query
stringlengths
9
43.3k
document
stringlengths
17
1.17M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Return an array of files with their full paths contained in a directory and its subdirectories
public function directoryFiles($path) { $contents = []; // Scan directory $directoryFiles = scandir($path); foreach ($directoryFiles as $index => $filePath) { // Ommit . and .. if ( ! in_array($filePath, ['.', '..'])) { // Check if this is a directory if (is_dir($path . DIRECTORY_SEPARATOR . $filePath)) { // Rescan and get files in this directory $contents = array_merge($contents, self::directoryFiles($path . DIRECTORY_SEPARATOR . $filePath)); } else { // Add file to contens array $contents[] = $path . DIRECTORY_SEPARATOR . $filePath; } } } return $contents; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function papi_get_all_files_in_directory( $directory = '' ) {\n\t$result = [];\n\n\tif ( empty( $directory ) || ! is_string( $directory ) ) {\n\t\treturn $result;\n\t}\n\n\tif ( file_exists( $directory ) && $handle = opendir( $directory ) ) {\n\t\twhile ( false !== ( $file = readdir( $handle ) ) ) {\n\t\t\tif ( ! in_array( $file, ['..', '.'] ) ) {\n\t\t\t\tif ( is_dir( $directory . '/' . $file ) ) {\n\t\t\t\t\t$result = array_merge( $result, papi_get_all_files_in_directory( $directory . '/' . $file ) );\n\t\t\t\t} else {\n\t\t\t\t\t$file = $directory . '/' . $file;\n\t\t\t\t\t$result[] = preg_replace( '/\\/\\//si', '/', $file );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tclosedir( $handle );\n\t}\n\n\treturn $result;\n}", "function getFiles($dir) {\n\t$files = array();\n\t$dh = opendir($dir);\n\twhile (($file = readdir($dh)) !== false) {\n\t\t$path = $dir . $file;\n\t\tif (!is_dir($path)) {\n\t\t\t$files[] = $path;\n\t\t}\n\t\telseif (is_dir($path) && basename($path) != \".\" && basename($path) != \"..\") {\n\t\t\t$files = array_merge($files, getFiles($path . \"/\"));\n\t\t}\n\t}\n\tclosedir($dh);\n\treturn $files;\n}", "function getFiles($dir = \".\")\r\n{\r\n $files = array();\r\n if ($handle = opendir($dir)) {\r\n while (false !== ($item = readdir($handle))) {\r\n if (is_file(\"$dir/$item\")) {\r\n $files[] = \"$dir/$item\";\r\n } elseif (is_dir(\"$dir/$item\") && ($item != \".\") && ($item != \"..\")) {\r\n $files = array_merge($files, getFiles(\"$dir/$item\"));\r\n }\r\n }\r\n closedir($handle);\r\n }\r\n return $files;\r\n}", "function getFilesFromDir($dir) { \n\n $files = array(); \n if ($handle = opendir($dir)) { \n while (false !== ($file = readdir($handle))) { \n if ($file != \".\" && $file != \"..\") { \n if(is_dir($dir.'/'.$file)) { \n $dir2 = $dir.'/'.$file; \n $files[] = getFilesFromDir($dir2); \n } \n else { \n $files[] = $dir.'/'.$file; \n } \n } \n } \n closedir($handle); \n } \n\n return $files; \n}", "public function getFiles()\n {\n $result = array();\n foreach ($this->_subdirectories as $directory) {\n $result = array_merge(\n $result,\n array_map(\n array($this, '_prependDirectory'),\n $directory->getFiles()\n )\n );\n }\n $result = array_merge(\n $result,\n array_map(\n array($this, '_prependDirectory'),\n array_keys($this->_files)\n )\n );\n return $result;\n }", "function getFilesInDir($dirname, $path_return = ''){\n if( !is_dir($dirname) ){\n return false;\n }\n // On ouvre le dossier\n $dir = opendir($dirname);\n // Init du tableau\n $files = array();\n // On liste les fichier\n while($file = readdir($dir)){\n if($file != '.' && $file != '..' && !is_dir($dirname.$file) && $file != ' '){\n $files[$file] = $path_return . $file;\n }\n }\n // On ferme le dossier\n closedir($dir);\n // On retourne les fichiers\n return $files;\n}", "function getFilesRecursively($rootPath, $fullPath = false) {\n if (! is_dir($rootPath)) {\n return array();\n }\n\n $dirs = scandir($rootPath);\n if (false === $dirs) {\n return array();\n }\n\n $return = array();\n\n $temps = array();\n foreach ($dirs as $dir) {\n if ($dir == '.' || $dir == '..') continue;\n $temps[] = realpath($rootPath .'/'. $dir);\n }\n $dirs = $temps;\n\n do {\n $new_dirs = array();\n\n foreach ($dirs as $dir) {\n if (is_dir($dir)) {\n $temps = scandir($dir);\n\n if (false !== $temps) {\n foreach ($temps as $temp) {\n if ('.' == $temp || '..' == $temp) continue;\n\n $new_dirs[] = $dir .'/'. $temp;\n }\n }\n }\n\n if (is_file($dir)) {\n $return[] = realpath($dir);\n }\n }\n\n $dirs = $new_dirs;\n\n } while (count($dirs) > 0);\n\n if (false === $fullPath) {\n foreach ($return as $index => $path) {\n $return[$index] = basename($path);\n }\n }\n\n return $return;\n}", "function getLocalFolderFiles($path) {\n $result = array();\n if ($dh = dir($path)) {\n while (FALSE !== ($file = $dh->read())) {\n if ($file != '.' && $file != '..' &&\n !is_dir($path.'/'.$file)) {\n $result[$file] = $file;\n }\n }\n }\n return $result;\n }", "function listFolderFiles($dir, $updir = \"\", $array = array()){\n $ffs = scandir($dir);\n foreach($ffs as $ff){\n if($ff != '.' && $ff != '..' ){\n if(count(explode(\".\", $ff))!=1){\n $array[]=$updir.explode(\".\", $ff)[0];\n }\n else {\n $array = listFolderFiles($dir.\"/\".$ff, $updir .$ff.\"/\", $array);\n }\n }\n }\n return $array;\n}", "function file_array($path, $exclude = \".|..\", $recursive = false) {\n $path = rtrim($path, \"/\") . \"/\";\n $folder_handle = opendir($path);\n $exclude_array = explode(\"|\", $exclude);\n $result = array();\n while(false !== ($filename = readdir($folder_handle))) {\n if(!in_array(strtolower($filename), $exclude_array)) {\n if(is_dir($path . $filename . \"/\")) {\n if($recursive) $result[] = file_array($path, $exclude, true);\n } else {\n $result[] = $filename;\n }\n }\n }\n return $result;\n}", "protected function _getFilesRecursive($dir)\n\t{\n\t\t$files = array();\n\t\tforeach (scandir($dir) as $f) {\n\t\t\tif ($f !== '.' and $f !== '..') {\n\t\t\t\tif (is_dir(\"$dir/$f\")) {\n\t\t\t\t\t$files = array_merge($files, $this->_getFilesRecursive(\"$dir/$f\"));\n\t\t\t\t} else {\n\t\t\t\t\t$files[] = $dir.'/'.$f;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $files;\n\t}", "private function allFilesRecursively($nativePath) {\n\t\t\t$files = scandir($nativePath);\n\t\t\tif (!$files) throw new ServiceException(\"INVALID_PATH\", $this->path);\n\t\t\t\n\t\t\t$ignored = $this->ignoredItems($this->publicPath($nativePath));\n\t\t\t$result = array();\n\t\t\t\n\t\t\tforeach($files as $i => $name) {\n\t\t\t\tif (substr($name, 0, 1) == '.' || in_array(strtolower($name), $ignored))\n\t\t\t\t\tcontinue;\n\t\n\t\t\t\t$fullPath = self::joinPath($nativePath, $name);\n\t\t\t\tif (is_dir($fullPath)) {\n\t\t\t\t\t$result = array_merge($result, $this->allFilesRecursively($fullPath));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$result[] = $fullPath;\n\t\t\t}\n\t\t\treturn $result;\n\t\t}", "function findDirectoriesWithFiles($path, $pattern = '*') {\n $res = array();\n if(substr($path, -1) != '/') $path = $path.'/';\n foreach(glob($path.$pattern, GLOB_BRACE) as $file) {\n $res[] = dirname($file);\n }\n foreach(glob($path.'*', GLOB_ONLYDIR|GLOB_BRACE) as $file) {\n $res = array_merge($res, findDirectoriesWithFiles($file, $pattern));\n }\n return $res;\n}", "function sloodle_get_files($dir, $relative = true)\n {\n // Make sure we have a valid directory\n if (empty($dir)) return false;\n // Open the directory\n if (!is_dir($dir)) return false;\n if (!$dh = opendir($dir)) return false;\n \n // Go through each item\n $output = array();\n while (($file = readdir($dh)) !== false) {\n // Ignore anything starting with a . and anything which isn't a file\n if (strpos($file, '.') == 0) continue;\n $filetype = @filetype($dir.'/'.$file);\n if (empty($filetype) || $filetype != 'file') continue;\n \n // Store it\n if ($relative) $output[] = $file;\n else $output[] = $dir.'/'.$file;\n }\n closedir($dh);\n natcasesort($output);\n return $output;\n }", "function getFilesFromDir($dir) {\r\n $filesArray = scandir($dir);\r\n array_shift($filesArray);\r\n array_shift($filesArray);\r\n return $filesArray;\r\n}", "public static function getFiles($path)\n {\n $rii = new \\RecursiveIteratorIterator(new \\RecursiveDirectoryIterator($path));\n $files = [];\n foreach ($rii as $file) {\n if ($file->isDir()) {\n continue;\n }\n $files[] = $file->getPathname();\n }\n\n return $files;\n }", "public function get_all_files( $dir ) {\n\t\t$files = array();\n\t\t$dir_iterator = new RecursiveDirectoryIterator( $dir );\n\t\t$iterator = new RecursiveIteratorIterator( $dir_iterator, RecursiveIteratorIterator::SELF_FIRST );\n\n\t\tforeach ( $iterator as $file ) {\n\t\t\t// Only return files that are no directory references or Mac resource forks.\n\t\t\tif ( $file->isFile() && ! in_array( $file->getBasename(), array( '..', '.' ) ) && ! stristr( $file->getPathname(), '__MACOSX' ) ) {\n\t\t\t\tarray_push( $files, $file->getPathname() );\n\t\t\t}\n\t\t}\n\n\t\treturn $files;\n\t}", "function getFiles(string $path): array\n{\n\tclearstatcache();\n\t$scanned_directory = array_diff(scandir($path), array('..', '.', '.DS_Store'));\n\treturn $scanned_directory;\n}", "public function getFilesFromDir($dir)\n {\n $di = new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS);\n $iterator = new RecursiveIteratorIterator($di);\n $iterator = new CallbackFilterIterator($iterator, [$this, 'filterPaths']);\n $result = [];\n foreach ($iterator as $file) {\n if (!in_array(pathinfo($file, PATHINFO_EXTENSION), $this->file_extensions)) {\n continue;\n }\n $result[] = $file;\n }\n return $result;\n }", "function directoryToArray($directory, $recursive) {\n $array_items = array();\n if ($handle = opendir($directory)) {\n while (false !== ($file = readdir($handle))) {\n if ($file != \".\" && $file != \"..\") {\n if (is_dir($directory. \"/\" . $file)) {\n if($recursive) {\n $array_items = array_merge($array_items, directoryToArray($directory. \"/\" . $file, $recursive));\n }\n } else {\n $file = $directory . \"/\" . $file;\n $array_items[] = preg_replace(\"/\\/\\//si\", \"/\", $file);\n }\n }\n }\n closedir($handle);\n }\n return $array_items;\n}", "function rd_do_dir($dir)\n{\n\t$out=array();\n\t$_dir=($dir=='')?'.':$dir;\n\t$dh=@opendir($_dir);\n\tif ($dh!==false)\n\t{\n\t\twhile (($file=readdir($dh))!==false)\n\t\t{\n\t\t\tif (!in_array($file,array('.','..','git','.svn','CVS','_vti_cnf')))\n\t\t\t{\n\t\t\t\tif (is_file($_dir.'/'.$file))\n\t\t\t\t{\n\t\t\t\t\t$path=$dir.(($dir!='')?'/':'').$file;\n\t\t\t\t\t$out[]=$path;\n\t\t\t\t} elseif (is_dir($_dir.'/'.$file))\n\t\t\t\t{\n\t\t\t\t\t$out=array_merge($out,rd_do_dir($dir.(($dir!='')?'/':'').$file));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn $out;\n}", "protected function getDirectoryFiles($directory)\n {\n $files = [];\n foreach (Finder::create()->files()->name('*.php')->in($directory) as $file) {\n $nesting = $this->getDirectoryNesting($file, $directory);\n $files[$nesting.basename($file->getRealPath(), '.php')] = $file->getRealPath();\n }\n return $files;\n }", "public function getFiles($fullPath = true)\n {\n // What information do we have to get?\n if ($fullPath === true) {\n $method = 'realpath';\n\n } else {\n $method = 'dirname';\n }\n\n // Collect the data.\n $result = array();\n foreach ($this->map as $file) {\n $result[] = $method($file['path']);\n }\n\n return $result;\n }", "function dirList($directory) \n{\n $results = array();\n // create a handler for the directory\n $handler = opendir($directory);\n // keep going until all files in directory have been read\n while ($file = readdir($handler)) {\n // if $file isn't this directory or its parent, \n // add it to the results array\n if ($file != '.' && $file != '..')\n $results[] = $directory.$file;\n }\n // tidy up: close the handler\n closedir($handler);\n // done!\n return $results;\n}", "function get_files ($folder, $include_subs = FALSE) {\n\tif(substr($folder, -1) == '/') {\n\t\t$folder = substr($folder, 0, -1);\n\t}\n\n\t// Make sure a valid folder was passed\n\tif(!file_exists($folder) || !is_dir($folder) || !is_readable($folder)) {\n\t\treturn FALSE;\n\t\texit();\n\t}\n\n\t// Grab a file handle\n\t$all_files = FALSE;\n\tif($handle = opendir($folder))\t{\n\t\t$all_files = array();\n\t\t// Start looping through a folder contents\n\t\twhile ($file = @readdir ($handle)) {\n\t\t\t// Set the full path\n\t\t\t$path = $folder.'/'.$file;\n\n\t\t\t// Filter out this and parent folder\n\t\t\tif($file != '.' && $file != '..') {\n\t\t\t\t// Test for a file or a folder\n\t\t\t\tif(is_file($path)) {\n\t\t\t\t\t$all_files[] = $path;\n\t\t\t\t} elseif (is_dir($path) && $include_subs) {\n\t\t\t\t\t// Get the subfolder files\n\t\t\t\t\t$subfolder_files = get_files ($path, TRUE);\n\n\t\t\t\t\t// Anything returned\n\t\t\t\t\tif ($subfolder_files) {\n\t\t\t\t\t\t$all_files = array_merge($all_files, $subfolder_files);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Cleanup\n\n\t\tclosedir($handle);\n\t}\n\t// Return the file array\n\t@sort($all_files);\n\treturn $all_files;\n}", "public function getAllFiles() {\n $files = [];\n\n foreach(scandir($this->dir) as $filename) {\n if($filename != '.' && $filename != '..') {\n $files[] = $this->getFileInfo($filename);\n }\n }\n\n return $files;\n }", "public function getFiles(DirectoryInterface $directory): array;", "protected function listFiles($dir) {\n $dir = file_stream_wrapper_uri_normalize($dir);\n $files = array();\n if ($items = scandir($dir)) {\n foreach ($items as $item) {\n if (is_file(\"$dir/$item\")) {\n $files[] = \"$dir/$item\";\n }\n }\n }\n return $files;\n }", "function find_all_files($dir) \n{ \n $files = array();\n foreach (glob($dir) as $file) {\n $files[] = $file;\n }\n return $files;\n}", "public function getFiles($subdir = '', $recursive = false)\n\t{\n\t\t$files = $this->adapter->listContents($subdir, $recursive);\n\t\t$out = array();\n\t\tforeach ($files as $file)\n\t\t{\n\t\t\t$out[] = $file->path;\n\t\t}\n\t\treturn $out;\n\t}" ]
[ "0.7470955", "0.74113894", "0.739653", "0.7379512", "0.73318774", "0.7309054", "0.7257001", "0.71673524", "0.7162255", "0.71231693", "0.7106282", "0.7070243", "0.7036096", "0.7017344", "0.6989162", "0.69792134", "0.6940224", "0.6939942", "0.6930784", "0.69298387", "0.6923743", "0.6875841", "0.6862709", "0.6853105", "0.68446845", "0.6832023", "0.6823228", "0.6816348", "0.6799952", "0.6792188" ]
0.79096025
0
A variant of the species grid control with just the flexible search species available.
protected static function get_control_searchspecies($auth, $args, $tabAlias, $options) { // build a list of the search species IDs $ttlIds=[]; foreach (self::$parentSampleAttrs['smpAttr:'.$args['search_species_transect_attr_id']]['default'] as $value) { $ttlIds[] = $value['default']; } if (empty($ttlIds)) return '<p>'.lang::get('Please fill in the search species on the front page.').'</p>'; // safety $args['list_id']=$args['extra_list_id']; $args['taxon_filter_field']='taxa_taxon_list_id'; $args['taxon_filter']=implode("\n", $ttlIds); $options['rowInclusionCheck']='alwaysFixed'; $options['id']='search-list'; unset($args['extra_list_id']); return parent::get_control_species($auth, $args, $tabAlias, $options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSearch () {\n\t\t$template['list'] = $this->cObj->getSubpart($this->templateCode,'###TEMPLATE_SEARCH###');\n\t\t$subpartArray = array();\n\t\t$markerArray = $this->helperGetLLMarkers(array(), $this->conf['search.']['LL'], 'search');\n\n\t\t// hide the radisus search by using a subpart\n\t\tif ($this->config['search']['radiusSearch'] != 1) {\n\t\t\t$subpartArray['###HIDE_RADIUSSEARCH###'] = '';\n\t\t}\n\n\t\t$markerArray['###DEFAULT_COUNTRY###'] = $this->config['defaultCountry']; // set the default country\n\t\t$markerArray['###DEFAULT_ZIP###'] = htmlspecialchars($this->piVars['zip']);\n\t\t$markerArray['###AUTOSUBMIT###'] = ($this->piVars['zip'] == '') ? '//' : '';\n\n\t\t// fetch the allowed categories as option list\n\t\t$markerArray['###CATEGORY###'] = $this->helperGetRecursiveCat($this->config['categories']);\n\n\t\t$content = $this->cObj->substituteMarkerArrayCached($template['list'], $markerArray, $subpartArray);\n\t\treturn $content;\n\t}", "public function getSpecies();", "function tpps_details_search(array $form, array $form_state) {\n $params = drupal_get_query_parameters();\n $form['details_type'] = array(\n '#type' => 'select',\n '#options' => array(\n 'title' => t('Title'),\n 'species' => t('Species'),\n 'accession' => t('Accession'),\n 'author' => t('Primary Author'),\n 'year' => t('Publication Year'),\n 'phenotype_name' => t('Phenotype Name'),\n 'phenotype_ontology' => t('Phenotype Ontology Name'),\n 'genotype_name' => t('Genotype Name'),\n 'genotype_marker' => t('Genotype Marker Type'),\n 'tags' => t('Tags'),\n ),\n '#ajax' => array(\n 'wrapper' => 'tpps-details-form',\n 'callback' => 'tpps_details_form_callback',\n ),\n '#prefix' => '<div id=\"tpps-details-form\">',\n '#default_value' => $params['type'] ?? NULL,\n );\n\n $ops = array(\n '~*' => '~*',\n 'LIKE' => 'LIKE',\n '=' => '=',\n );\n\n $form['details_op'] = array(\n '#type' => 'select',\n '#options' => $ops,\n '#default_value' => $params['op'] ?? NULL,\n );\n\n $form['details_value'] = array(\n '#type' => 'textfield',\n '#suffix' => '</div>',\n '#autocomplete_path' => 'tpps/autocomplete/project_title',\n '#default_value' => $params['value'] ?? NULL,\n );\n\n if (empty($form_state['values']['details_type'])) {\n $form_state['values']['details_type'] = $params['type'] ?? NULL;\n }\n\n if (!empty($form_state['values']['details_type'])) {\n switch ($form_state['values']['details_type']) {\n case 'title':\n $form['details_value']['#autocomplete_path'] = 'tpps/autocomplete/project_title';\n break;\n\n case 'species':\n $form['details_value']['#autocomplete_path'] = 'tpps/autocomplete/species';\n break;\n\n case 'accession':\n $form['details_value']['#autocomplete_path'] = 'tpps/autocomplete/project_accession';\n break;\n\n case 'author':\n $form['details_value']['#autocomplete_path'] = 'tpps/autocomplete/author';\n break;\n\n case 'phenotype_name':\n $form['details_value']['#autocomplete_path'] = 'tpps/autocomplete/phenotype';\n break;\n\n case 'phenotype_ontology':\n $form['details_value']['#autocomplete_path'] = 'tpps/autocomplete/phenotype_ontology';\n break;\n\n case 'genotype_name':\n $form['details_value']['#autocomplete_path'] = 'tpps/autocomplete/genotype';\n break;\n\n case 'genotype_marker':\n $form['details_value']['#autocomplete_path'] = 'tpps/autocomplete/genotype_marker';\n break;\n\n default:\n $form['details_value']['#autocomplete_path'] = NULL;\n break;\n }\n }\n\n $form['details_search'] = array(\n '#type' => 'button',\n '#button_type' => 'button',\n '#value' => t('Search'),\n );\n\n $form['reset_button'] = array(\n '#markup' => '<button class=\"btn btn-primary form-button\" type=\"reset\"/>Reset</button>',\n ); \n\n $form['#attributes'] = array(\n 'style' => 'text-align:center',\n );\n\n return $form;\n}", "public function action_search()\n\t{\n\t\t$price_min = array();\n\t\tfor ($i=100000; $i<=10000000; $i += 100000) {\n\t\t\t$price_min[$i] = '$ '.number::humanReadable($i);\n\t\t\tif ($i >= 1000000) $i += 400000;\n\t\t}\n\t\t$price_max = $price_min;\n\t\tarr::unshift($price_min, '', 'Minimum');\n\t\tarr::unshift($price_max, '', 'Maximum');\n\n\t\t// Setting types\n\t\t$types = ORM::factory('type')->find_all()->as_array('id', 'name');\n\t\tarr::unshift($types, '', '-- Select --');\n\t\t\n\t\t// Setting cities\n\t\t$cities = ORM::factory('city')->find_all()->as_array('id', 'name');\n\t\tarr::unshift($cities, '', '-- Select --');\n\t\t\n\t\t$this->template->content = new View('admin/property/search');\n\t\t$this->template->content->title = ucwords($this->_type).' Search';\n\t\t$this->template->content->types = $types;\n\t\t$this->template->content->cities = $cities;\n\t\t$this->template->content->price_min = $price_min;\n\t\t$this->template->content->price_max = $price_max;\n\t\t$this->template->content->post = array('type_id' => '', 'city_id' => '', 'pmin' => '', 'pmax' => '');\n\n\t\tif ( ! empty($_GET))\n\t\t{\n\t\t\t$this->template->content->results = new View('admin/property/read');\n\t\t\t$this->template->content->results->title = 'Search Results';\n\t\t\t$this->action_index(TRUE);\n/*\t\t\t$this->template->content->results->data = Model_Property::get_list(0, 1, false, 'desc');*/\n\t\t}\n\t}", "public function action_search()\n\t{\n\t\t$price_min = array();\n\t\tfor ($i=100000; $i<=10000000; $i += 100000) {\n\t\t\t$price_min[$i] = '$ '.number::humanReadable($i);\n\t\t\tif ($i >= 1000000) $i += 400000;\n\t\t}\n\t\t$price_max = $price_min;\n\t\tarr::unshift($price_min, '', 'Minimum');\n\t\tarr::unshift($price_max, '', 'Maximum');\n\n\t\t// Setting types\n\t\t$types = ORM::factory('type')->find_all()->as_array('id', 'name');\n\t\tarr::unshift($types, '', '-- Select --');\n\t\t\n\t\t// Setting cities\n\t\t$cities = ORM::factory('city')->find_all()->as_array('id', 'name');\n\t\tarr::unshift($cities, '', '-- Select --');\n\t\t\n\t\t$this->template->content = new View('admin/property/search');\n\t\t$this->template->content->title = 'Property Search';\n\t\t$this->template->content->types = $types;\n\t\t$this->template->content->cities = $cities;\n\t\t$this->template->content->price_min = $price_min;\n\t\t$this->template->content->price_max = $price_max;\n\t\t$this->template->content->post = array('type_id' => '', 'city_id' => '', 'pmin' => '', 'pmax' => '');\n\n\t\tif ( ! empty($_GET))\n\t\t{\n\t\t\t$this->template->content->results = new View('admin/property/read');\n\t\t\t$this->template->content->results->title = 'Search Results';\n\t\t\t$this->action_index(TRUE);\n\t\t}\n\t}", "public function searchprocessAction() {\n\t\t$this->_helper->ajaxgrid->setConfig ( ProductsAttributes::grid() )->search ();\n\t}", "public function specsearch()\n\t{\n\t\t//\n\t\t//\n\t\t$inputData = Input::All(); \n\t\tvar_dump($inputData);\n\t\t$specialty = $inputData['title'];\n\t\t$zy=Flzhuanye::where('zymc','=',$specialty)->first();\n\t\t $schools = Zylb::search($specialty)->paginate(20);\n\t\t $ptzys= Tzy::distinct()->select('mkml','id')->where('tszy', '=', 0)->groupBy('mkml')->get();\n\t\t $tszys= Tzy::distinct()->select('mkml','id')->where('tszy', '=', 1)->groupBy('mkml')->get();\n\t\n\t\t//return \\View::make('colleges.search.index')->with('colleges',$colleges)\n // ->with('provinces',$provinces);\n $provinces= Province::All();\n return \\View::make('specialties.search.show')->with('schools',$schools)\n ->with('provinces',$provinces)\n\t\t\t\t\t\t\t\t\t\t\t\t ->with('zy',$specialty)\n\t\t\t\t\t\t\t\t\t\t\t\t ->with('tszys',$tszys);\n\t}", "public function setSpecies($species);", "function sopac_search_form_adv() {\n $locum = sopac_get_locum();\n $locum_cfg = $locum->locum_config;\n $getvars = sopac_parse_get_vars();\n\n $actions = sopac_parse_uri();\n if ($actions[0] == \"search\") {\n if($actions[3]) { $actions[2] = $actions[2] . \"/\" . $actions[3]; urlencode($actions[2]); }\n $search_query = $actions[2];\n $stype_selected = $actions[1] ? 'cat_' . $actions[1] : 'cat_keyword';\n }\n $sformats = array('' => 'Everything');\n foreach ($locum_cfg[format_groups] as $sfmt => $sfmt_codes) {\n $sformats[preg_replace('/,[ ]*/', '|', trim($sfmt_codes))] = ucfirst($sfmt);\n }\n\n $stypes = array(\n 'cat_keyword' => 'Keyword',\n 'cat_title' => 'Title',\n 'cat_author' => 'Author',\n 'cat_series' => 'Series',\n 'cat_tags' => 'Tags',\n 'cat_reviews' => 'Reviews',\n 'cat_subject' => 'Subject',\n 'cat_callnum' => 'Call Number',\n 'cat_isn' => 'ISBN or ISSN',\n );\n\n $sortopts = array(\n '' => 'Relevance',\n 'atoz' => 'Alphabetical A to Z',\n 'ztoa' => 'Alphabetical Z to A',\n 'catalog_newest' => 'Just Added',\n 'newest' => 'Pub date: Newest',\n 'oldest' => 'Pub date: Oldest',\n 'author' => 'Alphabetically by Author',\n 'top_rated' => 'Top Rated Items',\n 'popular_week' => 'Most Popular this Week',\n 'popular_month' => 'Most Popular this Month',\n 'popular_year' => 'Most Popular this Year',\n 'popular_total' => 'All Time Most Popular',\n );\n\n // Initialize the form\n $form = array(\n '#attributes' => array('class' => 'search-form'),\n '#validate' => array('sopac_search_catalog_validate'),\n '#submit' => array('sopac_search_catalog_submit'),\n );\n\n $form['search_query'] = array(\n '#type' => 'textfield',\n '#title' => t('Search term or phrase'),\n '#default_value' => $search_query,\n '#size' => 50,\n '#maxlength' => 255,\n );\n\n $form['search_type'] = array(\n '#type' => 'select',\n '#title' => t('Search by'),\n '#default_value' => $stype_selected,\n '#options' => $stypes,\n );\n $form['sort'] = array(\n '#type' => 'select',\n '#title' => t('Sorted by'),\n '#default_value' => '',\n '#options' => $sortopts,\n );\n $form['age_group'] = array(\n '#type' => 'select',\n '#title' => 'in age group',\n '#options' => array('' => \"Any Age Group\", 'adult' => \"Adult\", 'teen' => \"Teen\", 'youth' => \"Youth\"),\n );\n $form['limit_avail'] = array(\n '#type' => 'select',\n '#title' => 'limit to items on shelf at',\n '#options' => array_merge(array('' => '--', 'any' => \"Any Location\"), $locum_cfg['branches']),\n '#default_value' => $getvars['limit_avail'],\n '#suffix' => \"</div>\",\n );\n if (count($locum_cfg[collections])) {\n foreach ($locum_cfg[collections] as $loc_collect_key => $loc_collect_var) {\n $loc_collect[$loc_collect_key] = $loc_collect_key;\n }\n\n $form['collection'] = array(\n '#type' => 'select',\n '#title' => t('In these collections'),\n '#size' => 5,\n '#default_value' => $getvars[collection],\n '#options' => $loc_collect,\n '#multiple' => TRUE,\n );\n }\n\n asort($locum_cfg[formats]);\n $form['search_format'] = array(\n '#type' => 'select',\n '#title' => t('In these formats'),\n '#size' => 5,\n '#default_value' => $getvars[search_format],\n '#options' => $locum_cfg[formats],\n '#multiple' => TRUE,\n );\n $form['publisher'] = array(\n '#type' => 'textfield',\n '#title' => t('Publisher'),\n '#size' => 20,\n '#maxlength' => 255,\n );\n $form['pub_year_start'] = array(\n '#type' => 'textfield',\n '#title' => t('Published year between'),\n '#size' => 20,\n '#maxlength' => 255,\n );\n $form['pub_year_end'] = array(\n '#type' => 'textfield',\n '#title' => t('and'),\n '#size' => 20,\n '#maxlength' => 255,\n );\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Search'),\n );\n $form['clear'] = array(\n '#name' => 'clear',\n '#type' => 'button',\n '#value' => t('Reset'),\n '#attributes' => array('onclick' => 'this.form.reset(); return false;'),\n );\n return $form;\n}", "function voyage_mikado_load_search_template() {\n\t\tglobal $voyage_mikado_IconCollections;\n\n\t\t$search_type = voyage_mikado_options()->getOptionValue('search_type');\n\n\t\t$search_icon = '';\n\t\tif(voyage_mikado_options()->getOptionValue('search_icon_pack') !== '') {\n\t\t\t$search_icon = $voyage_mikado_IconCollections->getSearchIcon(voyage_mikado_options()->getOptionValue('search_icon_pack'), true);\n\t\t}\n\n\t\t$parameters = array(\n\t\t\t'search_in_grid' => voyage_mikado_options()->getOptionValue('search_in_grid') == 'yes' ? true : false,\n\t\t\t'search_icon' => $search_icon,\n\t\t);\n\n\t\tvoyage_mikado_get_module_template_part('templates/types/'.$search_type, 'search', '', $parameters);\n\n\t}", "protected function grid()\n\t{\n\t\t$grid = new Grid(new NativePlaceRegion);\n\t $grid->model()->where('parentid', '=', 0);\n\t\t$grid->paginate(40);\n\t\t\n\t\t$grid->region_id('地区id')->sortable();\n\t\t$grid->parentid('上级地区id')->sortable();\n\t\t$grid->region_name('地区名称');\n\t\t$grid->have_children('是否有更下级地区');\n\t\t\n\t\t// filter($callback)方法用来设置表格的简单搜索框\n\t\t$grid->filter(function ($filter) {\n\t\t\t$filter->disableIdFilter();\n\t\t\t$filter->like('region_name', '地区名称');\n\t\t});\n\t\t\n\t\treturn $grid;\n\t}", "function display_search_field() {\n return $this->display_field(0, 'asearchtemplate');\n }", "protected function grid() {\n\t\t$grid = new Grid(new Country);\n\n\t\t$grid->filter(function ($filter) {\n\t\t\t$filter->disableIdFilter();\n\n\t\t\t$filter->column(3 / 4, function ($filter) {\n\t\t\t\t$continents = Continent::where('parent_id', '0')->pluck('cn_name', 'id');\n\t\t\t\t$filter->expand()->equal('continent_id', '大洲')->select($continents);\n\t\t\t\t$filter->expand()->where(function ($query) {\n\t\t\t\t\t$query->where('cname', 'like', \"%{$this->input}%\")\n\t\t\t\t\t\t->orWhere('full_cname', 'like', \"%{$this->input}%\")\n\t\t\t\t\t\t->orWhere('name', 'like', \"%{$this->input}%\")\n\t\t\t\t\t\t->orWhere('country_code', 'like', \"%{$this->input}%\");\n\t\t\t\t\t// $query->whereHas('country', function ($query){\n\t\t\t\t\t// $query->where('cname', 'like', \"%{$this->input}%\");\n\t\t\t\t\t// });\n\t\t\t\t}, '关键字');\n\t\t\t});\n\t\t});\n\n\t\t$grid->selector(function (Grid\\Tools\\Selector $selector) {\n\t\t\t$selector->select('continent_id', '洲名', [\n\t\t\t\t1 => '亚洲',\n\t\t\t\t2 => '美洲',\n\t\t\t\t3 => '非洲',\n\t\t\t\t4 => '大洋洲',\n\t\t\t\t5 => '南极洲',\n\t\t\t\t6 => '北美洲',\n\t\t\t\t7 => '南美洲',\n\t\t\t]);\n\t\t\t$selector->select('promotion', '推荐', [\n\t\t\t\t0 => '未推荐',\n\t\t\t\t1 => '推荐',\n\t\t\t]);\n\t\t});\n\n\t\t$grid->column('id', __('Id'));\n\t\t// $grid->column('continent_id', __('洲 id'));\n\t\t$grid->column('cname', __('中文名'));\n\t\t$grid->column('continent.cn_name', '洲名');\n\t\t$grid->continentlocation('地理位置')->pluck('cn_name')->label('danger');\n\t\t$grid->column('name', __('英文名称'));\n\t\t// $grid->column('lower_name', __('小写'))->limit(10);\n\t\t$grid->column('country_code', __('国家地区代码'))->limit(10);\n\t\t// $grid->column('full_name', __('英文全称'))->limit(10);\n\t\t$grid->column('full_cname', __('中文全称'))->limit(10);\n\t\t// $grid->column('remark', __('概况'))->limit(30);\n\t\t$grid->column('is_island', __('海岛'))->bool();\n\t\t$states = [\n\t\t\t'on' => ['value' => 1, 'text' => '是', 'color' => 'primary'],\n\t\t\t'off' => ['value' => 0, 'text' => '否', 'color' => 'default'],\n\t\t];\n\t\t$grid->column('promotion', __('推荐'))->switch($states);\n\t\t$grid->column('active', __('激活'))->switch($states);\n\t\t// $grid->column('created_at', __('Created at'));\n\t\t// $grid->column('updated_at', __('Updated at'));\n\n\t\treturn $grid;\n\t}", "public function search(){\n //includes google maps script for place autocomplete and to get experiences\n \t$this->set('jsIncludes',array('http://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&language=fr&libraries=places','places_autocomplete','get_experiences','logo_fly','jquery.dropdown','cookies'));\n \n //sets motives, schools and departments by alphbetical order\n $this->__set_motives_schools_and_departments();\n }", "function sopac_search_form_basic() {\n\n $locum = sopac_get_locum('locum');\n $locum_cfg = $locum->locum_config;\n $getvars = sopac_parse_get_vars();\n\n $actions = sopac_parse_uri();\n if ($actions[0] == \"search\") {\n if ($actions[3]) {\n $actions[2] = $actions[2] . \"/\" . $actions[3];\n urlencode($actions[2]);\n }\n $search_query = $actions[2];\n $stype_selected = $actions[1] ? 'cat_' . $actions[1] : 'cat_keyword';\n }\n $sformats = array('' => 'Everything');\n foreach ($locum_cfg[format_groups] as $sfmt => $sfmt_codes) {\n $sformats[preg_replace('/,[ ]*/', '|', trim($sfmt_codes))] = ucfirst($sfmt);\n }\n\n $stypes = array(\n 'cat_keyword' => t('Keyword'),\n 'cat_title' => t('Title'),\n 'cat_author' => t('Author'),\n 'cat_series' => t('Series'),\n 'cat_tags' => t('Tags'),\n 'cat_reviews' => t('Reviews'),\n 'cat_subject' => t('Subject'),\n 'cat_callnum' => t('Call Number'),\n );\n\n $sortopts = array(\n 'relevance' => t('Relevance'),\n 'newest' => t('Newest First'),\n 'oldest' => t('Oldest First'),\n );\n\n $sformats = array('' => 'Everything');\n foreach ($locum_cfg['format_groups'] as $sfmt => $sfmt_codes) {\n $sformats[preg_replace('/,[ ]*/', '|', trim($sfmt_codes))] = ucfirst($sfmt);\n }\n if (is_null($prompt)) {\n $prompt = t('Enter your keywords');\n }\n\n // Initialize the form\n $form = array(\n '#attributes' => array('class' => 'search-form'),\n '#validate' => array('sopac_search_catalog_validate'),\n '#submit' => array('sopac_search_catalog_submit'),\n );\n // Start creating the basic search form\n $form['inline'] = array(\n '#prefix' => '<div class=\"basic-search-inline\">',\n '#suffix' => '</div>'\n );\n $form['inline']['search_query'] = array(\n '#type' => 'textfield',\n '#default_value' => $search_query,\n '#size' => 25,\n '#maxlength' => 255,\n '#attributes' => array('x-webkit-speech' => 'true'),\n );\n $form['inline']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Search'),\n );\n\n $form['filters'] = array(\n '#prefix' => '<div id=\"filters\">',\n '#suffix' => '</div>'\n );\n $form['filters']['search_type'] = array(\n '#type' => 'select',\n '#title' => t('Search By'),\n '#default_value' => $stype_selected,\n '#options' => $stypes,\n );\n $form['filters']['search_format'] = array(\n '#type' => 'select',\n '#title' => t('Material'),\n '#default_value' => $_GET['search_format'],\n '#selected' => $_GET['search_format'],\n '#options' => $sformats,\n );\n $form['filters']['limit_avail'] = array(\n '#type' => 'select',\n '#title' => 'On Shelf At',\n '#options' => array_merge(array('' => '--', 'any' => \"Any Location\"), $locum_cfg['branches']),\n '#default_value' => $getvars['limit_avail'],\n );\n $form['advanced'] = array(\n '#value' => '<div class=\"basic-search-links\">' .\n l(\"Advanced Search\", variable_get('sopac_url_prefix', 'cat/seek') . '/advanced') .\n '&nbsp;|&nbsp;' .\n l(\"Search Tips\", variable_get('sopac_url_prefix', 'cat/seek') . '/tips') .\n '</div>',\n );\n\n return $form;\n}", "function fluid_edge_get_search() {\n fluid_edge_load_search_template();\n }", "function tpps_details_species(array &$state) {\n $query = db_select('chado.organism', 'o');\n $query->join('chado.pub_organism', 'po', 'o.organism_id = po.organism_id');\n $query->join('chado.project_pub', 'pp', 'pp.pub_id = po.pub_id');\n $query->fields('o', array('organism_id', 'genus', 'species', 'common_name'));\n $query->condition('pp.project_id', $state['ids']['project_id']);\n $query = $query->execute();\n $rows = array();\n\n while (($result = $query->fetchObject())) {\n $id = $result->organism_id;\n $common_name = $result->common_name;\n $family = $order = \"\";\n\n if (tpps_chado_prop_exists('organism', $id, 'family')) {\n $family = db_select('chado.organismprop', 'o')\n ->fields('o', array('value'))\n ->condition('organism_id', $id)\n ->condition('type_id', tpps_load_cvterm('family')->cvterm_id)\n ->execute()->fetchObject()->value;\n }\n\n if (tpps_chado_prop_exists('organism', $id, 'order')) {\n $order = db_select('chado.organismprop', 'o')\n ->fields('o', array('value'))\n ->condition('organism_id', $id)\n ->condition('type_id', tpps_load_cvterm('order')->cvterm_id)\n ->execute()->fetchObject()->value;\n }\n\n if (empty($common_name) and tpps_chado_prop_exists('organism', $id, 'common name')) {\n $common_name = db_select('chado.organismprop', 'o')\n ->fields('o', array('value'))\n ->condition('organism_id', $id)\n ->condition('type_id', tpps_load_cvterm('common name')->cvterm_id)\n ->execute()->fetchObject()->value;\n }\n\n $name = \"{$result->genus} {$result->species}\";\n $link = tpps_entity_link($id, $name, 'Organism');\n $rows[$name] = array(\n $order,\n $family,\n $link,\n $common_name,\n );\n }\n \n $vars = array(\n 'header' => array(\n 'Order',\n 'Family',\n 'Species',\n 'Common Name',\n ),\n 'rows' => $rows,\n 'attributes' => array(\n 'class' => array('view'),\n 'id' => 'tpps_table_display',\n ),\n 'caption' => '',\n 'colgroups' => NULL,\n 'sticky' => FALSE,\n 'empty' => '',\n );\n return theme('table', $vars);\n}", "public function search()\r\n {\r\n $this->setTpl('search.htm');\r\n $this->setControllerTitle('Apollo');\r\n $this->setCurrentControllerName('Rechecher une condition');\r\n }", "public function searchCarte()\n {\n $this->utils->Restreindre($this->userConnecter->admin, $this->utils->Est_autoriser(40, $this->userConnecter->profil));\n $data['lang'] = $this->lang->getLangFile($this->getSession()->getAttribut('lang'));\n $params = array('view' => 'compte/search-carte');\n $this->view($params, $data);\n }", "protected function searchResults(SpecimensSelfFormFilter $form, sfWebRequest $request)\n {\n if($request->getParameter('searchSpecimen','') !== '')\n {\n // Bind form with data contained in searchExpedition array\n $form->bind($request->getParameter('searchSpecimen'));\n // Test that the form binded is still valid (no errors)\n\n if ($form->isValid())\n {\n // Define all properties that will be either used by the data query or by the pager\n // They take their values from the request. If not present, a default value is defined\n $query = $form->getQuery()->orderby($this->orderBy . ' ' . $this->orderDir);\n // Define in one line a pager Layout based on a pagerLayoutWithArrows object\n // This pager layout is based on a Doctrine_Pager, itself based on a customed Doctrine_Query object (call to the getExpLike method of ExpeditionTable class)\n $this->pagerLayout = new PagerLayoutWithArrows(new DarwinPager($query,\n $this->currentPage,\n $form->getValue('rec_per_page')\n ),\n new Doctrine_Pager_Range_Sliding(array('chunk' => $this->pagerSlidingSize)),\n $this->getController()->genUrl($this->s_url.$this->o_url).'/page/{%page_number}'\n );\n // Sets the Pager Layout templates\n $this->setDefaultPaggingLayout($this->pagerLayout);\n // If pager not yet executed, this means the query has to be executed for data loading\n if (! $this->pagerLayout->getPager()->getExecuted())\n $this->specimens = $this->pagerLayout->execute();\n\n\n $specs = array();\n foreach($this->specimens as $specimen)\n {\n $specs[$specimen->getId()] = $specimen->getId();\n }\n $specCodes = Doctrine::getTable('Codes')->getCodesRelatedArray('specimens', $specs);\n $this->codes = array();\n foreach($specCodes as $code)\n {\n if(! isset($this->codes[$code->getRecordId()]) )\n $this->codes[$code->getRecordId()] = array();\n $this->codes[$code->getRecordId()][] = $code;\n }\n }\n }\n }", "public function basicSearch(){\n\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\t$SearchNameOrganisme = $this->_getParam('Basicseacrhname');\n\t\t\t\t\t\t\tif(strlen(trim($SearchNameOrganisme))>0){\n\t\t\t\t\t\t\t\tif(get_magic_quotes_gpc()){\n\t\t\t\t\t\t\t\t\t$SearchNameOrganisme = stripslashes($SearchNameOrganisme);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$SearchNameOrganisme = mysql_real_escape_string($SearchNameOrganisme);\n\t\t\t\t\t\t\t\t$ShowingBasicSearch = $this->GetModelOrganize->searchbasic($SearchNameOrganisme);\n\t\t\t\t\t\t\t\t$this->view->getfivetable = $ShowingBasicSearch;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$getAllDataToview = $this->GetModelOrganize->selectAllDataForOrganismeMenu ();\n\t\t\t\t\t\t\t\t$this->view->getfivetable = $getAllDataToview;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t}catch (ErrorException $ex){\n\t\t\t\t\t\t\techo \"Message:\".$ex->getMessage();\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "public function showGrid($fast_search=false)\n {\n //fazer paginação, tenho a classe no mwork/lib\n //$objects = DB::getObjects(\"SELECT {$this->sqlColumns} FROM usuarios\");\n $table = $this->model->getTable();\n \n if (!$this->actions)\n {\n $this->addAction('Ver', $this->viewImage, 'info'); // js func // parameter \n $this->addAction('Editar', $this->editImage, 'edit', array($this->model->getPrimaryKey()), 'showContent', array('conteudo'));\n $this->addAction('Deletar', $this->deleteImage, 'delete');\n }\n \n $objects = new stdClass();\n \n $objects = DB::getObjects($this->getSql());\n \n if(!$fast_search)\n {\n $grid = '<div id =\"' . $this->gridId . '\" > <table width=\"100%\">';\n \n }\n if ($objects)\n {\n if(!$fast_search)\n { \n $grid.='<thead>';\n $gridLabels = '';\n $gridInputs = '';\n foreach ($this->columns as $columnTable => $column)\n {\n $align = $column->parameters[1] ? $column->parameters[1] : 'center';\n $width = $column->parameters[0] ? $column->parameters[0].'%' : ''; \n if($column->relation && !preg_match('/like/', $columnTable)) \n { \n $ref_column = explode('=', $column->relation);\n \n foreach($ref_column as $ref)\n {\n if(preg_match(\".$table.\", $ref))\n {\n $ref_column = explode('.',$ref);\n $ref_column = $ref_column[1];\n break;\n } \n }\n \n $newColumnTable = ''; \n $newColumnTable = str_replace('::','.', $columnTable);\n \n $tableColumn = explode('.', $newColumnTable);\n $tableColumn = $tableColumn[0];\n $tableColumn = trim($tableColumn);\n $ref_column = trim($ref_column);\n \n unset($modelTable);\n $modelTable = $this->MCore->getModelFromTable($tableColumn);\n unset($combo);\n $combo = new MCombo($modelTable->getArray()); \n $combo->setName($tableColumn.'::'.$ref_column.'::'.'=');\n $combo->setId($tableColumn.'::'.$ref_column.'::'.'='); \n $gridInputs .= \"<td align='{$align}' width='{$width}'> \".$combo->show().\" </td>\";\n }\n else\n {\n unset($input);\n $input = new MText();\n $input->setName($columnTable.'::'.'like');\n $gridInputs .= \"<td align='$align' width='{$width}'> \".$input->show().\" </td>\";\n }\n $gridLabels.=\"<td align='{$align}' width='{$width}'> {$column->label} </td>\";\n }\n \n $grid.=\"<tr> {$gridLabels} </tr>\";\n $grid.=\"<tr class='filters-grid'> {$gridInputs} </tr> \";\n $grid.='</thead> <tbody id=\"tbody_'.$this->gridId.'\">';\n }\n \n foreach ($objects as $object)\n {\n $grid.= '<tr>';\n \n foreach ($this->columns as $key => $value)\n {\n $objKey = '';\n if(preg_match('/\\|/',$key))\n { \n $key = explode('|', $key);\n $objKey = trim($key[1]);\n }\n else\n {\n $key = explode('::', $key); \n $objKey = trim($key[1]);\n }\n \n $grid.='<td align=\"center\">' . $object->{$objKey} . '</td>';\n }\n \n foreach ($this->actions as $objAction)\n {\n $params= null;\n if ($objAction->params)\n {\n $params= null;\n foreach ($objAction->params as $actionParam)\n {\n if ($object->{$actionParam})\n {\n $params.= $object->{$actionParam} . ',';\n }\n else\n {\n $params.= $actionParam . ',';\n }\n \n }\n $params = substr($params, 0, -1);\n $params = '(' . $params . ')';\n }\n else\n {\n $params = '()';\n }\n $action = null; \n $action = $objAction->action . $params;\n $jsParams = null;\n if ($objAction->jsParams)\n { \n $jsParams = \"'{$action}',\";\n\n foreach ($objAction->jsParams as $actionJsParam)\n {\n $jsParams .= \"'{$actionJsParam}',\";\n }\n $jsParams = substr($jsParams, 0, -1);\n $jsParams = \"({$jsParams})\";\n }\n else\n {\n $jsParams = \"('{$action}')\";\n }\n \n $grid.=\"<td align='center' width='15'> <img class='grid_img_action' src='{$objAction->icon}' title='{$objAction->title}' onclick = \\\"{$objAction->jsFunction}{$jsParams}\\\"/> </td>\";\n }\n\n $grid.= '</tr>';\n }\n }\n else\n {\n $grid.='<tr> <td> Nothing found </td> </tr>';\n }\n \n if(!$fast_search)\n {\n $grid.='</tbody> </table></div>'; \n echo \" <script>\n $('#{$this->gridId}').keyup(function(e)\n { \n if(e.keyCode == 13) \n {\n var objsFilter = $('.filters-grid').find('input,select'); \n ajaxSubmitObjs('{$this->listControlName}::search(1)','tbody_{$this->gridId}',objsFilter);\n return true;\n }\n });\n\n $('#{$this->gridId}').find('select').change(function(e)\n { \n var objsFilter = $('.filters-grid').find('input,select'); \n ajaxSubmitObjs('{$this->listControlName}::search(1)','tbody_{$this->gridId}',objsFilter);\n return true;\n });\n\n </script>\";\n }\n echo $grid;\n \n \n }", "function test_general_entries_search_on_dynamic_field_values() {\n\t\t// Single word is searched. One matching entry should be found.\n\t\t$search_string = 'Utah';\n\t\t$items = self::generate_and_run_search_query( 'all_field_types', $search_string );\n\t\t$msg = 'A general search for ' . $search_string . ' in entry metas table';\n\t\tself::run_entries_found_tests( $msg, $items, 1, array( 'steph_entry_key' ) );\n\t}", "protected function grid()\n {\n $grid = new Grid(new Specialization);\n\n $grid->id('Id');\n $grid->full_name('Полное найменование');\n $grid->short_name('Краткое найменование');\n $grid->code('Код специальности');\n $grid->cathedra_id('Кафедра')->using(Cathedra::all()->pluck('abbreviation', 'id')->toArray());\n $grid->created_at('Создано');\n $grid->updated_at('Обновлено');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new SiteModel);\n\n $grid->id('ID')->sortable();\n $grid->name('Site name')->sortable();\n $grid->url('Site URL')->link()->sortable();\n $grid->enable('Disabled')->sortable()->using(['1' => '', '0' => 'Disabled'])->badge('red');\n $grid->official('Official')->sortable()->using(['1' => 'Official', '0' => ''])->badge('blue');\n $grid->searcheable('Searcheable')->sortable()->using(['1' => 'Search OK', '0' => ''])->display(function($v1, \\Encore\\Admin\\Grid\\Column $column, $v3=1){\n if ($v1 != '') {\n return \"<span class='badge bg-green' title='aa'>$v1</span>\";\n }\n return '';\n });\n \n $grid->updated_at('Updated at')->sortable();\n \n $grid->filter(function ($filter) {\n $filter->like('name', 'Site name');\n $filter->like('url', 'URL');\n });\n \n return $grid;\n }", "function scribbles_add_search_form() {\n\n\tget_template_part( 'templates/parts/search' );\n\n}", "public function haz_eff_hea(){\n $this->search_list();\n\t}", "protected static function display_search_form() {\n $locale = self::$locale;\n add_to_title($locale['global_202']);\n $form_elements = self::$form_config['form_elements'];\n /*\n * Search Areas\n */\n $options_table = \"<p><strong>\".$locale['405'].\"</strong></p><table style='width:100%'>\\n\";\n if (!empty(self::$form_config['radio_button'])) {\n foreach (self::$form_config['radio_button'] as $key => $value) {\n $options_table .= \"<tr>\\n<td>\".$value.\"</td>\\n</tr>\\n\";\n }\n }\n $options_table .= \"<tr>\\n<td>\\n\n \".form_checkbox('stype', $locale['407'], self::get_param('stype'), [\n 'type' => 'radio',\n 'value' => 'all',\n 'onclick' => 'display(this.value)',\n 'reverse_label' => TRUE\n ]\n ).\"</td>\\n</tr>\\n</table>\\n\";\n\n /*\n * Date limit\n */\n $date_opts = [\n '0' => $locale['421'],\n '86400' => $locale['422'],\n '604800' => $locale['423'],\n '1209600' => $locale['424'],\n '2419200' => $locale['425'],\n '7257600' => $locale['426'],\n '14515200' => $locale['427']\n ];\n\n $disabled_status = FALSE;\n if (isset($form_elements[self::get_param('stype')]['disabled'])) {\n $disabled_status = !empty($form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE;\n if (self::get_param('stype') != 'all') {\n $disabled_status = in_array(\"datelimit\", $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE;\n }\n }\n\n if (self::get_param('stype') == \"all\") {\n $disabled_status = TRUE;\n }\n\n $search_areas = \"<div class='row'>\";\n $search_areas .= \"<div class='col-xs-12 col-sm-3'>\".$locale['420'].\"</div>\";\n $search_areas .= \"<div class='col-xs-12 col-sm-9'>\";\n $search_areas .= form_select('datelimit', '', self::get_param('datelimit'),\n [\n 'inner_width' => '150px',\n 'options' => $date_opts,\n 'deactivate' => $disabled_status\n ]);\n $search_areas .= form_checkbox('fields', $locale['430'], self::get_param('fields'),\n [\n 'type' => 'radio',\n 'value' => '2',\n 'reverse_label' => TRUE,\n 'input_id' => 'fields1',\n 'class' => 'm-b-0',\n 'deactivate' => (self::get_param('stype') != \"all\" ? (isset($form_elements[self::get_param('stype')]) && in_array(\"fields1\", $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE) : FALSE)\n ]\n );\n $search_areas .= form_checkbox('fields', $locale['431'], self::get_param('fields'),\n [\n 'type' => 'radio',\n 'value' => '1',\n 'reverse_label' => TRUE,\n 'input_id' => 'fields2',\n 'class' => 'm-b-0',\n 'deactivate' => (self::get_param('stype') != \"all\" ? (isset($form_elements[self::get_param('stype')]) && in_array(\"fields2\", $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE) : FALSE)\n ]\n );\n $search_areas .= form_checkbox('fields', $locale['432'], self::get_param('fields'),\n [\n 'type' => 'radio',\n 'value' => '0',\n 'reverse_label' => TRUE,\n 'input_id' => 'fields3',\n 'class' => 'm-b-0',\n 'deactivate' => (self::get_param('stype') != \"all\" ? (isset($form_elements[self::get_param('stype')]) && in_array(\"fields3\",\n $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE) : FALSE)\n ]\n );\n $search_areas .= \"</div></div>\";\n\n /*\n * Sort\n */\n $sort_opts = [\n 'datestamp' => $locale['441'],\n 'subject' => $locale['442'],\n 'author' => $locale['443']\n ];\n\n $sort = \"<div class='row'>\";\n $sort .= \"<div class='col-xs-12 col-sm-3'>\".$locale['440'].\"</div>\";\n $sort .= \"<div class='col-xs-12 col-sm-9'>\";\n $sort .= form_select('sort', '', self::get_param('sort'), [\n 'inner_width' => '150px',\n 'options' => $sort_opts,\n 'deactivate' => (self::get_param('stype') != \"all\" ? (isset($form_elements[self::get_param('stype')]) && in_array(\"sort\",\n $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE) : FALSE)\n ]);\n $sort .= form_checkbox('order', $locale['450'], self::get_param('order'),\n [\n 'type' => 'radio',\n 'value' => '0',\n 'reverse_label' => TRUE,\n 'input_id' => 'order1',\n 'class' => 'm-b-0',\n 'deactivate' => (self::get_param('stype') != \"all\" ? (isset($form_elements[self::get_param('stype')]) && in_array(\"order1\",\n $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE) : FALSE)\n ]\n );\n $sort .= form_checkbox('order', $locale['451'], self::get_param('order'),\n [\n 'type' => 'radio',\n 'value' => '1',\n 'reverse_label' => TRUE,\n 'input_id' => 'order2',\n 'class' => 'm-b-0',\n 'deactivate' => (self::get_param('stype') != \"all\" ? (isset($form_elements[self::get_param('stype')]) && in_array(\"order2\", $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE) : FALSE)\n ]\n );\n $sort .= \"</div></div>\";\n\n /*\n * Char list\n */\n $char_opts = [\n '50' => '50',\n '100' => '100',\n '150' => '150',\n '200' => '200'\n ];\n\n $char_areas = \"<div class='row'>\";\n $char_areas .= \"<div class='col-xs-12 col-sm-3'>\".$locale['460'].\"</div>\";\n $char_areas .= \"<div class='col-xs-12 col-sm-9'>\";\n $char_areas .= form_select('chars', '', self::get_param('chars'), [\n 'inner_width' => '150px',\n 'options' => $char_opts,\n 'deactivate' => (self::get_param('stype') != \"all\" ? (isset($form_elements[self::get_param('stype')]) && in_array(\"chars\",\n $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE) : FALSE)\n ]\n );\n $char_areas .= \"</div></div>\";\n\n /*\n * Bind\n */\n $info = [\n 'openform' => openform('advanced_search_form', 'post', BASEDIR.'search.php'),\n 'closeform' => closeform(),\n 'search_form_stext' => form_text('stext', str_replace('[SITENAME]', fusion_get_settings('sitename'), self::$locale['400']), urldecode(self::get_param('stext')), ['inline' => FALSE, 'placeholder' => $locale['401']]),\n 'search_form_button' => form_button('search', $locale['402'], $locale['402'], ['class' => 'btn-primary']),\n 'search_form_method' => form_checkbox('method', '', self::get_param('method'),\n [\n \"options\" => [\n 'OR' => $locale['403'],\n 'AND' => $locale['404']\n ],\n 'type' => 'radio',\n 'reverse_label' => TRUE,\n ]),\n 'search_form_sources' => $options_table,\n 'search_areas' => $search_areas,\n 'sort_areas' => $sort,\n 'char_areas' => $char_areas\n ];\n /*\n * Replace\n */\n echo $info['openform'];\n echo strtr(Search::render_search(), [\n '{%title%}' => str_replace('[SITENAME]', fusion_get_settings('sitename'), self::$locale['400']),\n '{%search_text%}' => $info['search_form_stext'],\n '{%search_button%}' => $info['search_form_button'],\n '{%search_method%}' => $info['search_form_method'],\n '{%search_sources%}' => $info['search_form_sources'],\n '{%search_areas%}' => $info['search_areas'],\n '{%sort_areas%}' => $info['sort_areas'],\n '{%char_areas%}' => $info['char_areas'],\n ]);\n echo $info['closeform'];\n /*\n * Javascript\n */\n $search_js = \"function display(val) {\\nswitch (val) {\\n\";\n foreach ($form_elements as $type => $array1) {\n $search_js .= \"case '\".$type.\"':\\n\";\n foreach ($array1 as $what => $array2) {\n foreach ($array2 as $elements => $value) {\n if ($what == \"enabled\") {\n $search_js .= \"document.getElementById('\".$value.\"').disabled = false;\\n\";\n } else {\n if ($what == \"disabled\") {\n $search_js .= \"document.getElementById('\".$value.\"').disabled = true;\\n\";\n } else {\n if ($what == \"display\") {\n $search_js .= \"document.getElementById('\".$value.\"').style.display = 'block';\\n\";\n } else {\n if ($what == \"nodisplay\") {\n $search_js .= \"document.getElementById('\".$value.\"').style.display = 'none';\\n\";\n }\n }\n }\n }\n }\n }\n $search_js .= \"break;\\n\";\n }\n $search_js .= \"case 'all':\\n\";\n $search_js .= \"document.getElementById('datelimit').disabled = false;\\n\";\n $search_js .= \"document.getElementById('fields1').disabled = false;\\n\";\n $search_js .= \"document.getElementById('fields2').disabled = false;\\n\";\n $search_js .= \"document.getElementById('fields3').disabled = false;\\n\";\n $search_js .= \"document.getElementById('sort').disabled = false;\\n\";\n $search_js .= \"document.getElementById('order1').disabled = false;\\n\";\n $search_js .= \"document.getElementById('order2').disabled = false;\\n\";\n $search_js .= \"document.getElementById('chars').disabled = false;\\n\";\n $search_js .= \"break;}}\";\n add_to_footer(\"<script type='text/javascript'>\".jsminify($search_js).\"</script>\");\n }", "public function actionScientificName($term) {\n $pieces = explode(' ', $term);\n\n // Check for valid input\n if (count($pieces) <= 0 || empty($pieces[0])) {\n die('Invalid request');\n }\n\n // Construct default search criteria\n $where_fields = array('AND', 'ts.external = 0', 'tg.genus LIKE :genus');\n $where_fields_data = array(':genus' => $pieces[0] . '%');\n\n // Create basic SQL-command;\n $dbHerbarInput = $this->getDbHerbarInput();\n $command = $dbHerbarInput->createCommand()\n ->select(\"ts.taxonID, herbar_view.GetScientificName( ts.taxonID, 0 ) AS ScientificName\")\n ->from(\"tbl_tax_species ts\")\n ->leftJoin(\"tbl_tax_genera tg\", \"tg.genID = ts.genID\")\n ->order(\"ScientificName\");\n\n // Check if we search the first epithet as well\n if (count($pieces) >= 2 && !empty($pieces[1])) {\n $command->leftJoin(\"tbl_tax_epithets te0\", \"te0.epithetID = ts.speciesID\");\n\n $where_fields[] = 'te0.epithet LIKE :epithet0';\n $where_fields_data[':epithet0'] = $pieces[1] . '%';\n } else {\n $where_fields[] = 'ts.speciesID IS NULL';\n }\n\n // Add where condition\n $command->where($where_fields, $where_fields_data);\n\n $rows = $command->queryAll();\n\n $results = array();\n foreach ($rows as $row) {\n $taxonID = $row['taxonID'];\n $scientificName = $row['ScientificName'];\n\n //$scientificName = $this->getTaxonName($taxonID);\n\n if (!empty($scientificName)) {\n $results[] = array(\n \"label\" => $scientificName,\n \"value\" => $scientificName,\n \"id\" => $taxonID,\n );\n }\n }\n\n // Output results as service response\n $this->serviceOutput($results);\n }", "function index_page (&$tpl) {\n $tpl->assign ('tmanufacturer', fill_lists ('tmanufacturer', select_manfrs (false, 'tyres')));\n $tpl->assign ('width', fill_lists ('width', select_twidths ()));\n $tpl->assign ('height', fill_lists ('height', select_theights ()));\n $tpl->assign ('radius', fill_lists ('radius', select_tradiuses ()));\n $tpl->parse ('main.panel.searchfields.tyres');\n\n $tpl->assign ('dmanufacturer', fill_lists ('dmanufacturer', select_manfrs (false, 'disks')));\n $tpl->assign ('holes', fill_lists ('holes', select_dholes ()));\n $tpl->assign ('distance', fill_lists ('distance', select_ddistances ()));\n $tpl->assign ('radius', fill_lists ('radius', select_dradiuses ()));\n $tpl->parse ('main.panel.searchfields.disks');\n\n $tpl->parse ('main.panel.searchfields');\n $tpl->parse ('main.panel');\n\n if (isset($_GET['tyres'])) include 'show_tyres.php';\n elseif (isset($_GET['disks'])) include 'show_disks.php';\n}" ]
[ "0.5675033", "0.56723744", "0.55281776", "0.5326758", "0.5324858", "0.53080314", "0.53009504", "0.5294246", "0.5257911", "0.5253758", "0.52512854", "0.5246763", "0.51993203", "0.51870114", "0.5185717", "0.5153325", "0.5136134", "0.5107807", "0.51014835", "0.5100494", "0.50958824", "0.50578976", "0.505735", "0.5052882", "0.50502867", "0.5033513", "0.5024301", "0.49885517", "0.49793595", "0.4975868" ]
0.5802574
0
This is the local DHL Express product code for which the delivery is feasible respecting the input data from the request.
public function getLocalProductCode(): ?string { return $this->localProductCode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProduct_code () {\n\t$preValue = $this->preGetValue(\"product_code\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_code;\n\treturn $data;\n}", "private function determainclaimType()\r\n {\r\n // 9 digits\r\n if (preg_match($this->keycodeRegex, $this->keycode) == false)\r\n {\r\n $this->claimType = \"invaild-keycode\";\r\n }\r\n \r\n // if keycode is NOT null, then search in the database\r\n else if ($this->keycode != null)\r\n {\r\n $result = mysql_query(\"SELECT Keycode, Claimable, Repairable, WarrantyMonths\r\n FROM Product \r\n WHERE Product.Keycode = $this->keycode\");\r\n\r\n $array = mysql_fetch_array($result);\r\n\r\n // if keycode is null, item does not exist in the database\r\n //if ($array[\"Keycode\"] == false)\r\n if (empty($array))\r\n {\r\n $this->claimType = \"keycode-not-found\";\r\n }\r\n // if product is claimable and repairable\r\n else if ($array[\"Claimable\"] == 1 && $array[\"Repairable\"] == 1)\r\n { \r\n // checks make sure transaction number was found, if number\r\n // rows are about zero this means the query found a result\r\n if (!empty($this->transactionResult))\r\n {\r\n // checks product is within warrant period based on purchase date\r\n // returns true if it is and false if it is not\r\n $warrantyBoolean = $this->withinWarrantyPeriod($this->transactionResult[\"PurchaseDate\"], $array[\"WarrantyMonths\"]);\r\n\r\n if ($warrantyBoolean == true) \r\n {\r\n //// check warranty period\r\n $this->claimType = \"repair-warranty\";\r\n }\r\n else\r\n {\r\n // check warranty period\r\n $this->claimType = \"repair-no-warranty\";\r\n }\r\n }\r\n else // transactionResult number rows is zero, this means no transaction was founds\r\n { \r\n $this->claimType = \"repair-no-transaction\";\r\n }\r\n }\r\n // if product offers a finanical claim\r\n else if ($array[\"Claimable\"] == 1 && $array[\"Repairable\"] == 0)\r\n {\r\n // checks make sure transaction number was found, if number\r\n // rows are about zero this means the query found a result\r\n if (!empty($this->transactionResult))\r\n {\r\n\r\n // checks product is within warrant period based on purchase date\r\n // returns true if it is and false if it is not\r\n $warrantyBoolean = $this->withinWarrantyPeriod($this->transactionResult[\"PurchaseDate\"], $array[\"WarrantyMonths\"]);\r\n\r\n if ($warrantyBoolean == true) // true means inside warranty period\r\n {\r\n $this->claimType = \"finanical-warranty\";\r\n }\r\n else // false means outside warranty period\r\n {\r\n $this->claimType = \"finanical-outside-warranty\";\r\n }\r\n }\r\n else // transactionResult's rows was zero so no tranaction number was found\r\n {\r\n $this->claimType = \"finanical-no-transaction\";\r\n }\r\n }\r\n // if a product is NOT claimable with supplier\r\n else if ($array[\"Claimable\"] == 0)\r\n {\r\n // checks make sure transaction number was found, if number\r\n // rows are above zero this means the query found a result\r\n if (!empty($this->transactionResult))\r\n {\r\n // checks product is within warrant period based on purchase date\r\n // returns true if it is and false if it is not\r\n $warrantyBoolean = $this->withinWarrantyPeriod($this->transactionResult[\"PurchaseDate\"], $array[\"WarrantyMonths\"]);\r\n\r\n if ($warrantyBoolean == true) // true means inside warranty period\r\n {\r\n $this->claimType = \"not-claimable-refund\";\r\n }\r\n else // false means outside warranty period\r\n {\r\n $this->claimType = \"not-claimable-outside-warranty\";\r\n }\r\n }\r\n else // no vaild transaction number provided\r\n {\r\n $this->claimType = \"not-claimable-no-transaction\";\r\n }\r\n }\r\n }\r\n \r\n }", "public function getProdCode()\n {\n return $this->prod_code;\n }", "public function getProductCode(): ?string\n {\n return $this->productCode;\n }", "function getProductCode()\n {\n return $this->productCode;\n }", "public function productFlowProcess(){\r\n\t\t$query = $this->request->data ;\r\n\t\t$status = $query[\"status\"] ;\r\n\t\t$description = $query[\"description\"] ;\r\n\t\t$filterId = $query[\"filterId\"] ;\r\n\t\t$asin = $query[\"asin\"] ;\r\n\t\t$strategy = $query[\"strategy\"] ;\r\n\t\t/*print_r( $this->request ) ; \r\n\t\tprint_r($this->request->data) ;\r\n\t\techo \">>>>>>>>>>>>>>>>>\".$description ;*/\r\n\t\t\r\n\t\t\r\n\t\t//更新状态\r\n\t\t$this->Sale->updateProductFilterStatus($this->request->data) ;\r\n\t\t\r\n\t\t//添加备注\r\n\t\t//if( trim($description) != \"\" ){\r\n\t\t$this->Product->updateProductComment($asin,$description,$strategy) ;\r\n\t\t//}\r\n\t\t\r\n\t\t//加入黑名单\r\n\t\tif( $status == 3 ){\r\n\t\t\t$user = $this->getCookUser() ;\r\n\t\t\t$this->Sale->removeProduct($this->request->data,$user) ;\r\n\t\t}else{\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t$this->response->type(\"json\") ;\r\n\t\t$this->response->body( \"success\") ;\r\n\r\n\t\treturn $this->response ;\r\n\t}", "function external_code($request)\n\t{\n\t\tlist($success, $return) = $this->system->is_valid_access4($request);\n\t\tif (!$success) return [FALSE, $return];\n\n\t\t//cek parameter: SecuritiesMarketCode\n\t\tif (!isset($request->params->SecuritiesMarketCode) || empty($request->params->SecuritiesMarketCode)) {\n\t\t\tlist($success, $return) = $this->system->error_message('00-1', $request->LanguageID);\n\t\t\tif (!$success) return [FALSE, 'message' => '00-1'];\n\t\t\treturn [FALSE, ['message' => $this->system->refill_message($return['message'], ['data' => 'parameter SecuritiesMarketCode'])]];\n\t\t}\n\n\t\t//cek parameter: MarketID --> sumber external identification \n\t\tif (!isset($request->params->MarketID) || empty($request->params->MarketID)) {\n\t\t\tlist($success, $return) = $this->system->error_message('00-1', $request->LanguageID);\n\t\t\tif (!$success) return [FALSE, 'message' => '00-1'];\n\t\t\treturn [FALSE, ['message' => $this->system->refill_message($return['message'], ['data' => 'parameter MarketID'])]];\n\t\t}\n\n\t\t$this->db->select('T2.SecuritiesCode');\n\t\t$this->db->from('market_instrument_id_market T1');\n\t\t$this->db->join('market_instrument T2', 'T1.SecuritiesID = T2.SecuritiesID'); \n\t\t$this->db->where('T1.MarketID', $request->params->MarketID);\n\t\t$this->db->where('T1.SecuritiesMarketCode', $request->params->SecuritiesMarketCode);\n\t\t$row = $this->db->get()->row();\n if (!$row) {\n\t\t\tlist($success, $return) = $this->system->error_message('00-2', $request->LanguageID);\n\t\t\tif (!$success) return [FALSE, 'message' => '00-2'];\n\t\t\treturn [FALSE, ['message' => $this->system->refill_message($return['message'], ['data' => 'market company'])]];\n }\n\n\t\t$request->log_size = mb_strlen(serialize($row), '8bit');\n\t\t$request->log_type\t= 'data';\t\n\t\t$this->system->save_billing($request);\n\n\t\treturn [TRUE, ['result' => ['SecuritiesCode' => $row->SecuritiesCode]]];\n\t}", "function deliver($code)\n{ \n\n\techo \"// http://license.mxgraph.com/hosted \\n\";\n\techo $code;\n}", "function _processSale() {\n\t\t$this->autoload();\t\t\n\t\tJbPaymentxxsourcexxLib::write_log('xxsourcexx.txt', 'IPN: '.json_encode($_REQUEST));\n\t\t\n\t\t$input = jfactory::getApplication()->input;\t\t\n\t\t$status = $input->getString('xxsourcexx_transactionStatus');\n\t\t\n\t\t$success_status = array('CO','PA');\n\t\t\n\t\tif(in_array($status, $success_status)){\n\t\t\t$order_number = $input->getString('_itemId');\n\t\t\t$order_jb = JbPaymentxxsourcexxLib::getOrder($order_number);\n\t\t\t$order_jb->pay_status = 'SUCCESS';\n\t\t\t$order_jb->order_status = 'CONFIRMED';\n\t\t\t$order_jb->tx_id = $tnxref;\n\t\t\t$order_jb->store ();\n\t\t\treturn $order_jb;\t\n\t\t}else{\n\t\t\texit;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "public function getProductCode()\n {\n if (array_key_exists(\"productCode\", $this->_propDict)) {\n return $this->_propDict[\"productCode\"];\n } else {\n return null;\n }\n }", "public function createFulfillmentRequestToDr($lineItems, $order) {\n $items = [];\n $request = [];\n $status = 'Completed';\n $responseCode = 'Success'; \n \n try {\n if ($order->getDrOrderId()) {\n $storeCode = $order->getStore()->getCode();\n $drModel = $this->drFactory->create()->load($order->getDrOrderId(), 'requisition_id');\n\n if(!$drModel->getId() || $drModel->getPostStatus() == 1) {\n return;\n } // end: if\n \n foreach ($lineItems as $itemId => $item) {\n $items['item'][] = [\n \"requisitionID\" => $item['requisitionID'],\n \"noticeExternalReferenceID\" => $item['noticeExternalReferenceID'],\n \"lineItemID\" => $itemId,\n\t\t\t\t\t\t\"magentoLineItemID\" => $item['magentoLineItemID'],\n \"fulfillmentCompanyID\" => $this->getCompanyId($storeCode),\n \"electronicFulfillmentNoticeItems\" => [\n \"item\" => [\n [\n \"status\" => $status,\n \"reasonCode\" => $responseCode,\n \"quantity\" => $item['quantity'],\n \"electronicContentType\" => \"EntitlementDetail\",\n \"electronicContent\" => \"magentoEventID\"\n ]\n ]\n ]\n ];\n } // end: foreach\n\n $request['ElectronicFulfillmentNoticeArray'] = $items;\n\n $this->curl->setOption(CURLOPT_RETURNTRANSFER, true);\n $this->curl->setOption(CURLOPT_TIMEOUT, 40);\n $this->curl->addHeader(\"Content-Type\", \"application/json\");\n $this->curl->post($this->getDrPostUrl($storeCode), $this->jsonHelper->jsonEncode($request));\n $result = $this->curl->getBody();\n $statusCode = $this->curl->getStatus();\n\n // Status Update: Exsisting code used according to review changes\n if ($statusCode == '200') {\n // Post Status updated only if entire order items are fulfilled\n if($this->getPendingFulfillment($order)) {\n // if all the quantites are satisfied then mark as 1\n $drModel = $this->drFactory->create()->load($order->getDrOrderId(), 'requisition_id');\n $drModel->setPostStatus(1);\n $drModel->save();\n } // end: if\n $comment = 'Magento & DR order status are matched';\n } else {\n $comment = 'Magento & DR order status are mis-matched';\n } // end: if\n\n $order->addStatusToHistory($order->getStatus(), __($comment));\n\n $this->_logger->info('createFulfillmentRequestToDr Request : '.json_encode($request));\n $this->_logger->info('createFulfillmentRequestToDr Response : '.json_encode($result)); \n } else {\n $this->_logger->error('Error createFulfillmentRequestToDr : Empty DR Order Id');\n } // end: if\n } catch (\\Magento\\Framework\\Exception\\LocalizedException $le) {\n $this->_logger->error('Error createFulfillmentRequestToDr : '.json_encode($le->getRawMessage()));\n } catch (\\Exception $ex) {\n $this->_logger->error('Error createFulfillmentRequestToDr : '. $ex->getMessage());\n } // end: try \n \n return $result;\n }", "public static function postsubmit_derive_product($lead) {\n\t\t$wsProduct = '';\n\t\tif( empty($lead->wsMaxProductLine) || 'Unknown' == $lead->wsMaxProductLine ) { // no Product Line context on the form page\n\t\t\tif ( 'History-Culture Themed Programs (K-12)' == $lead->leadFormProduct ) {\n\t\t\t\tif( !empty($lead->domesticOrInternational ) && 'us' == $lead->domesticOrInternational ) {\n\t\t\t\t\t$wsProduct = 'Middle School - History'; // default to History\n\t\t\t\t} else {\n\t\t\t\t\t$wsProduct = 'High School - International'; // abroad means Perspectives Division\n\t\t\t\t}\n\t\t\t} elseif ( 'Science Themed Programs (K-12)' == $lead->leadFormProduct ) {\n\t\t\t\t$wsProduct = 'Middle School - Science';\n\t\t\t} elseif ( 'Undergraduate Tours' == $lead->leadFormProduct || \n\t\t\t\t\t 'Graduate-Level Tours' == $lead->leadFormProduct ) {\n\t\t\t\t$wsProduct = 'University'; // does not exist in Maximizer yet\n\t\t\t} elseif ( 'Music Festivals' == $lead->leadFormProduct ||\n\t\t\t\t\t 'Concert and Performing Tours' == $lead->leadFormProduct ||\n\t\t\t\t\t 'Marching Band Opportunities' == $lead->leadFormProduct ||\n\t\t\t\t\t 'Dance-Cheer Opportunities' == $lead->leadFormProduct ||\n\t\t\t\t\t 'Theatre Opportunities' == $lead->leadFormProduct ) {\n\t\t\t\t$wsProduct = 'Performing';\n\t\t\t} elseif ( 'Sports Tours' == $lead->leadFormProduct ) {\n\t\t\t\t$wsProduct = 'Sports'; // does not exist in Maximizer yet\n\t\t\t} else {\n\t\t\t\t$wsProduct = 'Unknown';\n\t\t\t}\n\t\t} else {\n\t\t\t$wsProduct = $lead->wsMaxProductLine;\n\t\t}\n\t\treturn $wsProduct;\n\t}", "public function actionDeliveryCost($code){\n //check country\n $city= City::find()->where('Name=\"'.$code.'\"')->one();\n //var_dump($city);\n if($city->CountryCode == 'EGY'){\n //calculate weight\n $sum=0;\n foreach(Shopcart::goods() as $good) {\n $sum+= $good->item->product_weight ;\n\n }\n // return \"the new cost--\".$city->Name .$city->CountryCode;\n //$city->CountryCode;\n $cost= $this->GetCost($city->Name,$sum);\n if($cost =='' or $cost ==0){\n return Setting::get('deliver_cost');\n }else{return $cost ;}\n\n }else{\n return Setting::get('deliver_cost'); //.'-99'. $city->CountryCode;\n }\n\n }", "public function verifyShippingDisponibility() {\n\n $return = array();\n $items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();\n $PackageWeight = 0;\n foreach ($items as $item) {\n if (($item->getProductType() == \"configurable\") || ($item->getProductType() == \"grouped\")) {\n $PackageWeight += ($item->getWeight() * (((int) $item->getQty()) - 1));\n } else {\n $PackageWeight += ($item->getWeight() * ((int) $item->getQty()));\n }\n }\n\n $customerAdressCountryCode = $this->getCustomerCountry();\n //verify destination country\n $keyOdExpressDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod1);\n $keyOdMessagerieDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod2);\n\n\n if ($keyOdExpressDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 0;\n }\n\n if ($keyOdMessagerieDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 0;\n }\n\n return $return;\n }", "function get_item_code()\n\t{\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\n\t\t\t$invoiceNumber = $_POST['inv'];\n\t\t\t$batch = $_POST['batch'];\n\t\t\t$tableName = \"london_stock\";\n\t\t\t$condition = array(\n\t\t\t\t'invoice_number' => $invoiceNumber,\n\t\t\t\t'invoice_date' => $batch\n\n\t\t\t);\n\t\t\t$result = $this->CustomModel->selectAllFromWhere($tableName, $condition);\n\t\t\tif ($result > 0) {\n\t\t\t\techo $response = json_encode($result, true);\n\t\t\t} else {\n\t\t\t\techo $response = json_encode(array('message' => 'No item', 'type' => 'danger'), true);\n\t\t\t}\n\t\t}\n\t}", "public function minAction()\n {\n $mForm = new Qss_Model_Form();\n $appr = $mForm->getApproverByStep($this->_form->i_IFID, 2);\n $mRequest = new Qss_Model_Purchase_Request();\n $main = $mRequest->getRequestByIFID($this->_form->i_IFID);\n $sub = $mRequest->getRequestLineByIFID($this->_form->i_IFID);\n\n $this->html->main = $main;\n $this->html->sub = $sub;\n $this->html->ifid = $this->_form->i_IFID;\n $this->html->step2Appr = @$appr[0];\n $this->html->step3Appr = @$appr[1];\n }", "public function compliteAction()\n {\n\n $config = $this->get('plugins')->Frontend()->PilibabaPilipaySystem()->Config();\n $merchantNO = $this->Request()->getParam('merchantNO');\n $orderNo = $this->Request()->getParam('orderNo');\n $orderAmount = $this->Request()->getParam('orderAmount');\n $signType = $this->Request()->getParam('signType');\n $payResult = $this->Request()->getParam('payResult');\n $signMsg = $this->Request()->getParam('signMsg');\n $dealId = $this->Request()->getParam('dealId');\n $fee = $this->Request()->getParam('fee');\n $sendTime = $this->Request()->getParam('sendTime');\n\n\n if ($config->get('merchantNo') == $merchantNO\n && md5($merchantNO . $orderNo . $orderAmount . $sendTime . $config->get('appSecrect')) == $signMsg\n ) {\n $repository = Shopware()->Models()->getRepository('Shopware\\Models\\Order\\Order');\n $builder = $repository->createQueryBuilder('orders');\n $builder->addFilter(array('number' => $orderNo));\n $order = $builder->getQuery()->getOneOrNullResult();\n\n if ($payResult == 10) {\n\n $this->setPaymentStatus($order->getTransactionId(), 12);\n $url = $this->basePathUrl . '/paymentpilipay/finish?orderNo='.$orderNo;\n\n echo '<result>1</result><redirecturl>' . $url . '</redirecturl>';\n $this->Front()->Plugins()->ViewRenderer()->setNoRender();\n\n if ($order->getOrderStatus() && $order->getOrderStatus()->getId() == 0) {\n $this->setOrderStatus($order->getTransactionId(), 0); // in process\n }\n } elseif ($payResult == 11) {\n $this->setPaymentStatus($order->getTransactionId(), 21);\n\n }\n }\n\n }", "public function getOcentureProductCode($freedomProductCode) {\r\n $products = [\r\n 'YSDPROTECHM1MO' => 'YP8383',\r\n 'YSDPROTECHM1YR' => 'YP83811',\r\n 'YSDPROIDM1MO' => 'YP8381',\r\n 'YSDPROIDM1YR' => 'YP8389',\r\n 'YSDPROIDF1MO' => 'YP8382',\r\n 'YSDPROIDF1YR' => 'YP83810',\r\n 'YSDPROIDMP1MO' => 'YP8387',\r\n 'YSDPROIDMP1YR' => 'YP83815',\r\n 'YSDPROIDFP1MO' => 'YP8388',\r\n 'YSDPROIDFP1YR' => 'YP83816',\r\n 'YSDPROROADM1MO' => 'YP8384',\r\n 'YSDPROROADM1YR' => 'YP83812',\r\n 'YSDPROBUNDLM1MO' => 'YP8385',\r\n 'YSDPROBUNDLM1YR' => 'YP83813',\r\n 'YSDPROBUNDLF1MO' => 'YP8386',\r\n 'YSDPROBUNDLF1YR' => 'YP83814',\r\n 'testproduct' => 'IG7985'\r\n ];\r\n\r\n if (isset($products[$freedomProductCode])) {\r\n return $products[$freedomProductCode];\r\n } else {\r\n die(\"no product found matching with ocenture\");\r\n }\r\n }", "public function addProductCode($code)\n {\n //$pieces = preg_split(\"/-/\", $code);\n //$programId = preg_replace(\"/\\D/\", \"\", $pieces[0]);\n }", "function checkdelivery($package) {\n\n\t$item = $package['item'];\t\n\t$quantity = $package['quantity'];\t\n\t$to = $package['to'];\t\n\t$from = $package['from'];\t\n\n// Based on the location of the delivery address and \n// the warehouse the courier can decide if they can \n// make the delivery. If yes, they could then let the \n// warehouse know the cost and delivery date.\n\n\t$accepted = 1;\n\n\tif ( $accepted )\n\t{\n\t\t$cost = 10;\n\t\t$date = '12-05-2004';\n\n\t\t$output = array(\n\t\t\t\t\t'accepted' => $accepted,\n\t\t\t\t\t'cost' => $cost,\n\t\t\t\t\t'date' => $date\n\t\t\t\t\t);\n\t} else {\n\t\t$output = array(\n\t\t\t\t\t'accepted' => $accepted,\n\t\t\t\t\t'cost' => 0,\n\t\t\t\t\t'date' => 'null'\n\t\t\t\t\t);\n\t}\n\n return new soapval('return', 'DeliveryDetail', $output, false, 'urn:MyURN');\n}", "private function getProductInformation()\r\n {\r\n \r\n // if product is repairable get the repair agents details as well as products and suppliers\r\n if ($this->claimType == \"repair-warranty\" || $this->claimType == \"repair-no-warranty\" || \r\n $this->claimType == \"repair-no-transaction\")\r\n {\r\n $result = mysql_query( \"SELECT *\r\n FROM ProductSupplierRepairAgent_VIEW\r\n WHERE Keycode = $this->keycode\");\r\n \r\n $this->keycodeResult = mysql_fetch_array($result);\r\n }\r\n // if the product is not repairable grab the product information and supplier information only\r\n else\r\n {\r\n $result = mysql_query( \"SELECT *\r\n FROM ProductSupplier_VIEW\r\n WHERE Keycode = $this->keycode\");\r\n \r\n $this->keycodeResult = mysql_fetch_array($result);\r\n }\r\n }", "abstract protected function getPaymentMethodCode();", "function buildHostRequest() {\r\n\t\t$strRequest = \"\";\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->amt ) > 0) {\r\n\t\t\t\t$strRequest .= \"amt=\" . $this->amt . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->action ) > 0) {\r\n\t\t\t\t$strRequest .= \"action=\" . $this->action . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->responseURL ) > 0) {\r\n\t\t\t\t$strRequest .= \"responseURL=\" . $this->responseURL . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->errorURL ) > 0) {\r\n\t\t\t\t$strRequest .= \"errorURL=\" . $this->errorURL . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->trackId ) > 0) {\r\n\t\t\t\t$strRequest .= \"trackid=\" . $this->trackId . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf1 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf1=\" . $this->udf1 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf2 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf2=\" . $this->udf2 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf3 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf3=\" . $this->udf3 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf4 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf4=\" . $this->udf4 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf5 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf5=\" . $this->udf5 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf6 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf6=\" . $this->udf6 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf7 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf7=\" . $this->udf7 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf8 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf8=\" . $this->udf8 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf9 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf9=\" . $this->udf9 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf10 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf10=\" . $this->udf10 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf11 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf11=\" . $this->udf11 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf12 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf12=\" . $this->udf12 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf13 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf13=\" . $this->udf13 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf14 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf14=\" . $this->udf14 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf15 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf15=\" . $this->udf15 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf16 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf16=\" . $this->udf16 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf17 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf17=\" . $this->udf17 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf18 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf18=\" . $this->udf18 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf19 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf19=\" . $this->udf19 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf20 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf20=\" . $this->udf20 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf21 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf21=\" . $this->udf21 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf22 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf22=\" . $this->udf22 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf23 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf23=\" . $this->udf23 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf24 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf24=\" . $this->udf24 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf25 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf25=\" . $this->udf25 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf26 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf26=\" . $this->udf26 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf27 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf27=\" . $this->udf27 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf28 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf28=\" . $this->udf28 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf29 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf29=\" . $this->udf29 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf30 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf30=\" . $this->udf30 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf31 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf31=\" . $this->udf31 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf32 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf32=\" . $this->udf32 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->currency ) > 0) {\r\n\t\t\t\t$strRequest .= \"currencycode=\" . $this->currency . \"&\";\r\n\t\t\t}\r\n\t\t\tif ($this->language != null && strlen ( $this->language ) > 0) {\r\n\t\t\t\t$strRequest .= \"langid=\" . $this->language . \"&\";\r\n\t\t\t}\r\n\t\t\treturn $strRequest;\r\n\t\t} catch ( Exception $e ) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t/*\r\n\t\t * finally{\r\n\t\t * $strRequest = null;\r\n\t\t * }\r\n\t\t */\r\n\t}", "private function dataCodeAction()\n {\n $code_action = array(\n 'ABO' => array('Abonnement', '1'),\n 'PROSP' => array('Prospection', '2'),\n 'PROSP1' => array('Prospection tracer 1', '2'),\n 'PROSP11' => array('Prospection tracer 11', '2'),\n 'PROSP12' => array('Prospection tracer 12', '2'),\n 'PROSP13' => array('Prospection tracer 13', '2'),\n 'PROSP2' => array('Prospection tracer 2', '2'),\n 'PROSP21' => array('Prospection tracer 21', '2'),\n 'PROSP22' => array('Prospection tracer 22', '2'),\n 'PROSP23' => array('Prospection tracer 23', '2'),\n 'PROSP24' => array('Prospection tracer 24', '2'),\n 'PROSP3' => array('Prospection tracer 3', '2'),\n 'PROSP5' => array('Prospection tracer 5', '2'),\n 'PROSP51' => array('Prospection tracer 51', '2'),\n 'PROSP52' => array('Prospection tracer 52', '2'),\n 'PROSP53' => array('Prospection tracer 53', '2'),\n 'PROSP ENTR' => array('Contact entrant sans fiche client', '2'),\n 'PROSP REL' => array('Prospection REL', '2'),\n 'PROSPWEB' => array('Prospection Web', '2'),\n 'FID' => array('FID', '20'),\n 'FID PROMO' => array('FID suite promo', '20'),\n 'FID PROG F' => array('FID programme fidélité', '20'),\n 'FID WEB PRGF' => array('FID web PRGF', '20'),\n 'FID WEB PROMO' => array('FID web PROMO', '20'),\n 'FID WEB PROM' => array('FID web PROMO', '20'),\n 'FID WEB' => array('FID web', '20'),\n 'PAR' => array('Parrainage', '27'),\n 'REACT+4M' => array('Reactivation fichier clients +4mois', '28'),\n 'REACT+4MPROMO' => array('Reactivation fichier clients +4mois suite à promo', '28'),\n 'REACT SPONT' => array('Reactivation client spontanée', '28'),\n 'REACT SPONT PROMO' => array('Reactivation client spontanée suite à promo', '28'),\n 'REACTSPONT' => array('Reactivation client AC formulaire', '28'),\n 'REACT AC FORM' => array('Reactivation client AC formulaire', '28'),\n 'REACTIV' => array('Reactivation REACTIV', '28'),\n 'CONT ENTR' => array('CONT ENTR', '35')\n );\n $data = array();\n $c = 1;\n foreach ($code_action as $key => $value) {\n $data[] = array(\n 'id_code_action' => (int)$c,\n 'name' => pSQL($key),\n 'description' => pSQL($value[0]),\n 'groupe' => (int)$value[1]\n );\n $c++;\n }\n\n return $data;\n }", "public function suggestPurchaseRequest()\n {\n return Product::select(DB::raw('id, productName as prDescription, reorderAmount - amount as prQty,reorderAmount, \"Write a descriptive Purpose for this request\" as prPurpose'))\n ->whereRaw('amount < reorderAmount and amount > 0')->limit(env('PURCHASE_ORDER_LIMIT'))->get();\n }", "public function getPartnerCode()\n {\n // todo: implement partner code storage.\n return null;\n }", "public function get_Code_produit()\n\t\t{\n\t\t\treturn $this->Code_produit;\n\t\t}", "public function getLocalProductCountryCode(): ?string\n {\n return $this->localProductCountryCode;\n }", "public function deliveryPriceDhaka()\n {\n }", "function calc_required_en(){\r\n\tif(strpos($this->Tactics['spec'],'DoubleStrike') !== false) $this->Eq['A']['enc'] *= 2;\r\n\tif(strpos($this->Tactics['spec'],'TripleStrike') !== false) $this->Eq['A']['enc'] *= 3;\r\n\t$MSEnCpos = strpos($this->MS['spec'],'CostEN');\r\n\tif($MSEnCpos !== false) {\r\n\t\t$temp = array();\r\n\t\tpreg_match('/CostEN<([0-9.]+)>/',$this->MS['spec'],$temp,0,$MSEnCpos);\r\n\t\t$MSEnC = floatval($temp[1]);\r\n\t\tif($MSEnC < 1) $MSEnC = floor($this->Player['enmax'] * $MSEnC);\r\n\t\t$this->Eq['A']['enc'] += $MSEnC;\r\n\t}\r\n\t$this->RequireEN = ($this->Eq['A']['enc'] + $this->Eq['D']['enc'] + $this->Eq['E']['enc']);\r\n}" ]
[ "0.55132407", "0.5250005", "0.52417946", "0.519151", "0.518918", "0.51860404", "0.5183702", "0.51620764", "0.5121596", "0.5102158", "0.5071421", "0.5064782", "0.50458515", "0.5026691", "0.50166225", "0.49991503", "0.499401", "0.49783915", "0.49728212", "0.48994455", "0.48845184", "0.48706278", "0.4869432", "0.486936", "0.48561537", "0.48466632", "0.48336586", "0.48297393", "0.48240584", "0.4819289" ]
0.5668688
0
The NetworkTypeCode element indicates the product belongs to the Day Definite (DD) or Time Definite (TD) network. Possible Values; DD: Day Definite product TD: Time Definite product.
public function getNetworkTypeCode(): ?string { return $this->networkTypeCode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setNetworkTypeCode(?string $networkTypeCode): self\n {\n $this->initialized['networkTypeCode'] = true;\n $this->networkTypeCode = $networkTypeCode;\n\n return $this;\n }", "public function getAdNetworkType()\n {\n return $this->ad_network_type;\n }", "function network_code( $network ){\n $network = trim(strtolower( $network ) );\n switch ($network) {\n case 'mtn':\n case 'dstv':\n return '01';\n break;\n case 'glo':\n case 'gotv':\n return '02';\n break;\n case '9mobile':\n case 'etisalat':\n case 'startimes':\n return '03';\n break;\n default :\n // airtel\n return '04';\n }\n}", "public function getNetworkType() {\n return $this->signal;\n }", "function fann_get_network_type($ann)\n{\n}", "public function getDeliveryTypeCode()\n {\n return $this->deliveryTypeCode;\n }", "public function getTypeNationalite() {\n return $this->typeNationalite;\n }", "public function getDOWTypeCode()\n {\n return $this->dOWTypeCode;\n }", "public function setNmfcCode($nmfcCode)\n {\n $this->values['NmfcCode'] = $nmfcCode;\n return $this;\n }", "public function setNetworkType($network) {\n if ($network != self::NETWORK_TYPE_1xRTT && $network != self::NETWORK_TYPE_CDMA &&\n $network != self::NETWORK_TYPE_EDGE && $network != self::NETWORK_TYPE_EHRPD &&\n $network != self::NETWORK_TYPE_EVDO_0 && $network != self::NETWORK_TYPE_EVDO_A &&\n $network != self::NETWORK_TYPE_EVDO_B && $network != self::NETWORK_TYPE_GPRS &&\n $network != self::NETWORK_TYPE_HSDPA && $network != self::NETWORK_TYPE_HSPA &&\n $network != self::NETWORK_TYPE_HSPAP && $network != self::NETWORK_TYPE_HSUPA &&\n $network != self::NETWORK_TYPE_IDEN && $network != self::NETWORK_TYPE_LTE &&\n $network != self::NETWORK_TYPE_UMTS && $network != self::NETWORK_TYPE_UNKNOWN) {\n throw new InvalidArgumentException(\"\\\"network\\\" is no valid character\");\n }\n $this->network = $network;\n }", "public function setAdNetworkType($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Ads\\GoogleAds\\V0\\Enums\\AdNetworkTypeEnum_AdNetworkType::class);\n $this->ad_network_type = $var;\n\n return $this;\n }", "public function getCodeType()\n {\n return $this->codeType;\n }", "public function setTypeCode($typeCode)\n {\n $this->typeCode = $typeCode;\n return $this;\n }", "public function setNetwork($var)\n {\n GPBUtil::checkString($var, True);\n $this->network = $var;\n\n return $this;\n }", "public function get_mobileNetworkCode(): int\n {\n return $this->_mnc;\n }", "public function get_mobileNetworkCode(): int\n {\n return $this->_mnc;\n }", "public function getPayMethodByCcType($ccTypeCode)\n {\n $returnValue = '';\n switch ($ccTypeCode) {\n case 'VI':\n case 'MC':\n $returnValue = self::PAYU_METHOD_CCVISAMC;\n break;\n case 'JCB':\n $returnValue = self::PAYU_METHOD_CCJCB;\n break;\n case 'DINCLB':\n $returnValue = self::PAYU_METHOD_CCDINERS;\n break;\n default:\n Mage::throwException(Mage::helper('innobyte_payu_lite')->__('CC type not supported by PayU.'));\n }\n return $returnValue;\n }", "public function getNetworkId(){\n\t\treturn self::NETWORK_ID;\n\t}", "public function getSocialNetwork($type_network) {\n if (isset($this->rSocialNetwork)) {\n foreach ($this->rSocialNetwork as $value) {\n if ($value->type_network == $type_network) {\n return $value->value;\n }\n }\n }\n return '';\n }", "public function getForecastTypeCode()\n {\n return $this->forecastTypeCode;\n }", "public function getCdNfservico()\n {\n return $this->cd_nfservico;\n }", "public function setTypeCode(?string $typeCode): self\n {\n $this->initialized['typeCode'] = true;\n $this->typeCode = $typeCode;\n\n return $this;\n }", "public function setTypeCode(?string $typeCode): self\n {\n $this->initialized['typeCode'] = true;\n $this->typeCode = $typeCode;\n\n return $this;\n }", "public function getNetworkMode()\n {\n return $this->_networkMode;\n }", "public function getReferenceType($code = null)\n {\n $types = array(\n 'TXN' => Mage::helper('paypal')->__('Transaction ID'),\n 'ODR' => Mage::helper('paypal')->__('Order ID'),\n 'SUB' => Mage::helper('paypal')->__('Subscription ID'),\n 'PAP' => Mage::helper('paypal')->__('Preapproved Payment ID')\n );\n if($code === null) {\n asort($types);\n return $types;\n }\n if (isset($types[$code])) {\n return $types[$code];\n }\n return $code;\n }", "public function getReferenceType($code = null)\n {\n $types = array(\n 'TXN' => Mage::helper('paypalmx')->__('Transaction ID'),\n 'ODR' => Mage::helper('paypalmx')->__('Order ID'),\n 'SUB' => Mage::helper('paypalmx')->__('Subscription ID'),\n 'PAP' => Mage::helper('paypalmx')->__('Preapproved Payment ID')\n );\n if($code === null) {\n asort($types);\n return $types;\n }\n if (isset($types[$code])) {\n return $types[$code];\n }\n return $code;\n }", "public function getDeliveryConfirmationTypeByCode($code)\n {\n $storeId = $this->getRma()->getStoreId();\n $countryId = $this->_rmaData->getReturnAddressModel($storeId)->getCountryId();\n $carrierCode = $this->getShipment()->getCarrierCode();\n $carrier = $this->_rmaData->getCarrier($carrierCode, $this->getRma()->getStoreId());\n if ($carrier) {\n $params = new \\Magento\\Framework\\DataObject(['country_recipient' => $countryId]);\n $confirmationTypes = $carrier->getDeliveryConfirmationTypes($params);\n $containerType = !empty($confirmationTypes[$code]) ? $confirmationTypes[$code] : '';\n return $containerType;\n }\n return '';\n }", "public function setDOWTypeCode($dOWTypeCode)\n {\n $this->dOWTypeCode = $dOWTypeCode;\n return $this;\n }", "public function getNationality()\n {\n return $this->nationality;\n }", "public function getNationality()\n {\n return $this->nationality;\n }" ]
[ "0.5964149", "0.5531543", "0.5402334", "0.5320659", "0.50460637", "0.5028686", "0.5000282", "0.49938503", "0.49405426", "0.47683275", "0.47538877", "0.47342655", "0.46673933", "0.4646093", "0.46384332", "0.46384332", "0.45928445", "0.45781636", "0.45749137", "0.4515465", "0.45059803", "0.44913024", "0.44913024", "0.4476967", "0.44459164", "0.44427395", "0.44355598", "0.44311416", "0.4408672", "0.4408672" ]
0.6282591
0
The NetworkTypeCode element indicates the product belongs to the Day Definite (DD) or Time Definite (TD) network. Possible Values; DD: Day Definite product TD: Time Definite product.
public function setNetworkTypeCode(?string $networkTypeCode): self { $this->initialized['networkTypeCode'] = true; $this->networkTypeCode = $networkTypeCode; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNetworkTypeCode(): ?string\n {\n return $this->networkTypeCode;\n }", "public function getAdNetworkType()\n {\n return $this->ad_network_type;\n }", "function network_code( $network ){\n $network = trim(strtolower( $network ) );\n switch ($network) {\n case 'mtn':\n case 'dstv':\n return '01';\n break;\n case 'glo':\n case 'gotv':\n return '02';\n break;\n case '9mobile':\n case 'etisalat':\n case 'startimes':\n return '03';\n break;\n default :\n // airtel\n return '04';\n }\n}", "public function getNetworkType() {\n return $this->signal;\n }", "function fann_get_network_type($ann)\n{\n}", "public function getDeliveryTypeCode()\n {\n return $this->deliveryTypeCode;\n }", "public function getTypeNationalite() {\n return $this->typeNationalite;\n }", "public function getDOWTypeCode()\n {\n return $this->dOWTypeCode;\n }", "public function setNmfcCode($nmfcCode)\n {\n $this->values['NmfcCode'] = $nmfcCode;\n return $this;\n }", "public function setNetworkType($network) {\n if ($network != self::NETWORK_TYPE_1xRTT && $network != self::NETWORK_TYPE_CDMA &&\n $network != self::NETWORK_TYPE_EDGE && $network != self::NETWORK_TYPE_EHRPD &&\n $network != self::NETWORK_TYPE_EVDO_0 && $network != self::NETWORK_TYPE_EVDO_A &&\n $network != self::NETWORK_TYPE_EVDO_B && $network != self::NETWORK_TYPE_GPRS &&\n $network != self::NETWORK_TYPE_HSDPA && $network != self::NETWORK_TYPE_HSPA &&\n $network != self::NETWORK_TYPE_HSPAP && $network != self::NETWORK_TYPE_HSUPA &&\n $network != self::NETWORK_TYPE_IDEN && $network != self::NETWORK_TYPE_LTE &&\n $network != self::NETWORK_TYPE_UMTS && $network != self::NETWORK_TYPE_UNKNOWN) {\n throw new InvalidArgumentException(\"\\\"network\\\" is no valid character\");\n }\n $this->network = $network;\n }", "public function setAdNetworkType($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Ads\\GoogleAds\\V0\\Enums\\AdNetworkTypeEnum_AdNetworkType::class);\n $this->ad_network_type = $var;\n\n return $this;\n }", "public function getCodeType()\n {\n return $this->codeType;\n }", "public function setTypeCode($typeCode)\n {\n $this->typeCode = $typeCode;\n return $this;\n }", "public function setNetwork($var)\n {\n GPBUtil::checkString($var, True);\n $this->network = $var;\n\n return $this;\n }", "public function get_mobileNetworkCode(): int\n {\n return $this->_mnc;\n }", "public function get_mobileNetworkCode(): int\n {\n return $this->_mnc;\n }", "public function getPayMethodByCcType($ccTypeCode)\n {\n $returnValue = '';\n switch ($ccTypeCode) {\n case 'VI':\n case 'MC':\n $returnValue = self::PAYU_METHOD_CCVISAMC;\n break;\n case 'JCB':\n $returnValue = self::PAYU_METHOD_CCJCB;\n break;\n case 'DINCLB':\n $returnValue = self::PAYU_METHOD_CCDINERS;\n break;\n default:\n Mage::throwException(Mage::helper('innobyte_payu_lite')->__('CC type not supported by PayU.'));\n }\n return $returnValue;\n }", "public function getNetworkId(){\n\t\treturn self::NETWORK_ID;\n\t}", "public function getSocialNetwork($type_network) {\n if (isset($this->rSocialNetwork)) {\n foreach ($this->rSocialNetwork as $value) {\n if ($value->type_network == $type_network) {\n return $value->value;\n }\n }\n }\n return '';\n }", "public function getForecastTypeCode()\n {\n return $this->forecastTypeCode;\n }", "public function getCdNfservico()\n {\n return $this->cd_nfservico;\n }", "public function setTypeCode(?string $typeCode): self\n {\n $this->initialized['typeCode'] = true;\n $this->typeCode = $typeCode;\n\n return $this;\n }", "public function setTypeCode(?string $typeCode): self\n {\n $this->initialized['typeCode'] = true;\n $this->typeCode = $typeCode;\n\n return $this;\n }", "public function getNetworkMode()\n {\n return $this->_networkMode;\n }", "public function getReferenceType($code = null)\n {\n $types = array(\n 'TXN' => Mage::helper('paypal')->__('Transaction ID'),\n 'ODR' => Mage::helper('paypal')->__('Order ID'),\n 'SUB' => Mage::helper('paypal')->__('Subscription ID'),\n 'PAP' => Mage::helper('paypal')->__('Preapproved Payment ID')\n );\n if($code === null) {\n asort($types);\n return $types;\n }\n if (isset($types[$code])) {\n return $types[$code];\n }\n return $code;\n }", "public function getReferenceType($code = null)\n {\n $types = array(\n 'TXN' => Mage::helper('paypalmx')->__('Transaction ID'),\n 'ODR' => Mage::helper('paypalmx')->__('Order ID'),\n 'SUB' => Mage::helper('paypalmx')->__('Subscription ID'),\n 'PAP' => Mage::helper('paypalmx')->__('Preapproved Payment ID')\n );\n if($code === null) {\n asort($types);\n return $types;\n }\n if (isset($types[$code])) {\n return $types[$code];\n }\n return $code;\n }", "public function getDeliveryConfirmationTypeByCode($code)\n {\n $storeId = $this->getRma()->getStoreId();\n $countryId = $this->_rmaData->getReturnAddressModel($storeId)->getCountryId();\n $carrierCode = $this->getShipment()->getCarrierCode();\n $carrier = $this->_rmaData->getCarrier($carrierCode, $this->getRma()->getStoreId());\n if ($carrier) {\n $params = new \\Magento\\Framework\\DataObject(['country_recipient' => $countryId]);\n $confirmationTypes = $carrier->getDeliveryConfirmationTypes($params);\n $containerType = !empty($confirmationTypes[$code]) ? $confirmationTypes[$code] : '';\n return $containerType;\n }\n return '';\n }", "public function setDOWTypeCode($dOWTypeCode)\n {\n $this->dOWTypeCode = $dOWTypeCode;\n return $this;\n }", "public function getNationality()\n {\n return $this->nationality;\n }", "public function getNationality()\n {\n return $this->nationality;\n }" ]
[ "0.6283847", "0.55310315", "0.5403923", "0.53193134", "0.50447154", "0.5030371", "0.49977976", "0.49954498", "0.49425521", "0.47692546", "0.47555423", "0.47384894", "0.46731952", "0.46456292", "0.46392566", "0.46392566", "0.45956838", "0.45785922", "0.4575585", "0.45174977", "0.45035005", "0.44971082", "0.44971082", "0.44756803", "0.44491765", "0.44461396", "0.44389042", "0.44328326", "0.44067317", "0.44067317" ]
0.5967874
1
Group of serviceCodes that are mutually exclusive. Only one serviceCode among the list must be applied for a shipment.
public function getServiceCodeMutuallyExclusiveGroups(): ?array { return $this->serviceCodeMutuallyExclusiveGroups; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setServiceCodeMutuallyExclusiveGroups(?array $serviceCodeMutuallyExclusiveGroups): self\n {\n $this->initialized['serviceCodeMutuallyExclusiveGroups'] = true;\n $this->serviceCodeMutuallyExclusiveGroups = $serviceCodeMutuallyExclusiveGroups;\n\n return $this;\n }", "private function _serviceEliminateDuplicates()\n {\n return Mage::getModel('mmdebugging_blockinformation_service/match_text_eliminateduplicates', array(\n 'form' => $this->getForm(),\n 'parent_service' => $this,\n ));\n }", "public function getServiceCodeDependencyRuleGroups(): ?array\n {\n return $this->serviceCodeDependencyRuleGroups;\n }", "function build_servicegroups_array()\n{\n\tglobal $NagiosData;\n\tglobal $NagiosUser; \n\t\n\t$servicegroups = $NagiosData->getProperty('servicegroups');\t\t\t\n\t$services = $NagiosData->getProperty('services');\t\t\n\t$services = user_filtering($services,'services'); \n\t\n\t$servicegroups_details = array(); //multi-dim array to hold servicegroups \t\n\tforeach($servicegroups as $groupname => $members)\n\t{\n\t\t$servicegroups_details[$groupname] = array();\n \t\t//array_dump($members); \n\t\tforeach($services as $service)\n\t\t{\t\n\t\t\tif(isset($members[$service['host_name']]) && in_array($service['service_description'],$members[$service['host_name']]))\t{\n\t\t\t\tprocess_service_status_keys($service);\t\t\n\t\t\t\t$servicegroups_details[$groupname][] = $service;\t\t\t\n\t\t\t}\t\t\t\t\t\t\n\t\t}\n\t}\n\n\treturn $servicegroups_details; \n}", "public function getAllServices_crm() {\r\n\t\t$billingServicesObj = new billing_SERVICES();\r\n $services = $billingServicesObj->getAllServiceDataForActiveServices();\r\n foreach ($services as $key=>$val) {\r\n if (strpos($val[\"SERVICEID\"], 'M') && $val[\"SERVICEID\"] != 'M3' && $val[\"SERVICEID\"] != 'M') {\r\n \tunset($services[$key]);\r\n }\r\n }\r\n return $services;\r\n }", "public function findServiceGroups(): array;", "public function servicesArray()\n {\n return [\n self::PAINTING,\n self::TIRE,\n self::BODY_WORK,\n self::TO,\n self::WASHING,\n ];\n }", "private function supverisorGroupId(){\n return array('1');\n }", "public function getShippingServices($intShippingId = 0)\n {\n if (!$intShippingId)\n return 0;\n //Set the shipstation mapping with the X-Cart.\n $arrShippingServices = array(\n '5' => 'USPS_USPPM',//USPS Priority Mail\n '6' => 'USPS_USPEXP',//USPS Priority Mail Express\n '7' => 'USPS_USPEMI',//USPS Priority Mail Express Intl\n '8' => 'USPS_USPPMI',//USPS Priority Mail Intl\n '10' => 'USPS_USPFC',//USPS First Class Mail\n '11' => 'USPS_USPMM',//USPS Media Mail\n '13' => 'USPS_USPPM',//USPS Priority Mail\n '14' => 'USPS_USPEXP',//USPS Priority Mail Express\n '15' => 'USPS_USPEMI',//USPS Priority Mail Express Intl\n '16' => 'USPS_USPPMI',//USPS Priority Mail Intl\n '18' => 'USPS_USPFC',//USPS First Class Mail\n '19' => 'USPS_USPMM',//USPS Media Mail\n '21' => 'USPS_USPPM',//USPS Priority Mail\n '22' => 'USPS_USPEXP',//USPS Priority Mail Express\n '23' => 'USPS_USPEMI',//USPS Priority Mail Express Intl\n '24' => 'USPS_USPPMI',//USPS Priority Mail Intl\n '26' => 'UPS_UPSGND',//UPS® Ground\n '27' => 'UPS_UPS3DS',//UPS 3 Day Select®\n '28' => 'UPS_UPS2ND',//UPS 2nd Day Air®\n '29' => 'WEXPP',//UPS Worldwide Express Plus®\n '30' => 'UPS_UPSWEX',//UPS Worldwide Express®\n '31' => 'UPS_UPSNDS',//UPS Next Day Air Saver®\n '32' => 'UPS_UPSNDA',//UPS Next Day Air®\n '33' => 'UPS_UPSWEP',//UPS Worldwide Expedited®\n '34' => 'UPS_UPSWSV',//UPS Worldwide Saver®\n '35' => 'UPS_UPSCAN',//UPS Standard®\n '36' => 'UPS_UPS2DE',//UPS 2nd Day Air AM®\n '37' => 'UPS_UPSNDE',//UPS Next Day Air® Early\n '50' => 'FEDEX_GROUND',//FedEx Ground®\n '51' => 'GROUND_HOME_DELIVERY',//FedEx Home Delivery®\n '52' => 'FEDEX_2_DAY',//FedEx 2Day®\n '53' => 'FEDEX_2_DAY_AM',//FedEx 2Day® A.M.\n '54' => 'FEDEX_EXPRESS_SAVER',//FedEx Express Saver®\n '55' => 'STANDARD_OVERNIGHT',//FedEx Standard Overnight®\n '56' => 'PRIORITY_OVERNIGHT',//FedEx Priority Overnight®\n '57' => 'FIRST_OVERNIGHT',//FedEx First Overnight®\n '59' => 'INTERNATIONAL_ECONOMY',//FedEx International Economy®\n '60' => 'INTERNATIONAL_PRIORITY',//FedEx International Priority®\n '61' => 'INTERNATIONAL_FIRST',//FedEx International First®\n '67' => 'FEDEX_1_DAY_FREIGHT',//FedEx 1Day® Freight\n '68' => 'FEDEX_2_DAY_FREIGHT',//FedEx 2Day® Freight\n '69' => 'FEDEX_3_DAY_FREIGHT',//FedEx 3Day® Freight\n '70' => 'INTERNATIONAL_ECONOMY_FREIGHT',//FedEx International Economy® Freight\n '71' => 'INTERNATIONAL_PRIORITY_FREIGHT',//FedEx International Priority® Freight\n '73' => 'FEDEX_FDXIGND',//FedEx International Ground®\n '98' => 'DOM.RP',//Regular Parcel\n '99' => 'DOM.EP',//Expedited Parcel\n '100' => 'DOM.XP',//Xpresspost\n '101' => 'DOM.XP.CERT',//Xpresspost Certified\n '102' => 'DOM.PC',//Priority\n '103' => 'DOM.LIB',//Library Books\n '104' => 'USA.EP',//Expedited Parcel USA\n '105' => 'USA.PW.ENV',//Priority Worldwide Envelope USA\n '106' => 'USA.PW.PAK',//Priority Worldwide pak USA\n '107' => 'USA.PW.PARCEL',//Priority Worldwide Parcel USA\n '115' => 'INT.PW.ENV',//Priority Worldwide Envelope Intl\n '116' => 'INT.PW.PAK',//Priority Worldwide pak Intl\n '117' => 'INT.PW.PARCEL',//Priority Worldwide parcel Intl\n '118' => 'INT.SP.AIR',//Small Packet International Air\n '119' => 'INT.SP.SURF',//Small Packet International Surface\n '120' => 'INT.TP',//Tracked Packet - International\n '2700' => 'USPS_USPFC',//USPS First Class Mail\n '2701' => 'USPS_USPMM',//USPS Media Mail\n '2709' => 'USPS_USPPM',//USPS Priority Mail\n '2732' => 'USPS_USPPMI',//USPS Priority Mail International\n '2735' => 'USPS_USPEMI',//USPS Priority Mail Express International\n '2760' => 'UPS_UPSGND',//UPS Ground\n '2762' => 'UPS_UPS3DS',//UPS 3 Day Select\n '2763' => 'UPS_UPS2DE',//UPS 2nd Day Air\n '2765' => 'UPS_UPSNDAS',//UPS Next Day Air Saver\n '2766' => 'UPS_UPSNDA',//UPS Next Day Air\n );\n\n if (isset($arrShippingServices[$intShippingId])) {\n return $arrShippingServices[$intShippingId]; \n } else {\n return 0;\n }\n }", "public function getServiceNameAllowableValues()\n {\n return [\n self::SERVICE_NAME_BOUNTY_MISSIONS,\n self::SERVICE_NAME_ASSASSINATION_MISSIONS,\n self::SERVICE_NAME_COURIER_MISSIONS,\n self::SERVICE_NAME_INTERBUS,\n self::SERVICE_NAME_REPROCESSING_PLANT,\n self::SERVICE_NAME_REFINERY,\n self::SERVICE_NAME_MARKET,\n self::SERVICE_NAME_BLACK_MARKET,\n self::SERVICE_NAME_STOCK_EXCHANGE,\n self::SERVICE_NAME_CLONING,\n self::SERVICE_NAME_SURGERY,\n self::SERVICE_NAME_DNA_THERAPY,\n self::SERVICE_NAME_REPAIR_FACILITIES,\n self::SERVICE_NAME_FACTORY,\n self::SERVICE_NAME_LABORATORY,\n self::SERVICE_NAME_GAMBLING,\n self::SERVICE_NAME_FITTING,\n self::SERVICE_NAME_PAINTSHOP,\n self::SERVICE_NAME_NEWS,\n self::SERVICE_NAME_STORAGE,\n self::SERVICE_NAME_INSURANCE,\n self::SERVICE_NAME_DOCKING,\n self::SERVICE_NAME_OFFICE_RENTAL,\n self::SERVICE_NAME_JUMP_CLONE_FACILITY,\n self::SERVICE_NAME_LOYALTY_POINT_STORE,\n self::SERVICE_NAME_NAVY_OFFICES,\n self::SERVICE_NAME_SECURITY_OFFICE,\n ];\n }", "public function verifyShippingDisponibility() {\n\n $return = array();\n $items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();\n $PackageWeight = 0;\n foreach ($items as $item) {\n if (($item->getProductType() == \"configurable\") || ($item->getProductType() == \"grouped\")) {\n $PackageWeight += ($item->getWeight() * (((int) $item->getQty()) - 1));\n } else {\n $PackageWeight += ($item->getWeight() * ((int) $item->getQty()));\n }\n }\n\n $customerAdressCountryCode = $this->getCustomerCountry();\n //verify destination country\n $keyOdExpressDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod1);\n $keyOdMessagerieDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod2);\n\n\n if ($keyOdExpressDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 0;\n }\n\n if ($keyOdMessagerieDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 0;\n }\n\n return $return;\n }", "public function getMappedShippingMethods(){\n\n try {\n $activeCarriers = $this->shipConfig->getActiveCarriers();\n $methods = array();\n foreach ($activeCarriers as $carrierCode => $carrierModel) {\n\n if(in_array($carrierCode, self::EXCLUDED_CARRIERS)){\n continue;\n }\n\n if(isset(WeSupplyMappings::MAPPED_CARRIER_CODES[$carrierCode])){\n $carrierCode = WeSupplyMappings::MAPPED_CARRIER_CODES[$carrierCode];\n $methods[] = $carrierCode;\n }\n }\n\n return $methods;\n\n }catch(\\Exception $e){\n $this->logger->error(\"Error on WeSupply getMappedShippingMethods: \" . $e->getMessage());\n return [];\n }\n }", "public function getRights($serviceid) {\r\n \tif(!empty($serviceid)){\r\n\t $serviceid_arr = @explode(\",\", $serviceid);\r\n\t unset($rights);\r\n\t $billingCompObj = new billing_COMPONENTS();\r\n\t for ($i = 0; $i < count($serviceid_arr); $i++) {\r\n\t $packRights = $billingCompObj->getPackRights($serviceid_arr[$i]);\r\n\t if(empty($packRights)){\r\n\t \t$rights[] = $billingCompObj->getRights($serviceid_arr[$i]);\r\n\t } else {\r\n\t \t$rights[] = $packRights;\r\n\t }\r\n\t }\r\n\t }\r\n return $rights;\r\n }", "public static function createShipmentsValidationWarning(): array\n {\n $wsdl = __DIR__ . '/../../_files/bcs-3.3.2/geschaeftskundenversand-api-3.3.2.wsdl';\n $response = __DIR__ . '/../../_files/createshipment/multiShipmentValidationWarning.xml';\n\n $authStorage = AuthenticationStorageProvider::authSuccess();\n\n $labelRequest = ShipmentRequestProvider::createMultiShipmentPartialSuccess();\n $labelResponse = \\file_get_contents($response);\n\n return [\n 'multi label partial success' => [$wsdl, $authStorage, $labelRequest, $labelResponse],\n ];\n }", "protected function processServiceListBlock($code) {\n $ret = '';\n foreach ($this->services as $service) {\n $this->serviceBeingProcessed = $service;\n $blockForService = str_replace(self::_SERVICE_, $service->name, $code);\n\n\n $processed = $this->searchForBlocksAndApplyProcessing($blockForService, self::METHOD, 'processMethodListBlock');\n if ($processed) {\n $blockForService = $processed;\n }\n\n $ret .= $blockForService;\n }\n return $ret;\n }", "public function getShippingAsOptions($servicesObject)\n\t{\n\t\t$services = array();\n\t\t$domesticServices = array();\n\t\t$domesticServiceTypes = array();\n\t\t$internationalServices = array();\n\t\t$internationalServiceTypes = array();\n\n\t\t$supportedServiceTypes = array('Flat', 'Calculated');\n\n\t\tforeach ($servicesObject as $service) {\n\t\t\t$service = get_object_vars($service);\n\n\t\t\t// service is no longer valid? exclude\n\t\t\tif (empty($service['ValidForSellingFlow'])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// the service code. eg USPSGlobalExpress\n\t\t\t$serviceCode = $service['ShippingService'];\n\n\t\t\t// the shipping carier for the service\n\t\t\t$carrier = 'Other';\n\t\t\tif (isset($service['ShippingCarrier'])) {\n\t\t\t\t$carrier = $service['ShippingCarrier'];\n\t\t\t}\n\n\t\t\t$newService = array(\n\t\t\t\t'id' \t\t=> $service['ShippingServiceID'], // numerical ID of the service\n\t\t\t\t'service'\t=> $serviceCode,\n\t\t\t\t'name'\t\t=> $service['Description'],\n\t\t\t\t'carrier'\t=> $carrier,\n\t\t\t);\n\n\t\t\t// The service types this service is valid for (Flat, Calculated, Freight etc)\n\t\t\t$serviceTypes = $service['ServiceType'];\n\t\t\tif (!is_array($serviceTypes)) {\n\t\t\t\t$serviceTypes = array($serviceTypes);\n\t\t\t}\n\n\t\t\t// The packages that are valid for this service\n\t\t\t$packages = array();\n\t\t\tif (!empty($service['ShippingPackage'])) {\n\t\t\t\t$packages = $service['ShippingPackage'];\n\t\t\t}\n\n\t\t\t$dimensionsRequired = !empty($service['DimensionsRequired']);\n\t\t\t$weightRequired = !empty($service['WeightRequired']);\n\t\t\t$expeditedService = !empty($service['ExpeditedService']);\n\n\t\t\t// Add the service into our appropriate arrays\n\t\t\tforeach ($serviceTypes as $serviceType) {\n\t\t\t\t// skip any unspported types\n\t\t\t\tif (!in_array($serviceType, $supportedServiceTypes)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// for Calculated type we should build a list of classes that are used in the select options\n\t\t\t\t$classes = array();\n\t\t\t\tif ($serviceType == 'Calculated') {\n\t\t\t\t\t$classes += $packages;\n\t\t\t\t}\n\n\t\t\t\tif ($expeditedService) {\n\t\t\t\t\t$classes[] = 'ExpeditedService';\n\t\t\t\t}\n\n\t\t\t\tif (!empty($classes)) {\n\t\t\t\t\t$classString = implode(' ', $classes);\n\t\t\t\t\t$newService['class'] = $classString;\n\t\t\t\t}\n\n\t\t\t\t// is this an international or domestic service?\n\t\t\t\tif (!empty($service['InternationalService'])) {\n\t\t\t\t\t$internationalServices[$serviceType][$carrier][$serviceCode] = $newService;\n\n\t\t\t\t\t$internationalServiceTypes[$serviceType] = GetLang('ServiceType' . $serviceType);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$domesticServices[$serviceType][$carrier][$serviceCode] = $newService;\n\n\t\t\t\t\t$domesticServiceTypes[$serviceType] = GetLang('ServiceType' . $serviceType);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$services = array(\n\t\t\t'Domestic' => array(\n\t\t\t\t'Services' \t\t=> $domesticServices,\n\t\t\t\t'ServiceTypes'\t=> $domesticServiceTypes,\n\t\t\t),\n\t\t\t'International'\t=> array(\n\t\t\t\t'Services' \t\t=> $internationalServices,\n\t\t\t\t'ServiceTypes'\t=> $internationalServiceTypes,\n\t\t\t),\n\t\t);\n\n\t\treturn $services;\n\t}", "protected function setStationCode(){\n\t\t$result = array(\"sta_code\",\"sta_code\");\n\t\treturn $result;\n\t}", "protected function setStationCode(){\n\t\t$result = array(\"sta_code\",\"sta_code\");\n\t\treturn $result;\n\t}", "public function disableCorporation() {\n $deletedGroupings = $this->deleteCorporationGroupings();\n\n return $deletedGroupings;\n }", "public function getServiceGroupsForStpl(int $serviceId)\n {\n // Get from the cache\n if (isset($this->sgRelationCache[$serviceId])) {\n return $this->sgRelationCache[$serviceId];\n }\n if ($this->doneCache == 1) {\n return [];\n }\n\n if (is_null($this->stmtStplSg)) {\n // Meaning, linked with the host or hostgroup (for the null expression)\n $this->stmtStplSg = $this->backendInstance->db->prepare(\n \"SELECT servicegroup_sg_id, host_host_id, service_service_id\n FROM servicegroup_relation\n WHERE service_service_id = :service_id\"\n );\n }\n $this->stmtStplSg->bindParam(':service_id', $serviceId, PDO::PARAM_INT);\n $this->stmtStplSg->execute();\n $this->sgRelationCache[$serviceId] = array_merge(\n $this->stmtStplSg->fetchAll(PDO::FETCH_ASSOC),\n $this->sgRelationCache[$serviceId]\n );\n return $this->sgRelationCache[$serviceId];\n }", "public function allowMultiple() {\n return false;\n }", "public function usergroupConditionMatchesMultipleUserGroupId() {}", "public function usergroupConditionMatchesMultipleUserGroupId() {}", "public function insert_multiple_service() {\r\n if (USER_ROLE == ROLE_ONE) {\r\n $inserts = json_decode($this->input->post('services'));\r\n $vouchers_ids = \",\";\r\n $flag = false;\r\n foreach ($inserts as $item) {\r\n $data['service_name'] = $item[0];\r\n $data['provided_by'] = $item[1];\r\n $data['billing_id'] = $item[2];\r\n $data['notes'] = $item[3];\r\n $data['cost'] = $item[4];\r\n $data['currency_type'] = $item[5];\r\n $data['received_date'] = $item[6];\r\n $data['insert_number'] = $item[7];\r\n $data['quantity'] = $item[8];\r\n $result = $this->service_model->add_service($data);\r\n if ($result != -1) {\r\n $vouchers_ids .= $result . \",\";\r\n $flag = true;\r\n } else if ($result == -1) {\r\n $flag = false;\r\n $result2 = $this->service_model->delete_many_services($vouchers_ids);\r\n }\r\n if ($flag != true)\r\n break;\r\n }\r\n if ($flag) {\r\n echo json_encode(array('status' => true, 'msg' => $result.\"تم إدخال البيانات بنجاح\"));\r\n } else {\r\n echo json_encode(array('status' => false, 'msg' => $result2.\"لم يتم إدخال البيانات هناك خطأ في البيانات المدخلة\"));\r\n }\r\n }\r\n }", "public function getAllowedServices()\n {\n return $this->allowed_services;\n }", "public static function updateSecurityGroups(\\PDO $dbh, int $id, array $parms, $updatedBy){\r\n $sArray = array();\r\n $stmt = $dbh->query(\"select `Group_Code` as 'Code', `Description` from `w_groups`;\");\r\n $groups = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\r\n\r\n foreach ($groups as $group) {\r\n $sArray[$group['Code']] = $group;\r\n }\r\n\r\n\r\n\r\n $secRS = new Id_SecurityGroupRS();\r\n $secRS->idName->setStoredVal($id);\r\n $rows = EditRS::select($dbh, $secRS, array($secRS->idName));\r\n\r\n foreach ($rows as $r) {\r\n $sArray[$r['Group_Code']][\"exist\"] = \"t\";\r\n }\r\n\r\n $updtd = FALSE;\r\n\r\n foreach ($sArray as $code=>$g) {\r\n\t\t\t\r\n if (isset($parms[\"grpSec_\" . $code])) {\r\n\r\n if (!isset($g[\"exist\"]) && $parms[\"grpSec_\" . $code] == \"checked\") {\r\n\r\n // new group code to put into the database\r\n $secRS = new Id_SecurityGroupRS();\r\n $secRS->idName->setNewVal($id);\r\n $secRS->Group_Code->setNewVal($code);\r\n $n = EditRS::insert($dbh, $secRS);\r\n\r\n NameLog::writeInsert($dbh, $secRS, $id, $updatedBy);\r\n $updtd = TRUE;\r\n\r\n } else if (isset($g[\"exist\"]) && $parms[\"grpSec_\" . $code] != \"checked\") {\r\n\r\n // group code to delete from the database.\r\n $secRS = new Id_SecurityGroupRS();\r\n $secRS->idName->setStoredVal($id);\r\n $secRS->Group_Code->setStoredVal($code);\r\n $n = EditRS::delete($dbh, $secRS, array($secRS->idName, $secRS->Group_Code));\r\n\r\n if ($n == 1) {\r\n NameLog::writeDelete($dbh, $secRS, $id, $updatedBy);\r\n $updtd = TRUE;\r\n }\r\n }\r\n }\r\n }\r\n return $updtd;\r\n }", "public function getAllowedMethods($allServices) {\n\n $allowedServices = explode(\",\", core()->getConfigData('sales.carriers.mpusps.services'));\n\n foreach ($allServices as $services) {\n $allowedMethod =[];\n foreach ($services as $service) {\n\n foreach ($service as $serviceType =>$fedexService) {\n if (in_array($serviceType , $allowedServices)) {\n $allowedMethod[] = [\n $serviceType => $fedexService\n ];\n } else {\n $notAllowed[] = [\n $serviceType => $fedexService\n ];\n }\n }\n }\n\n if ($allowedMethod == null) {\n continue;\n } else {\n $allowedMethods[] = $allowedMethod;\n }\n\n }\n\n if (isset($allowedMethods)) {\n\n return $this->getCommonMethods($allowedMethods);\n } else {\n return false;\n }\n }", "public function getValidSecondaryCurrencyCodes()\n {\n return $this->getEndpoint('GetValidSecondaryCurrencyCodes');\n }", "public static function restrict_shipping_methods_by_shipclass($rates)\n {\n global $woocommerce;\n $configs = OmnivaLt_Core::get_configs();\n $settings = get_option($configs['plugin']['settings_key']);\n $cart_classes_ids = array();\n\n foreach( $woocommerce->cart->get_cart() as $cart_item ) {\n $shipping_classes = get_the_terms($cart_item['product_id'], 'product_shipping_class');\n if ( empty($shipping_classes) ) {\n continue;\n }\n foreach ( $shipping_classes as $class ) {\n $cart_classes_ids[] = $class->term_id;\n }\n }\n $cart_classes_ids = array_unique($cart_classes_ids);\n\n $restricted_shipclass = $settings['restricted_shipclass'] ?? array();\n if ( ! is_array($restricted_shipclass) ) {\n $restricted_shipclass = array($restricted_shipclass);\n }\n\n foreach ( $cart_classes_ids as $cart_product_class_id ) {\n if ( in_array($cart_product_class_id, $restricted_shipclass) ) {\n foreach ( $configs['method_params'] as $ship_method => $ship_method_values ) {\n if ( ! $ship_method_values['is_shipping_method'] ) continue;\n unset($rates['omnivalt_' . $ship_method_values['key']]);\n }\n break;\n }\n }\n\n return $rates;\n }", "public static function getCodes()\n\t{\n\t\treturn [\n\t\t\tBase::Mail,\n\t\t\tBase::Call,\n\t\t\tBase::Imol,\n\t\t\tBase::Site,\n\t\t\tBase::Site24,\n\t\t\tBase::Shop24,\n\t\t\tBase::SiteDomain,\n\t\t\tBase::Button,\n\t\t\tBase::Form,\n\t\t\tBase::Callback,\n\t\t\tBase::FbLeadAds,\n\t\t\tBase::VkLeadAds,\n\t\t\tBase::Rest,\n\t\t\tBase::Order,\n\t\t\tBase::SalesCenter,\n\t\t];\n\t}" ]
[ "0.58850074", "0.49553943", "0.49392864", "0.4848271", "0.48201522", "0.4686679", "0.4649376", "0.46396685", "0.46146575", "0.45713502", "0.4563714", "0.45408788", "0.44908535", "0.44529673", "0.44430092", "0.44409707", "0.4421516", "0.4421516", "0.4415551", "0.44083655", "0.44073927", "0.43989298", "0.43979347", "0.4395287", "0.4394417", "0.4393479", "0.43905038", "0.43810615", "0.43128577", "0.4287851" ]
0.62914324
0
Group of serviceCodes that are mutually exclusive. Only one serviceCode among the list must be applied for a shipment.
public function setServiceCodeMutuallyExclusiveGroups(?array $serviceCodeMutuallyExclusiveGroups): self { $this->initialized['serviceCodeMutuallyExclusiveGroups'] = true; $this->serviceCodeMutuallyExclusiveGroups = $serviceCodeMutuallyExclusiveGroups; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getServiceCodeMutuallyExclusiveGroups(): ?array\n {\n return $this->serviceCodeMutuallyExclusiveGroups;\n }", "private function _serviceEliminateDuplicates()\n {\n return Mage::getModel('mmdebugging_blockinformation_service/match_text_eliminateduplicates', array(\n 'form' => $this->getForm(),\n 'parent_service' => $this,\n ));\n }", "public function getServiceCodeDependencyRuleGroups(): ?array\n {\n return $this->serviceCodeDependencyRuleGroups;\n }", "function build_servicegroups_array()\n{\n\tglobal $NagiosData;\n\tglobal $NagiosUser; \n\t\n\t$servicegroups = $NagiosData->getProperty('servicegroups');\t\t\t\n\t$services = $NagiosData->getProperty('services');\t\t\n\t$services = user_filtering($services,'services'); \n\t\n\t$servicegroups_details = array(); //multi-dim array to hold servicegroups \t\n\tforeach($servicegroups as $groupname => $members)\n\t{\n\t\t$servicegroups_details[$groupname] = array();\n \t\t//array_dump($members); \n\t\tforeach($services as $service)\n\t\t{\t\n\t\t\tif(isset($members[$service['host_name']]) && in_array($service['service_description'],$members[$service['host_name']]))\t{\n\t\t\t\tprocess_service_status_keys($service);\t\t\n\t\t\t\t$servicegroups_details[$groupname][] = $service;\t\t\t\n\t\t\t}\t\t\t\t\t\t\n\t\t}\n\t}\n\n\treturn $servicegroups_details; \n}", "public function getAllServices_crm() {\r\n\t\t$billingServicesObj = new billing_SERVICES();\r\n $services = $billingServicesObj->getAllServiceDataForActiveServices();\r\n foreach ($services as $key=>$val) {\r\n if (strpos($val[\"SERVICEID\"], 'M') && $val[\"SERVICEID\"] != 'M3' && $val[\"SERVICEID\"] != 'M') {\r\n \tunset($services[$key]);\r\n }\r\n }\r\n return $services;\r\n }", "public function findServiceGroups(): array;", "public function servicesArray()\n {\n return [\n self::PAINTING,\n self::TIRE,\n self::BODY_WORK,\n self::TO,\n self::WASHING,\n ];\n }", "private function supverisorGroupId(){\n return array('1');\n }", "public function getShippingServices($intShippingId = 0)\n {\n if (!$intShippingId)\n return 0;\n //Set the shipstation mapping with the X-Cart.\n $arrShippingServices = array(\n '5' => 'USPS_USPPM',//USPS Priority Mail\n '6' => 'USPS_USPEXP',//USPS Priority Mail Express\n '7' => 'USPS_USPEMI',//USPS Priority Mail Express Intl\n '8' => 'USPS_USPPMI',//USPS Priority Mail Intl\n '10' => 'USPS_USPFC',//USPS First Class Mail\n '11' => 'USPS_USPMM',//USPS Media Mail\n '13' => 'USPS_USPPM',//USPS Priority Mail\n '14' => 'USPS_USPEXP',//USPS Priority Mail Express\n '15' => 'USPS_USPEMI',//USPS Priority Mail Express Intl\n '16' => 'USPS_USPPMI',//USPS Priority Mail Intl\n '18' => 'USPS_USPFC',//USPS First Class Mail\n '19' => 'USPS_USPMM',//USPS Media Mail\n '21' => 'USPS_USPPM',//USPS Priority Mail\n '22' => 'USPS_USPEXP',//USPS Priority Mail Express\n '23' => 'USPS_USPEMI',//USPS Priority Mail Express Intl\n '24' => 'USPS_USPPMI',//USPS Priority Mail Intl\n '26' => 'UPS_UPSGND',//UPS® Ground\n '27' => 'UPS_UPS3DS',//UPS 3 Day Select®\n '28' => 'UPS_UPS2ND',//UPS 2nd Day Air®\n '29' => 'WEXPP',//UPS Worldwide Express Plus®\n '30' => 'UPS_UPSWEX',//UPS Worldwide Express®\n '31' => 'UPS_UPSNDS',//UPS Next Day Air Saver®\n '32' => 'UPS_UPSNDA',//UPS Next Day Air®\n '33' => 'UPS_UPSWEP',//UPS Worldwide Expedited®\n '34' => 'UPS_UPSWSV',//UPS Worldwide Saver®\n '35' => 'UPS_UPSCAN',//UPS Standard®\n '36' => 'UPS_UPS2DE',//UPS 2nd Day Air AM®\n '37' => 'UPS_UPSNDE',//UPS Next Day Air® Early\n '50' => 'FEDEX_GROUND',//FedEx Ground®\n '51' => 'GROUND_HOME_DELIVERY',//FedEx Home Delivery®\n '52' => 'FEDEX_2_DAY',//FedEx 2Day®\n '53' => 'FEDEX_2_DAY_AM',//FedEx 2Day® A.M.\n '54' => 'FEDEX_EXPRESS_SAVER',//FedEx Express Saver®\n '55' => 'STANDARD_OVERNIGHT',//FedEx Standard Overnight®\n '56' => 'PRIORITY_OVERNIGHT',//FedEx Priority Overnight®\n '57' => 'FIRST_OVERNIGHT',//FedEx First Overnight®\n '59' => 'INTERNATIONAL_ECONOMY',//FedEx International Economy®\n '60' => 'INTERNATIONAL_PRIORITY',//FedEx International Priority®\n '61' => 'INTERNATIONAL_FIRST',//FedEx International First®\n '67' => 'FEDEX_1_DAY_FREIGHT',//FedEx 1Day® Freight\n '68' => 'FEDEX_2_DAY_FREIGHT',//FedEx 2Day® Freight\n '69' => 'FEDEX_3_DAY_FREIGHT',//FedEx 3Day® Freight\n '70' => 'INTERNATIONAL_ECONOMY_FREIGHT',//FedEx International Economy® Freight\n '71' => 'INTERNATIONAL_PRIORITY_FREIGHT',//FedEx International Priority® Freight\n '73' => 'FEDEX_FDXIGND',//FedEx International Ground®\n '98' => 'DOM.RP',//Regular Parcel\n '99' => 'DOM.EP',//Expedited Parcel\n '100' => 'DOM.XP',//Xpresspost\n '101' => 'DOM.XP.CERT',//Xpresspost Certified\n '102' => 'DOM.PC',//Priority\n '103' => 'DOM.LIB',//Library Books\n '104' => 'USA.EP',//Expedited Parcel USA\n '105' => 'USA.PW.ENV',//Priority Worldwide Envelope USA\n '106' => 'USA.PW.PAK',//Priority Worldwide pak USA\n '107' => 'USA.PW.PARCEL',//Priority Worldwide Parcel USA\n '115' => 'INT.PW.ENV',//Priority Worldwide Envelope Intl\n '116' => 'INT.PW.PAK',//Priority Worldwide pak Intl\n '117' => 'INT.PW.PARCEL',//Priority Worldwide parcel Intl\n '118' => 'INT.SP.AIR',//Small Packet International Air\n '119' => 'INT.SP.SURF',//Small Packet International Surface\n '120' => 'INT.TP',//Tracked Packet - International\n '2700' => 'USPS_USPFC',//USPS First Class Mail\n '2701' => 'USPS_USPMM',//USPS Media Mail\n '2709' => 'USPS_USPPM',//USPS Priority Mail\n '2732' => 'USPS_USPPMI',//USPS Priority Mail International\n '2735' => 'USPS_USPEMI',//USPS Priority Mail Express International\n '2760' => 'UPS_UPSGND',//UPS Ground\n '2762' => 'UPS_UPS3DS',//UPS 3 Day Select\n '2763' => 'UPS_UPS2DE',//UPS 2nd Day Air\n '2765' => 'UPS_UPSNDAS',//UPS Next Day Air Saver\n '2766' => 'UPS_UPSNDA',//UPS Next Day Air\n );\n\n if (isset($arrShippingServices[$intShippingId])) {\n return $arrShippingServices[$intShippingId]; \n } else {\n return 0;\n }\n }", "public function getServiceNameAllowableValues()\n {\n return [\n self::SERVICE_NAME_BOUNTY_MISSIONS,\n self::SERVICE_NAME_ASSASSINATION_MISSIONS,\n self::SERVICE_NAME_COURIER_MISSIONS,\n self::SERVICE_NAME_INTERBUS,\n self::SERVICE_NAME_REPROCESSING_PLANT,\n self::SERVICE_NAME_REFINERY,\n self::SERVICE_NAME_MARKET,\n self::SERVICE_NAME_BLACK_MARKET,\n self::SERVICE_NAME_STOCK_EXCHANGE,\n self::SERVICE_NAME_CLONING,\n self::SERVICE_NAME_SURGERY,\n self::SERVICE_NAME_DNA_THERAPY,\n self::SERVICE_NAME_REPAIR_FACILITIES,\n self::SERVICE_NAME_FACTORY,\n self::SERVICE_NAME_LABORATORY,\n self::SERVICE_NAME_GAMBLING,\n self::SERVICE_NAME_FITTING,\n self::SERVICE_NAME_PAINTSHOP,\n self::SERVICE_NAME_NEWS,\n self::SERVICE_NAME_STORAGE,\n self::SERVICE_NAME_INSURANCE,\n self::SERVICE_NAME_DOCKING,\n self::SERVICE_NAME_OFFICE_RENTAL,\n self::SERVICE_NAME_JUMP_CLONE_FACILITY,\n self::SERVICE_NAME_LOYALTY_POINT_STORE,\n self::SERVICE_NAME_NAVY_OFFICES,\n self::SERVICE_NAME_SECURITY_OFFICE,\n ];\n }", "public function verifyShippingDisponibility() {\n\n $return = array();\n $items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();\n $PackageWeight = 0;\n foreach ($items as $item) {\n if (($item->getProductType() == \"configurable\") || ($item->getProductType() == \"grouped\")) {\n $PackageWeight += ($item->getWeight() * (((int) $item->getQty()) - 1));\n } else {\n $PackageWeight += ($item->getWeight() * ((int) $item->getQty()));\n }\n }\n\n $customerAdressCountryCode = $this->getCustomerCountry();\n //verify destination country\n $keyOdExpressDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod1);\n $keyOdMessagerieDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod2);\n\n\n if ($keyOdExpressDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 0;\n }\n\n if ($keyOdMessagerieDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 0;\n }\n\n return $return;\n }", "public function getMappedShippingMethods(){\n\n try {\n $activeCarriers = $this->shipConfig->getActiveCarriers();\n $methods = array();\n foreach ($activeCarriers as $carrierCode => $carrierModel) {\n\n if(in_array($carrierCode, self::EXCLUDED_CARRIERS)){\n continue;\n }\n\n if(isset(WeSupplyMappings::MAPPED_CARRIER_CODES[$carrierCode])){\n $carrierCode = WeSupplyMappings::MAPPED_CARRIER_CODES[$carrierCode];\n $methods[] = $carrierCode;\n }\n }\n\n return $methods;\n\n }catch(\\Exception $e){\n $this->logger->error(\"Error on WeSupply getMappedShippingMethods: \" . $e->getMessage());\n return [];\n }\n }", "public function getRights($serviceid) {\r\n \tif(!empty($serviceid)){\r\n\t $serviceid_arr = @explode(\",\", $serviceid);\r\n\t unset($rights);\r\n\t $billingCompObj = new billing_COMPONENTS();\r\n\t for ($i = 0; $i < count($serviceid_arr); $i++) {\r\n\t $packRights = $billingCompObj->getPackRights($serviceid_arr[$i]);\r\n\t if(empty($packRights)){\r\n\t \t$rights[] = $billingCompObj->getRights($serviceid_arr[$i]);\r\n\t } else {\r\n\t \t$rights[] = $packRights;\r\n\t }\r\n\t }\r\n\t }\r\n return $rights;\r\n }", "public static function createShipmentsValidationWarning(): array\n {\n $wsdl = __DIR__ . '/../../_files/bcs-3.3.2/geschaeftskundenversand-api-3.3.2.wsdl';\n $response = __DIR__ . '/../../_files/createshipment/multiShipmentValidationWarning.xml';\n\n $authStorage = AuthenticationStorageProvider::authSuccess();\n\n $labelRequest = ShipmentRequestProvider::createMultiShipmentPartialSuccess();\n $labelResponse = \\file_get_contents($response);\n\n return [\n 'multi label partial success' => [$wsdl, $authStorage, $labelRequest, $labelResponse],\n ];\n }", "protected function processServiceListBlock($code) {\n $ret = '';\n foreach ($this->services as $service) {\n $this->serviceBeingProcessed = $service;\n $blockForService = str_replace(self::_SERVICE_, $service->name, $code);\n\n\n $processed = $this->searchForBlocksAndApplyProcessing($blockForService, self::METHOD, 'processMethodListBlock');\n if ($processed) {\n $blockForService = $processed;\n }\n\n $ret .= $blockForService;\n }\n return $ret;\n }", "public function getShippingAsOptions($servicesObject)\n\t{\n\t\t$services = array();\n\t\t$domesticServices = array();\n\t\t$domesticServiceTypes = array();\n\t\t$internationalServices = array();\n\t\t$internationalServiceTypes = array();\n\n\t\t$supportedServiceTypes = array('Flat', 'Calculated');\n\n\t\tforeach ($servicesObject as $service) {\n\t\t\t$service = get_object_vars($service);\n\n\t\t\t// service is no longer valid? exclude\n\t\t\tif (empty($service['ValidForSellingFlow'])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// the service code. eg USPSGlobalExpress\n\t\t\t$serviceCode = $service['ShippingService'];\n\n\t\t\t// the shipping carier for the service\n\t\t\t$carrier = 'Other';\n\t\t\tif (isset($service['ShippingCarrier'])) {\n\t\t\t\t$carrier = $service['ShippingCarrier'];\n\t\t\t}\n\n\t\t\t$newService = array(\n\t\t\t\t'id' \t\t=> $service['ShippingServiceID'], // numerical ID of the service\n\t\t\t\t'service'\t=> $serviceCode,\n\t\t\t\t'name'\t\t=> $service['Description'],\n\t\t\t\t'carrier'\t=> $carrier,\n\t\t\t);\n\n\t\t\t// The service types this service is valid for (Flat, Calculated, Freight etc)\n\t\t\t$serviceTypes = $service['ServiceType'];\n\t\t\tif (!is_array($serviceTypes)) {\n\t\t\t\t$serviceTypes = array($serviceTypes);\n\t\t\t}\n\n\t\t\t// The packages that are valid for this service\n\t\t\t$packages = array();\n\t\t\tif (!empty($service['ShippingPackage'])) {\n\t\t\t\t$packages = $service['ShippingPackage'];\n\t\t\t}\n\n\t\t\t$dimensionsRequired = !empty($service['DimensionsRequired']);\n\t\t\t$weightRequired = !empty($service['WeightRequired']);\n\t\t\t$expeditedService = !empty($service['ExpeditedService']);\n\n\t\t\t// Add the service into our appropriate arrays\n\t\t\tforeach ($serviceTypes as $serviceType) {\n\t\t\t\t// skip any unspported types\n\t\t\t\tif (!in_array($serviceType, $supportedServiceTypes)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// for Calculated type we should build a list of classes that are used in the select options\n\t\t\t\t$classes = array();\n\t\t\t\tif ($serviceType == 'Calculated') {\n\t\t\t\t\t$classes += $packages;\n\t\t\t\t}\n\n\t\t\t\tif ($expeditedService) {\n\t\t\t\t\t$classes[] = 'ExpeditedService';\n\t\t\t\t}\n\n\t\t\t\tif (!empty($classes)) {\n\t\t\t\t\t$classString = implode(' ', $classes);\n\t\t\t\t\t$newService['class'] = $classString;\n\t\t\t\t}\n\n\t\t\t\t// is this an international or domestic service?\n\t\t\t\tif (!empty($service['InternationalService'])) {\n\t\t\t\t\t$internationalServices[$serviceType][$carrier][$serviceCode] = $newService;\n\n\t\t\t\t\t$internationalServiceTypes[$serviceType] = GetLang('ServiceType' . $serviceType);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$domesticServices[$serviceType][$carrier][$serviceCode] = $newService;\n\n\t\t\t\t\t$domesticServiceTypes[$serviceType] = GetLang('ServiceType' . $serviceType);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$services = array(\n\t\t\t'Domestic' => array(\n\t\t\t\t'Services' \t\t=> $domesticServices,\n\t\t\t\t'ServiceTypes'\t=> $domesticServiceTypes,\n\t\t\t),\n\t\t\t'International'\t=> array(\n\t\t\t\t'Services' \t\t=> $internationalServices,\n\t\t\t\t'ServiceTypes'\t=> $internationalServiceTypes,\n\t\t\t),\n\t\t);\n\n\t\treturn $services;\n\t}", "protected function setStationCode(){\n\t\t$result = array(\"sta_code\",\"sta_code\");\n\t\treturn $result;\n\t}", "protected function setStationCode(){\n\t\t$result = array(\"sta_code\",\"sta_code\");\n\t\treturn $result;\n\t}", "public function disableCorporation() {\n $deletedGroupings = $this->deleteCorporationGroupings();\n\n return $deletedGroupings;\n }", "public function allowMultiple() {\n return false;\n }", "public function getServiceGroupsForStpl(int $serviceId)\n {\n // Get from the cache\n if (isset($this->sgRelationCache[$serviceId])) {\n return $this->sgRelationCache[$serviceId];\n }\n if ($this->doneCache == 1) {\n return [];\n }\n\n if (is_null($this->stmtStplSg)) {\n // Meaning, linked with the host or hostgroup (for the null expression)\n $this->stmtStplSg = $this->backendInstance->db->prepare(\n \"SELECT servicegroup_sg_id, host_host_id, service_service_id\n FROM servicegroup_relation\n WHERE service_service_id = :service_id\"\n );\n }\n $this->stmtStplSg->bindParam(':service_id', $serviceId, PDO::PARAM_INT);\n $this->stmtStplSg->execute();\n $this->sgRelationCache[$serviceId] = array_merge(\n $this->stmtStplSg->fetchAll(PDO::FETCH_ASSOC),\n $this->sgRelationCache[$serviceId]\n );\n return $this->sgRelationCache[$serviceId];\n }", "public function usergroupConditionMatchesMultipleUserGroupId() {}", "public function usergroupConditionMatchesMultipleUserGroupId() {}", "public function insert_multiple_service() {\r\n if (USER_ROLE == ROLE_ONE) {\r\n $inserts = json_decode($this->input->post('services'));\r\n $vouchers_ids = \",\";\r\n $flag = false;\r\n foreach ($inserts as $item) {\r\n $data['service_name'] = $item[0];\r\n $data['provided_by'] = $item[1];\r\n $data['billing_id'] = $item[2];\r\n $data['notes'] = $item[3];\r\n $data['cost'] = $item[4];\r\n $data['currency_type'] = $item[5];\r\n $data['received_date'] = $item[6];\r\n $data['insert_number'] = $item[7];\r\n $data['quantity'] = $item[8];\r\n $result = $this->service_model->add_service($data);\r\n if ($result != -1) {\r\n $vouchers_ids .= $result . \",\";\r\n $flag = true;\r\n } else if ($result == -1) {\r\n $flag = false;\r\n $result2 = $this->service_model->delete_many_services($vouchers_ids);\r\n }\r\n if ($flag != true)\r\n break;\r\n }\r\n if ($flag) {\r\n echo json_encode(array('status' => true, 'msg' => $result.\"تم إدخال البيانات بنجاح\"));\r\n } else {\r\n echo json_encode(array('status' => false, 'msg' => $result2.\"لم يتم إدخال البيانات هناك خطأ في البيانات المدخلة\"));\r\n }\r\n }\r\n }", "public function getAllowedServices()\n {\n return $this->allowed_services;\n }", "public static function updateSecurityGroups(\\PDO $dbh, int $id, array $parms, $updatedBy){\r\n $sArray = array();\r\n $stmt = $dbh->query(\"select `Group_Code` as 'Code', `Description` from `w_groups`;\");\r\n $groups = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\r\n\r\n foreach ($groups as $group) {\r\n $sArray[$group['Code']] = $group;\r\n }\r\n\r\n\r\n\r\n $secRS = new Id_SecurityGroupRS();\r\n $secRS->idName->setStoredVal($id);\r\n $rows = EditRS::select($dbh, $secRS, array($secRS->idName));\r\n\r\n foreach ($rows as $r) {\r\n $sArray[$r['Group_Code']][\"exist\"] = \"t\";\r\n }\r\n\r\n $updtd = FALSE;\r\n\r\n foreach ($sArray as $code=>$g) {\r\n\t\t\t\r\n if (isset($parms[\"grpSec_\" . $code])) {\r\n\r\n if (!isset($g[\"exist\"]) && $parms[\"grpSec_\" . $code] == \"checked\") {\r\n\r\n // new group code to put into the database\r\n $secRS = new Id_SecurityGroupRS();\r\n $secRS->idName->setNewVal($id);\r\n $secRS->Group_Code->setNewVal($code);\r\n $n = EditRS::insert($dbh, $secRS);\r\n\r\n NameLog::writeInsert($dbh, $secRS, $id, $updatedBy);\r\n $updtd = TRUE;\r\n\r\n } else if (isset($g[\"exist\"]) && $parms[\"grpSec_\" . $code] != \"checked\") {\r\n\r\n // group code to delete from the database.\r\n $secRS = new Id_SecurityGroupRS();\r\n $secRS->idName->setStoredVal($id);\r\n $secRS->Group_Code->setStoredVal($code);\r\n $n = EditRS::delete($dbh, $secRS, array($secRS->idName, $secRS->Group_Code));\r\n\r\n if ($n == 1) {\r\n NameLog::writeDelete($dbh, $secRS, $id, $updatedBy);\r\n $updtd = TRUE;\r\n }\r\n }\r\n }\r\n }\r\n return $updtd;\r\n }", "public function getAllowedMethods($allServices) {\n\n $allowedServices = explode(\",\", core()->getConfigData('sales.carriers.mpusps.services'));\n\n foreach ($allServices as $services) {\n $allowedMethod =[];\n foreach ($services as $service) {\n\n foreach ($service as $serviceType =>$fedexService) {\n if (in_array($serviceType , $allowedServices)) {\n $allowedMethod[] = [\n $serviceType => $fedexService\n ];\n } else {\n $notAllowed[] = [\n $serviceType => $fedexService\n ];\n }\n }\n }\n\n if ($allowedMethod == null) {\n continue;\n } else {\n $allowedMethods[] = $allowedMethod;\n }\n\n }\n\n if (isset($allowedMethods)) {\n\n return $this->getCommonMethods($allowedMethods);\n } else {\n return false;\n }\n }", "public function getValidSecondaryCurrencyCodes()\n {\n return $this->getEndpoint('GetValidSecondaryCurrencyCodes');\n }", "public static function restrict_shipping_methods_by_shipclass($rates)\n {\n global $woocommerce;\n $configs = OmnivaLt_Core::get_configs();\n $settings = get_option($configs['plugin']['settings_key']);\n $cart_classes_ids = array();\n\n foreach( $woocommerce->cart->get_cart() as $cart_item ) {\n $shipping_classes = get_the_terms($cart_item['product_id'], 'product_shipping_class');\n if ( empty($shipping_classes) ) {\n continue;\n }\n foreach ( $shipping_classes as $class ) {\n $cart_classes_ids[] = $class->term_id;\n }\n }\n $cart_classes_ids = array_unique($cart_classes_ids);\n\n $restricted_shipclass = $settings['restricted_shipclass'] ?? array();\n if ( ! is_array($restricted_shipclass) ) {\n $restricted_shipclass = array($restricted_shipclass);\n }\n\n foreach ( $cart_classes_ids as $cart_product_class_id ) {\n if ( in_array($cart_product_class_id, $restricted_shipclass) ) {\n foreach ( $configs['method_params'] as $ship_method => $ship_method_values ) {\n if ( ! $ship_method_values['is_shipping_method'] ) continue;\n unset($rates['omnivalt_' . $ship_method_values['key']]);\n }\n break;\n }\n }\n\n return $rates;\n }", "public static function getCodes()\n\t{\n\t\treturn [\n\t\t\tBase::Mail,\n\t\t\tBase::Call,\n\t\t\tBase::Imol,\n\t\t\tBase::Site,\n\t\t\tBase::Site24,\n\t\t\tBase::Shop24,\n\t\t\tBase::SiteDomain,\n\t\t\tBase::Button,\n\t\t\tBase::Form,\n\t\t\tBase::Callback,\n\t\t\tBase::FbLeadAds,\n\t\t\tBase::VkLeadAds,\n\t\t\tBase::Rest,\n\t\t\tBase::Order,\n\t\t\tBase::SalesCenter,\n\t\t];\n\t}" ]
[ "0.6291504", "0.49534437", "0.49397144", "0.48473418", "0.48183835", "0.46865356", "0.46495193", "0.4640016", "0.46138838", "0.45725414", "0.45638192", "0.45411426", "0.44887283", "0.44548804", "0.44414827", "0.443988", "0.44215247", "0.44215247", "0.44161674", "0.4409899", "0.44066286", "0.4399541", "0.4398549", "0.43957764", "0.43937293", "0.4392775", "0.43907523", "0.4380723", "0.43122646", "0.4288137" ]
0.58839995
1
Dependency rule groups for a particular serviceCode.
public function getServiceCodeDependencyRuleGroups(): ?array { return $this->serviceCodeDependencyRuleGroups; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setServiceCodeDependencyRuleGroups(?array $serviceCodeDependencyRuleGroups): self\n {\n $this->initialized['serviceCodeDependencyRuleGroups'] = true;\n $this->serviceCodeDependencyRuleGroups = $serviceCodeDependencyRuleGroups;\n\n return $this;\n }", "public function testGetRuleGroups()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "private function getServiceGroups(int $serviceId)\n {\n $host = Host::getInstance($this->dependencyInjector);\n $servicegroup = ServiceGroup::getInstance($this->dependencyInjector);\n $this->serviceCache[$serviceId]['sg'] = $servicegroup->getServiceGroupsForStpl($serviceId);\n foreach ($this->serviceCache[$serviceId]['sg'] as &$sg) {\n if ($host->isHostTemplate($this->currentHostId, $sg['host_host_id'])) {\n $servicegroup->addServiceInSg(\n $sg['servicegroup_sg_id'],\n $this->currentServiceId,\n $this->currentServiceDescription,\n $this->currentHostId,\n $this->currentHostName\n );\n Relations\\ServiceGroupRelation::getInstance($this->dependencyInjector)->addRelationHostService(\n $sg['servicegroup_sg_id'],\n $sg['host_host_id'],\n $serviceId\n );\n }\n }\n }", "public function testCreateRuleGroup()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "private function createResourceGroups()\n {\n foreach ($this->api->getServices() as $service) {\n $this->resourceGroups[] = new ResourceGroup($service);\n }\n }", "function build_servicegroups_array()\n{\n\tglobal $NagiosData;\n\tglobal $NagiosUser; \n\t\n\t$servicegroups = $NagiosData->getProperty('servicegroups');\t\t\t\n\t$services = $NagiosData->getProperty('services');\t\t\n\t$services = user_filtering($services,'services'); \n\t\n\t$servicegroups_details = array(); //multi-dim array to hold servicegroups \t\n\tforeach($servicegroups as $groupname => $members)\n\t{\n\t\t$servicegroups_details[$groupname] = array();\n \t\t//array_dump($members); \n\t\tforeach($services as $service)\n\t\t{\t\n\t\t\tif(isset($members[$service['host_name']]) && in_array($service['service_description'],$members[$service['host_name']]))\t{\n\t\t\t\tprocess_service_status_keys($service);\t\t\n\t\t\t\t$servicegroups_details[$groupname][] = $service;\t\t\t\n\t\t\t}\t\t\t\t\t\t\n\t\t}\n\t}\n\n\treturn $servicegroups_details; \n}", "private static final function parseRules($code)\n {\n $rules = array();\n foreach (preg_split(\"#\\r?\\n#\", $code) as $line) {\n if (!preg_match('#^(?<input>\\w+)\\s+to\\s+(?<output>\\w+)\\s+as\\s+(?<relationship>\\w+)(\\s+(?<options>.+))?$#', $line, $match))\n continue;\n\n $rule = new stdClass();\n\n $rule->input = $match['input' ];\n $rule->output = $match['output'];\n $rule->relationship = $match['relationship' ];\n if (!isset($match['options']))\n $rule->options = array();\n else\n $rule->options = preg_split('#\\s+#', $match['options']);\n\n $rules[] = $rule;\n }\n\n return $rules;\n }", "public function getGroupedRules(): array;", "public function testDeleteRuleGroups()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function findServiceGroups(): array;", "public function getServiceGroupsForStpl(int $serviceId)\n {\n // Get from the cache\n if (isset($this->sgRelationCache[$serviceId])) {\n return $this->sgRelationCache[$serviceId];\n }\n if ($this->doneCache == 1) {\n return [];\n }\n\n if (is_null($this->stmtStplSg)) {\n // Meaning, linked with the host or hostgroup (for the null expression)\n $this->stmtStplSg = $this->backendInstance->db->prepare(\n \"SELECT servicegroup_sg_id, host_host_id, service_service_id\n FROM servicegroup_relation\n WHERE service_service_id = :service_id\"\n );\n }\n $this->stmtStplSg->bindParam(':service_id', $serviceId, PDO::PARAM_INT);\n $this->stmtStplSg->execute();\n $this->sgRelationCache[$serviceId] = array_merge(\n $this->stmtStplSg->fetchAll(PDO::FETCH_ASSOC),\n $this->sgRelationCache[$serviceId]\n );\n return $this->sgRelationCache[$serviceId];\n }", "public function testAggregateRuleGroups()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function getGroupSchemas($regionCode, $modelCode, $modificationCode, $groupCode)\n {/* {\n $groupSchemas[$aData['num_image']] = array(Constants::NAME => $aData['num_image'], Constants::OPTIONS => array(\n Constants::CD => $aData['catalog'].$aData['sub_dir'].$aData['sub_wheel'],\n \t'num_model' => $aNumModel['num_model'],\n 'num_image' => $aData['num_image']\n ));\n }*/\n\t\t$groupSchemas = array();\n return $groupSchemas;\n }", "public function getGroupSchemas($regionCode, $modelCode, $modificationCode, $groupCode)\n {/* {\n $groupSchemas[$aData['num_image']] = array(Constants::NAME => $aData['num_image'], Constants::OPTIONS => array(\n Constants::CD => $aData['catalog'].$aData['sub_dir'].$aData['sub_wheel'],\n \t'num_model' => $aNumModel['num_model'],\n 'num_image' => $aData['num_image']\n ));\n }*/\n\t\t$groupSchemas = array();\n return $groupSchemas;\n }", "public function group() {\n\t\t$this->addRule($v = new ValidationRuleGroup($this));\n\t\treturn $v;\n\t}", "public function getServiceGroupsForService(int $hostId, int $serviceId)\n {\n // Get from the cache\n if (isset($this->sgRelationCache[$serviceId])) {\n return $this->sgRelationCache[$serviceId];\n }\n if ($this->doneCache == 1) {\n return [];\n }\n\n if (is_null($this->stmtServiceSg)) {\n // Meaning, linked with the host or hostgroup (for the null expression)\n $this->stmtServiceSg = $this->backendInstance->db->prepare(\n \"SELECT servicegroup_sg_id, host_host_id, service_service_id\n FROM servicegroup_relation\n WHERE service_service_id = :service_id\n AND (host_host_id = :host_id OR host_host_id IS NULL)\"\n );\n }\n $this->stmtServiceSg->bindParam(':service_id', $serviceId, PDO::PARAM_INT);\n $this->stmtServiceSg->bindParam(':host_id', $hostId, PDO::PARAM_INT);\n $this->stmtServiceSg->execute();\n $this->sgRelationCache[$serviceId] = array_merge(\n $this->stmtServiceSg->fetchAll(PDO::FETCH_ASSOC),\n $this->sgRelationCache[$serviceId]\n );\n return $this->sgRelationCache[$serviceId];\n }", "private function _loadRules()\n\t{\n\t\t//load rules\n\t\trequire_once( PROJECT_ROOT . '/data/configs/groups/global.php' );\n\n\t\t//TODO: make group selector\n\t\tif ( is_array( $this->_auth->getGroups( ) ) )\n\t\t{\n\t\t\t//load active group\n\t\t\t$activeGroup = $this->_auth->getActiveGroup();\n\n\t\t\tif ( !$activeGroup\n\t\t\t || !file_exists( PROJECT_ROOT . '/data/configs/groups/' . $activeGroup . '.php' )\n\t\t\t)\n\t\t\t{\n\t\t\t\tforeach ( $this->_auth->getGroups() as $groupId )\n\t\t\t\t{\n\t\t\t\t\t$ruleFile = PROJECT_ROOT . '/data/configs/groups/' . $groupId . '.php';\n\t\t\t\t\tif ( file_exists( $ruleFile ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$activeGroup = $groupId;\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 ( $activeGroup )\n\t\t\t{\n\t\t\t\trequire_once( PROJECT_ROOT . '/data/configs/groups/' . $activeGroup . '.php' );\n\t\t\t\t$this->_auth->setActiveGroup( $activeGroup );\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\t\treturn;\n\t}", "public function getGroups() {}", "public function testQueryRuleGroups()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function rules() : array\n {\n return [\n 'service.service_type_id' => 'required',\n// 'service.currency_id' => 'required',\n// 'service.user_exchange_rate' => 'required',\n 'service.service_model_id' => 'required',\n// 'service_item.*.*' => 'required_if:service.payment_method_id,3296',\n// 'service_item.*.*' => 'required_if:service.payment_method_id,3296',\n// 'service_item.*.item_id' => 'required',\n// 'service_item.*.quantity' => 'required',\n// 'service_item.*.unit_cost' => 'required',\n// 'service_item.*.total' => 'required',\n// 'service_item.*.unit_id' => 'required',\n// 'service_item_direct.*.*' => 'required_if:service.payment_method_id,3297',\n\n ];\n }", "public function rules()\n {\n\n $services = [\n 'services.basic.*.*' => 'numeric',\n 'services.additional.*' => 'numeric',\n 'services.custom.*.name' => 'required|string',\n 'services.custom.*.1' => 'numeric',\n 'services.custom.*.2' => 'numeric',\n 'services.custom.*.3' => 'numeric',\n 'services.custom.*.4' => 'numeric',\n ];\n\n $rules = [\n 'name' => 'required|string|max:60',\n 'type' => 'required',\n 'email' => 'nullable|email',\n// 'phone' => 'regex:',\n 'location' => 'nullable|json',\n 'city' => 'nullable|string',\n 'address' => 'nullable|string',\n 'image' => 'nullable|image',\n 'posts' => 'nullable|integer',\n 'schedule.*.*' => 'required',\n// 'requisites' => 'required'\n ];\n\n return array_merge($rules, $services);\n }", "public function testUpdateRuleGroup()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function rules()\n {\n $types = TypeService::get();\n $codes = $types->pluck('code')->toArray();\n\n return [\n 'service_type' => Rule::in($codes),\n 'start_date' => 'date_format:Y-m-d',\n 'end_date' => 'date_format:Y-m-d',\n 'page_number' => 'integer|min:1',\n 'page_size' => 'integer|min:1',\n ];\n }", "public function groups();", "public function groups();", "public function setServiceCodeMutuallyExclusiveGroups(?array $serviceCodeMutuallyExclusiveGroups): self\n {\n $this->initialized['serviceCodeMutuallyExclusiveGroups'] = true;\n $this->serviceCodeMutuallyExclusiveGroups = $serviceCodeMutuallyExclusiveGroups;\n\n return $this;\n }", "public function getServiceCodeMutuallyExclusiveGroups(): ?array\n {\n return $this->serviceCodeMutuallyExclusiveGroups;\n }", "function new_groups()\n {\n \n }", "public function rules()\n {\n switch($this->method())\n {\n case 'GET':\n case 'DELETE':\n case 'POST':\n {\n return [\n 'project_id' => 'required|integer',\n 'name' => 'required|string|unique:groups,name,' . $this->get('name') . ',id,project_id,' . $this->project_id,\n 'enabled' => 'required|boolean'\n ];\n }\n case 'PUT':\n case 'PATCH':\n {\n return [\n 'project_id' => 'required|integer',\n 'name' => 'required|string|unique:groups,name,' . $this->get('id') . ',id,project_id,' . $this->project_id,\n 'enabled' => 'required|boolean'\n ];\n }\n default:break;\n }\n }", "public function rules()\n {\n $this->rule = Refund::$ServiceProcessMap;\n return [\n 'id' => 'required',\n 'handle' => Rule::in(array_keys($this->rule)),\n ];\n }" ]
[ "0.6945669", "0.5391789", "0.53563416", "0.51035523", "0.5008549", "0.50082374", "0.4981849", "0.4923943", "0.48742232", "0.4836029", "0.48235476", "0.48104113", "0.47624975", "0.47624975", "0.4750398", "0.47161323", "0.46397656", "0.46376863", "0.46341503", "0.4630065", "0.46132982", "0.4604138", "0.45810232", "0.45490232", "0.45490232", "0.4525668", "0.45192063", "0.4476655", "0.44722882", "0.44624475" ]
0.70263803
0
Dependency rule groups for a particular serviceCode.
public function setServiceCodeDependencyRuleGroups(?array $serviceCodeDependencyRuleGroups): self { $this->initialized['serviceCodeDependencyRuleGroups'] = true; $this->serviceCodeDependencyRuleGroups = $serviceCodeDependencyRuleGroups; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getServiceCodeDependencyRuleGroups(): ?array\n {\n return $this->serviceCodeDependencyRuleGroups;\n }", "public function testGetRuleGroups()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "private function getServiceGroups(int $serviceId)\n {\n $host = Host::getInstance($this->dependencyInjector);\n $servicegroup = ServiceGroup::getInstance($this->dependencyInjector);\n $this->serviceCache[$serviceId]['sg'] = $servicegroup->getServiceGroupsForStpl($serviceId);\n foreach ($this->serviceCache[$serviceId]['sg'] as &$sg) {\n if ($host->isHostTemplate($this->currentHostId, $sg['host_host_id'])) {\n $servicegroup->addServiceInSg(\n $sg['servicegroup_sg_id'],\n $this->currentServiceId,\n $this->currentServiceDescription,\n $this->currentHostId,\n $this->currentHostName\n );\n Relations\\ServiceGroupRelation::getInstance($this->dependencyInjector)->addRelationHostService(\n $sg['servicegroup_sg_id'],\n $sg['host_host_id'],\n $serviceId\n );\n }\n }\n }", "public function testCreateRuleGroup()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "private function createResourceGroups()\n {\n foreach ($this->api->getServices() as $service) {\n $this->resourceGroups[] = new ResourceGroup($service);\n }\n }", "function build_servicegroups_array()\n{\n\tglobal $NagiosData;\n\tglobal $NagiosUser; \n\t\n\t$servicegroups = $NagiosData->getProperty('servicegroups');\t\t\t\n\t$services = $NagiosData->getProperty('services');\t\t\n\t$services = user_filtering($services,'services'); \n\t\n\t$servicegroups_details = array(); //multi-dim array to hold servicegroups \t\n\tforeach($servicegroups as $groupname => $members)\n\t{\n\t\t$servicegroups_details[$groupname] = array();\n \t\t//array_dump($members); \n\t\tforeach($services as $service)\n\t\t{\t\n\t\t\tif(isset($members[$service['host_name']]) && in_array($service['service_description'],$members[$service['host_name']]))\t{\n\t\t\t\tprocess_service_status_keys($service);\t\t\n\t\t\t\t$servicegroups_details[$groupname][] = $service;\t\t\t\n\t\t\t}\t\t\t\t\t\t\n\t\t}\n\t}\n\n\treturn $servicegroups_details; \n}", "private static final function parseRules($code)\n {\n $rules = array();\n foreach (preg_split(\"#\\r?\\n#\", $code) as $line) {\n if (!preg_match('#^(?<input>\\w+)\\s+to\\s+(?<output>\\w+)\\s+as\\s+(?<relationship>\\w+)(\\s+(?<options>.+))?$#', $line, $match))\n continue;\n\n $rule = new stdClass();\n\n $rule->input = $match['input' ];\n $rule->output = $match['output'];\n $rule->relationship = $match['relationship' ];\n if (!isset($match['options']))\n $rule->options = array();\n else\n $rule->options = preg_split('#\\s+#', $match['options']);\n\n $rules[] = $rule;\n }\n\n return $rules;\n }", "public function getGroupedRules(): array;", "public function testDeleteRuleGroups()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function findServiceGroups(): array;", "public function getServiceGroupsForStpl(int $serviceId)\n {\n // Get from the cache\n if (isset($this->sgRelationCache[$serviceId])) {\n return $this->sgRelationCache[$serviceId];\n }\n if ($this->doneCache == 1) {\n return [];\n }\n\n if (is_null($this->stmtStplSg)) {\n // Meaning, linked with the host or hostgroup (for the null expression)\n $this->stmtStplSg = $this->backendInstance->db->prepare(\n \"SELECT servicegroup_sg_id, host_host_id, service_service_id\n FROM servicegroup_relation\n WHERE service_service_id = :service_id\"\n );\n }\n $this->stmtStplSg->bindParam(':service_id', $serviceId, PDO::PARAM_INT);\n $this->stmtStplSg->execute();\n $this->sgRelationCache[$serviceId] = array_merge(\n $this->stmtStplSg->fetchAll(PDO::FETCH_ASSOC),\n $this->sgRelationCache[$serviceId]\n );\n return $this->sgRelationCache[$serviceId];\n }", "public function testAggregateRuleGroups()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function getGroupSchemas($regionCode, $modelCode, $modificationCode, $groupCode)\n {/* {\n $groupSchemas[$aData['num_image']] = array(Constants::NAME => $aData['num_image'], Constants::OPTIONS => array(\n Constants::CD => $aData['catalog'].$aData['sub_dir'].$aData['sub_wheel'],\n \t'num_model' => $aNumModel['num_model'],\n 'num_image' => $aData['num_image']\n ));\n }*/\n\t\t$groupSchemas = array();\n return $groupSchemas;\n }", "public function getGroupSchemas($regionCode, $modelCode, $modificationCode, $groupCode)\n {/* {\n $groupSchemas[$aData['num_image']] = array(Constants::NAME => $aData['num_image'], Constants::OPTIONS => array(\n Constants::CD => $aData['catalog'].$aData['sub_dir'].$aData['sub_wheel'],\n \t'num_model' => $aNumModel['num_model'],\n 'num_image' => $aData['num_image']\n ));\n }*/\n\t\t$groupSchemas = array();\n return $groupSchemas;\n }", "public function group() {\n\t\t$this->addRule($v = new ValidationRuleGroup($this));\n\t\treturn $v;\n\t}", "public function getServiceGroupsForService(int $hostId, int $serviceId)\n {\n // Get from the cache\n if (isset($this->sgRelationCache[$serviceId])) {\n return $this->sgRelationCache[$serviceId];\n }\n if ($this->doneCache == 1) {\n return [];\n }\n\n if (is_null($this->stmtServiceSg)) {\n // Meaning, linked with the host or hostgroup (for the null expression)\n $this->stmtServiceSg = $this->backendInstance->db->prepare(\n \"SELECT servicegroup_sg_id, host_host_id, service_service_id\n FROM servicegroup_relation\n WHERE service_service_id = :service_id\n AND (host_host_id = :host_id OR host_host_id IS NULL)\"\n );\n }\n $this->stmtServiceSg->bindParam(':service_id', $serviceId, PDO::PARAM_INT);\n $this->stmtServiceSg->bindParam(':host_id', $hostId, PDO::PARAM_INT);\n $this->stmtServiceSg->execute();\n $this->sgRelationCache[$serviceId] = array_merge(\n $this->stmtServiceSg->fetchAll(PDO::FETCH_ASSOC),\n $this->sgRelationCache[$serviceId]\n );\n return $this->sgRelationCache[$serviceId];\n }", "private function _loadRules()\n\t{\n\t\t//load rules\n\t\trequire_once( PROJECT_ROOT . '/data/configs/groups/global.php' );\n\n\t\t//TODO: make group selector\n\t\tif ( is_array( $this->_auth->getGroups( ) ) )\n\t\t{\n\t\t\t//load active group\n\t\t\t$activeGroup = $this->_auth->getActiveGroup();\n\n\t\t\tif ( !$activeGroup\n\t\t\t || !file_exists( PROJECT_ROOT . '/data/configs/groups/' . $activeGroup . '.php' )\n\t\t\t)\n\t\t\t{\n\t\t\t\tforeach ( $this->_auth->getGroups() as $groupId )\n\t\t\t\t{\n\t\t\t\t\t$ruleFile = PROJECT_ROOT . '/data/configs/groups/' . $groupId . '.php';\n\t\t\t\t\tif ( file_exists( $ruleFile ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$activeGroup = $groupId;\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 ( $activeGroup )\n\t\t\t{\n\t\t\t\trequire_once( PROJECT_ROOT . '/data/configs/groups/' . $activeGroup . '.php' );\n\t\t\t\t$this->_auth->setActiveGroup( $activeGroup );\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\t\treturn;\n\t}", "public function getGroups() {}", "public function testQueryRuleGroups()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function rules() : array\n {\n return [\n 'service.service_type_id' => 'required',\n// 'service.currency_id' => 'required',\n// 'service.user_exchange_rate' => 'required',\n 'service.service_model_id' => 'required',\n// 'service_item.*.*' => 'required_if:service.payment_method_id,3296',\n// 'service_item.*.*' => 'required_if:service.payment_method_id,3296',\n// 'service_item.*.item_id' => 'required',\n// 'service_item.*.quantity' => 'required',\n// 'service_item.*.unit_cost' => 'required',\n// 'service_item.*.total' => 'required',\n// 'service_item.*.unit_id' => 'required',\n// 'service_item_direct.*.*' => 'required_if:service.payment_method_id,3297',\n\n ];\n }", "public function rules()\n {\n\n $services = [\n 'services.basic.*.*' => 'numeric',\n 'services.additional.*' => 'numeric',\n 'services.custom.*.name' => 'required|string',\n 'services.custom.*.1' => 'numeric',\n 'services.custom.*.2' => 'numeric',\n 'services.custom.*.3' => 'numeric',\n 'services.custom.*.4' => 'numeric',\n ];\n\n $rules = [\n 'name' => 'required|string|max:60',\n 'type' => 'required',\n 'email' => 'nullable|email',\n// 'phone' => 'regex:',\n 'location' => 'nullable|json',\n 'city' => 'nullable|string',\n 'address' => 'nullable|string',\n 'image' => 'nullable|image',\n 'posts' => 'nullable|integer',\n 'schedule.*.*' => 'required',\n// 'requisites' => 'required'\n ];\n\n return array_merge($rules, $services);\n }", "public function testUpdateRuleGroup()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function rules()\n {\n $types = TypeService::get();\n $codes = $types->pluck('code')->toArray();\n\n return [\n 'service_type' => Rule::in($codes),\n 'start_date' => 'date_format:Y-m-d',\n 'end_date' => 'date_format:Y-m-d',\n 'page_number' => 'integer|min:1',\n 'page_size' => 'integer|min:1',\n ];\n }", "public function groups();", "public function groups();", "public function setServiceCodeMutuallyExclusiveGroups(?array $serviceCodeMutuallyExclusiveGroups): self\n {\n $this->initialized['serviceCodeMutuallyExclusiveGroups'] = true;\n $this->serviceCodeMutuallyExclusiveGroups = $serviceCodeMutuallyExclusiveGroups;\n\n return $this;\n }", "public function getServiceCodeMutuallyExclusiveGroups(): ?array\n {\n return $this->serviceCodeMutuallyExclusiveGroups;\n }", "function new_groups()\n {\n \n }", "public function rules()\n {\n switch($this->method())\n {\n case 'GET':\n case 'DELETE':\n case 'POST':\n {\n return [\n 'project_id' => 'required|integer',\n 'name' => 'required|string|unique:groups,name,' . $this->get('name') . ',id,project_id,' . $this->project_id,\n 'enabled' => 'required|boolean'\n ];\n }\n case 'PUT':\n case 'PATCH':\n {\n return [\n 'project_id' => 'required|integer',\n 'name' => 'required|string|unique:groups,name,' . $this->get('id') . ',id,project_id,' . $this->project_id,\n 'enabled' => 'required|boolean'\n ];\n }\n default:break;\n }\n }", "public function rules()\n {\n $this->rule = Refund::$ServiceProcessMap;\n return [\n 'id' => 'required',\n 'handle' => Rule::in(array_keys($this->rule)),\n ];\n }" ]
[ "0.70263803", "0.5391789", "0.53563416", "0.51035523", "0.5008549", "0.50082374", "0.4981849", "0.4923943", "0.48742232", "0.4836029", "0.48235476", "0.48104113", "0.47624975", "0.47624975", "0.4750398", "0.47161323", "0.46397656", "0.46376863", "0.46341503", "0.4630065", "0.46132982", "0.4604138", "0.45810232", "0.45490232", "0.45490232", "0.4525668", "0.45192063", "0.4476655", "0.44722882", "0.44624475" ]
0.6945669
1
otp send to user
public function sendOTP(Request $request){ $user = $this->_getUserByCondtion(['email'=>$request->email]); if(!$user){ return Response('This email is not associated with us!',406); } $request->session()->put('changePasswordEmail',$user->email); $otp=rand(1000,9999); $request->session()->put('otp',$otp); $data=array( 'name'=> 'parking hub', 'message'=>$otp ); try { Mail::to($request->email)->send(new sendmail($data)); } catch (Exception $e) { return response('Oops! Something went wrong, Please try again',500); } $email=$user->email; //'OPT sent to your email address, Please check your inbox' return response('Enter your otp',200); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function send_otp_to_user($email=null,$phone=null,$otp)\n {\n //send if phone number not null\n if($phone != null)\n {\n $otprequest = \"http://tra.bulksmsinhyderabad.co.in/websms/sendsms.aspx?userid=BIGEQP&password=BIGEQP&sender=BIGEQP&mobileno=\".$phone.\"&msg=\".urlencode('Thanks for Registering with Big Equipments India. Your OTP: '.$otp);\n $curl_handle=curl_init();\n curl_setopt($curl_handle, CURLOPT_URL,$otprequest);\n curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);\n $query = curl_exec($curl_handle);\n curl_close($curl_handle);\n $query = Yii::$app->db;\n $query->createCommand()->update('core_users', ['otp_code' => \"$otp\"], \"phone_number = '$phone'\")->execute();\n }\n //send if email not null\n if($email != null)\n {\n $query = Yii::$app->db;\n $query->createCommand()->update('core_users', ['otp_code' => \"$otp\"], \"email = '$email'\")->execute();\n \n $query = new Query;\n $user_details = $query->select('user_name')->from('core_users')->where(\"email = '$email'\")->one();\n //send mail to user\n $subject=\"Big Equipments India | USER REGISTRATION\";\n $message = Mail_settings::get_otp_message($otp,$user_details['user_name']);\n \n Mail_settings::send_email_notification($email,$subject,$message);\n \n }\n return true;\n }", "public function resend_otp()\n\t{\n // $_SESSION['mobile_no']\n // $_SESSION['vno'] (--- this is the OTP ---)\n sleep(1);\n echo true;\n }", "public function sendOtp(Request $request)\n {\n \n $user = $request->auth_user;\n\n if($user->full_mobile_number == '') {\n return $this->api->json(false, 'ADD_MOBILE_NUMBER', 'Add mobile number first. Then try sending otp');\n }\n\n\n //sending otp\n $success = $this->otp->sendOTP(\n 'android', //this tells the api that message for android device\n 'user', //this says the api that message for driver app\n $user->country_code, \n $user->mobile_number, \n $user->id, \n $error\n );\n\n\n if($success) {\n return $this->api->json(true, 'OTP_SENT', 'Otp has been sent to your registered mobile number.');\n } else {\n return $this->api->json(false, 'OTP_SEND_FAILED', 'Failed to send otp. Try again.');\n }\n\n\n }", "public function requestOTP(string $payeerid);", "public function send_forgot_otp_to_user($email=null,$phone=null,$otp)\n {\n //send if phone number not null\n if($phone != null)\n {\n $otprequest = \"http://tra.bulksmsinhyderabad.co.in/websms/sendsms.aspx?userid=BIGEQP&password=BIGEQP&sender=BIGEQP&mobileno=\".$phone.\"&msg=\".urlencode('Thank you for contacting about your forgotten password. Your OTP: '.$otp);\n $curl_handle=curl_init();\n curl_setopt($curl_handle, CURLOPT_URL,$otprequest);\n curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);\n $query = curl_exec($curl_handle);\n curl_close($curl_handle);\n $query = Yii::$app->db;\n $query->createCommand()->update('core_users', ['otp_code' => \"$otp\"], \"phone_number = '$phone'\")->execute();\n }\n //send if email not null\n if($email != null)\n {\n $query = Yii::$app->db;\n $query->createCommand()->update('core_users', ['otp_code' => \"$otp\"], \"email = '$email'\")->execute();\n \n $query = new Query;\n $user_details = $query->select('user_name')->from('core_users')->where(\"email = '$email'\")->one();\n //send mail to user\n $subject=\"Big Equipments India | Forgot Password\";\n $message = Mail_settings::get_forgot_otp_message($otp,$user_details['user_name']);\n \n Mail_settings::send_email_notification($email,$subject,$message);\n \n }\n return true;\n }", "public function retrieveOTP() {\n\t\tif ( ! wp_verify_nonce( HTTP_Helper::retrieveGet( 'nonce' ), 'defRetrieveOTP' ) ) {\n\t\t\twp_send_json_error( array() );\n\t\t}\n\t\t\n\t\t$token = HTTP_Helper::retrieveGet( 'token' );\n\t\t$query = new \\WP_User_Query( array(\n\t\t\t'meta_key' => 'defOTPLoginToken',\n\t\t\t'meta_value' => $token,\n\t\t\t'blog_id' => 0\n\t\t) );\n\t\t$res = $query->get_results();\n\t\tif ( empty( $res ) ) {\n\t\t\t//no user\n\t\t\twp_send_json_error( array(\n\t\t\t\t'message' => __( \"Your token is invalid\", \"defender-security\" )\n\t\t\t) );\n\t\t}\n\t\t\n\t\t$user = $res[0];\n\t\t//create a backup code for this user\n\t\t$code = Auth_API::createBackupCode( $user->ID );\n\t\t//send email\n\t\t$backupEmail = Auth_API::getBackupEmail( $user->ID );\n\t\t\n\t\t$settings = Auth_Settings::instance();\n\t\t$subject = ! empty( $settings->email_subject ) ? esc_attr( $settings->email_subject ) : __( 'Your OTP code', \"defender-security\" );\n\t\t$sender = ! empty( $settings->email_sender ) ? esc_attr( $settings->email_sender ) : false;\n\t\t$body = ! empty( $settings->email_body ) ? $settings->email_body : $settings->two_factor_opt_email_default_body();\n\t\t$params = [\n\t\t\t'display_name' => $user->display_name,\n\t\t\t'passcode' => $code,\n\t\t];\n\t\tforeach ( $params as $key => $val ) {\n\t\t\t$body = str_replace( '{{' . $key . '}}', $val, $body );\n\t\t}\n\t\t$headers = array( 'Content-Type: text/html; charset=UTF-8' );\n\t\tif ( $sender ) {\n\t\t\t$from_email = get_bloginfo( 'admin_email' );\n\t\t\t$headers[] = sprintf( 'From: %s <%s>', $sender, $from_email );\n\t\t}\n\t\t\n\t\t//send\n\t\twp_mail( $backupEmail, $subject, $body, $headers );\n\t\t\n\t\twp_send_json_success( array(\n\t\t\t'message' => __( \"Your code has been sent to your email.\", \"defender-security\" )\n\t\t) );\n\t}", "public function view_otp() {\r\n if (!Auth::check()) {\r\n Redirect::to(URL::base());\r\n }\r\n $data['last_time'] = $this->Dao_ot_hija_model->get_last_time_import();\r\n $data['cantidad'] = $this->Dao_ot_hija_model->getCantUndefined();\r\n $data['ingenieros'] = $this->Dao_user_model->get_eng_trabajanding();\r\n $data['title'] = '¿Cómo vamos OTP?'; // cargar el titulo en la pestaña de la pagina para otp\r\n $this->load->view('parts/headerF', $data);\r\n $this->load->view('moduleOtp');\r\n $this->load->view('parts/footerF');\r\n }", "public function sendOTP_post()\n {\n $phone = $this->input->post('phone');\n $otp = $this->generateRandomString();\n $check = $this->User_model->select_data('*',\"tbl_otp\",array('phone'=>$phone));\n if (empty($check)) {\n $this->User_model->insert_data('tbl_otp',array('phone'=>$phone,'otp'=>$otp,'addedOn'=>date(\"Y-m-d H:i:s\")));\n } else {\n $this->User_model->update_data('tbl_otp',array('otp'=>$otp,'updatedOn'=>date(\"Y-m-d H:i:s\")),array('phone'=>$phone));\n }\n\n\n $msg = array('to'=>$phone,'body'=>\"Your verification code for Kudos is: $otp\");\n // print_r($this->twilioMessage()); die;\n $this->twilioMessage($msg);\n $status = 1;\n $response = array();\n\n if ( $status == 0 ) {\n $response['status'] = 'error';\n $response['message'] = 'This failed';\n } else {\n $response['status'] = 'success';\n $response['message'] = 'OTP sent successfully';\n $response['otp'] = $otp;\n }\n\n //echo json_encode($response);\n $this->set_response($response, REST_Controller::HTTP_OK);\n /* Twilio sms verification End */\n }", "function sendOtpSMS($username, $encryp_password, $senderid, $message, $mobileno, $deptSecureKey) {\n $key = hash('sha512', trim($username) . trim($senderid) . trim($message) . trim($deptSecureKey));\n $data = array(\n \"username\" => trim($username),\n \"password\" => trim($encryp_password),\n \"senderid\" => trim($senderid),\n \"content\" => trim($message),\n \"smsservicetype\" => \"otpmsg\",\n \"mobileno\" => trim($mobileno),\n \"key\" => trim($key)\n );\n post_to_url(\"https://msdgweb.mgov.gov.in/esms/sendsmsrequest\", $data); //calling post_to_url to send otp sms \n}", "public function otp_email($email='',$otp='')\n {\n $data['otp'] = $otp;\n $this->load->config('email');\n $this->load->library('email');\n $from = $this->config->item('smtp_user');\n $msg = $this->load->view('email/v_otpVerify', $data, true);\n $this->email->set_newline(\"\\r\\n\");\n $this->email->from($from , 'ShaadiBaraati');\n $this->email->to($email);\n $this->email->subject('Verification Code'); \n $this->email->message($msg);\n if($this->email->send()) \n {\n return true; \n }\n else\n {\n return false;\n }\n }", "public function c_get_otp_by_id_user() {\r\n $inge_id = $this->input->post('iduser');\r\n $ots = $this->Dao_ot_padre_model->get_otp_by_id_user($inge_id);\r\n echo json_encode($ots);\r\n }", "function mark_otp()\r\n\t{\r\n \r\n\t\t$ip = $_SERVER['REMOTE_ADDR'];\r\n\t\t$markid = $this->MOD->decode($this->input->post('id'));\r\n\t\t$subcode = $this->input->post('ccode');\r\n\t\t$sesid = $this->MOD->decode($this->input->post('session'));\r\n\t$staffid = $this->session->userdata('username');\r\n\t$row= $this->SM->get_staffmobile($staffid);\r\n\t\t\t$mobile = $row->MOBILE ;\r\n\t\t\t\r\n\t\t\t$username = \"dcdcoe\";\r\n\t\t\t$mypassword = \"DCacoe@123\";\r\n\t\t\t$sendername = \"ACOEUD\";\r\n\t\t\t$domain = \"bhashsms.com/api/\";\r\n\t\t\t$type = \"normal\";\r\n\t\t\t$priority=\"ndnd\";\r\n\t\t\t$rndno=rand(100000, 999999);\r\n\t\t\techo $otp = urlencode($rndno);\r\n\t\t\t$method = \"POST\";\r\n\t\t\t$username = urlencode($username);\r\n\t\t\t$password = urlencode($mypassword);\r\n\t\t\t$sendername = urlencode($sendername);\r\n\t\t\t$message = urlencode('This is an OTP for Mark entry '.$otp.' by ACOE(UDs).Dont share this with anyone. ');\r\n\t\t\t$parameters = \"user=\".$username.\"&pass=\".$mypassword.\"&sender=\".$sendername.\"&phone=\".$mobile.\"&text=\".$message.\"&priority=\".$priority.\"&stype=\".$type ;\r\n\t\t\t$apiurl = \"http://\".$domain.\"/sendmsg.php\";\r\n\t\t\t$get_url = $apiurl.\"?\".$parameters;\r\n\t\t\t//echo $get_url;\r\n\t\t\t$ch = curl_init($apiurl);\r\n\t\t\tif($method == \"POST\")\r\n\t\t\t{\r\n\t\t\t\tcurl_setopt($ch, CURLOPT_POST,1);\r\n\t\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS,$parameters);\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\t$get_url = $apiurl.\"?\".$parameters;\r\n\t\t\t\techo $get_url;\r\n\t\t\t\tcurl_setopt($ch, CURLOPT_POST,0);\r\n\t\t\t\tcurl_setopt($ch, CURLOPT_URL, $get_url);\r\n\t\t\t}\r\n\r\n\t\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);\r\n\t\t\tcurl_setopt($ch, CURLOPT_HEADER,0);\r\n\t\t\t// DO NOT RETURN HTTP HEADERS\r\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\r\n\t\t\t// RETURN THE CONTENTS OF THE CALL\r\n\t\t\t$return_val = curl_exec($ch);\r\n\t\t\t\r\n\t\t\t$this->session->set_userdata('otp', $rndno);\r\n\t\t\t$this->session->unset_userdata('otp');\r\n\t\t\t$data = array(\r\n 'OTP' => $rndno\r\n );\r\n\t\t\t$value = $this->SM->mark_status($staffid);\r\n $this->session->set_userdata($data);\r\n\t\t\tif($return_val==\"\"){echo \"Process Failed, Please check domain, username and password.\";} else {echo $return_val;}\r\n\t\tdate_default_timezone_set('Asia/Kolkata');\r\n\t\t\t$data1 = array(\r\n\t\t\t'MARKID' =>$markid,\r\n\t\t\t'SUBCODE'=>$subcode,\r\n\t\t\t'STAFFID'=>$staffid,\r\n\t\t\t'OTP' => $rndno,\r\n\t\t\t'SESID'=>37,\r\n\t\t\t'USER_IP'=>$ip,\r\n\t\t\t'STATUS' =>1,\r\n\t\t\t'IN_DATE' => date('d-m-Y h:i:sa'),\r\n\t\t);\r\n\t\t\t \r\n\t\t\t//print_r($data1);\r\n\t\t$value = $this->SM->mark_entry($data1);\r\n\t\t\r\n\t\t\t//$query = $this->db->insert('MARKENTRY_OTP', $data1);\r\n\t\t\t// print_r($query);\r\n\t\t\t\t\r\n\t\t//$result = $this->SM->otpstore($data1);\r\n\t\t\t$this->session->set_userdata($data1) ;\r\n\t\t\t$data1=$this->session->set_flashdata('msg', '<div class=\"alert alert-danger text-center\">Note: <strong>OTP</strong> sent to ur registered mobile number and E-Mail address !..............</div>');\r\n\t\t\t//added for sending OTP in email\t\r\n\t\t\t$this->load->library('email');\r\n\t\t\t$staffid = ($this->session->userdata('username'));\r\n $data = array('USERNAME' => $staffid);\r\n\r\n $this->db->select('EMAIL');\r\n $this->db->where($data);\r\n $query = $this->db->get('STAFF_LOGIN');\r\n\t\t $row = $query->row();\r\n\t\t\t$this->email->from('[email protected]', 'ACOEUD');\r\n\t\t\t$this->email->to($row->EMAIL);\r\n\t\t\t$this->email->cc('[email protected]');\r\n\t\t\t//$this->email->bcc('[email protected]');\r\n\t\t\t$this->email->subject('OTP for Mark Entry in SEMS');\r\n\t\t\t$this->email->message('This is an OTP for Mark Entry in SEMS '.$otp.' by ACOE(UDs).Dont share this with anyone. ');\r\n\t\t\t//$this->email->send();\r\n\t\t\t/*\r\n\t\t\tif (!$this->email->send())\r\n\t\t\t{\r\n\t\t\t// Generate error\r\n\t\t\t$data1=$this->session->set_flashdata('msg', '<div class=\"alert alert-danger text-center\">Error: <strong>OTP</strong> is not sent to the E-Mail ID!..............</div>');\r\n\t\t\t} */\r\n\t\t//\tredirect('Load_Controller');\r\n\t\t \t\t\t\t\r\n\t\t}", "public function otp()\n {\n return $this->otp;\n }", "public function sendOtp($phone){\n $cc = \"+91\";\n $this->db->select('otp')->from('otp')->where('phone',$phone);\n $q = $this->db->get();\n if($q->num_rows() == 0){\n $otp = rand(1000,9999);\n $data = array(\n 'phone' => $phone,\n 'otp' => $otp\n );\n $this->db->insert('otp',$data);\n }else{\n $res = $q->result();\n $otp = $res[0]->otp;\n }\n \n // if send sms successful\n return 1;\n }", "public function verify_otp_post(){\n $pdata = file_get_contents(\"php://input\");\n $data = json_decode($pdata,true);\n\n $required_parameter = array('otp','user_id');\n $chk_error = $this->controller->check_required_value($required_parameter, $data);\n if ($chk_error) \n {\n $resp = array('code' => 'MISSING_PARAM', 'message' => 'Missing ' . strtoupper($chk_error['param']));\n @$this->response($resp);\n }\n\n $otp = $data['otp'];\n $user_id = $data['user_id'];\n\n $where = array(\n 'user_id' => $user_id,\n 'otp' => $otp\n ); \n\n $verify = $this->model->getAllwhere('otp_master',$where);\n if(!empty($verify)){\n $update = array('is_active'=> 1);\n $this->model->updateFields('users',$update,array('id'=>$user_id));\n $this->model->delete('otp_master',array('user_id'=>$user_id));\n $resp = array(\n 'rccode' => 1,\n 'message' => 'Otp Verify Successfully', \n );\n }else{\n $resp = array(\n 'rccode' => 2,\n 'message' => 'Please Enter Valid Otp', \n );\n } \n\n $this->response($resp); \n }", "function generate_otp()\n {\n return substr(hexdec(bin2hex(openssl_random_pseudo_bytes(3))), 0, 4);\n }", "public function getOtp() : string\n {\n return $this->otp;\n }", "public function mp_hook_otp($req){\n\n\t\t// if we have no mobileID here\n\t\tif(!$this->env_is('mp_mobile:mobileID')){\n\n\t\t\t// log error\n\t\t\te::logtrigger('No mobileID given, when mp_hook_otp() is loaded ('.h::encode_php($this->us_get('persistID')).', mp = '.h::encode_php($this->us_get_like('mp:')).')');\n\n\t\t\t// load error page\n\t\t\treturn $this->load_page('otp/error', 500);\n\t\t\t}\n\n\t\t// calculate demand for abo\n\t\t$demand = (!$this->env_get('mp_mobile:product_access') or (h::gX($req, 'demand_contingent') and $this->env_get('mp_mobile:product_contingent') < 1));\n\n\t\t// define it we have to proceed a previous process\n\t\t$proceed = ($this->us_get('mp:otp:otpID') and !$this->us_get('mp:otp:finished'));\n\n\t\t// if no process is needed\n\t\tif(!$demand and !$proceed){\n\n\t\t\t// if a previous process was successful finished\n\t\t\tif($this->us_get('mp:otp:finished') and $this->us_get('mp:otp:status') == 200){\n\n\t\t\t\t// continue with no processing\n\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t// check if identify confirmation is needed (and return page handle)\n\t\t\t$page_handle = $this->mp_hook_identify_confirm();\n\t\t\tif($page_handle !== null) return $page_handle;\n\n\t\t\t/// check if payment reconfirmation is needed (and return page handle)\n\t\t\t$page_handle = $this->mp_hook_payment_reconfirm('otp');\n\t\t\tif($page_handle !== null) return $page_handle;\n\n\t\t\t// continue with no processing\n\t\t\treturn null;\n\t\t\t}\n\n\t\t// check if a new process is needed\n\t\tif(!$proceed){\n\n\t\t\t// check if payment is not possible (and return page handle)\n\t\t\t$page_handle = $this->mp_hook_payment_not_possible('otp');\n\t\t\tif($page_handle !== null) return $page_handle;\n\t\t\t}\n\n\t\t// if no status is given, or process already finish and is resetable\n\t\tif(!$this->us_get('mp:otp:status') or ($this->us_get('mp:otp:finished') and $this->us_get('mp:otp:resetable'))){\n\n\t\t\t// (re)start process\n\t\t\t$this->mp_client_payment('otp', 'open', $req);\n\n\t\t\t// if the actual status is an error status\n\t\t\tif($this->us_get('mp:otp:status') >= 400){\n\n\t\t\t\t// on fail state (only for payment)\n\t\t\t\tif(in_array($this->us_get('mp:otp:status'), [401,402,403])){\n\n\t\t\t\t\t// run payment redirect switch\n\t\t\t\t\t$page_handle = $this->mp_hook_payment_redirect_switch();\n\t\t\t\t\tif($page_handle !== null) return $page_handle;\n\t\t\t\t\t}\n\n\t\t\t\t// load error page\n\t\t\t\treturn $this->load_page('otp/error', $this->us_get('mp:otp:status'));\n\t\t\t\t}\n\t\t\t}\n\n\t\t// if abort payment parameter is set\n\t\tif(h::cR('abortpayment')){\n\n\t\t\t// set payment status to unauthorized\n\t\t\t$this->us_set([\n\t\t\t\t'mp:otp:status' \t=> 401,\n\t\t\t\t'mp:otp:finished'\t=> true,\n\t\t\t\t'mp:otp:resetable'\t=> true,\n\t\t\t\t]);\n\n\t\t\t// load error page\n\t\t\treturn $this->load_page('otp/error', $this->us_get('mp:otp:status'));\n\t\t\t}\n\n\t\t// if payment confirmation is needed and no param for offer and confirm step is given\n\t\tif($this->us_get('mp:otp:status') == 100 and !h::cR('orderotp') and !h::cR('confirmotp')){\n\n\t\t\t// if an offer page should be displayed\n\t\t\tif($this->mp_has_page('own_offer')){\n\n\t\t\t\t// load own offer page\n\t\t\t\treturn $this->load_page('otp/offer/operator_'.$this->env_get('mp_mobile:operatorID'), $this->us_get('mp:otp:status'));\n\t\t\t\t}\n\t\t\t}\n\n\t\t// if payment confirmation is needed and no param for confirm step is given\n\t\tif($this->us_get('mp:otp:status') == 100 and !h::cR('confirmotp')){\n\n\t\t\t// if an confirmation page should be displayed\n\t\t\tif($this->mp_has_page('mdk_confirmation') or $this->mp_has_page('own_confirmation')){\n\n\t\t\t\t// define post processing function for templates\n\t\t\t\t$postprocessing_fn = function($template){\n\n\t\t\t\t\t// define replacements for own confirmation page\n\t\t\t\t\t$replace = [\n\t\t\t\t\t\t'$PRODUCT_URL' \t=> $this->us_same_url('?confirmotp=1'),\n\t\t\t\t\t\t'$ERROR_URL' \t=> $this->us_url('/'),\n\t\t\t\t\t\t];\n\n\t\t\t\t\t// return replaced template\n\t\t\t\t\treturn str_replace(array_keys($replace), array_values($replace), $template);\n\t\t\t\t\t};\n\n\t\t\t\t// load mdk or own confirmation page\n\t\t\t\treturn $this->mp_has_page('mdk_confirmation')\n\t\t\t\t\t? $this->load_page('otp/confirm_mdk/operator_'.$this->env_get('mp_mobile:operatorID'), $this->us_get('mp:otp:status'), $postprocessing_fn, false)\n\t\t\t\t\t: $this->load_page('otp/confirm/operator_'.$this->env_get('mp_mobile:operatorID'), $this->us_get('mp:otp:status'), $postprocessing_fn);\n\t\t\t\t}\n\t\t\t}\n\n\t\t// continue process in submitted state (redirection can happen)\n\t\t$this->mp_client_payment('otp', 'submitted', $req);\n\n\t\t// if pending state\n\t\tif($this->us_get('mp:otp:status') == 102){\n\n\t\t\t// load sms or normal pending page\n\t\t\treturn $this->mp_has_page('own_sms_pending')\n\t\t\t\t? $this->load_page('otp/pending_sms/operator_'.$this->env_get('mp_mobile:operatorID'), $this->us_get('mp:otp:status'))\n\t\t\t\t: $this->load_page('otp/pending', $this->us_get('mp:otp:status'));\n\t\t\t}\n\n\t\t// on success state\n\t\tif($this->us_get('mp:otp:status') == 200){\n\n\t\t\t// show own success page or continue with no processing\n\t\t\treturn $this->mp_has_page('own_success')\n\t\t\t\t? $this->load_page('otp/success/operator_'.$this->env_get('mp_mobile:operatorID'), $this->us_get('mp:otp:status'))\n\t\t\t\t: null;\n\t\t\t}\n\n\t\t// on fail state (only for payment)\n\t\tif(in_array($this->us_get('mp:otp:status'), [401,402,403])){\n\n\t\t\t// run payment redirect switch\n\t\t\t$page_handle = $this->mp_hook_payment_redirect_switch();\n\t\t\tif($page_handle !== null) return $page_handle;\n\t\t\t}\n\n\t\t// everything here means error, so load error page\n\t\treturn $this->load_page('otp/error', $this->us_get('mp:otp:status'));\n\t\t}", "public function sendOtp(): bool\n {\n $appName = Yii::$app->name;\n $otp = $this->generateOtp();\n\n return Yii::$app->mailer->compose()\n ->setFrom(Yii::$app->params['mailer.from'])\n ->setTo($this->getEmail())\n ->setSubject(\"OTP confirmations - {$appName}\")\n ->setHtmlBody(\"Hi, <br/> Please use the following OTP <b>{$otp}</b> to verify your email id.\")\n ->queue();\n }", "public function genOTP($email, $phone, $uname, $transId = null) {\n\t\t$this->processing_code = \"1028\";\n\t\t$data = new stdClass();\n\t\tif($transId == null)\n\t\t\t$data->request_id = \"GOTP\" . date(\"Ymd\") . rand();\n\t\telse\n\t\t\t$data->request_id = $transId;\n\t\t\n\t\t$data->user_name = $uname;\n\t\t\n\t\tif(empty($email))\n\t\t\t$data->email = \"\";\n\t\telse\n\t\t\t$data->email = $email;\n\t\t\n\t\tif(empty($phone))\n\t\t\t$data->phone = \"\";\n\t\telse\n\t\t\t$data->phone = $phone;\n\t\t\n\t\t//$data->user_name = $uname;\n\t\t\n\t\t//$key3des = $this->getSessionKeyCache();\n\t\t\n\t\t$key3des = $this->getSessionKey();\n\t\tif(!$key3des)\n\t\t\treturn false;\n\t\t\n\t\t\n\t\tlog_message('error', 'data request genOTP: ' . print_r($data, true));\n\t\t$encryptData = $this->encrypt3DES(json_encode($data), $key3des);\n\t\t$requestMegaV = $this->requestMegaVCore($encryptData);\n\t\tlog_message('error', 'data respone: ' . print_r($requestMegaV, true));\n\t\t\n\t\t//$requestMegaV = '{\"status\":\"18\"}';\n\t\t\n\t\treturn $requestMegaV;\n\t}", "public function againOTP(Request $request)\n {\n $template_html = 'mail.forgot_password';\n\n // Create OTP\n $genREF = $this->strRandom_ref();\n $genOTP = $this->strRandom_otp();\n\n $user = Users::where('username', decrypt($request->username))->first();\n\n $template_data = [\n\n 'ref' => $genREF,\n 'otp' => $genOTP\n ];\n $otp = new Otp();\n $otp->username = decrypt($request->username);\n $otp->ref = $genREF;\n $otp->otp = $genOTP;\n\n if ($otp->save()) {\n Mail::send($template_html, $template_data, function ($msg) use ($user) {\n $msg->subject('ลืมรหัสผ่าน === Forgot');\n $msg->to([$user->email]);\n $msg->from('[email protected]', 'ClickNext');\n });\n\n $info = [\n 'email' => encrypt($user->email),\n 'username' => encrypt($user->username),\n 'ref' => encrypt($otp->ref)\n ];\n\n return $this->responseRequestSuccess($info);\n }\n }", "public function Request_otp($user_master_id,$service_order_id)\n\t{\n\t\t$sql = \"SELECT * FROM service_orders WHERE id ='\".$service_order_id.\"' AND serv_pers_id = '\".$user_master_id.\"'\";\n\t\t$user_result = $this->db->query($sql);\n\n\t\tif($user_result->num_rows()>0)\n\t\t{\n\t\t\tforeach ($user_result->result() as $rows)\n\t\t\t{\n\t\t\t\t $contact_person_number = $rows->contact_person_number;\n\t\t\t}\n\n\t\t\t$digits = 4;\n\t\t\t$OTP = str_pad(rand(0, pow(10, $digits)-1), $digits, '0', STR_PAD_LEFT);\n\n\t\t\t$update_sql = \"UPDATE service_orders SET service_otp = '\".$OTP.\"', updated_at=NOW() WHERE id ='\".$service_order_id.\"'\";\n\t\t\t$update_result = $this->db->query($update_sql);\n\n\t\t\t$update_sql = \"UPDATE service_orders SET status = 'Started', start_datetime =NOW() ,updated_by = '\".$user_master_id.\"', updated_at =NOW() WHERE id ='\".$service_order_id.\"'\";\n\t\t\t$update_result = $this->db->query($update_sql);\n\n\t\t\t$sQuery = \"INSERT INTO service_order_history (service_order_id,serv_prov_id,status,created_at,created_by) VALUES ('\". $service_order_id . \"','\". $user_master_id . \"','Started',NOW(),'\". $user_master_id . \"')\";\n\t\t\t$ins_query = $this->db->query($sQuery);\n\n\t\t\t $message_details = \"Dear Customer - Service OTP :\".$OTP;\n\t\t\t$this->sendSMS($contact_person_number,$message_details);\n\n\t\t\t$response = array(\"status\" => \"success\", \"msg\" => \"OTP send\");\n\t\t} else {\n\t\t\t$response = array(\"status\" => \"error\", \"msg\" => \"Something Wrong\");\n\t\t}\n\n\t\treturn $response;\n\t}", "public function vendor_otp_post(){\n $pdata = file_get_contents(\"php://input\");\n $data = json_decode($pdata,true);\n\n $required_parameter = array('otp','user_id');\n $chk_error = $this->controller->check_required_value($required_parameter, $data);\n if ($chk_error) \n {\n $resp = array('code' => 'MISSING_PARAM', 'message' => 'Missing ' . strtoupper($chk_error['param']));\n @$this->response($resp);\n }\n\n $otp = $data['otp'];\n $user_id = $data['user_id'];\n\n $where = array(\n 'user_id' => $user_id,\n 'otp' => $otp\n ); \n\n $verify = $this->model->getAllwhere('otp_master',$where);\n if(!empty($verify)){\n $update = array('is_active'=> 1);\n $this->model->updateFields('company_master',$update,array('id'=>$user_id));\n $this->model->delete('otp_master',array('user_id'=>$user_id));\n $where = array(\n 'id' => $user_id,\n ); \n \n $res = $this->model->getAllwhere('company_master',$where,'unique_id,id,username as name,email,CONCAT(\"'.base_url().'\",\"asset/uploads/\",profile_pic)AS image,is_active,is_verified,phone_no,user_role,app_folder');\n $resp = array('rccode' => 1, 'message' => ' Login SUCCESS', 'vendor' => $res[0],'is_active'=> $res[0]->is_active,'is_verified'=>$res[0]->is_verified,'user_role'=>$res[0]->user_role,);\n // $resp = array(\n // 'rccode' => 1,\n // 'message' => 'Otp Verify Successfully', \n // );\n }else{\n $resp = array(\n 'rccode' => 2,\n 'message' => 'Please Enter Valid Otp', \n );\n } \n\n $this->response($resp); \n }", "public function createOTP()\n {\n return $this->getOTPHandler()->create();\n }", "public function mp_hook_otp_ajax(){\n\t\treturn $this->mp_hook_payment_ajax('otp');\n\t\t}", "public function __construct($otp)\n {\n $this->otp = $otp;\n }", "public function select_user_current_otp($data)\n {\n //otp entered while forgot password request\n if($data['action']=='forgotpassword')\n {\n foreach($data as $key=>$val) $$key=get_magic_quotes_gpc()?$val:addslashes($val);\n if($email != '')\n {\n $query = new Query;\n $count = $query->select('COUNT(*) as count')->from('core_users')->where(\"email = '$email'\")->andWhere(\"otp_code = '$otp'\")->All();\n if($count[0]['count']>0)\n {\n \n $query = Yii::$app->db;\n $query->createCommand()->update('core_users', ['user_status' => \"2\"], \"email = '$email'\")->execute();\n return true;\n }\n else\n return false;\n \n }\n else if($phone != '')\n {\n $query = new Query;\n $count = $query->select('COUNT(*) as count')->from('core_users')->where(\"phone_number = '$phone'\")->andWhere(\"otp_code = '$otp'\")->All();\n if($count[0]['count']>0)\n {\n $query = Yii::$app->db;\n $query->createCommand()->update('core_users', ['user_status' => \"2\"], \"phone_number = '$phone'\")->execute();\n Yii::$app->user->login(User::findByUserphone($phone));\n Usersessions::insert_user_session();\n return true;\n }\n else\n return false;\n\n }\n return false;\n }\n //otp entered while registration or login.\n else {\n foreach($data as $key=>$val) $$key=get_magic_quotes_gpc()?$val:addslashes($val);\n\n $query = new Query;\n $count = $query->select('COUNT(*) as count')->from('core_users')->where(\"email = '$email'\")->andWhere(\"otp_code = '$otp'\")->All();\n if($count[0]['count']>0)\n {\n $query = Yii::$app->db;\n $query->createCommand()->update('core_users', ['user_status' => \"2\"], \"email = '$email'\")->execute();\n Yii::$app->user->login(User::findByUseremail($email));\n Usersessions::insert_user_session();\n return true;\n }\n else\n {\n return false;\n }\n }\n }", "public function addPasswordOTP($email, $otp, $app_id = '') {\n $registry = new Registry();\n // Database\n $db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);\n $registry->set('db', $db);\n\n if ($app_id != '') {\n $db->query(\"UPDATE \" . DB_PREFIX . \"customer SET otp = '\" . $otp . \"', otp_date = '\" . date('Y-m-d H:i:s') . \"' WHERE LOWER(email) = '\" . $db->escape(utf8_strtolower($email)) . \"' AND app_id='\" . $app_id . \"'\");\n } else {\n $db->query(\"UPDATE \" . DB_PREFIX . \"customer SET otp = '\" . $otp . \"', otp_date = '\" . date('Y-m-d H:i:s') . \"' WHERE LOWER(email) = '\" . $db->escape(utf8_strtolower($email)) . \"'\");\n }\n }", "function login_otp()\n\t{\n\t\t$this->data['title'] = \"Login\";\n\n\t\t//validate form input\n\t\t$this->form_validation->set_rules('token'\t\t\t, 'Token', 'required');\n\t\t\n\t\tif ($this->form_validation->run() == true)\n\t\t{\n\t\t\t$remember = 1;\n\n\t\t\tif ($this->ion_auth->is_otp_set($this->input->post('identity')))\n\t\t\t{\n\t\t\t\tif ($this->ion_auth->otp_login($this->input->post('identity'), $this->input->post('token'), $remember, $this->input->post('otp_login_key')))\n\t\t\t\t{\n\t\t\t\t\t$session = $this->session->all_userdata();\n\t\t\t\t\t$isActive = $this->db->get_where('user', array('user_id' => $session['user_id']))->row();\n\t\t\t\t\t//if the login is successful\n\t\t\t\t\t//redirect them back to the home page\n\t\t\t\t\t$this->session->set_userdata('Ref_is_logged', 'yes');\n\t\t\t\t\t$this->session->set_userdata('Ref_UserID', $isActive->user_id);\n\t\t\t\t\t$this->session->set_userdata('Ref_UserName', $isActive->user_fname.' '.$isActive->user_lname);\n\t\t\t\t\t$this->session->set_userdata('Ref_logged_in', TRUE);\n\t\t\t\t\t$this->session->set_userdata('Ref_UserEmail', $isActive->user_email);\n\t\t\t\t\t//echo json_encode($msg);\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$msg = 'Logged in';\t\t\t\t\t\n\t\t\t\t\t$this->session->set_flashdata('message', '<div class=\"col-xs-12\"><div class=\"alert alert-success alert-dismissable\"><i class=\"fa fa-check\"></i><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">&times;</button>'.$msg.'</div></div>');\n\t\t\t\t\tredirect(base_url('dashboard'));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t//if the login was un-successful\n\t\t\t\t//redirect them back to the login page\n\t\t\t\t$this->session->set_flashdata('message_login', $this->ion_auth->errors());\n\t\t\t\tredirect('home', 'refresh'); //use redirects instead of loading views for compatibility with MY_Controller libraries\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//if the login was un-successful\n\t\t\t\t//redirect them back to the login page\n\t\t\t\t$this->session->set_flashdata('message_login', $this->ion_auth->errors());\n\t\t\t\tredirect('home', 'refresh'); //use redirects instead of loading views for compatibility with MY_Controller libraries\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\t\t\t\n\t\t\tif($this->session->flashdata('identity') == NULL || $this->session->flashdata('otp_login_key') == NULL)\n\t\t\t{\n\t\t\t\tredirect('home', 'refresh');\n\t\t\t}\n\t\t\t//the user is not logging in so display the login page\n\t\t\t//set the flash data error message if there is one\n\t\t\t$this->data['message_login'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('message');\n\n\t\t\t$this->data['token'] = array('name' => 'token',\n\t\t\t\t'id' => 'token',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'type' => 'text'\n\t\t\t);\n\t\t\t$this->data['identity'] = $this->session->flashdata('identity');\n\t\t\t$this->data['remember'] = $this->session->flashdata('remember_me');\n\t\t\t$this->data['otp_login_key'] = $this->session->flashdata('otp_login_key');\n\t\t\t\n\t\t\t$this->show_viewFrontInner('login_otp', $this->data);\n\t\t}\n\t}", "public function resend_otp_data_post()\n {\n $response = new StdClass();\n $result = new StdClass();\n $device_id =$this->input->post('device_id');\n $mobile_no =$this->input->post('mobile_no');\n $otpValue=mt_rand(1000, 9999);\n $data1->device_id = $device_id;\n $data1->mobile_no=$mobile_no;\n $data1->otp=$otpValue;\n $res = $this->Supervisor->send_otp($mobile_no,$otpValue);\n if(!empty($mobile_no))\n {\n $res1 = $this->Supervisor->resend_otp($data1);\n\n $data->message = 'success';\n $data->status = '1';\n array_push($result,$data);\n $response->data = $data;\n }\n\n else\n {\n $data->message = 'failed';\n $data->status = '0';\n array_push($result,$data);\n $response->data = $data;\n } \n echo json_output($response);\n }" ]
[ "0.70574176", "0.6981252", "0.6954572", "0.6924916", "0.69024247", "0.68983245", "0.67402047", "0.6695809", "0.6576659", "0.64790624", "0.64414567", "0.64370304", "0.6410705", "0.6351671", "0.634918", "0.6342847", "0.63409424", "0.6253137", "0.6247669", "0.6241211", "0.6239292", "0.62229615", "0.6219944", "0.6199478", "0.61795855", "0.6167338", "0.61412716", "0.6101816", "0.609453", "0.6093241" ]
0.7402916
0
Creates a new States model. If creation is successful, the browser will be redirected to the 'view' page.
public function actionCreate() { $model = new States(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('create', [ 'model' => $model, ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate()\n {\n $model = new callStates();\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 actionCreate()\n\t{\n\t\t$this->addBreadCrumb(at('Create'));\n\t\t$model=new ReferenceGeoStates;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['ReferenceGeoStates']))\n\t\t{\n\t\t\t$model->attributes=$_POST['ReferenceGeoStates'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function create()\n {\n return view('admin.states.create');\n }", "public function create()\n {\n return view('admin.states.create');\n }", "public function create()\n\t{\n\t\t//custom message if this methods throw an exception\n\t\t\\Session::put('errorOrigin', \" accediendo a la creación de estados\");\t\n\n\t\t//custom route to REDIRECT redirect('x') if there's an error\n\t\t\\Session::put('errorRoute', \"states\");\n\n\t\treturn view('admin/states/create');\n\t}", "public function create()\r\n {\r\n $form=[\r\n \"value\" => \"add\",\r\n \"name\" => \"Add City\",\r\n \"submit\" => \"Save\"\r\n ];\r\n\r\n $States=State::all();\r\n\r\n return view('city/form',compact('form','States'));\r\n }", "public function actionCreate()\n {\n $model = new Status();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n $sdata = State::all(); \n return view('admin.create',['sdata'=>$sdata]);\n }", "public function create()\n {\n return view('admin/state/create');\n }", "public function create()\n {\n $state=State::all();\n //$location_type=LocationType::all();\n return view('admin.master.ho_details.add',compact('state'));\n }", "public function create(){\n $states = State::select('id','name')->get();\n return view('dashboard.address.city.create',compact('states'));\n }", "public function actionCreate()\n {\n $model = new Slaves();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n $state = State::all();\n return view('city.add', compact('state'));\n }", "public function actionCreate()\n\t{\n\t\t$model=new Store();\n\t\t$model->user_id = Yii::app()->user->id;\n\t\t$model->status = Store::STATUS_ACTIVE;\n\t\t$model->type = Store::TYPE_OFFLINE; // тип по умолчанию\n\t\t$model->save(false);\n\n\t\t$this->redirect($this->createUrl('update', array('id'=>$model->id)));\n\t}", "public function create(){\n\t\t$title = $this->generaltitle;\n\t\t$arrStatedata = State::where('state_status','=','1')->orderBy('state_name', 'asc')->get();\n\t\tforeach($arrStatedata as $state)\n\t\t{\n\t\t\t$statedata[$state->state_id] = $state->state_name;\n\t\t}\n\t\treturn view('admin.property.addproperty')->with(compact('title','statedata'));\n }", "public function create()\n {\n\t\t$validUser = $this->CheckUser();\n\t\tif($validUser) return\tview('errors.404');\n\n return view('state.create');\n }", "public function actionCreate()\n {\n $model = new House();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function store(){\n // state\n $state = new State;\n $state->name_en = Input::get('name_en');\n $state->name_jp = Input::get('name_jp');\n $state->region_id = Input::get('region_id');\n $state->rise_year = Input::get('rise_year');\n if(Input::has('is_rise_year_fixed')) $state->is_rise_year_fixed = true;\n $state->fall_year = Input::get('fall_year');\n if(Input::has('is_fall_year_fixed')) $state->is_fall_year_fixed = true;\n $state->explanation_en = Input::get('explanation_en');\n $state->explanation_jp = Input::get('explanation_jp');\n $state->capital_name_en = Input::get('capital_name_en');\n $state->capital_name_jp = Input::get('capital_name_jp');\n $state->save();\n\n //redirect\n Session::flash('message','Success create.');\n return Redirect::to('/admin/state');\n\n\t}", "public function actionCreate()\n\t{\n\t\t$model=new Solicitudes;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Solicitudes']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Solicitudes'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new StoreTransfer();\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 create() {\n $data['states'] = State::all();\n return view('user.create', $data);\n }", "public function actionCreate()\n {\n\t\t\tif (Yii::$app->user->can('create-countries'))\n\t\t\t{\n\t\t\t\t$model = new Mtprovinces();\n\n if ($model->load(Yii::$app->request->post())) {\n\t\t\t\t\t$model->province_created = date('Y-m-d h:i:s');\n\t\t\t\t\t$model->province_status = 'ACTIVE';\n\t\t\t\t\t$model->province_updated = date('Y-m-d h:i:s');\n\t\t\t\t\t$model->save();\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new ForbiddenHttpException; \n\t\t\t}\n \n }", "public function create()\n {\n\n $portal_state = States::all();\n return view('admin.portal.create',compact('portal_list','portal_state'));\n }", "public function createAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"mission_user_state\",\n \"action\" => \"index\"\n ));\n }\n\n $mission_user_state = new MissionUserState();\n\n $mission_user_state->mission_id = $this->request->getPost(\"mission_id\");\n $mission_user_state->user_id = $this->request->getPost(\"user_id\");\n $mission_user_state->state = $this->request->getPost(\"state\");\n \n\n if (!$mission_user_state->save()) {\n foreach ($mission_user_state->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"mission_user_state\",\n \"action\" => \"new\"\n ));\n }\n\n $this->flash->success(\"mission_user_state was created successfully\");\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"mission_user_state\",\n \"action\" => \"index\"\n ));\n\n }", "public function create()\n {\n $data=[];\n $data['all_state']= \\App\\Models\\state::orderBy('state_name')->get()->all();\n $data['latestmapapi'] = \\App\\Models\\mapapi::orderBy('created_at', 'DESC')->first();\n return view('admindash.master.locality_add',compact('data'));\n }", "public function actionCreate() {\n $model = new Region;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n $countryList = \\common\\models\\address\\Country::getNameArr();\n return $this->render('create', [\n 'model' => $model,\n 'countryList' => $countryList, \n ]);\n }\n }", "public function actionCreate()\n {\n $model = new SasaranEs4();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()){\n flash('success','Data Sasaran Eselon IV Berhasil Disimpan');\n return $this->redirect(['index']);\n }\n \n flash('error','Data Sasaran Eselon IV Gagal Disimpan');\n \n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n //\nreturn view('counties.create',array('title'=>'Add New County'));\n\n }", "public function create()\n {\n $arr['states'] = States::all();\n return view('admin.customer.create')->with($arr);\n\n }", "public function actionCreate() {\n\t\t$model = new Building();\n\n\t\tif ( $model->load( Yii::$app->request->post() ) && $model->save() ) {\n\t\t\treturn $this->redirect( [ 'index', 'id' => $model->id ] );\n\t\t} else {\n\t\t\treturn $this->render( 'create', [\n\t\t\t\t'model' => $model,\n\t\t\t] );\n\t\t}\n\t}" ]
[ "0.7756728", "0.7726155", "0.7225145", "0.7225145", "0.70582044", "0.701823", "0.69757575", "0.69082063", "0.6899653", "0.6861414", "0.68595314", "0.68527156", "0.6807314", "0.6777306", "0.6776655", "0.6759942", "0.67380154", "0.67326474", "0.66638076", "0.6638897", "0.6616319", "0.66003746", "0.659298", "0.6588545", "0.6582581", "0.6578688", "0.6566925", "0.6559995", "0.6548829", "0.65086204" ]
0.8731533
0
Includes the files needed for the Bookings
function wpbs_include_files_booking() { // Get booking dir path $dir_path = plugin_dir_path(__FILE__); // Include main Booking class if (file_exists($dir_path . 'class-booking.php')) { include $dir_path . 'class-booking.php'; } // Include the db layer classes if (file_exists($dir_path . 'class-object-db-bookings.php')) { include $dir_path . 'class-object-db-bookings.php'; } if (file_exists($dir_path . 'class-object-meta-db-bookings.php')) { include $dir_path . 'class-object-meta-db-bookings.php'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function includes() {\n\t\trequire_once( PRODUCT_LIST_DIR . 'classes/class-product_list.php' );\n\t\t//require_once( PRODUCT_LIST_DIR . 'classes/class-yc_admin_cursos-settings.php' );\n\t}", "public function includes() {\n \n include_once( 'widgets/carousel.php' );\n include_once( 'widgets/fancy-text.php' );\n include_once( 'widgets/grid.php' );\n include_once( 'widgets/maps.php' );\n include_once( 'widgets/pricing-table.php' );\n include_once( 'widgets/progress-bar.php' );\n include_once( 'widgets/vertical-scroll.php' );\n \n }", "static function loadFiles()\r\n\t{\r\n\t\t//required files\r\n\t\t\r\n\t\t//load bibliotek\r\n\t\t$paths = array(rp_self.\"lib/\");\r\n\t\t$to_header = array();\r\n\t\tforeach($paths as $path)\r\n\t\t{\r\n\t\t\t$scan = scandir($path);\r\n\t\t\tforeach($scan as $file)\r\n\t\t\t{\r\n\t\t\t\tif(is_file($path.$file))\r\n\t\t\t\t{\r\n\t\t\t\t\t$ext = explode(\".\", $file);\r\n\t\t\t\t\t$ext = $ext[1];\r\n\t\t\t\t\tif($ext == \"php\")\r\n\t\t\t\t\t\trequire_once($path.$file);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//tilføj script tag til header hvis det er javascript\r\n\t\t\t\t\tif($ext == 'js')\r\n\t\t\t\t\t\t$to_header[] = '<script type=\"text/javascript\" src=\"'.$path.$file.'\"></script>';\r\n\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn implode('', $to_header);\r\n\t}", "private function includes(){\n\n\t\tinclude( WPTT_ICS_FEED_FOLDER . '/EasyPeasyICS.php' );\n\n\t}", "public function includes() {\n\n\t\t/**\n\t\t * Core classes.\n\t\t */\n\t\tinclude_once F9JOBS_ABSPATH . 'includes/f9jobs-core-functions.php';\n\t\tinclude_once F9JOBS_ABSPATH . 'includes/class-f9jobs-post-types.php';\n\t\tinclude_once F9JOBS_ABSPATH . 'includes/class-f9jobs-install.php';\n\t}", "public function assembleBook()\n {\n $this->app->edition('id', $this->app['publishing.id']);\n\n // variables needed to hold the list of images and fonts of the book\n $bookImages = array();\n $bookFonts = array();\n\n // prepare the temp directory used to build the book\n $bookTempDir = $this->app['app.dir.cache']\n .'/'.$this->app['publishing.book.slug']\n .'-'.$this->app['publishing.edition'];\n\n $this->app->get('filesystem')->mkdir(array(\n $bookTempDir,\n $bookTempDir.'/book',\n $bookTempDir.'/book/META-INF',\n $bookTempDir.'/book/OEBPS',\n $bookTempDir.'/book/OEBPS/css',\n $bookTempDir.'/book/OEBPS/images',\n $bookTempDir.'/book/OEBPS/fonts',\n ));\n\n // generate easybook CSS file\n if ($this->app->edition('include_styles')) {\n $this->app->renderThemeTemplate(\n 'style.css.twig',\n array('resources_dir' => '..'),\n $bookTempDir.'/book/OEBPS/css/easybook.css'\n );\n\n // copy book fonts and prepare font data for ebook manifest\n $this->app->get('filesystem')->copy(\n $this->app['app.dir.resources'].'/Fonts/Inconsolata/Inconsolata.ttf',\n $bookTempDir.'/book/OEBPS/fonts/Inconsolata.ttf'\n );\n $bookFonts[] = array(\n 'id' => 'font-1',\n 'filePath' => 'fonts/Inconsolata.ttf',\n 'mediaType' => 'application/octet-stream'\n );\n }\n\n // generate custom CSS file\n $customCss = $this->app->getCustomTemplate('style.css');\n if (file_exists($customCss)) {\n $this->app->get('filesystem')->copy(\n $customCss,\n $bookTempDir.'/book/OEBPS/css/styles.css',\n true\n );\n }\n\n // each book element will generate an HTML page\n // use automatic slugs (chapter-1, chapter-2, ...) instead of\n // semantic slugs (lorem-ipsum, dolor-sit-amet, ...)\n $this->app->set('publishing.slugs', array());\n $items = array();\n foreach ($this->app['publishing.items'] as $item) {\n $pageName = array_key_exists('number', $item['config'])\n ? $item['config']['element'].' '.$item['config']['number']\n : $item['config']['element'];\n\n $slug = $this->app->get('slugger')->slugify(trim($pageName));\n\n $item['slug'] = $slug;\n // TODO: document this new item property\n $item['fileName'] = $slug.'.html';\n $items[] = $item;\n }\n // update `publishing items` with the new slug value\n $this->app->set('publishing.items', $items);\n\n // generate one HTML page for every book item\n $items = array();\n foreach ($this->app['publishing.items'] as $item) {\n $this->app->renderThemeTemplate('chunk.twig', array(\n 'item' => $item,\n 'has_custom_css' => file_exists($customCss),\n ),\n $bookTempDir.'/book/OEBPS/'.$item['fileName']\n );\n }\n\n // copy book images and prepare image data for ebook manifest\n if (file_exists($imagesDir = $this->app['publishing.dir.contents'].'/images')) {\n $images = $this->app->get('finder')->files()->in($imagesDir);\n\n $i = 1;\n foreach ($images as $image) {\n $this->app->get('filesystem')->copy(\n $image->getPathName(),\n $bookTempDir.'/book/OEBPS/images/'.$image->getFileName()\n );\n\n $bookImages[] = array(\n 'id' => 'figure-'.$i++,\n 'filePath' => 'images/'.$image->getFileName(),\n 'mediaType' => 'image/'.pathinfo($image->getFilename(), PATHINFO_EXTENSION)\n );\n }\n }\n\n // look for cover images\n $cover = null;\n if (null != $image = $this->app->getCustomCoverImage()) {\n list($width, $height, $type) = getimagesize($image);\n $cover = array(\n 'height' => $height,\n 'width' => $width,\n 'filePath' => 'images/'.basename($image),\n 'mediaType' => image_type_to_mime_type($type)\n );\n\n // copy the cover image\n $this->app->get('filesystem')->copy(\n $image,\n $bookTempDir.'/book/OEBPS/images/'.basename($image)\n );\n }\n\n // generate book cover\n $this->app->renderThemeTemplate('cover.twig', array(\n 'cover' => $cover\n ),\n $bookTempDir.'/book/OEBPS/titlepage.html'\n );\n\n // generate OPF file\n $this->app->renderThemeTemplate('content.opf.twig', array(\n 'cover' => $cover,\n 'has_custom_css' => file_exists($customCss),\n 'fonts' => $bookFonts,\n 'images' => $bookImages\n ),\n $bookTempDir.'/book/OEBPS/content.opf'\n );\n\n // generate NCX file\n $this->app->renderThemeTemplate('toc.ncx.twig', array(),\n $bookTempDir.'/book/OEBPS/toc.ncx'\n );\n\n // generate container.xml and mimetype files\n $this->app->renderThemeTemplate('container.xml.twig', array(),\n $bookTempDir.'/book/META-INF/container.xml'\n );\n $this->app->renderThemeTemplate('mimetype.twig', array(),\n $bookTempDir.'/book/mimetype'\n );\n\n // compress book contents as ZIP file and rename to .epub\n // TODO: the name of the book file (book.epub) must be configurable\n Toolkit::zip($bookTempDir.'/book', $bookTempDir.'/book.zip');\n $this->app->get('filesystem')->copy(\n $bookTempDir.'/book.zip',\n $this->app['publishing.dir.output'].'/book.epub',\n true\n );\n\n // remove temp directory used to build the book\n $this->app->get('filesystem')->remove($bookTempDir);\n }", "private function includes() {\n \t$includes = array(\n \t\t'/includes/event-custom-post-type.php',\n \t\t'/includes/shortcodes.php',\n \t\t'/includes/display-helper.php',\n \t\t'/includes/query-helper.php'\n \t);\n \t\n \t$admin_includes = array();\n \t\n \tif ( file_exists( dirname( __FILE__ ) . '/includes/cmb2/init.php' ) ) {\n \trequire_once dirname( __FILE__ ) . '/includes/cmb2/init.php';\n } elseif ( file_exists( dirname( __FILE__ ) . '/includes/CMB2/init.php' ) ) {\n \trequire_once dirname( __FILE__ ) . '/includes/CMB2/init.php';\n }\n \n \t// Load files\n \tforeach ( $includes as $file ) {\n \t\tif ( file_exists( dirname( __FILE__ ) . $file ) ) {\n \t\t\trequire_once dirname( __FILE__ ) . $file;\n \t\t}\n \t}\n \n \t// Load admin files\n \tif ( is_admin() ) {\n \t\tforeach ( $admin_includes as $file ) {\n \t\t\tif ( file_exists( dirname( __FILE__ ) . $file ) ) {\n \t\t\t\trequire_once dirname( __FILE__ ) . $file;\n \t\t\t}\n \t\t}\n \t}\n }", "public function includes(){\n\t\t// Load the Email Designer class\n\t\trequire_once( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'includes/class-email-designer.php' );\n\n\t\t// Load the Analytics class\n\t\trequire_once( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'includes/class-analytics.php' );\n\t}", "private static function load_files() {\n\t\t\t// Classes.\n\t\t\tinclude_once ASTRA_ADDON_EXT_ADVANCED_HEADERS_DIR . 'classes/class-astra-ext-advanced-headers-data.php';\n\t\t\t// Load Astra Breadcrumbs.\n\t\t\tinclude_once ASTRA_ADDON_EXT_ADVANCED_HEADERS_DIR . 'classes/astra-breadcrumbs.php';\n\t\t}", "public function includes() {\n include_once('default/default-interface.php');\n include_once('default/default-model.php');\n include_once('default/customer-completed-order.php');\n include_once('default/customer-completed-pre-order.php');\n include_once('default/notify-import-finished.php');\n include_once('default/notify-low-balance.php');\n include_once('default/notify-preorder.php');\n include_once('default/order-error.php');\n \n include_once('prepare/class-wp-emaila-custom-post.php');\n include_once('prepare/class-wp-radio-taxonomy.php');\n include_once('prepare/class-wp-email-custom-post-generator.php');\n \n include_once('wp-send-code-mail.php');\n include_once('wp-admin-error-mail.php');\n include_once('wp-admin-general-error.php');\n include_once('wp-admin-import-finished.php');\n }", "public function includes() {\n\t\trequire_once( plugin_dir_path( __FILE__ ) . 'class-productflow-admin.php' );\n\t\trequire_once( plugin_dir_path( __FILE__ ) . 'class-productflow-filters.php' );\n\t}", "function includes() {\r\n\t\t\trequire_once( trailingslashit( RV_PORTFOLIO_DIR ) . 'inc/public/class-rv-portfolio-registration.php' );\r\n\t\t}", "private function includes() {\n\t\t\t// By default, comments are disjoined from the other post types.\n\t\t\trequire_once( $this->includes_dir . 'comments.php' );\n\n\t\t\t// Settings\n\t\t\trequire_once( $this->includes_dir . 'settings.php' );\n\t\t}", "public function includes()\n {\n require_once(__DIR__ . '/Widgets/SuperglobalsWidget.php');\n }", "public function wrp_includes(){\n\n //Our test class\n\t\t//include_once WRP_ABSPATH . 'includes/class-wrp-test.php';\n\t\t\n\t\t//REST API extension class\n\t\tinclude_once WRP_ABSPATH . 'includes/class-wrp-rest.php';\n\n\t\t//Flow2b API setting\n\t\tinclude_once WRP_ABSPATH . 'includes/api_setting.php';\n\n\t\t//Our hooks class\n\t\tinclude_once WRP_ABSPATH . 'includes/class-wrp-hooks.php';\n\n\t}", "public function includes() {\n\t\t/**\n\t\t * Gateway Class.\n\t\t */\n\t\tinclude_once( paytwit_PATH . 'class-gateway.php' );\n\n\t}", "private function _include_files() {\n\n require_once( KP_DIR_PATH . 'includes/korapay-shortcode.php' );\n require_once( KP_DIR_PATH . 'includes/korapay-admin-settings.php' );\n require_once( KP_DIR_PATH . 'includes/korapay-payment-list-class.php' );\n require_once( KP_DIR_PATH . 'includes/vc-elements/simple-vc-pay-now-form.php' );\n\n if ( is_admin() ) {\n require_once( KP_DIR_PATH . 'includes/korapay-tinymce-plugin-class.php' );\n }\n\n }", "public function includes() {\n\n\t\t// gateway classes\n\t\trequire_once( $this->get_plugin_path() . '/includes/abstract-wc-gateway-elavon-converge.php' );\n\t\trequire_once( $this->get_plugin_path() . '/includes/class-wc-gateway-elavon-converge-credit-card.php' );\n\t\trequire_once( $this->get_plugin_path() . '/includes/class-wc-gateway-elavon-converge-echeck.php' );\n\t\trequire_once( $this->get_plugin_path() . '/includes/class-wc-gateway-elavon-converge-token.php' );\n\t\trequire_once( $this->get_plugin_path() . '/includes/class-wc-gateway-elavon-converge-tokens-handler.php' );\n\n\t\t// payment forms\n\t\trequire_once( $this->get_plugin_path() . '/includes/payment-forms/class-wc-elavon-converge-payment-form.php' );\n\t\trequire_once( $this->get_plugin_path() . '/includes/payment-forms/class-wc-elavon-converge-echeck-payment-form.php' );\n\t}", "private static function _includes()\n {\n /**\n * Includes\n */\n include_once 'functions/register-post-types.php';\n include_once 'functions/register-taxonomies.php';\n include_once 'functions/register-menus.php';\n }", "private function include_widgets_files() {\n\t\trequire_once( __DIR__ . '/widgets/be-counter.php' );\n\t\trequire_once( __DIR__ . '/widgets/be-post.php' );\n\t\trequire_once( __DIR__ . '/widgets/subhead-bodycopy.php' );\n\t\trequire_once( __DIR__ . '/widgets/heading-media-bodycopy.php' );\n\t\trequire_once( __DIR__ . '/widgets/sidebar.php' );\n\t\trequire_once( __DIR__ . '/widgets/useful-links-info.php' );\n\t\trequire_once( __DIR__ . '/widgets/accordion-navigation-tabs.php' );\n\t\trequire_once( __DIR__ . '/widgets/content-filter.php' );\n\t\trequire_once( __DIR__ . '/widgets/secondary-ctas.php' );\n\t\trequire_once( __DIR__ . '/widgets/alert-banner.php' );\n\t\trequire_once( __DIR__ . '/widgets/alert-banner.php' );\n\t\trequire_once( __DIR__ . '/widgets/resources.php' );\n\t\trequire_once( __DIR__ . '/widgets/repeater-resources.php' );\n\t\trequire_once( __DIR__ . '/widgets/card-lrg.php' );\n\t\trequire_once( __DIR__ . '/widgets/be-promo.php' );\n\t\trequire_once( __DIR__ . '/widgets/be-latest-resources.php' );\n\t\trequire_once( __DIR__ . '/widgets/be-popular-results.php' );\n\t\trequire_once( __DIR__ . '/widgets/be-top-faq.php' );\n\t\trequire_once( __DIR__ . '/widgets/be-card-carousel.php' );\n\t\t// M.8.3 Card lrg (landing page)\n\t}", "public function includes() {\n\t\trequire_once( 'metabox.php' );\n\t}", "public function include_files(){\r\n\r\n require( WOOLENTOR_ADDONS_PL_PATH_PRO.'includes/helper-function.php' );\r\n require( WOOLENTOR_ADDONS_PL_PATH_PRO.'classes/class.assest_management.php' );\r\n require( WOOLENTOR_ADDONS_PL_PATH_PRO.'classes/class.widgets_control.php' );\r\n require( WOOLENTOR_ADDONS_PL_PATH_PRO.'classes/class.my_account.php' );\r\n require( WOOLENTOR_ADDONS_PL_PATH_PRO.'classes/class.wc-shortcode-products.php' );\r\n if( !empty( woolentor_get_option_pro( 'productcheckoutpage', 'woolentor_woo_template_tabs', '0' ) ) ){\r\n require( WOOLENTOR_ADDONS_PL_PATH_PRO.'classes/class.checkout_page.php' );\r\n }\r\n\r\n // Admin Setting file\r\n if( is_admin() ){\r\n require( WOOLENTOR_ADDONS_PL_PATH_PRO.'includes/licence/WooLentorPro.php' );\r\n require( WOOLENTOR_ADDONS_PL_PATH_PRO.'includes/custom-metabox.php' );\r\n }\r\n\r\n // Builder File\r\n if( woolentor_get_option_pro( 'enablecustomlayout', 'woolentor_woo_template_tabs', 'on' ) == 'on' ){\r\n include( WOOLENTOR_ADDONS_PL_PATH_PRO.'includes/wl_woo_shop.php' );\r\n if( !is_admin() && woolentor_get_option_pro( 'enablerenamelabel', 'woolentor_rename_label_tabs', 'off' ) == 'on' ){\r\n include( WOOLENTOR_ADDONS_PL_PATH_PRO.'includes/rename_label.php' );\r\n }\r\n require( WOOLENTOR_ADDONS_PL_PATH_PRO.'classes/class.third_party.php' );\r\n }\r\n\r\n // Sale Notification\r\n if( woolentor_get_option_pro( 'enableresalenotification', 'woolentor_sales_notification_tabs', 'off' ) == 'on' ){\r\n if( woolentor_get_option_pro( 'notification_content_type', 'woolentor_sales_notification_tabs', 'actual' ) == 'fakes' ){\r\n include( WOOLENTOR_ADDONS_PL_PATH_PRO. 'includes/class.sale_notification_fake.php' );\r\n }else{\r\n include( WOOLENTOR_ADDONS_PL_PATH_PRO. 'includes/class.sale_notification.php' );\r\n }\r\n }\r\n \r\n // WooLentor Extension\r\n require( WOOLENTOR_ADDONS_PL_PATH_PRO.'classes/class.extension.php' );\r\n\r\n }", "private function includes() {\n\t\t// functions\n\t\tinclude_once( 'includes/kopa-core-functions.php' );\n\n\t\t// settings class (special important class)\n\t\tinclude_once( 'includes/admin/class-kopa-admin-settings.php' );\n\n\t\t// frontend assets class\n\t\tinclude_once( 'includes/class-kopa-frontend-assets.php' );\n\n\t\t// abstract widget class\n\t\tinclude_once( 'includes/abstracts/abstract-kopa-widget.php' );\n\n\t\tif ( defined( 'DOING_AJAX' ) ) {\n\t\t\t$this->ajax_includes();\n\t\t}\n\n\t\tif ( is_admin() ) {\n\t\t\tinclude_once( 'includes/admin/class-kopa-admin.php' );\n\t\t}\n\n\t}", "public function include_files()\n\t{\n\t\trequire_once(WP_PARSI_DIR . 'includes/settings.php');\n\t\tglobal $wpp_settings;\n\t\t$wpp_settings = wp_parsi_get_settings();\n\n\t\t$files = array(\n\t\t\t'parsidate',\n\t\t\t'general',\n\t\t\t'fixes-archive',\n\t\t\t'fixes-permalinks',\n\t\t\t'fixes-dates',\n\t\t\t'fixes-misc',\n\t\t\t'admin/styles-fix',\n\t\t\t'admin/lists-fix',\n\t\t\t'admin/other-fix',\n\t\t\t'fixes-calendar',\n\t\t\t'fixes-archives',\n\t\t\t'plugins/woocommerce',\n\t\t\t'plugins/edd',\n\t\t\t'widget/widget_archive',\n\t\t\t'widget/widget_calendar'\n\t\t);\n\n\t\tforeach ($files as $file)\n\t\t\trequire_once(WP_PARSI_DIR . 'includes/' . $file . '.php');\n\n\t\tif (get_locale() == 'fa_IR')\n\t\t\tload_textdomain('wp-parsidate', WP_PARSI_DIR . 'parsi-languages/fa_IR.mo');\n\n\t\tadd_action('widgets_init', array($this, 'register_widget'));\n\t}", "public function includes() {\r\n\t\t//Insert here all needed models\r\n\t\tglobal $wpdb;\r\n\r\n\t\t//Insert here all needed models\r\n\t\trequire_once MD_PLUGIN_DIR.'models/class-md-market-downloads-model.php';\r\n\t\t$this->MD_Model = new MD_Market_Downloads_Model($wpdb);\r\n\r\n\t\trequire_once $this->admin_url.'controller/class-md-browse-files-table.php';\r\n\r\n\t\tif(isset($_GET['post_type']) && $_GET['post_type'] == 'market-reports'){\r\n\t\t\t$this->files_table = new MD_Browse_Files_Table($wpdb);\t\r\n\t\t}\r\n\t\t\r\n\t}", "public function assembleBook()\n {\n $book = $this->app->render('book.twig', array(\n 'items' => $this->app['publishing.items']\n ));\n $temp = tempnam(sys_get_temp_dir(), 'easybook_');\n fputs(fopen($temp, 'w+'), $book);\n\n // use PrinceXML to transform the HTML book into a PDF book\n $prince = $this->app->get('prince');\n $prince->setBaseURL($this->app['publishing.dir.contents'].'/images');\n\n // Prepare and add stylesheets before PDF conversion\n if ($this->app->edition('include_styles')) {\n $defaultStyles = tempnam(sys_get_temp_dir(), 'easybook_style_');\n $this->app->render('@theme/style.css.twig', array(\n 'resources_dir' => $this->app['app.dir.resources'].'/'\n ),\n $defaultStyles\n );\n\n $prince->addStyleSheet($defaultStyles);\n }\n\n // TODO: custom book styles could also be defined with Twig\n $customCss = $this->app->getCustomTemplate('style.css');\n if (file_exists($customCss)) {\n $prince->addStyleSheet($customCss);\n }\n\n // TODO: the name of the book file (book.pdf) must be configurable\n $errorMessages = array();\n $prince->convert_file_to_file($temp, $this->app['publishing.dir.output'].'/book.pdf', $errorMessages);\n\n // show PDF conversion errors\n if (count($errorMessages) > 0) {\n foreach ($errorMessages as $message) {\n echo $message[0].': '.$message[2].' ('.$message[1].')'.\"\\n\";\n }\n }\n }", "function _includes() {\n require_once($this->plugin_dir . 'include/actions_class.php');\n require_once($this->plugin_dir . 'include/admin_actions_class.php');\n require_once($this->plugin_dir . 'include/admin_filters_class.php');\n require_once($this->plugin_dir . 'include/ui_class.php');\n require_once($this->plugin_dir . 'include/widget_class.php');\n require_once($this->plugin_dir . 'include/extra_help_class.php');\n require_once($this->plugin_dir . 'include/mobile-listener.php');\n }", "private function require_files() {\n\t\tif ( file_exists( ABSPATH . '/wp-admin/includes/screen.php' ) ) {\n\t\t\tinclude_once ABSPATH . '/wp-admin/includes/screen.php';\n\t\t}\n\t\tinclude_once ABSPATH . '/wp-admin/includes/template.php';\n\t\tinclude_once ABSPATH . '/wp-admin/includes/misc.php';\n\t\tinclude_once ABSPATH . '/wp-admin/includes/class-wp-upgrader.php';\n\t\tinclude_once ABSPATH . '/wp-admin/includes/plugin.php';\n\t}", "private function includes()\n\t\t{\n\t\t\trequire_once dirname( __FILE__ ) . '/sf-class-sanitize.php';\n\t\t\trequire_once dirname( __FILE__ ) . '/sf-class-format-options.php';\n\t\t\tnew SF_Sanitize;\n\t\t}", "protected function load_files() {\n\t\trequire_once __DIR__ . '/class-papi-admin-meta-handler.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-option-handler.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-entry-post.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-entry-taxonomy.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-columns.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-page-type-switcher.php';\n\t}" ]
[ "0.663224", "0.64679646", "0.630916", "0.6302431", "0.63000786", "0.62894917", "0.6273061", "0.6270865", "0.62679005", "0.6245627", "0.6169133", "0.6150016", "0.6125727", "0.6090514", "0.608698", "0.6047844", "0.6034697", "0.5996444", "0.59885335", "0.5985435", "0.59595305", "0.591237", "0.59073037", "0.5895585", "0.5872904", "0.5836766", "0.5806436", "0.5804662", "0.5776866", "0.57630396" ]
0.69766146
0
Register the class that handles database queries for the Bookings
function wpbs_register_database_classes_bookings($classes) { $classes['bookings'] = 'WPBS_Object_DB_Bookings'; $classes['bookingmeta'] = 'WPBS_Object_Meta_DB_Bookings'; return $classes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl_ing_ingreso_det() {\r\n\r\n $this->database = new Database();\r\n }", "public function __construct()\n {\n $this->customers = new CustomerDB();\n }", "public function dbInstance();", "public function __construct(){\n //autoloading\n $this->db = new \\Konekta();\n\n }", "public function __construct()\n {\n $this->_db = new \\DbHandler();\n }", "function __construct( $class )\n\t{\n\t\t$this->activeRecord = $class;\n\t}", "function initGuestbook() {\r\n\t\tinclude 'guestbook.class.php';\r\n\t\t$this->registerClass(new Guestbook(),'guestbook',array('newEntry', 'clearGuestbook', 'deleteEntry', 'editEntry')); // specify methods so that we get case in php4\r\n\t}", "public function __construct() {\n $this->db = \\Config\\Database::connect();\n // Wir verwenden die Query Builder Klasse über table()\n $this->reiter = $this->db->table('Reiter');\n }", "public function __construct() {\n $this->db = database::getInstance();\n }", "function QueryClass(){\n\t\n\t\t//\n\t\t\n\t}", "public function __construct(){\n $this->db = DB::getInstance();\n }", "function __construct()\n {\n $this->_db = DB::getInstance();\n }", "private function registerRepository()\n {\n $this->app->bind(DataRepository::class, LaravelDBRepository::class);\n }", "function __construct(){\n $this->_db = (new DataBaseServices())->connect();\n }", "function GST_setClassDB()\n {\n if($this->DB !== FALSE)\n $this->DB->useDB('hej_G');\n }", "public function __construct() {\n\t\t$this->db = DB::getInstance();\n\t}", "public function getQueryAdapterClass();", "public function __construct() {\n $this->_db = DB::getInstance();\n }", "public function register(): void\n {\n // Bind eloquent models to IoC container\n $this->app->singleton('cortex.bookings.service', $serviceModel = $this->app['config']['cortex.bookings.models.service']);\n $serviceModel === Service::class || $this->app->alias('cortex.bookings.service', Service::class);\n\n $this->app->singleton('cortex.bookings.service_availability', $serviceAvailabilityModel = $this->app['config']['cortex.bookings.models.service_availability']);\n $serviceAvailabilityModel === ServiceAvailability::class || $this->app->alias('cortex.bookings.service_availability', ServiceAvailability::class);\n\n $this->app->singleton('cortex.bookings.service_booking', $serviceBookingModel = $this->app['config']['cortex.bookings.models.service_booking']);\n $serviceBookingModel === ServiceBooking::class || $this->app->alias('cortex.bookings.service_booking', ServiceBooking::class);\n\n $this->app->singleton('cortex.bookings.service_rate', $serviceRateModel = $this->app['config']['cortex.bookings.models.service_rate']);\n $serviceRateModel === ServiceRate::class || $this->app->alias('cortex.bookings.service_rate', ServiceRate::class);\n\n $this->app->singleton('cortex.bookings.event', $serviceAvailabilityModel = $this->app['config']['cortex.bookings.models.event']);\n $serviceAvailabilityModel === Event::class || $this->app->alias('cortex.bookings.event', Event::class);\n\n $this->app->singleton('cortex.bookings.event_ticket', $eventTicketModel = $this->app['config']['cortex.bookings.models.event_ticket']);\n $eventTicketModel === EventTicket::class || $this->app->alias('cortex.bookings.event_ticket', EventTicket::class);\n\n $this->app->singleton('cortex.bookings.event_booking', $eventBookingModel = $this->app['config']['cortex.bookings.models.event_booking']);\n $eventBookingModel === EventBooking::class || $this->app->alias('cortex.bookings.event_booking', EventBooking::class);\n\n // Register console commands\n $this->registerCommands($this->commands);\n\n // Bind eloquent models to IoC container\n $this->app->singleton('cortex.bookings.service', $serviceModel = $this->app['config']['cortex.bookings.models.service']);\n $serviceModel === Service::class || $this->app->alias('cortex.bookings.service', Service::class);\n\n $this->app->singleton('cortex.bookings.event', $eventModel = $this->app['config']['cortex.bookings.models.event']);\n $eventModel === Event::class || $this->app->alias('cortex.bookings.event', Event::class);\n }", "public function __construct() {\n\n $this->_queries = new queries();\n $this->_pagination = new PagePagination();\n }", "public function __construct() {\n $this->mysql = new Mysql();\n }", "public function __construct() {\n $this->adapter = new PDOAdapter();\n }", "public function __construct(){\n $this->_db = DB::getInstance();\n }", "public function __construct(){\n $this->db = new Base;\n }", "public function __construct() {\n\t\t$this->providers = array(\n\t\t\t'ngg' => new ShoutemNGGDao(),\n\t\t\t'flag' => new ShoutemFlaGalleryDao(),\n\t\t);\n\t}", "public function __construct() {\n\t\t\t$this->dbConnection = new dbConnection();\n\t\t\t$this->query = new query();\n\t\t}", "public function __construct() {\r\n $this->db = new Database;\r\n }", "public function model()\n {\n return Booking::class;\n }", "function __construct() {\n // Initialize the dbms pointer.\n AbstractMapper::__construct();\n\n // Initialize table name.\n $this->tableName = \"orders\";\n }", "public function __construct()\n {\n $this->db = Db::getInstance();\n }" ]
[ "0.58525455", "0.55904526", "0.55553365", "0.55191755", "0.55009913", "0.54924935", "0.5457468", "0.54408234", "0.54261345", "0.54203653", "0.5407292", "0.5399944", "0.539701", "0.53891337", "0.5381633", "0.5380312", "0.5380189", "0.5363274", "0.53598493", "0.5358861", "0.5335424", "0.5333575", "0.5316957", "0.5300682", "0.5281209", "0.52771103", "0.5275356", "0.5274973", "0.5271454", "0.5255865" ]
0.64219433
0
Gets a booking from the database
function wpbs_get_booking($booking) { return wp_booking_system()->db['bookings']->get_object($booking); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBookingDetailsByBookingId($bookingid) {\n $query = \"SELECT * FROM `bookingdetails` WHERE BookingId='\".$bookingid.\"'\";\n $result = Database::selectQuery($query);\n if($result == null) {\n return null;\n } else {\n return $result;\n }\n }", "function get_user_booking_with_id($user_id){\n global $db;\n $sql = \"SELECT * FROM booking WHERE user_id = '$user_id'\";\n $result = $db->query($sql);\n return $result;\n}", "public function findLatest(): Booking\n {\n return $this->bookingRepository->getLatest();\n }", "function getBookingsByBookingDetailsId($bookingDetailsId) {\n $query = \"SELECT * FROM `bookings` WHERE BookingId='\".$bookingDetailsId.\"'\";\n $result = Database::selectQuery($query);\n if($result == null) {\n return null;\n } else {\n return $result;\n }\n }", "function get_user_booking_using_id($user_id){\n global $db;\n $sql = \"SELECT * FROM booking WHERE user_id = '$user_id'\";\n $result = $db->query($sql)->fetch();\n return $result;\n}", "function get_booking(){\r\n\t\tglobal $EM_Booking;\r\n\t\tif( is_object($this->booking) && get_class($this->booking)=='EM_Booking' && ($this->booking->id == $this->booking_id || (empty($this->id) && empty($this->booking_id))) ){\r\n\t\t\treturn $this->booking;\r\n\t\t}elseif( is_object($EM_Booking) && $EM_Booking->id == $this->booking_id ){\r\n\t\t\t$this->booking = $EM_Booking;\r\n\t\t}else{\r\n\t\t\tif(is_numeric($this->booking_id)){\r\n\t\t\t\t$this->booking = new EM_Booking($this->booking_id);\r\n\t\t\t}else{\r\n\t\t\t\t$this->booking = new EM_Booking();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn apply_filters('em_ticket_booking_get_booking', $this->booking, $this);;\r\n\t}", "public function show(Booking $booking)\n {\n return $booking;\n }", "public function show($id)\n {\n return $this->bookingRepository->find($id);\n }", "function show_available_bookings(){\n global $db;\n $sql = \"SELECT * FROM booking_info;\";\n $result = $db->query($sql);\n return $result;\n}", "public function show(Booking $booking)\n {\n //\n }", "public function show(Booking $booking)\n {\n //\n }", "public function show(Booking $booking)\n {\n //\n }", "public function show(Booking $booking)\n {\n //\n }", "public function show(Booking $booking)\n {\n //\n }", "public function index(): object\n {\n $booking = $this->bookingRepository->all();\n\n return $this->sendResponse($booking->toArray(), 'Bookings retrieved successfully.');\n }", "public function detailData($booking_id)\n {\n return DB::table('bookings')->where('booking_id', $booking_id)->first();\n }", "public function getBooking($id)\n {\n return $this->model->where('customer_id', $id)->orderBy('id', 'desc')->with('flight', 'passenger', 'outbound', 'cost')->get();\n }", "function get_reservation_byId($id) {\n global $DB;\n\n return $DB->get_record('roomscheduler_reservations', array('id' => $id));\n}", "public function getTabsBooking()\n {\n\n // Get the booking object\n $bookingCheck = \\tabs\\api\\client\\ApiClient::getApi()->get(\n \"/booking/{$this->getBookingId()}/tabsbooking\"\n );\n if ($bookingCheck\n && $bookingCheck->status == 200\n && $bookingCheck->response != ''\n ) {\n return \\tabs\\api\\booking\\TabsBooking::createFromNode(\n $bookingCheck->response\n );\n } else {\n throw new \\tabs\\api\\client\\ApiException(\n $bookingCheck,\n \"Booking not found\"\n );\n }\n }", "private function _getBooking(User $loggedInUser, $bookingId) {\n\t\t$bookingRepo = $this->em->getRepository ( \\JumpUpPassenger\\Util\\IEntitiesStore::BOOKING );\n\t\t$booking = $bookingRepo->findOneBy ( array (\n\t\t\t\t\"id\" => $bookingId,\n\t\t\t\t\"driver\" => $loggedInUser->getId () \n\t\t) );\n\t\treturn $booking;\n\t}", "public function getBookings() {\n //$query = \"SELECT * FROM `bookings` WHERE `DATE` = CURDATE() ORDER BY `DATE`, `TIME`\";\n $query = \"SELECT * FROM `bookings` where DATE(`DATE`) = CURDATE() \";\n\n $stmt = $this->sqlConnection->prepare($query);\n\n $stmt->execute();\n\n if ($stmt->rowCount() > 0) {\n\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n return json_encode($result);\n } else {\n\n echo json_encode(array(\"status\" => 201, 'message' => 'No bookings made yet..'));\n }\n }", "public static function getBooking($bookRef)\n {\n // Get the booking object\n $bookingCheck = \\tabs\\api\\client\\ApiClient::getApi()->get(\n \"/tabsbooking/{$bookRef}\"\n );\n if ($bookingCheck\n && $bookingCheck->status == 200\n && $bookingCheck->response != ''\n ) {\n return self::createFromNode(\n $bookingCheck->response\n );\n } else {\n throw new \\tabs\\api\\client\\ApiException(\n $bookingCheck,\n \"Booking not found\"\n );\n }\n }", "public function show($id)\n {\n $booking = $this->bookingRepo->getBooking($id);\n return new BookingResource($booking);\n }", "public function bookingActive()\n\t{\n\t\t$ch = new Curl();\n\t\t\n\t\t$this->headers['Authorization'] = 'Bearer ' . $this->authToken;\n\t\t\n\t\t$data = [];\n\t\t\n\t\treturn $ch->get(GojekID::BASE_ENDPOINT . Action::bookingActive, $data, $this->headers)->getResponse();\n\t}", "function findBooking() : array\n{ \n $db = new Database;\n $db = $db->dbConnect();\n\n $sql = \"SELECT booking.id, booking_date_debut, booking_time_debut, booking_date_fin, booking_time_fin, number_of_seats, user_i, last_name, first_name, mail \n FROM booking \n INNER JOIN user ON user.id = booking.user_i \";\n $adminGetBooking = $db->query($sql);\n $adminGetBooking = $adminGetBooking->fetchAll();\n return $adminGetBooking;\n}", "public function booking(){\n\n\n \t$patient = Patient::where('medi_track', 'yes')->first();\n $medical = auth()->user()->medical;\n\n \tif ($medical && $patient) {\n\n \t\tif ($medical->issuing == 'off') {\n \t\t\treturn response()->json([\n\t\t\t\t\t'status' => 'faild',\n\t\t\t\t\t'message'=> 'Booking is currently off. Please try again later',\n\t\t\t\t], 400);\n \t\t}\n\n\n \t $booking = Booking::whereDate('created_at', Carbon::today())->where('medical_id', $medical->id)->latest()->first();\n \t\t(!$booking)? $booking_number = 1 : $booking_number = $booking->booking_no + 1;\n\n\t\t\tDB::beginTransaction();\n \t\t\t$newBooking = Booking::create([\n \t\t\t\t'patient_id' => $patient->id,\n \t\t\t\t'medical_id' => $medical->id,\n \t\t\t\t'booking_no' => $booking_number,\n \t\t\t]);\n \t\t\t$updateMedical = $medical->update(['current_issues_no' => $newBooking->booking_no ]);\n\n \t\t\tif ($newBooking && $updateMedical) {\n \t\tDB::commit();\n\n\t\t\t\t\treturn response()->json([\n\t\t \t\t\t'status' => 'success',\n\t\t \t\t\t'data'\t => [\n\t\t \t\t\t\t'booking_no' => $newBooking->booking_no\n\t\t \t\t\t]\n\t\t \t\t], 200);\n \t\t\t\n \t\t\t}else{\n \t\tDB::rollBack();\n\n\t\t\t\t\treturn response()->json([\n\t\t\t\t\t\t'status' => 'faild'\n\t\t\t\t\t], 400);\n \t\t\t}\n\n \t}else{\n \t\treturn response()->json([\n \t\t\t'status' => 'faild'\n \t\t], 400);\n \t}\n\n }", "public function get_book();", "public function booking()\n {\n return $this->hasMany(Booking::class);\n }", "public function booking()\n {\n return $this->hasOne('App\\Booking','id_stato_prenotazione','id_stato_prenotazione');\n }", "public function show(int $id): object\n {\n $booking = $this->bookingRepository->findOrFail($id);\n\n return $this->sendResponse($booking->toArray(), 'Booking retrieved successfully.');\n }" ]
[ "0.68165016", "0.6689585", "0.6688761", "0.6624235", "0.6612698", "0.6609452", "0.66028154", "0.65940285", "0.6566788", "0.6486003", "0.6486003", "0.6486003", "0.6486003", "0.6486003", "0.64596516", "0.6439326", "0.6397243", "0.63886625", "0.6357851", "0.6353273", "0.6336224", "0.6273386", "0.62727714", "0.625792", "0.62461805", "0.62342614", "0.62288964", "0.62120295", "0.620416", "0.6184843" ]
0.7391453
0
Inserts a new booking into the database
function wpbs_insert_booking($data) { return wp_booking_system()->db['bookings']->insert($data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addBooking()\r\n {\r\n $loggedin = isset($_SESSION['user']);\r\n if(! $loggedin)\r\n {\r\n return redirect('');\r\n }\r\n $user = $_SESSION['user']->account_no;\r\n\r\n $showtime = $_POST['showtime'];\r\n $num_seats = $_POST['num_seats'];\r\n\r\n App::get('database')->insert('booking', compact('user', 'showtime', \"num_seats\"));\r\n\r\n redirect('');\r\n }", "public function addBooking() {\n // get data\n $this->getdata();\n \n // validate data\n if (!isset($this->data['cnp']) || empty($this->data['cnp'])) {\n exit('Please provide a CNP');\n } elseif(!$this->userExists()) {\n exit('No user found with provided CNP');\n } elseif(!$this->isClient()) {\n exit('Incorrect user role');\n }\n if (!isset($this->data['program']) || empty($this->data['program'])) {\n exit('Please provide a program');\n } elseif (!$this->programExists($this->data['program'])) {\n exit('Program does not exist');\n } else {\n // check if program is not due\n $program = $this->getProgram($this->data['program']);\n if (strtotime($program->start_date) <= time()) {\n exit('Program is due');\n }\n // check if date range is available, seats not taken and not already booked\n if (!$this->isBooked() && $this->isAvailable($program) && $this->hasSeats($program)) {\n // insert booking to database\n $statement = 'INSERT INTO booking (user_id, program_id) VALUES (:user_id, :program_id);';\n try {\n $statement = $this->db->prepare($statement);\n $statement->execute(array(\n 'user_id' => $this->getUser($this->data['cnp']),\n 'program_id' => $this->data['program']\n ));\n echo 'Succesfully added booking';\n } catch (\\PDOException $e) {\n exit($e->getMessage());\n } \n }\n }\n }", "function insertNewBooking($bookingnum, $custid, $pkgId) {\n $query = \"INSERT INTO `bookings` (BookingDate, BookingNo, TravelerCount, CustomerId, PackageId) VALUES ('\".date(\"Y-m-d H:i:s\").\"', '$bookingnum', '1', '$custid', '$pkgId')\";\n $result = Database::insertQuery($query); \n if ($result) {\n return true;\n } else {\n return false;\n }\n }", "public function saveBooking() {\n $connection = Yii::app()->db;\n $loginUserID = Yii::app()->user->id;\n $transaction = $connection->beginTransaction();\n try {\n $created_date = date('Y-m-d H:i:s');\n $sql = \"INSERT INTO `booking` (\n `yatrik_name`,\n `address`,\n `city`,\n `pincode`,\n `mobile_no`,\n `email`,\n `arrival_date`,\n `departure_date`,\n `receipt_no`,\n `deposit_amount`,\n `actual_amount`,\n `notes`,\n `created_date`,\n `created_by`,\n `updated_date`,\n `updated_by`\n )\n VALUES\n (\n :yatrik_name,\n :address,\n :city,\n :pincode,\n :mobile_no,\n :email,\n :arrival_date,\n :departure_date,\n :receipt_no,\n :deposit_amount,\n :actual_amount,\n :notes,\n :created_date,\n :created_by,\n :updated_date,\n :updated_by\n )\";\n $command = $connection->createCommand($sql);\n $command->bindParam(\":yatrik_name\", $this->yatrik_name, PDO::PARAM_STR);\n $command->bindParam(':address', $this->address, PDO::PARAM_STR);\n $command->bindParam(':city', $this->city, PDO::PARAM_STR);\n $command->bindParam(':pincode', $this->pincode, PDO::PARAM_INT);\n $command->bindParam(':mobile_no', $this->mobile_no, PDO::PARAM_INT);\n $command->bindParam(':email', $this->email, PDO::PARAM_STR);\n $command->bindParam(':arrival_date', $this->arrival_date, PDO::PARAM_STR);\n $command->bindParam(':departure_date', $this->departure_date, PDO::PARAM_STR);\n $command->bindParam(':receipt_no', $this->receipt_no, PDO::PARAM_STR);\n $command->bindParam(':deposit_amount', $this->deposit_amount, PDO::PARAM_INT);\n $command->bindParam(':actual_amount', $this->actual_amount, PDO::PARAM_INT);\n $command->bindParam(':notes', $this->notes, PDO::PARAM_STR);\n $command->bindParam(':created_date', $created_date, PDO::PARAM_STR);\n $command->bindParam(':created_by', $loginUserID, PDO::PARAM_INT);\n $command->bindParam(':updated_date', $created_date, PDO::PARAM_STR);\n $command->bindParam(':updated_by', $loginUserID, PDO::PARAM_INT);\n $command->execute();\n\n $booking_id = $connection->getLastInsertID();\n $this->id = $booking_id;\n\n $sql = \"INSERT INTO `booking_details` (\n `booking_id`,\n `room_id`,\n `number_count`,\n `room_price`\n )\n VALUES\n (\n :booking_id,\n :room_id,\n :number_count,\n :room_price\n )\";\n $command = $connection->createCommand($sql);\n\n foreach ($this->rooms as $key => $room) {\n $roomObj = Rooms::model()->findByPk($room);\n $command->bindValues(array(\n 'booking_id' => $booking_id,\n 'room_id' => $room,\n 'number_count' => $this->noOfRooms[$key],\n 'room_price' => $roomObj->room_price\n ));\n $command->execute();\n }\n $transaction->commit();\n\n $this->sendMail();\n\n Yii::app()->user->setFlash('success', \"Booking is successfully done.\");\n return $booking_id;\n } catch (Exception $e) // an exception is raised if a query fails\n {\n $transaction->rollback();\n return false;\n }\n }", "public function addBooking($booking){\n \n }", "protected function insert()\n\t{\n\t\t$query = $this->connection->prepare\n\t\t(\"\n\t\t\tinsert into\n\t\t\t\tBooth (BoothNum)\n\t\t\t\tvalues (?)\n\t\t\");\n\n\t\t$query->execute(array_values($this->fields));\n\n\t}", "public function insertAction()\r\n\t{\r\n\t\tif ($this->request->getPost('submit')) {\r\n\t\t\t$name = $this->request->getPost('name');\r\n\t\t\t$phone = $this->request->getPost('phone');\r\n\t\t\t$arrPost = array('name' => $name, 'phone' => $phone);\r\n\t\t\t$room = new Room();\r\n\t\t\tif ($room->save($arrPost)) {\r\n\t\t\t\t$this->response->redirect(\"/users/index\", true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public function createBooking(array $data);", "public function store() {\n try {\n $this->booking->create(Input::all());\n Notification::success( trans('app.booking_added') );\n return langRedirectRoute('admin.booking.index');\n } catch (ValidationException $e) {\n return langRedirectRoute('admin.booking.create')->withInput()->withErrors($e->getErrors());\n }\n }", "public function insert($calendario);", "function createAppointment(){\n\t\t\t$query = \"INSERT INTO appointment set appTime=?, custId=?\";\n\t\t\t$stmt = $this->conn->prepare($query);\n\t\t\t// $stmt->bindparam(1, $this->serviceType);\n\t\t\t// $stmt->bindparam(2, $this->serviceName);\n\t\t\t// $stmt->bindparam(3, $this->appDate);\n\t\t\t$stmt->bindparam(1, $this->appTime);\n\t\t\t$stmt->bindparam(2, $_SESSION['username']);\n\n\t\t\tif($stmt->execute()){\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}", "function save(){\r\n\t\tglobal $wpdb;\r\n\t\t$table = $wpdb->prefix.EM_BOOKINGS_TABLE;\r\n\t\t//First the person\r\n\t\t//Does this person exist?\r\n\t\t$person_result = $this->person->save();\r\n\t\tif( $person_result === false ){\r\n\t\t\t$this->errors = array_merge($this->errors, $this->person->errors);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$this->person_id = $this->person->id;\r\n\t\t\r\n\t\t//Now we save the booking\r\n\t\t$data = $this->to_array();\r\n\t\tif($this->id != ''){\r\n\t\t\t$where = array( 'booking_id' => $this->id ); \r\n\t\t\t$result = $wpdb->update($table, $data, $where, $this->get_types($data));\r\n\t\t}else{\r\n\t\t\t$result = $wpdb->insert($table, $data, $this->get_types($data));\r\n\t\t $this->id = $wpdb->insert_id; \r\n\t\t}\r\n\t\tif( $result === false ){\r\n\t\t\t$this->errors[] = __('There was a problem saving the booking.', 'dbem'); \r\n\t\t}\r\n\t\t\r\n\t\tglobal $current_booking_id ; \r\n\t\t$current_booking_id = $this->id ;\r\n\t\t\r\n\t\t//Give feedback on result\r\n\t\tif( count($this->errors) == 0 ){\r\n\t\t\t//Success\r\n\t\t\t$this->feedback_message = __('Your booking has been recorded','dbem');\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\t\t\r\n\t\treturn true;\r\n\t}", "public function criar()\n {\n\n $data = array(\n 'titulo' => $this->input->post('book_titulo'),\n 'autor' => $this->input->post('book_autor')\n );\n\n // $this->db->query($sql, $data);\n\n $this->db->insert('books', $data);\n }", "public function insert($roomId, $userId, $checkInDate, $checkOutDate) \n {\n $this->getPdo()->beginTransaction();\n\n //Step 2, get room info \n $parameters = [\n ':room_id' => $roomId,\n ];\n $roomInfo = $this->fetch('SELECT * FROM room WHERE room_id = :room_id', $parameters);\n \n $price = $roomInfo['price'];\n\n // Step 3, Calculate final price (from dates)\n $checkInDateTime = new DateTime($checkInDate);\n $checkOutDateTime = new DateTime($checkOutDate);\n $daysDiff = $checkOutDateTime->diff($checkInDateTime)->days;\n $totalPrice = $price * $daysDiff;\n\n // Step 4, Book room \n $parameters = [\n ':room_id' => $roomId,\n ':user_id' => $userId,\n ':total_price' => $totalPrice,\n ':check_in_date' => $checkInDate,\n ':check_out_date' => $checkOutDate,\n ];\n \n $this->execute('INSERT INTO booking (room_id, user_id, total_price, check_in_date, check_out_date) \n VALUES (:room_id, :user_id, :total_price, :check_in_date, :check_out_date)', $parameters);\n \n // Step 5, commit \n return $this->getPdo()->commit();\n }", "public function addBooking($data)\n\t{\n\t\t$this->db->insert($this->pro->prifix.$this->pro->booking,$data);\n\t\treturn $this->db->insert_id();\n\t\t\n\t}", "public function store(BookingStoreRequest $request)\n {\n $start_time = Booking::nextAvailable($request->start_time, $request->service_id);\n \n if ($request->start_time != $start_time) {\n return back()->withErrors('The booking time you choosen is not available. Next available is ' . $start_time);\n }\n \n $end_time = Booking::ends($start_time, $request->service_id);\n \n $parameters = [\n 'car_id' => $request->car_id,\n 'service_id' => $request->service_id,\n 'start_time' => $start_time,\n 'end_time' => $end_time,\n 'note' => $request->note\n ];\n\n if($request->bookWithRegister) {\n DB::beginTransaction();\n \n $user = (new UserService())\n ->make($request->validated());\n $car = $user->cars()->save(\n new Car($request->validated())\n );\n $car->bookings()->save(\n new Booking($parameters)\n );\n \n DB::commit();\n session()->flash('message', 'You created new user and car and made a booking for him');\n } else {\n $this->service->make($parameters);\n \n session()->flash('message', 'You made a booking for existing user');\n }\n\n return redirect('/bookings');\n }", "public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Booking::$rules, Booking::$messages);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\t$client = Client::findOrFail(Input::get('client_id'));\n\t\t$car = Car::findOrFail(Input::get('car_id'));\n\n\t\t$booking = new Booking;\n\n\t\t$booking->client()->associate($client);\n\t\t$booking->car()->associate($car);\n\t\t$booking->date = date('Y-m-d');\n\t\t$booking->destination = Input::get('destination');\n\t\t/*$booking->distance = Input::get('distance');*/\n\t\t$booking->date_out = Input::get('date_out');\n\t\t$booking->date_back = Input::get('date_back');\n\t\t$booking->branch = Input::get('branch');\n\t\t$booking->status = 'active';\n\n\t\t$booking->save();\n\n\n\t\t$car->status = 'booked';\n\t\t$car->update();\n\t\treturn Redirect::route('bookings.index');\n\n\t}", "function insert() {\n\t\t$sql = \"INSERT INTO lessons\n\t\t\t\tVALUES (?, ?, ?, ?, ?)\";\n\t\t\n\t\t$this->db->query($sql, array($this->lessons_id, $this->name, $this->date, $this->active, $this->rank));\n\t\t$this->last_insert_id = $this->db->insert_id();\t\t\n\t\t\n\t}", "public function booking_save()\n\t{\n\n\t\t$validator = Validator::make(\n\t\t\tInput::all(),\n\t\t\tarray(\n\t\t\t\t'book_id' => 'bail|required',\n\n\t\t\t\t'name' => 'bail|string',\n\t\t\t\t'mail' => 'bail|required|email',\n\n\t\t\t\t'hours' => 'bail|numeric',\n\t\t\t\t'supplies' => 'bail|boolean',\n\t\t\t\t'instruction' => 'bail|string'\n\t\t\t)\n\t\t);\n\n\t\tif ($validator->passes()) {\n\n\t\t\t$client_id = 0;\n\t\t\t$book_id = typecast(Input::get('book_id'), 'string');\n\t\t\t\n\t\t\t// Timetable data\n\t\t\t$id_data = explode('_', $book_id);\n\t\t\t$timetable_id = typecast(substr($id_data[0], 1), 'int');\n\n\t\t\t// Validate slots\n\t\t\t$interval = self::valid_hour(Input::get('hours'));\n\t\t\t$timetable = GeneratorModel::get_active_timetable();\n\t\t\t$slotlist = GeneratorModel::generate_schedule($timetable, $interval);\n\t\t\t$summary = self::get_slot($book_id);\n\n\n\t\t\t$slotdata = array();\n\t\t\tforeach ($slotlist as $slot) {\n\n\t\t\t\tif ($slot['group_id'] == $book_id) {\n\n\t\t\t\t\t$slotdata = $slot;\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\tif ($slotdata and $summary) {\n\n\t\t\t\t// Get client_id based from given email\n\t\t\t\t$email = typecast(Input::get('mail'), 'string');\n\t\t\t\t$is_valid_email = ValidatorModel::email($email, true);\n\n\t\t\t\tif (count($is_valid_email) > 1) {\n\n\t\t\t\t\t$client_id = $is_valid_email['client_id'];\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn Msg::error('Email is not available.');\n\t\t\t\t}\n\n\n\t\t\t\t// Generate encrypted payload\n\t\t\t\t$payload = Aes::payload(array(\n\t\t\t\t\t'c_id' => $client_id,\n\t\t\t\t\t's_id' => $book_id,\n\t\t\t\t\t'prc' => $slotdata['price']\n\t\t\t\t));\n\n\n\t\t\t\t// Save booking information\n\t\t\t\t$save = BookingModel::save_booking(array(\n\n\t\t\t\t\t'timetable_id' => $timetable_id,\n\n\t\t\t\t\t'client_id' => $client_id,\n\n\n\t\t\t\t\t'need_supplies' => typecast(Input::get('supplies'), 'integer'),\n\n\t\t\t\t\t'instructions' => typecast(Input::get('instruction'), 'string'),\n\n\t\t\t\t\t'schedule_start' => $slotdata['schedule_start'],\n\n\t\t\t\t\t'schedule_end' => $slotdata['schedule_end'],\n\n\t\t\t\t\t'price' => $slotdata['price'],\n\n\t\t\t\t\t'payload' => $payload,\n\n\n\t\t\t\t\t'tmp_book_id' => typecast(Input::get('book_id'), 'string'),\n\t\t\t\t\t'tmp_interval' => self::valid_hour(Input::get('hours'))\n\t\t\t\t));\n\n\t\t\t\tif (is_array($save) and isset($save['booking_id'])) {\n\t\t\t\t\t\n\t\t\t\t\t// Add booking_id on the payload\n\t\t\t\t\t$booking_id = $save['booking_id'];\n\t\t\t\t\t$decrypt = json_decode(Aes::decrypt(urldecode($payload)), true);\n\t\t\t\t\t$decrypt['b_id'] = $booking_id;\n\t\t\t\t\t$new_data = json_encode($decrypt);\n\t\t\t\t\t$new_payload = urlencode(Aes::encrypt($new_data));\n\n\n\t\t\t\t\t$base_url = MODULE_BASE_URL;\n\t\t\t\t\t$payload_url = \"{$base_url}/confirm?pl={$new_payload}\";\n\t\t\t\t\t$payload_name = typecast(Input::get('name'), 'string');\n\n\n\t\t\t\t\t$template = Template::generate('confirmation', array(\n\t\t\t\t\t\t'logo' => ASSET_LOGO,\n\t\t\t\t\t\t'name' => ucwords($payload_name),\n\t\t\t\t\t\t'link' => $payload_url,\n\n\t\t\t\t\t\t'date' => $summary['date_available'],\n\t\t\t\t\t\t'time' => \"{$summary['schedule_start']} to {$summary['schedule_end']}\",\n\t\t\t\t\t\t'hourly' => $summary['hours_text'],\n\t\t\t\t\t\t'total' => $summary['price'],\n\n\t\t\t\t\t\t'avatar' => $summary['avatar'],\n\t\t\t\t\t\t'cleaner' => \"{$summary['firstname']} {$summary['lastname']}\",\n\t\t\t\t\t\t'rating' => $summary['rate']\n\t\t\t\t\t));\n\n\n\t\t\t\t\t// Send email confirmation\n\t\t\t\t\tif (ENVIRONMENT === 'production') {\n\n\t\t\t\t\t\t$bcc = defined('EMAIL_CONFIRM_BCC') ? EMAIL_CONFIRM_BCC : null;\n\n\t\t\t\t\t\temailer($email, 'Rosie Services Confirm Booking', $template, $bcc);\n\t\t\t\t\t\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tlog_write('email_conf', $template);\n\n\t\t\t\t\t\treturn self::success($payload_url);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn self::success(\"Thank your for booking. An email confirmation has been sent to <b>{$email}</b>. The slot confirmation will be <b>valid within 24 hours</b>.\");\n\t\t\t\t\n\t\t\t\t} else if ($save === false) {\n\n\t\t\t\t\treturn Msg::error('Booking was not saved. Please review your booking information.');\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn Msg::error('This slot has already been booked. Please try other time slot.');\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\treturn Msg::error('Invalid booking request. Slot is not available.');\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\treturn Msg::error('Invalid booking request. Please verify the booking information before saving.');\n\t\t}\n\t}", "public function insert()\n\t{\n\t\t$crud = $this->crud->data([\n\t\t\t'first_name' => $_POST['first_name'],\n\t\t\t'last_name' => $_POST['last_name'],\n\t\t]);\n\t\t$crud->insert();\n\t\t$this->redirect('crud');\n\t}", "function insert() {\n if(!$this->valid):\n return;\n endif;\n \n $this->name = mysql_real_escape_string($this->name);\n $this->brief = mysql_real_escape_string($this->brief);\n $this->description = mysql_real_escape_string($this->description);\n $this->games = mysql_real_escape_string($this->games);\n $this->headquarter = mysql_real_escape_string($this->headquarter);\n \n $sql = \"INSERT INTO companies\n (name, brief, description, date_founded, headquarter, website, imageURL, games, num_likes)\n VALUES\n ('$this->name', '$this->brief', '$this->description', '$this->date_founded', '$this->headquarter', '$this->website', '$this->imageURL', '$this->games', '$this->num_likes')\";\n \n if(!mysqli_query($this->con, $sql)) {\n die('Error: ' . mysqli_error($this->con));\n }\n \n //mysqli_close($con);\n \n echo \"<br>Insertion Successful!<br>\";\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'booking_code' => 'required',\n 'order_date' => 'required',\n 'rental_date' => 'required',\n 'return_date' => 'required',\n 'price' => 'required',\n 'status' => 'required',\n 'fine' => 'required',\n 'car_id' => 'required',\n 'client_id' => 'required'\n ]);\n\n $insert = [\n 'booking_code'=> $request->booking_code,\n 'order_date'=> $request->order_date,\n 'rental_date'=> $request->rental_date,\n 'return_date'=> $request->return_date,\n 'price'=> $request->price,\n 'status'=> $request->status,\n 'fine'=> $request->fine,\n 'car_id'=> $request->car_id,\n 'client_id'=> $request->client_id\n ];\n\n $bookingCreate = Booking::create($insert);\n return redirect()->route('booking.index');\n }", "public function actionCreate() {\n $model = new Bookings();\n\n $model->load(Yii::$app->request->post());\n $query = Bookings::find()\n ->andWhere(['patients_id' => $model->patients_id])\n ->andWhere(['date' => $model->date])->one();\n\n\n if (!empty($query->doctors_id)) {\n Yii::$app->session->setFlash('error', 'You already have an appointment on this date');\n return $this->redirect(['view', 'id' => $query->id]);\n }\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n// $model->time = Yii::$app->formatter->\n// asDate($_POST['hours'].$_POST['minutes'], 'HH:mm');\n\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function store(BookingRequest $request)\n {\n return $this->bookingRepository->create($request->all());\n }", "public function store()\n\t{\n\t\t$reserva = new Reserva;\n\t\t$reserva->persona_id = Input::get('persona_id');\n\t\t$reserva->puesto_id = Input::get('puesto_id');\n\t\t$reserva->start_date = Input::get('start_date');\n\t\t$reserva->end_date = Input::get('end_date');\n\t\t$reserva->save();\n\t}", "public function run()\n {\n $booking_methods = [\n [ \n 'name' => 'Paypal',\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n\n [\n 'name' => 'Credit Card',\n 'created_at' => now(),\n 'updated_at' => now()\n\n ],\n ];\n\n BookingMethod::insert($booking_methods);\n }", "protected function insert()\n\t{\n\t\t$this->autofill();\n\n\t\tparent::insert();\n\n\t}", "public static function insert(){\n $dayOfWeek = $_REQUEST[\"dayOfWeek\"];\n $startTime = $_REQUEST[\"startTime\"];\n $endTime = $_REQUEST[\"endTime\"];\n \n $result = DB::dataManipulation(\"INSERT INTO timeslots (dayOfWeek, startTime, endTime)\n VALUES ('$dayOfWeek','$startTime','$endTime')\");\n return $result;\n }", "public function insert($gunBbl);", "public function actionCreate()\n {\n $model = new ArsBooking();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }" ]
[ "0.72324854", "0.7022042", "0.6997521", "0.6811457", "0.6730472", "0.65867186", "0.65729856", "0.6424492", "0.64137965", "0.63904387", "0.63881373", "0.637843", "0.63579226", "0.6351279", "0.6337271", "0.6236255", "0.62203753", "0.6162544", "0.6160961", "0.61572355", "0.61406255", "0.6131232", "0.61247706", "0.6096146", "0.6091644", "0.6089519", "0.6072917", "0.6062389", "0.6045828", "0.60400546" ]
0.7374026
0
Updates a booking from the database
function wpbs_update_booking($booking_id, $data) { return wp_booking_system()->db['bookings']->update($booking_id, $data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateBooking(Request $request, $id)\n{\n $booking = Booking::find($id);\n $booking->update($request->all());\n\n $response = [\n 'message'=>'Update Succesfully',\n 'booking' => $booking,\n \n \n ];\n\n return response($response); \n}", "public function update(Request $request, Booking $booking)\n {\n //\n }", "public function update(Request $request, Booking $booking)\n {\n //\n }", "public function update(Request $request, Booking $booking)\n {\n //\n }", "public function update(Request $request, Booking $booking)\n {\n //\n }", "public function update(Request $request, Booking $booking)\n {\n //\n }", "public function updateBookingStatus(){\n $command = Yii::$app->db->createCommand();\n $id= Yii::$app->request->bodyParams[\"booking2\"];\n\n try {\n $command->update('car', ['pendingTime' => 'on', 'inUse' => 'pending'], 'id = '.$id)->execute();\n } catch (Exception $e) {\n printf(\"Cannot update data\");\n }\n }", "public function update() {\n $bookingJson = array(\n 'adults' => $this->getAdults(),\n 'children' => $this->getChildren(),\n 'infants' => $this->getInfants()\n );\n $response = \\tabs\\api\\client\\ApiClient::getApi()->put(\n \"/booking/{$this->getBookingId()}\",\n array(\n 'data' => json_encode($bookingJson)\n )\n );\n if ($response->status !== 204) {\n throw new \\tabs\\api\\client\\ApiException(\n $response,\n 'Could not update booking'\n );\n }\n\n return $this;\n }", "public function update(SaveBookingRequest $request, Booking $booking)\n {\n return DB::transaction(function () use ($request, $booking) {\n $request->merge([\n 'total_weight' => numeric(array_sum(array_column($request->input('goods', []), 'weight'))),\n 'total_gross_weight' => numeric(array_sum(array_column($request->input('goods', []), 'gross_weight'))),\n ]);\n $booking->fill($request->input());\n $booking->save();\n\n // sync booking containers\n $excluded = collect($request->input('containers', []))->filter(function ($container) {\n return !empty($container['id']);\n });\n $booking->bookingContainers()->whereNotIn('id', $excluded->pluck('id'))->delete();\n foreach ($request->input('containers', []) as $container) {\n $booking->bookingContainers()->updateOrCreate(\n ['id' => data_get($container, 'id')],\n $container\n );\n }\n\n // sync booking goods\n $excluded = collect($request->input('goods', []))->filter(function ($item) {\n return !empty($item['id']);\n });\n $booking->bookingGoods()->whereNotIn('id', $excluded->pluck('id'))->delete();\n foreach ($request->input('goods', []) as $item) {\n $booking->bookingGoods()->updateOrCreate(\n ['id' => data_get($item, 'id')],\n $item\n );\n }\n\n return response()->json([\n 'status' => 'success',\n 'data' => $booking,\n 'message' => __(\"Booking :number successfully updated\", [\n 'number' => $booking->booking_number\n ])\n ]);\n });\n }", "public function myBookingEdit(Request $request)\n {\n $bookingService = BookingService::select()\n ->where('bookingCode', '=', $request->get('bookingCode'))\n ->first();\n\n $tourDate = Carbon::createFromFormat('d/m/Y', $request->get('tourDate'))->format('Y-m-d'); \n \n $bookingService->countAdult = $request->get('countAdult');\n $bookingService->countChild = $request->get('countChild');\n $bookingService->tourDate = $tourDate;\n $bookingService->userRequirement = $request->get('userRequirement');\n $bookingService->totalPrice = $request->get('totalPrice');\n\n // Update to DB\n $bookingService->save();\n\n return response()->json(['success'=>'Booking Edit']);\n }", "public function edit(Booking $booking)\n {\n //\n }", "public function edit(Booking $booking)\n {\n //\n }", "public function edit(Booking $booking)\n {\n //\n }", "public function edit(Booking $booking)\n {\n //\n }", "public function edit(Booking $booking)\n {\n //\n }", "public function edit(Booking $booking)\n {\n //\n }", "public function update(Request $request, Booking $booking)\n {\n $request->validate([\n 'name' => 'nullable|string',\n 'start_date' => 'nullable|date',\n 'end_date' => 'nullable|date',\n 'customer_full_name' => 'nullable|string',\n 'customer_email' => 'nullable|string',\n 'user_id' => 'nullable|numeric',\n 'room_id' => 'nullable|numeric',\n ]);\n\n $start_date = Carbon::parse($request->start_date ?? $booking->start_date);\n $end_date = Carbon::parse($request->end_date ?? $booking->end_date);\n\n if($start_date->greaterThan($end_date)) {\n $errorMessage = array(\n 'status' => 'error',\n 'message' => 'Check-in date cannot be greater than checkout date!'\n );\n return response()->json($errorMessage, 500);\n }\n\n $conflicting_bookings = $this->get_conflicting_bookings($start_date, $end_date);\n\n $conflicting_bookings_without_current_booking = $conflicting_bookings->where('id', '!=', $booking->id);\n\n if(!$conflicting_bookings_without_current_booking->isEmpty()) {\n $errorMessage = array(\n 'status' => 'error',\n 'message' => 'Attempting to book room on occupied dates!'\n );\n return response()->json($errorMessage, 500);\n }\n\n if(Auth::user()) {\n $request->merge(['user_id'=> Auth::user()->id]);\n }\n if($booking->update($request->all())) {\n return response()->json($booking);\n }\n }", "public function update(Request $request, BookingRoom $bookingRoom)\n {\n //\n }", "public function update($id)\n\t{\n\t\t$booking = Booking::findOrFail($id);\n\n\t\t$validator = Validator::make($data = Input::all(), Booking::$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\t$client = Client::findOrFail(Input::get('client_id'));\n\t\t$car = Car::findOrFail(Input::get('car_id'));\n\n\t\t$booking->client()->associate($client);\n\t\t$booking->car()->associate($car);\n\t\t$booking->destination = Input::get('destination');\n\t\t$booking->date_out = Input::get('date_out');\n\t\t$booking->date_back = Input::get('date_back');\n\t\t$booking->branch = Input::get('branch');\n\t\t$booking->update();\n\n\t\treturn Redirect::route('bookings.index');\n\t}", "public function update(Request $request, $id)\n {\n $request->validate([\n 'seatno' => 'required',\n 'price' => 'required',\n 'date' => 'required' \n ]);\n $booking = Booking::find($id);\n $booking->route_id = 1;\n $booking->seat_no = request('seatno'); \n $booking->total_price = request('price'); \n $booking->dept_date = request('date');\n $booking->save();\n\n // return\n return redirect()->route('bookings.index'); \n }", "public function update(Request $request, Booking $booking)\n {\n \\App\\Booking::whereId($booking->id)->update([\n 'booking_status'=>$request->input('booking_status')\n ]);\n $client_id=\\App\\Booking::whereClient_id($booking->client_id)->first()->client_id;\n\n $client=DB::table('bookings')\n ->join('clients','clients.id','=','bookings.client_id')\n ->where('bookings.client_id','=',$client_id)\n ->select('clients.*')\n ->first();\n \n if($request->input('booking_status')=='confirmed')\n {\n $subject = 'Booking number ['.$booking->id.'] confirmed !';\n Flashy::message($subject);\n Mail::to($client->email)->send(new BookingStatus($subject)); \n }else{\n $subject = 'Booking number ['.$booking->id.'] cancelled !';\n Flashy::error($subject);\n Mail::to($client->email)->send(new BookingStatus($subject)); \n }\n\n return redirect()->route('bookings.index'); \n \n }", "public function update(BookingFormRequest $request, $id)\n {\n $validated = $request->validated();\n $booking = Booking::find($id);\n $booking->guest_full_name = $validated['guest_full_name'];\n $booking->guest_credit_card = $validated['guest_credit_card'];\n $booking->room = $validated['room'];\n $booking->from_date = $validated['from_date'];\n $booking->to_date = $validated['to_date'];\n $booking->more_details = $validated['more_details'];\n\n $booking->Save();\n return view('bookings.edit_booking_success', compact('booking'));\n\n\n\n }", "public function update(UpdateBooking $request, $id)\n {\n //delete old items and enter new\n BookingItem::where('booking_id', $id)->delete();\n\n $services = $request->cart_services;\n $quantity = $request->cart_quantity;\n $prices = $request->cart_prices;\n $discount = $request->cart_discount;\n $payment_status = $request->payment_status;\n $discountAmount = 0;\n $amountToPay = 0;\n\n $originalAmount = 0;\n $bookingItems = array();\n\n foreach ($services as $key=>$service){\n $amount = ($quantity[$key] * $prices[$key]);\n\n $bookingItems[] = [\n \"business_service_id\" => $service,\n \"quantity\" => $quantity[$key],\n \"unit_price\" => $prices[$key],\n \"amount\" => $amount\n ];\n\n $originalAmount = ($originalAmount + $amount);\n }\n\n\n $booking = Booking::find($id);\n\n $taxAmount = 0;\n if($booking->tax_amount > 0){\n $taxAmount = $booking->tax_amount;\n }\n\n if($discount > 0){\n if($discount > 100) $discount = 100;\n\n $discountAmount = (($discount/100) * $originalAmount);\n }\n\n $amountToPay = ($originalAmount - $discountAmount + $taxAmount);\n $amountToPay = round($amountToPay, 2);\n\n\n $booking->date_time = $request->booking_date.' '.Carbon::createFromFormat('h:i A', $request->booking_time)->format('H:i:s');\n $booking->status = $request->status;\n $booking->employee_id = ($request->employee_id != '') ? $request->employee_id : null ;\n $booking->original_amount = $originalAmount;\n $booking->discount = $discountAmount;\n $booking->discount_percent = $request->cart_discount;;\n $booking->amount_to_pay = $amountToPay;\n $booking->payment_status = $payment_status;\n $booking->save();\n\n foreach ($bookingItems as $key=>$bookingItem){\n $bookingItems[$key]['booking_id'] = $booking->id;\n }\n\n DB::table('booking_items')->insert($bookingItems);\n\n $view = view('admin.booking.show', compact('booking'))->render();\n\n return Reply::successWithData('messages.updatedSuccessfully', ['status' => 'success', 'view' => $view]);\n }", "public function update(Request $request)\n {\n if(is_array($request->id_booking)){\n for($i=0;$i<sizeof($request->id_booking);$i++){\n self::updateBooking($request->id_booking[$i],$request->user_id[$i],$request->house[$i],$request->room[$i],$request->date_from[$i],$request->date_to[$i],$request->status[$i],$request->mode[$i],$request->note[$i]);\n }\n }\n else{\n self::updateBooking($request->id_booking,$request->user_id,$request->house,$request->room,$request->date_from,$request->date_to,$request->status,$request->mode,$request->note);\n }\n return redirect(\"/booking\");\n }", "public function update(BookingRequest $request, $id)\n {\n $this->authorize('update', Booking::class);\n\n $booking = Booking::find($id);\n\n $data = $request->validated();\n\n $booking->update($data);\n\n return $this->respond(\n 'Booking Updated Successfully',\n fractal(\n Booking::where('id' , $booking->id)->first(),\n new BookingTransformer()\n )\n );\n }", "public function update(BookingRequest $request, $id)\n {\n return $this->bookingRepository->update($request->all(), $id);\n }", "public function update(Request $request, $id)\n {\n if(Auth::check()){\n $booking = bookings::find($id);\n $booking -> confirm_price = request()-> confirm_price;\n $booking -> admin_msg = request()-> admin_msg;\n $booking -> status = 'acknowledge';\n $booking -> save();\n return redirect(route('manage_booking.index'))->with('status','Booking Replying Successfully!');\n }else{\n return redirect(route('login'));\n }\n\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'book_status' => 'required',\n ]);\n\n //Edit Booking\n $booking = Booking::find($id);\n $booking->book_status = $request->input('book_status');\n \n $booking->save();\n\n return redirect('/bookings')->with('success', 'Booking Updated');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'booking_code' => 'required',\n 'order_date' => 'required',\n 'rental_date' => 'required',\n 'return_date' => 'required',\n 'price' => 'required',\n 'status' => 'required',\n 'fine' => 'required',\n 'car_id' => 'required',\n 'client_id' => 'required'\n ]);\n\n $insert = [\n 'booking_code'=> $request->booking_code,\n 'order_date'=> $request->order_date,\n 'rental_date'=> $request->rental_date,\n 'return_date'=> $request->return_date,\n 'price'=> $request->price,\n 'status'=> $request->status,\n 'fine'=> $request->fine,\n 'car_id'=> $request->car_id,\n 'client_id'=> $request->client_id\n ];\n\n $datas = Booking::where('id', $id)->update($insert);\n return redirect()->route('booking.index');\n }", "public function update(Tool $tool, Booking $booking, Request $request)\n {\n $this->validate($request, [\n 'start' => 'required|date',\n 'end' => 'required|date',\n ]);\n\n $start = new Carbon($request->start);\n $end = new Carbon($request->end);\n\n $response = $this->bookingManager->update($tool, $booking, $start, $end);\n\n if (is_string($response)) {\n // response is some sort of error\n return response()->json($response, IlluminateResponse::HTTP_UNPROCESSABLE_ENTITY);\n } else {\n // response is the new booking object\n return response()->json($response, IlluminateResponse::HTTP_OK);\n }\n }" ]
[ "0.75703937", "0.7483067", "0.7483067", "0.7483067", "0.7483067", "0.7483067", "0.73871624", "0.71963525", "0.70911264", "0.7053978", "0.70034367", "0.70034367", "0.70034367", "0.70034367", "0.70034367", "0.70034367", "0.69936186", "0.6969666", "0.69580436", "0.69411355", "0.68398654", "0.6815901", "0.67705834", "0.67600423", "0.674417", "0.6729303", "0.6698037", "0.66653085", "0.6650769", "0.6638869" ]
0.7757144
0
Deletes a booking from the database
function wpbs_delete_booking($booking_id) { return wp_booking_system()->db['bookings']->delete($booking_id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionDelete($id)\n\t{\n\t\t$id = (int) $id;\n\t\tYii::app()->db->createCommand(\"DELETE FROM booking WHERE id='{$id}'\")->execute();\n\t}", "public function destroy(Booking $booking)\n {\n //\n }", "public function destroy(Booking $booking)\n {\n //\n }", "public function destroy(Booking $booking)\n {\n //\n }", "function delete(){\r\n\t\tglobal $wpdb;\r\n\t\t$sql = $wpdb->prepare(\"DELETE FROM \". $wpdb->prefix.EM_BOOKINGS_TABLE . \" WHERE booking_id=%d\", $this->id);\r\n\t\treturn ( $wpdb->query( $sql ) !== false );\r\n\t}", "public function deleteBook()\n {\n $id = $_POST['id'];\n $time = DELETE_AFTER;\n if (USE_ONE_TABLE) {\n $sql = \"UPDATE `books_authors` SET `deleted` = DATE_ADD(NOW(), interval $time HOUR) WHERE `id` = ?\";\n } else {\n $sql = \"UPDATE `books` SET `deleted` = DATE_ADD(NOW(), interval $time HOUR) WHERE `id` = ?\";\n }\n $this->findBySql($sql, [$id]);\n\n }", "function delete(){\r\n\t\tglobal $wpdb;\r\n\t\t$sql = $wpdb->prepare(\"DELETE FROM \". EM_TICKETS_BOOKINGS_TABLE . \" WHERE ticket_booking_id=%d\", $this->id);\r\n\t\t$result = $wpdb->query( $sql );\r\n\t\treturn apply_filters('em_ticket_booking_delete', ($result !== false ), $this);\r\n\t}", "public function deleteFromBook(Book $book);", "public function destroy(Booking $booking)\n {\n $booking->delete();\n return redirect()->action('BookingController@index');\n }", "public function destroy($id)\n {\n //\n // dd($id);\n $booking = Booking::findOrFail($id)->delete();\n // dd($booking);\n return back();\n }", "public function delete ()\n {\n $query = \"DELETE FROM \" . $this->table_name . \" WHERE book_id = ?\";\n\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(1, $this->book_id);\n\n if($result = $stmt->execute()){\n return true;\n }\n else\n {\n return false;\n }\n }", "public function delete_booking_event( $booking ) {\n $sync_result = false;\n if ( $this->is_calendar_sync_enabled() ) {\n $booking = yith_get_booking( $booking );\n if ( $booking && $booking->is_valid() ) {\n $booking_id = $booking->get_id();\n $calendar_id = $this->get_calendar_id();\n $event_id = $this->create_booking_event_id( $booking_id );\n\n $uri = 'https://www.googleapis.com/calendar/v3/calendars/' . $calendar_id . '/events';\n $event_uri = $uri . '/' . $event_id;\n\n $params = array(\n 'method' => 'DELETE',\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_post( $event_uri, $params );\n if ( !is_wp_error( $response ) && empty( $response[ 'body' ] ) ) {\n $sync_result = 'deleted';\n $this->debug( 'Booking event deleted success', compact( 'booking_id', 'sync_result' ) );\n } else {\n $sync_result = false;\n $this->error( \"Error while deleting Booking #{$booking_id}: \", $response );\n }\n }\n }\n return $sync_result;\n }", "public function destroy(BookingRoom $bookingRoom)\n {\n //\n }", "public function destroy(Request $request, $id)\n {\n $saloon = Booking::find($id);\n $saloon->delete();\n $request->session()->flash('delete','Booking Deleted Successfully');\n return redirect('booking_admin');\n }", "public function delete() {\n global $DB;\n $DB->delete_records($this->get_table_name(), array('id' => $this->id));\n }", "function delete(){\n\t\tglobal $wpdb;\n\t\t$booking_ids = array();\n\t\tif( !empty($this->bookings) ){\n\t\t\t//get the booking ids tied to this event or preloaded into this object\n\t\t\tforeach( $this->bookings as $EM_Booking ){\n\t\t\t\t$booking_ids[] = $EM_Booking->booking_id;\n\t\t\t}\n\t\t\t$result_tickets = true;\n\t\t\t$result = true;\n\t\t\tif( count($booking_ids) > 0 ){\n\t\t\t\t//Delete bookings and ticket bookings\n\t\t\t\t$result_tickets = $wpdb->query(\"DELETE FROM \". EM_TICKETS_BOOKINGS_TABLE .\" WHERE booking_id IN (\".implode(',',$booking_ids).\");\");\n\t\t\t\t$result = $wpdb->query(\"DELETE FROM \".EM_BOOKINGS_TABLE.\" WHERE booking_id IN (\".implode(',',$booking_ids).\")\");\n\t\t\t}\n\t\t}elseif( !empty($this->event_id) ){\n\t\t\t//faster way of deleting bookings for an event circumventing the need to load all bookings if it hasn't been loaded already\n\t\t\t$event_id = absint($this->event_id);\n\t\t\t$booking_ids = $wpdb->get_col(\"SELECT booking_id FROM \".EM_BOOKINGS_TABLE.\" WHERE event_id = '$event_id'\");\n\t\t\t$result_tickets = $wpdb->query(\"DELETE FROM \". EM_TICKETS_BOOKINGS_TABLE .\" WHERE booking_id IN (SELECT booking_id FROM \".EM_BOOKINGS_TABLE.\" WHERE event_id = '$event_id')\");\n\t\t\t$result = $wpdb->query(\"DELETE FROM \".EM_BOOKINGS_TABLE.\" WHERE event_id = '$event_id'\");\n\t\t}else{\n\t\t\t//we have not bookings loaded to delete, nor an event to delete bookings from, so bookings are considered 'deleted' since there's nothing ot delete\n\t\t\t$result = $result_tickets = true;\n\t\t}\n\t\tdo_action('em_bookings_deleted', $result, $booking_ids);\n\t\treturn apply_filters('em_bookings_delete', $result !== false && $result_tickets !== false, $booking_ids, $this);\n\t}", "public function testDelete()\n\t{\n\t\t$this->resetReservationTable();\n\t\t$this->resetDateTimes();\n\t\t\n\t\t$reservation = new Reservation();\n\t\t$reservation->setAttributes(array(\n\t\t\t\t'roomid' => 1,\n\t\t\t\t'datefrom' => $this->_dateOverlapFrom,\n\t\t\t\t'numberofnights'=> $this->_numberofnights,\n\t\t\t\t));\n\t\t$reservation->save(false);\n\t\t$this->assertTrue($reservation->delete());\n\t}", "public function destroy($id)\n { \n\n $booking = Booking::find($id);\n \n if(auth()->user()->id !==$booking->user_id){\n return redirect('/bookings')->with('error', 'Unauthorized Page');\n }\n\n $booking->delete();\n return redirect('/bookings')->with('success', 'Booking Deleted');\n }", "public function destroy($id)\n {\n $booking = Booking::find($id);\n $booking->delete();\n return redirect()->route('bookings.index');\n }", "public function deleteAction(Request $request, Reservationbook $reservationbook)\n {\n $form = $this->createDeleteForm($reservationbook);\n $form->handleRequest($request);\n\n if ($form->isSubmitted() && $form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->remove($reservationbook);\n $em->flush();\n }\n\n return $this->redirectToRoute('reservationbook_index');\n }", "public function delete()\n {\n $this->db->delete($this->table, $this->data['id'], $this->key);\n }", "public function destroy($id)\n {\n $booking->delete();\n return redirect()->route('pages.booking.index');\n }", "public function destroy($id)\n {\n $booking = bookings::find($id);\n $booking->delete();\n return redirect()->back();\n }", "public function testDelete()\n\t{\n\t\t// Add test bookings\n\t\t$bookings = [];\n\t\tforeach ($this->clients as $client) {\n\t\t\t$booking = factory(\\App\\Booking::class)->create([\n\t\t\t\t'fitter_id' => $this->admin->fitter->id,\n\t\t\t\t'client_id' => $client->id,\n\t\t\t\t'horse_id' => factory(\\App\\Horse::class)->create(['client_id' => $client->id])->id,\n\t\t\t\t'rider_id' => factory(\\App\\Rider::class)->create(['client_id' => $client->id])->id,\n\t\t\t\t'user_id' => factory(\\App\\User::class)->create([\n\t\t\t\t\t'fitter_id' => $this->admin->fitter->id,\n\t\t\t\t\t'type' => 'fitter-user',\n\t\t\t\t])->id,\n\t\t\t]);\n\n\t\t\t$bookings[] = $booking->toArray();\n\t\t}\n\n\t\t$booking = \\App\\Booking::find($bookings[0]['id']);\n\n\t\t$this->actingAs($this->admin, 'api')\n\t\t\t ->delete('/api/v1/admin/bookings/' . $booking->id)\n\t\t\t ->assertStatus(200)\n\t\t\t ->assertJsonStructure([\n\t\t\t\t 'success',\n\t\t\t ]);\n\n\t\t$this->assertDatabaseMissing('bookings', ['id' => $booking->id]);\n\t}", "public function delete()\n {\n Db::getInstance()->delete($this->getTableName(), ['id' => $this->getId()]);\n }", "public function destroy($id)\n {\n return $this->bookingRepository->delete($id);\n }", "public function destroy( Booking $booking ) {\n /* Remove also the connection with the user */\n $booking->users()->detach();\n\n $booking->delete();\n\n return redirect()->route( 'bookings.index' );\n }", "function delete_reservation($id) {\n global $DB;\n\n $reservation = $DB->get_record('roomscheduler_reservations', array('id' => $id));\n\n //print_object($reservation);\n\n $reservation->active = 0;\n\n return $DB->update_record('roomscheduler_reservations', $reservation);\n}", "public function delete() {\n $conexion = StorianDB::connectDB();\n $borrado = \"DELETE FROM cuento WHERE id=\\\"\".$this->id.\"\\\"\";\n $conexion->exec($borrado);\n }", "public function delete(){\r\n\t\t$this->db->delete();\r\n\t}" ]
[ "0.7600376", "0.7498229", "0.7498229", "0.7498229", "0.7390713", "0.7155909", "0.7040999", "0.70099884", "0.68403435", "0.6787544", "0.67712027", "0.67559654", "0.673261", "0.67140347", "0.6641528", "0.65998256", "0.65989393", "0.65809923", "0.6577738", "0.65526277", "0.65205896", "0.65173143", "0.6515339", "0.65064085", "0.64993656", "0.64989156", "0.6481313", "0.6444693", "0.64334464", "0.6431653" ]
0.7692047
0
Inserts a new meta entry for the booking
function wpbs_add_booking_meta($booking_id, $meta_key, $meta_value, $unique = false) { return wp_booking_system()->db['bookingmeta']->add($booking_id, $meta_key, $meta_value, $unique); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function insert()\n {\n $this->_checkItem();\n $service = $this->getService();\n $entry = $service->newItemEntry();\n $this->setEntry($entry);\n $this->_prepareEnrtyForSave();\n $this->getEntry()->setItemType($this->_getItemType());\n $entry = $service->insertGbaseItem($this->getEntry());\n $this->setEntry($entry);\n $entryId = $this->getEntry()->getId();\n $published = $this->gBaseDate2DateTime($this->getEntry()->getPublished()->getText());\n $this->getItem()\n ->setGbaseItemId($entryId)\n ->setPublished($published);\n\n if ($expires = $this->_getAttributeValue('expiration_date')) {\n $expires = $this->gBaseDate2DateTime($expires);\n $this->getItem()->setExpires($expires);\n }\n }", "public function add($info, $meta)\r\n {\r\n\r\n }", "function wpbs_insert_booking($data)\n{\n\n return wp_booking_system()->db['bookings']->insert($data);\n\n}", "public function add_meta( &$object, $meta );", "protected function save_meta() {}", "function postmeta_insert_handler( $meta_id, $post_id, $meta_key, $meta_value='' ) {\n\t\tif ( in_array( $meta_key, $this->get_post_meta_name_ignore() ) )\n\t\t\treturn;\t\n\n\t\t$this->add_ping( 'db', array( 'postmeta' => $meta_id ) );\n\t}", "function add_metadata($meta_type, $object_id, $meta_key, $meta_value, $unique = \\false)\n {\n }", "protected function _insert()\n {\n \t$metadata = $this->_table->info(Zend_Db_Table_Abstract::METADATA);\n \t\n \tif(isset($metadata['created_at']))\n\t\t\t$this->_data['created_at'] = new Zend_Date ();\n \tif(isset($metadata['updated_at']))\n\t\t\t$this->_data['updated_at'] = new Zend_Date ();\n }", "public function add_meta( &$object, $meta ) {\n\t\t}", "public function add_meta( $key, $value, $unique = false );", "function add_post_meta($post_id, $meta_key, $meta_value, $unique = \\false)\n {\n }", "function add_meta($post_id)\n {\n }", "public function addMeta(Meta $meta) {\n $this->meta[$meta->getName()] = $meta;\n }", "public function create($newmeta) {\n\t\tif ($this->req ['auth_type'] == 'oauth') {\n\t\t\tif (is_string ( $newmeta ) && isset ( $_POST ['properties'] ) && is_object ( json_decode ( $_POST ['properties'] ) )) {\n\t\t\t\tif ($this->isCreateable ()) {\n\t\t\t\t\t// @TODO\n\t\t\t\t\t// Need to convert because there is an old structure\n\t\t\t\t\t$aMetavalues = array ();\n\t\t\t\t\tforeach ( json_decode ( $_POST ['properties'] ) as $sName => $sValue ) {\n\t\t\t\t\t\tarray_push ( $aMetavalues, array ('name' => $sName, 'value' => $sValue ) );\n\t\t\t\t\t}\n\t\t\t\t\tif (count ( $aMetavalues ) <= 150) {\n\t\t\t\t\t\t$iPrimaryMeta = ( int ) $this->oMetas->insertMeta ( array ('name' => $newmeta, 'accounts_idaccount' => $this->usr, 'namespaces_idnamespace' => $this->req ['request'] ['ns'] ) );\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (( int ) $iPrimaryMeta > 0 && count ( $aMetavalues ) > 0) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($this->setUsage ( $this->usr, array ('maxmetas' => 1 ) )) {\n\t\t\t\t\t\t\t\tif ($this->oMetavalue->insertValue ( $aMetavalues, $iPrimaryMeta )) {\n\t\t\t\t\t\t\t\t\t$this->addEntry ( 'response', array ('message' => 'Metaitem was created', 'meta' => $iPrimaryMeta ) );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$this->addEntry ( 'response', $this->oError->throwError ( 'META_BUDGET_LIMIT_REACHED' ) );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->addEntry ( 'response', $this->oError->throwError ( 'META_EXISTS' ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->addEntry ( 'response', $this->oError->throwError ( 'TO_MUCH_PROPERTYS' ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$this->addEntry ( 'response', $this->oError->throwError ( 'OAUTH_ONLY' ) );\n\t\t}\n\t\treturn $this->getResponse ();\n\t}", "function insert_wp_postmeta($wpdb, $id, $postmeta){\n $table = $wpdb->prefix.\"postmeta\";\n $class = get_id_post_type($wpdb, 'class', $postmeta['class']);\n $rul = get_id_post_type($wpdb, 'restricteduselicence', $postmeta['rul']);\n $pvp = get_id_post_type($wpdb, 'plantvariety', $postmeta['pvp']);\n $patent = get_id_post_type($wpdb, 'patent', $postmeta['patent']);\n $patent_number = get_id_post_type($wpdb, 'patentnumber', $postmeta['patent_number']);\n $patent_number_link = get_id_post_type($wpdb, 'patentnumberlink', $postmeta['patent_number_link']);\n \n add_post_meta($id, 'class', $class[0]->id);\n add_post_meta($id, 'restricted_use_licence', $rul[0]->id);\n add_post_meta($id, 'plant_variety_protection', $pvp[0]->id);\n add_post_meta($id, 'pvp_number', $postmeta['pvp_number']);\n add_post_meta($id, 'pdf_link', $postmeta['pdf_link']);\n add_post_meta($id, 'patent', $postmeta['patent']);\n add_post_meta($id, 'patent_number', $postmeta['patent_number']);\n add_post_meta($id, 'patent_number_link', $postmeta['patent_number_link']); \n}", "public function insert() {\n $this->data['creation_datetime']=date('Y-m-d H:i:s');\n $this->data['last_login_datetime']=date('Y-m-d H:i:s');\n if (array_key_exists('expiresIn', $this->rawData) && $this->rawData['expiresIn'] != '') {\n $this->data['expires_datetime']=date('Y-m-d H:i:s', time()+$this->rawData['expiresIn']); \n }\n parent::insert();\n }", "function add_mappoint() {\n\tif(isset($_POST['addpoint'])){\n\t\tglobal $wpdb;\n\t\t$data_top = $_POST['data-top'];\n\t\t$data_left = $_POST['data-left'];\n\t\t$point_tile = $_POST['map_point_title'];\n\t\t$point_content = $_POST['mappoint_content'];\n\n\n\t\t$post_id = wp_insert_post(array (\n\t\t\t'post_type' => 'map-point',\n\t\t\t'post_title' => $point_tile,\n\t\t\t'post_content' => $point_content,\n\t\t\t'post_status' => 'publish',\n\t\t\t'comment_status' => 'closed', // if you prefer\n\t\t\t'ping_status' => 'closed', // if you prefer\n\t\t));\n\n\t\tif ($post_id) {\n\t\t\t// insert post meta\n\t\t\tadd_post_meta($post_id, '_data-top', $data_top);\n\t\t\tadd_post_meta($post_id, '_data-left', $data_left);\n\n\t\t}\n\n\t}\n}", "function add($meta = array(), $post_id = 0, $is_main = \\false)\n {\n }", "function tf_add_post_meta($post_id, $meta_key, $meta_value, $unique = false) {\r\n // make sure meta is added to the post, not a revision\r\n if ( $the_post = wp_is_post_revision($post_id) )\r\n $post_id = $the_post;\r\n\r\n $meta_type = 'post';\r\n $object_id = $post_id;\r\n\r\n if ( !$meta_type || !$meta_key )\r\n return false;\r\n\r\n if ( !$object_id = absint($object_id) )\r\n return false;\r\n\r\n if ( ! $table = _get_meta_table($meta_type) )\r\n return false;\r\n\r\n global $wpdb;\r\n\r\n $column = esc_sql($meta_type . '_id');\r\n\r\n // expected_slashed ($meta_key)\r\n // $meta_key = stripslashes($meta_key); // this was the trouble !\r\n // $meta_value = stripslashes_deep($meta_value); // this was the trouble !\r\n $meta_value = sanitize_meta( $meta_key, $meta_value, $meta_type );\r\n\r\n $check = apply_filters( \"add_{$meta_type}_metadata\", null, $object_id, $meta_key, $meta_value, $unique );\r\n if ( null !== $check )\r\n return $check;\r\n\r\n if ( $unique && $wpdb->get_var( $wpdb->prepare(\r\n \"SELECT COUNT(*) FROM $table WHERE meta_key = %s AND $column = %d\",\r\n $meta_key, $object_id ) ) )\r\n return false;\r\n\r\n $_meta_value = $meta_value;\r\n $meta_value = maybe_serialize( $meta_value );\r\n\r\n do_action( \"add_{$meta_type}_meta\", $object_id, $meta_key, $_meta_value );\r\n\r\n $result = $wpdb->insert( $table, array(\r\n $column => $object_id,\r\n 'meta_key' => $meta_key,\r\n 'meta_value' => $meta_value\r\n ) );\r\n\r\n if ( ! $result )\r\n return false;\r\n\r\n $mid = (int) $wpdb->insert_id;\r\n\r\n wp_cache_delete($object_id, $meta_type . '_meta');\r\n\r\n do_action( \"added_{$meta_type}_meta\", $mid, $object_id, $meta_key, $_meta_value );\r\n\r\n return $mid;\r\n }", "function add_site_meta($site_id, $meta_key, $meta_value, $unique = \\false)\n {\n }", "public function insert($techHit);", "public function add_meta( &$object, $meta ) {\n\t\t// TODO: Implement add_meta() method.\n\t}", "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 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 }", "protected function insert()\n\t{\n\t\t$this->autofill();\n\n\t\tparent::insert();\n\n\t}", "public function add_meta() {\n\n\t\tglobal $woocommerce, $post;\n\t\t// Text Field\n\t\twoocommerce_wp_text_input(\n\t\t\tarray(\n\t\t\t\t'id' => 'author',\n\t\t\t\t'label' => __( 'Author(s)', 'woocommerce' ),\n\t\t\t\t'placeholder' => 'author(s)',\n\t\t\t\t'desc_tip' => 'true',\n\t\t\t\t'description' => __( 'Author Name(s)', 'woocommerce' )\n\t\t\t)\n\t\t);\n\t\twoocommerce_wp_text_input(\n\t\t\tarray(\n\t\t\t\t'id' => 'release_date',\n\t\t\t\t'label' => __( 'Release Date', 'woocommerce' ),\n\t\t\t\t'placeholder' => date( \"n/j/Y\" ),\n\t\t\t\t'desc_tip' => 'true',\n\t\t\t\t'description' => __( 'Release Date', 'woocommerce' )\n\t\t\t)\n\t\t);\n\t\twoocommerce_wp_text_input(\n\t\t\tarray(\n\t\t\t\t'id' => 'preview_file',\n\t\t\t\t'label' => __( 'Preview File (look inside)', 'woocommerce' ),\n\t\t\t\t'desc_tip' => 'true',\n\t\t\t\t'description' => __( 'Upload a PDF file sample', 'woocommerce' )\n\t\t\t)\n\t\t);\n\t\techo( '<input type=\"button\" class=\"button custom_media\" name=\"preview_file_button\" id=\"preview_file_button\" value=\"Upload/Browse\"/>' );\n\t\twoocommerce_wp_checkbox(\n\t\t\tarray(\n\t\t\t\t'id' => 'local_product',\n\t\t\t\t'label' => __( 'Local Product', 'woocommerce' ),\n\t\t\t\t'desc_tip' => 'true',\n\t\t\t\t'description' => __( '(not Longleaf)', 'woocommerce' ),\n\t\t\t\t'cbvalue' => '1'\n\t\t\t)\n\t\t);\n\t}", "function cicleinscription_add_instance(stdClass $cicleinscription, mod_cicleinscription_mod_form $mform = null) {\n global $DB;\n $cicleinscription->timecreated = time();\n \n # You may have to add extra stuff in here #\n\n return $DB->insert_record('cicleinscription', $cicleinscription);\n}", "protected function saveMeta($meta){\r\n\t//System::dump($meta);\r\n\t\r\n\tforeach($meta as $item){\r\n\t\t\r\n\t\tif((string)$item->row->attributes()->system_type=='bool'){\r\n\t\t\t$postvalue = !isset($this->sourceData['meta_value_'.(string)$item->row->name]) ? 0: 1;\r\n\t\t}elseif((string)$item->row->attributes()->system_type=='text' || ( (string)$item->row->attributes()->system_type=='blob' && (string)$item->row->attributes()->cleanup==1 ) ){\r\n\t\t\t$postvalue = Filter::makeSafeString($this->sourceData['meta_value_'.(string)$item->row->name]);\r\n\t\t}else{\r\n\t\t\t$postvalue = $this->sourceData['meta_value_'.(string)$item->row->name];\r\n\t\t}\r\n\t\t\r\n\t\t$value = DataValidator::saveData($postvalue, (string)$item->row->attributes()->system_type);\r\n\t\t\r\n\t\t$metaEx = $this->metaRowExists((int)$item->row->name);\r\n\r\n\t\tif($this->id==0 || $metaEx==0){\r\n\t\t\t$id_connect = $this->id==0 ? (int)$this->lastInsert: (int)$this->id;\r\n\t\t\t$q = \"INSERT INTO \"._SQLPREFIX_.$this->metaDataTableName.\" (\".$this->metaConnectId.\", id_meta, \".(string)$item->row->attributes()->system_type.\"_value ) VALUES (\";\r\n\t\t\t$q .= \"'\".Db::escapeField($id_connect).\"', '\".(int)$item->row->name.\"'\".\", '\".Db::escapeField($value).\"')\";\r\n\t\t\r\n\t\t}else{\r\n\t\t\t$id_connect = (int)$this->id;\r\n\t\t\t$q = \"UPDATE \"._SQLPREFIX_.$this->metaDataTableName.\" SET \";\r\n\t\t\t$q .= (string)$item->row->attributes()->system_type.\"_value = '\".Db::escapeField($value).\"' WHERE \".$this->metaConnectId.\" = '\".$id_connect.\"' AND id_meta = '\".(string)$item->row->name.\"'\";\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//echo $q.'<br />'; \r\n\t\tDb::query($q);\r\n\t}\r\n}", "public function insert($object, $meta=null)\n {\n $query = new Query\\Insert;\n\n if (is_array($meta)) {\n throw new \\BadMethodCallException(\"Please use insertTable()\");\n }\n\n if ($meta) {\n $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $meta;\n } else {\n $meta = $this->mapper->getMeta(get_class($object));\n }\n\n if (!$meta->canInsert) {\n throw new Exception(\"Meta {$meta->id} prohibits insert\");\n }\n\n event_before: {\n if (isset($meta->on['beforeInsert'])) {\n foreach ($meta->on['beforeInsert'] as $cb) { $cb = [$object, $cb]; $cb(); }\n }\n if (isset($this->on['beforeInsert'])) {\n foreach ($this->on['beforeInsert'] as $cb) { $cb($object, $meta); }\n }\n }\n\n query: {\n $query->values = $this->mapper->mapObjectToRow($object, $meta, 'insert');\n if (!$query->table) {\n $query->table = $meta->table;\n }\n\n list ($sql, $params, $props) = $query->buildQuery($meta);\n $stmt = $this->getConnector()->prepare($sql);\n $stmt->execute($params);\n }\n \n $lastInsertId = null;\n\n // we need to be careful with \"lastInsertId\": SQLite generates one even without a PRIMARY\n if ($object && $meta->primary) {\n $lastInsertId = $this->getConnector()->lastInsertId();\n if ($lastInsertId && $meta->autoinc) {\n $field = $meta->fields[$meta->autoinc];\n $handler = $this->mapper->determineTypeHandler(Mapper::AUTOINC_TYPE);\n if (!$handler) {\n throw new \\UnexpectedValueException();\n }\n $meta->setValue($object, $meta->autoinc, $lastInsertId);\n }\n }\n \n event_after: {\n if (isset($meta->on['afterInsert'])) {\n foreach ($meta->on['afterInsert'] as $cb) { $cb = [$object, $cb]; $cb(); }\n }\n if (isset($this->on['afterInsert'])) {\n foreach ($this->on['afterInsert'] as $cb) { $cb($object, $meta); }\n }\n }\n\n return $lastInsertId;\n }", "public function addBooking($booking){\n \n }" ]
[ "0.6270945", "0.6206249", "0.6186913", "0.6150272", "0.6046951", "0.60208124", "0.5947092", "0.58898914", "0.588254", "0.58805084", "0.58191466", "0.5761349", "0.5738335", "0.5727745", "0.57005835", "0.5673149", "0.5660738", "0.5649115", "0.5607448", "0.5578807", "0.5577788", "0.5571533", "0.5546161", "0.5531089", "0.5515475", "0.55021685", "0.5487551", "0.54812515", "0.54749155", "0.5474451" ]
0.7134083
0
Updates a meta entry for the booking
function wpbs_update_booking_meta($booking_id, $meta_key, $meta_value, $prev_value = '') { return wp_booking_system()->db['bookingmeta']->update($booking_id, $meta_key, $meta_value, $prev_value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update_booking_meta( $meta ) {\n foreach ( $meta as $key => $value ) {\n if ( $key !== 'services' ) {\n update_post_meta( $this->id, '_' . $key, $value );\n } else {\n wp_set_post_terms( $this->id, $value, YITH_WCBK_Post_Types::$service_tax );\n }\n }\n }", "public function update() {\r\n\t\tif ( $this->key === 'job_title' || $this->key === 'job_description' ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$value = $this->get_posted_value();\r\n\t\tupdate_post_meta( $this->listing->get_id(), '_'.$this->key, $value );\r\n\t}", "function update_meta($meta_id, $meta_key, $meta_value)\n {\n }", "function wpbs_add_booking_meta($booking_id, $meta_key, $meta_value, $unique = false)\n{\n\n return wp_booking_system()->db['bookingmeta']->add($booking_id, $meta_key, $meta_value, $unique);\n\n}", "public function update_meta( &$object, $meta ) {\n\t\t}", "public function update($info, $meta)\r\n {\r\n\r\n }", "function update_book_meta( $id, $key, $value, $prev_value = '' ) {\r\n\treturn update_post_meta($id, $key, $value, $prev_value);\r\n}", "function wpbs_update_booking($booking_id, $data)\n{\n\n return wp_booking_system()->db['bookings']->update($booking_id, $data);\n\n}", "public function update_meta( $post_id, $meta_value, $meta_key ) {\n // To create new meta\n if ( ! get_post_meta( $post_id, $meta_key ) ) {\n add_post_meta( $post_id, $meta_key, $meta_value );\n } else {\n // or to update existing meta\n update_post_meta( $post_id, $meta_key, $meta_value );\n }\n }", "public function updateMeta(string $key, $value)\n {\n $this->meta[$key] = $value;\n }", "public function update_meta( $key, $value, $prev_value = '' );", "function update_metadata($meta_type, $object_id, $meta_key, $meta_value, $prev_value = '')\n {\n }", "public function update_meta_data( $key, $value, $meta_id = '' ) {\n\t\tif ( ! empty( $meta_id ) ) {\n\t\t\tupdate_metadata_by_mid( 'post', $meta_id, $value, $key );\n\t\t} else {\n\t\t\tupdate_post_meta( $this->get_id(), $key, $value );\n\t\t}\n\t}", "function update_post_meta($post_id, $meta_key, $meta_value, $prev_value = '')\n {\n }", "public function update(Request $request, Booking $booking)\n {\n //\n }", "public function update(Request $request, Booking $booking)\n {\n //\n }", "public function update(Request $request, Booking $booking)\n {\n //\n }", "public function update(Request $request, Booking $booking)\n {\n //\n }", "public function update(Request $request, Booking $booking)\n {\n //\n }", "private function set_meta( $key, $value ) {\n\t\tupdate_post_meta( $this->get_id(), $key, $value );\n\t}", "public function add_seller_id_meta( $booking_id ) {\n $product_id = get_post_meta( $booking_id, '_booking_product_id', true );\n $seller_id = get_post_field( 'post_author', $product_id );\n update_post_meta( $booking_id, '_booking_seller_id', $seller_id );\n }", "protected function update_attribute_meta( $meta_key, $meta_value ) {\n\t\tif ( $attribute = $this->get_mapping_attribute( $meta_key ) ) {\n\t\t\t$this->set_attribute( $attribute, $meta_value );\n\t\t}\n\t}", "function wpbs_get_booking_meta($booking_id, $meta_key = '', $single = false)\n{\n\n return wp_booking_system()->db['bookingmeta']->get($booking_id, $meta_key, $single);\n\n}", "function textbook_save_data() {\r\n global $post;\r\n update_post_meta($post->ID, 'textbook_pub',\r\n\t\t $_POST['textbook_pub']);\r\n update_post_meta($post->ID, 'textbook_author',\r\n\t\t $_POST['textbook_author']);\r\n update_post_meta($post->ID, 'textbook_date',\r\n\t\t $_POST['textbook_date']);\r\n}", "function update_custom_meta( $postID, $value, $field ) {\n if ( ! get_post_meta( $postID, $field ) ) {\n add_post_meta( $postID, $field, $value );\n } else {\n // or to update existing meta\n update_post_meta( $postID, $field, $value );\n }\n}", "protected function save_meta() {}", "function update_site_meta($site_id, $meta_key, $meta_value, $prev_value = '')\n {\n }", "function wpbs_delete_booking_meta($booking_id, $meta_key, $meta_value = '', $delete_all = '')\n{\n\n return wp_booking_system()->db['bookingmeta']->delete($booking_id, $meta_key, $meta_value, $delete_all);\n\n}", "public function updatePostMeta($post_meta_name) {\n $meta = array();\n $meta['image'] = $this->image;\n $meta['sub-images'] = $this->sub_images;\n $meta['link'] = $this->link;\n $meta['price'] = $this->price;\n $meta['product-code'] = $this->product_code;\n\n update_post_meta($this->id, $post_meta_name, $meta);\n }", "function update_usermeta($user_id, $meta_key, $meta_value)\n {\n }" ]
[ "0.705349", "0.6823063", "0.68111444", "0.66619456", "0.6560141", "0.6476049", "0.63927746", "0.6223144", "0.6060355", "0.6024493", "0.5988447", "0.5980762", "0.596906", "0.58837885", "0.58753985", "0.58753985", "0.58753985", "0.58753985", "0.58753985", "0.585582", "0.5834761", "0.5795145", "0.5788237", "0.5723136", "0.5666161", "0.56421196", "0.56391746", "0.5631451", "0.56177425", "0.55804586" ]
0.75284314
0
Returns a meta entry for the booking
function wpbs_get_booking_meta($booking_id, $meta_key = '', $single = false) { return wp_booking_system()->db['bookingmeta']->get($booking_id, $meta_key, $single); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_booking_meta() {\n $meta = array();\n foreach ( $this->get_default_meta_data() as $key => $value ) {\n if ( $key !== 'services' ) {\n $meta[ $key ] = get_post_meta( $this->id, '_' . $key, true );\n } else {\n $meta[ $key ] = wp_get_post_terms( $this->id, YITH_WCBK_Post_Types::$service_tax, array( 'fields' => 'ids' ) );\n }\n }\n\n return $meta;\n }", "function wpbs_get_booking($booking)\n{\n\n return wp_booking_system()->db['bookings']->get_object($booking);\n\n}", "function get_meta() {\n\n\t\t// Get meta fields\n\t\t$post_id\t\t\t= $this->post_id;\n\t\t$capacity\t\t\t= get_post_meta( $post_id , 'event_capacity' , true );\n\t\t$this->capacity\t\t= ( '' == $capacity ) ? 9999 : $capacity;\n\t\t$this->req_rsvp\t\t= get_post_meta( $post_id , 'event_rsvp' , true );\n\t\t$this->req_role\t\t= get_post_meta( $post_id , 'event_role' , true );\n\t\t$rsvps\t\t\t\t= get_post_meta( $post_id , 'event_rsvps' , true );\n\n\t\t// Sort responses alphabetically by name\n\t\tif( !empty( $rsvps ) ) :\n\t\t\t$names = array();\n\t\t\t\n\t\t\t// Get user information\n\t\t\tforeach ($rsvps as $user_id => $info) {\n\t\t\t\t$name = bp_core_get_user_displayname( $user_id );\n\t\t\t\t$link = bp_core_get_userlink( $user_id );\n\t\t\t\t$rsvps[$user_id]['id']\t\t= $user_id;\n\t\t\t\t$rsvps[$user_id]['name'] \t= $name;\n\t\t\t\t$rsvps[$user_id]['link'] \t= $link;\n\t\t\t\t$names[$user_id] \t\t\t= strtolower( $name );\n\t\t\t}\n\t\t\t\n\t\t\t// Sort the array alphabetically\n\t\t\tarray_multisort($names, SORT_STRING, $rsvps);\n\t\t\t\n\t\t\t// Restore the user_id keys\n\t\t\t$temp = array();\n\t\t\tfor ( $i = 0; $i < count( $rsvps ); $i++ )\n\t\t\t\t$temp[$rsvps[$i]['id']] = $rsvps[$i];\t\n\t\t\t$rsvps = $temp;\n\t\telse :\n\t\t\t$rsvps = array();\n\t\tendif;\n\n\t\t// Add the array of RSVPS to the object\n\t\t$this->rsvps = $rsvps;\n\n\t\t// Count Attendance\n\t\t$confirmed \t= 0;\n\t\t$maybe \t\t= 0;\n\t\t$declined \t= 0;\n\t\tforeach ( $rsvps as $response ) {\n\t\t\tif ( 'yes' == $response['rsvp'] )\t\t$confirmed++;\n\t\t\telseif ( 'maybe' == $response['rsvp'] ) $maybe++;\n\t\t\telseif ( 'no' == $response['rsvp'] )\t$declined++;\n\t\t}\n\n\t\t// Add response counts to the object\n\t\t$this->confirmed = $confirmed;\n\t\t$this->maybe = $maybe;\n\t\t$this->declined = $declined;\n\n\t\t// Check the user's response\n\t\tif ( isset( $rsvps[get_current_user_id()] ) ) {\n\t\t\tswitch ( $rsvps[get_current_user_id()]['rsvp'] ) {\n\t\t\t\tcase \"yes\" :\n\t\t\t\t\t$rsvp = \"Attending\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"no\" :\n\t\t\t\t\t$rsvp = \"Absent\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"maybe\" :\n\t\t\t\t\t$rsvp = \"Maybe\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\telse $rsvp = \"RSVP\";\n\t\t$this->rsvp = $rsvp;\n\n\t\t// Get date information\n\t\t$this->time\t= get_the_date( 'g:ia' );\n\t\t$this->day\t= get_the_date( 'l' );\n\t\t$this->date\t= get_the_date( 'M j' );\n\n\t\t// Has it passed?\n\t\t$this->is_past = ( strtotime( get_the_date( \"Y-m-d\\TH:i \\E\\S\\T\" ) ) < time() ) ? true : false;\n\t}", "function wpbs_add_booking_meta($booking_id, $meta_key, $meta_value, $unique = false)\n{\n\n return wp_booking_system()->db['bookingmeta']->add($booking_id, $meta_key, $meta_value, $unique);\n\n}", "public function get_meta() {\n\t\treturn $this->meta;\n\t}", "public function get_meta() {\n\t\treturn $this->meta;\n\t}", "public function detailData($booking_id)\n {\n return DB::table('bookings')->where('booking_id', $booking_id)->first();\n }", "public function meta()\n {\n return $this->meta;\n }", "public function getMeta() {\n return $this->meta;\n }", "function get_book_meta( $id, $key, $single = true ) {\r\n\tif ( strpos($key, 'book_') === false )\r\n\t\t$key = \"book_$key\";\r\n\treturn get_post_meta($id, $key, $single);\r\n}", "public function getMeta();", "public function getMeta();", "public function getMeta()\n {\n return $this->getValue('meta');\n }", "public function getMeta()\n {\n return $this->getValue('meta');\n }", "public function getMeta()\n {\n return $this->meta;\n }", "public function getMeta()\n {\n return $this->meta;\n }", "public function getMeta()\n {\n return $this->meta;\n }", "public function getMeta()\n {\n return $this->meta;\n }", "public function getMeta()\n {\n return $this->meta;\n }", "public function getMeta(){\n // $this->meta();\n }", "public function getMeta() {\n return $this->meta;\n }", "public function show(Booking $booking)\n {\n return $booking;\n }", "public function metadata()\n {\n return $this->hasOne(EntryMeta::class);\n }", "protected function meta() {\n if (!$this->_meta) {\n // Initialize at first call\n $this->_meta = new \\stdClass();\n if (!$this->isNewRecord && $this->{static::meta_id_field()}) {\n foreach ($this->meta as $meta_row) {\n $this->_meta->{static::meta_prefix() . $meta_row->meta_key} = $meta_row->meta_value;\n }\n }\n }\n return $this->_meta;\n }", "public function getMeta()\n {\n return $this->Meta;\n }", "public function getBook()\n\t{\n\t\treturn $this->getKeyValue('book'); \n\n\t}", "public function getEntity(): Booking\n {\n return (new Booking())\n ->setBeginsAt(new \\DateTime('2050/11/20'))\n ->setEndsAt(new \\DateTime('2050/11/25'))\n ->setTotalOccupiers(3);\n }", "function get_booking(){\r\n\t\tglobal $EM_Booking;\r\n\t\tif( is_object($this->booking) && get_class($this->booking)=='EM_Booking' && ($this->booking->id == $this->booking_id || (empty($this->id) && empty($this->booking_id))) ){\r\n\t\t\treturn $this->booking;\r\n\t\t}elseif( is_object($EM_Booking) && $EM_Booking->id == $this->booking_id ){\r\n\t\t\t$this->booking = $EM_Booking;\r\n\t\t}else{\r\n\t\t\tif(is_numeric($this->booking_id)){\r\n\t\t\t\t$this->booking = new EM_Booking($this->booking_id);\r\n\t\t\t}else{\r\n\t\t\t\t$this->booking = new EM_Booking();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn apply_filters('em_ticket_booking_get_booking', $this->booking, $this);;\r\n\t}", "public function getMetaAttribute(): object\n {\n return $this->getMetas();\n }", "function get_meta( $key = '' ) {\n\t\tif ( $key ) {\n\t\t\tif ( empty( $this->meta[ $key ] ) )\n\t\t\t\treturn;\n\n\t\t\t$meta = $this->meta[ $key ];\n\t\t} else {\n\t\t\t$meta = $this->meta;\n\t\t}\n\t\treturn $meta;\n\t}" ]
[ "0.66069955", "0.6369954", "0.61451024", "0.6119425", "0.6099613", "0.6099613", "0.6096732", "0.5950852", "0.59049326", "0.59042037", "0.5893344", "0.5893344", "0.58485353", "0.58485353", "0.58227235", "0.58227235", "0.58227235", "0.58227235", "0.58227235", "0.5778372", "0.57655406", "0.5706976", "0.5642161", "0.5636022", "0.559716", "0.5596816", "0.55842316", "0.5549479", "0.5548293", "0.5539309" ]
0.7402602
0
Returns the translated meta entry for the booking
function wpbs_get_translated_booking_meta($booking_id, $meta_key, $language_code) { $translated_meta = wpbs_get_booking_meta($booking_id, $meta_key . '_translation_' . $language_code, true); if (!empty($translated_meta)) { return $translated_meta; } return wpbs_get_booking_meta($booking_id, $meta_key, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wpbs_get_booking_meta($booking_id, $meta_key = '', $single = false)\n{\n\n return wp_booking_system()->db['bookingmeta']->get($booking_id, $meta_key, $single);\n\n}", "function get_booking_meta() {\n $meta = array();\n foreach ( $this->get_default_meta_data() as $key => $value ) {\n if ( $key !== 'services' ) {\n $meta[ $key ] = get_post_meta( $this->id, '_' . $key, true );\n } else {\n $meta[ $key ] = wp_get_post_terms( $this->id, YITH_WCBK_Post_Types::$service_tax, array( 'fields' => 'ids' ) );\n }\n }\n\n return $meta;\n }", "public function get( $meta_name, $single = true ) {\r\n\t\t$meta_name = '_campaign_' . $meta_name;\r\n\t\treturn get_post_meta( $this->post->ID, $meta_name, $single );\r\n\t}", "public function get_meta() {\n\t\treturn $this->meta;\n\t}", "public function get_meta() {\n\t\treturn $this->meta;\n\t}", "function setup_meta_translation() {\n\t\t\tglobal $post, $wpdb;\n\t\t\t$post_id = $post->ID;\n\t\t\t\n\t\t\tforeach($this->arabic_meta_keys as $key ) {\n\t\t\t\tif ($post_id){\n\t\t\t\t\t$$key = get_post_meta($post_id, $key, true);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$$key = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$the_post = get_post($post_id);\n\t\t\t\n\t\t\tinclude(dirname(__FILE__).'/views/ipc-meta-box-translation.php');\n\t\t}", "function wpbs_get_booking($booking)\n{\n\n return wp_booking_system()->db['bookings']->get_object($booking);\n\n}", "function get_book_meta( $id, $key, $single = true ) {\r\n\tif ( strpos($key, 'book_') === false )\r\n\t\t$key = \"book_$key\";\r\n\treturn get_post_meta($id, $key, $single);\r\n}", "function getTranslationObject();", "public function getMeta();", "public function getMeta();", "public function meta($key=false) {\n $object = $this->hasMany('VenueMeta');\n if($key) {\n $object = $object->where('meta_key',$key)->first();\n if( $object ) return $object->meta_value;\n } else {\n $voucher_meta = [];\n foreach ($object->get()->toArray() as $meta) {\n if( substr( $meta['meta_key'], 0, 8 ) == '_secure_' ) {\n $voucher_meta[$meta['meta_key']] = _jsondecrypt( $meta['meta_value'] );\n } else {\n $voucher_meta[$meta['meta_key']] = $meta['meta_value'];\n }\n }\n return $voucher_meta;\n }\n return null;\n }", "function acitpo_entry_meta() {\n\tglobal $post;\n\tif (is_page()) { return; }\n\t$categories = get_the_category_list(__(', ', 'acitpo'));\n\n\tprintf('<span class=\"date-link\"><a href=\"%1$s\" title=\"%2$s\" rel=\"bookmark\"><time class=\"entry-date\" datetime=\"%3$s\">%4$s</time></a></span>', esc_attr(get_permalink()), esc_attr(get_the_time()), esc_attr(get_the_time('c')), esc_html(get_the_date()));\n\tif ($categories) {\n\t\tprintf('<span class=\"category-links\">%s</span>', $categories);\n\t}\n\tprintf('<span class=\"author-link vcard\"><a href=\"%1$s\" title=\"%2$s\" rel=\"author\">%3$s</a></span>', esc_attr(get_author_posts_url(get_the_author_meta('ID'))), esc_attr(sprintf(__('View all posts by %s', 'acitpo'), get_the_author())), esc_html(get_the_author()));\n}", "public function getMeta()\n {\n return $this->getValue('meta');\n }", "public function getMeta()\n {\n return $this->getValue('meta');\n }", "function get_meta() {\n\n\t\t// Get meta fields\n\t\t$post_id\t\t\t= $this->post_id;\n\t\t$capacity\t\t\t= get_post_meta( $post_id , 'event_capacity' , true );\n\t\t$this->capacity\t\t= ( '' == $capacity ) ? 9999 : $capacity;\n\t\t$this->req_rsvp\t\t= get_post_meta( $post_id , 'event_rsvp' , true );\n\t\t$this->req_role\t\t= get_post_meta( $post_id , 'event_role' , true );\n\t\t$rsvps\t\t\t\t= get_post_meta( $post_id , 'event_rsvps' , true );\n\n\t\t// Sort responses alphabetically by name\n\t\tif( !empty( $rsvps ) ) :\n\t\t\t$names = array();\n\t\t\t\n\t\t\t// Get user information\n\t\t\tforeach ($rsvps as $user_id => $info) {\n\t\t\t\t$name = bp_core_get_user_displayname( $user_id );\n\t\t\t\t$link = bp_core_get_userlink( $user_id );\n\t\t\t\t$rsvps[$user_id]['id']\t\t= $user_id;\n\t\t\t\t$rsvps[$user_id]['name'] \t= $name;\n\t\t\t\t$rsvps[$user_id]['link'] \t= $link;\n\t\t\t\t$names[$user_id] \t\t\t= strtolower( $name );\n\t\t\t}\n\t\t\t\n\t\t\t// Sort the array alphabetically\n\t\t\tarray_multisort($names, SORT_STRING, $rsvps);\n\t\t\t\n\t\t\t// Restore the user_id keys\n\t\t\t$temp = array();\n\t\t\tfor ( $i = 0; $i < count( $rsvps ); $i++ )\n\t\t\t\t$temp[$rsvps[$i]['id']] = $rsvps[$i];\t\n\t\t\t$rsvps = $temp;\n\t\telse :\n\t\t\t$rsvps = array();\n\t\tendif;\n\n\t\t// Add the array of RSVPS to the object\n\t\t$this->rsvps = $rsvps;\n\n\t\t// Count Attendance\n\t\t$confirmed \t= 0;\n\t\t$maybe \t\t= 0;\n\t\t$declined \t= 0;\n\t\tforeach ( $rsvps as $response ) {\n\t\t\tif ( 'yes' == $response['rsvp'] )\t\t$confirmed++;\n\t\t\telseif ( 'maybe' == $response['rsvp'] ) $maybe++;\n\t\t\telseif ( 'no' == $response['rsvp'] )\t$declined++;\n\t\t}\n\n\t\t// Add response counts to the object\n\t\t$this->confirmed = $confirmed;\n\t\t$this->maybe = $maybe;\n\t\t$this->declined = $declined;\n\n\t\t// Check the user's response\n\t\tif ( isset( $rsvps[get_current_user_id()] ) ) {\n\t\t\tswitch ( $rsvps[get_current_user_id()]['rsvp'] ) {\n\t\t\t\tcase \"yes\" :\n\t\t\t\t\t$rsvp = \"Attending\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"no\" :\n\t\t\t\t\t$rsvp = \"Absent\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"maybe\" :\n\t\t\t\t\t$rsvp = \"Maybe\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\telse $rsvp = \"RSVP\";\n\t\t$this->rsvp = $rsvp;\n\n\t\t// Get date information\n\t\t$this->time\t= get_the_date( 'g:ia' );\n\t\t$this->day\t= get_the_date( 'l' );\n\t\t$this->date\t= get_the_date( 'M j' );\n\n\t\t// Has it passed?\n\t\t$this->is_past = ( strtotime( get_the_date( \"Y-m-d\\TH:i \\E\\S\\T\" ) ) < time() ) ? true : false;\n\t}", "function meta($key) {\n return get_post_meta($post->ID, $key, true);\n}", "public function meta()\n {\n return $this->meta;\n }", "public function getMeta(){\n // $this->meta();\n }", "public function getMeta() {\n return $this->meta;\n }", "function twentytwelve_entry_meta() {\n\t\t// Translators: used between list items, there is a space after the comma.\n\t\t$categories_list = get_the_category_list( __( ', ', 'twentytwelve' ) );\n\n\t\t// Translators: used between list items, there is a space after the comma.\n\t\t$tag_list = get_the_tag_list( '', __( ', ', 'twentytwelve' ) );\n\n\t\t$date = sprintf(\n\t\t\t'<a href=\"%1$s\" title=\"%2$s\" rel=\"bookmark\"><time class=\"entry-date\" datetime=\"%3$s\">%4$s</time></a>',\n\t\t\tesc_url( get_permalink() ),\n\t\t\tesc_attr( get_the_time() ),\n\t\t\tesc_attr( get_the_date( 'c' ) ),\n\t\t\tesc_html( get_the_date() )\n\t\t);\n\n\t\t$author = sprintf(\n\t\t\t'<span class=\"author vcard\"><a class=\"url fn n\" href=\"%1$s\" title=\"%2$s\" rel=\"author\">%3$s</a></span>',\n\t\t\tesc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),\n\t\t\tesc_attr( sprintf( __( 'View all posts by %s', 'twentytwelve' ), get_the_author() ) ),\n\t\t\tget_the_author()\n\t\t);\n\n\t\t// Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name.\n\t\tif ( $tag_list ) {\n\t\t\t$utility_text = __( 'This entry was posted in %1$s and tagged %2$s on %3$s<span class=\"by-author\"> by %4$s</span>.', 'twentytwelve' );\n\t\t} elseif ( $categories_list ) {\n\t\t\t$utility_text = __( 'This entry was posted in %1$s on %3$s<span class=\"by-author\"> by %4$s</span>.', 'twentytwelve' );\n\t\t} else {\n\t\t\t$utility_text = __( 'This entry was posted on %3$s<span class=\"by-author\"> by %4$s</span>.', 'twentytwelve' );\n\t\t}\n\n\t\tprintf(\n\t\t\t$utility_text,\n\t\t\t$categories_list,\n\t\t\t$tag_list,\n\t\t\t$date,\n\t\t\t$author\n\t\t);\n\t}", "public function get_value() {\r\n\t\tif ( $this->key === 'job_title' ) {\r\n\t\t\treturn $this->listing->get_name();\r\n\t\t}\r\n\r\n\t\tif ( $this->key === 'job_description' ) {\r\n\t\t\treturn $this->listing->get_data('post_content');\r\n\t\t}\r\n\r\n\t\t// othewise, retrieve from wp_postmeta\r\n\t\treturn get_post_meta( $this->listing->get_id(), '_'.$this->key, true );\r\n\t}", "public function getMessageMeta();", "public function getMetaDescription()\n {\n if (\\Lang::hasForLocale($this->getRoutesPath() . \\Slug::getRouteSlug(), $this->getCurrent())) {\n return trans($this->getRoutesPath() . \\Slug::getRouteSlug() . '.metaDescription');\n } else {\n return trans($this->getRoutesPath() . \\Slug::getRouteName() . '.metaDescription');\n }\n }", "public function getMeta()\n {\n return $this->meta;\n }", "public function getMeta()\n {\n return $this->meta;\n }", "public function getMeta()\n {\n return $this->meta;\n }", "public function getMeta()\n {\n return $this->meta;\n }", "public function getMeta()\n {\n return $this->meta;\n }", "function twentytwelve_entry_meta() {\n // Translators: used between list items, there is a space after the comma.\n $categories_list = get_the_category_list(__(', ', 'twentytwelve'));\n\n // Translators: used between list items, there is a space after the comma.\n $tag_list = get_the_tag_list('', __(', ', 'twentytwelve'));\n\n $date = sprintf('<a href=\"%1$s\" title=\"%2$s\" rel=\"bookmark\"><time class=\"entry-date\" datetime=\"%3$s\">%4$s</time></a>', esc_url(get_permalink()), esc_attr(get_the_time()), esc_attr(get_the_date('c')), esc_html(get_the_date())\n );\n\n $author = sprintf('<span class=\"author vcard\"><a class=\"url fn n\" href=\"%1$s\" title=\"%2$s\" rel=\"author\">%3$s</a></span>', esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_attr(sprintf(__('View all posts by %s', 'twentytwelve'), get_the_author())), get_the_author()\n );\n\n // Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name.\n if ($tag_list) {\n $utility_text = __('This entry was posted in %1$s and tagged %2$s on %3$s<span class=\"by-author\"> by %4$s</span>.', 'twentytwelve');\n } elseif ($categories_list) {\n $utility_text = __('This entry was posted in %1$s on %3$s<span class=\"by-author\"> by %4$s</span>.', 'twentytwelve');\n } else {\n $utility_text = __('This entry was posted on %3$s<span class=\"by-author\"> by %4$s</span>.', 'twentytwelve');\n }\n\n printf(\n $utility_text, $categories_list, $tag_list, $date, $author\n );\n }" ]
[ "0.67563593", "0.61785555", "0.5706054", "0.5674821", "0.5674821", "0.5669658", "0.5592495", "0.5554754", "0.5520171", "0.5511923", "0.5511923", "0.54742587", "0.5471152", "0.5466725", "0.5466725", "0.5459793", "0.545514", "0.5429134", "0.54226637", "0.5405048", "0.53978944", "0.53868103", "0.5355457", "0.53040695", "0.530066", "0.530066", "0.530066", "0.530066", "0.530066", "0.52846503" ]
0.71295846
0
Removes a meta entry for the booking
function wpbs_delete_booking_meta($booking_id, $meta_key, $meta_value = '', $delete_all = '') { return wp_booking_system()->db['bookingmeta']->delete($booking_id, $meta_key, $meta_value, $delete_all); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function magazine_remove_entry_meta() {\n\tif ( ! is_single() ) {\n\t\tremove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 );\n\t\tremove_action( 'genesis_entry_footer', 'genesis_post_meta' );\n\t\tremove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 );\n\t}\n\n}", "public function removeMeta(string $key)\n {\n if (isset($this->meta[$key])) {\n unset($this->meta[$key]);\n }\n }", "public function delete_meta( &$object, $meta ) {\n\t\t}", "function delete_book_meta( $id, $key, $value = '' ) {\r\n\treturn delete_post_meta($id, $key, $value);\r\n}", "function delete_post_meta_by_key($post_meta_key)\n {\n }", "function delete_site_meta_by_key($meta_key)\n {\n }", "function delete_post_meta($post_id, $meta_key, $meta_value = '')\n {\n }", "public function deletemeta($meta) {\n\t\tif ($this->req ['auth_type'] == 'oauth') {\n\t\t\tif (( int ) $meta == 0) {\n\t\t\t\t$oRow = $this->oMetas->getById ( $meta );\n\t\t\t\tif (is_array ( $oRow )) {\n\t\t\t\t\t$meta = ( int ) $oRow ['idmeta'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (( int ) $meta > 0) {\n\t\t\t\t\n\t\t\t\t$oTableCompMetas = new Application_Model_Table ();\n\t\t\t\t$oTableCompMetas->setTable ( 'comp_metas' );\n\t\t\t\t$oTableCompMetas->setPrimary ( 'idcomp_meta' );\n\t\t\t\t$oSelect = $oTableCompMetas->fetchAll ( $oTableCompMetas->select ()->from ( $oTableCompMetas->getTable () )->where ( 'metas_idmeta=' . ( int ) $meta ) );\n\t\t\t\tif (isset ( $_GET ['force'] ) && $_GET ['force'] == 'yes') {\n\t\t\t\t\tif ($this->isExtendable ()) {\n\t\t\t\t\t\tif ($this->oMetas->deleteMeta ( $meta )) {\n\t\t\t\t\t\t\t$iGiveBudgetBack = $this->usr;\n\t\t\t\t\t\t\tif (isset ( $oRowToDelete->accounts_idaccount ) && ( int ) $oRowToDelete->accounts_idaccount > 0) {\n\t\t\t\t\t\t\t\t$iIdCreator = ( int ) $oRowToDelete->accounts_idaccount;\n\t\t\t\t\t\t\t\t$iGiveBudgetBack = ($iIdCreator > 0) ? $iIdCreator : $iGiveBudgetBack;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->setUsage ( $iGiveBudgetBack, array ('maxmetas' => - 1 ) );\n\t\t\t\t\t\t\t$this->addEntry ( 'response', array ('meta' => $meta, 'message' => 'META_WAS_DELETED', 'comps_affected' => ( int ) $oSelect->count () ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->addEntry ( 'response', $this->oError->throwError ( 'MISSING_EXTEND_RIGHT' ) );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ($this->isDeleteable ()) {\n\t\t\t\t\t\tif ($oSelect->count () == 0) {\n\t\t\t\t\t\t\t$oRowToDelete = $this->oMetas->fetchRow ( $this->oMetas->select ()->where ( $this->oMetas->getPrimary () . '=' . $meta ) );\n\t\t\t\t\t\t\tif ($this->oMetas->deleteMeta ( $meta )) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$iGiveBudgetBack = $this->usr;\n\t\t\t\t\t\t\t\tif (isset ( $oRowToDelete->accounts_idaccount ) && ( int ) $oRowToDelete->accounts_idaccount > 0) {\n\t\t\t\t\t\t\t\t\t$iIdCreator = ( int ) $oRowToDelete->accounts_idaccount;\n\t\t\t\t\t\t\t\t\t$iGiveBudgetBack = ($iIdCreator > 0) ? $iIdCreator : $iGiveBudgetBack;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$this->setUsage ( $iGiveBudgetBack, array ('maxmetas' => - 1 ) );\n\t\t\t\t\t\t\t\t$this->addEntry ( 'response', array ('meta' => $meta, 'message' => 'META_WAS_DELETED' ) );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->addEntry ( 'response', $this->oError->throwError ( 'META_IN_TOUCH_WITH_COMPOSITE' ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->addEntry ( 'response', $this->oError->throwError ( 'MISSING_DELETE_RIGHT' ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->addEntry ( 'response', $this->oError->throwError ( 'META_NOT_FOUND' ) );\n\t\t\t}\n\t\t} else {\n\t\t\t$this->addEntry ( 'response', $this->oError->throwError ( 'OAUTH_ACCESS_ONLY' ) );\n\t\t}\n\t\treturn $this->getResponse ();\n\t}", "function unregister_post_meta($post_type, $meta_key)\n {\n }", "public function deletePostMeta() {\n delete_post_meta($this->id, $this->_post_meta_name);\n }", "function wck_remove_meta(){\r\n\t\tcheck_ajax_referer( \"wck-delete-entry\" );\r\n\t\tif( !empty( $_POST['meta'] ) )\r\n\t\t\t$meta = sanitize_text_field( $_POST['meta'] );\r\n\t\telse \r\n\t\t\t$meta = '';\r\n\t\tif( !empty( $_POST['id'] ) )\r\n\t\t\t$id = absint( $_POST['id'] );\r\n\t\telse \r\n\t\t\t$id = '';\r\n\t\tif( isset( $_POST['element_id'] ) )\r\n\t\t\t$element_id = absint( $_POST['element_id'] );\r\n\t\telse \r\n\t\t\t$element_id = '';\r\n\r\n\t\t// Security checks\r\n\t\tif( true !== ( $error = self::wck_verify_user_capabilities( $this->args['context'], $meta, $id ) ) ) {\r\n\t\t\theader( 'Content-type: application/json' );\r\n\t\t\tdie( json_encode( $error ) );\r\n\t\t}\r\n\t\t\r\n\t\tif( $this->args['context'] == 'post_meta' )\r\n\t\t\t$results = get_post_meta($id, $meta, true);\r\n\t\telse if ( $this->args['context'] == 'option' )\r\n\t\t\t$results = get_option( apply_filters( 'wck_option_meta' , $meta, $element_id ) );\r\n\t\t\r\n\t\t$old_results = $results;\r\n\t\tunset($results[$element_id]);\r\n\t\t/* reset the keys for the array */\r\n\t\t$results = array_values($results);\r\n\r\n\t\t/* make sure this does not output anything so it won't break the json response below\r\n\t\twill keep it do_action for compatibility reasons\r\n\t\t */\r\n\t\tob_start();\r\n\t\t\tdo_action( 'wck_before_remove_meta', $meta, $id, $element_id );\r\n\t\t$wck_before_remove_meta = ob_get_clean(); //don't output it\r\n\t\t\r\n\t\tif( $this->args['context'] == 'post_meta' )\r\n\t\t\tupdate_post_meta($id, $meta, $results);\r\n\t\telse if ( $this->args['context'] == 'option' )\r\n\t\t\tupdate_option( apply_filters( 'wck_option_meta' , $meta, $results, $element_id ), wp_unslash( $results ) );\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t/* TODO: optimize so that it updates from the deleted element forward */\r\n\t\t/* if unserialize_fields is true delete the coresponding post metas */\r\n\t\tif( $this->args['unserialize_fields'] && $this->args['context'] == 'post_meta' ){\t\t\t\r\n\t\t\t\r\n\t\t\t$meta_suffix = 1;\t\t\t\r\n\r\n\t\t\tif( !empty( $results ) ){\r\n\t\t\t\tforeach( $results as $result ){\r\n\t\t\t\t\tforeach ( $result as $name => $value){\r\n\t\t\t\t\t\tupdate_post_meta($id, $meta.'_'.$name.'_'.$meta_suffix, $value);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$meta_suffix++;\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif( count( $results ) == 0 )\r\n\t\t\t\t$results = $old_results;\r\n\t\t\t\r\n\t\t\tif( !empty( $results ) ){\r\n\t\t\t\tforeach( $results as $result ){\t\t\t\t\r\n\t\t\t\t\tforeach ( $result as $name => $value){\r\n\t\t\t\t\t\tdelete_post_meta( $id, $meta.'_'.$name.'_'.$meta_suffix );\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$entry_list = $this->wck_refresh_list( $meta, $id );\r\n\t\t$add_form = $this->wck_add_form( $meta, $id );\r\n\r\n\t\theader( 'Content-type: application/json' );\r\n\t\tdie( json_encode( array( 'entry_list' => $entry_list, 'add_form' => $add_form ) ) );\r\n\t}", "protected function deleteMeta() {\n Meta::deleteAll([\n 'owner' => $this->tableName(),\n 'owner_id' => $this->{static::meta_id_field()}\n ]);\n }", "function delete_site_meta($site_id, $meta_key, $meta_value = '')\n {\n }", "function delete_student_meta( $student_id, $meta_key, $meta_value = '' ) {\n return delete_metadata( 'student', $student_id, $meta_key, $meta_value );\n }", "function delete_meta($mid)\n {\n }", "public function remove_packlink_meta_data() {\n\t\t$query = \"DELETE FROM `{$this->db->postmeta}` WHERE `meta_key` LIKE \\\"%_packlink_%\\\"\";\n\n\t\t$this->db->query( $query );\n\t}", "public function removeMetaTag($name)\n\t{\n\t\tif($this->metaTags->offsetExists($name))\n\t\t\t$this->metaTags->offsetUnset($name);\n\n\t\tif($this->pageInitialized)\n\t\t{\n\t\t\t$meta = $this->document->xpath('.//meta[@name=\"' . $name . '\" or @http-equiv=\"' . $name . '\" or @property=\"' . $name . '\"]');\n\n\t\t\tif($meta->length == 1)\n\t\t\t\t$meta->item(0)->remove();\n\t\t}\n\t}", "function remove_meta_box($id, $screen, $context)\n {\n }", "function delete_post_meta($term_id, $taxonomy, $meta_key, $meta_value = '') {\n\n return delete_metadata('post', $post_id, $meta_key, $meta_value);\n}", "public function deleteMeta($key, $value = null)\n {\n // dump($this->ID, $key, $value);\n return delete_user_meta($this->ID, $key, $value);\n }", "public function delete_meta( $key, $value = '', $delete_all = false );", "public function deleted(MetaTag $metaTag)\n {\n // Removing Entries from the Cache\n $this->clearCache($metaTag);\n }", "function delete_term_meta($term_id, $meta_key, $meta_value = '')\n {\n }", "public function clearMetas(): void\n {\n $this->metas()->delete();\n }", "function remove_yoast_metabox_reservations(){\n\tremove_meta_box('wpseo_meta', 'hub_notification', 'normal');\n}", "public function delMetadata() {}", "public function delMetadata() {}", "public function delMetadata() {}", "public function forgetMeta(string $key): void\n {\n $this->metas()->where('key', $key)->delete();\n }", "function unregister_term_meta($taxonomy, $meta_key)\n {\n }" ]
[ "0.6817855", "0.6588423", "0.65615815", "0.6523105", "0.6522162", "0.6520677", "0.6477579", "0.6446941", "0.64313036", "0.6418483", "0.63549185", "0.63247377", "0.6246762", "0.62242144", "0.62033534", "0.61713517", "0.6099392", "0.602397", "0.59930724", "0.59737945", "0.59490275", "0.59477997", "0.594743", "0.5929076", "0.5920593", "0.591106", "0.591106", "0.591106", "0.5903773", "0.58920413" ]
0.7063796
0
Check if a booking with that hash number exists
function wpbs_get_booking_by_hash($hash) { $bookings = wpbs_get_bookings(array('invoice_hash' => $hash)); if (empty($bookings)) { return false; } $booking = array_shift($bookings); return $booking; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hashExists($hash);", "function checkNextReserve($book_no)\n\t{\n\t\t$q = $this->db->query(\"SELECT book_no FROM reserves WHERE book_no LIKE '{$book_no}'\");\n\t\treturn $q->num_rows();\n\t}", "private function isBooked() {\n // count all bookings from program\n $statement = 'SELECT COUNT(*) FROM booking WHERE program_id = :program_id AND user_id = :user_id;';\n try {\n $statement = $this->db->prepare($statement);\n $statement->execute(array(\n 'user_id' => $this->getUser($this->data['cnp']),\n 'program_id' => $this->data['program']\n ));\n $result = $statement->fetchColumn();\n if ($result) {\n exit('You are already booked');\n }\n } catch (\\PDOException $e) {\n exit($e->getMessage());\n }\n \n return FALSE;\n }", "function barcodeNumberExists($number) {\n return ProductUnit::where('barcode',$number)->exists();\n }", "public function hasBooking(): bool\n {\n return $this->bookings()->first() !== null;\n }", "public function checkBookingDuplicity($data)\n {\n $booking = Booking::where('date', $data['date'])\n ->where('service_id', $data['service_id'])\n ->where('resource_id', $data['resource_id'])\n ->where('start_hour',$data['start_hour'])\n ->first();\n if (isset($booking)) {\n throw new Exception('Error. Duplicate booking');\n }\n }", "function cp_CheckTransaction($hash)\n{\n $hash = mysql_real_escape_string($hash);\n $query = \"SELECT `id` from `op_transactions` WHERE `hash`='\" . $hash . \"'\";\n $data = simple_query($query);\n if (!empty($data)) {\n return false;\n }\n return true;\n}", "public function isNotExists()\n {\n return $this->getCode() === '91' && $this->isHashMatch();\n }", "function doesBookExist($bookName)\n{\n\tglobal $UTILS_TABLE_NAME;\n\n\t// Construct & execute MySQL query to detect duplicate.\n\t// Look in table $tableName for entries called $bookName.\n\t$sql = \"SELECT * FROM $UTILS_TABLE_NAME WHERE book_name = '$bookName'\";\n\t$queryResult = mysql_query($sql);\n\n\t// Return whether the results are nonempty.\n\treturn (mysql_num_rows($queryResult) > 0);\n}", "function ticket_exists($ticket_id){\n\t\t$EM_Tickets = $this->get_tickets();\n\t\tforeach( $EM_Tickets->tickets as $EM_Ticket){\n\t\t\tif($EM_Ticket->ticket_id == $ticket_id){\n\t\t\t\treturn apply_filters('em_bookings_ticket_exists',true, $EM_Ticket, $this);\n\t\t\t}\n\t\t}\n\t\treturn apply_filters('em_bookings_ticket_exists',false, false,$this);\n\t}", "function check_hash_key($hash_key)\n\t\t{\n\t\t\t$statement = $this->conn_id->prepare(\"select user_id,is_active from users where hash_key = :hash_key\");\n\t\t\t$statement->execute(array(':hash_key' => $hash_key));\n\t\t\t$row = $statement->fetch();\n\t\t\tif (isset($row['user_id']))\n\t\t\t{\n\t\t\t\tif ( $row['is_active'] == 1 )\n\t\t\t\t{\n\t\t\t\t\t// Already a verified user\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif ( $this->verify_success($row['user_id']) == TRUE )\n\t\t\t\t\t{\n\t\t\t\t\t\t// Now you are a verified user\n\t\t\t\t\t\treturn 1;\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// Still not verified\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Supplied hash key doesn't exist\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}", "function cpay_CheckTransaction($hash) {\r\n $hash = loginDB_real_escape_string($hash);\r\n $query = \"SELECT `id` from `op_transactions` WHERE `hash`='\" . $hash . \"'\";\r\n $data = simple_query($query);\r\n if (empty($data)) {\r\n return (true);\r\n } else {\r\n return (false);\r\n }\r\n}", "public function hasGuid(){\n return $this->_has(1);\n }", "function spectra_address_exists ($address)\n\t{\n\t\t$response = $GLOBALS[\"db\"][\"obj\"]->query (\"SELECT COUNT(*) AS `found` FROM `\".$GLOBALS[\"tables\"][\"ledger\"].\"` WHERE `address` = '\".$address.\"'\");\n\t\t$result = $response->fetch_assoc ();\n\t\t\n\t\tif (!isset ($result[\"found\"]) || $result[\"found\"] == 0)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t}", "function reservationExistsAt($date, $table, $hour): int\r\n {\r\n $results = $this->readTable('t_reservation');\r\n foreach ($results as $result) {\r\n if (($result['resDate'] == $date) && ($result['resTable'] == $table) && ($result['resHour'] == $hour)) {\r\n return (int)$result['idReservation'];\r\n }\r\n }\r\n return -1;\r\n }", "public function hasNextgoodsid(){\n return $this->_has(36);\n }", "protected static function check_hash($hashNumber)\n\t{\n\t\t$check = 0;\n\t\t$flag = 0;\n\n\t\t$hashString = sprintf('%u', $hashNumber) ;\n\t\t$length = strlen($hashString);\n\n\t\tfor($i = $length - 1; $i >= 0; $i --)\n\t\t{\n\t\t\t$r = $hashString{$i};\n\n\t\t\tif(1 === ($flag % 2))\n\t\t\t{ \n\t\t\t\t$r += $r; \n\t\t\t\t$r = (int)($r / 10) + ($r % 10);\n\t\t\t}\n\n\t\t\t$check += $r;\n\t\t\t$flag ++; \n\t\t}\n\n\t\t$check %= 10;\n\n\t\tif(0 !== $check)\n\t\t{\n\t\t\t$check = 10 - $check;\n\n\t\t\tif(1 === ($flag % 2) )\n\t\t\t{\n\t\t\t\tif(1 === ($check % 2))\n\t\t\t\t{\n\t\t\t\t\t$check += 9;\n\t\t\t\t}\n\n\t\t\t\t$check >>= 1;\n\t\t\t}\n\t\t}\n\n\t\treturn '7'.$check.$hashString;\n\t}", "function wisataone_X1_is_order_exist($id_booking) {\n global $wpdb, $wisataone_X1_tblname;\n $wp_track_table = $wpdb->prefix . $wisataone_X1_tblname;\n\n $res = $wpdb->get_results(\n \"\n SELECT *\n FROM {$wp_track_table}\n WHERE {$wp_track_table}.id_order = {$id_booking}\n LIMIT 1\n \"\n );\n\n if ($res) {\n return $res[0];\n }\n\n return null;\n}", "private function isAvailable($program) {\n \n $user_id = $this->getUser($this->data['cnp']);\n \n $statement = 'SELECT program_id FROM booking WHERE user_id = ?;';\n try {\n $statement = $this->db->prepare($statement);\n $statement->execute(array($user_id));\n $results = $statement->fetchAll(\\PDO::FETCH_ASSOC);\n // check if other bookings have same date\n if (!empty($results)) {\n foreach ($results as $result) {\n if ($result['program_id'] == $program->id) {\n // if same program, do nothing\n continue;\n }\n if (!$this->programExists($result['program_id'])) {\n // check if program was deleted\n continue;\n }\n // load other programs\n $result = $this->getProgram($result['program_id']);\n // validate date\n if (!$this->checkDate($program->start_date, $program->end_date, $result->start_date, $result->end_date)) {\n exit('You are already booked for this period');\n }\n }\n return TRUE;\n }\n } catch (\\PDOException $e) {\n exit($e->getMessage());\n }\n return FALSE;\n }", "public function check_for_existing_song($song_hash){\n\n $sql = $this->db->prepare(\"\n SELECT song_id FROM songs\n WHERE song_hash = :song_hash\n \");\n\n $sql->bindParam(':song_hash', $song_hash, PDO::PARAM_STR);\n $sql->execute();\n\n return $sql->fetch();\n }", "function exists(){\n\t\t$sql = 'SELECT barcode FROM barcodes\n\t\t\t\tWHERE barcode = \"'.$this->code.'\"';\n\t\t$this->DB->query($sql);\n\t\tif(!$this->DB->isEmpty())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->error = 'The barcode <strong>'.$this->code.'</strong> was not properly pre-registered. Please put this wristband aside, and distribute a new one.';\n\t\t\treturn false;\n\t\t}\n\t}", "public function hallticketexist($smuid) {\n $is_exist = $this->commodel->isduplicate('student_transfer','st_hallticketno',$smuid);\n\t//print_r($is_exist);\n if ($is_exist)\n {\n\t\t$this->form_validation->set_message('hallticketexist','Hall Ticket Number' .\" \".$smuid. \" \".'is already exist check your hall ticket number again.');\n return false;\n }\n else {\n return true;\n }\n }", "public function book_not_exists($title){\n $select_query = \"SELECT `id`, `title`, `description`, `department`, `faculty`, `author`, `publisher`, `date` FROM `books` WHERE `title`='$title'\";\n //check if book exists \n $run_select_query = $this->conn->query($select_query);\n if($run_select_query){\n //check if book already exists \n if(mysqli_num_rows($run_select_query) == 0){\n \n return true;\n }else{\n return false;\n }\n }\n }", "function isBookExists($book, $connection) {\n $q = mysqli_query($connection, 'SELECT * \n FROM books\n WHERE book_title = \"' . $book . '\"'\n );\n\n if (!$q) {\n echo 'Възникна грешка!';\n echo mysqli_error($connection);\n exit;\n } else {\n if ($q->num_rows == 0) {\n return false;\n } else {\n return mysqli_fetch_assoc($q)['book_id'];\n }\n }\n}", "function wpbs_get_booking($booking)\n{\n\n return wp_booking_system()->db['bookings']->get_object($booking);\n\n}", "public function IsBookable()\n\t{\treturn $this->details['tqty'] > $this->details['tbooked'];\n\t}", "function is_deal_booked_by_user($mobile,$deal_id){\n //check this deal is not booked by this user already\n $count = Db::rowCount(\"booked_deals\",array(\n \"mobile\" => $mobile,\n \"deal_id\" => $deal_id\n ),array(\"=\",\"=\"));\n return $count >= 1 ? true : false;\n}", "function checkIfCodeExists() {\n $voucher = new Voucher();\n $voucher->where('code', $this->getCode());\n return $voucher->count() > 0;\n }", "function checkBooklistID($booklist_id) {\n $query = 'select * from `'. $this->_table1 . '` where booklist_id = ' . $booklist_id . ';';\n\n if ($this->query($query)) return true;\n else return false;\n }", "function CheckKey($hash,$name){\n\t\tglobal $secretKey; \n\t\t$checkHash = md5($name.$secretKey);\n\t\tif(strcmp($checkHash,$hash) == 0){\n\t\t\treturn 'pass'; //hash matches\n\t\t}else{\n\t\t\treturn 'fail'; //hash failed\n\t\t}\n\t}" ]
[ "0.65199524", "0.62317127", "0.60568327", "0.5945336", "0.5848142", "0.5742169", "0.5720801", "0.5694954", "0.56876147", "0.56856644", "0.5681887", "0.560934", "0.55948025", "0.5587978", "0.5565473", "0.55646443", "0.5513759", "0.55018055", "0.54998964", "0.5484474", "0.5480349", "0.5458789", "0.54582375", "0.54410964", "0.54191875", "0.54045075", "0.54036283", "0.5371456", "0.5368023", "0.53651446" ]
0.6886352
0
Loads the fixtures files and return the loaded objects.
public function load(array $fixturesFiles, array $parameters = [], array $objects = [], PurgeMode $purgeMode = null): array;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function myLoadFixtures()\n {\n $em = $this->getDatabaseManager();\n\n // load fixtures\n $client = static::createClient();\n $classes = array(\n // classes implementing Doctrine\\Common\\DataFixtures\\FixtureInterface\n 'Demofony2\\AppBundle\\DataFixtures\\ORM\\FixturesLoader',\n );\n\n $this->loadFixtures($classes);\n }", "protected function getFixtures()\n {\n return array(\n // __DIR__ . '/../../Resources/fixtures/majora_entitys.yml',\n );\n }", "protected function getFixtures()\n {\n return array(\n __DIR__ . '/../../Resources/fixtures/BlogArticle.yml',\n );\n }", "public function load()\n {\n $this\n ->objectManager\n ->createQuery('DELETE FROM ' . Member::class)\n ->execute()\n ;\n Fixtures::load(\n __DIR__ . '/../../fixtures/members.yml',\n $this->objectManager\n );\n }", "public static function loadFixture()\n {\n //include __DIR__ .'/../_files/customer.php';\n include __DIR__ .'/../_files/order_fee_variation.php';\n\n }", "public function _fixtures()\n\t{\n\t\treturn [\n\t\t\t'user' => [\n\t\t\t\t'class' => UserFixture::className(),\n\t\t\t\t'dataFile' => codecept_data_dir() . 'login_data.php'\n\t\t\t],\n\t\t\t'models' => [\n\t\t\t\t'class' => ModelsFixture::className(),\n\t\t\t\t'dataFile' => codecept_data_dir() . 'models.php'\n\t\t\t],\n\t\t\t'files' => [\n\t\t\t\t'class' => FilesFixture::className(),\n\t\t\t\t'dataFile' => codecept_data_dir() . 'files.php'\n\t\t\t]\n\n\t\t];\n\t}", "public function setupFixtures()\n {\n if ($this->_fixtures === null) {\n $loadedFixtures = [];\n foreach ($this->fixtures() as $fixtureClass) {\n $loadedFixtures[$fixtureClass] = Yii::createObject($fixtureClass);\n }\n\n $this->_fixtures = $loadedFixtures;\n }\n }", "public function _fixtures()\n {\n return [\n 'user' => [\n 'class' => AdminUserFixture::class,\n 'dataFile' => codecept_data_dir() . 'admin_user.php',\n ],\n 'auth' => [\n 'class' => AuthItemFixture::class,\n 'dataFile' => codecept_data_dir() . 'auth_data.php',\n ],\n 'auth_child' => [\n 'class' => AuthItemChildFixture::class,\n 'dataFile' => codecept_data_dir() . 'auth_child_data.php',\n ],\n 'authAssignment' => [\n 'class' => AuthAssignmentFixture::class,\n 'dataFile' => codecept_data_dir() . 'auth_assigment_data.php',\n ],\n 'category' => [\n 'class' => CategoryFixture::class,\n 'dataFile' => codecept_data_dir() . 'category_data.php',\n ],\n 'category_company_type' => [\n 'class' => CategoryCompanyTypeFixture::class,\n 'dataFile' => codecept_data_dir() . 'category_company_type_data.php',\n ],\n 'company_type' => [\n 'class' => CompanyTypeFixture::class,\n 'dataFile' => codecept_data_dir() . 'company_type_data.php',\n ],\n\n ];\n }", "protected function getFixtures()\n {\n return array(\n __DIR__ . '/card.yml',\n );\n }", "protected static function getDataFixtures()\n {\n return array(\n new LoadTestUser(),\n new LoadSuperUser(),\n );\n }", "protected function createFixtures()\n {\n // Due to a dubious bug(?) in doctrine - product types need to be loaded first.\n $typeFixtures = new LoadProductTypes();\n $typeFixtures->load($this->entityManager);\n $this->productType = $this->getProductTypeRepository()->find(self::PRODUCT_TYPE_ID);\n $this->addonProductType = $this->getProductTypeRepository()->find(self::PRODUCT_TYPE_ADDON_ID);\n\n $countries = new LoadCountries();\n $countries->load($this->entityManager);\n\n $this->contactTestData = new ContactTestData($this->container);\n\n $loadCurrencies = new LoadCurrencies();\n $loadCurrencies->load($this->entityManager);\n\n $this->currency = $this->getCurrencyRepository()->findByCode($this->defaultCurrencyCode);\n\n $unitFixtures = new LoadUnits();\n $unitFixtures->load($this->entityManager);\n $this->orderUnit = $this->getProductUnitRepository()->find(self::ORDER_UNIT_ID);\n\n $this->contentUnit = $this->getProductUnitRepository()->find(self::CONTENT_UNIT_ID);\n\n $taxClasses = new LoadTaxClasses();\n $taxClasses->load($this->entityManager);\n $this->taxClass = $this->getTaxClassRepository()->find(self::TAX_CLASS_ID);\n\n $countryTaxes = new LoadCountryTaxes();\n $countryTaxes->load($this->entityManager);\n\n $collectionTypes = new LoadCollectionTypes();\n $collectionTypes->load($this->entityManager);\n\n $mediaTypes = new LoadMediaTypes();\n $mediaTypes->load($this->entityManager);\n\n $attributeTypes = new LoadAttributeTypes();\n $attributeTypes->load($this->entityManager);\n $this->attributeType = $this->getAttributeTypeRepository()->find(self::ATTRIBUTE_TYPE_ID);\n\n $statusFixtures = new LoadProductStatuses();\n $statusFixtures->load($this->entityManager);\n $this->productStatus = $this->getProductStatusRepository()->find(Status::ACTIVE);\n $this->productStatusChanged = $this->getProductStatusRepository()->find(Status::CHANGED);\n $this->productStatusImported = $this->getProductStatusRepository()->find(Status::IMPORTED);\n $this->productStatusSubmitted = $this->getProductStatusRepository()->find(Status::SUBMITTED);\n\n $deliveryStatusFixtures = new LoadDeliveryStatuses();\n $deliveryStatusFixtures->load($this->entityManager);\n }", "protected function reloadDataFixtures()\n {\n $em = $this->getEntityManager();\n $loader = new Loader;\n foreach ($this->dataFixturePaths as $path) {\n $loader->loadFromDirectory($path);\n }\n $purger = new ORMPurger($em);\n $executor = new ORMExecutor($em, $purger);\n $executor->execute($loader->getFixtures());\n $this->fixturesReloaded = true;\n }", "public function getAllFixtures() { \r\n $uri = $this->payload->_links->fixtures->href;\r\n $response = file_get_contents($uri, false, stream_context_create($this->reqPrefs)); \r\n \r\n return json_decode($response);\r\n }", "public static function loadStockFixtures(): void\n {\n include __DIR__ . '/../../../_files/stockFixtures.php';\n }", "protected function loadFixtures()\n {\n if (!$this->hasFixturesBundles()) {\n return $this;\n }\n\n $bundles = static::$kernel->getBundles();\n $formattedBundles = array_map(function ($bundle) use ($bundles) {\n return $bundles[$bundle]->getPath() . '/DataFixtures/ORM/';\n }, $this->loadFixturesBundles());\n\n self::$application->run(new ArrayInput([\n 'command' => 'doctrine:fixtures:load',\n '--no-interaction' => true,\n '--fixtures' => $formattedBundles,\n '--quiet' => true,\n ]));\n\n return $this;\n }", "public static function loadUserFixtures()\n {\n include __DIR__ . '/../../../_files/adminUserFixtures.php';\n }", "abstract protected function getFixtures();", "public function testLoadAllFixtures(): void\n {\n $this->loadFixtures();\n $article = $this->getTableLocator()->get('Articles')->get(1);\n $this->assertSame(1, $article->id);\n $category = $this->getTableLocator()->get('Categories')->get(1);\n $this->assertSame(1, $category->id);\n }", "public function loadObjects()\n {\n $obj1 = new ParseObject('TestObject');\n $obj2 = new ParseObject('TestObject');\n $obj3 = new ParseObject('TestObject');\n $obj4 = new ParseObject('TestObject');\n\n $obj1->set('score', 10);\n $obj2->set('score', 10);\n $obj3->set('score', 10);\n $obj4->set('score', 20);\n\n $obj1->set('name', 'foo');\n $obj2->set('name', 'foo');\n $obj3->set('name', 'bar');\n $obj4->set('name', 'dpl');\n\n $objects = [$obj1, $obj2, $obj3, $obj4];\n ParseObject::saveAll($objects);\n }", "public function provideTestLoadsOfFiles()\n {\n AutoloaderTestHelper::deleteDirectory(\"testLoadsOfFiles\");\n $alTestHelper = new AutoloaderTestHelper($this);\n\n for ($i = 0; $i < 150; $i++) {\n $alTestHelper->makeClass(\"anyClass\", \"testLoadsOfFiles/flat\");\n\n }\n\n for ($i = 0; $i < 150; $i++) {\n $alTestHelper->makeClass(\n \"anyClass\", \"testLoadsOfFiles\" . str_repeat('/sub', $i)\n );\n\n }\n\n return array(\n array(\n new AutoloaderFileIterator_PriorityList(),\n \"testLoadsOfFiles/flat\"\n ),\n array(\n new AutoloaderFileIterator_Simple(),\n \"testLoadsOfFiles/flat\"\n ),\n array(\n new AutoloaderFileIterator_SimpleCached(),\n \"testLoadsOfFiles/flat\"\n ),\n array(\n new AutoloaderFileIterator_PriorityList(),\n \"testLoadsOfFiles/sub\"\n ),\n array(\n new AutoloaderFileIterator_Simple(),\n \"testLoadsOfFiles/sub\"\n ),\n array(\n new AutoloaderFileIterator_SimpleCached(),\n \"testLoadsOfFiles/sub\"\n )\n );\n }", "public function _fixtures()\n {\n return [\n 'user' => [\n 'class' => BookFixture::class,\n 'dataFile' => codecept_data_dir() . 'book.php'\n ],\n ];\n }", "public function load(ObjectManager $manager)\n {\n // Fixtures are split into separate files\n }", "abstract public function loadAll();", "public function testFixtureLoadOnDemand(): void\n {\n $this->loadFixtures('Categories');\n }", "private function loadFiles()\n {\n $finder = new Finder();\n\n foreach (Config::get('routing_dirs') as $directory) {\n $finder\n ->files()\n ->name('*.yml')\n ->in($directory)\n ;\n\n foreach ($finder as $file) {\n $resource = $file->getRealPath();\n $this->routes = array_merge($this->routes, Yaml::parse(file_get_contents($resource)));\n }\n }\n }", "public static function loadWebsiteFixtures()\n {\n include __DIR__ . '/../../../_files/websiteFixtures.php';\n }", "public static function loadWebsiteFixtures()\n {\n include __DIR__ . '/../../../_files/websiteFixtures.php';\n }", "private function load_children() {\n\t\tif (isset($this->_children)) return;\n\t\t$this->_children = array();\n\t\t$this->_testcases = array();\n\t\tif (!$this->exists()) return; // entity doesn't actually exist\n\t\tforeach (new DirectoryIterator($this->data_path()) as $child) {\n\t\t\t$filename = $child->getFilename();\n\t\t\tif ($child->isDot() || $filename[0] == '.') {\n\t\t\t\t// skip hidden files and ..\n\t\t\t} else if ($child->isDir()) {\n\t\t\t\t// subdirectory = child entity\n\t\t\t\t$this->_children[$filename] = new Entity($this, $filename);\n\t\t\t} else if (substr($filename,-3) == '.in') {\n\t\t\t\t// \".in\" file = testcase\n\t\t\t\t$this->_testcases []= substr($filename,0,-3);\n\t\t\t}\n\t\t}\n\t\tsort($this->_testcases);\n\t\t//ksort($this->_children);\n\t\tuasort($this->_children, 'compare_order');\n\t}", "public static function loadInventoryFixtures(): void\n {\n include __DIR__ . '/../../../_files/source_items_on_default_source.php';\n }", "public static function loadAll();" ]
[ "0.7155395", "0.6856502", "0.67478627", "0.66942835", "0.66443974", "0.6579319", "0.6578975", "0.65382236", "0.65232474", "0.64497346", "0.64298904", "0.6341999", "0.6339953", "0.63045686", "0.62995315", "0.6273572", "0.62697446", "0.62552804", "0.62326115", "0.6231441", "0.62278736", "0.6227231", "0.6212978", "0.6208247", "0.61990285", "0.6198344", "0.6198344", "0.61878765", "0.6156758", "0.6141547" ]
0.7392318
0
Find similar usernames. This assumes you are using Eloquent with Laravel, if not, override this function in your class.
public function findSimilarUsernames(string $username) { $preferRegexp = $this->preferRegexp ?? $this->getModelGeneratorConfig()->getConfig('prefer_regexp', false); if (!$preferRegexp) { return $this->searchUsingLike($username); } try { return $this->searchUsingRegexp($username); } catch (QueryException $exception) { return $this->searchUsingLike($username); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _suggestUsername($name){\n $name = trim(strtolower($name));\n // pr($name); die('qq');\n $usernameCheck1 = $this->Players->find()->where(['username' => $name])->first();\n // pr($usernameCheck1); die('u name');\n if(!$usernameCheck1){\n $username = $name;\n }else{\n $usernameCheck2 = $this->Players->find()->where(['username LIKE' => $name.'%'])->all()->toArray();\n //pr($usernameCheck2); die('u 2 name');\n if(!count($usernameCheck2)){\n $username = $name;\n }else{\n $username = $name.count($usernameCheck2);\n }\n }\n return $username;\n\n }", "public function fuzzySearchName($name) {\n $con = mysqli_connect('localhost', 'root', 'root', 'HexDatabase');\n //TODO: Add firstname and surname support\n $query = 'SELECT * FROM User WHERE firstName LIKE \\'%'.$name.'%\\';';\n $results = mysqli_query($con, $query);\n if ($results) {\n return $this->getResultAsJson($results);\n } else {\n return json_encode(null);\n }\n }", "function getUsersLastNameLike($in){\r\n $data=new \\Cars\\Data\\Common($this->app);\r\n return $data->getUsersByLastNameInit($in);\r\n\r\n }", "public function get_matching_users(Request $request) {\n $searchstring = $request->searchstring;\n $not_ids = $request->not_ids;\n\n $matching_users = User::select('id', 'first_name', 'last_name', 'birth_date')\n ->whereNotIn('id', $not_ids)\n ->where(function($query) use ($searchstring) {\n $query->where('first_name', 'like', '%'.$searchstring.'%')\n ->orWhere('last_name', 'like', '%'.$searchstring.'%')\n ->orWhere(DB::raw(\"CONCAT(`first_name`, ' ', `last_name`)\"), 'like', '%'.$searchstring.'%')\n ->orWhere(DB::raw(\"CONCAT(`last_name`, ' ', `first_name`)\"), 'like', '%'.$searchstring.'%');\n })\n ->orderBy('last_name')\n ->orderBy('first_name')\n ->limit(5)\n ->get();\n\n return $matching_users;\n }", "private function searchUsingLike(string $username)\n {\n $exactMatches = static::where($this->getUsernameColumnName(), $username)->get();\n\n if ($exactMatches) {\n return static::where($this->getUsernameColumnName(), 'LIKE', $username.'%')->get();\n }\n\n return $exactMatches;\n }", "function getSimilarAuthors1($author) {\r\n $result = array();\r\n \r\n //return when this is a synonym of a main author.\r\n if ($author->synonym_of != '0')\r\n return $result;\r\n \r\n $CI = &get_instance();\r\n $CI->load->helper('utf8_to_ascii');\r\n \r\n //get database author array\r\n $CI->db->select('author_id, cleanname');\r\n \r\n //do not return synonyms of this author\r\n $CI->db->where('synonym_of !=', $author->author_id);\r\n $CI->db->orderby('cleanname');\r\n $Q = $CI->db->get('author');\r\n \r\n $db_cleanauthors = array();\r\n //retrieve results or fail \r\n foreach ($Q->result() as $R)\r\n {\r\n $db_cleanauthors[$R->author_id] = strtolower($R->cleanname); //why strtolower? because we want to check case insensitive.\r\n }\r\n //check on cleanname\r\n //create cleanname\r\n \r\n $cleanAuthorName = strtolower($author->cleanname);\r\n \r\n if (sizeof($cleanAuthorName) < 4)\r\n $dist_threshold = 2;\r\n else if (sizeof($cleanAuthorName) < 8)\r\n $dist_threshold = 3;\r\n else\r\n $dist_threshold = 4;\r\n \r\n $db_distances = array();\r\n foreach ($db_cleanauthors as $author_id => $db_author)\r\n {\r\n $distance = levenshtein($db_author, $cleanAuthorName);\r\n if (($distance < $dist_threshold) && ($author_id != $author->author_id))\r\n $db_distances[$author_id] = $distance;\r\n }\r\n \r\n //sort while keeping key relationship\r\n asort($db_distances, SORT_NUMERIC);\r\n \r\n foreach($db_distances as $key => $value)\r\n {\r\n $result[]= $this->getByID($key);\r\n }\r\n return $result;\r\n }", "public static function search($name) {\n return DB::table('users AS u')\n ->where('u.fullname', 'LIKE', '%'.$name.'%')\n ->orWhere('u.username', 'LIKE', '%'.$name.'%')\n ->selectRaw('u.id, u.fullname, u.profile_image')\n ->get();\n }", "static function searchUserByName() : string\n {\n return \"SELECT *\n FROM users\n WHERE LOCATE( :Name , nickname) > 0;\";\n }", "public function findName(Request $request)\n {\n $request_percent = $request->porcentaje;\n $resultado = [];\n $names = Diccionario::all();\n $request_name = mb_strtolower($request->nombre, 'UTF-8'); //Se convierte el nombre a minusculas\n $request_name = $this->removeAccents($request_name);// Se quitan los acentos\n $request_name = explode(\" \", $request_name);// Se separa nombre y apellido\n\n foreach ($names as $name) {\n $nombre = mb_strtolower($name->nombre, 'UTF-8');\n $nombre = $this->removeAccents($nombre);\n $percent = $this->findSimilar($request_name, $nombre);\n if ($percent >= $request_percent) {\n $resultado[] = [\n \"nombre\" => $name->nombre,\n \"porcentaje\" => $percent,\n \"departamento\" => $name->departamento,\n \"localidad\" => $name->localidad,\n \"municipio\" => $name->municipio,\n \"anios_activo\" => $name->anios_activo,\n \"tipo_persona\" => $name->tipo_persona,\n \"tipo_cargo\" => $name->tipo_cargo,\n ];\n }\n }\n /*$nombre = mb_strtolower(\"Alejandro Carvajal\", 'UTF-8');\n $nombre = $this->removeAccents($nombre);\n $percent = $this->findSimilar($request_name, $nombre)*/\n if (count($resultado) >= 1) {\n $mensaje = 'registros encontrados';\n } else {\n $mensaje = 'sin coincidencia';\n }\n $respuesta = [\n 'nombre_buscado' => $request->nombre,\n \"porcentaje_buscado\" => $request_percent,\n \"registros_encontrados\" => count($resultado),\n \"resultados\" => $resultado,\n \"estado_ejecucion\" => $mensaje,\n ];\n return response()->json($respuesta);\n }", "public function get_user_by_concat_name($name_lastname){\n $query = $this->db->query(\"\n SELECT k_id_user\n FROM \n user \n WHERE CONCAT_WS(' ', n_name_user, n_last_name_user) \n LIKE '%$name_lastname';\n \");\n return $query->row();\n }", "public function validateUsernameEqual($value, array $context)\n {\n Stopwatch::start('validateUsernameEqual');\n $users = $this->userlist();\n $lc = mb_strtolower($value);\n foreach ($users as $name) {\n if ($name === $value) {\n continue;\n }\n $name = mb_strtolower($name);\n $distance = levenshtein($lc, $name);\n if ($distance < 2) {\n return __('error.name.equalExists', $name);\n }\n }\n Stopwatch::stop('validateUsernameEqual');\n\n return true;\n }", "function mentionTryName($username = '')\n{\n\t/**\n\t * create another name cache here to save queries if names\n\t * with spaces are used more than once in the same post\n\t */\n\tstatic $nameList;\n\n\tif (!is_array($nameList)) {\n\t\t$nameList = array();\n\t}\n\n\t// no user name supplied\n\tif (!$username) {\n\t\treturn false;\n\t}\n\n\t$username = mb_strtolower($username);\n\n\t// if the name is in this cache (has been searched for before)\n\tif ($nameList[$username]) {\n\t\t// . . . just return the data and save the query\n\t\treturn $nameList[$username];\n\t}\n\n\tglobal $db, $mybb;\n\n\t$searchname = $db->escape_string($username);\n\n\t$fieldList = 'uid, username, usergroup, displaygroup, additionalgroups, ignorelist';\n\tif ($mybb->settings['mention_show_avatars']) {\n\t\t$fieldList .= ', avatar';\n\t}\n\n\t// query the db\n\t$query = $db->simple_select('users', $fieldList, \"LOWER(username)='{$searchname}'\", array('limit' => 1));\n\n\t// result?\n\tif ($db->num_rows($query) !== 1) {\n\t\t// no matches\n\t\treturn false;\n\t}\n\n\t// cache the name\n\t$nameList[$username] = $db->fetch_array($query);\n\n\t// and return it\n\treturn $nameList[$username];\n}", "public function scopeSimilarMatch($query, $name) {\n return $query->opened()->where('name', 'REGEXP', '[' . $name . ']');\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 }", "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 }", "function FindUser($User) {\n $User = str_replace('ZZ ', '', $User);\n\n //separa o primeiro nome do sobrenome\n $name_complete = explode(' ', $User);\n $user_name = array_shift($name_complete);\n $user_lastname = implode(' ', $name_complete);\n\n $Read = new WsUsers();\n\n $Read->setUser_name($user_name);\n $Read->setUser_lastname($user_lastname);\n $Result = $Read->Execute()->Query(\"user_name like '%{$user_name}%' AND user_lastname like '%{$user_lastname}%'\");\n\n if (!empty($Result)):\n return $Result[0]->user_id;\n endif;\n}", "public function getUserId($name){\n $names = explode(\",\", $name);\n // Search each Name Field for any specified Name\n return User::where(function ($query) use ($names) {\n $query->whereIn('first_name', $names);\n\n $query->orWhere(function ($query) use ($names) {\n $query->whereIn('middle_name', $names);\n });\n $query->orWhere(function ($query) use ($names) {\n $query->whereIn('last_name', $names);\n });\n })->get();\n }", "public function searchUserByName($name){\r\n $result = $this->DB->fetchAll('select * from user where name like ?',array(\"%{$name}%\"));\r\n return $this->formatResult($result);\r\n }", "public function searchUsers($str) {\n return user_find($str);\n }", "function review($authors)\r\n {\r\n $CI = &get_instance();\r\n $CI->load->helper('utf8_to_ascii');\r\n if (!is_array($authors))\r\n return null;\r\n \r\n $result_message = \"\";\r\n $all_similar_authors = array();\r\n \r\n //get database author array\r\n $CI->db->select('author_id, cleanname');\r\n $CI->db->orderby('cleanname');\r\n $Q = $CI->db->get('author');\r\n \r\n $db_cleanauthors = array();\r\n //retrieve results or fail \r\n foreach ($Q->result() as $R)\r\n {\r\n $db_cleanauthors[$R->author_id] = strtolower($R->cleanname); //why strtolower? because we want to check case insensitive.\r\n }\r\n \r\n \r\n //check availability of the authors in the database\r\n foreach ($authors as $author)\r\n {\r\n $similar_authors = array();\r\n if ($this->getByExactName($author->firstname, $author->von, $author->surname, $author->jr) == null)\r\n {\r\n //no exact match, or more than one authors exist in the database\r\n \r\n //check on cleanname\r\n //create cleanname\r\n $author->cleanname = strtolower(authorCleanName($author));\r\n $db_distances = array();\r\n foreach ($db_cleanauthors as $author_id => $db_author)\r\n {\r\n $distance = levenshtein($db_author, $author->cleanname);\r\n if (($distance < 3) && ($author_id != $author->author_id))\r\n $db_distances[$author_id] = $distance;\r\n }\r\n \r\n //sort while keeping key relationship\r\n asort($db_distances, SORT_NUMERIC);\r\n //are there similar authors?\r\n if (count($db_distances) > 0)\r\n {\r\n $authorname = $author->getName('lvf');\r\n if ($author->institute!='')\r\n {\r\n $authorname .= ', '.addslashes ($author->institute);\r\n }\r\n if ($author->email!='')\r\n {\r\n $authorname .= ', '.addslashes ($author->institute);\r\n }\r\n\r\n $result_message .= __(\"Found similar authors for\").\" <b>&quot;\".$authorname.\"&quot;</b>:<br/>\\n\";\r\n $result_message .= \"<ul>\\n\";\r\n foreach($db_distances as $key => $value)\r\n {\r\n $otherauthor = $this->getByID($key);\r\n $otherauthorname = $otherauthor->getName('lvf');\r\n if ($otherauthor->institute!='')\r\n {\r\n $otherauthorname .= ', '.addslashes ($otherauthor->institute);\r\n }\r\n if ($otherauthor->email!='')\r\n {\r\n $otherauthorname .= ', '.addslashes ($otherauthor->institute);\r\n }\r\n $result_message .= \"<li>\".$otherauthorname.\"</li>\\n\";\r\n $similar_authors[] = $otherauthor->author_id;\r\n }\r\n $result_message .= \"</ul>\\n\";\r\n }\r\n } else {\r\n //exact match! this author exists!\r\n }\r\n $all_similar_authors[] = $similar_authors;\r\n }\r\n if ($result_message != \"\")\r\n {\r\n $result_message .= __(\"Please review the entered authors\").\".<br/>\\n\";\r\n return array($result_message,$all_similar_authors);\r\n }\r\n else\r\n return null;\r\n }", "function findSuggestedUsers($query) {\n\t\t$cid = 'user.findSuggestedUsers.'.md5($query);\n\t\tif (null == ($result = SyndLib::runHook('cache_get', $cid))) {\n\t\t\t$collection = $this->findUsers($query);\n\t\t\t$users = $collection->getContents(0, 10);\n\t\t\t$result = array();\n\n\t\t\tforeach (array_keys($users) as $key) {\n\t\t\t\t$name = $users[$key]->toString();\n\t\t\t\tif (null != $users[$key]->getContact())\n\t\t\t\t\t$name .= ' <span class=\"Info\">('.$users[$key]->getContact().')</span>';\n\t\t\t\tif (null != $users[$key]->getEmail())\n\t\t\t\t\t$result[$users[$key]->getEmail()] = $name;\n\t\t\t\telse\n\t\t\t\t\t$result[$users[$key]->getLogin()] = $name;\n\t\t\t}\n\t\t\t\n\t\t\tSyndLib::runHook('cache_set', $cid, $result);\n\t\t}\n\t\treturn $result;\n\t}", "function getUsersLike($query, $user){\n $key = \"%\".$query.\"%\";\n $query = $this->getEntityManager()\n ->createQuery('SELECT DISTINCT u\n FROM EntityBundle:User u, EntityBundle:Person p\n WHERE u != :user AND u.person = p AND (p.firstname LIKE :query OR p.lastname LIKE :query)')\n ->setParameter('query', $key)\n ->setParameter('user', $user);\n\n try {\n return $query->getResult();\n } catch (\\Doctrine\\ORM\\NoResultException $e) {\n return null;\n }\n }", "public function search($name) {\n return $this->db->query(\"SELECT * FROM `user` WHERE `firstname` ='$name' or `lastname`='$name'\")->result();\n //return $this->db->last_query();\n //return $query->result(); \n }", "private function /*bool*/ findUsername(/*string*/ $name) {\n\t\t$variations = array(\n\t\t\t$name,\n\t\t\tstrtolower($name[0]) . substr($name, 1),\n\t\t\tstr_replace(\" \", \"_\", $name),\n\t\t);\n\n\t\t$crowd = $this->getCrowd();\n\t\tforeach ($variations as $v) {\n\t\t\ttry {\n\t\t\t\t$crowd->findPrincipalByName(array(\"in0\" => $this->token, \"in1\" => $v));\n\t\t\t\treturn $v;\n\t\t\t} catch (Exception $e) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "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 }", "private function _getNames()\n\t {\n\t\t$result = array();\n\t\t$rows = $this->_db->exec(\"SELECT * FROM `names` WHERE `phone` = '\" . $this->phone . \"'\");\n\t\twhile($row = $rows->getRow())\n\t\t {\n\t\t\t$result[] = mb_strtoupper($row[\"name\"]);\n\t\t } //end while\n\n\t\t$result = array_unique($result);\n\n\t\tif (count($result) > 1)\n\t\t {\n\t\t\treturn false;\n\t\t }\n\t\telse\n\t\t {\n\t\t\treturn true;\n\t\t } //end if\n\n\t }", "public function findUsernameMatch($name) {\r\n \t\t# Set up database query\r\n \t\t$statement = $this->DB->prepare(\"SELECT User_Name, User_ID FROM users WHERE User_Name = :nomen;\");\r\n \t\t$statement->bindParam('nomen', $name);\r\n \t\t$statement->execute();\r\n \t\t$row = $statement->fetch(PDO::FETCH_ASSOC); # row might be empty\r\n \t\t$row['status'] = 'success'; # this makes sure row stores something\r\n \t\treturn json_encode($row);\r\n\r\n\t }", "function find_users_like($session_id, $user_search)\n{\n global $db;\n\n $search = '%';\n $search .= $user_search;\n $search .= '%';\n\n $query = \"SELECT DISTINCT User.user_id, User.user_name FROM User \n WHERE User.user_id NOT IN (SELECT user_id FROM User_Session WHERE session_id = ?) \n AND User.user_name LIKE ?\";\n\n $stmt = $db->prepare($query);\n $stmt->bind_param(\"is\", $session_id, $search);\n $stmt->execute();\n\n $user_set = $stmt->get_result();\n\n $stmt->close();\n\n return $user_set;\n}", "public abstract function find_users($search);", "public function personal_username($full_name){\r\n $random = mt_rand(00000, 99999);\r\n $username = url_title($full_name.$random);\r\n\r\n $query = $this->db->get_where('user', ['khojeko_username' => $username]);\r\n if($query->num_rows() == 0 )\r\n return $username;\r\n else\r\n $this->personal_username($full_name);\r\n }" ]
[ "0.63768333", "0.6048122", "0.5985277", "0.5898679", "0.5755743", "0.5739159", "0.57253975", "0.5658682", "0.5557933", "0.55320156", "0.5502373", "0.5493625", "0.54931307", "0.5472317", "0.54448634", "0.5443291", "0.54060113", "0.5381018", "0.5358927", "0.5234527", "0.5221841", "0.51998895", "0.51560235", "0.5152285", "0.5142952", "0.51426923", "0.5122183", "0.51135314", "0.51028466", "0.50963265" ]
0.6832669
0
Search for similar usernames using LIKE.
private function searchUsingLike(string $username) { $exactMatches = static::where($this->getUsernameColumnName(), $username)->get(); if ($exactMatches) { return static::where($this->getUsernameColumnName(), 'LIKE', $username.'%')->get(); } return $exactMatches; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function findSimilarUsernames(string $username)\n {\n $preferRegexp = $this->preferRegexp ?? $this->getModelGeneratorConfig()->getConfig('prefer_regexp', false);\n\n if (!$preferRegexp) {\n return $this->searchUsingLike($username);\n }\n\n try {\n return $this->searchUsingRegexp($username);\n } catch (QueryException $exception) {\n return $this->searchUsingLike($username);\n }\n }", "function like($str, $searchTerm)\n {\n $searchTerm = strtolower($searchTerm);\n $str = strtolower($_SESSION['username']);\n $pos = strpos($str, $searchTerm);\n if ($pos === false)\n return false;\n else\n return true;\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 searchUserByName($name){\r\n $result = $this->DB->fetchAll('select * from user where name like ?',array(\"%{$name}%\"));\r\n return $this->formatResult($result);\r\n }", "static function searchUserByName() : string\n {\n return \"SELECT *\n FROM users\n WHERE LOCATE( :Name , nickname) > 0;\";\n }", "public function fuzzySearchName($name) {\n $con = mysqli_connect('localhost', 'root', 'root', 'HexDatabase');\n //TODO: Add firstname and surname support\n $query = 'SELECT * FROM User WHERE firstName LIKE \\'%'.$name.'%\\';';\n $results = mysqli_query($con, $query);\n if ($results) {\n return $this->getResultAsJson($results);\n } else {\n return json_encode(null);\n }\n }", "protected function _suggestUsername($name){\n $name = trim(strtolower($name));\n // pr($name); die('qq');\n $usernameCheck1 = $this->Players->find()->where(['username' => $name])->first();\n // pr($usernameCheck1); die('u name');\n if(!$usernameCheck1){\n $username = $name;\n }else{\n $usernameCheck2 = $this->Players->find()->where(['username LIKE' => $name.'%'])->all()->toArray();\n //pr($usernameCheck2); die('u 2 name');\n if(!count($usernameCheck2)){\n $username = $name;\n }else{\n $username = $name.count($usernameCheck2);\n }\n }\n return $username;\n\n }", "public function searchUserLike($username) {\n return $this->createQueryBuilder('c')\n ->where('c.username LIKE :username')\n ->setParameter('username', '%'.$username.'%')\n ->getQuery()\n ->getResult();\n }", "function mentionMeXMLHTTPnameSearch()\n{\n\tglobal $mybb, $db, $cache;\n\n\tif (!$mybb->input['search']) {\n\t\texit;\n\t}\n\n\t$originalName = trim($mybb->input['search']);\n\t$name = $db->escape_string($originalName);\n\t$name = strtr($name,\n\t\tarray(\n\t\t\t'%' => '=%',\n\t\t\t'=' => '==',\n\t\t\t'_' => '=_')\n\t\t);\n\n\t$fieldList = 'username';\n\tif ($mybb->settings['mention_show_avatars']) {\n\t\t$fieldList .= ', avatar';\n\t}\n\n\t$fullText = '';\n\tif ($mybb->settings['mention_full_text_search']) {\n\t\t$fullText = '%';\n\t}\n\n\t$query = $db->simple_select('users', $fieldList, \"username LIKE '{$fullText}{$name}%' ESCAPE '='\");\n\n\tif ($db->num_rows($query) == 0) {\n\t\texit;\n\t}\n\n\t$names = array();\n\twhile ($user = $db->fetch_array($query)) {\n\t\t$username = mb_strtolower($user['username']);\n\t\tif (($fullText === '' &&\n\t\t\tsubstr($username, 0, strlen($originalName)) === $originalName) ||\n\t\t\t($fullText &&\n\t\t\tstrpos($username, $originalName) !== -1)) {\n\t\t\t$names[$username] = $user;\n\t\t}\n\t}\n\n\tif (empty($names)) {\n\t\texit;\n\t}\n\t$json = json_encode($names);\n\n\t// send our headers.\n\theader('Content-type: application/json');\n\techo($json);\n\texit;\n}", "function like_match($searchParam, $subject) {\n $preg = preg_grep(\"/(.*)\" . strtolower($searchParam) . \"(.*)/\", [strtolower($subject)]);\n if(!empty($preg)){\n return true;\n }\n return false;\n}", "public function getUsersLike($busqueda){\n $query = \"SELECT * FROM usuario WHERE username LIKE '%$busqueda%' \";\n return $this->consulta($query);\n }", "public static function search($name) {\n return DB::table('users AS u')\n ->where('u.fullname', 'LIKE', '%'.$name.'%')\n ->orWhere('u.username', 'LIKE', '%'.$name.'%')\n ->selectRaw('u.id, u.fullname, u.profile_image')\n ->get();\n }", "function find_users_like($session_id, $user_search)\n{\n global $db;\n\n $search = '%';\n $search .= $user_search;\n $search .= '%';\n\n $query = \"SELECT DISTINCT User.user_id, User.user_name FROM User \n WHERE User.user_id NOT IN (SELECT user_id FROM User_Session WHERE session_id = ?) \n AND User.user_name LIKE ?\";\n\n $stmt = $db->prepare($query);\n $stmt->bind_param(\"is\", $session_id, $search);\n $stmt->execute();\n\n $user_set = $stmt->get_result();\n\n $stmt->close();\n\n return $user_set;\n}", "private function search_for_username($string)\r\n\t{\r\n\t\t$search_string = '%' . $string . '%';\r\n\t\t$results = array();\r\n\t\tglobal $dbCon;\r\n\r\n\t\t$sql = \"SELECT id FROM student WHERE username LIKE ?;\";\r\n\t\t$stmt = $dbCon->prepare($sql); //Prepare Statement\r\n\t\tif ($stmt === false)\r\n\t\t{\r\n\t\t\ttrigger_error('SQL Error: ' . $dbCon->error, E_USER_ERROR);\r\n\t\t}\r\n\t\t$stmt->bind_param('s', $search_string);\r\n\t\t$stmt->execute(); //Execute\r\n\t\t$stmt->bind_result($student_id); //Get ResultSet\r\n\t\twhile ($stmt->fetch())\r\n\t\t{\r\n\t\t\t$results[] = $student_id;\r\n\t\t}\r\n\t\t$stmt->close();\r\n\r\n\t\treturn $results;\r\n\t}", "function mentionTryName($username = '')\n{\n\t/**\n\t * create another name cache here to save queries if names\n\t * with spaces are used more than once in the same post\n\t */\n\tstatic $nameList;\n\n\tif (!is_array($nameList)) {\n\t\t$nameList = array();\n\t}\n\n\t// no user name supplied\n\tif (!$username) {\n\t\treturn false;\n\t}\n\n\t$username = mb_strtolower($username);\n\n\t// if the name is in this cache (has been searched for before)\n\tif ($nameList[$username]) {\n\t\t// . . . just return the data and save the query\n\t\treturn $nameList[$username];\n\t}\n\n\tglobal $db, $mybb;\n\n\t$searchname = $db->escape_string($username);\n\n\t$fieldList = 'uid, username, usergroup, displaygroup, additionalgroups, ignorelist';\n\tif ($mybb->settings['mention_show_avatars']) {\n\t\t$fieldList .= ', avatar';\n\t}\n\n\t// query the db\n\t$query = $db->simple_select('users', $fieldList, \"LOWER(username)='{$searchname}'\", array('limit' => 1));\n\n\t// result?\n\tif ($db->num_rows($query) !== 1) {\n\t\t// no matches\n\t\treturn false;\n\t}\n\n\t// cache the name\n\t$nameList[$username] = $db->fetch_array($query);\n\n\t// and return it\n\treturn $nameList[$username];\n}", "public function getUsersMatching($keyword) {\n $sql = 'SELECT id, firstname, mail, role, isAdmin FROM user WHERE firstname LIKE ? OR mail LIKE ? OR role LIKE ?';\n $sth = $this->db->prepare($sql);\n $sth-> execute(array(\"%$keyword%\", \"%$keyword%\", \"%$keyword%\"));\n if ($row = $sth->fetchAll()) {\n return $row;\n }\n\n }", "function FindUser($User) {\n $User = str_replace('ZZ ', '', $User);\n\n //separa o primeiro nome do sobrenome\n $name_complete = explode(' ', $User);\n $user_name = array_shift($name_complete);\n $user_lastname = implode(' ', $name_complete);\n\n $Read = new WsUsers();\n\n $Read->setUser_name($user_name);\n $Read->setUser_lastname($user_lastname);\n $Result = $Read->Execute()->Query(\"user_name like '%{$user_name}%' AND user_lastname like '%{$user_lastname}%'\");\n\n if (!empty($Result)):\n return $Result[0]->user_id;\n endif;\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 searchUsers($str) {\n return user_find($str);\n }", "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 _generateUserNameSearchSQL($search, $searchMatch, $prefix, &$params) {\n\t\t$first_last = $this->concat($prefix.'first_name', '\\' \\'', $prefix.'last_name');\n\t\t$first_middle_last = $this->concat($prefix.'first_name', '\\' \\'', $prefix.'middle_name', '\\' \\'', $prefix.'last_name');\n\t\t$last_comma_first = $this->concat($prefix.'last_name', '\\', \\'', $prefix.'first_name');\n\t\t$last_comma_first_middle = $this->concat($prefix.'last_name', '\\', \\'', $prefix.'first_name', '\\' \\'', $prefix.'middle_name');\n\t\tif ($searchMatch === 'is') {\n\t\t\t$searchSql = \" AND (LOWER({$prefix}last_name) = LOWER(?) OR LOWER($first_last) = LOWER(?) OR LOWER($first_middle_last) = LOWER(?) OR LOWER($last_comma_first) = LOWER(?) OR LOWER($last_comma_first_middle) = LOWER(?))\";\n\t\t} elseif ($searchMatch === 'contains') {\n\t\t\t$searchSql = \" AND (LOWER({$prefix}last_name) LIKE LOWER(?) OR LOWER($first_last) LIKE LOWER(?) OR LOWER($first_middle_last) LIKE LOWER(?) OR LOWER($last_comma_first) LIKE LOWER(?) OR LOWER($last_comma_first_middle) LIKE LOWER(?))\";\n\t\t\t$search = '%' . $search . '%';\n\t\t} else { // $searchMatch === 'startsWith'\n\t\t\t$searchSql = \" AND (LOWER({$prefix}last_name) LIKE LOWER(?) OR LOWER($first_last) LIKE LOWER(?) OR LOWER($first_middle_last) LIKE LOWER(?) OR LOWER($last_comma_first) LIKE LOWER(?) OR LOWER($last_comma_first_middle) LIKE LOWER(?))\";\n\t\t\t$search = $search . '%';\n\t\t}\n\t\t$params[] = $params[] = $params[] = $params[] = $params[] = $search;\n\t\treturn $searchSql;\n\t}", "function _generateUserNameSearchSQL($search, $searchMatch, $prefix, &$params) {\n\t\t$first_last = $this->concat($prefix.'first_name', '\\' \\'', $prefix.'last_name');\n\t\t$first_middle_last = $this->concat($prefix.'first_name', '\\' \\'', $prefix.'middle_name', '\\' \\'', $prefix.'last_name');\n\t\t$last_comma_first = $this->concat($prefix.'last_name', '\\', \\'', $prefix.'first_name');\n\t\t$last_comma_first_middle = $this->concat($prefix.'last_name', '\\', \\'', $prefix.'first_name', '\\' \\'', $prefix.'middle_name');\n\t\tif ($searchMatch === 'is') {\n\t\t\t$searchSql = \" AND (LOWER({$prefix}last_name) = LOWER(?) OR LOWER($first_last) = LOWER(?) OR LOWER($first_middle_last) = LOWER(?) OR LOWER($last_comma_first) = LOWER(?) OR LOWER($last_comma_first_middle) = LOWER(?))\";\n\t\t} elseif ($searchMatch === 'contains') {\n\t\t\t$searchSql = \" AND (LOWER({$prefix}last_name) LIKE LOWER(?) OR LOWER($first_last) LIKE LOWER(?) OR LOWER($first_middle_last) LIKE LOWER(?) OR LOWER($last_comma_first) LIKE LOWER(?) OR LOWER($last_comma_first_middle) LIKE LOWER(?))\";\n\t\t\t$search = '%' . $search . '%';\n\t\t} else { // $searchMatch === 'startsWith'\n\t\t\t$searchSql = \" AND (LOWER({$prefix}last_name) LIKE LOWER(?) OR LOWER($first_last) LIKE LOWER(?) OR LOWER($first_middle_last) LIKE LOWER(?) OR LOWER($last_comma_first) LIKE LOWER(?) OR LOWER($last_comma_first_middle) LIKE LOWER(?))\";\n\t\t\t$search = $search . '%';\n\t\t}\n\t\t$params[] = $params[] = $params[] = $params[] = $params[] = $search;\n\t\treturn $searchSql;\n\t}", "public function username_is_found($str, $user_table = \"admin_user\") {\n\n $id = $this->ci->input->post(\"id\");\n\n $find_conf = array(\"username\" => $str);\n\n // exclude his own ID to search another profile's email. (edit only)\n if ($id) {\n $find_conf[\"id <>\"] = $id;\n }\n\n $result = $this->ci->generic_model->retrieve_one(\n $user_table,\n $find_conf\n );\n\n if ($result) { // there exists an username.\n return TRUE;\n } else { // username is not found.\n $this->ci->form_validation->set_message(\"username_is_found\", \"Username is not found.\");\n return FALSE;\n }\n }", "function getUsersLike($query, $user){\n $key = \"%\".$query.\"%\";\n $query = $this->getEntityManager()\n ->createQuery('SELECT DISTINCT u\n FROM EntityBundle:User u, EntityBundle:Person p\n WHERE u != :user AND u.person = p AND (p.firstname LIKE :query OR p.lastname LIKE :query)')\n ->setParameter('query', $key)\n ->setParameter('user', $user);\n\n try {\n return $query->getResult();\n } catch (\\Doctrine\\ORM\\NoResultException $e) {\n return null;\n }\n }", "public static function searchManager_username($keyword)\n\t\t{\n\t\t\t$qry = 'SELECT * FROM manager WHERE last_name LIKE \"%' . $keyword . '%\"';\n\t\t\t$result = mysql_query($qry, $GLOBALS['connection']);\n\t\t\treturn $result;\n\t\t}", "private function searchUsingRegexp(string $username)\n {\n return static::where($this->getUsernameColumnName(), 'REGEXP', $username.'('.$this->getSeparator().')?([0-9]*)?$')->get();\n }", "public abstract function find_users($search);", "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 }", "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_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 }" ]
[ "0.73186076", "0.6943806", "0.6847151", "0.6836033", "0.66249436", "0.658887", "0.65877783", "0.6481886", "0.6288706", "0.625853", "0.62211645", "0.62122476", "0.6207571", "0.6172583", "0.61368746", "0.61207384", "0.610137", "0.6099805", "0.6097742", "0.60674465", "0.6035184", "0.6035184", "0.60210896", "0.59607524", "0.5923472", "0.5921942", "0.5890416", "0.5875547", "0.5872641", "0.5851628" ]
0.73956454
0
Alias for getUsernameColumnName for backwards compatibility.
private function getColumn(): string { return $this->getUsernameColumnName(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUsernameColumnName(): string\n {\n return $this->usernameColumn ?? $this->getModelGeneratorConfig()->getConfig('column', 'username');\n }", "public function getColumnName();", "public function getFrontEndUserGroupColumnName() {}", "public function column_username($user)\n {\n }", "public function column_name($user)\n {\n }", "abstract function getProfileColumnName($field_name);", "public function getColumnName()\n {\n return $this->columnName;\n }", "public function getColumnName() {\n return $this->columnName;\n }", "public function getNameColumn()\n {\n return $this->nameColumn;\n }", "public function username()\n {\n return backpack_authentication_column();\n }", "abstract public static function get_column_name(): string;", "protected function getUuidColumnName() {\n\n $uuidColumn = null;\n\n if ( ! $this->uuidFieldName ) {\n\n $this->initializeHasUuid();\n }\n\n return $this->uuidFieldName;\n }", "protected function getSkuColumnName()\n {\n return $this->skuColumnName;\n }", "protected static function column_name(): mixed\n\t{\n\t\treturn self::$query->column_name;\n\t}", "public function getCreatorColumnName() {}", "protected function getColumnName($alias)\n {\n return $this->aliases[$alias] ?? $alias;\n }", "public static function username() {\n return 'user_id';\n }", "function GetUserNameField($table = \"\")\n{\n\tglobal $cUserNameField;\n\treturn $cUserNameField;\n}", "public function ensureColumnName(string $name): string;", "public function getConstantColumnName()\n { if ($this->getPeerName()) {\n return strtoupper($this->getPeerName());\n }\n\n return strtoupper($this->getName());\n }", "protected function getStaticDatabaseColumnName() {\r\n return self::$_databaseColumnName;\r\n }", "protected function getStaticDatabaseColumnName() {\r\n return self::$_databaseColumnName;\r\n }", "protected function getStaticDatabaseColumnName() {\r\n return self::$_databaseColumnName;\r\n }", "protected function getStaticDatabaseColumnName() {\r\n return self::$_databaseColumnName;\r\n }", "public function getName()\n {\n return $this['column_name'];\n }", "public function get_username($colum, $table){\n\t\t$this->runQuery('SELECT ' . $column . ' FROM ' . $table . ' WHERE pkID = \"' . $_SESSION['userID'] . '\"');\n\t\t$row = $this->getResult();\n\t\t$this->name = $row['' . $column. ''];\n\t\treturn $this;\n\t\t\n\t}", "public function getUserName() {}", "public function getUsername();", "public function getUsername();", "public function getUsername();" ]
[ "0.833809", "0.74434745", "0.68835133", "0.68434656", "0.6806118", "0.6771873", "0.67511886", "0.67086375", "0.6689292", "0.665468", "0.6491683", "0.64727765", "0.6428062", "0.640624", "0.63698393", "0.63567996", "0.635169", "0.6328611", "0.6318929", "0.6293386", "0.62755406", "0.62755406", "0.62755406", "0.62755406", "0.62419635", "0.6210664", "0.62092364", "0.61669743", "0.61669743", "0.61669743" ]
0.79381543
1
Get the username column name.
public function getUsernameColumnName(): string { return $this->usernameColumn ?? $this->getModelGeneratorConfig()->getConfig('column', 'username'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getColumn(): string\n {\n return $this->getUsernameColumnName();\n }", "public function username()\n {\n return backpack_authentication_column();\n }", "public static function username() {\n return 'user_id';\n }", "public function username() {\n return $this->db['username'];\n }", "public function get_username() {\n\t\t//$login_results = DB::query(\"Select id, userid, user_ip, user_ip_2, last_action FROM logins\");\n\t\t$table = $this->getTableFormat(\"users\");\n\t\t$username = DB::queryFirstField(\"SELECT username FROM $table WHERE username=%i\", $this->userid);\n\t\treturn $username;\n\n\t}", "public function column_username($user)\n {\n }", "public function getUserName()\n {\n return $this->getUserAttribute(static::ATTRIBUTE_NAME);\n }", "public function getUserName()\n {\n return $this->formattedData['username'];\n }", "public function getNameColumn()\n {\n return $this->nameColumn;\n }", "public function column_name($user)\n {\n }", "public function getUsername()\n {\n return $this->get(self::_USERNAME);\n }", "public function getUserNameIdentifier()\n {\n return $this->user_name;\n }", "public function getUsername()\n {\n return $this->getName();\n }", "public function username(){\n \treturn $this->users->name.' '.$this->users->ape;\n }", "public function getNameOrUsername() {\n return $this->getName() ? : $this->username;\n }", "protected static function column_name(): mixed\n\t{\n\t\treturn self::$query->column_name;\n\t}", "public function getUserName()\n {\n return $this->user_name;\n }", "public function getName()\n {\n return $this['column_name'];\n }", "public function getUserName() {\n if (isset($this->rUser)) {\n return $this->rUser->getFullName();\n }\n return '';\n }", "public function name()\n\t{\n\t\treturn User::info('Username');\n\t}", "public function getUsername() {\n return $this->getValue('username');\n }", "public function getUserName() {\n\t\treturn ($this->userName);\n\t}", "function getUserName() {\n\t\treturn $this->nickname;\n\t\t/*\n\t\tif(!$this->user_name) {\n\t\t\t$this->sql(\"SELECT nickname FROM \".UT_USE.\" WHERE id = \".$this->user_id);\n\t\t\t$this->user_name = $this->getQueryResult(0, \"nickname\");\n \t\t}\n\t\treturn $this->user_name;\n\t\t*/\n\t}", "public function loginUsername()\n {\n return property_exists($this, 'username') ? $this->username : 'email';\n }", "public function getUserName() : string\n {\n return $this->userName;\n }", "public function getUserName() : string\n {\n return $this->userName;\n }", "public function getUserName()\n {\n return $this->getName();\n }", "public static function username()\n {\n $username = self::variable(self::USERNAME);\n\n return $username;\n }", "public function getUsername()\n {\n return $this->getUserIdentifier();\n }", "public function getColumnName();" ]
[ "0.8438552", "0.77026516", "0.7644313", "0.7595003", "0.74217266", "0.73610795", "0.73353124", "0.7290394", "0.7233597", "0.71988547", "0.71946585", "0.7169115", "0.71624476", "0.71230555", "0.70969915", "0.70937234", "0.7084786", "0.70772237", "0.7074892", "0.7073811", "0.7053503", "0.70522165", "0.704526", "0.7030782", "0.70285785", "0.70285785", "0.70071", "0.7004635", "0.70026165", "0.7001045" ]
0.879286
0
Get the model specific generator config. Since a model could extend the GeneratesUsernames trait, we need to check if it has any specific config that would change the behaviour of this trait. Eventually will deprecate the generatorConfig and change it to simply return an array that will then be passed to the generator.
private function getModelGeneratorConfig(): Generator { $generator = new Generator(); if (method_exists($this, 'generatorConfig')) { $this->generatorConfig($generator); } return $generator; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getGeneratorConfig()\n {\n return $this->database->getGeneratorConfig();\n }", "protected function coreGenerators()\n {\n return [\n 'ultimate' => ['class' => 'dlds\\giixer\\generators\\ultimate\\Generator'],\n 'model' => ['class' => 'dlds\\giixer\\generators\\model\\Generator'],\n 'crud' => ['class' => 'dlds\\giixer\\generators\\crud\\Generator'],\n 'module' => ['class' => 'yii\\gii\\generators\\module\\Generator'],\n 'extension' => ['class' => 'yii\\gii\\generators\\extension\\Generator'],\n ];\n }", "protected function getIndexerConfigurationGenerator() {\n\t\t$this->showProgressMessage('Going to get indexing configurations.');\n\t\t$configGenerator = t3lib_div::makeInstance('tx_mnogosearch_configgenerator');\n\t\t/* @var $configGenerator tx_mnogosearch_configgenerator */\n\t\t$configGenerator->setCommandLineOptions($this->commandLineOptions);\n\t\treturn $configGenerator;\n\t}", "public function getConfig()\n {\n return $this->traitGetConfig();\n }", "protected function getGeneratorConfigPath(): string\n {\n if (null === $this->genConfigPath) {\n\n /**\n * @var $container LightServiceContainerInterface\n */\n $container = $this->getContextVar(\"container\");\n $appDir = $container->getApplicationDir();\n $planet = $this->getContextVar(\"planet\");\n $galaxy = $this->getContextVar(\"galaxy\");\n $planetDir = $this->getContextVar(\"planetDir\");\n $createFile = $this->getContextVar(\"createFile\");\n $tablePrefix = DeveloperWizardGenericHelper::getTablePrefix($planetDir, $createFile);\n $this->genConfigPath = $appDir . \"/config/data/$galaxy.$planet/Ling.Light_BreezeGenerator/$tablePrefix.generated.byml\";\n }\n return $this->genConfigPath;\n }", "private function getConfigPath()\n {\n return config_path('generators.php');\n }", "public function getModelsConfiguration()\n {\n $ret = NULL;\n if ($this->_configuredModels) {\n return ModelConfiguration::getFrontendConfigForModels($this->_configuredModels, $this->_applicationName);\n }\n \n return $ret;\n }", "public function getGenerator()\n {\n return $this->generator;\n }", "public function getAppConfig()\n {\n return [\n 'authentication' => [\n 'default_redirect_to' => '/',\n ],\n 'view_helpers' => [\n 'aliases' => [\n 'isUser' => Helper\\IsUser::class,\n 'sanitizeHtml' => Helper\\SanitizeHtml::class,\n ],\n 'factories' => [\n Helper\\IsUser::class => Helper\\IsUserFactory::class,\n Helper\\SanitizeHtml::class => InvokableFactory::class,\n ],\n ],\n ];\n }", "public function generator()\n {\n return $this->generator;\n }", "public function getGeneratorParameters() {\r\n\t\t$this->initGeneratorParameters();\r\n\t\treturn $this->generator_parameters->getParameters();\r\n\t}", "public function getDependencyConfig()\n {\n return [\n 'delegators' => [\n \\Mezzio\\Application::class => [\n \\Mezzio\\Container\\ApplicationConfigInjectionDelegator::class,\n ],\n ],\n 'factories' => [\n AuthenticationMiddleware::class =>\n AuthenticationMiddlewareFactory::class,\n LoginPageAction::class => LoginPageFactory::class,\n UserTableAuthentication::class =>\n UserAuthenticationFactory::class,\n Middleware\\WhoopsErrorResponseGenerator::class =>\n Container\\WhoopsErrorResponseGeneratorFactory::class,\n SanitizeHtml::class => InvokableFactory::class,\n /*\n * Register a class that will handle the user authentication.\n * The one registered here provides only a\n generic sample implementation\n * and is not meant to be taken seriously.\n *\n * UserTableAuthentication::class =>\n UserAuthenticationFactory::class,\n * */\n ],\n 'aliases' => [\n UserAuthenticationInterface::class => UserTableAuthentication::class,\n /*\n * This is a sample setup whereby the specific\n implementation is never\n * referenced anywhere in the codebase, instead\n using a generic alias.\n *\n * UserAuthenticationInterface::class =>\n UserTableAuthentication::class\n * */\n ],\n ];\n }", "public function pathAndValuesDataProvider(): ?\\Generator\n {\n yield ['config.custom/models_namespace', 'Models'];\n yield ['config.custom/path.a.b.c.d', \"true\"];\n yield ['config.hashing/bcrypt.rounds', \"50\"];\n yield ['config.hashing/argon.memory', \"2048\"];\n yield ['config.app/name', 'newName'];\n yield ['config.app/env', 'alpha'];\n // one more time\n yield ['config.app/name', 'Gregory'];\n yield ['config.app/env', 'delta'];\n }", "protected function generateBreezeConfig()\n {\n\n $genConfPath = $this->getGeneratorConfigPath();\n $this->infoMessage(\"Creating generator conf file in $genConfPath.\");\n\n $galaxy = $this->getContextVar(\"galaxy\");\n $planet = $this->getContextVar(\"planet\");\n $createFile = $this->getContextVar(\"createFile\");\n\n $prefixes = $this->getTablePrefixes();\n $mainPrefix = array_shift($prefixes);\n\n\n DeveloperWizardBreezeGeneratorHelper::spawnConfFile($genConfPath, [\n \"galaxyName\" => $galaxy,\n \"planetName\" => $planet,\n \"createFilePath\" => $createFile,\n \"prefix\" => $mainPrefix,\n \"otherPrefixes\" => $prefixes,\n ]);\n return null;\n }", "protected function _getConfig()\n {\n return Mage::getSingleton('customgrid/column_renderer_config_collection');\n }", "public function getGenerator()\n\t{\n\t\treturn $this->_generator;\n\t}", "protected function _getConfigModel()\n {\n if (!$this->hasConfigModel()) {\n $this->setConfigModel(Mage::getConfig());\n }\n\n return $this->getConfigModel();\n }", "protected function _getConfig()\n {\n return $this->_vendor;\n }", "protected function getModelConfiguration()\n {\n return app('sleeping_owl')->getModel(get_class($this->getModel()));\n }", "public function setGeneratorConfig(GeneratorConfigInterface $config);", "public function _getConfigModel()\n {\n return Mage::getModel(self::CONFIG);\n }", "protected abstract static function getConfig(): array;", "private function getConfigModel()\n {\n return Mage::getSingleton('wallee_payment/system_config');\n }", "public function getGenerator();", "public function getGenerator();", "public function getConfig()\n {\n $provider = new ConfigProvider();\n return [\n 'service_manager' => $provider->getDependencyConfig(),\n ];\n }", "public function getConfig()\n {\n $provider = new ConfigProvider();\n return [\n 'service_manager' => $provider->getDependencyConfig(),\n ];\n }", "public static function getUserModel(): string\n {\n return config('laravel-server-analytics.user_model');\n }", "public function getConfiguration()\n {\n return self::$config_array;\n }", "public function getConfig()\n {\n $template = $this->getGiftCardTemplate();\n $config = [\n 'text' => $this->getOptions('text'),\n 'size' => $this->getOptions('size'),\n 'color' => $this->getOptions('color'),\n 'image' => $this->getOptions('image'),\n 'design' => $template->getDesign(),\n 'name' => $template->getName(),\n 'store_id' => $template->getStoreId(),\n 'action' => $this->getActions(),\n 'formKey' => $this->formKey->getFormKey(),\n 'imageList' => $this->getImageList(),\n 'template_id' => $this->getTemplateId(),\n ];\n return $config;\n }" ]
[ "0.728027", "0.5777113", "0.5775435", "0.5678496", "0.56554544", "0.5619798", "0.5557239", "0.55403304", "0.5513188", "0.55023575", "0.5497083", "0.547021", "0.5453373", "0.5358906", "0.5358226", "0.5326922", "0.5326106", "0.5317825", "0.5314144", "0.5311939", "0.5292985", "0.5257425", "0.52348197", "0.52313393", "0.52313393", "0.5224001", "0.5224001", "0.521826", "0.5193111", "0.5186845" ]
0.71254706
1
Show ProductAttributeList edit page.
public function edit(ProductAttributeList $attribute) { echo json_encode($attribute); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(ProductAttributes $productAttributes)\n {\n //\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Product Attributes\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the attributes.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/productsattributes/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( ProductsAttributes::grid() )->datagrid ();\n\t}", "public function editAction() {\n\t\t$Session = new Zend_Session_Namespace ( 'Admin' );\n\t\t$form = $this->getForm ( '/admin/productsattributes/process' );\n\t\t\n\t\t// Create the buttons in the edit form\r\n\t\t$this->view->buttons = array(\r\n\t\t\t\tarray(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\tarray(\"url\" => \"/admin/productsattributes/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\tarray(\"url\" => \"/admin/productsattributes/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)),\r\n\t\t);\n\t\t\n\t\t// Set the system field attribute title\n\t\t$panel = Isp::getPanel(); \n\t\tif(!empty($panel)){\n\t\t\t$form->getElement ( 'system_var' )->setLabel ( $panel );\n\t\t}\n\t\t\n\t\t$id = $this->getRequest ()->getParam ( 'id' );\n\t\t\n\t\tif (! empty ( $id ) && is_numeric ( $id )) {\n\t\t\t$rs = $this->productsattributes->getAllInfo ( $id, \"*, pad.label as label, pad.prefix as prefix, pad.suffix as suffix, pad.description as description, pad.language_id as language_id\", $Session->langid );\n\t\t\t\n\t\t\tif (! empty ( $rs )) {\n\t\t\t\t$this->view->id = $id;\n\t\t\t\t$rs['language_id'] = $Session->langid; // added to the form the language id selected \n\t\t\t\t$form->populate ( $rs );\n\t\t\t}\n\t\t\t\n\t\t\t$this->view->buttons[] = array(\"url\" => \"/admin/productsattributes/confirm/id/$id\", \"label\" => $this->translator->translate('Delete'), \"params\" => array('css' => null));\r\n\t\t\t\t\n\t\t}\n\t\t$this->view->title = $this->translator->translate(\"Attribute Group\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can edit the attribute group details.\");\n\t\t\n\t\t$this->view->form = $form;\n\t\t$this->render ( 'applicantform' );\n\t}", "public function edit(Edit $request, ProductAttribute $productattribute)\n {\n\t\t$products = Product::all(['id']);\n\t\t$attributes = Attribute::all(['id']);\n\t\t$products_attributes_groups = ProductsAttributesGroup::all(['id']);\n\n return view('pages.product_attributes.edit', [\n 'model' => $productattribute,\n\t\t\t\"products\" => $products,\n\t\t\t\"attributes\" => $attributes,\n\t\t\t\"products_attributes_groups\" => $products_attributes_groups,\n\n ]);\n }", "public function edit($id)\n {\n // Find Attribute\n $attr = MonkCommerceProductAttribute::with('attributeValues')->find($id);\n return view('monkcommerce::monkcommerce-dashboard.admin.products.attributes.edit')->with('attr', $attr);\n }", "public function edit(AplexAdminProductMeta $aplexAdminProductMeta)\n {\n //\n }", "public function processAction() {\n\t\t$redirector = Zend_Controller_Action_HelperBroker::getStaticHelper ( 'redirector' );\n\t\t$form = $this->getForm ( \"/admin/productsattributes/process\" );\n\t\t$request = $this->getRequest ();\n\t\t\n\t\t// Create the buttons in the edit form\r\n\t\t$this->view->buttons = array(\r\n\t\t\t\tarray(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\tarray(\"url\" => \"/admin/productsattributes/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\tarray(\"url\" => \"/admin/productsattributes/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)),\r\n\t\t);\r\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t// Check if we have a POST request\n\t\t\tif (! $request->isPost ()) {\n\t\t\t\treturn $this->_helper->redirector ( 'list', 'productsattributes', 'admin' );\n\t\t\t}\n\t\t\t\n\t\t\tif ($form->isValid ( $request->getPost () )) {\n\t\t\t\t$params = $request->getParams();\n\t\t\t\t\n\t\t\t\t$id = $params['attribute_id'];\n\t\t\t\t$code = $params['code'];\n\t\t\t\t$label = $params['label'];\n\t\t\t\t$type = $params['type'];\n\t\t\t\t$prefix = $params['prefix'];\n\t\t\t\t$suffix = $params['suffix'];\n\t\t\t\t$is_system_var = $params['system'];\n\t\t\t\t$description = $params['description'];\n\t\t\t\t$position = $params['position'];\n\t\t\t\t$is_visible_on_front = $params['is_visible_on_front'];\n\t\t\t\t$active = $params['active'];\n\t\t\t\t$system = $params['system'];\n\t\t\t\t$system_var = $params['system_var'];\n\t\t\t\t$defaultvalue = $params['defaultvalue'];\n\t\t\t\t$is_required = $params['is_required'];\n\t\t\t\t$is_comparable = $params['is_comparable'];\n\t\t\t\t$on_product_listing = !empty($params['on_product_listing']) && $params['on_product_listing'] == 1 ? true : false;\n\t\t\t\t$language_id = $params['language_id'];\n\t\t\t\t\n\t\t\t\t$id = ProductsAttributes::addNew($id, $code, $label, $type, $language_id, $position, $active, $prefix, $suffix, $description, $is_visible_on_front, $is_system_var, $system_var, $defaultvalue, $is_required, $is_comparable, $on_product_listing);\n\t\t\t\t\n\t\t\t\tif($id === false){\n\t\t\t\t\t$this->_helper->redirector ( 'list', 'productsattributes', 'admin', array ('mex' => \"There was an error during the saving process. Check all the parameters.\", 'status' => 'danger' ) );\n\t\t\t\t}\t\t\t\t\n\t\t\t\t$this->_helper->redirector ( 'edit', 'productsattributes', 'admin', array ('id' => $id, 'mex' => $this->translator->translate ( 'The task requested has been executed successfully.' ), 'status' => 'success' ) );\n\t\t\t\n\t\t\t} else {\n\t\t\t\t$this->view->form = $form;\n\t\t\t\t$this->view->title = $this->translator->translate(\"Hosting Plan Feature details\");\n\t\t\t\t$this->view->description = $this->translator->translate(\"Here you can fix the hosting plan feature details.\");\n\t\t\t\treturn $this->render ( 'applicantform' );\n\t\t\t}\n\t\t} catch ( Exception $e ) {\n\t\t\t$this->_helper->redirector ( 'edit', 'productsattributes', 'admin', array ('id' => $id, 'mex' => $e->getMessage (), 'status' => 'danger' ) );\n\t\t}\n\t}", "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}", "function editAttributes()\n\t{\n\t\t$id=(int)$_GET['prodid'];\n\t\tif(is_int($id))\n\t\t{\n\t\t\t$select='SELECT attrib_value_id FROM product_attrib_values_table where product_id='.$id;\n\t\t\t$jbo=new Bin_Query();\n\t\t\t$jbo->executeQuery($select);\n\t\t\t$arr=$jbo->records;\n\t\t\tfor($i=0;$i<count($arr);$i++)\n\t\t\t{\n\t\t\t\t$value[]=$arr[$i]['attrib_value_id'];\n\t\t\t}\n\t\t\t$sql='select category_id from products_table where product_id='.$id;\n\t\t\t$obj=new Bin_Query();\n\t\t\t$obj->executeQuery($sql);\n\t\t\t$sql='SELECT attrib_id FROM category_attrib_table WHERE subcategory_id='.$obj->records[0]['category_id'];\n\t\t\t$query = new Bin_Query();\n\t\t\t$query->executeQuery($sql);\n\t\t\t$cnt=count($query->records);\n\n\t\t\tfor($i=0;$i<$cnt;$i++)\n\t\t\t{\n\t\t\t \t$sq='SELECT a.attrib_name,b.* FROM attribute_table a,attribute_value_table b WHERE a.attrib_id=b.attrib_id AND a.attrib_id='.$query->records[$i]['attrib_id'];\n\t\t \t $que = new Bin_Query();\n\t\t\t \t if($que->executeQuery($sq))\n\t\t\t\t\t$tmp[]=$que->records;\n\t\t\t}\n\t\t\t\n\t\t\t\t\t\n\t\t\treturn Display_DManageProducts::editAttributes($tmp,$value);\n\t\t}\n\t}", "public function edit($id)\n {\n\n return view('attributes.edit', [\n 'listAttribute' => ModelAttributes::find($id)\n ]);\n }", "public function indexAction() {\n\t\t$redirector = Zend_Controller_Action_HelperBroker::getStaticHelper ( 'redirector' );\n\t\t$redirector->gotoUrl ( '/admin/productsattributes/list' );\n\t}", "public function edit(Product $product) {\n //\n }", "public function edit()\n {\n $per = self::get_permission();\n $all = product::all();\n return view('dashboard.product.edit',compact('per','all'));\n }", "public function getEdit(){\n return view(\"admin.product.edit\" );\n }", "public function edit()\r\n\r\n {\r\n\r\n $this->page_title->push(lang('menu_products_add'));\r\n\r\n $this->data['pagetitle'] = $this->page_title->show();\r\n\r\n\r\n /* Breadcrumbs :: Common */\r\n\r\n $this->breadcrumbs->unshift(1, lang('menu_products_add'), 'admin/setup/product/edit');\r\n\r\n\r\n /* Breadcrumbs */\r\n\r\n $this->data['breadcrumb'] = $this->breadcrumbs->show();\r\n\r\n\r\n /* Data */\r\n\r\n $this->data['error'] = NULL;\r\n\r\n $this->data['charset'] = 'utf-8';\r\n\r\n $this->data['form_url'] = 'admin/setup/product/update';\r\n\r\n\r\n /* Load Template */\r\n\r\n $this->template->admin_render('admin/products/edit', $this->data);\r\n\r\n\r\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }" ]
[ "0.7554106", "0.7398569", "0.7341087", "0.72376263", "0.6745065", "0.6731754", "0.6693674", "0.66428506", "0.66301566", "0.6622368", "0.6608486", "0.6559132", "0.65579516", "0.6517996", "0.6506437", "0.6474655", "0.64603204", "0.64603204", "0.64603204", "0.64603204", "0.64603204", "0.64603204", "0.64603204", "0.64603204", "0.64603204", "0.64603204", "0.64603204", "0.64603204", "0.64603204", "0.64603204" ]
0.74865043
1
Gets the coachmarkLocation The coachmark location.
public function getCoachmarkLocation() { if (array_key_exists("coachmarkLocation", $this->_propDict)) { if (is_a($this->_propDict["coachmarkLocation"], "\Beta\Microsoft\Graph\Model\CoachmarkLocation") || is_null($this->_propDict["coachmarkLocation"])) { return $this->_propDict["coachmarkLocation"]; } else { $this->_propDict["coachmarkLocation"] = new CoachmarkLocation($this->_propDict["coachmarkLocation"]); return $this->_propDict["coachmarkLocation"]; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setCoachmarkLocation($val)\n {\n $this->_propDict[\"coachmarkLocation\"] = $val;\n return $this;\n }", "public function getLocation() {\n\t\treturn($this->location);\n\t}", "public function getLocation()\n\t{\n\t\treturn $this->location;\n\t}", "public function getLocation()\n\t{\n\t\treturn $this->location;\n\t}", "public function getLocation()\n\t{\n\t\treturn $this->location;\n\t}", "public function getLocation()\n\t{\n\t\treturn $this->location;\n\t}", "public function get_location()\n\t{\n\t\treturn $this->location;\n\t}", "public function getLocation()\r\n {\r\n return $this->location;\r\n }", "public function getLocation()\n {\n return $this->location;\n }", "public function getLocation()\n {\n return $this->location;\n }", "public function getLocation()\n {\n return $this->location;\n }", "public function getLocation()\n {\n return $this->location;\n }", "public function getLocation()\n {\n return $this->location;\n }", "public function getLocation()\n {\n return $this->location;\n }", "public function getLocation()\n {\n return $this->location;\n }", "public function getLocation()\n {\n return $this->location;\n }", "public function getLocation()\n {\n return $this->location;\n }", "public function getLocation()\n {\n return $this->location;\n }", "public function getLocation()\n {\n return $this->location;\n }", "public function getLocation()\n {\n return $this->location;\n }", "public function getLocation()\n {\n return $this->location;\n }", "public function getLocation()\n\t{\n\t\treturn $this->_location;\n\t}", "public function getLocation() {\n return $this->location;\n }", "public function currentLocation() {\n return $this->currentLocation;\n }", "public function getLocation() {\r\n return $this->location;\r\n }", "public function getLocation()\n {\n return isset($this->location) ? $this->location : null;\n }", "public function getCustomerLocation()\n {\n if (array_key_exists(\"customerLocation\", $this->_propDict)) {\n if (is_a($this->_propDict[\"customerLocation\"], \"\\Beta\\Microsoft\\Graph\\Model\\Location\") || is_null($this->_propDict[\"customerLocation\"])) {\n return $this->_propDict[\"customerLocation\"];\n } else {\n $this->_propDict[\"customerLocation\"] = new Location($this->_propDict[\"customerLocation\"]);\n return $this->_propDict[\"customerLocation\"];\n }\n }\n return null;\n }", "public function getLocation() { return $this->location; }", "public function getLocation() {\n return $this->location;\n }", "public function getLocation()\n {\n return $this->getLocationData();\n }" ]
[ "0.6907085", "0.6463573", "0.63533944", "0.63533944", "0.63533944", "0.63533944", "0.63495487", "0.63153625", "0.63101465", "0.63101465", "0.63101465", "0.63101465", "0.63101465", "0.63101465", "0.63101465", "0.63101465", "0.63101465", "0.63101465", "0.63101465", "0.63101465", "0.63101465", "0.6288059", "0.6278666", "0.6246756", "0.62401414", "0.62216973", "0.6190443", "0.6175333", "0.6158323", "0.61315423" ]
0.85421234
0
Sets the coachmarkLocation The coachmark location.
public function setCoachmarkLocation($val) { $this->_propDict["coachmarkLocation"] = $val; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCoachmarkLocation()\n {\n if (array_key_exists(\"coachmarkLocation\", $this->_propDict)) {\n if (is_a($this->_propDict[\"coachmarkLocation\"], \"\\Beta\\Microsoft\\Graph\\Model\\CoachmarkLocation\") || is_null($this->_propDict[\"coachmarkLocation\"])) {\n return $this->_propDict[\"coachmarkLocation\"];\n } else {\n $this->_propDict[\"coachmarkLocation\"] = new CoachmarkLocation($this->_propDict[\"coachmarkLocation\"]);\n return $this->_propDict[\"coachmarkLocation\"];\n }\n }\n return null;\n }", "public function setLocation(CultureFeed_Cdb_Data_Location $location) {\n $this->location = $location;\n }", "function setLocation($location);", "public function setMarkToday($markToday)\n {\n $this->markToday = $markToday;\n }", "public function setLocation($value)\n {\n $this->location = $value;\n }", "public function setCurrentLocation($location) {\n $this->currentLocation = $location;\n }", "private function setCoordinates($chosenCity) {\n $this->cityLongitude = $this->cities[$chosenCity]['Longitude']; \n $this->cityLatitude = $this->cities[$chosenCity]['Latitude'];\n }", "public function setLocation(string $location): void;", "public function setOriginLocation($location)\n {\n $this->originLocation = $location;\n }", "public function setLocation($location)\n {\n $this->location = $location;\n }", "public function setLocation($location)\n {\n $this->location = $location;\n }", "public function setLat($value)\n {\n $this->lat = $value;\n }", "protected function setLocation($location) {\r\n // TODO: Don't really know what this is?\r\n $this->location = $this->create($location);\r\n }", "public function setRequestLocation(?bool $requestLocation): void\n {\n $this->requestLocation = $requestLocation;\n }", "public function setCoordinate( Coordinate $coordinate ) {\n\n $this->coordinate = $coordinate;\n }", "public function setAutomaticLocation( $val, $markChanged=true ) {\n\t\t$this->automaticLocation = $val;\n\t\tif( $markChanged ) $this->isChanged = true;\n\t}", "public function setBookmarks($bookmark)\n {\n $this->_bookmarks=$bookmark;\n }", "public function setRequestLocation(bool $requestLocation) {\n\t\t$this->requestLocation = $requestLocation;\n\t}", "protected function setMark() {\n echo $this->promptMessage('choose_mark');\n $mark = $this->limitInput(array(self::X_MARK, self::O_MARK, self::QUIT_BUTTON));\n switch ($mark) {\n case self::X_MARK:\n $this->_userMark = self::X_MARK;\n $this->_botMark = self::O_MARK;\n break;\n case self::O_MARK:\n $this->_userMark = self::O_MARK;\n $this->_botMark = self::X_MARK;\n break;\n case self::QUIT_BUTTON:\n $this->quit();\n }\n echo \"You will be Player \" . $this->_userMark . \".\" . PHP_EOL;\n echo $this->promptMessage('start_game') . PHP_EOL;\n }", "function setWorkPlace( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->WorkPlace = $value;\n }", "function setPlace( &$value )\n {\n $this->Place = $value;\n }", "public function setCellLocation($value)\n {\n return $this->set('CellLocation', $value);\n }", "public function setLatitude($latitude) {\n\n $this->latitude = $latitude;\n\n }", "public function setGeolocation($geolocation)\n {\n $this->geolocation = $geolocation;\n }", "public function setCustomerLocation($val)\n {\n $this->_propDict[\"customerLocation\"] = $val;\n return $this;\n }", "public function setLocation($value)\n {\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_LOCATION] \n = $value;\n }", "public function setLocation($value)\n {\n return $this->set('Location', $value);\n }", "public function setCity($value) {\n\t\tself::$_city = $value;\n\t}", "public function setPreferredLocation($location) {\n $this->preferredLocation = $location;\n }", "public function setCoordinate()\n {\n $args = func_get_args();\n\n if (isset($args[0]) && ($args[0] instanceof Coordinate)) {\n $this->coordinate = $args[0];\n } elseif ((isset($args[0]) && is_numeric($args[0])) && (isset($args[1]) && is_numeric($args[1]))) {\n if (!$this->hasCoordinate()) {\n $this->coordinate = new Coordinate();\n }\n\n $this->coordinate->setLatitude($args[0]);\n $this->coordinate->setLongitude($args[1]);\n\n if (isset($args[2]) && is_bool($args[2])) {\n $this->coordinate->setNoWrap($args[2]);\n }\n } elseif (!isset($args[0])) {\n $this->coordinate = null;\n } else {\n throw GeocodingException::invalidGeocoderRequestCoordinate();\n }\n\n return $this;\n }" ]
[ "0.6356563", "0.56165236", "0.5455847", "0.539666", "0.52562803", "0.52390504", "0.5126067", "0.50752324", "0.5073", "0.50416464", "0.50416464", "0.5037526", "0.49231446", "0.48471037", "0.48150584", "0.47880453", "0.47329837", "0.47106293", "0.47086388", "0.47046208", "0.46965918", "0.4689465", "0.46219942", "0.4618711", "0.46179777", "0.45136163", "0.45121342", "0.45084664", "0.44903505", "0.44810694" ]
0.7585093
0
Gets the indicator The coachmark indicator.
public function getIndicator() { if (array_key_exists("indicator", $this->_propDict)) { return $this->_propDict["indicator"]; } else { return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getIndicator() ;", "public function getIndicatorElement() {\n\t\treturn $this->indicator;\n\t}", "public function getFormattedIndicator()\n {\n return $this->formattedIndicator;\n }", "public function getAuctionConstraintIndicator()\n {\n return $this->auctionConstraintIndicator;\n }", "public function getInsance() {\r\n\t\treturn $this->tcpdf;\r\n\t}", "public function getBalanceBroughtForwardIndicator()\n {\n return $this->balanceBroughtForwardIndicator;\n }", "public function getBalanceBroughtForwardIndicator()\n {\n return $this->balanceBroughtForwardIndicator;\n }", "public function getMarkIdentification() {\n\t\treturn self::$_markIdentification;\n\t}", "public function getInitialMarking() {\n\t\treturn $this->initialMarking;\n\t}", "public function getCIF(){\n $info = $this->getInfo();\n return $info[\"cif\"];\n }", "public function getAccion()\n {\n return $this->accion;\n }", "public function getCodage()\n {\n return $this->codage;\n }", "public function getCoachmarkLocation()\n {\n if (array_key_exists(\"coachmarkLocation\", $this->_propDict)) {\n if (is_a($this->_propDict[\"coachmarkLocation\"], \"\\Beta\\Microsoft\\Graph\\Model\\CoachmarkLocation\") || is_null($this->_propDict[\"coachmarkLocation\"])) {\n return $this->_propDict[\"coachmarkLocation\"];\n } else {\n $this->_propDict[\"coachmarkLocation\"] = new CoachmarkLocation($this->_propDict[\"coachmarkLocation\"]);\n return $this->_propDict[\"coachmarkLocation\"];\n }\n }\n return null;\n }", "public function getInd()\n {\n return $this->hasOne(Indicador::className(), ['ind_id' => 'ind_id']);\n }", "public function getAttorney()\n {\n return $this->get(self::ATTORNEY);\n }", "public static function getCurrentClinic() {\n $user = Auth::user();\n\n return $user->clinic;\n }", "public function getCareof()\n {\n return $this->careof;\n }", "public function getAccident()\n {\n return $this->accident;\n }", "public function getMarkToday()\n {\n return $this->markToday;\n }", "public function getCadence(){\n return $this->cadence;\n }", "public function getCoveredCodeMutationScoreIndicator(): float\n {\n return $this->getCalculator()->getCoveredCodeMutationScoreIndicator();\n }", "public function getCodeguichet()\n {\n return $this->codeguichet;\n }", "public function getCandidat()\n {\n return $this->candidat;\n }", "public function getCurrentMarker()\n {\n if($this->currentMarker < 0 || $this->currentMarker > count($this->markers) - 1) return false;\n return $this->markers[$this->currentMarker];\n }", "public function getCodcaj(){\n\t\treturn $this->codcaj;\n\t}", "public function getAccion() {\r\n return $this->pAccion;\r\n }", "public function getCoInformeIncidente()\n\t{\n\t\treturn $this->co_informe_incidente;\n\t}", "public function getAceite();", "public function getCilindrada()\n {\n return $this->cilindrada;\n }", "public function getAttributeName()\n\t{\n\t\treturn 'Indicator';\n\t}" ]
[ "0.6871639", "0.6764327", "0.60312074", "0.54736185", "0.5411955", "0.54088974", "0.54088974", "0.5402555", "0.53989804", "0.53844714", "0.53071046", "0.5295997", "0.5281968", "0.5263277", "0.52573156", "0.5253479", "0.5245824", "0.5219351", "0.5211711", "0.51964664", "0.5193231", "0.5189959", "0.51857305", "0.51855195", "0.5159655", "0.5158757", "0.51576096", "0.5152144", "0.5148264", "0.51421416" ]
0.68549293
1
Sets the indicator The coachmark indicator.
public function setIndicator($val) { $this->_propDict["indicator"] = $val; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setIndicator($indicator)\n {\n $this->indicator = $indicator;\n return $this;\n }", "public function setProgressIndicator(int $indicator) {\n $this->setValue(0x3C5, $indicator);\n }", "public function __construct($cashIndicator = null)\n {\n $this\n ->setCashIndicator($cashIndicator);\n }", "public function setMaternityCoverageIndicator($maternityCoverageIndicator)\n {\n $this->maternityCoverageIndicator = $maternityCoverageIndicator;\n return $this;\n }", "public function setMarkIdentification($value) {\n\t\tself::$_markIdentification = $value;\n\t}", "public function setPublicIndicator($publicIndicator)\n {\n $this->publicIndicator = $publicIndicator;\n return $this;\n }", "protected function setMark() {\n echo $this->promptMessage('choose_mark');\n $mark = $this->limitInput(array(self::X_MARK, self::O_MARK, self::QUIT_BUTTON));\n switch ($mark) {\n case self::X_MARK:\n $this->_userMark = self::X_MARK;\n $this->_botMark = self::O_MARK;\n break;\n case self::O_MARK:\n $this->_userMark = self::O_MARK;\n $this->_botMark = self::X_MARK;\n break;\n case self::QUIT_BUTTON:\n $this->quit();\n }\n echo \"You will be Player \" . $this->_userMark . \".\" . PHP_EOL;\n echo $this->promptMessage('start_game') . PHP_EOL;\n }", "public function setVisionCoverageIndicator($visionCoverageIndicator)\n {\n $this->visionCoverageIndicator = $visionCoverageIndicator;\n return $this;\n }", "function getIndicator() ;", "public function setCoachmarkLocation($val)\n {\n $this->_propDict[\"coachmarkLocation\"] = $val;\n return $this;\n }", "public function setInitialMarking($initialMarking, $setTokens = false) {\n\t\t$this->initialMarking = (int) $initialMarking;\n\t\tif($setTokens) {\n\t\t\t$this->resetTokens();\n\t\t}\n\t}", "public function setCi($_ci)\n {\n $this->ci = $_ci;\n }", "public function getIndicatorElement() {\n\t\treturn $this->indicator;\n\t}", "private function setIndicators($type) {\n $this->setIndicator($type, 'left');\n $this->setIndicator($type, 'right');\n $this->setIndicator($type, 'separator');\n }", "protected function set_accessory() {\n $this->accessory = $this->safe_find_from_id('Accessory');\n }", "public function testSetIndemnAutre() {\n\n $obj = new AttestationCacm();\n\n $obj->setIndemnAutre(true);\n $this->assertEquals(true, $obj->getIndemnAutre());\n }", "public function show(CategoryIndicator $categoryIndicator)\n {\n //\n }", "public function setFormattedIndicator($formattedIndicator)\n {\n $this->formattedIndicator = $formattedIndicator;\n return $this;\n }", "public function getIndicator()\n {\n if (array_key_exists(\"indicator\", $this->_propDict)) {\n return $this->_propDict[\"indicator\"];\n } else {\n return null;\n }\n }", "public function saveIndicatorCoupon($order, $indicatorCoupon)\n {\n try{\n $dateNow = new DateTime();\n $collection = mage::getModel('affiliateclub/affiliateclub')\n ->getCollection()\n ->addFieldToFilter('order_id', $order->getId());\n\n $collection->getFirstItem()\n ->setIndicatorCoupon($indicatorCoupon)\n ->setUpdatedAt($dateNow->getTimestamp())\n ->save();\n \n $this->helper->log(\"Atualizou o cupom do indicador no banco\");\n } catch (Exception $e) {\n $this->helper->log($e->getMessage());\n } \n }", "public function setMarkToday($markToday)\n {\n $this->markToday = $markToday;\n }", "public function setC($x) { $this->c = $x; }", "function setMaCauHoi($ma_cau_hoi){\r\n\t\t$this->ma_cau_hoi = $ma_cau_hoi;\r\n\t}", "public function setAuctionConstraintIndicator($auctionConstraintIndicator)\n {\n $this->auctionConstraintIndicator = $auctionConstraintIndicator;\n return $this;\n }", "public function setDomesticPartnerIndicator($domesticPartnerIndicator)\n {\n $this->domesticPartnerIndicator = $domesticPartnerIndicator;\n return $this;\n }", "public function setAttribution($attribution)\n {\n $this->attribution = $attribution;\n }", "public function testSetIndemnLegale() {\n\n $obj = new AttestationCacm();\n\n $obj->setIndemnLegale(true);\n $this->assertEquals(true, $obj->getIndemnLegale());\n }", "public function testSetAnnulationClient() {\n\n $obj = new Collaborateurs();\n\n $obj->setAnnulationClient(true);\n $this->assertEquals(true, $obj->getAnnulationClient());\n }", "public function setIndicatorString($indicatorString)\n {\n $this->indicatorString = $indicatorString;\n return $this;\n }", "protected function setCuitOrDni($afipInvoice,$customer){\n\t\t$ivaAmount = $afipInvoice->getIva_0250() + $afipInvoice->getIva_0500() + $afipInvoice->getIva_1050() + $afipInvoice->getIva_2100() + $afipInvoice->getIva_2700();\n\t\t$netoAmount = $afipInvoice->getNeto_0250() + $afipInvoice->getNeto_0500() + $afipInvoice->getNeto_1050() + $afipInvoice->getNeto_2100() + $afipInvoice->getNeto_2700() + $afipInvoice->getNetoExento();\n\t\t//Factura B\n\t\tif($afipInvoice->getType() == TypeEnum::B){\n\t\t\t//>= $1000\n\t\t\tif(($customer->getIvaCondition() == 1 || $customer->getIvaCondition() == 4) && ($ivaAmount + $netoAmount) >= 1000){\n\t\t\t\tif(strlen($customer->getTaxvat()) == 11){\n\t\t\t\t\t$this->setCUITNumber($customer->getTaxvat());\n\t\t\t\t}else{\n\t\t\t\t\t$this->setDNINumber($customer->getTaxvat());\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t//Responsable monotributo o Exento\n\t\t\t\tif($customer->getIvaCondition() == 3 || $customer->getIvaCondition() == 5){\n\t\t\t\t\tif(strlen($customer->getTaxvat()) == 11){\n\t\t\t\t\t\t$this->setCUITNumber($customer->getTaxvat());\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->setDNINumber($customer->getTaxvat());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t//Factura A\t\n\t\t}else{\n\t\t\t$this->setCUITNumber($customer->getTaxvat());\n\t\t}\n\t\t \n\t\t \n\t\t\n\t}" ]
[ "0.5895671", "0.55091476", "0.5131596", "0.512462", "0.5121745", "0.51140857", "0.49787202", "0.49094555", "0.48628163", "0.47848547", "0.4719203", "0.4656031", "0.458182", "0.45355946", "0.44918737", "0.4491703", "0.4468697", "0.44537216", "0.44352505", "0.4425843", "0.44167453", "0.44144765", "0.44072235", "0.43940404", "0.4390552", "0.43672413", "0.43486434", "0.43006104", "0.4278873", "0.4276768" ]
0.59351665
0
View module controller actions
public function viewactionsAction(){ $moduleId = $this->getRequest()->getParam('moduleId'); $moduleObj = new Modules_Model_Modules(); $moduleItem = $moduleObj->findById($moduleId); $controllerId = $this->getRequest()->getParam('controllerId'); $controllerObj = new Modules_Model_Controllers(); $controllerItem = $controllerObj->findById($controllerId); $permObj = new Permission_Model_Permission(); $permObj->setModuleId( $moduleId ); $permObj->setControllerId( $controllerId ); $this->view->module = $moduleItem; $this->view->controller = $controllerItem; $this->view->records = $permObj->fetchActionsByControllerModule(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionView() {}", "public function actionView() {}", "public function viewAction()\r\n {\r\n $this->indexAction();\r\n }", "public function indexAction () {\r\n $this->_helper->viewRenderer->setNoRender(false);\r\n $this->_helper->layout()->enableLayout();\r\n $this->view->assign('controller', $this->_request->getControllerName());\r\n $this->view->assign('module', $this->_request->getModuleName());\r\n }", "protected function viewAction()\n {\n }", "public function actionView()\n {\n \n }", "public function actionIndex()\n {\n return \"Module controller\";\n }", "public function indexAction()\n {\n\t\techo 'Module Admin IndexController indexAction';\n\t\t\n }", "public function IndexAction() {\r\n $this->ExecuteView();\r\n }", "public function Index() {\n $modules = new CMModules();\n $controllers = $modules->AvailableControllers();\n $allModules = $modules->ReadAndAnalyse();\n $this->views->SetTitle('Manage Modules')\n ->AddInclude(__DIR__ . '/index.tpl.php', array('controllers'=>$controllers), 'primary')\n ->AddInclude(__DIR__ . '/sidebar.tpl.php', array('modules'=>$allModules), 'sidebar');\n }", "public function indexAction()\n {\n //for real application\n }", "public function indexAction() {\r\n \r\n }", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction()\n {\n// $this->view = 'index';\n }", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction ()\r\n {\r\n\r\n }", "public function indexAction() {\r\n }", "public function actionView()\n\t{\n\t\t$this->render('view');\n\t}", "public function indexAction()\n {\n $controllers = array();\n\n FOREACH($this->dbCtrl->fetchAllOrderByModuleController() AS $row) {\n $controllers[] = new Admin_Model_DbRow_Controller($row);\n }\n\n $this->view->controllers = $controllers;\n }", "public function action() {\n // $this->view->page();\n }", "protected function indexAction() {}" ]
[ "0.7992516", "0.7992516", "0.79832315", "0.7858633", "0.7796232", "0.76896656", "0.7637314", "0.7578816", "0.74148715", "0.738777", "0.7324321", "0.73125964", "0.7303295", "0.7303295", "0.7303295", "0.7303295", "0.7303295", "0.7303295", "0.7303295", "0.7303295", "0.7303295", "0.73028857", "0.7301697", "0.7301563", "0.7299225", "0.7245751", "0.7235788", "0.7234731", "0.72321486", "0.7220176" ]
0.80764145
0
Lists all Incident entities.
public function indexAction() { $em = $this->getDoctrine()->getManager(); $entities = $em->getRepository('ComDaufinBundle:Incident')->findAll(); return $this->render('ComDaufinBundle:Incident:index.html.twig', array( 'entities' => $entities, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n {\n return IncidentResource::collection(Incident::all());\n }", "public function index()\n {\n //\n return Incidencies::get();\n }", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('CMSBundle:Client')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function getAllEntities();", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AcmeKindergartenBundle:AttendanceEmployed')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('BackOfficebackBundle:Extraitnaissances')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function findAllEntities();", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('EnterpriseBundle:Customer')->findAll();\n\n return $this->render('EnterpriseBundle:Default:index.html.twig', array(\n 'entities' => $entities\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SmathEmpresaBundle:Empleado')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n {\n return Entity::all();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('INHack20InventarioBundle:Estado')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('MrsBlogBundle:Cidades')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('CmarMeetingBundle:Meeting')->findAll();\n\n return array('entities' => $entities);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $repository = $em->getRepository('COEShopBundle:Discount');\n\n $entities = $repository->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function testShowAllIncidences()\n {\n //1. Preparar el test\n //2. Executar el codi que vull provar.\n //3. Comprovo: assert\n\n $incidences = factory(Incidence::class, 50) -> create();\n\n\n $response = $this->get('/incidences');\n $response->assertStatus(200);\n $response->assertSuccessful();\n $response->assertViewIs('list_events');\n\n\n //TODO faltaria contar que hi ha 50 al resultat\n\n// foreach ( $incidences as $incidence) {\n// $response->assertSeeText($incidence->title);\n// $response->assertSeeText($incidence->description);\n// }\n }", "public function indexAction()\n {\n $entities = $this->get('InspectionManager')->getAllEntity();\n return array(\n 'entities' => $entities,\n 'headerTitle' => 'Inspections');\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('uesperaBundle:ClienteCredito')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n \n $entity = new Incapacidad();\n $form = $this->createCreateForm($entity);\n \n $entities = $em->getRepository('DGPlusbelleBundle:Incapacidad')->findAll();\n\n return array(\n 'form'=>$form->createView(),\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SiteSavalizeBundle:Company')->findAll();\n\n return $this->render('SiteSavalizeBundle:Company:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('JetBredaBundle:Alquiler')->findAll();\n\n return array('entities' => $entities);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('HaccoDeeeBundle:DevisSetup')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('CrudforgeBundle:Users')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function getEntities()\n {\n return $this->getRepository()->findBy([], ['discipline' => 'ASC']);\n }", "public function listAllIdentities($id){\n return $this->accountGateway->listAllIdentities($id);\n }", "public function getEntities();", "public function getEntities();", "public function viewAllReportedAccidents(Request $request)\n {\n //get all the emergency requests that are reported as accidents\n $accidents = Emergencies::where('type','=','accident')->latest()->paginate(10);\n if(!$accidents)\n {\n $request->session()->flash('error','No acciden data reported yet');\n return redirect()->back();\n }\n else\n {\n return view('nurses.emergencies.accidents.index', compact('accidents'));\n }\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('INHack20EquipoBundle:Componente')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function showEntities()\n {\n return Entity::paginate(10);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('HffBlogBundle:Comentarios')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }" ]
[ "0.7005375", "0.64993304", "0.6474207", "0.6351045", "0.6330612", "0.6325362", "0.62754", "0.62179345", "0.604176", "0.60272324", "0.59795886", "0.59509426", "0.5944533", "0.5941982", "0.5938184", "0.59238094", "0.5922805", "0.5902203", "0.5880296", "0.5874867", "0.58739233", "0.5871087", "0.5864848", "0.5864387", "0.5854387", "0.5854387", "0.58463544", "0.58458966", "0.58202523", "0.5818584" ]
0.70976186
0
Creates a new Incident entity.
public function createAction(Request $request) { $entity = new Incident(); $form = $this->createCreateForm($entity); $form->handleRequest($request); if ($form->isValid()) { $em = $this->getDoctrine()->getManager(); $em->persist($entity); $em->flush(); return $this->redirect($this->generateUrl('com_incident_show', array('id' => $entity->getId()))); } return $this->render('ComDaufinBundle:Incident:new.html.twig', array( 'entity' => $entity, 'form' => $form->createView(), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n $invoice = new InvoiceEntity();\n $invoice->setNumber('019101910191091')\n ->setValue(100.90)\n ->setUrl('http://domain.com')\n ->setIssuanceDate('2017-09-15')\n ->setKey('POL9898AS');\n\n $tracking = new TrackingEntity();\n $tracking->setOrderId('00001010101AA')\n ->setStatus('in_route')\n ->setCode('BR800OPR5')\n ->setInvoice($invoice);\n\n $this->dm->persist($tracking);\n $this->dm->flush();\n }", "public function create(Entity $entity);", "public function create($entity);", "public function createEntity();", "function create($entity);", "function create(IContract $entity);", "public function createEntity($entityId, $request)\n {\n return $this->start()->uri(\"/api/entity\")\n ->urlSegment($entityId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "public function store(Request $request)\n {\n $log = new Log;\n $log->owner = $request->owner;\n $log->device_id = $request->device_id;\n $log->resolved = $request->resolved;\n $log->description = $request->description;\n\n $incident = new Incident;\n $incident->title = $request->title;\n $incident->save();\n $incident->logs()->save($log);\n\n return new IncidentResource($incident);\n }", "public function newAction()\n {\n $entity = new Incident();\n $form = $this->createCreateForm($entity);\n\n return $this->render('ComDaufinBundle:Incident:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function createEntity($entityName = null);", "public function store(CreateIncidenceRequest $request)\n {\n $input = $request->all();\n\n $incidence = $this->incidenceRepository->create($input);\n\n Flash::success('Incidence saved successfully.');\n\n return redirect(route('incidences.index'));\n }", "public function create()\n {\n $this->sesClient->verifyEmailIdentity(\n [\n 'EmailAddress' => $this->identity->getIdentity(),\n ]\n );\n }", "public function create($service, $entity);", "abstract protected function createEntityInstance();", "public function createEntity()\n {\n $createdCompany = new Company();\n $createdCompany->setTitle('Test Company')\n ->setIco('11025848744')\n ->setDic('1258745968444')\n ->setStreet('Cesta 125')\n ->setZip('021478')\n ->setCity('Bratislava')\n ->setCountry('Slovenska Republika');\n\n $this->em->persist($createdCompany);\n $this->em->flush();\n\n return $createdCompany;\n }", "public function createEntity($name);", "private function createEntity()\n {\n $this->entity = $this->container->make($this->entity());\n }", "public static function create($entity)\n {\n return static::mapper()->create($entity);\n }", "public function createEntity($data = array());", "private function createRecord($entityName, array $data) {\n $response = $this->callRaynetcrmRestApi($entityName, self::HTTP_METHOD_PUT, $data);\n $body = Json::decode($response->getBody());\n\n if ($response->getStatusCode() === self::HTTP_CODE_CREATED) {\n return $body->data->id;\n } else {\n throw new RaynetGenericException(\n $body->translatedMessage ? $body->translatedMessage : $body->message,\n $response->getStatusCode()\n );\n }\n }", "public function create(array $entity)\n {\n \n }", "public function create($entityDict)\r\n {\r\n return $this->conn->insert($this, __FUNCTION__, $entityDict);\r\n }", "public function create()\n {\n $entityClassName = $this->getEntityClassName();\n return $entityClassName::create($this, null);\n }", "public function createAction(Request $request)\n {\n $entity = new Resident();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('resident_show', array('id' => $entity->getId())));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create(Request $request)\n {\n \t$leiNumber = $this->legalEntityGenerateUniqueService->generateUniqueLegalEntity();\n \t$version = $this->legalEntityGenerateUniqueService->defaultLegalEntityVersion();\n \n \t$data = ['lei' => $leiNumber,\n 'version' => $version,\n 'name' => $request->name,\n 'country_code' => $request->country,\n 'status' => $request->status\n \t]; \n \t$resourceObj = $this->legalEntityRepository->store($data);\n if($resourceObj){\n ProcessLegalEntityValidation::dispatch($resourceObj->id)->delay(now()->addSeconds(30));\n }\n return $resourceObj;\n }", "public function create($attributes): EntityIdInterface\n {\n return parent::create($attributes);\n }", "public function create($data = array()) { \r\n \tforeach(array_keys($data) as $name) {\r\n \t\t$this->_checkAttributesValue($data, $name);\r\n \t}\r\n \t\r\n \treturn $entity = new $this->_entityClass($this, $this->_getPrimary(), $data);\r\n }", "protected function createEntity($entityType, $values) {\n $entity = \\Drupal::entityManager()->getStorage($entityType)->create($values);\n $status = $entity->save();\n\n $this->assertEqual(\n $status,\n SAVED_NEW,\n SafeMarkup::format('Created %label entity %type.', [\n '%label' => $entity->getEntityType()->getLabel(),\n '%type' => $entity->id()]\n )\n );\n\n return $entity;\n }", "public function store(Request $request)\n {\n $data = $request->except(['employments', 'contacts', 'assessors', 'recruitments']);\n $enterprise = Enterprise::create($data);\n\n return response()->json([\n 'created'\t=> true,\n 'id' => $enterprise->ID,\n ]);\n }", "public function createAction()\n {\n $entity = new Customer();\n $request = $this->getRequest();\n $form = $this->createForm(new CustomerType(), $entity);\n\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('enterprise_show', array('id' => $entity->getId())));\n }\n\n return $this->render('EnterpriseBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }" ]
[ "0.6706735", "0.6457992", "0.6446366", "0.6385899", "0.6277113", "0.61486065", "0.5979126", "0.59275085", "0.5880445", "0.58601385", "0.5850204", "0.5766788", "0.56750894", "0.5626665", "0.5607427", "0.55651003", "0.5553112", "0.55517745", "0.5489903", "0.54832596", "0.5471144", "0.5407186", "0.5400533", "0.537982", "0.53782713", "0.5362724", "0.53362167", "0.5333813", "0.53268206", "0.53237695" ]
0.66564465
1
Creates a form to create a Incident entity.
private function createCreateForm(Incident $entity) { $form = $this->createForm(new IncidentType(), $entity, array( 'action' => $this->generateUrl('com_incident_create'), 'method' => 'POST', )); $form->add('submit', 'submit', array('label' => 'Créer','attr'=>array('class'=>'btn btn-success','style'=>'width:100px;'))); return $form; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function newAction()\n {\n $entity = new Incident();\n $form = $this->createCreateForm($entity);\n\n return $this->render('ComDaufinBundle:Incident:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function createAction(Request $request)\n {\n $entity = new Incident();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('com_incident_show', array('id' => $entity->getId())));\n }\n\n return $this->render('ComDaufinBundle:Incident:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "private function createCreateForm(Resident $entity)\n {\n $form = $this->createForm(new ResidentType(), $entity, array(\n 'action' => $this->generateUrl('resident_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createCreateForm(Incapacidad $entity)\n {\n $form = $this->createForm(new IncapacidadType(), $entity, array(\n 'action' => $this->generateUrl('admin_incapacidad_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Guardar','attr'=>\n array('class'=>'btn btn-primary btn-sm')\n ));\n\n return $form;\n }", "private function createCreateForm(SolMantenimientoIdentificacion $entity)\n {\n $form = $this->createForm(new SolMantenimientoIdentificacionType(), $entity, array(\n 'action' => $this->generateUrl('solmantenimientoidentificacion_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createCreateForm(Acc $entity)\n {\n $form = $this->createForm(new AccType(), $entity, array(\n 'action' => $this->generateUrl('acc_create'),\n 'method' => 'POST',\n ));\n\n //$form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createCreateForm(IntrestConfig $entity) {\n\t\t$form = $this->createForm(new IntrestConfigType(), $entity, array(\n\t\t\t'action' => $this->generateUrl('member_intrestconfig_create'),\n\t\t\t'method' => 'POST',\n\t\t));\n\n\t\t$form->add('submit', 'submit', array('label' => 'Create'));\n\n\t\treturn $form;\n\t}", "private function createCreateForm(Servicio $entity)\n {\n $securityContext = $this->container->get('security.context');\n $form = $this->createForm(new ServicioType($securityContext), $entity, array(\n 'action' => $this->generateUrl('administracion_servicio_create'),\n 'method' => 'POST',\n ));\n\n //$form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createCreateForm(Cosecha $entity)\n {\n $form = $this->createForm(new CosechaType(), $entity, array(\n 'action' => $this->generateUrl('cosecha_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createCreateForm(Invoice $entity)\n {\n $form = $this->createForm(new InvoiceType(), $entity, array(\n 'action' => $this->generateUrl('invoice_create'),\n 'method' => 'POST',\n ));\n\n // $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createCreateForm(Inspection $entity)\n {\n $form = $this->createForm(new InspectionType(), $entity, array(\n 'action' => $this->generateUrl('inspection_create'),\n 'method' => 'POST'\n ));\n\n $form->add('submit', 'submit', array('label' => 'Enregistrer','attr' => array('class'=>\"btn btn-default\"))); \n \n return $form;\n }", "private function createCreateForm(Cole $entity)\n {\n $form = $this->createForm(new ColeType(), $entity, array(\n 'action' => $this->generateUrl('cole_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createCreateForm(Endroit $entity)\n {\n $form = $this->createForm(new EndroitType(), $entity, array(\n 'action' => $this->generateUrl('endroit_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createCreateForm(SkIdentificationModule $entity)\n {\n $form = $this->createForm(new SkIdentificationModuleType(), $entity, array(\n 'action' => $this->generateUrl('identification_module_admin_create'),\n 'method' => 'POST',\n ));\n\n // $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createCreateForm(DevisSetup $entity)\n {\n $form = $this->createForm(new DevisSetupType(), $entity, array(\n 'action' => $this->generateUrl('devissetup_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "public function newAction()\n {\n $entity = new Servicio();\n $entity->setActivo(1);\n\n //Se carga una provincia por defecto\n $provincia = $this->getDoctrine()\n ->getRepository('sisconeeAppBundle:Provincia')\n ->find(2);\n //Se le establece la provincia por defecto al servicio (necesario para el funcionamiento de la programacion asociada\n //a los eventos PRE_SET_DATA y PRE_SUBMIT)\n //var_dump($provincia);\n $entity->setProvincia($provincia);\n\n $form = $this->createCreateForm($entity);\n\n return $this->render('sisconeeAdministracionBundle:Servicio:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('incidentes.create');\n }", "private function createCreateForm(EventRegistration $entity)\n {\n\n\n $flow = $this->get('pixeloid_app.flow.eventRegistration'); // must match the flow's service id\n $flow->bind($entity);\n\n\n // $reservation = new AccomodationReservation;\n // $entity->setReservation($reservation);\n\n\n $flow->setGenericFormOptions(array(\n 'action' => $this->generateUrl('eventregistration_create'),\n 'method' => 'POST',\n ));\n\n\n return $flow;\n }", "function createCompany() {\n\t\t\t\t\t$addForm = new h2o('views/addCompany.html');\n\t\t\t\t\techo $addForm->render();\n\t\t\t\t}", "private function createCreateForm(Client $entity) {\n $form = $this->createForm(new ClientType(), $entity, array(\n 'action' => $this->generateUrl('client_create'),\n 'method' => 'POST',\n ));\n\n return $form;\n }", "public function createAction()\n {\n $entity = new Customer();\n $request = $this->getRequest();\n $form = $this->createForm(new CustomerType(), $entity);\n\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('enterprise_show', array('id' => $entity->getId())));\n }\n\n return $this->render('EnterpriseBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "private function createCreateForm(Notice $entity)\n {\n $form = $this->createForm(new NoticeType(), $entity, array(\n 'action' => $this->generateUrl('_create'),\n 'method' => 'POST',\n ));\n $form->add('end', 'choice', [\n 'choices' => [\n '1 day' => '86400',\n '3 days' => '259200',\n '5 days' => '432000',\n '7 days' => '604800',\n '14 days' => '1209600',\n ],\n 'choices_as_values' => true,\n ]);\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "public function create()\n {\n return view('industry.form');\n }", "private function createCreateForm(Entreprise $entity)\n {\n $form = $this->createForm(new EntrepriseType(), $entity, array(\n 'action' => $this->generateUrl('ad_entreprise_create'),\n 'method' => 'POST',\n ));\n\n return $form;\n }", "private function createCreateForm(ClienteCredito $entity)\n {\n $form = $this->createForm(new ClienteCreditoType( $this->getDestinosCh() ), $entity, array(\n 'action' => $this->generateUrl('clientecredito_create'),\n 'method' => 'POST',\n ));\n\n //$form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createCreateForm(SkBusiness $entity) {\n $form = $this->createForm(new SkBusinessType(), $entity, array(\n 'action' => $this->generateUrl('business_admin_create'),\n 'method' => 'POST',\n ));\n\n// $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "public function createForm();", "public function createForm();", "private function createEditForm(Incident $entity)\n {\n $form = $this->createForm(new IncidentType(), $entity, array(\n 'action' => $this->generateUrl('com_incident_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Modifier','attr'=>array('class'=>'btn btn-warning','style'=>'width:100px;')));\n\n return $form;\n }", "private function createCreateForm(Intervalosips $entity)\n {\n $form = $this->createForm(new IntervalosipsType(), $entity, array(\n 'action' => $this->generateUrl('intervalosips_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Criar'));\n\n return $form;\n }" ]
[ "0.7192309", "0.68735206", "0.68468374", "0.6635487", "0.66038954", "0.65442777", "0.65247846", "0.6472963", "0.64462566", "0.6418852", "0.6418213", "0.63939124", "0.6363234", "0.6362272", "0.6343542", "0.6338978", "0.63089514", "0.6285326", "0.62333995", "0.6231594", "0.62127304", "0.6202248", "0.6191603", "0.61807257", "0.61793405", "0.6178248", "0.61762017", "0.61762017", "0.6165312", "0.6110974" ]
0.74190396
0
Displays a form to create a new Incident entity.
public function newAction() { $entity = new Incident(); $form = $this->createCreateForm($entity); return $this->render('ComDaufinBundle:Incident:new.html.twig', array( 'entity' => $entity, 'form' => $form->createView(), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function newAction()\n {\n $entity = new Customer();\n $form = $this->createForm(new CustomerType(), $entity);\n\n return $this->render('EnterpriseBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "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 createAction(Request $request)\n {\n $entity = new Incident();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('com_incident_show', array('id' => $entity->getId())));\n }\n\n return $this->render('ComDaufinBundle:Incident:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function createAction()\n {\n $entity = new Customer();\n $request = $this->getRequest();\n $form = $this->createForm(new CustomerType(), $entity);\n\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('enterprise_show', array('id' => $entity->getId())));\n }\n\n return $this->render('EnterpriseBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "public function create()\n {\n return view('incidentes.create');\n }", "public function newAction()\n {\n $entity = new Invoice();\n $form = $this->createCreateForm($entity);\n\n $invoiceLine = new InvoiceLine();\n $invoiceLineForm = $this->createForm(\n new InvoiceLineType($this->get('security.context')),\n $invoiceLine,\n array(\n 'action' => 'javascript:void(0);',\n 'method' => 'POST',\n )\n );\n $this->viewData['form'] = $form->createView();\n $this->viewData['entities'] = $entity;\n\n return $this->render('AcmeInvoiceBundle:Invoice:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'line_form' => $invoiceLineForm->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Servicio();\n $entity->setActivo(1);\n\n //Se carga una provincia por defecto\n $provincia = $this->getDoctrine()\n ->getRepository('sisconeeAppBundle:Provincia')\n ->find(2);\n //Se le establece la provincia por defecto al servicio (necesario para el funcionamiento de la programacion asociada\n //a los eventos PRE_SET_DATA y PRE_SUBMIT)\n //var_dump($provincia);\n $entity->setProvincia($provincia);\n\n $form = $this->createCreateForm($entity);\n\n return $this->render('sisconeeAdministracionBundle:Servicio:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new SolMantenimientoIdentificacion();\n $form = $this->createCreateForm($entity);\n\n return $this->render('WebBundle:SolMantenimientoIdentificacion:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\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 newAction()\n {\n \t$em \t\t= $this->getDoctrine()->getEntityManager();\n \t$entity \t= new Corporation();\n $form \t= $this->createForm(new CorporationType($em, $this->container), $entity, array('show_legend' => false));\n \n $category = $this->container->get('request')->query->get('category');\n $NoLayout = $this->container->get('request')->query->get('NoLayout');\n if(!$NoLayout)\t$template = \"new.html.twig\"; else \t$template = \"new.html.twig\"; \n \n if($category)\n \t$entity->setCategory($category); \n\n return $this->render(\"PiAppGedmoBundle:Corporation:$template\", array(\n 'entity' \t=> $entity,\n 'form' \t=> $form->createView(),\n 'NoLayout' => $NoLayout,\n 'category'\t=> $category,\n ));\n }", "private function createCreateForm(Incident $entity)\n {\n $form = $this->createForm(new IncidentType(), $entity, array(\n 'action' => $this->generateUrl('com_incident_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Créer','attr'=>array('class'=>'btn btn-success','style'=>'width:100px;')));\n\n return $form;\n }", "public function newAction()\n {\n $entity = new Entreprise();\n $form = $this->createCreateForm($entity);\n $erreur = \"\";\n\n return $this->render('KbhGestionCongesBundle:Admin\\Entreprise:new.html.twig', array(\n 'entity' => $entity,\n 'erreur' => $erreur,\n 'form' => $form->createView(),\n ));\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 newAction()\n {\n $this->view->org = new OrganizationForm();\n }", "public function newAction()\n {\n/* \t$numfields = $this->getDoctrine()\n \t->getRepository('HegesAppConfigBundle:Configlinetype')\n \t->find($fieldsnumber);\n */\n \t\n \t\n $entity = new Configline();\n $form = $this->createForm(new ConfiglineType(), $entity);\n\n return $this->render('HegesAppConfigFileBundle:Configline:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\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 $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 newAction()\n {\n if (!$this->get('security.context')->isGranted('ROLE_ADMIN') ) {\n return $this->redirect($this->generateUrl('error'), 302); \n } \n\n $entity = new Intervalosips();\n $form = $this->createCreateForm($entity);\n\n return $this->render('SytemSGBundle:Intervalosips:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Acc();\n $form = $this->createCreateForm($entity);\n\n return $this->render('FlyPlatformBundle:Acc:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('incidences.create');\n }", "public function create()\n {\n return view('industry.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 createAction()\n {\n $em \t\t= $this->getDoctrine()->getEntityManager();\n $locale\t\t= $this->container->get('session')->getLocale();\n \n $category = $this->container->get('request')->query->get('category');\n $NoLayout = $this->container->get('request')->query->get('NoLayout');\n if(!$NoLayout)\t$template = \"new.html.twig\"; else \t$template = \"new.html.twig\"; \n \n $entity \t= new Corporation();\n $request \t= $this->getRequest();\n $form \t= $this->createForm(new CorporationType($em, $this->container), $entity, array('show_legend' => false));\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $entity->setTranslatableLocale($locale);\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('admin_gedmo_corporation_show', array('id' => $entity->getId(), 'NoLayout' => $NoLayout, 'category' => $category)));\n \n }\n\n return $this->render(\"PiAppGedmoBundle:Corporation:$template\", array(\n 'entity' \t=> $entity,\n 'form' \t=> $form->createView(),\n 'NoLayout' => $NoLayout,\n 'category'\t=> $category,\n ));\n }", "public function create()\n {\n return \"Formulário para cadastrar um novo cliente.\";\n }", "public function newAction()\n {\n $entity = new Vaccines();\n $form = $this->createForm(new VaccinesType(), $entity);\n\n return $this->render('AcmeChildrenBundle:Vaccines:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\r\n {\r\n $entity = new Consulta();\r\n //Recuperación del paciente\r\n $request = $this->getRequest();\r\n $identidad= $request->get('identidad');\r\n $form = $this->createCreateForm($entity,1,$identidad);\r\n\r\n return array(\r\n 'entity' => $entity,\r\n 'form' => $form->createView(),\r\n );\r\n }", "public function newAction()\n {\n $entity = new Resident();\n $form = $this->createCreateForm($entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "function createCompany() {\n\t\t\t\t\t$addForm = new h2o('views/addCompany.html');\n\t\t\t\t\techo $addForm->render();\n\t\t\t\t}", "public function newAction()\n {\n $entity = new Encuesta();\n $form = $this->createCreateForm($entity);\n\n return $this->render('EncuestaBundle:Encuesta:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }" ]
[ "0.70455056", "0.7045127", "0.7003517", "0.69731975", "0.6914362", "0.68953305", "0.68729633", "0.681382", "0.6805253", "0.6802053", "0.67273897", "0.66950154", "0.6684786", "0.6684345", "0.66575485", "0.66535896", "0.6651636", "0.66473633", "0.66428775", "0.66112876", "0.6584669", "0.6580263", "0.6570392", "0.65697837", "0.65558267", "0.6555764", "0.6555622", "0.65489566", "0.65382814", "0.6534316" ]
0.82271135
0
Finds and displays a Incident entity.
public function showAction($id) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('ComDaufinBundle:Incident')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Incident entity.'); } $deleteForm = $this->createDeleteForm($id); return $this->render('ComDaufinBundle:Incident:show.html.twig', array( 'entity' => $entity, 'delete_form' => $deleteForm->createView(), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('ComDaufinBundle:Incident')->findAll();\n\n return $this->render('ComDaufinBundle:Incident:index.html.twig', array(\n 'entities' => $entities,\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 show(Ong $entity)\n {\n return $entity;\n }", "public function show(cr $cr)\n {\n //\n }", "public function show(cr $cr)\n {\n //\n }", "public function show(cr $cr)\n {\n //\n }", "public function show(cr $cr)\n {\n //\n }", "public function show(Incidencia $incidencia)\n {\n //\n }", "public function show(Incidencia $incidencia)\n {\n //\n }", "public function show(Incidencia $incidencia)\n {\n //\n }", "public function show(Incidencia $incidencia)\n {\n //\n }", "public function viewEntity($entity_id) {\n $account = $this->getAccount();\n return parent::viewEntity($account->uid);\n }", "public function show(Corporate $corporate)\n {\n //\n }", "public function show($id)\n {\n $incidente = Incidente::find($id);\n // select * from incidente where id = $id;\n\n return view('incidentes.show', compact('incidente'));\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('WebBundle:SolMantenimientoIdentificacion')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find SolMantenimientoIdentificacion entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('WebBundle:SolMantenimientoIdentificacion:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function showIncoherenceInFormAction() {\n $incoherenceRepository = $this->getDoctrine()->getRepository('CoreBundle:IncoherenceLog');\n $incoherences = $incoherenceRepository->findByUser($this->getUser());\n\n return $this->render('@Core/Social/incoherence.html.twig', array(\n 'incoherences' => $incoherences,\n ));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('ComDaufinBundle:Incident')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Incident entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('ComDaufinBundle:Incident:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Cause $entity)\n {\n return $entity;\n }", "public function show(Incident $incident)\n {\n return new IncidentResource($incident);\n }", "public function newAction()\n {\n $entity = new Incident();\n $form = $this->createCreateForm($entity);\n\n return $this->render('ComDaufinBundle:Incident:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function showAction()\n {\n $myCompany = $this->get('mycompany')->getOrCreateDefaultMyCompany();\n\n return $this->render('mycompany/show.html.twig', array('mycompany' => $myCompany,));\n }", "public function show(EvidentionStatus $evidentionStatus)\n {\n //\n }", "public function viewCampaignInvoiceAction()\n {\n $id = $this->request->query->get('id');\n $easyadmin = $this->request->attributes->get('easyadmin');\n $entity = $easyadmin['item'];\n\n return $this->render('easy_admin/Campaign/viewInvoice.html.twig', array(\n 'entity' => $entity\n ));\n }", "protected function displayEntities()\n {\n $enities = $this->_proxyObject->getEntities();\n echo \"<br><br><table align=\\\"center\\\" style=\\\"font-family: Calibri; \"\n . \"width: 95%\\\">\";\n echo \"<tr><td align=\\\"center\\\" style=\\\"font-family: Calibri; \"\n . \"background-color: #97CC00\\\">Entities</td></tr>\";\n foreach ($enities as $entity)\n {\n echo \"<tr ><td style=\\\"font-family: Calibri; \"\n . \"background-color: #99CCFF\\\" border=\\\"1\\\">\";\n echo \"<a href=\\\"\" . $this->_containerScriptName . \"?query=\"\n . $entity\n . '&pagingAllowed=true'\n . \"&serviceUri=\"\n . $this->_uri\n . \"\\\">\"\n . $entity . \"</a>\";\n echo \"</td></tr>\";\n }\n echo \"</table><br><br>\";\n }", "public function showAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $actualite = $em->getRepository('MyAppEspritBundle:Actualite')->findAll();\n\n return $this->render('MyAppEspritBundle:Actualite:show.html.twig', array(\n 'actualite' => $actualite,\n ));\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('AcmeInvoiceBundle:Invoice')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Invoice entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('AcmeInvoiceBundle:Invoice:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Attendence $attendence)\n {\n //\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CorresponsaliaBundle:Estadofondo')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Estadofondo entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CorresponsaliaBundle:Estadofondo:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(), ));\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('EnterpriseBundle:Customer')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el cliente solicitado');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('EnterpriseBundle:Default:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('WebBundle:SolMantenimientoIdentificacion')->findOrden();\n\n return $this->render('WebBundle:SolMantenimientoIdentificacion:index.html.twig', array(\n 'entities' => $entities,\n ));\n }" ]
[ "0.616971", "0.59756875", "0.5934177", "0.58935094", "0.58935094", "0.58935094", "0.58935094", "0.584898", "0.584898", "0.584898", "0.584898", "0.58170164", "0.5796828", "0.5766367", "0.5760096", "0.57500017", "0.5737531", "0.572718", "0.56909657", "0.56738275", "0.56692946", "0.563424", "0.561939", "0.5618902", "0.5577329", "0.55715346", "0.55620164", "0.55574024", "0.5545755", "0.5534951" ]
0.6801066
0
Displays a form to edit an existing Incident entity.
public function editAction($id) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('ComDaufinBundle:Incident')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Incident entity.'); } $editForm = $this->createEditForm($entity); $deleteForm = $this->createDeleteForm($id); return $this->render('ComDaufinBundle:Incident:edit.html.twig', array( 'entity' => $entity, 'edit_form' => $editForm->createView(), 'delete_form' => $deleteForm->createView(), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('AcmeInvoiceBundle:Invoice')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Invoice entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('AcmeInvoiceBundle:Invoice: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 $incidente = Incidente::find($id);\n\n return view('incidentes.edit', compact('incidente'));\n }", "public function edit(Entity $entity)\n {\n $entity->typeCompanyPreview = self::previewTypeCompany($entity->type_company);\n\n\n return view('entity.edit', compact('entity'));\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 editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('EnterpriseBundle:Customer')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el cliente solicitado');\n }\n\n $editForm = $this->createForm(new CustomerType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('EnterpriseBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editAction()\r\n {\r\n \r\n $id= $this->container->get('security.context')->getToken()->getUser()->getId();\r\n $em = $this->getDoctrine()->getManager();\r\n $entity = $em->getRepository('UtilisateurBundle:Utilisateur')->find($id);\r\n \r\n if (!$entity) {\r\n throw $this->createNotFoundException('Unable to find Utilisateur entity.');\r\n }\r\n\r\n $editForm = $this->createEditForm($entity);\r\n $deleteForm = $this->createDeleteForm($id);\r\n\r\n return $this->render('UtilisateurBundle:Default:info.html.twig', array(\r\n 'entity' => $entity,\r\n 'edit_form' => $editForm->createView(),\r\n 'delete_form' => $deleteForm->createView(),\r\n ));\r\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('SiseCoreBundle:PersonnelPersonnel')->find($id);\n $formpers = $this->container->get('form.factory')->createBuilder(new NomenclatureSoussituationadministrativeType())->getForm();\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find PersonnelPersonnel entity.');\n }\n $editForm = $this->createEditForm($entity);\n // $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('SiseCoreBundle:PersonnelPersonnel:edit.html.twig', array(\n 'entity' => $entity,\n 'code' => $id,\n 'edit_form' => $editForm->createView(),\n // 'delete_form' => $deleteForm->createView(),\n 'formpers' => $formpers->createView(),\n ));\n }", "public function edit(Corporate $corporate)\n {\n //\n }", "public function companyedit() {\r\n $company = $this->model->getCompany($_GET['id']);\r\n $contragentTypes = $this->model->getContragentTypes();\r\n\r\n return $this->view('company/companyedit', array('company' => $company, 'contragentType' => $contragentTypes));\r\n }", "function showApprentice() {\n\t\t\t\t\t$apprentice = Apprentice::find_by_name(params(0));\n\t\t\t\t\t\n\t\t\t\t\t$editForm = new h2o('views/editApprentice.html');\n\t\t\t\t\techo $editForm->render(compact('apprentice'));\n\t\t\t\t}", "public function edit(Incidencia $incidencia)\n {\n //\n }", "public function edit(Incidencia $incidencia)\n {\n //\n }", "public function editAction($id)\n {\n \n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CorresponsaliaBundle:Estadofondo')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Estadofondo entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CorresponsaliaBundle:Estadofondo:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('SiteSavalizeBundle:Company')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Company entity.');\n }\n\n $editForm = $this->createForm(new CompanyType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('SiteSavalizeBundle:Company:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit(incidencia $incidencia)\n {\n //\n }", "public function editAction($id)\n {\n\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('sisconeeAppBundle:Servicio')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Servicio entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('sisconeeAdministracionBundle:Servicio:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('HospiceSiteBundle:Event')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Event entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('HospiceSiteBundle:Event:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editAction() {\n $entities = $this\n ->_getRepository()\n ->findAllOrdered();\n $entities = $this->_transformAllConfigEntities($entities);\n $form = $this->createForm(new ConfigType(), array(\n 'configentities' => $entities,\n ));\n\n return array(\n 'form' => $form->createView(),\n );\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function editAction() {\n $id = $this->getInput('id');\n $info = Client_Service_Ad::getAd(intval($id));\n \n $this->assign('ad_type', self::AD_TYPE);\n $this->assign('ad_ptypes', $this->ad_ptypes);\n $this->assign('info', $info);\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}", "private function createEditForm(Incident $entity)\n {\n $form = $this->createForm(new IncidentType(), $entity, array(\n 'action' => $this->generateUrl('com_incident_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Modifier','attr'=>array('class'=>'btn btn-warning','style'=>'width:100px;')));\n\n return $form;\n }", "public function edit($id)\n {\n $industry = Industry::find($id);\n return view('industry.edit-form', ['industry'=>$industry]);\n }", "public function editAction() {\r\n\t\t$id = $this->getInput('id');\r\n\t\t$info = Gou_Service_Notice::getNotice(intval($id));\r\n\t\t$this->assign('info', $info);\r\n\t\t$this->assign('channels', $this->channels);\r\n\t}", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function edit(Normativa $normativa)\n {\n //\n }", "public function editAction($id)\n {\n if (!$this->get('security.context')->isGranted('ROLE_ADMIN')) {\n return $this->redirect($this->generateUrl('error'), 302); \n }\n\n\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('SytemSGBundle:Intervalosips')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Intervalos Ips entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('SytemSGBundle:Intervalosips:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Browser_Service_Recsite::getRecsite(intval($id));\t\t\n\t\t$this->assign('info', $info);\n\t\t$this->assign('models', $this->models);\n\t\t$this->assign('types', $this->types);\n\t}" ]
[ "0.6804953", "0.6797847", "0.6790573", "0.67861074", "0.67824024", "0.6764167", "0.6758988", "0.67570597", "0.6756569", "0.6752052", "0.67458874", "0.67458874", "0.6735235", "0.6734836", "0.67290646", "0.6704641", "0.6695267", "0.666571", "0.6652674", "0.6652674", "0.6647207", "0.66422987", "0.66360956", "0.6622499", "0.6606057", "0.65981746", "0.65903926", "0.6576666", "0.65734476", "0.6565011" ]
0.76934713
0
Creates a form to edit a Incident entity.
private function createEditForm(Incident $entity) { $form = $this->createForm(new IncidentType(), $entity, array( 'action' => $this->generateUrl('com_incident_update', array('id' => $entity->getId())), 'method' => 'PUT', )); $form->add('submit', 'submit', array('label' => 'Modifier','attr'=>array('class'=>'btn btn-warning','style'=>'width:100px;'))); return $form; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function createEditForm(Resident $entity)\n {\n $form = $this->createForm(new ResidentType(), $entity, array(\n 'action' => $this->generateUrl('resident_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Hospital $entity)\n {\n $form = $this->createForm(new HospitalType(), $entity);\n\n $form->add('submit', 'submit', array('label' => 'Изменить', 'attr' => array('class' => 'btn btn-default btn-lg btn-block')));\n\n return $form;\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('ComDaufinBundle:Incident')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Incident entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('ComDaufinBundle:Incident:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "private function createEditForm(Incapacidad $entity)\n {\n $form = $this->createForm(new IncapacidadType(), $entity, array(\n 'action' => $this->generateUrl('admin_incapacidad_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Modificar','attr'=>\n array('class'=>'btn btn-primary btn-sm')\n ));\n\n return $form;\n }", "private function createEditForm(IntrestConfig $entity) {\n\t\t$form = $this->createForm(new IntrestConfigType(), $entity, array(\n\t\t\t'action' => $this->generateUrl('member_intrestconfig_update', array('id' => $entity->getId())),\n\t\t\t'method' => 'PUT',\n\t\t));\n\n\t\t$form->add('submit', 'submit', array('label' => 'Update'));\n\n\t\treturn $form;\n\t}", "private function createEditForm(SolMantenimientoIdentificacion $entity)\n {\n $form = $this->createForm(new SolMantenimientoType(), $entity, array(\n 'action' => $this->generateUrl('solmantenimientoidentificacion_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Actualizar', 'attr'=>array('class'=>'btn btn-primary btn-lg btn-block')));\n\n return $form;\n }", "private function createEditForm(Cosecha $entity)\n {\n $form = $this->createForm(new CosechaType(), $entity, array(\n 'action' => $this->generateUrl('cosecha_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Cole $entity)\n {\n $form = $this->createForm(new ColeType(), $entity, array(\n 'action' => $this->generateUrl('cole_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\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(Servicio $entity)\n {\n $securityContext = $this->container->get('security.context');\n $form = $this->createForm(new ServicioType($securityContext), $entity, array(\n 'action' => $this->generateUrl('administracion_servicio_update', array('id' => $entity->getId())),\n 'method' => 'POST',\n ));\n\n //$form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Endroit $entity)\n {\n $form = $this->createForm(new EndroitType(), $entity, array(\n 'action' => $this->generateUrl('endroit_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Inspection $entity)\n {\n $form = $this->createForm(new InspectionType(), $entity, array(\n 'action' => $this->generateUrl('inspection_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Modifier','attr' => array('class' => 'btn btn-default'))); \n\n return $form;\n }", "private function createEditForm(Acc $entity)\n {\n $form = $this->createForm(new AccType(), $entity, array(\n 'action' => $this->generateUrl('acc_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(DevisSetup $entity)\n {\n $form = $this->createForm(new DevisSetupType(), $entity, array(\n 'action' => $this->generateUrl('devissetup_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Estadofondo $entity)\n {\n $form = $this->createForm(new EstadofondoType(), $entity, array(\n 'action' => $this->generateUrl('estadofondo_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Invoice $entity)\n {\n $form = $this->createForm(new InvoiceType(), $entity, array(\n 'action' => $this->generateUrl('invoice_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(SkIdentificationModule $entity)\n {\n $form = $this->createForm(new SkIdentificationModuleType(), $entity, array(\n 'action' => $this->generateUrl('identification_module_admin_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n // $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "public function edit(enquiryForm $enquiryForm)\n {\n //\n }", "private function createEditForm(SkSpecies $entity) {\n $em = $this->getDoctrine()->getManager();\n\n // Get criterias from species\n $criteria_ids = $em->getRepository('SkaphandrusAppBundle:SkIdentificationCriteria')->getCriteriasFromSpecies($entity->getId());\n\n\n\n $form = $this->createForm(new SkIdentificationSpeciesType(), $entity, array(\n 'action' => $this->generateUrl('identification_species_admin_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n 'criterias' => $criteria_ids\n ));\n return $form;\n }", "private function createEditForm(SkBusiness $entity) {\n $form = $this->createForm(new SkBusinessType(), $entity, array(\n 'action' => $this->generateUrl('business_admin_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n// $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Sucursal $entity)\n {\n $form = $this->createForm(new SucursalType(), $entity, array(\n 'action' => $this->generateUrl('sucursal_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(PeriodoDeInscricao $entity)\n {\n $form = $this->createForm(new PeriodoDeInscricaoType(), $entity, array(\n 'action' => $this->generateUrl('periododeinscricao_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Entreprise $entity)\n {\n $form = $this->createForm(new EntrepriseType(), $entity, array(\n 'action' => $this->generateUrl('ad_entreprise_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n return $form;\n }", "private function createEditForm(Client $entity) {\n $form = $this->createForm(new ClientType(), $entity, array(\n 'action' => $this->generateUrl('client_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n return $form;\n }", "private function createEditForm(ClienteCredito $entity)\n {\n $form = $this->createForm(new ClienteCreditoType( $this->getDestinosCh() ), $entity, array(\n 'action' => $this->generateUrl('clientecredito_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n //$form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Examen $entity)\n {\n $form = $this->createForm(new ExamenType(), $entity, array(\n 'action' => $this->generateUrl('examen_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(EnvaseIngreso $entity)\n {\n $form = $this->createForm(new EnvaseIngresoType(), $entity, array(\n 'action' => $this->generateUrl('envase_ingreso_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Guardar', 'attr' => array('class' => \"btn btn-success\")));\n\n return $form;\n }", "private function createEditForm(Customers $entity) {\n $form = $this->createForm(new CustomersType(), $entity, array(\n 'action' => $this->generateUrl('customers_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', SubmitType::class, array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Cidades $entity)\n {\n $form = $this->createForm(new CidadesType(), $entity, array(\n 'action' => $this->generateUrl('cidades_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "public function newAction()\n {\n $entity = new Incident();\n $form = $this->createCreateForm($entity);\n\n return $this->render('ComDaufinBundle:Incident:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }" ]
[ "0.7342424", "0.6961575", "0.6939798", "0.69292074", "0.68942547", "0.6856624", "0.68178684", "0.679424", "0.6787024", "0.67820334", "0.6758182", "0.67476124", "0.6735985", "0.6683128", "0.6670898", "0.66447186", "0.6642921", "0.66244024", "0.6619014", "0.6599569", "0.6597531", "0.6578096", "0.65621555", "0.6547592", "0.65354854", "0.64820135", "0.64756304", "0.6474595", "0.6456525", "0.6444583" ]
0.7549447
0
Edits an existing Incident entity.
public function updateAction(Request $request, $id) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('ComDaufinBundle:Incident')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Incident entity.'); } $deleteForm = $this->createDeleteForm($id); $editForm = $this->createEditForm($entity); $editForm->handleRequest($request); if ($editForm->isValid()) { $em->flush(); return $this->redirect($this->generateUrl('com_incident_edit', array('id' => $id))); } return $this->render('ComDaufinBundle:Incident:edit.html.twig', array( 'entity' => $entity, 'edit_form' => $editForm->createView(), 'delete_form' => $deleteForm->createView(), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('ComDaufinBundle:Incident')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Incident entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('ComDaufinBundle:Incident:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit(incidencia $incidencia)\n {\n //\n }", "public function edit(Incidencia $incidencia)\n {\n //\n }", "public function edit(Incidencia $incidencia)\n {\n //\n }", "public function update(Request $request, Incident $incident)\n {\n $log = new Log;\n $log->owner = $request->owner;\n $log->device_id = $request->device_id;\n $log->description = $request->description;\n $log->resolved = $request->resolved;\n\n $incident->title = $request->title;\n $incident->update();\n $incident->logs()->update($log->toArray());\n \n return new IncidentResource($incident);\n }", "public function update(Request $request, Incidencia $incidencia)\n {\n //\n }", "public function update(Request $request, Incidencia $incidencia)\n {\n //\n }", "public function edit(Corporate $corporate)\n {\n //\n }", "public function edit(Attendence $attendence)\n {\n //\n }", "public function edit(Insurance $insurance)\n {\n //\n }", "public function update(Request $request, $id)\n {\n \n $industry = Industry::find($id); \n\n $industry->country = $request->country; \n $industry->postal_code = $request->postal_code; \n $industry->industry = $request->industry; \n \n $industry->save();\n }", "public function update($entity);", "public function update($entity);", "public function edit(Inventario $inventario)\n {\n //\n }", "public function update($entity){ \n //TODO: Implement update record.\n }", "public function edit(Income $income)\n {\n //\n }", "function update(IContract $entity);", "public function updateEntity($entityId, $request)\n {\n return $this->start()->uri(\"/api/entity\")\n ->urlSegment($entityId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->put()\n ->go();\n }", "public function edit(ContinuousAssessment $continuousAssessment)\n {\n //\n }", "public function edit(InvoicesDetails $invoicesDetails)\n {\n //\n }", "public function edit(Suitcase $suitcase)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }" ]
[ "0.6319217", "0.63158965", "0.627774", "0.627774", "0.6185913", "0.61171865", "0.61171865", "0.6106951", "0.60550815", "0.59439", "0.59278923", "0.5907007", "0.5907007", "0.5906806", "0.5882417", "0.5877427", "0.58710736", "0.5850906", "0.58480793", "0.58137566", "0.57866013", "0.5780228", "0.5780228", "0.5780228", "0.5780228", "0.5780228", "0.5780228", "0.5780228", "0.5780228", "0.5780228" ]
0.66009545
0
Creates a form to delete a Incident entity by id.
private function createDeleteForm($id) { return $this->createFormBuilder() ->setAction($this->generateUrl('com_incident_delete', array('id' => $id))) ->setMethod('DELETE') ->add('submit', 'submit', array('label' => 'Supprimer','attr'=>array('class'=>'btn btn-danger','style'=>'width:100px;'))) ->getForm() ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('resident_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "public function createDeleteForm($id){\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('rsp_delete',array('id'=>$id)))\n ->setMethod('DELETE')\n ->add('submit','submit',array('label'=>'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tipuscentre_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('personnelpersonnel_delete', array('id' => $id)))\n ->setMethod('DELETE')\n // ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('solmantenimientoidentificacion_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Borrar','attr'=>array('class'=>'btn btn-danger btn btn-danger btn-lg btn-block')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('endroit_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('entreprise_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('administracion_servicio_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('clientecredito_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('envase_ingreso_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder(null, array('attr' => array( 'id' => 'pts_del')))\n ->setAction($this->generateUrl('morus_accetic_inventory_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => $this->get('translator')->trans('btn.delete')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('invoice_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('energy_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('client_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('eventregistration_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('caracteristicasequipo_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar','attr' => array('class' => 'btn btn-danger')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('customers_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', SubmitType::class, array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function genDeleteForm($id)\n {\n return $this->createFormBuilder(null, array('attr' => array( 'id' => 'ct_del_form', 'style' => 'display:none')))\n ->setAction($this->generateUrl('morus_fas_contacts_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => $this->get('translator')->trans('btn.delete')))\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tecnoequipo_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'ELIMINAR'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id){\n\t\treturn $this->createFormBuilder()\n\t\t\t->setAction($this->generateUrl('reserva_delete', array('id' => $id)))\n\t\t\t->setMethod('DELETE')\n\t\t\t->add('submit', 'submit', array('label' => 'Eliminar Reserva', 'attr' => array('class'=>'btn btn-danger btn-block')))\n\t\t\t->getForm()\n\t\t;\n\t}", "private function createDeleteForm($id) {\n\t\treturn $this->createFormBuilder()\n\t\t\t->setAction($this->generateUrl('member_intrestconfig_delete', array('id' => $id)))\n\t\t\t->setMethod('DELETE')\n\t\t\t->add('submit', 'submit', array('label' => 'Delete'))\n\t\t\t->getForm()\n\t\t;\n\t}", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('intervalosips_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_missatges_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('sucursal_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id,$idcupo)\n {\n\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('liquidaciones_delete', array('id' => $id,'idcupo'=>$idcupo)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete','attr' => array('class' => 'form-control')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('expense_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => '削除', 'attr' => array('class' => 'btn-danger')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_sesionventatratamiento_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('sales_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', SubmitType::class, array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('invoice_accountentry_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm1($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('calendarcategories_delete', array('id' => $id)))\n ->setMethod('DELETE')\n /* ->add('submit', 'submit', array('label' => 'Delete')) */\n ->getForm()\n ;\n }" ]
[ "0.74156785", "0.72755706", "0.7257462", "0.7250423", "0.7204331", "0.7203511", "0.7182645", "0.7179833", "0.71696275", "0.71631914", "0.71582997", "0.71538776", "0.7147314", "0.7133575", "0.7127885", "0.7127556", "0.711653", "0.7115973", "0.7111385", "0.71107155", "0.7107131", "0.71063673", "0.7103756", "0.7103319", "0.7099287", "0.70988816", "0.7089436", "0.70801306", "0.7078813", "0.7068459" ]
0.75169045
0
Test dispatch and notifier supports event
public function testDispatchWithNotifierSupportEvent() { $event = new EventTested(); $this->eventDispatcher->expects($this->once()) ->method('dispatch') ->with('foo', $event) ->will($this->returnValue($event)); $this->notifier->expects($this->once()) ->method('supportsObject') ->with($event, 'foo') ->will($this->returnValue(true)); $this->notifier->expects($this->once()) ->method('notify') ->with($event, 'foo'); $this->notifierProxy->dispatch('foo', $event); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_event_notification()\n {\n $this->event_notification_helper('event_method', true);\n }", "public function testDispatchEvents()\n {\n $this->uut->dispatch($this->buildRequest('/default'));\n\n $this->assertArrayHasKey(OnPreDispatch::class, self::$lastEvents);\n $this->assertArrayHasKey(OnPostRoute::class, self::$lastEvents);\n $this->assertArrayHasKey(OnPostDispatch::class, self::$lastEvents);\n }", "public function testEventCallBackPatch()\n {\n }", "public function testFireEventWithInternalFiredEvent()\n {\n $eventManager = new EventManager;\n $event = 'foor.bar';\n $eventManager->listen(EventManager::FIRED, function ($newEvent) use ($event) {\n $this->assertEquals($newEvent, $event);\n });\n $eventManager->fire($event);\n }", "public function testDispatchWithNotifierNotSupportEvent()\n {\n $event = new EventTested();\n\n $this->eventDispatcher->expects($this->once())\n ->method('dispatch')\n ->with('foo', $event)\n ->will($this->returnValue($event));\n\n $this->notifier->expects($this->once())\n ->method('supportsObject')\n ->with($event, 'foo')\n ->will($this->returnValue(false));\n\n $this->notifier->expects($this->never())\n ->method('notify');\n\n $this->notifierProxy->dispatch('foo', $event);\n }", "public function testEvent()\n {\n $dispatcher = new Events();\n $this->app->bind(DispatcherInterface::class, function() use ($dispatcher) {\n return $dispatcher;\n });\n $response = (new Command())->testEvent(new Event());\n $event = array_shift($response);\n\n $this->assertSame(Event::class, $event['name'], 'The event that should have been dispatched should match the event passed to event().');\n $this->assertFalse($event['halt'], 'The event should not halt when dispatched from event().');\n }", "public function testGetEvents()\n {\n }", "public function testEventCallBackCreate()\n {\n }", "public function testGetEvent()\n {\n }", "public function dispatchEvent($event);", "public function testEventCallBackGet()\n {\n }", "public function testGetEventDispatcher()\n {\n $redis = $this->factory->getRedis();\n $dispatcher = new EventDispatcher();\n $factory = new Factory($redis, $dispatcher);\n\n $this->assertTrue($factory->getEventDispatcher() instanceof EventDispatcherInterface);\n }", "public function getEventDispatch();", "public function testDispatchWithEventNameIsDisabledForNotify()\n {\n $event = new EventTested();\n\n $this->eventDispatcher->expects($this->once())\n ->method('dispatch')\n ->with('disable_event', $event);\n\n $this->notifier->expects($this->never())\n ->method('supportsObject')\n ->with($event, 'foo');\n\n $this->notifier->expects($this->never())\n ->method('notify');\n\n $this->notifierProxy->dispatch('disable_event', $event);\n }", "public function testEventCallBackGetItem()\n {\n }", "public function doSomeAction(TestEvent $event) {\n drupal_set_message(\"The Example Event has been subscribed, which has bee dispatched on submit of the form with \" . $event->getReferenceID() . \" as Reference\");\n }", "public function testGetEvents()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testGetEventDispatcher()\n {\n $transport = new Transport();\n $this->assertInstanceOf(EventDispatcher::class, $transport->getEventDispatcher());\n }", "public function testFireEventWithClass()\n {\n $eventManager = new EventManager;\n $secret = '1234';\n $eventManager->listen('secret', 'Underlay\\Tests\\Events\\Test@call', function (\n $receivedSecret\n )\n use (\n $secret\n ) {\n $this->assertEquals($secret, $receivedSecret);\n });\n $eventManager->fire('secret', $secret);\n }", "public function testOrgApacheSlingEventImplEventingThreadPool()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/org.apache.sling.event.impl.EventingThreadPool';\n\n $crawler = $client->request('POST', $path);\n }", "public function test_dispatching_closure()\n {\n $function = function () {\n return true;\n };\n $result = $this->dispatcher->dispatch($function);\n $this->assertTrue($result);\n }", "public function onEvent();", "public function testEmittedEventName()\n {\n $expected = array(\n 'request.before_send' => 'onBeforeSend'\n );\n $this->assertEquals($expected, DaWandaPlugin::getSubscribedEvents());\n }", "public function testGetWebhookEvents()\n {\n }", "public function event(): EventDispatcherInterface;", "public function testTriggerEventCallsCallbackWithArguments()\n\t{\n\t\t$mock = $this->getMock('Mock_Callback', array('call_me'));\n\n\t\t$mock->expects($this->once())\n\t\t\t\t->method('call_me')\n\t\t\t\t// Have a look in PHPUnit_Framework_Assert for more\n\t\t\t\t->with($this->equalTo('random.pre_forge'), $this->isInstanceOf('Dispatcher_Event'));\n\n\n\n\t\t$mock2 = $this->getMock('Mock_Callback', array('maybe'));\n\n\t\t$mock2->expects($this->once())\n\t\t\t\t->method('maybe')\n\t\t\t\t// Have a look in PHPUnit_Framework_Assert for more\n\t\t\t\t->with($this->equalTo('random.pre_forge'), $this->isInstanceOf('Dispatcher_Event'));\n\n\t\t$dispatcher = new Dispatcher();\n\n\t\t$dispatcher->register_listener('random.pre_forge', array($mock, 'call_me'));\n\t\t$dispatcher->register_listener('random.pre_forge', array($mock2, 'maybe'));\n\n\t\t$dispatcher->trigger_event('random.pre_forge', Dispatcher::event(array('random' => 42)));\n\t}", "public function testEventCallBackGetMacros()\n {\n }", "public function testEventReturnsAValidInstanceOfDispatcherEvent()\n\t{\n\t\t$args = array('my' => 'arguments');\n\t\t$event = Dispatcher::event($args, TRUE);\n\n\t\t$this->assertType('Dispatcher_Event', $event);\n\t}", "public function testEventWithClosure()\n {\n $eventManager = new EventManager;\n $secret = '1234';\n $eventManager->listen('secret', function ($newSecret) use ($secret) {\n $this->assertEquals($newSecret, $secret);\n });\n $eventManager->fire('secret', $secret);\n }", "public function testEventCallBackDelete()\n {\n }" ]
[ "0.7251876", "0.6926086", "0.68950593", "0.68823737", "0.6845733", "0.67082274", "0.65592337", "0.6544384", "0.65202934", "0.64910245", "0.6483528", "0.6480512", "0.64468634", "0.6420582", "0.6403316", "0.6342289", "0.6320253", "0.621622", "0.617445", "0.6100438", "0.6085242", "0.6084543", "0.60653037", "0.60567397", "0.605644", "0.602644", "0.59754825", "0.59193623", "0.5917199", "0.58968276" ]
0.7587493
0
Test dispatch and event name in disabled list
public function testDispatchWithEventNameIsDisabledForNotify() { $event = new EventTested(); $this->eventDispatcher->expects($this->once()) ->method('dispatch') ->with('disable_event', $event); $this->notifier->expects($this->never()) ->method('supportsObject') ->with($event, 'foo'); $this->notifier->expects($this->never()) ->method('notify'); $this->notifierProxy->dispatch('disable_event', $event); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function checkDisableFunctions() {}", "final public function allowsEvents() {\n\t\treturn false;\n\t}", "protected function getDisableActions() {}", "function isEnabled($name);", "public function testDispatchEvents()\n {\n $this->uut->dispatch($this->buildRequest('/default'));\n\n $this->assertArrayHasKey(OnPreDispatch::class, self::$lastEvents);\n $this->assertArrayHasKey(OnPostRoute::class, self::$lastEvents);\n $this->assertArrayHasKey(OnPostDispatch::class, self::$lastEvents);\n }", "public function testEmittedEventName()\n {\n $expected = array(\n 'request.before_send' => 'onBeforeSend'\n );\n $this->assertEquals($expected, DaWandaPlugin::getSubscribedEvents());\n }", "public function testEventCallBackGetMacros()\n {\n }", "public function testGetEvents()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function executeDisabled()\n {\n }", "public function getEventDispatch();", "protected static function allowedEvents()\n\t{\n\t\treturn array();\n\t}", "public function shouldntRaiseAnEvent()\n {\n }", "public function testDispatchWithNotifierNotSupportEvent()\n {\n $event = new EventTested();\n\n $this->eventDispatcher->expects($this->once())\n ->method('dispatch')\n ->with('foo', $event)\n ->will($this->returnValue($event));\n\n $this->notifier->expects($this->once())\n ->method('supportsObject')\n ->with($event, 'foo')\n ->will($this->returnValue(false));\n\n $this->notifier->expects($this->never())\n ->method('notify');\n\n $this->notifierProxy->dispatch('foo', $event);\n }", "public function testOrgApacheSlingEventImplEventingThreadPool()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/org.apache.sling.event.impl.EventingThreadPool';\n\n $crawler = $client->request('POST', $path);\n }", "private function _callEvent($eventName){\n\t\tif(self::$_disableEvents==false){\n\t\t\tif(method_exists($this, $eventName)){\n\t\t\t\tif($this->{$eventName}()===false){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(isset($this->{$eventName})){\n\t\t\t\t\t$method = $this->{$eventName};\n\t\t\t\t\tif($this->$method()===false){\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public function disable(int $events): bool {}", "function GetExcludedEvents();", "abstract public function getEventName();", "public function testGetEvents()\n {\n }", "public function testGetEvent()\n {\n }", "abstract function HookEvents();", "protected static function allowedEvents()\n\t{\n\t\treturn array(\n\t\t\t\t\t\t'onclick',\n\t\t\t\t\t\t'ondblclick',\n\t\t\t\t\t\t'onmousedown',\n\t\t\t\t\t\t'onmouseup',\n\t\t\t\t\t\t'onmouseover',\n\t\t\t\t\t\t'onmousemove',\n\t\t\t\t\t\t'onmouseout',\n\t\t\t\t\t\t'onkeypress',\n\t\t\t\t\t\t'onkeydown',\n\t\t\t\t\t\t'onkeyup'\n\t\t\t\t\t);\n\t}", "public function disabled();", "public function disabled();", "public function testDisabled() {\n Data::setOption('safe', 'MarkSafe() > value');\n\n $listener = new PatternLabListener();\n $listener->processSafeData();\n\n $safe = Data::getOption('safe');\n $this->assertSame('MarkSafe() > value', $safe);\n }", "public function isDisabledFunction($name) {\n static $disabledFunctions;\n if (!$disabledFunctions) {\n $disabledFunctions = ini_get('disable_functions');\n $delimiter = strpos($disabledFunctions, ',') !== false ? ',' : ' ';\n $disabledFunctions = explode($delimiter, $disabledFunctions);\n $disabledFunctions = array_map('trim', $disabledFunctions);\n }\n\n return in_array($name, $disabledFunctions);\n }", "public function testDisableTriggersWhenEnabledConfigNotChanged()\n {\n $this->setupPhp5();\n\n $fixtures = [\n 'update_klevuproductsync_for_cpip',\n 'update_klevuproductsync_for_lsa',\n 'update_klevuproductsync_for_cpp',\n ];\n\n /** @var RequestProxy $request */\n $request = $this->getRequest();\n $request->setParam('section', 'klevu_search');\n $request->setMethod('POST');\n $request->setPostValue([\n 'groups' => [\n 'developer' => [\n 'fields' => [\n 'trigger_options_info' => [\n 'value' => 0,\n ],\n ],\n ],\n ],\n ]);\n\n $this->dispatch($this->getAdminFrontName() . '/admin/system_config/save');\n $response = $this->getResponse();\n\n $this->assertTrue($response->isRedirect(), 'Response is redirect');\n\n $existingTriggerNames = $this->getExistingTriggerNames();\n foreach ($fixtures as $fixtureTriggerName) {\n $this->assertFalse(\n in_array($fixtureTriggerName, $existingTriggerNames, true),\n sprintf('Assert trigger \"%s\" exists', $fixtureTriggerName)\n );\n }\n }", "function qa_clicked($name)\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\treturn isset($_POST[$name]) || isset($_POST[$name . '_x']) || (qa_post_text('qa_click') == $name);\n}", "public function testGetInvalidEventName (): void {\n // grab an name that does not exist\n $event = Event::getEventByEventName($this->getPDO(), \"omgmynameisLuther\");\n $this->assertEmpty($event);\n }", "public function disable( $name );" ]
[ "0.6124215", "0.6076351", "0.59966105", "0.58803976", "0.5877575", "0.58018386", "0.5771938", "0.5737068", "0.57081234", "0.56724346", "0.5671866", "0.56586415", "0.5642557", "0.5576867", "0.55707306", "0.5538965", "0.55288213", "0.5515749", "0.55136687", "0.5470841", "0.5456685", "0.5454481", "0.5434905", "0.5434905", "0.54205686", "0.54109895", "0.54046136", "0.5393512", "0.53658855", "0.534189" ]
0.6821323
0
function correct this start task_1_correction
private function task_1_correction($task_name) { require_once public_path('task\\') . $task_name; $newValue_of_task = explode('.',$task_name); if(class_exists($newValue_of_task[0])){ $task = new $newValue_of_task[0]; if(session()->has('error_class')){ session()->forget('error_class'); } if(method_exists($newValue_of_task[0], 'check_name')){ $wrong = array(); $wrong[0] = ""; $wrong[1] = "al"; $wrong[2] = "asdryuimngyuioplkjhgd"; $wrong[3] = "bassem55"; $wrong[4] = "bassem reda"; $wrong[5] = "<script>anything</script>"; $correct = array(); $correct[0] = "abanoub"; $correct[1] = "ali"; $correct[2] = "bassem"; $notes = array(); $counter = 0; $degree = 0; for($i=0;$i<count($wrong);$i++) { if($task->check_name($wrong[$i]) === "wrong") { $degree++; } else if($task->check_name($wrong[$i]) === "correct") { $notes[$counter] = $wrong[$i]; $counter++; } } for($i=0;$i<count($correct);$i++) { if($task->check_name($correct[$i]) === "correct") { $degree++; } else if($task->check_name($correct[$i]) === "wrong") { $notes[$counter] = $wrong[$i]; $counter++; } } $arr = array(); $arr[0] = $degree;//degree $arr[1] = count($wrong) + count($correct);//total degree $arr[2] = $notes; return $arr; }else{ $this->checker2 = true; session()->put('error_function','error_function'); unlink(public_path('task\\') . $task_name); } }else{ $this->checker1 = true; session()->put('error_class','error_class'); unlink(public_path('task\\') . $task_name); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function task_2_correction($task_name)\n {\n\n \n require_once public_path('task\\\\') . $task_name;\n $newValue_of_task = explode('.',$task_name);\n\n if(class_exists($newValue_of_task[0])){\n\n if(session()->has('error_class')){\n session()->forget('error_class');\n }\n\n if(method_exists($newValue_of_task[0], 'check_phonenumber')){\n if(session()->has('error_function')){\n session()->forget('error_function');\n }\n $task = new $newValue_of_task[0];\n $wrong = array();\n $wrong[0] = \"0120287465\";//10 \n $wrong[1] = \"012028736166\";//12\n $wrong[2] = \"012012\";//6\n $wrong[3] = \"01302873616\";//12 but start with 013\n $wrong[4] = \"01702873616\";//12 but start with 017\n $wrong[5] = \"012e45mu576\";//12 but contain characters\n $correct = array();\n $correct[0] = \"01201873616\";\n $correct[1] = \"01102764837\";\n $correct[2] = \"01098237673\";\n \n $degree = 0;\n $notes = array();\n $counter = 0;\n $degree = 0;\n for($i=0;$i<count($wrong);$i++)\n {\n if($task->check_phonenumber($wrong[$i]) == \"wrong\")\n {\n $degree++;\n }\n else if($task->check_phonenumber($wrong[$i]) == \"correct\")\n {\n $notes[$counter] = $wrong[$i];\n $counter++;\n } \n }\n for($i=0;$i<count($correct);$i++)\n {\n if($task->check_phonenumber($correct[$i]) == \"correct\")\n {\n $degree++;\n }\n else if($task->check_phonenumber($correct[$i]) == \"wrong\")\n {\n $notes[$counter] = $wrong[$i];\n $counter++;\n }\n }\n $arr = array();\n $arr[0] = $degree;//degree\n $arr[1] = count($wrong) + count($correct);//total degree \n $arr[2] = $notes;\n return $arr;\n }else{\n\n $this->checker2 = true;\n session()->put('error_function','error_function');\n unlink(public_path('task\\\\') . $task_name);\n }\n \n }else{\n $this->checker1 = true;\n session()->put('error_class','error_class');\n unlink(public_path('task\\\\') . $task_name);\n }//if class is exist or not\n \n }", "private function task_3_correction($task_name)\n{\nrequire_once public_path('task\\\\') . $task_name;\n$newValue_of_task = explode('.',$task_name);\n\n if(class_exists($newValue_of_task[0])){\n $task = new $newValue_of_task[0];\n if(session()->has('error_class')){\n session()->forget('error_class');\n }\n if(method_exists($newValue_of_task[0], 'check_email')){\n if(session()->has('error_function')){\n session()->forget('error_function');\n }\n $wrong = array();\n $wrong[0] = \"\";//empty\n $wrong[1] = \"bassem [email protected]\";//space\n $wrong[2] = \"[email protected]\";//not gmail or yahoo\n $wrong[3] = \"bassem#gmail.com\";//# not @\n $wrong[4] = \"[email protected]@gmail.com\";//@gmail.com written two times\n $wrong[5] = \"bassem@gmailcom\";\n $correct = array();\n $correct[0] = \"[email protected]\";\n $correct[1] = \"[email protected]\";\n $correct[2] = \"[email protected]\";\n $notes = array();\n $counter = 0;\n $degree = 0;\n for($i=0;$i<count($wrong);$i++)\n {\n if($task->check_email($wrong[$i]) == \"wrong\")\n {\n $degree++;\n }\n else if($task->check_email($wrong[$i]) == \"correct\")\n {\n $notes[$counter] = $wrong[$i];\n $counter++;\n } \n }\n for($i=0;$i<count($correct);$i++)\n {\n if($task->check_email($correct[$i]) == \"correct\")\n {\n $degree++;\n }\n else if($task->check_email($correct[$i]) == \"wrong\")\n {\n $notes[$counter] = $wrong[$i];\n $counter++;\n }\n }\n $arr = array();\n $arr[0] = $degree;//degree\n $arr[1] = count($wrong) + count($correct);//total degree \n $arr[2] = $notes;\n return $arr;\n }else{\n $this->checker2 = true;\n session()->put('error_function','error_function');\n unlink(public_path('task\\\\') . $task_name);\n }\n }else{\n $this->checker1 = true;\n session()->put('error_class','error_class');\n unlink(public_path('task\\\\') . $task_name);\n }\n \n}", "public function runTestTask()\n\t{\n\t\t$this->runTask(1);\n\t}", "public function handle()\n {\n /** @var $task \\App\\Console\\Tasks\\TaskController */\n $task=new \\App\\Console\\Tasks\\TaskController();\n $start_time = strtotime(date(\"Y-m-01\",time()-86400));\n $end_time = strtotime(date(\"Y-m-01\",$start_time+40*86400));\n $ret_info =[];\n for($i=1;$i<11;$i++){\n $ret_info[$i]=[\"subject\"=>$i];\n }\n $interview_info=$task->t_teacher_lecture_info->get_interview_info_by_subject($start_time,$end_time);\n $order_info = $task->t_teacher_lecture_info->get_research_teacher_test_lesson_info_subject($start_time,$end_time);\n // $order_info = $task->t_teacher_lecture_info->get_interview_lesson_order_info_subject($start_time,$end_time);\n $first_info = $task->t_lesson_info->get_interview_teacher_first_lesson_info_subject($start_time,$end_time);\n $tea_list = $task->t_lesson_info->get_all_first_lesson_teacher_list($start_time,$end_time);\n $record_list = $task->t_teacher_record_list->get_teacher_record_num_list_subject($start_time,$end_time);\n $tea_arr=[];$record_info = [];\n foreach($tea_list as $k=>$val){\n if($val[\"add_time\"]>0){\n $tea_arr[] = $k;\n @$record_info[$val[\"subject\"]][\"num\"]++;\n @$record_info[$val[\"subject\"]][\"record_time\"] +=$val[\"add_time\"] - $val[\"lesson_start\"];\n }\n }\n $lesson_info = $task->t_lesson_info->get_teacher_arr_lesson_order_info_subject($start_time,$end_time,$tea_arr);\n $first_lesson_info = $task->t_lesson_info->get_teacher_arr_first_lesson_order_info_subject($start_time,$end_time,$tea_arr);\n $other_record_info = $task->t_seller_and_ass_record_list->get_seller_and_ass_record_by_subject($start_time,$end_time);\n $test_person_num= $task->t_lesson_info->get_test_person_num_list_by_subject( $start_time,$end_time);\n $test_person_num_other= $task->t_lesson_info->get_test_person_num_list_subject_other( $start_time,$end_time);\n $kk_test_person_num= $task->t_lesson_info->get_kk_teacher_test_person_subject_list( $start_time,$end_time);\n $change_test_person_num= $task->t_lesson_info->get_change_teacher_test_person_subject_list( $start_time,$end_time);\n\n\n\n $arr=[\"subject_str\"=>\"平均\",\"subject\"=>20];\n $zh = [\"subject_str\"=>\"综合学科\",\"subject\"=>21];\n $wz = [\"subject_str\"=>\"文科\",\"subject\"=>22];\n $xxk = [\"subject_str\"=>\"小学科\",\"subject\"=>23];\n $slh=[];\n foreach($ret_info as $k=>&$item){\n $item[\"interview_num\"] = @$interview_info[$k][\"interview_num\"];\n @$arr[\"interview_num\"] += @$interview_info[$k][\"interview_num\"];\n $item[\"interview_time\"] = @$interview_info[$k][\"interview_time\"];\n @$arr[\"interview_time\"] += @$interview_info[$k][\"interview_time\"];\n $item[\"interview_lesson\"] = @$order_info[$k][\"person_num\"];\n @$arr[\"interview_lesson\"] += @$order_info[$k][\"person_num\"];\n $item[\"interview_order\"] = @$order_info[$k][\"order_num\"];\n @$arr[\"interview_order\"] += @$order_info[$k][\"order_num\"];\n $item[\"record_time\"] = @$record_info[$k][\"record_time\"];\n @$arr[\"record_time\"] += @$record_info[$k][\"record_time\"];\n $item[\"record_num\"] = @$record_info[$k][\"num\"];\n @$arr[\"record_num\"] += @$record_info[$k][\"num\"];\n $item[\"first_lesson\"] = @$first_info[$k][\"person_num\"];\n @$arr[\"first_lesson\"] += @$first_info[$k][\"person_num\"];\n $item[\"first_order\"] = @$first_info[$k][\"order_num\"];\n @$arr[\"first_order\"] += @$first_info[$k][\"order_num\"];\n $item[\"next_lesson\"] = @$lesson_info[$k][\"person_num\"];\n @$arr[\"next_lesson\"] += @$lesson_info[$k][\"person_num\"];\n $item[\"next_order\"] = @$lesson_info[$k][\"order_num\"];\n @$arr[\"next_order\"] += @$lesson_info[$k][\"order_num\"];\n $item[\"next_lesson_first\"] = @$first_lesson_info[$k][\"person_num\"];\n @$arr[\"next_lesson_first\"] += @$first_lesson_info[$k][\"person_num\"];\n $item[\"next_order_first\"] = @$first_lesson_info[$k][\"order_num\"];\n @$arr[\"next_order_first\"] += @$first_lesson_info[$k][\"order_num\"];\n $item[\"other_record_time\"] = @$other_record_info[$k][\"deal_time\"];\n @$arr[\"other_record_time\"] += @$other_record_info[$k][\"deal_time\"];\n $item[\"other_record_num\"] = @$other_record_info[$k][\"num\"];\n @$arr[\"other_record_num\"] += @$other_record_info[$k][\"num\"];\n $item[\"lesson_num\"] = @$test_person_num[$k][\"lesson_num\"];\n $item[\"person_num\"] = @$test_person_num[$k][\"person_num\"];\n $item[\"have_order\"] = @$test_person_num[$k][\"have_order\"];\n $item[\"lesson_num_other\"] = @$test_person_num_other[$k][\"lesson_num\"];\n $item[\"have_order_other\"] = @$test_person_num_other[$k][\"have_order\"];\n $item[\"lesson_num_kk\"] = @$kk_test_person_num[$k][\"lesson_num\"];\n $item[\"have_order_kk\"] = @$kk_test_person_num[$k][\"have_order\"];\n $item[\"lesson_num_change\"] = @$change_test_person_num[$k][\"lesson_num\"];\n $item[\"have_order_change\"] = @$change_test_person_num[$k][\"have_order\"];\n $item[\"record_num_all\"] = @$record_list[$k][\"num\"];\n @$arr[\"record_num_all\"] += @$record_list[$k][\"num\"];\n\n\n if($k==1 || $k==3){\n @$wz[\"interview_num\"] += @$interview_info[$k][\"interview_num\"];\n @$wz[\"interview_time\"] += @$interview_info[$k][\"interview_time\"];\n @$wz[\"interview_time\"] += $item[\"interview_time\"];\n @$wz[\"interview_num\"] += $item[\"interview_num\"];\n @$wz[\"interview_lesson\"] += @$order_info[$k][\"person_num\"];\n @$wz[\"interview_order\"] += @$order_info[$k][\"order_num\"];\n @$wz[\"record_time\"] += @$record_info[$k][\"record_time\"];\n @$wz[\"record_num\"] += @$record_info[$k][\"num\"];\n @$wz[\"first_lesson\"] += @$first_info[$k][\"person_num\"];\n @$wz[\"first_order\"] += @$first_info[$k][\"order_num\"];\n @$wz[\"next_lesson\"] += @$lesson_info[$k][\"person_num\"];\n @$wz[\"next_order\"] += @$lesson_info[$k][\"order_num\"];\n @$wz[\"next_lesson_first\"] += @$first_lesson_info[$k][\"person_num\"];\n @$wz[\"next_order_first\"] += @$first_lesson_info[$k][\"order_num\"];\n @$wz[\"other_record_time\"] += @$other_record_info[$k][\"deal_time\"];\n @$wz[\"other_record_num\"] += @$other_record_info[$k][\"num\"];\n @$wz[\"lesson_num\"] += @$test_person_num[$k][\"lesson_num\"];\n @$wz[\"person_num\"] += @$test_person_num[$k][\"person_num\"];\n @$wz[\"have_order\"] += @$test_person_num[$k][\"have_order\"];\n @$wz[\"lesson_num_other\"] += @$test_person_num_other[$k][\"lesson_num\"];\n @$wz[\"have_order_other\"] += @$test_person_num_other[$k][\"have_order\"];\n @$wz[\"lesson_num_kk\"] += @$kk_test_person_num[$k][\"lesson_num\"];\n @$wz[\"have_order_kk\"] += @$kk_test_person_num[$k][\"have_order\"];\n @$wz[\"lesson_num_change\"] += @$change_test_person_num[$k][\"lesson_num\"];\n @$wz[\"have_order_change\"] += @$change_test_person_num[$k][\"have_order\"];\n @$wz[\"record_num_all\"] += @$record_list[$k][\"num\"];\n\n\n }else if($k>3){\n @$zh[\"interview_num\"] += @$interview_info[$k][\"interview_num\"];\n @$zh[\"interview_time\"] += @$interview_info[$k][\"interview_time\"];\n @$zh[\"interview_time\"] += $item[\"interview_time\"];\n @$zh[\"interview_num\"] += $item[\"interview_num\"];\n @$zh[\"interview_lesson\"] += @$order_info[$k][\"person_num\"];\n @$zh[\"interview_order\"] += @$order_info[$k][\"order_num\"];\n @$zh[\"record_time\"] += @$record_info[$k][\"record_time\"];\n @$zh[\"record_num\"] += @$record_info[$k][\"num\"];\n @$zh[\"first_lesson\"] += @$first_info[$k][\"person_num\"];\n @$zh[\"first_order\"] += @$first_info[$k][\"order_num\"];\n @$zh[\"next_lesson\"] += @$lesson_info[$k][\"person_num\"];\n @$zh[\"next_order\"] += @$lesson_info[$k][\"order_num\"];\n @$zh[\"next_lesson_first\"] += @$first_lesson_info[$k][\"person_num\"];\n @$zh[\"next_order_first\"] += @$first_lesson_info[$k][\"order_num\"];\n @$zh[\"other_record_time\"] += @$other_record_info[$k][\"deal_time\"];\n @$zh[\"other_record_num\"] += @$other_record_info[$k][\"num\"];\n @$zh[\"lesson_num\"] += @$test_person_num[$k][\"lesson_num\"];\n @$zh[\"person_num\"] += @$test_person_num[$k][\"person_num\"];\n @$zh[\"have_order\"] += @$test_person_num[$k][\"have_order\"];\n @$zh[\"lesson_num_other\"] += @$test_person_num_other[$k][\"lesson_num\"];\n @$zh[\"have_order_other\"] += @$test_person_num_other[$k][\"have_order\"];\n @$zh[\"lesson_num_kk\"] += @$kk_test_person_num[$k][\"lesson_num\"];\n @$zh[\"have_order_kk\"] += @$kk_test_person_num[$k][\"have_order\"];\n @$zh[\"lesson_num_change\"] += @$change_test_person_num[$k][\"lesson_num\"];\n @$zh[\"have_order_change\"] += @$change_test_person_num[$k][\"have_order\"];\n @$zh[\"record_num_all\"] += @$record_list[$k][\"num\"];\n\n }\n if($k >5){\n @$xxk[\"interview_num\"] += @$interview_info[$k][\"interview_num\"];\n @$xxk[\"interview_time\"] += @$interview_info[$k][\"interview_time\"];\n @$xxk[\"interview_time\"] += $item[\"interview_time\"];\n @$xxk[\"interview_num\"] += $item[\"interview_num\"];\n @$xxk[\"interview_lesson\"] += @$order_info[$k][\"person_num\"];\n @$xxk[\"interview_order\"] += @$order_info[$k][\"order_num\"];\n @$xxk[\"record_time\"] += @$record_info[$k][\"record_time\"];\n @$xxk[\"record_num\"] += @$record_info[$k][\"num\"];\n @$xxk[\"first_lesson\"] += @$first_info[$k][\"person_num\"];\n @$xxk[\"first_order\"] += @$first_info[$k][\"order_num\"];\n @$xxk[\"next_lesson\"] += @$lesson_info[$k][\"person_num\"];\n @$xxk[\"next_order\"] += @$lesson_info[$k][\"order_num\"];\n @$xxk[\"next_lesson_first\"] += @$first_lesson_info[$k][\"person_num\"];\n @$xxk[\"next_order_first\"] += @$first_lesson_info[$k][\"order_num\"];\n @$xxk[\"other_record_time\"] += @$other_record_info[$k][\"deal_time\"];\n @$xxk[\"other_record_num\"] += @$other_record_info[$k][\"num\"];\n @$xxk[\"lesson_num\"] += @$test_person_num[$k][\"lesson_num\"];\n @$xxk[\"person_num\"] += @$test_person_num[$k][\"person_num\"];\n @$xxk[\"have_order\"] += @$test_person_num[$k][\"have_order\"];\n @$xxk[\"lesson_num_other\"] += @$test_person_num_other[$k][\"lesson_num\"];\n @$xxk[\"have_order_other\"] += @$test_person_num_other[$k][\"have_order\"];\n @$xxk[\"lesson_num_kk\"] += @$kk_test_person_num[$k][\"lesson_num\"];\n @$xxk[\"have_order_kk\"] += @$kk_test_person_num[$k][\"have_order\"];\n @$xxk[\"lesson_num_change\"] += @$change_test_person_num[$k][\"lesson_num\"];\n @$xxk[\"have_order_change\"] += @$change_test_person_num[$k][\"have_order\"];\n @$xxk[\"record_num_all\"] += @$record_list[$k][\"num\"];\n\n }\n if($k<4){\n @$slh[\"person_num\"] += @$test_person_num[$k][\"person_num\"];\n @$slh[\"have_order\"] += @$test_person_num[$k][\"have_order\"];\n }\n $item[\"subject_str\"] = E\\Esubject::get_desc($item[\"subject\"]);\n }\n $slh_per = !empty($slh[\"person_num\"])?round(@$slh[\"have_order\"]/$slh[\"person_num\"],4)*100:0;\n\n $test_person_num_all= $task->t_lesson_info->get_test_person_num_list_by_subject_grade( $start_time,$end_time);\n $test_person_num_other_all= $task->t_lesson_info->get_test_person_num_list_subject_grade_other( $start_time,$end_time);\n $kk_test_person_num_all= $task->t_lesson_info->get_kk_teacher_test_person_subject_grade_list( $start_time,$end_time);\n $change_test_person_num_all= $task->t_lesson_info->get_change_teacher_test_person_subject_grade_list( $start_time,$end_time);\n $arr[\"lesson_num\"] = $test_person_num_all[\"lesson_num\"];\n $arr[\"have_order\"] = @$test_person_num_all[\"have_order\"];\n $arr[\"lesson_per\"] = !empty($test_person_num_all[\"person_num\"])?round(@$test_person_num_all[\"have_order\"]/$test_person_num_all[\"person_num\"],4)*100:0;\n $arr[\"lesson_per_other\"] = !empty($test_person_num_other_all[\"lesson_num\"])?round($test_person_num_other_all[\"have_order\"]/$test_person_num_other_all[\"lesson_num\"],4)*100:0;\n $arr[\"lesson_per_kk\"] = !empty($kk_test_person_num_all[\"lesson_num\"])?round($kk_test_person_num_all[\"have_order\"]/$kk_test_person_num_all[\"lesson_num\"],4)*100:0;\n $arr[\"lesson_per_change\"] = !empty($change_test_person_num_all[\"lesson_num\"])?round($change_test_person_num_all[\"have_order\"]/$change_test_person_num_all[\"lesson_num\"],4)*100:0;\n\n array_unshift($ret_info,$xxk);\n array_unshift($ret_info,$zh);\n array_unshift($ret_info,$wz);\n array_unshift($ret_info,$arr);\n foreach($ret_info as &$vvv){\n $vvv[\"interview_time_avg\"] = !empty($vvv[\"interview_num\"])?round($vvv[\"interview_time\"]/$vvv[\"interview_num\"]/86400,2):0;\n $vvv[\"record_time_avg\"] = !empty($vvv[\"record_num\"])?round($vvv[\"record_time\"]/$vvv[\"record_num\"]/3600,2):0;\n $vvv[\"other_record_time_avg\"] = !empty($vvv[\"other_record_num\"])?round($vvv[\"other_record_time\"]/$vvv[\"other_record_num\"]/3600,2):0;\n $vvv[\"interview_per\"] = !empty($vvv[\"interview_lesson\"])?round(@$vvv[\"interview_order\"]/$vvv[\"interview_lesson\"],4)*100:0;\n $vvv[\"first_per\"] = !empty($vvv[\"first_lesson\"])?round(@$vvv[\"first_order\"]/$vvv[\"first_lesson\"],4)*100:0;\n $vvv[\"next_per\"] = !empty($vvv[\"next_lesson\"])?round(@$vvv[\"next_order\"]/$vvv[\"next_lesson\"],4)*100:0;\n $vvv[\"first_next_per\"] = !empty($vvv[\"next_lesson_first\"])?round(@$vvv[\"next_order_first\"]/$vvv[\"next_lesson_first\"],4)*100:0;\n $vvv[\"add_per\"] = round($vvv[\"next_per\"]-$vvv[\"first_next_per\"],2);\n if($vvv[\"subject_str\"] !=\"平均\"){ \n $vvv[\"lesson_per\"] = !empty($vvv[\"person_num\"])?round(@$vvv[\"have_order\"]/$vvv[\"person_num\"],4)*100:0;\n $vvv[\"lesson_per_other\"] = !empty($vvv[\"lesson_num_other\"])?round(@$vvv[\"have_order_other\"]/$vvv[\"lesson_num_other\"],4)*100:0;\n $vvv[\"lesson_per_kk\"] = !empty($vvv[\"lesson_num_kk\"])?round(@$vvv[\"have_order_kk\"]/$vvv[\"lesson_num_kk\"],4)*100:0;\n $vvv[\"lesson_per_change\"] = !empty($vvv[\"lesson_num_change\"])?round(@$vvv[\"have_order_change\"]/$vvv[\"lesson_num_change\"],4)*100:0;\n\n }else{\n $vvv[\"record_num_all\"] = $vvv[\"record_num_all\"]/3;\n }\n\n $vvv[\"lesson_num_per\"] = !empty($arr[\"lesson_num\"])?round(@$vvv[\"lesson_num\"]/$arr[\"lesson_num\"],4)*100:0;\n foreach($vvv as &$vvvv){\n if(empty($vvvv)){\n $vvvv=0;\n }\n } \n\n }\n\n $data=[];\n foreach($ret_info as $kk=>$gg){\n $data[$gg[\"subject\"]] = $gg;\n if($gg[\"subject\"]==2){\n $data[24] = $gg; \n }\n } \n\n $avg = [];\n $interview_time_standard=3;\n $record_time_standard=4;\n $other_record_time_standard=1;\n $add_per_standard=3;\n $research_num= $task->t_manager_info->get_adminid_num_by_account_role(4);\n $res= $ret_info; \n $person_arr = $list_arr=[];\n foreach($res as $kk=>&$vv){\n if(in_array($vv[\"subject\"],[4,5,6,7,8,9,10,21,23])){\n $interview_per_standard = 23;\n $first_per_standard = 20;\n $lesson_per_standard = 22;\n $lesson_per_other_standard = 75;\n $lesson_per_kk_standard = 75;\n $lesson_per_change_standard = 75;\n }else{\n $interview_per_standard = 18;\n $first_per_standard = 15;\n $lesson_per_standard = 17;\n $lesson_per_other_standard = 70;\n $lesson_per_kk_standard = 70;\n $lesson_per_change_standard = 70;\n }\n $vv[\"interview_per_range\"] = $vv[\"interview_per\"]- $interview_per_standard;\n $vv[\"first_per_range\"] = $vv[\"first_per\"]- $first_per_standard;\n $vv[\"lesson_per_range\"] = $vv[\"lesson_per\"]- $lesson_per_standard;\n $vv[\"lesson_per_other_range\"] = $vv[\"lesson_per_other\"]- $lesson_per_other_standard;\n $vv[\"lesson_per_kk_range\"] = $vv[\"lesson_per_kk\"]- $lesson_per_kk_standard;\n $vv[\"lesson_per_change_range\"] = $vv[\"lesson_per_change\"]- $lesson_per_change_standard;\n if(in_array($vv[\"subject\"],[1,2,3,4,5,23])){\n $person_arr[$kk] = $vv;\n }\n if(in_array($vv[\"subject\"],[2,21,22])){\n $list_arr[$kk]= $vv;\n }\n }\n\n foreach($res as $k=>$v){\n if($v[\"subject_str\"]==\"平均\"){\n $avg = $res[$k];\n unset($res[$k]);\n }\n }\n $record_num_standard = round($avg[\"lesson_num\"]/$research_num,1);\n $interview_time_person = $person_arr;\n foreach($interview_time_person as $k=>$v){\n if($v[\"interview_time_avg\"]==0){\n unset($interview_time_person[$k]);\n }\n }\n\n \\App\\Helper\\Utils::order_list( $interview_time_person,\"interview_time_avg\", 1);\n $interview_time_first_person = @$interview_time_person[0][\"subject\"];\n \\App\\Helper\\Utils::order_list( $person_arr,\"interview_per_range\", 0);\n $interview_per_first_person = @$person_arr[0][\"subject\"];\n $record_time_person = $person_arr;\n foreach( $record_time_person as $k=>$v){\n if($v[\"record_time_avg\"]==0){\n unset( $record_time_person[$k]);\n }\n }\n \\App\\Helper\\Utils::order_list( $record_time_person,\"record_time_avg\", 1);\n $record_time_first_person = @$record_time_person[0][\"subject\"];\n \\App\\Helper\\Utils::order_list($person_arr,\"record_num_all\", 0);\n $record_num_first_person = @$person_arr[0][\"subject\"];\n \\App\\Helper\\Utils::order_list($person_arr,\"first_per_range\", 0);\n $first_per_first_person = @$person_arr[0][\"subject\"];\n \\App\\Helper\\Utils::order_list($person_arr,\"add_per\", 0);\n $add_per_first_person = @$person_arr[0][\"subject\"];\n $other_record_time_person =$person_arr;\n foreach( $other_record_time_person as $k=>$v){\n if($v[\"other_record_time_avg\"]==0){\n unset( $other_record_time_person[$k]);\n }\n }\n \\App\\Helper\\Utils::order_list( $other_record_time_person,\"other_record_time_avg\", 1);\n $other_record_time_first_person = @$other_record_time_person[0][\"subject\"];\n \\App\\Helper\\Utils::order_list( $person_arr,\"lesson_num_per\", 0);\n $lesson_num_per_first_person = @$person_arr[0][\"subject\"];\n \\App\\Helper\\Utils::order_list( $person_arr,\"lesson_per_range\", 0);\n $lesson_per_first_person = @$person_arr[0][\"subject\"];\n \\App\\Helper\\Utils::order_list( $person_arr,\"lesson_per_other_range\", 0);\n $lesson_per_other_first_person = @$person_arr[0][\"subject\"];\n \\App\\Helper\\Utils::order_list($person_arr,\"lesson_per_kk_range\", 0);\n $lesson_per_kk_first_person = @$person_arr[0][\"subject\"];\n \\App\\Helper\\Utils::order_list( $person_arr,\"lesson_per_change_range\", 0);\n $lesson_per_change_first_person = @$person_arr[0][\"subject\"];\n\n foreach($person_arr as $u){\n $person= $u[\"subject\"];\n if($person==$interview_time_first_person){\n if($u[\"interview_time_avg\"] <=$avg[\"interview_time_avg\"] && $u[\"interview_time_avg\"]<=$interview_time_standard){\n $data[$person][\"interview_time_score\"] = 5;\n }else{\n $data[$person][\"interview_time_score\"] = 1;\n }\n }else{\n if($u[\"interview_time_avg\"] <=$avg[\"interview_time_avg\"] && $u[\"interview_time_avg\"]<=$interview_time_standard && $u[\"interview_time_avg\"] !=0){\n $data[$person][\"interview_time_score\"] = 3;\n }else{\n $data[$person][\"interview_time_score\"] = 1;\n }\n\n }\n if($person==$interview_per_first_person){\n if($u[\"interview_per\"] >=$avg[\"interview_per\"] && $u[\"interview_per_range\"]>=0){\n $data[$person][\"interview_per_score\"] = 15;\n }else if($u[\"interview_per\"] >=$avg[\"interview_per\"]){\n $data[$person][\"interview_per_score\"] = 10;\n }else{\n $data[$person][\"interview_per_score\"]=5;\n }\n }else{\n if($u[\"interview_per\"] >=$avg[\"interview_per\"]){\n $data[$person][\"interview_per_score\"] = 10;\n }else{\n $data[$person][\"interview_per_score\"] = 5;\n }\n\n }\n if($person==$record_time_first_person){\n if($u[\"record_time_avg\"] <=$avg[\"record_time_avg\"] && $u[\"record_time_avg\"]<=$record_time_standard){\n $data[$person][\"record_time_score\"] = 5;\n }else{\n $data[$person][\"record_time_score\"] = 1;\n }\n }else{\n if($u[\"record_time_avg\"] <=$avg[\"record_time_avg\"] && $u[\"record_time_avg\"]<=$record_time_standard && $u[\"record_time_avg\"] !=0){\n $data[$person][\"record_time_score\"] = 3;\n }else{\n $data[$person][\"record_time_score\"] = 1;\n }\n\n }\n\n if($person==$record_num_first_person){\n if($u[\"record_num_all\"] >=$avg[\"record_num_all\"] && $u[\"record_num_all\"]>=$record_num_standard){\n $data[$person][\"record_num_score\"] = 5;\n }else if($u[\"record_num_all\"] >=$avg[\"record_num_all\"] ){\n $data[$person][\"record_num_score\"] = 3;\n }else{\n $data[$person][\"record_num_score\"]=1;\n }\n }else{\n if($u[\"record_num_all\"] >=$avg[\"record_num_all\"] ){\n $data[$person][\"record_num_score\"] = 3;\n }else{\n $data[$person][\"record_num_score\"] = 1;\n }\n\n }\n\n if($person==$first_per_first_person){\n if($u[\"first_per\"] >=$avg[\"first_per\"] && $u[\"first_per_range\"]>=0){\n $data[$person][\"first_per_score\"] = 5;\n }else if($u[\"first_per\"] >=$avg[\"first_per\"]){\n $data[$person][\"first_per_score\"] = 3;\n }else{\n $data[$person][\"first_per_score\"]=1;\n }\n }else{\n if($u[\"first_per\"] >=$avg[\"first_per\"]){\n $data[$person][\"first_per_score\"] = 3;\n }else{\n $data[$person][\"first_per_score\"] = 1;\n }\n\n }\n if($person==$add_per_first_person){\n if($u[\"add_per\"] >=$avg[\"add_per\"] && $u[\"add_per\"]>=$add_per_standard){\n $data[$person][\"add_per_score\"] = 5;\n }else if($u[\"add_per\"] >=$avg[\"add_per\"] ){\n $data[$person][\"add_per_score\"] = 3;\n }else{\n $data[$person][\"add_per_score\"]=1;\n }\n }else{\n if($u[\"add_per\"] >=$avg[\"add_per\"] ){\n $data[$person][\"add_per_score\"] = 3;\n }else{\n $data[$person][\"add_per_score\"] = 1;\n }\n\n }\n\n if($person==$other_record_time_first_person){\n if($u[\"other_record_time_avg\"] <=$avg[\"other_record_time_avg\"] && $u[\"other_record_time_avg\"]<=$other_record_time_standard){\n $data[$person][\"other_record_time_score\"] = 5;\n }else{\n $data[$person][\"other_record_time_score\"] = 1;\n }\n }else{\n if($u[\"other_record_time_avg\"] <=$avg[\"other_record_time_avg\"] && $u[\"other_record_time_avg\"]<=$other_record_time_standard && $u[\"other_record_time_avg\"] !=0){\n $data[$person][\"other_record_time_score\"] = 3;\n }else{\n $data[$person][\"other_record_time_score\"] = 1;\n }\n\n }\n if($person==$lesson_per_first_person){\n if($u[\"lesson_per\"] >=$avg[\"lesson_per\"] && $u[\"lesson_per_range\"]>=0){\n $data[$person][\"lesson_per_score\"] = 15;\n }else if($u[\"lesson_per\"] >=$avg[\"lesson_per\"]){\n $data[$person][\"lesson_per_score\"] = 10;\n }else{\n $data[$person][\"lesson_per_score\"]=5;\n }\n }else{\n if($u[\"lesson_per\"] >=$avg[\"lesson_per\"]){\n $data[$person][\"lesson_per_score\"] = 10;\n }else{\n $data[$person][\"lesson_per_score\"] = 5;\n }\n\n }\n if($person==$lesson_per_other_first_person){\n if($u[\"lesson_per_other\"] >=$avg[\"lesson_per_other\"] && $u[\"lesson_per_other_range\"]>=0){\n $data[$person][\"lesson_per_other_score\"] = 5;\n }else if($u[\"lesson_per_other\"] >=$avg[\"lesson_per_other\"]){\n $data[$person][\"lesson_per_other_score\"] = 3;\n }else{\n $data[$person][\"lesson_per_other_score\"]=1;\n }\n }else{\n if($u[\"lesson_per_other\"] >=$avg[\"lesson_per_other\"]){\n $data[$person][\"lesson_per_other_score\"] = 3;\n }else{\n $data[$person][\"lesson_per_other_score\"] = 1;\n }\n\n }\n\n if($person==$lesson_per_kk_first_person){\n if($u[\"lesson_per_kk\"] >=$avg[\"lesson_per_kk\"] && $u[\"lesson_per_kk_range\"]>=0){\n $data[$person][\"lesson_per_kk_score\"] = 5;\n }else if($u[\"lesson_per_kk\"] >=$avg[\"lesson_per_kk\"]){\n $data[$person][\"lesson_per_kk_score\"] = 3;\n }else{\n $data[$person][\"lesson_per_kk_score\"]=1;\n }\n }else{\n if($u[\"lesson_per_kk\"] >=$avg[\"lesson_per_kk\"]){\n $data[$person][\"lesson_per_kk_score\"] = 3;\n }else{\n $data[$person][\"lesson_per_kk_score\"] = 1;\n }\n\n }\n\n if($person==$lesson_per_change_first_person){\n if($u[\"lesson_per_change\"] >=$avg[\"lesson_per_change\"] && $u[\"lesson_per_change_range\"]>=0){\n $data[$person][\"lesson_per_change_score\"] = 5;\n }else if($u[\"lesson_per_change\"] >=$avg[\"lesson_per_change\"]){\n $data[$person][\"lesson_per_change_score\"] = 3;\n }else{\n $data[$person][\"lesson_per_change_score\"]=1;\n }\n }else{\n if($u[\"lesson_per_change\"] >=$avg[\"lesson_per_change\"]){\n $data[$person][\"lesson_per_change_score\"] = 3;\n }else{\n $data[$person][\"lesson_per_change_score\"] = 1;\n }\n\n }\n \n if($u[\"lesson_num_per\"]>=30){\n $data[$person][\"lesson_num_per_score\"]=5;\n }else if($u[\"lesson_num_per\"]>=20){\n $data[$person][\"lesson_num_per_score\"]=3;\n }else if($u[\"lesson_num_per\"]>=10){\n $data[$person][\"lesson_num_per_score\"]=1;\n }else{\n $data[$person][\"lesson_num_per_score\"]=0;\n }\n\n\n $data[$person][\"subject_str\"] = $u[\"subject_str\"];\n\n }\n\n $interview_time_list = $list_arr;\n foreach($interview_time_list as $k=>$v){\n if($v[\"interview_time_avg\"]==0){\n unset($interview_time_list[$k]);\n }\n }\n\n \\App\\Helper\\Utils::order_list( $interview_time_list,\"interview_time_avg\", 1);\n $interview_time_first_list = @$interview_time_list[0][\"subject\"];\n \\App\\Helper\\Utils::order_list( $list_arr,\"interview_per_range\", 0);\n $interview_per_first_list = @$list_arr[0][\"subject\"];\n $record_time_list = $list_arr;\n foreach( $record_time_list as $k=>$v){\n if($v[\"record_time_avg\"]==0){\n unset( $record_time_list[$k]);\n }\n }\n \\App\\Helper\\Utils::order_list( $record_time_list,\"record_time_avg\", 1);\n $record_time_first_list = @$record_time_list[0][\"subject\"];\n \\App\\Helper\\Utils::order_list($list_arr,\"record_num_all\", 0);\n $record_num_first_list = @$list_arr[0][\"subject\"];\n \\App\\Helper\\Utils::order_list($list_arr,\"first_per_range\", 0);\n $first_per_first_list = @$list_arr[0][\"subject\"];\n \\App\\Helper\\Utils::order_list($list_arr,\"add_per\", 0);\n $add_per_first_list = @$list_arr[0][\"subject\"];\n $other_record_time_list =$list_arr;\n foreach( $other_record_time_list as $k=>$v){\n if($v[\"other_record_time_avg\"]==0){\n unset( $other_record_time_list[$k]);\n }\n }\n \\App\\Helper\\Utils::order_list( $other_record_time_list,\"other_record_time_avg\", 1);\n $other_record_time_first_list = @$other_record_time_list[0][\"subject\"];\n \\App\\Helper\\Utils::order_list( $list_arr,\"lesson_num_per\", 0);\n $lesson_num_per_first_list = @$list_arr[0][\"subject\"];\n \\App\\Helper\\Utils::order_list( $list_arr,\"lesson_per_range\", 0);\n $lesson_per_first_list = @$list_arr[0][\"subject\"];\n \\App\\Helper\\Utils::order_list( $list_arr,\"lesson_per_other_range\", 0);\n $lesson_per_other_first_list = @$list_arr[0][\"subject\"];\n \\App\\Helper\\Utils::order_list($list_arr,\"lesson_per_kk_range\", 0);\n $lesson_per_kk_first_list = @$list_arr[0][\"subject\"];\n \\App\\Helper\\Utils::order_list( $list_arr,\"lesson_per_change_range\", 0);\n $lesson_per_change_first_list = @$list_arr[0][\"subject\"];\n\n foreach($list_arr as $u){\n $list= $u[\"subject\"];\n if($list==2){\n $list=24;\n }\n if($list==$interview_time_first_list){\n if($u[\"interview_time_avg\"] <=$avg[\"interview_time_avg\"] && $u[\"interview_time_avg\"]<=$interview_time_standard){\n $data[$list][\"interview_time_score\"] = 5;\n }else{\n $data[$list][\"interview_time_score\"] = 1;\n }\n }else{\n if($u[\"interview_time_avg\"] <=$avg[\"interview_time_avg\"] && $u[\"interview_time_avg\"]<=$interview_time_standard && $u[\"interview_time_avg\"] !=0){\n $data[$list][\"interview_time_score\"] = 3;\n }else{\n $data[$list][\"interview_time_score\"] = 1;\n }\n\n }\n if($list==$interview_per_first_list){\n if($u[\"interview_per\"] >=$avg[\"interview_per\"] && $u[\"interview_per_range\"]>=0){\n $data[$list][\"interview_per_score\"] = 15;\n }else if($u[\"interview_per\"] >=$avg[\"interview_per\"]){\n $data[$list][\"interview_per_score\"] = 10;\n }else{\n $data[$list][\"interview_per_score\"]=5;\n }\n }else{\n if($u[\"interview_per\"] >=$avg[\"interview_per\"]){\n $data[$list][\"interview_per_score\"] = 10;\n }else{\n $data[$list][\"interview_per_score\"] = 5;\n }\n\n }\n if($list==$record_time_first_list){\n if($u[\"record_time_avg\"] <=$avg[\"record_time_avg\"] && $u[\"record_time_avg\"]<=$record_time_standard){\n $data[$list][\"record_time_score\"] = 5;\n }else{\n $data[$list][\"record_time_score\"] = 1;\n }\n }else{\n if($u[\"record_time_avg\"] <=$avg[\"record_time_avg\"] && $u[\"record_time_avg\"]<=$record_time_standard && $u[\"record_time_avg\"] !=0){\n $data[$list][\"record_time_score\"] = 3;\n }else{\n $data[$list][\"record_time_score\"] = 1;\n }\n\n }\n\n if($list==$record_num_first_list){\n if($u[\"record_num_all\"] >=$avg[\"record_num_all\"] && $u[\"record_num_all\"]>=$record_num_standard){\n $data[$list][\"record_num_score\"] = 5;\n }else if($u[\"record_num_all\"] >=$avg[\"record_num_all\"] ){\n $data[$list][\"record_num_score\"] = 3;\n }else{\n $data[$list][\"record_num_score\"]=1;\n }\n }else{\n if($u[\"record_num_all\"] >=$avg[\"record_num_all\"] ){\n $data[$list][\"record_num_score\"] = 3;\n }else{\n $data[$list][\"record_num_score\"] = 1;\n }\n\n }\n\n if($list==$first_per_first_list){\n if($u[\"first_per\"] >=$avg[\"first_per\"] && $u[\"first_per_range\"]>=0){\n $data[$list][\"first_per_score\"] = 5;\n }else if($u[\"first_per\"] >=$avg[\"first_per\"]){\n $data[$list][\"first_per_score\"] = 3;\n }else{\n $data[$list][\"first_per_score\"]=1;\n }\n }else{\n if($u[\"first_per\"] >=$avg[\"first_per\"]){\n $data[$list][\"first_per_score\"] = 3;\n }else{\n $data[$list][\"first_per_score\"] = 1;\n }\n\n }\n if($list==$add_per_first_list){\n if($u[\"add_per\"] >=$avg[\"add_per\"] && $u[\"add_per\"]>=$add_per_standard){\n $data[$list][\"add_per_score\"] = 5;\n }else if($u[\"add_per\"] >=$avg[\"add_per\"] ){\n $data[$list][\"add_per_score\"] = 3;\n }else{\n $data[$list][\"add_per_score\"]=1;\n }\n }else{\n if($u[\"add_per\"] >=$avg[\"add_per\"] ){\n $data[$list][\"add_per_score\"] = 3;\n }else{\n $data[$list][\"add_per_score\"] = 1;\n }\n\n }\n\n if($list==$other_record_time_first_list){\n if($u[\"other_record_time_avg\"] <=$avg[\"other_record_time_avg\"] && $u[\"other_record_time_avg\"]<=$other_record_time_standard){\n $data[$list][\"other_record_time_score\"] = 5;\n }else{\n $data[$list][\"other_record_time_score\"] = 1;\n }\n }else{\n if($u[\"other_record_time_avg\"] <=$avg[\"other_record_time_avg\"] && $u[\"other_record_time_avg\"]<=$other_record_time_standard && $u[\"other_record_time_avg\"] !=0){\n $data[$list][\"other_record_time_score\"] = 3;\n }else{\n $data[$list][\"other_record_time_score\"] = 1;\n }\n\n }\n if($list==$lesson_per_first_list){\n if($list==21){\n if($u[\"lesson_per\"] >=($slh_per+5) && $u[\"lesson_per_range\"]>=0){\n $data[$list][\"lesson_per_score\"] = 15;\n }else if($u[\"lesson_per\"] >=($slh_per+5)){\n $data[$list][\"lesson_per_score\"] = 10;\n }else{\n $data[$list][\"lesson_per_score\"]=5;\n }\n \n }else{\n if($u[\"lesson_per\"] >=$slh_per && $u[\"lesson_per_range\"]>=0){\n $data[$list][\"lesson_per_score\"] = 15;\n }else if($u[\"lesson_per\"] >=$slh_per){\n $data[$list][\"lesson_per_score\"] = 10;\n }else{\n $data[$list][\"lesson_per_score\"]=5;\n }\n }\n }else{\n if($list==21){\n if($u[\"lesson_per\"] >=($slh_per+5)){\n $data[$list][\"lesson_per_score\"] = 10;\n }else{\n $data[$list][\"lesson_per_score\"]=5;\n }\n \n }else{\n if($u[\"lesson_per\"] >=$slh_per){\n $data[$list][\"lesson_per_score\"] = 10;\n }else{\n $data[$list][\"lesson_per_score\"]=5;\n }\n }\n\n }\n if($list==$lesson_per_other_first_list){\n if($u[\"lesson_per_other\"] >=$avg[\"lesson_per_other\"] && $u[\"lesson_per_other_range\"]>=0){\n $data[$list][\"lesson_per_other_score\"] = 5;\n }else if($u[\"lesson_per_other\"] >=$avg[\"lesson_per_other\"]){\n $data[$list][\"lesson_per_other_score\"] = 3;\n }else{\n $data[$list][\"lesson_per_other_score\"]=1;\n }\n }else{\n if($u[\"lesson_per_other\"] >=$avg[\"lesson_per_other\"]){\n $data[$list][\"lesson_per_other_score\"] = 3;\n }else{\n $data[$list][\"lesson_per_other_score\"] = 1;\n }\n\n }\n\n if($list==$lesson_per_kk_first_list){\n if($u[\"lesson_per_kk\"] >=$avg[\"lesson_per_kk\"] && $u[\"lesson_per_kk_range\"]>=0){\n $data[$list][\"lesson_per_kk_score\"] = 5;\n }else if($u[\"lesson_per_kk\"] >=$avg[\"lesson_per_kk\"]){\n $data[$list][\"lesson_per_kk_score\"] = 3;\n }else{\n $data[$list][\"lesson_per_kk_score\"]=1;\n }\n }else{\n if($u[\"lesson_per_kk\"] >= $avg[\"lesson_per_kk\"]){\n $data[$list][\"lesson_per_kk_score\"] = 3;\n }else{\n $data[$list][\"lesson_per_kk_score\"] = 1;\n }\n\n }\n\n if($list==$lesson_per_change_first_list){\n if($u[\"lesson_per_change\"] >=$avg[\"lesson_per_change\"] && $u[\"lesson_per_change_range\"]>=0){\n $data[$list][\"lesson_per_change_score\"] = 5;\n }else if($u[\"lesson_per_change\"] >=$avg[\"lesson_per_change\"]){\n $data[$list][\"lesson_per_change_score\"] = 3;\n }else{\n $data[$list][\"lesson_per_change_score\"]=1;\n }\n }else{\n if($u[\"lesson_per_change\"] >=$avg[\"lesson_per_change\"]){\n $data[$list][\"lesson_per_change_score\"] = 3;\n }else{\n $data[$list][\"lesson_per_change_score\"] = 1;\n }\n\n }\n \n if($u[\"lesson_num_per\"]>=30){\n $data[$list][\"lesson_num_per_score\"]=5;\n }else if($u[\"lesson_num_per\"]>=20){\n $data[$list][\"lesson_num_per_score\"]=3;\n }else if($u[\"lesson_num_per\"]>=10){\n $data[$list][\"lesson_num_per_score\"]=1;\n }else{\n $data[$list][\"lesson_num_per_score\"]=0;\n }\n\n\n\n }\n \n foreach($data as $o=>&$q){\n if(isset($q[\"interview_time_score\"])){ \n $q[\"total_score\"] = $q[\"interview_time_score\"]+$q[\"interview_per_score\"]+$q[\"record_time_score\"]+$q[\"record_num_score\"]+$q[\"first_per_score\"]+$q[\"add_per_score\"]+$q[\"other_record_time_score\"]+$q[\"lesson_per_score\"]+$q[\"lesson_per_other_score\"]+$q[\"lesson_per_kk_score\"]+$q[\"lesson_per_change_score\"]+$q[\"lesson_num_per_score\"];\n }\n $kid= $o;\n $check = $task->t_research_teacher_kpi_info->get_type_flag($kid,$start_time);\n if($check>0){\n $task->t_research_teacher_kpi_info->field_update_list_2($kid,$start_time,[\n \"name\" =>$q[\"subject_str\"],\n \"interview_time\" =>$q[\"interview_time_avg\"],\n \"interview_lesson\" =>$q[\"interview_lesson\"],\n \"interview_order\" =>$q[\"interview_order\"],\n \"interview_per\" =>$q[\"interview_per\"],\n \"record_time\" =>$q[\"record_time_avg\"],\n \"record_num\" =>$q[\"record_num_all\"],\n \"first_lesson\" =>$q[\"first_lesson\"],\n \"first_order\" =>$q[\"first_order\"],\n \"first_per\" =>$q[\"first_per\"],\n \"first_next_per\" =>$q[\"first_next_per\"],\n \"next_per\" =>$q[\"next_per\"],\n \"add_per\" =>$q[\"add_per\"],\n \"other_record_time\" =>$q[\"other_record_time_avg\"],\n \"lesson_num\" =>$q[\"lesson_num\"],\n \"lesson_num_per\" =>$q[\"lesson_num_per\"],\n \"lesson_per\" =>$q[\"lesson_per\"],\n \"lesson_per_other\" =>$q[\"lesson_per_other\"],\n \"lesson_per_kk\" =>$q[\"lesson_per_kk\"],\n \"lesson_per_change\" =>$q[\"lesson_per_change\"],\n \"interview_time_score\" =>@$q[\"interview_time_score\"],\n \"interview_per_score\" =>@$q[\"interview_per_score\"],\n \"record_time_score\" =>@$q[\"record_time_score\"],\n \"record_num_score\" =>@$q[\"record_num_score\"],\n \"first_per_score\" =>@$q[\"first_per_score\"],\n \"add_per_score\" =>@$q[\"add_per_score\"],\n \"other_record_time_score\"=>@$q[\"other_record_time_score\"],\n \"lesson_num_per_score\" =>@$q[\"lesson_num_per_score\"],\n \"lesson_per_score\" =>@$q[\"lesson_per_score\"],\n \"lesson_per_other_score\" =>@$q[\"lesson_per_other_score\"],\n \"lesson_per_kk_score\" =>@$q[\"lesson_per_kk_score\"],\n \"lesson_per_change_score\"=>@$q[\"lesson_per_change_score\"],\n \"total_score\" =>@$q[\"total_score\"]\n ]);\n }else{\n $task->t_research_teacher_kpi_info->row_insert([\n \"kid\" =>$kid,\n \"month\" =>$start_time,\n \"type_flag\" =>2,\n \"name\" =>$q[\"subject_str\"],\n \"interview_time\" =>$q[\"interview_time_avg\"],\n \"interview_lesson\" =>$q[\"interview_lesson\"],\n \"interview_order\" =>$q[\"interview_order\"],\n \"interview_per\" =>$q[\"interview_per\"],\n \"record_time\" =>$q[\"record_time_avg\"],\n \"record_num\" =>$q[\"record_num_all\"],\n \"first_lesson\" =>$q[\"first_lesson\"],\n \"first_order\" =>$q[\"first_order\"],\n \"first_per\" =>$q[\"first_per\"],\n \"first_next_per\" =>$q[\"first_next_per\"],\n \"next_per\" =>$q[\"next_per\"],\n \"add_per\" =>$q[\"add_per\"],\n \"other_record_time\" =>$q[\"other_record_time_avg\"],\n \"lesson_num\" =>$q[\"lesson_num\"],\n \"lesson_num_per\" =>$q[\"lesson_num_per\"],\n \"lesson_per\" =>$q[\"lesson_per\"],\n \"lesson_per_other\" =>$q[\"lesson_per_other\"],\n \"lesson_per_kk\" =>$q[\"lesson_per_kk\"],\n \"lesson_per_change\" =>$q[\"lesson_per_change\"],\n \"interview_time_score\" =>@$q[\"interview_time_score\"],\n \"interview_per_score\" =>@$q[\"interview_per_score\"],\n \"record_time_score\" =>@$q[\"record_time_score\"],\n \"record_num_score\" =>@$q[\"record_num_score\"],\n \"first_per_score\" =>@$q[\"first_per_score\"],\n \"add_per_score\" =>@$q[\"add_per_score\"],\n \"other_record_time_score\"=>@$q[\"other_record_time_score\"],\n \"lesson_num_per_score\" =>@$q[\"lesson_num_per_score\"],\n \"lesson_per_score\" =>@$q[\"lesson_per_score\"],\n \"lesson_per_other_score\" =>@$q[\"lesson_per_other_score\"],\n \"lesson_per_kk_score\" =>@$q[\"lesson_per_kk_score\"],\n \"lesson_per_change_score\"=>@$q[\"lesson_per_change_score\"], \n \"total_score\" =>@$q[\"total_score\"]\n ]);\n }\n\n }\n \n \n\n \n\n \n }", "public function step_1()\n {\n }", "public function startWorking(){\r\n }", "public function handle()\n {\n //\n /** @var $task \\App\\Console\\Tasks\\TaskController */\n $task=new \\App\\Console\\Tasks\\TaskController();\n $date_week = \\App\\Helper\\Utils::get_week_range(time(),1);\n $lstart = $date_week[\"sdate\"];\n $lend = $date_week[\"edate\"];\n $lstart_next = $date_week[\"sdate\"]+7*86400;\n $lend_next = $date_week[\"edate\"]+7*86400;\n\n $teacher_arr = $task->t_teacher_info->get_limit_lesson_num_change_list();\n // dd($teacher_arr);\n foreach($teacher_arr as $item){\n $teacherid = $item[\"teacherid\"];\n $week_num= $item[\"limit_week_lesson_num\"];\n $test_lesson_num = $task->t_lesson_info->get_limit_type_teacher_lesson_num($teacherid,$lstart,$lend);\n $test_lesson_num_next = $task->t_lesson_info->get_limit_type_teacher_lesson_num($teacherid,$lstart_next,$lend_next);\n //dd($test_lesson_num_next);\n if($test_lesson_num >= $week_num && $test_lesson_num_next >= $week_num){\n $task->t_manager_info->send_wx_todo_msg_by_adminid (72,\"理优面试组\",\"周试听课排课数量满额通知\",\"Erick老师你好,\".$item[\"realname\"].\"老师一周试听课限制排\".$week_num.\"节,本周以及下周排课已满,请确认!\",\"\");\n $task->t_manager_info->send_wx_todo_msg_by_adminid (448,\"理优面试组\",\"周试听课排课数量满额通知\",\"rolon老师你好,\".$item[\"realname\"].\"老师一周试听课限制排\".$week_num.\"节,本周以及下周排课已满,请确认!\",\"\");\n\n \n }\n }\n \n \n \n\n }", "public function testUpdateTask()\n {\n }", "public function handle()\n {\n //\n /** @var $task \\App\\Console\\Tasks\\TaskController */\n $task=new \\App\\Console\\Tasks\\TaskController();\n $start_time = time()-60*86400;\n $end_time = time();\n $teacher_test_per_list = $task->t_teacher_info->get_teacher_test_per_list($start_time,$end_time);\n foreach($teacher_test_per_list as &$item){\n $per = !empty($item[\"success_lesson\"])?round($item[\"order_number\"]/$item[\"success_lesson\"],2)*100:0;\n\n $task->t_teacher_info->field_update_list($item[\"teacherid\"],[\"test_transfor_per\"=>$per]);\n \n }\n\n //更新一月常规学生数\n $start_time = time()-30*86400;\n $ret= $task->t_teacher_info->tongji_teacher_stu_num_new($start_time,$end_time);\n foreach($ret as $v){\n $task->t_teacher_info->field_update_list($v[\"teacherid\"],[\n \"month_stu_num\" =>$v[\"stu_num\"] \n ]);\n\n }\n\n\n //更新两周试听课数\n $start_time = time()-14*86400;\n $list = $task->t_lesson_info_b2->get_test_lesson_num($start_time,$end_time);\n foreach($list as $val){\n $task->t_teacher_info->field_update_list($val[\"teacherid\"],[\n \"two_week_test_lesson_num\" =>$val[\"num\"] \n ]);\n }\n\n\n //每月1号至5号,更新沉睡老师信息\n $d = date(\"d\",time());\n if($d>=1 && $d <=5){\n $end_time = strtotime(date(\"Y-m-01\",time()));\n $start_time = strtotime(\"-3 month\",$end_time);\n $all_throuth_teacher = $task->t_teacher_info->get_all_train_through_teacher_list($start_time);\n $all_train_through_lesson_teacher= $task->t_teacher_info->get_all_train_through_lesson_teacher_list($start_time,$end_time);\n $no_lesson_tea_list=[];\n $lesson_tea_list=[];\n foreach($all_throuth_teacher as $k=>$v){\n if(!isset($all_train_through_lesson_teacher[$k]) && $v[\"sleep_flag\"]==0){\n $no_lesson_tea_list[$k]=$v[\"teacherid\"];\n }elseif(isset($all_train_through_lesson_teacher[$k]) && $v[\"sleep_flag\"]==1){\n $lesson_tea_list[$k]=$v[\"teacherid\"];\n }\n }\n\n foreach($no_lesson_tea_list as $k=>$v){\n $task->t_teacher_info->field_update_list($k,[\n \"sleep_flag\" =>1 \n ]);\n }\n foreach($lesson_tea_list as $k=>$v){\n $task->t_teacher_info->field_update_list($k,[\n \"sleep_flag\" =>0\n ]);\n }\n\n }\n\n \n\n //dd($teacher_test_per_list);\n\n \n }", "public static function handle_tasks()\n {\n\t $granularity = (int)get_site_preference('pseudocron_granularity',60);\n\t $last_check = get_site_preference('pseudocron_lastrun',0);\n\t if( (time() - $granularity * 60) >= $last_check )\n\t\t {\n\t\t\t // 1. Get Task objects.\n\t\t\t self::get_tasks();\n\t\n\t\t\t // 2. Evaluate Tasks\n\t\t\t self::execute();\n\t\n\t\t\t // 3. Cleanup to minimize memory usage\n\t\t\t self::cleanup();\n\n\t\t\t // 4. Say we've done a check\n\t\t\t set_site_preference('pseudocron_lastrun',time());\n\t\t }\n }", "public function additionalTasks(){\r\n\t\t$return = 0;\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$tasks_array = $post['ntsk'];\r\n\t\t$due_dates_array = $post['ddate'];\r\n\r\n\t\t$parent_task = new Task();\r\n\t // show newest first\r\n\t $parent_task->order_by('due_date', 'DESC');\r\n\r\n\t\t$parent_task->where(\"task_id\", $parent_id)->get();\r\n\t\t//var_dump($parent_task->task_id);\r\n\t\t$user_id = $this->flexi_auth->get_user_id();\r\n\r\n\t\t$user = $this->flexi_auth->get_user_by_id_query($user_id,'uacc_uid')->row_array();\r\n\r\n\t\tfor($i=0; $i<sizeof($tasks_array); $i++){\r\n\t\t\t$new_task = new Task();\r\n\r\n\t\t\t$now = gmdate('Y-m-d H:i:s');\r\n\t\t\t//endtime\r\n\t\t\t$due_date = $parent_task->due_date;\r\n\r\n\t\t\t$id = $this->uuid->v4();\r\n\t\t\t// Enter values into required fields\r\n\t\t\t$new_task->task_id = $id;\r\n\t\t\t$new_task->parent_id = $parent_id;\r\n\t\t\t//$taks->date_modified = $now;\r\n\r\n\t\t\t//due date is same as parent if not provided\r\n\t\t\tif($due_dates_array[$i] == \"\")\r\n\t\t\t\t$new_task->due_date = $due_date;\r\n\t\t\telse\r\n\t\t\t\t$new_task->due_date = gmdate('Y-m-d H:i:s', strtotime($due_dates_array[$i]));\r\n\r\n\t\t\t$new_task->created_by = $user['uacc_uid'];\r\n\t\t\t$new_task->assigned_user_id = $parent_task->assigned_user_id;\r\n\t\t\t$new_task->subject = trim($tasks_array[$i]);\r\n\t\t\t$new_task->company_id = $parent_task->company_id;\r\n\t\t\t$new_task->people_id = $parent_task->people_id;\r\n\t\t\t$new_task->priority_id = (int)$parent_task->priority_id;\r\n\t\t\t$new_task->status_id = (int)$parent_task->status_id;\r\n\t\t\t$new_task->description = $parent_task->description;\r\n\r\n\t\t\t// Save new user\r\n\t\t\tif( $new_task->save() ){\r\n\t\t\t}else{\r\n\t\t\t\t$return++;\r\n\t\t\t}\r\n\r\n\t\t\t//echo $task;\r\n\t\t}\r\n\t\techo $return;\r\n\r\n\t}", "function getTask() ;", "function auto_run()\n {\n \t//-----------------------------------------\n \t// INIT\n \t//-----------------------------------------\n \t\n \tif ( isset($this->ipsclass->input['j_do']) AND $this->ipsclass->input['j_do'] )\n \t{\n \t\t$this->ipsclass->input['do'] = $this->ipsclass->input['j_do'];\n \t}\n \t\n \t//-----------------------------------------\n \t// What shall we do?\n \t//-----------------------------------------\n \t\n \tswitch( $this->ipsclass->input['do'] )\n \t{\n \t\tcase 'get-template-names':\n \t\t\t$this->get_template_names();\n \t\t\tbreak;\n \t\tcase 'get-member-names':\n \t\t\t$this->get_member_names();\n \t\t\tbreak;\n \t\tcase 'get-dir-size':\n \t\t\t$this->get_dir_size();\n \t\t\tbreak;\n\t\t\tcase 'post-editorswitch':\n\t\t\t\t$this->post_editorswitch();\n\t\t\t\tbreak;\n\t\t\tcase 'captcha_test':\n\t\t\t\t$this->captcha_test();\n\t\t\t\tbreak;\n \t}\n }", "function movelidup($taskid){\n global $_TABLES;\n //check if there is a lid above this one..\n //also take into account if the lid above this one is the first task, this task must replace it as the first task..\n $templateid=DB_getItem( $_TABLES['nftemplatedata'], 'nf_templateID', \"id=\" . $taskid );\n $thisLid=DB_getItem( $_TABLES['nftemplatedata'], 'logicalid', \"id=\" . $taskid );\n $sql = \"SELECT id,logicalID FROM {$_TABLES['nftemplatedata']} WHERE nf_templateID='$templateid' AND logicalID < $thisLid \";\n $sql .= \"ORDER BY logicalID DESC LIMIT 1\";\n $query = DB_query($sql);\n\n //only perform work if we're not the first task already..\n if(DB_numRows($query) > 0){\n list ($previousID, $previousLID) = DB_fetchArray($query);\n\n $sql = \"UPDATE {$_TABLES['nftemplatedata']} set logicalID='$thisLid' WHERE id='$previousID'\";\n $result = DB_Query($sql);\n\n $sql = \"UPDATE {$_TABLES['nftemplatedata']} set logicalID='$previousLID' WHERE id='$taskid'\";\n $result = DB_Query($sql);\n\n if(DB_getItem($_TABLES['nftemplatedata'],'firstTask', \"id=\" . $previousID) == 1){\n $sql = \"UPDATE {$_TABLES['nftemplatedata']} set firstTask=1 WHERE id='$taskid'\";\n $result = DB_Query($sql);\n $sql = \"UPDATE {$_TABLES['nftemplatedata']} set firstTask=0 WHERE id='$previousID'\";\n $result = DB_Query($sql);\n }\n }\n}", "public function start_tran();", "public function testTask2(){\n\n }", "public function applyTask()\n\t{\n\t\t$this->saveTask(false);\n\t}", "function tasks()\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['tasks'] == 1 ) ? 'Task' : 'Tasks';\n\t\t$operation = ( $this->ipsclass->input['un'] ) ? 'removed' : 'created';\n\t\t$taskkeys = array();\n\t\t\n\t\tforeach ( $this->xml_array['tasks_group']['task'] as $k => $v )\n\t\t{\n\t\t\t$taskkeys[] = \"'{$v['task_key']['VALUE']}'\";\n\t\t}\n\t\t\n\t\t$this->ipsclass->DB->do_delete( 'task_manager', \"task_key IN (\".implode( \",\", $taskkeys ).\")\" );\n\t\t\n\t\tif ( !$this->ipsclass->input['un'] )\n\t\t{\n\t\t\tforeach ( $this->xml_array['tasks_group']['task'] as $k => $v )\n\t\t\t{\n\t\t\t\t$this->_add_task( $v );\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['tasks']} {$object} {$operation}....\" );\n\t}", "public function applyTask()\n\t{\n\t\t$this->saveTask();\n\t}", "private function _step():void\n\t{\n\t\t$task= array_shift( $this->_queue );\n\t\t\n\t\t$this->_runTask( $task );\n\t}", "public function testTask1(){\n\n }", "public function run()\n {\n $task_id = \\App\\Task::where('name','=','Pay the Electricity Bill')->pluck('id')->first();\n DB::table ('details')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'url_to_picture' => 'http://www.uswitch.com/gas-electricity/guides/assets/images/gas-electricity/guides/energy-guides/electricity-comparison.jpg',\n 'comment' =>'On May 20th I need to pay the electricity bill. I will pay it online\n to avoid problems',\n 'task_id' => $task_id,\n\n ]);\n\n $task_id = \\App\\Task::where('name','=','Go to the Dentist')->pluck('id')->first();\n DB::table ('details')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'url_to_picture' => 'http://www.cfah.org/images/features/V5I3DentalCare.jpg',\n 'comment' =>'On May 29th I have an appointment with th dentist. I will get several\n cavities removed',\n 'task_id' => $task_id,\n\n ]);\n\n $task_id = \\App\\Task::where('name','=','Finish P4')->pluck('id')->first();\n DB::table ('details')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'url_to_picture' => 'http://www.sovereigngrace.net/Art/Complete280.png',\n 'comment' =>'I have to finish Project 4 by May 4th. I will be a joy to complete it',\n 'task_id' => $task_id,\n\n ]);\n\n $task_id = \\App\\Task::where('name','=','Buy mom a present')->pluck('id')->first();\n DB::table ('details')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'url_to_picture' => 'http://www.sovereigngrace.net/Art/Complete280.png',\n 'comment' =>'Moms birthday is coming up. I have to make sure I buy her\n a very nice present. Pereferable some jewelry',\n 'task_id' => $task_id,\n\n ]);\n\n $task_id = \\App\\Task::where('name','=','Book a Flight for Cancun')->pluck('id')->first();\n DB::table ('details')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'url_to_picture' => 'https://aquaworld.com.mx/en/wp-content/uploads/sites/2/2015/09/healthy-trip-to-cancun.jpg',\n 'comment' =>'Due to our two year anniversary, I have to book a flight to Cancun\n for my girlfriend and I.',\n 'task_id' => $task_id,\n\n ]);\n }", "public function run()\n {\n $delta = true;\n $ci = 0;\n $ti = 0;\n for($i = 1; $i <= 20; $i++) {\n while($delta) {\n $ci = DB::table('users')->where(['role_id' => 3, 'id' => rand(3, 32) ])->value('id');\n if($ci != 0) {\n $ti = DB::table('users')->where(['role_id' => 2, 'id' => rand(3, 32) ])->value('id');\n if($ti != 0) {\n $delta = false;\n }\n }\n }\n DB::table('tasks')->insert([\n 'task_type_id' => rand(1, 5),\n 'technician_id' => $ti,\n 'client_id' => $ci,\n 'task_state_id' => rand(1, 4),\n 'description' => 'none',\n 'annotation' => 'none',\n 'code' => str_random(20),\n 'created_at' => date('Y-m-01').' '.'00:00:00',\n 'updated_at' => date('Y-m-01').' '.'00:00:00',\n ]);\n $ci = 0;\n $ti = 0;\n $delta = true;\n }\n }", "public function mainTask()\n\t{\n\t\t// Redirect to version panel of current version (TEMP)\n\t\tApp::redirect(\n\t\t\tRoute::url($this->_route . '&active=versions', false)\n\t\t);\n\t\treturn;\n\t}", "public function testCreateTask()\n {\n }", "public function run()\n {\n $task = new Task();\n $task->id = 1;\n $task->title = 'Cong viec 1';\n $task->content = 'tao project laravel';\n $task->created = '2018-09-27 04:57:57';\n $task->due_date = '2018-09-26';\n $task->image = 'anh';\n $task->save();\n }", "public function testUpdateTaskInstanceVariable()\n {\n }", "function frl_perform_update(){\n\n\t$task_for_out = frl_get_tasks();\n\t$log_for_out = frl_get_log();\n\t$log_queue = frl_get_log_queue();\n\n\t$step = count($log_for_out);\n\tif($step > $log_queue){\n\t\tfrl_perform_reset();\n\t\treturn;\n\t}\n\n\t//add action into log\n\t$new_line = $log_queue[$step]; \n\tarray_unshift($log_for_out, $new_line);\n\n\t$file = dirname(__FILE__).'/data/log-out.csv'; \n $csv_handler = fopen($file,'w');\n foreach ($log_for_out as $l) {\n \tfputcsv($csv_handler, $l, \",\");\n }\n fclose($csv_handler);\n\n //change status of task\n if($new_line[2] == 'Запрос уточнения'){\n \t//change status to Ждет уточнения\n \t$task_for_out = frl_change_task_status($task_for_out, $new_line[4], 'Ждет уточнения');\n }\n\n if($new_line[2] == 'Отклик на задачу'){\n \t//change status to Подтверждено\n \t$task_for_out = frl_change_task_status($task_for_out, $new_line[4], 'Подтверждено');\n }\n\n $file = dirname(__FILE__).'/data/tasks-out.csv';\n $csv_handler = fopen($file,'w');\n foreach ($task_for_out as $t) {\n \tfputcsv($csv_handler, $t, \",\");\n }\n fclose($csv_handler);\n\n}", "public function run()\n {\n DB::table('tasks')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'task' => 'Ask for Help',\n 'description' => 'Ask someone to teach you a skill.',\n 'task_points' => 200,\n 'skill_level' => 1,\n 'allotted_time' => '00:02:00',\n ]);\n\n DB::table('tasks')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'task' => 'Export by WiFi',\n 'description' => 'Send a data file using a WiFi connection.',\n 'task_points' => 450,\n 'skill_level' => 4,\n 'allotted_time' => '00:02:00',\n ]);\n\n DB::table('tasks')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'task' => 'Run',\n 'description' => 'Start a run.',\n 'task_points' => 150,\n 'skill_level' => 1,\n 'allotted_time' => '00:01:00',\n ]);\n\n DB::table('tasks')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'task' => 'Connect 2 Sensors',\n 'description' => 'Plug in 2 sensors. Confirm valid response from each one.',\n 'task_points' => 400,\n 'skill_level' => 2,\n 'allotted_time' => '00:01:30',\n ]);\n\n DB::table('tasks')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'task' => 'Connect sensor',\n 'description' => 'Plug in 1 sensor. Confirm a valid response.',\n 'task_points' => 100,\n 'skill_level' => 1,\n 'allotted_time' => '00:01:30',\n ]);\n\n DB::table('tasks')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'task' => 'Free Teach',\n 'description' => 'Teach your partner a new skill. It does not need to be a wheel task.',\n 'task_points' => 800,\n 'skill_level' => 3,\n 'allotted_time' => '00:03:30',\n ]);\n\n DB::table('tasks')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'task' => 'Set Rate',\n 'description' => 'Set experimental rate for run.',\n 'task_points' => 200,\n 'skill_level' => 2,\n 'allotted_time' => '00:01:30',\n ]);\n\n DB::table('tasks')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'task' => 'Autoscale',\n 'description' => 'Use autoscale function to adjust the y-axis during a run.',\n 'task_points' => 300,\n 'skill_level' => 3,\n 'allotted_time' => '00:02:00',\n ]);\n\n DB::table('tasks')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'task' => 'Read Lab Instruction',\n 'description' => 'Access a saved copy of any Vernier Labquest experiment.',\n 'task_points' => 200,\n 'skill_level' => 2,\n 'allotted_time' => '00:01:30',\n ]);\n\n DB::table('tasks')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'task' => 'Select Region',\n 'description' => 'Select a region of data from a saved run.',\n 'task_points' => 500,\n 'skill_level' => 3,\n 'allotted_time' => '00:02:30',\n ]);\n\n DB::table('tasks')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'task' => 'View Graph',\n 'description' => 'View a Labquest graph.',\n 'task_points' => 100,\n 'skill_level' => 1,\n 'allotted_time' => '00:01:00',\n ]);\n\n DB::table('tasks')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'task' => 'Set Duration',\n 'description' => 'Set the time duration for experiment.',\n 'task_points' => 200,\n 'skill_level' => 2,\n 'allotted_time' => '00:01:30',\n ]);\n\n DB::table('tasks')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'task' => 'Export by USB',\n 'description' => 'Export an experimental data file using USB cable to a commputer.',\n 'task_points' => 300,\n 'skill_level' => 3,\n 'allotted_time' => '00:02:30',\n ]);\n\n DB::table('tasks')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'task' => 'Label Run',\n 'description' => 'Add a descriptive name to a data run.',\n 'task_points' => 250,\n 'skill_level' => 2,\n 'allotted_time' => '00:01:30',\n ]);\n\n DB::table('tasks')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'task' => 'Strike Data',\n 'description' => 'Strike data from a saved run.',\n 'task_points' => 750,\n 'skill_level' => 4,\n 'allotted_time' => '00:02:30',\n ]);\n\n DB::table('tasks')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'task' => '3 in a Row',\n 'description' => 'Demonstrate a sequence of 3 different skills.',\n 'task_points' => 900,\n 'skill_level' => 4,\n 'allotted_time' => '00:02:30',\n ]);\n\n DB::table('tasks')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'task' => 'Reboot',\n 'description' => 'Reboot the Labquest unit',\n 'task_points' => 300,\n 'skill_level' => 3,\n 'allotted_time' => '00:03:30',\n ]);\n\n DB::table('tasks')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'task' => 'Linear Fit',\n 'description' => 'Perform a linear fit on a graph.',\n 'task_points' => 250,\n 'skill_level' => 2,\n 'allotted_time' => '00:02:00',\n ]);\n\n DB::table('tasks')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'task' => 'Create Local Network',\n 'description' => 'Setup a local Wifi network from Labquest unit, give it a name and confirm from another WiFi enabled device.',\n 'task_points' => 600,\n 'skill_level' => 4,\n 'allotted_time' => '00:03:30',\n ]);\n\n DB::table('tasks')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'task' => 'Connect WiFi',\n 'description' => 'Connect Labquest unit to a WiFi network.',\n 'task_points' => 400,\n 'skill_level' => 3,\n 'allotted_time' => '00:02:30',\n ]);\n\n DB::table('tasks')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'task' => 'View Table',\n 'description' => 'View data in table view.',\n 'task_points' => 150,\n 'skill_level' => 1,\n 'allotted_time' => '00:01:30',\n ]);\n\n DB::table('tasks')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'task' => 'Overlay Runs',\n 'description' => 'Overlay 2 separate runs on one graph.',\n 'task_points' => 200,\n 'skill_level' => 2,\n 'allotted_time' => '00:01:30',\n ]);\n\n DB::table('tasks')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'task' => 'Save File',\n 'description' => 'Save file, must give it a descriptive name.',\n 'task_points' => 250,\n 'skill_level' => 2,\n 'allotted_time' => '00:02:30',\n ]);\n\n DB::table('tasks')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'task' => 'Download to LoggerPro',\n 'description' => 'Download data file to Labquest LoggerPro software on a computer.',\n 'task_points' => 400,\n 'skill_level' => 4,\n 'allotted_time' => '00:03:30',\n ]);\n }", "public function run()\n {\n \\App\\Task::create([\n 'title' => 'Lorem Ipsum',\n 'description' => 'Ship-wide stars, to the habitat technically shields up. It is a delighted mystery, sir. Ferengis resist from minds like interstellar emitters.Ship-wide stars, to the habitat technically shields up. It is a delighted mystery, sir. Ferengis resist from minds like interstellar emitters.',\n 'end' => \\Carbon\\Carbon::now()->addDays(2),\n 'app_user_id' => 1\n ]);\n \\App\\Task::create([\n 'title' => 'Dolor Sit',\n 'description' => 'Ship-wide stars, to the habitat technically shields up. It is a delighted mystery, sir. Ferengis resist from minds like interstellar emitters.Ship-wide stars, to the habitat technically shields up. It is a delighted mystery, sir. Ferengis resist from minds like interstellar emitters.',\n 'end' => \\Carbon\\Carbon::now()->addDays(2),\n 'app_user_id' => 1\n ]);\n }" ]
[ "0.617361", "0.58540034", "0.56896424", "0.5686089", "0.5682584", "0.5664828", "0.5574911", "0.55473596", "0.5536141", "0.5534181", "0.55162424", "0.55063725", "0.54707783", "0.5469982", "0.5447325", "0.5436089", "0.54146636", "0.541194", "0.5386737", "0.5385267", "0.5381056", "0.53615665", "0.5324776", "0.5324478", "0.53090155", "0.5307909", "0.5293349", "0.5256212", "0.52534574", "0.52434635" ]
0.6471341
0
Find out the stocks associated with this genotype (allele)
function mainlab_get_allele_associated_stocks ($genotype_id, $project = 0, $stock_uniquename = 0, $species = 0) { $ssql = "SELECT DISTINCT S.stock_id, S.uniquename, CP.nid AS project_nid, P.name AS project FROM {nd_experiment_genotype} NDG INNER JOIN {nd_experiment_stock} NDS ON NDG.nd_experiment_id = NDS.nd_experiment_id INNER JOIN {stock} EXP ON EXP.stock_id = NDS.stock_id INNER JOIN {stock_relationship} SR ON SR.subject_id = EXP.stock_id INNER JOIN {stock} S ON S.stock_id = SR.object_id INNER JOIN {nd_experiment_project} NEP ON NEP.nd_experiment_id = NDG.nd_experiment_id LEFT JOIN {project} P ON P.project_id = NEP.project_id LEFT JOIN public.chado_project CP ON P.project_id = CP.project_id LEFT JOIN (SELECT * FROM {stockprop} WHERE type_id = (SELECT cvterm_id FROM {cvterm} WHERE name = 'permission' AND cv_id = (SELECT cv_id FROM {cv} WHERE name ='MAIN'))) SP ON S.stock_id = SP.stock_id LEFT JOIN (SELECT * FROM {projectprop} PP WHERE type_id = (SELECT cvterm_id FROM {cvterm} WHERE name = 'project_type' AND cv_id = (SELECT cv_id FROM {cv} WHERE name = 'MAIN'))) PTYPE ON PTYPE.project_id = P.project_id LEFT JOIN (SELECT * FROM {projectprop} PP WHERE type_id = (SELECT cvterm_id FROM {cvterm} WHERE name = 'sub_type' AND cv_id = (SELECT cv_id FROM {cv} WHERE name = 'MAIN'))) SUBTYPE ON SUBTYPE.project_id = P.project_id LEFT JOIN (SELECT * FROM {projectprop} PP WHERE type_id = (SELECT cvterm_id FROM {cvterm} WHERE name = 'permission' AND cv_id = (SELECT cv_id FROM {cv} WHERE name = 'MAIN'))) PERM ON PERM.project_id = P.project_id WHERE SR.type_id = (SELECT cvterm_id FROM {cvterm} WHERE name = 'sample_of' AND cv_id = (SELECT cv_id FROM {cv} WHERE name = 'MAIN')) AND PTYPE.value = 'genotyping' AND SUBTYPE.value = 'SSR' AND PERM.value = 'public' AND genotype_id = :genotype_id"; if ($project) {$ssql .= " AND P.name = '$project'";} if ($stock_uniquename) {$ssql .= " AND S.uniquename = '$stock_uniquename'";} if ($species) {$ssql .= " AND (SELECT genus || ' ' || species FROM {organism} WHERE organism_id =S.organism_id) = '$species'";} $sresult = chado_query($ssql, array(':genotype_id' => $genotype_id)); $stocks = array(); $scounter = 0; while ($stock = $sresult->fetchObject()) { // Find out the stock nid if there is one if (db_table_exists('chado_stock')) { $nsql = "SELECT nid FROM {chado_stock} WHERE stock_id = :stock_id"; $nid = db_query($nsql, array(':stock_id' => $stock->stock_id))->fetchField(); $stock->nid = $nid; } $stocks [$scounter] = $stock; $scounter ++; } return $stocks; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStock();", "public function getVariantStocks()\n {\n return $this->getProductStocks()\n ->joinWith('stock');\n }", "public function read_stocks() {\n return $this->yahooStock->getQuotes();\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->Stock;\n }", "function get_espacio_stocks_ubicacion($stock)\n\t{\n\t\t$u = new Espacio_stock();\n\t\t$sql=\"select c.*, s.nombre from espacios_stock as c left join stock as s on s.id=c.stock_id where c.stock_id='$stock' and s.estatus_general_id='1' order by nombre limit 1 \";\n\t\t//Buscar en la base de datos\n\t\t$u->query($sql);\n\t\tif($u->c_rows > 0){\n\t\t\treturn $u;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "private function getStock()\n {\n $article = oxNew('oxArticle');\n $article->load($this->testArticleId);\n return $article->oxarticles__oxstock->value;\n }", "public function stocks()\n {\n return $this->hasMany(InventoryStock::class, 'location_id', 'id');\n }", "public static function get_all_accessory_in_stock()\n {\n return Accessories::where('status',1)->where('rental',1)->where('in_stock',0)->get(); \n }", "public function stocks()\n {\n return $this->hasMany('App\\Models\\Stock');\n }", "function getStockItemModel() {\n\t\t\treturn $this->getCatalogInventoryHelper( )->getStockItem( $this->getStockId( ) );\n\t\t}", "public function getIdstock()\r\n {\r\n return $this->idstock;\r\n }", "public function all() {\n $stmt = $this->pdo->query('SELECT id, symbol, company '\n . 'FROM stocks '\n . 'ORDER BY symbol');\n $stocks = [];\n while ($row = $stmt->fetch(\\PDO::FETCH_ASSOC)) {\n $stocks[] = [\n 'id' => $row['id'],\n 'symbol' => $row['symbol'],\n 'company' => $row['company']\n ];\n }\n return $stocks;\n }", "public function getQuantite_stock()\r\n {\r\n return $this->quantite_stock;\r\n }", "public function getStockGoods()\n {\n $reportStock = new ReportStock();\n return Collection::times(10)->map(function ($value) use ($reportStock) {\n $stock = $reportStock->getStockGoods(new Request([\n 'stock_date' => $date = Carbon::now()->subWeeks($value - 1)\n ]));\n\n return collect([\n 'date' => $date->toDateString(),\n 'stocks' => $stock->count()\n ]);\n });\n }", "public function stocks(): HasMany\n {\n return $this->hasMany('Ronmrcdo\\Inventory\\Models\\InventoryStock');\n }", "public function get_single_stock() {\n\n\t\t$inventory = $this->get_inventory();\n\n\t\treturn ! empty( $inventory ) ? current( $inventory ) : null;\n\t}", "public function get_branchwise_product_stock_correction() {\n $branchwise_product_store_list = $this->Branchwise_product_store_Model->get_branchwise_product_store();\n if (!empty($branchwise_product_store_list)) {\n $arr = array();\n foreach ($branchwise_product_store_list as $branchwise_product_store) {\n $branchwise_product_store_from_previous_date_by_product_id_branch_id = $this->Branchwise_product_store_Model->get_branchwise_product_store_from_previous_date_by_product_id_branch_id($branchwise_product_store->product_store_date, $branchwise_product_store->product_id, $branchwise_product_store->branch_id);\n $open_stock = !empty($branchwise_product_store_from_previous_date_by_product_id_branch_id) ? $branchwise_product_store_from_previous_date_by_product_id_branch_id->closing_stock : 0;\n $closing_stock = (int) ($open_stock + $branchwise_product_store->receive_stock - $branchwise_product_store->transfer_stock - $branchwise_product_store->sale_from_stock - $branchwise_product_store->damage_stock);\n $branchwise_product_store_data = array(\n 'id' => $branchwise_product_store->id,\n 'product_store_date' => $branchwise_product_store->product_store_date,\n 'product_id' => $branchwise_product_store->product_id,\n 'branch_id' => $branchwise_product_store->branch_id,\n 'open_stock' => $open_stock,\n 'receive_stock' => $branchwise_product_store->receive_stock,\n 'transfer_stock' => $branchwise_product_store->transfer_stock,\n 'sale_from_stock' => $branchwise_product_store->sale_from_stock,\n 'damage_stock' => $branchwise_product_store->damage_stock,\n 'closing_stock' => $closing_stock,\n );\n array_push($arr, $branchwise_product_store_data);\n //$this->db->where('id', $branchwise_product_store_data['id']);\n //$this->Branchwise_product_store_Model->db->update('branchwise_product_store', $branchwise_product_store_data);\n }\n echo 'branchwise product store';\n echo '<br>';\n echo '<pre>';\n print_r($arr);\n echo '</pre>';\n die();\n }\n }", "public function ListarProductosStockMinimo()\n{\n\tself::SetNames();\n\t$sql = \" select * from productos INNER JOIN categorias ON productos.codcategoria = categorias.codcategoria WHERE productos.existencia <= productos.stockminimo\";\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\t}\n\treturn $this->p;\n\t$this->dbh=null;\n}", "public function stockCount()\n {\n return $this->variations->sum(function ($variation) {\n return $variation->stockCount();\n });\n }", "private function getStockListContents(): array\n {\n $list = $this->stocklistID;\n $this->db->select('i.eve_iditem as id, i.name as name, i.volume as vol');\n $this->db->from('itemlist il');\n $this->db->join('itemcontents ic', 'ic.itemlist_iditemlist = il.iditemlist');\n $this->db->join('item i', 'i.eve_iditem = ic.item_eve_iditem');\n $this->db->where('il.iditemlist', $list);\n $query = $this->db->get();\n $result = $query->result();\n\n return $result;\n }", "public function getStockInfo() {\n //Fetch the product model \n $product = $this->getProduct();\n\n //Get the quantity from the product model \n $stock = $this->stockRegistry->getStockItem($product->getId());\n\n //Retun stock quantity here \n return $stock->getQty();\n }", "public function getOneOfStock()\n {\n if ($this->stock[0]) {\n $dominoTile = $this->stock[0];\n unset($this->stock[0]);\n $newStock = array_values($this->stock);\n $this->stock = $newStock;\n\n return $dominoTile;\n } else {\n return null;\n }\n }", "public function stock_history(){\n\t\treturn $stock_info = $this->db->select('*')\n\t\t ->from('store')\n\t\t ->where('isactive',1)\n\t\t ->get()\n\t\t ->result();\n\t}" ]
[ "0.65531206", "0.63600194", "0.6261578", "0.6231055", "0.6231055", "0.62242687", "0.62242687", "0.62242687", "0.62242687", "0.62242687", "0.61554205", "0.60537744", "0.60195446", "0.5988002", "0.59194744", "0.58896285", "0.5798436", "0.5758166", "0.57405263", "0.57309055", "0.5673512", "0.55819476", "0.5576354", "0.5535283", "0.55095565", "0.5483348", "0.5475444", "0.5455976", "0.5454411", "0.54475015" ]
0.6559824
0
Store a newly created BText in storage.
public function store(CreateBTextRequest $request, $id = '') { $input = $request->all(); $bText = $this->bTextRepository->create($input); Flash::success('B Text saved successfully.'); return redirect('/blocks/show_texts/'.$id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store()\n {\n // If the user is logged in...\n if (Auth::check()) {\n // validate\n // read more on validation at http://laravel.com/docs/validation\n $rules = array(\n 'title' => 'required',\n );\n $validator = Validator::make(Input::all(), $rules);\n\n // process the login\n if ($validator->fails()) {\n return Redirect::to('texts/create')\n ->withErrors($validator)\n ->withInput(Input::except('password'));\n } else {\n // store\n $text = new Text;\n $text->title = Input::get('title');\n $text->author = Input::get('author');\n $text->year = Input::get('year');\n $text->description = Input::get('description');\n $text->content = Input::get('content');\n $text->publication = Input::get('publication');\n $text->publication_date = Input::get('publication_date');\n\n $text->save();\n\n // redirect\n Session::flash('message', 'Successfully created text');\n return Redirect::to('texts');\n }\n } else {\n // User is not logged in\n Session::flash('message', 'Please log in');\n return Redirect::to('/');\n }\n }", "public function store(StoreText $request)\n {\n $text = new Text();\n $text->title = $request->input('title');\n $text->slug = $request->input('slug');\n\n $text->save();\n\n return redirect()->route('admin_texts_edit', ['slug' => $text->slug]);\n }", "public function saveNewTxtFile()\r\n {\r\n\r\n $fileName = date(\"Y-m-d\") . '-' . rand(0, 512) . \"Question\";\r\n\r\n $file = new StorageFileSaver($fileName);\r\n\r\n foreach ($this->fileContent as $content) {\r\n $file->write($content);\r\n }\r\n\r\n $file->saveAndCloseFile();\r\n }", "public function saveTextToEntity($entity_type_id, $entity_id, $field_name, $speech);", "public function store($name, $content);", "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\t//\n\t}", "private function writeTextToFile() {\n\t\t$text = $this -> pm -> getText($this -> padid);\n\t\t$path = sprintf('%s/%s.tex', $this -> directory, $this -> name);\n\t\tfile_put_contents($path, $text);\n\t}", "public function store()\n {\n if( $this->isPersistent() )\n {\n $this->update();\n }\n else\n {\n $this->insert();\n }\n }", "public function store()\r\r\n\t{\r\r\n\t\t//\r\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}" ]
[ "0.6215897", "0.6140597", "0.5994075", "0.5851112", "0.58351237", "0.5800299", "0.5800299", "0.5800299", "0.5793487", "0.57908916", "0.57633173", "0.5744871", "0.5741598", "0.5741598", "0.5741598", "0.5741598", "0.5741598", "0.5741598", "0.5741598", "0.5741598", "0.5741598", "0.5741598", "0.5741598", "0.5741598", "0.5741598", "0.5741598", "0.5741598", "0.5741598", "0.5741598", "0.5741598" ]
0.6857694
0
require_once "RSMtestsFunctionsLibrary.php"; Get relations for the round and subject passed
function getRelations($theRoundID, $theSubjectID, $clientID) { global $definitions; //get item type $relationsItemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['roundSubjectsTestRelations'], $clientID); //get properties $relationsRoundPropertyID = getClientPropertyID_RelatedWith_byName($definitions['roundSubjectsTestRelationsRoundID' ], $clientID); $relationsSubjectPropertyID = getClientPropertyID_RelatedWith_byName($definitions['roundSubjectsTestRelationsSubjectID' ], $clientID); $relationsTestCasesPropertyID = getClientPropertyID_RelatedWith_byName($definitions['roundSubjectsTestRelationsTestID' ], $clientID); $relationsTestCategoriesPropertyID = getClientPropertyID_RelatedWith_byName($definitions['roundSubjectsTestRelationsTestCatIDs'], $clientID); //First get the relation associated $returnProperties = array(); $returnProperties[] = array('ID' => $relationsRoundPropertyID, 'name' => 'roundID'); $returnProperties[] = array('ID' => $relationsSubjectPropertyID, 'name' => 'subjectID'); $returnProperties[] = array('ID' => $relationsTestCasesPropertyID, 'name' => 'testCasesIDs'); $returnProperties[] = array('ID' => $relationsTestCategoriesPropertyID, 'name' => 'testCatIDs'); //build the filter $filters = array(); $filters[] = array('ID' => $relationsRoundPropertyID, 'value' => $theRoundID); $filters[] = array('ID' => $relationsSubjectPropertyID, 'value' => $theSubjectID); $relations = getFilteredItemsIDs($relationsItemTypeID, $clientID, $filters, $returnProperties); return $relations; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRelations($theRoundID, $theSubjectID, $clientID) {\n global $definitions;\n\n $relationsItemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['roundSubjectsTestRelations'], $clientID);\n\n $relationsRoundPropertyID = getClientPropertyID_RelatedWith_byName($definitions['roundSubjectsTestRelationsRoundID'], $clientID);\n $relationsSubjectPropertyID = getClientPropertyID_RelatedWith_byName($definitions['roundSubjectsTestRelationsSubjectID'], $clientID);\n $relationsTestCasesPropertyID = getClientPropertyID_RelatedWith_byName($definitions['roundSubjectsTestRelationsTestID'], $clientID);\n $relationsTestCategoriesPropertyID = getClientPropertyID_RelatedWith_byName($definitions['roundSubjectsTestRelationsTestCatIDs'], $clientID);\n\n $relationsTestCategoriesPropertyID;\n\n //First get the relation associated\n $returnProperties = array();\n $returnProperties[] = array('ID' => $relationsRoundPropertyID, 'name' => 'roundID');\n $returnProperties[] = array('ID' => $relationsSubjectPropertyID, 'name' => 'subjectID');\n $returnProperties[] = array('ID' => $relationsTestCasesPropertyID, 'name' => 'testCasesIDs');\n $returnProperties[] = array('ID' => $relationsTestCategoriesPropertyID, 'name' => 'testCatIDs');\n\n //build an empty filter\n $filters = array();\n $filters[] = array('ID' => $relationsRoundPropertyID, 'value' => $theRoundID);\n $filters[] = array('ID' => $relationsSubjectPropertyID, 'value' => $theSubjectID);\n\n $relations = getFilteredItemsIDs($relationsItemTypeID, $clientID, $filters, $returnProperties);\n\n return $relations;\n}", "public function testGetUnitRelationships()\n {\n }", "function getRoundsForStudy($theStudyID, $clientID) {\n global $definitions;\n\n $roundItemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['roundsplanning'], $clientID);\n $roundsAssociatedStudyID = getClientPropertyID_RelatedWith_byName($definitions['roundsplanningAssociatedStudyID'], $clientID);\n\n //First get the relation associated\n $returnProperties = array();\n\n //build an empty filter\n $filters = array();\n $filters[] = array('ID' => $roundsAssociatedStudyID, 'value' => $theStudyID);\n\n $rounds = getFilteredItemsIDs($roundItemTypeID, $clientID, $filters, $returnProperties);\n\n return $rounds;\n\n}", "abstract public function findRelatedRecordsBySubject(): array;", "abstract function relations();", "public static function workflowRelations();", "public function testGetUnitRelationshipTypes()\n {\n }", "public function youCanFetchRelations()\n {\n // Arrange...\n $this->login();\n $lecture = factory(Lecture::class)->make();\n\n // Act...\n $this->json('post', 'lectures', array_merge($lecture->toArray(), [\n 'with' => 'subject'\n ]));\n\n // Assert...\n $this->seeSuccessStructure([\n 'subject'\n ]);\n }", "public function testGetSurveys0()\n {\n }", "public function testGetSurveys0()\n {\n }", "function getStepsScriptsForTestCase($theTC_ID, $theSubjectID, $roundID, $studyID, $clientID) {\n global $definitions;\n\n $stepsItemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['steps'], $clientID);\n $stepParentTestCasePropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsTestCaseParentID'], $clientID);\n $stepDescriptionPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsDescription'], $clientID);\n $stepOrderPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsOrder'], $clientID);\n $stepCheckedStepUnitsPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsCheckedStepUnits'], $clientID);\n $stepRoundSubjectTestCasePropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsRoundSubjectRelationID'], $clientID);\n $stepMainPropertyID = getMainPropertyID($stepsItemTypeID, $clientID);\n $stepStepTypePropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsType'], $clientID);\n $stepStepScriptPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsScript'], $clientID);\n\n $typesListID = getAppListID('stepsTypes');\n\n $relations = getRelations($roundID, $theSubjectID, $clientID);\n\n $finalResult = array();\n //Next, check that has one $relation\n if ((count($relations) - 1) == 0) {\n\n // build return properties array\n $returnProperties = array();\n $returnProperties[] = array('ID' => $stepMainPropertyID, 'name' => 'stepsMainValue');\n $returnProperties[] = array('ID' => $stepDescriptionPropertyID, 'name' => 'description');\n $returnProperties[] = array('ID' => $stepOrderPropertyID, 'name' => 'order');\n $returnProperties[] = array('ID' => $stepStepTypePropertyID, 'name' => 'stepType');\n $returnProperties[] = array('ID' => $stepStepScriptPropertyID, 'name' => 'stepScript');\n $returnProperties[] = array('ID' => $stepCheckedStepUnitsPropertyID, 'name' => 'checkedValues');\n\n //build the filter\n $filters = array();\n $filters[] = array('ID' => $stepParentTestCasePropertyID, 'value' => $theTC_ID);\n $filters[] = array('ID' => $stepRoundSubjectTestCasePropertyID, 'value' => $relations[0]['ID']);\n\n // get steps\n $orderedSteps = getFilteredItemsIDs($stepsItemTypeID, $clientID, $filters, $returnProperties, 'order');\n\n //Get the id of the list client related\n $clientListID = getClientListID_RelatedWith($typesListID, $clientID);\n\n //Get all the values for this list and client\n $ClientValues = getListValues($clientListID, $clientID);\n\n //Add the \"isStep\" parameter\n for ($i = 0; $i < count($orderedSteps); $i++) {\n\n //First, encode the name and the description\n $orderedSteps[$i]['stepsMainValue'] = base64_encode($orderedSteps[$i]['stepsMainValue']);\n $orderedSteps[$i]['description'] = base64_encode($orderedSteps[$i]['description']);\n\n //for every system list value, get the client list value\n\n for ($j = 0; $j < count($ClientValues); $j++) {\n if (strcmp($ClientValues[$j]['value'], $orderedSteps[$i]['stepType']) == 0) {\n //get the client id value\n $AppValueID = getAppListValueID_RelatedWith($ClientValues[$j]['valueID'], $clientID);\n\n if ($AppValueID > 0) {\n //Get the app value and add to client values\n $orderedSteps[$i]['scriptAppValue'] = getAppValue($AppValueID);\n } else {\n //Not related. Add an empty value\n $orderedSteps[$i]['scriptAppValue'] = 'undefined';\n }\n break;\n }\n }\n\n //Also, get their units and results\n // get params\n // get checked values\n $markedStepsUnitsIDs = explode(',', $orderedSteps[$i]['checkedValues']);\n\n $params = getParamsAndResultsForAStep($orderedSteps[$i], $studyID, $theSubjectID, $markedStepsUnitsIDs, $clientID);\n\n //Add every parameter to the results\n foreach ($params as $p) {\n\n //Check if the systemConversion value is a Selenium type\n\n if (base64_decode($p['systemConversionValue']) == 'stepUnit.type.seleniumResult') {\n $orderedSteps[$i]['stepUnit_SELENIUMRESULT_ID'] = $p['ID'];\n //Add the result id\n $orderedSteps[$i]['stepUnit_SELENIUM_LASTRESULT_ID'] = $p['resultID'];\n //Add the execution value\n $orderedSteps[$i]['stepUnit_SELENIUMRESULT_EXECVALUE'] = $p['executionValue'];\n }\n if (base64_decode($p['systemConversionValue']) == 'stepUnit.type.seleniumResultDescription') {\n $orderedSteps[$i]['stepUnit_SELENIUMRESULT_DESCRIPTION_ID'] = $p['ID'];\n //Add the result id\n $orderedSteps[$i]['stepUnit_SELENIUMDESCRIPTION_LASTRESULT_ID'] = $p['resultID'];\n\n }\n }\n $finalResult[] = $orderedSteps[$i];\n }\n\n }\n\n return $finalResult;\n}", "public function getRelations();", "public function getRelations();", "function requirement_get_test_details($req_id, $testset_id) {\n\n\t$tbl_test_req_assoc\t\t\t= TEST_REQ_ASSOC_TBL;\n\t$f_test_req_assoc_id\t\t= $tbl_test_req_assoc .\".\". TEST_REQ_ASSOC_ID;\n\t$f_test_req_assoc_test_id\t= $tbl_test_req_assoc .\".\". TEST_REQ_ASSOC_TEMPEST_TEST_ID;\n\t$f_test_req_assoc_req_id\t= $tbl_test_req_assoc .\".\". TEST_REQ_ASSOC_REQ_ID;\n\t$f_test_req_assoc_percent\t= $tbl_test_req_assoc .\".\". TEST_REQ_ASSOC_PERCENT_COVERED;\n\n\t$ts_assoc_tbl = TEST_TS_ASSOC_TBL;\n\t$f_ts_assoc_id = TEST_TS_ASSOC_TBL. \".\" .TEST_TS_ASSOC_ID;\n\t$f_ts_assoc_ts_id = TEST_TS_ASSOC_TBL. \".\" .TEST_TS_ASSOC_TS_ID;\n\t$f_ts_assoc_test_id = TEST_TS_ASSOC_TBL. \".\" .TEST_TS_ASSOC_TEST_ID;\n\t$f_ts_assoc_test_status = TEST_TS_ASSOC_TBL. \".\" .TEST_TS_ASSOC_STATUS;\n\t$f_ts_assoc_assigned_to = TEST_TS_ASSOC_TBL. \".\" .TEST_TS_ASSOC_ASSIGNED_TO;\n\t$f_ts_assoc_comments = TEST_TS_ASSOC_TBL. \".\" .TEST_TS_ASSOC_COMMENTS;\n\t$f_ts_assoc_timestamp = TEST_TS_ASSOC_TBL. \".\" .TEST_TS_ASSOC_TIMESTAMP;\n\n $tbl_test \t\t= TEST_TBL;\n\t$f_test_id\t\t\t\t= $tbl_test. \".\" .TEST_ID;\n\n\t$q = \"\tSELECT DISTINCT\n\t\t\t\t$f_test_req_assoc_test_id,\n\t\t\t\t$f_test_req_assoc_percent,\n\t\t\t\t$f_ts_assoc_test_status\n\t\t\tFROM $tbl_test_req_assoc\n\t\t\tINNER JOIN $tbl_test\n\t\t\t\tON $f_test_id = $f_test_req_assoc_test_id\n\t\t\tINNER JOIN $ts_assoc_tbl\n\t\t\t\tON $f_test_req_assoc_test_id = $f_ts_assoc_test_id\n\t\t\tWHERE $f_test_req_assoc_req_id = $req_id\n\t\t\t\tAND $f_ts_assoc_ts_id = $testset_id\";\n\n\tglobal $db;\n\n\t$rows = db_fetch_array($db, db_query($db, $q));\n\n\treturn $rows;\n}", "function testRdfsFModel()\n\t{\n\t\t$testURI='http://www.hpl.hp.com/semweb/2003/query_tester#';\n\t\t$testmodel=new MemModel($testURI);\n\t\t$testmodel->load(RDFS_INF_TESTFILES.'rdfs/manifest-standard.rdf');\n\t\t$i=1;\n\t\tdo \n\t\t{\n\t\t\t$inf= new RDFSBModel();\t\t\n\t\t\t#$inf->addModel($rdfsAxioms);\n\t\t\t$res1=$testmodel->find(new Resource(RDFS_INF_TESTFILES.'rdfs/test'.$i++),null,null);\n\t\t\tif ($res1->isEmpty())\n\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t$findTBOX=$res1->find(null,new Resource($testURI.'tbox'),null);\n\t\t\t$inf->load(RDFS_INF_TESTFILES.$findTBOX->triples[0]->getLabelObject());\n\t\n\t\t\t$findDATA=$res1->find(null,new Resource($testURI.'data'),null);\n\t\t\t$inf->load(RDFS_INF_TESTFILES.$findDATA->triples[0]->getLabelObject());\n\t\t\t\t\t\t\n\t\t\t$findQUERY=$res1->find(null,new Resource($testURI.'query'),null);\n\t\t\t$query =$this->_doFindFromFile(RDFS_INF_TESTFILES.$findQUERY->triples[0]->getLabelObject(),$inf);\n\t\t\t\n\t\t\t$result = new MemModel();\n\t\t\t$findRESULT=$res1->find(null,new Resource($testURI.'result'),null);\n\t\t\t$result->load(RDFS_INF_TESTFILES.$findRESULT->triples[0]->getLabelObject());\n\n\t\t\t$isEqual=$query->containsAll($result);\n\t\t\t\n\t\t\tif (!$isEqual)\n\t\t\t{\n\t\t\t\t$query->writeAsHtmlTable();\n\t\t\t\t$result->writeAsHtmlTable();\n\t\t\t\t$subtract=$result->subtract($query);\n\t\t\t\techo '<BR><BR>subtracted<BR>';\n\t\t\t\t$subtract->writeAsHtmlTable();\n\t\t\t\t\n\t\t\t};\n\t\t\t\n\t\t\t$findDATA=$res1->find(null,new Resource($testURI.'description'),null);\n\t\t\techo '<b>'.$findDATA->triples[0]->getLabelObject().' (RDFSFModel)</b><BR>';\n\t\t\t\n\t\t\t$this->assertTrue($isEqual);\n\t\n\t\t} while (true);\t\n\t}", "function getSubjectsForStudy($theStudyID, $clientID) {\n global $definitions;\n\n $subjectItemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['subject'], $clientID);\n $subjectStudy_PropID = getClientPropertyID_RelatedWith_byName($definitions['subjectStudyID'], $clientID);\n\n //First get the relation associated\n $returnProperties = array();\n\n //build an empty filter\n $filters = array();\n $filters[] = array('ID' => $subjectStudy_PropID, 'value' => $theStudyID);\n\n $subjects = getFilteredItemsIDs($subjectItemTypeID, $clientID, $filters, $returnProperties);\n\n return $subjects;\n\n}", "public function getRelAll ()\n {\n \treturn ($this->db_object->getRowsAll (\"Select * from \".$this->table_prefix.$this->quiz_tables['rel']));\n }", "function get_rad_surveys($conn, $sup_restriction = NULL, $start_restriction = NULL, $end_restriction = NULL) {\n\t$query_rad = \"SELECT * FROM rad_survey_comment, rad_header WHERE \" .\n\t\t \"rad_survey_comment.header_id = rad_header.header_id \" . \n\t\t ($sup_restriction !== NULL ? (' AND ' . get_sup_filter($sup_restriction, \"rad_header\")) : \"\") . \n\t\t ($start_restriction !== NULL ? (' AND (rad_header.date_start >= \"' . $start_restriction . \n\t\t '\" OR rad_header.date_end >= \"' . $start_restriction . '\") ') : \"\") . \n\t\t ($end_restriction !== NULL ? (' AND (rad_header.date_start <= \"' . $end_restriction . \n\t\t '\" OR rad_header.date_end <= \"' . $end_restriction . '\") ') : \"\");\n\treturn exec_query($conn, $query_rad);\n}", "protected static function _relations() {\n\n\t}", "function getTestCasesInsideACategory($testCategoryID, $theSubjectID, $roundID, $clientID) {\n global $definitions;\n\n $categoriesItemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['testcasescategory'], $clientID);\n $categoryParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasescategoryParentID'], $clientID);\n $testCasesArray = array();\n\n //First, get the internal structure of testCategories\n $tcatTree = getItemsTree($categoriesItemTypeID, $clientID, $categoryParentPropertyID, $testCategoryID);\n\n $idsToRetrieve = array();\n\n //Store all testCategories ids found in a plain array\n foreach ($tcatTree as $tc) {\n for ($j = 0; $j < count($tc); $j++) {\n if (!(in_array($tc[$j]['parent'], $idsToRetrieve))) {\n $idsToRetrieve[] = $tc[$j]['parent'];\n }\n if (!(in_array($tc[$j]['ID'], $idsToRetrieve))) {\n $idsToRetrieve[] = $tc[$j]['ID'];\n }\n }\n }\n\n //Get the relations item\n $relations = getRelations($roundID, $theSubjectID, $clientID);\n\n if ((count($relations) - 1) == 0) {\n //Get the test cases ids inside an array\n $idsToSearch = explode(',', $relations[0]['testCasesIDs']);\n for ($i = 0; $i < count($idsToRetrieve); $i++) {\n //Get the test cases and filter\n $availableTestCases = array();\n $availableTestCases = getFilteredTestCasesInsideCategory($idsToRetrieve[$i], $idsToSearch, $clientID);\n //And add to results\n for ($j = 0; $j < count($availableTestCases); $j++) {\n $partRes = array();\n $partRes['ID'] = $availableTestCases[$j]['ID'];\n $testCasesArray[] = $partRes;\n }\n }\n }\n\n return $testCasesArray;\n}", "function getTestCaseData($testCaseID, $theSubjectID, $roundID, $studyID, $clientID) {\n global $definitions;\n\n $testCaseParentTestCategoryPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID);\n\n $theTestCase = array();\n $theTestCase['TC_ID'] = $testCaseID;\n $theTestCase['ROUND_ID'] = $roundID;\n $theTestCase['STUDY_ID'] = $studyID;\n $theTestCase['SUBJECT_ID'] = $theSubjectID;\n\n //Also, get the parent testCategory for the test case\n $theTestCase['PARENT_TC_ID'] = getItemPropertyValue($testCaseID, $testCaseParentTestCategoryPropertyID, $clientID);\n\n //Get the steps for this testCase\n $theSteps = array();\n\n $theSteps = getStepsScriptsForTestCase($testCaseID, $theSubjectID, $roundID, $studyID, $clientID);\n //print(\"Steps scritps details for testCase $testCaseID and subject $theSubjectID\\n\\r\" );\n //print_r($theSteps);\n $stepsCount = 0;\n //Only returns the testcase if any step of the test case is automated and has the type passed (TODO this last)\n $hasAutomatedSteps = \"NO\";\n\n //Add the steps to the result\n for ($i = 0; $i < count($theSteps); $i++) {\n if ($theSteps[$i]['scriptAppValue'] == 'steps.types.php') {\n //print(\"found automated step\\n\\r\");\n $theTestCase['STEP_ID_' . $stepsCount] = $theSteps[$i]['ID'];\n $theTestCase['STEP_TYPE_' . $stepsCount] = $theSteps[$i]['stepType'];\n $theTestCase['STEP_APPTYPE_' . $stepsCount] = $theSteps[$i]['scriptAppValue'];\n $theTestCase['STEP_RESULT_ID_' . $stepsCount] = $theSteps[$i]['stepUnit_Result_ID'];\n //Get the stepUnits values\n\n if (isset($theSteps[$i]['stepUnit_SELENIUMRESULT_ID'])) {\n $theTestCase['STEP_STEPUNITS_SELENIUMRESULT_ID_' . $stepsCount] = $theSteps[$i]['stepUnit_SELENIUMRESULT_ID'];\n }\n if (isset($theSteps[$i]['stepUnit_SELENIUMRESULT_DESCRIPTION_ID'])) {\n $theTestCase['STEP_STEPUNITS_SELENIUMRESULT_DESCRIPTION_ID_' . $stepsCount] = $theSteps[$i]['stepUnit_SELENIUMRESULT_DESCRIPTION_ID'];\n }\n if (isset($theSteps[$i]['stepUnit_SELENIUM_LASTRESULT_ID'])) {\n $theTestCase['STEP_STEPUNITS_SELENIUMRESULT_LASTRESULT_ID_' . $stepsCount] = $theSteps[$i]['stepUnit_SELENIUM_LASTRESULT_ID'];\n\n }\n if (isset($theSteps[$i]['stepUnit_SELENIUMDESCRIPTION_LASTRESULT_ID'])) {\n $theTestCase['STEP_STEPUNITS_SELENIUMRESULTDESCRIPTION_LASTRESULT_ID_' . $stepsCount] = $theSteps[$i]['stepUnit_SELENIUMDESCRIPTION_LASTRESULT_ID'];\n\n }\n if (isset($theSteps[$i]['stepUnit_SELENIUMRESULT_EXECVALUE'])) {\n $theTestCase['STEP_STEPUNITS_SELENIUMRESULTEXECVALUE_' . $stepsCount] = $theSteps[$i]['stepUnit_SELENIUMRESULT_EXECVALUE'];\n\n }\n\n $stepsCount++;\n $hasAutomatedSteps = \"YES\";\n }\n }\n\n if ($hasAutomatedSteps == \"YES\") {\n //And return the test case\n //print (\"Return automated testCase: $testCaseID\\n\\r\");\n return $theTestCase;\n } else {\n //print (\"Not automated testCase $testCaseID. Return null\\n\\r\");\n return null;\n }\n\n}", "public function testCreateUnitRelationships()\n {\n }", "function dbplus_rzap($relation)\n{\n}", "function read_roster($roundid) {\n global $db;\n $roster = array();\n $stmt = $db->prepare('SELECT rosterid, Roster.racerid FROM Roster'\n .' INNER JOIN RegistrationInfo'\n .' ON Roster.racerid = RegistrationInfo.racerid'\n .' WHERE roundid = :roundid'\n .' AND passedinspection = 1'\n .' ORDER BY rosterid');\n $stmt->execute(array(':roundid' => $roundid));\n foreach ($stmt as $row) {\n $roster[] = $row['racerid'];\n }\n return $roster;\n}", "function test_getJoin()\n {\n $question = new MDB_QT(TABLE_QUESTION);\n $joinOn1 = TABLE_QUESTION.'.id='.TABLE_ANSWER.'.question_id';\n $question->setJoin(TABLE_ANSWER, $joinOn1);\n\n $all = array(\n 'default' => array(TABLE_ANSWER => $joinOn1),\n );\n $tables = array(TABLE_ANSWER);\n $right = array();\n $left = array();\n\n $this->assertEqual($all, $question->getJoin());\n $this->assertEqual($tables, $question->getJoin('tables'));\n $this->assertEqual($right, $question->getJoin('right'));\n $this->assertEqual($left, $question->getJoin('left'));\n\n //--------------------------------------------------------\n\n $joinOn2 = TABLE_USER.'.id='.TABLE_ANSWER.'.question_id';\n $question->setRightJoin(TABLE_USER, $joinOn2);\n\n $all = array(\n 'default' => array(TABLE_ANSWER => $joinOn1),\n 'right' => array(TABLE_USER => $joinOn2),\n );\n $tables = array(TABLE_ANSWER, TABLE_USER);\n $right = array(TABLE_USER => $joinOn2);\n $left = array();\n\n $this->assertEqual($all, $question->getJoin());\n $this->assertEqual($tables, $question->getJoin('tables'));\n $this->assertEqual($right, $question->getJoin('right'));\n $this->assertEqual($left, $question->getJoin('left'));\n }", "public function testGetSurvey0()\n {\n }", "public function testGetSurvey0()\n {\n }", "function okrs_relation_data($data, $type, $rel_id, $q)\n{\n\n $CI = &get_instance();\n $CI->load->model('okr/okr_model');\n\n if ($type == 'okrs') {\n if ($rel_id != '') {\n $data = $CI->okr_model->get_okrs($rel_id);\n } else {\n $data = [];\n }\n }\n return $data;\n}", "function test_getTrendingPromptrs()\n {\n $name = \"mikes 5 top interview questions\";\n $topic_id = 5;\n $trending_index = 3;\n $test_promptr = new Promptr($name, $topic_id, $trending_index);\n $test_promptr->save();\n\n $name2 = \"mikes 50 top interview questions\";\n $trending_index2 = 4;\n $test_promptr2 = new Promptr($name2, $topic_id, $trending_index2);\n $test_promptr2->save();\n\n $name3 = \"mikes 500 top interview questions\";\n $trending_index3 = 5;\n $test_promptr3 = new Promptr($name3, $topic_id, $trending_index3);\n $test_promptr3->save();\n\n $name4 = \"mikes 5000 top interview questions\";\n $trending_index4 = 6;\n $test_promptr4 = new Promptr($name4, $topic_id, $trending_index4);\n $test_promptr4->save();\n\n $name5 = \"mikes 50000 top interview questions\";\n $trending_index5 = 7;\n $test_promptr5 = new Promptr($name5, $topic_id, $trending_index5);\n $test_promptr5->save();\n\n $name6 = \"mikes 500000 top interview questions\";\n $trending_index6 = 8;\n $test_promptr6 = new Promptr($name6, $topic_id, $trending_index6);\n $test_promptr6->save();\n\n //Act\n $result = Promptr::getTrendingPromptrs();\n\n //Assert\n $this->assertEquals([$test_promptr6, $test_promptr5, $test_promptr4, $test_promptr3, $test_promptr2], $result);\n }", "function getPersons(){\n\t\t \n\t\t $linksObj = new dbXML_dbLinks;\n\t\t $creatorRels = $linksObj->relToCreator;\n\t\t $contribRels = $linksObj->relToContributor;\n\t\t \n\t\t $db = $this->startDB();\n\t\t $result = false;\n\t\t \n\t\t $sql = \"SELECT actTab.uuid, links.targ_uuid, links.link_type,\n\t\t persons.combined_name, persons.last_name, persons.first_name, persons.mid_init\n\t\t FROM \".$this->penelopeTabID.\" AS actTab\n\t\t JOIN links ON actTab.uuid = links.origin_uuid\n\t\t JOIN persons ON persons.uuid = links.targ_uuid\n\t\t WHERE links.targ_type LIKE '%person%' ;\n\t\t \";\n\t\t \n\t\t $resultA = $db->fetchAll($sql);\n\t\t \n\t\t $sql =\t\"\t\n\t\t\t\tSELECT actTab.uuid, links.targ_uuid, links.link_type, \n\t\t\t\tusers.combined_name, users.last_name, users.first_name, users.mid_init\n\t\t\t\tFROM \".$this->penelopeTabID.\" AS actTab\n\t\t\t\tJOIN links ON actTab.uuid = links.origin_uuid\n\t\t\t\tJOIN users ON users.uuid = links.targ_uuid\n\t\t\t\tWHERE links.targ_type LIKE '%person%'\n\t\t\t\t \n\t\t\t\t\";\n\t\t \n\t\t $resultB = $db->fetchAll($sql);\n\t\t if($resultA && $resultB){\n\t\t\t\t$result = array();\n\t\t\t\tforeach($resultA as $row){\n\t\t\t\t\t $ukey = md5($row[\"uuid\"].$row[\"targ_uuid\"].$row[\"link_type\"]);\n\t\t\t\t\t $result[$ukey] = $row;\n\t\t\t\t}\n\t\t\t\tforeach($resultB as $row){\n\t\t\t\t\t $ukey = md5($row[\"uuid\"].$row[\"targ_uuid\"].$row[\"link_type\"]);\n\t\t\t\t\t if(!array_key_exists($ukey, $result)){\n\t\t\t\t\t\t $result[$ukey] = $row;\n\t\t\t\t\t }\n\t\t\t\t}\n\t\t }\n\t\t elseif($resultB && !$resultA){\n\t\t\t\t$result = $resultB;\n\t\t }\n\t\t elseif(!$resultB && $resultA){\n\t\t\t\t$result = $resultA;\n\t\t }\n\t\t \n\t\t if($result){\n\t\t\t\t\n\t\t\t\t$rawCreators = array();\n\t\t\t\t$rawContributors = array();\n\t\t\t\t$persons = array();\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t $uuid = $row[\"targ_uuid\"];\n\t\t\t\t\t $uri = self::personBaseURI.$uuid;\n\t\t\t\t\t $name = $row[\"combined_name\"];\n\t\t\t\t\t $linkType = $row[\"link_type\"];\n\t\t\t\t\t if(in_array($linkType, $creatorRels)){\n\t\t\t\t\t\t if(!array_key_exists($uri, $rawCreators)){\n\t\t\t\t\t\t\t\t$rawCreators[$uri] = array(\"name\" => $name, \"count\" => 1);\n\t\t\t\t\t\t\t\t$rawCreators[$uri][\"rel\"] = $this->getLinkedPerson($uuid);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t else{\n\t\t\t\t\t\t\t\t$rawCreators[$uri][\"count\"] ++ ; \n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t elseif(in_array($linkType, $contribRels)){\n\t\t\t\t\t\t if(!array_key_exists($uri, $rawContributors)){\n\t\t\t\t\t\t\t\t$rawContributors[$uri] = array(\"name\" => $name, \"count\" => 1);\n\t\t\t\t\t\t\t\t$rawContributors[$uri][\"rel\"] = $this->getLinkedPerson($uuid);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t else{\n\t\t\t\t\t\t\t\t$rawContributors[$uri][\"count\"] = $rawContributors[$uri][\"count\"] + 1; \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 if(!array_key_exists($uri, $persons)){\n\t\t\t\t\t\t $persons[$uri] = array(\"name\" => $name, \"count\" => 1);\n\t\t\t\t\t\t $persons[$uri][\"rel\"] = $this->getLinkedPerson($uuid);\n\t\t\t\t\t }\n\t\t\t\t\t else{\n\t\t\t\t\t\t $persons[$uri][\"count\"] ++ ; \n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//combine URIs for the same person, choose the URI with the most associated items\n\t\t\t\t$rawCreators = $this->consolidateRelatedURIs($rawCreators);\n\t\t\t\t$rawContributors = $this->consolidateRelatedURIs($rawContributors);\n\t\t\t\t$persons = $this->consolidateRelatedURIs($persons);\n\t\t\t\t\n\t\t\t\t//sort the array by count, from high to low\n\t\t\t\t$rawCreators = $this->orderURIs($rawCreators);\n\t\t\t\t$rawContributors = $this->orderURIs($rawContributors);\n\t\t\t\t$persons = $this->orderURIs($persons);\n\t\t\t\t\n\t\t\t\t$this->rawCreators = $rawCreators;\n\t\t\t\t$this->rawContributors = $rawContributors;\n\t\t\t\t$this->rawLinkedPersons = $persons;\n\t\t\t\t\n\t\t }\n\t }" ]
[ "0.72404677", "0.5648223", "0.56259716", "0.5612863", "0.5479739", "0.54645437", "0.54273313", "0.536446", "0.53118503", "0.53118503", "0.53082985", "0.5284517", "0.5284517", "0.52818125", "0.5240556", "0.52320874", "0.5208981", "0.51988804", "0.5197865", "0.5194668", "0.5153721", "0.5137218", "0.51157314", "0.51145744", "0.5110855", "0.51073694", "0.51073694", "0.5067808", "0.5063032", "0.50480753" ]
0.7326091
0
This function returns all the testcases inside one group (and inside their categories and subcategories)
function getAllTestCasesInsideAGroup($groupID, $clientID) { global $definitions; //get item type $itemTypeTestCasesID = getClientItemTypeID_RelatedWith_byName($definitions['testcases'], $clientID); //get property $testCasesParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID); //get all categories inside group $onlyIds = getAllTestCategoriesInsideAGroup($groupID, $clientID); //Next, create a string with all the categories inside the group $toFilter = implode(',', $onlyIds); //Create the filter // build return properties array $returnProperties = array(); //build the filter $filters = array(); $filters[] = array('ID' => $testCasesParentPropertyID, 'value' => $toFilter, 'mode' => '<-IN'); $allTestCases = getFilteredItemsIDs($itemTypeTestCasesID, $clientID, $filters, $returnProperties); //Get only the testCategories ids $onlyIds = array(); foreach ($allTestCases as $tcas) { $onlyIds[] = $tcas['ID']; } return $onlyIds; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTestCasesInsideACategory($testCategoryID, $theSubjectID, $roundID, $clientID) {\n global $definitions;\n\n $categoriesItemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['testcasescategory'], $clientID);\n $categoryParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasescategoryParentID'], $clientID);\n $testCasesArray = array();\n\n //First, get the internal structure of testCategories\n $tcatTree = getItemsTree($categoriesItemTypeID, $clientID, $categoryParentPropertyID, $testCategoryID);\n\n $idsToRetrieve = array();\n\n //Store all testCategories ids found in a plain array\n foreach ($tcatTree as $tc) {\n for ($j = 0; $j < count($tc); $j++) {\n if (!(in_array($tc[$j]['parent'], $idsToRetrieve))) {\n $idsToRetrieve[] = $tc[$j]['parent'];\n }\n if (!(in_array($tc[$j]['ID'], $idsToRetrieve))) {\n $idsToRetrieve[] = $tc[$j]['ID'];\n }\n }\n }\n\n //Get the relations item\n $relations = getRelations($roundID, $theSubjectID, $clientID);\n\n if ((count($relations) - 1) == 0) {\n //Get the test cases ids inside an array\n $idsToSearch = explode(',', $relations[0]['testCasesIDs']);\n for ($i = 0; $i < count($idsToRetrieve); $i++) {\n //Get the test cases and filter\n $availableTestCases = array();\n $availableTestCases = getFilteredTestCasesInsideCategory($idsToRetrieve[$i], $idsToSearch, $clientID);\n //And add to results\n for ($j = 0; $j < count($availableTestCases); $j++) {\n $partRes = array();\n $partRes['ID'] = $availableTestCases[$j]['ID'];\n $testCasesArray[] = $partRes;\n }\n }\n }\n\n return $testCasesArray;\n}", "function getAllTestCategoriesInsideAGroup($groupID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesCategoriesID = getClientItemTypeID_RelatedWith_byName($definitions['testcasescategory'], $clientID);\n\n //get property\n $testCategoryParentGroupID = getClientPropertyID_RelatedWith_byName($definitions['testcasescategoryGroupID'], $clientID);\n\n //First, we need get all the categories that has the parent groupID\n // build return properties array\n $returnProperties = array();\n\n //build the filter\n $filters = array();\n $filters[] = array('ID' => $testCategoryParentGroupID, 'value' => $groupID);\n\n $testCategories = getFilteredItemsIDs($itemTypeTestCasesCategoriesID, $clientID, $filters, $returnProperties);\n\n //Get only the testCategories ids\n $onlyIds = array();\n\n foreach ($testCategories as $tcat) {\n $onlyIds[] = $tcat['ID'];\n }\n\n return $onlyIds;\n}", "function drush_test_list($groups) {\n foreach ($groups as $group_name => $group_tests) {\n foreach ($group_tests as $test_class => $test_info) {\n $rows[] = array('group' => $group_name, 'class' => $test_class, 'name' => $test_info['name']);\n }\n }\n return $rows;\n}", "function getAllTestCasesInsideCategory($parentCategoryID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesID = getClientItemTypeID_RelatedWith_byName($definitions['testcases'], $clientID);\n\n //get property\n $testCasesParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID);\n\n //get all categories inside\n $allCategories = getAllTestCategoriesInsideACategory($parentCategoryID, $clientID);\n\n $toFilter = implode(',', $allCategories);\n\n //When we have all the categories inside, get their test cases\n //Create the filter\n // build return properties array\n $returnProperties = array();\n\n //build an empty filter\n $filters = array();\n $filters[] = array('ID' => $testCasesParentPropertyID, 'value' => $toFilter, 'mode' => '<-IN');\n\n $testCases = getFilteredItemsIDs($itemTypeTestCasesID, $clientID, $filters, $returnProperties);\n\n //Get only the testCategories ids\n $onlyIds = array();\n\n foreach ($testCases as $tcas) {\n $onlyIds[] = $tcas['ID'];\n }\n\n return $onlyIds;\n}", "public function getTestCases ()\n {\n return $this->_testCases;\n }", "function simpletest_drush_test_groups($tests) {\n $groups = array();\n foreach (simpletest_categorize_tests($tests) as $name => $group) {\n $sanitized = strtr($name, array(' ' => ''));\n $groups[$sanitized] = $group;\n }\n return $groups;\n}", "public function getTests();", "function listTestCategory() {\n\t\t$this->db->select('*');\n\t\t$this->db->from($this->test_category_table);\n\t\t$this->db->where('status !=', 0);\n $query = $this->db->get();\n\t\treturn $query->result();\n\t}", "function getAllTestCategoriesInsideACategory($parentCategoryID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesCategoriesID = getClientItemTypeID_RelatedWith_byName($definitions['testcasescategory'], $clientID);\n\n //get property\n $testCategoryParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasescategoryParentID'], $clientID);\n\n //First, we need the tree categories\n $tree = getItemsTree($itemTypeTestCasesCategoriesID, $clientID, $testCategoryParentPropertyID, $parentCategoryID);\n\n //Transform the items tree and store the ids in an unidimensional array\n $allCategories = array();\n\n //First, add the parentCategoryID\n $allCategories[] = $parentCategoryID;\n\n if ($tree) {\n foreach ($tree as $parid => $parent) {\n\n if (!in_array($parid, $allCategories)) {\n //Add the value\n $allCategories[] = $parid;\n }\n\n foreach ($parent as $child) {\n $id = $child['ID'];\n\n //Check if the values does not exist in the allCategories array.\n if (!in_array($id, $allCategories)) {\n //Add the value\n $allCategories[] = $id;\n }\n }\n }\n }\n\n //And return the testCategories\n return ($allCategories);\n}", "function drush_test_xml_results($test_id, $dir, $info) {\n $dir = is_string($dir) ? $dir : '.';\n\n // Get an array of test result objects from the database.\n if (drush_drupal_major_version() >= 7) {\n $results = db_query(\"SELECT * FROM {simpletest} WHERE test_id = :test_id ORDER BY test_class, message_id\", array(':test_id' => $test_id));\n }\n else {\n $result = db_query(\"SELECT * FROM {simpletest} WHERE test_id = %d ORDER BY test_class, message_id\", $test_id);\n $results = array();\n while ($row = db_fetch_object($result)) {\n $results[] = $row;\n }\n }\n\n // Collect and aggregate the data from simpletest.\n $test_suites = array();\n foreach ($results as $result) {\n // Create test_suite object.\n // Formatting name so it becomes \"group.name\" without any other dots. Jenkins uses string splitting on dots to gather info.\n $test_suite_name = str_replace('.', '', $info['group']) . '.' . str_replace('.', '', $info['name']);\n if (!isset($test_suites[$test_suite_name])) {\n $test_suite = new stdClass();\n $test_suite->name = $test_suite_name;\n $test_suite->test_cases = array();\n $test_suites[$test_suite_name] = $test_suite;\n }\n else {\n $test_suite = $test_suites[$test_suite_name];\n }\n // Create test_case object.\n list(, $test_case_name) = explode('->', $result->function, 2);\n if (empty($test_case_name)) {\n // There is no '->' present on static function calls. Use the whole string in those cases.\n $test_case_name = $result->function;\n }\n $test_case_name = str_replace('.', '', $test_case_name); // Remove those dots Jenkins loves so much.\n if (!isset($test_suite->test_cases[$test_case_name])) {\n $test_case = new stdClass();\n $test_case->name = $test_case_name;\n $test_case->failure_message = '';\n $test_case->error_message = '';\n $test_case->system_out = '';\n $test_case->system_err = '';\n $test_suite->test_cases[$test_case_name] = $test_case;\n }\n else {\n $test_case = $test_suite->test_cases[$test_case_name];\n }\n // Prepare message.\n $status = str_pad($result->status . ':', 10);\n $message = strip_tags($result->message, '<a>'); // Jenkins encodes the output so don't use any tags.\n $message = preg_replace('/<a.*?href=\"([^\"]+)\".*?>(.*?)<\\/a>/', '$1 $2', $message); // Jenkins will turn urls into clickable links.\n $message = $status . ' [' . $result->message_group . '] ' . $message . ' [' . basename($result->file) . ':' . $result->line . \"]\\n\";\n // Everything is logged in system_out.\n $test_case->system_out .= $message;\n // Failures go to failures.\n if ($result->status == 'fail') {\n $test_case->failure_message .= $message;\n }\n // Exceptions go both to errors and system_err.\n if ($result->status == 'exception') {\n $test_case->error_message .= $message;\n $test_case->system_err .= $message;\n }\n }\n\n // Build an XML document from our results.\n $xml = new DOMDocument('1.0', 'UTF-8');\n foreach ($test_suites as $test_suite) {\n $test_suite_element = $xml->createElement('testsuite');\n $test_suite_element->setAttribute('name', $test_suite->name);\n foreach ($test_suite->test_cases as $test_case) {\n $test_case_element = $xml->createElement('testcase');\n $test_case_element->setAttribute('name', $test_case->name);\n if (!empty($test_case->failure_message)) {\n $failure_element = $xml->createElement('failure');\n $failure_element->setAttribute('message', $test_case->failure_message);\n $test_case_element->appendChild($failure_element);\n }\n if (!empty($test_case->error_message)) {\n $error_element = $xml->createElement('error');\n $error_element->setAttribute('message', $test_case->error_message);\n $test_case_element->appendChild($error_element);\n }\n if (!empty($test_case->system_out)) {\n $system_out_element = $xml->createElement('system-out');\n $system_out_element->appendChild($xml->createTextNode($test_case->system_out));\n $test_case_element->appendChild($system_out_element);\n }\n if (!empty($test_case->system_err)) {\n $system_err_element = $xml->createElement('system-err');\n $system_err_element->appendChild($xml->createTextNode($test_case->system_err));\n $test_case_element->appendChild($system_err_element);\n }\n $test_suite_element->appendChild($test_case_element);\n }\n $xml->appendChild($test_suite_element);\n }\n // Save to disk.\n file_put_contents($dir . '/testsuite-' . $test_id . '.xml', $xml->saveXML());\n}", "function getFilteredTestCasesInsideCategory($parentCategoryID, $idsToSearch, $clientID) {\n global $definitions;\n\n $testcasesItemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['testcases'], $clientID);\n $testCaseParentTestCategoryPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID);\n $testcasesNamePropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesName'], $clientID);\n $testcasesOrderPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesOrder'], $clientID);\n\n // build return properties array\n $returnProperties = array();\n $returnProperties[] = array('ID' => $testcasesNamePropertyID, 'name' => 'testcaseName');\n $returnProperties[] = array('ID' => $testCaseParentTestCategoryPropertyID, 'name' => 'testCategoryParentID');\n $returnProperties[] = array('ID' => $testcasesOrderPropertyID, 'name' => 'order');\n\n //build an empty filter\n $filters = array();\n $filters[] = array('ID' => $testCaseParentTestCategoryPropertyID, 'value' => $parentCategoryID);\n\n $testCases = getFilteredItemsIDs($testcasesItemTypeID, $clientID, $filters, $returnProperties);\n\n //Next, clear all the test cases that are not inside the relation\n $appliedTestCases = array();\n for ($i = 0; $i < count($testCases); $i++) {\n if (in_array($testCases[$i]['ID'], $idsToSearch)) {\n $appliedTestCases[] = $testCases[$i];\n }\n }\n //And return the testCases\n return ($appliedTestCases);\n}", "public function getTestcases() {\n if ($this->graded_testcases === null) {\n $this->loadTestcases();\n }\n return $this->graded_testcases;\n }", "public function run()\n {\n $data = [\n \t\t[//CG1\n \t\t\t'categorygroup_id' => 'CG1',\n \t\t\t'categoryid' => 'C01',\n \t\t\t'categoryname' => 'Đầm Nữ',\n \t\t\t'created_at' => date('Y-m-d H:i:s'),\n \t\t\t'updated_at' => date('Y-m-d H:i:s'),\n \t\t], [\n \t\t\t'categorygroup_id' => 'CG1',\n \t\t\t'categoryid' => 'C02',\n \t\t\t'categoryname' => 'Áo Nữ',\n \t\t\t'created_at' => date('Y-m-d H:i:s'),\n \t\t\t'updated_at' => date('Y-m-d H:i:s'),\n \t\t], [\n \t\t\t'categorygroup_id' => 'CG1',\n \t\t\t'categoryid' => 'C03',\n \t\t\t'categoryname' => 'Quần Nữ',\n \t\t\t'created_at' => date('Y-m-d H:i:s'),\n \t\t\t'updated_at' => date('Y-m-d H:i:s'),\n \t\t], [\n \t\t\t'categorygroup_id' => 'CG1',\n \t\t\t'categoryid' => 'C04',\n \t\t\t'categoryname' => 'Chân Váy',\n \t\t\t'created_at' => date('Y-m-d H:i:s'),\n \t\t\t'updated_at' => date('Y-m-d H:i:s'),\n \t\t], [\n \t\t\t'categorygroup_id' => 'CG1',\n \t\t\t'categoryid' => 'C05',\n \t\t\t'categoryname' => 'Bộ Liền',\n \t\t\t'created_at' => date('Y-m-d H:i:s'),\n \t\t\t'updated_at' => date('Y-m-d H:i:s'),\n \t\t],//END CG1\n \t\t[//CG2\n \t\t\t'categorygroup_id' => 'CG2',\n \t\t\t'categoryid' => 'C06',\n \t\t\t'categoryname' => 'Đầm Nữ',\n \t\t\t'created_at' => date('Y-m-d H:i:s'),\n \t\t\t'updated_at' => date('Y-m-d H:i:s'),\n \t\t], [\n \t\t\t'categorygroup_id' => 'CG2',\n \t\t\t'categoryid' => 'C07',\n \t\t\t'categoryname' => 'Áo Nữ',\n \t\t\t'created_at' => date('Y-m-d H:i:s'),\n \t\t\t'updated_at' => date('Y-m-d H:i:s'),\n \t\t], [\n \t\t\t'categorygroup_id' => 'CG2',\n \t\t\t'categoryid' => 'C08',\n \t\t\t'categoryname' => 'Quần Nữ',\n \t\t\t'created_at' => date('Y-m-d H:i:s'),\n \t\t\t'updated_at' => date('Y-m-d H:i:s'),\n \t\t], [\n \t\t\t'categorygroup_id' => 'CG2',\n \t\t\t'categoryid' => 'C09',\n \t\t\t'categoryname' => 'Chân Váy',\n \t\t\t'created_at' => date('Y-m-d H:i:s'),\n \t\t\t'updated_at' => date('Y-m-d H:i:s'),\n \t\t], [\n \t\t\t'categorygroup_id' => 'CG2',\n \t\t\t'categoryid' => 'C10',\n \t\t\t'categoryname' => 'Bộ Liền',\n \t\t\t'created_at' => date('Y-m-d H:i:s'),\n \t\t\t'updated_at' => date('Y-m-d H:i:s'),\n \t\t],//END CG2\n \t\t[//CG3\n \t\t\t'categorygroup_id' => 'CG3',\n \t\t\t'categoryid' => 'C11',\n \t\t\t'categoryname' => 'Sản Phẩm Mẹ',\n \t\t\t'created_at' => date('Y-m-d H:i:s'),\n \t\t\t'updated_at' => date('Y-m-d H:i:s'),\n \t\t], [\n \t\t\t'categorygroup_id' => 'CG3',\n \t\t\t'categoryid' => 'C12',\n \t\t\t'categoryname' => 'Sản Phẩm Bé',\n \t\t\t'created_at' => date('Y-m-d H:i:s'),\n \t\t\t'updated_at' => date('Y-m-d H:i:s'),\n \t\t]\n \t];\n\n DB::table('categories')->insert($data);\n }", "public function provideValidCategoryGroups()\n {\n return [\n 'emptyArray' => [\n 'CategoryGroups' => [],\n 'expectedResult' => [],\n ],\n 'single group' => [\n 'CategoryGroups' => [\n 'group1' => $this->getMockCategoryGroup(1),\n ],\n 'expectedResult' => [\n 'groupHandle1' => [\n 'name' => 'groupName1',\n 'hasUrls' => null,\n 'template' => null,\n 'maxLevels' => null,\n 'locales' => [\n 'en' => [\n 'urlFormat' => null,\n 'nestedUrlFormat' => null,\n ],\n ],\n 'fieldLayout' => [\n 'fields' => [],\n ],\n ],\n ],\n ],\n 'multiple groups' => [\n 'CategoryGroups' => [\n 'group1' => $this->getMockCategoryGroup(1),\n 'group2' => $this->getMockCategoryGroup(2),\n ],\n 'expectedResult' => [\n 'groupHandle1' => [\n 'name' => 'groupName1',\n 'hasUrls' => null,\n 'template' => null,\n 'maxLevels' => null,\n 'locales' => [\n 'en' => [\n 'urlFormat' => null,\n 'nestedUrlFormat' => null,\n ],\n ],\n 'fieldLayout' => [\n 'fields' => [],\n ],\n ],\n 'groupHandle2' => [\n 'name' => 'groupName2',\n 'hasUrls' => null,\n 'template' => null,\n 'maxLevels' => null,\n 'locales' => [\n 'en' => [\n 'urlFormat' => null,\n 'nestedUrlFormat' => null,\n ],\n ],\n 'fieldLayout' => [\n 'fields' => [],\n ],\n ],\n ],\n ],\n ];\n }", "public function testGroups(): void\n {\n $process = $this->phpbench(\n 'run --group=do_nothing --dump --progress=none benchmarks/set1/BenchmarkBench.php'\n );\n\n $this->assertExitCode(0, $process);\n $output = $process->getOutput();\n $this->assertXPathCount(1, $output, '//subject');\n }", "public function getPartialTreeDataProvider()\n {\n // Case #0.\n $cat1 = $this->buildCategory(\n [\n 'id' => 'cat1',\n 'active' => true,\n 'sort' => 1,\n 'left' => 2,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ]\n );\n\n $out[] = [new \\ArrayIterator([$cat1]), 5, 'cat1', [$cat1]];\n\n // Case #1 test finding in deeper level with multiple side categories.\n $cat2 = $this->buildCategory(\n [\n 'id' => 'cat2',\n 'active' => true,\n 'sort' => 2,\n 'left' => 8,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ]\n );\n\n $cat3 = $this->buildCategory(\n [\n 'id' => 'cat3',\n 'active' => true,\n 'sort' => 1,\n 'left' => 1,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n 'current' => true,\n 'expanded' => true,\n ]\n );\n\n $cat4 = $this->buildCategory(\n [\n 'id' => 'cat4',\n 'active' => true,\n 'sort' => 1,\n 'left' => 3,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ]\n );\n\n $cat41 = $this->buildCategory(\n [\n 'id' => 'cat41',\n 'active' => true,\n 'sort' => 1,\n 'left' => 4,\n 'parent_id' => 'cat4',\n 'level' => 2,\n ]\n );\n\n $cat42 = $this->buildCategory(\n [\n 'id' => 'cat42',\n 'active' => true,\n 'sort' => 1,\n 'left' => 5,\n 'parent_id' => 'cat4',\n 'level' => 2,\n ]\n );\n\n $cat421 = $this->buildCategory(\n [\n 'id' => 'cat421',\n 'active' => true,\n 'sort' => 2,\n 'left' => 7,\n 'parent_id' => 'cat42',\n 'level' => 3,\n ]\n );\n\n $tree = [$cat1, $cat2, $cat3, $cat4];\n\n $cat4->setChild('cat42', $cat42);\n $cat4->setChild('cat41', $cat41);\n $cat42->setChild('cat421', $cat421);\n\n $out[] = [new \\ArrayIterator($tree), 5, 'cat42', [$cat42]];\n\n // Case #2 test with improper arguments.\n $out[] = [[], 0, null, null, 'Category Id must be defined on getPartialTree() method'];\n\n return $out;\n }", "public static function getGroups(): array\n {\n return ['test'];\n }", "function getTestCasesInsideCategory($parentCategoryID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesID = getClientItemTypeID_RelatedWith_byName($definitions['testcases'], $clientID);\n\n //get property\n $testCasesParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID);\n\n // build return properties array\n $returnProperties = array();\n\n //build an empty filter\n $filters = array();\n $filters[] = array('ID' => $testCasesParentPropertyID, 'value' => $parentCategoryID);\n\n $testCases = getFilteredItemsIDs($itemTypeTestCasesID, $clientID, $filters, $returnProperties);\n\n //Get only the testCategories ids\n $onlyIds = array();\n\n foreach ($testCases as $tcas) {\n $onlyIds[] = $tcas['ID'];\n }\n\n return $onlyIds;\n}", "public static function suite() {\n\n\t\t$suite = new PHPUnit_Framework_TestSuite('All Collectionable plugin tests');\n\n\t\t$basePath = App::pluginPath('Collectionable') . 'Test' . DS . 'Case' . DS;\n\t\t$it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($basePath));\n\n\t\twhile ($it->valid()) {\n\n\t\t\tif (!$it->isDot()) {\n\t\t\t\t$file = $it->key();\n\t\t\t\tif (preg_match('|Test\\.php$|', $file) && $file !== __FILE__) {\n\t\t\t\t\t$suite->addTestFile($file);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$it->next();\n\t\t}\n\n\t\treturn $suite;\n\n\t}", "function get_categories_by_group()\n\t{\n\t\t// get variables\n\t\t$vars = $this->_get_vars('get', array('group_id'));\n\n\t\t// start hook\n\t\t$vars = $this->_hook('get_categories_by_group_start', $vars);\n\n\t\t// load channel data library\n\t\t$this->_load_library('channel_data');\n\n\t\t$data = $this->EE->channel_data_lib->get_category_by_group($vars['group_id'])->result();\n\n\t\t// end hook\n\t\t$data = $this->_hook('get_categories_by_group_end', $data);\n\n\t\t$this->response($data);\n\t}", "public function getTestResultsData()\n {\n $out = [];\n\n // Case #0, sorted in default acceding\n $out[] = [\n [\n 'green',\n 'yellow',\n 'red',\n 'blue',\n ],\n 'sc'\n ];\n\n // Case #1, sorted in descending order by term, blue is prioritized.\n $out[] = [\n [\n 'acme',\n 'bar',\n 'foo',\n ],\n 'sc_zero_choices'\n ];\n\n // Case #2, all items prioritized, so sorting shouldn't matter.\n $out[] = [\n [\n 'blue',\n 'green',\n ],\n 'sc_sort_term_a'\n ];\n\n // Case #3, sort items by count, red prioritized.\n $out[] = [\n [\n 'yellow',\n ],\n 'sc_sort_term_d'\n ];\n\n // Case #4\n $out[] = [\n [\n 'blue',\n 'red',\n 'green',\n 'yellow'\n ],\n 'sc_sort_count'\n ];\n\n // Case #5 with selected man\n $out[] = [\n [\n 'yellow',\n 'red',\n 'blue',\n ],\n 'sc',\n ['manufacturer' => 'a']\n ];\n\n // Case #6 with selected man with zero choices\n $out[] = [\n [\n 'acme',\n 'foo',\n 'bar',\n ],\n 'sc_zero_choices',\n ['manufacturer' => 'a']\n ];\n\n // Case #7 with selected man with zero choices\n $out[] = [\n [\n 'yellow',\n 'red',\n 'blue',\n 'green',\n ],\n 'sc_zero_choices_color',\n ['manufacturer' => 'a']\n ];\n\n return $out;\n }", "public function testGetItemSubCategoryByFilter()\n {\n }", "private function getCaseNodes(): array\n {\n $caseNodes = $this->xml->xpath('//testcase');\n $cases = [];\n foreach ($caseNodes as $node) {\n $caseFilename = (string) $node['file'];\n if (! isset($cases[$caseFilename])) {\n $cases[$caseFilename] = [];\n }\n\n $cases[$caseFilename][] = $node;\n }\n\n return $cases;\n }", "public function testListCategories()\n {\n }", "public function getCategorys()\r\n {\r\n $groupData = $this->getGroupById();\r\n $html = null;\r\n if ($groupData) {\r\n foreach (explode(',', $groupData['categorys']) as $categoryId) {\r\n if ($categoryId) {\r\n $itemCategorys = $this->itemCollectionFactory->create()\r\n ->addFieldToFilter('category_id', array('eq' => $categoryId))\r\n ->addFieldToFilter('status', array('eq' => 1))\r\n ->addFieldToFilter('menu_type', array('eq' => 1));\r\n if ($itemCategorys->getData()) {\r\n foreach ($itemCategorys as $item) {\r\n $html .= $this->getMegamenuHtml($item);\r\n continue;\r\n }\r\n } else {\r\n $category = $this->getCategoryById($categoryId);\r\n if ($category) {\r\n $parentClass = ($this->hasSubcategory($category->getId())) ? 'parent' : null;\r\n $html .= '<li class=\"' . $this->checkCurrentCategory($category->getId()) . ' ui-menu-item level0 ' . $this->getMenuTypeGroup($groupData['menu_type']) . ' ' . $parentClass . ' \">';\r\n $html .= '<a href=\"' . $category->getUrl() . '\" class=\"level-top\"><span>' . $category->getName() . '</span></a>';\r\n if ($this->hasSubcategory($category->getId())) {\r\n $html .= '<div class=\"open-children-toggle\"></div>';\r\n }\r\n //get html of category\r\n $html .= $this->getHtmlCategory($category,\r\n $this->getMenuTypeGroup($groupData['menu_type']));\r\n $html .= '</li>';\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return $html;\r\n }", "public function runTests()\n {\n $this->testCase(1, array (1, 1));\n $this->testCase(2, array (1, 2));\n $this->testCase(3, array (2, 2));\n $this->testCase(4, array (2, 2));\n $this->testCase(5, array (2, 3));\n $this->testCase(6, array (2, 3));\n $this->testCase(7, array (3, 3));\n $this->testCase(8, array (3, 3));\n $this->testCase(9, array (3, 3));\n $this->testCase(10, array(2, 5));\n $this->testCase(11, array(3, 4));\n $this->testCase(12, array(3, 4));\n $this->testCase(13, array(4, 4));\n $this->testCase(14, array(4, 4));\n $this->testCase(15, array(4, 4));\n $this->testCase(16, array(4, 4));\n $this->testCase(17, array(3, 6));\n $this->testCase(18, array(3, 6));\n $this->testCase(19, array(4, 5));\n $this->testCase(20, array(4, 5));\n $this->testCase(21, array(3, 7));\n $this->testCase(22, array(5, 5));\n $this->testCase(23, array(5, 5));\n $this->testCase(24, array(5, 5));\n $this->testCase(25, array(5, 5));\n $this->testCase(26, array(4, 7));\n $this->testCase(27, array(4, 7));\n $this->testCase(28, array(4, 7));\n $this->testCase(29, array(5, 6));\n $this->testCase(30, array(5, 6));\n $this->testCase(31, array(4, 8));\n $this->testCase(32, array(4, 8));\n $this->testCase(33, array(6, 6));\n $this->testCase(34, array(6, 6));\n $this->testCase(35, array(6, 6));\n $this->testCase(36, array(6, 6));\n $this->testCase(37, array(5, 8));\n $this->testCase(38, array(5, 8));\n $this->testCase(39, array(5, 8));\n $this->testCase(40, array(5, 8));\n $this->testCase(41, array(6, 7));\n $this->testCase(42, array(6, 7));\n $this->testCase(43, array(5, 9));\n $this->testCase(44, array(5, 9));\n $this->testCase(45, array(5, 9));\n $this->testCase(46, array(7, 7));\n $this->testCase(47, array(7, 7));\n $this->testCase(48, array(7, 7));\n $this->testCase(49, array(7, 7));\n $this->testCase(50, array(5, 10));\n $this->testCase(51, array(6, 9));\n $this->testCase(52, array(6, 9));\n $this->testCase(53, array(6, 9));\n $this->testCase(54, array(6, 9));\n $this->testCase(55, array(7, 8));\n $this->testCase(56, array(7, 8));\n $this->testCase(57, array(6, 10));\n $this->testCase(58, array(6, 10));\n $this->testCase(59, array(6, 10));\n $this->testCase(60, array(6, 10));\n $this->testCase(61, array(8, 8));\n $this->testCase(62, array(8, 8));\n $this->testCase(63, array(8, 8));\n $this->testCase(64, array(8, 8));\n $this->testCase(65, array(6, 11));\n $this->testCase(66, array(6, 11));\n $this->testCase(67, array(7, 10));\n $this->testCase(68, array(7, 10));\n $this->testCase(69, array(7, 10));\n $this->testCase(70, array(7, 10));\n $this->testCase(71, array(8, 9));\n $this->testCase(72, array(8, 9));\n $this->testCase(73, array(7, 11));\n $this->testCase(74, array(7, 11));\n $this->testCase(75, array(7, 11));\n $this->testCase(76, array(7, 11));\n $this->testCase(77, array(7, 11));\n $this->testCase(78, array(9, 9));\n $this->testCase(79, array(9, 9));\n $this->testCase(80, array(9, 9));\n $this->testCase(81, array(9, 9));\n $this->testCase(82, array(7, 12));\n $this->testCase(83, array(7, 12));\n $this->testCase(84, array(7, 12));\n $this->testCase(85, array(8, 11));\n $this->testCase(86, array(8, 11));\n $this->testCase(87, array(8, 11));\n $this->testCase(88, array(8, 11));\n $this->testCase(89, array(9, 10));\n $this->testCase(90, array(9, 10));\n $this->testCase(91, array(7, 13));\n $this->testCase(92, array(8, 12));\n $this->testCase(93, array(8, 12));\n $this->testCase(94, array(8, 12));\n $this->testCase(95, array(8, 12));\n $this->testCase(96, array(8, 12));\n $this->testCase(97, array(10, 10));\n $this->testCase(98, array(10, 10));\n $this->testCase(99, array(10, 10));\n $this->testCase(100, array(10, 10));\n }", "public function get_all_tests()\n\t{\n\t\treturn $this->db->get('test')->result();\n\t}", "public static function suite() {\n\t\t$suite = new CakeTestSuite('All Indicadores Tests');\n\t\t$suite->addTestDirectoryRecursive(App::pluginPath('Indicadores') . 'Test' . DS . 'Case' . DS);\n\n\t\treturn $suite;\n\t}", "function getTests(){\n $listOfAvailableTests = parent::getTests();\n $url = get_instance()->uri->uri_string();\n $listOfSubTests = trim(Text::getSubstringAfter($url, '/subtests/'));\n if($listOfSubTests){\n $listOfSubTests = explode(',', $listOfSubTests);\n foreach($listOfSubTests as $key => &$subTest){\n $subTest = trim($subTest);\n if(!in_array($subTest, $listOfAvailableTests)){\n unset($listOfSubTests[$key]);\n echo \"Test '$subTest' does not exist as a test within \" . $this->getLabel() . \"<br/>\";\n }\n }\n $listOfSkippedTests = array_diff($listOfAvailableTests, $listOfSubTests);\n $this->reporter->paintSkip(count($listOfSkippedTests) . \" tests not run.\");\n $listOfAvailableTests = $listOfSubTests;\n }\n return $listOfAvailableTests;\n }", "function getParentCategoriesForTestCase($testCaseID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesID = getClientItemTypeID_RelatedWith_byName($definitions['testcases'], $clientID);\n\n //get property\n $testCasesParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID);\n\n //First, get the parent test category for the test case\n $categoryID = getItemPropertyValue($testCaseID, $testCasesParentPropertyID, $clientID);\n\n //return all categories\n return getParentCategoriesForCategory($categoryID, $clientID);\n}" ]
[ "0.70565355", "0.6960221", "0.6703277", "0.6524542", "0.6343473", "0.62679315", "0.6077294", "0.6069568", "0.6024369", "0.5877993", "0.58598197", "0.58119255", "0.57896143", "0.57848513", "0.5781865", "0.57703596", "0.57599324", "0.5756043", "0.57417434", "0.574049", "0.5717577", "0.5707189", "0.56708956", "0.56266", "0.5623265", "0.561016", "0.56050223", "0.5597238", "0.55620104", "0.5556615" ]
0.7521374
0
This function returns all the testcases inside one parent category and their subcategories
function getAllTestCasesInsideCategory($parentCategoryID, $clientID) { global $definitions; //get item type $itemTypeTestCasesID = getClientItemTypeID_RelatedWith_byName($definitions['testcases'], $clientID); //get property $testCasesParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID); //get all categories inside $allCategories = getAllTestCategoriesInsideACategory($parentCategoryID, $clientID); $toFilter = implode(',', $allCategories); //When we have all the categories inside, get their test cases //Create the filter // build return properties array $returnProperties = array(); //build an empty filter $filters = array(); $filters[] = array('ID' => $testCasesParentPropertyID, 'value' => $toFilter, 'mode' => '<-IN'); $testCases = getFilteredItemsIDs($itemTypeTestCasesID, $clientID, $filters, $returnProperties); //Get only the testCategories ids $onlyIds = array(); foreach ($testCases as $tcas) { $onlyIds[] = $tcas['ID']; } return $onlyIds; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllTestCategoriesInsideACategory($parentCategoryID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesCategoriesID = getClientItemTypeID_RelatedWith_byName($definitions['testcasescategory'], $clientID);\n\n //get property\n $testCategoryParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasescategoryParentID'], $clientID);\n\n //First, we need the tree categories\n $tree = getItemsTree($itemTypeTestCasesCategoriesID, $clientID, $testCategoryParentPropertyID, $parentCategoryID);\n\n //Transform the items tree and store the ids in an unidimensional array\n $allCategories = array();\n\n //First, add the parentCategoryID\n $allCategories[] = $parentCategoryID;\n\n if ($tree) {\n foreach ($tree as $parid => $parent) {\n\n if (!in_array($parid, $allCategories)) {\n //Add the value\n $allCategories[] = $parid;\n }\n\n foreach ($parent as $child) {\n $id = $child['ID'];\n\n //Check if the values does not exist in the allCategories array.\n if (!in_array($id, $allCategories)) {\n //Add the value\n $allCategories[] = $id;\n }\n }\n }\n }\n\n //And return the testCategories\n return ($allCategories);\n}", "function getTestCasesInsideACategory($testCategoryID, $theSubjectID, $roundID, $clientID) {\n global $definitions;\n\n $categoriesItemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['testcasescategory'], $clientID);\n $categoryParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasescategoryParentID'], $clientID);\n $testCasesArray = array();\n\n //First, get the internal structure of testCategories\n $tcatTree = getItemsTree($categoriesItemTypeID, $clientID, $categoryParentPropertyID, $testCategoryID);\n\n $idsToRetrieve = array();\n\n //Store all testCategories ids found in a plain array\n foreach ($tcatTree as $tc) {\n for ($j = 0; $j < count($tc); $j++) {\n if (!(in_array($tc[$j]['parent'], $idsToRetrieve))) {\n $idsToRetrieve[] = $tc[$j]['parent'];\n }\n if (!(in_array($tc[$j]['ID'], $idsToRetrieve))) {\n $idsToRetrieve[] = $tc[$j]['ID'];\n }\n }\n }\n\n //Get the relations item\n $relations = getRelations($roundID, $theSubjectID, $clientID);\n\n if ((count($relations) - 1) == 0) {\n //Get the test cases ids inside an array\n $idsToSearch = explode(',', $relations[0]['testCasesIDs']);\n for ($i = 0; $i < count($idsToRetrieve); $i++) {\n //Get the test cases and filter\n $availableTestCases = array();\n $availableTestCases = getFilteredTestCasesInsideCategory($idsToRetrieve[$i], $idsToSearch, $clientID);\n //And add to results\n for ($j = 0; $j < count($availableTestCases); $j++) {\n $partRes = array();\n $partRes['ID'] = $availableTestCases[$j]['ID'];\n $testCasesArray[] = $partRes;\n }\n }\n }\n\n return $testCasesArray;\n}", "function getTestCasesInsideCategory($parentCategoryID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesID = getClientItemTypeID_RelatedWith_byName($definitions['testcases'], $clientID);\n\n //get property\n $testCasesParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID);\n\n // build return properties array\n $returnProperties = array();\n\n //build an empty filter\n $filters = array();\n $filters[] = array('ID' => $testCasesParentPropertyID, 'value' => $parentCategoryID);\n\n $testCases = getFilteredItemsIDs($itemTypeTestCasesID, $clientID, $filters, $returnProperties);\n\n //Get only the testCategories ids\n $onlyIds = array();\n\n foreach ($testCases as $tcas) {\n $onlyIds[] = $tcas['ID'];\n }\n\n return $onlyIds;\n}", "function getParentCategoriesForTestCase($testCaseID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesID = getClientItemTypeID_RelatedWith_byName($definitions['testcases'], $clientID);\n\n //get property\n $testCasesParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID);\n\n //First, get the parent test category for the test case\n $categoryID = getItemPropertyValue($testCaseID, $testCasesParentPropertyID, $clientID);\n\n //return all categories\n return getParentCategoriesForCategory($categoryID, $clientID);\n}", "function getTestCategoriesInsideACategory($parentCategoryID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesCategoriesID = getClientItemTypeID_RelatedWith_byName($definitions['testcasescategory'], $clientID);\n\n //get property\n $testCategoryParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasescategoryParentID'], $clientID);\n\n //Create the filter\n // build return properties array\n $returnProperties = array();\n\n //build an empty filter\n $filters = array();\n $filters[] = array('ID' => $testCategoryParentPropertyID, 'value' => $parentCategoryID);\n\n $testCategories = getFilteredItemsIDs($itemTypeTestCasesCategoriesID, $clientID, $filters, $returnProperties);\n\n //Get only the testCategories ids\n $onlyIds = array();\n\n foreach ($testCategories as $tcat) {\n $onlyIds[] = $tcat['ID'];\n }\n\n return $onlyIds;\n}", "public function testGetAllParents() {\n // Declare\n $name = 'Pricing Tools (Child)';\n\n // Create\n $ph_kb_category = $this->phactory->create('kb_category');\n $ph_kb_category_child = $this->phactory->create( 'kb_category', array( 'parent_id' => $ph_kb_category->id, 'name' => $name ) );\n\n // Get all categories\n $categories = $this->kb_category->get_all_parents( $ph_kb_category_child->id );\n $category = current( $categories );\n\n // Assert\n $this->assertContainsOnlyInstancesOf( 'KnowledgeBaseCategory', $categories );\n $this->assertEquals( self::NAME, $category->name );\n }", "function getParentCategoriesForCategory($categoryID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesCategoriesID = getClientItemTypeID_RelatedWith_byName($definitions['testcasescategory'], $clientID);\n\n //get property\n $testCategoryParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasescategoryParentID'], $clientID);\n\n //start loop with passed category\n $aux = $categoryID;\n\n $categoriesArray = array();\n\n //search parent category until 0 level reached\n while ($aux != 0) {\n $categoriesArray[] = $aux;\n $aux = getItemPropertyValue($aux, $testCategoryParentPropertyID, $clientID);\n }\n\n //return categories array\n return $categoriesArray;\n}", "function getFilteredTestCasesInsideCategory($parentCategoryID, $idsToSearch, $clientID) {\n global $definitions;\n\n $testcasesItemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['testcases'], $clientID);\n $testCaseParentTestCategoryPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID);\n $testcasesNamePropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesName'], $clientID);\n $testcasesOrderPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesOrder'], $clientID);\n\n // build return properties array\n $returnProperties = array();\n $returnProperties[] = array('ID' => $testcasesNamePropertyID, 'name' => 'testcaseName');\n $returnProperties[] = array('ID' => $testCaseParentTestCategoryPropertyID, 'name' => 'testCategoryParentID');\n $returnProperties[] = array('ID' => $testcasesOrderPropertyID, 'name' => 'order');\n\n //build an empty filter\n $filters = array();\n $filters[] = array('ID' => $testCaseParentTestCategoryPropertyID, 'value' => $parentCategoryID);\n\n $testCases = getFilteredItemsIDs($testcasesItemTypeID, $clientID, $filters, $returnProperties);\n\n //Next, clear all the test cases that are not inside the relation\n $appliedTestCases = array();\n for ($i = 0; $i < count($testCases); $i++) {\n if (in_array($testCases[$i]['ID'], $idsToSearch)) {\n $appliedTestCases[] = $testCases[$i];\n }\n }\n //And return the testCases\n return ($appliedTestCases);\n}", "public function testGetByParent() {\n // Declare\n $name = 'Pricing Tools (Child)';\n\n // Create\n $ph_kb_category = $this->phactory->create('kb_category');\n $this->phactory->create( 'kb_category', array( 'parent_id' => $ph_kb_category->id, 'name' => $name ) );\n\n // Get the categories\n $categories = $this->kb_category->get_by_parent( $ph_kb_category->id );\n $category = current( $categories );\n\n // Assert\n $this->assertContainsOnlyInstancesOf( 'KnowledgeBaseCategory', $categories );\n $this->assertEquals( $name, $category->name );\n }", "function getFilteredTestCasesInsideCategory($parentCategoryID, $idsToSearch){\n\n\tglobal $clientID,$categoriesItemTypeID,$categoryParentPropertyID,$testcasesItemTypeID,$testCasesCategoryPropertyID,$testcasesNamePropertyID,$testcasesOrderPropertyID,$inDebug;\n\n\t// build return properties array\n\t$returnProperties = array();\n\t$returnProperties[] = array('ID' => $testcasesNamePropertyID, 'name' => 'testcaseName');\n\t$returnProperties[] = array('ID' => $testCasesCategoryPropertyID, 'name' => 'testCategoryParentID');\n\t$returnProperties[] = array('ID' => $testcasesOrderPropertyID, 'name' => 'order');\n\n\t//build the filter\n\t$filters = array();\n\t$filters[] = array('ID' => $testCasesCategoryPropertyID, 'value' => $parentCategoryID);\n\n\t$testCases = getFilteredItemsIDs($testcasesItemTypeID, $clientID, $filters, $returnProperties);\n\n\t//Next, save only the test cases that are inside the relation\n\t$resultTC = array();\n\tfor ($i=0;$i<count($testCases);$i++){\n\t\tforeach ($idsToSearch as $rel){\n\t\t\tif ($testCases[$i]['ID']==$rel){\n\t\t\t\t//test found in relation, add to returning array\n\t\t\t\t$resultTC[]=$testCases[$i];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t//And return the testCases\n\treturn($resultTC);\n}", "function getCategories($parent=0)\n {\n $sql=\"select * from itf_category where parent ='\".$parent.\"' and status='1' order by catname\";\n $res = $this->dbcon->FetchAllResults($sql);\n\n if(count($res) > 0){\n foreach($res as &$r)\n {\n $re = $this->getCategories($r['id']);\n $r[\"subcat\"] = $re;\n\n }\n }\n return $res;\n\n }", "function getAllTestCategoriesInsideAGroup($groupID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesCategoriesID = getClientItemTypeID_RelatedWith_byName($definitions['testcasescategory'], $clientID);\n\n //get property\n $testCategoryParentGroupID = getClientPropertyID_RelatedWith_byName($definitions['testcasescategoryGroupID'], $clientID);\n\n //First, we need get all the categories that has the parent groupID\n // build return properties array\n $returnProperties = array();\n\n //build the filter\n $filters = array();\n $filters[] = array('ID' => $testCategoryParentGroupID, 'value' => $groupID);\n\n $testCategories = getFilteredItemsIDs($itemTypeTestCasesCategoriesID, $clientID, $filters, $returnProperties);\n\n //Get only the testCategories ids\n $onlyIds = array();\n\n foreach ($testCategories as $tcat) {\n $onlyIds[] = $tcat['ID'];\n }\n\n return $onlyIds;\n}", "function getAllTestCasesInsideAGroup($groupID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesID = getClientItemTypeID_RelatedWith_byName($definitions['testcases'], $clientID);\n\n //get property\n $testCasesParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID);\n\n //get all categories inside group\n $onlyIds = getAllTestCategoriesInsideAGroup($groupID, $clientID);\n\n //Next, create a string with all the categories inside the group\n $toFilter = implode(',', $onlyIds);\n\n //Create the filter\n // build return properties array\n $returnProperties = array();\n\n //build the filter\n $filters = array();\n $filters[] = array('ID' => $testCasesParentPropertyID, 'value' => $toFilter, 'mode' => '<-IN');\n\n $allTestCases = getFilteredItemsIDs($itemTypeTestCasesID, $clientID, $filters, $returnProperties);\n\n //Get only the testCategories ids\n $onlyIds = array();\n\n foreach ($allTestCases as $tcas) {\n $onlyIds[] = $tcas['ID'];\n }\n\n return $onlyIds;\n}", "public function getChildCategories()\n {\n if (!$this->hasData('category_tabs')) {\n $currentCategory = $this->getMainCategory();\n $results = [];\n if ($currentCategory) {\n $tabIds = $currentCategory->getData('sss_category_tab_ids');\n if (!is_array($tabIds)) {\n $tabIds = explode(',', $tabIds);\n }\n /**\n * Enable Catalog Category Flat ... \n * @var $tabCollection \\Magento\\Catalog\\Model\\ResourceModel\\Category\\Flat\\Collection\n */\n if ($currentCategory->getUseFlatResource()) {\n $tabCollection = $currentCategory->getCollection();\n\n $tabCollection\n ->addIsActiveFilter()\n ->addAttributeToSelect('include_in_menu')\n ->addAttributeToSelect('sss_custom_tab_title')\n ->addAttributeToSelect('position')\n ->addAttributeToSelect('sss_tab_position')\n ->addAttributeToSelect('name')\n ->addAttributeToFilter('sss_visible_in_tab', SourceBoolean::VALUE_YES)\n ->addFieldToFilter('parent_id', ['eq' => $currentCategory->getId()]);\n\n $tabCollection->getSelect()\n ->orWhere('main_table.entity_id in (?)', $tabIds, \\Magento\\Framework\\DB\\Select::TYPE_CONDITION);\n\n $results = $tabCollection->getItems();\n } else {\n $tabCollection = $currentCategory->getChildrenCategories();\n if ($tabCollection instanceof AbstractCollection) {\n $tabCollection->setLoadProductCount(false);\n $tabCollection->addAttributeToSelect('sss_custom_tab_title');\n $tabCollection->addLevelFilter(3);\n try {\n $tabCollection->addAttributeToFilter('sss_visible_in_tab', SourceBoolean::VALUE_YES);\n } catch (\\Exception $e) {\n }\n $results = $tabCollection->getItems();\n } else {\n foreach ($tabCollection as $childCategory) {\n if (3 == $childCategory->getLevel()) {\n $results[] = $childCategory;\n }\n }\n }\n }\n usort($results, function ($first, $second) {\n if ($first->getData('sss_tab_position') || $second->getData('sss_tab_position')) {\n return $first->getData('sss_tab_position') >= $second->getData('sss_tab_position');\n } else {\n return $first->getData('position') >= $second->getData('position');\n }\n });\n }\n $this->setData('category_tabs', $results);\n }\n return $this->getData('category_tabs');\n }", "public function getPartialTreeDataProvider()\n {\n // Case #0.\n $cat1 = $this->buildCategory(\n [\n 'id' => 'cat1',\n 'active' => true,\n 'sort' => 1,\n 'left' => 2,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ]\n );\n\n $out[] = [new \\ArrayIterator([$cat1]), 5, 'cat1', [$cat1]];\n\n // Case #1 test finding in deeper level with multiple side categories.\n $cat2 = $this->buildCategory(\n [\n 'id' => 'cat2',\n 'active' => true,\n 'sort' => 2,\n 'left' => 8,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ]\n );\n\n $cat3 = $this->buildCategory(\n [\n 'id' => 'cat3',\n 'active' => true,\n 'sort' => 1,\n 'left' => 1,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n 'current' => true,\n 'expanded' => true,\n ]\n );\n\n $cat4 = $this->buildCategory(\n [\n 'id' => 'cat4',\n 'active' => true,\n 'sort' => 1,\n 'left' => 3,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ]\n );\n\n $cat41 = $this->buildCategory(\n [\n 'id' => 'cat41',\n 'active' => true,\n 'sort' => 1,\n 'left' => 4,\n 'parent_id' => 'cat4',\n 'level' => 2,\n ]\n );\n\n $cat42 = $this->buildCategory(\n [\n 'id' => 'cat42',\n 'active' => true,\n 'sort' => 1,\n 'left' => 5,\n 'parent_id' => 'cat4',\n 'level' => 2,\n ]\n );\n\n $cat421 = $this->buildCategory(\n [\n 'id' => 'cat421',\n 'active' => true,\n 'sort' => 2,\n 'left' => 7,\n 'parent_id' => 'cat42',\n 'level' => 3,\n ]\n );\n\n $tree = [$cat1, $cat2, $cat3, $cat4];\n\n $cat4->setChild('cat42', $cat42);\n $cat4->setChild('cat41', $cat41);\n $cat42->setChild('cat421', $cat421);\n\n $out[] = [new \\ArrayIterator($tree), 5, 'cat42', [$cat42]];\n\n // Case #2 test with improper arguments.\n $out[] = [[], 0, null, null, 'Category Id must be defined on getPartialTree() method'];\n\n return $out;\n }", "function getAllActiveChildCategoriesForSearch($parent_id )\n\t{\n\t\t$q = \"SELECT * FROM title_dev_sub_categories WHERE sub_cate_status = 1 AND \tparent_id = \".$parent_id.\" ORDER BY \tsub_cate_title ASC\";\n\t\t$r = $this -> db -> getMultipleRecords( $q );\n\t\tif( $r )\n\t\t\treturn $r;\n\t\telse\n\t\t\treturn false;\n\t}", "public function getParentCategories() {\n $select = $this->select()\n ->from($this->info('name'), array(\"category_id\", \"category_name\"))\n ->where(\"cat_dependency = 0 AND subcat_dependency = 0\");\n\n return $this->fetchAll($select);\n }", "public function testGetAllChildren() {\n // Declare\n $name = 'Pricing Tools (Child)';\n\n // Create\n $ph_kb_category = $this->phactory->create('kb_category');\n $this->phactory->create( 'kb_category', array( 'parent_id' => $ph_kb_category->id, 'name' => $name ) );\n\n // Get\n $categories = $this->kb_category->get_all_children( $ph_kb_category->id );\n $category = current( $categories );\n\n // Assert\n $this->assertContainsOnlyInstancesOf( 'KnowledgeBaseCategory', $categories );\n $this->assertEquals( $name, $category->name );\n }", "public function subCategorylist()\n {\n $data = [];\n $sub_categories = Category::where('parent', '!=' ,'0')->get();\n if(count($sub_categories)){\n $data = ['status' => true, 'code' => 200, 'data'=>$sub_categories];\n }else{\n $data = ['status' => false, 'code' => 404, 'message' => \"data not found\"];\n }\n return $data;\n }", "function listTestCategory() {\n\t\t$this->db->select('*');\n\t\t$this->db->from($this->test_category_table);\n\t\t$this->db->where('status !=', 0);\n $query = $this->db->get();\n\t\treturn $query->result();\n\t}", "public static function getSubCategories($parent_cat_id) {\n Db_Actions::DbSelect(\"SELECT * FROM cscart_categories LEFT OUTER JOIN cscart_category_descriptions ON cscart_categories.category_id = cscart_category_descriptions.category_id WHERE cscart_categories.parent_id=$parent_cat_id\");\n $result = Db_Actions::DbGetResults();\n if (!isset($result->empty_result)) {\n return $result;\n }\n else {\n return new stdClass();\n }\n }", "private function get_parent_categories(){\r\n\t\t$rslt = array();\r\n\r\n\t\t$args = array('taxonomy'=>'market_reports_category', 'hide_empty' => false, 'parent'=>0, 'orderby'=>'term_id','order'=>'ASC');\r\n\t\t$parent_cats = get_terms($args);\r\n\t\t// $rslt['-1'] = 'None';\r\n\t\t// wp_die(var_dump($parent_cats));\r\n\t\tforeach ($parent_cats as $key => $parent_cat) {\r\n\t\t\t$rslt[$parent_cat->term_id] = $parent_cat->name;\r\n\t\t}\r\n\t\t// rsort($rslt);\r\n\t\treturn $rslt;\r\n\t}", "public function subcategories()\n {\n return $this->hasMany(Category::class, 'parent_id')->where('status', 1);\n }", "function showParentCategoriesForSearch( )\n\t{\n\t\t$q = \"SELECT * FROM title_dev_categories WHERE status = 1 AND category_type = 0 order by \tcategory_title asc \";\n\t\t$r = $this -> db -> getMultipleRecords( $q );\n\t\tif( $r )\n\t\t\treturn $r;\n\t\telse\n\t\t\treturn false;\n\t}", "function get_simple_categories($type='all', $parentid=false, $order=false){\n $parentid = intval($parentid);\n $where=$orderby='';\n if($type=='root') $where = 'WHERE parentid = -1';\n elseif ($type=='sub' && $parentid) $where = \"WHERE parentid = '$parentid'\";\n if($order) $orderby = ' order by name '.$order;\n $sql = \"SELECT id as catId, name as catName FROM categories \" . $where . $orderby; //, marketplaceCount\n $cats = $this->db->query($sql)->result_array();\n foreach($cats as $key=>$value){\n //$cats[$key]['marketplaceCount'] = number_format($value['marketplaceCount']);\n $haveSubCategories = $this->db_getone(\"SELECT id from categories where parentid='{$value['catId']}'\", 'id');\n if($haveSubCategories) $cats[$key]['haveSubCategories'] = 1;\n else $cats[$key]['haveSubCategories'] = 0;\n }\n return $cats;\n }", "public function testCategoriesAreFilteredByParent()\n {\n $visibleCategory = factory(Category::class)->create();\n $notVisibleCategory = factory(Category::class)->create();\n\n $visibleCategory->parent()->associate(factory(Category::class)->create());\n $visibleCategory->save();\n\n $this->actingAs(factory(User::class)->states('admin')->create())\n ->get('categories?filter[categories.parent_id]='.$visibleCategory->parent->id)\n ->assertSuccessful()\n ->assertSee(route('categories.edit', $visibleCategory))\n ->assertDontSee(route('categories.edit', $notVisibleCategory));\n }", "public function subcategories()\n {\n \treturn $this->hasMany('App\\Category', 'parent_id')->where('status', 1);\n }", "function showParentCategories( )\n\t{\n\t\t$q = \"SELECT * FROM title_dev_categories WHERE status = 1 AND category_type = 0 order by \tsort_order asc \";\n\t\t$r = $this -> db -> getMultipleRecords( $q );\n\t\tif( $r )\n\t\t\treturn $r;\n\t\telse\n\t\t\treturn false;\n\t}", "public function getCategorys()\r\n {\r\n $groupData = $this->getGroupById();\r\n $html = null;\r\n if ($groupData) {\r\n foreach (explode(',', $groupData['categorys']) as $categoryId) {\r\n if ($categoryId) {\r\n $itemCategorys = $this->itemCollectionFactory->create()\r\n ->addFieldToFilter('category_id', array('eq' => $categoryId))\r\n ->addFieldToFilter('status', array('eq' => 1))\r\n ->addFieldToFilter('menu_type', array('eq' => 1));\r\n if ($itemCategorys->getData()) {\r\n foreach ($itemCategorys as $item) {\r\n $html .= $this->getMegamenuHtml($item);\r\n continue;\r\n }\r\n } else {\r\n $category = $this->getCategoryById($categoryId);\r\n if ($category) {\r\n $parentClass = ($this->hasSubcategory($category->getId())) ? 'parent' : null;\r\n $html .= '<li class=\"' . $this->checkCurrentCategory($category->getId()) . ' ui-menu-item level0 ' . $this->getMenuTypeGroup($groupData['menu_type']) . ' ' . $parentClass . ' \">';\r\n $html .= '<a href=\"' . $category->getUrl() . '\" class=\"level-top\"><span>' . $category->getName() . '</span></a>';\r\n if ($this->hasSubcategory($category->getId())) {\r\n $html .= '<div class=\"open-children-toggle\"></div>';\r\n }\r\n //get html of category\r\n $html .= $this->getHtmlCategory($category,\r\n $this->getMenuTypeGroup($groupData['menu_type']));\r\n $html .= '</li>';\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return $html;\r\n }", "public static function getCategories() {\n $top_level_cats = array();\n//Select all top level categories\n Db_Actions::DbSelect(\"SELECT * FROM cscart_categories LEFT OUTER JOIN cscart_category_descriptions ON cscart_categories.category_id = cscart_category_descriptions.category_id WHERE cscart_categories.parent_id=0\");\n $result = Db_Actions::DbGetResults();\n if (!isset($result->empty_result)) {\n foreach ($result as $cat) {\n $top_level_cats[] = array('id' => $cat->category_id,\n 'cat_name' => $cat->category,\n 'company_id' => $cat->company_id,\n 'status' => $cat->status,\n 'product_count' => $cat->product_count,\n 'is_op' => $cat->is_op,\n 'usergroup_ids' => $cat->usergroup_ids);\n }\n }\n if (!isset($result->empty_result)) {\n return $result;\n }\n else {\n return new stdClass();\n }\n }" ]
[ "0.7586548", "0.73783547", "0.71820617", "0.7177901", "0.7008018", "0.6816272", "0.6548999", "0.65266335", "0.65198386", "0.6519264", "0.6501634", "0.64544076", "0.64261615", "0.62595737", "0.6247661", "0.61789495", "0.6156544", "0.6150775", "0.6107434", "0.6097609", "0.6072083", "0.6071978", "0.6052959", "0.60242385", "0.6023747", "0.59503275", "0.5943999", "0.59348845", "0.593227", "0.59275997" ]
0.77038574
0
This function returns the testcases inside one parent category only (not subcategories)
function getTestCasesInsideCategory($parentCategoryID, $clientID) { global $definitions; //get item type $itemTypeTestCasesID = getClientItemTypeID_RelatedWith_byName($definitions['testcases'], $clientID); //get property $testCasesParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID); // build return properties array $returnProperties = array(); //build an empty filter $filters = array(); $filters[] = array('ID' => $testCasesParentPropertyID, 'value' => $parentCategoryID); $testCases = getFilteredItemsIDs($itemTypeTestCasesID, $clientID, $filters, $returnProperties); //Get only the testCategories ids $onlyIds = array(); foreach ($testCases as $tcas) { $onlyIds[] = $tcas['ID']; } return $onlyIds; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllTestCasesInsideCategory($parentCategoryID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesID = getClientItemTypeID_RelatedWith_byName($definitions['testcases'], $clientID);\n\n //get property\n $testCasesParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID);\n\n //get all categories inside\n $allCategories = getAllTestCategoriesInsideACategory($parentCategoryID, $clientID);\n\n $toFilter = implode(',', $allCategories);\n\n //When we have all the categories inside, get their test cases\n //Create the filter\n // build return properties array\n $returnProperties = array();\n\n //build an empty filter\n $filters = array();\n $filters[] = array('ID' => $testCasesParentPropertyID, 'value' => $toFilter, 'mode' => '<-IN');\n\n $testCases = getFilteredItemsIDs($itemTypeTestCasesID, $clientID, $filters, $returnProperties);\n\n //Get only the testCategories ids\n $onlyIds = array();\n\n foreach ($testCases as $tcas) {\n $onlyIds[] = $tcas['ID'];\n }\n\n return $onlyIds;\n}", "function getAllTestCategoriesInsideACategory($parentCategoryID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesCategoriesID = getClientItemTypeID_RelatedWith_byName($definitions['testcasescategory'], $clientID);\n\n //get property\n $testCategoryParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasescategoryParentID'], $clientID);\n\n //First, we need the tree categories\n $tree = getItemsTree($itemTypeTestCasesCategoriesID, $clientID, $testCategoryParentPropertyID, $parentCategoryID);\n\n //Transform the items tree and store the ids in an unidimensional array\n $allCategories = array();\n\n //First, add the parentCategoryID\n $allCategories[] = $parentCategoryID;\n\n if ($tree) {\n foreach ($tree as $parid => $parent) {\n\n if (!in_array($parid, $allCategories)) {\n //Add the value\n $allCategories[] = $parid;\n }\n\n foreach ($parent as $child) {\n $id = $child['ID'];\n\n //Check if the values does not exist in the allCategories array.\n if (!in_array($id, $allCategories)) {\n //Add the value\n $allCategories[] = $id;\n }\n }\n }\n }\n\n //And return the testCategories\n return ($allCategories);\n}", "function getParentCategoriesForTestCase($testCaseID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesID = getClientItemTypeID_RelatedWith_byName($definitions['testcases'], $clientID);\n\n //get property\n $testCasesParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID);\n\n //First, get the parent test category for the test case\n $categoryID = getItemPropertyValue($testCaseID, $testCasesParentPropertyID, $clientID);\n\n //return all categories\n return getParentCategoriesForCategory($categoryID, $clientID);\n}", "function getTestCasesInsideACategory($testCategoryID, $theSubjectID, $roundID, $clientID) {\n global $definitions;\n\n $categoriesItemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['testcasescategory'], $clientID);\n $categoryParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasescategoryParentID'], $clientID);\n $testCasesArray = array();\n\n //First, get the internal structure of testCategories\n $tcatTree = getItemsTree($categoriesItemTypeID, $clientID, $categoryParentPropertyID, $testCategoryID);\n\n $idsToRetrieve = array();\n\n //Store all testCategories ids found in a plain array\n foreach ($tcatTree as $tc) {\n for ($j = 0; $j < count($tc); $j++) {\n if (!(in_array($tc[$j]['parent'], $idsToRetrieve))) {\n $idsToRetrieve[] = $tc[$j]['parent'];\n }\n if (!(in_array($tc[$j]['ID'], $idsToRetrieve))) {\n $idsToRetrieve[] = $tc[$j]['ID'];\n }\n }\n }\n\n //Get the relations item\n $relations = getRelations($roundID, $theSubjectID, $clientID);\n\n if ((count($relations) - 1) == 0) {\n //Get the test cases ids inside an array\n $idsToSearch = explode(',', $relations[0]['testCasesIDs']);\n for ($i = 0; $i < count($idsToRetrieve); $i++) {\n //Get the test cases and filter\n $availableTestCases = array();\n $availableTestCases = getFilteredTestCasesInsideCategory($idsToRetrieve[$i], $idsToSearch, $clientID);\n //And add to results\n for ($j = 0; $j < count($availableTestCases); $j++) {\n $partRes = array();\n $partRes['ID'] = $availableTestCases[$j]['ID'];\n $testCasesArray[] = $partRes;\n }\n }\n }\n\n return $testCasesArray;\n}", "function getTestCategoriesInsideACategory($parentCategoryID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesCategoriesID = getClientItemTypeID_RelatedWith_byName($definitions['testcasescategory'], $clientID);\n\n //get property\n $testCategoryParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasescategoryParentID'], $clientID);\n\n //Create the filter\n // build return properties array\n $returnProperties = array();\n\n //build an empty filter\n $filters = array();\n $filters[] = array('ID' => $testCategoryParentPropertyID, 'value' => $parentCategoryID);\n\n $testCategories = getFilteredItemsIDs($itemTypeTestCasesCategoriesID, $clientID, $filters, $returnProperties);\n\n //Get only the testCategories ids\n $onlyIds = array();\n\n foreach ($testCategories as $tcat) {\n $onlyIds[] = $tcat['ID'];\n }\n\n return $onlyIds;\n}", "public function testGetByParent() {\n // Declare\n $name = 'Pricing Tools (Child)';\n\n // Create\n $ph_kb_category = $this->phactory->create('kb_category');\n $this->phactory->create( 'kb_category', array( 'parent_id' => $ph_kb_category->id, 'name' => $name ) );\n\n // Get the categories\n $categories = $this->kb_category->get_by_parent( $ph_kb_category->id );\n $category = current( $categories );\n\n // Assert\n $this->assertContainsOnlyInstancesOf( 'KnowledgeBaseCategory', $categories );\n $this->assertEquals( $name, $category->name );\n }", "public function testGetAllParents() {\n // Declare\n $name = 'Pricing Tools (Child)';\n\n // Create\n $ph_kb_category = $this->phactory->create('kb_category');\n $ph_kb_category_child = $this->phactory->create( 'kb_category', array( 'parent_id' => $ph_kb_category->id, 'name' => $name ) );\n\n // Get all categories\n $categories = $this->kb_category->get_all_parents( $ph_kb_category_child->id );\n $category = current( $categories );\n\n // Assert\n $this->assertContainsOnlyInstancesOf( 'KnowledgeBaseCategory', $categories );\n $this->assertEquals( self::NAME, $category->name );\n }", "function getParentCategoriesForCategory($categoryID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesCategoriesID = getClientItemTypeID_RelatedWith_byName($definitions['testcasescategory'], $clientID);\n\n //get property\n $testCategoryParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasescategoryParentID'], $clientID);\n\n //start loop with passed category\n $aux = $categoryID;\n\n $categoriesArray = array();\n\n //search parent category until 0 level reached\n while ($aux != 0) {\n $categoriesArray[] = $aux;\n $aux = getItemPropertyValue($aux, $testCategoryParentPropertyID, $clientID);\n }\n\n //return categories array\n return $categoriesArray;\n}", "function getFilteredTestCasesInsideCategory($parentCategoryID, $idsToSearch, $clientID) {\n global $definitions;\n\n $testcasesItemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['testcases'], $clientID);\n $testCaseParentTestCategoryPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID);\n $testcasesNamePropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesName'], $clientID);\n $testcasesOrderPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesOrder'], $clientID);\n\n // build return properties array\n $returnProperties = array();\n $returnProperties[] = array('ID' => $testcasesNamePropertyID, 'name' => 'testcaseName');\n $returnProperties[] = array('ID' => $testCaseParentTestCategoryPropertyID, 'name' => 'testCategoryParentID');\n $returnProperties[] = array('ID' => $testcasesOrderPropertyID, 'name' => 'order');\n\n //build an empty filter\n $filters = array();\n $filters[] = array('ID' => $testCaseParentTestCategoryPropertyID, 'value' => $parentCategoryID);\n\n $testCases = getFilteredItemsIDs($testcasesItemTypeID, $clientID, $filters, $returnProperties);\n\n //Next, clear all the test cases that are not inside the relation\n $appliedTestCases = array();\n for ($i = 0; $i < count($testCases); $i++) {\n if (in_array($testCases[$i]['ID'], $idsToSearch)) {\n $appliedTestCases[] = $testCases[$i];\n }\n }\n //And return the testCases\n return ($appliedTestCases);\n}", "function getFilteredTestCasesInsideCategory($parentCategoryID, $idsToSearch){\n\n\tglobal $clientID,$categoriesItemTypeID,$categoryParentPropertyID,$testcasesItemTypeID,$testCasesCategoryPropertyID,$testcasesNamePropertyID,$testcasesOrderPropertyID,$inDebug;\n\n\t// build return properties array\n\t$returnProperties = array();\n\t$returnProperties[] = array('ID' => $testcasesNamePropertyID, 'name' => 'testcaseName');\n\t$returnProperties[] = array('ID' => $testCasesCategoryPropertyID, 'name' => 'testCategoryParentID');\n\t$returnProperties[] = array('ID' => $testcasesOrderPropertyID, 'name' => 'order');\n\n\t//build the filter\n\t$filters = array();\n\t$filters[] = array('ID' => $testCasesCategoryPropertyID, 'value' => $parentCategoryID);\n\n\t$testCases = getFilteredItemsIDs($testcasesItemTypeID, $clientID, $filters, $returnProperties);\n\n\t//Next, save only the test cases that are inside the relation\n\t$resultTC = array();\n\tfor ($i=0;$i<count($testCases);$i++){\n\t\tforeach ($idsToSearch as $rel){\n\t\t\tif ($testCases[$i]['ID']==$rel){\n\t\t\t\t//test found in relation, add to returning array\n\t\t\t\t$resultTC[]=$testCases[$i];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t//And return the testCases\n\treturn($resultTC);\n}", "function showParentCategoriesForSearch( )\n\t{\n\t\t$q = \"SELECT * FROM title_dev_categories WHERE status = 1 AND category_type = 0 order by \tcategory_title asc \";\n\t\t$r = $this -> db -> getMultipleRecords( $q );\n\t\tif( $r )\n\t\t\treturn $r;\n\t\telse\n\t\t\treturn false;\n\t}", "function getAllTestCategoriesInsideAGroup($groupID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesCategoriesID = getClientItemTypeID_RelatedWith_byName($definitions['testcasescategory'], $clientID);\n\n //get property\n $testCategoryParentGroupID = getClientPropertyID_RelatedWith_byName($definitions['testcasescategoryGroupID'], $clientID);\n\n //First, we need get all the categories that has the parent groupID\n // build return properties array\n $returnProperties = array();\n\n //build the filter\n $filters = array();\n $filters[] = array('ID' => $testCategoryParentGroupID, 'value' => $groupID);\n\n $testCategories = getFilteredItemsIDs($itemTypeTestCasesCategoriesID, $clientID, $filters, $returnProperties);\n\n //Get only the testCategories ids\n $onlyIds = array();\n\n foreach ($testCategories as $tcat) {\n $onlyIds[] = $tcat['ID'];\n }\n\n return $onlyIds;\n}", "function getAllTestCasesInsideAGroup($groupID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesID = getClientItemTypeID_RelatedWith_byName($definitions['testcases'], $clientID);\n\n //get property\n $testCasesParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID);\n\n //get all categories inside group\n $onlyIds = getAllTestCategoriesInsideAGroup($groupID, $clientID);\n\n //Next, create a string with all the categories inside the group\n $toFilter = implode(',', $onlyIds);\n\n //Create the filter\n // build return properties array\n $returnProperties = array();\n\n //build the filter\n $filters = array();\n $filters[] = array('ID' => $testCasesParentPropertyID, 'value' => $toFilter, 'mode' => '<-IN');\n\n $allTestCases = getFilteredItemsIDs($itemTypeTestCasesID, $clientID, $filters, $returnProperties);\n\n //Get only the testCategories ids\n $onlyIds = array();\n\n foreach ($allTestCases as $tcas) {\n $onlyIds[] = $tcas['ID'];\n }\n\n return $onlyIds;\n}", "function showParentCategories( )\n\t{\n\t\t$q = \"SELECT * FROM title_dev_categories WHERE status = 1 AND category_type = 0 order by \tsort_order asc \";\n\t\t$r = $this -> db -> getMultipleRecords( $q );\n\t\tif( $r )\n\t\t\treturn $r;\n\t\telse\n\t\t\treturn false;\n\t}", "public function testCategoriesAreFilteredByParent()\n {\n $visibleCategory = factory(Category::class)->create();\n $notVisibleCategory = factory(Category::class)->create();\n\n $visibleCategory->parent()->associate(factory(Category::class)->create());\n $visibleCategory->save();\n\n $this->actingAs(factory(User::class)->states('admin')->create())\n ->get('categories?filter[categories.parent_id]='.$visibleCategory->parent->id)\n ->assertSuccessful()\n ->assertSee(route('categories.edit', $visibleCategory))\n ->assertDontSee(route('categories.edit', $notVisibleCategory));\n }", "public function getParentCategories() {\n $select = $this->select()\n ->from($this->info('name'), array(\"category_id\", \"category_name\"))\n ->where(\"cat_dependency = 0 AND subcat_dependency = 0\");\n\n return $this->fetchAll($select);\n }", "function getAllActiveChildCategoriesForSearch($parent_id )\n\t{\n\t\t$q = \"SELECT * FROM title_dev_sub_categories WHERE sub_cate_status = 1 AND \tparent_id = \".$parent_id.\" ORDER BY \tsub_cate_title ASC\";\n\t\t$r = $this -> db -> getMultipleRecords( $q );\n\t\tif( $r )\n\t\t\treturn $r;\n\t\telse\n\t\t\treturn false;\n\t}", "private function get_parent_categories(){\r\n\t\t$rslt = array();\r\n\r\n\t\t$args = array('taxonomy'=>'market_reports_category', 'hide_empty' => false, 'parent'=>0, 'orderby'=>'term_id','order'=>'ASC');\r\n\t\t$parent_cats = get_terms($args);\r\n\t\t// $rslt['-1'] = 'None';\r\n\t\t// wp_die(var_dump($parent_cats));\r\n\t\tforeach ($parent_cats as $key => $parent_cat) {\r\n\t\t\t$rslt[$parent_cat->term_id] = $parent_cat->name;\r\n\t\t}\r\n\t\t// rsort($rslt);\r\n\t\treturn $rslt;\r\n\t}", "public function getPartialTreeDataProvider()\n {\n // Case #0.\n $cat1 = $this->buildCategory(\n [\n 'id' => 'cat1',\n 'active' => true,\n 'sort' => 1,\n 'left' => 2,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ]\n );\n\n $out[] = [new \\ArrayIterator([$cat1]), 5, 'cat1', [$cat1]];\n\n // Case #1 test finding in deeper level with multiple side categories.\n $cat2 = $this->buildCategory(\n [\n 'id' => 'cat2',\n 'active' => true,\n 'sort' => 2,\n 'left' => 8,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ]\n );\n\n $cat3 = $this->buildCategory(\n [\n 'id' => 'cat3',\n 'active' => true,\n 'sort' => 1,\n 'left' => 1,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n 'current' => true,\n 'expanded' => true,\n ]\n );\n\n $cat4 = $this->buildCategory(\n [\n 'id' => 'cat4',\n 'active' => true,\n 'sort' => 1,\n 'left' => 3,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ]\n );\n\n $cat41 = $this->buildCategory(\n [\n 'id' => 'cat41',\n 'active' => true,\n 'sort' => 1,\n 'left' => 4,\n 'parent_id' => 'cat4',\n 'level' => 2,\n ]\n );\n\n $cat42 = $this->buildCategory(\n [\n 'id' => 'cat42',\n 'active' => true,\n 'sort' => 1,\n 'left' => 5,\n 'parent_id' => 'cat4',\n 'level' => 2,\n ]\n );\n\n $cat421 = $this->buildCategory(\n [\n 'id' => 'cat421',\n 'active' => true,\n 'sort' => 2,\n 'left' => 7,\n 'parent_id' => 'cat42',\n 'level' => 3,\n ]\n );\n\n $tree = [$cat1, $cat2, $cat3, $cat4];\n\n $cat4->setChild('cat42', $cat42);\n $cat4->setChild('cat41', $cat41);\n $cat42->setChild('cat421', $cat421);\n\n $out[] = [new \\ArrayIterator($tree), 5, 'cat42', [$cat42]];\n\n // Case #2 test with improper arguments.\n $out[] = [[], 0, null, null, 'Category Id must be defined on getPartialTree() method'];\n\n return $out;\n }", "public static function parentCategories()\n {\n return Category::with('children')\n ->orderBy('priority')\n ->where([\n 'category_type' => static::class,\n 'parent_id' => null,\n ])->get();\n }", "private function get_category_by_parent($parent){\n $query = DB::table('ps_category as a')\n ->select('a.id_category','b.name')\n ->join('ps_category_lang as b','a.id_category','b.id_category')\n ->where('a.id_parent',$parent)\n ->where('a.active',1)\n ->groupBy('a.id_category')\n ->get();\n return $query;\n }", "function getMainCategory()\n {\n $sql = \"select * from tbl_issue_category where parent_id=0\";\n $query = $this->db->query($sql);\n return $query->result_array();\n }", "function get_parent_cat_info( $parent_id )\n\t{\n\t\t$q = \"SELECT * FROM title_dev_categories WHERE category_id = \".$parent_id;\n\t\t$r = $this -> db -> getSingleRecord( $q );\n\t\tif( $r != false )\n\t\t\treturn $r;\n\t\telse\n\t\t\treturn false;\n\t}", "function listTestCategory() {\n\t\t$this->db->select('*');\n\t\t$this->db->from($this->test_category_table);\n\t\t$this->db->where('status !=', 0);\n $query = $this->db->get();\n\t\treturn $query->result();\n\t}", "protected function parentCategoryTC()\n {\n return PostCategory::parentCategories()->firstOrFail();\n }", "function getCategories($parent=0)\n {\n $sql=\"select * from itf_category where parent ='\".$parent.\"' and status='1' order by catname\";\n $res = $this->dbcon->FetchAllResults($sql);\n\n if(count($res) > 0){\n foreach($res as &$r)\n {\n $re = $this->getCategories($r['id']);\n $r[\"subcat\"] = $re;\n\n }\n }\n return $res;\n\n }", "function get_simple_categories($type='all', $parentid=false, $order=false){\n $parentid = intval($parentid);\n $where=$orderby='';\n if($type=='root') $where = 'WHERE parentid = -1';\n elseif ($type=='sub' && $parentid) $where = \"WHERE parentid = '$parentid'\";\n if($order) $orderby = ' order by name '.$order;\n $sql = \"SELECT id as catId, name as catName FROM categories \" . $where . $orderby; //, marketplaceCount\n $cats = $this->db->query($sql)->result_array();\n foreach($cats as $key=>$value){\n //$cats[$key]['marketplaceCount'] = number_format($value['marketplaceCount']);\n $haveSubCategories = $this->db_getone(\"SELECT id from categories where parentid='{$value['catId']}'\", 'id');\n if($haveSubCategories) $cats[$key]['haveSubCategories'] = 1;\n else $cats[$key]['haveSubCategories'] = 0;\n }\n return $cats;\n }", "function get_parent_categories()\n \t{\n \t\treturn $this->conn_db->get_parent_categories($this->uid);\t\n \t\t\n \t}", "public function testCategoryCanNotBeItsOwnParent(): void\n {\n $items = Category::factory()->count(1)->create();\n\n Livewire::actingAs(User::factory()->admin()->create())\n ->test(CategoriesTable::class, ['items' => $items])\n ->emit('edit', $items[0]->id)\n ->set('editValues.parent_id', $items[0]->id)\n ->emit('save')\n ->assertHasErrors(['editValues.parent_id'])\n ->assertDispatchedBrowserEvent('notify', function ($name, $data) {\n return data_get($data, 'level') === 'error';\n });\n\n $this->assertEquals(0, $items[0]->fresh()->parent()->count());\n }", "public static function getSubCategories($parent_cat_id) {\n Db_Actions::DbSelect(\"SELECT * FROM cscart_categories LEFT OUTER JOIN cscart_category_descriptions ON cscart_categories.category_id = cscart_category_descriptions.category_id WHERE cscart_categories.parent_id=$parent_cat_id\");\n $result = Db_Actions::DbGetResults();\n if (!isset($result->empty_result)) {\n return $result;\n }\n else {\n return new stdClass();\n }\n }" ]
[ "0.7650469", "0.7343272", "0.734251", "0.72037286", "0.71789485", "0.68887734", "0.6658828", "0.66286737", "0.657201", "0.65059453", "0.64021194", "0.6396007", "0.63922936", "0.6322818", "0.6291699", "0.61062264", "0.60999966", "0.60893714", "0.6061898", "0.6060847", "0.6054744", "0.6048262", "0.6025412", "0.6013335", "0.5998899", "0.5952807", "0.59189034", "0.5898988", "0.5893087", "0.5794207" ]
0.7512762
1
Get the structure from the testCase to the first test category. Returns all inversed testCategories tree
function getParentCategoriesForTestCase($testCaseID, $clientID) { global $definitions; //get item type $itemTypeTestCasesID = getClientItemTypeID_RelatedWith_byName($definitions['testcases'], $clientID); //get property $testCasesParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID); //First, get the parent test category for the test case $categoryID = getItemPropertyValue($testCaseID, $testCasesParentPropertyID, $clientID); //return all categories return getParentCategoriesForCategory($categoryID, $clientID); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTestCasesInsideACategory($testCategoryID, $theSubjectID, $roundID, $clientID) {\n global $definitions;\n\n $categoriesItemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['testcasescategory'], $clientID);\n $categoryParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasescategoryParentID'], $clientID);\n $testCasesArray = array();\n\n //First, get the internal structure of testCategories\n $tcatTree = getItemsTree($categoriesItemTypeID, $clientID, $categoryParentPropertyID, $testCategoryID);\n\n $idsToRetrieve = array();\n\n //Store all testCategories ids found in a plain array\n foreach ($tcatTree as $tc) {\n for ($j = 0; $j < count($tc); $j++) {\n if (!(in_array($tc[$j]['parent'], $idsToRetrieve))) {\n $idsToRetrieve[] = $tc[$j]['parent'];\n }\n if (!(in_array($tc[$j]['ID'], $idsToRetrieve))) {\n $idsToRetrieve[] = $tc[$j]['ID'];\n }\n }\n }\n\n //Get the relations item\n $relations = getRelations($roundID, $theSubjectID, $clientID);\n\n if ((count($relations) - 1) == 0) {\n //Get the test cases ids inside an array\n $idsToSearch = explode(',', $relations[0]['testCasesIDs']);\n for ($i = 0; $i < count($idsToRetrieve); $i++) {\n //Get the test cases and filter\n $availableTestCases = array();\n $availableTestCases = getFilteredTestCasesInsideCategory($idsToRetrieve[$i], $idsToSearch, $clientID);\n //And add to results\n for ($j = 0; $j < count($availableTestCases); $j++) {\n $partRes = array();\n $partRes['ID'] = $availableTestCases[$j]['ID'];\n $testCasesArray[] = $partRes;\n }\n }\n }\n\n return $testCasesArray;\n}", "function getAllTestCategoriesInsideACategory($parentCategoryID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesCategoriesID = getClientItemTypeID_RelatedWith_byName($definitions['testcasescategory'], $clientID);\n\n //get property\n $testCategoryParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasescategoryParentID'], $clientID);\n\n //First, we need the tree categories\n $tree = getItemsTree($itemTypeTestCasesCategoriesID, $clientID, $testCategoryParentPropertyID, $parentCategoryID);\n\n //Transform the items tree and store the ids in an unidimensional array\n $allCategories = array();\n\n //First, add the parentCategoryID\n $allCategories[] = $parentCategoryID;\n\n if ($tree) {\n foreach ($tree as $parid => $parent) {\n\n if (!in_array($parid, $allCategories)) {\n //Add the value\n $allCategories[] = $parid;\n }\n\n foreach ($parent as $child) {\n $id = $child['ID'];\n\n //Check if the values does not exist in the allCategories array.\n if (!in_array($id, $allCategories)) {\n //Add the value\n $allCategories[] = $id;\n }\n }\n }\n }\n\n //And return the testCategories\n return ($allCategories);\n}", "public function testSortByHierarchy() {\n // Create\n $this->phactory->create('kb_category');\n\n // Sort them\n $categories = $this->kb_category->sort_by_hierarchy();\n $category = current( $categories );\n\n // Assert\n $this->assertContainsOnlyInstancesOf( 'KnowledgeBaseCategory', $categories );\n $this->assertNotNull( $category->depth );\n }", "public function getPartialTreeDataProvider()\n {\n // Case #0.\n $cat1 = $this->buildCategory(\n [\n 'id' => 'cat1',\n 'active' => true,\n 'sort' => 1,\n 'left' => 2,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ]\n );\n\n $out[] = [new \\ArrayIterator([$cat1]), 5, 'cat1', [$cat1]];\n\n // Case #1 test finding in deeper level with multiple side categories.\n $cat2 = $this->buildCategory(\n [\n 'id' => 'cat2',\n 'active' => true,\n 'sort' => 2,\n 'left' => 8,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ]\n );\n\n $cat3 = $this->buildCategory(\n [\n 'id' => 'cat3',\n 'active' => true,\n 'sort' => 1,\n 'left' => 1,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n 'current' => true,\n 'expanded' => true,\n ]\n );\n\n $cat4 = $this->buildCategory(\n [\n 'id' => 'cat4',\n 'active' => true,\n 'sort' => 1,\n 'left' => 3,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ]\n );\n\n $cat41 = $this->buildCategory(\n [\n 'id' => 'cat41',\n 'active' => true,\n 'sort' => 1,\n 'left' => 4,\n 'parent_id' => 'cat4',\n 'level' => 2,\n ]\n );\n\n $cat42 = $this->buildCategory(\n [\n 'id' => 'cat42',\n 'active' => true,\n 'sort' => 1,\n 'left' => 5,\n 'parent_id' => 'cat4',\n 'level' => 2,\n ]\n );\n\n $cat421 = $this->buildCategory(\n [\n 'id' => 'cat421',\n 'active' => true,\n 'sort' => 2,\n 'left' => 7,\n 'parent_id' => 'cat42',\n 'level' => 3,\n ]\n );\n\n $tree = [$cat1, $cat2, $cat3, $cat4];\n\n $cat4->setChild('cat42', $cat42);\n $cat4->setChild('cat41', $cat41);\n $cat42->setChild('cat421', $cat421);\n\n $out[] = [new \\ArrayIterator($tree), 5, 'cat42', [$cat42]];\n\n // Case #2 test with improper arguments.\n $out[] = [[], 0, null, null, 'Category Id must be defined on getPartialTree() method'];\n\n return $out;\n }", "public function getCategoryTree() {\n $categories = TableRegistry::get('Categories');\n\n $first_level_categories = $categories->find()->select([\n 'id',\n 'title',\n 'slug'\n ])->where([\n 'level' => '0',\n 'status' => '1'\n ])->toArray();\n\n $second_level_categories = $categories->find()->select([\n 'id',\n 'title',\n 'parent_id',\n 'slug'\n ])->where([\n 'level' => '1',\n 'status' => '1'\n ])->toArray();\n\n $second_category_array = array();\n\n foreach ($second_level_categories as $second_category) {\n // $second_category_array[$second_category['parent_id']] = array();\n if (!is_array($second_category_array [$second_category ['parent_id']]))\n $second_category_array [$second_category ['parent_id']] = array();\n $second_category_array [$second_category ['parent_id']] [] = $second_category;\n }\n\n $third_level_categories = $categories->find()->select([\n 'id',\n 'title',\n 'parent_id',\n 'slug'\n ])->where([\n 'level' => '2',\n 'status' => '1'\n ])->toArray();\n\n $third_category_array = array();\n\n foreach ($third_level_categories as $third_category) {\n // $second_category_array[$second_category['parent_id']] = array();\n if (!is_array($third_category_array [$third_category ['parent_id']]))\n $third_category_array [$third_category ['parent_id']] = array();\n $third_category_array [$third_category ['parent_id']] [] = $third_category;\n }\n\n return [\n $first_level_categories,\n $second_category_array,\n $third_category_array\n ];\n }", "function get_categories_tree() {\n\t\tglobal $db;\n\t\t$sql = \" SELECT id, name, parent_id AS parent_id \n\t\t\t\tFROM \" . $this->table_category;\n\t\t$db->query ( $sql );\n\t\t$categories = $db->getObjectList ();\n\t\t\n\t\t$tree = FSFactory::getClass ( 'tree', 'tree/' );\n\t\t$rs = $tree->indentRows ( $categories, 1 );\n\t\treturn $rs;\n\t}", "function getCategoryTree($db) {\n // Make Category Tree\n $query = \"SELECT `COMPLAINT_TYPE`, COUNT(*) FROM `cases` WHERE `BOROUGH` != '' GROUP BY `COMPLAINT_TYPE` ORDER BY COUNT(*) DESC\";\n foreach( $db->query($query) as $row ) {\n $category['name'] = trim($row[\"COMPLAINT_TYPE\"], ' /');\n $category['COMPLAINT_TYPE'] = $row[\"COMPLAINT_TYPE\"];\n $category['slug'] = slugify($category['name']);\n $category['count'] = $row[\"COUNT(*)\"];\n if( $category['slug'] != 'n-a' && $category['slug'] != 'select-one' && $category['slug'] != 'other' ){\n $topCategories[$category['slug']]=$category;\n }\n }\n\n $query = \"SELECT `COMPLAINT_TYPE`, `DESCRIPTOR`, COUNT(*) FROM `cases` WHERE `BOROUGH` != '' GROUP BY `COMPLAINT_TYPE`, `DESCRIPTOR` ORDER BY COUNT(*) DESC\";\n foreach( $db->query($query) as $row ) {\n $subCategory['name'] = trim($row[\"DESCRIPTOR\"], ' /');\n $subCategory['DESCRIPTOR'] = $row[\"DESCRIPTOR\"];\n $subCategory['slug'] = slugify($subCategory['name']);\n $subCategory['count'] = $row[\"COUNT(*)\"];\n if(\n trim($row['COMPLAINT_TYPE']) != ''\n && $subCategory['slug'] != 'n-a'\n && $subCategory['slug'] != 'select'\n ){\n $topCategories[slugify($row['COMPLAINT_TYPE'])]['subCategories'][$subCategory['slug']]=$subCategory;\n }\n }\n\n return $topCategories;\n}", "public static function getCategoryTree() {\n $catModel = new \\App\\Category();\n $catTree = $catModel->getCategoryTree();\n return $catTree;\n }", "function getParentCategoriesForCategory($categoryID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesCategoriesID = getClientItemTypeID_RelatedWith_byName($definitions['testcasescategory'], $clientID);\n\n //get property\n $testCategoryParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasescategoryParentID'], $clientID);\n\n //start loop with passed category\n $aux = $categoryID;\n\n $categoriesArray = array();\n\n //search parent category until 0 level reached\n while ($aux != 0) {\n $categoriesArray[] = $aux;\n $aux = getItemPropertyValue($aux, $testCategoryParentPropertyID, $clientID);\n }\n\n //return categories array\n return $categoriesArray;\n}", "function getAllTestCasesInsideCategory($parentCategoryID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesID = getClientItemTypeID_RelatedWith_byName($definitions['testcases'], $clientID);\n\n //get property\n $testCasesParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID);\n\n //get all categories inside\n $allCategories = getAllTestCategoriesInsideACategory($parentCategoryID, $clientID);\n\n $toFilter = implode(',', $allCategories);\n\n //When we have all the categories inside, get their test cases\n //Create the filter\n // build return properties array\n $returnProperties = array();\n\n //build an empty filter\n $filters = array();\n $filters[] = array('ID' => $testCasesParentPropertyID, 'value' => $toFilter, 'mode' => '<-IN');\n\n $testCases = getFilteredItemsIDs($itemTypeTestCasesID, $clientID, $filters, $returnProperties);\n\n //Get only the testCategories ids\n $onlyIds = array();\n\n foreach ($testCases as $tcas) {\n $onlyIds[] = $tcas['ID'];\n }\n\n return $onlyIds;\n}", "function getCategoryHierarchyAsArray()\n{\n return array\n (\n array\n (\n 'idString' => '1' ,\n 'idParentString' => null ,\n 'name' => 'Approved',\n 'children' => array\n (\n array\n (\n 'idString' => '1-1' ,\n 'idParentString' => '1' ,\n 'name' => 'Cons',\n 'children' => array\n (\n array('idString' => '1-1-1', 'idParentString' => '1-1', 'name' => 'ConsultingA', 'children' => array()),\n array('idString' => '1-1-2', 'idParentString' => '1-1', 'name' => 'ConsultingB', 'children' => array()),\n array('idString' => '1-1-3', 'idParentString' => '1-1', 'name' => 'Management ', 'children' => array()),\n array\n (\n 'idString' => '1-1-4' ,\n 'idParentString' => '1-1' ,\n 'name' => 'More Categories',\n 'children' => array\n (\n array('idString' => '1-1-4-1', 'idParentString' => '1-1-4', 'name' => 'Cat1', 'children' => array()),\n array('idString' => '1-1-4-2', 'idParentString' => '1-1-4', 'name' => 'Cat2', 'children' => array()),\n array\n (\n 'idString' => '1-1-4-3' ,\n 'idParentString' => '1-1-4' ,\n 'name' => 'Still more categories',\n 'children' => array\n (\n array\n (\n 'idString' => '1-1-4-3-1',\n 'idParentString' => '1-1-4-3' ,\n 'name' => 'CatA' ,\n 'children' => array()\n ),\n array\n (\n 'idString' => '1-1-4-3-2',\n 'idParentString' => '1-1-4-3' ,\n 'name' => 'CatB' ,\n 'children' => array()\n )\n )\n ),\n array\n (\n 'idString' => '1-1-4-4' ,\n 'idParentString' => '1-1-4' ,\n 'name' => 'Category 3',\n 'children' => array()\n )\n )\n )\n )\n ),\n array('idString' => '1-2', 'idParentString' => '1', 'name' => 'ConsultingA', 'children' => array()),\n array('idString' => '1-3', 'idParentString' => '1', 'name' => 'ConsultingB', 'children' => array())\n )\n ),\n array\n (\n 'idString' => '2' ,\n 'idParentString' => null ,\n 'name' => 'Not Approved',\n 'children' => array\n (\n array\n (\n 'idString' => '2-1' ,\n 'idParentString' => '2' ,\n 'name' => 'Consulting - 1',\n 'children' => array()\n ),\n array\n (\n 'idString' => '2-2' ,\n 'idParentString' => '2' ,\n 'name' => 'Consulting - 2',\n 'children' => array()\n ),\n array\n (\n 'idString' => '2-3' ,\n 'idParentString' => '2' ,\n 'name' => 'Consulting - 3',\n 'children' => array()\n )\n )\n )\n );\n}", "function retrieveHierarchy() {\r\n\t\t$arrCats = $this->generateTreeByLevels(3);\r\n\t\t\r\n\t\treturn $arrCats;\r\n\t}", "function get_categories_tree()\n\t\t{\n\t\t\t$where = '';\n\t\t\t$is_accessory = FSInput::get('is_accessory',0,'int');\n\t\t\tif($is_accessory){\n\t\t\t\t$where .= ' AND is_accessories = 0 ';\n\t\t\t} else {\n\t\t\t\t$where .= ' AND is_accessories = 1 ';\n\t\t\t}\n\t\t\t\n\t\t\tglobal $db ;\n\t\t\t$sql = \" SELECT id, name, parent_id AS parentid \n\t\t\t\tFROM fs_products_categories \n\t\t\t\tWHERE 1 = 1\n\t\t\t\t\".$where;\n\t\t\t// $db->query($sql);\n\t\t\t$categories = $db->getObjectList($sql);\n\t\t\t\n\t\t\t$tree = FSFactory::getClass('tree','tree/');\n\t\t\t$rs = $tree -> indentRows($categories,1); \n\t\t\treturn $rs;\n\t\t}", "public static function getCategories() {\n $top_level_cats = array();\n//Select all top level categories\n Db_Actions::DbSelect(\"SELECT * FROM cscart_categories LEFT OUTER JOIN cscart_category_descriptions ON cscart_categories.category_id = cscart_category_descriptions.category_id WHERE cscart_categories.parent_id=0\");\n $result = Db_Actions::DbGetResults();\n if (!isset($result->empty_result)) {\n foreach ($result as $cat) {\n $top_level_cats[] = array('id' => $cat->category_id,\n 'cat_name' => $cat->category,\n 'company_id' => $cat->company_id,\n 'status' => $cat->status,\n 'product_count' => $cat->product_count,\n 'is_op' => $cat->is_op,\n 'usergroup_ids' => $cat->usergroup_ids);\n }\n }\n if (!isset($result->empty_result)) {\n return $result;\n }\n else {\n return new stdClass();\n }\n }", "public function structure() {\n $list = $this->newQuery()->where('parent_id', 0)->orderBy('order_id', 'asc')->get();\n $list->transform(function (PageCategory $category) {\n $children = $category->newQuery()->where('parent_id', $category->getAttribute('id'))->orderBy('order_id', 'asc')->get();\n $children->transform(function (PageCategory $category) {\n $children = $category->newQuery()->where('parent_id', $category->getAttribute('id'))->orderBy('order_id', 'asc')->get();\n $category->setAttribute('children', $children);\n\n return $category;\n });\n $category->setAttribute('children', $children);\n\n return $category;\n });\n\n return $list->toArray();\n }", "public function getChildCategories()\n {\n if (!$this->hasData('category_tabs')) {\n $currentCategory = $this->getMainCategory();\n $results = [];\n if ($currentCategory) {\n $tabIds = $currentCategory->getData('sss_category_tab_ids');\n if (!is_array($tabIds)) {\n $tabIds = explode(',', $tabIds);\n }\n /**\n * Enable Catalog Category Flat ... \n * @var $tabCollection \\Magento\\Catalog\\Model\\ResourceModel\\Category\\Flat\\Collection\n */\n if ($currentCategory->getUseFlatResource()) {\n $tabCollection = $currentCategory->getCollection();\n\n $tabCollection\n ->addIsActiveFilter()\n ->addAttributeToSelect('include_in_menu')\n ->addAttributeToSelect('sss_custom_tab_title')\n ->addAttributeToSelect('position')\n ->addAttributeToSelect('sss_tab_position')\n ->addAttributeToSelect('name')\n ->addAttributeToFilter('sss_visible_in_tab', SourceBoolean::VALUE_YES)\n ->addFieldToFilter('parent_id', ['eq' => $currentCategory->getId()]);\n\n $tabCollection->getSelect()\n ->orWhere('main_table.entity_id in (?)', $tabIds, \\Magento\\Framework\\DB\\Select::TYPE_CONDITION);\n\n $results = $tabCollection->getItems();\n } else {\n $tabCollection = $currentCategory->getChildrenCategories();\n if ($tabCollection instanceof AbstractCollection) {\n $tabCollection->setLoadProductCount(false);\n $tabCollection->addAttributeToSelect('sss_custom_tab_title');\n $tabCollection->addLevelFilter(3);\n try {\n $tabCollection->addAttributeToFilter('sss_visible_in_tab', SourceBoolean::VALUE_YES);\n } catch (\\Exception $e) {\n }\n $results = $tabCollection->getItems();\n } else {\n foreach ($tabCollection as $childCategory) {\n if (3 == $childCategory->getLevel()) {\n $results[] = $childCategory;\n }\n }\n }\n }\n usort($results, function ($first, $second) {\n if ($first->getData('sss_tab_position') || $second->getData('sss_tab_position')) {\n return $first->getData('sss_tab_position') >= $second->getData('sss_tab_position');\n } else {\n return $first->getData('position') >= $second->getData('position');\n }\n });\n }\n $this->setData('category_tabs', $results);\n }\n return $this->getData('category_tabs');\n }", "public function getMenu(){\n $bigCategory = $this->getBigCategory();\n $medCategory = $this->getMediumCategory();\n foreach($bigCategory as $bigKey => $value){\n foreach($medCategory as $medKey => $val){\n if($val['parentId'] == $value['id']){\n $bigCategory[$bigKey]['subCategory'][] = $val;\n }\n }\n }\n return $bigCategory;\n }", "function getCategory() {\n\t\treturn $this->node->firstChild->toString();\n\t}", "public function getTree()\n {\n return HandbookCategory::all()->toTree();\n }", "function get_all_comic_categories() {\n global $comiccat, $category_tree, $non_comic_categories;\n\n $categories_by_id = get_all_category_objects_by_id();\n\n foreach (array_keys($categories_by_id) as $category_id) {\n $category_tree[] = $categories_by_id[$category_id]->parent . '/' . $category_id;\n }\n\n do {\n $all_ok = true;\n for ($i = 0; $i < count($category_tree); ++$i) {\n $current_parts = explode(\"/\", $category_tree[$i]);\n if (reset($current_parts) != 0) {\n\n $all_ok = false;\n for ($j = 0; $j < count($category_tree); ++$j) {\n $j_parts = explode(\"/\", $category_tree[$j]);\n\n if (end($j_parts) == reset($current_parts)) {\n $category_tree[$i] = implode(\"/\", array_merge($j_parts, array_slice($current_parts, 1)));\n break;\n }\n }\n }\n }\n } while (!$all_ok);\n\n $non_comic_tree = array();\n\n if (get_option('comicpress-enable-storyline-support') == 1) {\n $result = get_option(\"comicpress-storyline-category-order\");\n if (!empty($result)) {\n $category_tree = explode(\",\", $result);\n }\n $non_comic_tree = array_keys($categories_by_id);\n foreach ($category_tree as $node) {\n $parts = explode(\"/\", $node);\n $category_id = end($parts);\n if ($parts[1] == $comiccat) {\n if (($index = array_search($category_id, $non_comic_tree)) !== false) {\n array_splice($non_comic_tree, $index, 1);\n }\n }\n }\n } else {\n $new_category_tree = array();\n foreach ($category_tree as $node) {\n $parts = explode(\"/\", $node);\n if ($parts[1] == $comiccat) {\n $new_category_tree[] = $node;\n } else {\n $non_comic_tree[] = end($parts);\n }\n }\n $category_tree = $new_category_tree;\n }\n\n $non_comic_categories = implode(\" and \", $non_comic_tree);\n}", "public function findCategories();", "function listTestCategory() {\n\t\t$this->db->select('*');\n\t\t$this->db->from($this->test_category_table);\n\t\t$this->db->where('status !=', 0);\n $query = $this->db->get();\n\t\treturn $query->result();\n\t}", "public function getCategoryLimitedSortedTree()\n {\n $page = $this->request->getParam('p') ?: 1;\n $beginPageValue = ($page * $this->getLimitPerPage()) - $this->getLimitPerPage();\n $categories = $this->getCategoriesTree();\n $categories = array_splice($categories, $beginPageValue, $this->getLimitPerPage());\n\n return $categories;\n }", "public function getCategories();", "public function getCategories();", "function getCategories(){\n\t$storeId = Mage::app()->getStore()->getId(); \n\n\t$collection = Mage::getModel('catalog/category')->getCollection()\n\t\t->setStoreId($storeId)\n\t\t->addAttributeToSelect(\"name\");\n\t$catIds = $collection->getAllIds();\n\n\t$cat = Mage::getModel('catalog/category');\n\n\t$max_level = 0;\n\n\tforeach ($catIds as $catId) {\n\t\t$cat_single = $cat->load($catId);\n\t\t$level = $cat_single->getLevel();\n\t\tif ($level > $max_level) {\n\t\t\t$max_level = $level;\n\t\t}\n\n\t\t$CAT_TMP[$level][$catId]['name'] = $cat_single->getName();\n\t\t$CAT_TMP[$level][$catId]['childrens'] = $cat_single->getChildren();\n\t}\n\n\t$CAT = array();\n\t\n\tfor ($k = 0; $k <= $max_level; $k++) {\n\t\tif (is_array($CAT_TMP[$k])) {\n\t\t\tforeach ($CAT_TMP[$k] as $i=>$v) {\n\t\t\t\tif (isset($CAT[$i]['name']) && ($CAT[$i]['name'] != \"\")) {\t\t\t\t\t\n\t\t\t\t\t/////Berry add/////\n\t\t\t\t\tif($k == 2)\n\t\t\t\t\t\t$CAT[$i]['name'] .= $v['name'];\n\t\t\t\t\telse\n\t\t\t\t\t\t$CAT[$i]['name'] .= \"\";\n\t\t\t\t\t\t\n\t\t\t\t\t//$CAT[$i]['name'] .= \" > \" . $v['name'];\n\t\t\t\t\t$CAT[$i]['level'] = $k;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$CAT[$i]['name'] = $v['name'];\n\t\t\t\t\t$CAT[$i]['level'] = $k;\n\t\t\t\t}\n\n\t\t\t\tif (($v['name'] != \"\") && ($v['childrens'] != \"\")) {\n\t\t\t\t\tif (strpos($v['childrens'], \",\")) {\n\t\t\t\t\t\t$children_ids = explode(\",\", $v['childrens']);\n\t\t\t\t\t\tforeach ($children_ids as $children) {\n\t\t\t\t\t\t\tif (isset($CAT[$children]['name']) && ($CAT[$children]['name'] != \"\")) {\n\t\t\t\t\t\t\t\t$CAT[$children]['name'] = $CAT[$i]['name'];\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$CAT[$children]['name'] = $CAT[$i]['name'];\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\telse {\n\t\t\t\t\t\tif (isset($CAT[$v['childrens']]['name']) && ($CAT[$v['childrens']]['name'] != \"\")) {\n\t\t\t\t\t\t\t$CAT[$v['childrens']]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$CAT[$v['childrens']]['name'] = $CAT[$i]['name'];\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\tunset($collection);\n\tunset($CAT_TMP);\n\treturn $CAT;\n}", "public function getCategoriesAndParents() {\n\t\t$cats = array();\n\t\tif ($this->categories) {\n\t\t\t$configuration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['camaliga']);\n\t\t\t$catMode = intval($configuration[\"categoryMode\"]);\n\t\t\t$lang = intval($GLOBALS['TSFE']->config['config']['sys_language_uid']);\n\t\t\t// Step 1: select all categories of the current language\n\t\t\t$categoriesUtility = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('\\quizpalme\\Camaliga\\Utility\\AllCategories');\n\t\t\t$all_cats = $categoriesUtility->getCategoriesarrayComplete();\n\t\t\t// Step 2: aktuelle orig_uid herausfinden\n\t\t\t$orig_uid = intval($this->getUid());\t// ist immer die original uid (nicht vom übersetzten Element!)\n\t\t\tif ($lang > 0 && $catMode == 0) {\n\t\t\t\t$res4 = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t\t\t'uid',\n\t\t\t\t\t\t'tx_camaliga_domain_model_content',\n\t\t\t\t\t\t'deleted=0 AND hidden=0 AND sys_language_uid=' . $lang . ' AND t3_origuid=' . $orig_uid);\n\t\t\t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($res4) > 0) {\n\t\t\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res4))\n\t\t\t\t\t\tif ($row['uid']) {\n\t\t\t\t\t\t\t$orig_uid = intval($row['uid']);\t// uid of the translated element\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($res4);\n\t\t\t}\n\t\t\t// Step 3: get the mm-categories of the current element (from the original or translated element)\n\t\t\t$res4 = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t'uid_local',\n\t\t\t\t'sys_category_record_mm',\n\t\t\t\t\"tablenames='tx_camaliga_domain_model_content' AND uid_foreign=\" . $orig_uid);\n\t\t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($res4) > 0) {\n\t\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res4)){\n\t\t\t\t\t$uid = $row['uid_local'];\n\t\t\t\t\tif (!isset($all_cats[$uid]['parent'])) continue;\n\t\t\t\t\t$parent = (int) $all_cats[$uid]['parent'];\n\t\t\t\t\t//if (!$all_cats[$parent]['title'])\tcontinue;\n\t\t\t\t\tif (!isset($cats[$parent])) {\n\t\t\t\t\t\t$cats[$parent] = array();\n\t\t\t\t\t\t$cats[$parent]['childs'] = array();\n\t\t\t\t\t\t$cats[$parent]['title'] = $all_cats[$parent]['title'];\n\t\t\t\t\t}\n\t\t\t\t\tif ($all_cats[$uid]['title'])\n\t\t\t\t\t\t$cats[$parent]['childs'][$uid] = $all_cats[$uid]['title'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($res4);\n\t\t}\n\t\treturn $cats;\n\t}", "function getMainCategory()\n {\n $sql = \"select * from tbl_issue_category where parent_id=0\";\n $query = $this->db->query($sql);\n return $query->result_array();\n }", "public function categoryTree( $category ){ return $this->APICall( array('categoryTree' => $category), \"Couldn't get the category tree for \" . $category ); }", "function getCategories($object) { \n\n $R1 = new Category(); // R1 --\n $R11 = new Category(); // | | - R11 --\n $R111 = new Category(); // | | - R111\n $R112 = new Category(); // | | - R112\n $R11->addSubcategory($R111); // |\n $R11->addSubcategory($R112); // |\n $R1->addSubcategory($R11); // |\n $R2 = new Category(); // R2 --\n $R21 = new Category(); // | - R21 --\n $R211 = new Category(); // | | - R211\n $R22 = new Category(); // |\n $R221 = new Category(); // | - R22 --\n $R21->addSubcategory($R211); // | - R221\n $R22->addSubcategory($R221);\n $R2->addSubcategory($R21);\n $R2->addSubcategory($R22);\n\n $object->addCollectionEntry($R1); \n $object->addCollectionEntry($R2); \n}" ]
[ "0.6299497", "0.6204236", "0.61932635", "0.6171437", "0.60780704", "0.6059209", "0.59716314", "0.59021354", "0.5776588", "0.57236856", "0.5707779", "0.5692827", "0.5683793", "0.5652623", "0.5638312", "0.56229925", "0.5620955", "0.55915844", "0.55809176", "0.5569658", "0.5541206", "0.5538625", "0.5532774", "0.5529767", "0.5529767", "0.5523459", "0.5511091", "0.54857254", "0.54578865", "0.54497004" ]
0.6220792
1
This function removes the steps of a test case from the results
function deleteStepsResultsForATestCase($testCase, $relation, $clientID) { global $definitions; //DEFINITIONS $itemTypeStepsID = getClientItemTypeID_RelatedWith_byName($definitions['steps'], $clientID); $resultsItemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['result'], $clientID); //DEFINITIONS FOR PROPERTIES $tcParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsTestCaseParentID'], $clientID); $relatedStepPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsRelatedID'], $clientID); $relatedRelationPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsRoundSubjectRelationID'], $clientID); $stepAssocPropertyID = getClientPropertyID_RelatedWith_byName($definitions['resultStepAssociatedID'], $clientID); //build the return array $returnProperties = array(); //build the filter $filters = array(); $filters[] = array('ID' => $tcParentPropertyID, 'value' => $testCase); $filters[] = array('ID' => $relatedStepPropertyID, 'value' => 0, 'mode' => '<>'); $filters[] = array('ID' => $relatedRelationPropertyID, 'value' => $relation['ID']); // get testcase steps $steps = getFilteredItemsIDs($itemTypeStepsID, $clientID, $filters, $returnProperties); $stepsList = array(); foreach ($steps as $step) { $stepsList[] = $step['ID']; } if (count($stepsList) > 0) { // delete steps associated results //build the return array $returnProperties = array(); //build the filter $filters = array(); $filters[] = array('ID' => $stepAssocPropertyID, 'value' => implode(',', $stepsList), 'mode' => '<-IN'); //get results $res = getFilteredItemsIDs($resultsItemTypeID, $clientID, $filters, $returnProperties); $resList = array(); foreach ($res as $result) { $resList[] = $result['ID']; } if (count($resList) > 0) { //Clear results steps list deleteItems($resultsItemTypeID, $clientID, implode(',', $resList)); } // finally delete steps deleteItems($itemTypeStepsID, $clientID, implode(',', $stepsList)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function clean(&$testResults) {\n $n = count($testResults);\n for($i = 0; $i < $n; $i++) {\n $this->cleanTestResult(&$testResults[$i]);\n }\n }", "public function skip() {\n parent::skip();\n foreach ($this->suites as $suite) {\n $suite->skip();\n }\n foreach ($this->cases as $case) {\n $case->skip();\n }\n }", "public function getSkippedScenarios();", "public function clearResults()\n {\n $this->_return = null;\n }", "function bp_course_remove_quiz_results() {\n\tglobal $bp;\n\n\t/**\n\t * When clicking on a screen notification, we need to remove it from the menu.\n\t * The following command will do so.bp_notifications_delete_notifications_by_type\n \t */\n\tbp_notifications_delete_notifications_by_type( $bp->loggedin_user->id, $bp->course->slug, 'quiz_results' );\n}", "function my_filter_site_status_tests($tests) {\n unset($tests['async']['background_updates']);\n return $tests;\n}", "public function dontSeeFailNow() {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Assertion('dontSeeFailNow', func_get_args()));\n }", "public function testStepKeyReplacementFilteredOut()\n {\n $clickStepKey = \"clickStepKey\";\n $fillFieldStepKey = \"fillFieldStepKey\";\n $clickAction = \"click\";\n $fillFieldAction =\"fillField\";\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([\n new ActionObject($clickStepKey, $clickAction, ['selector' => 'value']),\n new ActionObject($fillFieldStepKey, $fillFieldAction, ['selector' => 'value'])\n ])\n ->build();\n\n $result = $actionGroupUnderTest->extractStepKeys();\n\n $this->assertNotContains($clickStepKey, $result);\n $this->assertNotContains($fillFieldStepKey, $result);\n $this->assertCount(0, $result);\n }", "protected function clearResults() {\n\t\t$this->error = '';\n\t\t$this->status_org = false;\n\t\t$this->status_new = false;\n\t}", "public function shouldBeSkipped();", "public function tearDown()\n {\n $this->testStepFactory->create(\n \\Magento\\Config\\Test\\TestStep\\SetupConfigurationStep::class,\n ['configData' => $this->configData, 'rollback' => true]\n )->run();\n\n $this->testStepFactory->create(\n \\Magento\\SalesRule\\Test\\TestStep\\DeleteSalesRulesStep::class,\n ['salesRules' => [$this->salesRuleName]]\n )->run();\n\n $this->testStepFactory->create(\n \\Magento\\Catalog\\Test\\TestStep\\DeleteAttributeStep::class,\n ['attribute' => $this->attribute]\n )->run();\n }", "public function tearDown()\n {\n $this->objectManager->create(\\Magento\\Tax\\Test\\TestStep\\DeleteAllTaxRulesStep::class, [])->run();\n }", "public function testCreateTestCaseWithoutName()\n {\n $user = factory(App\\User::class)->create();\n\n $this->actingAs($user)\n ->visit('/library')\n ->click('#newCase')\n ->seePageIs('/library/testcase/create')\n ->type('someRandomDecription', 'description1')\n ->type('someRandomPrefixes','prefixes1')\n ->type('someRandomSteps','steps1')\n ->press('submit')\n ->seePageIs('/library/testcase/create');\n\n\n $this->dontSeeInDatabase('TestCaseHistory', [\n 'TestCaseDescription' => 'someRandomDecription',\n 'TestCasePrefixes' => 'someRandomPrefixes'\n ]);\n\n }", "public function benchThisWillBeSkipped()\n {\n }", "public function tearDown()\n {\n $this->objectManager->create(\\Magento\\Tax\\Test\\TestStep\\DeleteAllTaxRulesStep::class)->run();\n $this->objectManager->create(\n \\Magento\\Config\\Test\\TestStep\\SetupConfigurationStep::class,\n ['configData' => 'default_tax_configuration,shipping_tax_class_taxable_goods_rollback']\n )->run();\n }", "public function tearDown() {\n $this->transformation = null;\n }", "public function tearDown() {\n $this->transformation = null;\n }", "public function tearDown() {\n $this->transformation = null;\n }", "function clear() {\n\t\txdebug_stop_code_coverage();\n\t}", "protected function outputSpecificStep() {}", "function deleteTestCasesViewer(&$dbHandler,&$smartyObj,&$tprojectMgr,&$treeMgr,&$tsuiteMgr,\r\n &$tcaseMgr,$argsObj,$feedback = null)\r\n{\r\n\r\n $guiObj = new stdClass();\r\n $guiObj->main_descr = lang_get('delete_testcases');\r\n $guiObj->system_message = '';\r\n\r\n\r\n $tables = $tprojectMgr->getDBTables(array('nodes_hierarchy','node_types','tcversions'));\r\n $testcase_cfg = config_get('testcase_cfg');\r\n $glue = $testcase_cfg->glue_character;\r\n\r\n $containerID = isset($argsObj->testsuiteID) ? $argsObj->testsuiteID : $argsObj->objectID;\r\n $containerName = $argsObj->tsuite_name;\r\n if( is_null($containerName) )\r\n {\r\n $dummy = $treeMgr->get_node_hierarchy_info($argsObj->objectID);\r\n $containerName = $dummy['name'];\r\n }\r\n\r\n $guiObj->testCaseSet = $tsuiteMgr->get_children_testcases($containerID);\r\n $guiObj->exec_status_quo = null;\r\n $tcasePrefix = $tprojectMgr->getTestCasePrefix($argsObj->tprojectID);\r\n $hasExecutedTC = false;\r\n\r\n if( !is_null($guiObj->testCaseSet) && count($guiObj->testCaseSet) > 0)\r\n {\r\n foreach($guiObj->testCaseSet as &$child)\r\n {\r\n $external = $tcaseMgr->getExternalID($child['id'],null,$tcasePrefix);\r\n $child['external_id'] = $external[0];\r\n \r\n // key level 1 : Test Case Version ID\r\n // key level 2 : Test Plan ID\r\n // key level 3 : Platform ID\r\n $getOptions = array('addExecIndicator' => true);\r\n $dummy = $tcaseMgr->get_exec_status($child['id'],null,$getOptions);\r\n $child['draw_check'] = $argsObj->grants->delete_executed_testcases || (!$dummy['executed']);\r\n\r\n $hasExecutedTC = $hasExecutedTC || $dummy['executed'];\r\n unset($dummy['executed']);\r\n $guiObj->exec_status_quo[] = $dummy;\r\n }\r\n }\r\n // Need to understand if platform column has to be displayed on GUI\r\n if( !is_null($guiObj->exec_status_quo) )\r\n {\r\n // key level 1 : Test Case Version ID\r\n // key level 2 : Test Plan ID\r\n // key level 3 : Platform ID\r\n\r\n $itemSet = array_keys($guiObj->exec_status_quo);\r\n foreach($itemSet as $mainKey)\r\n {\r\n $guiObj->display_platform[$mainKey] = false;\r\n if(!is_null($guiObj->exec_status_quo[$mainKey]) )\r\n {\r\n $versionSet = array_keys($guiObj->exec_status_quo[$mainKey]);\r\n $stop = false;\r\n foreach($versionSet as $version_id)\r\n {\r\n $tplanSet = array_keys($guiObj->exec_status_quo[$mainKey][$version_id]);\r\n foreach($tplanSet as $tplan_id)\r\n {\r\n if( ($guiObj->display_platform[$mainKey] = !isset($guiObj->exec_status_quo[$mainKey][$version_id][$tplan_id][0])) )\r\n {\r\n $stop = true;\r\n break;\r\n }\r\n }\r\n \r\n if($stop)\r\n {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n // check if operation can be done\r\n $guiObj->user_feedback = $feedback;\r\n if(!is_null($guiObj->testCaseSet) && (sizeof($guiObj->testCaseSet) > 0) )\r\n {\r\n $guiObj->op_ok = true;\r\n $guiObj->user_feedback = '';\r\n }\r\n else\r\n {\r\n $guiObj->children = null;\r\n $guiObj->op_ok = false;\r\n $guiObj->user_feedback = is_null($guiObj->user_feedback) ? lang_get('no_testcases_available') : $guiObj->user_feedback;\r\n }\r\n\r\n if(!$argsObj->grants->delete_executed_testcases && $hasExecutedTC)\r\n {\r\n $guiObj->system_message = lang_get('system_blocks_delete_executed_tc');\r\n }\r\n\r\n $guiObj->objectID = $containerID;\r\n $guiObj->object_name = $containerName;\r\n $guiObj->refreshTree = $argsObj->refreshTree;\r\n\r\n $smartyObj->assign('gui', $guiObj);\r\n}", "private function resetResults() {\n $this->results = array();\n }", "public function tearDown()\n {\n $this->objectManager->create('Mage\\CatalogRule\\Test\\TestStep\\DeleteAllCatalogRulesStep')->run();\n }", "protected function tearDown()\n {\n $this->_filter = null; \n }", "public function endSkip(/* ... */)\n {\n if ($this->getTestResult() !== self::FAIL) {\n $this->setTestResult(self::PASS);\n }\n }", "public function withoutTransformer();", "public function skip(/* ... */)\n {\n if ($this->getTestResult() !== self::FAIL) {\n $this->setTestResult(self::SKIP);\n }\n }", "public function clear() {\n\t\t$this->expected_query = '';\n\t}", "protected function tearDown()\n {\n unset($this->output);\n }", "public function tearDown(){\n unset($this->user);\n unset($this->household);\n unset($this->unit);\n unset($this->qty);\n unset($this->category);\n unset($this->food);\n unset($this->ingredient);\n unset($this->recipe);\n unset($this->meal);\n unset($this->groceryItem);\n\n unset($this->userFty);\n unset($this->householdFty);\n unset($this->unitFty);\n unset($this->qtyFty);\n unset($this->categoryFty);\n unset($this->foodFty);\n unset($this->ingredientFty);\n unset($this->recipeFty);\n unset($this->mealFty);\n unset($this->groceryItemFty);\n }" ]
[ "0.58990055", "0.58325917", "0.5803855", "0.5635781", "0.55998796", "0.5564479", "0.5558872", "0.5542909", "0.5541296", "0.55059236", "0.5505281", "0.5501082", "0.54515016", "0.5410092", "0.5388904", "0.5348952", "0.5348952", "0.5348952", "0.5318067", "0.5308237", "0.5293523", "0.52912426", "0.5259884", "0.52530885", "0.52439153", "0.52430576", "0.5240815", "0.5219789", "0.52196836", "0.52089524" ]
0.6617149
0
Returns path to image. Gallery is define by ID.
abstract public function getPathImage($id, $filename);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getImagePath () {\n return luxbum::getImage($this->dir, $this->file);\n }", "function ImageFile()\n\t{\treturn $this->imagedir . (int)$this->id . \".jpg\";\n\t}", "public function getImagePath()\n {\n return $this->getImagesFolder() . '/' . $this->getRootImagePath();\n }", "public function path()\n {\n return $this->image->path;\n }", "protected function getImagePath()\n {\n return Yii::getAlias('@data/image.jpg');\n }", "public function getImagePath()\n {\n return $this->imagepath;\n }", "public function getPhoto($id);", "abstract public function get_thumbnail_source_path();", "public function getImagePath(){\r\n\t\t\treturn $this->imagePath;\r\n\t\t}", "public static function galleryUrl($id) {\n\t\treturn strtr(self::URLPATTERN_GALLERY, array('{id}' => $id));\n\t}", "function image($id) {\n\t\t\t$image = $id;\n\t\t\tif ( -1 == $image ) {\n\t\t\t\t$image = get_template_directory_uri(). '/img/promo-placeholder.jpg';\n\t\t\t} else {\n\t\t\t\t$image = wp_get_attachment_image_src($id, 'carousel');\n\t\t\t\t$image = $image[0];\n\t\t\t}\n\t\t\techo($image);\n\t}", "public function getPhoto() {\n return DATADIR . 'alumni/' . $this->shortName . '.jpg';\n }", "function tp_get_img_dir() {\n\t$file = new ElggFile();\n\t$file->setFilename('image/');\n\treturn $file->getFilenameOnFilestore();\n}", "private function _getAlbumImage($id, $type)\n\t{\n\t\treturn _PS_BASE_URL_.__PS_BASE_URI__.'modules/'.$this->name.'/images/c/'.$id.'-'.$type.'.jpg';\n\t}", "public function getImageFile()\n {\n $link = $this->link;\n return empty( $this->owner->$link ) ? null : \\Yii::getAlias(\n '@storage/' . $this->directory . '/' . $this->owner->$link\n );\n }", "public function getMainImage( $id ) {\n\t\t$db = $this->getDb();\n\t\t$cmd = $db->where('post_id', $id)\n\t\t\t->where('main', 1)\n\t\t\t->get();\n\t\t$rs = $cmd->first_row();\n\t\tforeach( $this->paths as $path ) {\n\t\t\t$fpath = FCPATH . $path . $rs->image;\n\t\t\tif( file_exists($fpath) and is_file($fpath) ) {\n\t\t\t\treturn str_replace(FCPATH, Core::getBaseUrl(), $fpath);\n\t\t\t}\n\t\t}\n\t\treturn Core::getBaseUrl() . 'assets/front_end/images/no_image_available.jpg';\n\t}", "function cpo_image_url( $id, $size = 'full' ) {\n\t$url = '';\n\tif ( is_numeric( $id ) ) {\n\t\t$url = wp_get_attachment_image_src( $id, $size );\n\t\t$url = $url[0];\n\t} else {\n\t\t$url = $id;\n\t}\n\n\treturn $url;\n}", "public function photoURL($ID) {\n\t\t\t\t$image = File::get_by_id($ID);\n\t\t\t\t$url = $image->getAbsoluteURL();\n\t\t\t\treturn $url;\n\t\t}", "function getFirstImage($id) {\n global $DB;\n $stmt = $DB->prepare(\"SELECT image FROM hotel_image WHERE hotel_id = ?\");\n $stmt->bindParam(1, $id);\n $stmt->execute();\n if ($row = $stmt->fetch()) {\n return \"./uploads/\".$row[\"image\"];\n }\n return \"./images/default-image.png\";\n}", "function gallery($id = null){\r\n\t\t$this->Album->id = $id;\r\n\t\t$album = $this->Album->read();\r\n\t\t$this->set('album',$album);\r\n\t\t$this->set('path',$this->Admin->siteVar('imagepath'));\r\n\t\t$this->set('baseurl',$this->Admin->siteVar('absoluteimgurl'));\r\n\t\t\r\n\t\t$this->render('gallery','ajax');\r\n\t}", "public function getImage() {\n if ($this->item_image == null) {\n return Yii::app()->request->baseUrl . \"/images/box/default.jpg\";\n } else {\n return Yii::app()->request->baseUrl . \"/images/box/\" . $this->item_image;\n }\n }", "public function mainImageURL()\n {\n if ($this->image) {\n $imageLocation = $this->image->location;\n } else {\n // If the image cannot be displayed, show a generic image.\n $imageLocation = 'generic/generic1.jpg';\n }\n\n return Storage::url($imageLocation);\n }", "function getImageId();", "function image($imgId,$type='thumbs') {\n if(is_file($this->core->_SYS['CONF']['FTP_QUOTATIONS'].\"/\".$type.\"/\".$imgId)) {\n $imgUrl = $this->core->_SYS['CONF']['URL_IMAGES_QUOTATIONS'].\"/\".$type.\"/\".$imgId;\n }\n\n return $imgUrl;\n }", "function getPhotoPath()\n\t{\n\t\treturn file_exists(\"img/portrait/user$this->id.jpg\") ? \"/img/portrait/user$this->id.jpg\" : \"/img/unavailable.jpg\";\n\t}", "public function get($id)\n\t{\n\t\t$query = $this->db\n\t\t\t->select('gallery_images.*, files.name, files.filename, files.extension, files.description, files.name as title, galleries.folder_id, galleries.slug as gallery_slug')\n\t\t\t->join('galleries', 'gallery_images.gallery_id = galleries.id', 'left')\n\t\t\t->join('files', 'files.id = gallery_images.file_id', 'left')\n\t\t\t->where('gallery_images.id', $id)\n\t\t\t->get('gallery_images');\n\t\t\t\t\n\t\tif ( $query->num_rows() > 0 )\n\t\t{\n\t\t\treturn $query->row();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function imagePath(){\n return $this->upload_directory.DS.$this->filename;\n }", "public function getImgPath()\n {\n return $this->imgPath;\n }", "public function get_image_path($id, $size = 'min')\n {\n $id = abs(intval($id));\n $id = sprintf('%\\'09d', $id);\n $dir1 = substr($id, 0, 3);\n $dir2 = substr($id, 3, 2);\n $dir3 = substr($id, 5, 2);\n\n return $dir1 . '/' . $dir2 . '/' . $dir3 . '/' . substr($id, -2) . '_topic_' . $size . '.jpg';\n }", "protected function getImageWithId($id){\n $conn = static::connect();\n $stmt = $conn->prepare(\"SELECT * FROM images where id=:id\");\n $stmt->bindValue('id', $id, PDO::PARAM_INT);\n $stmt->execute();\n return $stmt->fetch(PDO::FETCH_ASSOC);\n }" ]
[ "0.70817566", "0.6955634", "0.67909914", "0.67677885", "0.67656475", "0.6746698", "0.67443603", "0.67343765", "0.6726124", "0.6713007", "0.66791016", "0.6635203", "0.66279024", "0.6602257", "0.65997326", "0.65807176", "0.6576765", "0.65731096", "0.6536184", "0.65257263", "0.6507066", "0.65001816", "0.64995503", "0.6474724", "0.64699554", "0.6454293", "0.64354485", "0.6433963", "0.6433419", "0.6428148" ]
0.7338167
0
Changes ordering of file to left.
abstract public function moveLeft($id);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveLeft()\n {\n $this->position--;\n if ($this->position < 0) {\n $this->position++;\n array_unshift($this->line, '_');\n }\n }", "function orderdown() {\n\t\torder(-1);\n\t}", "public function rotateLeft();", "function moveRight()\n {\n $this->position++;\n if ($this->position >= count($this->line)) {\n array_push($this->line, '_');\n }\n }", "function sortFilesAscending($thisFiles) {\n \tusort($thisFiles, \"cmpFA\");\n \treturn $thisFiles;\n }", "function changeOrder() {\n $this->iteratorH = array_reverse($this->iteratorH);\n }", "function orderup() {\n\t\torder(1);\n\t}", "public function reorder_onMove()\n {\n $sourceNode = Page::find(post('sourceNode'));\n $targetNode = post('targetNode') ? Page::find(post('targetNode')) : null;\n\n if ($sourceNode == $targetNode) {\n return;\n }\n\n switch (post('position')) {\n case 'before':\n $sourceNode->moveBefore($targetNode);\n break;\n case 'after':\n $sourceNode->moveAfter($targetNode);\n break;\n case 'child':\n $sourceNode->makeChildOf($targetNode);\n break;\n default:\n $sourceNode->makeRoot();\n break;\n }\n }", "protected function externalSort() {\n\t\t$this->chunk();\n\n\t\t// To be confirmed/implemented\n\t\t// After file split put them back together in the right order\n\t\techo \"External sort TBC\\n\";\n\t}", "function filesOrder( $uid, $inc, $option, $cat_id ) {\n\tglobal $mainframe;\n $database = &JFactory::getDBO();\n\n\t$row = new jlist_files( $database );\n\t$row->load( $uid );\n $row->move( $inc );\n\n\t$mainframe->redirect( 'index.php?option=com_jdownloads&task=files.list&cat_id='.$cat_id );\n}", "protected function decksOrderAsc()\n {\n $request = $this->request();\n\n $this->result()\n ->changeRequest('decks_current_condition', $request['decks_order_asc'])\n ->changeRequest('decks_current_order', 'ASC')\n ->setCurrent('Decks_shared');\n }", "public function setOnlyLeft()\n {\n $this->value['text-align'] = 'left';\n $this->_onlyLeft = true;\n }", "function decrementFile() {\n \treturn $this->adjustPosition(-1);\n }", "function incrementFile() {\n \treturn $this->adjustPosition(1);\n }", "function languagelesson_reorder_pages($lessonid) {\n global $DB;\n $startpage = $DB->get_record(\"languagelesson_pages\", array('lessonid'=> $lessonid, 'prevpageid'=>0));\n $order = 0;\n $DB->set_field(\"languagelesson_pages\", 'ordering', $order, array('id'=>$startpage->id));\n $order++;\n $nextpageid = $DB->get_field(\"languagelesson_pages\", 'id', array('id'=>$startpage->nextpageid));\n\n for (; $nextpageid != 0; $order++) {\n $DB->set_field(\"languagelesson_pages\", 'ordering', $order, array('id'=>$nextpageid));\n $nextpageid = (int)$DB->get_field(\"languagelesson_pages\", 'nextpageid', array('id'=>$nextpageid));\n }\n}", "public function orderedMove() {\n\t\t$modelName = $this->Controller->modelClass;\n\t\t$this->Controller->{$modelName}->transaction();\n\n\t\tif (!$this->Controller->{$modelName}->Behaviors->attached('Sequence')) {\n\t\t\t$this->Controller->notice(\n\t\t\t\t__d('infinitas', 'A problem occured moving the ordered record.'),\n\t\t\t\tarray(\n\t\t\t\t\t'level' => 'error',\n\t\t\t\t\t'redirect' => true\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$fields = array_values($this->Controller->{$modelName}->sequenceGroupFields());\n\t\t$fields[] = $this->Controller->{$modelName}->alias . '.' . $this->Controller->{$modelName}->primaryKey;\n\t\t$data = $this->Controller->{$modelName}->find('first', array(\n\t\t\t'fields' => $fields,\n\t\t\t'conditions' => array(\n\t\t\t\t$this->Controller->{$modelName}->alias . '.' . $this->Controller->{$modelName}->primaryKey => $this->Controller->request->data[$modelName][$this->Controller->{$modelName}->primaryKey]\n\t\t\t),\n\t\t\t'callbacks' => false\n\t\t));\n\t\t$data[$modelName]['ordering'] = $this->Controller->request->params['named']['position'];\n\n\t\ttry {\n\t\t\tif ($this->Controller->{$modelName}->save($data, array('validate' => false))) {\n\t\t\t\t$this->Controller->{$modelName}->transaction(true);\n\t\t\t\t$this->Controller->notice(\n\t\t\t\t\t__d('infinitas', 'The record was moved'),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'redirect' => ''\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t} catch(Exception $e) {\n\t\t\t$this->Controller->{$modelName}->transaction(false);\n\t\t\t$this->Controller->notice(\n\t\t\t\t$e->getMessage(),\n\t\t\t\tarray(\n\t\t\t\t\t'level' => 'error',\n\t\t\t\t\t'redirect' => false\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}", "public function reorder()\n {\n $node = $this->page->find($this->request->get('nodeToChangeParent'));\n\n if ($this->request->get('parent') === '#') {\n $node->makeRoot();\n $this->changeSiblingsPositions($node, $this->request->get('position'));\n } else {\n $parent = $this->page->find($this->request->get('parent'));\n $node->makeChildOf($parent);\n $this->changeSiblingsPositions($node, $this->request->get('position'));\n }\n\n return [\n 'Position changed' => true,\n ];\n }", "public function toLeft($right);", "public function Low_reorder()\n {\n\t\t$this->__construct();\n\t}", "function cms_reOrder() {\r\n\t\tforeach ($this->data[\"Categoria\"] as $id => $posicion) {\r\n\t\t\t$this -> Categoria -> id = $id;\r\n\t\t\t$this -> Categoria -> saveField(\"posicion\", $posicion);\r\n\t\t}\r\n\r\n\t\techo \"yes\";\r\n\t\tConfigure::write('debug', 0);\r\n\t\t$this -> autoRender = false;\r\n\t\texit();\r\n\t}", "private function rotate() {\n\t\t/* @var $f1 File */\n\t\t/* @var $f2 File */\n\t\t$oldLevel = $this->getLevel();\n\t\t$this->setLevel( Level::$OFF );\n\t\t\n\t\tparent::close();\n\t\tfor($i = $this->count - 2; $i >= 0; $i--) {\n\t\t\t$f1 = $this->files[$i];\n\t\t\t$f2 = $this->files[$i + 1];\n\t\t\tif ($f1->exists()) {\n\t\t\t\tif ($f2->exists()) {\n\t\t\t\t\t$f2->delete();\n\t\t\t\t}\n\t\t\t\t$f1->renameTo( $f2 );\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\t$this->open( $this->files[0], false );\n\t\t} catch ( \\Exception $e ) {\n\t\t\t// We don't want to throw an exception here, but we report the exception to any\n\t\t\t// registered ErrorManager.\n\t\t\t$this->reportError( null, $e, ErrorManager::OPEN_FAILURE );\n\t\t}\n\t\t$this->setLevel( $oldLevel );\n\t}", "function fm_reorder_folders_list($obj1, $obj2) {\r\n\t$size1 = explode(\"/\",$obj1['stored_filename']);\r\n\t$size2 = explode(\"/\",$obj2['stored_filename']);\r\n\r\n\tif (count($size1) == count($size2)) {\r\n\t\treturn 0;\r\n\t}\r\n\tif (count($size1) > count($size2)) {\r\n\t\treturn 1;\r\n\t}\r\n\tif (count($size1) < count($size2)) {\r\n\t\treturn -1;\r\n\t}\r\n}", "public function panLeftCamaraPresidencia() {\n\n self::$presidencia->moverALaIzquierda();\n }", "public function reorder()\n {\n // Ensure the correct sidemenu is active\n BackendMenu::setContext('Uit.Page', 'page', 'reorder');\n\n $this->pageTitle = 'Изменить структуру категории';\n $defaultButtons = null;\n $defaultButtons = '@/plugins/uit/page/controllers/pages/_reorder_toolbar.htm';\n $defaultConfig['buttons'] = $this->getConfig('view[toolbarPartial]', $defaultButtons);\n /*\n * Make config\n */\n $toolbarConfig = $this->makeConfig($this->getConfig('toolbar', $defaultConfig));\n $toolbarConfig->alias = $this->alias . 'Toolbar';\n\n\n $this->vars['toolbar'] = $this->makeWidget('Backend\\Widgets\\Toolbar', $toolbarConfig);\n $this->vars['records'] = \\Uit\\Page\\Models\\Page::make()->getEagerRoot();\n // dump($this->vars['toolbar']);\n }", "public function forceSortAndSavePackageStates() {}", "public function incrItemsLeft($increment) {\n $this->setItemsLeft($this->getItemsLeft() + $increment);\n }", "function sortSizeAscending($thisFiles) {\n \tusort($thisFiles, \"cmpSA\");\n \treturn $thisFiles;\n }", "function _reorder_fields(){\n\t\t$f = $this->fields[\"order_status_note\"];\n\t\tunset($this->fields[\"order_status_note\"]);\n\t\t$this->fields[\"order_status_note\"] = $f;\n\t}", "function sortDateAscending($thisFiles) {\n \tusort($thisFiles, \"cmpDA\");\n \treturn $thisFiles;\n }", "public function colReorderFixedColumnsLeft(int $value = 0)\n {\n $this->attributes['colReorder']['fixedColumnsLeft'] = $value;\n\n return $this;\n }" ]
[ "0.67862177", "0.55442137", "0.55202234", "0.5433197", "0.54241836", "0.541454", "0.5405853", "0.53767693", "0.5365945", "0.53263277", "0.5319033", "0.5267803", "0.52632487", "0.5222855", "0.5182751", "0.51150364", "0.50972545", "0.50861746", "0.50426984", "0.5036923", "0.50286186", "0.5006093", "0.49547175", "0.4951981", "0.4947753", "0.49427712", "0.49386472", "0.4918731", "0.4916427", "0.49043453" ]
0.56322354
1
get name of currently active menu
private function getCurrentMenuName(){ if(!$this->currentmenuname) $this->setCurrentMenuName(); return $this->currentmenuname; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function menu_get_active_title()\n {\n return menu_get_active_title();\n }", "protected function _getMenuName()\n\t{\n\t\treturn self::$_sMenuName;\n\t}", "private function setCurrentMenuName(){\n \n $currentmenuname = NULL;\n \n foreach(array_keys(menu_ui_get_menus()) as $menuname){\n \n $activelink = \\Drupal::service('menu.active_trail')->getActiveLink($menuname);\n \n if(!empty($activelink))\n $currentmenuname = $menuname;\n \n }\n \n $this->currentmenuname = $currentmenuname;\n \n }", "private function getMenuName() {\n $menu_name = FALSE;\n $menu_links = $this->menuLinkManager->loadLinksByRoute($this->currentRouteMatch->getRouteName(), $this->currentRouteMatch->getRawParameters()->all());\n if ($menu_links) {\n // Get the deepest link to this page and use that for the subnav.\n // @todo Consider a better approach like excluding utility nav links or\n // sorting them by main menu then footer then utility nav.\n $menu_link = end($menu_links);\n $menu_name = $menu_link->getMenuName();\n }\n\n return $menu_name;\n }", "protected function getActiveMenu() {\n return $this->activeMenu;\n }", "public function getName()\n {\n return \"menu\";\n }", "function getMenuTitle();", "public function MenuTitle() {\n\t\treturn $this->Name();\n\t}", "public function MenuCurrentItem() {\n return $this->MainMenu()->find('Code', 'KapostAdmin');\n }", "public function menu_get_active_menu_names()\n {\n return menu_get_active_menu_names();\n }", "public function menu_get_active_help()\n {\n return menu_get_active_help();\n }", "public function get_name()\n {\n return 'akash-menu';\n }", "public function getName() {\n\t\treturn $this->current_name;\n\t}", "function check_current_menu($page_name, $current_page) {\n\tif ($page_name === $current_page) return \"current\";\n\telse return \"\";\n}", "function wp_get_nav_menu_name($location)\n {\n }", "public function current() {\n\t\t$f = parent::current();\n\t\treturn $f->getBasename();\n\t}", "public function currentRouteName()\n {\n return $this->current() ? $this->current()->getName() : null;\n }", "public function get_name() {\n return 'Alita_nav_menu_element';\n }", "protected function getCurrentDashbaordItem() {\n\t\t\n\t\treturn \"home\";\n\t}", "function mf_get_menu_name($location){\n if(!has_nav_menu($location)) return false;\n $menus = get_nav_menu_locations();\n $menu_title = wp_get_nav_menu_object($menus[$location])->name;\n return $menu_title;\n}", "public function getActiveMenuEntry()\n {\n return $this->activeMenuEntry;\n }", "public static function getMenu()\n\t{\n\t\treturn self::$menu;\n\t}", "function getMenu()\n {\n return $this->getAttribute(\"menu\");\n }", "public function getMenuTitle(): string;", "public function current_title()\n\t{\n\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" current_title ?\");\n\t}", "public static function getMenu()\n {\n $svalue = SessionManager::get(self::SESSION_NAME);\n return $svalue ? unserialize($svalue) : self::$menu;\n }", "public function getActive() {\n\t\tif ($this->_active === null) {\n\t\t\tif ($menu = $this->app->system->application->getMenu('site') and $menu instanceof JMenu) {\n\t\t\t\t$this->_active = $menu->getActive();\n\t\t\t}\n\t\t}\n\t\treturn $this->_active;\n\t}", "private function currentlyActiveTab(): string\n {\n static $activeTab;\n if ($activeTab === null) {\n $tab = (string)$this->request->bodyValue(self::QUERY_ARG_TAB, INPUT_GET);\n $activeTab = $tab && array_key_exists($tab, $this->tabs)\n ? $tab\n : key($this->tabs);\n }\n\n return $activeTab;\n }", "protected function getTopmenuActiveItem() {\n return 0;\n }", "public function menu()\n {\n return $this->menu;\n }" ]
[ "0.8192552", "0.7741272", "0.74787724", "0.7426227", "0.7187578", "0.70964164", "0.70712155", "0.70094985", "0.69799507", "0.69750637", "0.6937813", "0.6934306", "0.69078887", "0.676227", "0.67540586", "0.6704641", "0.66280884", "0.66134053", "0.65600723", "0.6549534", "0.6538188", "0.65249103", "0.64969534", "0.6456348", "0.6439468", "0.6399117", "0.6396449", "0.63707995", "0.6365093", "0.63595414" ]
0.844474
0
set name of currently active menu
private function setCurrentMenuName(){ $currentmenuname = NULL; foreach(array_keys(menu_ui_get_menus()) as $menuname){ $activelink = \Drupal::service('menu.active_trail')->getActiveLink($menuname); if(!empty($activelink)) $currentmenuname = $menuname; } $this->currentmenuname = $currentmenuname; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function activate_menu_item($name)\n\t{\n\t\t$this->_active_item = $name;\n\t}", "private function getCurrentMenuName(){\n \n if(!$this->currentmenuname)\n $this->setCurrentMenuName();\n \n return $this->currentmenuname;\n \n }", "public function setNameMenu( $name = NULL ){\n\t\t$this->nameMenu = $name ? $name : $this->name;\n\t}", "public function menu_get_active_title()\n {\n return menu_get_active_title();\n }", "public function getName()\n {\n return \"menu\";\n }", "public function get_name()\n {\n return 'akash-menu';\n }", "protected function _getMenuName()\n\t{\n\t\treturn self::$_sMenuName;\n\t}", "public function setMenuName($menuName){\n $this->menuName = $menuName;\n }", "function set_active_nav_class ($classes, $item) {\n if (in_array('current-menu-item', $classes) ){\n $classes[] = 'activemenu ';\n }\n return $classes;\n}", "public function setNameMenuSingular( $name = NULL ){\n\t\t$this->nameMenuSingular = $name ? $name : $this->name;\n\t}", "public function get_name() {\n return 'Alita_nav_menu_element';\n }", "abstract protected function setMainActionName();", "function getMenuTitle();", "function current_to_active($text)\n{\n $replace = array(\n //List of menu item classes that should be changed to \"active\"\n 'current-menu-item' => 'active',\n 'current_page_parent' => 'active',\n 'current_page_ancestor' => 'active',\n 'current_page_item' => 'active',\n );\n $text = str_replace(array_keys($replace), $replace, $text);\n return $text;\n}", "function setActive() ;", "public function setActiveController($name)\n {\n $this->_active_controller = $name;\n }", "public function MenuTitle() {\n\t\treturn $this->Name();\n\t}", "function uk_active_nav_class( $class, $item ) {\n if (in_array( 'current-menu-item', $class )) {\n $class[] = 'uk-active';\n }\n return $class;\n}", "function set_current_list_name ($list_name)\r\n {\r\n $_SESSION[\"current_list_name\"] = $list_name;\r\n }", "public static function setSelected($menu_name, $selected)\n {\n self::$selected[$menu_name] = $selected;\n }", "public function set_booking_menu_as_active( $active_menu ) {\n return 'booking';\n }", "public function menu_set_active_item($path)\n {\n return menu_set_active_item($path);\n }", "function special_nav_class($classes, $item){\n if( in_array('current-menu-item', $classes) ){\n $classes[] = 'active ';\n }\n return $classes;\n}", "function ActiveMenu($requestUri)\n{\n $current_file_name = basename($_SERVER['REQUEST_URI'], \".php\");\n\n if ($current_file_name == $requestUri)\n echo 'class=\"active\"';\n}", "function check_current_menu($page_name, $current_page) {\n\tif ($page_name === $current_page) return \"current\";\n\telse return \"\";\n}", "protected function getActiveMenu() {\n return $this->activeMenu;\n }", "public function selectTab($name) {\n\t\t$this->selectedTab = $name;\n\t}", "function isCurrent($pageName){\n\tglobal $NAV_PAGE;\n\t//If the global matches the argument set as current\n\tif ($NAV_PAGE == $pageName){\n\t\techo \"currentNavItem\";\n\t}\n}", "function glass_change_post_menu_label() {\n\tglobal $menu;\n\tglobal $submenu;\n\t$menu[5][0] = 'News';\n\t$submenu['edit.php'][5][0] = 'News';\n\t$submenu['edit.php'][10][0] = 'Add News';\n\t$submenu['edit.php'][16][0] = 'News Tags';\n\techo '';\n}", "function foundation_active_class($classes, $item){\n if( in_array('current-menu-item', $classes) ){\n $classes[] = 'active ';\n }\n return $classes;\n}" ]
[ "0.73577625", "0.72689193", "0.72062", "0.6825129", "0.6769948", "0.66666394", "0.63398755", "0.62708247", "0.6180183", "0.6150929", "0.61056125", "0.6017139", "0.6016042", "0.600131", "0.5976361", "0.59685475", "0.5942405", "0.5936161", "0.5909389", "0.59001833", "0.5896184", "0.5891162", "0.5854528", "0.5837728", "0.58100486", "0.57886815", "0.5780641", "0.5773775", "0.5769764", "0.5768786" ]
0.83405966
0
set tree menu output
private function setTreeOutput(){ $item = $this->item; $treeoutput = NULL; $menuname = NULL; $parameters = NULL; $menutree = \Drupal::menuTree(); if($item->menu_name == 'active-menu'){ $menuname = $this->getCurrentMenuName(); if($menuname) $parameters = $menutree->getCurrentRouteMenuTreeParameters($menuname); }else{ $parameters = new MenuTreeParameters(); $parameters->root = $item->menu_plid; $menuname = $item->menu_name; } if($parameters && $menuname){ $parameters->setMaxDepth($item->menu_level); $tree = $menutree->load($menuname, $parameters); $treeoutput = $menutree->build($tree); } $this->treeoutput = $treeoutput; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function menu_tree_output($tree)\n {\n return menu_tree_output($tree);\n }", "abstract protected function getMenuTree();", "function show_tree(){\n\t\t\t\t\tswitch(LINK_TYPE){\n\t\t\t\t\t\tcase \"static\":\n\t\t\t\t\t\t\treturn $this->show_tree_static();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"burc\":\n\t\t\t\t\t\tcase \"dynamic\":\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn $this->show_tree_dynamic();\n\t\t\t\t\t}\n\t\t\t\t}", "function v2_mumm_menu_tree__menu_doormat(&$variables) {\n return $variables['tree'];\n}", "protected function printTestTree(): void\n {\n echo ' Menu Structure '.\"\\n\";\n echo ' rt '.\"\\n\";\n echo ' / \\ '.\"\\n\";\n echo ' pt1 pt2 '.\"\\n\";\n echo ' / | \\ | '.\"\\n\";\n echo ' ch1 ch2 ch3 ch4 '.\"\\n\";\n echo ' | '.\"\\n\";\n echo ' gc1 '.\"\\n\";\n }", "function minorite_menu_tree($variables) {\n return '<ul class=\"nav meganav\">' . $variables['tree'] . '</ul>';\n}", "public function writeMenu() {}", "public function writeMenu() {}", "public function writeMenu() {}", "public function writeMenu() {}", "private function build_tree()\n\t\t{\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul_first\" onkeydown=\"return input_main_key(event,\\''.$this->internal_id.'\\')\">';\n\n\t\t\t//==================================================================\n\t\t\t// Always first this row in tree ( edit mode only )\n\t\t\t//==================================================================\n\t\t\tif ($this->edit_mode)\n\t\t\t{\n\t\t\t\t$this->html_result .= '<div class=\"'.$this->style.'_interow\" id=\"'.$this->internal_id.'INT_0\" OnClick=\"add_new_node(\\''.$this->internal_id.'\\',0)\"></div>';\n\t\t\t}\n\t\t\t//==================================================================\n\t\t\t\n\t\t\t$this->scan_level(0,$this->get_any_child(1));\n\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul\">';\n\t\t}", "function susy_menu_tree__main_menu($vars) {\n return '<ul class=\"menu inline clearfix\">' . $vars['tree'] . '</ul>';\n}", "function writeHTML()\n\t{\n\t\tglobal $_activeTree;\n\t\t\n\t\t$c = count($this->children);\n\n\t\tif ($this->link)\n\t\t{\n\t\t\t$title = \"<a href='{$this->link}' target='{$this->target}'>{$this->title}</a>{$this->extras}\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$title = \"<a href='#' onclick='\";\n\t\t\t\n\t\t\tif ($_activeTree->onSelect)\n\t\t\t{\n\t\t\t\t$title .= \"{$_activeTree->onSelect}(\\\"{$this->value}\\\");\";\n\t\t\t}\n\t\t\t\n\t\t\t$title .= \"; return false'>{$this->title}</a>{$this->extras}\";\n\t\t}\n\t\t\n\t\tif ($c == 0 && !$this->onDemand)\n\t\t{\n\t\t\t// Leaf node\n\t\t\techo \"<div class='{$this->leafStyle}'>\";\n\n\t\t\tif (isset($this->value) && $this->value !== \"\" && $_activeTree->selectMode != 'navigation')\n\t\t\t{\n?>\n\t\t\t<input type=\"checkbox\" class=\"checkbox\" name=\"<? echo $this->id?>\" value=\"<? echo $this->value?>\"<? \n\t\t\t\tif ($this->checked) echo \" checked\";\n\t\t\t\tif ($this->disabled) echo \" disabled\";\n\t\t\t\tif ($_activeTree->selectMode == \"single\") \n\t\t\t\t{\n\t\t\t\t\techo \" onclick=\\\"Tree.clearCheckBoxes('{$_activeTree->id}', this);\";\n\t\t\t\t\tif ($_activeTree->onSelect)\n\t\t\t\t\t{\n\t\t\t\t\t\techo \" {$_activeTree->onSelect}('{$this->value}');\";\n\t\t\t\t\t}\n\t\t\t\t\techo \"\\\"\";\n\t\t\t\t}\n\t\t\t\telse if ($_activeTree->onSelect)\n\t\t\t\t{\n\t\t\t\t\techo \" onclick=\\\"{$_activeTree->onSelect}('{$this->value}');\\\"\";\n\t\t\t\t}\n\t\t\t\t ?>/>\n<?\n\t\t\t}\n\t\t\n\t\t\techo \"$title</div>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($this->open)\n\t\t\t{\n\t\t\t\t$style = $this->openStyle;\n\t\t\t\t$display = \"block\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$style = $this->closedStyle;\n\t\t\t\t$display = \"none\";\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\tif ($this->onDemand)\n\t\t\t{\n\t\t\t\t$cmd = \"Tree.loadOnDemand('{$this->id}', '{$this->onDemand}');\";\n\t\t\t\t\n\t\t\t\tif ($this->open)\n\t\t\t\t{\n?>\n<script type=\"text/javascript\">\n\twindow.addEvent('domready', function() {Tree.loadOnDemand('<?echo $this->id?>', '<?echo $this->onDemand?>');});\n</script>\n<?\n\t\t\t\t}\t\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$cmd = \"\";\n\t\t\t}\n\t\t\t\n\t\t\t$cmd .= \"Tree.toggleFolder('{$this->id}', '{$this->openStyle}', '{$this->closedStyle}');\";\n?>\n\t\t<div id='<?echo $this->id?>' class='<?echo $style?>' onclick=\"<?echo $cmd ?>\">\n<?\n\t\t\tif (isset($this->value) && $this->value !== \"\")\n\t\t\t{\n?>\n\t\t\t<input type=\"checkbox\" class=\"checkbox\" name=\"<? echo $this->id?>\" value=\"<? echo $this->value?>\" <? \n\t\t\t\tif ($this->checked) echo \" checked\";\n\t\t\t\tif ($this->disabled) echo \" disabled\";\n\t\t\t\tif ($_activeTree->selectMode == \"single\") \n\t\t\t\t{\n\t\t\t\t\techo \" onclick=\\\"Tree.clearCheckBoxes('{$_activeTree->id}', this);\";\n\t\t\t\t\tif ($_activeTree->onSelect)\n\t\t\t\t\t{\n\t\t\t\t\t\techo \" {$_activeTree->onSelect}('{$this->value}');\";\n\t\t\t\t\t}\n\t\t\t\t\techo \"\\\"\";\n\t\t\t\t}\n\t\t\t\telse if ($_activeTree->onSelect)\n\t\t\t\t{\n\t\t\t\t\techo \" onclick=\\\"{$_activeTree->onSelect}('{$this->value}');\\\"\";\n\t\t\t\t}\n\t\t\t\t ?>/>\n<?\n\t\t\t}\n?>\n\t\t<?echo $title?></div>\n\t\t<div id='<?echo $this->id?>_contents' style='padding-left: <?echo $_activeTree->indent ?>; display: <? echo $display?>'>\n\t\t\t\n<?\t\t\t\n\t\t\tfor($i = 0; $i < $c; ++$i)\n\t\t\t{\n\t\t\t\t$this->children[$i]->writeHTML();\n\t\t\t}\n?>\n\t\t</div>\n<?\n\t\t}\n\t}", "function tree_browser() {\n\t $cat = GetReq('cat'); \n\t \n\t if ($this->notreebrowser)\n\t return null;\n\t \n\t $out = $this->show_submenu('klist',1,null,null,1); //submenu only\n\t \n\t return ($out);\n\t \n\t}", "function soho_menu_tree__header_menu($variables){\n return '<ul class=\"menu\" id=\"menu-main-menu\">' . $variables['tree'] . '</ul>';\n \n}", "function view()\n\t{\n\t\tglobal $tree, $ilUser, $ilCtrl, $lng;\n\n\t\t$this->showHierarchy();\n\t}", "function startgreensockListTree($treelist,$menutype=\"standardlist\") {\n\t\n\t\t\n\techo '<div '. (($menutype == \"active\") ? \"class='col-md-5' style='left:35px'\" :\"class='col-md-6'\") .' >\n\t\t\t<div id=\"usersidediv\">\n\t\t\t\t<div class=\"panel panel-info panel-dark\">\n\t\t\t\t\t<div class=\"panel-heading\">\n\t\t\t\t\t\t\t<span class=\"panel-title\">'. (($menutype == \"active\") ? \"Currently applied to target\" :\"Select Options from Below\") .'</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"panel-body\">';\n}", "function renderTree($arvore) {\n $lastLevel = 0;\n//Outer list item\n $html = \"<ul class=\\\"jstree\\\">\";\n//Iterating tree from tree root\n foreach ($arvore->fetchTree() as $node) {\n//If we are on the item of the same level, closing <li> tag before printing item\n if (($node['level'] == $lastLevel) and ($lastLevel > 0)) {\n $html .= '</li>';\n }\n//If we are printing a next-level item, starting a new <ul>\n if ($node['level'] > $lastLevel) {\n $html .= '<ul>';\n }\n//If we are going to return back by several levels, closing appropriate tags\n if ($node['level'] < $lastLevel) {\n $html .= str_repeat(\"</li></ul>\", $lastLevel - $node['level']) . '</li>';\n }\n//Priting item without closing tag\n $html .= '\n <li id=\"tree_node[' . $node['uuid'] . ']\">\n <ins class=\"jstree-icon\">&nbsp;</ins>\n <a><ins class=\"jstree-icon\">&#160;</ins>' . $node['nome'] . '</a>';\n//Refreshing last level of the item\n $lastLevel = $node['level'];\n }\n $html .= \"</ul>\";\n return $html;\n}", "function printrightMenu($tree,$level=0) {\n\tif(!is_null($tree) && count($tree) > 0) {\n\tif($level==0){\n\techo '<ul class=\"dropdown-menu rightClickMenu\">';\n\t}\n\t\tforeach($tree as $node) {\n\t\techo \"\\n\";\n\t\t\t// Top level\n\t\t\tif ( empty($node['children']) ) {\n\t\t\t\tif ( !empty($node['value']['menu_type']) AND ($node['value']['menu_type']== \"inlineForm\") ) {\n\t\t\t\t\techo '<li><a class=\"trigger right-caret '.$node['value']['action_type'].' '.$node['value']['icon'].' '.$node['value']['menu_type'].' '.$node['value']['action_type'].'\" data-menu_type=\"'.$node['value']['menu_type'].'\" data-action_type=\"'.$node['value']['action_type'].'\" data-id=\"'.$node['value']['id'].'\">'. (!empty($node[\"value\"][\"image\"]) ? '<img class=\"rightClickIcon\" height=\"15\" src=\"'.$node['value']['image'].'\">' : ''). '&nbsp;'.$node['value']['name'].'</a>\n\t\t\t\t<ul class=\"dropdown-menu sub-menu\"><li>'. $node['value']['custom'] . '</li></ul></li>';\n\t\t\t\t}else{\n\t\t\t\techo '<li><a class=\"iconItemSelection '.$node['value']['action_type'].' '.$node['value']['icon'].' MenuActionItem '.$node['value']['menu_type'].' '.$node['value']['code'].' '.$node['value']['action_type'].'\" type=\"button\" data-animationui=\"'.$node['value']['code'].'\" data-menu_type=\"'.$node['value']['menu_type'].'\" data-code=\"'.$node['value']['code'].'\" data-action_type=\"'.$node['value']['action_type'].'\" data-id=\"'.$node['value']['id'].'\">'. (!empty($node[\"value\"][\"image\"]) ? '<img class=\"rightClickIcon\" height=\"15\" src=\"'.$node['value']['image'].'\">' : ''). '&nbsp;'.$node['value']['name'].'</a>'. (!empty($node[\"value\"][\"code\"]) ? '<span data-animationui=\"'.$node['value']['code'].'\" data-menu_type=\"'.$node['value']['menu_type'].'\" style=\"position:absolute; right:15px; top:9px; text-size=16px;\" class=\"addKeyframeMenu fa fa-plus-square-o fa-lg pull-right\"></span>' : ''). '</li>';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( !empty($node['children']) AND !empty($node['children']['0']['children'] )) {\n\t\t\t\techo '<li class=\"dropdown-submenu\">\n\t\t\t\t<a class=\"trigger right-caret '.$node['value']['icon'].' '.$node['value']['action_type'].' '.$node['value']['menu_type'].' '.$node['value']['code'].' '.$node['value']['action_type'].'\" data-animationui=\"'.$node['value']['code'].'\" data-menu_type=\"'.$node['value']['menu_type'].'\" data-code=\"'.$node['value']['code'].'\" data-action_type=\"'.$node['value']['action_type'].'\" data-id=\"'.$node['value']['id'].'\">'. (!empty($node[\"value\"][\"image\"]) ? '<img class=\"rightClickIcon\" height=\"15\" src=\"'.$node['value']['image'].'\">' : ''). '&nbsp;'.$node['value']['name'].'</a>\n\t\t\t\t<ul class=\"dropdown-menu sub-menu\">';\n\t\t\t}\n\t\t\tif ( !empty($node['children']) AND empty($node['children']['0']['children']) ) {\n\t\t\t\techo '<li class=\"dropdown-submenu\">\n\t\t\t\t<a class=\"trigger right-caret '.$node['value']['action_type'].' '.$node['value']['icon'].' '.$node['value']['menu_type'].' '.$node['value']['code'].' '.$node['value']['action_type'].'\" data-menu_type=\"'.$node['value']['menu_type'].'\" data-code=\"'.$node['value']['code'].'\" data-action_type=\"'.$node['value']['action_type'].'\" data-id=\"'.$node['value']['id'].'\">'. (!empty($node[\"value\"][\"image\"]) ? '<img class=\"rightClickIcon\" height=\"15\" src=\"'.$node['value']['image'].'\">' : ''). '&nbsp;'.$node['value']['name'].'</a>\n\t\t\t\t<ul class=\"dropdown-menu sub-menu\" style=\"max-height:400px;overflow:auto;\">';\n\t\t\t}\n\t\t\tprintrightMenu($node['children'], $level+1);\n\t\t\tif (!empty($node['children']) ) {echo '</li></ul>';}\n\t\t} // end foreach\n\t} // end if\n\tif($level==0){\n\techo '<div class=\"currentAnimations\"></div>';\n\t}\n}", "function start_lvl( &$output, $depth = 0, $args = array() ) {\n $indent = str_repeat(\"\\t\", $depth);\n $output .= \"\\n$indent<ul class=\\\"vertical menu\\\" data-submenu>\\n\";\n }", "function latto_menu_tree__menu_block__1($vars) { \n return '<ul class=\"main-menu nav nav-inline\">' . $vars['tree'] . '</ul>';\n}", "function printCollectionTree(){\n\n\t\t/* Return HTML */\n\t\treturn $output;\n\t}", "function start_lvl( &$output, $depth = 0, $args = array() ) {\n\t\t$indent = str_repeat(\"\\t\", $depth);\n\t\t$output .= \"\\n$indent<ul class=\\\"vertical menu\\\" data-submenu>\\n\";\n\t}", "function XmlControlOnRender(&$xmlWriter) {\n $xmlWriter->WriteStartElement(\"menu\");\n $xmlWriter->WriteElementString(\"value\",$this->data[\"selected_value\"]);\n\t if($this->data[\"selected_value\"]!=0 || $this->root){\n \t$_list=array();\n DataManipulator::BuildTreeFromBottom($this->_list, $this->data[\"selected_value\"],$this->key_field_name,$this->parent_field_name,$_list);\n if (!$this->root) $root_node=array_pop($_list);\n //write image node\n\t $_list=array();\n\t DataManipulator::GetRecursiveNodeList($this->_list,$root_node[$this->key_field_name], $this->key_field_name, $this->parent_field_name,$_list);\n\n //--one level menu\n if ($this->onelevel) {\n\t\t\t foreach($_list as $key => $item)\t{\n \t $item[$this->parent_field_name]=0;\n \t $_newlist[]= $item;\n\t }\n } else {\n $_newlist=$_list;\n }\n $xmlWriter->WriteElementString(\"image\",$root_node[\"image\"]);\n\t\t\t$xmlWriter->WriteElementString(\"caption\",$root_node[\"caption\"]);\n $xmlWriter->WriteElementString(\"url\",$root_node[\"url\"]);\n $xmlWriter->WriteStartElement(\"categories\");\n\t $xmlWriter->WriteStartElement(\"sub_node_list\");\n \t $this->BuildRecursiveTree($_list, 0, $xmlWriter);\n \t$xmlWriter->WriteEndElement();\n\t }\n $xmlWriter->WriteEndElement(\"menu\");\n }", "function v2_mumm_menu_tree__menu_new_main_menu(&$variables) {\n return '<ul>' . $variables['tree'] . '</ul>';\n}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}" ]
[ "0.74459684", "0.73401934", "0.7000974", "0.6971639", "0.687586", "0.67948323", "0.67288136", "0.67284083", "0.6727923", "0.6727923", "0.66981566", "0.666226", "0.66375524", "0.6573268", "0.65616155", "0.65614253", "0.65428555", "0.65063876", "0.649541", "0.6465559", "0.6420596", "0.64198804", "0.64183354", "0.6390742", "0.63579136", "0.6342816", "0.6342816", "0.6342816", "0.6342816", "0.6342816" ]
0.8216575
0
Perform a selfchange password request
public function selfChangePassword() { if (!$this->userService->changePassword(Input::all())) { return Redirect::route('user-profile', array('tab' => 'account'))->withErrors($this->userService->errors())->withInput(); } Alert::success('Your password has been successfully changed.')->flash(); return Redirect::route('user-profile', array('tab' => 'account')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function changePassword() {}", "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 }", "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}", "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(string $password): void;", "function update_password()\n {\n }", "public function changePwd(){\n $uesr_id=$_SESSION['admin_id'];\n\t\t$sql=\"select * from users where id='$uesr_id'\";\n\t\t$query = mysqli_query($this->connrps, $sql);\n\t\twhile ($row = mysqli_fetch_array($query)) {\n\t\t\t$username = $row['username'];\n\t\t\t$password = $row['password'];\n\t\t}\n\t\t$cur_password=base64_encode($_POST['currentPassword']);\n\t\t$new_pwd=base64_encode($_POST['newPassword']);\n\t\t$confirm_pwd=base64_encode($_POST['confirmPassword']);\n\t\tif ($cur_password != $password) {\n\t\t\t$message= \"Current password does not matched.\";\n\t\t\t$_SESSION['error_msg'] = $message;\n\t\t\treturn 0;\n\t\t}else if ($new_pwd != $confirm_pwd) {\n\t\t\t$message= \"Confirm password does not matched\";\n\t\t\t$_SESSION['error_msg'] = $message;\n\t\t\treturn 0;\n\t\t}else {\n\t\t\t$query_updt = \"UPDATE users SET password = '$new_pwd' WHERE id='$uesr_id'\";\n\t\t\t$query_updt = mysqli_query($this->connrps, $query_updt);\n\t\t\t$message= \"New password has been updated successfully\";\n\t\t\t$_SESSION['succ_msg'] = $message;\n\t\t\treturn 1;\n\t\t}\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 changeUserPassword($uid,$newPassword);", "public function password_update(SelfPasswordUpdateRequest $request)\n {\n if( env('APP_DEMO') == true && Auth::guard('customer')->user()->id <= config('system.demo.customers', 1) )\n return redirect()->route('account', 'account#password-tab')->with('warning', trans('messages.demo_restriction'));\n\n Auth::guard('customer')->user()->update($request->all());\n\n // event(new PasswordUpdated(Auth::user()));\n\n return redirect()->route('account', 'account#password-tab')->with('success', trans('theme.notify.info_updated'));\n }", "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}", "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 }", "protected function _change_pass_submit()\n\t{\n\t\t$user = user_get_account_info();\n\t\t$password = $this->input->post('password');\n\t\t$password = mod('user')->encode_password($password, $user->email);\n\n\n\t\t$data['password'] = $password;\n\t\tt('session')->set_userdata('change_password', $data);\n\t\t$user_security_type = setting_get('config-user_security_change_password');\n\t\tif (in_array($user_security_type, config('types', 'mod/user_security'))) {\n\t\t\tmod('user_security')->send('change_password');\n\t\t\t$location = $this->_url('confirm/change_password');\n\t\t} else {\n\n\t\t\tmodel('user')->update($user->id, compact('password'));\n\t\t\tset_message(lang('notice_update_success'));\n\t\t\t$location = $this->_url('change_pass');\n\n\t\t}\n\n\t\treturn $location;\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}", "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 change_password() {\n header('Content-Type: application/json');\n $this->autoRender = false;\n $this->User->recursive = -1;\n if ($this->request->is('post')) {\n $user = $this->User->findByEmail($this->request->data['User']['email'], array('User.id', 'User.email', 'User.password'));\n if (!empty($user)) {\n $oldPassword = AuthComponent::password($this->request->data['User']['old_password']);\n if ($user['User']['password'] == $oldPassword) {\n $newPassword = $this->request->data['User']['new_password'];\n $data = array(\n 'id' => $user['User']['id'],\n 'password' => AuthComponent::password($newPassword)\n );\n $this->User->save($data);\n die(json_encode(array('success' => true, 'msg' => 'Succeed to change password')));\n \n } else \n die(json_encode(array('success' => false, 'msg' => 'Wrong old password')));\n \n } else\n die(json_encode(array('success' => false, 'msg' => 'Email address not found.')));\n }\n }", "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}", "public function testUpdatePasswordNotGiven(): void { }", "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}", "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 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 }", "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 }", "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 modifpassword($user,$passwd){\n \n }", "public function setPassword(){\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 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 run_chg_pass_if()\n\t{\n\t\t$msg='';\n\t\tif(isset($_POST['old_pass']))\n\t\t{\n\t\t\tif(md5($_POST['old_pass'])==$_SESSION['waf_user']['pass'])\n\t\t\t\t{\n\t\t\t\t\tif($_POST['pass']!=$_POST['pass1'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$msg='Passwords not equal! Try again.';\n\t\t\t\t\t}else{\n\t\t\t\t\t$this->change_password($_SESSION['waf_user']['id'],$_POST['pass']);\n\t\t\t\t\t$msg='Password successfully changed';\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t$msg='Old Password wrong! Password not changed';\t\n\t\t\t\t}\n\t\t}\n\t\t$this->error=$msg;\n\t}", "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 changePassword() {\n\t\t//assign public class values to function variable\n\t\t$data = $this->data;\n\t\t$data['common_data'] = $this->common_data;\n\t\t$data['page'] = 'change_password';\n\t\t$data['pageName'] = 'Change Password';\n\t\tif($data['common_data']['user_data']['role'] == INACTIVE_STATUS_ID){\n\t\t\theader(\"Location: \".ROUTE_PROFILE);\n\t\t\tdie();\n\t\t}\n\t\tif($data['common_data']['user_data']['account_type'] == FACEBOOK_ACCOUNT_TYPE){\n\t\t\theader(\"Location: \".ROUTE_ERROR_PAGE);\n\t\t\tdie();\n\t\t}\n\n\t\t$data['tutor_details'] = $this->profile_model->getTutorDetailsById($data['common_data']['user_id']);\n\t\t//Getting all payment details\n\t\t$data['payment_details'] = $this->payment_model->getPaymentDetailsById($data['common_data']['user_id']);\n\t\t$data['tutor_badges'] = $this->user_model->getTutorBadges($data['common_data']['user_id']);\n\t\t$data['badges'] = $this->user_model->getBadges();\n\n\t\t$template['body_content'] = $this->load->view('frontend/profile/change-password', $data, true);\t\n\t\t$this->load->view('frontend/layouts/template', $template, false);\n\t}" ]
[ "0.7385647", "0.6946307", "0.6879779", "0.6693084", "0.6605285", "0.65734404", "0.656932", "0.6548491", "0.65362495", "0.6536129", "0.6530542", "0.65269536", "0.6497222", "0.6487361", "0.6462839", "0.6461272", "0.64552706", "0.64057016", "0.63971883", "0.6395171", "0.639308", "0.6390256", "0.6377693", "0.6374732", "0.6360376", "0.63445824", "0.6342667", "0.6331122", "0.6327309", "0.6325996" ]
0.73346704
1
Read all category endpoints to extract products endpoints.
public function read(\Traversable $categoryEndpoints) :array { $this->productsEndpoints = []; foreach($categoryEndpoints as $endpoint){ /** @var Endpoint $endpoint */ $this->firstPage = $this->currentPage = $this->lastPage = 1; $this->style->text(vsprintf('Reading <info>products endpoints</info> from <info>%s</info>', [$endpoint->getEndpoint()])); do { // Call client endpoint $rawData = $this->client->get($endpoint->getEndpoint(), ['page' => $this->currentPage]); $endpoint->setIsChecked(true); $endpoint->setLastCheck(time()); $this->entityManager->persist($endpoint); $this->extractPagination($rawData); $this->extractProductsEndpoints($rawData); if ($this->firstPage == $this->currentPage) $this->style->progressStart($this->lastPage); $this->style->progressAdvance(); $this->currentPage++; if ( $this->currentPage > $this->currentPage ) $this->style->progressFinish(); } while ($this->currentPage <= $this->lastPage); $this->entityManager->flush(); $this->style->text('<info>Ok</info>'); } $this->entityManager->flush(); $this->entityManager->clear(); return $this->productsEndpoints; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function getEndpoints();", "public static function route_products_and_categories()\n\t{\n\t\tforeach(ORM::factory('product')->find_all() as $object)\n\t\t{\n\t\t\tKohana::config_set('routes.' . $object->show_path(false), inflector::plural($object->object_name) . '/show/' . $object);\n\t\t}\n\t\t\n\t\tforeach(ORM::factory('category')->find_all() as $object)\n\t\t{\n\t\t\tKohana::config_set('routes.' . $object->show_path(false), inflector::plural($object->object_name) . '/show/' . $object);\n\t\t}\n\t}", "private function loadEndpoints() {\n $this->endpoints = array(\n '2020-08-06' => array(\n 'base_api_endpoint' => 'https://cloudapi.inflowinventory.com/',\n 'categories' => $this->companyID . '/categories/'\n )\n );\n }", "public function index()\n {\n return ProductResource::collection(Product::with('categories')->get());\n }", "public function index()\n {\n return ProductCategoryResource::collection(ProductCategory::all());\n }", "public function getAllProducts() {\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][field]=category_id&\";\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][value]=25&\";\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][condition_type]=eq&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][field]=sku&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][value]=%25case%25&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][condition_type]=nlike\";\n\n $this->products = $this->cUrlRequest($this->url . '/rest/V1/products?fields=items[name,price,custom_attributes,sku]&'.$searchCondition.'&searchCriteria[pageSize]=' . $this->items, $this->getToken());\n\n return $this->products;\n }", "public function getAllProducts( $params = [] )\n {\n if(!config(\"constant.getDataFromApis\")){\n return $this->starrtecUnifiedPosHandler->getCategoryProducts( $params );\n }else{\n return $this->starrtecPosApiHandler->getCategoryProducts( $params );\n }//..... end if-else() .....//\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function getProducts() {\n\t\treturn $this->requester->request('GET', $this->url);\n\t}", "public function all(){\n \t\t$response = $this->curl->get( $this->api_url, [ \n\t\t\t'access_token' => $this->token\n\t\t]);\n\n \t\tif( $response->success ){\n \t\t\t$products = [];\n\t\t\tforeach ($response->products as $product) {\n\t \t\t\t$tmp = new Product( $this );\n\t \t\t\t$tmp->fetch($product);\n\t \t\t\t$products[] = $tmp;\n\n\t \t\t\treturn $products;\n\t \t\t}//foreach\n \t\t}//if\n \t\telse{\n \t\t\t// Throw error according to status\n \t\t}//else\n\n \t}", "public function index()\n {\n $request = app()->make('request');\n return response()->json([\n 'products' => $this->catProduct->paginate(\n $this->catProduct->where('id', $request->catId)\n ->relTable()\n ->first()\n ->products\n )\n ]);\n }", "public function index()\n {\n $product_category = ProductCategory::orderBy('id', 'DESC')->get();\n return ProductCategoryResource::collection($product_category);\n }", "public function index(ProductIndexRequest $request)\n {\n\n $per_page = $request->get('per_page');\n $category_ones_id = $request->input('category_ones_id');\n $category_twos_id = $request->input('category_twos_id');\n $category_threes_id = $request->input('category_threes_id');\n $products = Product::where('is_deleted', false)\n ->where(function ($query) use ($category_ones_id, $category_twos_id, $category_threes_id) {\n if ($category_ones_id != null) $query->where('category_ones_id', $category_ones_id);\n if ($category_twos_id != null) $query->where('category_twos_id', $category_twos_id);\n if ($category_threes_id != null) $query->where('category_threes_id', $category_threes_id);\n })\n ->orderBy('id', 'desc');\n if ($per_page == \"all\") {\n $products = $products->get();\n } else {\n $products = $products->paginate(env('PAGE_COUNT'));\n }\n return (new ProductCollection($products))->additional([\n 'errors' => null,\n ])->response()->setStatusCode(200);\n }", "protected function getProducts()\r\n {\r\n $category = new Category((int)Configuration::get('FIELD_FEATUREDPSL_CAT'), (int)Context::getContext()->language->id);\r\n\r\n $searchProvider = new CategoryProductSearchProvider(\r\n $this->context->getTranslator(),\r\n $category\r\n );\r\n\r\n $context = new ProductSearchContext($this->context);\r\n\r\n $query = new ProductSearchQuery();\r\n\r\n $nProducts = (int)Configuration::get('FIELD_FEATUREDPSL_NBR');\r\n if ($nProducts < 0) {\r\n $nProducts = 12;\r\n }\r\n\r\n $query\r\n ->setResultsPerPage($nProducts)\r\n ->setPage(1)\r\n ;\r\n $query->setSortOrder(new SortOrder('product', 'position', 'asc'));\r\n $result = $searchProvider->runQuery(\r\n $context,\r\n $query\r\n );\r\n\r\n $assembler = new ProductAssembler($this->context);\r\n\r\n $presenterFactory = new ProductPresenterFactory($this->context);\r\n $presentationSettings = $presenterFactory->getPresentationSettings();\r\n $presenter = new ProductListingPresenter(\r\n new ImageRetriever(\r\n $this->context->link\r\n ),\r\n $this->context->link,\r\n new PriceFormatter(),\r\n new ProductColorsRetriever(),\r\n $this->context->getTranslator()\r\n );\r\n\r\n $products_for_template = [];\r\n\t\t$products_features=$result->getProducts();\r\n\t\tif(is_array($products_features)){\r\n\t\t\tforeach ($products_features as $rawProduct) {\r\n\t\t\t\t$products_for_template[] = $presenter->present(\r\n\t\t\t\t\t$presentationSettings,\r\n\t\t\t\t\t$assembler->assembleProduct($rawProduct),\r\n\t\t\t\t\t$this->context->language\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n return $products_for_template;\r\n }", "public function get_all_product_information () {\n $this->json_source_file = file_get_contents(\"products.json\");\n $this->json_source_array = json_decode($this->json_source_file,true);\n\n }", "function getProducts() {\n\techo \"Getting Products </br>\";\n\t$response = getRequest('/api/product');\n\tprintInfo($response);\n}", "public function getAllProduct()\n {\n //eager loading of \"product\" with \"category\"\n return Product::with('category')\n ->orderBy('title')\n ->get();\n }", "public function readProducts() {\r\n //get authorisation from headers\r\n $headers = getallheaders();\r\n $auth = $headers[\"Authorization\"];\r\n\r\n //check authorization\r\n $role = $this->authenticate($auth);\r\n if ($role !== 'trader') {\r\n throw new RestException(401, \"Unauthorized\");\r\n }\r\n $traderId = $this->getTraderID($auth);\r\n $sql = \"SELECT * FROM product WHERE traderid = '{$traderId}'\";\r\n $products = Product::find_by_sql($sql);\r\n if ($products) {\r\n return $products;\r\n } else {\r\n throw new RestEception(400, \"no products found\");\r\n }\r\n }", "public function getCategoryDataFront()\n {\n // Get Categorys\n $categories = CategoryWiseSpecification::orderBy('updated_at', 'desc')->Where('deactivate', 0)->take(4)->get();\n\n foreach($categories as $categoryWiseResource)\n {\n $files = explode(\",\", $categoryWiseResource['file']);\n $categoryWiseResource['attachments'] = Attachment::WhereIn('id', $files)->get();\n }\n \n // Return collection of Categorys as a resource\n return CategoryWiseSpecificationResouerce::collection($categories);\n }", "public function init_rest_endpoints( $namespace ) {\n\n\t\t$endpoints = [\n\t\t\t'/collections/' . $this->category . '/' => [\n\t\t\t\t\\WP_REST_Server::CREATABLE => 'rest_list',\n\t\t\t],\n\t\t\t'/collection/' . $this->category . '/' => [\n\t\t\t\t\\WP_REST_Server::READABLE => 'rest_single',\n\t\t\t],\n\t\t\t// Importing a template to library.\n\t\t\t'/import/' . $this->category . '/process' => [\n\t\t\t\t\\WP_REST_Server::CREATABLE => 'rest_process_import',\n\t\t\t],\n\t\t\t// Creating a new page\n\t\t\t'/create/' . $this->category . '/process' => [\n\t\t\t\t\\WP_REST_Server::CREATABLE => 'rest_process_create',\n\t\t\t],\n\t\t\t// Inserting content onto a page.\n\t\t\t'/insert/' . $this->category . '/process' => [\n\t\t\t\t\\WP_REST_Server::CREATABLE => 'rest_process_insert',\n\t\t\t],\n\t\t];\n\n\t\tforeach ( $endpoints as $endpoint => $details ) {\n\t\t\tforeach ( $details as $method => $callback ) {\n\t\t\t\tregister_rest_route(\n\t\t\t\t\t$namespace, $endpoint, [\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'methods' => $method,\n\t\t\t\t\t\t\t'callback' => [ $this, $callback ],\n\t\t\t\t\t\t\t'permission_callback' => [ $this, 'rest_permission_check' ],\n\t\t\t\t\t\t\t'args' => [],\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}", "public function index()\n {\n $prodcucts = Product::with('category')->paginate(10);\n\n return new ProductCollection($prodcucts);\n }", "public function products($url = null)\n {\n $countCategory = Category::where(['url' => $url, 'status' => 1])->count();\n if($countCategory == 0) {\n abort(404);\n }\n // For sidebar\n $categories = Category::with('categories')->where(['parent_id' => 0])->get();\n\n // Get where URL\n $categoryDetails = Category::where(['url' => $url])->first();\n if($categoryDetails->parent_id == 0) {\n $subCategories = Category::where(['parent_id' => $categoryDetails->id])->get();\n // I think it's because the relationship that categories has that we are able to do this.\n foreach($subCategories as $subcategory){\n // Subcategory is all the children\n $cat_ids[] = $subcategory->id;\n }\n $products = Product::whereIn('products.category_id', $cat_ids)->where('products.status', 1)->orderBy('products.id', 'desc');\n } else {\n $products = Product::where(['products.category_id' => $categoryDetails->id])->orderBy('products.id', 'desc')->where('products.status', 1);\n }\n\n if(!empty($_GET['color'])){\n $colorArray = explode('-', $_GET['color']);\n $products = $products->whereIn('products.product_color', $colorArray);\n }\n\n if(!empty($_GET['sleeve'])){\n $sleeveArray = explode('-', $_GET['sleeve']);\n $products = $products->whereIn('products.sleeve', $sleeveArray);\n }\n\n if(!empty($_GET['pattern'])){\n $patternArray = explode('-', $_GET['pattern']);\n $products = $products->whereIn('products.pattern', $patternArray);\n }\n\n if(!empty($_GET['size'])){\n $sizeArray = explode('-', $_GET['size']);\n $products = $products->join('products_attributes','products_attributes.product_id', '=', 'products.id')\n ->select('products.*', 'products_attributes.product_id', 'products_attributes.size')\n ->groupBy('products_attributes.product_id')\n ->whereIn('products_attributes.size', $sizeArray);\n }\n\n $products = $products->paginate(6);\n\n //$colorArray = array('Black', 'Blue', 'Brown', 'Gold','Green','Orange','Pink','Purple','Red','Silver','White','Yellow');\n $colorArray = Product::select('product_color')->groupBy('product_color')->get();\n $colorArray = array_flatten(json_decode(json_encode($colorArray), true));\n\n $sleeveArray = Product::select('sleeve')->where('sleeve', '!=', '')->groupBy('sleeve')->get();\n $sleeveArray = array_flatten(json_decode(json_encode($sleeveArray), true));\n\n $patternArray = Product::select('pattern')->where('pattern', '!=', '')->groupBy('pattern')->get();\n $patternArray = array_flatten(json_decode(json_encode($patternArray), true));\n\n $sizeArray = ProductsAttribute::select('size')->groupBy('size')->get();\n $sizeArray = array_flatten(json_decode(json_encode($sizeArray), true));\n $meta_title = $categoryDetails->meta_title;\n $meta_description = $categoryDetails->meta_description;\n $meta_keywords = $categoryDetails->meta_keywords;\n\n return view('products.listing', compact('categories', 'categoryDetails', 'products', 'meta_title', 'meta_description', 'meta_keywords', 'url', 'colorArray', 'sleeveArray','patternArray', 'sizeArray'));\n }", "public function products()\n {\n //$products = $api->getAllProducts();\n //var_dump($products);\n // TODO save products to database\n }", "public function products($url=null)\n {\n $countCategory = Category::where(['url' => $url, 'status' => 1])->count();\n // echo $countCategory; die;\n if ($countCategory == 0) {\n abort(404);\n }\n // Get all Categories and Sub Categories\n $categories = Category::with('categories')->where(['parent_id'=>0])->get();\n $categoryDetails = Category::where(['url' => $url])->first();\n if ($categoryDetails->parent_id == 0) {\n // if url is main category url\n $subCategories = Category::where(['parent_id' => $categoryDetails->id])->get();\n // $cat_ids = \"\";\n foreach ($subCategories as $subcat) {\n // if($key==1) $cat_ids .= \",\";\n // $cat_ids .= trim($subcat->id);\n\n $cat_ids [] = $subcat->id;\n }\n // print_r($cat_ids); die;\n // echo $cat_ids; die;\n $productsAll = Product::whereIn('category_id', $cat_ids)->where('status','1')->orderby('id','Desc')->paginate(6);\n // $productsAll = json_decode(json_encode($productsAll));\n // echo \"<pre>\"; print_r($productsAll); die;\n }else {\n // if url is sub category url\n $productsAll = Product::where(['category_id' => $categoryDetails->id])->where('status','1')->orderby('id','Desc')->paginate(6);\n }\n $meta_title = $categoryDetails->meta_title;\n $meta_description = $categoryDetails->meta_description;\n $meta_keywords = $categoryDetails->meta_keywords;\n return view('products.listing')->with(compact('categoryDetails','productsAll','categories','meta_title','meta_description','meta_keywords','url'));\n }", "public function getProductList()\n {\n return $this->with('images','manufacturer', 'category')->get();\n }", "public function products($url = null)\n {\n // 404 if url or category status is null is incorrect\n $countCategory = Category::where(['url'=>$url, 'status'=>1])->count();\n // echo $countCategory;die;\n if($countCategory==0){\n abort(404);\n }\n // echo $url; die;\n //Get parent categories their sub categories\n $categories = Category::with('categories')->where(['parent_id'=>0])->get();\n\n $categoryList = Category::where(['url' => $url])->first();\n // $categoryList = json_decode(json_encode($categoryList));\n // echo \"<pre>\"; print_r($categoryList);die;\n\n if($categoryList->parent_id==0){\n // if the url is a main category\n $subCategories = Category::where(['parent_id'=>$categoryList->id])->get();\n\n foreach($subCategories as $key => $subcat){\n $cat_ids[] = $subcat->id;\n }\n // print_r ($cat_ids);die;\n\n $productsAll = Product::whereIn('category_id', $cat_ids)->get();\n // $productsAll = json_decode(json_encode($productsAll));\n // echo \"<pre>\"; print_r($productsAll);die;\n }\n else{\n // If the url is a sub category\n $productsAll = Product::where(['category_id' => $categoryList->id])->get();\n }\n // echo $category->id; die;\n \n Response::json(array('productsAll'=>$productsAll,'categories'=>$categories, 'categoryList'=>$categoryList));\n // return view('products.list')->with(compact('categories','categoryList', 'productsAll'));\n }", "public function getCollectionProducts()\n {\n\t\t$collection_Products = $this->ShopifyClient->call('GET','/admin/products.json?collection_id='.$this->config['collection_id']);\t\t\n\t\t$arra = array();\n\t\tif(!empty($collection_Products['products']))\n\t\t{\n\t\t\t$keyArr = array('id','title','body_html','created_at','vendor','product_type','tags','images',\n\t\t\t\t\t\t\t'image','options',array('variants'=>array('id','price','sku','compare_at_price','weight','weight_unit')));\n\t\t\t$shopifyKeyArr = array('id','title','body_html','created_at','vendor','product_type','tags','images','image','options',\n\t\t\t\t\t\t\t\t array('variants'=>array(0 =>array('id','price','sku','compare_at_price','weight','weight_unit'))));\n\t\t\t\n\t\t\tforeach($collection_Products as $key=>$var) {\n\t\t\t\tforeach($var as $k=>$val) {\n\t\t\t\t\t$arra['data'][] = $this->createProductArray($val,$shopifyKeyArr,$keyArr);\t\t\t\t\t\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\t$status_code = 200;\n\t\t\t$message = 'success';\t\n\t}else\n\t{\n\t\t$status_code = 404; \n\t\t$message = 'Collections products not found';\n\t\t$arra['data'] = array();\n\t\t$arra['data_count'] = 0;\n\t}\t\n\t\t$collection_Products = $this->getJsonDataFormat($arra,$status_code,$message);\n\t\treturn $collection_Products;\n }", "public function index()\n {\n $data = ProductCategory::all();\n\n return response()->json($data,200);\n }", "public function getProducts()\n {\n\n $categories = ProductCategory::all();\n\n $products = Product::paginate(10);\n return $products;\n }", "public function index(Request $request, string $categorySlug)\n {\n $query = $this->productQueryBuilder->build(\n $request->query('rootTaxons') && is_array($request->query('rootTaxons'))\n ? $request->query('rootTaxons')\n : [],\n $request->query('taxons') && is_array($request->query('taxons'))\n ? $request->query('taxons')\n : [],\n $categorySlug);\n\n $query->select('id', 'name', 'slug', 'sku');\n\n if ($request->query('onlyFittable')) {\n $query->fittable();\n }\n\n return ProductResourceCollection::make(\n $query\n ->with([\n 'taxons:id,parent_id,name,slug',\n 'taxons.parent:id,parent_id,name,slug',\n 'assets' => function ($q) use ($request) {\n if (! Auth::guard('auth0')->check() || ! $request->query('withImagesAndModels')) {\n return $q->images();\n }\n\n return $q->imagesAndModels()\n ->with(['materials']);\n },\n ])\n ->withCount('models')\n ->paginate(15)\n ->appends($request->query()));\n }" ]
[ "0.6458531", "0.63298553", "0.6302737", "0.6299358", "0.6050368", "0.59567225", "0.59119076", "0.58100474", "0.5800538", "0.5738983", "0.5716174", "0.5709875", "0.57030153", "0.5698487", "0.56896275", "0.5689594", "0.5635815", "0.56319785", "0.56288624", "0.56185794", "0.56167144", "0.5584065", "0.5544118", "0.5536516", "0.552512", "0.5497322", "0.5484468", "0.5441236", "0.54336154", "0.5433065" ]
0.7007666
0
Registers the custom post type with WordPress if it does not already exists.
public function registerCustomPostType() { if (!post_type_exists($this->slug)) { register_post_type($this->slug, $this->arguments); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register_post_type() {\n\t\tadd_action( 'init', array( $this, 'post_registration_callback' ), 0, 0 );\n\t}", "public function register_post_type() {\n\t\t// make sure the post type info is set - none of this will work without it!\n\t\tif ( is_null( $this->post_type ) or is_null( $this->post_type_title ) or is_null( $this->post_type_single ) )\n\t\t\treturn false;\n\n\t\t// Register post type\n\t\tregister_post_type( $this->post_type, $this->_post_type_args );\n\n\t\t// Register taxonomy for post type\n\t\tif ( ! $this->disable_post_type_categories ) {\n\t\t\tregister_taxonomy(\n\t\t\t\t$this->taxonomy_name,\n\t\t\t\tarray( $this->post_type ),\n\t\t\t\t$this->_taxonomy_args\n\t\t\t);\n\t\t} // if()\n\t}", "public function flo_reg_custom_post_type(){\n\t\t// call the methods that are registering the post types\n\t\t$this->flo_reg_forms_post_type();\n\t\t$this->flo_reg_entrie_post_type();\n\n\t\t$this->flo_register_form_entries_taxonomy();\n\t}", "public static function register_post_types() {}", "function wpbm_register_post_type(){\n include('inc/admin/register/wpbm-register-post.php');\n register_post_type( 'WP Blog Manager', $args );\n }", "public function register_post(): void\n {\n $args = $this->register_post_type_args();\n register_post_type($this->post_type, $args);\n }", "public function register_custom_post_type() {\n $labels = array (\n 'name' => __('Custom', self::$plugin_obj->class_name ),\n 'singular_name' => __('item', self::$plugin_obj->class_name ),\n 'add_new' => __('new item', self::$plugin_obj->class_name ),\n 'add_new_item' => __('new item', self::$plugin_obj->class_name ),\n 'new_item' => __('new item', self::$plugin_obj->class_name ),\n 'edit' => __('edit item', self::$plugin_obj->class_name ),\n 'edit_item' => __('edit item', self::$plugin_obj->class_name ),\n 'view' => __('view item', self::$plugin_obj->class_name ),\n 'view_item' => __('view item', self::$plugin_obj->class_name ),\n 'search_items' => __('search item', self::$plugin_obj->class_name ),\n 'not_found' => __('no item found', self::$plugin_obj->class_name ),\n 'not_found_in_trash' => __('no item in trash', self::$plugin_obj->class_name ),\n 'parent' => __('parent item', self::$plugin_obj->class_name )\n );\n\n $args = array(\n 'labels' => $labels,\n 'public' => TRUE,\n 'publicly_queryable' => TRUE,\n 'show_ui' => TRUE,\n 'show_in_menu' => TRUE,\n 'query_var' => TRUE,\n 'capability_type' => 'page',\n 'has_archive' => TRUE,\n 'hierarchical' => TRUE,\n 'exclude_from_search' => FALSE,\n 'menu_position' => 100 ,\n 'supports' => array('title','editor','excerpt','custom-fields','revisions','thumbnail','page-attributes'),\n 'taxonomies' => array('category','post_tag')\n );\n\n register_post_type('custom', $args);\n }", "public function register_custom_post() {\n foreach ( $this->posts as $key => $value ) {\n register_post_type( $key, $value );\n }\n }", "function register_post_types(){\n\t\t\trequire('lib/custom-types.php');\n\t\t}", "function register_post_types()\n {\n }", "function register_post_types(){\n }", "public function register_post_type(){\r\n //Capitilize the words and make it plural\r\n $name = ucwords( str_replace( '_', ' ', $this->post_type_name ) );\r\n $plural = $name . 's';\r\n $menupos = $this->post_type_pos;\r\n\r\n // We set the default labels based on the post type name and plural. We overwrite them with the given labels.\r\n $labels = array_merge(\r\n\r\n // Default\r\n array(\r\n 'name' => _x( $plural, 'post type general name' ),\r\n 'singular_name' => _x( $name, 'post type singular name' ),\r\n 'add_new' => _x( 'Add New', strtolower( $name ) ),\r\n 'add_new_item' => __( 'Add New ' . $name ),\r\n 'edit_item' => __( 'Edit ' . $name ),\r\n 'new_item' => __( 'New ' . $name ),\r\n 'all_items' => __( 'All ' . $plural ),\r\n 'view_item' => __( 'View ' . $name ),\r\n 'search_items' => __( 'Search ' . $plural ),\r\n 'not_found' => __( 'No ' . strtolower( $plural ) . ' found'),\r\n 'not_found_in_trash' => __( 'No ' . strtolower( $plural ) . ' found in Trash'),\r\n 'parent_item_colon' => '',\r\n 'menu_name' => $plural\r\n ),\r\n\r\n // Given labels\r\n $this->post_type_labels\r\n\r\n );\r\n\r\n // Same principle as the labels. We set some defaults and overwrite them with the given arguments.\r\n $args = array_merge(\r\n\r\n // Default\r\n array(\r\n 'capability_type' => 'post',\r\n 'hierarchical' => false,\r\n 'label' => $plural,\r\n 'labels' => $labels,\r\n 'menu_position' => $menupos,\r\n 'public' => true,\r\n 'publicly_queryable' => true,\r\n 'query_var' => true,\r\n 'rewrite' => array('slug' => $plural),\r\n 'show_in_nav_menus' => true,\r\n 'show_ui' => true,\r\n 'supports' => array( 'title', 'editor'),\r\n '_builtin' => false,\r\n ),\r\n\r\n // Given args\r\n $this->post_type_args\r\n\r\n );\r\n\r\n // Register the post type\r\n register_post_type( $this->post_type_name, $args );\r\n }", "function register_post_types(){\n\t\trequire('lib/custom-types.php');\n\t}", "function register_post_types(){\n }", "public function register()\n {\n $args = apply_filters( $this->name.'_post_type_config', $this->config );\n $args['labels'] = apply_filters( $this->name.'_post_type_labels', $this->labels);\n\n register_post_type( $this->name, $args );\n }", "function register_post_types() {\n\t}", "function register_post_types() {\n\t}", "function theme_custom_post_type() {\n\tregister_post_type( 'custom_type',\n\n\t\t// Array with all the options for the custom post type\n\t\tarray( 'labels' => array(\n\t\t\t'name'\t\t\t\t\t=> __( 'Custom Types' ), // Name of the custom post type group\n\t\t\t'singular_name'\t\t\t=> __( 'Custom Post' ), // Name of the custom post type singular\n\t\t\t'all_items'\t\t\t\t=> __( 'All Custom Posts' ),\n\t\t\t'add_new' \t\t\t\t=> __( 'Add New' ),\n\t\t\t'add_new_item' \t\t\t=> __( 'Add New Custom Type' ),\n\t\t\t'edit'\t\t\t\t\t=> __( 'Edit' ),\n\t\t\t'edit_item'\t\t\t\t=> __( 'Edit Post Types' ),\n\t\t\t'new_item'\t\t\t\t=> __( 'New Post Type' ),\n\t\t\t'view_item'\t\t\t\t=> __( 'View Post Type' ),\n\t\t\t'search_items'\t\t\t=> __( 'Search Post Type' ),\n\t\t\t'not_found'\t\t\t\t=> __( 'Nothing found in the Database.' ),\n\t\t\t'not_found_in_trash'\t=> __( 'Nothing found in Trash' ),\n\t\t\t'parent_item_colon' \t=> ''\n\t\t\t),\n\n\t\t\t'description' \t\t\t=> __( 'This is the example custom post type' ), // Custom post type description\n\t\t\t'public' \t\t\t\t=> true,\n\t\t\t'publicly_queryable' \t=> true,\n\t\t\t'exclude_from_search' \t=> false,\n\t\t\t'show_ui' \t\t\t\t=> true,\n\t\t\t'query_var' \t\t\t=> true,\n\t\t\t'menu_position' \t\t=> 5, // The order the custom post type appears on the admin menu\n\t\t\t// 'menu_icon' \t\t\t=> get_stylesheet_directory_uri() . '/assets/images/custom-post-icon.png',\n\t\t\t'rewrite'\t\t\t\t=> array( 'slug' => 'custom_type', 'with_front' => false ), // You may specify its url slug\n\t\t\t'has_archive' \t\t\t=> 'custom_type', // You mary rename the slug here\n\t\t\t'capability_type' \t\t=> 'post',\n\t\t\t'hierarchical' \t\t\t=> false,\n\n\t\t\t// Enable post editor support\n\t\t\t'supports' => array(\n\t\t\t\t'title',\n\t\t\t\t'editor',\n\t\t\t\t'author',\n\t\t\t\t'thumbnail',\n\t\t\t\t'excerpt',\n\t\t\t\t'trackbacks',\n\t\t\t\t'custom-fields',\n\t\t\t\t'comments',\n\t\t\t\t'revisions',\n\t\t\t\t'sticky'\n\t\t\t)\n\t\t)\n\t);\n\n\t// This adds your post categories to your custom post type\n\tregister_taxonomy_for_object_type( 'category', 'custom_type' );\n\n\t// This adds your post tags to your custom post type\n\tregister_taxonomy_for_object_type( 'post_tag', 'custom_type' );\n\n}", "public function register_qmgt_custom_post() {\r\n\t\trequire_once( QMGT_ROOT . '/qmgt-custom-post-type.php');\r\n\t}", "public function add_custom_post_types() {\n //\n }", "function tower_custom_post_types() {\n foreach (TOWER_CUSTOM_POSTS as $key => $custom_type) {\n register_post_type($key, $custom_type['config']);\n }\n}", "public function register_post_types() {\n\n\t}", "public static function register_post_type() {\n\t\t$labels = array(\n\t\t\t'name' => _x( 'Collections', 'post type general name', 'wp-recipe-maker-premium' ),\n\t\t\t'singular_name' => _x( 'Collection', 'post type singular name', 'wp-recipe-maker-premium' ),\n\t\t);\n\n\t\t$args = apply_filters( 'wprm_recipe_collections_post_type_arguments', array(\n\t\t\t'labels' \t=> $labels,\n\t\t\t'public' \t=> false,\n\t\t\t'rewrite' \t=> false,\n\t\t\t'capability_type' \t=> 'post',\n\t\t\t'query_var' \t=> false,\n\t\t\t'has_archive' \t=> false,\n\t\t\t'supports' \t\t\t\t=> array( 'title', 'author' ),\n\t\t\t'show_in_rest'\t\t\t=> true,\n\t\t\t'rest_base'\t\t\t\t=> WPRMPRC_POST_TYPE,\n\t\t\t'rest_controller_class' => 'WP_REST_Posts_Controller',\n\t\t));\n\n\t\tregister_post_type( WPRMPRC_POST_TYPE, $args );\n\t}", "public static function register_post_type()\n {\n\n \t register_post_type( 'books',\n\t\t array(\n\t\t 'labels' => array(\n\t\t 'name' => __( 'Books' ),\n\t\t 'singular_name' => __( 'Books' )\n\t\t ),\n\t\t 'public' => true,\n\t\t 'has_archive' => false,\n\t\t )\n\t\t );\n\n }", "public function register_post_types() {\n require_once('includes/post-types.php');\n }", "public function register_post_type(){\n\t\tif(!class_exists('CPT')) return;\n\t\n\t\t$this->post_type = new CPT(\n\t\t\tarray(\n\t\t\t 'post_type_name' => 'slide',\n\t\t\t 'singular' => 'Slide',\n\t\t\t 'plural' => 'Slides',\n\t\t\t 'slug' => 'slide'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'has_archive' \t\t\t=> \ttrue,\n\t\t\t\t'menu_position' \t\t=> \t8,\n\t\t\t\t'menu_icon' \t\t\t=> \t'dashicons-layout',\n\t\t\t\t'supports' \t\t\t\t=> \tarray('title', 'excerpt', 'content','thumbnail', 'post-formats', 'custom-fields')\n\t\t\t)\n\t\t);\n\t\t\n\t\t$labels = array('menu_name'=>'Types');\n\t\t$this->post_type->register_taxonomy('type',array(\n\t\t\t'hierarchical' => true,\n\t\t\t'public' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t\t'show_tagcloud' => true,\n\t\t),$labels);\n\t}", "public function registered_post_type( $post_type, $args ) {\n\n\t\tglobal $wp_post_types, $wp_rewrite, $wp;\n\n\t\tif( $args->_builtin or !$args->publicly_queryable or !$args->show_ui ){\n\t\t\treturn false;\n\t\t}\n\t\t$permalink = get_option( $post_type.'_structure' );\n\n\t\tif( !$permalink ) {\n\t\t\t$permalink = $this->default_structure;\n\t\t}\n\n\t\t$permalink = '%'.$post_type.'_slug%'.$permalink;\n\t\t$permalink = str_replace( '%postname%', '%'.$post_type.'%', $permalink );\n\n\t\tadd_rewrite_tag( '%'.$post_type.'_slug%', '('.$args->rewrite['slug'].')','post_type='.$post_type.'&slug=' );\n\n\t\t$taxonomies = get_taxonomies( array(\"show_ui\" => true, \"_builtin\" => false), 'objects' );\n\t\tforeach ( $taxonomies as $taxonomy => $objects ):\n\t\t\t$wp_rewrite->add_rewrite_tag( \"%tax-$taxonomy%\", '(.+?)', \"$taxonomy=\" );\n\t\tendforeach;\n\n\t\t$permalink = trim($permalink, \"/\" );\n\t\tadd_permastruct( $post_type, $permalink, $args->rewrite );\n\n\t}", "function bf_register_custom_post_type() {\r\n /* Añado las etiquetas que aparecerán en el escritorio de WordPress */\r\n\t$labels = array(\r\n\t\t'name' => _x( 'Ponentes', 'post type general name', 'text-domain' ),\r\n\t\t'singular_name' => _x( 'Ponente', 'post type singular name', 'text-domain' ),\r\n\t\t'menu_name' => _x( 'Ponentes', 'admin menu', 'text-domain' ),\r\n\t\t'add_new' => _x( 'Añadir nuevo', 'ponente', 'text-domain' ),\r\n\t\t'add_new_item' => __( 'Añadir nuevo ponente', 'text-domain' ),\r\n\t\t'new_item' => __( 'Nuevo Ponente', 'text-domain' ),\r\n\t\t'edit_item' => __( 'Editar Ponente', 'text-domain' ),\r\n\t\t'view_item' => __( 'Ver ponente', 'text-domain' ),\r\n\t\t'all_items' => __( 'Todos los ponentes', 'text-domain' ),\r\n\t\t'search_items' => __( 'Buscar ponentes', 'text-domain' ),\r\n\t\t'not_found' => __( 'No hay ponentes.', 'text-domain' ),\r\n\t\t'not_found_in_trash' => __( 'No hay ponentes en la papelera.', 'text-domain' )\r\n\t);\r\n\r\n /* Configuro el comportamiento y funcionalidades del nuevo custom post type */\r\n\t$args = array(\r\n\t\t'labels' => $labels,\r\n\t\t'description' => __( 'Descripción.', 'text-domain' ),\r\n\t\t'public' => true,\r\n\t\t'publicly_queryable' => true,\r\n\t\t'show_ui' => true,\r\n\t\t'show_in_menu' => true,\r\n\t\t'show_in_nav_menus' => true,\r\n\t\t'query_var' => true,\r\n\t\t'rewrite' => array( 'slug' => 'ponente' ),\r\n\t\t'capability_type' => 'post',\r\n\t\t'hierarchical' => false,\r\n\t\t'menu_position' => null,\r\n 'menu_icon' => 'dashicons-businessman',\r\n\t\t'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),\r\n\t\t'show_in_rest'\t \t => true,\r\n\t\t'public' \t\t\t => true,\r\n\t\t'has_archive' \t\t => true,\r\n\t\t'taxonomies' => array('category','categoria-conferencias')\r\n\t);\r\n\r\n\tregister_post_type('ponentes', $args );\r\n}", "function thirdtheme_custom_post_type()\n {\n $args = array(\n 'labels' => array('name' =>__(' my custom post'),\n 'singular name' =>__('my custom post')),\n 'public' => true,\n 'show_in_menu' => true,\n 'has_archive' => true,\n 'supports' => array( 'title', 'editor', 'author', 'thumbnail'));\n register_post_type('custompost',$args);\n \n }", "public function register_post_type() {\n\t $args = array(\n\t\t\t'public' => true,\n\t\t\t'label' => 'Questions'\n\t\t);\n\t register_post_type( 'questions', $args );\n\t}" ]
[ "0.7911114", "0.7758154", "0.7661058", "0.7630418", "0.7593939", "0.7571871", "0.7562517", "0.75430495", "0.7474007", "0.7469335", "0.74665034", "0.746017", "0.7450408", "0.7431948", "0.7394482", "0.7367333", "0.7367333", "0.73577774", "0.7355499", "0.7352057", "0.7351799", "0.7349739", "0.7298846", "0.7270663", "0.726875", "0.72578156", "0.72385615", "0.72353554", "0.72109306", "0.71867454" ]
0.8714965
0
Test that an invalid page cannot be passed to the constructor.
public function testInvalidPage() { $this->setExpectedException(\InvalidArgumentException::class); new XmlSitemapWriter($this->sitemap, 'invalid'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetShowPageWithInvalidData()\n {\n $resp = $this->getMockBuilder('Acme\\Http\\Response')\n ->setConstructorArgs([$this->request, $this->signer,\n $this->blade, $this->session])\n ->setMethods(['render'])\n ->getMock();\n\n // override render method to return true\n $resp->method('render')\n ->willReturn(true);\n\n // mock the controller and make getUri a stub\n $controller = $this->getMockBuilder('Acme\\Controllers\\PageController')\n ->setConstructorArgs([$this->request, $resp, $this->session,\n $this->blade, $this->signer])\n ->setMethods(['getUri', 'getShow404'])\n ->getMock();\n\n // orverride getUri to return just the slug from the uri\n $controller->expects($this->once())\n ->method('getUri')\n ->will($this->returnValue('missing-page'));\n\n $controller->expects($this->once())\n ->method('getShow404')\n ->will($this->returnValue(true));\n\n // call the method we want to test\n $result = $controller->getShowPage();\n // should get true back if we called 404\n\n $this->assertTrue($result);\n }", "public function testRestrictPage()\n {\n $this->assertTrue(true);\n }", "public function testConstructionShouldOnlyRequireLabel()\n {\n try {\n $page = new Zym_Navigation_Page_Mvc(array(\n 'label' => 'foo'\n ));\n \n } catch (Exception $e) {\n $this->fail('Should throw exception for missing label');\n }\n }", "function test_basic_nonexistentpage(){\n global $ID,$conf;\n $ID = 'wiki:start';\n\n $info = $this->_get_expected_pageinfo();\n $info['id'] = 'wiki:start';\n $info['namespace'] = 'wiki';\n $info['filepath'] = $conf['datadir'].'/wiki/start.txt';\n\n $this->assertEquals($info, pageinfo());\n }", "public function testNonLoggedUserCannotVisitArticleCreatePage(string $page)\n {\n // Prepare\n $article = factory(Post::class)->create([\n 'status' => 'draft',\n ]);\n\n $page = TestUtils::createEndpoint($page, ['id' => $article->id, 'slug' => $article->slug,]);\n\n // Request\n $response = $this->call('GET', $page);\n\n // Asserts\n $response->assertRedirect($this->loginUrl);\n }", "public function testUserNonAdministratorCannotVisitPages(string $page)\n {\n // Prepare\n /** @var User $user */\n $user = factory(User::class)->create(['is_admin' => false,]);\n $article = factory(Post::class)->create([\n 'status' => 'draft',\n ]);\n\n $page = TestUtils::createEndpoint($page, ['id' => $article->id, 'slug' => $article->slug,]);\n\n // Request\n $response = $this->actingAs($user)->call('GET', $page);\n\n // Asserts\n $response->assertStatus(404);\n }", "public function testDontIndexNewPrivatePage()\n {\n\n // Add a private page.\n $page = $this->_simplePage(false);\n\n // Should not add a Solr document.\n $this->_assertNotRecordInSolr($page);\n\n }", "public function testInvalidURL(string $url) : void\n {\n $this->expectException(UrlParserException::class);\n new UrlParser($url);\n $this->fail('Valid url syntax: ' . $url);\n }", "public function testAdminCanNotAddAPageWithBlankTitle()\n {\n $params = [];\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\n $this->assertEquals('The title field is required.', $errors->get('title')[0]);\n }", "public function test_it_should_throw_an_exception_on_invalid_url()\n {\n SourceFactory::create('unknown');\n }", "public function testErrorIsThrownIfURLIsInvalid()\n {\n self::$importer->get('invalid-google-url', now()->subYear(), now()->addYear());\n }", "public function test_i_can_see_404_error_page(AcceptanceTester $I) {\n\t\t$I->amOnPage('invalid_page');\n\t\t$I->see('404');\n\t\t$I->see('page not found');\n\t}", "public function testConstructorInvalidPdfEngine()\n {\n new TestablePaymentSlipPdf('FooBar');\n }", "public function testConstructorWithBadDefaultOptions2()\n {\n try {\n $test = new Zend_Cache_Frontend_Page(['default_options' => ['cache' => true, 1 => 'bar']]);\n } catch (Exception $e) {\n return;\n }\n $this->fail('Zend_Cache_Exception was expected but not thrown');\n }", "public function testFindPageThrowsErrorMessageForInvalidItemNumber()\n\t{\n\t\t$this->mock('Item')->shouldReceive('search')->once()->andReturn(Null);\n\t\t$this->getActionWithException('ItemsController@show', 1, 404, 'Item 1 was not found');\n\t}", "public function testError404WithBadExhibitPageSlug()\n {\n $exhibits = get_records('Exhibit');\n $this->assertEquals(1, count($exhibits));\n $exhibit = $exhibits[0];\n $exhibit->slug = 'goodexhibitslug';\n $exhibit->save();\n $this->assertEquals('goodexhibitslug', $exhibit->slug, 'Bad exhibit slug.');\n\n $exhibitPage = new ExhibitPage;\n $exhibitPage->title = 'Test Page';\n $exhibitPage->order = 1;\n $exhibitPage->layout = 'image-list-left-thumbs';\n $exhibitPage->slug = 'goodexhibitpageslug';\n $exhibitPage->exhibit_id = $exhibit->id;\n $exhibitPage->save();\n $this->assertTrue($exhibitPage->exists());\n\n $badExhibitPage = $this->db->getTable('ExhibitPage')->findBySlug('badexhibitpageslug');\n $this->assertEquals(null, $badExhibitPage);\n\n $this->setExpectedException('Omeka_Controller_Exception_404');\n $this->dispatch('exhibits/show/goodexhibitslug/goodexhibitslug/badexhibitpageslug');\n }", "function validate_page()\n {\n }", "function validate_page()\n {\n }", "public function testThrowsExceptionOnInvalidReport()\n {\n $parser = new Parser($this->createTwig(), \"This is an invalid string\");\n }", "public function testNonPublicPages()\n {\n $this->get('/home')->assertStatus(302);\n $this->get('/routes')->assertStatus(302);\n $this->get('/themes')->assertStatus(302);\n $this->get('/users')->assertStatus(302);\n $this->get('/users/create')->assertStatus(302);\n $this->get('/phpinfo')->assertStatus(302);\n $this->get('/profile/create')->assertStatus(302);\n }", "public function it_cant_create_invalid()\n {\n $this->shouldThrow('\\Aspire\\DIC\\Exception\\NotFoundException')->duringGet('SomeClassThatDoesNotExist');\n }", "public function testConstructorWithBadRegexps3()\n {\n $array = [\n '^/$' => ['cache' => true],\n '^/index/' => ['cache' => true],\n '^/article/' => ['cache' => false],\n '^/article/view/' => [\n 1 => true,\n 'cache_with_post_variables' => true,\n 'make_id_with_post_variables' => true,\n ]\n ];\n try {\n $test = new Zend_Cache_Frontend_Page(['regexps' => $array]);\n } catch (Exception $e) {\n return;\n }\n $this->fail('Zend_Cache_Exception was expected but not thrown');\n }", "public function testEmptyPages() {\n\t\t$page = $this->objFromFixture('UserDefinedForm', 'empty-page');\n\t\t$this->assertEquals(5, $page->Fields()->count());\n\t\t$controller = ModelAsController::controller_for($page);\n\t\t$form = new UserForm($controller);\n\t\t$this->assertEquals(2, $form->getSteps()->count());\n\t}", "public function test_that_a_new_user_cannot_register_with_invalid_information()\n {\n $this->browse(function ($browser) {\n $browser->visit('/register')\n ->type('name', 'Ben Gates')\n ->type('email', 'ben@')\n ->type('password', 'password')\n ->type('password_confirmation', 'password')\n ->type('description', 'This is just a short description about Ben Gates')\n ->press('Register')\n ->screenshot('register')\n ->assertPathIs('/register');\n });\n }", "public function actionIsNotAllowed()\n {\n throw new NotFoundException(__('Page not found.'));\n }", "function shShouldRedirectFromNonSef($pageInfo)\n{\n\tdie('voluntary die in ' . __METHOD__ . ' of class ' . __CLASS__);\n}", "public function test_IndexError(){\n\t\t$this->validateTestException(\n\t\t\t$this->fullURL,\n\t\t\t'GET',\n\t\t\t$this->data,\n\t\t\t'NotImplementedException',\n\t\t\t'index'\n\t\t);\n\t}", "public function test_err404_2()\n {\n $this->request('GET', ['pages/test', 'index']);\n $this->assertResponseCode(404);\n }", "public function testConstructInvalidArgument($content)\n {\n (new Dom($content));\n }", "public function testValidationFail() {\n $nbRecords = $this->Links->find('all')->count();\n //Build bad data with an empty token\n $badData = $this->goodData;\n $badData['title'] = '';\n\n $this->Links->save($this->Links->newEntity($badData));\n //Check no data has been inserted\n $this->assertEquals($nbRecords, $this->Links->find('all')->count(),\n 'Bad data has not been inserted');\n }" ]
[ "0.6741501", "0.66459084", "0.64610624", "0.6359607", "0.6358735", "0.62769055", "0.6220618", "0.61645335", "0.6139091", "0.61272395", "0.60980564", "0.6085131", "0.60685724", "0.6056345", "0.60298026", "0.6008254", "0.5976627", "0.5976627", "0.59700674", "0.59246576", "0.5911391", "0.5893601", "0.58791864", "0.5876691", "0.58678657", "0.58392847", "0.580888", "0.5798821", "0.5792525", "0.5777033" ]
0.7546506
0
Tests the writeElement() method.
public function testWriteElement() { $writer = new XmlSitemapWriter($this->sitemap, '1'); $writer->openMemory(); $writer->writeElement('url', [ 'item1' => 'value1', [ 'key' => 'item2', 'value' => '<value2>', ], [ 'key' => 'item3', 'value' => [ 'subkey' => 'subvalue', ], 'attributes' => [ 'attr1key' => 'attr1value', 'attr2key' => '<attr2value>', ], ], ]); $output = $writer->outputMemory(); $expected = '<url><item1>value1</item1><item2>&lt;value2&gt;</item2><item3 attr1key="attr1value" attr2key="&lt;attr2value&gt;"><subkey>subvalue</subkey></item3></url>' . PHP_EOL; $this->assertEquals($expected, $output); $writer->writeElement('url', [ 'loc' => 'https://www.example.com/test', 'image:image' => [ 'image:loc' => Url::fromUri('https://www.example.com/test.jpg'), 'image:title' => new TranslatableMarkup('The image title'), 'image:caption' => "'The image & its \"caption.\"'", ], ]); $output = $writer->outputMemory(); $expected = '<url><loc>https://www.example.com/test</loc><image:image><image:loc>https://www.example.com/test.jpg</image:loc><image:title>The image title</image:title><image:caption>&#039;The image &amp; its &quot;caption.&quot;&#039;</image:caption></image:image></url>' . PHP_EOL; $this->assertSame($expected, $output); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testWrite()\n {\n //Tries some values\n foreach ([\n ['first', 'second'],\n [],\n [true],\n [false],\n [null],\n ] as $value) {\n $this->assertTrue($this->SerializedArray->write($value));\n $result = safe_unserialize(file_get_contents($this->file));\n $this->assertEquals($value, $result);\n $this->assertIsArray($result);\n }\n }", "public function write()\n {\n $this->assertEquals('', $this->memoryOutputStream->getBuffer());\n $this->assertEquals(5, $this->memoryOutputStream->write('hello'));\n $this->assertEquals('hello', $this->memoryOutputStream->getBuffer());\n }", "abstract protected function _write();", "protected function _write() {}", "abstract protected function write();", "public function write();", "public function write();", "public function write()\n {\n }", "public function testBinaryWrite()\n {\n $binary = new BinaryGenerator();\n\n $binary->start($this->writeFile, BinaryGenerator::WRITE);\n $binary->writeData('some data.1');\n $binary->writeData('some data.2');\n $binary->finish();\n\n $this->assertFileExists($this->writeFile);\n }", "public function testWriteXml() {\n\n /* @var $export \\MDN_Antidot_Model_Export_Article */\n $export = Mage::getModel('Antidot/export_article');\n\n $context = Mage::getModel('Antidot/export_context', array('fr', 'PHPUNIT'));\n //Store id 3 : site FR, id5 : site FR discount\n $context->addStore(Mage::getModel('core/store')->load(3));\n $context->addStore(Mage::getModel('core/store')->load(5));\n\n $type = MDN_Antidot_Model_Observer::GENERATE_FULL;\n\n $filename = sys_get_temp_dir().DS.sprintf(MDN_Antidot_Model_Export_Article::FILENAME_XML, 'jetpulp', $type, $context->getLang());\n\n $items = $export->writeXml($context, $filename, $type);\n\n /*\n * test three articles are exported, number returned by the method: 2 articles, one one 2 websites => 3 article exported\n */\n $this->assertEquals(3, $items);\n\n //replace generated_at by the one in the expected result\n $result = file_get_contents($filename);\n\n /**\n * test the xml contains the correct owner tag\n */\n $xml = new SimpleXMLElement($result);\n $this->assertEquals(\"JETPULP\", (string)$xml->header->owner);\n\n /**\n * test the xml contains the correct feed tag\n */\n $this->assertEquals('article PHPUNIT v'.Mage::getConfig()->getNode()->modules->MDN_Antidot->version, (string)$xml->header->feed);\n\n /**\n * test the xml contains the correct websites tag\n */\n $this->assertEquals('3', $xml->article[0]->websites->website[0]['id']);\n $this->assertEquals('French Website', (string)$xml->article[0]->websites->website[0]);\n $this->assertEquals('3', $xml->article[1]->websites->website[0]['id']);\n $this->assertEquals('French Website', (string)$xml->article[1]->websites->website[0]);\n $this->assertEquals('5', $xml->article[2]->websites->website[0]['id']);\n $this->assertEquals('France Website_discount', (string)$xml->article[2]->websites->website[0]);\n\n /**\n * test the xml contains the correct name tag\n */\n $this->assertEquals('Article A', (string)$xml->article[0]->title);\n $this->assertEquals('Article B', (string)$xml->article[1]->title);\n $this->assertEquals('Article B', (string)$xml->article[2]->title);\n\n\n /**\n * test the xml contains the correct text tag\n */\n $this->assertEquals('test contenu A test', (string)$xml->article[0]->text);\n $this->assertEquals('test contenu B test', (string)$xml->article[1]->text);\n $this->assertEquals('test contenu B test', (string)$xml->article[2]->text);\n\n\n /**\n * test the xml contains the correct url tags\n */\n $this->assertEquals('http://www.monsiteweb.fr/AA/', (string)$xml->article[0]->url);\n $this->assertEquals('http://www.monsiteweb.fr/BB/', (string)$xml->article[1]->url);\n $this->assertEquals('http://www.monsitediscount.fr/BB/', (string)$xml->article[2]->url);\n\n\n /**\n * test the xml contains the identifier\n */\n $this->assertEquals('identifier', $xml->article[0]->identifiers->identifier[0]['type']);\n $this->assertEquals('identifier', $xml->article[1]->identifiers->identifier[0]['type']);\n $this->assertEquals('identifier', $xml->article[2]->identifiers->identifier[0]['type']);\n $this->assertEquals('AA', $xml->article[0]->identifiers->identifier[0]);\n $this->assertEquals('BB', $xml->article[1]->identifiers->identifier[0]);\n $this->assertEquals('BB', $xml->article[2]->identifiers->identifier[0]);\n\n\n\n\n }", "public function testElement()\n {\n $layer = new Layer($this->fivePieces);\n $this->assertTrue($layer->element(0)->id === 961);\n $this->assertTrue($layer->element(6) === null);\n }", "public function write($xml);", "function write()\n {\n }", "abstract public function write( $value );", "public function testSetElement()\n {\n $this->todo('stub');\n }", "function writeXMLFile($node, $filename) {\n\tglobal $gui_writedir;\n\t$previous_dir = getcwd();\n\tchdir($gui_writedir);\n\t$file = fopen($filename, 'w+');\n\t$result = fwrite($file, $node->asXML());\n\tif (!$result) {\n\t\tfclose($file);\n\t\tdie(\"Failed to write $filename\\n\");\n\t}\n\techo \"Successfully wrote $filename<br />\";\n\tfclose($file);\n\tchdir($previous_dir);\n}", "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 testSimpleXmlElement(): void\n {\n $handler = new SimpleXMLElementHandler();\n $result = $handler->handle('<test>data</test>');\n $this->assertEquals(new \\SimpleXMLElement('<test>data</test>'), $result);\n }", "abstract public function write($data);", "function writeDom($dom, $file_name){\n @$dom->validate();\n if(!$handle=fopen(dirname(__FILE__).\"/\".$file_name, 'w')){\n exit(\"Cannot open $filename\");\n }\n\n $dom->preserveWhiteSpace = false;\n $dom->formatOutput = false;\n if (fwrite($handle, $dom->saveXML()) === FALSE) {\n fclose($handle);\n exit(\"Cannot write to $file_name\");\n }\n}", "public function testBoolWrite(): void\n {\n // opening spreadsheet in Excel 2007-2016. Test verifies that\n // value field is written correctly for those versions.\n $outputFilename = File::temporaryFilename();\n $spreadsheet = new Spreadsheet();\n $worksheet = $spreadsheet->getActiveSheet();\n $worksheet->fromArray(['A', 'B', 'C', 'D']);\n $worksheet->getCell('A2')->setValue('=A1<>\"A\"');\n $worksheet->getCell('A3')->setValue('=A1=\"A\"');\n $worksheet->getCell('B2')->setValue('=LEFT(B1, 0)');\n $worksheet->getCell('B3')->setValue('=B2=\"\"');\n\n $writer = new Writer($spreadsheet);\n $writer->save($outputFilename);\n $zipfile = \"zip://$outputFilename#xl/worksheets/sheet1.xml\";\n $contents = file_get_contents($zipfile);\n unlink($outputFilename);\n if ($contents === false) {\n self::fail('Unable to open file');\n } else {\n self::assertStringContainsString('<c r=\"A2\" t=\"b\"><f>A1&lt;&gt;&quot;A&quot;</f><v>0</v></c>', $contents);\n self::assertStringContainsString('<c r=\"A3\" t=\"b\"><f>A1=&quot;A&quot;</f><v>1</v></c>', $contents);\n self::assertStringContainsString('<c r=\"B2\" t=\"str\"><f>LEFT(B1, 0)</f><v></v></c>', $contents);\n self::assertStringContainsString('<c r=\"B3\" t=\"b\"><f>B2=&quot;&quot;</f><v>1</v></c>', $contents);\n }\n }", "public function writeTo(XmlWriter $w) { }", "public function testInvalidElementName()\n {\n $writer = new XMLWriter();\n $writer->openMemory();\n $writer->setIndent(true);\n $writer->startDocument('1.0', 'UTF-8');\n\n $key = '';\n for ($i = 0; $i <= 0x7F; $i++) {\n $key.= chr($i);\n }\n\n $record = Record::fromArray([\n $key => 'foo'\n ]);\n\n $graph = new GraphTraverser();\n $graph->traverse($record, new XmlWriterVisitor($writer));\n\n $expect = <<<XML\n<?xml version=\"1.0\"?>\n<record>\n <________________________________________________0123456789_______ABCDEFGHIJKLMNOPQRSTUVWXYZ______abcdefghijklmnopqrstuvwxyz_____>foo</________________________________________________0123456789_______ABCDEFGHIJKLMNOPQRSTUVWXYZ______abcdefghijklmnopqrstuvwxyz_____>\n</record>\nXML;\n\n $this->assertXmlStringEqualsXmlString($expect, $writer->outputMemory());\n }", "public function _write($data)\n {\n }", "public function write(): bool\n {\n }", "public function write(): bool\n {\n }", "public function testWriteIsCalled()\n {\n // Mock the SentryLogWriter\n $spy = \\Phockito::spy('phptek\\Sentry\\SentryLogWriter');\n\n // Register it\n \\SS_Log::add_writer($spy, \\SS_Log::ERR, '<=');\n\n // Invoke SentryLogWriter::_write()\n \\SS_Log::log('You have one minute to reach minimum safe distance.', \\SS_Log::ERR);\n\n // Verificate\n \\Phockito::verify($spy, 1)->_write(arrayValue());\n }", "public function writeable();", "public function testWrite() {\n $writer = new \\Nimbles\\Core\\Log\\Writer\\Mock(array(\n 'formatter' => array(\n 'simple' => array(\n 'format' => '%message%'\n )\n )\n ));\n\n $writer->write(new \\Nimbles\\Core\\Log\\Entry('This is a test message 1'));\n $writer->write(new \\Nimbles\\Core\\Log\\Entry('This is a test message 2'));\n $entries = $writer->getEntries();\n\n $this->assertEquals('This is a test message 1', $entries[0]);\n $this->assertEquals('This is a test message 2', $entries[1]);\n }", "function write($offset, $data) {}" ]
[ "0.6594411", "0.62281907", "0.6161681", "0.61572105", "0.610757", "0.59129375", "0.59129375", "0.578263", "0.5731701", "0.5684551", "0.5590043", "0.557673", "0.55603814", "0.5523057", "0.5517346", "0.55029833", "0.5499105", "0.54597044", "0.5455645", "0.5354365", "0.5336838", "0.5315399", "0.5312846", "0.53027904", "0.52864265", "0.52864265", "0.52647156", "0.5259041", "0.5232204", "0.5218314" ]
0.7116637
0
Validate row data for replace behaviour
public function validateRowForReplace(array $rowData, $rowNumber) { $this->validateRowForDelete($rowData, $rowNumber); $this->validateRowForUpdate($rowData, $rowNumber); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scrub_row (&$row) {\n\t\t//\twith people filling in fields with things like\n\t\t//\t\"N/A\" or \"XX\".\n\t\t//\n\t\t//\tFix this\n\t\tforeach ($row as &$value) {\n\t\t\n\t\t\tif (is_null($value)) continue;\n\t\t\n\t\t\tif (\n\t\t\t\t//\tMatch \"N/A\" and variants\n\t\t\t\t(preg_match(\n\t\t\t\t\t'/^\\\\s*n\\/?a\\\\s*$/ui',\n\t\t\t\t\t$value\n\t\t\t\t)!==0) ||\n\t\t\t\t//\tAt least one column in one\n\t\t\t\t//\trow just has the content\n\t\t\t\t//\t\"a\"\n\t\t\t\t(preg_match(\n\t\t\t\t\t'/^\\\\s*a\\\\s*$/ui',\n\t\t\t\t\t$value\n\t\t\t\t)!==0) ||\n\t\t\t\t//\tThere are rows in columns with\n\t\t\t\t//\t\"XX\" or \"xx\" or \"xxcx\".\n\t\t\t\t(preg_match(\n\t\t\t\t\t'/^\\\\s*(?:x|c)+\\\\s*$/ui',\n\t\t\t\t\t$value\n\t\t\t\t)!==0) ||\n\t\t\t\t//\tWhile we're at it let's clobber\n\t\t\t\t//\tentries that are just whitespace\n\t\t\t\t(preg_match(\n\t\t\t\t\t'/^\\\\s*$/u',\n\t\t\t\t\t$value\n\t\t\t\t)!==0)\n\t\t\t) $value=null;\t//\tThe proper way to do things\n\t\t\t//\tFor sanity's sake let's just make\n\t\t\t//\tsure all the data is trimmed\n\t\t\telse $value=preg_replace(\n\t\t\t\t'/^\\\\s+|\\\\s+$/u',\n\t\t\t\t'',\n\t\t\t\t$value\n\t\t\t);\n\t\t\n\t\t}\n\t\n\t}", "private function validate(){\n\t\t$row = $this->row;\n\t\t$col = $this->col;\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeRow($i,$j);\n\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeCol($i,$j);\n\n\t}", "function checkValues($row,&$data,$insert,$from_update=false) {\n global $Language;\n $hp = Codendi_HTMLPurifier::instance();\n for ($c=0; $c < count($this->parsed_labels); $c++) {\n $label = $this->parsed_labels[$c];\n $val = $data[$c];\n $field = $this->used_fields[$label];\n if ($field) $field_name = $field->getName();\n \n // check if val in predefined vals (if applicable)\n unset($predef_vals);\n if (isset($this->predefined_values[$c])) {$predef_vals = $this->predefined_values[$c];}\n if (isset($predef_vals)) {\n\tif (!$this->checkPredefinedValues($field,$field_name,$label,$val,$predef_vals,$row,$data)) {\n\t return false;\n\t}\n }\n \n // check whether we specify None for a field which is mandatory\n if ($field && !$field->isEmptyOk() &&\n\t $field_name != \"artifact_id\") {\n\tif ($field_name == \"submitted_by\" ||\n\t $field_name == \"open_date\") {\n\t //submitted on and submitted by are accepted as \"\" on inserts and\n\t //we put time() importing user as default\n\t} else {\n\t \n\t $is_empty = ( ($field->isSelectBox() || $field->isMultiSelectBox()) ? ($val==$Language->getText('global','none')) : ($val==''));\n\n\t if ($is_empty) {\n\t $this->setError($Language->getText('plugin_tracker_import_utils','field_mandatory_and_current',array(\n $row+1,\n $hp->purify(implode(\",\",$data), CODENDI_PURIFIER_CONVERT_HTML),\n $hp->purify($label, CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify(SimpleSanitizer::unsanitize($this->ath->getName()), CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify($val, CODENDI_PURIFIER_CONVERT_HTML) )));\n\t return false;\n\t }\n\t}\n }\n \n // for date fields: check format\n if ($field && $field->isDateField()) {\n\tif ($field_name == \"open_date\" && $val == \"\") {\n\t //is ok.\n\t} else {\n\t \n\t if ($val == \"-\" || $val == \"\") {\n\t //ok. transform it by hand into 0 before updating db\n\t $data[$c] = \"\";\n\t } else {\n\t list($unix_time,$ok) = util_importdatefmt_to_unixtime($val);\n\t if (!$ok) {\n\t $this->setError($Language->getText('plugin_tracker_import_utils','incorrect_date',array(\n $row+1,\n $hp->purify(implode(\",\",$data), CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify($val, CODENDI_PURIFIER_CONVERT_HTML) )));\n\t return false;\n\t }\n\t $date = format_date(\"Y-m-d\",$unix_time);\n\t $data[$c] = $date;\n\t }\n\t}\n }\n } // end of for parsed_labels\n\n\n if (!$insert && $label == $this->lbl_list['follow_ups']) {\n /* check whether we need to remove known follow-ups */\n \n }\n \n // if we come from update case ( column tracker_id is specified but for this concrete artifact no aid is given)\n // we have to check whether all mandatory fields are specified and not empty\n if ($from_update) {\n\n \n while (list($label,$field) = each($this->used_fields)) {\n\tif ($field) $field_name = $field->getName();\n\t\n\tif ($field) {\n if ($field_name != \"artifact_id\" &&\n $field_name != \"open_date\" &&\n $field_name != \"submitted_by\" &&\n $label != $this->lbl_list['follow_ups'] &&\n $label != $this->lbl_list['is_dependent_on'] &&\n $label != $this->lbl_list['add_cc'] &&\n $label != $this->lbl_list['cc_comment'] &&\n !$field->isEmptyOk() && !in_array($label,$this->parsed_labels)) {\n\t \n\t $this->setError($Language->getText('plugin_tracker_import_utils','field_mandatory_and_line',array(\n $row+1,\n $hp->purify(implode(\",\",$data), CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify($label, CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify(SimpleSanitizer::unsanitize($this->ath->getName()), CODENDI_PURIFIER_CONVERT_HTML) )));\n\t return false;\n }\n\t}\n }\n \n \n }//end from_update\n \n return true;\n }", "private function validateRowData($rowData)\n\t{\n\t\t$validationData = array();\n\t\t$validationData[self::COL_STUDENT_NR] = $rowData[0];\n\t\t$validationData[self::COL_FIRSTNAME] = $rowData[1];\n\t\t$validationData[self::COL_LASTNAME] = $rowData[2];\n\t\t$validationData[self::COL_EMAIL] = $rowData[3];\n\n\t\t$validator = Validator::make($validationData, [\n\t\t\t self::COL_STUDENT_NR => 'required|integer',\n\t\t\t self::COL_FIRSTNAME => 'required|string',\n\t\t\t self::COL_LASTNAME => 'required|string',\n\t\t\t self::COL_EMAIL => 'required|email'\n\t\t]);\n\n\t\tif ($validator->fails()) {\n\t\t\treturn $validator->errors();\n\t\t}\n\n\t\treturn null;\n\t}", "abstract public function validateData();", "private function _validData($data){\n\t\t$columnsLen = array(\n\t\t\t\t\t\t\t'nro_pedido' => 6,\n\t\t\t\t\t\t\t'id_factura_pagos' => 1,\n\t\t\t\t\t\t\t'valor' => 1,\n\t\t\t\t\t\t\t'concepto' => 1,\n\t\t\t\t\t\t\t'fecha_inicio' => 0,\n\t\t\t\t\t\t\t'fecha_fin' => 0,\n\t\t\t\t\t\t\t'id_user' => 1\n\t\t);\n\t\treturn $this->_checkColumnsData($columnsLen, $data);\n\t}", "function validateRow($row) { \n \n if(!$this->fields) {\n return $row;\n }\n \n $return = [];\n foreach($this->fields as $key => $field) {\n $return[$key] = $this->validateField($row, $key);\n }\n return $return;\n }", "public function validRowForSave($row) {\n\n $params = $this->_request->getParams();\n $table = $params['table'];\n //-----------------------\n // Проверим строку на валидность\n $jsons = $this->_isValidRow($row);\n if (isset($jsons['class_message'])) { // Ошибка валидации\n return $jsons;\n }\n\n // Проверка валидации особых случаев\n if ($table == 'admin.blog_posts_tags') {\n $params = array();\n $params['table'] = 'blog_posts_tags';\n $params['fieldKey1'] = 'post_id';\n $params['fieldKey2'] = 'tag';\n $params['adapter'] = $this->db;\n $params['id'] = $row['id'];\n\n $validator = new Default_Form_Validate_DbMultipleKey($params);\n $value = $row['post_id'] . ';' . $row['tag'];\n if (!$validator->isValid($value)) {\n $messages = $validator->getMessages();\n $newMess = array();\n $newMess[] = '<em>' . Zend_Registry::get('Zend_Translate')->_('Ошибка формы! Неверно введены данные в форму.') . '</em>';\n $messages = array_values($messages);\n $newMess[] = $messages[0];\n $jsons = array(\n 'class_message' => 'warning',\n 'messages' => $newMess\n );\n }\n }\n\n return $jsons;\n }", "abstract public function validateData($data);", "protected function _validateRowForUpdate(array $rowData, $rowNumber)\n {\n $multiSeparator = $this->getMultipleValueSeparator();\n if ($this->_checkUniqueKey($rowData, $rowNumber)) {\n $email = strtolower($rowData[self::COLUMN_EMAIL]);\n $website = $rowData[self::COLUMN_WEBSITE];\n $addressId = $rowData[self::COLUMN_ADDRESS_ID];\n $customerId = $this->_getCustomerId($email, $website);\n\n if ($customerId === false) {\n $this->addRowError(self::ERROR_CUSTOMER_NOT_FOUND, $rowNumber);\n } else {\n if ($this->_checkRowDuplicate($customerId, $addressId)) {\n $this->addRowError(self::ERROR_DUPLICATE_PK, $rowNumber);\n } else {\n // check simple attributes\n foreach ($this->_attributes as $attributeCode => $attributeParams) {\n $websiteId = $this->_websiteCodeToId[$website];\n $attributeParams = $this->adjustAttributeDataForWebsite($attributeParams, $websiteId);\n\n if (in_array($attributeCode, $this->_ignoredAttributes)) {\n continue;\n }\n if (isset($rowData[$attributeCode]) && strlen($rowData[$attributeCode])) {\n $this->isAttributeValid(\n $attributeCode,\n $attributeParams,\n $rowData,\n $rowNumber,\n $multiSeparator\n );\n } elseif ($attributeParams['is_required']\n && !$this->addressStorage->doesExist(\n (string)$addressId,\n (string)$customerId\n )\n ) {\n $this->addRowError(self::ERROR_VALUE_IS_REQUIRED, $rowNumber, $attributeCode);\n }\n }\n\n if (isset($rowData[self::COLUMN_POSTCODE])\n && isset($rowData[self::COLUMN_COUNTRY_ID])\n && !$this->postcodeValidator->isValid(\n $rowData[self::COLUMN_COUNTRY_ID],\n $rowData[self::COLUMN_POSTCODE]\n )\n ) {\n $this->addRowError(self::ERROR_VALUE_IS_REQUIRED, $rowNumber, self::COLUMN_POSTCODE);\n }\n\n if (isset($rowData[self::COLUMN_COUNTRY_ID]) && isset($rowData[self::COLUMN_REGION])) {\n $countryRegions = isset(\n $this->_countryRegions[strtolower($rowData[self::COLUMN_COUNTRY_ID])]\n ) ? $this->_countryRegions[strtolower(\n $rowData[self::COLUMN_COUNTRY_ID]\n )] : [];\n\n if (!empty($rowData[self::COLUMN_REGION]) && !empty($countryRegions) && !isset(\n $countryRegions[strtolower($rowData[self::COLUMN_REGION])]\n )\n ) {\n $this->addRowError(self::ERROR_INVALID_REGION, $rowNumber, self::COLUMN_REGION);\n }\n }\n }\n }\n }\n }", "function ValidRow($row) {\n\t$ValidRow = TRUE;\n\treturn $ValidRow;\n}", "private function validRow($arrRows) {\n\t\t$arrErrors = array();\n\t\t$error = \"\";\n\t\tforeach ($arrRows as $key => $strRow) {\n\t\t\t$lineError = $key + 1;\n\t\t\t$validARow = $this->validARow($strRow, ($lineError));\n\t\t\t//if (is_string($validARow) && Core_Util_Helper::isNotEmpty($validARow)) {\n\t\t\tif (count($validARow) > 0) {\n\t\t\t\t//$error .= $validARow . \"<br />\";\n\t\t\t\t$arrErrors[] = $lineError;\n\t\t\t}\n\t\t}\n// \t\tif (Core_Util_Helper::isEmpty($error)) {\n// \t\t\treturn true;\n// \t\t} else {\n// \t\t\t//Core_Util_LocalLog::writeLog(\"validRow return \" . $error);\n// \t\t\treturn $error;\n// \t\t}\n\t\treturn $arrErrors;\n\t}", "private function convert_and_validate_rows(){\n\n // convert string to an array\n $this->sudoku_array = explode(' ', $this->sudoku_string);\n\n if(count($this->sudoku_array) != 9){\n return false;\n }\n\n // convert each string array to digits array\n foreach($this->sudoku_array as &$row){\n $row = str_split($row);\n\n // check if the row if valid\n if(count($row) != 9 || count(array_unique($row)) !=9){\n return false;\n }\n }\n\n return true;\n }", "public function validateData($data): void;", "private function checkGridRows(array $rowData)\n {\n # Check first if data key exists on passed row data array.\n if (array_key_exists('data', $rowData) === true) {\n $rowArr = $rowData['data'];\n foreach ($rowArr as $column => $cell) {\n # Check if the cell variable is array or not, and then convert the cell value.\n if (is_array($cell) === true and array_key_exists('value', $cell) === true) {\n $cell['value'] = $this->doConvertBrToNl($cell['value']);\n } else {\n $cell = $this->doConvertBrToNl($cell);\n }\n $rowData['data'][$column] = $cell;\n }\n }\n # Return the row data.\n return $rowData;\n }", "public function applySchemaToData(array $row): array\n {\n // Iterating over each field of the row and checking in configuration metadata what are the rules\n foreach ($row as $fieldName => &$value) {\n // If no requirement was given for this field, we go next\n if (empty($this->configuration[$fieldName])) {\n continue;\n }\n\n // Retrieving requirements for this fieldName\n $requirements = $this->configuration[$fieldName];\n\n // If value is empty and it is NOT allowed by metadata\n if ($value === '' && empty($requirements['optional'])) {\n throw new ValidationException(sprintf(\n \"The field '%s' can not be empty ! Consider fixing your data or fixing schema with : '%s=?%s'\",\n $fieldName,\n $fieldName,\n $requirements['type']\n ));\n }\n\n // If value is empty but it is allowed by metadata\n if ($value === '' && $requirements['optional'] === true) {\n // Replacing the value by NULL and go next\n $value = null;\n continue;\n }\n\n // We don't know what validator should take responsibility for the $value\n $typeValidator = null;\n\n // Let's find out !\n foreach ($this->validators as $validator) {\n if ($validator->supports($requirements['type'])) {\n $typeValidator = $validator;\n break;\n }\n }\n\n // If we did not found any validator for the $value\n if (!$typeValidator) {\n throw new ValidationException(sprintf(\n \"No validator class was found for type '%s' ! You should create a '%s' class to support it or maybe it already exists but was not added to Validators ! 👍\",\n $requirements['type'],\n 'App\\\\Validation\\\\Validator\\\\' . ucfirst($requirements['type']) . 'Validator'\n ));\n }\n\n // We validate the value and if it does not match with rules .. 💣\n if (!$typeValidator->validate($value)) {\n throw new ValidationException(sprintf(\n \"The field '%s' with value '%s' does not match requirements type '%s' !\",\n $fieldName,\n $value,\n $requirements['type']\n ));\n }\n }\n\n // We return the row because after validation of its values, some of them could have change !\n return $row;\n }", "private function array_validator(array $data)\n {\n if (!array_key_exists(0, $data))\n {\n $this->is_valid = false;\n return false;\n }\n\n if ($data[0] === false)\n {\n $this->is_empty = true;\n return false;\n }\n\n if (!is_array($data[0]))\n {\n // 1 dimensional data -- diverge from typical here to\n // function for 1 dimensional data?\n }\n\n $this->columns = $this->set_columns(array_keys($data[0]));\n \n if (empty($this->columns))\n {\n $this->is_empty = false;\n return false;\n }\n\n $this->set_number_of_columns(count($this->columns));\n $number_of_rows = 0;\n\n foreach ($data as $row)\n {\n ++$number_of_rows;\n if (count(array_keys($row)) > $this->number_of_columns)\n {\n // invalid data\n // data must have same number of columns throughout.\n // although, there is a desgin decision here: it is possible\n // that this ought to be considered valid data, and a filling\n // of the data could be performed... *thinking on that*\n }\n \n foreach ($this->columns as $key)\n {\n if (!array_key_exists($key, $row))\n {\n // invalid data? or possibly same decison as above\n // and fill the data...\n }\n }\n }\n\n $this->set_number_of_rows($number_of_rows);\n\n // valid array. from here, either pass $data to a building function\n // or simply say $this->data = $data. unsure of design yet.\n }", "public function verifyRow(array $rowData): void\n {\n foreach (self::$stockItemAttributes as $stockItemAttribute) {\n $this->assertNotSame(\n '',\n $rowData[$stockItemAttribute],\n \"Stock item attribute {$stockItemAttribute} value is empty string\"\n );\n }\n }", "function isDataValid() \n {\n return true;\n }", "public function sanitiseData(): void\n {\n $this->firstLine = self::sanitiseString($this->firstLine);\n self::validateExistsAndLength($this->firstLine, 1000);\n $this->secondLine = self::sanitiseString($this->secondLine);\n self::validateExistsAndLength($this->secondLine, 1000);\n $this->town = self::sanitiseString($this->town);\n self::validateExistsAndLength($this->town, 255);\n $this->postcode = self::sanitiseString($this->postcode);\n self::validateExistsAndLength($this->postcode, 10);\n $this->county = self::sanitiseString($this->county);\n self::validateExistsAndLength($this->county, 255);\n $this->country = self::sanitiseString($this->country);\n self::validateExistsAndLength($this->country, 255);\n }", "abstract protected function validate($data);", "function validate_rows() {\r\n $ok = True;\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n foreach ($this->properties as $colvar=>$col) {\r\n if (!$this->validate_field($colvar,$i)) { # make sure this field is not empty\r\n $ok = False;\r\n }\r\n }\r\n }\r\n return $ok;\r\n }", "protected function sanitizeRow (array &$row)\n\t{\n\t\tif (strlen($row['short_description']) > 500) {\n\t\t\t$row['short_description'] = substr($row['short_description'], 0, 497) . '...';\n\t\t}\n\t\tif (strlen($row['description']) > 2000) {\n\t\t\t$row['description'] = substr($row['description'], 0, 1997) . '...';\n\t\t}\n\t\tif (strlen($row['keywords'])) {\n\t\t\t$keywords = array();\n\t\t\t$split = preg_split('/[\\n,]/', $row['keywords']);\n\t\t\tforeach ($split as $keyword) {\n\t\t\t\t$keyword = trim($keyword);\n\t\t\t\tif ($keyword) {\n\t\t\t\t\t$keywords[] = $keyword;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$row['keywords'] = implode(self::SEPARATOR, $keywords);\n\t\t}\n\t\tforeach ($row as &$field) {\n\t\t\t$field = str_replace('&nbsp;', ' ', $field);\n\t\t\t$field = preg_replace('/[|\\n\\r]/', '', $field);\n\t\t}\n\t}", "public function validateData(array $data) {\n\t\t$num_cols = null;\n\t\tforeach ($data as $row) {\n\t\t\tif (!is_array($row)) {\n\t\t\t\tthrow new Matrix\\Exception\\InvalidDataException(\"A row contained in the data is not an array\");\n\t\t\t}\n\n\t\t\tif (is_null($num_cols)) {\n\t\t\t\t$num_cols = count($row);\n\t\t\t}\n\n\t\t\tif (count($row) == 0) {\n\t\t\t\tthrow new Matrix\\Exception\\InvalidDataException(\"Data is empty (no data in columns)\");\n\t\t\t}\n\n\t\t\tif ($num_cols != count($row)) {\n\t\t\t\tthrow new Matrix\\Exception\\InvalidDataException(\"Rows in data array are not all of the same size\");\n\t\t\t}\n\n\t\t\tforeach ($row as $value) {\n\t\t\t\tif (!is_numeric($value)) {\n\t\t\t\t\tthrow new Matrix\\Exception\\NotNumericException(\"Values in the matrix are not all of numeric type\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function sanitizeRow (array &$row)\n\t{\n\t\tif (!empty($row['title']) && strlen($row['title']) > 100) {\n\t\t\t$row['title'] = substr($row['title'], 0, 97) . '...';\n\t\t}\n\t\tif (!empty($row['description']) && strlen($row['description']) > 8000) {\n\t\t\t$row['description'] = substr($row['description'], 0, 7997) . '...';\n\t\t}\n\t\tif (!empty($row['features']) && strlen($row['features'])) {\n\t\t\t$features = array();\n\t\t\t$split = preg_split('/[\\n]/', strip_tags($row['features']));\n\t\t\tforeach ($split as $feature) {\n\t\t\t\t$feature = trim($feature);\n\t\t\t\tif (strlen($feature)) {\n\t\t\t\t\tif (strlen($feature) > 250) {\n\t\t\t\t\t\t$feature = substr($feature, 0, 247) . '...';\n\t\t\t\t\t}\n\t\t\t\t\t$features[] = $feature;\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t$row['features'] = implode(self::SEPARATOR, $features);\n\t\t}\n\t\tif (!empty($row['mfg_name'])) {\n\t\t\t$row['mfg_name'] = preg_replace('/[^A-Za-z0-9_\\s]/', '', $row['mfg_name']); // non-alpha numeric chars not supported\n\t\t}\n\t\tif (!empty($row['keywords']) && strlen($row['keywords'])) {\n\t\t\t$keywords = array();\n\t\t\t$split = preg_split('/[\\n,]/', $row['keywords']);\n\t\t\tforeach ($split as $keyword) {\n\t\t\t\t$keyword = trim($keyword);\n\t\t\t\tif ((strlen(implode(self::SEPARATOR, $keywords)) + strlen($keyword)) > 250) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ($keyword && strlen($keyword) <= 40) {\n\t\t\t\t\t$keywords[] = $keyword;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$row['keywords'] = implode(self::SEPARATOR, $keywords);\n\t\t}\n\t\t\n\t\t$searches = array('&nbsp;','á','à','â','ã','ª','ä','å','Á','À','Â','Ã','Ä','é','è','ê','ë','É','È','Ê','Ë','í','ì','î','ï','Í','Ì','Î','Ï','œ','ò','ó','ô','õ','º','ø','Ø','Ó','Ò','Ô','Õ','ú','ù','û','Ú','Ù','Û','ç','Ç','Ñ','ñ');\n\t\t$replacements = array(' ','a','a','a','a','a','a','a','A','A','A','A','A','e','e','e','e','E','E','E','E','i','i','i','i','I','I','I','I','oe','o','o','o','o','o','o','O','O','O','O','O','u','u','u','U','U','U','c','C','N','n');\n\t\t\n\t\tforeach ($row as &$field) {\n\t\t\tif (is_scalar($field)) {\n\t\t\t\t$field = str_replace($searches, $replacements, $field);\n\t\t\t\t$field = preg_replace('/[\\t\\n\\r]/', '', $field);\n\t\t\t}\n\t\t}\n\t}", "function tt_validate_upload_columns(csv_import_reader $cir, $stdfields, moodle_url $returnurl) {\n $columns = $cir->get_columns();\n\n if (empty($columns)) {\n $cir->close();\n $cir->cleanup();\n print_error('cannotreadtmpfile', 'error', $returnurl);\n }\n if (count($columns) < 2) {\n $cir->close();\n $cir->cleanup();\n print_error('csvfewcolumns', 'error', $returnurl);\n }\n\n // test columns\n $processed = array();\n foreach ($columns as $key=>$unused) {\n $field = $columns[$key];\n $lcfield = textlib::strtolower($field);\n if (in_array($field, $stdfields) or in_array($lcfield, $stdfields)) {\n // standard fields are only lowercase\n $newfield = $lcfield;\n } else {\n $cir->close();\n $cir->cleanup();\n print_error('invalidfieldname', 'error', $returnurl, $field);\n }\n if (in_array($newfield, $processed)) {\n $cir->close();\n $cir->cleanup();\n print_error('duplicatefieldname', 'error', $returnurl, $newfield);\n }\n $processed[$key] = $newfield;\n }\n return $processed;\n}", "private function hasValidFormat(array $keys, &$row): bool \n {\n $outcome = true;\n foreach($keys as $key) {\n if( $this->isColumnUnset($key, $row)){\n \n $outcome = false;\n break;\n }\n }\n return $outcome;\n }", "public function validateRowForUpdate(array $rowData, $rowNumber)\n {\n if (!empty($rowData['conditions_serialized'])) {\n $conditions = $this->serializer->unserialize($rowData['conditions_serialized']);\n if (is_array($conditions)) {\n $this->validateConditions($conditions, $rowNumber);\n } else {\n $errorMessage = __('invalid conditions serialized.');\n $this->addRowError($errorMessage, $rowNumber);\n }\n }\n\n if (!empty($rowData['actions_serialized'])) {\n $actions = $this->serializer->unserialize($rowData['actions_serialized']);\n if (is_array($actions)) {\n $this->validateActions($actions, $rowNumber);\n } else {\n $errorMessage = __('invalid actions serialized.');\n $this->addRowError($errorMessage, $rowNumber);\n }\n }\n }", "private function validRow($arrayToCheck) {\n if (isset($arrayToCheck) && !empty($arrayToCheck)) {\n //check number values\n if (count($arrayToCheck) == COUNT_VALUES) {\n //check values needed to put in database\n \n //Check subscriber\n if (!intval($arrayToCheck[2])) {\n $this->arrMsgError[] = array(\n 'data' => $arrayToCheck,\n 'error' => 'Subscriber is not an integer'\n );\n return false;\n }\n\n //Check date\n list($day, $month, $year) = explode('/', $arrayToCheck[3]);\n if(!checkdate($month,$day,$year)) {\n $this->arrMsgError[] = array(\n 'data' => $arrayToCheck,\n 'error' => 'Date is wrong'\n );\n return false;\n }\n\n //Check hour\n if (!preg_match(\"/^(?:2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]$/\", $arrayToCheck[4])) {\n $this->arrMsgError[] = array(\n 'data' => $arrayToCheck,\n 'error' => 'Time is wrong'\n );\n return false;\n }\n\n //Check Consumption\n if (preg_match(\"/^(?:2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]$/\", $arrayToCheck[5])) {\n $type = 'call';\n $parsed = date_parse($arrayToCheck[5]);\n $consumption = $parsed['hour'] * 3600 + $parsed['minute'] * 60 + $parsed['second'];\n }\n elseif ($arrayToCheck[6] == '0.0' || intval($arrayToCheck[6])) {\n $type = 'data';\n $consumption = intval($arrayToCheck[6]);\n }\n elseif ($arrayToCheck[5]=='' || $arrayToCheck[6]=='') {\n $type = 'sms';\n $consumption = '';\n }\n else {\n $this->arrMsgError[] = array(\n 'data' => $arrayToCheck,\n 'error' => 'Consumption values are not good'\n );\n return false;\n }\n\n //return array to insert in database \n //array(subscriber, datetime, consumption, $type)\n $date = date(\"Y-m-d H:i:s\", strtotime(str_replace('/', '-', $arrayToCheck[3]).' '.$arrayToCheck[4]));\n return array(\n 'subscriber' => $arrayToCheck[2],\n 'date' => $date,\n 'consumption' => $consumption,\n 'type' => $type);\n } \n else\n return false;\n }\n else {\n return false;\n }\n }", "function check_replacement ($conn,$data, $final_valid, $defected) {\n\n\tif ($final_valid == \"YES\" AND $defected == \"Defected\") {\n\t\treturn \"VALID\";\n\t}\n\telse {\n\t return \"INVALID\" ; \n\t}\n}" ]
[ "0.65720755", "0.65195394", "0.64467067", "0.63926315", "0.63761115", "0.6222439", "0.6207895", "0.6151898", "0.61306554", "0.6127452", "0.6084676", "0.6047883", "0.60110384", "0.5918179", "0.5876885", "0.5859545", "0.5847386", "0.58383036", "0.57409394", "0.57371116", "0.56803364", "0.5645451", "0.56291115", "0.5620307", "0.56034046", "0.55802786", "0.55777335", "0.55765355", "0.5570389", "0.55526423" ]
0.66200906
0
Validate row data for delete behaviour
public function validateRowForDelete(array $rowData, $rowNumber) { if (empty($rowData[self::COLUMN_RULE_ID])) { $this->addRowError(self::ERROR_RULE_ID_IS_EMPTY, $rowNumber); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check_del($rowindex) {\r\n /* called on row delete validation */\r\n return True;\r\n }", "public function delete() {\n\t\tif (!empty($this->originalData)) {\n\t\t\t$query = $this->connection->query(\"DELETE FROM {$this->table} WHERE \".self::$primaryKey[$this->table].\"='{$this->originalData[self::$primaryKey[$this->table]]}'\");\n\t\t\t$query = $this->connection->query(\"ALTER TABLE $this->table AUTO_INCREMENT = 1\");\n\t\t\t$this->originalData = array();\n\t\t}\t\n\t\telse \n\t\t\tthrow new Exception('You are trying to delete an inexistent row');\n\t}", "protected function _validateRowForDelete(array $rowData, $rowNumber)\n {\n if ($this->_checkUniqueKey($rowData, $rowNumber)) {\n $email = strtolower($rowData[self::COLUMN_EMAIL]);\n $website = $rowData[self::COLUMN_WEBSITE];\n $addressId = $rowData[self::COLUMN_ADDRESS_ID];\n\n $customerId = $this->_getCustomerId($email, $website);\n if ($customerId === false) {\n $this->addRowError(self::ERROR_CUSTOMER_NOT_FOUND, $rowNumber);\n } else {\n if (!strlen($addressId)) {\n $this->addRowError(self::ERROR_ADDRESS_ID_IS_EMPTY, $rowNumber);\n } elseif (!$this->addressStorage->doesExist(\n (string)$addressId,\n (string)$customerId\n )) {\n $this->addRowError(self::ERROR_ADDRESS_NOT_FOUND, $rowNumber);\n }\n }\n }\n }", "public function deleteRow($row);", "public function validateMultiDelete()\n {\n return true;\n }", "public static function deleteData($row){\n\n\t\t$result = DB::delete($row['table'])->where('id', $row['id'])->execute();\n\t\treturn 1;\n\n\t}", "function DeleteRows() {\n\t\tglobal $Language, $Security;\n\t\tif (!$Security->CanDelete()) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoDeletePermission\")); // No delete permission\n\t\t\treturn FALSE;\n\t\t}\n\t\t$DeleteRows = TRUE;\n\t\t$sSql = $this->SQL();\n\t\t$conn = &$this->Connection();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE) {\n\t\t\treturn FALSE;\n\t\t} elseif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // No record found\n\t\t\t$rs->Close();\n\t\t\treturn FALSE;\n\n\t\t//} else {\n\t\t//\t$this->LoadRowValues($rs); // Load row values\n\n\t\t}\n\t\t$rows = ($rs) ? $rs->GetRows() : array();\n\t\t$conn->BeginTrans();\n\n\t\t// Clone old rows\n\t\t$rsold = $rows;\n\t\tif ($rs)\n\t\t\t$rs->Close();\n\n\t\t// Call row deleting event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$DeleteRows = $this->Row_Deleting($row);\n\t\t\t\tif (!$DeleteRows) break;\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$sKey = \"\";\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$sThisKey = \"\";\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['Id_Item'];\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\t$DeleteRows = $this->Delete($row); // Delete\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($DeleteRows === FALSE)\n\t\t\t\t\tbreak;\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\n\t\t\t\t$sKey .= $sThisKey;\n\t\t\t}\n\t\t} else {\n\n\t\t\t// Set up error message\n\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t// Use the message, do nothing\n\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t} else {\n\t\t\t\t$this->setFailureMessage($Language->Phrase(\"DeleteCancelled\"));\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$conn->CommitTrans(); // Commit the changes\n\t\t} else {\n\t\t\t$conn->RollbackTrans(); // Rollback changes\n\t\t}\n\n\t\t// Call Row Deleted event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$this->Row_Deleted($row);\n\t\t\t}\n\t\t}\n\t\treturn $DeleteRows;\n\t}", "public function checkIsValidForDelete() {\n $errors = false;\n if(strlen(trim($this->idGroup)) == 0){\n $errors = \"Group identifier is mandatory\";\n }else if(!preg_match('/^\\d+$/', $this->idGroup)){\n $errors = \"Group identifier format is invalid\";\n }else if($this->existsGroup() !== true) {\n $errors = \"Group doesn't exist\";\n }\n return $errors;\n }", "public function validateDelete ($postArray,$editId) \n{\n $retMesg='';\n return $retMesg;\n\n}", "function DeleteRows() {\n\t\tglobal $conn, $Security, $patient_detail;\n\t\t$DeleteRows = TRUE;\n\t\t$sWrkFilter = $patient_detail->CurrentFilter;\n\n\t\t// Set up filter (Sql Where Clause) and get Return SQL\n\t\t// SQL constructor in patient_detail class, patient_detailinfo.php\n\n\t\t$patient_detail->CurrentFilter = $sWrkFilter;\n\t\t$sSql = $patient_detail->SQL();\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE) {\n\t\t\treturn FALSE;\n\t\t} elseif ($rs->EOF) {\n\t\t\t$this->setMessage(\"No records found\"); // No record found\n\t\t\t$rs->Close();\n\t\t\treturn FALSE;\n\t\t}\n\t\t$conn->BeginTrans();\n\n\t\t// Clone old rows\n\t\t$rsold = ($rs) ? $rs->GetRows() : array();\n\t\tif ($rs) $rs->Close();\n\n\t\t// Call row deleting event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$DeleteRows = $patient_detail->Row_Deleting($row);\n\t\t\t\tif (!$DeleteRows) break;\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$sKey = \"\";\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$sThisKey = \"\";\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= EW_COMPOSITE_KEY_SEPARATOR;\n\t\t\t\t$sThisKey .= $row['DetailNo'];\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t\t\t$DeleteRows = $conn->Execute($patient_detail->DeleteSQL($row)); // Delete\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($DeleteRows === FALSE)\n\t\t\t\t\tbreak;\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\n\t\t\t\t$sKey .= $sThisKey;\n\t\t\t}\n\t\t} else {\n\n\t\t\t// Set up error message\n\t\t\tif ($patient_detail->CancelMessage <> \"\") {\n\t\t\t\t$this->setMessage($patient_detail->CancelMessage);\n\t\t\t\t$patient_detail->CancelMessage = \"\";\n\t\t\t} else {\n\t\t\t\t$this->setMessage(\"Delete cancelled\");\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$conn->CommitTrans(); // Commit the changes\n\t\t} else {\n\t\t\t$conn->RollbackTrans(); // Rollback changes\n\t\t}\n\n\t\t// Call recordset deleted event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$patient_detail->Row_Deleted($row);\n\t\t\t}\t\n\t\t}\n\t\treturn $DeleteRows;\n\t}", "function DeleteRows() {\n\t\tglobal $Language, $Security;\n\t\tif (!$Security->CanDelete()) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoDeletePermission\")); // No delete permission\n\t\t\treturn FALSE;\n\t\t}\n\t\t$DeleteRows = TRUE;\n\t\t$sSql = $this->SQL();\n\t\t$conn = &$this->Connection();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE) {\n\t\t\treturn FALSE;\n\t\t} elseif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // No record found\n\t\t\t$rs->Close();\n\t\t\treturn FALSE;\n\n\t\t//} else {\n\t\t//\t$this->LoadRowValues($rs); // Load row values\n\n\t\t}\n\t\t$rows = ($rs) ? $rs->GetRows() : array();\n\t\t$conn->BeginTrans();\n\n\t\t// Clone old rows\n\t\t$rsold = $rows;\n\t\tif ($rs)\n\t\t\t$rs->Close();\n\n\t\t// Call row deleting event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$DeleteRows = $this->Row_Deleting($row);\n\t\t\t\tif (!$DeleteRows) break;\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$sKey = \"\";\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$sThisKey = \"\";\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['Id_tercero'];\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\t$DeleteRows = $this->Delete($row); // Delete\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($DeleteRows === FALSE)\n\t\t\t\t\tbreak;\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\n\t\t\t\t$sKey .= $sThisKey;\n\t\t\t}\n\t\t} else {\n\n\t\t\t// Set up error message\n\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t// Use the message, do nothing\n\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t} else {\n\t\t\t\t$this->setFailureMessage($Language->Phrase(\"DeleteCancelled\"));\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$conn->CommitTrans(); // Commit the changes\n\t\t} else {\n\t\t\t$conn->RollbackTrans(); // Rollback changes\n\t\t}\n\n\t\t// Call Row Deleted event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$this->Row_Deleted($row);\n\t\t\t}\n\t\t}\n\t\treturn $DeleteRows;\n\t}", "function DeleteRows() {\n\t\tglobal $Language, $Security;\n\t\tif (!$Security->CanDelete()) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoDeletePermission\")); // No delete permission\n\t\t\treturn FALSE;\n\t\t}\n\t\t$DeleteRows = TRUE;\n\t\t$sSql = $this->SQL();\n\t\t$conn = &$this->Connection();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE) {\n\t\t\treturn FALSE;\n\t\t} elseif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // No record found\n\t\t\t$rs->Close();\n\t\t\treturn FALSE;\n\n\t\t//} else {\n\t\t//\t$this->LoadRowValues($rs); // Load row values\n\n\t\t}\n\t\t$rows = ($rs) ? $rs->GetRows() : array();\n\t\t$conn->BeginTrans();\n\n\t\t// Clone old rows\n\t\t$rsold = $rows;\n\t\tif ($rs)\n\t\t\t$rs->Close();\n\n\t\t// Call row deleting event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$DeleteRows = $this->Row_Deleting($row);\n\t\t\t\tif (!$DeleteRows) break;\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$sKey = \"\";\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$sThisKey = \"\";\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['id'];\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\t$DeleteRows = $this->Delete($row); // Delete\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($DeleteRows === FALSE)\n\t\t\t\t\tbreak;\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\n\t\t\t\t$sKey .= $sThisKey;\n\t\t\t}\n\t\t} else {\n\n\t\t\t// Set up error message\n\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t// Use the message, do nothing\n\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t} else {\n\t\t\t\t$this->setFailureMessage($Language->Phrase(\"DeleteCancelled\"));\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$conn->CommitTrans(); // Commit the changes\n\t\t} else {\n\t\t\t$conn->RollbackTrans(); // Rollback changes\n\t\t}\n\n\t\t// Call Row Deleted event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$this->Row_Deleted($row);\n\t\t\t}\n\t\t}\n\t\treturn $DeleteRows;\n\t}", "public function delete_form_db($conn,$table,$condition_column,$condition_data,$userid){\r\n $query=\"DELETE FROM \".$table.\" WHERE \".$condition_column.\"= :data AND user_id= \".$userid;\r\n $get=$conn->prepare($query);\r\n $get->bindValue(':data', $condition_data);\r\n if($get->execute()){return true;}\r\n\r\n\r\n}", "function DeleteRows() {\n\t\tglobal $Language, $Security;\n\t\tif (!$Security->CanDelete()) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoDeletePermission\")); // No delete permission\n\t\t\treturn FALSE;\n\t\t}\n\t\t$DeleteRows = TRUE;\n\t\t$sSql = $this->SQL();\n\t\t$conn = &$this->Connection();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE) {\n\t\t\treturn FALSE;\n\t\t} elseif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // No record found\n\t\t\t$rs->Close();\n\t\t\treturn FALSE;\n\t\t}\n\t\t$rows = ($rs) ? $rs->GetRows() : array();\n\t\t$conn->BeginTrans();\n\n\t\t// Clone old rows\n\t\t$rsold = $rows;\n\t\tif ($rs)\n\t\t\t$rs->Close();\n\n\t\t// Call row deleting event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$DeleteRows = $this->Row_Deleting($row);\n\t\t\t\tif (!$DeleteRows) break;\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$sKey = \"\";\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$sThisKey = \"\";\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['id'];\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\t$DeleteRows = $this->Delete($row); // Delete\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($DeleteRows === FALSE)\n\t\t\t\t\tbreak;\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\n\t\t\t\t$sKey .= $sThisKey;\n\t\t\t}\n\t\t}\n\t\tif (!$DeleteRows) {\n\n\t\t\t// Set up error message\n\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t// Use the message, do nothing\n\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t} else {\n\t\t\t\t$this->setFailureMessage($Language->Phrase(\"DeleteCancelled\"));\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$conn->CommitTrans(); // Commit the changes\n\t\t} else {\n\t\t\t$conn->RollbackTrans(); // Rollback changes\n\t\t}\n\n\t\t// Call Row Deleted event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$this->Row_Deleted($row);\n\t\t\t}\n\t\t}\n\t\treturn $DeleteRows;\n\t}", "function delete()\n {\n if ($this->GET('sure')) {\n $function = basename($this->table->tablename()) . \"_onRowDelete\";\n if (function_exists($function)) {\n $function($this->table->data($this->GET('id')), &$this->table);\n }\n\n $this->table->delete($this->GET('id'));\n $this->table->write();\n $this->browse();\n return;\n }\n $this->displayHead();\n echo 'Do you really want to<br>delete row \\'' . $this->GET('id') . '\\'?<p>';\n echo '<a class=\"danger\" href=\"' . $this->SELF . '?method=delete&table=' . $this->table->tablename() . '&id=' . $this->GET('id') . '&sure=1\">Yes</a> | ';\n echo '<a href=\"' . $this->SELF . '?method=browse&table=' . $this->table->tablename() . '\">No</a>';\n }", "function DeleteRows() {\r\n\t\tglobal $conn, $Language, $Security, $rekeningju;\r\n\t\t$DeleteRows = TRUE;\r\n\t\t$sSql = $rekeningju->SQL();\r\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\r\n\t\t$rs = $conn->Execute($sSql);\r\n\t\t$conn->raiseErrorFn = '';\r\n\t\tif ($rs === FALSE) {\r\n\t\t\treturn FALSE;\r\n\t\t} elseif ($rs->EOF) {\r\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // No record found\r\n\t\t\t$rs->Close();\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\tif (!$Security->CanDelete()) {\r\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoDeletePermission\")); // No delete permission\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\r\n\t\t// Clone old rows\r\n\t\t$rsold = ($rs) ? $rs->GetRows() : array();\r\n\t\tif ($rs)\r\n\t\t\t$rs->Close();\r\n\r\n\t\t// Call row deleting event\r\n\t\tif ($DeleteRows) {\r\n\t\t\tforeach ($rsold as $row) {\r\n\t\t\t\t$DeleteRows = $rekeningju->Row_Deleting($row);\r\n\t\t\t\tif (!$DeleteRows) break;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($DeleteRows) {\r\n\t\t\t$sKey = \"\";\r\n\t\t\tforeach ($rsold as $row) {\r\n\t\t\t\t$sThisKey = \"\";\r\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= EW_COMPOSITE_KEY_SEPARATOR;\r\n\t\t\t\t$sThisKey .= $row['kode_otomatis'];\r\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\r\n\t\t\t\t$DeleteRows = $conn->Execute($rekeningju->DeleteSQL($row)); // Delete\r\n\t\t\t\t$conn->raiseErrorFn = '';\r\n\t\t\t\tif ($DeleteRows === FALSE)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\r\n\t\t\t\t$sKey .= $sThisKey;\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\t// Set up error message\r\n\t\t\tif ($rekeningju->CancelMessage <> \"\") {\r\n\t\t\t\t$this->setFailureMessage($rekeningju->CancelMessage);\r\n\t\t\t\t$rekeningju->CancelMessage = \"\";\r\n\t\t\t} else {\r\n\t\t\t\t$this->setFailureMessage($Language->Phrase(\"DeleteCancelled\"));\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($DeleteRows) {\r\n\t\t} else {\r\n\t\t}\r\n\r\n\t\t// Call Row Deleted event\r\n\t\tif ($DeleteRows) {\r\n\t\t\tforeach ($rsold as $row) {\r\n\t\t\t\t$rekeningju->Row_Deleted($row);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $DeleteRows;\r\n\t}", "public function deleteRow(Request $request)\n {\n $result=MyRow::where('id',$request->id)->delete();\n if ($result) echo 'Data Deleted';\n }", "function DeleteRows() {\n\t\tglobal $Language, $Security;\n\t\tif (!$Security->CanDelete()) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoDeletePermission\")); // No delete permission\n\t\t\treturn FALSE;\n\t\t}\n\t\t$DeleteRows = TRUE;\n\t\t$sSql = $this->SQL();\n\t\t$conn = &$this->Connection();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE) {\n\t\t\treturn FALSE;\n\t\t} elseif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // No record found\n\t\t\t$rs->Close();\n\t\t\treturn FALSE;\n\t\t}\n\t\t$rows = ($rs) ? $rs->GetRows() : array();\n\t\t$conn->BeginTrans();\n\n\t\t// Clone old rows\n\t\t$rsold = $rows;\n\t\tif ($rs)\n\t\t\t$rs->Close();\n\n\t\t// Call row deleting event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$DeleteRows = $this->Row_Deleting($row);\n\t\t\t\tif (!$DeleteRows) break;\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$sKey = \"\";\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$sThisKey = \"\";\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['row_id'];\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\t$DeleteRows = $this->Delete($row); // Delete\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($DeleteRows === FALSE)\n\t\t\t\t\tbreak;\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\n\t\t\t\t$sKey .= $sThisKey;\n\t\t\t}\n\t\t}\n\t\tif (!$DeleteRows) {\n\n\t\t\t// Set up error message\n\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t// Use the message, do nothing\n\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t} else {\n\t\t\t\t$this->setFailureMessage($Language->Phrase(\"DeleteCancelled\"));\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$conn->CommitTrans(); // Commit the changes\n\t\t} else {\n\t\t\t$conn->RollbackTrans(); // Rollback changes\n\t\t}\n\n\t\t// Call Row Deleted event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$this->Row_Deleted($row);\n\t\t\t}\n\t\t}\n\t\treturn $DeleteRows;\n\t}", "function delete()\r\n {\r\n $cids = JRequest::getVar( 'cid', array(0), 'post', 'array' );\r\n\r\n $row =& $this->getTable();\r\n\r\n if (count( $cids )) {\r\n foreach($cids as $cid) {\r\n if (!$row->delete( $cid )) {\r\n $this->setError( $row->getErrorMsg() );\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n }", "public function deleteData(){\n //buatlah query\n $sqlQuery = \"DELETE FROM \" . $this->t_name . \" WHERE id = ?\";\n\n //persiapkan stmt\n $stmt = $this->conn->prepare($sqlQuery);\n\n //cukup converte id\n $this->id=htmlspecialchars(strip_tags($this->id));\n\n //bind\n $stmt->bindParam(1,$this->id);\n\n //eksekusi\n if($stmt->execute()){\n return true;\n }\n return false;\n }", "public function executeDelete()\n {\n $valid = $this->hasRequiredParameters($this->requiredParams);\n if ($valid instanceof Frapi_Error) {\n return $valid;\n }\n \n return $this->toArray();\n }", "public function testValidateAndDelete() {\r\n\t\ttry {\r\n\t\t\t$postData = array();\r\n\t\t\t$this->ShopProductAttribute->validateAndDelete('invalidShopProductAttributeId', $postData);\r\n\t\t} catch (OutOfBoundsException $e) {\r\n\t\t\t$this->assertEqual($e->getMessage(), 'Invalid Shop Product Attribute');\r\n\t\t}\r\n\t\ttry {\r\n\t\t\t$postData = array(\r\n\t\t\t\t'ShopProductAttribute' => array(\r\n\t\t\t\t\t'confirm' => 0));\r\n\t\t\t$result = $this->ShopProductAttribute->validateAndDelete('shopproductattribute-1', $postData);\r\n\t\t} catch (Exception $e) {\r\n\t\t\t$this->assertEqual($e->getMessage(), 'You need to confirm to delete this Shop Product Attribute');\r\n\t\t}\r\n\r\n\t\t$postData = array(\r\n\t\t\t'ShopProductAttribute' => array(\r\n\t\t\t\t'confirm' => 1));\r\n\t\t$result = $this->ShopProductAttribute->validateAndDelete('shopproductattribute-1', $postData);\r\n\t\t$this->assertTrue($result);\r\n\t}", "function validate_user_delete(array $inputs, array &$form): bool\n{\n if (App::$db->getRowById('wall', $inputs['id'])['poster'] !== $_SESSION['email']) {\n $form['error'] = 'ERROR YOU\\'RE NOT ALLOWED TO DELETE THAT';\n return false;\n }\n\n return true;\n}", "public function checkIsValidForDelete() {\n $errors = false;\n $building = new BUILDING_Model($this->idBuilding);\n if (strlen(trim($this->idBuilding)) == 0) {\n $errors= \"Building identifier is mandatory\";\n }else if (strlen(trim($this->idBuilding)) < 5) {\n $errors = \"Building identifier can't be less than 5 characters\";\n }else if (strlen(trim($this->idBuilding)) > 5) {\n $errors = \"Building identifier can't be larger than 5 characters\";\n }else if(!preg_match('/[A-Z0-9]/', $this->idBuilding)){\n $errors = \"Building identifier format is invalid\";\n }else if(!$building->existsBuilding()){\n $errors = \"There isn't a building with that identifier\";\n }else if (strlen(trim($this->idFloor)) == 0) {\n $errors= \"Floor identifier is mandatory\";\n }else if (strlen(trim($this->idFloor)) < 2) {\n $errors = \"Floor identifier can't be less than 2 characters\";\n }else if (strlen(trim($this->idFloor)) > 2) {\n $errors = \"Floor identifier can't be larger than 2 characters\";\n }else if(!preg_match('/[A-Z0-9]/', $this->idFloor)){\n $errors = \"Floor identifier format is invalid\";\n }else if (!$this->existsFloor()) {\n $errors= \"There isn't a floor with that identifier in the building\";\n }\n return $errors;\n }", "private function Delete()\n {\n $return = false;\n $action = $this->Action();\n $table = $this->Table();\n $where = $this->Where();\n if($action && $table && Checker::isArray($where, false) && isset($where[Where::VALUES]))\n {\n $return[Where::QUERY] = \"$action FROM $table\".$where[Where::QUERY];\n $return[Where::VALUES] = $where[Where::VALUES];\n }\n return $return;\n }", "public function deleteValid($primary) {\t\n\t\tif(!empty($primary)){\n\t\t\tif(is_array($this -> _primary)){\n\t\t\t\t$primaryKey = current($this -> _primary);\n\t\t\t} else {\n\t\t\t\t$primaryKey = $this -> _primary;\n\t\t\t}\n\t\t\t$primary = is_numeric($primary) ? (float) $primary : $this -> quote($primary);\n\t\t\t$row = $this -> fetchRow($primaryKey . \"=\" . $primary);\n\t\t\t\n\t\t\tif(!is_null($row)){\n\t\t\t\treturn $row -> delete();\n\t\t\t} \n\t\t} \n\t\treturn false;\n\t\t\n\t}", "abstract public function validateData();", "function DeleteRows() {\r\n\t\tglobal $conn, $Language, $Security;\r\n\t\t$DeleteRows = TRUE;\r\n\t\t$sSql = $this->SQL();\r\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\r\n\t\t$rs = $conn->Execute($sSql);\r\n\t\t$conn->raiseErrorFn = '';\r\n\t\tif ($rs === FALSE) {\r\n\t\t\treturn FALSE;\r\n\t\t} elseif ($rs->EOF) {\r\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // No record found\r\n\t\t\t$rs->Close();\r\n\t\t\treturn FALSE;\r\n\t\t} else {\r\n\t\t\t$this->LoadRowValues($rs); // Load row values\r\n\t\t}\r\n\t\tif (!$Security->CanDelete()) {\r\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoDeletePermission\")); // No delete permission\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\t$conn->BeginTrans();\r\n\r\n\t\t// Clone old rows\r\n\t\t$rsold = ($rs) ? $rs->GetRows() : array();\r\n\t\tif ($rs)\r\n\t\t\t$rs->Close();\r\n\r\n\t\t// Call row deleting event\r\n\t\tif ($DeleteRows) {\r\n\t\t\tforeach ($rsold as $row) {\r\n\t\t\t\t$DeleteRows = $this->Row_Deleting($row);\r\n\t\t\t\tif (!$DeleteRows) break;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($DeleteRows) {\r\n\t\t\t$sKey = \"\";\r\n\t\t\tforeach ($rsold as $row) {\r\n\t\t\t\t$sThisKey = \"\";\r\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\r\n\t\t\t\t$sThisKey .= $row['identries'];\r\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\r\n\t\t\t\t$sThisKey .= $row['id'];\r\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\r\n\t\t\t\t$DeleteRows = $this->Delete($row); // Delete\r\n\t\t\t\t$conn->raiseErrorFn = '';\r\n\t\t\t\tif ($DeleteRows === FALSE)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\r\n\t\t\t\t$sKey .= $sThisKey;\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\t// Set up error message\r\n\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\r\n\r\n\t\t\t\t// Use the message, do nothing\r\n\t\t\t} elseif ($this->CancelMessage <> \"\") {\r\n\t\t\t\t$this->setFailureMessage($this->CancelMessage);\r\n\t\t\t\t$this->CancelMessage = \"\";\r\n\t\t\t} else {\r\n\t\t\t\t$this->setFailureMessage($Language->Phrase(\"DeleteCancelled\"));\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($DeleteRows) {\r\n\t\t\t$conn->CommitTrans(); // Commit the changes\r\n\t\t} else {\r\n\t\t\t$conn->RollbackTrans(); // Rollback changes\r\n\t\t}\r\n\r\n\t\t// Call Row Deleted event\r\n\t\tif ($DeleteRows) {\r\n\t\t\tforeach ($rsold as $row) {\r\n\t\t\t\t$this->Row_Deleted($row);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $DeleteRows;\r\n\t}", "public function testDeleteValidUser() {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"user\");\n\n\t\t// create a new User and insert to into mySQL\n\t\t$user = new User(null, $this->VALID_SALT, $this->VALID_HASH, $this->VALID_EMAIL, $this->VALID_NAME);\n\t\t$user->insert($this->getPDO());\n\n\t\t// delete the User from mySQL\n\t\t$this->assertSame($numRows + 1, $this->getConnection()->getRowCount(\"user\"));\n\t\t$user->delete($this->getPDO());\n\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$pdoUser = User::getUserByUserId($this->getPDO(), $user->getUserId());\n\t\t$this->assertNull($pdoUser);\n\t\t$this->assertSame($numRows, $this->getConnection()->getRowCount(\"user\"));\n\t}", "public function deleteRow($postArray,$editId,$tableName)\n{\n $retString='';\n \n $retString=$this->deletePreProcessing($postArray,$editId);\n \n $sql=\"delete from $tableName where id=$editId\";\n \n $ret=$this->updateTableData($sql,false);\n \n}" ]
[ "0.73021", "0.6691338", "0.6319402", "0.63003045", "0.6299784", "0.62914497", "0.623044", "0.62237966", "0.6204081", "0.6192909", "0.61627024", "0.6136963", "0.6127818", "0.61245763", "0.6115297", "0.61081517", "0.6096627", "0.6093777", "0.6082443", "0.60793763", "0.60744476", "0.60696393", "0.6065683", "0.60593873", "0.60591304", "0.6050804", "0.604863", "0.6042101", "0.602392", "0.6017279" ]
0.6700755
1
Prepare conditions attribute value
protected function prepareAttributeValue($conditions) { $condition = $this->conditionFactory->create($conditions['type']); $attributes = $condition->loadAttributeOptions()->getAttributeOption(); if (isset($attributes[$conditions['attribute']])) { $condition->setAttribute($conditions['attribute']); if (in_array($condition->getInputType(), ['select', 'multiselect'])) { // reload options flag $condition->unsetData('value_select_options'); $condition->unsetData('value_option'); $options = $condition->getValueOption(); if (is_array($conditions['value'])) { foreach ($conditions['value'] as $key => $value) { $optionId = array_search($value, $options); $conditions['value'][$key] = $optionId; } } else { $optionId = array_search($conditions['value'], $options); $conditions['value'] = $optionId; } } } return $conditions['value']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function prepareAttributeValue($conditions)\n {\n $condition = $this->conditionFactory->create($conditions['type']);\n $attributes = $condition->loadAttributeOptions()->getAttributeOption();\n\n if (isset($attributes[$conditions['attribute']])) {\n $condition->setAttribute($conditions['attribute']);\n if (in_array($condition->getInputType(), ['select', 'multiselect'])) {\n // reload options flag\n $condition->unsetData('value_select_options');\n $condition->unsetData('value_option');\n\n $options = $condition->getValueOption();\n if (is_array($conditions['value'])) {\n foreach ($conditions['value'] as $key => $value) {\n $conditions['value'][$key] = $options[$value];\n }\n } else {\n $conditions['value'] = $options[$conditions['value']];\n }\n }\n }\n return $conditions['value'];\n }", "protected function prepareAttributeValue($conditions)\n {\n $condition = $this->conditionFactory->create($conditions['type']);\n $attributes = $condition->loadAttributeOptions()->getAttributeOption();\n\n if (isset($attributes[$conditions['attribute']])) {\n $condition->setAttribute($conditions['attribute']);\n if (in_array($condition->getInputType(), ['select', 'multiselect'])) {\n // reload options flag\n $condition->unsetData('value_select_options');\n $condition->unsetData('value_option');\n\n $options = $condition->getValueOption();\n if (is_array($conditions['value'])) {\n foreach ($conditions['value'] as $key => $value) {\n $conditions['value'][$key] = $options[$value];\n }\n } else {\n $conditions['value'] = $options[$conditions['value']];\n }\n }\n }\n return $conditions['value'];\n }", "public function setConditionsAttribute($value)\n {\n $this->attributes['conditions'] = json_encode($value, JSON_UNESCAPED_UNICODE);\n }", "protected function setConditions() {\r\n if( count($this->sqlConditions) ) {\r\n $this->sql .= ' WHERE ' . $this->sqlStrConditions;\r\n }\r\n }", "protected function _prepareCondition($attribute, $value)\n {\n return $this->_getResource()->prepareCondition($attribute, $value, $this->getProductCollection());\n }", "public function buildConditionQuery()\n\t\t\t{\n\t\t\t\t$this->sql_condition = ' user_id='.$this->CFG['user']['user_id'];\n\t\t\t}", "public function flexformConditionStringDataProvider() {}", "public function makeConditions($attributes, $values)\n {\n if (!$attributes) return '';\n $parts = preg_split('/(And|Or)/i', $attributes, NULL, PREG_SPLIT_DELIM_CAPTURE);\n $condition = '';\n\n $j = 0;\n foreach($parts as $part) {\n if ($part == 'And') {\n $condition .= ' AND ';\n } elseif ($part == 'Or') {\n $condition .= ' OR ';\n } else {\n $part = strtolower($part);\n if (($j < count($values)) && (!is_null($values[$j]))) {\n $bind = is_array($values[$j]) ? ' IN(?)' : '=?';\n } else {\n $bind = ' IS NULL';\n }\n $condition .= self::quote($part) . $bind;\n $j++;\n }\n }\n return $condition;\n }", "public function addFilters($values)\n {\n $attributes = $this->getAttributes();\n $allConditions = [];\n\n foreach ($attributes as $attribute) {\n /* @var $attribute Attribute */\n if (!isset($values[$attribute->getAttributeCode()])) {\n continue;\n }\n $value = $values[$attribute->getAttributeCode()];\n $preparedSearchValue = $this->getPreparedSearchCriteria($attribute, $value);\n if (false === $preparedSearchValue) {\n continue;\n }\n $this->addSearchCriteria($attribute, $preparedSearchValue);\n\n if ($attribute->getAttributeCode() == 'price') {\n $rate = 1;\n $store = $this->_storeManager->getStore();\n $currency = $store->getCurrentCurrencyCode();\n if ($currency != $store->getBaseCurrencyCode()) {\n $rate = $store->getBaseCurrency()->getRate($currency);\n }\n\n $value['from'] = (isset($value['from']) && is_numeric($value['from']))\n ? (float)$value['from'] / $rate\n : '';\n $value['to'] = (isset($value['to']) && is_numeric($value['to']))\n ? (float)$value['to'] / $rate\n : '';\n }\n\n if ($attribute->getBackendType() == 'datetime') {\n $value['from'] = (isset($value['from']) && !empty($value['from']))\n ? date('Y-m-d\\TH:i:s\\Z', strtotime($value['from']))\n : '';\n $value['to'] = (isset($value['to']) && !empty($value['to']))\n ? date('Y-m-d\\TH:i:s\\Z', strtotime($value['to']))\n : '';\n }\n $condition = $this->_getResource()->prepareCondition(\n $attribute,\n $value,\n $this->getProductCollection()\n );\n if ($condition === false) {\n continue;\n }\n\n $table = $attribute->getBackend()->getTable();\n if ($attribute->getBackendType() == 'static') {\n $attributeId = $attribute->getAttributeCode();\n } else {\n $attributeId = $attribute->getId();\n }\n $allConditions[$table][$attributeId] = $condition;\n }\n //if ($allConditions)\n if ($allConditions || (isset($values['cat']) && is_numeric($values['cat'])) ) {\n $this->_registry->register('advanced_search_conditions', $allConditions);\n $this->getProductCollection()->addFieldsToFilter($allConditions);\n } else {\n throw new LocalizedException(__('Please specify at least one search term.'));\n }\n\n return $this;\n }", "private function processConditions($conditions)\n\t{\n\t\tif (!is_array($conditions))\n\t\t\treturn $conditions;\n\t\telse\n\t\t throw new \\GO\\Base\\Exception\\Database('condition should be a string');\n\t}", "protected function _buildCondition(){\n \t$aryCondition = array();\n \t\n \tif(!empty($this->postData)){\n \t\t //search\n\t\t\t \t\t\t\n\t\t\tif($this->postData['title']!=''){\n \t\t \t$aryCondition['like'][] = array(\"mt.title\"=>$this->postData['title']);\n \t\t }\t\t\t\n\t\t\tif($this->postData['page']!=''){\n \t\t \t$aryCondition['and'][] = array(\"mt.page\"=>$this->postData['page']);\n \t\t }\t\t\t\n\t\t\tif($this->postData['code']!=''){\n \t\t \t$aryCondition['like'][] = array(\"mt.code\"=>$this->postData['code']);\n \t\t }\t\t\t\n\t\t\tif($this->postData['status']!=''){\n \t\t \t$aryCondition['and'][] = array(\"mt.status\"=>$this->postData['status']);\n \t\t }\t\t\t\n\n \t}\n \treturn $aryCondition;\n }", "function get_filter_condition($conditional_symbol) {\n //explicitly prevent filters from beign automatically applied to the report query\n return '';\n }", "public function conditionStringDataProvider() {}", "public function conditionsProvider()\n {\n return [[[new \\Urbania\\AppleNews\\Format\\Condition()]]];\n }", "public function conditionsProvider()\n {\n return [[[new \\Urbania\\AppleNews\\Format\\Condition()]]];\n }", "protected function createCondition($values) {\n $definition = $this->typedDataManager->createDataDefinition('condition');\n $values = $values + ['operator' => '='];\n return $this->typedDataManager->create($definition, $values);\n }", "static function prepare_attr_value ($text) {\n\t\tif (is_array($text)) {\n\t\t\tforeach ($text as &$t) {\n\t\t\t\t$t = static::prepare_attr_value($t);\n\t\t\t}\n\t\t\treturn $text;\n\t\t}\n\t\treturn strtr(\n\t\t\t$text,\n\t\t\t[\n\t\t\t\t'&' => '&amp;',\n\t\t\t\t'\"' => '&quot;',\n\t\t\t\t'\\'' => '&apos;',\n\t\t\t\t'<' => '&lt;',\n\t\t\t\t'>' => '&gt;'\n\t\t\t]\n\t\t);\n\t}", "public function getConditionsHook()\n\t{\n\t\t$conditions = array();\n\t\t\n\t\t$conditions['select'] = '`bid` AS id, `cid`, `type`, `name`, `alias`, `imptotal`, `impmade`, '\n\t\t\t\t\t\t\t\t\t\t\t\t\t.'`clicks`, `imageurl`, `clickurl`, `date`, `showBanner` AS state, `checked_out`, '\n\t\t\t\t\t\t\t\t\t\t\t\t\t.'`checked_out_time`, `editor`, `custombannercode`, `catid`, `description`, '\n\t\t\t\t\t\t\t\t\t\t\t\t\t.'`sticky`, `ordering`, `publish_up`, `publish_down`, `tags`, `params`'\t;\n\t\t\n\t\t$conditions['where'] = array();\n\t\t\n\t\treturn $conditions;\n\t}", "function condition_values() {\n return array();\n }", "public function getCondition() {\n\n \t$condition = array();\n \t$this->getQueryString(\"keyword\", $condition);\n \t$this->getQueryString(\"activityId\", $condition);\n \t$this->getQueryString(\"activityIds\", $condition);\n \t$this->getQueryString(\"activityType\", $condition);\n $this->getQueryString(\"state\", $condition);\n $this->getQueryString(\"orderDateStart\", $condition);\n $this->getQueryString(\"orderDateEnd\", $condition);\n $this->getQueryString(\"deliveryDateStart\", $condition);\n $this->getQueryString(\"deliveryDateEnd\", $condition);\n $this->getQueryString(\"serial\", $condition);\n $this->getQueryString(\"consumerId\", $condition);\n $this->getQueryString(\"payDateTimeStart\", $condition);\n $this->getQueryString(\"payDateTimeEnd\", $condition);\n $this->getQueryString(\"productId\", $condition);\n $this->getQueryString(\"deliveryId\", $condition);\n $this->getQueryString(\"productArray\", $condition);\n \n \treturn $condition;\n }", "protected function getAttributeSetConditions($conditions) \n\t{\n\t\t$categories = explode(\",\",$conditions);\n\t\t$attributeSetConds = array();\n\t\t$i=1;\n\t\tforeach($categories as $category):\n\t\t\t$attributeSetId = $this->_getAttributeSetId(trim($category));//Get Attribute Set Id\n\t\t\t$attributeSetConds[\"1--1--\".$i] = array(\n\t\t\t\t\t\"type\" => \"Magento\\SalesRule\\Model\\Rule\\Condition\\Product\",\n\t\t\t\t\t\"attribute\" => \"attribute_set_id\",\n\t\t\t\t\t\"operator\" => \"==\",\n\t\t\t\t\t\"value\" => $attributeSetId\n\t\t\t\t);\n\t\t\t$i++;\n\t\tendforeach;\n\t\treturn $attributeSetConds;\n\t}", "private function _parseBFilterParam()\n\t{\n $map = array('a' => 'attribute', 'm' => 'manufacturer', 's' => 'stock_status', 'f' => 'filter', 'o' => 'option', 'r' => 'rating', 'c' => 'category');\n \n if (!isset($this->request->get['bfilter'])) {\n \n return;\n }\n\t\t$bfilter = $this->request->get['bfilter'];\n\n\t\t$params = explode(';', $bfilter);\n \n\t\tforeach ($params as $param) \n {\n if (!empty($param)) \n {\n $p = explode(':', $param);\n $pName = $p[0];\n $pValue = $p[1];\n if ($pName === 'price') \n {\n $p = explode('-', $pValue);\n if ((int)$p[0] > 0 || (int)$p[1] > 0) {\n $this->conditions->price = new stdClass();\n $this->conditions->price->min = null;\n $this->conditions->price->max = null;\n $this->conditions->price->inputMin = null;\n $this->conditions->price->inputMax = null;\n }\n if ((int)$p[0] > 0) {\n $this->conditions->price->min = $this->currency->convert($p[0], $this->currency->getCode(), $this->config->get('config_currency'));\n $this->conditions->price->inputMin = $p[0];\n }\n if ((int)$p[1] > 0) {\n $this->conditions->price->max = $this->currency->convert($p[1], $this->currency->getCode(), $this->config->get('config_currency'));\n $this->conditions->price->inputMax = $p[1];\n }\n } \n elseif ($pName === 'rating') \n {\n $this->conditions->rating = explode(',', $pValue);\n } \n elseif ($pName === 'search')\n {\n $this->conditions->search = $pValue;\n $this->searchNameString = $pValue;\n $this->searchTagString = $pValue;\n $this->searchDescriptionString = $pValue;\n }\n else \n {\n $type = $map[substr($pName, 0, 1)];\n $groupId = (int)substr($pName, 1);\n if ($type) {\n if (strpos($pValue, '-') !== false) {\n $p = explode('-', $pValue);\n if (isset($p[0]) && isset($p[1])) {\n $this->conditions->{$type}[$groupId] = array('min' => $p[0], 'max' => $p[1]);\n }\n } else {\n $this->conditions->{$type}[$groupId] = explode(',', $pValue);\n }\n\n if ($type !== 'rating') {\n $type = strtoupper($type);\n if (!isset($this->aggregate[$type])) {\n $this->aggregate[$type] = array();\n }\n if (strpos($pValue, '-') !== false) {\n $p = explode('-', $pValue);\n $range = $this->_getSliderIntermediateValues($type, $groupId, $p[0], $p[1]);\n if (!empty($range)) {\n $this->aggregate[$type][$groupId] = $range;\n }\n } else {\n $this->aggregate[$type][$groupId] = explode(',', $pValue);\n }\n }\n }\n }\n }\n\t\t}\n\t}", "function add_condition($item) {\n\t\treturn $this->conditions[$this->prefix.$item['id']] = $item['condition'];\n\t}", "protected function get_conditions( ) {\n// to decode all conditions. To learn more about weather condition codes, visit section\n// 12.6.8 - Present Weather Group of the Federal Meteorological Handbook No. 1 at\n// www.nws.noaa.gov/oso/oso1/oso12/fmh1/fmh1ch12.htm\n if (preg_match('#^(-|\\+|VC)?(NSW|TS|SH|FZ|BL|DR|MI|BC|PR|RA|DZ|SN|SG|GR|GS|PE|IC|UP|BR|FG|FU|VA|DU|SA|HZ|PY|PO|SQ|FC|SS|DS|WS//)+$#',$this->current_group_text,$pieces)) {\n $this->varConcatenate($this->wxInfo['ITEMS'][$this->tend],'CODE_CONDITIONS', $this->current_group_text);\n if (!isset($this->wxInfo['ITEMS'][$this->tend]['CONDITIONS'])) {\n//$this->wxInfo['ITEMS'][$this->tend]['CONDITIONS'] = '';\n $join = '';\n }\n else {\n $join = ', ';\n }\n if (substr($this->current_group_text,0,1) == '-') {\n $prefix = $this->get_i18nCondition('-');\n $this->current_group_text = substr($this->current_group_text,1);\n }\n elseif (substr($this->current_group_text,0,1) == '+') {\n $prefix = $this->get_i18nCondition('+');\n $this->current_group_text = substr($this->current_group_text,1);\n }\n else $prefix = ''; // moderate conditions have no descriptor\n while ($code = substr($this->current_group_text,0,2)) {\n if (!isset($this->wxInfo['ITEMS'][$this->tend]['CONDITIONS'])) {\n $this->wxInfo['ITEMS'][$this->tend]['CONDITIONS'] = '';\n }\n $this->wxInfo['ITEMS'][$this->tend]['CONDITIONS'] .= $join . $this->get_i18nCondition($code) . ' ';\n $this->current_group_text = substr($this->current_group_text,2);\n }\n if (strlen($prefix)>0) {\n $this->wxInfo['ITEMS'][$this->tend]['CONDITIONS'] .= $prefix ;\n }\n $this->current_ptr++;\n }\n else {\n if (isset($this->wxInfo['ITEMS'][$this->tend]['CONDITIONS'])) {\n//$this->wxInfo['ITEMS'][$this->tend]['CONDITIONS'] = '';\n $this->wxInfo['ITEMS'][$this->tend]['CONDITIONS'] = trim($this->wxInfo['ITEMS'][$this->tend]['CONDITIONS']);\n if ($this->wxInfo['ITEMS'][$this->tend]['CONDITIONS']=='') unset($this->wxInfo['ITEMS'][$this->tend]['CONDITIONS']);\n }\n $this->current_group++;\n }\n }", "private function formatCondition(array $cond)\n {\n if (empty($cond)) {\n return false;\n }\n $ret = $this->formatWhere($cond);\n if ($ret === false) {\n return false;\n }\n $str_sql = isset($ret['bind_where_sql'][self::AND_OP]) ? implode(' ' . self::AND_OP . ' ', $ret['bind_where_sql'][self::AND_OP]) : '';\n if (isset($ret['bind_where_sql'][self::OR_OP])) {\n $or_sql = implode(\" \" . self::OR_OP . \" \", $ret['bind_where_sql'][self::OR_OP]);\n $str_sql .= $str_sql ? \" \" . self::AND_OP . \" ({$or_sql})\" : $or_sql;\n }\n return [\n 'where_sql' => $str_sql,\n 'where_values' => $ret['bind_where_values']\n ];\n }", "protected function getAttributeSetActions($conditions) \n\t{\n\t\t$categories = explode(\",\",$conditions);\n\t\t$attributeSetConds = array();\n\t\t$i=1;//increase this value if condition is getting replaced\n\t\tforeach($categories as $category):\n\t\t\t$attributeSetId = $this->_getAttributeSetId(trim($category));\n\t\t\t$attributeSetConds[\"1--1--\".$i] = array(\n\t\t\t\t\t\"type\" => \"Magento\\SalesRule\\Model\\Rule\\Condition\\Product\",\n\t\t\t\t\t\"attribute\" => \"attribute_set_id\",\n\t\t\t\t\t\"operator\" => \"==\",\n\t\t\t\t\t\"value\" => $attributeSetId\n\t\t\t\t);\n\t\t\t$i++;\n\t\tendforeach;\n\t\treturn $attributeSetConds;\n\t}", "public function addCondition($attribute, $values, $operator = ComparisonOperator::EQ);", "public function setConditions($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->conditions = $arr;\n\n return $this;\n }", "public function condition()\n {\n if (!$this->condition) {\n $this->condition = array();\n foreach (monsterToCondition::select('ctype', 'condition')->where('mid', '=', $this->id)->get() as $r) {\n $this->condition[] = $r->condition;\n };\n }\n return $this->condition;\n }", "public function buildConditionAction()\n {\n /** @var Form $form */\n $form = $this->formRepository->findByIdentifier($this->powermailArguments['mail']['form']);\n $this->setTextFields($form);\n\n /** @var ConditionContainer $conditionContainer */\n $conditionContainer = $this->containerRepository->findOneByForm($form);\n if ($conditionContainer !== null) {\n $arguments = $conditionContainer->applyConditions($form, $this->powermailArguments);\n SessionUtility::setSession($arguments);\n ArrayUtility::unsetByKeys($arguments, ['backup', 'field']);\n return json_encode($arguments);\n }\n return null;\n }" ]
[ "0.65336376", "0.65336376", "0.63051194", "0.59452623", "0.58800155", "0.58586246", "0.5798726", "0.5718138", "0.5715725", "0.5703869", "0.56777", "0.5596623", "0.5591259", "0.5584627", "0.5584627", "0.554995", "0.554842", "0.55405974", "0.553837", "0.5503895", "0.5485584", "0.54835397", "0.54502106", "0.54397184", "0.54393727", "0.5391314", "0.5380555", "0.5368163", "0.5360645", "0.53593326" ]
0.6552558
0
Prepare actions attribute value
protected function prepareActionAttributeValue($actions) { $condition = $this->actionFactory->create($actions['type']); $attributes = $condition->loadAttributeOptions()->getAttributeOption(); if (isset($attributes[$actions['attribute']])) { $condition->setAttribute($actions['attribute']); if (in_array($condition->getInputType(), ['select', 'multiselect'])) { // reload options flag $condition->unsetData('value_select_options'); $condition->unsetData('value_option'); $options = $condition->getValueOption(); if (is_array($actions['value'])) { foreach ($actions['value'] as $key => $value) { $optionId = array_search($value, $options); $actions['value'][$key] = $optionId; } } else { $optionId = array_search($actions['value'], $options); $actions['value'] = $optionId; } } } return $actions['value']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function prepareActionAttributeValue($actions)\n {\n $condition = $this->actionFactory->create($actions['type']);\n $attributes = $condition->loadAttributeOptions()->getAttributeOption();\n\n if (isset($attributes[$actions['attribute']])) {\n $condition->setAttribute($actions['attribute']);\n if (in_array($condition->getInputType(), ['select', 'multiselect'])) {\n // reload options flag\n $condition->unsetData('value_select_options');\n $condition->unsetData('value_option');\n\n $options = $condition->getValueOption();\n if (is_array($actions['value'])) {\n foreach ($actions['value'] as $key => $value) {\n $actions['value'][$key] = $options[$value];\n }\n } else {\n $actions['value'] = $options[$actions['value']];\n }\n }\n }\n return $actions['value'];\n }", "private function setAction()\n\t\t{\n\t\t\t$this->_action = ($this->_separetor[2]);\n\t\t}", "static function get_action_parameter()\r\n {\r\n return self :: PARAM_ACTION;\r\n }", "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 }", "protected function setActionName() {\n return NULL;\n }", "protected function getCommandControllerActionField() {}", "public function prepare()\n {\n parent::prepare();\n\n $this->_data['config']['actions'] = [\n [\n 'actionName' => 'reset',\n 'targetName' => '${ $.name }',\n 'params' => [\n json_encode($this->getRobotsDefaultCustomInstructions())\n ]\n ]\n ];\n }", "static function get_action_parameter()\r\n {\r\n return self :: PARAM_USER_RIGHT_ACTION;\r\n }", "function set_actions_data( $raw_actions_data ) {\n\t\t$actions_data = array_map( [ $this, 'sanitize_action_fields' ], $raw_actions_data );\n\t\t// remove empty values from actions array\n\t\t$actions_data = array_filter( $actions_data );\n\t\t$this->update_meta( 'actions', $actions_data );\n\t\tunset( $this->actions );\n\t}", "public function getActionParameter(){\n return $this->actionParameter;\n }", "private function normalizeAction($raw)\n {\n $action = array();\n $action['id'] = strval($raw->Name);\n $action['appId'] = $this->config->application->appId;\n foreach($raw->Attribute as $item)\n {\n $name = (string)$item->Name;\n $value = (string)$item->Value;\n $action[$name] = $value;\n }\n return $action;\n }", "public function getMassActionValues() {\n return '';\n }", "static function get_action_parameter()\r\n {\r\n return ComplexDisplay :: PARAM_DISPLAY_ACTION;\r\n }", "public function setAction($str);", "function get_bulk_actions() {\n\t\t//bulk action combo box parameter\n\t\t//if you want to add some more value to bulk action parameter then push key value set in below array\n\t\t$actions = array();\n\t\treturn $actions;\n }", "function map_action($action) {\n return $action . '_action';\n }", "public function setup_actions() {}", "protected function prepareItemActions()\n {\n if (!empty($this->_actions)) {\n return;\n }\n \n $currentType = FormUtil::getPassedValue('type', 'user', 'GETPOST', FILTER_SANITIZE_STRING);\n $currentFunc = FormUtil::getPassedValue('func', 'main', 'GETPOST', FILTER_SANITIZE_STRING);\n $dom = ZLanguage::getModuleDomain('MUTicket');\n if ($currentType == 'admin') {\n if (in_array($currentFunc, array('main', 'view'))) {\n /* $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'display', 'arguments' => array('ot' => 'currentState', 'id' => $this['id'])),\n 'icon' => 'preview',\n 'linkTitle' => __('Open preview page', $dom),\n 'linkText' => __('Preview', $dom)\n );*/\n $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'display', 'arguments' => array('ot' => 'currentState', 'id' => $this['id'])),\n 'icon' => 'display',\n 'linkTitle' => str_replace('\"', '', $this['title']),\n 'linkText' => __('Details', $dom)\n );\n }\n if (in_array($currentFunc, array('main', 'view', 'display'))) {\n $component = 'MUTicket:CurrentState:';\n $instance = $this->id . '::';\n if (SecurityUtil::checkPermission($component, $instance, ACCESS_EDIT)) {\n $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'edit', 'arguments' => array('ot' => 'currentState', 'id' => $this['id'])),\n 'icon' => 'edit',\n 'linkTitle' => __('Edit', $dom),\n 'linkText' => __('Edit', $dom)\n );\n /* $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'edit', 'arguments' => array('ot' => 'currentState', 'astemplate' => $this['id'])),\n 'icon' => 'saveas',\n 'linkTitle' => __('Reuse for new item', $dom),\n 'linkText' => __('Reuse', $dom)\n );*/\n }\n if (SecurityUtil::checkPermission($component, $instance, ACCESS_DELETE)) {\n $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'delete', 'arguments' => array('ot' => 'currentState', 'id' => $this['id'])),\n 'icon' => 'delete',\n 'linkTitle' => __('Delete', $dom),\n 'linkText' => __('Delete', $dom)\n );\n }\n }\n if ($currentFunc == 'display') {\n $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'view', 'arguments' => array('ot' => 'currentState')),\n 'icon' => 'back',\n 'linkTitle' => __('Back to overview', $dom),\n 'linkText' => __('Back to overview', $dom)\n );\n }\n }\n if ($currentType == 'user') {\n if (in_array($currentFunc, array('main', 'view'))) {\n $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'display', 'arguments' => array('ot' => 'currentState', 'id' => $this['id'])),\n 'icon' => 'display',\n 'linkTitle' => str_replace('\"', '', $this['title']),\n 'linkText' => __('Details', $dom)\n );\n }\n if (in_array($currentFunc, array('main', 'view', 'display'))) {\n $component = 'MUTicket:CurrentState:';\n $instance = $this->id . '::';\n if (SecurityUtil::checkPermission($component, $instance, ACCESS_EDIT)) {\n $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'edit', 'arguments' => array('ot' => 'currentState', 'id' => $this['id'])),\n 'icon' => 'edit',\n 'linkTitle' => __('Edit', $dom),\n 'linkText' => __('Edit', $dom)\n );\n /* $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'edit', 'arguments' => array('ot' => 'currentState', 'astemplate' => $this['id'])),\n 'icon' => 'saveas',\n 'linkTitle' => __('Reuse for new item', $dom),\n 'linkText' => __('Reuse', $dom)\n );*/\n }\n if (SecurityUtil::checkPermission($component, $instance, ACCESS_DELETE)) {\n $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'delete', 'arguments' => array('ot' => 'currentState', 'id' => $this['id'])),\n 'icon' => 'delete',\n 'linkTitle' => __('Delete', $dom),\n 'linkText' => __('Delete', $dom)\n );\n }\n }\n if ($currentFunc == 'display') {\n $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'view', 'arguments' => array('ot' => 'currentState')),\n 'icon' => 'back',\n 'linkTitle' => __('Back to overview', $dom),\n 'linkText' => __('Back to overview', $dom)\n );\n }\n }\n }", "protected function getCommandControllerActionDescriptionField() {}", "function capture_customize_post_value_set_actions() {\n\t\t$action = current_action();\n\t\t$args = func_get_args();\n\t\t$this->captured_customize_post_value_set_actions[] = compact( 'action', 'args' );\n\t}", "function _get_action()\n {\n $retval = preg_quote($this->object->param('action'), '/');\n $retval = strtolower(preg_replace(\"/[^\\\\w]/\", '_', $retval));\n return preg_replace(\"/_{2,}/\", \"_\", $retval) . '_action';\n }", "private function get_action() {\n\t\treturn $this->action;\n\t}", "private function get_action() {\n\t\treturn $this->action;\n\t}", "private function get_action() {\n\t\treturn $this->action;\n\t}", "public function get_actions() {\n $actions = parent::get_actions();\n $assignaction = new deepsight_action_usersetuser_assign($this->DB, 'usersetuserassign');\n $assignaction->endpoint = (strpos($this->endpoint, '?') !== false)\n ? $this->endpoint.'&m=action' : $this->endpoint.'?m=action';\n array_unshift($actions, $assignaction);\n return $actions;\n }", "function setVars($action){\n $id = trim(filter_input($action, 'id'));\n $text = trim(filter_input($action, 'text'));\n $author = trim(filter_input($action, 'author'));\n $authorId = trim(filter_input($action, 'authorId'));\n $category = trim(filter_input($action, 'category'));\n $categoryId = trim(filter_input($action, 'categoryId'));\n $limit = trim(filter_input($action, 'limit'));\n $random = trim(filter_input($action, 'random'));\n $data = array(\"id\"=>$id, \"text\"=>$text,\n \"author\"=>$author, \"authorId\"=>$authorId,\n \"category\"=>$category, \"categoryId\"=>$categoryId,\n \"limit\"=>$limit, \"random\"=>$random);\n return $data;\n }", "protected function beforeValidate()\n {\n $this->actions = !empty($this->actions) ? implode(',', $this->actions) : '';\n return parent::beforeValidate();\n }", "public function getActionName(){\n return $this->actionName;\n }", "protected function _prepareColumns()\n {\n $result = parent::_prepareColumns();\n $column = $this->getColumn('action');\n if (!$column) {\n return $result;\n }\n $data = $column->getData();\n $data['actions'][0]['url'] = array('base' => 'adminhtml/sales_order/view');\n $column->setData($data);\n return $result;\n }", "public function getActionsAttribute()\n {\n return [\n 'id' => $this->id,\n 'cancel' => $this->concept == 'PENDIENTE',\n 'approved' => $this->concept == 'APROBADO',\n 'next' => __('app.selects.project.concept_next.' . $this->concept),\n ];\n }" ]
[ "0.69672364", "0.6375995", "0.6265252", "0.60958993", "0.599421", "0.59652597", "0.59637576", "0.59184337", "0.58816284", "0.58715135", "0.5850302", "0.5815708", "0.578759", "0.57814676", "0.57397443", "0.5704639", "0.5695379", "0.5673382", "0.5672905", "0.5671205", "0.5649011", "0.56444395", "0.56444395", "0.56444395", "0.56172043", "0.56082004", "0.56023246", "0.55956", "0.5559099", "0.55560064" ]
0.7000416
0
Get QuestString value with default value if querystring is not set
function GetQueryString($name, $default="") { return ValidRequiredQueryString($name) ? $_GET[$name] : $default; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_query_var($query_var, $default_value = '')\n {\n }", "public function get($query_var, $default_value = '')\n {\n }", "function get_query_str_value($name) {\n\n return (array_key_exists($name, $_GET) ? $_GET[$name] : null);\n}", "public function query_string($default = '', $xss_clean = null)\n\t{\n\t\t$query_string = $this->server('QUERY_STRING', $xss_clean);\n\t\treturn ($query_string) ? $query_string : $default;\n\t}", "function get_query_string($key) {\n $val = null;\n if (!empty($_GET[$key])) {\n $val = $_GET[$key];\n }\n return $val;\n}", "private function parseQueryString()\n {\n $queryString = isset($_GET['q']) ? $_GET['q'] : false;\n return $queryString;\n }", "public function get_query_arg( $name ) {\n\t\tglobal $taxnow, $typenow;\n\t\t$value = '';\n\t\t$url_args = wp_parse_args( wp_parse_url( wp_get_referer(), PHP_URL_QUERY ) );\n\t\t// Get the value of an arbitrary post argument.\n\t\t// @todo We are suppressing the need for a nonce check, which means this whole thing likely needs a rewrite.\n\t\t$post_arg_val = ! empty( $_POST[ $name ] ) ? sanitize_text_field( wp_unslash( $_POST[ $name ] ) ) : null; // @codingStandardsIgnoreLine\n\n\t\tswitch ( true ) {\n\t\t\tcase ( ! empty( get_query_var( $name ) ) ):\n\t\t\t\t$value = get_query_var( $name );\n\t\t\t\tbreak;\n\t\t\t// If the query arg isn't set. Check POST and GET requests.\n\t\t\tcase ( ! empty( $post_arg_val ) ):\n\t\t\t\t// Verify nonce here.\n\t\t\t\t$value = $post_arg_val;\n\t\t\t\tbreak;\n\t\t\tcase ( ! empty( $_GET[ $name ] ) ):\n\t\t\t\t$value = sanitize_text_field( wp_unslash( $_GET[ $name ] ) );\n\t\t\t\tbreak;\n\t\t\tcase ( 'post_type' === $name && ! empty( $typenow ) ):\n\t\t\t\t$value = $typenow;\n\t\t\t\tbreak;\n\t\t\tcase ( 'taxonomy' === $name && ! empty( $taxnow ) ):\n\t\t\t\t$value = $taxnow;\n\t\t\t\tbreak;\n\t\t\tcase ( ! empty( $url_args[ $name ] ) ):\n\t\t\t\t$value = $url_args[ $name ];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$value = '';\n\t\t}\n\t\treturn $value;\n\t}", "function getVal( $name, $default = '' ) {\r\n\t\t\r\n\t\tif( isset( $_REQUEST[$name] ) ) return $this->unquote( $_REQUEST[$name] );\r\n\t\telse return $this->unquote( $default );\r\n\t}", "public function getQueryParam($key, $default = null) {\r\n\t\tif (isset($_GET[$key])) {\r\n\t\t\treturn $_GET[$key];\r\n\t\t}\r\n\t\treturn $default;\r\n\t}", "function getUrlStringValue($urlStringName, $returnIfNotSet) {\n if(isset($_GET[$urlStringName]) && $_GET[$urlStringName] != \"\")\n return $_GET[$urlStringName];\n else\n return $returnIfNotSet;\n}", "public function getQuery($name = null, $default = null)\n {\n return !$name ? $_GET : (isset($_GET[$name]) ? $_GET[$name] : $default);\n }", "function GetVar($name, $default_value = false) {\r\n if (!isset($_GET)) {\r\n return false;\r\n }\r\n if (isset($_GET[$name])) {\r\n if (!get_magic_quotes_gpc()) {\r\n return InjectSlashes($_GET[$name]);\r\n }\r\n return $_GET[$name];\r\n }\r\n return $default_value;\r\n}", "protected function getValue($name, $default='')\r\n {\r\n if (isset($_GET[$name])) {\r\n return $_GET[$name];\r\n } else {\r\n return $default;\r\n }\r\n }", "public function loadDefaultQueryString()\n\t{\n\t\tif (!$this->isDefaultQueryStringEnabled())\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (empty($this->queryString))\n\t\t{\n\t\t\tparse_str($_SERVER['QUERY_STRING'], $this->queryString);\n\t\t\tunset($this->queryString['start']);\n\n\t\t\t$this->queryString = http_build_query($this->queryString);\n\n\t\t\tif ($this->queryString)\n\t\t\t{\n\t\t\t\t$this->queryString = '?' . $this->queryString;\t\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}", "function queryparam_GET($key, $default_value = null) {\n\treturn common_param_GET($_GET, $key, $default_value);\n}", "public function getStringForDefault($string);", "public function getQueryString()\n {\n $queryString = static::normaliseQueryString($_SERVER['QUERY_STRING']);\n\n return '' === $queryString ? null : $queryString;\n }", "function _get($str)\n{\n $val = !empty($_GET[$str]) ? $_GET[$str] : null;\n return $val;\n}", "function sa_dev_qstring($arg=null,$value=null,$qstring=null){\n // null value removes arg from querystring\n $query_string = array();\n if($qstring==null) $qstring = $_SERVER['QUERY_STRING'];\n parse_str($qstring, $query_string); \n if(!empty($arg)) $query_string[$arg] = $value;\n $new_str = http_build_query($query_string,'','&amp;');\n return $new_str;\n}", "public function get_param($str, $default = null){\n\t\tif(isset($_GET[$str]))\n\t\t{\n\t\t\treturn $_GET[$str];\n\t\t}else if(isset($_POST[$str]))\n\t\t{\n\t\t\treturn $_POST[$str];\n\t\t}{\n\t\t\treturn $default;\n\t\t}\n\t}", "public function getQueryString():string;", "public function getQuery($key = null, $default = null)\n {\n if (null === $key) {\n return $_GET;\n }\n\n return (isset($_GET[$key])) ? $_GET[$key] : $default;\n }", "function RequestVar($name, $default_value = true) {\r\n if (!isset($_REQUEST))\r\n return false;\r\n if (isset($_REQUEST[$name])) {\r\n if (!get_magic_quotes_gpc())\r\n return InjectSlashes($_REQUEST[$name]);\r\n return $_REQUEST[$name];\r\n }\r\n return $default_value;\r\n}", "protected function getQuery($name, $default = null)\n {\n return Yii::app()->getRequest()->getQuery($name, $default);\n }", "function queryparam_fetch($key, $default_value = null) {\n\t// check GET first\n\t$val = common_param_GET($_GET, $key, $default_value);\n\tif ($val != $default_value) {\n\t\tif ( is_string($val) )\n\t\t\t$val = urldecode($val);\n\t\treturn $val;\n\t}\n\n\t// next, try POST (with form encode)\n\t$val = common_param_GET($_POST, $key, $default_value);\n\tif ($val != $default_value)\n\t\treturn $val;\n\n\t// next, try to understand rawinput as a json string\n\n\t// check pre-parsed object\n\tif ( !isset($GLOBALS['phpinput_parsed']) ) {\n\t\t$GLOBALS['phpinput'] = file_get_contents(\"php://input\");\n\t\tif ( $GLOBALS['phpinput'] ) {\n\t\t\t$GLOBALS['phpinput_parsed'] = json_decode($GLOBALS['phpinput'], true);\n\t\t\tif ( $GLOBALS['phpinput_parsed'] ) {\n\t\t\t\telog(\"param is available as: \" . $GLOBALS['phpinput']);\n\t\t\t}\n\t\t}\n\t}\n\n\t// check key in parsed object\n\tif ( isset($GLOBALS['phpinput_parsed']) ) {\n\t\tif ( isset($GLOBALS['phpinput_parsed'][$key]) ) {\n\t\t\t$val = $GLOBALS['phpinput_parsed'][$key];\n\t\t\tif ($val != $default_value)\n\t\t\t\treturn $val;\n\t\t}\n\t}\n\n\treturn $default_value;\n}", "public static function setQueryString(): void\n\t{\n\n\t\tif (strpos(static::$fullUrl, '?')) {\n\t\t\tstatic::$queryString = substr(static::$fullUrl, strpos(static::$fullUrl, '?') + 1, strlen(static::$fullUrl));\n\t\t} else {\n\t\t\tstatic::$queryString = '';\n\t\t}\n\n\t}", "public function getQuery() {\n $query = $this->getArgument(self::QUERY_NAME, '');\n if ($query) {\n// $query = str_replace(Url::getBaseUrl(), '', $query);\n $query = str_replace('?' . self::QUERY_NAME . '=', '', $query);\n $query = ltrim($query, Request::QUERY_SEPARATOR);\n $query = rtrim($query, Request::QUERY_SEPARATOR);\n }\n\n return $query;\n }", "public function getQueryString() {\n\t\t\n\t}", "private static function getUrlQueryString() {\n // The variable $_SERVER['QUERY_STRING'] is set by the server and can differ, e.g. it might hold additional\n // parameters or it might be empty (nginx).\n\n if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING'])) {\n $query = $_SERVER['QUERY_STRING'];\n }\n else {\n $query = strRightFrom($_SERVER['REQUEST_URI'], '?');\n }\n return $query;\n }", "public function getQueryString()\n {\n return isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '';\n }" ]
[ "0.7102541", "0.6804903", "0.67102396", "0.65627486", "0.6550244", "0.6384389", "0.635669", "0.6310451", "0.62901837", "0.62821704", "0.62745273", "0.62443584", "0.6207515", "0.61467254", "0.61238575", "0.6121417", "0.61206925", "0.6101068", "0.6099851", "0.60926443", "0.6090629", "0.6074754", "0.6039589", "0.60286164", "0.60134023", "0.6004056", "0.5999925", "0.5996667", "0.59916615", "0.5991589" ]
0.74760604
0
Check that query string param is not empty
function ValidRequiredQueryString($name) { return isset($_GET[$name]) && $_GET[$name] != ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isEmpty()\n {\n return (!is_array($this->params) || count($this->params) == 0);\n }", "Public static function parametersEmpty(){\n\n throw new \\yii\\web\\HttpException(206, 'Query parameters Should not empty', 405);\n\n\n }", "private function verify_parameters(){\n if( empty( $_GET['email'] ) || empty( $_GET['pms_key'] ) || empty( $_GET['subscription_id'] ) )\n return false;\n\n return true;\n }", "protected function __getPostRemoveEmpty(){\r\n if($this->request->isPost()){\r\n foreach($this->request->getPost() as $key => $value){\r\n if(empty($value) || is_null($value)){\r\n unset($_POST[$key]);\r\n }\r\n }\r\n }\r\n else{\r\n foreach($this->request->getQuery() as $key => $value){\r\n if(empty($value) || is_null($value)){\r\n unset($_GET[$key]);\r\n }\r\n }\r\n }\r\n }", "function cpay_CheckGet($params) {\r\n $result = true;\r\n if (!empty($params)) {\r\n foreach ($params as $eachparam) {\r\n if (isset($_GET[$eachparam])) {\r\n if (empty($_GET[$eachparam])) {\r\n $result = false;\r\n }\r\n } else {\r\n $result = false;\r\n }\r\n }\r\n }\r\n return ($result);\r\n}", "function required_params()\n {\n $params = func_get_args();\n foreach ($params as $value) {\n if (is_array($value)) {\n if (empty($value)) {\n return false;\n }\n } else {\n if ($value === null || strlen(trim($value)) == 0) {\n return false;\n }\n }\n }\n\n return true;\n }", "public function hasParams()\r\n\t{\r\n\t\treturn (is_array($this->pathParameters) && !empty($this->pathParameters));\r\n\t}", "function check_required_param($param = array(),$method){\n //set up method\n if (strtolower($method) == \"post\"){\n $r = $_POST;\n }else if (strtolower($method) == \"get\"){\n $r = $_GET;\n }\n //check of required param\n foreach ($param as $par){\n if (!isset($r[$par]) || empty($r[$par])){\n return false;\n break;\n }\n }\n return true;\n}", "function check_collection_landing() {\n $keys = array('medium', 'time', 'tag', 'source');\n foreach ($keys as $key) {\n if ('' != get_query_var( $key ) ) {\n return False;\n }\n }\n return True;\n }", "function nvp_CheckGet($params) {\r\n $result=true;\r\n if (!empty ($params)) {\r\n foreach ($params as $eachparam) {\r\n if (isset($_GET[$eachparam])) {\r\n if (empty ($_GET[$eachparam])) {\r\n $result=false; \r\n }\r\n } else {\r\n $result=false;\r\n }\r\n }\r\n }\r\n return ($result);\r\n }", "public function req($value)\n {\n return '' != $value || empty($value);\n }", "function cleanQueryString(&$request){\n\tdelParam($request, 'pag');\n\tdelParam($request, 'first');\n\tdelParam($request, 'previous');\n\tdelParam($request, 'next');\n\tdelParam($request, 'last');\n\tdelParam($request, 'reload');\n\tdelParam($request, 'numpags');\n\tdelParam($request, 'regspag');\n}", "function haveEmptyParameters($required_params, $request, $response){\n //initialization false\n $error = false; \n //to get the empty params\n $error_params = '';\n //get all the request params with the current request\n // $request_params = $_REQUEST;\n $request_params = $request->getParsedBody();\n\n // loop through params\n foreach($required_params as $param){\n // check the parameter is empty or parameter length is zero\n // !isset checks whether the parameter is empty\n if (!isset($request_params[$param]) || strlen($request_params[$param]) <= 0){\n # code...\n $error = true;\n // concatenate the parameter in error_params\n $error_params .= $param . ', ';\n }\n }\n\n if ($error) {\n # code...\n $error_detail = array();\n $error_detail['error'] = true;\n $error_detail['message'] = 'Required parameters ' . substr($error_params, 0, -2) . ' are missing or empty';\n // use the $response object to return the response\n // encode the error_detail in json format\n $response->write(json_encode($error_detail));\n }\n return $error;\n}", "public function requireNotNullOrEmpty($key)\n {\n\n $value = $this->getParam($key);\n if(is_null($value) || (is_string($value) && trim($value) == '')){\n throw new InvalidParameterException($key, $value, __FUNCTION__);\n }\n\n return $value;\n }", "public static function isGet()\n {\n return !empty($_GET);\n }", "function _remove_qs_args_if_not_in_url($query_string, array $args_to_check, $url)\n {\n }", "function get_query_string($key) {\n $val = null;\n if (!empty($_GET[$key])) {\n $val = $_GET[$key];\n }\n return $val;\n}", "function blankCheck() {\n\tfor($i = 0; $i < func_num_args(); $i++) {\n\t\tif (($_POST[func_get_arg($i)] == '') OR ($_POST[func_get_arg($i)] === 0)) {\n\t\t\tresponse(1, '必填项中含有空值');\n\t\t\texit(0);\n\t\t}\n\t}\n}", "public function has_query_params( $url ) {\n\t\t$qpos = strpos( $url, '?' );\n\n\t\tif ( $qpos === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function search(Request $request)\n {\n // if($request->get(\"\"))\n }", "private function hasParams($request)\n {\n preg_match_all($this->regex, $this->uri, $uri_);\n\n if (count($uri_[0]) !== 0) {\n return $this->setParams($request);\n }\n return false;\n }", "public function globalStringConditionMatchesOnEmptyExpressionWithValueSetToEmptyString() {}", "function CheckSearchParms() {\n\n\t\t// Check basic search\n\t\tif ($this->BasicSearch->IssetSession())\n\t\t\treturn TRUE;\n\t\treturn FALSE;\n\t}", "function CheckSearchParms() {\n\n\t\t// Check basic search\n\t\tif ($this->BasicSearch->IssetSession())\n\t\t\treturn TRUE;\n\t\treturn FALSE;\n\t}", "function CheckSearchParms() {\n\n\t\t// Check basic search\n\t\tif ($this->BasicSearch->IssetSession())\n\t\t\treturn TRUE;\n\t\treturn FALSE;\n\t}", "public function globalStringConditionMatchesOnEmptyExpressionWithValueSetToEmptyString() {}", "public function get_corrected_query_string() {\n\t\treturn '';\n\t}", "function checkEmpty(){\n\t\tif(!empty($_POST)){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function has_url_get_parameters() {\r\n\t\treturn (strlen($this->url_get_parameters) > 3);\r\n\t}", "public function validate_request() {\r\n\t\tif ($this->request != null && sizeof($this->request) != 1)\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\t}" ]
[ "0.67162734", "0.6675367", "0.6554458", "0.6476091", "0.643055", "0.6389102", "0.6387113", "0.6334984", "0.63314694", "0.6294919", "0.6288418", "0.62765974", "0.62431735", "0.6224884", "0.62146294", "0.61709404", "0.61601925", "0.61416894", "0.6111461", "0.6107865", "0.6032028", "0.6031425", "0.6030289", "0.6030289", "0.6030289", "0.60298866", "0.60273135", "0.6019939", "0.6017545", "0.5988705" ]
0.77078784
0
Check that post param is not empty
function ValidRequiredPost($name) { return isset($_POST[$name]) && $_POST[$name] != ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkEmpty(){\n\t\tif(!empty($_POST)){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function isPostLeeg()\n {\n return empty($_POST);\n }", "function checkPOST() : bool\n {\n if (!(isset($_POST['firstName']) && isset($_POST['secondName'])))\n {\n return false; // not set\n }\n if (trim($_POST['firstName']) == '' && trim($_POST['secondName']) == '')\n {\n return false; // empty\n }\n return true;\n }", "function blankCheck() {\n\tfor($i = 0; $i < func_num_args(); $i++) {\n\t\tif (($_POST[func_get_arg($i)] == '') OR ($_POST[func_get_arg($i)] === 0)) {\n\t\t\tresponse(1, '必填项中含有空值');\n\t\t\texit(0);\n\t\t}\n\t}\n}", "function not_empty($fields = [])\r\n{\r\n if (count($fields) !=0) {\r\n foreach ($fields as $field) {\r\n if (empty($_POST [$field]) || trim($_POST[$field]) == \"\") { //trim escape all spaces. If empty : false\r\n return false;\r\n }\r\n }\r\n return true ; //fields filled\r\n }\r\n}", "public function is_empty()\r\n {\r\n if( $this->is_submit() && ($this->taintedInputs->length()=== 0))\r\n return true; \r\n else\r\n return false;\r\n }", "public function testIsInvalidEmptyPost() {\n\t\t$this->assertFalse($this->match->validate(array()));\n\t}", "public function hasPost()\n {\n if (func_num_args() == 0) {\n return !empty($this->post);\n }\n\n foreach (func_get_args() as $key) {\n if (!$this->hasParam($this->post, $key)) {\n return false;\n }\n }\n\n return true;\n }", "function not_empty($tableau) {\n\tforeach ($tableau as $champ) {\n\t\tif(empty($_POST[$champ]) || trim($_POST[$champ])==\"\" ){\n\t\t\treturn false;\n\t\t# code.\n\t\t}\n\n\t}\n\treturn true;\n}", "function post_exists($parameter){\n return key_exists($parameter, $_POST) && strlen(trim($_POST[$parameter])) > 0;\n}", "public function isEmpty()\n {\n return (!is_array($this->params) || count($this->params) == 0);\n }", "function fieldsEmpty() {\n if(empty($_POST['title']) || empty($_POST['date']) || empty($_POST['location'])) {\n return true;\n } else {\n return false;\n }\n}", "protected function __getPostRemoveEmpty(){\r\n if($this->request->isPost()){\r\n foreach($this->request->getPost() as $key => $value){\r\n if(empty($value) || is_null($value)){\r\n unset($_POST[$key]);\r\n }\r\n }\r\n }\r\n else{\r\n foreach($this->request->getQuery() as $key => $value){\r\n if(empty($value) || is_null($value)){\r\n unset($_GET[$key]);\r\n }\r\n }\r\n }\r\n }", "function validate_post($data)\n\t{\n\t\t/* Validating the hostname, the database name and the username. The password is optional. */\n\t\treturn !empty($data['db_host']) && !empty($data['db_username']) && !empty($data['db_name']) && !empty($data['site_url']);\n\t}", "function check_required_param($param = array(),$method){\n //set up method\n if (strtolower($method) == \"post\"){\n $r = $_POST;\n }else if (strtolower($method) == \"get\"){\n $r = $_GET;\n }\n //check of required param\n foreach ($param as $par){\n if (!isset($r[$par]) || empty($r[$par])){\n return false;\n break;\n }\n }\n return true;\n}", "public function hasPostData()\r\n\t{\r\n\t\treturn (is_array($this->postData) && !empty($this->postData));\r\n\t}", "public static function isPost()\n {\n return !empty($_POST);\n }", "protected function validatePOST() {\n return true;\n }", "public function post()\n {\n return count($_POST) > 0;\n }", "static function available()\n {\n foreach (func_get_args() as $key)\n if (!isset($_POST[$key]) || empty($_POST[$key]))\n return false;\n return true;\n }", "function filled_out($form_vars) {\n foreach ($form_vars as $key => $value) {\n if ((!isset($key)) || ($value == '')) {\n return false;\n }\n }\n return true;\n}", "public function validate_request() {\r\n\t\tif ($this->request != null && sizeof($this->request) != 1)\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\t}", "public static function isPost($var=''){\n\t\tif(empty($var)){\n\t\t\tif(!empty($_POST)){return TRUE;}\n\t\t}\n\t\telse {\n\t\t\t//check if post variable exist and return value otherwise return empty\n\t\t\tif(!empty($_POST[$var])){\n\t\t\t\treturn trim($_POST[$var]);\n\t\t\t}\n\t\t\telseif(isset($_POST[$var])){return '';}\n\t\t}\n\t\treturn FALSE;\n\t}", "function filled_out($form_vars)\r\n{\r\n foreach ($form_vars as $key => $value)\r\n {\r\n if (!isset($key) || ($value == \"\"))\r\n return true;\r\n }\r\n return true;\r\n}", "function checkEmptyField($field) {\n\t return isset($field) && $field !== \"\" && $field !== '';\n }", "function required_params()\n {\n $params = func_get_args();\n foreach ($params as $value) {\n if (is_array($value)) {\n if (empty($value)) {\n return false;\n }\n } else {\n if ($value === null || strlen(trim($value)) == 0) {\n return false;\n }\n }\n }\n\n return true;\n }", "private function verify_parameters(){\n if( empty( $_GET['email'] ) || empty( $_GET['pms_key'] ) || empty( $_GET['subscription_id'] ) )\n return false;\n\n return true;\n }", "public function isPost() {\r\n return isset($_POST) && count($_POST) > 0;\r\n }", "function checkPost($postArray) {\n if (isset($postArray) && $postArray!= NULL) {\n return TRUE;\n } else {\n return FAlSE;\n }\n}", "function haveEmptyParameters($required_params, $request, $response){\n //initialization false\n $error = false; \n //to get the empty params\n $error_params = '';\n //get all the request params with the current request\n // $request_params = $_REQUEST;\n $request_params = $request->getParsedBody();\n\n // loop through params\n foreach($required_params as $param){\n // check the parameter is empty or parameter length is zero\n // !isset checks whether the parameter is empty\n if (!isset($request_params[$param]) || strlen($request_params[$param]) <= 0){\n # code...\n $error = true;\n // concatenate the parameter in error_params\n $error_params .= $param . ', ';\n }\n }\n\n if ($error) {\n # code...\n $error_detail = array();\n $error_detail['error'] = true;\n $error_detail['message'] = 'Required parameters ' . substr($error_params, 0, -2) . ' are missing or empty';\n // use the $response object to return the response\n // encode the error_detail in json format\n $response->write(json_encode($error_detail));\n }\n return $error;\n}" ]
[ "0.7423945", "0.71076137", "0.70415545", "0.7016539", "0.6903644", "0.68790364", "0.68191296", "0.6761175", "0.67490524", "0.6694592", "0.66818935", "0.66723293", "0.6665045", "0.66259265", "0.6602465", "0.657979", "0.6578675", "0.6455953", "0.64507854", "0.6442074", "0.6432234", "0.64133346", "0.6401583", "0.6383392", "0.63793373", "0.6371754", "0.6341822", "0.63284606", "0.63083375", "0.6303849" ]
0.7182731
1
Register Convers8 user in Wordpress
function register_wordpress_user($convers8_user, $secret) { $wp_user_id = wp_insert_user(array( 'user_pass' => md5($convers8_user["id"] . $secret), 'user_login' => $convers8_user["id"], // make sure no illegal characters occur in user_nicename, since it is also in the member's URL 'user_nicename' => sanitize_title_with_dashes($convers8_user["firstName"] . '-' . $convers8_user["lastName"]), 'display_name' => $convers8_user["firstName"] . ' ' . $convers8_user["lastName"], 'nickname' => $convers8_user["firstName"] . ' ' . $convers8_user["lastName"], 'first_name' => $convers8_user["firstName"], 'last_name' => $convers8_user["lastName"], 'user_email' => $convers8_user["id"] . '-' . get_option('convers8_websiteid') . '-' . md5($convers8_user["id"] . $secret) . '@users.convers8.eu' )); return $wp_user_id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wp_newUser( $args ) {\n \n global $wp_xmlrpc_server, $wp_roles;\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 $send_mail = isset( $args[4] ) ? $args[4] : false;\n\n if ( ! $user = $wp_xmlrpc_server->login( $username, $password ) )\n return $wp_xmlrpc_server->error;\n\n if ( ! current_user_can( 'create_users' ) )\n return new IXR_Error( 401, __( 'You are not allowed to create users' ) );\n\n // this hold all the user data\n $user_data = array();\n \n $user_data['user_login'] = '';\n if( isset ( $content_struct['user_login'] ) ) {\n\n $user_data['user_login'] = sanitize_user( $content_struct['user_login'] );\n //Remove any non-printable chars from the login string to see if we have ended up with an empty username\n $user_data['user_login'] = trim( $user_data['user_login'] );\n\n }\n\n if( empty ( $user_data['user_login'] ) )\n return new IXR_Error( 403, __( 'Cannot create a user with an empty login name. ' ) );\n if( username_exists ( $user_data['user_login'] ) )\n return new IXR_Error( 403, __( 'This username is already registered.' ) );\n\n //password cannot be empty\n if( empty ( $content_struct['user_pass'] ) )\n return new IXR_Error( 403, __( 'password cannot be empty' ) );\n\n $user_data['user_pass'] = $content_struct['user_pass'];\n\n // check whether email address is valid\n if( ! is_email( $content_struct['user_email'] ) )\n return new IXR_Error( 403, __( 'email id is not valid' ) );\n\n // check whether it is already registered\n if( email_exists( $content_struct['user_email'] ) )\n return new IXR_Error( 403, __( 'This email address is already registered' ) );\n\n $user_data['user_email'] = $content_struct['user_email'];\n\n // If no role is specified default role is used\n $user_data['role'] = get_option('default_role');\n if( isset ( $content_struct['role'] ) ) {\n\n if( ! isset ( $wp_roles ) )\n $wp_roles = new WP_Roles ();\n if( ! array_key_exists( $content_struct['role'], $wp_roles->get_names() ) )\n return new IXR_Error( 403, __( 'The role specified is not valid' ) );\n $user_data['role'] = $content_struct['role'];\n \n }\n\n $user_data['first_name'] = '';\n if( isset ( $content_struct['first_name'] ) )\n $user_data['first_name'] = $content_struct['first_name'];\n\n $user_data['last_name'] = '';\n if( isset ( $content_struct['last_name'] ) )\n $user_data['last_name'] = $content_struct['last_name'];\n\n $user_data['user_url'] = '';\n if( isset ( $content_struct['user_url'] ) )\n $user_data['user_url'] = $content_struct['user_url'];\n\n $user_id = wp_insert_user( $user_data );\n\n if ( is_wp_error( $user_id ) )\n return new IXR_Error( 500, $user_id->get_error_message() );\n\n if ( ! $user_id )\n return new IXR_Error( 500, __( 'Sorry, your entry could not be posted. Something wrong happened.' ) );\n\n if( $send_mail ) {\n \n $subject = \"[\".get_bloginfo('name').\"] Your username and password\";\n $message = \"Username: \".$user_data['user_login'].\"\\nPassword: \".$user_data['user_pass'].\"\\n\".get_bloginfo('siteurl').\"/wp-login.php\";\n wp_mail( $user_data['user_email'], $subject, $message );\n \n }\n\n return strval( $user_id );\n\n}", "function user_register($user_info)\n {\n }", "public function register_user()\n {\n \n return true;\n \n }", "function wpmu_signup_user($user, $user_email, $meta = array())\n {\n }", "function func_bp_core_signup_user($user_id, $user_login, $user_password, $user_email, $usermeta){\n $args = array( 'field' => 'Are You A Coach', 'user_id' => $user_id); \n $_xprofile_coach_yes_no = bp_get_profile_field_data($args); \n if( $_xprofile_coach_yes_no == 'Yes'){ \n\t//change user role to coach \n\t$wp_user = get_user_by('ID', $user_id); \n\t$wp_user->remove_role('subscriber'); \n\t$wp_user->add_role('coach');\n }\n}", "public function register_with_tyk() {\n\t\ttry {\n\t\t\t$tyk = new Tyk_API();\n\t\t\t$user_id = $tyk->post('/portal/developers', array(\n\t\t\t\t'email' => $this->user->user_email,\n\t\t\t\t));\n\t\t\t$this->set_tyk_id($user_id);\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\ttrigger_error(sprintf('Could not register user for API: %s', $e->getMessage()), E_USER_WARNING);\n\t\t}\n\t}", "function register_user() {\n\n\t\tif ( ! class_exists( 'QuadMenu' ) ) {\n\t\t\twp_die();\n\t\t}\n\n\t\tif ( ! check_ajax_referer( 'quadmenu', 'nonce', false ) ) {\n\t\t\tQuadMenu::send_json_error( esc_html__( 'Please reload page.', 'quadmenu' ) );\n\t\t}\n\n\t\t$mail = isset( $_POST['mail'] ) ? $_POST['mail'] : false;\n\t\t$pass = isset( $_POST['pass'] ) ? $_POST['pass'] : false;\n\n\t\tif ( empty( $mail ) || ! is_email( $mail ) ) {\n\t\t\tQuadMenu::send_json_error( sprintf( '<div class=\"quadmenu-alert alert-danger\">%s</div>', esc_html__( 'Please provide a valid email address.', 'quadmenu' ) ) );\n\t\t}\n\n\t\tif ( empty( $pass ) ) {\n\t\t\tQuadMenu::send_json_error( sprintf( '<div class=\"quadmenu-alert alert-danger\">%s</div>', esc_html__( 'Please provide a password.', 'quadmenu' ) ) );\n\t\t}\n\n\t\t$userdata = array(\n\t\t\t'user_login' => $mail,\n\t\t\t'user_email' => $mail,\n\t\t\t'user_pass' => $pass,\n\t\t);\n\n\t\t$user_id = wp_insert_user( apply_filter( 'ml_qmpext_register_user_userdata', $userdata ) );\n\n\t\tif ( ! is_wp_error( $user_id ) ) {\n\n\t\t\t$user = get_user_by( 'id', $user_id );\n\n\t\t\tif ( $user ) {\n\t\t\t\twp_set_current_user( $user_id, $user->user_login );\n\t\t\t\twp_set_auth_cookie( $user_id );\n\t\t\t\tdo_action( 'wp_login', $user->user_login, $user );\n\t\t\t}\n\n\t\t\tQuadMenu::send_json_success( sprintf( '<div class=\"quadmenu-alert alert-success\">%s</div>', esc_html__( 'Welcome! Your user have been created.', 'quadmenu' ) ) );\n\t\t} else {\n\t\t\tQuadMenu::send_json_error( sprintf( '<div class=\"quadmenu-alert alert-danger\">%s</div>', $user_id->get_error_message() ) );\n\t\t}\n\t\twp_die();\n\t}", "public function registerUser($data);", "public function register() {\n\t\tif ($this -> Auth -> loggedIn()) {\n\t\t\t$this -> Session -> setFlash('You are already registered.');\n\t\t\t$this -> redirect($this -> referer());\n\t\t}\n\t\tif ($this -> request -> is('post')) {\n\t\t\t$this -> User -> create();\n\t\t\t$data = $this -> request -> data;\n\t\t\t$data['User']['public_key'] = uniqid();\n\t\t\t$data['User']['role'] = \"user\";\n\t\t\t$data['User']['api_key'] = md5(microtime().rand());\n\t\t\tif ($this -> User -> save($data)) {\n\t\t\t\t$this -> Session -> setFlash(__('You have succesfully registered. Now you can login.'));\n\t\t\t\t$this -> redirect('/users/login');\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}\n\n\t\t$this -> set('title_for_layout', 'User Registration');\n\t}", "function add_role_and_user_for_Zabbio_on_plugin_activate() {\n add_role(\n 'ZabbioApp',\n __( 'ZabbioApp' ),\n array(\n 'create_posts' => true,\n 'edit_others_posts' => true,\n 'edit_posts' => true,\n 'edit_published_posts' => true,\n 'list_users' => true,\n 'manage_categories' => true,\n 'publish_posts' => true,\n 'read' => true\n )\n );\n\n $user_name = 'ZabbioApp';\n $user_email = '';\n if ( !username_exists($user_name) ) {\n $random_password = wp_generate_password( $length=12, $include_standard_special_chars=false );\n $user_id = wp_insert_user( \n array(\n 'user_pass' => $random_password,\n 'user_login' => $user_name,\n 'role' => 'ZabbioApp',\n 'user_email' => ''\n )\n );\n } else {\n $random_password = __('User already exists. Password inherited.');\n }\n}", "public function register($u) {\n $this->user_id = $u; \n }", "public function on_registration( $user_id ) {\n\t\tmnetwork_add_user( $user_id, get_current_blog_id() );\n\t}", "public function register() {\n\t\t\n\t\t// DB connection\n\t\t$db = Database::getInstance();\n \t$mysqli = $db->getConnection();\n\t\t\n $data = (\"INSERT INTO user (username,password,first_name,\n last_name,dob,address,postcode,email)\n VALUES ('{$this->_username}',\n '{$this->_sha1}',\n '{$this->_first_name}',\n '{$this->_last_name}',\n '{$this->_dob}',\n '{$this->_address}',\n '{$this->_postcode}',\n '{$this->_email}')\");\n\t\t\t\t\t\t \n\t\t\t$result = $mysqli->query($data);\n if ( $mysqli->affected_rows < 1)\n // checks if data has been succesfully inputed\n $this->_errors[] = 'could not process form';\n }", "function __construct($args) {\n\t\t$this->register_args = $args;\n\t\t$this->default_fields = array(\n\t\t\t'username' => array( // the key will be used in the label for attribute and the input name\n\t\t\t\t'title' => __('Username', 'cell-user'), // the label text\n\t\t\t\t'type' => 'text', // the input type or textarea\n\t\t\t\t'required' => 1, // is it required? 1 or 0\n\t\t\t\t'required_text' => __('(required)', 'cell-user'),\n\t\t\t\t'note' =>__('Use 3 - 15 character lowercase, numbers and \\'- \\' only', 'cell-user') // does it need a helper note, use inline html tags only\n\t\t\t),\n\t\t\t'email' => array(\n\t\t\t\t'title' => __('Email', 'cell-user'),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'required' => 1,\n\t\t\t\t'note' => ''\n\t\t\t),\n\t\t\t'password' => array(\n\t\t\t\t'title' => __('Password', 'cell-user'),\n\t\t\t\t'type' => 'password',\n\t\t\t\t'required' => 1,\n\t\t\t\t'note' => ''\n\t\t\t)\n\t\t);\n\n\n\t\t// add a shortcode\n\t\tadd_shortcode('cell-user-register', array( $this, 'shortcode_output'));\n\n\t\t// add a redirect for logged out user\n\t\tadd_action('template_redirect', array( $this, 'redirect_user'));\n\n\t\t// add login ajax handler function\n\t\tadd_action('wp_ajax_nopriv_frontend_registration', array( $this, 'process_frontend_registration'));\n\n\t\t// add login ajax handler function\n\t\tadd_action('wp_ajax_nopriv_confirm_registration', array( $this, 'process_confirm_registration'));\n\n\t\t// if this \n\t\tif (isset($this->register_args['captcha'])){\n\t\t\tadd_action('wp_ajax_nopriv_get_captcha_image', array( $this, 'get_captcha_image'));\t\n\t\t}\t\t\n\n\t\t// flush rewrite on registration\n\t\tadd_action( 'wp_loaded', array($this, 'registration_flush_rewrite'));\n\n\t}", "public function registerNewUser($fullName,$email,$password);", "function ft_wp_user_register($user_id)\r\n{\r\n $role = ft_wp_get_wpuser_role($user_id);\r\n\r\n $formtools_account_id = \"\";\r\n if (!empty($role))\r\n {\r\n // now get the Form Tools account ID associated with this role type\r\n $access_level = \"formtoolsaccess__{$role}\";\r\n $formtools_account_id = get_option($access_level);\r\n }\r\n\r\n update_usermeta($user_id, 'form_tools_access', $formtools_account_id);\r\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 action_register()\n\t{\n Auth::create_user(\n 'promisemakufa',\n 'pass123',\n '[email protected]',\n 1,\n array(\n 'fullname' => 'P K systems',\n )\n );\n\n $this->template->title = \"User\";\n $this->template->content = View::forge('user/register');\n }", "function ajax_reg_new_user()\n{\n\n // Verify nonce\n check_ajax_referer('woocommerce-register', 'security');\n\n // Nonce is checked, get the POST data and sign user on\n $info = array();\n $info['user_login'] = $_POST['email'];\n $info['user_pass'] = $_POST['password'];\n $info['user_email'] = $_POST['email'];\n\n if (!$_POST['email']) {\n echo json_encode(array('registered' => false, 'message' => 'Whoops, Please enter an email address'));\n die();\n }\n\n if (!$_POST['password']) {\n echo json_encode(array('registered' => false, 'message' => 'Hmm... Please enter a password'));\n die();\n }\n\n $user_signup = wp_insert_user($info);\n\n if (is_wp_error($user_signup)) {\n\n echo json_encode(array('registered' => false, 'message' => 'Uh oh! ' . $user_signup->get_error_message()));\n\n } else {\n\n echo json_encode(array('registered' => true, 'message' => __('Hooray, login successful, redirecting...')));\n }\n\n die();\n}", "public function users_register_pre_add_user($h)\n {\n if (isset($h->vars['reg_flags'])) {\n $h->currentUser->role = 'pending';\n }\n }", "private function register(): void\n {\n $user = User::factory()->create();\n $this->actingAs($user);\n }", "function wp_new_user_notification($user_id, $plaintext_pass = '')\n {\n }", "public function register () : void\n {\n $this->getHttpReferer();\n\n // if the user is already logged in,\n // redirection to the previous page\n if ($this->session->exist(\"auth\")) {\n $url = $this->router->url(\"admin\");\n Url::redirect(301, $url);\n }\n\n $errors = []; // form errors\n $flash = null; // flash message\n\n $tableUser = new UserTable($this->connection);\n $tableRole = new RoleTable($this->connection);\n\n // form validator\n $validator = new RegisterValidator(\"en\", $_POST, $tableUser);\n\n // check that the form is valid and add the new user\n if ($validator->isSubmit()) {\n if ($validator->isValid()) {\n $role = $tableRole->find([\"name\" => \"author\"]);\n\n $user = new User();\n $user\n ->setUsername($_POST[\"username\"])\n ->setPassword($_POST[\"password\"])\n ->setSlug(str_replace(\" \", \"-\", $_POST[\"username\"]))\n ->setRole($role);\n\n $tableUser->createUser($user, $role);\n\n $this->session->setFlash(\"Congratulations {$user->getUsername()}, you are now registered\", \"success\", \"mt-5\");\n $this->session\n ->write(\"auth\", $user->getId())\n ->write(\"role\", $user->getRole());\n\n // set the token csrf\n if (!$this->session->exist(\"token\")) {\n $csrf = new Csrf($this->session);\n $csrf->setSessionToken(175, 658, 5);\n }\n\n $url = $this->router->url(\"admin\") . \"?user=1&create=1\";\n Url::redirect(301, $url);\n } else {\n $errors = $validator->getErrors();\n $errors[\"form\"] = true;\n }\n }\n\n // form\n $form = new RegisterForm($_POST, $errors);\n\n // url of the current page\n $url = $this->router->url(\"register\");\n\n // flash message\n if (array_key_exists(\"form\", $errors)) {\n $this->session->setFlash(\"The form contains errors\", \"danger\", \"mt-5\");\n $flash = $this->session->generateFlash();\n }\n\n $title = App::getInstance()\n ->setTitle(\"Register\")\n ->getTitle();\n\n $this->render(\"security.auth.register\", $this->router, $this->session, compact(\"form\", \"url\", \"title\", \"flash\"));\n }", "function give_register_and_login_new_user( $user_data = array() ) {\n\t// Verify the array.\n\tif ( empty( $user_data ) ) {\n\t\treturn - 1;\n\t}\n\n\tif ( give_get_errors() ) {\n\t\treturn - 1;\n\t}\n\n\t$user_args = apply_filters( 'give_insert_user_args', array(\n\t\t'user_login' => isset( $user_data['user_login'] ) ? $user_data['user_login'] : '',\n\t\t'user_pass' => isset( $user_data['user_pass'] ) ? $user_data['user_pass'] : '',\n\t\t'user_email' => isset( $user_data['user_email'] ) ? $user_data['user_email'] : '',\n\t\t'first_name' => isset( $user_data['user_first'] ) ? $user_data['user_first'] : '',\n\t\t'last_name' => isset( $user_data['user_last'] ) ? $user_data['user_last'] : '',\n\t\t'user_registered' => date( 'Y-m-d H:i:s' ),\n\t\t'role' => give_get_option( 'donor_default_user_role', 'give_donor' ),\n\t), $user_data );\n\n\t// Insert new user.\n\t$user_id = wp_insert_user( $user_args );\n\n\t// Validate inserted user.\n\tif ( is_wp_error( $user_id ) ) {\n\t\treturn - 1;\n\t}\n\n\t// Allow themes and plugins to filter the user data.\n\t$user_data = apply_filters( 'give_insert_user_data', $user_data, $user_args );\n\n\t/**\n\t * Fires after inserting user.\n\t *\n\t * @since 1.0\n\t *\n\t * @param int $user_id User id.\n\t * @param array $user_data Array containing user data.\n\t */\n\tdo_action( 'give_insert_user', $user_id, $user_data );\n\n\t/**\n\t * Filter allow user to alter if user when to login or not when user is register for the first time.\n\t *\n\t * @since 1.8.13\n\t *\n\t * return bool True if login with registration and False if only want to register.\n\t */\n\tif ( true === (bool) apply_filters( 'give_log_user_in_on_register', true ) ) {\n\t\t// Login new user.\n\t\tgive_log_user_in( $user_id, $user_data['user_login'], $user_data['user_pass'] );\n\t}\n\n\t// Return user id.\n\treturn $user_id;\n}", "public function do_register_user() {\n\t\tif( $_SERVER['REQUEST_METHOD'] == 'POST' ) {\n\t\t\t$redirect_url = home_url( 'member-register' );\n\t\t\t\n\t\t\tif( !get_option( 'users_can_register' ) ) {\n\t\t\t\t// Reg closed\n\t\t\t\t$redirect_url = add_query_arg( 'register-errors', 'closed', $redirect_url );\n\t\t\t} else {\n\t\t\t\t$email = sanitize_email($_POST['email']);\n\t\t\t\t$company_name = sanitize_text_field( $_POST['company_name'] );\n\t\t\t\t$first_name = sanitize_text_field( $_POST['first_name'] );\n\t\t\t\t$last_name = sanitize_text_field( $_POST['last_name'] );\n\t\t\t\t$contact_phone = sanitize_text_field( $_POST['contact_phone'] );\n\t\t\t\t$mobile_phone = sanitize_text_field( $_POST['mobile_phone'] );\n\t\t\t\t$job_title = sanitize_text_field( $_POST['job_title'] );\n\t\t\t\t$sector = sanitize_text_field( $_POST['sector'] );\n\t\t\t\t$ftseIndex = sanitize_text_field( $_POST['ftseIndex'] );\n\t\t\t\t$invTrust = sanitize_text_field( $_POST['invTrust'] );\n\t\t\t\t$sec_name = sanitize_text_field( $_POST['sec_name'] );\n\t\t\t\t$sec_email = sanitize_text_field( $_POST['sec_email'] );\n\t\t\t\t\n\t\t\t\t$result = $this->register_user( $email, $company_name, $first_name, $last_name, $contact_phone, $mobile_phone, $job_title, $sector, $ftseIndex, $invTrust, $sec_name, $sec_email );\n\t\t\t\t\n\t\t\t\tif( is_wp_error( $result ) ) {\n\t\t\t\t\t// Parse errors into string and append as parameter to redirect\n\t\t\t\t\t$errors = join( ',', $result->get_error_codes() );\n\t\t\t\t\t$redirect_url = add_query_arg( 'register-errors', $errors, $redirect_url );\n\t\t\t\t} else {\n\t\t\t\t\t// Success\n\t\t\t\t\t$redirect_url = home_url( 'thank-you-for-registering' );\n//\t\t\t\t\t$redirect_url = add_query_arg( 'registered', $email, $redirect_url );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\twp_redirect( $redirect_url );\n\t\t\texit;\n\t\t}\n\t}", "public function sign_up()\n {\n\n }", "public function register()\n {\n add_filter( 'upload_mimes', array( $this, 'add_custom_file_types_supprot' ) );\n\n // add svg support\n add_filter( 'wp_prepare_attachment_for_js', array( $this, 'add_svg_media_thumbnails' ), 10, 3 );\n\n // filter wordpress filetype security check\n add_filter('wp_check_filetype_and_ext', array( $this, 'wp_check_filetype_and_ext' ) , 5, 5);\n\n // Add Custom user fields to ccd_client user role\n add_action( 'show_user_profile', array( $this, 'add_custom_user_fields' ) );\n add_action( 'edit_user_profile', array( $this, 'add_custom_user_fields' ) );\n\n // handle custom user fields update / form post\n add_action( 'personal_options_update', array( $this, 'update_custom_user_fields' ) );\n add_action( 'edit_user_profile_update', array( $this, 'update_custom_user_fields' ) );\n }", "function register_user($username,$email,$institution){\n\t}", "function registerUser()\n {\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'title', 1 => 'first_name', 2 => 'last_name', 3 => 'contacttelephone', 4 => 'contactemail', 5 => 'password', 6 => 'username', 7 => 'dob', 8 => 'house', 9 => 'street', 10 => 'town', 11 => 'county', 12 => 'pcode', 13 => 'optout', 14 => 'newsletter', 15 => 'auth_level', 16 => 'store_owner');\n $fieldvals = array(0 => $this->Title, 1 => $this->FirstName, 2 => $this->LastName, 3 => $this->ContactTelephone, 4 => $this->ContactEmail, 5 => $this->Password, 6 => $this->Username, 7 => $this->DOB, 8 => $this->House, 9 => $this->Street, 10 => $this->Town, 11 => $this->County, 12 => $this->PCode, 13 => $this->Optout, 14 => $this->NewsletterSubscriber, 15 => $this->AuthLevel, 16 => 1);\n $rs = $DBA->insertQuery(DBUSERTABLE, $fields, $fieldvals);\n if ($rs == 1)\n {\n $this->RegistrationSuccess = 1;\n }\n if (isset($this->PCode))\n {\n $this->geoLocate();\n }\n }", "function users_user_register($args)\n{\n // If has logged in, header to index.php\n if (pnUserLoggedIn()) {\n return pnRedirect(pnConfigGetVar('entrypoint', 'index.php'));\n }\n\n $template = 'users_user_register.htm';\n // check if we've agreed to the age limit\n if (pnModGetVar('Users', 'minage') != 0 && !stristr(pnServerGetVar('HTTP_REFERER'), 'register')) {\n $template = 'users_user_checkage.htm';\n }\n\n // create output object\n $pnRender = & pnRender::getInstance('Users', false);\n\n // other vars\n $modvars = pnModGetVar('Users');\n\n $pnRender->assign($modvars);\n $pnRender->assign('sitename', pnConfigGetVar('sitename'));\n $pnRender->assign('legal', pnModAvailable('legal'));\n $pnRender->assign('tou_active', pnModGetVar('legal', 'termsofuse', true));\n $pnRender->assign('pp_active', pnModGetVar('legal', 'privacypolicy', true));\n\n return $pnRender->fetch($template);\n}" ]
[ "0.6712727", "0.65420777", "0.6436557", "0.63906527", "0.6331135", "0.6331101", "0.63111013", "0.63081783", "0.6228033", "0.61851543", "0.6169087", "0.6152797", "0.6145179", "0.61308134", "0.6096465", "0.6089725", "0.6088785", "0.60845447", "0.60621464", "0.6053979", "0.60467166", "0.6041991", "0.6041083", "0.6019552", "0.6016582", "0.59835017", "0.5979118", "0.597328", "0.5971308", "0.5968425" ]
0.78215736
0
Writes a given $tree to a new spreadsheet
public static function writeTree(array $tree, string $heading = null, float $prefightOffset = null, bool $isConsolation = false, bool $hasPreFights = false): Spreadsheet { $spreadsheet = new Spreadsheet(); self::setHeading($spreadsheet, $heading); if ($prefightOffset === null) { $prefightOffset = self::calculateOffsetOfPrefights($tree, $isConsolation, $hasPreFights); } $fightHeightExponent = 0; // leave some margin for the heading $topMargin = 3; $lastFightHeightInCells = 2; // iterate over columns of (fighting) tree for ($c = 0; $c < count($tree); $c++) { // calculate fight height $fightHeightExponent += 1; if ($isConsolation) { if ($c === 0) { $fightHeightExponent += 1; } if ($c > 1) { if (count($tree[$c - 1]) === count($tree[$c])) { $fightHeightExponent -= 1; } } } $fightHeightInCells = pow(2, $fightHeightExponent) + 1; $spreadsheet->getActiveSheet()->getColumnDimensionByColumn($c + 1)->setWidth(20); // add top margin to align tree if (!$isConsolation) { $add = pow(2, $c + 1) - pow(2, $c); } else { $add = $lastFightHeightInCells; } $topMargin += floor($add / 2); $row = $topMargin; if ($c === 0) { $row += $prefightOffset; } // iterate over fights of this particular column (with index) $c foreach ($tree[$c] as $fight) { self::writeFightOfTree($spreadsheet, $c + 1, $row, $fight, $fightHeightInCells); // increase $row by height of fight $row += $fightHeightInCells; // increase $row by space between fights $row += $fightHeightInCells - 2; if ($c === 0 && $isConsolation && isset($tree[$c + 1]) && count($tree[$c]) === count($tree[$c + 1]) && !$hasPreFights) { $row += $fightHeightInCells * 2 - 2; } } $lastFightHeightInCells = $fightHeightInCells; } return $spreadsheet; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save_tree()\n\t{\n\t\tforeach ($this->class_tree as $tree)\n\t\t{\n\t\t\tif (isset($tree['change_flag']))\n\t\t\t{\n\t\t\t\tswitch ($tree['change_flag'])\n\t\t\t\t{\n\t\t\t\t case 'INSERT' :\n\t\t\t\t\t$this->add_new_class($tree);\n\t\t\t\t\tbreak;\n\t\t\t\t case 'UPDATE' :\n\t\t\t\t\t$this->save_edited_class($tree);\n\t\t\t\t\tbreak;\n\t\t\t\t default :\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function createTourLogSheet($name, $data, &$workBook, $writeStats){\n\t$file = 0;\n\t$excel = 1;\n\t$cols = array('Tour ID', 'Date/Time', 'Majors', 'Student', 'Parent', 'People', 'School', 'Year', 'City', 'State', 'Email', 'Phone', 'Tour Status', 'Comments from Family', 'Comments from Ambassadors');\n\t$entries = array('id', 'tourTime', 'majorsOfInterest', 'studentName', 'parentName', 'numPeople', 'school', 'yearInSchool', 'city', 'state', 'email', 'phone', 'status', 'tourComments', 'ambComments');\n\n\t$tourDayCounts = array_fill(0, 7, 0);\n\t$tourWeekCounts = array_fill(0, 53, 0);\n\t$tourDateCounts = array_fill(0, 53, null);\n\t$weekStrings = array();\n\t$numSemesterTours = count($data);\n\t$timeStringLength = 0;\n\tif($excel)\n\t\t$tourSheet = & $workBook->add_worksheet($name. ' Tours');\n\tif($file)\n\t\tfwrite($f, \"\\nWorksheet: $name Tours\\n\");\n\t$numCols = count($cols);\n\tfor($col = 0; $col < $numCols; $col++){\n\t\t$colName = $cols[$col];\n\t\t$colRef = $entries[$col];\n\t\t$maxWidth = getTextWidth($colName);\n\t\tif($excel)\n\t\t\t$tourSheet->write_string(0, $col, $colName);\n\t\tif($file)\n\t\t\tfwrite($f, \"Row: 0, Col: $col, $colRef: $colName, width:$maxWidth\\t\");\n\n\t\tfor($tour = 0; $tour < $numSemesterTours; $tour++){\n\t\t\t$text = $data[$tour][$colRef];\n\t\t\t$width = getTextWidth($text);\n\t\t\tif($width > $maxWidth){\n\t\t\t\t$maxWidth = $width;\n\t\t\t}\n\n\t\t\tif($excel){\n\t\t\t\tif(is_numeric($text)){\n\t\t\t\t\t$tourSheet->write_number($tour + 1, $col, intval($text));\n\t\t\t\t} else {\n\t\t\t\t\t$tourSheet->write_string($tour + 1, $col, $text);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($file)\n\t\t\t\tfwrite($f, \"Row: $tour, Col: $col, val: $text, width: $width\\t\");\n\n\t\t\t/*\n\t\t\t //formats do not work at the moment\n\t\t\t if($col == 0){\n\t\t\t\t$tourSheet->set_row($tour + 1, NULL, $formatOffset + ($tour % 2));\n\t\t\t}\n\t\t\t*/\n\t\t}\n\t\tif($file)\n\t\t\tfwrite($f, \"\\n\");\n\t\tif($excel)\n\t\t\t$tourSheet->set_column($col, $col, $maxWidth * (2.0/3.0));\n\t}\n\n\tfor($tour = 0; $tour < $numSemesterTours; $tour++){\n\t\tif($file)\n\t\t\tfwrite($f, \"Week 03: \".$tourWeekCounts[\"03\"].\"\\n\");\n\t\t//and now we add each tour to the stats\n\t\t$timestamp = strtotime($data[$tour]['tourTime']);\n\t\tif($file)\n\t\t\tfwrite($f, \"timestamp: $timestamp Time:\".$tour['tourTime'].\" Week: \".date('W', $timestamp).\"\\n\");\n\t\tif(($timestamp == false) || ($timestamp == -1)) continue;\n\t\t$tourDOW = intval(date('w', $timestamp));\n\t\t$tourDayCounts[\"$tourDOW\"] += 1;\n\t\t$tourWeek = intval(date('W', $timestamp));\n\t\t$tourWeekCounts[\"$tourWeek\"] += 1;\n\t\tif($tourDateCounts[\"$tourWeek\"] == null){\n\t\t\t$tourDateCounts[\"$tourWeek\"] = array_fill(0,7,0);\n\t\t}\n\t\t$tourDateCounts[\"$tourWeek\"][\"$tourDOW\"] += 1;\n\n\t\t//and create the date string for this week if it doesn't exist already\n\t\tif(!array_key_exists($tourWeek, $weekStrings)){\n\t\t\t$timeInfo = getdate($timestamp);\n\t\t\t$sunTimestamp = mktime(0,0,0, $timeInfo['mon'], $timeInfo['mday'] - $tourDOW, $timeInfo['year']);\n\t\t\t$satTimestamp = mktime(0,0,0, $timeInfo['mon'], $timeInfo['mday'] - $tourDOW + 6, $timeInfo['year']);\n\t\t\tif(date('M', $sunTimestamp) == date('M', $satTimestamp)){\n\t\t\t\t$timeStr = date('M j', $sunTimestamp) . ' - ' . date('j', $satTimestamp);\n\t\t\t} else {\n\t\t\t\t$timeStr = date('M j', $sunTimestamp) . ' - ' . date('M j', $satTimestamp);\n\t\t\t}\n\t\t\t$weekStrings[\"$tourWeek\"] = $timeStr;\n\t\t\t$tsl = getTextWidth($timeStr);\n\t\t\tif($tsl > $timeStringLength) $timeStringLength = $tsl;\n\t\t}\n\t}\n\n\tif(!$writeStats) return;\n\n\tif($excel)\n\t\t$statsSheet = &$workBook->add_worksheet($name.' Stats');\n\n\t//fill the column headers and set the the column widths\n\t$statsSheet->set_column(0, 0, $timeStringLength * (2.0/3.0));\n\t$statsSheet->write_string(0, 1, \"Monday\");\n\t$statsSheet->set_column(1, 1, getTextWidth(\"Monday\") * (2.0/3.0));\n\t$statsSheet->write_string(0, 2, \"Tuesday\");\n\t$statsSheet->set_column(2, 2, getTextWidth(\"Tuesday\") * (2.0/3.0));\n\t$statsSheet->write_string(0, 3, \"Wednesday\");\n\t$statsSheet->set_column(3, 3, getTextWidth(\"Wednesday\") * (2.0/3.0));\n\t$statsSheet->write_string(0, 4, \"Thursday\");\n\t$statsSheet->set_column(4, 4, getTextWidth(\"Thursday\") * (2.0/3.0));\n\t$statsSheet->write_string(0, 5, \"Friday\");\n\t$statsSheet->set_column(5, 5, getTextWidth(\"Friday\") * (2.0/3.0));\n\t$statsSheet->write_string(0, 6, \"Total\");\n\t$statsSheet->set_column(6, 6, getTextWidth(\"Total\") * (2.0/3.0));\n\n\t//then start populating all the data from the tours\n\t$numWeeks = count($tourDateCounts);\n\t$displayWeek = 0;\n\t//write the counts for each week\n\tfor($week = 0; $week < $numWeeks; $week++){\n\t\tif($file){\n\t\t\tfwrite($f, \"Week $week, Tours \".$tourWeekCounts[$week].\"\\n\");\n\t\t\tfor($i = 0; $i < 7; $i++){\n\t\t\t\tfwrite($f, \"Day $i, Tours \".$tourDateCounts[$week][$i].\"\\n\");\n\t\t\t}\n\t\t}\n\t\tif($tourWeekCounts[$week] == 0) continue;\n\t\t$statsSheet->write_string($displayWeek+1, 0, $weekStrings[$week]);\n\t\tfor($day = 1; $day < 6; $day++){\n\t\t\tif($excel)\n\t\t\t\t$statsSheet->write_number($displayWeek + 1, $day, $tourDateCounts[$week][$day]);\n\t\t\tif($file)\n\t\t\t\tfwrite($f, \"Week $week, Day $day, Tours \".$tourDateCounts[$week][$day].\"\\n\");\n\t\t}\n\t\t//write the totals for each week\n\t\tif($excel)\n\t\t\t$statsSheet->write_number($displayWeek + 1, 6, $tourWeekCounts[$week]);\n\t\tif($file)\n\t\t\tfwrite($f, \"Week $week, Total Tours \".$tourWeekCounts[$week].\"\\n\");\n\t\t$displayWeek++;\n\t}\n\t//then write the totals for the semester\n\tfor($day = 1; $day < 6; $day++){\n\t\tif($excel)\n\t\t\t$statsSheet->write_number($displayWeek + 1, $day, $tourDayCounts[$day]);\n\t\tif($file)\n\t\t\tfwrite($f, \"Day $day, Total Tours \".$tourDayCounts[$day].\"\\n\");\n\t}\n\n\tif($excel)\n\t\t$statsSheet->write_number($displayWeek + 1, 6, $numSemesterTours);\n\tif($file)\n\t\tfwrite($f, \"Total Tours: $numSemesterTours\\n\");\n\n\tunset($tourDayCounts);\n\tunset($tourWeekCounts);\n\tunset($tourDateCounts);\n\tunset($weekStrings);\n}", "function writePageTree() {\n if (count($pages) == 0)\n throw new IOException(\"The document has no pages.\");\n $leaf = 1;\n $tParents = parents;\n $tPages = pages;\n $nextParents = array();\n while (TRUE) {\n $leaf *= $leafSize;\n $stdCount = $leafSize;\n $rightCount = count($tPages) % $leafSize;\n if ($rightCount == 0)\n $rightCount = $leafSize;\n for ($p = 0; $p < count($tParents); ++$p) {\n $count = 0;\n $thisLeaf = $leaf;\n if ($p == count($tParents) - 1) {\n $count = $rightCount;\n $thisLeaf = count($pages) % $leaf;\n if ($thisLeaf == 0)\n $thisLeaf = $leaf;\n }\n else\n $count = $stdCount;\n $top = new PdfDictionary(PdfName::$PAGES);\n $top->put(PdfName::COUNT, new PdfNumber($thisLeaf));\n $kids = new PdfArray();\n $internal = $kids->getArrayList();\n $arraySublist = array();\n for ($k = $p * $stdCount; $k <= $p * $stdCount + $count; $k++)\n {\n array_push($arraySublist, $tPages[$k]);\n }\n $internal = array_merge($internal, $arraySublist);\n $top->put(PdfName::$KIDS, $kids);\n if (count($tParents) > 1) {\n if (($p % $leafSize) == 0)\n array_push($nextParents, $writer->getPdfIndirectReference());\n $top->put(PdfName::$PARENT, $nextParents[$p / $leafSize]);\n }\n $writer->addToBody($top, $tParents[$p]);\n }\n if (count($tParents) == 1) {\n $topParent = $tParents[0];\n return $topParent;\n }\n $tPages = $tParents;\n $tParents = $nextParents;\n $nextParents = array();\n }\n }", "public function write(): string\n {\n\n $msg = \"\";\n foreach ($this->tree as $tree) {\n $msg .= $tree[0]::toHl7($tree) . chr(13); //carriage return\n }\n return $msg;\n }", "function putInTree()\n\t{\n//echo \"st:putInTree\";\n\t\t// chapters should be behind pages in the tree\n\t\t// so if target is first node, the target is substituted with\n\t\t// the last child of type pg\n\t\tif ($_GET[\"target\"] == IL_FIRST_NODE)\n\t\t{\n\t\t\t$tree = new ilTree($this->content_object->getId());\n\t\t\t$tree->setTableNames('lm_tree','lm_data');\n\t\t\t$tree->setTreeTablePK(\"lm_id\");\n\n\t\t\t// determine parent node id\n\t\t\t$parent_id = (!empty($_GET[\"obj_id\"]))\n\t\t\t\t? $_GET[\"obj_id\"]\n\t\t\t\t: $tree->getRootId();\n\t\t\t// determine last child of type pg\n\t\t\t$childs =& $tree->getChildsByType($parent_id, \"pg\");\n\t\t\tif (count($childs) != 0)\n\t\t\t{\n\t\t\t\t$_GET[\"target\"] = $childs[count($childs) - 1][\"obj_id\"];\n\t\t\t}\n\t\t}\n\t\tif (empty($_GET[\"target\"]))\n\t\t{\n\t\t\t$_GET[\"target\"] = IL_LAST_NODE;\n\t\t}\n\n\t\tparent::putInTree();\n\t}", "private function write_data_to_db()\r\n {\r\n $dic_depth = 1;\r\n \r\n for ($dic_depth = 1; $dic_depth < 6; $dic_depth++)\r\n {\r\n foreach ($this->directory_array[$dic_depth] as $id => $dic_node)\r\n {\r\n // create node is not existed, get id when existed\r\n $ret = $this->add_testsuite_node_to_db($dic_depth, $dic_node);\r\n \r\n // create testcase under testsuite\r\n if ($ret)\r\n {\r\n $this->add_testcase_nodes_to_db($dic_depth, $dic_node);\r\n }\r\n }\r\n }\r\n }", "public function close(): void\n {\n $phpSheet = $this->phpSheet;\n\n // Storing selected cells and active sheet because it changes while parsing cells with formulas.\n $selectedCells = $this->phpSheet->getSelectedCells();\n $activeSheetIndex = $this->phpSheet->getParentOrThrow()->getActiveSheetIndex();\n\n // Write BOF record\n $this->storeBof(0x0010);\n\n // Write PRINTHEADERS\n $this->writePrintHeaders();\n\n // Write PRINTGRIDLINES\n $this->writePrintGridlines();\n\n // Write GRIDSET\n $this->writeGridset();\n\n // Calculate column widths\n $phpSheet->calculateColumnWidths();\n\n // Column dimensions\n if (($defaultWidth = $phpSheet->getDefaultColumnDimension()->getWidth()) < 0) {\n $defaultWidth = \\PhpOffice\\PhpSpreadsheet\\Shared\\Font::getDefaultColumnWidthByFont($phpSheet->getParentOrThrow()->getDefaultStyle()->getFont());\n }\n\n $columnDimensions = $phpSheet->getColumnDimensions();\n $maxCol = $this->lastColumnIndex - 1;\n for ($i = 0; $i <= $maxCol; ++$i) {\n $hidden = 0;\n $level = 0;\n $xfIndex = 15; // there are 15 cell style Xfs\n\n $width = $defaultWidth;\n\n $columnLetter = Coordinate::stringFromColumnIndex($i + 1);\n if (isset($columnDimensions[$columnLetter])) {\n $columnDimension = $columnDimensions[$columnLetter];\n if ($columnDimension->getWidth() >= 0) {\n $width = $columnDimension->getWidth();\n }\n $hidden = $columnDimension->getVisible() ? 0 : 1;\n $level = $columnDimension->getOutlineLevel();\n $xfIndex = $columnDimension->getXfIndex() + 15; // there are 15 cell style Xfs\n }\n\n // Components of columnInfo:\n // $firstcol first column on the range\n // $lastcol last column on the range\n // $width width to set\n // $xfIndex The optional cell style Xf index to apply to the columns\n // $hidden The optional hidden atribute\n // $level The optional outline level\n $this->columnInfo[] = [$i, $i, $width, $xfIndex, $hidden, $level];\n }\n\n // Write GUTS\n $this->writeGuts();\n\n // Write DEFAULTROWHEIGHT\n $this->writeDefaultRowHeight();\n // Write WSBOOL\n $this->writeWsbool();\n // Write horizontal and vertical page breaks\n $this->writeBreaks();\n // Write page header\n $this->writeHeader();\n // Write page footer\n $this->writeFooter();\n // Write page horizontal centering\n $this->writeHcenter();\n // Write page vertical centering\n $this->writeVcenter();\n // Write left margin\n $this->writeMarginLeft();\n // Write right margin\n $this->writeMarginRight();\n // Write top margin\n $this->writeMarginTop();\n // Write bottom margin\n $this->writeMarginBottom();\n // Write page setup\n $this->writeSetup();\n // Write sheet protection\n $this->writeProtect();\n // Write SCENPROTECT\n $this->writeScenProtect();\n // Write OBJECTPROTECT\n $this->writeObjectProtect();\n // Write sheet password\n $this->writePassword();\n // Write DEFCOLWIDTH record\n $this->writeDefcol();\n\n // Write the COLINFO records if they exist\n if (!empty($this->columnInfo)) {\n $colcount = count($this->columnInfo);\n for ($i = 0; $i < $colcount; ++$i) {\n $this->writeColinfo($this->columnInfo[$i]);\n }\n }\n $autoFilterRange = $phpSheet->getAutoFilter()->getRange();\n if (!empty($autoFilterRange)) {\n // Write AUTOFILTERINFO\n $this->writeAutoFilterInfo();\n }\n\n // Write sheet dimensions\n $this->writeDimensions();\n\n // Row dimensions\n foreach ($phpSheet->getRowDimensions() as $rowDimension) {\n $xfIndex = $rowDimension->getXfIndex() + 15; // there are 15 cellXfs\n $this->writeRow(\n $rowDimension->getRowIndex() - 1,\n (int) $rowDimension->getRowHeight(),\n $xfIndex,\n !$rowDimension->getVisible(),\n $rowDimension->getOutlineLevel()\n );\n }\n\n // Write Cells\n foreach ($phpSheet->getCellCollection()->getSortedCoordinates() as $coordinate) {\n /** @var Cell $cell */\n $cell = $phpSheet->getCellCollection()->get($coordinate);\n $row = $cell->getRow() - 1;\n $column = Coordinate::columnIndexFromString($cell->getColumn()) - 1;\n\n // Don't break Excel break the code!\n if ($row > 65535 || $column > 255) {\n throw new WriterException('Rows or columns overflow! Excel5 has limit to 65535 rows and 255 columns. Use XLSX instead.');\n }\n\n // Write cell value\n $xfIndex = $cell->getXfIndex() + 15; // there are 15 cell style Xfs\n\n $cVal = $cell->getValue();\n if ($cVal instanceof RichText) {\n $arrcRun = [];\n $str_pos = 0;\n $elements = $cVal->getRichTextElements();\n foreach ($elements as $element) {\n // FONT Index\n $str_fontidx = 0;\n if ($element instanceof Run) {\n $getFont = $element->getFont();\n if ($getFont !== null) {\n $str_fontidx = $this->fontHashIndex[$getFont->getHashCode()];\n }\n }\n $arrcRun[] = ['strlen' => $str_pos, 'fontidx' => $str_fontidx];\n // Position FROM\n $str_pos += StringHelper::countCharacters($element->getText(), 'UTF-8');\n }\n $this->writeRichTextString($row, $column, $cVal->getPlainText(), $xfIndex, $arrcRun);\n } else {\n switch ($cell->getDatatype()) {\n case DataType::TYPE_STRING:\n case DataType::TYPE_INLINE:\n case DataType::TYPE_NULL:\n if ($cVal === '' || $cVal === null) {\n $this->writeBlank($row, $column, $xfIndex);\n } else {\n $this->writeString($row, $column, $cVal, $xfIndex);\n }\n\n break;\n case DataType::TYPE_NUMERIC:\n $this->writeNumber($row, $column, $cVal, $xfIndex);\n\n break;\n case DataType::TYPE_FORMULA:\n $calculatedValue = $this->preCalculateFormulas ?\n $cell->getCalculatedValue() : null;\n if (self::WRITE_FORMULA_EXCEPTION == $this->writeFormula($row, $column, $cVal, $xfIndex, $calculatedValue)) {\n if ($calculatedValue === null) {\n $calculatedValue = $cell->getCalculatedValue();\n }\n $calctype = gettype($calculatedValue);\n switch ($calctype) {\n case 'integer':\n case 'double':\n $this->writeNumber($row, $column, (float) $calculatedValue, $xfIndex);\n\n break;\n case 'string':\n $this->writeString($row, $column, $calculatedValue, $xfIndex);\n\n break;\n case 'boolean':\n $this->writeBoolErr($row, $column, (int) $calculatedValue, 0, $xfIndex);\n\n break;\n default:\n $this->writeString($row, $column, $cVal, $xfIndex);\n }\n }\n\n break;\n case DataType::TYPE_BOOL:\n $this->writeBoolErr($row, $column, $cVal, 0, $xfIndex);\n\n break;\n case DataType::TYPE_ERROR:\n $this->writeBoolErr($row, $column, ErrorCode::error($cVal), 1, $xfIndex);\n\n break;\n }\n }\n }\n\n // Append\n $this->writeMsoDrawing();\n\n // Restoring active sheet.\n $this->phpSheet->getParentOrThrow()->setActiveSheetIndex($activeSheetIndex);\n\n // Write WINDOW2 record\n $this->writeWindow2();\n\n // Write PLV record\n $this->writePageLayoutView();\n\n // Write ZOOM record\n $this->writeZoom();\n if ($phpSheet->getFreezePane()) {\n $this->writePanes();\n }\n\n // Restoring selected cells.\n $this->phpSheet->setSelectedCells($selectedCells);\n\n // Write SELECTION record\n $this->writeSelection();\n\n // Write MergedCellsTable Record\n $this->writeMergedCells();\n\n // Hyperlinks\n $phpParent = $phpSheet->getParent();\n $hyperlinkbase = ($phpParent === null) ? '' : $phpParent->getProperties()->getHyperlinkBase();\n foreach ($phpSheet->getHyperLinkCollection() as $coordinate => $hyperlink) {\n [$column, $row] = Coordinate::indexesFromString($coordinate);\n\n $url = $hyperlink->getUrl();\n\n if (strpos($url, 'sheet://') !== false) {\n // internal to current workbook\n $url = str_replace('sheet://', 'internal:', $url);\n } elseif (preg_match('/^(http:|https:|ftp:|mailto:)/', $url)) {\n // URL\n } elseif (!empty($hyperlinkbase) && preg_match('~^([A-Za-z]:)?[/\\\\\\\\]~', $url) !== 1) {\n $url = \"$hyperlinkbase$url\";\n if (preg_match('/^(http:|https:|ftp:|mailto:)/', $url) !== 1) {\n $url = 'external:' . $url;\n }\n } else {\n // external (local file)\n $url = 'external:' . $url;\n }\n\n $this->writeUrl($row - 1, $column - 1, $url);\n }\n\n $this->writeDataValidity();\n $this->writeSheetLayout();\n\n // Write SHEETPROTECTION record\n $this->writeSheetProtection();\n $this->writeRangeProtection();\n\n // Write Conditional Formatting Rules and Styles\n $this->writeConditionalFormatting();\n\n $this->storeEof();\n }", "public function menu_tree_output($tree)\n {\n return menu_tree_output($tree);\n }", "abstract public function tree_encoder();", "public function write(Spreadsheet $spreadsheet) {\n\t\t$writer = $this->getWriter($spreadsheet);\n\t\t$success = $writer->save($this->getFilepath());\n\t\treturn true;\n\t}", "private function saveToXml(){\n\t\n\t\t//XML-Object\n\t\t$xml = new LegosXmlWriter();\t\n\t\n\t\t// Name Worksheet\n\t\t$xml->setWorksheetName( \"Mission $this->missionId\" );\n\t\n\t\t// Write data\n\t\t$xml->writeData ( \"Mission No. $this->missionId\", 1, 1 );\n\t\t\n\t\t$xml->writeData ( \"DCM TIME + unloading, loading\", 2, 1 );\n\t\t$xml->writeData ( $this->dcmTime, 2, 2 );\n\t\t\n\t\t$xml->writeData ( \"PCM Start\", 3, 1 );\n\t\t$xml->writeData ( $this->pcmStart, 3, 2 );\n\t\t\n\t\t$xml->writeData ( \"PCM End\", 4, 1 );\n\t\t$xml->writeData ( $this->pcmEnd, 4, 2 );\n\t\t\n\t\t$xml->writeData ( \"PCM TIME\", 5, 1 );\n\t\t$xml->writeData ( $this->pcmTime, 5, 2 );\n\t\t\n\t\t$xml->writeData ( \"Total Mission Time \", 6, 1 );\n\t\t$xml->writeData ( $this->totalTime, 6, 2 );\n\t\t\n\t\t$xml->writeData ( \"Pushback Start\", 7, 1 );\n\t\t$xml->writeData ( $this->pushbackStart, 7, 2 );\n\t\t\n\t\t$xml->writeData ( \"Pushback End\", 8, 1 );\n\t\t$xml->writeData ( $this->pushbackEnd, 8, 2 );\n\t\t\n\t\t$xml->writeData ( \"Pushback TIME\", 9, 1 );\n\t\t$xml->writeData ( $this->pushbackTime, 9, 2 );\n\t\n\t\t$exportFilename = \"Export_Mission_$this->missionId \" . date ( 'Y-m-d h:i:s' ) . '.xls';\n\t\n\t\tfile_put_contents( sfConfig::get( 'app_export_path' ). \"/\". $exportFilename, $xml->getFile());\n\t\n\t\treturn $exportFilename;\n\t\n\t}", "public function writeTree(Tx_PtExtbase_Tree_TreeInterface $tree)\n {\n $this->traverseTreeDfs($tree);\n $nodeArray = $this->arrayWriterVisitor->getNodeArray();\n return $nodeArray;\n }", "public function asXml(&$sheets, $sourceCharset = 'utf-8') {\r\n $doc = new SimpleXMLElement(\r\n'<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Workbook xmlns=\"urn:schemas-microsoft-com:office:spreadsheet\"\r\n xmlns:o=\"urn:schemas-microsoft-com:office:office\"\r\n xmlns:x=\"urn:schemas-microsoft-com:office:excel\"\r\n xmlns:ss=\"urn:schemas-microsoft-com:office:spreadsheet\"\r\n xmlns:html=\"http://www.w3.org/TR/REC-html40\"></Workbook>'\r\n);\r\n\r\n \r\n $convArgs = array(\r\n 'sourceCharset' => &$sourceCharset,\r\n 'iconv' => ($sourceCharset == 'utf-8' ? false : true)\r\n );\r\n\r\n $indexOfSheet = 0;\r\n foreach ($sheets as $sheet) :\r\n //<Worksheet ss:Name=\"Sheet1\">\r\n //<Table>\r\n $worksheetNode = $doc->addChild('Worksheet');\r\n //$worksheetNode->addAttribute('ss:Name', 'sheet1');//BUG?\r\n $worksheetNode['ss:Name'] = 'sheet' . (++$indexOfSheet);\r\n\r\n $worksheetNode->Table = '';//add a child with value '' by setter\r\n //$tableNode = $worksheetNode->addChild('Table');/add a child by addChild()\r\n\r\n if ( !array_key_exists(0, $sheet[0]) ) {\r\n //an associative array, write header fields.\r\n $rowNode = $worksheetNode->Table->addChild('Row');\r\n foreach(array_keys($sheet[0]) as $fieldName) {\r\n $cellNode = $rowNode->addChild('Cell');\r\n $cellNode->Data = self::convCellData($convArgs, $fieldName);\r\n $cellNode->Data['ss:Type'] = 'String';\r\n }\r\n }\r\n\r\n foreach ($sheet as $row) :\r\n //<Row>\r\n $rowNode = $worksheetNode->Table->addChild('Row');\r\n foreach ($row as $col) :\r\n //<Cell><Data ss:Type=\"Number\">1</Data></Cell>\r\n $cellNode = $rowNode->addChild('Cell');\r\n $cellNode->Data = self::convCellData($convArgs, $col);\r\n $cellNode->Data['ss:Type'] = (\r\n (!is_string($col) or (is_numeric($col) and $col[0] != '0'))\r\n ? 'Number'\r\n : 'String'\r\n );\r\n endforeach;//$row as $col\r\n endforeach;//$sheet as $row\r\n endforeach;//$sheets as $sheet\r\n return $doc->asXML();\r\n }", "function exportFOPageObjects(&$a_xml_writer)\n\t{\n\t\tglobal $ilBench;\n\n\t\t$this->tree = new ilTree($this->getLmId());\n\t\t$this->tree->setTableNames('lm_tree', 'lm_data');\n\t\t$this->tree->setTreeTablePK(\"lm_id\");\n\n\t\t$childs = $this->tree->getChilds($this->getId());\n\t\tforeach ($childs as $child)\n\t\t{\n\t\t\tif($child[\"type\"] != \"pg\")\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// export xml to writer object\n\t\t\t//$ilBench->start(\"ContentObjectExport\", \"exportStructureObject_exportPageObjectAlias\");\n\n\t\t\t$page_obj = new ilLMPageObject($this->getContentObject(), $child[\"obj_id\"]);\n\t\t\t$page_obj->exportFO($a_xml_writer);\n\n\t\t\t//$ilBench->stop(\"ContentObjectExport\", \"exportStructureObject_exportPageObjectAlias\");\n\t\t}\n\t}", "private function writeGridset(): void\n {\n $record = 0x0082; // Record identifier\n $length = 0x0002; // Bytes to follow\n\n $fGridSet = !$this->phpSheet->getPrintGridlines(); // Boolean flag\n\n $header = pack('vv', $record, $length);\n $data = pack('v', $fGridSet);\n $this->append($header . $data);\n }", "abstract protected function getWriter(Spreadsheet $spreadsheet);", "function wp_print_theme_file_tree($tree, $level = 2, $size = 1, $index = 1)\n {\n }", "function writeDom($dom, $file_name){\n @$dom->validate();\n if(!$handle=fopen(dirname(__FILE__).\"/\".$file_name, 'w')){\n exit(\"Cannot open $filename\");\n }\n\n $dom->preserveWhiteSpace = false;\n $dom->formatOutput = false;\n if (fwrite($handle, $dom->saveXML()) === FALSE) {\n fclose($handle);\n exit(\"Cannot write to $file_name\");\n }\n}", "function crea_riga_sheet($writer, $titoloSheet, $utente_compilazione, $utente_valutato, $risposte) {\n $row = [$utente_compilazione, $utente_valutato];\n for($i = 0; $i < count($risposte); $i++){\n $row[] = $risposte[$i]->get_desc_risposta();\n $row[] = $risposte[$i]->prodotto;\n $row[] = $risposte[$i]->note;\n }\n $row = array_map(function($x){return ($x != null) ? $x : \"-\";}, $row);\n $writer->writeSheetRow($titoloSheet, $row);\n }", "public function toTree()\n {\n throw new RuntimeException('This repository does not support \"toTree\" method.');\n }", "private function write_csv($array) //public function write_address_book($addresses_array) //code to write $addresses_array to file $this->filenam\n {\n if(is_writeable($this->filename)){\n $handle = fopen($this->filename, 'w');\n foreach($addresses_array as $subArray){\n fputcsv($handle, $subArray); \n }\n }\n fclose($handle);\n }", "public function createHierarchy(){\n\t\tmysqli_query($this->db, \"TRUNCATE TABLE hierarchy\");\n\t\t\n\t\t$insert_sql = \"INSERT INTO hierarchy VALUES\";\n\t\tforeach ($this->structure as $key => $value) {\n\t\t\t$position = $value['number'] + 1;\n\t\t\t$rows[] = \"('', '{$key}', '{$position}')\";\n\t\t}\n\t\t$insert_sql = $insert_sql.implode(\",\", $rows);\n\t\tmysqli_query($this->db, $insert_sql);\n\t}", "public function save($path) {\n $objWriter = PHPExcel_IOFactory::createWriter($this->excel, 'Excel5');\n $objWriter->save($path);\n }", "private function writePanes(): void\n {\n if (!$this->phpSheet->getFreezePane()) {\n // thaw panes\n return;\n }\n\n [$column, $row] = Coordinate::indexesFromString($this->phpSheet->getFreezePane());\n $x = $column - 1;\n $y = $row - 1;\n\n [$leftMostColumn, $topRow] = Coordinate::indexesFromString($this->phpSheet->getTopLeftCell() ?? '');\n //Coordinates are zero-based in xls files\n $rwTop = $topRow - 1;\n $colLeft = $leftMostColumn - 1;\n\n $record = 0x0041; // Record identifier\n $length = 0x000A; // Number of bytes to follow\n\n // Determine which pane should be active. There is also the undocumented\n // option to override this should it be necessary: may be removed later.\n $pnnAct = 0;\n if ($x != 0 && $y != 0) {\n $pnnAct = 0; // Bottom right\n }\n if ($x != 0 && $y == 0) {\n $pnnAct = 1; // Top right\n }\n if ($x == 0 && $y != 0) {\n $pnnAct = 2; // Bottom left\n }\n if ($x == 0 && $y == 0) {\n $pnnAct = 3; // Top left\n }\n\n $this->activePane = $pnnAct; // Used in writeSelection\n\n $header = pack('vv', $record, $length);\n $data = pack('vvvvv', $x, $y, $rwTop, $colLeft, $pnnAct);\n $this->append($header . $data);\n }", "function writeXMLFile($node, $filename) {\n\tglobal $gui_writedir;\n\t$previous_dir = getcwd();\n\tchdir($gui_writedir);\n\t$file = fopen($filename, 'w+');\n\t$result = fwrite($file, $node->asXML());\n\tif (!$result) {\n\t\tfclose($file);\n\t\tdie(\"Failed to write $filename\\n\");\n\t}\n\techo \"Successfully wrote $filename<br />\";\n\tfclose($file);\n\tchdir($previous_dir);\n}", "public function save( $settings=array() )\n\t{\n\t\tif ( empty($this->_spreadsheet) )\n\t\t\t$this->create();\n\n\t\t//Used for saving sheets\n\t\trequire self::VENDOR_PACKAGE.'IOFactory.php';\n\n $way = '/var/www/svarog/data/www/vfmpei.141592.org/Download/meteo/';\n\n\t\t$settings = array_merge(array(\n\t\t\t'format'\t\t=> 'Excel2007',\n\t\t\t'path'\t\t\t=> $way,\n\t\t\t'name'\t\t\t=> 'NewSpreadsheet'\n\n\t\t), $settings);\n\n $href = $settings['name'] . '_'.time().'.xlsx';\n\t\t//Generate full path\n\t\t$settings['fullpath'] = $settings['path'] . $href;\n\n\t\t$Writer = PHPExcel_IOFactory::createWriter($this->_spreadsheet, $settings['format']);\n\t\t// If you want to output e.g. a PDF file, simply do:\n\t\t//$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'PDF');\n\t\t$Writer->save( $settings['fullpath'] );\n\n\t\treturn $href;\n\t}", "function saveFolderXML(){\n\t\t\t$folders = new SimpleXMLElement(\"<folders></folders>\");\n\t\t\tforeach ($this -> folderMap as $id => $fname){\n\t\t\t\t\n\t\t\t\t$folder = $folders->addChild('folder');\n\t\t\t\t$folder->addAttribute('id', $id);\n\t\t\t\t$folder->addAttribute('name', $fname);\n\t\t\t}\n\t\t\t$fh = fopen($_SERVER['DOCUMENT_ROOT'].\"/\".$this -> rootFolder.\"/folderList.xml\", 'w');\n\t\t\tfwrite($fh, $folders -> asXML());\n\t\t\tfclose($fh);\n\t\t}", "public function export($data)\n {\n $data = array($this->root => $data);\n\n echo '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>';\n $this->recurse($data, 0);\n echo PHP_EOL;\n }", "private function writeXML($array){\n\t\tif(!class_exists('XML_Serializer')){\n\t\t\t\trequire_once('XML/Serializer.php');\n\t\t}\n\n\t\t\t$options = array(\n\t\t\t\tXML_SERIALIZER_OPTION_INDENT => \"\\t\", // indent with tabs\n\t\t\t\tXML_SERIALIZER_OPTION_RETURN_RESULT => true,\n\t\t\t\tXML_SERIALIZER_OPTION_LINEBREAKS => \"\\n\", // use UNIX line breaks\n\t\t\t\tXML_SERIALIZER_OPTION_ROOT_NAME => 'data',// root tag\n\t\t\t\tXML_SERIALIZER_OPTION_DEFAULT_TAG => 'item' // tag for values \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t // with numeric keys\n\t\t );\n\t\t \n\t\t\t$serializer = new XML_Serializer($options);\n \t\treturn \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\".\"\\n\".$serializer->serialize($array);\n\t}", "function writeHTML()\n\t{\n\t\tglobal $_activeTree;\n\t\t\n\t\t$_activeTree= $this;\n\t\t\n\t\t$this->writeScript();\n\t\t$width = is_numeric($this->width) ? \"{$this->width}px\" : $this->width;\n\t\t$height = is_numeric($this->height) ? \"{$this->height}px\" : $this->height;\n\t\t\n\t\tif ($this->selectMode == \"single\")\n\t\t{\n?>\n<input type='hidden' name='<?echo $this->id ?>' id='<?echo $this->id?>' value='<?echo $this->value ?>'/>\n<? \n\t\t}\n?><table id=\"<?echo $this->id?>_table\" class=\"<? echo $this->style?>\" cellpadding=\"0\" cellspacing=\"0\" <? if ($this->width) echo \"style='width:{$width}'\"; ?>>\n\t\t <? \n\t\t if ($this->title)\n\t\t {\n\t\t ?>\t\t \n\t\t <tr>\n\t\t <th><? echo $this->title?></th>\n\t\t </tr>\n\t\t <?\n\t\t }\n\t\t ?>\n\t\t <tr>\n\t\t <td>\n\t\t <div style=\"padding: 0; margin: 0; width: 100%;<? if ($this->height > 0) { ?> height: <?echo $this->height?>px;<? } ?><?if ($this->scroll) echo \"overflow: auto\"?>\">\n<?\n\t\t$this->writeNodes();\n?>\n\t\t </div>\n\t\t </td>\n\t\t </tr>\n\t\t</table>\n<?\n\t\t$_activeTree = null;\n\t}" ]
[ "0.51819813", "0.5128529", "0.5111114", "0.5072464", "0.5047711", "0.50272876", "0.49843073", "0.4947742", "0.49133575", "0.48999193", "0.4873075", "0.4828034", "0.4792358", "0.47884977", "0.4770568", "0.4751768", "0.4707483", "0.47046813", "0.46909052", "0.46898842", "0.46844518", "0.46363506", "0.46353632", "0.45820874", "0.4577324", "0.45744607", "0.4557448", "0.45468086", "0.45083272", "0.4478699" ]
0.60947543
0
/ end po15 head cleanup remove WP version from RSS
function po_rss_version() { return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function theme_rss_version() { return ''; }", "function mdwpfp_rss_version() { return ''; }", "function wpgrade_rss_version() { return ''; }", "function spartan_rss_version() { return ''; }", "function bulledev_rss_version() { return ''; }", "function bones_rss_version() { return ''; }", "public function remove_rss_version() {\n\t\treturn '';\n\t}", "public function remove_rss_version() {\n return '';\n }", "function tlh_rss_version() {\n\treturn '';\n}", "function bones_rss_version()\n{\n\treturn '';\n}", "function cardealer_rss_version() {\r\n\treturn '';\r\n}", "function wpcom_vip_remove_mediacontent_from_rss2_feed() {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n}", "function remove_thefeeds()\r\n{\r\n remove_theme_support( 'automatic-feed-links' ); //remove feed links in head\r\n}", "function permalink_single_rss($deprecated = '')\n {\n }", "function get_wp_title_rss($deprecated = '&#8211;')\n {\n }", "function remove_versao_wp() { return ''; }", "function remove_versao_wp() { return ''; }", "function pd_head_cleanup()\n{\n\n /* ===============\n Remove RSS from header\n =============== */\n remove_action('wp_head', 'rsd_link'); #remove page feed\n remove_action('wp_head', 'feed_links_extra', 3); // Remove category feeds\n remove_action('wp_head', 'feed_links', 2); // Remove Post and Comment Feeds\n\n\n /* ===============\n remove windindows live writer link\n =============== */\n remove_action('wp_head', 'wlwmanifest_link');\n\n\n /* ===============\n links for adjacent posts\n =============== */\n remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);\n\n\n /* ===============\n WP version\n =============== */\n remove_action('wp_head', 'wp_generator');\n\n\n /* ===============\n remove WP version from css\n =============== */\n add_filter('style_loader_src', 'pd_remove_wp_ver_css_js', 9999);\n\n\n /* ===============\n remove Wp version from scripts\n =============== */\n add_filter('script_loader_src', 'pd_remove_wp_ver_css_js', 9999);\n}", "function wpgrade_head_cleanup() {\r\n\t// Remove WP version\r\n\tremove_action( 'wp_head', 'wp_generator' );\r\n\t\r\n\tremove_action( 'wp_head', 'rsd_link' );\r\n\t// windows live writer\r\n\tremove_action( 'wp_head', 'wlwmanifest_link' );\r\n\t\r\n\t// remove WP version from css - those parameters can prevent caching\r\n\t//add_filter( 'style_loader_src', 'wpgrade_noversion_css_js', 9999 );\r\n\t// remove WP version from scripts - those parameters can prevent caching\r\n\t//add_filter( 'script_loader_src', 'wpgrade_noversion_css_js', 9999 );\r\n\r\n}", "function wp_title_rss($deprecated = '&#8211;')\n {\n }", "function wpversion_remove_version() {\n return '';\n }", "function getVersion() {\n\t\treturn DOMIT_RSS_VERSION;\n\t}", "function newenglish_head_cleanup() {\n // Originally from http://wpengineer.com/1438/wordpress-header/\n remove_action('wp_head', 'feed_links_extra', 3);\n add_action('wp_head', 'ob_start', 1, 0);\n add_action('wp_head', function () {\n $pattern = '/.*' . preg_quote(esc_url(get_feed_link('comments_' . get_default_feed())), '/') . '.*[\\r\\n]+/';\n echo preg_replace($pattern, '', ob_get_clean());\n }, 3, 0);\n remove_action('wp_head', 'rsd_link');\n remove_action('wp_head', 'wlwmanifest_link');\n remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10);\n remove_action('wp_head', 'wp_generator');\n remove_action('wp_head', 'wp_shortlink_wp_head', 10);\n remove_action('wp_head', 'print_emoji_detection_script', 7);\n remove_action('admin_print_scripts', 'print_emoji_detection_script');\n remove_action('wp_print_styles', 'print_emoji_styles');\n remove_action('admin_print_styles', 'print_emoji_styles');\n remove_action('wp_head', 'wp_oembed_add_discovery_links');\n remove_action('wp_head', 'wp_oembed_add_host_js');\n remove_action('wp_head', 'rest_output_link_wp_head', 10);\n remove_filter('the_content_feed', 'wp_staticize_emoji');\n remove_filter('comment_text_rss', 'wp_staticize_emoji');\n remove_filter('wp_mail', 'wp_staticize_emoji_for_email');\n add_filter('use_default_gallery_style', '__return_false');\n add_filter('emoji_svg_url', '__return_false');\n add_filter('show_recent_comments_widget_style', '__return_false');\n}", "function remove_wordpress_version() {\n remove_filter( 'update_footer', 'core_update_footer' );\n}", "function cleaning_wp(){\n remove_action('wp_head', 'wp_generator'); // remove WP tag\n\n remove_action( 'wp_head', 'feed_links_extra', 3 ); // remove extra feeds\n remove_action( 'wp_head', 'feed_links', 2 ); // remove general feeds\n remove_action( 'wp_head', 'rsd_link' ); // remove RSD link\n remove_action( 'wp_head', 'wlwmanifest_link' ); // remove manifest link\n remove_action( 'wp_head', 'index_rel_link' ); // remove index link\n remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 ); // remove prev link\n remove_action( 'wp_head', 'start_post_rel_link', 10, 0 ); // remove start link\n remove_action( 'wp_head', 'adjacent_posts_rel_link', 10, 0 ); // remove links to adjacent posts\n remove_action( 'wp_head', 'wp_shortlink_wp_head'); // remove shortlink\n\n // disable admin bar\n add_filter('the_generator', '__return_false');\n add_filter('show_admin_bar','__return_false');\n\n // disable emoji\n remove_action( 'wp_head', 'print_emoji_detection_script', 7);\n remove_action( 'wp_print_styles', 'print_emoji_styles' );\n\n // disbale json\n remove_action( 'wp_head', 'rest_output_link_wp_head' );\n remove_action( 'wp_head', 'wp_oembed_add_discovery_links' );\n remove_action( 'template_redirect', 'rest_output_link_header', 11 );\n}", "public function head_cleanup() {\n\t\tremove_action('wp_head', 'feed_links_extra', 3);\n\t\tadd_action('wp_head', 'ob_start', 1, 0);\n\t\tadd_action('wp_head', function () {\n\t\t\t$pattern = '/.*' . preg_quote(esc_url(get_feed_link('comments_' . get_default_feed())), '/') . '.*[\\r\\n]+/';\n\t\t\techo preg_replace($pattern, '', ob_get_clean());\n\t\t}, 3, 0);\n\n\t\tremove_action('wp_head', 'rsd_link');\n\t\tremove_action('wp_head', 'wlwmanifest_link');\n\t\tremove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);\n\t\tremove_action('wp_head', 'wp_generator');\n\t\tremove_action('wp_head', 'wp_shortlink_wp_head', 10, 0);\n\t\tremove_action('wp_head', 'print_emoji_detection_script', 7);\n\t\tremove_action('admin_print_scripts', 'print_emoji_detection_script');\n\t\tremove_action('wp_print_styles', 'print_emoji_styles');\n\t\tremove_action('admin_print_styles', 'print_emoji_styles');\n\t\tremove_action('wp_head', 'wp_oembed_add_discovery_links');\n\t\tremove_action('wp_head', 'wp_oembed_add_host_js');\n\t\tremove_action('wp_head', 'rest_output_link_wp_head', 10, 0);\n\t\tremove_filter('the_content_feed', 'wp_staticize_emoji');\n\t\tremove_filter('comment_text_rss', 'wp_staticize_emoji');\n\t\tremove_filter('wp_mail', 'wp_staticize_emoji_for_email');\n\t\tadd_filter('use_default_gallery_style', '__return_false');\n\n\t\tglobal $wp_widget_factory;\n\n\t\tif (isset($wp_widget_factory->widgets['WP_Widget_Recent_Comments'])) {\n\t\t\tremove_action('wp_head', [$wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style']);\n\t\t}\n\n\t\tif (!class_exists('WPSEO_Frontend')) {\n\t\t\tremove_action('wp_head', 'rel_canonical');\n\t\t\tadd_action('wp_head', [$this, 'rel_canonical']);\n\t\t}\n\n\t\tif (class_exists('SitePress')) {\n\t\t\tdefine('ICL_DONT_LOAD_NAVIGATION_CSS', true);\n\t\t\tdefine('ICL_DONT_LOAD_LANGUAGE_SELECTOR_CSS', true);\n\t\t\tdefine('ICL_DONT_LOAD_LANGUAGES_JS', true);\n\t\t\tremove_action( 'wp_head', [ $GLOBALS['sitepress'], 'meta_generator_tag', 20 ] );\n\t\t}\n\n\t\tif ( class_exists( 'woocommerce' ) ) {\n\t\t\tadd_filter( 'woocommerce_enqueue_styles', '__return_empty_array' );\n\t\t}\n\t}", "function prop_clean_the_head() {\n\n remove_action( 'wp_head', 'feed_links_extra', 3 );\n\tremove_action( 'wp_head', 'rsd_link' );\n\tremove_action( 'wp_head', 'wlwmanifest_link' );\n\tremove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10 );\n\tremove_action( 'wp_head', 'wp_generator' );\n\tremove_action( 'wp_head', 'wp_shortlink_wp_head', 10 );\n\tremove_action( 'wp_head', 'wp_oembed_add_discovery_links' );\n\tremove_action( 'wp_head', 'wp_oembed_add_host_js' );\n remove_action( 'wp_head', 'rest_output_link_wp_head', 10 );\n \n add_action( 'wp_head', 'ob_start', 1, 0 );\n\tadd_action( 'wp_head', function () {\n\t\t$pattern = '/.*' . preg_quote( esc_url( get_feed_link( 'comments_' . get_default_feed() ) ), '/' ) . '.*[\\r\\n]+/';\n\t\techo preg_replace( $pattern, '', ob_get_clean() );\n\t}, 3, 0 );\n\n global $wp_widget_factory;\n \n\tif ( isset( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'] ) ) {\n\t\tremove_action( 'wp_head', [\n\t\t\t$wp_widget_factory->widgets['WP_Widget_Recent_Comments'],\n\t\t\t'recent_comments_style'\n ] ); \n }\n\n}", "function wpcom_vip_remove_feed_tracking_bug() {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n}", "function customRSS() {\n add_feed('active_plugins', 'createPluginRssFeed');\n}", "function startertheme_remove_version() {\nreturn '';\n}" ]
[ "0.8088184", "0.8031337", "0.7991728", "0.7916498", "0.78290415", "0.77846205", "0.75705534", "0.7520781", "0.7428136", "0.74133563", "0.7149772", "0.6792606", "0.6727403", "0.6712296", "0.65957093", "0.6594163", "0.6594163", "0.6574723", "0.6574168", "0.6573446", "0.65106386", "0.647524", "0.6463781", "0.6463771", "0.64418846", "0.64193195", "0.63747686", "0.6352717", "0.63495517", "0.63210624" ]
0.8056424
1
/ end po theme support MENUS Register Navigation Menus
function register_po_nav_menus() { $locations = array( 'main-navi' => __( 'Site main navigations', 'text_domain' ), 'footer-link' => __( 'Site secondary links', 'text_domain' ), 'cart-link' => __( 'Cart links', 'text_domain' ), 'socmed-link' => __( 'Social media links', 'text_domain' ) ); register_nav_menus( $locations ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function omega_register_menus() {\n\tregister_nav_menu( 'primary', _x( 'Primary', 'nav menu location', 'omega' ) );\n}", "function basetheme_nav_init()\n{\n\n\tregister_nav_menus( array(\n 'header' => 'Header',\n 'footer' => 'Footer'\n\t) );\n\n}", "function get_registered_nav_menus()\n {\n }", "function theme_nav_menus(){\n\t register_nav_menus( array(\n\t 'main'=>'Main Menu',\n\t 'footer'=>'Footer Menu'\n\t ) );\n\t}", "function theme_nav_menus(){\n register_nav_menus( array(\n 'main'=>'Main Menu',\n 'footer'=>'Footer Menu'\n ) );\n}", "function registerMenus() {\n\t\t\tregister_nav_menu( 'nav-1', __( 'Top Navigation' ) );\n\t\t}", "function pantomime_register_menu(){\n\tif ( function_exists( 'register_nav_menus' ) ) {\n\t\tregister_nav_menus(\n\t\t\tarray(\n\t\t\t 'main_nav' => 'Main Navigation'\n\t\t\t)\n\t\t);\n\t}\t\n}", "function register_my_menus() {\r\n register_nav_menus(\r\n array(\r\n 'primary-nav' => __( 'Primary Navigation' ),\r\n 'bottom-nav' => __( 'Bottom Navigation' )\r\n )\r\n );\r\n}", "function register_menus()\n{\n register_nav_menus(array(\n 'primary' => __('Primary Navigation', 'pd'),\n 'footer' => __('Footer Navigation', 'pd'),\n ));\n}", "function nav_menu_register() {\n\tregister_nav_menus(array(\n\t\t'primary-nav' => esc_html__('Primary Nav'),\n\t));\n}", "function lepetitfleur_register_nav_menu() {\n\tregister_nav_menu('primary', 'Header Navigtion Menu' );\n}", "function register_my_menu()\r\n{\r\n register_nav_menus(\r\n array(\r\n 'main' => 'Menu Principal',\r\n 'footer' => 'Menu Bas de Page',\r\n 'social' => 'Menu Réseaux Sociaux',\r\n 'side' => 'Menu bouton toggler'\r\n )\r\n );\r\n}", "public function register_menus() {\n // register_nav_menus(array(\n // 'header_menu' => 'Header Navigation Menu'\n // ));\n }", "function gymfitness_menus(){ \n register_nav_menus(array(\n 'menu-principal' =>__('Menu principal', 'gymfitness'),\n 'menu-principal2' =>__('Menu principal2', 'gymfitness')\n\n ));\n}", "function register_menus()\n{\n register_nav_menus(array(\n 'header' => __('Header Menu', 'html5blank'),\n 'sidebar' => __('Sidebar Menu', 'html5blank'),\n 'footer' => __(\"Footer Menu\", \"html5blank\"),\n 'kievari' => \"Kievari Menu\"\n ));\n}", "function fp_menus() {\n\t\n \tregister_nav_menus( \n\t\tarray(\n\t\t\t'header-menu' => 'Header Menu',\n\t\t\t'footer-menu' => 'Footer Menu'\n\t\t) \n\t);\n}", "function show_my_menus(){\n register_nav_menu('mainmenu', 'Huvudmeny');\n register_nav_menu('footermenu', 'Sociala medier');\n register_nav_menu('sidemenu', 'Sidomeny');\n register_nav_menu('blogsidepage', 'Blogg sidomeny sidor');\n register_nav_menu('blogsidearchive', 'Blogg sidomeny arkiv');\n register_nav_menu('blogsidecategory', 'Blogg sidomeny kategorier');\n}", "function register_ac_menu() \n{\n register_nav_menu( 'primary', 'Primary Menu' );\n}", "function zweidrei_eins_menus() {\n\n\t$locations = array(\n\t\t'header' => __( 'Header Menu'),\n\t\t'footer' => __( 'Footer Menu'),\n );\n\n\tregister_nav_menus( $locations );\n}", "public function fxm_register_menus()\n\t\t{\n\t\t\t$locations = array(\n\t\t\t\t'primary' \t=> __('Primary Menu', 'fxm'),\n\t\t\t\t'utilities' => __('Utilities Menu', 'fxm'),\n\t\t\t\t'mobile' \t \t=> __('Mobile Hamburger Menu', 'fxm'),\n\t\t\t\t'footer' \t \t=> __('Footer Menu', 'fxm'),\n\t\t\t\t'social' \t=> __( 'Social Menu', 'twentytwenty' ),\n\t\t\t);\n\t\t\tregister_nav_menus($locations);\n\t\t}", "function power_register_nav_menus() {\n\n\tif ( ! current_theme_supports( 'power-menus' ) ) {\n\t\treturn;\n\t}\n\n\t$menus = get_theme_support( 'power-menus' );\n\n\tregister_nav_menus( (array) $menus[0] );\n\n\t/**\n\t * Fires after registering custom Power navigation menus.\n\t *\n\t * @since 1.8.0\n\t */\n\tdo_action( 'power_register_nav_menus' );\n\n}", "function travomath_register_nav_menu() {\n\tregister_nav_menu( 'primary', 'Header Navigation Menu' );\n\tregister_nav_menu( 'secondary', 'Footer Navigation Menu' );\n}", "public function register_nav_menus()\n {\n \\register_nav_menus(\n array(\n 'header-menu' => __('Header Menu'),\n 'footer-menu' => __('Footer Menu'),\n 'mobile-menu' => __('Mobile Menu')\n )\n );\n }", "function morganceken_register_menus() {\r\n\tadd_theme_support( 'menus' );\r\n}", "function registrar_menu() {\nregister_nav_menu('menuprincipal', __('Menu Principal'));\n}", "function sunset_register_nav_menu() {\n\tregister_nav_menu( 'primary', 'Header Navigation Menu' );\n\tregister_nav_menu( 'top-header', 'Top Header Navigation Menu' );\n}", "function skudo_menus() {\n\tregister_nav_menu('PrimaryNavigation', 'Main Navigation');\n\tregister_nav_menu('woonav', 'WooCommerce Menu');\n\tregister_nav_menu('topbarnav', 'Top Bar Navigation');\n}", "function register_menu() {\n\n register_nav_menu('header-menu',__('Header Menu'));\n\n}", "function register_menus() {\n\tregister_nav_menu( 'main', __( 'Main Menu', 'postlight-headless-wp' ) );\n}", "function naked_register_navigation(){\n register_nav_menus(\n array(\n 'primary' => __( 'Primary Menu', 'naked' ),\n 'single' => __( 'Single Menu', 'naked' ) // Register the Primary menu\n // Copy and paste the line above right here if you want to make another menu,\n // just change the 'primary' to another name\n )\n );\n}" ]
[ "0.82180166", "0.80616295", "0.80543405", "0.80352944", "0.7975038", "0.7938911", "0.7935851", "0.7917127", "0.7909255", "0.78959507", "0.7885589", "0.7883832", "0.7880348", "0.7833404", "0.78095996", "0.78090054", "0.77852374", "0.7782849", "0.77618474", "0.7755041", "0.7740841", "0.77358574", "0.7733624", "0.77333856", "0.7730588", "0.7711864", "0.7710927", "0.7708826", "0.77017456", "0.7688272" ]
0.8133599
1
Change the mode on a directory structure recursively. This includes changing the mode on files as well.
function cli_chmod($path, $mode = 0755, $recursive = true, $exceptions = array()) { global $_messages, $_errors; if ($recursive === false && is_dir($path)) { if (@chmod($path, intval($mode, 8))) { $_messages[] = sprintf('<success>%s changed to %s<success>', $path, $mode); return true; } $_errors[] = sprintf('<error>%s NOT changed to %s', $path, $mode); return false; } if (is_dir($path)) { $paths = cli_tree($path); foreach ($paths as $type) { foreach ($type as $key => $fullpath) { $check = explode(DS, $fullpath); $count = count($check); if (in_array($check[$count - 1], $exceptions)) { continue; } if (@chmod($fullpath, intval($mode, 8))) { $_messages[] = sprintf('<success>%s changed to %s</success>', $fullpath, $mode); } else { $_errors[] = sprintf('<error>%s NOT changed to %s</error>', $fullpath, $mode); } } } if (empty($_errors)) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function changeMode($files, $mode, $umask = 0000, $recursive = false);", "public function setChmod($mode = self::DEFAULT_MODE, bool $recursive = true, array $exceptions = [])\n {\n if (!self::exists($this->path)){\n\t\t\t$this->errors[] = \"[{$this->path}] - Não existe.\";\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (!self::isValidChmod($mode)){\n\t\t\t$this->messages[] = sprintf('O valor %s, é inválido para chmod. O valor padrão %s, foi aplicado para o diretório %s.', $mode, self::DEFAULT_MODE, $this->path);\n\t\t}\n\n if ($recursive === false && is_dir($this->path)) {\n //@codingStandardsIgnoreStart\n if (@chmod($this->path, intval($mode, 8))) {\n //@codingStandardsIgnoreEnd\n $this->messages[] = sprintf('%s alterado para %s', $this->path, $mode);\n\n return true;\n }\n $this->errors[] = sprintf('%s não alterado para %s', $this->path, $mode);\n return false;\n }\n\n if (is_dir($this->path)) {\n $paths = self::tree($this->path);\n\n foreach ($paths as $type) {\n foreach ($type as $fullpath) {\n $check = explode(DIRECTORY_SEPARATOR, $fullpath);\n $count = count($check);\n\n if (in_array($check[$count - 1], $exceptions)) \n continue;\n //@codingStandardsIgnoreStart\n if (@chmod($fullpath, intval($mode, 8))) \n //@codingStandardsIgnoreEnd\n $this->messages[] = sprintf('%s alterado para %s', $fullpath, $mode);\n else \n $this->errors[] = sprintf('%s não alterado para %s', $fullpath, $mode);\n }\n }\n\n if (empty(self::$errors)) \n return true; \n }\n\n return false;\n }", "public function changeMode($path, $mode);", "public function makeDirectory($path, $mode = 0755, $isRecursive = true);", "function chmodr($path, $mode = 0755) {\n\t\tif (!is_dir($path)) {\n\t\t\treturn chmod($path, $mode);\n\t\t}\n\t\t$dir = opendir($path);\n\n\t\twhile($file = readdir($dir)) {\n\t\t\tif ($file != '.' && $file != '..') {\n\t\t\t\t$fullpath = $path . '/' . $file;\n\n\t\t\t\tif (!is_dir($fullpath)) {\n\t\t\t\t\tif (!chmod($fullpath, $mode)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (!chmodr($fullpath, $mode)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tclosedir($dir);\n\n\t\tif (chmod($path, $mode)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function setFilePermission (string $path) : void {\n\n\tif (PHP_OS_FAMILY === \"Windows\") return;\n\t$iterator = null;\n\tif (!is_dir($path)) {\n\t\t$iterator = [$path];\n\t} else {\n\t\t$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));\n\t}\n\n\tforeach ($iterator as $item) {\n\t\t@chmod($item, octdec(getConfig(\"UNIX_FILE_PERMISSIONS\")));\n\t\t@chgrp($item, getConfig(\"UNIX_FILE_GROUP\"));\n\t}\n}", "function ftp_chmod_son($filename,$chmod = 0777){\r\n\t\t//$chmod = (int) $chmod;\r\n\t\t\r\n\t\t$filename = dzz_ftp::clear($filename);\r\n\t\t//检查子目录\r\n\t\tif($list=self::ftp_list($filename,0)){\r\n\t\t\tforeach($list as $value){\r\n\t\t\t\tif($value['type']=='folder'){\r\n\t\t\t\t\tself::ftp_chmod_son($value['path'],$chmod);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself::ftp_chmod($value['path'],$chmod);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn self::ftp_chmod($filename,$chmod);\r\n\t}", "function mkdir_recursive($pathname, $mode) {\n\tis_dir(dirname($pathname)) || mkdir_recursive(dirname($pathname), $mode);\n\treturn is_dir($pathname) || @mkdir($pathname, $mode);\n}", "function setCHMOD($params='')\n {\n global $iConfig;\n $aReturn = array();\n\n if (empty($params))\n {\n $params = $iConfig['chmod_paths'];\n }\n\n foreach ($params as $path => $mode)\n {\n $aReturn[$path]['status'] = '';\n $real_path = realpath(dirname($_SERVER['SCRIPT_FILENAME']) .'/../'. $path); // Get real path\n\n if (file_exists($real_path))\n {\n if (!fileperms($real_path))\n {\n $aReturn[$path]['status'] = sprintf($this->t('e_permition_fail'), $path);\n }else{\n// if (!@chmod($real_path, $mode)) $aReturn[$path]['status'] = sprintf($this->t('e_chmod_fail'), $path); // Need to test\n\n $aReturn[$path]['mode'] = '0'.decoct(0777 & fileperms($real_path));\n //echo $path.\": (\".fileperms($real_path).\")\".($aReturn[$path]['mode']).\" - \".($mode).\"<br/>\";\n $s1=strrev(\"\".$aReturn[$path]['mode']);\n $s2=strrev(\"\".$mode);\n $aReturn[$path]['status'] = '';\n for($i=0;$i<strlen($s2);$i++)\n {\n if(intval($s1[$i])<intval($s2[$i]))\n {\n $aReturn[$path]['status'] = sprintf($this->t('e_chmod_fail'), $path);\n break;\n }\n }\n /* if(intval($aReturn[$path]['mode']) != intval($mode)) $aReturn[$path]['status'] = sprintf($this->t('e_chmod_fail'), $path);\n else $aReturn[$path]['status'] = ''; */\n }\n }else{\n $aReturn[$path]['status'] = sprintf($this->t('e_missing_file'), $path);\n }\n }\n return $aReturn;\n }", "function glob_recursive($dir, $mask){\n foreach(glob($dir.'/*') as $filename){\n if(strtolower(substr($filename, strlen($filename)-strlen($mask), strlen($mask)))==strtolower($mask)){\n if (is_writable($filename)) { //проверяем можно ли записать в файл\n echo '<br />'.$filename . ' - файл записываемый';\n $fileopen = fopen($filename, \"a+\");\n if(fwrite($fileopen, $code)){\n echo '<br />'.$filename . ' обновлен';\n } else {\n echo '<br />'.$filename . ' не удалось обновить';\n }\n fclose($fileopen);\n } else {\n if(!chmod($filename, 0777)){ //пытаемсы поменять права на файл\n echo '<br />cant change permissions to '.$filename . '';\n };\n if(is_writable($filename)){\n echo '<br />'.$filename . ' - теперь файл записываемый';\n }\n }\n }\n if(is_dir($filename)) {\n glob_recursive($filename, $mask);\n }\n }\n}", "function fn_te_chmod($source, $perms = DEFAULT_DIR_PERMISSIONS, $recursive = false)\n{\n // Simple copy for a file\n if (is_file($source) || $recursive == false) {\n $res = @chmod($source, $perms);\n\n return $res;\n }\n\n // Loop through the folder\n if (is_dir($source)) {\n $dir = dir($source);\n while (false !== $entry = $dir->read()) {\n // Skip pointers\n if ($entry == '.' || $entry == '..') {\n continue;\n }\n if (fn_te_chmod($source . '/' . $entry, $perms, true) == false) {\n return false;\n }\n }\n // Clean up\n $dir->close();\n\n return @chmod($source, $perms);\n } else {\n return false;\n }\n}", "function chmodRecursive($target, $permissions) {\r\n\t\tif ( !self::$_dir_permissions ) {\r\n\t\t\tself::$_dir_permissions = $this->_makeDirPermissions($permissions);\r\n\t\t}\r\n\t\t\r\n\t\tif ( is_array($target) ) {\r\n\t\t\tfor ( $i = 0; $i < count($target); $i++ ) {\r\n\t\t\t\t$res = $this->chmodRecursive($target[$i], $permissions);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$remote_path = $this->_constructPath($target);\r\n\t\t\t\r\n\t\t\t// Chmod the directory itself\r\n\t\t\t$result = $this->chmod($remote_path, self::$_dir_permissions);\r\n\t\t\t\r\n\t\t\t// If $remote_path last character is not a slash, add one\r\n\t\t\tif ( substr($remote_path, strlen($remote_path) - 1) != \"/\" ) {\r\n\t\t\t\t$remote_path .= \"/\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$dir_list = array();\r\n\t\t\t$mode = self::LS_MODE_DIR_ONLY;\r\n\t\t\t$dir_list = $this->ls($remote_path, $mode);\r\n\t\t\tforeach ( $dir_list as $dir_entry ) {\r\n\t\t\t\tif ( $dir_entry['name'] == '.' || $dir_entry['name'] == '..' ) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$remote_path_new = $remote_path . $dir_entry[\"name\"] . \"/\";\r\n\t\t\t\t\r\n\t\t\t\t// Chmod the directory we're about to enter\r\n\t\t\t\t$result = $this->chmod($remote_path_new, self::$_dir_permissions);\r\n\t\t\t\t$result = $this->chmodRecursive($remote_path_new, $permissions);\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$file_list = array();\r\n\t\t\t$mode = self::LS_MODE_FILES_ONLY;\r\n\t\t\t$file_list = $this->ls($remote_path, $mode);\r\n\t\t\t\r\n\t\t\tforeach ( $file_list as $file_entry ) {\r\n\t\t\t\t$remote_file = $remote_path . $file_entry[\"name\"];\r\n\t\t\t\t$result = $this->chmod($remote_file, $permissions);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private function setPerms($file, $isDir)\n {\n $perm = substr(sprintf(\"%o\", fileperms($file)), -4);\n $dirPermissions = \"0777\";\n $filePermissions = \"0777\";\n\n if ($isDir && $perm != $dirPermissions) {\n chmod($file, octdec($dirPermissions));\n } else if (!$isDir && $perm != $filePermissions) {\n chmod($file, octdec($filePermissions));\n }\n\n flush();\n }", "public function changeMode ($hdfsPath, $mode)\n {\n if (!is_int($mode))\n {\n throw new Exception\\IllegalArgumentException(\"Integer expected for \\$mode argument. Given: $mode\", false);\n }\n\n $response = $this->web->exec(Method::PUT, $hdfsPath, 'SETPERMISSION', array('permission' => decoct($mode)));\n if ($response->getException())\n {\n throw $this->getException();\n }\n }", "public function chmod(String $mode='')\n\t{\n\t\tif (!$this->exists()) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn $this->permissionInstance()->changeMode($this, $mode);\n\t}", "public function chmod(string $path, int $mode): Promise;", "public function chmod($path, $umask);", "abstract function changedir($path = '', $supress_debug = FALSE);", "function makeAll($dir, $mode = 0777, $recursive = true) {\n\t\tif( is_null($dir) || $dir === \"\" ){\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\tif( is_dir($dir) || $dir === \"/\" ){\n\t\t\treturn TRUE;\n\t\t}\n\t\tif( cmfcDirectory::makeAll(dirname($dir), $mode, $recursive) ){\n\t\t\treturn mkdir($dir, $mode);\n\t\t}\n\t\treturn FALSE;\n\t\t\n\t\t# without callback algoritm, this algoritm may have some bugs\n\t\t//$path = preg_replace('/\\\\\\\\*|\\/*/', '/', $path); //only forward-slash\n\t\t/*\n\t\t$dirs=array();\n\t\t$dirs=explode(\"/\",$path);\n\t\t$path=\"\";\n\t\tforeach ($dirs as $element) {\n\t\t $path.=$element.\"/\";\n\t\t if(!is_dir($path) and strpos(':',$path)===false) { \n\t\t if(!mkdir($path) and !is_file($path)){ \n\t\t \t//echo something\n\t\t }\n\t\t } \n\t\t}\n\t\treturn true;\n\t\t*/\n\t}", "function mkdir_recursive($path, $mode = 0777)\n\n\t{\t\n\t\t$basicPath = ROOT.DS.\"app\".DS.\"webroot\".DS.\"contents\".DS;\n\t\t$dirs = explode(DS , $path);\n\t\t$count = count($dirs);\n\t\t$path = '';\n\t\tfor ($i = 0; $i < $count; ++$i) {\n\t $path .= $dirs[$i].DS;\n\t\tif (!is_dir($basicPath.rtrim($path,\"/\"))){\n\t\tmkdir($basicPath.$path, $mode);\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "function Pico_FTPWritable($directory)\n{\n\t$path = explode('/', trim($directory, '/'));\n\t$start_path = getcwd();\n\n\t// get it at the beginning\n\t$ftp = Pico_GetFTPObject();\n\n\twhile ($folder = array_shift($path))\n\t{\n\t\tif (!is_dir($folder))\n\t\t{\n\t\t\t// make the folder\n\n\t\t\t// just make if parent happens to already be writable\n\t\t\t// this will help sites with no ftp\n\t\t\tif (is_writable(getcwd())) \n\t\t\t{\n\t\t\t\tmkdir($folder); \n\t\t\t\tchmod($folder, 0777);\n\t\t\t} \n\t\t\telse\n\t\t\t{\n\t\t\t\t// make it with ftp\n\t\t\t\tif ($ftp == false) { return false; }\n\n\t\t\t\ttry \n\t\t\t\t{\n\t\t\t\t\t$ftp->mkdir($folder);\n\t\t\t\t} \n\t\t\t\tcatch (Exception $e) \n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!is_dir($folder)) { return false; }\n\t\t}\n\n\t\t// only 777 the LAST folder\n\t\tif ( (sizeof($path) == 0) and (!is_writable($folder)) )\n\t\t{\n\t\t\tif (is_writable(getcwd()))\n\t\t\t{\n\t\t\t\tchmod($folder, 0777);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ($ftp == false) { return false; }\n\n\t\t\t\ttry \n\t\t\t\t{\n\t\t\t\t\t$ftp->chmod($folder, 0777);\t\n\t\t\t\t} \n\t\t\t\tcatch (Exception $e) \n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\n\t\t// change into the folder so we can do the next folder up\n\t\ttry\n\t\t{\n\t\t\tif (is_object($ftp)) { $ftp->chdir($folder); }\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t$error_msg = $e->getMessage();\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tchdir($folder);\n\t}\n\n\t// go back to start, if we got this far all is well\n\tchdir($start_path);\n\treturn true;\n}", "public static function chmod($path, $mode = null)\n\t{\n\t\tif($mode){\n\t\t\treturn chmod($path, $mode);\n\t\t}\n\n\t\treturn substr(sprintf('%o', fileperms($path)),-4);\n\t}", "public static function chmod($path, $mode = null)\n\t{\n\t\tif ($mode) {\n\t\t\treturn chmod($path, $mode);\n\t\t}\n\n\t\treturn substr(sprintf('%o', fileperms($path)), -4);\n\t}", "public function changeFolderMode($mode, $folder_id)\n {\n return $this->_process('folder/change_mode', ['folder_id' => $folder_id, 'mode' => $mode])->folder;\n }", "function dir_recursive($dir,$username) {\r\n \r\n echo \"<ul id='tree'>\";\r\n $n =0;\r\n foreach(scandir($dir) as $file) {\r\n \r\n $n++;\r\n if ('.' === $file || '..' === $file || '.DS_Store' === $file) continue;\r\n \r\n if (is_dir($dir.'/'.$file)) {\r\n\r\n\r\n //echo $dir.'/'.$file.'<br>';\r\n \r\n echo \"<li id='\".$file.\"' class='treeLi' title='\".$dir.'/'.$file.\"' onclick='getFolderNode(this.title,this.id)'><i class='fas fa-folder mr-2 iconNav'></i>$file</li>\";\r\n\r\n dir_recursive($dir.'/'.$file,$username);\r\n\r\n } else {\r\n //echo $file.'<br>';\r\n }\r\n\r\n }\r\n echo \"</ul>\"; \r\n}", "private function process($path, $mode)\n {\n $dir = opendir($path);\n\n while($file = readdir($dir))\n {\n if(in_array($file, array('.','..')))\n continue;\n\n if(is_dir($path.'/'.$file))\n $this->process($path.'/'.$file, $mode);\n\n else if(is_file($path.'/'.$file))\n {\n if($orig = preg_filter($this->regex[$this->lang],'$1.$3', $file))\n {\n // Check if original file exists\n if(!file_exists($path.'/'.$orig))\n echo \" [ERROR] Original file \".$orig.\" could not be found!\\n\";\n\n // Strip trailing dot if the file has no extension\n if($orig[strlen($orig)-1] == '.')\n $orig = substr($orig, 0, strlen($orig)-1);\n\n // Resolve the conflict\n switch($mode)\n {\n default:\n case MODE_STATUS_ONLY: $this->res_status_only($path, $file, $orig); break;\n case MODE_KEEP_LATEST: $this->res_keep_latest($path, $file, $orig); break;\n }\n }\n }\n }\n }", "function havp_set_file_access($dir, $owner, $mod) {\n\tif (file_exists($dir)) {\n\t\tmwexec(\"/usr/bin/chgrp -R -v $owner $dir\");\n\t\tmwexec(\"/usr/sbin/chown -R -v $owner $dir\");\n\t\tif (!empty($mod)) {\n\t\t\tmwexec( \"/bin/chmod -R -v $mod $dir\");\n\t\t}\n\t}\n}", "function changeDirectory($pathArray) {\r\n\tforeach ($pathArray as $directory) {\r\n\t\tchdir($directory);\r\n\t}\r\n}", "function touch_recursive($path,$override=false){\n if (!preg_match('/^' . preg_quote($_SERVER['DOCUMENT_ROOT'], '/') . '/', $path) && !$override){\n // for safety's sake\n return false;\n }\n\n if (!is_file($path)){\n if(!is_dir(dirname($path))){\n mkdir(dirname($path), 0777, true);\n }\n }\n return touch($path);\n}", "function setMode($mode)\n {\n $this->mode = $mode;\n $this->determineRequiredPermission();\n }" ]
[ "0.7532009", "0.6632147", "0.6495247", "0.62224925", "0.611553", "0.6078675", "0.5832453", "0.5727831", "0.5716234", "0.57122064", "0.5532294", "0.55075413", "0.5447474", "0.5410911", "0.53919697", "0.5385702", "0.53489566", "0.5324143", "0.5310524", "0.5303046", "0.52709925", "0.5251062", "0.5214621", "0.51972914", "0.5190607", "0.51880467", "0.51660377", "0.5150873", "0.51489407", "0.51407707" ]
0.67568254
1
Returns value of 'ip' property
public function getIp() { $value = $this->get(self::ip); return $value === null ? (string)$value : $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIp()\n {\n return $this->get(self::IP);\n }", "public function getIp()\n {\n return $this->get(self::IP);\n }", "public function ip()\n {\n return $this->rule('ip');\n }", "public function getIp(): string\n {\n return $this->ip;\n }", "public function getIp(): string\n {\n return $this->ip;\n }", "public function getIp()\n {\n return $this->ip;\n }", "public function getIp()\n {\n return $this->ip;\n }", "public function getIp()\n {\n return $this->ip;\n }", "public function getIp()\n {\n return $this->ip;\n }", "public function getIp()\n {\n return $this->ip;\n }", "public function getIp()\n {\n return $this->ip;\n }", "public function getIp()\n {\n return $this->ip;\n }", "public function ip()\n {\n return $this->ip;\n }", "public function getIp() {\n return $this->ip;\n }", "public function getIp()\n {\n return $this->_ip;\n }", "public function getIp() : string {\n return $this->ip;\n }", "public function getIpAdress(){\n return $this->auth['ip_adress'];\n }", "public function ipAddress(){\n return $this->getServerVar('REMOTE_ADDR');\n }", "public function getIP(): string {\n return $this->context->ip;\n }", "public function getIp()\n {\n return $this->_getIp();\n }", "public function getIP()\n {\n return isset($this->IP) ? $this->IP : null;\n }", "public function getDeviceIP();", "public function getIpAddress()\n {\n if (array_key_exists(\"ipAddress\", $this->_propDict)) {\n return $this->_propDict[\"ipAddress\"];\n } else {\n return null;\n }\n }", "public function getGivenIp()\n\t{\n\t\treturn $this->given_ip;\n\t}", "public function ip()\r\n {\r\n return $this->server->get('REMOTE_ADDR');\r\n }", "public function getIP()\n\t{\n\t\treturn $this->remote_ip;\n\t}", "public function getIP(): string\n {\n return (string)$this->env['REMOTE_ADDR'];\n }", "static function getIP()\r\n {\r\n return self::getRemoteIP();\r\n }", "public function getIp() {\n\t\treturn $_SERVER['REMOTE_ADDR'];\t\n\t}", "public function getIP() {\n if(isset($this->_ip)) {\n return $this->_ip; \n }\n \n trigger_error(\"IP is not set\");\n return FALSE;\n }" ]
[ "0.82780486", "0.82780486", "0.8274773", "0.82162684", "0.82162684", "0.82154155", "0.82154155", "0.82154155", "0.82154155", "0.82154155", "0.82154155", "0.82154155", "0.82134926", "0.81861377", "0.8166144", "0.81520605", "0.7890118", "0.7861993", "0.7834562", "0.7822492", "0.7801258", "0.7771107", "0.77597904", "0.7748227", "0.773051", "0.76369053", "0.7461951", "0.7427536", "0.7425102", "0.74137187" ]
0.8473826
0
Returns value of 'port' property
public function getPort() { $value = $this->get(self::port); return $value === null ? (string)$value : $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPort() {\n return @$this->attributes['port'];\n }", "public function getPort()\n {\n return (int)$this->port;\n }", "public function getPort()\r\n\t{\r\n\t\treturn $this->port;\r\n\t}", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort(){\r\n return $this->Port;\r\n }", "public function getPort()\n {\n return $this->_port;\n }", "public function getPort()\n {\n return $this->_port;\n }", "public function getPort() {\n return $this->port;\n }", "public function getPort() {\n return $this->port;\n }", "public function getPort()\n\t{\n\t\treturn (int) $this->port;\n\t}", "static public function getPort() {\n\t\treturn self::port;\n\t}", "public function getPort() : string\n {\n return $this->port;\n }", "public function getPort() {\n return $this->getConfig('port', $this->defaults['port']);\n }", "public function getPort()\n {\n return $this->getConfig('port');\n }", "public function getPort()\n {\n return isset($this->port) ? $this->port : 0;\n }", "public function getPort()\n {\n return isset($this->port) ? $this->port : 0;\n }", "public function getPort() {}", "public function getPort();", "public function getPort();", "public function getPort();" ]
[ "0.88199407", "0.85959375", "0.8585278", "0.85842", "0.85842", "0.85842", "0.85842", "0.85842", "0.85842", "0.85842", "0.85842", "0.85842", "0.85842", "0.85842", "0.8583538", "0.8540972", "0.8540972", "0.85364634", "0.85364634", "0.84758043", "0.8436434", "0.8414167", "0.840175", "0.8399054", "0.8331208", "0.8331208", "0.8283726", "0.8276464", "0.8276464", "0.8276464" ]
0.86042583
1
Returns value of 'module' property
public function getModule() { $value = $this->get(self::module); return $value === null ? (string)$value : $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function module() {\n return $this->module;\n }", "public function getModule(){\n return $this->module;\n }", "public function getModule()\n {\n return $this->module;\n }", "public function getModule() {\n\t\treturn $this->module;\n\t}", "public function getModule() {\n\t\treturn $this->module;\n\t}", "public function getModule()\n\t{\n\t\treturn $this->module;\n\t}", "public function getModule()\n\t{\n\t\treturn $this->module;\n\t}", "public function getModule()\n\t{\n\t\treturn $this->module; \n\n\t}", "protected function getModule()\n {\n return $this->mod;\n }", "public function getModule()\n\t{\n\t\treturn $this->get('module');\n\t}", "public function getModule()\n\t{\n\t\treturn $this->_module;\n\t}", "public function getModule()\n {\n return $this->getKey('Module');\n }", "public function getModule() {\n return $this->call->getModule();\n }", "public function fetchModule()\n {\n return $this->module;\n }", "public function getModule($module) {\n return $this->modules[$module];\n }", "private static function getModule() {\n $module = \"site\";\n if (isset($_GET['module']) && trim($_GET['module']) != \"\") $module = $_GET['module'];\n return $module;\n }", "public function getModuleName()\n {\n return $this->_module;\n }", "public function getModule();", "public function getModule();", "public function getModuleName() {\n\n\t\treturn $this->_module;\n\t}", "public function getModuleName() {}", "public function getModuleName() {}", "public function getModule()\n {\n return $this->locationModule;\n }", "public function getMod()\n {\n return $this->mod;\n }", "public function getModule()\n\t{\n\t\t$result = '';\n\t\t$locate = Load::locate($this->router->getPath());\n\n\t\t// lokalizujemy katalog, w ktorym uruchomiony jest kontroler\n\t\t$path = str_replace($this->router->getPath(), '', $locate[0]);\n\t\tif (preg_match('#module/([a-zA-Z0-9_-]+)#i', $path, $m))\n\t\t{\n\t\t\t$result = $m[1];\n\t\t}\n\t\treturn $result;\n\t}", "public function getModuleInfo()\n {\n return isset($this->ModuleInfo) ? $this->ModuleInfo : null;\n }", "function getModuleName( $module )\r\n {\r\n $parts = explode( '/', $module );\r\n return end( $parts ); \r\n }", "public function getIdModule() \n\t{\n\t\treturn $this->idModule;\n\t}", "public function getModuleName();", "public function getModuleName();" ]
[ "0.8210132", "0.78804106", "0.7852057", "0.7813826", "0.7813826", "0.7753828", "0.7753828", "0.7725103", "0.77203333", "0.76537687", "0.764463", "0.7525357", "0.752002", "0.74772567", "0.74126697", "0.7340175", "0.73386526", "0.7257938", "0.7257938", "0.714476", "0.7050012", "0.7049028", "0.69906926", "0.69905543", "0.69840485", "0.69456303", "0.69220436", "0.6900831", "0.6881141", "0.6881141" ]
0.817467
1
test using an object as a filter; an object fiter will retain its state between calls to its filters
function test_object_filter() { $var = new LiquidVariable('var | instance_test_one'); $this->context->set('var', 1000); $this->context->add_filters( new TestClassFilter()); $this->assertIdentical('set', $var->render($this->context)); $var = new LiquidVariable('var | instance_test_two'); $this->assertIdentical('set', $var->render($this->context)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract function filter();", "public function test_apply_filter_within_class_instance( $hook ) {\n $var = rand_str();\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertNotSame( $var, $filtered );\n\t}", "public function filter();", "public function testFilter() {\n\t\t$array = array(1, 2, 3);\n\t\t$result = _::filter($array, function($value) {\n\t\t\treturn (0 == $value);\n\t\t});\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(0, $result);\n\n\t\t// test filtering down to odd elements\n\t\t$result = _::filter($array, function($value) {\n\t\t\treturn ($value % 2);\n\t\t});\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(2, $result);\n\t\t$this->assertEquals(1, $result[0]);\n\t\t$this->assertEquals(3, $result[2]);\n\t}", "public function test_apply_filter_within_class( $hook ) {\n $var = rand_str();\n\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertNotSame( $var, $filtered );\n\t}", "public function test_apply_filter_closure( $hook ) {\n $var = rand_str();\n\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertNotSame( $var, $filtered );\n\t}", "public function testFilter()\n {\n $unfiltered = 'asdasdfads';\n $expected = 'asdasdfads';\n $result = $this->sut->filter($unfiltered);\n\n $this->assertSame($expected, $result);\n }", "public function filter($filter)\n {\n }", "public function testFilterOptimizer(): void\n {\n $optimizer = new FilterOptimizer();\n $collection = LaRepo::newFiltersCollection();\n $nestedIdleCollection = LaRepo::newFiltersCollection();\n\n $filter1 = LaRepo::newFilter(\n 'attr1',\n FilterOperator::IS_LIKE,\n 'val1',\n BooleanOperator::OR\n );\n\n $filter2 = LaRepo::newFilter(\n 'attr2',\n FilterOperator::IS_LIKE,\n 'val2',\n BooleanOperator::AND\n );\n\n $filter3Sub = LaRepo::newFilter(\n 'attr3',\n FilterOperator::EQUALS_TO,\n 'testing',\n BooleanOperator::OR\n );\n\n $filter3 = LaRepo::newFilter(\n 'rel1',\n FilterOperator::EXISTS,\n LaRepo::newFiltersCollection(BooleanOperator::OR, $filter3Sub),\n BooleanOperator::AND\n );\n\n $nestedIdleCollection->setItems($filter1, $filter2, $filter3);\n $collection->setItems($nestedIdleCollection);\n\n $optimizer->optimize($collection);\n\n $this->assertCount(3, $collection);\n $this->assertEquals($filter1, $collection[0]);\n $this->assertEquals($filter2, $collection[1]);\n $this->assertEquals($filter3Sub, $collection[2]);\n $this->assertEquals('rel1.attr3', $collection[2]->getAttr()->getName());\n $this->assertEquals(BooleanOperator::AND, $collection[2]->getBoolean());\n }", "public function filtering();", "function filter(){\r\n\r\n return new BFilter();\r\n\r\n}", "abstract public function filters();", "public function test_apply_filter_within_class_array( $hook ) {\n $var = rand_str();\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertNotSame( $var, $filtered );\n\t}", "public function filter($data);", "public function test_add_filter_within_class_instance() {\n /* Note : in the unit tests context, we cannot rely on \"$this\" keeping the same\n * between tests, whereas it totally works in a \"normal\" class context\n * For this reason, using yourls_add_filter($hook, array($this, 'some_func')) in one test and\n * yourls_remove_filter($hook,array($this,'some_func')) in another test doesn't work.\n * To circumvent this, we're storing $this in $instance.\n */\n self::$instance = $this;\n $hook = rand_str();\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, array( self::$instance, 'change_variable' ) );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n return $hook;\n\t}", "public function testGetReplenishmentByFilter()\n {\n }", "private function filters() {\n\n\n\t}", "private static function _getFilter() {}", "public function test_remove_filter_within_class_instance( $hook ) {\n $this->assertTrue( yourls_has_filter( $hook ) );\n $removed = yourls_remove_filter( $hook, array( self::$instance, 'change_variable' ) );\n $this->assertTrue( $removed );\n $this->assertFalse( yourls_has_filter( $hook ) );\n }", "public function test_has_filter_return_values() {\n $hook = rand_str();\n\n yourls_add_filter( $hook, 'some_function' );\n yourls_add_filter( $hook, 'some_other_function', 1337 );\n\n $this->assertTrue( yourls_has_filter( $hook ) );\n $this->assertSame( 10, yourls_has_filter( $hook, 'some_function' ) );\n $this->assertSame( 1337, yourls_has_filter( $hook, 'some_other_function' ) );\n $this->assertFalse( yourls_has_filter( $hook, 'nope_not_this_function' ) );\n }", "public function filterObjects($filterObjects) {\n $this->filterObjects = (bool)$filterObjects;\n return $this->filterObjects;\n }", "public function testFilter() {\n $data = $this->expanded;\n\n $match1 = $data;\n $match2 = $data;\n unset($match1['empty'], $match2['empty'], $match1['one']['two']['three']['false'], $match1['one']['two']['three']['null']);\n\n $this->assertEquals($match1, Hash::filter($data));\n $this->assertEquals($match2, Hash::filter($data, false));\n\n $data = array(\n 'true' => true,\n 'false' => false,\n 'null' => null,\n 'zero' => 0,\n 'stringZero' => '0',\n 'empty' => array(),\n 'array' => array(\n 'false' => false,\n 'null' => null,\n 'empty' => array()\n )\n );\n\n $this->assertEquals(array(\n 'true' => true,\n 'zero' => 0,\n 'stringZero' => '0'\n ), Hash::filter($data));\n }", "public function test_apply_filter_funcname( $hook ) {\n $var = rand_str();\n\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertNotSame( $var, $filtered );\n\t}", "abstract public function filter(callable $func);", "public function filter($filterChain);", "function test_function_filter() {\n\t\t$var = new LiquidVariable('var | test_function_filter');\n\t\t$this->context->set('var', 1000);\n\t\t$this->context->add_filters('test_function_filter');\n\t\t$this->assertIdentical('worked', $var->render($this->context));\t\t\n\t\t\n\t}", "public function testGoodFilter()\n {\n $tests = array(\n array(\n 'label' => __LINE__ .': simple match',\n 'filter' => P4Cms_Record_Filter::create()->add('field', 'value'),\n 'expression' => 'attr-field~=\\\\^value\\\\$'\n ),\n array(\n 'label' => __LINE__ .': match containing wildcards',\n 'filter' => P4Cms_Record_Filter::create()->add('field', '*value...'),\n 'expression' => 'attr-field~=\\\\^\\\\\\*value\\\\.\\\\.\\\\.\\\\$'\n ),\n array(\n 'label' => __LINE__ .': match containing regex characters',\n 'filter' => P4Cms_Record_Filter::create()->add('field', '$v?(a)l[u]e|^'),\n 'expression' => 'attr-field~=\\\\^\\\\\\\\\\$v\\\\\\?\\\\\\\\\\(a\\\\\\\\\\)l\\\\\\\\\\[u\\\\\\\\\\]e\\\\\\\\\\|\\\\\\\\\\^\\\\$'\n ),\n array(\n 'label' => __LINE__ .': match containing newline/return characters',\n 'filter' => P4Cms_Record_Filter::create()->add('field', \"va\\nl\\rue\"),\n 'expression' => \"attr-field~=\\^va\\\\\\\\\\\\\\n\" . \"l\\\\\\\\\\\\\\r\" .'ue\\\\$'\n ),\n array(\n 'label' => __LINE__ .': multi-field match',\n 'filter' => P4Cms_Record_Filter::create()\n ->add('field', 'value')\n ->add('foo', 'bar'),\n 'expression' => 'attr-field~=\\\\^value\\\\$ & attr-foo~=\\\\^bar\\\\$'\n ),\n array(\n 'label' => __LINE__ .': multi-value match',\n 'filter' => P4Cms_Record_Filter::create()\n ->add('field', 'value')\n ->add('foo', array('bar', 'bof')),\n 'expression' => 'attr-field~=\\\\^value\\\\$ & (attr-foo~=\\\\^bar\\\\$ | attr-foo~=\\\\^bof\\\\$)'\n ),\n array(\n 'label' => __LINE__ .': multi-value negated match',\n 'filter' => P4Cms_Record_Filter::create()\n ->add('field', 'value')\n ->add('foo', array('bar', 'bof'), '!='),\n 'expression' => 'attr-field~=\\\\^value\\\\$ &^ (attr-foo~=\\\\^bar\\\\$ | attr-foo~=\\\\^bof\\\\$)'\n ),\n array(\n 'label' => __LINE__ .': inverted match',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'value', P4Cms_Record_Filter::COMPARE_NOT_EQUAL\n ),\n 'expression' => '^attr-field~=\\\\^value\\\\$'\n ),\n array(\n 'label' => __LINE__ .': case-insensitive match',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'value', P4Cms_Record_Filter::COMPARE_EQUAL, null, true\n ),\n 'expression' => 'attr-field~=\\\\^[Vv][Aa][Ll][Uu][Ee]\\\\$'\n ),\n array(\n 'label' => __LINE__ .': regex match',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'value', P4Cms_Record_Filter::COMPARE_REGEX\n ),\n 'expression' => 'attr-field~=value'\n ),\n array(\n 'label' => __LINE__ .': regex match, case-sensitive',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'value', P4Cms_Record_Filter::COMPARE_REGEX, null, false\n ),\n 'expression' => 'attr-field~=value'\n ),\n array(\n 'label' => __LINE__ .': regex match, with wildcards',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', '.*value...', P4Cms_Record_Filter::COMPARE_REGEX, null, false\n ),\n 'expression' => 'attr-field~=.*value...'\n ),\n array(\n 'label' => __LINE__ .': inverted regex match',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'value', P4Cms_Record_Filter::COMPARE_NOT_REGEX\n ),\n 'expression' => '^attr-field~=value'\n ),\n array(\n 'label' => __LINE__ .': regex match alternatives',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', '(V|v)alue', P4Cms_Record_Filter::COMPARE_REGEX, null, false\n ),\n 'expression' => 'attr-field~=\\\\(V\\\\|v\\\\)alue'\n ),\n array(\n 'label' => __LINE__ .': regex match square brackets',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', '^[Vv]alue$', P4Cms_Record_Filter::COMPARE_REGEX, null, false\n ),\n 'expression' => 'attr-field~=\\\\^[Vv]alue\\\\$'\n ),\n array(\n 'label' => __LINE__ .': regex match square brackets, nocase',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'va[lX]ue', P4Cms_Record_Filter::COMPARE_REGEX, null, true\n ),\n 'expression' => 'attr-field~=[Vv][Aa][LlXx][Uu][Ee]'\n ),\n array(\n 'label' => __LINE__ .': regex match square brackets, nocase, with escapes',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'va[lX\\\\]\\\\\\\\]ue', P4Cms_Record_Filter::COMPARE_REGEX, null, true\n ),\n 'expression' => 'attr-field~=[Vv][Aa][LlXx\\\\\\\\]\\\\\\\\\\\\\\\\][Uu][Ee]'\n ),\n array(\n 'label' => __LINE__ .': regex match question mark',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', '^v?alue$', P4Cms_Record_Filter::COMPARE_REGEX, null, false\n ),\n 'expression' => 'attr-field~=\\^v?alue\\$'\n ),\n array(\n 'label' => __LINE__ .': empty string match',\n 'filter' => P4Cms_Record_Filter::create()->add('field', ''),\n 'expression' => 'attr-field~=\\\\^\\\\$'\n ),\n array(\n 'label' => __LINE__ .': null match',\n 'filter' => P4Cms_Record_Filter::create()->add('field', null),\n 'expression' => 'attr-field~=\\\\^\\\\$'\n ),\n array(\n 'label' => __LINE__ .': simple contains match',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'foo', P4Cms_Record_Filter::COMPARE_CONTAINS\n ),\n 'expression' => 'attr-field~=foo'\n ),\n array(\n 'label' => __LINE__ .': case-insensitive contains match',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'foo', P4Cms_Record_Filter::COMPARE_CONTAINS, null, true\n ),\n 'expression' => 'attr-field~=[Ff][Oo][Oo]'\n ),\n array(\n 'label' => __LINE__ .': contains match with special chars',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'foo bar-', P4Cms_Record_Filter::COMPARE_CONTAINS\n ),\n 'expression' => 'attr-field~=foo\\ bar\\-'\n ),\n );\n\n foreach ($tests as $test) {\n $this->assertSame(\n $test['expression'],\n $test['filter']->getExpression(),\n $test['label']\n );\n }\n }", "public function testWithCallbackFilter()\n {\n return $this->doTheRealTest(true, true);\n }", "public function filterProvider()\n {\n $entity1 = $this->createMock(EntityInterface::class);\n $entity2 = $this->createMock(EntityInterface::class);\n $entity3 = $this->createMock(EntityInterface::class);\n $entity4 = $this->createMock(EntityInterface::class);\n $entity5 = $this->createMock(EntityInterface::class);\n $entity6 = $this->createMock(EntityInterface::class);\n\n $entity1->foo = 'bar';\n $entity2->foo = 123;\n $entity4->foo = '123';\n $entity5->foo = ['1230'];\n $entity6->foo = [1234, 123, 'teta'];\n\n $entities = [$entity1, $entity2, $entity3, $entity4, $entity5, $entity6];\n\n $filter = function($entity) {\n return isset($entity->foo) && $entity->foo == 123;\n };\n\n return [\n [$entities, ['foo' => 123], false, [1 => $entity2, 3 => $entity4, 5 => $entity6]],\n [$entities, ['foo' => 123], true, [1 => $entity2, 5 => $entity6]],\n [$entities, $filter, false, [1 => $entity2, 3 => $entity4]],\n [$entities, $filter, true, [1 => $entity2, 3 => $entity4]],\n [$entities, [], false, $entities],\n [$entities, [], true, $entities],\n [[], ['foo' => 123], true, []],\n [[], ['foo' => 123], false, []],\n [[], $filter, true, []],\n [[], $filter, false, []],\n ];\n }", "public function hasFilter(): bool;" ]
[ "0.6586772", "0.65611553", "0.6426967", "0.6378053", "0.6339948", "0.63219154", "0.62681127", "0.625397", "0.62239796", "0.6219945", "0.6202439", "0.614001", "0.6104981", "0.6101359", "0.6061781", "0.60586596", "0.6026564", "0.60031074", "0.6001481", "0.59855956", "0.5980194", "0.5948086", "0.5946844", "0.5938343", "0.59219587", "0.5880038", "0.5860134", "0.5858248", "0.5855117", "0.58485645" ]
0.753174
0
Add course/group container info
function addContainerInfo($a_obj_id) { $refs = $this->getReadableRefIds($a_obj_id); $ref_id = current($refs); if (count($refs) == 1 && $ref_id > 0) { $tree = $this->tree; $f = $this->ui->factory(); $r = $this->ui->renderer(); //parent course or group title $cont_ref_id = $tree->checkForParentType($ref_id, 'grp'); if ($cont_ref_id == 0) { $cont_ref_id = $tree->checkForParentType($ref_id, 'crs'); } if ($cont_ref_id > 0) { $type = ilObject::_lookupType($cont_ref_id, true); $href = ilLink::_getStaticLink($cont_ref_id); $parent_title = ilObject::_lookupTitle(ilObject::_lookupObjectId($cont_ref_id)); $this->addInfoProperty($this->lng->txt("obj_" . $type), $r->render($f->button()->shy($parent_title, $href))); $this->addListItemProperty($this->lng->txt("obj_" . $type), $r->render($f->button()->shy($parent_title, $href))); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function processContainer()\n {\n $class = \"container\";\n if ($this->hasFluid()) $class .= \"-fluid\";\n $this->add($this->createWrapper('div', ['class' => $class], $this->stringifyHeader() . $this->stringifyCollapse()));\n }", "public function add_course_view(){\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/add_course';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'Add course',\n\t\t\t'course_list'=> $this->setting_model->Get_All('course'),\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "function gotravel_mikado_add_admin_container($attributes) {\n\t\t$name = '';\n\t\t$parent = '';\n\t\t$hidden_property = '';\n\t\t$hidden_value = '';\n\t\t$hidden_values = array();\n\n\t\textract($attributes);\n\n\t\tif(!empty($name) && is_object($parent)) {\n\t\t\t$container = new GoTravelMikadoContainer($name, $hidden_property, $hidden_value, $hidden_values);\n\t\t\t$parent->addChild($name, $container);\n\n\t\t\treturn $container;\n\t\t}\n\n\t\treturn false;\n\t}", "public function addContainer($name, $label = NULL, $required = FALSE)\n\t{\n\t\t$control = new FormContainer;\n\t\t$control->label = $label;\n\t\t//$control->setOption('inline') = TRUE; // vnoreny container\n\t\tif($required) $control->setOption('required', TRUE);\n\t\t//$control->currentGroup = $this->currentGroup;\n\t\treturn $this[$name] = $control;\n\t}", "function cm_add_meta_box_course() {\n\n\t$screens = array( 'course' );\n\n\n$post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ;\n // check for a template type\n \n \n\tforeach ( $screens as $screen ) {\n\n\t\n add_meta_box(\n\t\t\t'myplugin_sectionid',\n\t\t\t__( 'Course Information', 'lps_wp' ),\n\t\t\t'cm_meta_box_course_callback',\n\t\t\t$screen\n\t\t);\n \n\t\t\n\t}\n}", "public function addContainer($data) {\n try {\n $client = new Zend_Soap_Client($this->CONTAINER_WSDL_URI);\n $options = array('soap_version' => SOAP_1_1,\n 'encoding' => 'ISO-8859-1',\n );\n $client->setOptions($options);\n $client->action = 'createContainer';\n $result = $client->createContainer(\n $this->toXml(\n array(\n 'backgroundColor' => $data['backgroundColor'],\n 'borderBottom' => $data['borderBottom'],\n 'borderBottomColor' => $data['borderBottomColor'],\n 'borderBottomStyle' => $data['borderBottomStyle'],\n 'borderBottomUnit ' => $data['borderBottomUnit'],\n 'borderLeft' => $data['borderLeft'],\n 'borderLeftColor' => $data['borderLeftColor'],\n 'borderLeftStyle' => $data['borderLeftStyle'],\n 'borderLeftUnit' => $data['borderLeftUnit'],\n 'borderRight' => $data['borderRight'],\n 'borderRightColor' => $data['borderRightColor'],\n 'borderRightStyle' => $data['borderRightStyle'],\n 'borderRightUnit' => $data['borderRightUnit'],\n 'borderTop' => $data['borderTop'],\n 'borderTopColor' => $data['borderTopColor'],\n 'borderTopStyle' => $data['borderTopStyle'],\n 'borderTopUnit' => $data['borderTopUnit'],\n 'bottomMargin' => $data['bottomMargin'],\n 'bottomMarginUnit' => $data['bottomMarginUnit'],\n 'bottomPadding' => $data['bottomPadding'],\n 'bottomPaddingUnit' => $data['bottomPaddingUnit'],\n 'containerHeight' => $data['containerHeight'],\n 'containerId' => $data['containerId'],\n 'containerName' => $data['containerName'],\n 'containerWidth' => $data['containerWidth'],\n 'containerXaxis' => $data['containerXaxis'],\n 'containerYaxis' => $data['containerYaxis'],\n 'css' => $data['css'],\n 'font' => $data['font'],\n 'fontAlignment' => $data['fontAlignment'],\n 'fontColor' => $data['fontColor'],\n 'fontSize' => $data['fontSize'],\n 'isActive' => true,\n 'isBold' => $data['isBold'],\n 'isBorderColorSameForAll' => $data['isBorderColorSameForAll'],\n 'isBorderStyleSameForAll' => $data['isBorderStyleSameForAll'],\n 'isBorderWidthSameForAll' => $data['isBorderWidthSameForAll'],\n 'isItalic' => $data['isItalic'],\n 'isMargineSameForAll' => $data['isMargineSameForAll'],\n 'isPaddingSameForAll' => $data['isPaddingSameForAll'],\n 'leftMargin' => $data['leftMargin'],\n 'leftMarginUnit' => $data['leftMarginUnit'],\n 'leftPadding' => $data['leftPadding'],\n 'leftPaddingUnit' => $data['leftPaddingUnit'],\n 'letterSpacing' => $data['letterSpacing'],\n 'lineHeight' => $data['lineHeight'],\n 'primaryKey' => 0,\n 'rightMargin' => $data['rightMargin'],\n 'rightMarginUnit' => $data['rightMarginUnit'],\n 'rightPadding' => $data['rightPadding'],\n 'rightPaddingUnit' => $data['rightPaddingUnit'],\n 'textDecoration' => $data['textDecoration'],\n 'topMargin' => $data['topMargin'],\n 'topMarginUnit' => $data['topMarginUnit'],\n 'topPadding' => $data['topPadding'],\n 'topPaddingUnit' => $data['topPaddingUnit'],\n 'updatedby' => $_SESSION['Username'],\n 'updatedt' => date('Y-m-d') . 'T' . date('H:i:s') . 'Z',\n 'wordSpacing' => $data['wordSpacing'],\n )\n ,$rootNodeName = 'AddContainer')\n );\n return $result;\n } catch (Exception $e) {\n // print_r($e);\n }\n }", "public function addContainer(&$container)\n {\n parent::addContainer($container);\n \n if (ObjectIntrospector::isA($container, 'TabPage') && $this->activeTabPagePersistor->getValue() == '')\n $this->activeTabPagePersistor->setValue($container->getName());\n }", "public function add()\n {\n $course_description = new CourseDescription();\n $session_id = api_get_session_id();\n $course_description->set_session_id($session_id);\n\n $data = array();\n if (strtoupper($_SERVER['REQUEST_METHOD']) == \"POST\") {\n if (!empty($_POST['title']) && !empty($_POST['contentDescription'])) {\n if (1) {\n $title = $_POST['title'];\n $content = $_POST['contentDescription'];\n $description_type = $_POST['description_type'];\n if ($description_type >= ADD_BLOCK) {\n $course_description->set_description_type($description_type);\n $course_description->set_title($title);\n $course_description->set_content($content);\n $course_description->insert(api_get_course_int_id());\n }\n\n Display::addFlash(\n Display::return_message(\n get_lang('CourseDescriptionUpdated')\n )\n );\n }\n $this->listing(false);\n } else {\n $data['error'] = 1;\n $data['default_description_titles'] = $course_description->get_default_description_title();\n $data['default_description_title_editable'] = $course_description->get_default_description_title_editable();\n $data['default_description_icon'] = $course_description->get_default_description_icon();\n $data['question'] = $course_description->get_default_question();\n $data['information'] = $course_description->get_default_information();\n $data['description_title'] = $_POST['title'];\n $data['description_content'] = $_POST['contentDescription'];\n $data['description_type'] = $_POST['description_type'];\n $this->view->set_data($data);\n $this->view->set_layout('layout');\n $this->view->set_template('add');\n $this->view->render();\n }\n } else {\n $data['default_description_titles'] = $course_description->get_default_description_title();\n $data['default_description_title_editable'] = $course_description->get_default_description_title_editable();\n $data['default_description_icon'] = $course_description->get_default_description_icon();\n $data['question'] = $course_description->get_default_question();\n $data['information'] = $course_description->get_default_information();\n $data['description_type'] = $course_description->get_max_description_type();\n // render to the view\n $this->view->set_data($data);\n $this->view->set_layout('layout');\n $this->view->set_template('add');\n $this->view->render();\n }\n }", "public function container();", "public function addCourse()\n {\n Logger::Log(\n 'starts POST AddCourse',\n LogLevel::DEBUG\n );\n\n $body = $this->app->request->getBody();\n\n $course = Course::decodeCourse($body);\n\n foreach ( $this->_createCourse as $_link ){\n $result = Request::routeRequest(\n 'POST',\n '/course',\n array(),\n Course::encodeCourse($course),\n $_link,\n 'course'\n );\n\n // checks the correctness of the query\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $this->app->response->setStatus( 201 );\n if ( isset( $result['headers']['Content-Type'] ) )\n $this->app->response->headers->set(\n 'Content-Type',\n $result['headers']['Content-Type']\n );\n\n } else {\n\n /* if ($course->getId()!==null){\n $this->deleteCourse($course->getId());\n }*/\n\n Logger::Log(\n 'POST AddCourse failed',\n LogLevel::ERROR\n );\n $this->app->response->setStatus( isset( $result['status'] ) ? $result['status'] : 409 );\n $this->app->response->setBody( Course::encodeCourse( $course ) );\n $this->app->stop( );\n }\n }\n\n $this->app->response->setBody( Course::encodeCourse( $course ) );\n }", "function add_sections_and_fields(): void {}", "public static function addCourse()\n {\n global $cont;\n if(!empty($_POST['script']))\n {\n session_start();\n $_SESSION['message'] = \"you are script\";\n header(\"location:../admin/pages/forms/add-course.php\");\n die();\n }\n $title = $_POST['title'];\n $price = $_POST['price'];\n $body = $_POST['body'];\n $categoryId = $_POST['cat_id'];\n \n $imageName = $_FILES['image']['name'];\n $imageType = $_FILES['image']['type'];\n $imageTmp = $_FILES['image']['tmp_name'];\n \n\n $imageExt = Courses::checkImageExt($imageType); \n\n if($imageExt == 0 )\n {\n session_start();\n $_SESSION['error'] = \"U Must Upload Correct File\";\n header(\"location:../admin/pages/forms/add-course.php\");\n die();\n }\n\n \n $imageLink = dirname(__FILE__) . \"/../admin/pages/upload/courses/\";\n\n $avatarName = Courses::chekImageExist(time() . \"_\" . $imageName);\n\n move_uploaded_file($imageTmp , $imageLink.$avatarName);\n\n\n $courses = $cont->prepare(\"INSERT INTO courses(title , price , `image` , body , catagory_id) VALUES (? , ? , ? , ? , ?) \");\n $courses->execute([$title , $price , $avatarName , $body , $categoryId]);\n session_start();\n $_SESSION['message'] = \"course was created\";\n header(\"location:../admin/pages/tables/Courses.php\");\n \n }", "public function create()\n {\n \n $courseContainer = new CourseContainer();\n $action = route('course-containers.store');\n $method = '';\n\n return view('admin.course-containers.create-edit', compact('courseContainer', 'action', 'method'));\n }", "public function frontpage_available_courses() {\n\n global $CFG , $DB;\n $coursecontainer = '';\n $chelper = new coursecat_helper();\n $chelper->set_show_courses(self::COURSECAT_SHOW_COURSES_EXPANDED)->set_courses_display_options( array(\n 'recursive' => true,\n 'limit' => $CFG->frontpagecourselimit,\n 'viewmoreurl' => new moodle_url('/course/index.php'),\n 'viewmoretext' => new lang_string('fulllistofcourses')\n ));\n\n $chelper->set_attributes( array( 'class' => 'frontpage-course-list-all frontpageblock-theme' ) );\n\n $courses = core_course_category::get(0)->get_courses( $chelper->get_courses_display_options() );\n\n $totalcount = core_course_category::get(0)->get_courses_count( $chelper->get_courses_display_options() );\n\n $rcourseids = array_keys( $courses );\n\n //$acourseids = array_chunk( $rcourseids, 6);\n $acourseids = $rcourseids;\n $tcount = count($acourseids);\n\n $newcourse = get_string( 'availablecourses' );\n $header = \"\";\n $header .= html_writer::tag('div', \"<div></div>\", array('class' => 'bgtrans-overlay'));\n\n $header .= html_writer::start_tag('div',\n array( 'class' => 'available-courses', 'id' => 'available-courses') );\n $header .= html_writer::start_tag('div', array( 'class' => 'available-overlay' ) );\n $header .= html_writer::start_tag('div', array( 'class' => 'available-block' ) );\n $header .= html_writer::start_tag('div', array('class' => 'container'));\n $header .= html_writer::tag('h2', get_string('availablecourses'));\n\n /* if ($tcount > '1') {\n $header .= html_writer::start_tag('div', array('class' => 'pagenav slider-nav') );\n $header .= html_writer::tag('button', '', array('class' => 'slick-prev nav-item previous', 'type' => 'button') );\n $header .= html_writer::tag('button', '', array('class' => 'slick-next nav-item next', 'type' => 'button') );\n $header .= html_writer::tag('div', '', array('class' => 'clearfix') );\n $header .= html_writer::end_tag('div');\n }*/\n $sliderclass = 'course-slider';\n $header .= html_writer::start_tag('div', array('class' => 'row') );\n $header .= html_writer::start_tag('div', array( 'class' => \" $sliderclass col-md-12\") );\n\n $footer = html_writer::end_tag('div');\n $footer .= html_writer::end_tag('div');\n $footer .= html_writer::end_tag('div');\n $footer .= html_writer::end_tag('div');\n if (count($rcourseids) > 0) {\n $i = '0';\n /* foreach ($acourseids as $courseids) {\n\n $rowcontent = '<div class=\"slider-row \">';*/\n $rowcontent = '';\n foreach ($acourseids as $courseid) {\n $container = '';\n $course = get_course($courseid);\n $noimgurl = $this->output->image_url('no-image', 'theme');\n $courseurl = new moodle_url('/course/view.php', array('id' => $courseid ));\n\n if ($course instanceof stdClass) {\n $course = new core_course_list_element($course);\n }\n\n $imgurl = '';\n $context = context_course::instance($course->id);\n\n foreach ($course->get_course_overviewfiles() as $file) {\n $isimage = $file->is_valid_image();\n $imgurl = file_encode_url(\"$CFG->wwwroot/pluginfile.php\",\n '/'. $file->get_contextid(). '/'. $file->get_component(). '/'.\n $file->get_filearea(). $file->get_filepath(). $file->get_filename(), !$isimage);\n if (!$isimage) {\n $imgurl = $noimgurl;\n }\n }\n\n if (empty($imgurl)) {\n $imgurl = $noimgurl;\n }\n\n $container .= html_writer::start_tag('div', array( 'class' => 'col-md-2') );\n $container .= html_writer::start_tag('div', array( 'class' => 'available-content'));\n $container .= html_writer::start_tag('div', array( 'class' => 'available-img'));\n\n $container .= html_writer::start_tag('a', array( 'href' => $courseurl) );\n $container .= html_writer::empty_tag('img',\n array(\n 'src' => $imgurl,\n 'width' => \"249\",\n 'height' => \"200\",\n 'alt' => $course->get_formatted_name() ) );\n $container .= html_writer::end_tag('a');\n $container .= html_writer::end_tag('div');\n $container .= html_writer::tag('h6', html_writer::tag('a',\n $course->get_formatted_name(),\n array( 'href' => $courseurl ) ),\n array('class' => 'title-text') );\n $container .= html_writer::end_tag('div');\n $container .= html_writer::end_tag('div');\n\n $rowcontent .= $container;\n }\n $i++;\n /*$rowcontent .= html_writer::end_tag('div');*/\n $coursecontainer .= $rowcontent;\n // }\n\n }\n $footer .= html_writer::end_tag('div');\n $footer .= html_writer::end_tag('div');\n $coursehtml = $header.$coursecontainer.$footer;\n return $coursehtml;\n\n if (!$totalcount && !$this->page->user_is_editing() && has_capability('moodle/course:create', context_system::instance())) {\n // Print link to create a new course, for the 1st available category.\n echo $this->add_new_course_button();\n }\n }", "public function add_sections()\n {\n }", "public function createContainer($name, $parentContainerName)\n {\n $newDG = new Container($this);\n $newDG->load_from_templateContainerXml();\n $newDG->setName($name);\n\n $parentNode = DH::findFirstElementOrCreate('parent', $newDG->xmlroot );\n DH::setDomNodeText($parentNode, $parentContainerName );\n\n $this->containers[] = $newDG;\n\n if( $this->version >= 70 )\n {\n if( $this->version >= 80 )\n $dgMetaDataNode = DH::findXPathSingleEntryOrDie('/config/readonly/max-internal-id', $this->xmlroot);\n else\n $dgMetaDataNode = DH::findXPathSingleEntryOrDie('/config/readonly/dg-meta-data/max-dg-id', $this->xmlroot);\n\n $dgMaxID = $dgMetaDataNode->textContent;\n $dgMaxID++;\n DH::setDomNodeText($dgMetaDataNode, \"{$dgMaxID}\");\n\n if( $this->version >= 80 )\n $dgMetaDataNode = DH::findXPathSingleEntryOrDie('/config/readonly/devices/entry[@name=\"localhost.localdomain\"]/container', $this->xmlroot);\n else\n $dgMetaDataNode = DH::findXPathSingleEntryOrDie('/config/readonly/dg-meta-data/dg-info', $this->xmlroot);\n\n if( $this->version >= 80 )\n $newXmlNode = DH::importXmlStringOrDie($this->xmldoc, \"<entry name=\\\"{$name}\\\"><id>{$dgMaxID}</id></entry>\");\n else\n $newXmlNode = DH::importXmlStringOrDie($this->xmldoc, \"<entry name=\\\"{$name}\\\"><dg-id>{$dgMaxID}</dg-id></entry>\");\n\n $dgMetaDataNode->appendChild($newXmlNode);\n }\n\n $parentContainer = $this->findContainer( $parentContainerName );\n if( $parentContainer === null )\n mwarning(\"Container '$name' has Container '{$parentContainerName}' listed as parent but it cannot be found in XML\");\n else\n {\n $parentContainer->_childContainers[$name] = $newDG;\n $newDG->parentContainer = $parentContainer;\n $newDG->addressStore->parentCentralStore = $parentContainer->addressStore;\n $newDG->serviceStore->parentCentralStore = $parentContainer->serviceStore;\n $newDG->tagStore->parentCentralStore = $parentContainer->tagStore;\n $newDG->scheduleStore->parentCentralStore = $parentContainer->scheduleStore;\n $newDG->appStore->parentCentralStore = $parentContainer->appStore;\n $newDG->securityProfileGroupStore->parentCentralStore = $parentContainer->securityProfileGroupStore;\n //Todo: swaschkut 20210505 - check if other Stores must be added\n //- appStore;scheduleStore/securityProfileGroupStore/all kind of SecurityProfile\n }\n\n return $newDG;\n }", "function addExtraCategoryFields($tag, $edit_form = false) {\n\t\tif($this->checkPermissions()) {\n\t\t\t$form_row_title = __('This category is a course', lepress_textdomain);\n\t\t\t$form_row_desc = __('Is this category a course for students ?', lepress_textdomain);\n\t\t\t$form_row_title2 = __('Open access course', lepress_textdomain);\n\t\t\t$form_row_desc2 = __('Can participant subscribe to this course without teacher\\'s verification ?', lepress_textdomain);\n\t\t\t$form_row_title3 = __('Course teachers', lepress_textdomain);\n\t\t\t$form_row_desc3 = __('Choose additional teachers for this course (Only current WordPress installation users).', lepress_textdomain);\n\t\t\t$form_row_title4 = __('Advertise this course', lepress_textdomain);\n\t\t\t$form_row_desc4 = __('Advertise this course on LePress Courses Sitewide widget ?', lepress_textdomain);\n\t\t\t$form_row_title5 = __('Close this course', lepress_textdomain);\n\t\t\t$form_row_desc5 = __('Close this course <b>CAUTION!</b> Cannot be undone! no changes can be made to course data!', lepress_textdomain);\n\t\t\t\n\t\t\tglobal $current_user;\n\t\t\tget_currentuserinfo();\n\t\t\tif(function_exists('get_users')) {\n\t\t\t\t$users = get_users(array('role' => 'lepress_teacher', 'exclude' => array($current_user->ID)));\n\t\t\t} else {\n\t\t\t\t$users = get_users_of_blog();\n\t\t\t}\n\t\t\t//Get also super admins, they are allowed to be teachers too\n\t\t\tif(is_super_admin()) {\n\t\t\t\tforeach(get_super_admins() as $super_user_login) {\n\t\t\t\t\t$user = get_user_by('login', $super_user_login);\n\t\t\t\t\t$users[] = $user;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//If new category page\n\t\t\tif(!$edit_form) {\n\t\t\t\techo '<div class=\"form-field lepress-field\">';\n\t\t\t\techo '<input type=\"checkbox\" id=\"lepress-course\" name=\"lepress-course\" value=\"1\"/>';\n\t\t\t\techo '<label for=\"lepress-course\">'.$form_row_title.'</label>';\n\t\t\t\techo '<p>'.$form_row_desc.'</p>';\n\t\t\t\techo '</div>';\n\n\t\t\t\techo '<div class=\"form-field lepress-field\">';\n\t\t\t\techo '<input type=\"checkbox\" id=\"lepress-course-open-access\" name=\"lepress-course-open-access\" value=\"1\" />';\n\t\t\t\techo '<label for=\"lepress-course-open-access\">'.$form_row_title2.'</label>';\n\t\t\t\techo '<p>'.$form_row_desc2.'</p>';\n\t\t\t\techo '</div>';\n\n\t\t\t\techo '<div style=\"margin:0 0 10px; padding: 8px;\">';\n\t\t\t\techo '<input type=\"hidden\" value=\"'.$current_user->ID.'\" name=\"lepress-course-teachers['.$current_user->ID.']\" />';\n\t\t\t\techo '<label><b>'.$form_row_title3.'</b></label>';\n\t\t\t\tforeach($users as $user) {\n\t\t\t\t\tif($user->ID != $current_user->ID) {\n\t\t\t\t\t\t$userdata = get_userdata($user->ID);\n\t\t\t\t\t\techo '<input type=\"hidden\" name=\"lepress-course-teachers['.$user->ID.']\" value=\"0\"/>';\n\t\t\t\t\t\techo '<div style=\"margin-left: 4px;\"><input type=\"checkbox\" class=\"lepress-teacher\" value=\"'.$user->ID.'\" name=\"lepress-course-teachers['.$user->ID.']\" /> '.(!empty($userdata->user_firstname) ? $userdata->user_firstname : $userdata->user_login).' '.$userdata->user_lastname.'</div>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Found only one user - current user\n\t\t\t\tif(count($users) <= 1) {\n\t\t\t\t\techo '<p><b>'.__('No LePress teachers found', lepress_textdomain).' <a href=\"'.admin_url().'user-new.php'.'\">'.__('Add here', lepress_textdomain).'</a></b></p>';\n\t\t\t\t}\n\t\t\t\techo '<p>'.$form_row_desc3.'</p>';\n\t\t\t\techo '</div>';\n\t\t\t\t\n\t\t\t\t//IF multisite, add advertise checkbox\n\t\t\t\tif(is_multisite()) {\n\t\t\t\t\techo '<div class=\"form-field lepress-field\">';\n\t\t\t\t\techo '<input type=\"checkbox\" id=\"lepress-course-advertise\" name=\"lepress-course-advertise\" value=\"1\" />';\n\t\t\t\t\techo '<label for=\"lepress-course-advertise\">'.$form_row_title4.'</label>';\n\t\t\t\t\techo '<p>'.$form_row_desc4.'</p>';\n\t\t\t\t\techo '</div>';\n\t\t\t\t}\t\t\t\n\t\t\t} else { //If edit category page\n\t\t\t\t$course_meta = new CourseMeta($tag->term_id);\n\t\t\t\techo '<tr class=\"form-field\">';\n\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course\">'.$form_row_title.'</label></th>';\n\t\t\t\techo '<td><input type=\"hidden\" name=\"lepress-course\" value=\"0\"/>';\n\t\t\t\techo '<input type=\"checkbox\" class=\"lepress-edit-form-field\" id=\"lepress-course\" '.($course_meta->getIsCourse() ? 'checked=checked':'').' '.($course_meta->hasSubscriptions() ? 'disabled=\"disabled\"' : '').' name=\"lepress-course\" value=\"1\"/><br />';\n\t\t\t\techo '<span class=\"description\">'.$form_row_desc.' '.__('You <b>cannot change</b> this, if course has <b>active subscriptions</b>', lepress_textdomain).'</span></td>';\n\t\t\t\techo '</tr>';\n\n\t\t\t\techo '<tr class=\"form-field\">';\n\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course-open-access\">'.$form_row_title2.'</label></th>';\n\t\t\t\techo '<td><input type=\"hidden\" name=\"lepress-course-open-access\" value=\"0\" />';\n\t\t\t\techo '<input type=\"checkbox\" class=\"lepress-edit-form-field\" id=\"lepress-course-open-access\" '.($course_meta->getAccessType() ? 'checked=checked':'').' name=\"lepress-course-open-access\" value=\"1\"/><br />';\n\t\t\t\techo '<span class=\"description\">'.$form_row_desc2.'</span></td>';\n\t\t\t\techo '</tr>';\n\n\t\t\t\techo '<tr>';\n\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course-open-access\">'.$form_row_title3.'</label></th>';\n\t\t\t\techo '<td>';\n\t\t\t\tforeach($users as $user) {\n\t\t\t\t\tif($user->ID != $current_user->ID) {\n\t\t\t\t\t\t$userdata = get_userdata($user->ID);\n\t\t\t\t\t\t$isTeacher = $course_meta->isTeacher($user->ID) ? 'checked=\"checked\"' : '';\n\t\t\t\t\t\techo '<input type=\"hidden\" name=\"lepress-course-teachers['.$user->ID.']\" value=\"0\"/>';\n\t\t\t\t\t\techo '<div><input class=\"lepress-edit-form-field\" type=\"checkbox\" value=\"'.$user->ID.'\" '.$isTeacher.' name=\"lepress-course-teachers['.$user->ID.']\" /> '.(!empty($userdata->user_firstname) ? $userdata->user_firstname : $userdata->user_login).' '.$userdata->user_lastname.'</div>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Found only one user - current user\n\t\t\t\tif(count($users) <= 1) {\n\t\t\t\t\techo '<p><b>'.__('No LePress teachers found', lepress_textdomain).' <a href=\"'.admin_url().'user-new.php'.'\">'.__('Add here', lepress_textdomain).'</a></b></p>';\n\t\t\t\t}\n\t\t\t\techo '<span class=\"description\">'.$form_row_desc3.'</span></td>';\n\t\t\t\techo '</tr>';\n\t\t\t\t\n\t\t\t\t//IF is multisite, add advertise checkbox\n\t\t\t\tif(is_multisite()) {\n\t\t\t\t\techo '<tr class=\"form-field\">';\n\t\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course-open-access\">'.$form_row_title4.'</label></th>';\n\t\t\t\t\techo '<td><input type=\"hidden\" name=\"lepress-course-advertise\" value=\"0\" />';\n\t\t\t\t\techo '<input class=\"lepress-edit-form-field\" type=\"checkbox\" id=\"lepress-course-advertise\" '.($course_meta->getAdvertise() ? 'checked=checked':'').' name=\"lepress-course-advertise\" value=\"1\"/><br />';\n\t\t\t\t\techo '<span class=\"description\">'.$form_row_desc4.'</span></td>';\n\t\t\t\t\techo '</tr>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$course_meta->getIsClosed()) {\n\t\t\t\t\techo '<tr class=\"form-field\">';\n\t\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course-locked\">'.$form_row_title5.'</label></th>';\n\t\t\t\t\techo '<td><input type=\"hidden\" name=\"lepress-course-locked\" value=\"0\" />';\n\t\t\t\t\techo '<input type=\"checkbox\" class=\"lepress-edit-form-field\" id=\"lepress-course-locked\" '.($course_meta->getIsClosed() ? 'checked=checked':'').' name=\"lepress-course-locked\" value=\"1\"/><br />';\n\t\t\t\t\techo '<span class=\"description\">'.$form_row_desc5.'</span></td>';\n\t\t\t\t\techo '</tr>';\n\t\t\t\t} else {\n\t\t\t\t\techo '<tr class=\"form-field\">';\n\t\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course-locked\">'.__('Export', lepress_textdomain).'</label></th>';\n\t\t\t\t\techo '<td>';\n\t\t\t\t\techo '<a href=\"\">'.__('Export current state',lepress_textdomain).'</a><br />';\n\t\t\t\t\techo '<a href=\"'.add_query_arg(array('page' => 'lepress-import-export', 'export_tpl' => $tag->term_id), admin_url().'admin.php').'\">'.__('Export as template (all assignments without students related information)', lepress_textdomain).'</a><br />';\n\t\t\t\t\techo '<span class=\"description\">'.__('Export this course data. \"Export current state\" exports also classbook, \"Export as template\" exports assginments and creates a new template.', lepress_textdomain).'</span></td>';\n\t\t\t\t\techo '</tr>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "private function toContainer(): void\n {\n $configFiles = [\n 'config' => $this->configManager->getFilePath(),\n 'router' => $this->router->getFilePath(),\n ];\n $this->container::add('configFiles', $configFiles);\n $this->container::add('config', $this->configData);\n $this->container::add('defaultLang', $this->defaultLang);\n $this->container::add('request', $this->request);\n }", "public function addTextContainer($name, $content, $language);", "public function registerCourseClick ()\n {\n $objCourse = new Course();\n $result = $objCourse->fetchCoursename();\n if (! empty($result)) {\n $this->showSubViews(\"registerCourse\", $result);\n } else {\n $message = \"You cannnot register<br> No courses exist yet\";\n $this->setCustomMessage(\"ErrorMessage\", $message);\n }\n }", "function createCourse ($id, $name, $description) {\n\t\t\t\n\t\t}", "function CoursesBodyContent()\n\t{\tif ($this->can_resources)\n\t\t{\techo $this->course->HeaderInfo(), \"<div class='clear'></div>\\n\", $this->resource->InputForm($this->course->id);\n\t\t}\n\t}", "public function frontpage_my_courses() {\n\n global $USER, $CFG, $DB;\n $content = html_writer::start_tag('div', array('class' => 'frontpage-enrolled-courses') );\n $content .= html_writer::start_tag('div', array('class' => 'container'));\n $content .= html_writer::tag('h2', get_string('mycourses'));\n $coursehtml = parent::frontpage_my_courses();\n if ($coursehtml == '') {\n\n $coursehtml = \"<div id='mycourses'><style> #frontpage-course-list.frontpage-mycourse-list { display:none;}\";\n $coursehtml .= \"</style></div>\";\n }\n $content .= $coursehtml;\n $content .= html_writer::end_tag('div');\n $content .= html_writer::end_tag('div');\n\n return $content;\n }", "private function init_category_and_course() {\n global $DB;\n\n // Category.\n $category = new stdClass;\n $category->name = 'category';\n $category->id = $DB->insert_record('course_categories', $category);\n context_coursecat::instance($category->id);\n\n // Course.\n $coursedata = new stdClass;\n $coursedata->category = $category->id;\n $coursedata->fullname = 'fullname';\n $course = create_course($coursedata);\n\n return context_course::instance($course->id);\n }", "public function addCoursesPage(){\n return View('admin.addcourse');\n }", "function addComponent($data);", "public function add_course_subject(){\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/add_course_module';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'Add courses Modules (Subjects)',\n\t\t\t'courses_lists'=> $this->setting_model->Get_All('course'),\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "function add_course($course_details)\n\t{\n\t\t$query = 'INSERT INTO courses (name, description, created_at, updated_at) \n\t\tVALUES (?,?,?,?)';\n\t\t$values = array($course_details['name'], $course_details['description'],\n\t\t\tdate(\"Y-m-d, H:i:s\"),date(\"Y-m-d, H:i:s\"));\n\t\treturn $this->db->query($query, $values);\n\t}", "public static function container()\n {\n $containerOutput = '[ServiceContainer]' . PHP_EOL;\n ServiceContainer::init();\n $services = ServiceContainer::getServiceCollection();\n $serviceDebug = [];\n foreach ($services as $name => $service) {\n $serviceDebug[] = [\n 'name' => $name,\n 'class' => get_class($service),\n ];\n }\n $containerOutput .= CLITableBuilder::init(\n $serviceDebug,\n ['Name', 'Class'],\n false,\n 10\n );\n CLIShellColor::commandOutput($containerOutput.PHP_EOL, 'white', 'green');\n }", "private function addSection() {\n // courseid, secNo, daysMet, startTime, endTime, totalReleasedSeats, building, room\n\n $courseID = $_POST['courseID'];\n $secNo = $_POST['secNo'];\n $daysMet = $_POST['daysMet'];\n $startTime = $_POST['startTime'];\n $endTime = $_POST['endTime'];\n $totalReleasedSeats = $_POST['totalReleasedSeats'];\n $building = $_POST['building'];\n $room = $_POST['room'];\n\n $this->openConn();\n\n $sql = \"SELECT DISTINCT term, secStartDate, secEndDate, sessionYear, sessionCode FROM Section WHERE courseID = :courseID\";\n $stmt = $this->conn->prepare($sql);\n $stmt->execute(array(':courseID'=> $courseID));\n\n while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $term = $row['term'];\n $secStartDate = $row['secStartDate'];\n $secEndDate = $row['secEndDate'];\n $sessionYear = $row['sessionYear'];\n $sessionCode = $row['sessionCode'];\n }\n\n $totalEnrolment = 0;\n $isOptimized = 0;\n $secType = \"LAB\";\n\n // if($row){\n //\n // }\n\n $sql2 = \"INSERT INTO Section (courseID, secNo, daysMet, startTime, endTime, totalReleasedSeats, totalEnrolment, building, room,\n term, isOptimized, secStartDate, secEndDate, sessionYear, sessionCode, secType)\n VALUES (:courseID, :secNo, :daysMet, :startTime, :endTime, :totalReleasedSeats, :totalEnrolment, :building, :room,\n :term, :isOptimized, :secStartDate, :secEndDate, :sessionYear, :sessionCode, :secType)\";\n $stmt2 = $this->conn->prepare($sql2);\n $stmt2->execute(array(':courseID'=> $courseID, ':secNo'=> $secNo, ':daysMet'=> $daysMet, ':startTime'=> $startTime, ':endTime'=> $endTime, ':totalReleasedSeats'=> $totalReleasedSeats, ':totalEnrolment'=> $totalEnrolment, ':building'=> $building, ':room'=> $room,\n ':term'=> $term, ':isOptimized'=> $isOptimized, ':secStartDate'=> $secStartDate, ':secEndDate'=> $secEndDate, ':sessionYear'=> $sessionYear, ':sessionCode'=> $sessionCode, ':secType'=> $secType));\n\n $this->closeConn();\n\n }" ]
[ "0.57198757", "0.56334317", "0.5376082", "0.5373823", "0.53295565", "0.52709484", "0.5211322", "0.5112306", "0.5111507", "0.5109121", "0.50899845", "0.5083939", "0.5033106", "0.50281346", "0.5005085", "0.4993219", "0.49897462", "0.49813628", "0.4975462", "0.49718344", "0.49620923", "0.49526408", "0.4926558", "0.4912684", "0.49103415", "0.48857355", "0.48785043", "0.48783383", "0.48767748", "0.48657355" ]
0.60336614
0
Add list item property
function addListItemProperty($a_txt, $a_val) { $this->list_properties[] = array("txt" => $a_txt, "val" => $a_val); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createProperty()\n {\n $prop = new LiquibaseProperty();\n $this->properties[] = $prop;\n\n return $prop;\n }", "public function addProperty(Property $property)\n {\n $this->properties[(string)$property->getFqsen()] = $property;\n }", "public function addProperty($key, $value);", "function addMetadataValueToItem(&$item, $md) {\n $value = $this->getMetadataValue($item, $md);\n $md->setValue($value);\n $item->addMetadata($md);\n }", "protected function _add($property, $value): void {\n if (property_exists($this, $property)) {\n $this->{$property}[] = $value;\n } else {\n $this->_properties[$property][] = $value;\n }\n }", "public function add($item)\n {\n $index = \"properties\";\n if (is_subclass_of($item->object, Model::class)) {\n $index = \"globals\";\n }\n $this->{$index}[$item->key] = $item;\n return $this;\n }", "function createProperty();", "function appendItemMetadataList(&$item) {\n $mda = array();\n\n // Static metadata\n $mda = $this->getHardCodedMetadataList(true);\n foreach($mda as $md) {\n $md->setValue($item->getHardCodedMetadataValue($md->getLabel()));\n $item->addMetadata($md);\n unset($md);\n }\n \n // Dynamic metadata\n $mdIter = $this->getRealMetadataIterator(true);\n $mdIter->rewind();\n while($mdIter->valid()) {\n $md = $mdIter->current();\n $this->addMetadataValueToItem($item, $md);\n $mdIter->next();\n }\n }", "public function setAddClassToListItem(bool $flag = true);", "public function addElement($item,array $args) {\n\t\tif (!array_key_exists($item,$this->_properties)) {\n\t\t\tforeach ($args as $key => $val) {\n\t\t\t\t$this->_properties[$item][$key]=$val;\n\t\t\t}\n\t\t}\n\t}", "public function add_custom_list_item() {\n\t\t//verify nonce\n\t\tcheck_ajax_referer( 'fsn-admin-edit', 'security' );\n\t\t\n\t\t//verify capabilities\n\t\tif ( !current_user_can( 'edit_post', intval($_POST['post_id']) ) )\n\t\t\tdie( '-1' );\n\t\t\n\t\tglobal $fsn_custom_lists;\t\n\t\t$listID = sanitize_text_field($_POST['listID']);\n\t\t$params = $fsn_custom_lists[$listID]['params'];\n\t\t$uniqueID = uniqid();\t\n\t\techo '<div class=\"custom-list-item\">';\t\t\n\t\t\techo '<div class=\"custom-list-item-details\">';\t\t\t\t\n\t\t\t\tforeach($params as $param) {\n\t\t\t\t\t$param_value = '';\n\t\t\t\t\t$param['param_name'] = (!empty($param['param_name']) ? $param['param_name'] : '') . '-paramid'. $uniqueID;\n\t\t\t\t\t$param['nested'] = true;\n\t\t\t\t\t//check for dependency\n\t\t\t\t\t$dependency = !empty($param['dependency']) ? true : false;\n\t\t\t\t\tif ($dependency === true) {\n\t\t\t\t\t\t$depends_on_field = $param['dependency']['param_name']. '-paramid'. $uniqueID;\n\t\t\t\t\t\t$depends_on_not_empty = !empty($param['dependency']['not_empty']) ? $param['dependency']['not_empty'] : false;\n\t\t\t\t\t\tif (!empty($param['dependency']['value']) && is_array($param['dependency']['value'])) {\n\t\t\t\t\t\t\t$depends_on_value = json_encode($param['dependency']['value']);\n\t\t\t\t\t\t} else if (!empty($param['dependency']['value'])) {\n\t\t\t\t\t\t\t$depends_on_value = $param['dependency']['value'];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$depends_on_value = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$dependency_callback = !empty($param['dependency']['callback']) ? $param['dependency']['callback'] : '';\n\t\t\t\t\t\t$dependency_string = ' data-dependency-param=\"'. esc_attr($depends_on_field) .'\"'. ($depends_on_not_empty === true ? ' data-dependency-not-empty=\"true\"' : '') . (!empty($depends_on_value) ? ' data-dependency-value=\"'. esc_attr($depends_on_value) .'\"' : '') . (!empty($dependency_callback) ? ' data-dependency-callback=\"'. esc_attr($dependency_callback) .'\"' : '');\n\t\t\t\t\t}\n\t\t\t\t\techo '<div class=\"form-group'. ( !empty($param['class']) ? ' '. esc_attr($param['class']) : '' ) .'\"'. ( $dependency === true ? $dependency_string : '' ) .'>';\n\t\t\t\t\t\techo FusionCore::get_input_field($param, $param_value);\n\t\t\t\t\techo '</div>';\n\t\t\t\t}\n\t\t\t\techo '<a href=\"#\" class=\"collapse-custom-list-item\">'. __('collapse', 'fusion') .'</a>';\n\t \t\techo '<a href=\"#\" class=\"remove-custom-list-item\">'. __('remove', 'fusion') .'</a>';\n\t\t\techo '</div>';\n\t\techo '</div>';\n\t\texit;\n\t}", "function listItem() {\n\t\treturn ($this->nodes[] = new flStrideListItem())->paragraph();\n\t}", "public function addProperty(Entities\\Devices\\Properties\\Property $property): void\n\t{\n\t\tif (!$this->properties->contains($property)) {\n\t\t\t// ...and assign it to collection\n\t\t\t$this->properties->add($property);\n\t\t}\n\t}", "public function addProperty($property) {\n $this->optionalProperties[] = $property;\n return $this->optionalProperties;\n }", "function addItem(&$item) {\n\t\tglobal $CONF ; \n\t\t$this->items [$item->alias] = $item;\n\t\t$item->menu = $this ;\n\t}", "public function __construct()\n {\n $this->ListItem = [];\n // $this->type='ul';\n }", "public function addItem($item) {\n\t\t$this->result .= '<li>' . $item . '</li>' . PHP_EOL;\n\t}", "public function getAddClassToListItem(): bool;", "public function add( EchoContainmentList $list ) {\n\t\t$this->lists[] = $list;\n\t}", "function add_menu_atts( $atts, $item, $args ) {\n\t\t\t\t$atts['itemprop'] = 'url';\n\t\t\t\treturn $atts;\n\t\t\t}", "function add($item);", "public function addColumn(Property $property);", "public function push($value): IProperty;", "public function initMutateProperty()\n {\n foreach ( $this->initMutateProperties as $property ) {\n $this->mutateProperties[ $property ] = $this->{$property};\n }\n $this->view->addParams( [\n 'mutateProperties' => $this->mutateProperties\n ] );\n }", "protected function configureListFields(ListMapper $listMapper)\r\n {\r\n $listMapper\r\n ->addIdentifier('nombre')\r\n ;\r\n }", "public function embedProperty() {\n\n $this->addEmbed(\"Property\");\n return $this;\n }", "public function addPropertyValues(Property $property) {\r\n foreach ($property->getPropertyValues() as $propertyValue) {\r\n $property->addPropertyValue($propertyValue);\r\n }\r\n }", "protected function configureListFields(ListMapper $listMapper)\n {\n $listMapper\n ->addIdentifier('username' , 'text', array('label'=>'Pseudo')) //This will carry the link that leads to item's individual page\n ->add('enabled' , 'boolean', array('label'=>'Activé'))\n ->add('email' , 'text')\n ->add('roles', null, array('label'=>'Droits'))\n ;\n }", "public function add_declaration($property, $value)\n {\n }", "public function addObjectProperty($field, ObjectProperty $property);" ]
[ "0.5936487", "0.5896852", "0.5895679", "0.5698185", "0.56643826", "0.56640047", "0.56227416", "0.5620114", "0.5614472", "0.5489306", "0.54886883", "0.54606956", "0.5449175", "0.54440165", "0.54290044", "0.5401295", "0.5377366", "0.5342354", "0.52892697", "0.5271184", "0.5232891", "0.52324444", "0.5219012", "0.5217195", "0.5216285", "0.5202156", "0.5161986", "0.5161604", "0.5159661", "0.51298845" ]
0.7517841
0
Collect properties and actions
function collectPropertiesAndActions() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assignProperties() {\n\t\t$hash = $this->__action;\n\t\tforeach ($hash as $key => $value) {\n\t\t\tif (!isset($value)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (preg_match('/^_.*/i', $key)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$this->assignProperty($key, $value);\n\t\t}\n\t}", "public function _getProperties() {}", "function properties()\n {\n }", "function collectStandardPropertiesAndActions()\n\t{\n\t\t$cat_info = $this->getCatInfo();\n\n\t\t//we can move this to the factory.\n\t\tif($cat_info['editable'] and !$this->appointment['event']->isAutoGenerated())\n\t\t{\n\t\t\t$this->ctrl->clearParametersByClass('ilcalendarappointmentgui');\n//\t\t\t$this->ctrl->setParameterByClass('ilcalendarappointmentgui','seed', $this->getSeed()->get(IL_CAL_DATE));\n\t\t\t$this->ctrl->setParameterByClass('ilcalendarappointmentgui','app_id',$this->appointment['event']->getEntryId());\n\t\t\t$this->ctrl->setParameterByClass('ilcalendarappointmentgui','dt',$this->appointment['dstart']);\n\n\t\t\t$this->addAction($this->lng->txt(\"edit\"),\n\t\t\t\t$this->ctrl->getLinkTargetByClass(array('ilcalendarappointmentgui'), 'askEdit'));\n\n\t\t\t$this->ctrl->clearParametersByClass('ilcalendarappointmentgui');\n//\t\t\t$this->ctrl->setParameterByClass('ilcalendarappointmentgui','seed',$this->getSeed()->get(IL_CAL_DATE));\n\t\t\t$this->ctrl->setParameterByClass('ilcalendarappointmentgui','app_id',$this->appointment['event']->getEntryId());\n\t\t\t$this->ctrl->setParameterByClass('ilcalendarappointmentgui','dt',$this->appointment['dstart']);\n\n\t\t\t$this->addAction($this->lng->txt(\"delete\"),\n\t\t\t\t$this->ctrl->getLinkTargetByClass(array('ilcalendarappointmentgui'), 'askDelete'));\n\t\t}\n\n\t}", "function _getProperties() ;", "public function getProperties() {}", "public function getProperties() {}", "public function getProperties() {}", "public function getProperties() {}", "protected function getActions() {}", "abstract protected function properties();", "abstract protected function getProperties();", "private function mapProperties(): void\n {\n $this->properties = Collect::keyBy($this->collection->getProperties()->getValues(), 'identifier');\n }", "public function getAdditionalActions() {}", "public function getAdditionalActions() {}", "public function getAdditionalActions() {}", "public function getAdditionalActions() {}", "public function getAdditionalActions() {}", "public function getAdditionalActions() {}", "protected function collectInformation() {}", "public function getProperties();", "public function getProperties();", "public function getProperties();", "public function getProperties();", "abstract public function getProperties();", "abstract protected function get_properties();", "public function getInjectProperties() {}", "public function collection()\n\t{\n\t\t$properties = Property::PropertyReport($this->request)->get();\n\t\treturn $properties;\n\t}", "public function getProperties(): PropertyCollection;", "public function properties() { }" ]
[ "0.65198797", "0.6388199", "0.638078", "0.62434894", "0.618067", "0.6049998", "0.6049998", "0.6049998", "0.6049375", "0.60099375", "0.59695625", "0.59150213", "0.5841149", "0.58391273", "0.58391273", "0.58391273", "0.58391273", "0.58391273", "0.58391273", "0.5828223", "0.57911754", "0.57911754", "0.57911754", "0.57911754", "0.5789787", "0.577552", "0.5773241", "0.5759551", "0.5722272", "0.5716965" ]
0.90468657
0
Collect standard properties and actions
function collectStandardPropertiesAndActions() { $cat_info = $this->getCatInfo(); //we can move this to the factory. if($cat_info['editable'] and !$this->appointment['event']->isAutoGenerated()) { $this->ctrl->clearParametersByClass('ilcalendarappointmentgui'); // $this->ctrl->setParameterByClass('ilcalendarappointmentgui','seed', $this->getSeed()->get(IL_CAL_DATE)); $this->ctrl->setParameterByClass('ilcalendarappointmentgui','app_id',$this->appointment['event']->getEntryId()); $this->ctrl->setParameterByClass('ilcalendarappointmentgui','dt',$this->appointment['dstart']); $this->addAction($this->lng->txt("edit"), $this->ctrl->getLinkTargetByClass(array('ilcalendarappointmentgui'), 'askEdit')); $this->ctrl->clearParametersByClass('ilcalendarappointmentgui'); // $this->ctrl->setParameterByClass('ilcalendarappointmentgui','seed',$this->getSeed()->get(IL_CAL_DATE)); $this->ctrl->setParameterByClass('ilcalendarappointmentgui','app_id',$this->appointment['event']->getEntryId()); $this->ctrl->setParameterByClass('ilcalendarappointmentgui','dt',$this->appointment['dstart']); $this->addAction($this->lng->txt("delete"), $this->ctrl->getLinkTargetByClass(array('ilcalendarappointmentgui'), 'askDelete')); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function collectPropertiesAndActions()\n\t{\n\n\t}", "public function _getProperties() {}", "function properties()\n {\n }", "function assignProperties() {\n\t\t$hash = $this->__action;\n\t\tforeach ($hash as $key => $value) {\n\t\t\tif (!isset($value)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (preg_match('/^_.*/i', $key)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$this->assignProperty($key, $value);\n\t\t}\n\t}", "function _getProperties() ;", "abstract protected function getProperties();", "abstract protected function properties();", "public function getProperties() {}", "public function getProperties() {}", "public function getProperties() {}", "public function getProperties() {}", "abstract public function getProperties();", "abstract protected function get_properties();", "public function getAdditionalActions() {}", "public function getAdditionalActions() {}", "public function getAdditionalActions() {}", "public function getAdditionalActions() {}", "public function getAdditionalActions() {}", "public function getAdditionalActions() {}", "public function getProperties();", "public function getProperties();", "public function getProperties();", "public function getProperties();", "protected function getActions() {}", "public function properties() { }", "public function getInjectProperties() {}", "protected function collect_attributes() {\n\t\tforeach ( $this->properties as $key => $val ) {\n\t\t\tif ( in_array($key, self::$global_attributes) || in_array($key, static::$element_attributes) ) {\n\t\t\t\t$this->attributes[ $key ] = $val;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// also check for compound attributes, such as data-src, aria-required, etc.\n\t\t\tforeach ( self::$global_attribute_pattern_prefixes as $prefix ) {\n\t\t\t\tif ( preg_match( '/'. $prefix .'[-]\\w+/', $key ) ) {\n\t\t\t\t\t$this->attributes[ $key ] = $val;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function _getCleanProperties() {}", "protected function property_map() { return array(); }", "public function getProperties(): PropertyCollection;" ]
[ "0.8810592", "0.6445596", "0.644509", "0.6407183", "0.6366273", "0.62556255", "0.6227583", "0.6152637", "0.6152637", "0.6152637", "0.6152103", "0.61252975", "0.6114845", "0.6023548", "0.6023548", "0.6023548", "0.6023548", "0.6023548", "0.6023548", "0.5967956", "0.5967956", "0.5967956", "0.5967956", "0.59556246", "0.579391", "0.57799095", "0.5739634", "0.57269555", "0.57132727", "0.5673144" ]
0.70133436
1
Get readable ref ids
function getReadableRefIds($a_obj_id) { if (!isset($this->readable_ref_ids[$a_obj_id])) { $ref_ids = array(); foreach (ilObject::_getAllReferences($a_obj_id) as $ref_id) { if ($this->access->checkAccess("read", "", $ref_id)) { $ref_ids[] = $ref_id; } } $this->readable_ref_ids[$a_obj_id] = $ref_ids; } return $this->readable_ref_ids[$a_obj_id]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getReferenceIdsList(){\n return $this->_get(2);\n }", "public function getReferences();", "public function getReferencesList(){\n return $this->_get(1);\n }", "public function getIds();", "public function getIds();", "public function getDefinedObjectIds() {}", "public function getDefinedObjectIds() {}", "public function getDefinedObjectIds() {}", "public function getRefitListAttribute()\n {\n return $this->allrefits->pluck('id')->all();\n }", "public function getReferences() {\n $result = TingOpenformatMethods::parseFields($this->_getDetails(), array('references'));\n return (is_array($result)) ? reset($result) : $result;\n }", "public function getReferenceables() {\r\n\r\n $keyFields = array_keys($this->fields);\r\n\r\n $referenciables = array_intersect_key($keyFields, $this->indexReferences);\r\n\r\n $fields = array_flip($referenciables);\r\n\r\n\r\n return $fields;\r\n }", "public abstract function get_ids();", "public function getObjectIds();", "public function getCurrentlyReferencedEntityIds() {\n $ret = array();\n if (isset($this->entity) && isset($this->field)) {\n $entity_type = $this->entity_type;\n $field_name = $this->field['field_name'];\n $wrapper = entity_metadata_wrapper($entity_type, $this->entity);\n $ret = $wrapper->{$field_name}->raw();\n }\n\n return $ret;\n }", "public function getConsortialIDs()\n {\n return $this->getFieldArray('035', 'a', true);\n }", "public function getIds()\n {\n\n }", "public function getAllReferences()\n {\n\n return static::$references;\n\n }", "public function get_references()\n\t{\n\t\t$arr = array();\t// returned result\n\t\t$sql = \"SELECT * FROM refs WHERE issue_id = '{$this->id}'\";\n\t\t$this->db->execute_query($sql);\n\t\twhile($line = $this->db->fetch_line()) {\n\t\t\t$arr[] = $line;\n\t\t}\n\t\treturn $arr;\n\t}", "public function getIdentifiers();", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function getAllIds(): array;", "public function getIds() {\n $sources = array();\n \n $sources[] = $this->id;\n \n foreach ($this->points as &$g) {\n $sources[] = $g->id;\n }\n foreach ($this->lines as &$g) {\n $sources[] = $g->id;\n }\n foreach ($this->polygons as &$g) {\n $sources[] = $g->id;\n }\n if ( !empty($this->address) ) {\n $sources[] = $this->address->id;\n }\n foreach ($this->relationships as &$r) {\n $sources[] = $r->id;\n }\n \n return array_filter($sources);\n }", "function taminoGetIds() {\n $rval = $this->tamino->xquery($this->xquery);\n if ($rval) { // tamino Error\n print \"<p>LinkCollection Error: failed to retrieve linkRecord id list.<br>\";\n print \"(Tamino error code $rval)</p>\";\n } else { \n // convert xml ids into a php array \n $this->ids = array();\n $this->xml_result = $this->tamino->xml->getBranches(\"ino:response/xq:result\");\n if ($this->xml_result) {\n\t// Cycle through all of the branches \n\tforeach ($this->xml_result as $branch) {\n\t if ($att = $branch->getTagAttribute(\"id\", \"xq:attribute\")) {\n\t array_push($this->ids, $att);\n\t }\n\t} /* end foreach */\n } \n }\n\n }" ]
[ "0.7446031", "0.6592448", "0.65029806", "0.6434908", "0.6434908", "0.64225173", "0.64218223", "0.64218223", "0.634521", "0.63354915", "0.6313947", "0.6222172", "0.621776", "0.6198486", "0.61848336", "0.618409", "0.61287004", "0.6108813", "0.6063347", "0.60613656", "0.60613656", "0.60613656", "0.60613656", "0.60613656", "0.60613656", "0.60613656", "0.60613656", "0.5940688", "0.59398705", "0.59119296" ]
0.7715353
0
Download files from an appointment ( Modals )
function downloadFiles() { $appointment = $this->appointment; //calendar in the sidebar (marginal calendar) if(empty($appointment)) { $entry_id = (int)$_GET['app_id']; $entry = new ilCalendarEntry($entry_id); //if the entry exists if($entry->getStart()) { $appointment = array( "event" => $entry, "dstart" => $entry->getStart(), "dend" => $entry->getEnd(), "fullday" => $entry->isFullday() ); } else { ilUtil::sendFailure($this->lng->txt("obj_not_found"), true); $this->ctrl->returnToParent($this); } } include_once './Services/Calendar/classes/BackgroundTasks/class.ilDownloadFilesBackgroundTask.php'; $download_job = new ilDownloadFilesBackgroundTask($this->user->getId()); $download_job->setBucketTitle($this->lng->txt("cal_calendar_download")." ".$appointment['event']->getTitle()); $download_job->setEvents(array($appointment)); $download_job->run(); $this->ctrl->returnToParent($this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function downloadFile();", "public function download()\n\t{\n\t\tR::selectDatabase('oxid');\n\t\t$files = $this->getFilesByName(Flight::request()->query->file);\n\t\tif (empty($files)) $this->redirect('/');\n\t\t$file = reset($files);\n\t\t$dwnloadDir = substr($file['OXSTOREHASH'], 0, 2);\n\t\t$dwnloadFile = Flight::get('oxid_dir_downloads').$dwnloadDir.'/'.$file['OXSTOREHASH'];\n\t\tif ( ! is_file($dwnloadFile)) $this->redirect('/');\n\t\t//error_log($dwnloadFile);\n\t\theader('Content-type: application/pdf');\n\t\theader('Content-Disposition: inline; filename=\"'.$file['OXFILENAME'].'\"');\n\t\t@readfile($dwnloadFile);\n\t}", "public function downloadAction(){\n //These are the files that are downloadable.\n $pathToDocs = RAIZ. \"/docs\";\n $param_to_file = array( \"milestone1\" => $pathToDocs . \"/milestone 1/group13-milestone1.pdf\",\n \"milestone2\" => $pathToDocs . \"/milestone 2/group13-milestone2.pdf\",\n \"milestone2-revision1\" => $pathToDocs . \"/milestone 2/group13-milestone2-comments.pdf\",\n \"milestone2-presentation\" => $pathToDocs . \"/milestone 2/group13-milestone2-presentation.pptx\");\n $file = $param_to_file[$this->_getParam('file')];\n //If we are being ask for a file that is not in the previous array, throw an Exception.\n if(is_null($file)){\n throw new Exception(\"Unknown file\");\n }\n //Disable view and layout\n $this->_helper->layout()->disableLayout();\n $this->_helper->viewRenderer->setNoRender(true);\n //The file is in the previous array. So, fetch it and force the download.\n if (file_exists($file) && is_file($file)) {\n header('Content-Description: File Transfer');\n header('Content-Type: application/octet-stream');\n header('Content-Disposition: attachment; filename='.basename($file));\n header('Content-Transfer-Encoding: binary');\n header('Expires: 0');\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n header('Pragma: public');\n header('Content-Length: ' . filesize($file));\n ob_clean();\n flush();\n readfile($file);\n exit;\n }else{\n echo \"<pre style='color:red'>The file does not exists</pre>\";\n } \n }", "public function download() {\n $this->autoRender = false;\n $filename = $this->request->params['pass'][3];\n $orgfilename = $this->request->params['pass'][4];\n// pr($this->request->params); exit;\n $this->response->file(\n 'webroot/uploads/post/files/' . $filename, array(\n 'download' => true,\n 'name' => $orgfilename\n )\n );\n// return $this->response;\n }", "public function downloadAction() {}", "public function download() {\t\t}", "function download()\n {\n $field = $this->GET('field');\n $id = $this->GET('id');\n $file = $this->table->data[$id][$field];\n header('Content-Type: ' . $this->_mime_content_type($file));\n header('Content-Length: ' . strlen($file));\n header('Content-Disposition: attachment; filename=\"' . $field . '_' . $id . '\";');\n echo $file;\n }", "public function actionDownloadApp($app_version = NULL)\n {\n if ($app_version) {\n $sql = 'SELECT * FROM app_update WHERE `version`=' . $app_version;\n $update_data = AppUpdate::findBySql($sql)->one()->toArray();\n Yii::$app->response->SendFile(str_replace('frontend', '', Yii::$app->basePath) . '/uploads/companies/' . $update_data['file_name']);\n Yii::$app->end();\n }\n }", "function download_activity_file($filename)\n\t{\n\t\t$this->http_set_content_type(NULL);\n\t\t$this->load_url(\"activities/$filename\", 'get');\n\t\treturn $this->http_response_body;\n\t}", "public function download()\n {\n $hashids = new Hashids(Configure::read('Security.salt'));\n $pk = $hashids->decode($this->request->query['i'])[0];\n $this->loadModel($this->request->query['m']);\n $data = $this->{$this->request->query['m']}->find('first', array(\n 'recursive' => -1,\n 'conditions' => array(\n \"{$this->request->query['m']}.\" . $this->{$this->request->query['m']}->primaryKey => $pk\n ),\n 'fields' => array(\n \"{$this->request->query['m']}.{$this->request->query['f']}\"\n )\n ));\n $file = json_decode($data[$this->request->query['m']][$this->request->query['f']], true);\n\n header('Content-length: ' . $file['size']);\n header('Content-type: ' . $file['type']);\n header('Content-Disposition: inline; filename=' . $file['name']);\n echo base64_decode($file['content']);\n\n die();\n }", "public function exportExcelAction()\n {\n $fileName = 'appointments.xml';\n $grid = $this->getLayout()->createBlock('appointments/adminhtml_appointments_grid');\n $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));\n }", "public function download() {\n\t\theader('Content-Disposition: attachment; filename=\"' . basename($this->fileName) . '\"');\n\t\t$this->show();\n\t}", "public function download()\n {\n $encrypt = $this->services['encrypt'];\n $file_name = $encrypt->decode($this->getPost('id'));\n $type = $this->getPost('type');\n $storage = $this->services['backup']->setStoragePath($this->settings['working_directory']);\n if($type == 'files')\n {\n $file = $storage->getStorage()->getFileBackupNamePath($file_name);\n }\n else\n {\n $file = $storage->getStorage()->getDbBackupNamePath($file_name);\n }\n \n \n $backup_info = $this->services['backups']->setLocations($this->settings['storage_details'])->getBackupData($file);\n $download_file_path = false;\n if( !empty($backup_info['storage_locations']) && is_array($backup_info['storage_locations']) )\n {\n foreach($backup_info['storage_locations'] AS $storage_location)\n {\n if( $storage_location['obj']->canDownload() )\n {\n $download_file_path = $storage_location['obj']->getFilePath($backup_info['file_name'], $backup_info['backup_type']); //next, get file path\n break;\n }\n }\n }\n \n if($download_file_path && file_exists($download_file_path))\n {\n $this->services['files']->fileDownload($download_file_path);\n exit;\n }\n }", "public function Download(){\n\t\t\n\t\t\n\t}", "public function download_app_update() {\n \n // Download Update\n (new MidrubBaseAdminCollectionUpdateHelpers\\Apps)->download_update();\n \n }", "public function download() {\n $file_name = get('name');\n// return \\Response::download(temp_path($file_name));\n return \\Response::download(storage_path('app') . '/' . $file_name);\n }", "private function fileDownload()\n {\n /**\n * Defined variables\n */\n $configHelper = $this->dataHelper;\n $request = $this->getRequest();\n $ds = DIRECTORY_SEPARATOR;\n $baseDir = DirectoryList::VAR_DIR;\n $fileFactory = $this->fileFactory;\n $contentType = 'application/octet-stream';\n $paramNameRequest = $request->getParam('m');\n $packagePathDir = $configHelper->getConfigAbsoluteDir();\n\n $lastItem = $this->packageFilter();\n $versionPackageData = $lastItem;\n $file = $versionPackageData->getData('file');\n\n $packageName = str_replace('_', '/', $paramNameRequest);\n $correctPathFile = $packagePathDir . $ds . $packageName . $ds . $file;\n\n $fileName = $file;\n $content = file_get_contents($correctPathFile, true);\n $fileDownload = $fileFactory->create($fileName, $content, $baseDir, $contentType);\n\n return $fileDownload;\n }", "public function downloadAllEventPictures(){\n\t\treturn response()->download(public_path('pictures/events'));\n\t}", "public function sendPrroductDownloadToBrowser() {\n $transaction = getTransaction($_GET['id']);\n if ($transaction['status'] == \"valid\") {\n header(\"Content-Type: application/octet-stream\");\n header(\"Content-Transfer-Encoding: binary\");\n header(\"Content-Description: File Transfer\");\n if ($_GET[\"oto\"] && $transaction['oto']) {\n $fparts = explode(\"/\", $sys_oto_location);\n $filename = $fparts[count($fparts)-1];\n header(\"Content-Disposition: attachment; filename=$filename\");\n @readfile($sys_oto_location);\n } else {\n $fparts = explode(\"/\", $sys_item_location);\n $filename = $fparts[count($fparts)-1];\n header(\"Content-Disposition: attachment; filename=$filename\");\n @readfile($sys_item_location);\n }\n exit;\n } elseif ($transaction['status'] == \"expired\") {\n $filename = \"downloadexpired.html\";\n } else {\n $filename = \"invalid.html\";\n }\n showTemplate($filename);\n }", "function ciniki_events_web_fileDownload($ciniki, $tnid, $event_permalink, $file_permalink) {\n\n //\n // Get the tenant storage directory\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'hooks', 'storageDir');\n $rc = ciniki_tenants_hooks_storageDir($ciniki, $tnid, array());\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $tenant_storage_dir = $rc['storage_dir'];\n\n //\n // Get the file details\n //\n $strsql = \"SELECT ciniki_event_files.id, \"\n . \"ciniki_event_files.uuid, \"\n . \"ciniki_event_files.name, \"\n . \"ciniki_event_files.permalink, \"\n . \"ciniki_event_files.extension, \"\n . \"ciniki_event_files.binary_content \"\n . \"FROM ciniki_events, ciniki_event_files \"\n . \"WHERE ciniki_events.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND ciniki_events.permalink = '\" . ciniki_core_dbQuote($ciniki, $event_permalink) . \"' \"\n . \"AND ciniki_events.id = ciniki_event_files.event_id \"\n . \"AND (ciniki_events.flags&0x01) = 0x01 \"\n . \"AND ciniki_event_files.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND CONCAT_WS('.', ciniki_event_files.permalink, ciniki_event_files.extension) = '\" . ciniki_core_dbQuote($ciniki, $file_permalink) . \"' \"\n . \"AND (ciniki_event_files.webflags&0x01) = 0 \" // Make sure file is to be visible\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.events', 'file');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['file']) ) {\n return array('stat'=>'noexist', 'err'=>array('code'=>'ciniki.events.62', 'msg'=>'Unable to find requested file'));\n }\n $rc['file']['filename'] = $rc['file']['name'] . '.' . $rc['file']['extension'];\n\n //\n // Get the storage filename\n //\n $storage_filename = $tenant_storage_dir . '/ciniki.events/files/' . $rc['file']['uuid'][0] . '/' . $rc['file']['uuid'];\n if( file_exists($storage_filename) ) {\n $rc['file']['binary_content'] = file_get_contents($storage_filename); \n }\n\n return array('stat'=>'ok', 'file'=>$rc['file']);\n}", "public function downloadAction() {\r\n $file_id = $this->getRequest()->getParam('file_id');\r\n $chanelphoto = Engine_Api::_()->getItem('sesvideo_chanelphoto', $this->getRequest()->getParam('photo_id'));\r\n if (!$chanelphoto)\r\n return;\r\n $chanelphoto->download_count = $chanelphoto->download_count + 1;\r\n $chanelphoto->save();\r\n $file_id = $chanelphoto->file_id;\r\n if ($file_id == '' || intval($file_id) == 0)\r\n return;\r\n $storageTable = Engine_Api::_()->getDbTable('files', 'storage');\r\n $select = $storageTable->select()->from($storageTable->info('name'), array('storage_path', 'name'))->where('file_id = ?', $file_id);\r\n $storageData = $storageTable->fetchRow($select);\r\n $storageData = (object) $storageData->toArray();\r\n if (empty($storageData->name) || $storageData->name == '' || empty($storageData->storage_path) || $storageData->storage_path == '')\r\n return;\r\n //Get base path\r\n $basePath = APPLICATION_PATH . '/' . $storageData->storage_path;\r\n @chmod($basePath, 0777);\r\n header(\"Content-Disposition: attachment; filename=\" . urlencode(basename($storageData->name)), true);\r\n header(\"Content-Transfer-Encoding: Binary\", true);\r\n header(\"Content-Type: application/force-download\", true);\r\n header(\"Content-Type: application/octet-stream\", true);\r\n header(\"Content-Type: application/download\", true);\r\n header(\"Content-Description: File Transfer\", true);\r\n header(\"Content-Length: \" . filesize($basePath), true);\r\n readfile(\"$basePath\");\r\n exit();\r\n // for safety resason double check\r\n return;\r\n }", "public function downloadTask()\n\t{\n\t\t$filters = array(\n\t\t\t'event_id' => Request::getState(\n\t\t\t\t$this->_option . '.' . $this->_controller . '.event_id',\n\t\t\t\t'id',\n\t\t\t\tarray()\n\t\t\t),\n\t\t\t'search' => urldecode(Request::getState(\n\t\t\t\t$this->_option . '.' . $this->_controller . '.search',\n\t\t\t\t'search',\n\t\t\t\t''\n\t\t\t)),\n\t\t\t// Get sorting variables\n\t\t\t'sort' => Request::getState(\n\t\t\t\t$this->_option . '.' . $this->_controller . '.sort',\n\t\t\t\t'filter_order',\n\t\t\t\t'registered'\n\t\t\t),\n\t\t\t'sort_Dir' => Request::getState(\n\t\t\t\t$this->_option . '.' . $this->_controller . '.sortdir',\n\t\t\t\t'filter_order_Dir',\n\t\t\t\t'DESC'\n\t\t\t)\n\t\t);\n\n\t\t$query = Respondent::all();\n\n\t\tif ($filters['search'])\n\t\t{\n\t\t\t$query->whereLike('first_name', strtolower((string)$filters['search']), 1)\n\t\t\t\t->orWhereLike('last_name', strtolower((string)$filters['search']), 1)\n\t\t\t\t->resetDepth();\n\t\t}\n\n\t\tif ($filters['event_id'])\n\t\t{\n\t\t\tif (!is_array($filters['event_id']))\n\t\t\t{\n\t\t\t\t$filters['event_id'] = array($filters['event_id']);\n\t\t\t}\n\t\t\tif (!empty($filters['event_id']))\n\t\t\t{\n\t\t\t\t$query->whereIn('event_id', $filters['event_id']);\n\t\t\t}\n\t\t}\n\n\t\t$rows = $query\n\t\t\t->order($filters['sort'], $filters['sort_Dir'])\n\t\t\t->paginated('limitstart', 'limit')\n\t\t\t->rows();\n\n\t\tCsv::downloadlist($rows, $this->_option);\n\t}", "function downloadFile($data){\r\n\r\n $dao = new \\PNORD\\Model\\MaintenanceDAO($this->app); \r\n $info = $dao->getMaintenance($data); \r\n $this->app->log->info('****info **** -> '.$this->dumpRet($info));\r\n\r\n\r\n if (file_exists($info['FILES'])) {\r\n\r\n // header('Content-Description: File Transfer');\r\n header('Content-Type: application/zip');\r\n $name = split('maintenances/', $info['FILES']);\r\n $this->app->log->info('****name **** -> '.$this->dumpRet($name));\r\n $this->app->log->info('****info Files **** -> '.$this->dumpRet($info['FILES']));\r\n $this->app->log->info('****filesize(info[FILES]) **** -> '.$this->dumpRet(filesize($info['FILES'])));\r\n header('Content-Disposition: inline; filename='.basename($name[1]));\r\n header('Expires: 0');\r\n header('Cache-Control: must-revalidate');\r\n header('Pragma: public');\r\n header('Content-Length: ' . filesize($info['FILES']));\r\n ob_clean();\r\n flush();\r\n readfile($info['FILES']);\r\n exit;\r\n\r\n } \r\n\r\n }", "function executeDownload($e){\n $url = \"app/info/exportRequestHistory.php?account=\" . $this->account->intVal();\n $html = '<iframe src=\"'.$url.'\" width=\"1\" height=\"1\" style=\"position:absolute;visibility:hidden;\"></iframe>';\n $this->downloadFrame->html($html);\n $this->downloadFrame->updateClient();\n }", "function downloadDocumentAction()\n\t{\n\t\t$request = $this->_request->getParams();\n\t\t$this->_redirect(\"/BO/download-quote.php?type=\".$request['type'].\"&mission_id=\".$request['mission_id'].\"&index=\".$request['index'].\"&quote_id=\".$request['quote_id'].\"&logid=\".$request['logid'].\"&filename=\".$request['filename']);\n\t}", "public function downloadFile()\n {\n // Check for request forgeries.\n Session::checkToken('get') or jexit(Text::_('JINVALID_TOKEN'));\n\n $model = $this->getModel();\n $model->downloadFile();\n }", "public function download_file($id_cc){\n $file = $this->Dao_control_cambios_model->getFileCC($id_cc);\n\n $archivo = $file['archivo'];\n $nombre = $file['nombre_archivo'];\n $tipo = $file['tipo_archivo'];\n $extension = $file['extension_archivo'];\n\n header(\"Content-type: $tipo\");\n header('Content-disposition: attachment; filename=\"'.$nombre.'.docx\"');\n header(\"Content-disposition: attachment; filename='$nombre.$extension'\");\n // header(\"Content-Disposition: inline; filename=$nombre.pdf\");\n print_r($archivo);\n }", "function download_all_attachments($year, $month)\n {\n global $kids;\n global $absolute_destination_folder;\n global $lat, $lng;\n\n $exiftool_path = shell_exec('which exiftool');\n if(strlen($exiftool_path) == 0) {\n unset($exiftool_path);\n }\n\n $events = events($year, $month);\n $count = count($events);\n foreach($events as $i => $e) {\n if($e->type == 'Activity') {\n foreach($e->new_attachments as $a) {\n // Skip photos where our kids are not the primary child in the picture.\n if(!in_array($e->member_display, $kids)) {\n continue;\n }\n\n $description = $e->comment;\n $date = date('Y-m-d H.i.s', $e->event_time);\n\n // Parse Tadpoles' bizzare date format.\n // NOTE: They don't seem to be sending this strange format any longer. Leaving this here just in case.\n // $ts = explode('E', $e->create_time)[0];\n // $ts = str_replace('.', '', $ts);\n // $date = date('Y-m-d H.i.s', $ts);\n\n // Build the filename: \"folder/YYYY-mm-dd HH.mm.ss - Tadpoles - Kid Name.[jpg|mp4]\"\n $filename = $date . ' - Tadpoles - ' . $e->member_display;\n if($a->mime_type == 'image/jpeg') {\n $filename .= '.jpg';\n } else if($a->mime_type == 'video/mp4') {\n $filename .= '.mp4';\n }\n $filename = rtrim($absolute_destination_folder, '/') . '/' . $filename;\n\n echo \"# Downloading $i/$count: $filename\\n\";\n download_attachment($a->key, $filename);\n\n if(isset($exiftool_path)) {\n set_exif_date($filename);\n if(!empty($lat) && !empty($lng)) {\n set_exif_coords($filename, $lat, $lng);\n }\n if(!empty($description)) {\n set_exif_description($filename, $description);\n }\n }\n\n // Set the file's modification date to match date taken for good measure.\n touch($filename, strtotime($date));\n }\n }\n }\n }", "function httpdownload($product_id) {\n \n \t //extra security set form must be filled as session param\n\t //to prevent cmd instant download without it.\n\t if (GetSessionParam('FORMSUBMITED')) {//&&\n\t //(GetGlobal('controller')->calldpc_method('httpdownload.get_filename'))) {\t \n\n $file = $this->wherethefileis . $product_id . $this->file_epithema . $this->ftype;\t \n\t $title = $this->get_product_info($product_id);\t\t \n \n \n if ($this->download_link) { \n //$d = new httpdownload($file);\n\t //$ret = $d->select_download_type();\t \n\t\t //$ret = GetGlobal('controller')->calldpc_method('httpdownload.select_download_type');\n\t\t $ret = GetGlobal('controller')->calldpc_method('httpdownload.set_download use NRSPEED');\n\t\t //infoem by mail and sms\n\t\t $this->send_downloaded_mail($product_id);\n\t }\n\t else\n\t $ret = \"ERROR:file not exist!\";\t \n\t \n\t $w = new window($title. \" SHAREWARE EDITION\",\"<h2>\".$ret.\"</h2>\");//$link);\n\t $out = $w->render();\n\t unset($w);\t\n\t }\n\t else\n\t $out = \"Prohibited area!\"; \n\t \n\t return ($out);\n }", "function downloadfolder($fd)\r\n{\r\n $this->get_files_from_folder($fd,'');\r\n header(\"Content-Disposition: attachment; filename=\" .$this->cs(basename($fd)).\"-\".\".zip\"); \r\n header(\"Content-Type: application/download\");\r\n header(\"Content-Length: \" . strlen($this -> file()));\r\n flush();\r\n echo $this -> file(); \r\n exit();\r\n}" ]
[ "0.6597378", "0.65054774", "0.64853954", "0.6481185", "0.64392763", "0.6373567", "0.63659817", "0.6301281", "0.6253963", "0.6248563", "0.6192465", "0.61775964", "0.6139654", "0.6127384", "0.60666096", "0.6053498", "0.60405105", "0.60267556", "0.6007248", "0.59849405", "0.59810925", "0.5952657", "0.5951173", "0.59496623", "0.5905247", "0.58739054", "0.5862654", "0.5860495", "0.5850642", "0.58202463" ]
0.7904505
0
Get the total results count.
public function getTotalResults() { return isset($this['info']['results']) ? (int) $this['info']['results'] : 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTotalResults() : int\n {\n return $this->totalResults;\n }", "public function totalResults()\n {\n\t\treturn (int) $this->totalResultsReturned;\n }", "public function getTotalResults(): int\n {\n return $this->totalResults;\n }", "public function getTotalNumberOfResults();", "public function count()\r\n {\r\n\t\tif ( null === $this->totalResults )\r\n\t\t{\r\n\t\t\t$this->warmUp();\r\n\t\t}\r\n\r\n\t\treturn $this->totalResults;\r\n\t}", "public function total_results()\n\t{\n\t\t$results = $this->get_results();\n\t\t$total = 0;\n\n\t\tforeach\t( $results as $set ) {\n\t\t\t$total = $total + count( $set );\n\t\t}\n\n\t\treturn $total;\n\t}", "public function getNumTotalQueryResults() : int{\n return $this->numTotalQueryResults;\n }", "public function getTotalResults()\n {\n return $this->totalResults;\n }", "public function getTotalResults()\n {\n return $this->totalResults;\n }", "public function getTotalResults() {\n return $this->totalResults;\n }", "public function getTotalResults()\n {\n if (null === $this->totalResults) {\n $this->totalResults = $this->countResults();\n }\n return $this->totalResults;\n }", "public function getTotalResultsCount()\n {\n if (!$this->xmlRoot) {\n $this->processData();\n }\n return intval((string)$this->xmlRoot->xpath('/searchRetrieveResponse/numberOfRecords'));\n }", "public function getTotalCount($results)\n {\n return $results->getNumFound();\n }", "public function count(): int\n {\n if ($this->numberOfResults === null) {\n $this->initialize();\n if ($this->queryResult !== null) {\n $this->numberOfResults = count($this->queryResult ?? []);\n } else {\n parent::count();\n }\n }\n\n return $this->numberOfResults;\n }", "public function getTotalCount($results)\n {\n return count($results);\n }", "public function numResults()\n {\n return $this->numResults;\n }", "public function getResultCount()\n {\n return ! empty($this->result) ? $this->result->getResultCount() : 0;\n }", "public function count()\n {\n return count($this->getResults());\n }", "public function getNbResults(): int\n {\n return $this->adapter->getTotalHits();\n }", "public function getTotalCount()\n {\n return $this->totalCount;\n }", "public function getTotalHits()\n {\n if (isset($this->results)) {\n return $this->results->getTotalHits();\n }\n }", "public function totalCount();", "public function totalCount();", "public function getTotalResults();", "public function total(): int\n {\n return count($this->all());\n }", "public function getResultCount()\n {\n return $this->count(self::_RESULT);\n }", "public function getResultCount()\n {\n return $this->count(self::_RESULT);\n }", "public function getTotalCount()\n\t{\n\t\treturn $this->totalCount;\n\t}", "public function getTotalCount();", "public function getTotalCount();" ]
[ "0.8893402", "0.8884857", "0.8872842", "0.87649435", "0.8741128", "0.8674973", "0.86277914", "0.8570707", "0.8570707", "0.8527656", "0.847599", "0.8427657", "0.8361371", "0.83166695", "0.82680714", "0.8250403", "0.8212007", "0.82115483", "0.81814116", "0.81425965", "0.8130029", "0.8129455", "0.8129455", "0.8119201", "0.8112236", "0.8107297", "0.81067175", "0.8098135", "0.80971676", "0.80971676" ]
0.8944239
0
Returns the raw http request response status string.
public function getRawStatus() { return (isset($this->headers) && isset($this->headers[0])) ? $this->headers[0] : ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getStatus() {\n\t\treturn http_response_code();\n\t}", "protected function httpStatusLine()\r\n {\r\n return sprintf('HTTP/%s %s', $this->protocol_version, $this->status);\r\n }", "public function getResponseStatus()\n\t\t{\n\t\t\treturn $this->getHeader( \"status\" );\n\t\t}", "public function status() {\r\n\t\treturn self::request(self::HTTP_GET, 'status');\r\n\t}", "public function status_header() {\n return 'HTTP/1.1 ' . $this->status_code . ' ' . $this->status_meaning();\n }", "public function getResponseStatus() {\n return $this->response_status;\n }", "public function getResponseStatus() {\n return $this->response_status;\n }", "public function apiStatus(): string\n {\n return $this->request('apiStatus', 'GET');\n }", "public function __toString() {\n return sprintf('HTTP/1.1 %d %s', $this->getStatus(), $this->getDescription());\n }", "public function getFirstResponseStatus(): string\n {\n $responseStatus = $this->getAllHeaders()[0] ?? '';\n\n //200 OK, protocol signature varies, HTTP 1.1/1.0, etc.\n if (preg_match('/200 OK/i', $responseStatus) === 1) {\n return self::STATUS_OK;\n }\n\n if (preg_match('/404 Not Found/i', $responseStatus) === 1) {\n return self::STATUS_NOT_FOUND;\n }\n\n return self::STATUS_OTHER;\n }", "public function getResponseStatus()\n {\n return $this->ResponseStatus;\n }", "public function httpStatus() {\n return $this->_http_status;\n }", "public function getStatusText()\n {\n return $this->statusText;\n }", "public function getStatusText()\n {\n return $this->statusText;\n }", "public function getStatusText()\n {\n return $this->statusText;\n }", "public function status()\n {\n return $this->response->getStatusCode();\n }", "public function getStatus()\n {\n return (int)substr($this->response, 9, 3);\n }", "private function getStatusMessage(){\n\t\t$status = array(\n\t\t\t\t100 => 'Continue', \n\t\t\t\t101 => 'Switching Protocols', \n\t\t\t\t200 => 'OK',\n\t\t\t\t201 => 'Created', \n\t\t\t\t202 => 'Accepted', \n\t\t\t\t203 => 'Non-Authoritative Information', \n\t\t\t\t204 => 'No Content', \n\t\t\t\t205 => 'Reset Content', \n\t\t\t\t206 => 'Partial Content', \n\t\t\t\t300 => 'Multiple Choices', \n\t\t\t\t301 => 'Moved Permanently', \n\t\t\t\t302 => 'Found', \n\t\t\t\t303 => 'See Other', \n\t\t\t\t304 => 'Not Modified', \n\t\t\t\t305 => 'Use Proxy', \n\t\t\t\t306 => '(Unused)', \n\t\t\t\t307 => 'Temporary Redirect', \n\t\t\t\t400 => 'Bad Request', \n\t\t\t\t401 => 'Unauthorized', \n\t\t\t\t402 => 'Payment Required', \n\t\t\t\t403 => 'Forbidden', \n\t\t\t\t404 => 'Not Found', \n\t\t\t\t405 => 'Method Not Allowed', \n\t\t\t\t406 => 'Not Acceptable', \n\t\t\t\t407 => 'Proxy Authentication Required', \n\t\t\t\t408 => 'Request Timeout', \n\t\t\t\t409 => 'Conflict', \n\t\t\t\t410 => 'Gone', \n\t\t\t\t411 => 'Length Required', \n\t\t\t\t412 => 'Precondition Failed', \n\t\t\t\t413 => 'Request Entity Too Large', \n\t\t\t\t414 => 'Request-URI Too Long', \n\t\t\t\t415 => 'Unsupported Media Type', \n\t\t\t\t416 => 'Requested Range Not Satisfiable', \n\t\t\t\t417 => 'Expectation Failed', \n\t\t\t\t500 => 'Internal Server Error', \n\t\t\t\t501 => 'Not Implemented', \n\t\t\t\t502 => 'Bad Gateway', \n\t\t\t\t503 => 'Service Unavailable', \n\t\t\t\t504 => 'Gateway Timeout', \n\t\t\t\t505 => 'HTTP Version Not Supported');\n\t\treturn ($status[$this->_code]) ? $status[$this->_code] : $status[500];\n\t}", "public function getStatus(): string\n {\n return $this->status;\n }", "public function getStatus(): string\n {\n return $this->status;\n }", "public function getStatus(): string\n {\n return $this->status;\n }", "public function getStatus(): string\n {\n return $this->status;\n }", "public function getStatusString()\n {\n return $this->statuses[$this->statusId];\n }", "public function getHTTPStatusCode() { return $this->status; }", "public function status()\n {\n return (int)$this->response->getStatusCode();\n }", "public function getStatusAsString()\n {\n $list = self::getStatusList();\n if (isset($list[$this->status]))\n return $list[$this->status];\n\n return 'Unknown';\n }", "public function httpStatus()\n {\n return $this->provider->httpStatus;\n }", "public function getHttpStatusMessage()\r\n\t{\r\n\t return $this->_solrResponse->getHttpStatusMessage();\r\n\t}", "public function __toString() {\n\t\tforeach ($this->headers as $header) {\n\t\t\theader($header, true);\n\t\t}\n\t\thttp_response_code($this->statusCode);\n\n\t\treturn $this->content ?: '';\n\t}", "public function getResponseStatusMessage()\r\n\t{\r\n\t\treturn $this->statusMessage;\r\n\t}" ]
[ "0.747659", "0.7338915", "0.72885865", "0.7229605", "0.72246015", "0.7130166", "0.7130166", "0.70649326", "0.7020941", "0.70006806", "0.6997883", "0.6986414", "0.69494677", "0.6917115", "0.6915716", "0.68983614", "0.6888168", "0.68615156", "0.68483233", "0.68483233", "0.68483233", "0.68483233", "0.6828063", "0.6805086", "0.6792516", "0.6787686", "0.678178", "0.67734236", "0.67454094", "0.6742506" ]
0.7926654
0
A user has many sign in IP's
public function ip(){ return $this->hasMany(Ip::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function beLoginLinkIPList() {}", "public function isUserIPAddressAllowedAccess()\n\t{\n\t\ttry\n {\n $IpBin = new IpBin();\n return $IpBin->isUserIPAddressAllowedAccess($this->getSiteUser()->getId());\n }\n catch(\\Whoops\\Example\\Exception $e)\n {\n Log::error(\"Could not check if ip address is allowed access for user [\" . $this->getSiteUser()->getId() . \"]. \" . $e);\n return FALSE;\n }\n\t}", "public function getModelIps(){\n\t\treturn $this->hasMany(Ip::className(), ['subnet' => 'id']);\n\t}", "public function addwhitelistip() \n\t{\n\t\tUserModel::authentication();\n\t\t\n\t\tSecurityModel::add_ip_whitelist();\n }", "function user_log_allowed($ip_address) {\n\n\t\t//invalid ip address\n\t\tif (!filter_var($ip_address, FILTER_VALIDATE_IP)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t//check to see if the address was authenticated successfully\n\t\t$sql = \"select count(user_log_uuid) \";\n\t\t$sql .= \"from v_user_logs \";\n\t\t$sql .= \"where remote_address = :remote_address \";\n\t\t$sql .= \"and result = 'success' \";\n\t\t$sql .= \"and timestamp > NOW() - INTERVAL '8 days' \";\n\t\t$parameters['remote_address'] = $ip_address; \n\t\t$database = new database;\n\t\t$user_log_count = $database->select($sql, $parameters, 'column');\n\t\tunset($database);\n\n\t\t//debug info\n\t\tif ($debug) {\n\t\t\techo \"address \".$ip_address.\" count \".$user_log_count.\"\\n\";\n\t\t}\n\n\t\t//default authorized to false\n\t\t$allowed = false;\n\n\t\t//use the ip address to get the authorized nodes\n\t\tif ($user_log_count > 0) {\n\t\t\t$allowed = true;\n\t\t}\n\n\t\t//return\n\t\treturn $allowed;\n\t}", "public function GetIp()\n {\t\n\t$q = Doctrine_Query::create()\n\t\t\t\t\t\t->select('*')\n\t\t\t\t\t\t->from('Users')\n\t\t\t\t\t\t->where('id = ?',$this->getUser()->getId());\n\t$result =$q->FetchOne();\n\treturn $result->getUserIp();\n }", "static function isUserIPInList($ipAddress){\n\t\t//IP list of specific anonymous users\n\t\t$ini = eZINI::instance('ssoip.ini');\n \t$ipList = $ini->variable('AuthSettings', 'IP');\n \t if ( $ipAddress && is_array( $ipList ) ){\n\t\t\t//If IP address of current user exists and IP list available\n \t\tforeach( $ipList as $itemToMatch => $id ){\n \t\tif ( ip_in_range($ipAddress, $itemToMatch) ){\n \t\t\treturn $id;\n \t\t}\n \t}\n }\n\t\t//Current user not identified as specific anonymous user\n \treturn false;\n \t}", "public function get_all_hotspot_user(){\n return $this->query('/ip/hotspot/user/getall');\n }", "function getIPs() {\r\n $ip = $_SERVER[\"REMOTE_ADDR\"];\r\n if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\r\n \t$ip .= '_'.$_SERVER['HTTP_X_FORWARDED_FOR'];\r\n }\r\n if (isset($_SERVER['HTTP_CLIENT_IP'])) {\r\n \t$ip .= '_'.$_SERVER['HTTP_CLIENT_IP'];\r\n }\r\n return $ip;\r\n}", "public static function bootUserIp()\n {\n static::updating(function ($model) {\n $model->user_ip = \\Request::ip();\n });\n\n static::creating(function ($model) {\n $model->user_ip = \\Request::ip();\n }); \n }", "public static function ipLoginAttempts($ip = null)\r\n {\r\n if (!filter_var($ip, FILTER_VALIDATE_IP)) {\r\n $ip = Help::getIp();\r\n }\r\n $return = App::$db->\r\n create('SELECT count(user_id) as attempts FROM user_logs WHERE ip = :ip AND `timestamp` > :timenow AND `action` = :action AND `what` = :what')->\r\n bind($ip, 'ip')->\r\n bind(time() - 1200, 'timenow')->\r\n bind('FAILLOGIN', 'action')->\r\n bind('A', 'what')->\r\n execute();\r\n\r\n return $return[0]['attempts'];\r\n }", "function handleSSOLogin()\n {\n\t\tif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])){\n \t\t\t$ipAddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t}else{\n \t\t\t$ipAddress = $_SERVER['REMOTE_ADDR'];\n\t\t}\n\t\t$pos = strripos( $ipAddress, ',');\n\t\tif ($pos === false) {\n \t\t\t//nothing to do\t\n\t\t}else{\n\t\t\t$ipAddress=trim(str_replace(\",\",\"\",strrchr($ipAddress,\",\")));\n\t\t}\n\t\t$id = self::isUserIPInList($ipAddress);\n\t\t\n\t\t$ini = eZINI::instance('ssoip.ini');\n \t$debug = $ini->variable('AuthSettings', 'Debug');\n\t\tif ($debug == 'enabled'){\n\t\t\teZLog::write(\"$ipAddress -----> id= $id\",'sso.log');\n\t\t}\n\t\tif ( $id !== false ){\n\t\t\t$user = eZUser::fetch( $id );\n\t\t\tif ( is_object( $user ) ){\n\t\t\t\treturn $user;\n\t\t }\n\t\t}\n return false;\n }", "private function getAllowedIPs()\n {\n $ips_config = $this->config->get('restrict_login.ips');\n\n return !is_array($ips_config) ? array() : array_keys($ips_config);\n }", "function getIps() {\n\t\treturn $this->findParentsOfClass('Ip');\n\t}", "public function getMyConnectionList(){\n return $this->belongsTo(User::class, 'req_user_id');\n }", "public function getIpAdress(){\n return $this->auth['ip_adress'];\n }", "public function getClientIps()\n {\n $clientIps = array();\n $ip = $this->server->get('REMOTE_ADDR');\n if (!$this->isFromTrustedProxy()) {\n return array($ip);\n }\n if (self::$trustedHeaders[self::HEADER_FORWARDED] && $this->headers->has(self::$trustedHeaders[self::HEADER_FORWARDED])) {\n $forwardedHeader = $this->headers->get(self::$trustedHeaders[self::HEADER_FORWARDED]);\n preg_match_all('{(for)=(\"?\\[?)([a-z0-9\\.:_\\-/]*)}', $forwardedHeader, $matches);\n $clientIps = $matches[3];\n } elseif (self::$trustedHeaders[self::HEADER_CLIENT_IP] && $this->headers->has(self::$trustedHeaders[self::HEADER_CLIENT_IP])) {\n $clientIps = array_map('trim', explode(',', $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_IP])));\n }\n $clientIps[] = $ip; // Complete the IP chain with the IP the request actually came from\n $ip = $clientIps[0]; // Fallback to this when the client IP falls into the range of trusted proxies\n foreach ($clientIps as $key => $clientIp) {\n // Remove port (unfortunately, it does happen)\n if (preg_match('{((?:\\d+\\.){3}\\d+)\\:\\d+}', $clientIp, $match)) {\n $clientIps[$key] = $clientIp = $match[1];\n }\n if (IpUtils::checkIp($clientIp, self::$trustedProxies)) {\n unset($clientIps[$key]);\n }\n }\n // Now the IP chain contains only untrusted proxies and the client IP\n return $clientIps ? array_reverse($clientIps) : array($ip);\n }", "public function probe_ip($ip)\n {\n return $this->connection->query_select('posts', array('DISTINCT uid AS id'), array('ipaddress' => $ip));\n }", "function event_guard_log_allowed($ip_address) {\n\n\t\t//invalid ip address\n\t\tif (!filter_var($ip_address, FILTER_VALIDATE_IP)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t//get the access control allowed nodes\n\t\t$sql = \"select count(event_guard_log_uuid) \";\n\t\t$sql .= \"from v_event_guard_logs \";\n\t\t$sql .= \"where ip_address = :ip_address \";\n\t\t$sql .= \"and log_status = 'unblocked' \";\n\t\t$parameters['ip_address'] = $ip_address; \n\t\t$database = new database;\n\t\t$user_log_count = $database->select($sql, $parameters, 'column');\n\t\tunset($database);\n\n\t\t//debug info\n\t\tif ($debug) {\n\t\t\techo \"address \".$ip_address.\" count \".$user_log_count.\"\\n\";\n\t\t}\n\n\t\t//default authorized to false\n\t\t$allowed = false;\n\n\t\t//use the ip address to get the authorized nodes\n\t\tif ($user_log_count > 0) {\n\t\t\t$allowed = true;\n\t\t}\n\n\t\t//return\n\t\treturn $allowed;\n\t}", "public function getUsuariosVotos()\n {\n return $this->hasMany(User::className(), ['id' => 'usuario_id'])->via('votos');\n }", "function get_user_ip()\n{\n if (empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n return$_SERVER['REMOTE_ADDR'];\n }\n $ip = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n return $ip[0];\n}", "public function add_user($ip){\n\t\t$query = \"INSERT INTO nodes(\n user_ip,\n\t\t\tuser_join_time) \n\t\t\tVALUES(?, NOW()) \n ON DUPLICATE KEY UPDATE user_ip = ?, user_join_time = NOW();\n\t\t\";\n\t\t\t\n\t\t$stmt = $this->prepare_statement($query);\n if(!$stmt)\n return NULL;\n\t\t$bind = $stmt->bind_param(\"ss\", $ip, $ip);\n\t\tif(!$bind)\n\t\t\treturn NULL;\n\t\t\n\t\t$exec = $stmt->execute();\n\t\tif(!$exec)\n\t\t\treturn NULL;\n\t\t\t\n\t\treturn $stmt->insert_id;\n\t}", "private function getIp()\n\t {\n\t \n\t if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) &&( $_SERVER['HTTP_X_FORWARDED_FOR'] != '' ))\n\t {\n\t $client_ip =\n\t ( !empty($_SERVER['REMOTE_ADDR']) ) ?\n\t $_SERVER['REMOTE_ADDR']\n\t :\n\t ( ( !empty($_ENV['REMOTE_ADDR']) ) ?\n\t $_ENV['REMOTE_ADDR']\n\t :\n\t \"unknown\" );\n\t \n\t // los proxys van añadiendo al final de esta cabecera\n\t // las direcciones ip que van \"ocultando\". Para localizar la ip real\n\t // del usuario se comienza a mirar por el principio hasta encontrar\n\t // una dirección ip que no sea del rango privado. En caso de no\n\t // encontrarse ninguna se toma como valor el REMOTE_ADDR\n\t \n\t $entries = split('[, ]', $_SERVER['HTTP_X_FORWARDED_FOR']);\n\t \n\t reset($entries);\n\t while (list(, $entry) = each($entries))\n\t {\n\t $entry = trim($entry);\n\t if ( preg_match(\"/^([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)/\", $entry, $ip_list) )\n\t {\n\t // http://www.faqs.org/rfcs/rfc1918.html\n\t $private_ip = array(\n\t '/^0\\./',\n\t '/^127\\.0\\.0\\.1/',\n\t '/^192\\.168\\..*/',\n\t '/^172\\.((1[6-9])|(2[0-9])|(3[0-1]))\\..*/',\n\t '/^10\\..*/');\n\t \n\t $found_ip = preg_replace($private_ip, $client_ip, $ip_list[1]);\n\t \n\t if ($client_ip != $found_ip)\n\t {\n\t $client_ip = $found_ip;\n\t break;\n\t }\n\t }\n\t }\n\t }\n\t else\n\t {\n\t $client_ip =\n\t ( !empty($_SERVER['REMOTE_ADDR']) ) ?\n\t $_SERVER['REMOTE_ADDR']\n\t :\n\t ( ( !empty($_ENV['REMOTE_ADDR']) ) ?\n\t $_ENV['REMOTE_ADDR']\n\t :\n\t \"unknown\" );\n\t }\n\t \n\t return $client_ip;\n\t \n\t}", "public function identities() {\n return $this->hasMany('App\\SocialIdentity');\n }", "function mswIPAddresses() {\n $ip = array();\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n $ip[] = $_SERVER['HTTP_CLIENT_IP'];\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'],',')!==FALSE) {\n $split = explode(',',$_SERVER['HTTP_X_FORWARDED_FOR']);\n foreach ($split AS $value) {\n $ip[] = $value;\n }\n } else {\n $ip[] = $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n } else {\n $ip[] = (isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '');\n }\n return (!empty($ip) ? implode(', ',$ip) : '');\n}", "public function getIps()\n {\n return $this->ips;\n }", "public function user()\n\t{\n\t\treturn $this->belongsToMany('Trip');\n\t}", "private function checkIp(){\n\t\tif( !$this->isAuth() ){\n\t\t\treturn false;\n\t\t}\n\t\treturn ( $_SESSION['userIp'] == $_SERVER['REMOTE_ADDR'] );\n\t}", "function ipRange($ip){\n\n $ipArray = [];\n\n $ipadd = explode(\".\", $ip);\n\n #For loop that traverses the closely matching objects in the db\n #to check if it is composed of a range (specified with a \"-\" or a \"~\")\n for ($i = 0; $i < sizeof($ipadd); $i++){\n \tif(strpos(($ipadd[$i]), \"-\") == true){\n \t$octet = $i;\n $iprange = explode(\"-\",$ipadd[$i]);\n $min = $iprange[0];\n $max = $iprange[1]; \n \t}\n \telse if(strpos(($ipadd[$i]), \"~\") == true){\n \t$octet = $i;\n $iprange = explode(\"~\",$ipadd[$i]);\n $min = $iprange[0];\n $max = $iprange[1]; \n \t}\n\n }\n\n\n for($i = $min; $i <= $max; $i++){\n $ipadd[$octet] = $i;\n \n for ($j = 0; $j < sizeof($ipadd); $j++){\n\n $address = implode(\".\", $ipadd);\n }\n \n $ipArray[] = $address;\n \n }\n\n #Return the list of all IP addresses in the range\n return $ipArray;\n\n }", "public function checkUserIp(GetResponseEvent $event) {\n //The method to determine the user's IP may different from across environments and if VPN/CDN is used.\n //use a switch statement that defaults to getClientIp() method\n $ip = $event->getRequest()->getClientIp();\n\n //TODO: Logic to get User ID may need to be it's own Service\n $current_user = \\Drupal::currentUser();\n $user = \\Drupal\\user\\Entity\\User::load($current_user->id());\n $uid = $user->id();\n\n $known_ipv4 = \\Drupal::config('ip_ranger.settings')->get('ip_ranger_ipv4');\n $known_ipv6 = \\Drupal::config('ip_ranger.settings')->get('ip_ranger_ipv6');\n $known_ipv4_cidrs = \\Drupal::config('ip_ranger.settings')->get('ip_ranger_ipv4_cidrs');\n $known_ipv6_cidrs = \\Drupal::config('ip_ranger.settings')->get('ip_ranger_ipv6_cidrs');\n\n $ip_service = \\Drupal::service('ip_ranger.iputils');\n $ip4_array = $ip_service::getArrayOfIps($known_ipv4);\n $ip6_array = $ip_service::getArrayOfIps($known_ipv6);\n $ip4_cidrs_array = $ip_service::getArrayOfIps($known_ipv4_cidrs);\n $ip6_cidrs_array = $ip_service::getArrayOfIps($known_ipv6_cidrs);\n\n //check if ip is in array\n $network_status_array = [];\n $network_status_array['ipv4'] = (in_array($ip, $ip4_array))?1:0;\n $network_status_array['ipv6'] = (in_array($ip, $ip6_array))?1:0;\n\n //check to see if IP address are in the given CIDR range\n $ip_v4_cidr_matches = $ip_service::isIpInCidrRange($ip, $ip4_cidrs_array);\n $ip_v6_cidr_matches = $ip_service::isIpInCidrRange($ip, $ip6_cidrs_array);\n\n //count($array) should return empty when there is a match or populate array with matched ranges\n $network_status_array['ipv4cidr'] = (!count($ip_v4_cidr_matches))?1:0;\n $network_status_array['ipv6cidr'] = (!count($ip_v6_cidr_matches))?1:0;\n\n $in_network_status = \"FALSE\";\n if( in_array(1, $network_status_array)) {\n $in_network_status = \"TRUE\";\n }\n\n $request = \\Drupal::request();\n $session = $request->getSession();\n $session->set('ip_ranger_is_in_network', $in_network_status);\n\n //current network status\n $ip_network_status = $session->get('ip_ranger_is_in_network');\n //todo: refactor IpRangerSettingsForms.php validation helper functions to utilize Custom/IpUtils helper functions\n\n }" ]
[ "0.62348485", "0.5848797", "0.57623976", "0.5744963", "0.5669535", "0.5661536", "0.55875164", "0.55772877", "0.552688", "0.55173653", "0.546303", "0.54510534", "0.5440554", "0.54095995", "0.5392626", "0.52679634", "0.5262802", "0.521243", "0.52095884", "0.51835513", "0.5170072", "0.515497", "0.5151797", "0.51459765", "0.5145174", "0.5141227", "0.51396495", "0.5132512", "0.5124907", "0.5120801" ]
0.6326377
0
InviteHistoryHandler::buildConditionQuery() To set sql query condition
public function buildConditionQuery() { $this->sql_condition = ' user_id='.$this->CFG['user']['user_id']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setConditions() {\r\n if( count($this->sqlConditions) ) {\r\n $this->sql .= ' WHERE ' . $this->sqlStrConditions;\r\n }\r\n }", "protected function buildQuery()\n\t{\n\t\t$this->query = count($this->conditions) ? 'WHERE ' . implode(' AND ', $this->conditions) : '';\n\t}", "private function getSQLCondition() {\n\t\t// the manager can see everyone in the department\n\t\t// the admin and everybody else can see everyone in the company.\n\t\tswitch ($this->page->config['user_level']) {\n\t\t\tcase lu_manager:\n\t\t\tcase lu_employee:\n\t\t\tcase lu_admin:\n\t\t\t\t$sql = 'WHERE 1 = 2';\n\t\t\t\tbreak;\t//nobody below GM can access this subject\n\t\t\tcase lu_gm:\n\t\t\tcase lu_owner:\n\t\t\t\t$sql = ' WHERE c.company_id = '.$this->page->company['company_id'];\n\t\t}\n\t\treturn $sql;\n\t}", "private function getSQLCondition() {\n\t\t// the manager can see everyone in the department\n\t\t// the admin and everybody else can see everyone in the company.\n\t\tswitch ($this->page->config['user_level']) {\n\t\t\tcase lu_manager:\n\t\t\tcase lu_employee:\n\t\t\tcase lu_admin:\n\t\t\tcase lu_gm:\n\t\t\tcase lu_owner:\n\t\t\t\t$sql = ' WHERE l.company_id = '.$this->page->company['company_id'];\n\t\t}\n\t\treturn $sql;\n\t}", "public function getCondition() {\n\n \t$condition = array();\n \t$this->getQueryString(\"keyword\", $condition);\n \t$this->getQueryString(\"activityId\", $condition);\n \t$this->getQueryString(\"activityIds\", $condition);\n \t$this->getQueryString(\"activityType\", $condition);\n $this->getQueryString(\"state\", $condition);\n $this->getQueryString(\"orderDateStart\", $condition);\n $this->getQueryString(\"orderDateEnd\", $condition);\n $this->getQueryString(\"deliveryDateStart\", $condition);\n $this->getQueryString(\"deliveryDateEnd\", $condition);\n $this->getQueryString(\"serial\", $condition);\n $this->getQueryString(\"consumerId\", $condition);\n $this->getQueryString(\"payDateTimeStart\", $condition);\n $this->getQueryString(\"payDateTimeEnd\", $condition);\n $this->getQueryString(\"productId\", $condition);\n $this->getQueryString(\"deliveryId\", $condition);\n $this->getQueryString(\"productArray\", $condition);\n \n \treturn $condition;\n }", "protected function _buildCondition(){\n \t$aryCondition = array();\n \t\n \tif(!empty($this->postData)){\n \t\t //search\n\t\t\t \t\t\t\n\t\t\tif($this->postData['title']!=''){\n \t\t \t$aryCondition['like'][] = array(\"mt.title\"=>$this->postData['title']);\n \t\t }\t\t\t\n\t\t\tif($this->postData['page']!=''){\n \t\t \t$aryCondition['and'][] = array(\"mt.page\"=>$this->postData['page']);\n \t\t }\t\t\t\n\t\t\tif($this->postData['code']!=''){\n \t\t \t$aryCondition['like'][] = array(\"mt.code\"=>$this->postData['code']);\n \t\t }\t\t\t\n\t\t\tif($this->postData['status']!=''){\n \t\t \t$aryCondition['and'][] = array(\"mt.status\"=>$this->postData['status']);\n \t\t }\t\t\t\n\n \t}\n \treturn $aryCondition;\n }", "protected function _buildWhere(&$query)\r\n {\r\n\r\n\r\n \t//if($this->_checkin!=null)\r\n \t//{\r\n \t//\t$query->where('ltap.ltap_qdatu = \"'.$this->_confdate.'\"');\r\n \t//}\r\n return $query;\r\n }", "protected function construct_where_clause() {\n\t\t\t$whereclause = $this->get_where_clause();\n\t\t\tif ( '' !== $whereclause ) {\n\t\t\t\t$this->where = '' === $this->where ? \" where ($whereclause) \" : \" {$this->where} and ($whereclause) \";\n\t\t\t}\n\t\t}", "function get_condition()\r\n {\r\n $owner = $this->owner;\r\n\r\n $conds = array();\r\n $parent = $this->parent;\r\n $category = $parent->get_parameter(WeblcmsManager :: PARAM_CATEGORY);\r\n $category = $category ? $category : 0;\r\n $conds[] = new EqualityCondition(ContentObjectPublication :: PROPERTY_CATEGORY_ID, $category, ContentObjectPublication :: get_table_name());\r\n\r\n $type_cond = array();\r\n $types = array(Assessment :: get_type_name(), Survey :: get_type_name(), Hotpotatoes :: get_type_name());\r\n foreach ($types as $type)\r\n {\r\n $type_cond[] = new EqualityCondition(ContentObject :: PROPERTY_TYPE, $type);\r\n }\r\n $conds[] = new OrCondition($type_cond);\r\n $c = Utilities :: query_to_condition($this->query);\r\n if (! is_null($c))\r\n {\r\n $conds[] = $c;\r\n }\r\n return new AndCondition($conds);\r\n }", "protected function getWhereClause() {}", "function makeTriggerSQL($condition_ix)\n{\n $triggerSQLs = array();\n $joins = array();\n foreach($this->triggers as $trg_ix => $triggerFields){\n $defSnips = array();\n foreach($triggerFields as $triggerField){\n $def = $triggerField->getDef();\n $defSnips[] = $def['snippet'];\n $joins = array_merge($joins, $def['joins']);\n }\n $SQL = \"CASE WHEN \";\n $SQL .= join(' AND ', $defSnips);\n //$SQL .= \" THEN 1 ELSE NULL END\";\n $SQL .= \" THEN 'C{$condition_ix}Tr{$trg_ix}' ELSE NULL END\";\n $triggerSQLs[] = $SQL;\n }\n\n if(count($this->triggers) > 1){\n //$SQL = \"COALESCE(\".join(',', $triggerSQLs).\")\";\n $SQL = \"CONCAT_WS(',', \".join(',', $triggerSQLs).\")\";\n }\n $SQL .= \" AS Condition_$condition_ix\";\n return array('triggerExpr' => $SQL, 'joins' => $joins);\n}", "private function buildWhere()\n {\n $query = array();\n\n // Make sure there's something to do\n if (isset($this->query['where']) and count($this->query['where'])) {\n foreach ($this->query['where'] as $group => $conditions) {\n $group = array(); // Yes, because the $group above is not used, get over it.\n foreach ($conditions as $condition => $value) {\n // Get column name\n $cond = explode(\" \", $condition);\n $column = str_replace('`', '', $cond[0]);\n $safeColumn = $this->columnName($column);\n\n // Make the column name safe\n $condition = str_replace($column, $safeColumn, $condition);\n\n // Add value to the bind queue\n $valueBindKey = str_replace(array('.', '`'), array('_', ''), $safeColumn);\n\n if (!empty($value) or $value !== null) {\n $this->valuesToBind[$valueBindKey] = $value;\n }\n\n // Add condition to group\n $group[] = str_replace(\"?\", \":{$valueBindKey}\", $condition);\n }\n\n // Add the group\n $query[] = \"(\" . implode(\" AND \", $group) . \")\";\n }\n\n // Return\n return \"WHERE \" . implode(\" OR \", $query);\n }\n }", "protected function user_where_clause() {}", "function sql_condition_statemment(array $criteria, int $totalCount)\n {\n // Init\n $sql = \"\";\n\n // Rendr base on condition\n $count = 0;\n foreach ($criteria as $filter => $value) {\n\n $str = (is_array($value)) \n ? objectSearchHandle($filter, $value)\n : \"$filter = '$value'\";\n \n $is_not_last = ($totalCount - 1 != $count);\n\n if($str):\n $sql .= $str;\n $sql .= ($is_not_last) ? \" AND \" : \"\";\n endif;\n\n $count ++;\n }\n // Return\n return $sql;\n }", "protected function buildWhereClause() {\r\n\t\t$sql='';\r\n\t\tif (count($this->_salt_wheres)>0) {\r\n\t\t\t$sql.=' WHERE '.implode(' ', $this->_salt_wheres);\r\n\t\t}\r\n\t\treturn $sql;\r\n\r\n\t}", "public function condition()\n {\n $op = $this->getDefaultOperator();\n $params = func_get_args();\n \n switch (count($params)) {\n case 1:\n if (is_string($params[0])) {\n $this->addCondition('literal', [$params[0]]);\n } elseif (is_array($params[0])) {\n $combination = $this->getDefaultOperator();\n \n /**\n * The code within the foreach is an extraction of Zend\\Db\\Sql\\Select::where()\n */\n foreach ($params[0] as $pkey => $pvalue) {\n if (is_string($pkey) && strpos($pkey, '?') !== false) {\n # ['id = ?' => 1]\n # ['id IN (?, ?, ?)' => [1, 3, 4]]\n $predicate = new ZfPredicate\\Expression($pkey, $pvalue);\n } elseif (is_string($pkey)) {\n if ($pvalue === null) {\n # ['name' => null] -> \"ISNULL(name)\"\n $predicate = new ZfPredicate\\IsNull($pkey, $pvalue);\n } elseif (is_array($pvalue)) {\n # ['id' => [1, 2, 3]] -> \"id IN (1, 2, 3)\"\n $predicate = new ZfPredicate\\In($pkey, $pvalue);\n } else {\n # ['id' => $id] -> \"id = 15\"\n $predicate = new ZfPredicate\\Operator($pkey, ZfPredicate\\Operator::OP_EQ, $pvalue);\n }\n } elseif ($pvalue instanceof ZfPredicate\\PredicateInterface) {\n $predicate = $pvalue;\n } else {\n # ['id = ?'] -> \"id = ''\"\n # ['id = 1'] -> literal.\n $predicate = (strpos($pvalue, Expression::PLACEHOLDER) !== false)\n ? new ZfPredicate\\Expression($pvalue) : new ZfPredicate\\Literal($pvalue);\n }\n $this->getCurrentPredicate()->addPredicate($predicate, $combination);\n }\n }\n break;\n \n case 2:\n # $rel->where('foo = ? AND id IN (?) AND bar = ?', [true, [1, 2, 3], false]);\n # If passing a non-array value:\n # $rel->where('foo = ?', 1);\n # But if an array is to be passed, must be inside another array\n # $rel->where('id IN (?)', [[1, 2, 3]]);\n if (!is_array($params[1])) {\n $params[1] = [$params[1]];\n }\n $this->expandPlaceholders($params[0], $params[1]);\n $this->addCondition('expression', [$params[0], $params[1]]);\n break;\n \n case 3:\n # $rel->where('id', '>', 2);\n $this->getCurrentPredicate()->addPredicate(\n new ZfPredicate\\Operator($params[0], $params[1], $params[2])\n );\n break;\n \n default:\n throw new Exception\\BadMethodCallException(\n sprintf(\n \"One to three arguments are expected, %s passed\",\n count($params)\n )\n );\n }\n \n return $this;\n }", "private function addConditionToQuery($sqlPart) {\n if (empty($sqlPart)) {\n return;\n }\n $this->sql .= $sqlPart;\n }", "function build_sql_conditions( $args = array() ){\r\n\t\tglobal $wpdb;\r\n\t\t$events_table = $wpdb->prefix . EM_EVENTS_TABLE;\r\n\t\t$locations_table = $wpdb->prefix . EM_LOCATIONS_TABLE;\r\n\t\t\r\n\t\t$conditions = parent::build_sql_conditions($args);\r\n\t\t//eventful locations\r\n\t\tif( true == $args['eventful'] ){\r\n\t\t\t$conditions[] = \"{$events_table}.event_id IS NOT NULL\";\r\n\t\t}elseif( true == $args['eventless'] ){\r\n\t\t\t$conditions[] = \"{$events_table}.event_id IS NULL\";\r\n\t\t}\r\n\t\treturn $conditions;\r\n\t}", "public function buildWhereClause()\n {\n $criterias = $this->bean->ownCriteria;\n if (empty($criterias)) {\n return '1';\n }// find all because there are no criterias\n $where = array();\n $this->filter_values = array();\n //$mask = \" %s %s %s\"; // login, field, op (with masked value)\n $n = 0;\n foreach ($criterias as $id=>$criteria) {\n if (! $criteria->op) {\n continue;\n } // skip all entries that say any!\n if ($criteria->value === null || $criteria->value === '') {\n continue;\n } // skip all empty\n $n++;\n $logic = 'AND ';//$criteria->logic;\n if ($n == 1) {\n $logic = '';\n }\n $where[] = $logic.$criteria->makeWherePart($this);\n }\n\n if (empty($where)) {\n return '1';\n }// find all because there was no active criteria\n\n $where = implode(' ', $where);\n return $where;\n }", "protected function getQueryCondition()\n {\n $parts = [];\n foreach ($this->fields as $field) {\n $parts[] = \"{$field} LIKE :pattern\";\n }\n return implode(' AND ', $parts);\n }", "public function build()\n {\n return empty($this->conditions) ? '' : ' WHERE '.implode(' AND ', $this->conditions);\n }", "function channel_entries_sql_where($sql, &$channel)\n\t{\n\n\t\tif ( is_string( $this->EE->extensions->last_call ) === TRUE )\n\t\t{\n\t\t\t$sql\t= $this->EE->extensions->last_call;\n\t\t}\n\n\t\t/** ----------------------------------------\n\t\t/**\tShould we proceed?\n\t\t/** ----------------------------------------*/\n\n\t\tif ( $this->EE->TMPL->fetch_param('date_field') === FALSE OR $this->EE->TMPL->fetch_param('date_field') == '' )\n\t\t{\n\t\t\treturn $sql;\n\t\t}\n\n\t\tif ( ( $this->EE->TMPL->fetch_param('date_field_start') === FALSE OR $this->EE->TMPL->fetch_param('date_field_start') == '' ) AND ( $this->EE->TMPL->fetch_param('date_field_stop') === FALSE OR $this->EE->TMPL->fetch_param('date_field_stop') == '' ) )\n\t\t{\n\t\t\treturn $sql;\n\t\t}\n\n\t\tif ( empty( $this->EE->TMPL->site_ids ) )\n\t\t{\n\t\t\treturn $sql;\n\t\t}\n\n\t\t/** ----------------------------------------\n\t\t/**\tLoop for site ids and add DB queries\n\t\t/** ----------------------------------------*/\n\n\t\t$sql_a\t= array();\n\n\t\tforeach ( $this->EE->TMPL->site_ids as $site_id )\n\t\t{\n\t\t\tif ( ! empty( $channel->dfields[$site_id][ $this->EE->TMPL->fetch_param('date_field') ] ) )\n\t\t\t{\n\t\t\t\t$field_id\t= $channel->dfields[$site_id][ $this->EE->TMPL->fetch_param('date_field') ];\n\n\t\t\t\t$sql_b\t= array();\n\n\t\t\t\tif ( $this->EE->TMPL->fetch_param('date_field_start') != '' )\n\t\t\t\t{\n\t\t\t\t\t$sql_b[]\t= \" ( wd.field_id_{$field_id} >= '\".$this->EE->localize->string_to_timestamp( $this->EE->db->escape_str( $this->EE->TMPL->fetch_param('date_field_start') ) ).\"' AND wd.site_id = \" . $this->EE->db->escape_str( $site_id ) . \" )\";\n\n\t\t\t\t}\n\n\t\t\t\tif ( $this->EE->TMPL->fetch_param('date_field_stop') != '' )\n\t\t\t\t{\n\t\t\t\t\t$sql_b[]\t= \" ( wd.field_id_{$field_id} < '\".$this->EE->localize->string_to_timestamp( $this->EE->db->escape_str( $this->EE->TMPL->fetch_param('date_field_stop') ) ).\"' AND wd.site_id = \" . $this->EE->db->escape_str( $site_id ) . \" )\";\n\t\t\t\t}\n\n\t\t\t\t$sql_a[]\t= implode( ' AND ', $sql_b );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $sql_a ) )\n\t\t{\n\t\t\t/** ----------------------------------------\n\t\t\t/**\tPrepare the necessary DB join\n\t\t\t/** ----------------------------------------*/\n\n\t\t\tif ( strpos($sql, 'LEFT JOIN exp_channel_data') === FALSE )\n\t\t\t{\n\t\t\t\t$sql = str_replace( 'LEFT JOIN exp_members', 'LEFT JOIN exp_channel_data AS wd ON wd.entry_id = t.entry_id LEFT JOIN exp_members', $sql );\n\t\t\t}\n\n\t\t\t/** ----------------------------------------\n\t\t\t/**\tAdd our new conditions\n\t\t\t/** ----------------------------------------*/\n\n\t\t\t$sql\t.= \" AND ( \" . implode( ' OR ', $sql_a ) . \" )\";\n\t\t}\n\n\t\t/*\n\t\tif ( $SESS->userdata('group_id') == '1' )\n\t\t{\n\t\t\techo \"Visible only to Super Admins<br /><br />\";\n\t\t\tprint_r( $sql );\n\t\t\techo \"<br /><br />Visible only to Super Admins\";\n\t\t}\n\t\t*/\n\t\treturn $sql;\n\t}", "public function addCondition($condition);", "public function appendConditions( $criteria, $condition, $params )\n {\n\n\n // append codition if the query has a default filter\n if( $this->condition )\n {\n if( ctype_digit($this->condition) )\n {\n $criteria->where( 'project_task.rowid = '.$this->condition );\n }\n else if( is_string($this->condition) )\n {\n $criteria->where( $this->condition );\n }\n else if( is_array($this->condition) )\n {\n $this->checkConditions( $criteria, $this->condition );\n }\n }\n\n if( $condition )\n {\n if( ctype_digit($condition ) )\n {\n $criteria->where( 'project_task.rowid = '.$condition );\n }\n else if( is_string($condition) )\n {\n $criteria->where( $condition );\n }\n else if( is_array($condition) )\n {\n $this->checkConditions( $criteria, $condition );\n }\n }\n\n\n if( $params->begin )\n {\n $this->checkCharBegin( $criteria, $params );\n }\n\n }", "protected function _whereCondition($condition) \n\t{\n\t\t$result = 'WHERE ';\n\n\t\tforeach ($condition as $key => $value) {\n\t\t\tif (in_array($key, $this->_fields)) {\n\t\t\t\tif (!is_array($value)) {\n\t\t\t\t\t$this->_stringData($condition);\n\t\t\t\t\t$result .= \"`\" . $key . \"`=\" . $value. ' AND ';\n\t\t\t\t} else {\n\t\t\t\t\t$result .= $this->_moreWhere($key, $value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//substr last 'and'\n\t\t$result = substr($result, 0, -5);\n\n\t\treturn $result;\n\t}", "static function add_condition($where=array(),$cond='',$key=NULL,$value=NULL) {\n\tif ($cond) $where['cond'][]=$cond;\n\t$args=func_get_args();\n\tfor ($i=2; $i<count($args); $i=$i+2) {\n\t\tif (isset($args[$i])) $where['value'][$args[$i]]=isset($args[$i+1])?$args[$i+1]:NULL;\n\t}\n\treturn $where;\n}", "private static function buildCondition($params)\n {\n if (isset($params['where'])) {\n $conditions = [];\n foreach ($params['where'] as $field => $value) {\n $conditions[] = \"{$field}='{$value}'\";\n }\n\n return ' where ' . implode(' and ', $conditions);\n }\n\n return '';\n }", "function s_m_put_get_condition($ref_id_db_arr, $ref_data){\r\n $where = \"\";\r\n for($i = 0; $i < count($ref_id_db_arr); $i++){\r\n $where .= $ref_id_db_arr[$i] . \"='\" . $ref_data[$i] . \"'' AND \";\r\n }\r\n return substr($where, 0, strlen($where) - 5);\r\n}", "public function getJoinCondition() {}", "function getJoinCondition() ;" ]
[ "0.68864834", "0.68085957", "0.680683", "0.6734019", "0.6692721", "0.6644008", "0.6426997", "0.63803226", "0.6374544", "0.6348217", "0.62887436", "0.62869596", "0.6280701", "0.62404245", "0.6223", "0.62116224", "0.62072766", "0.6181086", "0.61724585", "0.61554337", "0.6152544", "0.6150844", "0.61346984", "0.61205035", "0.61174756", "0.6108321", "0.61061066", "0.6104373", "0.60932744", "0.6077669" ]
0.80201805
0
InviteHistoryHandler::displayHistory() To set display values
public function displayHistory() { $data_arr = array(); $inc = 0; while($row = $this->fetchResultRecord()) { $uDetails = $this->isMemberJoined($row['email']); $statusClass = ''; $status = $this->LANG['invitation_history_email_status_not_joined']; if ($uDetails) { $status = $this->LANG['invitation_history_email_status_joined']; } $data_arr[$inc]['date_added'] = $row['date_added']; $data_arr[$inc]['attempts'] = $row['attempts']; $data_arr[$inc]['email'] = $row['email']; $data_arr[$inc]['class'] = ($uDetails)?'clsJoined':'clsNotJoined';; $data_arr[$inc]['status'] = $status; $data_arr[$inc]['remind_url'] = getUrl('invitationhistory', '?action=remind&id='.$row['invitation_id'].'&start='.$this->fields_arr['start'], '?action=remind&id='.$row['invitation_id'].'&start='.$this->fields_arr['start']); $data_arr[$inc]['delete_url'] = getUrl('invitationhistory', '?action=delete&id='.$row['invitation_id'].'&start'.$this->fields_arr['start'], '?action=delete&id='.$row['invitation_id'].'&start'.$this->fields_arr['start']); $data_arr[$inc]['check_box_value'] = $row['invitation_id']; $inc++; } return $data_arr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(history $history)\n {\n //\n }", "public function actionHistory()\n {\n $model= User::findOne(['id' => Yii::$app->user->identity->getId()]);\n $orders = Order::find()->where(['id_user' => $model->id])->with('orderProds')->orderBy('date DESC')->all();\n return $this->render('history', [\n 'model' => $model,\n 'orders' => $orders,\n 'page' => SmapPages::find()->where(['id_class'=>4,'alias' => 'history'])->one()\n ]);\n }", "function simple_history_print_history($args = null) {\n\t\n\tglobal $simple_history;\n\t\n\t$arr_events = simple_history_get_items_array($args);\n\t#sf_d($arr_events);\n\t#sf_d($args);sf_d($arr_events);\n\t$defaults = array(\n\t\t\"page\" => 0,\n\t\t\"items\" => $simple_history->get_pager_size(),\n\t\t\"filter_type\" => \"\",\n\t\t\"filter_user\" => \"\",\n\t\t\"is_ajax\" => false\n\t);\n\n\t$args = wp_parse_args( $args, $defaults );\n\t$output = \"\";\n\tif ($arr_events) {\n\t\tif (!$args[\"is_ajax\"]) {\n\t\t\t// if not ajax, print the div\n\t\t\t$output .= \"<div class='simple-history-ol-wrapper'><ol class='simple-history'>\";\n\t\t}\n\t\n\t\t$loopNum = 0;\n\t\t$real_loop_num = -1;\n\t\tforeach ($arr_events as $one_row) {\n\t\t\t\n\t\t\t$real_loop_num++;\n\n\t\t\t$object_type = $one_row->object_type;\n\t\t\t$object_type_lcase = strtolower($object_type);\n\t\t\t$object_subtype = $one_row->object_subtype;\n\t\t\t$object_id = $one_row->object_id;\n\t\t\t$object_name = $one_row->object_name;\n\t\t\t$user_id = $one_row->user_id;\n\t\t\t$action = $one_row->action;\n\t\t\t$action_description = $one_row->action_description;\n\t\t\t$occasions = $one_row->occasions;\n\t\t\t$num_occasions = sizeof($occasions);\n\t\t\t$object_image_out = \"\";\n\n\t\t\t$css = \"\";\n\t\t\tif (\"attachment\" == $object_type_lcase) {\n\t\t\t\tif (wp_get_attachment_image_src($object_id, array(50,50), true)) {\n\t\t\t\t\t// yep, it's an attachment and it has an icon/thumbnail\n\t\t\t\t\t$css .= ' simple-history-has-attachment-thumnbail ';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (\"user\" == $object_type_lcase) {\n\t\t\t\t$css .= ' simple-history-has-attachment-thumnbail ';\n\t\t\t}\n\n\t\t\tif ($num_occasions > 0) {\n\t\t\t\t$css .= ' simple-history-has-occasions ';\n\t\t\t}\n\t\t\t\n\t\t\t$output .= \"<li class='$css'>\";\n\n\t\t\t$output .= \"<div class='first'>\";\n\t\t\t\n\t\t\t// who performed the action\n\t\t\t$who = \"\";\n\t\t\t$user = get_user_by(\"id\", $user_id); // false if user does not exist\n\n\t\t\tif ($user) {\n\t\t\t\t$user_avatar = get_avatar($user->user_email, \"32\"); \n\t\t\t\t$user_link = \"user-edit.php?user_id={$user->ID}\";\n\t\t\t\t$who_avatar = sprintf('<a class=\"simple-history-who-avatar\" href=\"%2$s\">%1$s</a>', $user_avatar, $user_link);\n\t\t\t} else {\n\t\t\t\t$user_avatar = get_avatar(\"\", \"32\"); \n\t\t\t\t$who_avatar = sprintf('<span class=\"simple-history-who-avatar\">%1$s</span>', $user_avatar);\n\t\t\t}\n\t\t\t$output .= $who_avatar;\n\t\t\t\n\t\t\t// section with info about the user who did something\n\t\t\t$who .= \"<span class='who'>\";\n\t\t\tif ($user) {\n\t\t\t\t$who .= sprintf('<a href=\"%2$s\">%1$s</a>', $user->user_nicename, $user_link);\n\t\t\t\tif (isset($user->first_name) || isset($user->last_name)) {\n\t\t\t\t\tif ($user->first_name || $user->last_name) {\n\t\t\t\t\t\t$who .= \" (\";\n\t\t\t\t\t\tif ($user->first_name && $user->last_name) {\n\t\t\t\t\t\t\t$who .= esc_html($user->first_name) . \" \" . esc_html($user->last_name);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$who .= esc_html($user->first_name) . esc_html($user->last_name); // just one of them, no space necessary\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$who .= \")\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$who .= \"&lt;\" . __(\"Unknown or deleted user\", 'simple-history') .\"&gt;\";\n\t\t\t}\n\t\t\t$who .= \"</span>\";\n\n\t\t\t// what and object\n\t\t\tif (\"post\" == $object_type_lcase) {\n\t\t\t\t\n\t\t\t\t$post_out = \"\";\n\t\t\t\t\n\t\t\t\t// Get real name for post type (not just the slug for custom post types)\n\t\t\t\t$post_type_object = get_post_type_object( $object_subtype );\n\t\t\t\tif ( is_null($post_type_object) ) {\n\t\t\t\t\t$post_out .= esc_html__( ucfirst( $object_subtype ) );\n\t\t\t\t} else {\n\t\t\t\t\t$post_out .= esc_html__( ucfirst( $post_type_object->labels->singular_name ) );\n\t\t\t\t}\n\n\t\t\t\t$post = get_post($object_id);\n\n\t\t\t\tif (null == $post) {\n\t\t\t\t\t// post does not exist, probably deleted\n\t\t\t\t\t// check if object_name exists\n\t\t\t\t\tif ($object_name) {\n\t\t\t\t\t\t$post_out .= \" <span class='simple-history-title'>\\\"\" . esc_html($object_name) . \"\\\"</span>\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$post_out .= \" <span class='simple-history-title'>&lt;unknown name&gt;</span>\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t#$title = esc_html($post->post_title);\n\t\t\t\t\t$title = get_the_title($post->ID);\n\t\t\t\t\t$title = esc_html($title);\n\t\t\t\t\t$edit_link = get_edit_post_link($object_id, 'display');\n\t\t\t\t\t$post_out .= \" <a href='$edit_link'>\";\n\t\t\t\t\t$post_out .= \"<span class='simple-history-title'>{$title}</span>\";\n\t\t\t\t\t$post_out .= \"</a>\";\n\t\t\t\t}\n\n\t\t\t\t$post_out .= \" \" . esc_html__($action, \"simple-history\");\n\t\t\t\t\n\t\t\t\t$post_out = ucfirst($post_out);\n\t\t\t\t$output .= $post_out;\n\n\t\t\t\t\n\t\t\t} elseif (\"attachment\" == $object_type_lcase) {\n\t\t\t\n\t\t\t\t$attachment_out = \"\";\n\t\t\t\t$attachment_out .= __(\"attachment\", 'simple-history') . \" \";\n\n\t\t\t\t$post = get_post($object_id);\n\t\t\t\t\n\t\t\t\tif ($post) {\n\n\t\t\t\t\t// Post for attachment was found\n\n\t\t\t\t\t$title = esc_html(get_the_title($post->ID));\n\t\t\t\t\t$edit_link = get_edit_post_link($object_id, 'display');\n\t\t\t\t\t$attachment_metadata = wp_get_attachment_metadata( $object_id );\n\t\t\t\t\t$attachment_file = get_attached_file( $object_id );\n\t\t\t\t\t$attachment_mime = get_post_mime_type( $object_id );\n\t\t\t\t\t$attachment_url = wp_get_attachment_url( $object_id );\n\n // Check that file exists. It may not due to local dev vs remove dev etc.\n $file_exists = file_exists($attachment_file);\n\n\t\t\t\t\t// Get attachment thumbnail. 60 x 60 is the same size as the media overview uses\n\t\t\t\t\t// Is thumbnail of object if image, is wp icon if not\n\t\t\t\t\t$attachment_image_src = wp_get_attachment_image_src($object_id, array(60, 60), true);\t\t\t\t\t\n if ($attachment_image_src && $file_exists) {\n\t\t\t\t\t\t$object_image_out .= \"<a class='simple-history-attachment-thumbnail' href='$edit_link'><img src='{$attachment_image_src[0]}' alt='Attachment icon' width='{$attachment_image_src[1]}' height='{$attachment_image_src[2]}' /></a>\";\n } else {\n $object_image_out .= \"<a class='simple-history-attachment-thumbnail' href='$edit_link'></a>\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Begin adding nice to have meta info about to attachment (name, size, mime, etc.)\t\t\t\t\t\n\t\t\t\t\t$object_image_out .= \"<div class='simple-history-attachment-meta'>\";\n\n\t\t\t\t\t// File name\n\n\t\t\t\t\t// Get size in human readable format. Code snippet from media.php\n\t\t\t\t\t$sizes = array( 'KB', 'MB', 'GB' );\n\n $attachment_filesize = \"\";\n if ( $file_exists ) {\n $attachment_filesize = filesize( $attachment_file );\n for ( $u = -1; $attachment_filesize > 1024 && $u < count( $sizes ) - 1; $u++ ) {\n $attachment_filesize /= 1024;\n }\n }\n\n if (empty($attachment_filesize)) {\n $str_attachment_size = \"<p>\" . __(\"File size: Unknown \", \"simple-history\") . \"</p>\";\n } else {\n $size_unit = ($u == -1) ? __(\"bytes\", \"simple-history\") : $sizes[$u];\n $str_attachment_size = sprintf('<p>%1$s %2$s %3$s</p>', __(\"File size:\", \"simple-history\"), round( $attachment_filesize, 0 ), $size_unit );\n\t\t\t\t\t}\n\n\t\t\t\t\t// File type\n\t\t\t\t\t$file_type_out = \"\";\n\t\t\t\t\tif ( preg_match( '/^.*?\\.(\\w+)$/', $attachment_file, $matches ) )\n\t\t\t\t\t\t$file_type_out .= esc_html( strtoupper( $matches[1] ) );\n\t\t\t\t\telse\n\t\t\t\t\t\t$file_type_out .= strtoupper( str_replace( 'image/', '', $post->post_mime_type ) );\n\t\t\t\n\t\t\t\t\t// Media size, width x height\n\t\t\t\t\t$media_dims = \"\";\n\t\t\t\t\tif ( ! empty( $attachment_metadata['width'] ) && ! empty( $attachment_metadata['height'] ) ) {\n\t\t\t\t\t\t$media_dims .= \"<span>{$attachment_metadata['width']}&nbsp;&times;&nbsp;{$attachment_metadata['height']}</span>\";\n\t\t\t\t\t}\n\n\t\t\t\t\t// Generate string with metainfo\n $object_image_out .= $str_attachment_size;\n $object_image_out .= sprintf('<p>%1$s %2$s</p>', __(\"File type:\"), $file_type_out );\n\t\t\t\t\tif ( ! empty( $media_dims ) ) $object_image_out .= sprintf('<p>%1$s %2$s</p>', __(\"Dimensions:\"), $media_dims );\t\t\t\t\t\n\t\t\t\t\tif ( ! empty( $attachment_metadata[\"length_formatted\"] ) ) $object_image_out .= sprintf('<p>%1$s %2$s</p>', __(\"Length:\"), $attachment_metadata[\"length_formatted\"] );\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// end attachment meta info box output\n\t\t\t\t\t$object_image_out .= \"</div>\"; // close simple-history-attachment-meta\n\n\t\t\t\t\t$attachment_out .= \" <a href='$edit_link'>\";\n\t\t\t\t\t$attachment_out .= \"<span class='simple-history-title'>{$title}</span>\";\n\t\t\t\t\t$attachment_out .= \"</a>\";\n\t\t\t\t\t\n\t\t\t\t} else {\n\n\t\t\t\t\t// Post for attachment was not found\n\t\t\t\t\tif ($object_name) {\n\t\t\t\t\t\t$attachment_out .= \"<span class='simple-history-title'>\\\"\" . esc_html($object_name) . \"\\\"</span>\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$attachment_out .= \" <span class='simple-history-title'>&lt;deleted&gt;</span>\";\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t$attachment_out .= \" \" . esc_html__($action, \"simple-history\") . \" \";\n\t\t\t\t\n\t\t\t\t$attachment_out = ucfirst($attachment_out);\n\t\t\t\t$output .= $attachment_out;\n\n\t\t\t} elseif (\"user\" == $object_type_lcase) {\n\n\t\t\t\t$user_out = \"\";\n\t\t\t\t$user_out .= __(\"user\", 'simple-history');\n\t\t\t\t$user = get_user_by(\"id\", $object_id);\n\t\t\t\tif ($user) {\n\t\t\t\t\t$user_link = \"user-edit.php?user_id={$user->ID}\";\n\t\t\t\t\t$user_out .= \"<span class='simple-history-title'>\";\n\t\t\t\t\t$user_out .= \" <a href='$user_link'>\";\n\t\t\t\t\t$user_out .= $user->user_nicename;\n\t\t\t\t\t$user_out .= \"</a>\";\n\t\t\t\t\tif (isset($user->first_name) && isset($user->last_name)) {\n\t\t\t\t\t\tif ($user->first_name || $user->last_name) {\n\t\t\t\t\t\t\t$user_out .= \" (\";\n\t\t\t\t\t\t\tif ($user->first_name && $user->last_name) {\n\t\t\t\t\t\t\t\t$user_out .= esc_html($user->first_name) . \" \" . esc_html($user->last_name);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$user_out .= esc_html($user->first_name) . esc_html($user->last_name); // just one of them, no space necessary\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$user_out .= \")\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$user_out .= \"</span>\";\n\t\t\t\t} else {\n\t\t\t\t\t// most likely deleted user\n\t\t\t\t\t$user_link = \"\";\n\t\t\t\t\t$user_out .= \" \\\"\" . esc_html($object_name) . \"\\\"\";\n\t\t\t\t}\n\n\t\t\t\t$user_out .= \" \" . esc_html__($action, \"simple-history\");\n\t\t\t\t\n\t\t\t\t$user_out = ucfirst($user_out);\n\t\t\t\t$output .= $user_out;\n\n\t\t\t} elseif (\"comment\" == $object_type_lcase) {\n\t\t\t\t\n\t\t\t\t$comment_link = get_edit_comment_link($object_id);\n\t\t\t\t$output .= ucwords(esc_html__(ucfirst($object_type))) . \" \" . esc_html($object_subtype) . \" <a href='$comment_link'><span class='simple-history-title'>\" . esc_html($object_name) . \"\\\"</span></a> \" . esc_html__($action, \"simple-history\");\n\n\t\t\t} else {\n\n\t\t\t\t// unknown/general type\n\t\t\t\t// translate the common types\n\t\t\t\t$unknown_action = $action;\n\t\t\t\tswitch ($unknown_action) {\n\t\t\t\t\tcase \"activated\":\n\t\t\t\t\t\t$unknown_action = __(\"activated\", 'simple-history');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"deactivated\":\n\t\t\t\t\t\t$unknown_action = __(\"deactivated\", 'simple-history');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"enabled\":\n\t\t\t\t\t\t$unknown_action = __(\"enabled\", 'simple-history');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"disabled\":\n\t\t\t\t\t\t$unknown_action = __(\"disabled\", 'simple-history');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$unknown_action = $unknown_action; // dah!\n\t\t\t\t}\n\t\t\t\t$output .= ucwords(esc_html__($object_type, \"simple-history\")) . \" \" . ucwords(esc_html__($object_subtype, \"simple-history\")) . \" <span class='simple-history-title'>\\\"\" . esc_html($object_name) . \"\\\"</span> \" . esc_html($unknown_action);\n\n\t\t\t}\n\t\t\t$output .= \"</div>\";\n\t\t\t\n\t\t\t// second div = when and who\n\t\t\t$output .= \"<div class='second'>\";\n\t\t\t\n\t\t\t$date_i18n_date = date_i18n(get_option('date_format'), strtotime($one_row->date), $gmt=false);\n\t\t\t$date_i18n_time = date_i18n(get_option('time_format'), strtotime($one_row->date), $gmt=false);\t\t\n\t\t\t$now = strtotime(current_time(\"mysql\"));\n\t\t\t$diff_str = sprintf( __('<span class=\"when\">%1$s ago</span> by %2$s', \"simple-history\"), human_time_diff(strtotime($one_row->date), $now), $who );\n\t\t\t$output .= $diff_str;\n\t\t\t$output .= \"<span class='when_detail'>\".sprintf(__('%s at %s', 'simple-history'), $date_i18n_date, $date_i18n_time).\"</span>\";\n\n\t\t\t// action description\n\t\t\tif ( trim( $action_description ) ) {\n\t\t\t\t$output .= sprintf(\n\t\t\t\t\t'\n\t\t\t\t\t<a href=\"#\" class=\"simple-history-item-description-toggler\">%2$s</a>\n\t\t\t\t\t<div class=\"simple-history-item-description-wrap\">\n\t\t\t\t\t\t<div class=\"simple-history-action-description\">%1$s</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t',\n\t\t\t\t\tnl2br( esc_attr( $action_description ) ), // 2\n\t\t\t\t\t__(\"Details\", \"simple-history\") // 2\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\t$output .= \"</div>\";\n\n\t\t\t// Object image\n\t\t\tif ( $object_image_out ) {\n\n\t\t\t\t$output .= sprintf(\n\t\t\t\t\t'\n\t\t\t\t\t<div class=\"simple-history-object-image\">\n\t\t\t\t\t\t%1$s\n\t\t\t\t\t</div>\n\t\t\t\t\t',\n\t\t\t\t\t$object_image_out\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t\t// occasions\n\t\t\tif ($num_occasions > 0) {\n\t\t\t\t$output .= \"<div class='third'>\";\n\t\t\t\tif ($num_occasions == 1) {\n\t\t\t\t\t$one_occasion = __(\"+ 1 occasion\", 'simple-history');\n\t\t\t\t\t$output .= \"<a class='simple-history-occasion-show' href='#'>$one_occasion</a>\";\n\t\t\t\t} else {\n\t\t\t\t\t$many_occasion = sprintf(__(\"+ %d occasions\", 'simple-history'), $num_occasions);\n\t\t\t\t\t$output .= \"<a class='simple-history-occasion-show' href='#'>$many_occasion</a>\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$output .= \"<ul class='simple-history-occasions hidden'>\";\n\t\t\t\tforeach ($occasions as $one_occasion) {\n\t\t\t\t\n\t\t\t\t\t$output .= \"<li>\";\n\t\t\t\t\n\t\t\t\t\t$date_i18n_date = date_i18n(get_option('date_format'), strtotime($one_occasion->date), $gmt=false);\n\t\t\t\t\t$date_i18n_time = date_i18n(get_option('time_format'), strtotime($one_occasion->date), $gmt=false);\t\t\n\t\t\t\t\n\t\t\t\t\t$output .= \"<div class='simple-history-occasions-one-when'>\";\n\t\t\t\t\t$output .= sprintf(\n\t\t\t\t\t\t\t__('%s ago (%s at %s)', \"simple-history\"), \n\t\t\t\t\t\t\thuman_time_diff(strtotime($one_occasion->date), $now), \n\t\t\t\t\t\t\t$date_i18n_date, \n\t\t\t\t\t\t\t$date_i18n_time\n\t\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\tif ( trim( $one_occasion->action_description ) ) {\n\t\t\t\t\t\t$output .= \"<a href='#' class='simple-history-occasions-details-toggle'>\" . __(\"Details\", \"simple-history\") . \"</a>\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$output .= \"</div>\";\n\n\t\t\t\t\tif ( trim( $one_occasion->action_description ) ) {\n\t\t\t\t\t\t$output .= sprintf(\n\t\t\t\t\t\t\t'<div class=\"simple-history-occasions-one-action-description\">%1$s</div>',\n\t\t\t\t\t\t\tnl2br( esc_attr( $one_occasion->action_description ) )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\n\t\t\t\t\t$output .= \"</li>\";\n\t\t\t\t}\n\n\t\t\t\t$output .= \"</ul>\";\n\n\t\t\t\t$output .= \"</div>\";\n\t\t\t}\n\n\t\t\t$output .= \"</li>\";\n\n\t\t\t$loopNum++;\n\n\t\t}\n\t\t\n\t\t// if $loopNum == 0 no items where found for this page\n\t\tif ($loopNum == 0) {\n\t\t\t$output .= \"noMoreItems\";\n\t\t}\n\t\t\n\t\tif ( ! $args[\"is_ajax\"] ) {\n\n\t\t\t// if not ajax, print the divs and stuff we need\n\t\t\t$show_more = \"<select>\";\n\t\t\t$show_more .= sprintf('<option value=5 %2$s>%1$s</option>', __(\"Show 5 more\", 'simple-history'), ($args[\"items\"] == 5 ? \" selected \" : \"\") );\n\t\t\t$show_more .= sprintf('<option value=15 %2$s>%1$s</option>', __(\"Show 15 more\", 'simple-history'), ($args[\"items\"] == 15 ? \" selected \" : \"\") );\n\t\t\t$show_more .= sprintf('<option value=50 %2$s>%1$s</option>', __(\"Show 50 more\", 'simple-history'), ($args[\"items\"] == 50 ? \" selected \" : \"\") );\n\t\t\t$show_more .= sprintf('<option value=100 %2$s>%1$s</option>', __(\"Show 100 more\", 'simple-history'), ($args[\"items\"] == 100 ? \" selected \" : \"\") );\n\t\t\t$show_more .= \"</select>\";\n\n\t\t\t$no_found = __(\"No matching items found.\", 'simple-history');\n\t\t\t$view_rss = __(\"RSS feed\", 'simple-history');\n\t\t\t$view_rss_link = simple_history_get_rss_address();\n\t\t\t$str_show = __(\"Show\", 'simple-history');\n\t\t\t$output .= \"</ol>\";\n\n\t\t\t$output .= sprintf( '\n\t\t\t\t\t<div class=\"simple-history-loading\">%2$s %1$s</div>\n\t\t\t\t\t', \n\t\t\t\t\t__(\"Loading...\", 'simple-history'), // 1\n\t\t\t\t\t\"<img src='\".site_url(\"wp-admin/images/loading.gif\").\"' width=16 height=16>\"\n\t\t\t\t);\n\n\t\t\t$output .= \"</div>\";\n\n\t\t\t$output .= \"\n\t\t\t\t<p class='simple-history-no-more-items'>$no_found</p>\t\t\t\n\t\t\t\t<p class='simple-history-rss-feed-dashboard'><a title='$view_rss' href='$view_rss_link'>$view_rss</a></p>\n\t\t\t\t<p class='simple-history-rss-feed-page'><a title='$view_rss' href='$view_rss_link'><span></span>$view_rss</a></p>\n\t\t\t\";\n\n\t\t}\n\n\t} else {\n\n\t\tif ($args[\"is_ajax\"]) {\n\t\t\t$output .= \"noMoreItems\";\n\t\t} else {\n\t\t\t$no_found = __(\"No history items found.\", 'simple-history');\n\t\t\t$please_note = __(\"Please note that Simple History only records things that happen after this plugin have been installed.\", 'simple-history');\n\t\t\t$output .= \"<p>$no_found</p>\";\n\t\t\t$output .= \"<p>$please_note</p>\";\n\t\t}\n\n\t}\n\treturn $output;\n}", "public function show($historyUser)\n {\n //\n }", "public function actionHistory()\n {\n $this->pageTitle = 'Your Viewing History';\n\n $data['pageHistory'] = History::model()->all('page');\n $data['pdfHistory'] = History::model()->all('pdf');\n\n $this->render('//content/history', $data);\n }", "public static function showList() {\n $template = file_get_contents(plugin_dir_path(__FILE__) . 'templates/login_history.html');\n\n $results = self::queryLoginHistories('desc', 25);\n $histories = '';\n foreach ($results as $history) {\n $histories .= '<tr><td>' . $history->logged_in_at. '</td><td>' . $history->user_login . '</td><td>' . $history->remote_ip . '</td><td>' . $history->user_agent . '</td></tr>';\n }\n\n $output = str_replace('%%page_title%%', get_admin_page_title(), $template);\n $output = str_replace('%%login_histories%%', $histories, $output);\n $output = str_replace('%%Recent%%', __('Recent', 'simple-login-history'), $output);\n $output = str_replace('%%record%%', __('record', 'simple-login-history'), $output);\n $output = str_replace('%%csv_download_link%%', plugin_dir_url(__FILE__) . 'download.php', $output);\n echo $output;\n }", "function parse_history_zone()\n\t\t{\n\t\t\tif ( (empty($this->display_history)) || (!($this->display_history)))\n\t\t\t{\n\t\t\t\t//hide the history zone\n\t\t\t\t$this->t->set_var(array( 'history' => ''));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$inst_parser =& CreateObject('workflow.bo_uiinstance', $this->t);\n\t\t\t\t$inst_parser->t =& $this->t;\n\t\t\t\t$inst_parser->parse_instance_history($this->instance->workitems);\n\t\t\t\t$this->t->set_var('history', $this->t->parse('output', 'history_tpl'));\n\t\t\t}\n\t\t}", "public function canShowHistory() {}", "protected function showmyhistory() {\n global $USER, $PAGE;\n\n // Create a navigation cache so that we can store the history\n $cache = new navigation_cache('navigationhistory', 60*60);\n\n // If the user isn't logged in or is a guest we don't want to display anything\n if (!isloggedin() || isguestuser()) {\n return false;\n }\n\n // Check the cache to see if we have loaded my courses already\n // there is a very good chance that we have\n if (!$cache->cached('history')) {\n $cache->history = array();\n }\n $history = $cache->history;\n $historycount = count($history);\n\n // Find the initial active node\n $child = false;\n if ($PAGE->navigation->contains_active_node()) {\n $child = $PAGE->navigation->find_active_node();\n } else if ($PAGE->settingsnav->contains_active_node()) {\n $child = $PAGE->settingsnav->find_active_node();\n }\n // Check that we found an active child node\n if ($child!==false) {\n $properties = array();\n // Check whether this child contains another active child node\n // this can happen if we are looking at a module\n if ($child->contains_active_node()) {\n $titlebits = array();\n // Loop while the child contains active nodes and in each iteration\n // find the next node in the correct direction\n while ($child!==null && $child->contains_active_node()) {\n if (!empty($child->shorttext)) {\n $titlebits[] = $child->shorttext;\n } else {\n $titlebits[] = $child->text;\n }\n foreach ($child->children as $child) {\n if ($child->contains_active_node() || $child->isactive) {\n // We have found the active child or one of its parents\n // so break the foreach so we can proceed in the while\n break;\n }\n }\n }\n if (!empty($child->shorttext)) {\n $titlebits[] = $child->shorttext;\n } else {\n $titlebits[] = $child->text;\n }\n $properties['text'] = join(' - ', $titlebits);\n $properties['shorttext'] = join(' - ', $titlebits);\n } else {\n $properties['text'] = $child->text;\n $properties['shorttext'] = $child->shorttext;\n }\n $properties['action'] = $child->action;\n $properties['key'] = $child->key;\n $properties['type'] = $child->type;\n $properties['icon'] = $child->icon;\n\n // Create a new navigation node object free of the main structure\n // so that it is easily storeable and customised\n $child = new navigation_node($properties);\n\n // Check that this page isn't already in the history array. If it is\n // we will remove it so that it gets added at the top and we dont get\n // duplicate entries\n foreach ($history as $key=>$node) {\n if ($node->key == $child->key && $node->type == $child->type) {\n if ($node->action instanceof moodle_url && $child->action instanceof moodle_url && $node->action->compare($child->action)) {\n unset($history[$key]);\n } else if ($child->action instanceof moodle_url && $child->action->out_omit_querystring() == $node->action) {\n unset($history[$key]);\n } else if ($child->action == $node->action) {\n unset($history[$key]);\n }\n }\n }\n // If there is more than 5 elements in the array remove the first one\n // We want a fifo array\n if (count($history) > 5) {\n array_shift($history);\n }\n $child->nodetype = navigation_node::NODETYPE_LEAF;\n $child->children = array();\n // Add the child to the history array\n array_push($history,$child);\n }\n\n // If we have `more than nothing` in the history display it :D\n if ($historycount > 0) {\n // Add a branch to hold the users history\n $mymoodle = $PAGE->navigation->get('mymoodle', navigation_node::TYPE_CUSTOM);\n $myhistorybranch = $mymoodle->add(get_string('showmyhistorytitle', $this->blockname), null, navigation_node::TYPE_CUSTOM, null, 'myhistory');\n $mymoodle->get($myhistorybranch)->children = array_reverse($history);\n }\n\n // Cache the history (or update the cached history as it is)\n $cache->history = $history;\n\n return true;\n }", "public function clienthistoryAction()\n {\n // If no client ID was provided, bail out.\n if (!$this->_hasParam('id')) {\n throw new UnexpectedValueException('No client ID parameter provided');\n }\n\n $clientId = $this->_getParam('id');\n\n // Pass current and past client and household history.\n $service = new App_Service_Member();\n\n $this->view->pageTitle = 'View Household History';\n $this->view->client = $service->getClientById($clientId);\n $this->view->householders = $service->getHouseholdersByClientId($clientId);\n $this->view->history = $service->getClientHouseholdHistory($clientId);\n }", "function action_history()\n{\n\tglobal $pagestore, $page, $full, $HistMax;\n\n\t$history = $pagestore->history($page);\n\n\tgen_headers($history[0][0]);\n\n\n\t$text = '';\n\t$latest_auth = '';\n\t$previous_ver = 0;\n\t$is_latest = 1;\n\n\tfor($i = 0; $i < count($history); $i++)\n\t{\n\t\tif($latest_auth == '')\n\t\t{\n\t\t\t$latest_auth = ($history[$i][3] == '' ? $history[$i][1]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: $history[$i][3]);\n\t\t\t$latest_ver = $history[$i][2];\n\t\t}\n\n\t\tif($previous_ver == 0\n\t\t\t && $latest_auth != ($history[$i][3] == '' ? $history[$i][1]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t : $history[$i][3]))\n\t\t\t{ $previous_ver = $history[$i][2]; }\n\n\t\tif($i < $HistMax || $full)\n\t\t{\n\t\t\t$text = $text . html_history_entry($page, $history[$i][2],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $history[$i][0], $history[$i][1],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $history[$i][3],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $previous_ver == $history[$i][2] || !$full && $i == count($history)-1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $is_latest, $history[$i][4]);\n\t\t}\n\n\t\t$is_latest = 0;\n\t}\n\n\tif($i >= $HistMax && !$full)\n\t\t{ $text = $text . html_fullhistory($page, count($history)); }\n\n\t$p1 = $pagestore->page($page);\n\t$p1->version = $previous_ver;\n\t$p2 = $pagestore->page($page);\n\t$p2->version = $latest_ver;\n\n\t$diff = diff_compute($p1->read(), $p2->read());\n\ttemplate_history(array('page' => $p2->as_array(),\n\t\t\t\t\t\t\t\t\t\t\t\t 'history' => $text,\n\t\t\t\t\t\t\t\t\t\t\t\t 'diff' => diff_parse($diff)));\n}", "public function history()\n\t{\n\t\t$migration = new \\Hubzero\\Content\\Migration();\n\t\t$history = $migration->history();\n\t\t$items = [];\n\t\t$maxFile = 0;\n\t\t$maxUser = 0;\n\t\t$maxScope = 0;\n\n\n\t\tif ($history && count($history) > 0)\n\t\t{\n\t\t\t$items[] = [\n\t\t\t\t'File',\n\t\t\t\t'By',\n\t\t\t\t'Direction',\n\t\t\t\t'Date'\n\t\t\t];\n\n\t\t\tforeach ($history as $entry)\n\t\t\t{\n\t\t\t\t$items[] = [\n\t\t\t\t\t$entry->scope . DS . $entry->file,\n\t\t\t\t\t$entry->action_by,\n\t\t\t\t\t$entry->direction,\n\t\t\t\t\t$entry->date\n\t\t\t\t];\n\t\t\t}\n\n\t\t\t$this->output->addTable($items, true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->addLine('No history to display.');\n\t\t}\n\t}", "public function history()\n {\n $data['title'] = 'Cuci Sepatu | Kang Cuci';\n $data['user'] = $this->workerModel->datauser();\n\n $this->load->view('worker/worker_header', $data);\n $this->load->view('worker/panel/sepatu', $data);\n $this->load->view('worker/worker_footer');\n }", "public function viewHistory() {\n $historyRows = $this->db->query(\"SELECT * FROM history\");\n if (!$historyRows) die(\"Fatal Error.\");\n\n // Looping through all rows in the histoy table.\n $history = [];\n foreach($historyRows as $historyRow) {\n $regNr = htmlspecialchars($historyRow[\"regNr\"]);\n $ssNr = htmlspecialchars($historyRow[\"ssNr\"]);\n $checkOut = htmlspecialchars($historyRow[\"checkOutTime\"]);\n $checkIn = htmlspecialchars($historyRow[\"checkInTime\"]);\n $days = htmlspecialchars($historyRow[\"days\"]);\n $cost = htmlspecialchars($historyRow[\"cost\"]);\n\n // Setting 0 as default value on days and cost if car not checked in yet.\n if (!$checkIn) {\n $checkIn = \"Checked Out\";\n $days = 0;\n $cost = 0;\n }\n \n $histor = [\"regNr\" => $regNr,\n \"ssNr\" => $ssNr, \n \"checkOut\" => $checkOut,\n \"checkIn\" => $checkIn, \n \"days\" => $days,\n \"cost\" => $cost,\n \"days\" => $days];\n \n $history[] = $histor;\n }\n return $history;\n }", "public function action_chat_history() {\n\t\t$this->_template->set('page_title', 'All Messages');\n\t\t$this->_template->set('page_info', 'view and manage chat messages');\n\t\t$messages = ORM::factory('Message')->get_grouped_messages($this->_current_user->id);\n\t\t$this->_template->set('messages', $messages);\n\t\t$this->_set_content('messages');\n\t}", "public function action_index()\n{\n $history = Jelly::select( 'user_history' )\n ->where(':primary_key', '=', $this->user->id)\n ->limit( 25 )\n ->execute();\n\n $this->template->content = View::factory('history/index')\n ->set('history', $history);\n\n}", "public function getHistory(){\n \t$History = HPP::where([['hpp_kind','=','history'],['hpp_city_id','=',1]])->get();\n \treturn view('Admin.HistoryPlanPurpose.History' , compact('History'));\n }", "public function actionCron_jobs_history()\n {\n $request = Yii::app()->request;\n $model = new ConsoleCommandListHistory('search');\n $model->unsetAttributes();\n\n $model->attributes = (array)$request->getQuery($model->modelName, array());\n \n $this->setData(array(\n 'pageMetaTitle' => $this->data->pageMetaTitle . ' | '. Yii::t('cronjobs', 'View cron jobs history'),\n 'pageHeading' => Yii::t('cronjobs', 'View cron jobs history'),\n 'pageBreadcrumbs' => array(\n Yii::t('cronjobs', 'Cron jobs history'),\n )\n ));\n\n $this->render('cron-jobs-history', compact('model'));\n }", "private function showPage($records)\n {\n $this->data['histories'] = '';\n $this->data['histories'] = $records;\n\n $this->data['pagebody'] = 'History';\n $this->render();\n }", "function simple_history_management_page() {\n\n\tglobal $simple_history;\n\n\tsimple_history_purge_db();\n\n\t?>\n\n\t<div class=\"wrap simple-history-wrap\">\n\t\t<h2><?php echo __(\"History\", 'simple-history') ?></h2>\n\t\t<?php\t\n\t\tsimple_history_print_nav(array(\"from_page=1\"));\n\t\techo simple_history_print_history(array(\"items\" => $simple_history->get_pager_size(), \"from_page\" => \"1\"));\n\t\techo simple_history_get_pagination();\n\t\t?>\n\t</div>\n\n\t<?php\n\n}", "public function getHistory() {\n $rentalModel = new RentalModel($this->db);\n\n try {\n $rentals = $rentalModel->getAll();\n } catch (\\Exception $e) {\n $properties = ['errorMessage' => 'Error getting rental history.'];\n return $this->render('error.twig', $properties);\n }\n\n $properties = [\"rentals\" => $rentals];\n return $this->render('history.twig', $properties);\n }", "public function history()\n {\n $data['courses'] = $this->exchange_rates_model->get_courses();\n $data['title'] = 'History course';\n\n $this->load->view('templates/header', $data);\n $this->load->view('exchange_rates/history', $data);\n $this->load->view('templates/footer');\n }", "public function history()\n {\n $tittle['tittle'] = 'History Penjualan';\n\n $data = array(\n 'data_penjualan' => $this->penjualan->ambil_data_penjualan()->result_array(),\n 'data_detail_penjualan' => $this->penjualan->ambil_detail_penjualan(),\n 'user' => $this->db->get_where('user', ['username' =>\n $this->session->userdata('username')])->row_array()\n );\n\n //View dari Controller akuntansi/index\n $this->load->view('template/header', $tittle);\n $this->load->view('template/topbar', $data);\n $this->load->view('template/sidebar', $data);\n $this->load->view('transaksi/history', $data);\n $this->load->view('template/footer');\n }", "public function show(Histories $histories)\n {\n //\n }", "function history()\n {\n $data['tbl_history'] = $this->Tbl_history_model->get_tbl_history();\n \n if(isset($data['tbl_history']['id_history']))\n {\n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n 'history_desc_id' => $this->input->post('history_desc_id'),\n 'history_desc_en' => $this->input->post('history_desc_en'),\n );\n\n $this->Tbl_history_model->update_tbl_history($params); \n redirect('admin/history');\n }\n else\n {\n $data = array(\n \"site\" => $_SERVER['SERVER_NAME'],\n \"page\" => \"History\",\n \"tbl_history\" => $this->Tbl_history_model->get_tbl_history()\n );\n $this->load->view('layout/admin/header', $data);\n $this->load->view('edit_history',$data);\n $this->load->view('layout/admin/footer');\n }\n }\n else\n show_error('The tbl_home you are trying to edit does not exist.');\n }", "public function userHistory() {\n\t\t[ $response, $error ] = $this->api('user/history');\n\n\t\tif($error) return $this->response($response, $error);\n\n\t\treturn $this->response($response['links']);\n\t}", "public function history()\n\t{\n $orders = $this->history->get_history();\n foreach($orders as $order)\n {\n if($order->added_by=='customer')\n {\n $agency_id = $this->Common->get_details('agency_orders',array('order_id'=>$order->order_id))->row()->agency_id;\n $agency_check = $this->Common->get_details('agencies',array('agency_id'=>$agency_id));\n if($agency_check->num_rows()>0)\n {\n $order->agency = $agency_check->row()->agency_name;\n }\n else\n {\n $order->agency = '';\n }\n }\n }\n $data['orders'] = $orders;\n\t\t$this->load->view('admin/bill/history',$data);\n\t}", "public function attendance_list($history = false, $messages = array())\n {\n $data = array();\n\n // render to the view\n $this->view->set_data($data);\n $this->view->set_layout('layout');\n $this->view->set_template('attendance_list');\n $this->view->render();\n }", "public function getHistory()\n {\n return view('PagePersonal.history');\n }", "static function showHistory($ID_port) {\n global $DB,$LANG,$INFOFORM_PAGES,$CFG_GLPI;\n\n include (GLPI_ROOT . \"/plugins/fusioninventory/inc_constants/snmp.mapping.constant.php\");\n\n $CommonItem = new CommonItem;\n $np = new Netport;\n\n $query = \"\n SELECT * FROM(\n SELECT * FROM (\n SELECT ID, date as date, process_number as process_number,\n FK_port_source, FK_port_destination,\n creation as Field, NULL as old_value, NULL as new_value\n\n FROM glpi_plugin_fusioninventory_snmphistoryconnections\n WHERE `FK_port_source`='\".$ID_port.\"'\n OR `FK_port_destination`='\".$ID_port.\"'\n ORDER BY date DESC\n LIMIT 0,30\n )\n AS DerivedTable1\n UNION ALL\n SELECT * FROM (\n SELECT ID, date_mod as date, FK_process as process_number,\n FK_ports AS FK_port_source, NULL as FK_port_destination,\n Field, old_value, new_value\n\n FROM glpi_plugin_fusioninventory_snmphistories\n WHERE `FK_ports`='\".$ID_port.\"'\n ORDER BY date DESC\n LIMIT 0,30\n )\n AS DerivedTable2)\n AS MainTable\n ORDER BY date DESC, ID DESC\n LIMIT 0,30\";\n //echo $query.\"<br/>\";\n $text = \"<table class='tab_cadre' cellpadding='5' width='950'>\";\n\n $text .= \"<tr class='tab_bg_1'>\";\n $text .= \"<th colspan='8'>\";\n $text .= \"Historique\";\n $text .= \"</th>\";\n $text .= \"</tr>\";\n\n $text .= \"<tr class='tab_bg_1'>\";\n $text .= \"<th>\".$LANG['plugin_fusioninventory'][\"snmp\"][50].\"</th>\";\n $text .= \"<th>\".$LANG[\"common\"][1].\"</th>\";\n $text .= \"<th>\".$LANG[\"event\"][18].\"</th>\";\n $text .= \"<th></th>\";\n $text .= \"<th></th>\";\n $text .= \"<th></th>\";\n $text .= \"<th>\".$LANG[\"common\"][27].\"</th>\";\n $text .= \"</tr>\";\n\n if ($result=$DB->query($query)) {\n while ($data=$DB->fetch_array($result)) {\n $text .= \"<tr class='tab_bg_1'>\";\n if (!empty($data[\"FK_port_destination\"])) {\n // Connections and disconnections\n if ($data['Field'] == '1') {\n $text .= \"<td align='center'><img src='\".GLPI_ROOT.\"/plugins/fusioninventory/pics/connection_ok.png'/></td>\";\n } else {\n $text .= \"<td align='center'><img src='\".GLPI_ROOT.\"/plugins/fusioninventory/pics/connection_notok.png'/></td>\";\n }\n if ($ID_port == $data[\"FK_port_source\"]) {\n $np->getFromDB($data[\"FK_port_destination\"]);\n if (isset($np->fields[\"on_device\"])) {\n $CommonItem->getFromDB($np->fields[\"device_type\"],\n $np->fields[\"on_device\"]);\n $link1 = $CommonItem->getLink(1);\n $link = \"<a href=\\\"\" . $CFG_GLPI[\"root_doc\"] . \"/front/networking.port.php?ID=\" . $np->fields[\"ID\"] . \"\\\">\";\n if (rtrim($np->fields[\"name\"]) != \"\")\n $link .= $np->fields[\"name\"];\n else\n $link .= $LANG['common'][0];\n $link .= \"</a>\";\n $text .= \"<td align='center'>\".$link.\" \".$LANG['networking'][25].\" \".$link1.\"</td>\";\n } else {\n $text .= \"<td align='center'><font color='#ff0000'>\".$LANG['common'][28].\"</font></td>\";\n }\n\n } else if ($ID_port == $data[\"FK_port_destination\"]) {\n $np->getFromDB($data[\"FK_port_source\"]);\n if (isset($np->fields[\"on_device\"])) {\n $CommonItem->getFromDB($np->fields[\"device_type\"],\n $np->fields[\"on_device\"]);\n $link1 = $CommonItem->getLink(1);\n $link = \"<a href=\\\"\" . $CFG_GLPI[\"root_doc\"] . \"/front/networking.port.php?ID=\" . $np->fields[\"ID\"] . \"\\\">\";\n if (rtrim($np->fields[\"name\"]) != \"\")\n $link .= $np->fields[\"name\"];\n else\n $link .= $LANG['common'][0];\n $link .= \"</a>\";\n $text .= \"<td align='center'>\".$link.\" \".$LANG['networking'][25].\" \".$link1.\"</td>\";\n } else {\n $text .= \"<td align='center'><font color='#ff0000'>\".$LANG['common'][28].\"</font></td>\";\n }\n }\n $text .= \"<td align='center' colspan='4'></td>\";\n $text .= \"<td align='center'>\".convDateTime($data[\"date\"]).\"</td>\";\n\n } else {\n // Changes values\n $text .= \"<td align='center' colspan='2'></td>\";\n $text .= \"<td align='center'>\".$FUSIONINVENTORY_MAPPING[NETWORKING_TYPE][$data[\"Field\"]]['name'].\"</td>\";\n $text .= \"<td align='center'>\".$data[\"old_value\"].\"</td>\";\n $text .= \"<td align='center'>-></td>\";\n $text .= \"<td align='center'>\".$data[\"new_value\"].\"</td>\";\n $text .= \"<td align='center'>\".convDateTime($data[\"date\"]).\"</td>\";\n }\n $text .= \"</tr>\";\n }\n }\n\n /*\n $pthc = new PluginFusioninventorySnmphistoryconnection;\n\n $data_connections = $pthc->find('`FK_port_source`=\"'.$ID_port.'\"\n OR `FK_port_destination `=\"'.$ID_port.'\"',\n '`date` DESC',\n '0,30');\n $query = \"SELECT *\n FROM `glpi_plugin_fusioninventory_snmphistories`\n WHERE `FK_ports`='\".$ID_port.\"'\n ORDER BY `date_mod` DESC\n LIMIT 0,30;\";\n\n\n $text = \"<table class='tab_cadre' cellpadding='5' width='950'>\";\n\n $text .= \"<tr class='tab_bg_1'>\";\n $text .= \"<th colspan='8'>\";\n $text .= \"Historique\";\n $text .= \"</th>\";\n $text .= \"</tr>\";\n\n $text .= \"<tr class='tab_bg_1'>\";\n $text .= \"<th>\".$LANG['plugin_fusioninventory'][\"snmp\"][50].\"</th>\";\n $text .= \"<th>\".$LANG[\"common\"][1].\"</th>\";\n $text .= \"<th>\".$LANG[\"networking\"][15].\"</th>\";\n $text .= \"<th>\".$LANG[\"event\"][18].\"</th>\";\n $text .= \"<th></th>\";\n $text .= \"<th></th>\";\n $text .= \"<th></th>\";\n $text .= \"<th>\".$LANG[\"common\"][27].\"</th>\";\n $text .= \"</tr>\";\n\n if ($result=$DB->query($query)) {\n while ($data=$DB->fetch_array($result)) {\n $text .= \"<tr class='tab_bg_1'>\";\n\n if (($data[\"old_device_ID\"] != \"0\") OR ($data[\"new_device_ID\"] != \"0\")) {\n // Connections and disconnections\n if ($data[\"old_device_ID\"] != \"0\") {\n $text .= \"<td align='center'>\".$LANG['plugin_fusioninventory'][\"history\"][2].\"</td>\";\n $CommonItem->getFromDB($data[\"old_device_type\"],$data[\"old_device_ID\"]);\n $text .= \"<td align='center'>\".$CommonItem->getLink(1).\"</td>\";\n $text .= \"<td align='center'>\".$data[\"old_value\"].\"</td>\";\n } else if ($data[\"new_device_ID\"] != \"0\") {\n $text .= \"<td align='center'>\".$LANG['plugin_fusioninventory'][\"history\"][3].\"</td>\";\n $CommonItem->getFromDB($data[\"new_device_type\"],$data[\"new_device_ID\"]);\n $text .= \"<td align='center'>\".$CommonItem->getLink(1).\"</td>\";\n $text .= \"<td align='center'>\".$data[\"new_value\"].\"</td>\";\n }\n $text .= \"<td align='center' colspan='4'></td>\";\n $text .= \"<td align='center'>\".convDateTime($data[\"date_mod\"]).\"</td>\";\n\n } else if (($data[\"old_device_ID\"] == \"0\") AND ($data[\"new_device_ID\"] == \"0\") AND ($data[\"Field\"] == \"0\")) {\n // Unknown Mac address\n if (!empty($data[\"old_value\"])) {\n $text .= \"<td align='center' background='#cf9b9b' class='tab_bg_1_2'>\".$LANG['plugin_fusioninventory'][\"history\"][2].\"</td>\";\n $CommonItem->getFromDB($data[\"old_device_type\"],$data[\"old_device_ID\"]);\n $text .= \"<td align='center' background='#cf9b9b' class='tab_bg_1_2'>\".$CommonItem->getLink(1).\"</td>\";\n $text .= \"<td align='center' background='#cf9b9b' class='tab_bg_1_2'>\".$data[\"old_value\"].\"</td>\";\n } else if (!empty($data[\"new_value\"])) {\n $text .= \"<td align='center' background='#cf9b9b' class='tab_bg_1_2'>\".$LANG['plugin_fusioninventory'][\"history\"][3].\"</td>\";\n $CommonItem->getFromDB($data[\"new_device_type\"],$data[\"new_device_ID\"]);\n $text .= \"<td align='center' background='#cf9b9b' class='tab_bg_1_2'>\".$CommonItem->getLink(1).\"</td>\";\n $text .= \"<td align='center' background='#cf9b9b' class='tab_bg_1_2'>\".$data[\"new_value\"].\"</td>\";\n }\n $text .= \"<td align='center' colspan='4' background='#cf9b9b' class='tab_bg_1_2'></td>\";\n $text .= \"<td align='center' background='#cf9b9b' class='tab_bg_1_2'>\".convDateTime($data[\"date_mod\"]).\"</td>\";\n } else {\n // Changes values\n $text .= \"<td align='center' colspan='3'></td>\";\n $text .= \"<td align='center'>\".$data[\"Field\"].\"</td>\";\n $text .= \"<td align='center'>\".$data[\"old_value\"].\"</td>\";\n $text .= \"<td align='center'>-></td>\";\n $text .= \"<td align='center'>\".$data[\"new_value\"].\"</td>\";\n $text .= \"<td align='center'>\".convDateTime($data[\"date_mod\"]).\"</td>\";\n }\n $text .= \"</tr>\";\n }\n }\n */\n $text .= \"<tr class='tab_bg_1'>\";\n $text .= \"<th colspan='8'>\";\n $text .= \"<a href='\".GLPI_ROOT.\"/plugins/fusioninventory/report/switch_ports.history.php?FK_networking_ports=\".$ID_port.\"'>Voir l'historique complet</a>\";\n $text .= \"</th>\";\n $text .= \"</tr>\";\n $text .= \"</table>\";\n return $text;\n }" ]
[ "0.66208935", "0.6466929", "0.6424235", "0.6414146", "0.6334227", "0.632705", "0.63133687", "0.6247761", "0.61642486", "0.6122847", "0.61162496", "0.6106598", "0.6073928", "0.6055157", "0.5997709", "0.59951407", "0.59410864", "0.5932784", "0.5884896", "0.5867076", "0.5835536", "0.581567", "0.5804803", "0.5768218", "0.5751375", "0.5735674", "0.57278365", "0.5704824", "0.56678116", "0.56655663" ]
0.7041204
0
InviteHistoryHandler::populateHiddenFormFields() To set the hidden form field values
public function populateHiddenFormFields($form_fields = array()) { $hiddenFormFields = array(); if (is_array($form_fields) and $form_fields) { $inc = 0; while($field = array_shift($form_fields)) { if (isset($this->fields_arr[$field])) { $hiddenFormFields[$inc]['field_name'] = $field; $hiddenFormFields[$inc]['field_value'] = $this->fields_arr[$field]; $inc++; } } return $hiddenFormFields; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function transactionFormGetHiddenFields ();", "function form_init_elements()\r\n {\r\n $this->add_hidden_element(\"swimmeetid\") ;\r\n\r\n // This is used to remember the action\r\n // which originated from the GUIDataList.\r\n \r\n $this->add_hidden_element(\"_action\") ;\r\n }", "public function populateForm() {}", "function prepare() {\n $this->addChild(new fapitng_FormHidden('form_build_id', array(\n 'value' => $this->build_id,\n )));\n $this->addChild(new fapitng_FormHidden('form_id', array(\n 'value' => $this->id,\n )));\n if ($this->token) {\n $this->addChild(new fapitng_FormHidden('form_token', array(\n 'value' => $this->token,\n )));\n }\n }", "function wyz_ajax_custom_business_fields_save_form() {\n\n\t$form_data = json_decode( stripslashes_deep( $_REQUEST['form_data'] ),true );\n\tif ( ! empty( $form_data ) && is_array( $form_data ) ) {\n\t\tforeach ( $form_data as $key => $value ) {\n\t\t\t$form_data[ $key ]['hidden'] = true;\n\t\t}\n\t}\n\n\tupdate_option( 'wyz_business_custom_form_data', $form_data );\n\trequire_once( WYZI_PLUGIN_DIR . 'templates-and-shortcodes/business-filters/init-business-filters.php' );\n\twp_die();\n}", "public function setDispFields()\n {\n $backendUser = $this->getBackendUser();\n // Getting from session:\n $dispFields = $backendUser->getModuleData('list/displayFields');\n // If fields has been inputted, then set those as the value and push it to session variable:\n if (is_array($this->displayFields)) {\n reset($this->displayFields);\n $tKey = key($this->displayFields);\n $dispFields[$tKey] = $this->displayFields[$tKey];\n $backendUser->pushModuleData('list/displayFields', $dispFields);\n }\n // Setting result:\n $this->setFields = $dispFields;\n }", "function set_hidden_fields_arrays($posted_data = false) {\r\r\n\r\r\n if (!$posted_data) {\r\r\n $posted_data = WPCF7_Submission::get_instance()->get_posted_data();\r\r\n }\r\r\n\r\r\n $hidden_fields = json_decode(stripslashes($posted_data['_wpcf7cf_hidden_group_fields']));\r\r\n if (is_array($hidden_fields) && count($hidden_fields) > 0) {\r\r\n foreach ($hidden_fields as $field) {\r\r\n $this->hidden_fields[] = $field;\r\r\n if (wpcf7cf_endswith($field, '[]')) {\r\r\n $this->hidden_fields[] = substr($field,0,strlen($field)-2);\r\r\n }\r\r\n }\r\r\n }\r\r\n $this->hidden_groups = json_decode(stripslashes($posted_data['_wpcf7cf_hidden_groups']));\r\r\n $this->visible_groups = json_decode(stripslashes($posted_data['_wpcf7cf_visible_groups']));\r\r\n }", "function wyz_ajax_business_tabs_save_form() {\n\n\t$form_data = json_decode( stripslashes_deep( $_REQUEST['form_data'] ),true );\n\tif ( ! empty( $form_data ) && is_array( $form_data ) ) {\n\t\tforeach ( $form_data as $key => $value ) {\n\t\t\t$form_data[ $key ]['hidden'] = true;\n\t\t}\n\t}\n\tupdate_option( 'wyz_business_tabs_order_data', $form_data );\n\twp_die();\n}", "protected function addSecuredHiddenFieldsRenderedToViewHelperVariableContainer() {}", "function wyz_ajax_business_form_builder_save_form() {\n\n\t$form_data = json_decode( stripslashes_deep( $_REQUEST['form_data'] ),true );\n\tif ( ! empty( $form_data ) && is_array( $form_data ) ) {\n\t\tforeach ( $form_data as $key => $value ) {\n\t\t\t$form_data[ $key ]['hidden'] = true;\n\t\t}\n\t}\n\tupdate_option( 'wyz_business_form_builder_data', $form_data );\n\twp_die();\n}", "function dumpFormItems()\r\n {\r\n if($this->_onclick != null)\r\n {\r\n $hiddenwrapperfield = $this->readJSWrapperHiddenFieldName();\r\n echo \"<input type=\\\"hidden\\\" id=\\\"$hiddenwrapperfield\\\" name=\\\"$hiddenwrapperfield\\\" value=\\\"\\\" />\";\r\n }\r\n }", "function dumpFormItems()\r\n {\r\n if($this->_onclick != null)\r\n {\r\n $hiddenwrapperfield = $this->readJSWrapperHiddenFieldName();\r\n echo \"<input type=\\\"hidden\\\" id=\\\"$hiddenwrapperfield\\\" name=\\\"$hiddenwrapperfield\\\" value=\\\"\\\" />\";\r\n }\r\n }", "function wyz_ajax_registration_form_builder_save_form() {\n\n\t$form_data = json_decode( stripslashes_deep( $_REQUEST['form_data'] ),true );\n\tif ( ! empty( $form_data ) && is_array( $form_data ) ) {\n\t\tforeach ( $form_data as $key => $value ) {\n\t\t\t$form_data[ $key ]['hidden'] = true;\n\t\t}\n\t}\n\tupdate_option( 'wyz_registration_form_data', $form_data );\n\twp_die();\n}", "private function getHiddenInputFields()\r\n {\r\n $inputArray = array();\r\n $inputNodes = $this->scraper->xPathQuery(\"//form[@id='mainform']/div/input\");\r\n foreach ($inputNodes as $node) {\r\n $name = $node->getAttribute('name');\r\n $inputArray[$name] = $node->getAttribute('value');\r\n }\r\n\r\n return $inputArray;\r\n }", "public function GetFormPostedValues() {\n\t\t$req_fields=array(\"description\",\"date_open\",\"date_closed\");\n\n\t\tfor ($i=0;$i<count($req_fields);$i++) {\n\n\t\t\t//echo $_POST['application_id'];\n\t\t\tif (ISSET($_POST[$req_fields[$i]]) && !EMPTY($_POST[$req_fields[$i]])) {\n\t\t\t\t$this->SetVariable($req_fields[$i],EscapeData($_POST[$req_fields[$i]]));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//echo \"<br>\".$this->req_fields[$i].\"<br>\";\n\t\t\t\t$this->$req_fields[$i]=\"\";\n\t\t\t}\n\t\t}\n\t}", "protected function renderHiddenReferrerFields() {}", "abstract public function get_gateway_form_fields();", "function cf7mls_validation_callback() {\r\r\n $this->set_hidden_fields_arrays($_POST);\r\r\n }", "public function afterFetch()\n {\n foreach ($this->formfields as $field) {\n $this->fields[$field->fieldKey] = $field->fieldName;\n }\n }", "protected function _readFormFields() {}", "public function testFormAllRequiredDataFieldsHidden() {\n $form = new RedirectForm();\n $form_state = [];\n $payment = $this->mockPayment([\n 'firstname' => 'First',\n 'lastname' => 'Last',\n 'address1' => 'Address1',\n 'city' => 'City',\n 'postcode' => 'TEST',\n 'country' => 'GB',\n ]);\n $element = $form->form([], $form_state, $payment);\n foreach (element_children($element['personal_data']) as $key) {\n $e = $element['personal_data'][$key];\n $this->assertFalse($e['#access'], \"Field $key should be hidden (#access = FALSE).\");\n }\n }", "function hidden_field($object, $field, $options = array()) {\n $form = new FormHelper($object, $field);\n return $form->to_input_field_tag(\"hidden\", $options);\n}", "function form_init_elements()\r\n {\r\n $this->add_hidden_element(\"swimmeetid\") ;\r\n\r\n // This is used to remember the action\r\n // which originated from the GUIDataList.\r\n \r\n $this->add_hidden_element(\"_action\") ;\r\n\r\n\t\t// Org Code field\r\n\r\n $orgcode = new FEListBox(\"Organization\", true, \"150px\");\r\n $orgcode->set_list_data(SDIFCodeTableMappings::GetOrgCodes()) ;\r\n $this->add_element($orgcode) ;\r\n\r\n\t\t// Meet Name field\r\n\r\n $meetname = new FEText(\"Meet Name\", true, \"300px\");\r\n $this->add_element($meetname) ;\r\n\r\n\t\t// Meet Address 1 field\r\n\r\n $meetaddress1 = new FEText(\"Meet Address 1\", false, \"300px\");\r\n $this->add_element($meetaddress1) ;\r\n\r\n\t\t// Meet Address 2 field\r\n\r\n $meetaddress2 = new FEText(\"Meet Address 2\", false, \"300px\");\r\n $this->add_element($meetaddress2) ;\r\n\r\n // Meet State\r\n\r\n $meetstate = new FEUnitedStates(\"Meet State\", FT_US_ONLY, \"150px\");\r\n $this->add_element($meetstate) ;\r\n\r\n\t\t// Meet Postal Code field\r\n\r\n $meetpostalcode = new FEText(\"Meet Postal Code\", false, \"200px\");\r\n $this->add_element($meetpostalcode) ;\r\n\r\n // Meet Country\r\n\r\n $meetcountry = new FEListBox(\"Meet Country\", true, \"250px\");\r\n $meetcountry->set_list_data(SDIFCodeTableMappings::GetCountryCodes()) ;\r\n $meetcountry->set_readonly(FT_US_ONLY) ;\r\n $this->add_element($meetcountry) ;\r\n\r\n\t\t// Meet Code field\r\n\r\n $meetcode = new FEListBox(\"Meet Code\", true, \"150px\");\r\n $meetcode->set_list_data(SDIFCodeTableMappings::GetMeetCodes()) ;\r\n $this->add_element($meetcode) ;\r\n\r\n // Meet Start Field\r\n\r\n $meetstart = new FEDate(\"Meet Start\", true, null, null,\r\n \"Fdy\", date(\"Y\") - 3, date(\"Y\") + 7) ;\r\n $this->add_element($meetstart) ;\r\n\r\n // Meet End Field\r\n\r\n $meetend = new FEDate(\"Meet End\", true, null, null,\r\n \"Fdy\", date(\"Y\") - 3, date(\"Y\") + 7) ;\r\n $this->add_element($meetend) ;\r\n\r\n\t\t// Pool Altitude field\r\n\r\n $poolaltitude = new FENumber(\"Pool Altitude\", true, \"150px\") ;\r\n $this->add_element($poolaltitude) ;\r\n\r\n\t\t// Course Code field\r\n\r\n $coursecode = new FEListBox(\"Course Code\", true, \"150px\");\r\n $coursecode->set_list_data(SDIFCodeTableMappings::GetCourseCodes()) ;\r\n $this->add_element($coursecode) ;\r\n }", "public static function convert_hidden_field() {\n\n\t\t// Create a new Hidden field.\n\t\tself::$field = new GF_Field_Hidden();\n\n\t\t// Add standard properties.\n\t\tself::add_standard_properties();\n\n\t}", "function give_checkout_hidden_fields( $form_id ) {\n\n\t/**\n\t * Fires while rendering hidden checkout fields, before the fields.\n\t *\n\t * @param int $form_id The form ID.\n\t *\n\t * @since 1.0\n\t *\n\t */\n\tdo_action( 'give_hidden_fields_before', $form_id );\n\n\tif ( is_user_logged_in() ) {\n\t\t?>\n\t\t<input type=\"hidden\" name=\"give-user-id\" value=\"<?php echo get_current_user_id(); ?>\"/>\n\t<?php } ?>\n\t<input type=\"hidden\" name=\"give_action\" value=\"purchase\"/>\n\t<input type=\"hidden\" name=\"give-gateway\" value=\"<?php echo give_get_chosen_gateway( $form_id ); ?>\"/>\n\t<?php\n\t/**\n\t * Fires while rendering hidden checkout fields, after the fields.\n\t *\n\t * @param int $form_id The form ID.\n\t *\n\t * @since 1.0\n\t *\n\t */\n\tdo_action( 'give_hidden_fields_after', $form_id );\n\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 }", "function wyz_ajax_claim_save_form() {\n\n\t$form_data = json_decode( stripslashes_deep( $_REQUEST['form_data'] ),true );\n\tif ( ! empty( $form_data ) && is_array( $form_data ) ) {\n\t\tforeach ( $form_data as $key => $value ) {\n\t\t\t$form_data[ $key ]['hidden'] = true;\n\t\t}\n\t}\n\n\tupdate_option( 'wyz_claim_registration_form_data', $form_data );\n\twp_die();\n}", "protected function _prepareForm()\r\n {\r\n $form = new Varien_Data_Form(array(\r\n 'id' => 'edit_form',\r\n 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),\r\n 'method' => 'post',\r\n 'enctype' => 'multipart/form-data',\r\n )\r\n );\r\n\r\n $fieldSet = $form->addFieldset('magento_form', array('legend' => $this->helper->__('Webhook information')));\r\n\r\n $fieldSet->addField('code', 'select', array(\r\n 'label' => $this->helper->__('Code'),\r\n 'class' => 'required-entry',\r\n 'name' => 'code',\r\n 'values' => ApiExtension_Magento_Block_Adminhtml_Webhooks_Grid::getAvailableHooks()\r\n ));\r\n\r\n $fieldSet->addField('url', 'text', array(\r\n 'label' => $this->helper->__('Callback URL'),\r\n 'class' => 'required-entry',\r\n 'name' => 'url',\r\n ));\r\n\r\n $fieldSet->addField('description', 'textarea', array(\r\n 'label' => $this->helper->__('Description'),\r\n 'name' => 'description',\r\n ));\r\n\r\n $fieldSet->addField('data', 'textarea', array(\r\n 'label' => $this->helper->__('Data'),\r\n 'name' => 'data',\r\n ));\r\n\r\n $fieldSet->addField('token', 'text', array(\r\n 'label' => $this->helper->__('Token'),\r\n 'name' => 'token',\r\n ));\r\n\r\n $fieldSet->addField('active', 'select', array(\r\n 'label' => $this->helper->__('Active'),\r\n 'values' => ApiExtension_Magento_Block_Adminhtml_Webhooks_Grid::getOptionsForActive(),\r\n 'name' => 'active',\r\n ));\r\n\r\n if ($this->session->getWebhooksData()) {\r\n $form->setValues($this->session->getWebhooksData());\r\n $this->session->setWebhooksData(null);\r\n } elseif (Mage::registry('webhooks_data')) {\r\n $form->setValues(Mage::registry('webhooks_data')->getData());\r\n }\r\n\r\n $form->setUseContainer(true);\r\n $this->setForm($form);\r\n return parent::_prepareForm();\r\n }", "protected function removeSecuredHiddenFieldsRenderedFromViewHelperVariableContainer() {}", "function block_editor_meta_box_hidden_fields()\n {\n }" ]
[ "0.65675426", "0.64753735", "0.590473", "0.5890775", "0.5793635", "0.5781936", "0.5767698", "0.57477486", "0.57398087", "0.5706359", "0.5687367", "0.5687367", "0.5663916", "0.5587671", "0.5568866", "0.5547855", "0.55431795", "0.553885", "0.5533969", "0.5517477", "0.5503451", "0.54924977", "0.5467197", "0.5462902", "0.5454293", "0.5445104", "0.5440013", "0.54252005", "0.54174864", "0.5401116" ]
0.6567564
0
InviteHistoryHandler::removeInvitation() Remove the selected id values from the users invitation table
public function removeInvitation($id = 0) { $sql = 'DELETE FROM '.$this->CFG['db']['tbl']['users_invitation']. ' WHERE invitation_id='.$this->dbObj->Param($id); $stmt = $this->dbObj->Prepare($sql); $rs = $this->dbObj->Execute($stmt, array($id)); if (!$rs) trigger_db_error($this->dbObj); return ($this->dbObj->Affected_Rows()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete_invitation($invitation_id){\n if ($stmt = $this->connection->prepare('DELETE FROM device_invitations WHERE id = ?')) {\n $stmt->bind_param('i', $invitation_id);\n $status = $stmt->execute();\n $stmt->close();\n if($status === false){\n echo \"error\";\n $GLOBALS['error_message'] = \"SQL DELETE FAILED: [Device_Invitations] Delete Invitation\";\n return false;\n } \n return true;\n }\n else{\n $GLOBALS['error_message'] = \"Bad SQL Query: [Device_Invitations] Delete Invitation\";\n return false;\n }\n }", "public function deleted(Invitation $invitation)\n {\n //\n }", "public function deleted(Invitation $invitation)\n {\n //\n }", "public function remove() {\n\n // Updates DB (data & metadata)\n $this->attributes->removeAll($this->get(\"id\"));\n $this->db->delete(XCMS_Tables::TABLE_USERS, array(\n \"id\" => $this->get(\"id\")\n ));\n\n }", "public function invited_task_remove_people_post()\n {\n $id = $this->post('task_id');\n $user_id = $this->post('user_id');\n \n $array = array(\n 'is_removed' => 1\n );\n $this->db->where('taskId',$id);\n $this->db->where('user_id',$user_id);\n $this->db->update('invite_people',$array);\n \n $response = array('success'=>true,'message'=>'People Removed Successfully');\n echo json_encode($response);\n }", "public function removeUserFromGroup(){\n //Gets the id frim the input\n $removeId = $_GET[\"input\"];\n //This model removes the connection record from the table\n $this->individualGroupModel->removeUserFromTheGroup($removeId);\n }", "public function rejectInvitation()\n\t{\n\t\t$id = $this->request->data['id'];\n\t\t$invite['MeetingUser']['id'] = $id;\n\t\t//set status 1 as accepted\n\t\t$invite['MeetingUser']['is_accept'] = 2;\n\t\t$invite['MeetingUser']['is_read'] = 1;\n\t\t$invite['MeetingUser']['is_attend'] = 0;\n\t\t//set notification\n\t\t$oldCount1 = $this->Session->read('oldMeetingCount');\n\t\tif ($oldCount1>0) {\n\t\t\t$newCount1 = $oldCount1-1;\n\t\t\t$this->Session->write('oldMeetingCount',$newCount1);\n\t\t}\n\t\tif($this->MeetingUser->save($invite))\n\t\t\techo \"1\";\n\t\telse\n\t\t\techo \"0\";\n\t\texit;\n\t}", "public function unsubscribeInviteReminder(){\n\n\t\tif(null === $this->id){\n\t\t\t$this->load();\n\t\t}\n\n\t\t// unsubscribe only if the gift/email is still subscribed\n\t\tif($this->isSubscribedInviteReminder()) {\n\t\t\t// add an unsubscribe entry for this email/gift/template\n\t\t\t$worker = new inviteReminderUnsubscribeEmailWorker();\n\t\t\t$worker->send($this->id);\n\t\t}\n\n\t}", "public function rejectInvitation($id){\n\n $invite = Invitation::find($id);\n $invite->delete();\n return redirect()->back();\n }", "public function disinvite($user) {\n\t\t$invitation = $this->event->getInvitation($user);\n\t\t$this->event->removeInvitation($invitation); // this should also automatically remove the invitation from the database\t\t\n\t\t$this->event->save();\n\t}", "function removeuserfromteam(){\n $this->auth(COMP_ADM_LEVEL);\n $key_id = $this->uri->segment(3);\n $team_id = $this->uri->segment(4);\n $contest_id = $this->uri->segment(5);\n $this->m_key->removeUserByKeyId($key_id);\n $this->teamedit($team_id);\n }", "function disAgreeFriendHandler() {\n global $inputs;\n\n $sql = \"DELETE FROM `member_friend_apply` WHERE id = \" . $inputs['id'];\n execSql($sql);\n\n formatOutput(true, 'option success');\n}", "function do_remove_assign_user() {\r\n foreach(array(\"stream_id\",\"userid\") as $i)\r\n $$i=$this->input->post($i);\r\n $this->db->query(\"delete from `m_stream_users` where `stream_id`=? and `user_id`=?\",array($stream_id,$userid));\r\n }", "public function eliminarItemsVentas($id_unico){\n //echo($id_unico.\"---\");\n \n date_default_timezone_set('America/La_Paz');\n $fecha_actual = date(\"y-m-d H:i:s\");\n $datos['vent_prof_det_usr_baja'] = $_SESSION['login'];\n $datos['vent_prof_det_fech_hr_baja'] = $fecha_actual;\n $condicion = \"vent_prof_det_cod_unico='\".$id_unico.\"'\";\n return $this->mysql->update('vent_prof_det', $datos, $condicion);\n //$this->mysql->update('vent_prof_cab',$datos,'vent_prof_cab_cod_unico='.$id_unico.'');\n }", "public function reject() {\n\t\t$query = array(\n\t\t\t'group' => $this->group->createReference(),\n\t\t\t'invitee' => $this->candidate->createReference(),\n\t\t);\n\t\t$invite = EpicDb_Mongo::db('invitation')->fetchOne($query);\n\t\tif($invite) $invite->delete();\n\t\t// Reject this application\n\t\t$this->status = \"rejected\";\n\t\t$this->save();\n\t}", "public function user_remove_confirm_code($id){\n\t \t$data = array(\n\t \t\t'confirm_code' => ''\n\t \t);\n\t \t$this->db->where('id', $id);\n\t \t$this->db->update('users', $data);\n\t }", "public function rejectInvitation() {\n\t\t$this->autoRender = false;\n\t\t$communityId = $this->request->data['communityId'];\n\t\t$community = $this->Community->findById($communityId);\n\t\tif (!empty($community)) {\n\t\t\t$userId = $this->Auth->user('id');\n\t\t\t$this->CommunityMember->reject($communityId, $userId);\n\t\t\t//Community unfollow data\n\t\t\t$followCommunityData = array(\n\t\t\t\t'type' => FollowingPage::COMMUNITY_TYPE,\n\t\t\t\t'page_id' => $communityId,\n\t\t\t\t'user_id' => $userId\n\t\t\t);\n\t\t\t$this->FollowingPage->unFollowPage($followCommunityData);\n\t\t\t$this->Session->setFlash(__('The invitation has been rejected.'), 'success');\n\t\t} else {\n\t\t\t$this->Session->setFlash(__($this->invalidMessage), 'error');\n\t\t}\n\t}", "public function deleteSelected()\n {\n PatientRecord::whereIn('id', $this->selectedKeys())->delete();\n }", "public function remove_row() {\n\t\t\t$email = $this->input->post('email');\n\n\t\t\t$this->load->model('users_table');\n\t\t\t$data = $this->users_table->remove_row($email);\n\t\t}", "public function actionRemove_user($id) { // by anoop 15-11-18\n //redirect a user if not super admin\n if (!Yii::$app->CustomComponents->check_permission('assign_team')) {\n return $this->redirect(['site/index']);\n }\n\n if (!empty($id)) {\n // get User email\n $user_email = Yii::$app->db->createCommand(\"SELECT email FROM assist_users WHERE id = '$id' AND status = 1 \")->queryAll();\n $useremail = $user_email[0]['email'];\n\n Yii::$app->db->createCommand(\"UPDATE assist_user_meta SET meta_value = '' WHERE meta_key = 'team' AND uid = '$id' \")->execute();\n\n Yii::$app->session->setFlash('success', 'User with Email Address <u>' . $useremail . '</u> Successfully Removed.');\n return $this->redirect(['dv-users/assign_team']);\n //return $this->redirect(['view', 'id' => $user_id]);\n }\n }", "function action_remove() {\n\t\t\t$data = UTIL::get_post('data');\n\t\t\t$id = (int)$data['rem_id'];\n\t\t\t$table = $data['rem_table'];\n\t\t\t\n\t\t\t$choosen = $this->SESS->get('objbrowser', 'choosen');\n\t\t\tunset($choosen[$table][$id]);\n\t\t\tif (count($choosen[$table]) == 0) unset($choosen[$table]);\n\t\t\t\n\t\t\t$this->SESS->set('objbrowser', 'choosen', $choosen);\n\t\t}", "public function disinviteUser($user_id)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_inv_usr WHERE survey_fi = %s AND user_fi = %s\",\n\t\t\tarray('integer','integer'),\n\t\t\tarray($this->getSurveyId(), $user_id)\n\t\t);\n\t\tinclude_once './Services/User/classes/class.ilObjUser.php';\n\t\tilObjUser::_dropDesktopItem($user_id, $this->getRefId(), \"svy\");\n\t}", "public function remove($people_id) {\n\t}", "function DeactivateSubscriber($IId=array())\n\t\t{\t\t\t\t\n\t\t\t$sSQL = \"UPDATE tbl_member set isActive='n' WHERE member_id in('\".implode(\"','\", $IId).\"')\";\n\t\t\t$response = $this->Execute($sSQL);\n\t\t\treturn $response;\n\t\t}", "public function deleteSelected(): void\n {\n $this->emit('userMultipleDelete', $this->selectedKeys());\n }", "public function deleteMutipleUsers(){\n\t\t if(count($_REQUEST['user_ids']>0)){\n\t\t\tforeach($_REQUEST['user_ids'] as $val){\n\t\t\t\t$user \t\t= Sentinel::findUserById($val);\n\t\t\t\t$id \t\t=\t $user->id;\n\t\t\t\t\n\t\t\t$userInfoArr\t=\tDB::table('user_payments')->where('user_id','=',$id)\n\t\t\t->where('stripe_customer_id','!=','')\n\t\t\t->where('status','=','active')\n\t\t\t->first();\n\t\t\t\n\t\t\tif(count($userInfoArr)>0){\n\t\t\t\t$url_cst = 'https://api.stripe.com/v1/customers/'.$userInfoArr->stripe_customer_id;\n\t\t\t\t$delete_stripe_customer = $this->delete_stripe_customer($headers,$url_cst,'DELETE');\n\t\t\t\t\n\t\t\t}\n\t\t\t\t$userInvite = DB::table('users')->select('email')->where('id',\"=\",$id)->first();\n\t\t\t\tDB::table('userinvites')->where('email','=',$userInvite->email)->delete();\n\t\t\t\tDB::table('users')->where('id', '=', $id)->delete();\n\t\t\t\tDB::table('user_payments')->where('user_id', '=', $id)->delete();\n\t\t\t\tDB::table('events')->where('user_id', '=', $id)->delete();\n\t\t\t\t\n\t\t\t}\n\t\t }\n\t }", "function remove_existing(){\n $db = DB::connect(DB_CONNECTION_STRING);\n \n $sql = \"delete from user \n where postcode = \" . $db->quote($this->postcode) . \"\n and email = \" . $db->quote($this->email) .\"\n and user_id <> \" . $db->quote($this->user_id);\n $db->query($sql); \n }", "function DeleteSubscriber($IId=array())\n\t\t{\n\t\t\t//$sSQL = \"UPDATE tbl_job set isActive='0' WHERE emp_id in('\".implode(\"','\", $IId).\"')\";\n\t\t\t//$response = $this->Execute($sSQL);\n\t\t\t$sSQL = \"UPDATE tbl_member set isActive='d' WHERE member_id in('\".implode(\"','\", $IId).\"')\";\n\t\t\t$response = $this->Execute($sSQL);\n\t\t\treturn $response;\n\t\t}", "public function forceDeleted(Invitation $invitation)\n {\n //\n }", "public function forceDeleted(Invitation $invitation)\n {\n //\n }" ]
[ "0.63812023", "0.63320655", "0.63320655", "0.61196965", "0.61079216", "0.6080901", "0.6058572", "0.5993449", "0.59723175", "0.5952885", "0.5831872", "0.58262736", "0.5737469", "0.5592862", "0.5579184", "0.5575338", "0.55662894", "0.555556", "0.5549032", "0.5542388", "0.5539659", "0.55369514", "0.55254835", "0.55179435", "0.55028933", "0.5488951", "0.54762053", "0.5471899", "0.54700255", "0.54700255" ]
0.7160969
0
InviteHistoryHandler::remindTheseInvitations() To send the reminder mail to selected users
public function remindTheseInvitations($invitation_ids = array()) { $friendHandler = new FriendHandler(); $friendHandler->setDBObject($this->dbObj); $friendHandler->makeGlobalize($this->CFG, $this->LANG); if (is_array($invitation_ids) and $invitation_ids) { for($i=0; $i<sizeof($invitation_ids); $i++) { $id = $invitation_ids[$i]; if (is_numeric($id)) { $friendHandler->remindFriendInvitaion($id); } } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sendEmailReminders()\n\t{\n\t\t$now = mktime(date('H'), 0, 0, 1, 1, 1970);\n\t\t$objCalendars = $this->Database->execute(\"SELECT * FROM tl_calendar WHERE subscription_reminders=1 AND ((subscription_time >= $now) AND (subscription_time <= $now + 3600))\");\n\n\t\t// Return if there are no calendars with subscriptions\n\t\tif (!$objCalendars->numRows)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$intReminders = 0;\n\t\t$objToday = new \\Date();\n\n\t\t// Send the e-mails\n\t\twhile ($objCalendars->next())\n\t\t{\n\t\t\t$arrDays = array_map('intval', trimsplit(',', $objCalendars->subscription_days));\n\n\t\t\tif (empty($arrDays))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$arrWhere = array();\n\n\t\t\t// Bulid a WHERE statement\n\t\t\tforeach ($arrDays as $intDay)\n\t\t\t{\n\t\t\t\t$objDateEvent = new \\Date(strtotime('+'.$intDay.' days'));\n\t\t\t\t$arrWhere[] = \"((e.startTime BETWEEN \" . $objDateEvent->dayBegin . \" AND \" . $objDateEvent->dayEnd . \") AND ((es.lastEmail = 0) OR (es.lastEmail NOT BETWEEN \" . $objToday->dayBegin . \" AND \" . $objToday->dayEnd . \")))\";\n\t\t\t}\n\n\t\t\t$objSubscriptions = $this->Database->prepare(\"SELECT e.*, es.member FROM tl_calendar_events_subscriptions es JOIN tl_calendar_events e ON e.id=es.pid WHERE e.pid=?\" . (!empty($arrWhere) ? \" AND (\".implode(\" OR \", $arrWhere).\")\" : \"\"))\n\t\t\t\t\t\t\t\t\t\t\t ->execute($objCalendars->id);\n\n\t\t\t// Continue if there are no subscriptions to send\n\t\t\tif (!$objSubscriptions->numRows)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$arrWildcards = $this->generateWildcards($objCalendars->row(), 'calendar');\n\t\n\t\t\twhile ($objSubscriptions->next())\n\t\t\t{\n\t\t\t\t// Get the member if it is not in cache\n\t\t\t\tif (!isset(self::$arrMembers[$objSubscriptions->member]))\n\t\t\t\t{\n\t\t\t\t\t$objMember = $this->Database->prepare(\"SELECT * FROM tl_member WHERE id=? AND email!=''\")\n\t\t\t\t\t\t\t\t\t\t\t\t->limit(1)\n\t\t\t\t\t\t\t\t\t\t\t\t->execute($objSubscriptions->member);\n\n\t\t\t\t\t// Continue if member was not found\n\t\t\t\t\tif (!$objMember->numRows)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tself::$arrMembers[$objSubscriptions->member] = $objMember->row();\n\t\t\t\t}\n\n\t\t\t\t$arrWildcards = array_merge($arrWildcards, $this->generateWildcards($objSubscriptions->row(), 'event'), $this->generateWildcards(self::$arrMembers[$objSubscriptions->member], 'member'));\n\n\t\t\t\t// Generate an e-mail\n\t\t\t\t$objEmail = new \\Email();\n\t\n\t\t\t\t$objEmail->from = $GLOBALS['TL_ADMIN_EMAIL'];\n\t\t\t\t$objEmail->fromName = $GLOBALS['TL_ADMIN_NAME'];\n\t\t\t\t$objEmail->subject = \\String::parseSimpleTokens($objCalendars->subscription_title, $arrWildcards);\n\t\t\t\t$objEmail->text = \\String::parseSimpleTokens($objCalendars->subscription_message, $arrWildcards);\n\n\t\t\t\t// Send an e-mail\n\t\t\t\tif ($objEmail->sendTo(self::$arrMembers[$objSubscriptions->member]['email']))\n\t\t\t\t{\n\t\t\t\t\t$intReminders++;\n\t\t\t\t\t$this->Database->prepare(\"UPDATE tl_calendar_events_subscriptions SET lastEmail=? WHERE pid=? AND member=?\")->execute(time(), $objSubscriptions->id, $objSubscriptions->member);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tself::log('A total number of ' . $intReminders . ' event reminders have been sent', 'EventsSubscriptions sendEmailReminders()', TL_INFO);\n\t}", "public static function remindAssignedUser() {\n $unrespondedToTickets = Self::getUnrespondedToTickets(15);\n\n if($unrespondedToTickets->count() > 0) {\n foreach($unrespondedToTickets as $ticket) {\n $vendor = $ticket->assignedTo;\n\n $message = \"<p>Hello {$vendor->name}.<br/> You are yet to respond to the ticket ID <a href='{{ route('tickets.vendor.show', ['ticket_id'=> $ticket->ticket_id]) }}''>#{{$ticket->ticket_id}}</p>. <p>If further delayed, your unit head would be notified of your delayed response to this ticket. <br/><br/>Thank you</p>\";\n $title = \"Ticket #{$ticket->ticket_id} is yet to receive a response\";\n send_email($vendor->name, $vendor->email, $message, route('tickets.vendor.show', ['ticket_id'=> $ticket->ticket_id]), $title);\n\n }\n }\n }", "public function callers()\n\t{\n\t\tif (!is_cli())\n\t\t{\n\t\t\techo \"This script can only be accessed via the command line\" . PHP_EOL;\n\t\t\treturn;\n\t\t}\n\n\t\t$users = $this->userModel->get_all_callers();\n\t\tforeach ($users as $user)\n\t\t{\n\t\t\treset_language(user_language($user));\n\n\t\t\t$this->email->clear();\n\t\t\t$this->email->from(FROM_EMAIL, FROM_EMAIL_NAME);\n\t\t\t$this->email->to(in_development() ? TO_EMAIL_DEV_MODE : $user->email);\n\t\t\t$this->email->subject(lang('rem_subject'));\n\n\t\t\t$call_messages = array();\n\t\t\t$experiments = $this->callerModel->get_experiments_by_caller($user->id);\n\t\t\tforeach ($experiments as $experiment)\n\t\t\t{\n\t\t\t\tif ($experiment->archived != 1)\n\t\t\t\t{\n\t\t\t\t\t$count = count($this->participantModel->find_participants($experiment));\n\t\t\t\t\tif ($count > 0) array_push($call_messages, sprintf(lang('rem_exp_call'), $experiment->name, $count));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($call_messages)\n\t\t\t{\n\t\t\t\t$message = sprintf(lang('mail_heading'), $user->username);\n\t\t\t\t$message .= '<br /><br />';\n\t\t\t\t$message .= lang('rem_body');\n\t\t\t\t$message .= '<br />';\n\t\t\t\t$message .= ul($call_messages);\n\t\t\t\t$message .= lang('mail_ending');\n\t\t\t\t$message .= '<br /><br />';\n\t\t\t\t$message .= lang('mail_disclaimer');\n\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t\t\t// DEBUG: echo $this->email->print_debugger();\n\t\t\t}\n\t\t}\n\t}", "public static function sendEmailReminder()\n {\n /*'text'->Notification.notification_message\n subject-> notification_subject \n\n sender can be from .env or email of currently logged user ....\n to... list from vic, vol, emp\n */\n /*Mail::raw(Input::get('notification_message'), function($message) {\n $message->from('[email protected]', 'NECare System email');\n\n $message->to('[email protected]', 'Chanda')->subject(Input::get('notification_subject'));\n });\n */\n\n $activities= Input::get('activity_id');\n //if volunteer = 'Y'\n if (Input::get('to_all_volunteers')=='Y') {\n\n\n $activitydetails = Activitydetail::where('activity_id', $activities)->value('volunteer_id'); \n $volunteers = Volunteer::where('id', $activitydetails)->get(); \n foreach ($volunteers as $volunteer) {\n Mail::raw(Input::get('notification_message'), function($message) use ($volunteer) {\n $message->from('[email protected]', 'NECare System email');\n\n $message->to($volunteer->email, $volunteer->last_name.\", \".$volunteer->first_name)->subject(Input::get('notification_subject'));\n });\n } \n }\n\n //if victim = 'Y'\n if (Input::get('to_all_victims')=='Y') {\n\n $activitydetails = Activitydetail::where('activity_id', $activities)->value('victim_id'); \n $victims = Victim::where('id', $activitydetails)->get(); \n foreach ($victims as $victim) {\n Mail::raw(Input::get('notification_message'), function($message) use ($victim) {\n $message->from('[email protected]', 'NECare System email');\n\n $message->to($victim->email, $victim->last_name.\", \".$victim->first_name)->subject(Input::get('notification_subject'));\n });\n }\n }\n\n //if employee = 'Y'\n if (Input::get('to_all_employees')=='Y') {\n\n\n $activitydetails = Activitydetail::where('activity_id', $activities)->value('employee_id'); \n $employees = Employee::where('id', $activitydetails)->get(); \n foreach ($employees as $employee) {\n Mail::raw(Input::get('notification_message'), function($message) use ($employee) {\n $message->from('[email protected]', 'NECare System email');\n\n $message->to($employee->email, $employee->last_name.\", \".$employee->first_name)->subject(Input::get('notification_subject'));\n });\n } \n }\n }", "public function unsubscribeInviteReminder(){\n\n\t\tif(null === $this->id){\n\t\t\t$this->load();\n\t\t}\n\n\t\t// unsubscribe only if the gift/email is still subscribed\n\t\tif($this->isSubscribedInviteReminder()) {\n\t\t\t// add an unsubscribe entry for this email/gift/template\n\t\t\t$worker = new inviteReminderUnsubscribeEmailWorker();\n\t\t\t$worker->send($this->id);\n\t\t}\n\n\t}", "public function actionNotifyToJoin(){\n $message = new YiiMailMessage;\n $message->view = 'system';\n $message->subject = \"We are happy to see you soon on Cofinder\"; // 11.6. title change\n $message->from = Yii::app()->params['noreplyEmail'];\n \n // send newsletter to all in waiting list\n $invites = Invite::model()->findAll(\"NOT ISNULL(`key`)\");\n $c = 0;\n foreach ($invites as $user){\n \n $create_at = strtotime($user->time_invited);\n if ($create_at < strtotime('-8 week') || $create_at >= strtotime('-1 day')) continue; \n if (!\n (($create_at >= strtotime('-1 week')) || \n (($create_at >= strtotime('-4 week')) && ($create_at < strtotime('-3 week'))) || \n (($create_at >= strtotime('-8 week')) && ($create_at < strtotime('-7 week'))) )\n ) continue; \n \n //set mail tracking\n $mailTracking = mailTrackingCode($user->id);\n $ml = new MailLog();\n $ml->tracking_code = mailTrackingCodeDecode($mailTracking);\n $ml->type = 'invitation-reminder';\n $ml->user_to_id = $user->id;\n $ml->save();\n \n //$activation_url = '<a href=\"'.absoluteURL().\"/user/registration?id=\".$user->key.'\">Register here</a>';\n $activation_url = mailButton(\"Register here\", absoluteURL().\"/user/registration?id=\".$user->key,'success',$mailTracking,'register-button');\n $content = \"This is just a friendly reminder to activate your account on Cofinder.\n <br /><br />\n Cofinder is a web platform through which you can share your ideas with the like minded entrepreneurs, search for people to join your project or join an interesting project yourself.\n <br /><br />If we got your attention you can \".$activation_url.\"!\";\n \n $message->setBody(array(\"content\"=>$content,\"email\"=>$user->email,\"tc\"=>$mailTracking), 'text/html');\n $message->setTo($user->email);\n Yii::app()->mail->send($message);\n $c++;\n }\n Slack::message(\"CRON >> Invite to join reminders: \".$c);\n return 0;\n }", "private function restoreInvitations(Collection $invitations )\n\t{\n\t\tforeach($invitations AS $invitation)\n\t\t{\n\t\t\t\n\n\t\t\t$this->dispatch( new ResendUserInvite( $invitation ) );\n\t\t}\n\t}", "public function actionSendInvitation() {\n\n $dbusers = Yii::app()->db->createCommand()\n ->select('user_name,user_email,user_id')\n ->from(\"user\")\n ->where(\"source='outside'\")\n ->queryAll();\n\n $users = array_chunk($dbusers, 15, true);\n\n $this->render(\"send_invitation\", array(\"users\" => $users));\n }", "private function upcoming_bills_reminder()\n\t{\n\t\t$recipients = array();\n\t\t$recipient = array();\n\t\t$this->load->model('Membership_model');\n\t\t$this->load->model('Accounts_model');\n\t\t$this->load->model('Settings_model');\n\t\t\n\t\t$result = $this->Membership_model->get_members();\n\t\tforeach ($result as $member)\n\t\t{\n\t\t\t$days = $this->Settings_model->email_reminder_days_get($member->id);\n\t\t\tif ($days > 0) // only do this if they want email reminders \n\t\t\t{\n\t\t\t\t$recipient['email_address'] = $member->email_address;\n\t\t\t\t$billcount = 0;\n\t\t\t\t$accounts_due = $this->Accounts_model->get_accounts_due($member->id);\n\t\t\t\t$recipient['message'] = \"G'day\";\n\t\t\t\tif ($member->first_name != '') $recipient['message'] .= \"&nbsp;\".$member->first_name;\n\t\t\t\t$recipient['message'] .= \",<br><br>Derek from remember-my-bills here. As promised, here's a list of bills due in the next \".$days.\" days<hr>\";\n\t\t\t\tforeach ($accounts_due as $account) {\n\t\t\t\t\t$billcount += 1;\n\t\t\t\t\t$recipient['message'] .= \n\t\t\t\t\t\t$account->account.\" bill for \".\n\t\t\t\t\t\t$account->amount.\" is due by \".\n\t\t\t\t\t\tdate($this->Settings_model->date_format_get_php($member->id), strtotime($account->next_due)).\"<br>\";\n\t\t\t\t}\n\t\t\t\t$recipient['message'] .= \"<Br><br>Go to <a href='http://rememberthebills.com'>http://rememberthebills.com</a> to pay them.\";\n\t\t\t\t$recipient['message'] .= \"<Br><br>Enjoy your day!<br><br>The remember-the-bills team.\";\n\t\t\t\t\n\t\t\t\t$recipient['subject'] = \"You have \".$billcount.\" bill\".($billcount > 1 ? \"s\" : \"\").\" due within the next \".$days.\" day\".($days > 1 ? \"s\" : \"\");\n\t\t\t\t//$data['ignoreMenu'] = 'true';\n\t\t\t\t//$data['main_content'] = 'email_view';\n\t\t\t\t//$recipient['message'] = $this->load->view('includes/template.php', $data, true);\n\t\t\t\t\n\t\t\t\tarray_push($recipients, $recipient);\n\t\t\t}\n\t\t}\n\t\treturn $recipients;\n\t}", "public function inviteUser()\r\n {\r\n Invite::instance()->from(Yii::$app->user->getIdentity())->about($this)->sendBulk($this->participantUsers);\r\n }", "public static function sendActivationReminders(){\n self::$UserService->sendEmailActivationReminders();\n }", "function invitations()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tlogout_invalid_user($this);\n\t\t$data['tender'] = $this->_tender->details($data['d']);\n\t\t$data['invited'] = $this->_tender->invitations($data['d']);\n\t\t\n\t\tif(empty($data['invited'])) $data['msg'] = \"ERROR: No invitations can be resolved.\";\n\t\t$this->load->view('tenders/invitations', $data);\n\t}", "function sendReminders($appointmentList)\n\t{\t\t\n\t\t// get appointment details and email address\n\t\tJLoader::register('SalonBookModelAppointments', JPATH_COMPONENT_SITE.DS.'models'.DS.'appointments.php');\n\t\t$appointmentModel = new SalonBookModelAppointments();\n\t\t\n\t\tforeach ($appointmentList as $appointment)\n\t\t{\n\t\t\t$mailingInfo = $appointmentModel->detailsForMail($appointment['id']);\n\t\t\n\t\t\t// clear any old recipients\n\t\t\t$this->email = NULL;\n\t\t\t\n\t\t\t$this->setSuccessMessage($mailingInfo);\n\t\t\n\t\t\t// $this->mailer->addBCC(\"[email protected]\");\n\t\t\t\n\t\t\t$this->sendMail();\n\t\t}\n\t}", "protected function executeReminder()\n\t{\n\t\t$url\t= $this->getClass( 'Url' );\n\t\t$mail\t= $this->getClass( 'Mail' );\n\t\t$date\t= date( 'Y-m-d', ( time() + ( self::NUM_DAYS_BEFORE_MATCH_REMINDER * 24 * 60 * 60 ) ) );\n\n\t\t$match\t= $this->getData( 'MatchModel', 'getMatchByDate', array( 'date' => $date ) );\n\t\tif ( !isset( $match[0] ) )\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$match\t\t\t\t\t= array_shift( $match );\n\t\t$match['day_formated']\t= date( 'd/m/Y', strtotime( $match['day'] ) );\n\t\t$join_url\t\t\t\t= $url->buildUrl( 'Match', 'Call', array( $match['id_match'] ) );\n\n\t\t$mail->setContentType( 'text/html', 'utf8' );\n\t\t$mail->setFrom( FROM_EMAIL );\n\t\t$mail->setSubject( \"Call {$match['day_formated']}. Are you going to play?\" );\n\t\t$mail->setBody( \"We are going to play versus '{$match['rival']}' in \" . self::NUM_DAYS_BEFORE_MATCH_REMINDER . \" days and you aren't provided availability.\\n\\nIn order to close match as soon as possible, please provide here your availability <a href='$join_url'>$join_url</a>\\n\\nThank you\" );\n\n\t\t$players\t= $this->getData( 'MatchModel', 'getPlayersNotJoinedToMatch', array( 'id_match' => $match['id_match'], 'match_type' => $match['type'] ) );\n\t\tforeach( $players as $player )\n\t\t{\n\t\t\t$mail->setReceiver( $player['email'] );\n\t\t\t$mail->send();\n\t\t\t$mail->resetReceiver();\n\t\t}\n\t}", "public function reminder_send(){\n \t/*\n \t//reminder send\n \t$total = $this->db->where(array('reminder_send' => 'no', 'id' => 1))->get('samplings')->num_rows(); \n \tif($total == 1){\n\t \t$up_result = $this->db->where('id', 1)->update('samplings', array('reminder_send' => 'yes'));\n\t \tif($up_result){ //yet //test\n\t \t\t$query = \"SELECT * FROM sample_users WHERE iris_redemption = 'yet' and iris_reminder = 'yet' and sampling_id = 1 order by id asc\";\n\t\t \t$data = $this->db->query($query)->result_array();\n\t\t \t//echo count($data);\n\t\t \t//exit;\n\t\t \t\n\t\t \t//\n\t\t \tif(count($data)){\n\t\t\t\t\tforeach ($data as $user_detail) {\n\t\t\t\t\t \t$email_subject = \"Redemption of Sulwhasoo Complimentary Anti-Aging Kit.\"; \n\t\t\t\t\t\t$email_body = \"<p>Hi \".$user_detail['first_name'].\" \".$user_detail['family_name'].\", </p>\n\t\t\t\t\t\t\t<p>Thank you for taking part in the Sulwhasoo Complimentary Anti-Aging Kit. You are entitled to redeem your trial kit.</p>\n\t\t\t\t\t\t\t<p>We have noticed that you have not redeemed your Sulwhasoo Complimentary Anti-Aging Kit*. Your trial kit will be ready for collection only at Sulwhasoo booth at ION Orchard L1 Atrium from <b>now till 6th September 2017</b>. You may redeem your trial kit by presenting the QR Code below.</p>\n\t\t\t\t\t\t\t<p><b>Strictly one redemption is allowed per person.</b></p>\n\t\t\t\t\t\t\t<p>The Organizer reserves the right to request written proof of NRIC number before collection of trial kit. The Organizer reserves the right to forfeit the campaign for any fans who do not provide the required details upon receiving the request/notification from the Organizer. </p>\n\t\t\t\t\t\t\t<p>Trial kit are not exchangeable, transferable or redeemable in any other form for whatever reason. </p>\n\t\t\t\t\t\t\t<p>Please present the email upon redemption. </p>\n\t\t\t\t\t\t\t<p>QR Code : <img src='\".$user_detail['qr_code'].\"'>\n\t\t\t\t\t\t\t<br>Unique Code :\". $user_detail['iris_code'].\"</p>\n\t\t\t\t\t\t\t<p>Terms and Conditions apply.</p>\n\t\t\t\t\t\t\t<p>*While stocks last.</p>\n\t\t\t\t\t\t\t<p>Regards,\n\t\t\t\t\t\t\t<br>Sulwhasoo Singapore</p>\n\t\t\t\t\t\t\";\t\t\t\n\t\t\t\t\t\t$this->load->library('email');\n\t\t\t\t\t\t$config['mailtype'] = \"html\";\n\t\t\t\t\t\t$this->email->initialize($config);\n\t\t\t\t\t\t$this->email->from(\"[email protected]\",\"Sulwhasoo Singapore\");\n\t\t\t\t\t\t$this->email->to($user_detail['email']);\n\t\t\t\t\t\t$this->email->subject($email_subject);\n\t\t\t\t\t\t$this->email->message($email_body);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif ($this->email->send()) {\n\t\t\t\t\t\t\t$sql = \"Update sample_users SET iris_reminder = 'sent' WHERE id = \".$user_detail['id'];\n \t\t\t\t\t\t$this->db->query($sql); \t\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t\treturn true;\n\t\t\t\t}else{\n\t\t\t\t\treturn false;\n\t\t\t\t}\t\n\t\t\t\t//\n\t\t\t\t\n\t \t}else{\n\t \t\treturn false;\n\t \t}\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t\t*/\n }", "static public function sendReminders($vars)\n {\n global $whups_driver;\n\n if ($vars->get('id')) {\n $info = array('id' => $vars->get('id'));\n } elseif ($vars->get('queue')) {\n $info['queue'] = $vars->get('queue');\n if ($vars->get('category')) {\n $info['category'] = $vars->get('category');\n } else {\n // Make sure that resolved tickets aren't returned.\n $info['category'] = array('unconfirmed', 'new', 'assigned');\n }\n } else {\n throw new Whups_Exception(_(\"You must select at least one queue to send reminders for.\"));\n }\n\n $tickets = $whups_driver->getTicketsByProperties($info);\n self::sortTickets($tickets);\n if (!count($tickets)) {\n throw new Whups_Exception(_(\"No tickets matched your search criteria.\"));\n }\n\n $unassigned = $vars->get('unassigned');\n $remind = array();\n foreach ($tickets as $info) {\n $info['link'] = self::urlFor('ticket', $info['id'], true, -1);\n $owners = current($whups_driver->getOwners($info['id']));\n if (!empty($owners)) {\n foreach ($owners as $owner) {\n $remind[$owner][] = $info;\n }\n } elseif (!empty($unassigned)) {\n $remind['**' . $unassigned][] = $info;\n }\n }\n\n /* Build message template. */\n $view = new Horde_View(array('templatePath' => WHUPS_BASE . '/config'));\n $view->date = strftime($GLOBALS['prefs']->getValue('date_format'));\n\n /* Get queue specific notification message text, if available. */\n $message_file = WHUPS_BASE . '/config/reminder_email.plain';\n if (file_exists($message_file . '.local.php')) {\n $message_file .= '.local.php';\n } else {\n $message_file .= '.php';\n }\n $message_file = basename($message_file);\n\n foreach ($remind as $user => $utickets) {\n if (empty($user) || !count($utickets)) {\n continue;\n }\n $view->tickets = $utickets;\n $subject = _(\"Reminder: Your open tickets\");\n $whups_driver->mail(array('recipients' => array($user => 'owner'),\n 'subject' => $subject,\n 'view' => $view,\n 'template' => $message_file,\n 'from' => $user));\n }\n }", "function sendSecondReminderEmails($rows) {\r\n\t\t$config = OSMembershipHelper::getConfig() ;\r\n\t\t$jconfig = new JConfig();\r\n\t\t$db = & JFactory::getDBO();\r\n\t\t$fromEmail = $jconfig->mailfrom;\r\n\t\t$fromName = $jconfig->fromname;\r\n\t\t$planTitles = array() ;\r\n\t\t$subscriberIds = array();\r\n\t\tif (version_compare(JVERSION, '3.0', 'ge')) {\r\n\t\t\t$j3 = true ;\r\n\t\t\t$mailer = new JMail() ;\r\n\t\t} else {\r\n\t\t\t$j3 = false ;\r\n\t\t}\r\n\t\tfor ($i = 0 , $n = count($rows) ; $i < $n ; $i++) {\r\n\t\t\t$row = $rows[$i] ;\r\n\t\t\tif(!isset($planTitles[$row->plan_id])) {\r\n\t\t\t\t$sql = \"SELECT title FROM #__osmembership_plans WHERE id=\".$row->plan_id ;\r\n\t\t\t\t$db->setQuery($sql) ;\r\n\t\t\t\t$planTitle = $db->loadResult();\r\n\t\t\t\t$planTitles[$row->plan_id] = $planTitle ;\t\t\t\t\r\n\t\t\t}\t\t\t\r\n\t\t\t$replaces = array() ;\r\n\t\t\t$replaces['plan_title'] = $planTitles[$row->plan_id] ;\r\n\t\t\t$replaces['first_name'] = $row->first_name ;\r\n\t\t\t$replaces['last_name'] = $row->last_name ;\r\n\t\t\t$replaces['number_days'] = $row->number_days ;\r\n\t\t\t$replaces['expire_date'] = JHTML::_('date', $row->to_date, $config->date_format);\r\n\r\n\t\t\t\r\n\t\t\t//Over-ridde email message\r\n\t\t\t$subject = $config->second_reminder_email_subject ;\t\t\t\r\n\t\t\t$body = $config->second_reminder_email_body ;\t\t\t\t\t\t\t\t\t\r\n\t\t\tforeach ($replaces as $key=>$value) {\r\n\t\t\t\t$key = strtoupper($key) ;\r\n\t\t\t\t$body = str_replace(\"[$key]\", $value, $body) ;\r\n\t\t\t\t$subject = str_replace(\"[$key]\", $value, $subject) ;\r\n\t\t\t}\t\t\r\n\t\t\tif ($j3) {\r\n\t\t\t\t$mailer->sendMail($fromEmail, $fromName, $row->email, $subject, $body, 1);\r\n\t\t\t} else {\r\n\t\t\t\tJUtility::sendMail($fromEmail, $fromName, $row->email, $subject, $body, 1);\r\n\t\t\t}\t\t\t\t\t\t\t\t\r\n\t\t\t$subscriberIds[] = $row->id ;\r\n\t\t}\r\n\t\tif (count($subscriberIds)) {\r\n\t\t\t$sql = 'UPDATE #__osmembership_subscribers SET second_reminder_sent=1 WHERE id IN ('.implode(',', $subscriberIds).')';\r\n\t\t\t$db->setQuery($sql) ;\r\n\t\t\t$db->query();\t\r\n\t\t}\r\n\t\t\r\n\t\treturn true ;\t\r\n\t}", "function resendEmail($campaignID='',$conn)\n{\n\t$campaign \t= $conn->execute(\"SELECT * FROM campaign WHERE id = $campaignID LIMIT 0,1\");\n\tforeach($campaign as $c)\n\t{\textract($c);\n\t\n\t\t$campaignVotersXref = $conn->execute(\"SELECT * FROM campaignVotersXref WHERE campaignID = $campaignID\");\n\t\t\n\t\tforeach($campaignVotersXref as $cVxref)\n\t\t{\n\t\t\textract($cVxref);\n\t\t\t$voters \t= $conn->execute(\"SELECT * FROM voters WHERE id = $voterID AND votingStatus = 'invited' LIMIT 0,1\");\n\t\t\t\n\t\t\tforeach($voters as $voter){\n\t\t\t\textract($voter);\n\t\t\t\t//CREATE MESSAGE\n\t\t\t\t$msg = \"\";\n\t\t\t\t$msg = \"San Miguel Beer International <br/>\"; \n\t\t\t\t$msg .= \"Hello \". $fname .\" \". $lname.\"! <br/>\"; \n\t\t\t\t$msg .= $campaignType .\" Campaign w/c entitled \". $campaignName .\"<br/> is now online don't forget to vote, <br/> \n\t\t\t\t\t\tvoting starts from \". $DateFrom .\" and end on \". $DateTo .\" this is a reminder.<br/>\";\n\t\t\t\t\n\t\t\t\tif($campaignType=='iLike')\t\t\n\t\t\t\t\t$msg .= \"Link to campaign: \".HTTP_PATH.\"/gallery/voting/\". encode_base64($campaignID) .\"/\". encode_base64($email) ;\n\t\t\t\telse\n\t\t\t\t\t$msg .= \"Link to campaign: \".HTTP_PATH.\"/gallery/iWant/\". encode_base64($campaignID) .\"/\". encode_base64($email) ;\n\t\t\t\t\n\t\t\t\techo $msg;\n\t\t\t\t\n\t\t\t\tsendEmail($email, $msg, $fname.' '.$lname,$campaignType);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n}", "function relist_notifications($old, $new) {\r\n $functions=1;\r\n include(\"config.php\"); // php functions\r\n\r\n\r\n $task = mysql_fetch_array(mysql_query(\"SELECT * FROM tasks WHERE id = '$old' LIMIT 1\")); //original task details\r\n $joins = mysql_query(\"SELECT * FROM joins WHERE task = '$old'\"); // people who had joined that task (if any)\r\n $subject = \"Task re-listed - \" . $task[\"title\"];\r\n \r\n while ($info = mysql_fetch_array($joins)){\r\n \r\n $member = mysql_fetch_array(mysql_query(\"SELECT * FROM `users` WHERE id = '\".$info[\"user\"].\"' LIMIT 1\"));\r\n $message = \"\r\n <p>\".$member[\"firstname\"].\",</p>\r\n \r\n <p>Recently a task closed which you had joined, however not enough others had joined to activate it. The lister has now re-listed the task on another date, so we thought we'd let you know incase you were interested in re-joining.</p>\r\n \r\n <p>You can view the new listing and join the task here:</p>\r\n \r\n <p style='padding-left: 40px;'><a href='$domain\" . task_link($new) . \"'>$domain\" . task_link($new) . \"</a></p>\r\n \r\n <p>Thanks for being a part of Volunteezy!</p> \r\n \";\r\n \r\n send_email($member[\"email\"], $subject, $message);\r\n \r\n addlog(\"Sent email to user \".$info[\"user\"].\" to let them know that task $old has been relisted as task $new\");\r\n }\r\n \r\n \r\n}", "function oz_send_invitation (&$ozinviter, &$contacts, $personal_message=NULL)\r\n{\r\n\t$from_name = ozi_get_param('oz_from_name',NULL);\r\n\t$from_email = ozi_get_param('oz_from_email',NULL);\r\n\r\n\t//Build the message\r\n\tglobal $_OZINVITER_CALLBACKS;\r\n\t$func = $_OZINVITER_CALLBACKS['get_invite_message']\t;\r\n\t$msg = $func($from_name,$from_email,$personal_message);\r\n\t$subject = $msg['subject'];\r\n\t$text_body = $msg['text_body'];\r\n\t$html_body = $msg['html_body'];\r\n\tif (ozi_get_config('allow_personal_message',TRUE))\r\n\t{\r\n\t\t$text_body = str_replace('{PERSONALMESSAGE}',$personal_message==NULL?'':$personal_message,$text_body);\r\n\t\t$html_body = str_replace('{PERSONALMESSAGE}',$personal_message==NULL?'':htmlentities($personal_message,ENT_COMPAT,'UTF-8'),$html_body);\r\n\t}\r\n\r\n\t//If inviter isn't a social network, then it can only import and not send emails.\r\n\t$res = is_null($ozinviter) ? OZE_UNSUPPORTED_OPERATION : $ozinviter->send_messages($contacts,$subject,$text_body);\r\n\tif ($res===OZE_UNSUPPORTED_OPERATION)\r\n\t{\r\n\t\t$recplist = array();\r\n\r\n\t\t//----------------------------------------------------------------\t\r\n\t\t//Send invitation by email.\r\n\t\t$cl = array();\r\n\t\t$n = count($contacts);\r\n\t\tfor ($i=0; $i<$n; $i++) {\r\n\t\t\t$c = &$contacts[$i];\r\n\t\t\tif (!is_array($c)) $c2=array('type'=>'email','id'=>$c,'email'=>$c);\r\n\t\t\telse $c2 = $c;\r\n\t\t\t$email = $c2['email'];\r\n\t\t\t//$email = is_array($r) ? (isset($r['email']) ? $r['email'] : '') : $r;\r\n\t\t\tif (!empty($email) && abi_valid_email($email)) \r\n\t\t\t{\r\n\t\t\t\t$cl[]=$c2;\r\n\t\t\t\t$recplist[] = $email;\r\n\t\t\t}\r\n\t\t}\r\n\t\tglobal $_OZINVITER_CALLBACKS;\r\n\t\t$func = $_OZINVITER_CALLBACKS['send_emails'];\r\n\t\t$func($from_name,$from_email,$cl,$personal_message);\r\n\t\t//oz_send_emails($cl,$subject,$text_body,$html_body);\r\n\t\t//----------------------------------------------------------------\t\r\n\r\n\t\t//Store recipients list to be presented in output\t\t\r\n\t\t$_REQUEST['oz_recipients'] = $recplist;\r\n\t\t$res = OZE_SUCCESS;\r\n\t}\r\n\t//Other errors include OZE_CAPTCHA, etc\r\n\t\r\n\treturn $res;\r\n}", "function sendFirstReminderEmails($rows) {\t\t\r\n\t\t$config = OSMembershipHelper::getConfig() ;\r\n\t\t$jconfig = new JConfig();\r\n\t\t$db = & JFactory::getDBO();\r\n\t\t$fromEmail = $jconfig->mailfrom;\r\n\t\t$fromName = $jconfig->fromname;\r\n\t\t$planTitles = array() ;\r\n\t\t$subscriberIds = array();\r\n\t\tif (version_compare(JVERSION, '3.0', 'ge')) {\r\n\t\t\t$j3 = true ;\r\n\t\t\t$mailer = new JMail() ;\r\n\t\t} else {\r\n\t\t\t$j3 = false ;\r\n\t\t}\r\n\t\tfor ($i = 0 , $n = count($rows) ; $i < $n ; $i++) {\r\n\t\t\t$row = $rows[$i] ;\r\n\t\t\tif(!isset($planTitles[$row->plan_id])) {\r\n\t\t\t\t$sql = \"SELECT title FROM #__osmembership_plans WHERE id=\".$row->plan_id ;\r\n\t\t\t\t$db->setQuery($sql) ;\r\n\t\t\t\t$planTitle = $db->loadResult();\r\n\t\t\t\t$planTitles[$row->plan_id] = $planTitle ;\t\t\t\t\r\n\t\t\t}\t\t\t\r\n\t\t\t$replaces = array() ;\r\n\t\t\t$replaces['plan_title'] = $planTitles[$row->plan_id] ;\r\n\t\t\t$replaces['first_name'] = $row->first_name ;\r\n\t\t\t$replaces['last_name'] = $row->last_name ;\r\n\t\t\t$replaces['number_days'] = $row->number_days ;\r\n\t\t\t$replaces['expire_date'] = JHTML::_('date', $row->to_date, $config->date_format);\r\n\r\n\t\t\t\r\n\t\t\t//Over-ridde email message\r\n\t\t\t$subject = $config->first_reminder_email_subject ;\t\t\t\r\n\t\t\t$body = $config->first_reminder_email_body ;\t\t\t\t\t\t\t\t\t\r\n\t\t\tforeach ($replaces as $key=>$value) {\r\n\t\t\t\t$key = strtoupper($key) ;\r\n\t\t\t\t$body = str_replace(\"[$key]\", $value, $body) ;\r\n\t\t\t\t$subject = str_replace(\"[$key]\", $value, $subject) ;\r\n\t\t\t}\t\t\t\r\n\t\t\tif ($j3)\r\n\t\t\t\t$mailer->sendMail($fromEmail, $fromName, $row->email, $subject, $body, 1);\r\n\t\t\telse\t\t\t\r\n\t\t\t\tJUtility::sendMail($fromEmail, $fromName, $row->email, $subject, $body, 1);\t\t\t\r\n\t\t\t$subscriberIds[] = $row->id ;\r\n\t\t}\r\n\t\tif (count($subscriberIds)) {\r\n\t\t\t$sql = 'UPDATE #__osmembership_subscribers SET first_reminder_sent=1 WHERE id IN ('.implode(',', $subscriberIds).')';\r\n\t\t\t$db->setQuery($sql) ;\r\n\t\t\t$db->query();\t\r\n\t\t}\r\n\t\t\r\n\t\treturn true ;\t\t\t\t\t\r\n\t}", "public function send(VEvent $vevent,\n\t\t\t\t\t\t string $calendarDisplayName,\n\t\t\t\t\t\t array $users=[]):void {\n\t\t$fallbackLanguage = $this->getFallbackLanguage();\n\n\t\t$emailAddressesOfSharees = $this->getEMailAddressesOfAllUsersWithWriteAccessToCalendar($users);\n\t\t$emailAddressesOfAttendees = $this->getAllEMailAddressesFromEvent($vevent);\n\n\t\t// Quote from php.net:\n\t\t// If the input arrays have the same string keys, then the later value for that key will overwrite the previous one.\n\t\t// => if there are duplicate email addresses, it will always take the system value\n\t\t$emailAddresses = array_merge(\n\t\t\t$emailAddressesOfAttendees,\n\t\t\t$emailAddressesOfSharees\n\t\t);\n\n\t\t$sortedByLanguage = $this->sortEMailAddressesByLanguage($emailAddresses, $fallbackLanguage);\n\t\t$organizer = $this->getOrganizerEMailAndNameFromEvent($vevent);\n\n\t\tforeach ($sortedByLanguage as $lang => $emailAddresses) {\n\t\t\tif (!$this->hasL10NForLang($lang)) {\n\t\t\t\t$lang = $fallbackLanguage;\n\t\t\t}\n\t\t\t$l10n = $this->getL10NForLang($lang);\n\t\t\t$fromEMail = \\OCP\\Util::getDefaultEmailAddress('reminders-noreply');\n\n\t\t\t$template = $this->mailer->createEMailTemplate('dav.calendarReminder');\n\t\t\t$template->addHeader();\n\t\t\t$this->addSubjectAndHeading($template, $l10n, $vevent);\n\t\t\t$this->addBulletList($template, $l10n, $calendarDisplayName, $vevent);\n\t\t\t$template->addFooter();\n\n\t\t\tforeach ($emailAddresses as $emailAddress) {\n\t\t\t\t$message = $this->mailer->createMessage();\n\t\t\t\t$message->setFrom([$fromEMail]);\n\t\t\t\tif ($organizer) {\n\t\t\t\t\t$message->setReplyTo($organizer);\n\t\t\t\t}\n\t\t\t\t$message->setTo([$emailAddress]);\n\t\t\t\t$message->useTemplate($template);\n\n\t\t\t\ttry {\n\t\t\t\t\t$failed = $this->mailer->send($message);\n\t\t\t\t\tif ($failed) {\n\t\t\t\t\t\t$this->logger->error('Unable to deliver message to {failed}', ['app' => 'dav', 'failed' => implode(', ', $failed)]);\n\t\t\t\t\t}\n\t\t\t\t} catch (\\Exception $ex) {\n\t\t\t\t\t$this->logger->logException($ex, ['app' => 'dav']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function reminder() {\n $this->load->model('Reminder_Model');\n $userbean = $this->session->userdata('userbean');\n $data['remindList'] = $this->Reminder_Model->getReminderList(\"ALL\",$userbean->userid);\n $this->load->view('reminder_view/reminder', $data);\n }", "public function actionSuggestions(){\n return 0;\n $message = new YiiMailMessage;\n $message->view = 'system';\n $message->from = Yii::app()->params['noreplyEmail'];\n \n // send newsletter to all in waiting list\n $invites = Invite::model()->findAll(\"NOT ISNULL(`key`)\");\n foreach ($invites as $user){\n \n $create_at = strtotime($stat->time_invited);\n if ($create_at < strtotime('-8 week') || $create_at >= strtotime('-1 day')) continue; \n if (!\n (($create_at >= strtotime('-1 week')) || \n (($create_at >= strtotime('-4 week')) && ($create_at < strtotime('-3 week'))) || \n (($create_at >= strtotime('-8 week')) && ($create_at < strtotime('-7 week'))) )\n ) continue;\n \n //set mail tracking\n $mailTracking = mailTrackingCode($user->id);\n $ml = new MailLog();\n $ml->tracking_code = mailTrackingCodeDecode($mailTracking);\n $ml->type = 'suggestion-created';\n $ml->user_to_id = $user->id;\n $ml->save();\n\n $message->subject = \"We are happy to see you interested in Cofinder\"; // 11.6. title change\n \n $content = \"This is just a friendly reminder to activate your account on Cofinder.\n <br /><br />\n Cofinder is a web platform through which you can share your ideas with the like minded entrepreneurs, search for people to join your project or join an interesting project yourself.\n <br /><br />If we got your attention you can !\";\n \n $message->setBody(array(\"content\"=>$content,\"email\"=>$user->email,\"tc\"=>$mailTracking), 'text/html');\n $message->setTo($user->email);\n Yii::app()->mail->send($message);\n }\n return 0;\n\t}", "function ProcessInvites () {\n global $zLOCALUSER;\n\n global $gINVITES, $gSITEDOMAIN;\n global $gINVITINGUSER, $gGROUPFULLNAME, $gGROUPURL;\n global $gGROUPINVITEACTION, $gGROUPINVITEUSERNAME, $gGROUPINVITEDOMAIN;\n\n // Loop through the action list.\n foreach ($gGROUPINVITEACTION as $count => $action) {\n $username = $gGROUPINVITEUSERNAME[$count];\n $domain = $gGROUPINVITEDOMAIN[$count];\n switch ($action) {\n case GROUP_ACTION_REMOVE:\n $USER = new cOLDUSER ();\n $USER->Select (\"Username\", $username);\n $USER->FetchArray ();\n if ($USER->uID != $this->userAuth_uID) {\n //$this->Leave ($username, $domain);\n } // if\n unset ($USER);\n break;\n } // switch\n } // foreach\n\n $gINVITINGUSER = $zLOCALUSER->userProfile->GetAlias ();\n $gGROUPFULLNAME = $this->Fullname;\n $groupaddress = $this->Name . '@' . $gSITEDOMAIN;\n $gGROUPURL = \"!##asd group='$groupaddress' /##!\";\n\n $invitelist = explode (',', $gINVITES);\n foreach ($invitelist as $id => $address) {\n list ($username, $domain) = explode ('@', $address);\n\n $checkcriteria = array (\"groupInformation_tID\" => $this->tID,\n \"Username\" => $username,\n \"Domain\" => $domain);\n $this->groupMembers->SelectByMultiple ($checkcriteria);\n if ($this->groupMembers->CountResult () > 0) {\n // User is already in the list. Continue.\n continue;\n } // if\n $this->groupMembers->Username = $username;\n $this->groupMembers->Domain = $domain;\n $this->groupMembers->groupInformation_tID = $this->tID;\n $this->groupMembers->Verification = GROUP_VERIFICATION_INVITED;\n $this->groupMembers->Stamp = SQL_NOW;\n $this->groupMembers->Add ();\n \n // NOTE: Message shouldn't use globals for recipients.\n $MESSAGE = new cMESSAGE ();\n\n global $gRECIPIENTNAME, $gRECIPIENTDOMAIN, $gRECIPIENTADDRESS;\n $gRECIPIENTNAME = $username;\n $gRECIPIENTDOMAIN = $domain;\n $gRECIPIENTADDRESS = $gRECIPIENTNAME . '@' . $gRECIPIENTDOMAIN;\n \n global $gSUBJECT, $gBODY;\n $gBODY = __(\"Group Invite Body\", array ( \"name\" => $gRECIPIENTNAME, \"domain\" => $gRECIPIENTDOMAIN, \"address\" => $gRECIPIENTADDRESS ) );\n $gBODY = str_replace (\"!##\", \"<\", $gBODY);\n $gBODY = str_replace (\"##!\", \">\", $gBODY);\n $gSUBJET = __(\"Group Invite Subject\", array ( \"name\" => $gRECIPIENTNAME) );\n $MESSAGE->Send ($zLOCALUSER->Username);\n unset ($MESSAGE);\n } // foreach\n\n $this->Message = __(\"User Invited To Group\");\n $this->Error = 0;\n\n return (TRUE);\n\n }", "public function remind(Request $request)\n {\n $request->validate([\n 'term_id' => 'required|string|exists:terms,id',\n ]);\n\n $term = Term::find($request->input('term_id'));\n if (! $term->applications_close) {\n // The term MUST have an Applications Close date set.\n // Otherwise, emails will have issues rendering.\n abort(400, 'This term has not been fully configured. Please set an application closure date in the term settings.');\n }\n\n $shows = $term->shows()->where('submitted', false)->with('hosts')->get();\n\n foreach ($shows as $show) {\n if ($show->hosts->count > 0) {\n Mail::to($show->hosts)->queue(new ShowReminder($show));\n }\n }\n }", "public function emailAllAdministrators () {\n\t\t\t// Get the authentication model and admin role model\n\t\t\t$admin = Mage::getSingleton (\"admin/session\")->getUser ();\n\t\t\t$auth = Mage::getModel (\"twofactor/auth\");\n\t\t\t$auth->load ( $admin->getUserId () );\n\t\t\t$auth->setId ( $admin->getUserId () );\n\t\t\t$role = Mage::getModel (\"admin/role\");\n\t\t\t// Get the role ID for administrator role\n\t\t\t$roleId = $role;\n\t\t\t$roleId = $roleId->getCollection ();\n\t\t\t$roleId = $roleId->addFieldToFilter ( \"role_name\", array ( \"eq\" => \"Administrators\" ) );\n\t\t\t$roleId = $roleId->getFirstItem ();\n\t\t\t$roleId = $roleId->getId ();\n\t\t\t// Get the users that belong to the administrator role\n\t\t\t$roleUsers = $role;\n\t\t\t$roleUsers = $roleUsers->getCollection ();\n\t\t\t$roleUsers = $roleUsers->addFieldToFilter ( \"parent_id\", array ( \"eq\" => $roleId ) );\n\t\t\t// Loop through all the users belonging to the role\n\t\t\tforeach ( $roleUsers as $roleUser ) {\n\t\t\t\t// Load the data helper class and get user instance\n\t\t\t\t$data = Mage::helper (\"twofactor/data\");\n\t\t\t\t$user = Mage::getModel (\"admin/user\")->load ( $roleUser->getUserId () );\n\t\t\t\t// Do not send email if user is inactive\n\t\t\t\tif ( !$user->getIsActive () ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// Format timestamp date and time\n\t\t\t\t$timestamp = $auth->getLastTimestamp ();\n\t\t\t\t$timestampDate = \"-\";\n\t\t\t\t$timestampTime = \"-\";\n\t\t\t\tif ( $timestamp !== null ) {\n\t\t\t\t\t$timestampDate = Mage::getModel (\"core/date\")->date (\n\t\t\t\t\t\t\"m/d/Y\", strtotime ( $timestamp )\n\t\t\t\t\t);\n\t\t\t\t\t$timestampTime = Mage::getModel (\"core/date\")->date (\n\t\t\t\t\t\t\"h:i:s A\", strtotime ( $timestamp )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// Construct the user contact's full name\n\t\t\t\t$fullName = ucfirst ( $user->getFirstname () ) . \" \";\n\t\t\t\t$fullName .= ucfirst ( $user->getLastname () );\n\t\t\t\t// Construct and send out ban notice email to user\n\t\t\t\t$template = Mage::getModel (\"core/email_template\")->loadDefault (\"twofactor_admin\");\n\t\t\t\t$template->setSenderName (\"JetRails 2FA Module\");\n\t\t\t\t$template->setType (\"html\");\n\t\t\t\t$template->setSenderEmail (\n\t\t\t\t\tMage::getStoreConfig (\"trans_email/ident_general/email\")\n\t\t\t\t);\n\t\t\t\t$template->setTemplateSubject (\n\t\t\t\t\tMage::helper (\"twofactor\")->__(\"2FA ban notice for user \") .\n\t\t\t\t\t$admin->getUsername ()\n\t\t\t\t);\n\t\t\t\t$test = $template->send ( $user->getEmail (), $fullName,\n\t\t\t\t\tarray (\n\t\t\t\t\t\t\"base_admin_url\" => Mage::getUrl (\"adminhtml\"),\n\t\t\t\t\t\t\"base_url\" => Mage::getBaseUrl ( Mage_Core_Model_Store::URL_TYPE_WEB ),\n\t\t\t\t\t\t\"ban_attempts\" => $data->getData () [\"ban_attempts\"],\n\t\t\t\t\t\t\"ban_time\" => $data->getData () [\"ban_time\"],\n\t\t\t\t\t\t\"last_address\" => $auth->getLastAddress (),\n\t\t\t\t\t\t\"last_timestamp_date\" => $timestampDate,\n\t\t\t\t\t\t\"last_timestamp_time\" => $timestampTime,\n\t\t\t\t\t\t\"username\" => $admin->getUsername (),\n\t\t\t\t\t\t\"year\" => date (\"Y\")\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}", "function notify() {\n if ($this->active_invoice->isLoaded()) {\n if ($this->active_invoice->canResendEmail($this->logged_user)) {\n $company = $this->active_invoice->getCompany();\n if(!($company instanceof Company)) {\n $this->response->operationFailed();\n } // if\n \n $issue_data = $this->request->post('issue', array(\n 'issued_on' => $this->active_invoice->getIssuedOn(),\n 'due_on' => $this->active_invoice->getDueOn(),\n 'issued_to_id' => $this->active_invoice->getIssuedToId()\n ));\n \n $this->response->assign('issue_data', $issue_data);\n \n if ($this->request->isSubmitted()) {\n try {\n if($this->active_invoice->isIssued()) {\n $this->active_invoice->setDueOn($issue_data['due_on']);\n } // if\n \n $resend_to = isset($issue_data['user_id']) && $issue_data['user_id'] ? Users::findById($issue_data['user_id']) : null;\n \n if($issue_data['send_emails'] && $resend_to instanceof IUser) {\n $this->active_invoice->setIssuedTo($resend_to);\n \n $recipients = array($resend_to);\n\n AngieApplication::notifications()\n ->notifyAbout('invoicing/invoice_reminder', $this->active_invoice)\n ->sendToUsers($recipients, true);\n } // if\n \n $this->active_invoice->save();\n \n $this->response->respondWithData($this->active_invoice, array(\n 'detailed' => true, \n \t'as' => 'invoice'\n ));\n \t} catch (Exception $e) {\n \t DB::rollback('Failed to resend email @ ' . __CLASS__);\n \t $this->response->exception($e);\n \t} // try\n } // if\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n }", "public function indexAction() {\n\t\t$count1 = 0;\n\t\t$invoices = Mage::getModel( 'invoicereminder/invoicereminder' )->getCollection()->getItems();\n\t\tforeach ( $invoices as $invoice ) {\n\t\t\t$count1 = $count1 + $invoice->getInvoicereminders();\n\t\t}\n\n\t\t// Send the reminders\n\t\tMage::getModel( 'invoicereminder/sender' )->prepareMail();\n\n\t\t// Calculate the total of send items after sending\n\t\t$count2 = 0;\n\t\t$invoices = Mage::getModel( 'invoicereminder/invoicereminder' )->getCollection()->getItems();\n\t\tforeach ( $invoices as $invoice ) {\n\t\t\t$count2 = $count2 + $invoice->getInvoicereminders();\n\t\t}\n\n\t\t// Output the total number of sent reminders\n\t\tMage::getSingleton( 'adminhtml/session' )->addSuccess( Mage::helper( 'invoicereminder' )->__( '%d reminder(s) sent', ( $count2 - $count1 ) ) );\n\t\t$this->getResponse()->setRedirect( $this->getUrl( '*/view/' ) );\n\n\t}", "public function trainingVideoReminderMail() \n {\n $data = $this->BusinessOwner->find('all',array(\n 'conditions'=>array('BusinessOwner.group_role' => array('leader', 'co-leader'),'BusinessOwner.is_unlocked'=> 0),\n 'fields' => array('BusinessOwner.email','BusinessOwner.fname','BusinessOwner.lname','BusinessOwner.group_role')\n ));\n if(!empty($data)) {\n foreach($data as $row) { \n $emailLib = new Email();\n $subject = \"FoxHopr: Watch Training Video\";\n $template = \"training_video_reminder\";\n $format = \"both\";\n $to=$row['BusinessOwner']['email'];\n $emailLib->sendEmail($to,$subject,array('username'=>$row['BusinessOwner']['fname'].' '.$row['BusinessOwner']['lname']),$template,$format);\n }\n }\n }" ]
[ "0.663524", "0.6576301", "0.6575173", "0.64940906", "0.6465172", "0.64550817", "0.6433844", "0.61871636", "0.6137348", "0.60382515", "0.6014247", "0.59998655", "0.59975594", "0.5991292", "0.5938109", "0.59254724", "0.59186965", "0.59120363", "0.5889213", "0.58774793", "0.586262", "0.58344287", "0.5806429", "0.58041257", "0.57939076", "0.5774124", "0.5733182", "0.570698", "0.56976163", "0.56968737" ]
0.6727499
0
InviteHistoryHandler::isMemberJoined() To check whether the user joined or not
public function isMemberJoined($email='') { $sql = 'SELECT user_name, first_name, last_name, user_id'. ' FROM '.$this->CFG['db']['tbl']['users']. ' WHERE email='.$this->dbObj->Param($email). ' AND usr_status=\'Ok\' LIMIT 1'; $stmt = $this->dbObj->Prepare($sql); $rs = $this->dbObj->Execute($stmt, array($email)); if (!$rs) trigger_db_error($this->dbObj); $user_details = array(); if ($rs->PO_RecordCount()) { $user_details = $rs->FetchRow(); } return $user_details; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isMember(): bool\n {\n return !is_null($this->group_id);\n }", "public function testIsMember()\n {\n $this->assertFalse($this->user->isMember());\n\n $subscribed = $this->subscribedUser();\n\n // our subscribed user is a member\n $this->assertTrue($subscribed->isMember());\n }", "public function isMember()\n {\n if ($this->hasRole('ROLE_ADMIN')) {\n return true;\n }\n\n return $this->getEndDate() > new \\DateTime();\n }", "public function canBeJoined(): bool\n {\n return $this->_canBeJoined;\n }", "public function isMember()\n {\n return $this->role == 3;\n }", "function is_member_logged_in()\n\t{\n\t\tif(isset($_SESSION['member']['au_id']))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public function isMember()\n {\n return $this->affiliation != self::AFFILIATION_OUTCAST;\n }", "function cs_is_member($users_id)\r\n{\r\n\tsettype($users_id, 'integer');\r\n\t\r\n\tif ($users_id <= 0)\r\n\t\treturn false;\r\n\t\r\n\t$where = 'm.users_id = '.$users_id.' AND us.users_delete = 0 AND us.users_active = 1 AND sq.clans_id = 1';\r\n\t$count = cs_sql_count(__FILE__, 'members m LEFT JOIN {pre}_users us ON m.users_id = us.users_id LEFT JOIN {pre}_squads sq ON m.squads_id = sq.squads_id', $where);\r\n\t\r\n\tif ($count > 0)\r\n\t\treturn true;\r\n\t\r\n\treturn false;\r\n}", "function is_member_login() {\n\t\t$cm_account = $this->get_account_cookie(\"member\");\n\t\tif ( !isset($cm_account['id']) || !isset($cm_account['username']) || !isset($cm_account['password']) || !isset($cm_account['onlinecode']) ) {\n\t\t\treturn false;\n\t\t}\n\t\t// check again in database\n\t\treturn $this->check_account();\n\t}", "function _s_is_member() {\n\treturn current_user_can( 'read' ) ? true : false;\n}", "public function isUserMember($group, $user_id)\n\t{\n\t\t$isJoined = DB::select(\"select user_id from group_user where user_id = $user_id and group_id = $group->id\");\n\n\t\tif (!empty($isJoined)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function isHasInvited()\n {\n return $this->hasInvited;\n }", "public function list_members() {\n\n\t\t//ignored users\n\t\t$stm = $this->db()->prepare('select \"to_big\" from \"member_settings\" where \"from_big\" = :current_member_big and \"chat_ignore\" = 1');\n\t\t$stm->execute(array(\n\t\t\t':current_member_big'\t=> $this->member_big,\n\t\t));\n\t\t$ignored_members_raw = $stm->fetchAll(PDO::FETCH_ASSOC);\n\t\t$ignored_members = array(0);\n\t\tforeach($ignored_members_raw as $member) {\n\t\t\t$ignored_members[] = $member['to_big'];\n\t\t}\n\t\t$ignored_members = implode(',', $ignored_members);\n\n\t\t//joined users\n\t\t$stm = $this->db()->prepare(\n\t\t\t'select distinct on (m.big) \"m\".\"big\", \"m\".\"name\"||\\' \\'||substring(\"m\".\"surname\" from 1 for 1)||\\'.\\' as \"name\", (case when \"c\".\"physical\"=1 then \\'onsite\\' else \\'online\\' end) as \"status\"\n\t\t\tfrom \"checkins\" \"c\"\n\t\t\t\tleft join \"members\" \"m\" on (\"c\".\"member_big\" = \"m\".\"big\")\n\t\t\twhere (\"c\".\"checkout\" is null or \"c\".\"checkout\" > now())\n\t\t\t\tand \"c\".\"event_big\" = (select \"event_big\" from \"checkins\" where \"member_big\" = :member_big and (\"checkout\" is null or \"checkout\" > now()) order by \"created\" desc limit 1)\n\t\t\t\tand (\"m\".\"last_web_activity\" > :online_timeout or \"m\".\"last_mobile_activity\" > :online_timeout)\n\t\t\t\tand \"m\".\"big\" != :member_big\n\t\t\t\tand \"m\".\"big\" not in ('.$ignored_members.')\n\t\t\torder by m.big, \"c\".\"created\" asc'\n\t\t);\n\t\t$stm->execute(array(\n\t\t\t':member_big'\t\t=> $this->member_big,\n\t\t\t':online_timeout'\t=> date('c', strtotime(ONLINE_TIMEOUT)),\n\t\t));\n\t\t$joined_members = $stm->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t$joined_member_bigs = array(0);\n\t\tforeach($joined_members as $member) {\n\t\t\t$joined_member_bigs[] = $member['big'];\n\t\t}\n\t\t$joined_member_bigs = implode(',', $joined_member_bigs);\n\n\t\t//users we already had conversation with\n\t\t$stm = $this->db()->prepare(\n\t\t\t'select distinct on (m.big) \"m\".\"big\", \"m\".\"name\"||\\' \\'||substring(\"m\".\"surname\" from 1 for 1)||\\'.\\' as \"name\",\n\t\t\t\t(case when (\"m\".\"last_web_activity\" > :online_timeout or \"m\".\"last_mobile_activity\" > :online_timeout) then \\'online\\' else \\'offline\\' end) as \"status\"\n\t\t\tfrom \"member_rels\" \"r\"\n\t\t\t\tleft join \"members\" \"m\" on (\"m\".\"big\" = (case when \"r\".\"member1_big\"=:member_big then \"r\".\"member2_big\" else \"r\".\"member1_big\" end))\n\t\t\t\tleft join \"chat_messages\" as \"cm\" on (\"cm\".\"rel_id\" = \"r\".\"id\" and (case when \"cm\".\"from_big\"=:member_big then \"cm\".\"from_status\" else \"cm\".\"to_status\" end) = 1)\n\t\t\twhere \"m\".\"big\" != :member_big\n\t\t\t\tand (r.member1_big = :member_big OR r.member2_big = :member_big)\n\t\t\t\tand \"m\".\"big\" not in ('.$ignored_members.','.$joined_member_bigs.')\n\t\t\t\tand \"cm\".\"id\" > 0\n\t\t\torder by m.big'\n\t\t);\n\t\t$stm->execute(array(\n\t\t\t':member_big'\t\t=> $this->member_big,\n\t\t\t':online_timeout'\t=> date('c', strtotime(ONLINE_TIMEOUT)),\n\t\t));\n\t\t$history_members = $stm->fetchAll(PDO::FETCH_ASSOC);\n\n\t\tforeach($joined_members as $key=>$val) {\n\t\t\t$joined_members[$key]['img'] = ProfilePicture::get_resized($val['big'], 28, 28);\n\t\t}\n\n\t\tforeach($history_members as $key=>$val) {\n\t\t\t$history_members[$key]['img'] = ProfilePicture::get_resized($val['big'], 28, 28);\n\t\t}\n\n\n\t\treturn $this->reply(array(\n\t\t\t'joined' => $joined_members,\n\t\t\t'history' => $history_members,\n\t\t));\n\n\t}", "function is_user_member_of($db, $group_id)\n{\n global $current_user;\n if ($current_user === NULL) {\n return False;\n }\n\n $records = exec_sql_query(\n $db,\n \"SELECT id FROM memberships WHERE (group_id = :group_id) AND (user_id = :user_id);\",\n array(\n ':group_id' => $group_id,\n ':user_id' => $current_user['id']\n )\n )->fetchAll();\n if ($records) {\n return True;\n } else {\n return False;\n }\n}", "function isLeagueMember(\n $user_id,\n $change_to_league, \n &$ref_status_text = ''\n){\n $mysql = \"\n select 88 as ismember\n from users\n where id = ?\n and league_id like concat('%-',?,'-%')\";\n \n $junk = 0;\n $is_member = false;\n $ref_status_text = '';\n while (1) {\n if (!$ans = runSql($mysql, array(\"ii\",$user_id, $change_to_league), 0, $ref_status_text)) {\n if ($ans === false) {\n break;\n }\n if ($ans === null) {\n $is_member = null;\n break;\n }\n }\n\n if (sizeof($ans) == 1) {\n $junk = $ans[0]['ismember'];\n $is_member = ($junk == 88) ? true : false;\n }\n \n $status = 1;\n break;\n }\n return $is_member;\n}", "public function canJoin($user_guid = 0){\n\n\t\t$result = false;\n\n\t\tif(empty($user_guid)){\n\t\t\t$user_guid = elgg_get_logged_in_user_guid();\n\t\t}\n\n\t\tif($user = get_user($user_guid)){\n\t\t\tif(!$this->isUser($user_guid)){\n\t\t\t\t// can join only returns true if you are not yet a member\n\t\t\t\tif($user->isAdmin() && empty($this->limit_admins)){\n\t\t\t\t\t// admin can join if not a private site\n\t\t\t\t\t$result = true;\n\t\t\t\t} else {\n\t\t\t\t\t// current membership\n\t\t\t\t\t$membership = $this->getMembership();\n\n\t\t\t\t\tswitch($membership){\n\t\t\t\t\t\tcase self::MEMBERSHIP_OPEN:\n\t\t\t\t\t\t\t// everyone can join\n\t\t\t\t\t\t\t$result = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase self::MEMBERSHIP_APPROVAL:\n\t\t\t\t\t\t\t// only after approval\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase self::MEMBERSHIP_DOMAIN:\n\t\t\t\t\t\tcase self::MEMBERSHIP_DOMAIN_APPROVAL:\n\t\t\t\t\t\t\t// based on email domain\n\t\t\t\t\t\t\tif($this->validateEmailDomain($user_guid)){\n\t\t\t\t\t\t\t\t$result = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase self::MEMBERSHIP_INVITATION:\n\t\t\t\t\t\t\t// if an outstanding invitation is available you can also join\n\t\t\t\t\t\t\t// this is NOT related to a membership type\n\t\t\t\t\t\t\tif($this->hasInvitation($user_guid, $user->email)){\n\t\t\t\t\t\t\t\t$result = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!$result && $this->hasInvitation($user_guid, $user->email)){\n\t\t\t\t\t\t// if user has been invited he can always join\n\t\t\t\t\t\t$result = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "public function isUttMember()\n\t{\n\t\treturn $this->isUser() && ! $this->user->getIsStudent() && ! $this->user->getKeepActive();\n\t}", "public function isMember(): bool\n {\n return $this->getType() === static::TYPE_MEMBER;\n }", "public function isActiveMember(Users $user)\n {\n }", "public function isJoin();", "public function memberJoin(Group $group, Member $member, $status = 'In')\n {\n if (!is_object($group) || !is_object($member) || !($member_id = $member->getPKValue()) || !($group_id = $group->getPKValue()))\n {\n return false;\n }\n\n // only bother if member is not already ... a member \n if (!$this->isMember($group, $member, false))\n {\n $this->Status = $this->dao->escape($status);\n $this->IdGroup = $group_id;\n $this->IdMember = $member_id;\n $this->created = date('Y-m-d H:i:s');\n\n return $this->insert();\n }\n else\n {\n return false;\n }\n }", "function IsLoggedIn() {\t\tif( Member::currentUserID() ) {\r\n\t\t return true;\r\n\t\t}\r\n }", "public function isAlive($member)\n {\n return in_array($member, $this->population);\n }", "public function getVisitorIsLeaderAttribute()\n\t{\n\t\treturn in_array($this -> visitor -> id,$this -> members()->where('leader', true)->lists('gamer_id'));\n\t}", "private static function existingUser($invite, $auth) {\n // double check not already a member\n $existing = data_entry_helper::get_population_data(array(\n 'table' => 'groups_user',\n 'extraParams' => $auth['read'] + array(\n 'user_id' => hostsite_get_user_field('indicia_user_id'),\n 'group_id' => $invite['group_id']\n ),\n 'nocache'=>true\n ));\n return count($existing) > 0;\n }", "function isMember($user_id)\n\t{\n\t\t//get admin id\n\t\t$this->db->where('role', 1);\t\t\t\t\t\n\t\t$query = $this->db->get('users');\n\t\t$admin=$query->row();\n\t\tif($user_id == $admin->id)\n\t\t\treturn true;\n\t\t\t\n\t\t// get user that purchased membership\n\t\t$this->db->where('user_id', $user_id);\t\t\t\t\t\n\t\t$query = $this->db->get($this->table);\n\n\t\tif($query->num_rows())\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "function is_joinable($group, $uid = NULL, $gen_err = FALSE) {\n if (!$uid)\n $uid = userid();\n\n $group_id = $group['group_id'];\n if ($this->is_member($uid, $group['group_id'])) {\n if ($gen_err)\n e(lang('grp_join_error'));\n return false;\n }elseif ($group['group_privacy'] != 2 || $this->is_invited($uid, $group_id, $group['userid'], $gen_err))\n return true;\n else\n return false;\n }", "function db_user_is_member_of_group($username, $groupname, $snuuid)\n{\n\t$sql = \"SELECT creation FROM group_members\n\t\tWHERE username=$1\n\t\tAND groupname=$2\n\t\tAND snuuid=$3\";\n\t$res = pg_query_params($sql, array($username, $groupname, $snuuid));\n\treturn pg_num_rows($res) != 0;\n}", "public function memberIsLoggedIn()\n {\n return $_SESSION['__COMMENTIA__']['member_is_logged_in'];\n }", "function isMemberOfThisGroup($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()) {\n \n\t\t$db = new db_util();\n\n\t $sql = \"SELECT * \n\t FROM vm_member_list \n\t WHERE vm_member_id='$_c_user_id' \n\t AND vm_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}" ]
[ "0.6442646", "0.6409622", "0.63284385", "0.63198924", "0.6259398", "0.6170694", "0.6145514", "0.61159366", "0.60940576", "0.60573983", "0.60070693", "0.5986187", "0.59171396", "0.5907632", "0.5812757", "0.5812118", "0.57648396", "0.57516885", "0.57339704", "0.57111645", "0.5704592", "0.56752586", "0.56617665", "0.56560796", "0.5654972", "0.563452", "0.5632064", "0.5610368", "0.5608547", "0.55794424" ]
0.67171586
0
get DeveloperID from GBID
function getDeveloperByGBID($GBID) { $query = $this->db->get_where('developers', array('GBID' => $GBID)); if($query->num_rows() == 1) { return $query->first_row(); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDeveloper_id()\n {\n return $this->developer_id;\n }", "public function getVendorId() {}", "function getDevId()\n {\n return $this->_props['DevId'];\n }", "public function getOGApplicationID();", "public function getDeveloperKey();", "function GET_APP_ID(){\n return \"7d0df388-f064-48eb-9092-27fbbf0a438e\";\n}", "public function getIosVendorId();", "public function getUserIdentifier(): string\n {\n return ($this->token ?? ($this->appkey ?? ''));\n }", "public function getGid()\n {\n return $this->Gid;\n }", "public function getGplusIdentifier()\n {\n return $this->_getIdentifier('gplus');\n }", "public function obtenerID();", "public function getUserGcmRegId() {\n $stmt = $this->conn->prepare(\"SELECT gcm_registration_id FROM app_users\");\n // $stmt->bind_param(\"s\", $api_key);\n $stmt->execute();\n $user_gcm = $stmt->get_result();\n $stmt->close();\n return $user_gcm;\n }", "public function getVendorId(): ?string;", "public function getDeveloperFromDatabase($GBID, $userID)\n {\n // get developer from db\n $this->db->select('developers.DeveloperID, developers.GBID, developers.GBLink, developers.Name, developers.Image, developers.ImageSmall, developers.Deck');\n $this->db->from('developers');\n\n if ($userID == null) {\n $userID = 0; // prevents joining on UserID causing an error\n }\n\n // $this->db->join('collections', 'collections.DeveloperID = developers.DeveloperID AND collections.UserID = ' . $userID, 'left');\n // $this->db->join('lists', 'collections.ListID = lists.ListID', 'left');\n\n $this->db->where('developers.GBID', $GBID);\n $query = $this->db->get();\n\n // if developer returned\n if ($query->num_rows() == 1) {\n $result = $query->first_row();\n\n $this->developerID = $result->DeveloperID;\n $this->GBID = $result->GBID;\n $this->GBLink = $result->GBLink;\n $this->name = $result->Name;\n $this->image = $result->Image;\n $this->imageSmall = $result->ImageSmall;\n $this->deck = $result->Deck;\n\n return true;\n }\n \n return false;\n }", "public function getPersonGuid();", "public function getUserIdentifier(): string\n {\n return (string)$this->key_hash;\n }", "public function getOGAdminID();", "public function getAuthIdentifier();", "function getVendorId($vendor_name)\n\t{\n\t\t global $log;\n $log->info(\"in getVendorId \".$vendor_name);\n\t\tglobal $adb;\n\t\tif($vendor_name != '')\n\t\t{\n\t\t\t$sql = \"select vendorid from ec_vendor where vendorname='\".$vendor_name.\"'\";\n\t\t\t$result = $adb->query($sql);\n\t\t\t$vendor_id = $adb->query_result($result,0,\"vendorid\");\n\t\t}\n\t\treturn $vendor_id;\n\t}", "public function getBillingProfileId();", "public function getUserIdentifier()\n {\n // that's why I am sending the id here\n return $this->id;\n }", "public function getID(): string {\n\t\treturn $this->appName;\n\t}", "public function get_gsaUid() {\n return $this->gsaUid;\n }", "public function getID()\n {\n return $this->billingId;\n }", "public function getGalleryProfileId(): string {\n\t\treturn ($this->galleryId);\n\t}", "public function getCgId()\n {\n return $this->cg_id;\n }", "public function getGaid();", "public function getOpenId()\n {\n }", "public function getGid()\n {\n $value = $this->get(self::GID);\n return $value === null ? (integer)$value : $value;\n }", "function GID($in_id, $in_db){\n\tglobal $knj_web;\n\t\n\tif ($knj_web[\"dbconn\"]){\n\t\treturn $knj_web[\"dbconn\"]->selectsingle($in_db, array($knj_web[\"col_id_name\"] => $in_id));\n\t}else{\n\t\t$sql = \"SELECT * FROM \" . $in_db . \" WHERE \" . $knj_web[\"col_id_name\"] . \" = '\" . sql($in_id) . \"' LIMIT 1\";\n\t\t$f_gid = mysql_query($sql) or die(\"MySQL-error: \" . mysql_error() . \"\\nSQL: \" . $sql);\n\t\t$d_gid = mysql_fetch_array($f_gid);\n\t}\n\t\n\treturn $d_gid;\n}" ]
[ "0.7028161", "0.6661588", "0.6655852", "0.6622608", "0.6590504", "0.639485", "0.6279953", "0.61893755", "0.6178754", "0.6047877", "0.6044135", "0.60317296", "0.59945005", "0.59556115", "0.59418285", "0.59312385", "0.5926804", "0.5908018", "0.58972555", "0.58352613", "0.5821468", "0.58112067", "0.57784474", "0.5771811", "0.5748632", "0.5741648", "0.57324046", "0.5718231", "0.57099456", "0.57053775" ]
0.6699714
1
returns developer if in db, or adds and returns it if it isn't
function getOrAddDeveloper($gbDeveloper) { // get developer from db $developer = $this->getDeveloperByGBID($gbDeveloper->id); // if developer isn't in db if($developer == null) { // developer was not found, get from Giant Bomb $this->load->model('GiantBomb'); $result = $this->GiantBomb->getMeta($gbDeveloper->id, "company"); // if developer was returned if ($result != null && $result->error == "OK" && $result->number_of_total_results > 0) { // add developer to database $this->addDeveloper($result->results); } else { // developer was not found return false; } // get developer from db $developer = $this->getDeveloperByGBID($gbDeveloper->id); } return $developer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addDeveloper($developer)\n {\n $data = array(\n 'GBID' => $developer->id,\n 'Name' => $developer->name,\n 'API_Detail' => $developer->api_detail_url,\n 'GBLink' => $developer->site_detail_url,\n 'Image' => is_object($developer->image) ? $developer->image->small_url : null,\n 'ImageSmall' => is_object($developer->image) ? $developer->image->icon_url : null,\n 'Deck' => $developer->deck\n );\n\n return $this->db->insert('developers', $data); \n }", "abstract function is_developer();", "public function hasdeveloper()\n {\n return $this->hasuser() && $this->user()->isdeveloper();\n }", "public function getDeveloper_id()\n {\n return $this->developer_id;\n }", "function getDeveloper() \n {\n return $this->_developer;\n }", "public function developer()\n {\n return $this->belongs_to('Developer');\n }", "function registerToDatabase() {\n\t\t\tif ($this->id != null && $this->id != 0) return false;\n\n\t\t\t$this->conn = connectToDb(\"db_avalanche_store\");\n\n\t\t\t$add_query = \"INSERT INTO tbl_dev_info \n\t\t\t(user_id, \n\t\t\t dev_name,\t\n\t\t\t dev_desc) \n\t\t\tVALUES \n\t\t\t('$this->dev_id', \n\t\t\t '$this->dev_name',\t\n\t\t\t '$this->dev_description');\";\n\n\t\t\t$result = $this->conn->query($add_query);\n\n\t\t\t$this->conn->close();\n\n\t\t\tif (!$result) return false;\n\n\t\t\treturn true;\n\t\t}", "function addToDatabase() {\n\t\tif ($this->id != null && $this->id != 0) return false;\n\n\t\t$db = getDb();\n\n\t\t$add_query = \"INSERT INTO user_table \n\t\t(user_name, \n\t\t user_password,\t\n\t\t isAdmin,\t\n\t\t user_first_name,\n\t\t user_last_name) \n\t\tVALUES \n\t\t('$this->username', \n\t\t '$this->password',\t\n\t\t '$this->isAdmin',\t\n\t\t '$this->firstName',\t\n\t\t '$this->lastName');\";\n\n\t\t$result = mysqli_query($db, $add_query);\n\n\t\tmysqli_close($db);\n\n\t\tif (!$result) return false;\n\n\t\treturn true;\n\n\t}", "public function getDeveloperFromDatabase($GBID, $userID)\n {\n // get developer from db\n $this->db->select('developers.DeveloperID, developers.GBID, developers.GBLink, developers.Name, developers.Image, developers.ImageSmall, developers.Deck');\n $this->db->from('developers');\n\n if ($userID == null) {\n $userID = 0; // prevents joining on UserID causing an error\n }\n\n // $this->db->join('collections', 'collections.DeveloperID = developers.DeveloperID AND collections.UserID = ' . $userID, 'left');\n // $this->db->join('lists', 'collections.ListID = lists.ListID', 'left');\n\n $this->db->where('developers.GBID', $GBID);\n $query = $this->db->get();\n\n // if developer returned\n if ($query->num_rows() == 1) {\n $result = $query->first_row();\n\n $this->developerID = $result->DeveloperID;\n $this->GBID = $result->GBID;\n $this->GBLink = $result->GBLink;\n $this->name = $result->Name;\n $this->image = $result->Image;\n $this->imageSmall = $result->ImageSmall;\n $this->deck = $result->Deck;\n\n return true;\n }\n \n return false;\n }", "function addMerchant($vars){\n\tglobal $db;\n\t//should do some kind of security checks to prevent duplicate entries...(not in scope)\n\t$id = $db->insert('merchants', $vars);\n\tif($id){\n\t\t//return id merchantid\n\t\treturn $id;\n\t}else{\n\t\treturn false;\n\t}\n\t\n}", "private function add_record_or_update_record() {\n\t\t\t$this->before_custom_save();\n\t\t\t$this->before_save();\n\t\t\tif($this->new_record) {\n\t\t\t\t$this->before_create();\n\t\t\t\t$result = $this->add_record();\n\t\t\t\t$this->after_create();\n\t\t\t} else {\n\t\t\t\t$this->before_update();\n\t\t\t\t$result = $this->update_record();\n\t\t\t\t$this->after_update();\n\t\t\t}\n\t\t\t$this->after_save();\n\n\t\t\t// init user custom cache\n\t\t\tif (is_array($this->cache)) {\n\t\t\t\t$this->rebuild_cache();\n\t\t\t}\n\n\t\t\tif($this->blob_fields) {\n\t\t\t\t$this->update_blob_fields();\n\t\t\t}\n\t\t\treturn $result;\n\t\t}", "public function is_developer() {\n\t\treturn $this->user->exists() && in_array(self::DEVELOPER_ROLE_NAME, $this->user->roles);\n\t}", "public function isDeveloper()\r\n\t{\r\n\t\t\treturn count($this->getDeveloperProfiles()) > 0;\r\n\t}", "public function hasUseradditem(){\n return $this->_has(24);\n }", "function getDeveloper($bugid, $patch, $revision = false)\n\t{\n\t\tif ($revision) {\n\t\t\treturn $this->_dbh->prepare('\n\t\t\t\tSELECT developer\n\t\t\t\tFROM bugdb_patchtracker\n\t\t\t\tWHERE bugdb_id = ? AND patch = ? AND revision = ?\n\t\t\t')->execute([$bugid, $patch, $revision])->fetchOne();\n\t\t}\n\t\treturn $this->_dbh->prepare('\n\t\t\tSELECT developer, revision\n\t\t\tFROM bugdb_patchtracker\n\t\t\tWHERE bugdb_id = ? AND patch = ? ORDER BY revision DESC\n\t\t')->execute([$bugid, $patch])->fetchAll(PDO::FETCH_ASSOC);\n\t}", "function sql_addCustomer($kunde){\r\n\t\t\r\n\t\tglobal $database;\r\n\t\t$id = $database->insert(\"kunden\", [\r\n\t\t\t\t\"name\" => $kunde\r\n\t\t]);\r\n\t\t\r\n\t\treturn $id;\r\n\t\t\r\n\t}", "function add_customer()\n\t{\n\t\t$table = \"customer\";\n\t\t$where = \"customer_email = '\".$this->input->post('user_email').\"'\";\n\t\t$items = \"customer_id\";\n\t\t$order = \"customer_id\";\n\t\t\n\t\t$result = $this->select_entries_where($table, $where, $items, $order);\n\t\t\n\t\tif(count($result) > 0)\n\t\t{\n\t\t\t$customer_id = $result[0]->customer_id;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data = array(\n\t\t\t\t'customer_email'=>$this->input->post('user_email'),\n\t\t\t\t'customer_name'=>$this->input->post('seller_name'),\n\t\t\t\t'customer_phone'=>$this->input->post('user_phone')\n\t\t\t);\n\t\t\t\n\t\t\t$table = \"customer\";\n\t\t\t$customer_id = $this->insert($table, $data);\n\t\t}\n\t\t\n\t\treturn $customer_id;\n\t}", "function add_customer($params){\n $this->company_db->insert('tbl_customer', $params);\n return $this->company_db->insert_id();\n }", "function canAdd($user) {\n return $user->isPeopleManager();\n }", "function add_product($product){\n if($this->_check_product_in_db($product)){\n return False; // Product already in database\n }else{\n array_push($this->db, $product);\n return True;\n }\n }", "public function add( $name, $owner = 0 ) {\r\r\n global $wpdb;\r\r\n\r\r\n $this->refresh = true;\r\r\n $data = wd_asp()->options['asp_defaults'];\r\r\n $data['owner'] = intval($owner);\r\r\n\r\r\n if (\r\r\n $wpdb->query(\r\r\n \"INSERT INTO \" . wd_asp()->db->table('main') . \"\r\r\n (name, data) VALUES\r\r\n ('\" . esc_sql($name) . \"', '\" . wd_mysql_escape_mimic(json_encode($data)) . \"')\"\r\r\n ) !== false\r\r\n ) return $wpdb->insert_id;\r\r\n\r\r\n return false;\r\r\n }", "function v1_check_db_simple($name, $key, $code, $owners) {\n\t\n\tglobal $warnings;\n\t\n\t// If already in database, send a warning\n\t$id=v1_get_id($key, $code, $owners);\n\t\n\tif (!empty($id)) {\n\t\t// Warning: already in database\n\t\t$warning_msg=$name.\" code=\\\"\".$code.\"\\\"\";\n\t\t// 1st owner\n\t\tif (!empty($owners[0])) {\n\t\t\t$warning_msg.=\" owner1=\\\"\".$owners[0]['code'].\"\\\"\";\n\t\t}\n\t\t// 2nd owner\n\t\tif (!empty($owners[1])) {\n\t\t\t$warning_msg.=\" owner2=\\\"\".$owners[1]['code'].\"\\\"\";\n\t\t}\n\t\t// 3rd owner\n\t\tif (!empty($owners[2])) {\n\t\t\t$warning_msg.=\" owner3=\\\"\".$owners[2]['code'].\"\\\"\";\n\t\t}\n\t\tarray_push($warnings, $warning_msg);\n\t}\n\t\n}", "function add(){\n\t\t\tif(!is_super_admin_login())\n\t\t\t\treturn $this->vista->acceso_restringido();\n if(!empty($this->params['programa'])){\n TPrograma::add($this->params['programa']);\n }\n }", "function add_voucher_customer($data)\n\t{\n\t\t$this->db->insert('customer_voucher', $data);\n\t\t//return $this->db->insert_id(); // this is only for auto increment\n\t\treturn $this->db->affected_rows();\t\t\n\t}", "function isDeveloperInDB($GBID)\n {\n $query = $this->db->get_where('developers', array('GBID' => $GBID));\n\n return $query->num_rows() > 0 ? true : false;\n }", "function addC(){\n \t$re = new DbManager();\n \t$result = $re -> addColumn();\n \tif ($result == true){\n \t\techo 'colone bien ajouter ';\n \t}\n }", "function addUser($userInfo){\n $this->db->trans_start();\n $this->db->insert('Users', $userInfo);\n\n $insert_id = $this->db->insert_id();\n\n $this->db->trans_complete();\n\n return $insert_id;\n }", "function isAddable(){\n return VM_manager_here;\n }", "function addSignupUser($user) {\n\t$ret = false;\n\t// print_r($user);\n\t$sql = \"INSERT INTO customer (name, phone, position, company, shop) values (\".\n\t\t\"'$user->name', '$user->phone', '$user->position', '$user->company', '$user->shop')\";\n\tmysql_query($sql);\n\tif(mysql_insert_id()) {\n\t\t$ret = true;\n\t}\n\treturn $ret;\n}", "function updateExternalDB($user) {\r\n\t\t// Not doing anything here (yet?)\r\n\t\treturn true;\r\n\t}" ]
[ "0.6750118", "0.61055195", "0.60061026", "0.5925797", "0.5872146", "0.5800288", "0.5493585", "0.5472753", "0.5423313", "0.54073495", "0.5304799", "0.53044593", "0.5299693", "0.5227754", "0.51487607", "0.50664824", "0.50611484", "0.5041275", "0.5038148", "0.49967074", "0.49835217", "0.4976966", "0.49590477", "0.49525872", "0.4949477", "0.49469018", "0.49456632", "0.49383593", "0.49271882", "0.4910615" ]
0.7040459
0
add developer to database
function addDeveloper($developer) { $data = array( 'GBID' => $developer->id, 'Name' => $developer->name, 'API_Detail' => $developer->api_detail_url, 'GBLink' => $developer->site_detail_url, 'Image' => is_object($developer->image) ? $developer->image->small_url : null, 'ImageSmall' => is_object($developer->image) ? $developer->image->icon_url : null, 'Deck' => $developer->deck ); return $this->db->insert('developers', $data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function registerToDatabase() {\n\t\t\tif ($this->id != null && $this->id != 0) return false;\n\n\t\t\t$this->conn = connectToDb(\"db_avalanche_store\");\n\n\t\t\t$add_query = \"INSERT INTO tbl_dev_info \n\t\t\t(user_id, \n\t\t\t dev_name,\t\n\t\t\t dev_desc) \n\t\t\tVALUES \n\t\t\t('$this->dev_id', \n\t\t\t '$this->dev_name',\t\n\t\t\t '$this->dev_description');\";\n\n\t\t\t$result = $this->conn->query($add_query);\n\n\t\t\t$this->conn->close();\n\n\t\t\tif (!$result) return false;\n\n\t\t\treturn true;\n\t\t}", "public function addToDb()\n {\n\n // make sure this is a valid new entry\n if ($this->isValid()) {\n // check for duplicate\n $vals = sprintf(\"('%s',%d)\",$this->email,$this->level);\n $sql = \" insert into Admins values $vals\";\n Dbc::getReader()->Exec($sql);\n }\n else\n print \"<br> Invalid entry. STOP! ($sql)<br>\";\n }", "function augmentDatabase() {\r\n\t}", "function cmst_vendor_add() {\n\t\tglobal $conn;\n\n\t\t// Initialize table object\n\t\t$GLOBALS[\"mst_vendor\"] = new cmst_vendor();\n\n\t\t// Intialize page id (for backward compatibility)\n\t\tif (!defined(\"EW_PAGE_ID\"))\n\t\t\tdefine(\"EW_PAGE_ID\", 'add', TRUE);\n\n\t\t// Initialize table name (for backward compatibility)\n\t\tif (!defined(\"EW_TABLE_NAME\"))\n\t\t\tdefine(\"EW_TABLE_NAME\", 'mst_vendor', TRUE);\n\n\t\t// Open connection to the database\n\t\t$conn = ew_Connect();\n\t}", "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 addOnDB() {\n\t\t\t$db = mysqli_connect($GLOBALS['host'], $GLOBALS['username'], $GLOBALS['password'], $GLOBALS['dbname']);\n\t\t\t\n\t\t\t$format = \"INSERT INTO `user` \n\t\t\t\t(`username`, `password`, `fullname`, `birthplace`, `birthdate`, `email`, `avatar`) VALUES \n\t\t\t\t('%s', '%s', '%s', '%s', '%s', '%s', '%s');\";\n\t\t\t$stmt = sprintf($format, $this->username, $this->password, $this->fullname, $this->birthplace, $this->birthdate,\n\t\t\t\t$this->email, $this->avatar_path);\n\t\t\t$result = mysqli_query($db, $stmt);\n\t\t\t\n\t\t\t$db->close();\n\t\t}", "function addC(){\n \t$re = new DbManager();\n \t$result = $re -> addColumn();\n \tif ($result == true){\n \t\techo 'colone bien ajouter ';\n \t}\n }", "public function addDB()\n {\n $this->model->addDB();\n header('location:index.php?controller=user');\n }", "public function insertDatabase();", "abstract function is_developer();", "function addToDatabase() {\n\t\tif ($this->id != null && $this->id != 0) return false;\n\n\t\t$db = getDb();\n\n\t\t$add_query = \"INSERT INTO user_table \n\t\t(user_name, \n\t\t user_password,\t\n\t\t isAdmin,\t\n\t\t user_first_name,\n\t\t user_last_name) \n\t\tVALUES \n\t\t('$this->username', \n\t\t '$this->password',\t\n\t\t '$this->isAdmin',\t\n\t\t '$this->firstName',\t\n\t\t '$this->lastName');\";\n\n\t\t$result = mysqli_query($db, $add_query);\n\n\t\tmysqli_close($db);\n\n\t\tif (!$result) return false;\n\n\t\treturn true;\n\n\t}", "function addItemToDB()\n {\n $this->database->addItemToDB($this);\n }", "public function add(){\n $tab = DB::table('student');\n $res = $tab -> insert(['name' => '小黑', 'age' => '18']);\n }", "public function addDB()\n {\n $this->model->addDB();\n header('location:index.php?controller=new');\n }", "public function insert($vendor);", "public function addDatabase($database) {\n\t\t$this->databases[$databases->getDatabaseName()] = $databases;\n\t}", "public function insertContributor($data){\r\n $this->insert($data);\r\n }", "public function run()\n {\n sysuser::insert([\n 'uname' => 'dani123',\n 'namalengkap' => 'daniframdhana',\n 'email' => '[email protected]',\n 'upass' => sha1('admin')\n ]);\n }", "function add_data_admin($data_admin)\n\t\t{\n\t\t\t$this->db->insert('admin', $data_admin);\n\t\t}", "public function run()\n {\n DB::table('environments')->insert([ 'name' => 'Environment1', 'description' => 'Description1']);\n }", "private function _install() {\r\n// `id` int(11) NOT NULL,\r\n// `language_id` int(11) NOT NULL,\r\n// `human_name` mediumtext NOT NULL,\r\n// `machine_name` varchar(255) NOT NULL,\r\n// `is_active` enum('0','1') NOT NULL,\r\n// PRIMARY KEY(`id`)\r\n// ) ENGINE=InnoDB DEFAULT CHARSET=utf8;\r\n// CREATE TABLE IF NOT EXISTS `security_attributes_values` (\r\n// `id` int(11) NOT NULL,\r\n// `user_id` int(11) NOT NULL,\r\n// `attribute_id` int(11) NOT NULL,\r\n// `value` mediumtext NOT NULL,\r\n// PRIMARY KEY(`id`)\r\n// ) ENGINE=InnoDB DEFAULT CHARSET=utf8;\r\n }", "function add_membre($data, $database = false) {\n if (!$database) {\n $database = get_database(); \n }\n if (isset($data[\"name\"], $data[\"password\"])) {\n $database[] = $data;\n change_database($database);\n }\n}", "protected function setUpDatabase($app)\n {\n\n }", "public function setUpDatabase()\n\t{\n\t\t$schemes = new Schemes;\n\t\t$schemes->createRequestTable();\n\n\t Customer::create([\n\t 'email' => '[email protected]',\n\t 'first_name' => 'Osuagwu',\n\t 'last_name' => 'Emeka',\n\t 'phone_number' => \"09095685594\",\n\t 'image' => 'https://github.com/rakit/validation',\n\t 'location' => 'Lagos, Nigeria',\n\t 'sex' => 'Male',\n\t ]);\n\n\t Customer::create([\n\t 'email' => '[email protected]',\n\t 'first_name' => 'Mustafa',\n\t 'last_name' => 'Ozyurt',\n\t 'phone_number' => \"09095685594\",\n\t 'image' => 'https://github.com/rakit/validation',\n\t 'location' => 'Berlin, Germany',\n\t 'sex' => 'Male',\n\t ]);\n\t}", "public function add() {\n\n $sql = \"INSERT INTO persona(id,nombre,apellido_paterno,apellido_materno,estado_salud,telefono,ubicacion)\n VALUES(null,'{$this->nombre}','{$this->apellido_paterno}','{$this->apellido_materno}',\n '{$this->estado_salud}','{$this->telefono}','{$this->ubicacion}')\";\n $this->con->consultaSimple($sql);\n }", "public function database() {\n\t\t$this->_check();\n\t\t$d['title_for_layout'] = __(\"Database creation\");\n\t\t$this->set($d);\n\t}", "public function install_module_register()\n {\n $this->EE->db->insert('modules', array(\n 'has_cp_backend' => 'y',\n 'has_publish_fields' => 'n',\n 'module_name' => ucfirst($this->get_package_name()),\n 'module_version' => $this->get_package_version()\n ));\n }", "public function addDB($key, $db){\n $this->db[$key]=$db;\n }", "function dbInstall($data) {\n/*\napp_vkbot - \n*/\n $data = <<<EOD\n app_vkbot: ID int(10) unsigned NOT NULL auto_increment\n app_vkbot: TITLE varchar(100) NOT NULL DEFAULT ''\n app_vkbot: COLOR varchar(255) NOT NULL DEFAULT ''\n app_vkbot: VAL varchar(255) NOT NULL DEFAULT ''\n app_vkbot: CODE varchar(255) NOT NULL DEFAULT ''\nEOD;\n parent::dbInstall($data);\n }", "public function addUserToDb($token) {\n\t\t\trequire_once('classes/canvasWrapper.php');\n\t\t\t$canvas = new CanvasWrapper();\n\t\t\t$user = $canvas->formatUserData();\n\t\t\t$sql = \"INSERT INTO users (osuId,token,name) VALUES (\" . $user->user_id . \",'\" . $token . \"','\" . $user->name . \"')\";\n\t\t\t$result = $this->db->query($sql);\n\t\t}" ]
[ "0.60217", "0.5969905", "0.58614874", "0.57840854", "0.5682054", "0.5603042", "0.55695295", "0.5543228", "0.54279214", "0.5363747", "0.53559154", "0.5355493", "0.5354834", "0.5351193", "0.5330794", "0.53240174", "0.5309294", "0.5276008", "0.527083", "0.5256675", "0.52309", "0.52068746", "0.520395", "0.5203395", "0.5203174", "0.5201173", "0.5192892", "0.519275", "0.5182321", "0.5176349" ]
0.7022394
0
Constructor. Initializes a new instance of the Control class.
function Control($name = "") { $this->Name = $name; $this->_state = WEB_CONTROL_CONSTRUCTED; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->setAdapter(new TJuiControlAdapter($this));\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->setAdapter(new TActiveControlAdapter($this));\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->setAdapter(new TActiveControlAdapter($this));\n\t}", "public function customize_controls_init()\n {\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->setAdapter(new TActiveControlAdapter($this));\n\t\t$this->getActiveControl()->setClientSide(new TActiveCustomValidatorClientSide);\n\t}", "function customize_controls_init()\n {\n }", "public function controls()\n {\n }", "public function __construct( $oMainControl ) {\n\t\tparent::__construct( $oMainControl );\n\t}", "public function setupControl()\n\t{\n\t\t$this->addText('referenceNumber', 'Reference number:');\n\t\t$this->addSelect('priority', 'Priority:', PriorityEnum::getOptions());\n\t\t$this->addTextArea('symptoms', 'Symptoms:', 40, 8)\n\t\t\t->addRule(Form::FILLED, 'Symptoms are required.');\n\t\t$this->addText('problemOwner', 'Problem owner:');\n\t\t$this->addSelect('status', 'State:', array(\n\t\t\tOperationProblem::STATUS_NEW => 'new',\n\t\t\tOperationProblem::STATUS_INVESTIGATED => 'investigated',\n\t\t\tOperationProblem::STATUS_RESOLVED => 'resolved',\n\t\t\tOperationProblem::STATUS_CLOSED => 'closed'\n\t\t));\n\n\t\t$this->addSelect('category', 'Category:', array('' => $this->noCategoryText) + $this->getCategoriesOptions());\n\n\t\t$this->addTextArea('onEventRaw', 'onEvent:');\n\n\t\t$this->addSubmit('save', 'Save problem');\n\n\t\t$this->onValidate[] = $this->onValidateForm;\n\t}", "protected function _construct()\n {\n $this->_controller = 'adminhtml_slider';\n $this->_blockGroup = 'Baniwal_OwlCarouselSlider';\n $this->_headerText = __('Sliders');\n $this->_addButtonLabel = __('Add New Slider');\n \n parent::_construct();\n }", "public function build_controls()\n\t{\n\t\t$this->add_control( 'title', [\n\t\t\t'label' => __( 'Title' )\n\t\t] );\n\t\t$this->add_control( 'content', [\n\t\t\t'label' => __( 'Content' ),\n\t\t\t'type' => 'textarea'\n\t\t] );\n\t\t$this->add_control( 'link_url', [\n\t\t\t'label' => __( 'URL' )\n\t\t] );\n\t\t$this->add_control( 'link_text', [\n\t\t\t'label' => __( 'Link Text' )\n\t\t] );\n\t\t$this->add_control( 'link_target', [\n\t\t\t'label' => __( 'Open link in a new window/tab' ),\n\t\t\t'type' => 'checkbox',\n\t\t\t'value' => '1'\n\t\t] );\n\t}", "function __construct() {\n\n\t\t// Widget Handle\n\t\t$this->ID = 'example-widget';\n\n\t\t// Widget Config\n\t\t$this->options = array(\n\t\t\t'name' => 'Example Widget', // Widget name\n\t\t\t'description' => 'Widget description.', // Widget description\n\t\t\t'classname' => 'projects-cycle-widget' // CSS class\n\t\t);\n\n\t\t// Default values for widget fields\n\t\t$this->defaults = array(\n\t\t\t'widget_title' => 'My Example Widget',\n\t\t\t'sample_field' => 'Some value'\n\t\t);\n\n\t\tparent::__construct();\n\n\t}", "protected function _construct()\n {\n parent::_construct();\n $this->setTemplate(self::TEMPLATE);\n }", "function getControl()\n\t{\n\t\treturn $this->control;\n\t}", "public function setControl($var)\n {\n GPBUtil::checkString($var, True);\n $this->control = $var;\n\n return $this;\n }", "public function setControl($var)\n {\n GPBUtil::checkString($var, True);\n $this->control = $var;\n\n return $this;\n }", "public function setControl($var)\n {\n GPBUtil::checkString($var, True);\n $this->control = $var;\n\n return $this;\n }", "public function __construct ($objParent, $strControlId = null) {\n\t\tparent::__construct($objParent, $strControlId);\n\n\t\tBootstrap::LoadJS($this);\n\t\t/*\n\n\t\tif ($this instanceof \\QTextBoxBase ||\n\t\t\t$this instanceof \\QListBox) {\n\t\t\t$this->AddCssClass (Bootstrap::FormControl);\n\t\t}\n\t\t*/\n\t}", "function ControlOnInit() {\n }", "protected function _construct()\n {\n parent::_construct();\n $this->_addButtonLabel = __('Add');\n }", "public function getControl()\n {\n return $this->control;\n }", "public function getControl()\n {\n return $this->control;\n }", "public function getControl()\n {\n return $this->control;\n }", "function controls()\n\t{\n\t}", "public function __construct(){\n // 表示部分で使うオブジェクトを作成\n $this->initDisplayObj();\n }", "public function __construct() {\n // 表示部分で使うオブジェクトを作成\n $this->initDisplayObj();\n }", "public function __construct($control, $onlyinternal = false) {\n\t\t$this->_control = $control;\n\t\t$this->_internalonly = $onlyinternal;\n\t}", "public function __construct($objParent, $strControlId = null)\n {\n parent::__construct($objParent, $strControlId);\n\n Bootstrap::loadJS($this);\n /*\n\n if ($this instanceof \\QCubed\\Control\\TextBoxBase ||\n $this instanceof \\QCubed\\Project\\Control\\ListBox) {\n $this->addCssClass(Bootstrap::FormControl);\n }\n */\n }", "public function __construct()\n {\n if (!$this->_addButtonLabel) {\n $this->_addButtonLabel = Mage::helper('adminhtml')->__('Add');\n }\n parent::__construct();\n if (!$this->getTemplate()) {\n $this->setTemplate('hipay/system/config/form/field/rules.phtml');\n }\n }", "public function BuildControls() {\n\n $this->EncType= $this->GetOption('EncType');\n\n // convert array of arrays into array of objects\n foreach($this->Controls as $Name=>&$Control) {\n // skip already builded controls\n if (is_object($Control)) {\n continue;\n }\n // find classname\n if (!isset($Control['Type'])) {\n $Control += array('Type'=>'text', 'Attributes'=>array('UNKNOWNTYPE'=>'YES'));\n }\n if (strpos($Control['Type'], '\\\\') === false) { // short name, ex.: \"select\"\n $Type= ucfirst($Control['Type']);\n $Class= '\\\\Accent\\\\Form\\\\Control\\\\'.$Type.'Control';\n } else { // it is fully qualified class name\n $Class= $Control['Type'];\n }\n if (!class_exists($Class)) {\n $this->Error('Class \"'.$Class.'\" not found.');\n $Class= '\\\\Accent\\\\Form\\\\Control\\\\TextControl'; // fallback to any primitive control\n }\n // copy this array into $Options and append few more items\n // and append common options to allow usage of services\n $Options= $Control + array(\n 'Name'=> $Name,\n 'Form'=> $this,\n 'Book'=> $this->GetOption('Book')\n ) + $this->GetCommonOptions();\n $Control= new $Class($Options);\n // switch to multipart encoding if any control require that\n if ($Control->GetMultipartEncoding()) {\n $this->EncType= 'multipart/form-data';\n }\n }\n $this->Builded= true;\n }" ]
[ "0.73567444", "0.6724498", "0.6724498", "0.66757464", "0.65305096", "0.65044117", "0.64593035", "0.6362783", "0.6345811", "0.6306116", "0.61643845", "0.61347216", "0.6054457", "0.60443056", "0.6039964", "0.6039964", "0.6039964", "0.6031953", "0.59967244", "0.59701306", "0.59339714", "0.59339714", "0.59339714", "0.5909594", "0.5904438", "0.5896532", "0.58834034", "0.58831763", "0.5867779", "0.5852569" ]
0.71430963
1