query
stringlengths
10
8.11k
document
stringlengths
17
398k
negatives
sequencelengths
19
20
metadata
dict
Force index by column
public function forceIndex($column) { return $this->query->from(\DB::raw($this->query->from . ' FORCE INDEX (' . $column . ')')); }
[ "public function getIndexColumn()\n {\n return false;\n }", "protected function indexColumnName() : AST\\IndexColumnName {}", "function first_index_cols() {\n //\n //Collect all the keys of this table's indices\n $keys = array_keys($this->indices);\n //\n //Pick the first key; if this fails, then teher is no identificaion index\n try{\n $key = $keys[0];\n } catch(Exception $e){\n //\n throw new Exception(\"No identification index is found\"); \n }\n //\n //Now get the first index\n $index = $this->indices[$key];\n //\n //A index is an array of index colum names; map them to actual columns\n $cols = array_map(function ($colname) {\n return $this->fields[$colname];\n }, $index);\n //\n //To ensure that the returned columns are column_name indexed\n return array_combine($index, $cols);\n }", "protected function _add_fluent_indexes()\n\t{\n\t\tforeach ($this->_columns as $column)\n\t\t{\n\t\t\tforeach (array('primary', 'unique', 'index') as $index)\n\t\t\t{\n\t\t\t\t// If the index has been specified on the given column, but is simply\n\t\t\t\t// equal to \"true\" (boolean), no name has been specified for this\n\t\t\t\t// index, so we will simply call the index methods without one.\n\t\t\t\tif ($column->$index === TRUE)\n\t\t\t\t{\n\t\t\t\t\t$this->$index($column->name);\n\n\t\t\t\t\tcontinue 2;\n\t\t\t\t}\n\n\t\t\t\t// If the index has been specified on the column and it is something\n\t\t\t\t// other than boolean true, we will assume a name was provided on\n\t\t\t\t// the index specification, and pass in the name to the method.\n\t\t\t\telseif (isset($column->$index))\n\t\t\t\t{\n\t\t\t\t\t$this->$index($column->name, $column->$index);\n\n\t\t\t\t\tcontinue 2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function default_index_cols() {\n //Get the first identification index of this table\n //\n //Get the first key from this table's indices\n $key = array_keys($this->indices)[0];\n //\n //Now get the first index\n $index = $this->indices[$key];\n //\n //A index is an array of index colum names; map them to actual columns\n $cols = array_map(function ($colname) {\n return $this->fields[$colname];\n }, $index);\n //\n //To ensure that the returned columns are column_name indexed\n return array_combine($index, $cols);\n }", "public function getAutoIndex();", "public function installDoesNotAddIndexOnChangedColumn() {}", "public function hasIndex(array $columns = []);", "function column_index( $idx )\n{\n $calculated = null;\n\n if( is_numeric( $idx ) ){\n $calculated = (int)$idx;\n }\n elseif( is_string( $idx ) ) {\n $calculated = indicize( $idx );\n }\n\n return $calculated;\n}", "public function set_index_column($name) {\n $this->index_column = $name;\n return $this;\n }", "public function getIndCol()\n\t{\n\t\t$args = func_get_args();\n\t\t$index = array_shift($args);\n\t\t$query = $this->prepareQuery($args);\n\n\t\t$ret = array();\n\t\tif ( $res = $this->rawQuery($query) )\n\t\t{\n\t\t\twhile($row = $this->fetch($res))\n\t\t\t{\n\t\t\t\t$key = $row[$index];\n\t\t\t\tunset($row[$index]);\n\t\t\t\t$ret[$key] = reset($row);\n\t\t\t}\n\t\t\t$this->free($res);\n\t\t}\n\t\treturn $ret;\n\t}", "public function indexBy($column)\n\t{\n\t\t$this->indexBy = $column;\n\t\treturn $this;\n\t}", "public function load($index, $column = null);", "public function addIndex(string $table, string $column, string $name): bool;", "public function index()\n {\n $index = $this->getIndexName();\n\n $this->assertTrue(\n $this->table->hasIndex($index), \"The {$this->name} column is not indexed.\"\n );\n\n $this->assertTrue(\n $this->table->getIndex($index)->isSimpleIndex(), \"The {$this->name} column is not a simple index.\"\n );\n }", "public function index() {\n\t\t$this->addIndex($this->column->getName());\n\n\t\treturn $this;\n\t}", "function isIndexable()\n {\n return false;\n }", "public function setUseIdxTable($value = false);", "public function getIndexTable(): array;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finding all references to file based on uploadfolder / filename
public function whereIsFileReferenced($uploadFolder, $filename) { // Gets tables / Fields that reference to files $fileFields = $this->getFileFields($uploadFolder); $theRecordList = []; foreach ($fileFields as $info) { list($table, $field) = $info; $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table); $queryBuilder->getRestrictions()->removeAll(); $queryResult = $queryBuilder ->select('uid', 'pid', $GLOBALS['TCA'][$table]['ctrl']['label'], $field) ->from($table) ->where( $queryBuilder->expr()->like( $field, $queryBuilder->createNamedParameter('%' . $queryBuilder->escapeLikeWildcards($filename) . '%') ) ) ->execute(); while ($row = $queryResult->fetch()) { // Now this is the field, where the reference COULD come from. // But we're not guaranteed, so we must carefully examine the data. $tempArr = explode(',', trim($row[$field])); foreach ($tempArr as $file) { $file = trim($file); if ($file == $filename) { $theRecordList[] = [ 'table' => $table, 'uid' => $row['uid'], 'field' => $field, 'pid' => $row['pid'] ]; } } } } return $theRecordList; }
[ "public function getFileReferences()\n {\n return $this->files;\n }", "function getFiles() {\n $managed_files = $this->getDrupalObjects(FILE_SQL);\n\n // Commented files are in file_managed table.\n $unmanaged_files = array(\n '1000.jpg',\n '100x100_transparent.png',\n '16x16_transparent.png',\n '500px.png',\n 'add_feed.jpg',\n 'add_to_channel.jpg',\n 'allwords.gif',\n 'atrium.jpg',\n 'authoritah.jpg',\n 'badges.png',\n 'baneberry.jpg',\n 'bird_stealing_meat.jpg',\n 'blog.png',\n 'blogsite463.tar.gz',\n 'book_dead.jpg',\n 'book_perms.png',\n 'broken.jpg',\n 'bubble.jpg',\n 'by-sa.png',\n 'camera.jpg',\n 'cas_alert5-640x475.jpg',\n 'case8.ppt',\n 'CASE_NAIS.ppt',\n 'cats.jpg',\n 'cc_license.png',\n 'cc_nc_by_sa.png',\n 'characteristic.png',\n 'cheater_pen.jpg',\n 'classic_phone_zazou.png',\n 'classroom20.png',\n 'class.tar.gz',\n 'climb.jpg',\n 'code_review.jpg',\n 'comcast_cares.png',\n 'comcast_no.png',\n 'confused.jpg',\n 'contact.png',\n 'container.gif',\n 'context.jpg',\n //'contextog.png',\n 'contradiction.jpg',\n 'create_channel.jpg',\n 'crow.jpg',\n 'denied.jpg',\n 'devils_tower.jpg',\n 'did_you_know.jpg',\n 'discipline_xml.png',\n 'display_options.jpg',\n 'Dr_El_Mo.doc',\n 'Dr_El_Mo.gif',\n 'drupaled-5.4-0.tar.gz',\n 'drupal_in_ed.png',\n 'edsurge_edited.png',\n 'edsurge_original.png',\n 'empty-desks.jpg',\n 'Energy_Tour.png',\n //'epub.png',\n 'facebook_sad.jpg',\n 'facepalm.jpg',\n 'facets.jpg',\n 'FAQ_on_State_Testing_Participation.pdf',\n //'featureset.png',\n //'files/17_july.png',\n //'files/23_aug.png',\n //'files/320px-MannGlassEye1999crop.jpg',\n //'files/35_million.png',\n //'files/all_rights_cc_2.png',\n //'files/apartheid_pre_deletes.png',\n //'files/aspire_google.png',\n //'files/aspire.png',\n //'files/bps_google.png',\n //'files/chi_intl_google.png',\n //'files/concept_google.png',\n //'files/cps_google.png',\n //'files/dallas_google.png',\n //'files/democ_google.png',\n //'files/digedu_privacy.pdf',\n //'files/digedu_tos.pdf',\n //'files/document_checklist.pdf',\n //'files/edmodo_transfer.png',\n //'files/ELSI_excel_export_6354568118362318308717.xls',\n //'files/engage_ny.png',\n //'files/ESBOCES_CaseStudy.pdf',\n //'files/ferguson_donate.png',\n //'files/ferpa_pps.png',\n //'files/first_version.zip',\n //'files/full_comments.zip',\n //'files/G2-M1.pdf',\n //'files/greendot_google.png',\n //'files/greendot.png',\n //'files/icansoar_google.png',\n //'files/icansoar.png',\n //'files/i_heart_rigor.png',\n //'files/inbloom_partners.pdf',\n //'files/inbloom_white.pdf',\n //'files/Kansas_CaseStudy.pdf',\n //'files/kipp_google.png',\n //'files/kipp.png',\n //'files/kipp_sat.png',\n //'files/la_course_choice.png',\n //'files/lausd_google.png',\n //'files/letter_no_contact.jpg',\n //'files/mevoked_convo_twitter.png',\n //'files/mevoked_privacy_10_30_2014.png',\n //'files/namecalling.jpg',\n //'files/noble_google.png',\n //'files/noble.png',\n //'files/no_results.png',\n //'files/nypd_tshirts.jpg',\n //'files/paper_rater_discussion.png',\n //'files/pearson_socialmedia.png',\n //'files/Pennsylvania_CaseStudy.pdf',\n //'files/portland_google.png',\n //'files/redirect_loop.png',\n //'files/remind_real_safe.png',\n //'files/remind_sm1_clean_up.png',\n //'files/remind_truste_cert.png',\n //'files/rewrite_1.png',\n //'files/rocket_google.png',\n //'files/rsdla_google.png',\n //'files/share_my_lesson_pp.png',\n //'files/succad_google.png',\n //'files/succad.png',\n //'files/TeachingAbouttheJordanDavisMurderTrial.odt',\n //'files/TeachingAbouttheJordanDavisMurderTrial.pdf',\n //'files/the_standards.png',\n //'files/uno_0.png',\n //'files/uno_google_0.png',\n //'files/uno_google.png',\n //'files/uno.png',\n //'files/urban_google.png',\n //'files/urban.png',\n //'files/wiley.png',\n //'files/yesprep_google.png',\n //'files/yesprep.png',\n 'flip.jpg',\n 'fm_logo_2.png',\n 'fm_logo.png',\n 'focused_coherent.jpg',\n 'forumperms.gif',\n 'frame.jpg',\n 'freerange.jpg',\n 'friendly.gif',\n 'funkymonkey_favicon_0.png',\n 'funkymonkey_favicon_1.png',\n 'funkymonkey_favicon.png',\n 'funkymonkey_logo.png',\n 'GeoServer_300.png',\n 'glossary.jpg',\n 'gootube.png',\n 'grilling.png',\n 'group.png',\n 'group_thumb.png',\n 'hack_schools_2.png',\n 'hall.jpg',\n 'hat_only.png',\n 'headscratcher.jpg',\n 'homepage.jpg',\n 'hsa_pics.zip',\n 'identity_verification.png',\n 'i_love_books.jpg',\n 'imagecache_sample.png',\n 'ink_water.jpg',\n 'in_our_time.png',\n 'input_screen.gif',\n 'ipad_head.png',\n 'isenet.png',\n 'Julio_Logo_Web.png',\n //'julio.png',\n 'k12open.png',\n 'kdi_app.png',\n 'kdi_app_small.png',\n 'khan_exercises.png',\n 'khan_focus.png',\n 'khan_reinforcement.png',\n 'kindergarten_common_core.png',\n 'lazy_cow.png',\n 'learner.jpg',\n 'learn_from_kids.jpg',\n 'leaves_berry.jpg',\n 'lemonade.jpg',\n 'lessons_400.png',\n 'lessons_full.png',\n 'light.jpg',\n 'list_titles.png',\n 'lock.jpg',\n 'lock_open.jpg',\n //'logo_0.png',\n 'logo.gif',\n //'logo.png',\n 'louisck_200.png',\n 'mind_the_gap.jpg',\n 'minimal_full.jpg',\n 'mission_0.png',\n 'mission.png',\n 'mn_intro_3.jpg',\n 'modules-on-do_0.png',\n 'modules-on-do.png',\n 'modules.swf',\n 'money.jpg',\n 'monkey_only.png',\n 'monkey_test.jpg',\n 'moo.jpg',\n 'necc.gif',\n 'netp2010-model-of-learning.png',\n 'newmonkey_bw_550px.png',\n 'newmonkey_favicon.png',\n 'newmonkey_logo.png',\n 'newmonkey_orange.png',\n 'newseum_star_ledger.jpg',\n 'ning.png',\n 'no_new_button.gif',\n 'no_ssn.png',\n 'notes.gif',\n 'not_tested.png',\n 'nwp_logo.png',\n 'nyscate_cc_nc_sa.jpg',\n 'oer.jpg',\n 'olpc.gif',\n 'open-content.png',\n 'OpenContentRoadmap.png',\n 'openlearning.png',\n 'openlearning_thumb.png',\n 'orange_man.png',\n 'oregonian_front_page.jpg',\n 'os_bb1.jpg',\n 'os_bb2.jpg',\n 'our-team.png',\n 'pare.jpg',\n 'peas.png',\n 'pencils.jpg',\n 'peri.gif',\n 'philly_pres.zip',\n 'pictures/picture-1.gif',\n 'pictures/picture-1.jpg',\n 'pictures/picture-2.jpg',\n 'pictures/picture-358.jpg',\n 'pictures/picture-358.png',\n 'pictures/picture-361.jpg',\n 'pictures/picture-364.png',\n 'pictures/picture-365.jpg',\n 'pictures/picture-366.jpg',\n 'pictures/picture-367.png',\n 'portfolio.avi',\n 'portfolio.png',\n 'pout_face.jpg',\n 'prism.jpg',\n 'profile.png',\n 'profile_thumb2.png',\n 'protein.jpg',\n 'purchase_not_allowed.png',\n 'question_mark.jpg',\n 'red_herring.jpg',\n 'restraint.png',\n 'rip_privacy.jpg',\n 'rocketship_300.png',\n 'rotten_apple.jpg',\n 'rotten_to_the_core.jpg',\n //'sally.png',\n 'save_search.jpg',\n 'screenshot_008.png',\n 'services_0.png',\n 'services.png',\n 'sharing_content.jpg',\n 'sponsor.png',\n 'stanley_cup.jpg',\n 'steal_book.jpg',\n 'steam.jpg',\n 'steenkin_badges.jpg',\n 'step1.png',\n 'stinkin_badges.jpg',\n 'studentid.png',\n 'style_tile.png',\n 'surveillance.jpg',\n 'tag1 draft2.png',\n 'tangled_wires.jpg',\n 'teacher.jpg',\n 'terrain.png',\n 'top_level_nav.jpg',\n 'tubes.jpg',\n 'Tuxcrystal.png',\n 'ui_features.jpg',\n 'upload/categories.gif',\n 'upload/portfolio.gif',\n 'upload/role_perms.gif',\n 'upload/roles.gif',\n 'upload/tax_structure.gif',\n 'upload/workflow.gif',\n 'useful_places_groups.png',\n 'useful_places.png',\n 'userlink.zip',\n 'userplus463.tar.gz',\n //'users/andrea_0.png',\n //'users/bill.png',\n //'users/jeff.png',\n 'variables.jpg',\n 'virtualbox-renamed-ova-error.png',\n 'voicebox_1_sm.png',\n 'voicebox_features_full.jpg',\n 'voicebox_features_no_ui.jpg',\n 'voicebox_logo_0.png',\n 'voicebox_logo.png',\n 'voted.jpg',\n 'wall.jpg',\n 'wes-moore-book.jpg',\n 'wfaa_taylor_santos.png',\n 'wh_home_page.jpg',\n 'wh_rdfa.jpg',\n 'wh_solr.jpg',\n 'window.jpg',\n 'wish-list_0.jpg',\n 'work.png',\n 'wtc_memorial_400.png',\n 'xtracker.gif',\n 'yard.jpg',\n 'yelp_ratings.jpg',\n 'youll_get_nothing.jpg',\n 'youre_out.jpg',\n );\n foreach ($unmanaged_files as $file) {\n $filepath = LEGACY_FILES_DIR . '/' . $file;\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $entry = new \\stdClass;\n $entry->fid = '-1';\n $entry->filename = basename($file);\n $entry->uri = $file;\n $entry->filemime = finfo_file($finfo, $filepath);\n $entry->timestampe = filemtime($filepath);\n finfo_close($finfo);\n $managed_files[] = $entry;\n }\n return $managed_files;\n }", "public function scan_files(){\r\n $locations = $this->file_local_places();\r\n foreach($locations as $location){\r\n $this->scan_files_by_location( $location );\r\n }\r\n }", "public function findFiles($where);", "public function match( $ref ){\n $excluded = new Loco_fs_Locations( $this->getExcluded() );\n /* @var Loco_fs_Directory */\n foreach( $this->getRootDirectories() as $base ){\n $file = new Loco_fs_File($ref);\n $path = $file->normalize( (string) $base );\n if( $file->exists() && ! $excluded->check($path) ){\n return $file;\n }\n }\n }", "function GetFilenames(){}", "public function retrieve_other_files() \n {\n }", "public function getExtractedFiles() {}", "public function findFileReferences($file) {\n\n\t\t$fileIdentifier = $file instanceof File ? $file->getUid() : (int)$file;\n\n\t\t// Get the file references of the file.\n\t\treturn $this->getDatabaseConnection()->exec_SELECTgetRows(\n\t\t\t'*',\n\t\t\t'sys_file_reference',\n\t\t\t'deleted = 0 AND uid_local = ' . $fileIdentifier\n\t\t);\n\t}", "protected function findFiles() {\n $files = [];\n foreach ($this->directories as $provider => $directory) {\n $file = $directory . '/' . $provider . '.extend.gql';\n if (file_exists($file)) {\n $files[$provider] = $file;\n }\n }\n return $files;\n }", "public function getFileList();", "public function getElementsManagedFiles();", "protected function findFiles() {\n $files = [];\n foreach ($this->directories as $provider => $directory) {\n $file = $directory . '/' . $provider . '.gql';\n if (file_exists($file)) {\n $files[$provider] = $file;\n }\n }\n return $files;\n }", "public function getFiles()\n {\n if (!$this->getDestinationDirectory())\n {\n return array();\n }\n \n $finder = $this->getFinder()\n ->in($this->getAbsoluteUploadPath())\n ->depth('< 1')\n //->notContains('/^[\\.]/')\n ->files();\n \n $files = array();\n \n foreach ($finder AS $file)\n {\n $files[] = $file->getRelativePathname();\n }\n \n return $files;\n }", "private function filesToSet()\n {\n $list = [];\n $metadata = $this->getMetadata();\n\n foreach ($this->hashMap as $relativePath => $md5)\n {\n if (!isset($metadata['hashMap'][$relativePath])\n or $metadata['hashMap'][$relativePath] !== $md5)\n {\n $absolutePath = $this->fileMap[$relativePath];\n $list[$relativePath] = $absolutePath;\n }\n }\n\n return $list;\n }", "static function importUploads() {\n\t\t\n\t\t$wp_upload_dir = wp_upload_dir();\n\t\t$wp_upload_dir = $wp_upload_dir['path'];\n\t\t\n\t\t$dr_upload_dirs = drupal()->variable->value->getValues(\n\t\t\tarray(\n\t\t\t\t'name' => 'file_%'\n\t\t\t)\n\t\t);\n\n\t\t// Locate files based on upload vars\t\t\n\n\t\t$files = drupal()->files->getAllRecords();\n\t\tforeach( $files as $file ) {\n\t\t\t\n\t\t\t// Only transfer files referenced by a node\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "private function collectExtensionFiles() {\n\n\n\n $this->collectLookingFilenames();\n\n $rii = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->OCpath));\n\n foreach ($rii as $file) {\n\n if ($file->isDir()){\n continue;\n }\n\n if ($file->isFile()){\n\n foreach ( $this->lookingFilenames as $lookingFilename ) {\n\n if( strpos($file->getPathname(), $lookingFilename) !== false ) {\n $this->extensionFilenames[] = $file->getPathname();\n }\n\n }\n\n }\n }\n return $this->extensionFilenames;\n\n //var_dump($this->extensionFilenames);\n }", "public function getCandidateFiles() {\n $files = [];\n foreach (Framework::instance()->moduleList() as $module) {\n $filepath = DRUPAL_ROOT . '/' . drupal_get_path('module', $module) . '/realistic_dummy_content/fields/' . $this->getEntityType() . '/' . $this->getBundle() . '/' . $this->getName();\n $files = array_merge($files, RealisticDummyContentEnvironment::getAllFileGroups($filepath, $this->getExtensions()));\n }\n return $files;\n }", "public function discoverAllFiles(): Collection;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
checking if Zamp Live Test Mode enabled not not
public function checkLiveTestMode() { if(!ZAMP_LIVE_TEST_MODE) return; $block_test_mode_access = true; if($accessKey = $this->_request->get('zamp_live_test_mode_access_key')) { $host = preg_replace('/^www\./i', '', $this->_request->server('HTTP_HOST')); $cookieInfo = session_get_cookie_params(); if($accessKey == ZAMP_LIVE_TEST_MODE_ACCESS_KEY) { setcookie('zamp_live_test_mode_key', ZAMP_LIVE_TEST_MODE_ACCESS_KEY, time() + 86400, '/', '.'.$host, $cookieInfo['secure'], $cookieInfo['httponly']); $block_test_mode_access = false; } elseif($accessKey == 'stop') { setcookie('zamp_live_test_mode_key', '', time() - 86400, '/', '.'.$host, $cookieInfo['secure'], $cookieInfo['httponly']); $block_test_mode_access = true; } } $liveTestModeKey = $this->_request->cookie('zamp_live_test_mode_key'); if( ( empty($liveTestModeKey) || ($liveTestModeKey != ZAMP_LIVE_TEST_MODE_ACCESS_KEY) ) && $block_test_mode_access ) { Zamp_General::setHeader(503); header('Retry-After: 3600'); if(SET_ZAMP_HEADER) header("X-Powered-By: Zamp PHP/".ZAMP_VERSION); if(isset($this->_view)) { $errorFile = 'zamp_live_test_mode'.$this->_view->_view_template_extension; if(file_exists($errorFilePath = _APPLICATION_CORE_.'view/'.$this->_config['viewTemplate']['template_name'].'/'.$errorFile) or file_exists($errorFilePath = _APPLICATION_CORE_.'view/default/'.$errorFile)) { $errorFilePath = 'file:'.preg_replace('@(\\\|/{2,})@', '/', realpath($errorFilePath)); $this->_view->display($errorFilePath); cleanExit(); } } $fileName = _PROJECT_PATH_."Zamp/Exception/template/zamp_live_test_mode.html.php"; require_once $fileName; cleanExit(); } }
[ "public function isTestMode() {\n\t\treturn (bool) $this->app->store->get()->params->get('anet.test_mode');\n\t}", "public function isTestMode()\n {\n return $this->getConfigData('testmode') == 1;\n }", "protected function is_test_mode(): bool {\n\t\t\treturn true;\n\t\t}", "public function is_test_mode()\n {\n\n return (isset($this->settings->test_mode) && $this->settings->test_mode);\n }", "public function is_test_mode() {\n return ( $this->app_mode == 'test' ) ? TRUE : FALSE;\n }", "public function is_test_mode() {\n return false; // Why bother\n }", "public function isTest()\n {\n return Base::$gateway_mode == 'test';\n }", "public static function isTest() {\n return (isset($_SESSION[\"MODE\"]) && $_SESSION[\"MODE\"] == \"TESTS\") || getenv(\"MODE\")==\"TESTS\";\n }", "private function isTest(): bool\n\t{\n\t\treturn self::MODE_TEST === $this->mode;\n\t}", "function xendit_for_give_is_test_mode() {\n if (give_get_option('xendit_for_give_xendit_enable_test')) {\n return true;\n } else {\n return false;\n }\n}", "public static function isTestMode() : bool\n {\n return env('APP_MODE') === 'test' ? true : false;\n }", "public function isLive()\n {\n return config('przelewy24.mode', 'sandbox') === 'live';\n }", "public function isLiveMode()\n {\n return $this->getConfigFlag('live_mode');\n }", "public function getIsTestMode()\n {\n return $this->isTestMode;\n }", "public static function isTestMode()\n\t{\n\t\t// The constant HAS TO BE defined and set to FALSE, for LIVE Credit Card payments to work\n\t\treturn (!defined('CREDIT_CARD_PAYMENT_TEST_MODE') || CREDIT_CARD_PAYMENT_TEST_MODE !== FALSE);\n\t}", "abstract protected function enableTestMode();", "function is_demo_mode()\n{\n\treturn (defined('DEMO_MODE') AND DEMO_MODE == true) ? true : false;\n}", "public function test_isInDevMode() {\n $isdevmode = $this->framework->isInDevMode();\n\n $this->assertFalse($isdevmode);\n }", "function isNotLive(){ return $_ENV['CURRENT_ENVIRONMENT'] != ENVIRONMENT_LIVE; }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return current custom entity interface.
private function getCurrentCustomEntity() { return $this->registry->registry('current_custom_entity'); }
[ "public function getInterface();", "abstract protected function appOwnerEntityDefinition(): EntityTypeInterface;", "public function get_entity_type()\n {\n return self::ENTITY_TYPE;\n }", "public function getCurrentEntityClass(): string {\n return $this->entityClass;\n }", "public function interface()\n {\n return $this->interface;\n }", "public function entity() {\n\t\t\treturn $this->entity;\n\t\t}", "public function getReferenceEntityApi(): ReferenceEntityApiInterface\n {\n }", "abstract public function getEntityTypeCode();", "public function getSystemEntity()\n {\n return $this->entity;\n }", "public function getInterface(): string\n {\n return $this->interface;\n }", "public function asEntity(): IEntityTypeReference;", "abstract protected function getEntityTypeCode();", "protected function getEntity() {\n list(, $webform_options_custom_id) = explode(':', $this->getPluginId());\n return $this->entityTypeManager->getStorage('webform_options_custom')->load($webform_options_custom_id);\n }", "public function __getInterface__()\r\n {\r\n return $this->_interface;\r\n }", "public function getInterface()\n {\n return isset($this->interface) ? $this->interface : '';\n }", "public function getOriginalEntity(): EntityInterface {\n return $this->entity->original;\n }", "public function getManuapi()\r\n {\r\n return $this->entity;\r\n }", "public function getEntity() : ContextAnnotationEntityFields\n {\n return $this->entity;\n }", "public function getEntitiesOverrides()\n {\n return [\n\t\t\t'Elcodi\\Bundle\\PriceBundle\\Entity\\Interfaces\\PriceInterface' => 'elcodi.entity.price.class',\n\t\t];\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ ======== function showEcho =======
function showEcho ($echo_text, $echo_value) { echo "<p>".$echo_text.$echo_value."</p>"; }
[ "public function _echo()\n\t{\n\t\t$args = func_get_args();\n\t\tforeach ($args as $val) echo $val;\n\n\t\treturn '';\n\t}", "protected function echoString() {\n }", "function pustaka_echo( $string ) {\n\tprintf( $string );\n}", "public function isEcho();", "function xecho($text)\n\t{\n\t\tif($this->do_newlines)\n\t\t{\n\t\t\t$text .= \"\\n\";\n\t\t}\n\t\tif($this->do_queue)\n\t\t{\n\t\t\t$this->output_queue .= $text;\n\t\t}\n\t\tif($this->do_echo)\n\t\t{\n\t\t\techo $text;\n\t\t}\n\t\tif($this->do_return)\n\t\t{\n\t\t\treturn $text;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}", "function onEcho($internal, $public);", "function debug_text_print($text) {\n\techo \"<div class=\\\"raw_output\\\">\\n$text</div>\\n\";\n\t}", "function ob_echo($echo, $silent = false){ if (!$silent){ echo($echo.PHP_EOL); } ob_flush(); }", "function encho($text)\n\t{\n\t\techo htmlspecialchars($text);\n\t}", "function echoit($string)\r\n{\r\n echo $string;\r\n}", "function echoit($string)\n{\n\techo $string;\n}", "public function echo($string)\n {\n echo($string);\n }", "function echoit($string)\n{\n echo $string;\n}", "function my_echo($msg) {\n echo \"$msg\\n\";\n \n debug_msg($msg);\n}", "function superEcho ($str1, $str2 = null, $color = 'verde', $debug=1)\n{\n if ( $debug <= NIVEL_DEBUG){\n $len1 = strlen($str1);\n \n if ($str2 != null) {\n $len2 = strlen($str2);\n pinta($str1, $color);\n if ($len2 > MAX_TERMINAL){\n $str2 = substr($str2, $len1, MAX_TERMINAL - $len1) . \"...\"; \n } else {\n $str2 = substr($str2, $len1);\n }\n $str = $str2;\n } else {\n if ($len1 > MAX_TERMINAL){\n $str = substr($str1, 0, MAX_TERMINAL - $len1) . \"...\";\n } else {\n $str = $str1;\n }\n }\n echo $str.\"\\n\";\n }\n}", "function XSSecho($var) {\n echo htmlentities($var);\n }", "public static function show(){\n if(EB_DEBUG_TO_SCREEN && !empty($GLOBALS['debug'])){\n echo join('<br/>',$GLOBALS['debug']);\n }\n }", "function showOutput();", "function echoer( $value ) {\n\treturn create_function( '', 'echo '.var_export( $value, true ).';');\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Function Name : getUpdateQueryString Purpose : to generate the update query string Parameters : array Form values Returns : Calls : Called By : Author : Sushrit Created on : July 29 , 2015 Modified By : Modified on :
function getUpdateQueryString($formValues, $formTableMap) { if (isset($formValues['formname'])) { if ($formValues['formname'] != "") { $updateString = ""; foreach ($formValues as $key => $value) { if ($key != "formname") { if (isset($formTableMap[$formValues['formname']][$key]) && $value != "") { $columnName = $formTableMap[$formValues['formname']][$key]; $columnValue = ($columnName == "client_password") ? md5(trim($value)) : trim($value); $updateString .= ($updateString != "") ? " , " : ""; $updateString .= $columnName . " = \"" . $columnValue . "\""; } } } return $updateString; } } }
[ "private function updateQueryString()\n\t{\n self::$mutableQueryString = \"?\";\n\t\t\n\t\t$total = sizeof(self::$mutableQueryElems);\n\t\t\n\t\tfor ($i=0; $i<$total; $i++) {\n\t\t\tlist($Key, $Value) = each(self::$mutableQueryElems);\n\t\t\t\n self::$mutableQueryString .= $Key;\n\t\t\t\n\t\t\tif ($Value!=NULL)\n\t\t\t\tself::$mutableQueryString .= \"=\" . $Value;\n\t\t\t\n\t\t\tif ($i<$total-1)\n\t\t\t\tself::$mutableQueryString .= \"&\";\n\t\t}\n\t\t\n\t\treset(self::$mutableQueryElems);\n\t}", "protected function prepareUpdate() {\r\n\t\t$this->params = array ();\r\n\r\n\t\t$query = \"UPDATE \";\r\n\t\tforeach ( $this->from as $k => $v ) {\r\n\t\t\t$query .= ($k ? \", \" : \"\") . $v;\r\n\t\t}\r\n\t\t$query .= \" SET \";\r\n\r\n\t\tforeach ( $this->fields as $k => $v ) {\r\n\t\t\t$query .= ($k ? \", \" : \"\") . $v [0] . \"=\";\r\n\t\t\tif ($v [2]) {\r\n\t\t\t\t$query .= $v [1];\r\n\t\t\t} else {\r\n\t\t\t\t$query .= \"?\";\r\n\t\t\t\t$this->params [] = $v [1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->prepareWhere ( $query );\r\n\r\n\t\treturn $query;\r\n\t}", "private function buildQueryString(){\n if(count($this->querystrings) == 0){\n return \"\";\n }\n else{\n $querystring = \"?\";\n foreach($this->querystrings as $index => $value){\n if($index > 0){\n $querystring .= \"&\";\n }\n $querystring .= $value;\n }\n return $querystring;\n }\n }", "function getQueryString()\n {\n $queryString = \"\";\n $continuation = \"\";\n\n foreach ($this->queryArray as $element => $value) {\n $queryString .= \"$continuation$element=\" . urlencode($value);\n $continuation = \"&amp;\";\n }\n\n return $queryString;\n }", "private function generateUpdateQuery()\n {\n $query = 'SCHTASKS /CHANGE /SC MONTHLY';\n $query .= ' ' . $this->getSchSyntaxForModifier();\n $query .= ' ' . $this->getSchSyntaxForName();\n $query .= ' ' . $this->getSchSyntaxForAction();\n $query .= ' ' . $this->getSchSyntaxForStartDate();\n $query .= ' ' . $this->getSchSyntaxForStartTime();\n if (strtoupper($this->getModifier()) === 'LASTDAY') {\n $query .= ' ' . $this->getSchSyntaxForMonth();\n } else {\n $query .= ' ' . $this->getSchSyntaxForDay(\"MONTHLY\");\n }\n $query .= ' ' . $this->getSchSyntaxForEndDate();\n $query .= ' ' . $this->getSchSyntaxForEndTime();\n return $query;\n }", "private function getUpdateQuery()\n {\n if (isset($this->parts['from'][0]['alias'])) {\n $fromClause = $this->parts['from'][0]['alias'].' FROM '.$this->getFromClause();\n } else {\n $fromClause = $this->parts['from'][0]['table'];\n }\n\n $setClause = array();\n\n foreach ($this->parts['set'] as $idenfier => $value) {\n $setClause[] = $this->getExpressionBuilder()->equal($idenfier, $value);\n }\n\n return 'UPDATE '.$fromClause.\n ' SET '.implode(', ', $setClause).\n (($this->parts['where'] !== null) ? ' WHERE '.$this->parts['where'] : null);\n }", "protected static function buildQueryString() {\n\t$s = '';\n\tforeach (self::$parms as $k => $v) {\n\t $s .= $k . '=' . urlencode($v) . '&';\n\t}\n\treturn $s;\n }", "function getQueryString(){\n\tglobal $query_string;\n\t$query_string = array();\n\t$new_query_string = array();\n\tif(isset($_SERVER) && isset($_SERVER['REQUEST_URI'])){\n\t\tif(strpos($_SERVER['REQUEST_URI'], '?')){\n\t\t\t$query_string = explode('?', $_SERVER['REQUEST_URI']);\n\n\t\t\tif(strpos($query_string[1], '&')){\n\t\t\t\t$query_string = explode('&', $query_string[1]);\n\t\t\t\tforeach ($query_string as $value) {\n\t\t\t\t\t$value_array = explode('=', $value);\n\t\t\t\t\t$new_query_string[urldecode($value_array[0])] = urldecode($value_array[1]);\n\t\t\t\t}\n\t\t\t\t$query_string = $new_query_string;\n\t\t\t}else{\n\t\t\t\t$value_array = explode('=', $query_string[1]);\n\t\t\t\t$new_query_string[urldecode($value_array[0])] = urldecode($value_array[1]);\n\t\t\t}\n\t\t}\n\t}\n\t$query_string = $new_query_string;\n}", "protected function getUpdateQuery() {\n if (!static::$updateQuery) {\n $this->connect();\n static::$updateQuery = $this->solr->createUpdate();\n }\n return static::$updateQuery;\n }", "private static function updateQuerystring($querystring, $param, $value){\n\t\t$f = array();\n\t\t$ex = explode(\"&\", $querystring);\n\t\t$founded=false;\n\t\tforeach($ex as $arg){\n\t\t\t$a = explode(\"=\", $arg);\n\t\t\tif($a[0] == $param){\n\t\t\t\t$a[1] = $value;\n\t\t\t\t$founded = true;\n\t\t\t}\n\t\t\tarray_push($f,implode(\"=\", $a));\n\t\t}\n\t\tif($founded == false)array_push($f,\"{$param}={$value}\");\n\t\treturn implode(\"&\", $f);\n\t}", "static function build_querystring($getArr){\n\t\tif(is_array($getArr))\n\t\t\t$qs = self::ref_build_querystring($getArr, '', '');\n\t\t\t$hash=(isset($getArr['#']) && $getArr['#'])?\"#\".urlencode($getArr['#']):'';\n\t\t\treturn $qs.$hash;\n\t\treturn (string) $getArr;\n\t}", "function queryString()\r\n{\r\n\t$qString = array();\r\n\t\r\n\tforeach($_GET as $key => $value) {\r\n\t\tif (trim($value) != '') {\r\n\t\t\t$qString[] = $key. '=' . trim($value);\r\n\t\t} else {\r\n\t\t\t$qString[] = $key;\r\n\t\t}\r\n\t}\r\n\t\r\n\t$qString = implode('&', $qString);\r\n\t\r\n\treturn $qString;\r\n}", "public static function GenerateQueryString() {\n\t\t\tif (count($_GET)) {\n\t\t\t\t$strToReturn = '';\n\t\t\t\tforeach ($_GET as $strKey => $mixValue)\n\t\t\t\t\t$strToReturn .= QApplication::GenerateQueryStringHelper(urlencode($strKey), $mixValue);\n\t\t\t\treturn '?' . substr($strToReturn, 1);\n\t\t\t} else\n\t\t\t\treturn '';\n\t\t}", "public function constructUpdateQuery()\n {\n $tablesUsed = array();\n $updateString = $this->constructUpdateString($tablesUsed, true);\n $condString = $this->constructCondString($tablesUsed);\n\n return 'UPDATE ' . implode(', ', $tablesUsed) . ' SET ' . $updateString . ' WHERE ' . $condString;\n }", "function rebuildQueryString(){\r\n\t\t$queryString = $_SERVER[\"QUERY_STRING\"];\r\n\r\n\t\t//while rebuilding the query string remove any old page parameters\r\n\t\t//(so we don't end up pathing them twice and ending up with page=1&page=1\r\n\t\t$this->removeQueryStringVar($queryString,$this->pageVariable);\r\n\r\n\t\t//remove the url= query string too\r\n\t\t$this->removeQueryStringVar($queryString,\"url\");\r\n\r\n\t\treturn $queryString;\r\n\t}", "private function getQueryString() {\n if (empty($this->queryParams)) {\n return '';\n }\n\n return implode('&', $this->queryParams);\n }", "public function getPostQueryString()\n {\n return http_build_query($this->postParams);\n }", "function generate_update_SQL($update_field_name, $update_field_value){\n\t\t$str_field\t= \"(\";\n\t\t$str_data\t= \"(\";\n\t\t$querystr\t= \"\";\n\t\tfor($i=0; $i<=$this->number_of_field; $i++){\n\t\t\t$str_field = $this->array_data_field[$i] . \"=\";\n\t\t\t//gan bien temp = gia tri mac dinh\n\t\t\t$temp = $this->array_data_default_value[$i];\n\n\t\t\t//Read from method POST\n\t\t\tif($this->array_data_store[$i]==0){\n\t\t\t\tif(isset($_POST[$this->array_data_value[$i]])) $temp = $_POST[$this->array_data_value[$i]];\n\t\t\t}\n\t\t\t//Read from global variable\n\t\t\telse{\n\t\t\t\t$temp_var = $this->array_data_value[$i];\n\t\t\t\tglobal $$temp_var;\n\t\t\t\t$temp = $$temp_var;\n\t\t\t}\n\t\t\t//remove quote;\n\t\t\t$temp = str_replace(\"\\'\",\"'\",$temp);\n\t\t\t$temp = str_replace(\"'\",\"''\",$temp);\n\n\t\t\t//Remove HTML tag if removeHTML = 1\n\t\t\tif($this->removeHTML == 1) $temp = $this->htmlspecialbo($temp);\n\n\t\t\tswitch ($this->array_data_type[$i]){\n\t\t\t\tcase \"0\": $str_data = \"'\" . $temp . \"',\"; break;\n\t\t\t\tcase \"1\": $str_data = intval($temp) . \",\"; break;\n\t\t\t\tcase \"2\": $str_data = \"'\" . $temp . \"',\"; break;\n\t\t\t\tcase \"3\": $str_data = doubleval($temp) . \",\"; break;\n\t\t\t\tcase \"4\": $str_data = \"'\" . md5($temp) . \"',\"; break;\n\t\t\t}\n\t\t\t$querystr .= $str_field . $str_data;\n\t\t}\n\n\t\t$querystr = substr($querystr, 0, strlen($querystr)-1);\n\t\t$querystr = \"UPDATE \" . $this->table_name . \" SET \" . $querystr . \" WHERE \" . $update_field_name . \" = \" . $update_field_value . \" LIMIT 1\";\n\n\t\treturn $querystr;\n\t}", "public function getUpdateQuery();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filter the query on the scity column Example usage: $query>filterByScity('fooValue'); // WHERE scity = 'fooValue' $query>filterByScity('%fooValue%', Criteria::LIKE); // WHERE scity LIKE '%fooValue%'
public function filterByScity($scity = null, $comparison = null) { if (null === $comparison) { if (is_array($scity)) { $comparison = Criteria::IN; } } return $this->addUsingAlias(ShiptoTableMap::COL_SCITY, $scity, $comparison); }
[ "public function filterBySecuNumber($secuNumber = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($secuNumber)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $secuNumber)) {\n $secuNumber = str_replace('*', '%', $secuNumber);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(ContactPeer::SECU_NUMBER, $secuNumber, $comparison);\n }", "public function searchStock($value)\n\t{\n\t\treturn $this->stock->where('name','LIKE','%'.$value.'%')->get();\n\t}", "public function filter($value);", "public function filterBySconame($sconame = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($sconame)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(CarthedTableMap::COL_SCONAME, $sconame, $comparison);\n }", "public function filterBySiret($siret = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($siret)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $siret)) {\n $siret = str_replace('*', '%', $siret);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(ContactPeer::SIRET, $siret, $comparison);\n }", "function where_search_paysheet_has_salary_summery_pass_salary_category($value)\n {\n\n $this->db->where('salary_category_idsalary_category', $value);\n $query = $this->db->get('paysheet_has_salary_summery');\n\n return $query->result();\n\n }", "public function filterBySst($sst = null, $comparison = null)\n {\n if (is_array($sst)) {\n $useMinMax = false;\n if (isset($sst['min'])) {\n $this->addUsingAlias(AliProductTableMap::COL_SST, $sst['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($sst['max'])) {\n $this->addUsingAlias(AliProductTableMap::COL_SST, $sst['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(AliProductTableMap::COL_SST, $sst, $comparison);\n }", "public function searchCity($value) {\n $cities = \\Plac\\City::whereRaw(\"lower(city_name) like '$value%'\")->where(\"country_id\", \"COL\")->get();\n \n if (count($cities)>0) {\n for ($i = 0; $i < count($cities); $i++) {\n $cities[$i]['isSelected'] = 0;\n $cities[$i]['cityPosition'] = $i;\n }\n }\n return $cities;\n }", "public function filterBySname($sname = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($sname)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ShiptoTableMap::COL_SNAME, $sname, $comparison);\n }", "public function getFilteredWithCuisine($cuisineId) {\n // $filterString = $this->getFiltersQuery();\n\n $query = \n mysql_query(\"SELECT sm_user_reco_small.fbid AS fbid,\n sm_user_reco_small.resId AS resId,\n sm_user_reco_small.rating AS rating\n FROM sm_restaurant_info, sm_user_reco_small, sm_res_cuisine\n WHERE sm_user_reco_small.fbid='\".$this->fbid.\"'\n AND sm_user_reco_small.resId = sm_restaurant_info.resId\n AND sm_res_cuisine.cuisineId = \\\"\".$cuisineId.\"\\\"\n AND sm_res_cuisine.resId = sm_restaurant_info.resId\".\n // .$filterString.\n \" ORDER BY rating DESC\")\n or die(mysql_error());\n return $query;\n\n }", "public function filterValue($value, $filter);", "public function filterBySemifinalista($semifinalista = null, $comparison = null)\n\t{\n\t\tif (null === $comparison) {\n\t\t\tif (is_array($semifinalista)) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t} elseif (preg_match('/[\\%\\*]/', $semifinalista)) {\n\t\t\t\t$semifinalista = str_replace('*', '%', $semifinalista);\n\t\t\t\t$comparison = Criteria::LIKE;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(EquipoPeer::SEMIFINALISTA, $semifinalista, $comparison);\n\t}", "abstract function applyFilter($value);", "function search_condition($value) {\n\n\t\tif (is_array($value)) {\n\t\t\t$value = $this->array_to_type($value);\n\t\t}\n\n\t\tswitch ($this->type) {\n\n\t\t\tcase TIMESTAMP:\n\t\t\tcase INTEGER:\n\t\t\t\t$result = $this->name.\" = \".intval($value);\n\t\t\t\tbreak;\n\n\t\t\tcase FLOAT:\n\t\t\t\t$result = $this->name.\" = \".floatval($value);\n\t\t\t\tbreak;\n\n\t\t\tcase DATETIME:\n\t\t\tcase TIME:\n\t\t\tcase DATE:\n\t\t\t\t$result = $this->name.\" = '\".$value.\"'\";\n\t\t\t\tbreak;\n\n\t\t\tcase BINARY:\n\t\t\tcase TEXT:\n\t\t\tcase STRING:\n\t\t\tdefault:\n\t\t\t\t$result = $this->name.\" LIKE '\".$value.\"'\";\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\treturn $result;\n\n\t}", "public function filterBySerie($serie = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($serie)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $serie)) {\n $serie = str_replace('*', '%', $serie);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(FacturaPeer::SERIE, $serie, $comparison);\n }", "public function filterBySiren($siren = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($siren)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $siren)) {\n $siren = str_replace('*', '%', $siren);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(ContactPeer::SIREN, $siren, $comparison);\n }", "public function search($jenis)\n {\n return Product::where('jenis', 'like', '%' . $jenis . '%')->get();\n }", "public function filter($builder, $value)\n {\n return $builder->where('vehicleName', 'LIKE', '%' . $value . '%');\n }", "public function searchSchools($data){\n\t\t$searchVal = $data['value'].'%';\n\t\t$sqlst = \"SELECT * FROM campuses WHERE name LIKE :v\";\n\t\t$st = $this->db->prepare($sqlst);\n\t\t$st->execute(array(\":v\"=>$searchVal));\n\t\treturn $st->fetchAll();\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create and setup QFloatTextBox txtActualTotalAmount
public function txtActualTotalAmount_Create($strControlId = null) { $this->txtActualTotalAmount = new QFloatTextBox($this->objParentObject, $strControlId); $this->txtActualTotalAmount->Name = QApplication::Translate('Actual Total Amount'); $this->txtActualTotalAmount->Text = $this->objStewardshipBatch->ActualTotalAmount; return $this->txtActualTotalAmount; }
[ "public function txtAmount_Create($strControlId = null) {\n\t\t\t$this->txtAmount = new QFloatTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtAmount->Name = QApplication::Translate('Amount');\n\t\t\t$this->txtAmount->Text = $this->objSignupPayment->Amount;\n\t\t\treturn $this->txtAmount;\n\t\t}", "public function txtAmountCharged_Create($strControlId = null) {\n\t\t\t$this->txtAmountCharged = new QFloatTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtAmountCharged->Name = QApplication::Translate('Amount Charged');\n\t\t\t$this->txtAmountCharged->Text = $this->objCreditCardPayment->AmountCharged;\n\t\t\treturn $this->txtAmountCharged;\n\t\t}", "private function addTotalAmount(){\t\t\n\t\t$element = 'totalAmount';\n\t\t$this->addElement('text', $element, array(\n\t\t 'label' => 'totalAmountToPay',\t\t \n\t\t 'readonly' => true\t\t \n\t\t));\t\t\n\t\t$this->addDecoratorAndGroup( $element, true );\t\t\n\t\t$this->getElement($element)->setValue( number_format($this->getSum(),2) );\n\t}", "public function txtQuantidadeReal_Create($strControlId = null) {\n\t\t\t$this->txtQuantidadeReal = new QIntegerTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtQuantidadeReal->Name = QApplication::Translate('Quantidade Real');\n\t\t\t$this->txtQuantidadeReal->Text = $this->objComandoRiscoPeca->QuantidadeReal;\n\t\t\t$this->txtQuantidadeReal->Required = true;\n\t\t\treturn $this->txtQuantidadeReal;\n\t\t}", "private function setup_total() {\n\t\t$amount = $this->get_meta( '_give_payment_total', true );\n\n\t\treturn round( floatval( $amount ), give_get_price_decimals( $this->ID ) );\n\t}", "public function lblAmount_Create($strControlId = null, $strFormat = null) {\n\t\t\t$this->lblAmount = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblAmount->Name = QApplication::Translate('Amount');\n\t\t\t$this->lblAmount->Text = $this->objFlowchartGrid->Amount;\n\t\t\t$this->lblAmount->Required = true;\n\t\t\t$this->lblAmount->Format = $strFormat;\n\t\t\treturn $this->lblAmount;\n\t\t}", "protected function txtOrderNumber_Create() {\n\t\t\t$this->txtOrderNumber = new QIntegerTextBox($this);\n\t\t\t$this->txtOrderNumber->Name = QApplication::Translate('Order Number');\n\t\t\t$this->txtOrderNumber->Text = $this->objParameter->OrderNumber;\n\t\t}", "public function txtPeso_Create($strControlId = null) {\n\t\t\t$this->txtPeso = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtPeso->Name = QApplication::Translate('Peso');\n\t\t\t$this->txtPeso->Text = $this->objFichas->Peso;\n\t\t\t$this->txtPeso->MaxLength = Fichas::PesoMaxLength;\n\t\t\treturn $this->txtPeso;\n\t\t}", "public function lblAmount_Create($strControlId = null, $strFormat = null) {\n\t\t\t$this->lblAmount = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblAmount->Name = QApplication::Translate('Amount');\n\t\t\t$this->lblAmount->Text = $this->objOnlineDonation->Amount;\n\t\t\t$this->lblAmount->Format = $strFormat;\n\t\t\treturn $this->lblAmount;\n\t\t}", "private function _createAmountField()\n {\n $ammount = new Zend_Form_Element_Text('amount');\n $ammount->setLabel('transactionAmount')\n ->addFilter(new Zend_Filter_StringTrim())\n ->addFilter(new Zend_Filter_StripTags())\n ->setRequired();\n\n return $ammount;\n }", "public function lblAmount_Create($strControlId = null, $strFormat = null) {\n\t\t\t$this->lblAmount = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblAmount->Name = QApplication::Translate('Amount');\n\t\t\t$this->lblAmount->Text = $this->objStewardshipPostAmount->Amount;\n\t\t\t$this->lblAmount->Format = $strFormat;\n\t\t\treturn $this->lblAmount;\n\t\t}", "public function lblPostedTotalAmount_Create($strControlId = null, $strFormat = null) {\n\t\t\t$this->lblPostedTotalAmount = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblPostedTotalAmount->Name = QApplication::Translate('Posted Total Amount');\n\t\t\t$this->lblPostedTotalAmount->Text = $this->objStewardshipBatch->PostedTotalAmount;\n\t\t\t$this->lblPostedTotalAmount->Format = $strFormat;\n\t\t\treturn $this->lblPostedTotalAmount;\n\t\t}", "public function txtValor6_Create($strControlId = null) {\n\t\t\t$this->txtValor6 = new QIntegerTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtValor6->Name = QApplication::Translate('Valor 6');\n\t\t\t$this->txtValor6->Text = $this->objEncuestas->Valor6;\n\t\t\t$this->txtValor6->Required = true;\n\t\t\treturn $this->txtValor6;\n\t\t}", "function cpa_enteramt_render() { \n\t\t\n\t\t$cpa_enteramt=get_option('cpa_enteramt');\n\n\t\tif(!$cpa_enteramt){\n\t\t\t$cpa_enteramt=\"\";\n\t\t}\n\n\t\t?>\n\t\t<input type='text' name='cpa_enteramt' value='<?php echo $cpa_enteramt; ?>'>\n\t\t</br><p> <?php _e('Enter amount of cart total on exceeds of which this function will work .','cart-products-automatically');?> </p>\n\t\t<?php\n\n\t}", "public function recalculateTotal()\n {\n $this->setTotal($this->getSubTotal() + $this->getHubFee());\n }", "private function setTotal()\n {\n if($this->taxIncluded){\n $this->total = $this->subtotal;\n }else{\n $this->total = $this->subtotal + $this->tax;\n } \n }", "public function addTotal(){\n $total = $this->Total;\n $this->gridAddRow();\n\n // Adicionando a Label do Total\n $this->gridAddCell($total->label, $total->labelAlign, $total->labelStyle, $total->labelColspan, $total->border, false);\n\n // Se o estilo para o total for igual ao da label\n if (!$total->valueStyle){\n $total->valueStyle = $total->labelStyle;\n }\n\n $this->gridAddCell($total->value, $total->valueAlign, $total->valueStyle, $total->valueColspan, $total->border, false);\n\n }", "public function txtFlete_Create($strControlId = null) {\n\t\t\t$this->txtFlete = new QFloatTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtFlete->Name = QApplication::Translate('Flete');\n\t\t\t$this->txtFlete->Text = $this->objLicencia->Flete;\n\t\t\treturn $this->txtFlete;\n\t\t}", "private function setTotalAmounts()\n {\n $taxable\t= 0.00;\n $expenses = 0.00;\n $outlays\t= 0.00;\n\n foreach ($this->invoiceDetails as $invoiceDetail) {\n $amount = $invoiceDetail->getAmount();\n switch ($invoiceDetail->getType())\n {\n case 'incoming':\n $taxable += $amount;\n break;\n case 'expense':\n $taxable += $amount;\n $expenses += $amount;\n break;\n case 'outlay':\n $outlays += $amount;\n break;\n }\n }\n\n $this->setTotalTaxable($taxable);\n $this->setTotalExpenses($expenses);\n $this->setTotalOutlays($outlays);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check scenario with group chunking User user1 will share file to user2 and other file to 205 groups, in which user2 is member
public function testGetAllSharedGroupChunking($storageStringId, $fileName1, $fileName2) { $storageId = $this->createTestStorageEntry($storageStringId); $user1 = $this->createMock(IUser::class); $user1->method('getUID')->willReturn('user1'); $user2 = $this->createMock(IUser::class); $user2->method('getUID')->willReturn('user2'); $fileId1 = $this->createTestFileEntry($fileName1, $storageId); $idUser = $this->addShareToDB(Share::SHARE_TYPE_USER, 'user2', 'user1', 'user1', 'file', $fileId1, 'for_meow_user', 31, null, null, null); $fileId2 = $this->createTestFileEntry($fileName2, $storageId); for ($i = 0; $i < 205; $i++) { $groupId = 'group'.$i; $group = $this->createMock(IGroup::class); $group->method('getGID')->willReturn($groupId); $groupArray[] = $group; $idGroups[] = $this->addShareToDB(Share::SHARE_TYPE_GROUP, $groupId, 'user1', 'user1', 'file', $fileId2, 'target'.$groupId, 31, null, null, null); } $this->groupManager->method('get')->with('group')->willReturn($group); $this->groupManager->method('getUserGroups')->willReturnCallback(function ($user) use ($groupArray) { $userUID = $user->getUID(); if ($userUID === 'user2') { return $groupArray; } return []; }); // Setup mocking $this->userManager->method('get')->willReturnMap([ ['user1', false, $user1], ['user2', false, $user2], ]); $this->rootFolder->method('getUserFolder')->with('user1')->will($this->returnSelf()); $node1 = $this->createMock(File::class); $node1->method('getId')->willReturn($fileId1); $node2 = $this->createMock(File::class); $node2->method('getId')->willReturn($fileId2); $this->rootFolder->method('getById')->willReturnCallback(function ($id) use ($node1, $node2) { if ($node1->getId() === $id) { return [$node1]; } return [$node2]; }); $recShares = $this->provider->getAllSharedWith('user1', null); $this->assertCount(0, $recShares); $recShares = $this->provider->getAllSharedWith('user2', null); $this->assertCount(206, $recShares); foreach ($recShares as $share) { if ($share->getShareType() === Share::SHARE_TYPE_USER) { $this->assertEquals($idUser, $share->getId()); $this->assertSame('user2', $share->getSharedWith()); $this->assertSame('user1', $share->getShareOwner()); $this->assertSame('user1', $share->getSharedBy()); $shareNode = $share->getNode(); $this->assertSame($node1, $shareNode); } else { $this->assertContains((int) $share->getId(), $idGroups); $this->assertStringStartsWith('group', $share->getSharedWith()); $this->assertSame('user1', $share->getShareOwner()); $this->assertSame('user1', $share->getSharedBy()); $shareNode = $share->getNode(); $this->assertSame($node2, $shareNode); } } }
[ "function fm_user_has_shared($original=0, $link=0, $ownertype) {\r\n\tglobal $USER, $CFG;\r\n\r\n\tif ($link == 0) {\r\n\t\tif (!$sharedfiles = (count_records('fmanager_shared', \"owner\", $original, \"ownertype\", $ownertype,\"userid\", $USER->id) + count_records('fmanager_shared', \"owner\", $original, \"ownertype\", $ownertype,\"userid\", 0))) {\t\r\n\t\t\terror(get_string(\"errnoshared\", 'block_file_manager'));\r\n\t\t}\r\n\t} else {\r\n\t\tif (!$sharedfiles = (count_records('fmanager_shared',\"owner=$original AND ownertype\", $ownertype,\"userid\",$USER->id,\"sharedlink\",$link) + count_records('fmanager_shared',\"owner=$original AND ownertype\", $ownertype,\"userid\",0,\"sharedlink\",$link))) {\r\n\t\t\terror(get_string(\"errnoshared\",'block_file_manager'));\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "public function testPermissionUpgradeOnUserDeletedGroupShare() {\n\t\t$g = \\OC::$server->getGroupManager()->createGroup('testGroup');\n\t\t$g->addUser(\\OC::$server->getUserManager()->get(self::TEST_FILES_SHARING_API_USER1));\n\t\t$g->addUser(\\OC::$server->getUserManager()->get(self::TEST_FILES_SHARING_API_USER2));\n\t\t$g->addUser(\\OC::$server->getUserManager()->get(self::TEST_FILES_SHARING_API_USER3));\n\n\t\t$connection = \\OC::$server->getDatabaseConnection();\n\n\t\t// Share item with group\n\t\t$fileinfo = $this->view->getFileInfo($this->folder);\n\t\t$share = $this->share(\n\t\t\t\\OCP\\Share::SHARE_TYPE_GROUP,\n\t\t\t$this->folder,\n\t\t\tself::TEST_FILES_SHARING_API_USER1,\n\t\t\t'testGroup',\n\t\t\t\\OCP\\Constants::PERMISSION_READ\n\t\t);\n\n\t\t// Login as user 2 and verify the item exists\n\t\tself::loginHelper(self::TEST_FILES_SHARING_API_USER2);\n\t\t$this->assertTrue(\\OC\\Files\\Filesystem::file_exists($this->folder));\n\t\t$result = $this->shareManager->getShareById($share->getFullId(), self::TEST_FILES_SHARING_API_USER2);\n\t\t$this->assertNotEmpty($result);\n\t\t$this->assertEquals(\\OCP\\Constants::PERMISSION_READ, $result->getPermissions());\n\n\t\t// Delete the share\n\t\t$this->assertTrue(\\OC\\Files\\Filesystem::rmdir($this->folder));\n\t\t$this->assertFalse(\\OC\\Files\\Filesystem::file_exists($this->folder));\n\n\t\t// Verify we do not get a share\n\t\t$result = $this->shareManager->getShareById($share->getFullId(), self::TEST_FILES_SHARING_API_USER2);\n\t\t$this->assertEquals(\\OCP\\Constants::PERMISSION_READ, $result->getPermissions());\n\t\t$this->assertEquals(\\OCP\\Share::STATE_REJECTED, $result->getState());\n\n\t\t// Login as user 1 again and change permissions\n\t\tself::loginHelper(self::TEST_FILES_SHARING_API_USER1);\n\t\t$share->setPermissions(\\OCP\\Constants::PERMISSION_ALL);\n\t\t$share = $this->shareManager->updateShare($share);\n\n\t\t// Login as user 2 and verify\n\t\tself::loginHelper(self::TEST_FILES_SHARING_API_USER2);\n\t\t$this->assertFalse(\\OC\\Files\\Filesystem::file_exists($this->folder));\n\t\t$result = $this->shareManager->getShareById($share->getFullId(), self::TEST_FILES_SHARING_API_USER2);\n\t\t$this->assertEquals(\\OCP\\Constants::PERMISSION_ALL, $result->getPermissions());\n\t\t$this->assertEquals(\\OCP\\Share::STATE_REJECTED, $result->getState());\n\n\t\t$this->shareManager->deleteShare($share);\n\n\t\t//cleanup\n\t\tself::loginHelper(self::TEST_FILES_SHARING_API_USER1);\n\t\t$g = \\OC::$server->getGroupManager()->createGroup('testGroup');\n\t\t$g->removeUser(\\OC::$server->getUserManager()->get(self::TEST_FILES_SHARING_API_USER1));\n\t\t$g->removeUser(\\OC::$server->getUserManager()->get(self::TEST_FILES_SHARING_API_USER2));\n\t\t$g->removeUser(\\OC::$server->getUserManager()->get(self::TEST_FILES_SHARING_API_USER3));\n\t}", "public function outgoingServer2ServerGroupSharesAllowed();", "public function foldershareduser($id_usershared);", "public function testMoveGroupShare() {\n\t\t$g = \\OC::$server->getGroupManager()->createGroup('testGroup');\n\t\t$g->addUser(\\OC::$server->getUserManager()->get(self::TEST_FILES_SHARING_API_USER1));\n\t\t$g->addUser(\\OC::$server->getUserManager()->get(self::TEST_FILES_SHARING_API_USER2));\n\t\t$g->addUser(\\OC::$server->getUserManager()->get(self::TEST_FILES_SHARING_API_USER3));\n\n\t\t$fileinfo = $this->view->getFileInfo($this->filename);\n\t\t$share = $this->share(\n\t\t\t\\OCP\\Share::SHARE_TYPE_GROUP,\n\t\t\t$this->filename,\n\t\t\tself::TEST_FILES_SHARING_API_USER1,\n\t\t\t'testGroup',\n\t\t\t\\OCP\\Constants::PERMISSION_READ | \\OCP\\Constants::PERMISSION_UPDATE | \\OCP\\Constants::PERMISSION_SHARE\n\t\t);\n\n\t\tself::loginHelper(self::TEST_FILES_SHARING_API_USER2);\n\n\t\t$this->assertTrue(\\OC\\Files\\Filesystem::file_exists($this->filename));\n\n\t\t\\OC\\Files\\Filesystem::rename($this->filename, \"newFileName\");\n\n\t\t$this->assertTrue(\\OC\\Files\\Filesystem::file_exists('newFileName'));\n\t\t$this->assertFalse(\\OC\\Files\\Filesystem::file_exists($this->filename));\n\n\t\tself::loginHelper(self::TEST_FILES_SHARING_API_USER3);\n\t\t$this->assertTrue(\\OC\\Files\\Filesystem::file_exists($this->filename));\n\t\t$this->assertFalse(\\OC\\Files\\Filesystem::file_exists(\"newFileName\"));\n\n\t\tself::loginHelper(self::TEST_FILES_SHARING_API_USER3);\n\t\t$this->assertTrue(\\OC\\Files\\Filesystem::file_exists($this->filename));\n\t\t$this->assertFalse(\\OC\\Files\\Filesystem::file_exists(\"newFileName\"));\n\n\t\t//cleanup\n\t\tself::loginHelper(self::TEST_FILES_SHARING_API_USER1);\n\t\t$this->shareManager->deleteShare($share);\n\t\t$g = \\OC::$server->getGroupManager()->createGroup('testGroup');\n\t\t$g->removeUser(\\OC::$server->getUserManager()->get(self::TEST_FILES_SHARING_API_USER1));\n\t\t$g->removeUser(\\OC::$server->getUserManager()->get(self::TEST_FILES_SHARING_API_USER2));\n\t\t$g->removeUser(\\OC::$server->getUserManager()->get(self::TEST_FILES_SHARING_API_USER3));\n\t}", "private static function db_folder_is_shared_with_me($path,$user = ''){\n\t\t$path = str_replace('/Shared/', '/', $path); //TODO REGEX for shared at the begining only!\n\t\t\n\t\tif ($user = '' ) {\n\t\t$user = OCP\\User::getUser();\t\t\t\n\t\t}\n\n\t\t$query=OC_DB::prepare('SELECT * FROM `*PREFIX*share` WHERE `file_target` = ? AND (`share_with` = ? OR `uid_owner` = ?)');\n\t\t$result=$query->execute(array($path,$user,$user));\nvar_dump($result);\n\t\tif(OC_DB::isError($result)) {\n\t\t\t\\OCP\\Util::writeLog('mailnotify', 'database error at '.__LINE__ .' Result='.$result, \\OCP\\Util::ERROR);\n\t\t\treturn -1;\n\t\t}\n\t\t\n\t\tif($result->numRows() > 0){\t\t\t\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "protected function permissionsGroupShare()\n {\n $groupshare = self::$share->newShare('jane', 'groupshare', 'Group Share');\n $groupshare->addGroupPermission('mygroup', Horde_Perms::SHOW | Horde_Perms::READ | Horde_Perms::DELETE);\n $groupshare->save();\n $this->assertTrue($groupshare->hasPermission('john', Horde_Perms::SHOW));\n $this->assertTrue($groupshare->hasPermission('john', Horde_Perms::READ));\n $this->assertFalse($groupshare->hasPermission('john', Horde_Perms::EDIT));\n $this->assertTrue($groupshare->hasPermission('john', Horde_Perms::DELETE));\n }", "function user_belong_to_same_group($user1id,$user2id,$courseid) {\n\techo $user1id;\n\techo '<br/>';\n\techo $user2id;\n\t$groupids1=get_records('groups_members','userid',$user1id);\n\t$groupids2=get_records('groups_members','userid',$user2id);\n\t$check=0;\n\tforeach($groupids1 as $groupid1) {\n\t\tforeach($groupids2 as $groupid2) {\n\t\t\tif ($groupid1->groupid==$groupid2->groupid) {\n\t\t\t\t$check=1;\n\t\t\t}\n\t\t}\n\t}\n\tif($check==1) {\n\t\treturn true;\n\t}\n\telse{\n\t\treturn false;\n\t}\n}", "public static function share()\r\n {\r\n if(!isset($_POST['email']) || !isset($_POST['fileName']))\r\n return 1;\r\n\r\n $shareEmail = strtolower($_POST['email']);\r\n $fileName = $_POST['fileName'];\r\n\r\n $file = \\Model\\File::getFile($fileName, $_SESSION['UserID']);\r\n $shareUserId = \\Model\\Users::getUser($shareEmail);\r\n\r\n if ($file == null)\r\n return 2;\r\n\r\n if ($shareUserId['UserID'] == null or $shareUserId['UserID'] == $_SESSION['UserID'])\r\n return 3;\r\n\r\n global $db;\r\n\r\n $stmt = $db->prepare('INSERT INTO HasAccessTo (FileID, UserID) VALUES (?, ?);');\r\n $stmt->bindParam(1, $file['FileID'], \\PDO::PARAM_STR);\r\n $stmt->bindParam(2, $shareUserId['UserID'], \\PDO::PARAM_STR);\r\n try {\r\n if ($stmt->execute() === false) {\r\n return 1;\r\n }\r\n } catch (\\PDOException $e) {\r\n return 4;\r\n }\r\n\r\n return 0;\r\n }", "function checkRemoteFile( $oSFTP, $sFileName, $local_user_path, $base_filename ) {\n\t\n\terror_log(\" CHILD MINDER: Waiting 1 Seconds...\" );\n\tsleep(1);\n\t\n\t$bDone = false;\n\t$iCount = 0;\n\t\n\twhile ( !$bDone ) {\n\t\t\n\t\t$aStatOut = $oSFTP->stat( $sFileName );\n\t\t$iSizeOne = $aStatOut[\"size\"];\n\t\t\n\t\terror_log(\" CHILD MINDER: Waiting 1 Seconds...\" );\n\t\tsleep(1);\n\t\t$iCount++;\n\t\t\n\t\t$aStatOut = $oSFTP->stat( $sFileName );\n\t\t$iSizeTwo = $aStatOut[\"size\"];\n\t\t\n\t\terror_log(\" CHILD MINDER: DIFF SIZE: \" . (($iSizeTwo - $iSizeOne)/1000) . \"KB\");\n\t\t\n\t\t\tif ( !empty($iSizeOne) && !empty($iSizeTwo) && ($iSizeTwo - $iSizeOne) == 0 ) {\n\t\n\t\t\t\terror_log(\" CHILD MINDER: Done!\");\n\t\t\t\t$bDone = true;\n\t\t\t\n\t\t\t// if the file is not there or accessible then timeout the minder and throw an error to the user.\n\t\t\t} else if ( $iCount >= 120 ) {\n\t\t\t\t\n\t\t\t\terror_log(\" CHILD MINDER: Process timeout at $iCount seconds!\");\n\t\t\t\terror_log(\" CHILD MINDER: Posting error to user\");\n\t\t\t\tunlink($local_user_path . \".tmp/.updater/\" . $base_filename . \" - Generating maps...\");\t\t\n\t\t\t\ttouch($local_user_path . \".tmp/.updater/\" . $base_filename . \" - Failed on generating maps! Please email helpdesk.\");\n\t\t\t\t\t\n\t\t\t\texit();\n\t\t\t\t\n\t\t\t} // end if\n\t\n\t} // end while\n\n}", "function fastdfs_storage_modify_by_filebuff(string $file_buff,\r\n int $file_offset, string $group_name, string $appender_filename\r\n , array $tracker_server = [], array $storage_server = []): bool\r\n{\r\n}", "public function storage_upload_slave_by_filebuff($file_buff, $group_name, $master_filename, $prefix_name, $file_ext_name='', $meta_list=array(), $tracker_server=array(), $storage_server=array()){}", "abstract protected function processShareData();", "public function get_group_shared_files_and_create_template($group_id)\n {\n $files = [];\n $data_lity = ' ';\n $allFiles = 'unknown|rar|zip|mp3|mp4|mov|flv|wmv|avi|doc|docx|pdf|xls|xlsx|zip|rar|txt|php|html|css|jpeg|jpg|png|swf|PNG|JPG|JPEG';\n $photoExtensions = 'unknown|jpeg|jpg|png|gif|swf|PNG|JPG|JPEG|';\n $docFiles = 'unknown|rar|zip|mp3|mp4|mov|flv|wmv|avi|doc|docx|pdf|xls|xlsx|zip|rar|txt|php|html|css';\n\n $dir = list_files(PR_CHAT_MODULE_GROUPS_UPLOAD_FOLDER);\n\n $from_messages_table = $this->db->query('SELECT file_name FROM ' . db_prefix() . 'chatgroupsharedfiles' . \" WHERE file_name REGEXP '^.*\\.(\" . $allFiles . \")$' AND group_id = '\" . $group_id . \"'\");\n\n if ($from_messages_table) {\n $from_messages_table = $from_messages_table->result_array();\n } else {\n return false;\n }\n foreach ($dir as $file_name) {\n foreach ($from_messages_table as $value) {\n if (strpos($file_name, $value['file_name']) !== false) {\n if (!in_array($file_name, $files)) {\n array_push($files, $file_name);\n }\n }\n }\n }\n\n $html = '';\n $html .= '<ul class=\"nav nav-tabs\" role=\"tablist\">';\n $html .= '<li class=\"active\"><a href=\"#group_photos\" role=\"tab\" data-toggle=\"tab\"><i class=\"fa fa-file-image-o icon_shared_files\" aria-hidden=\"true\"></i>' . _l('chat_photos_text') . '</a></li>';\n $html .= '<li><a href=\"#group_files\" role=\"tab\" data-toggle=\"tab\"><i class=\"fa fa-file-o icon_shared_files\" aria-hidden=\"true\"></i>' . _l('chat_files_text') . '</a></li>';\n $html .= '</ul>';\n\n $html .= '<div class=\"tab-content\">';\n $html .= '<div class=\"tab-pane active\" id=\"group_photos\">';\n $html .= '<span class=\"text-center shared_items_span\">' . _l('chat_shared_photos_text') . '</span>';\n\n foreach ($files as $file) {\n if (preg_match(\"/^[^\\?]+\\.('\" . $photoExtensions . \"')$/\", $file)) {\n $html .= \"<a data-lity href='\" . base_url('modules/prchat/uploads/groups/' . $file) . \"'>\n <div class='col-md-3 shared_files_ahref' style='background-image:url(\" . base_url('modules/prchat/uploads/groups/' . $file) . \");'></div></a>\";\n }\n }\n $html .= '</div>';\n $html .= '<div class=\"tab-pane\" id=\"group_files\">';\n $html .= '<span class=\"text-center shared_items_span\">' . _l('chat_shared_files_text') . '</span>';\n\n foreach ($files as $file) {\n if (strpos($file, '.pdf')) {\n $data_lity = 'data-lity';\n }\n if (preg_match(\"/^[^\\?]+\\.('\" . $docFiles . \"')$/\", $file)) {\n $html .= \"<div class='col-md-12'><a target='_blank' \" . $data_lity . \" href ='\" . base_url('modules/prchat/uploads/groups/' . $file) . \"'><i class='fa fa-file-o icon_shared_files' aria-hidden='true'></i>\" . $file . '</a></div>';\n }\n }\n $html .= '</div></div>';\n\n return $html;\n }", "public function checkFilesAndSpaces() {\n $users = $this->____load_model('UserModel')->search(array());\n foreach ($users as $user) {\n $this->logDebug('Checking ' . $user->user_name . '(' . $user->workshop . ') for using too many files or too much spaces ...');\n $this->__clear_feature();\n $this->__set_account($user, false);\n $this->validateFilesAndSpaces(true);\n }\n }", "public function shareWithGroupMembersOnly() {\n\t\treturn $this->config->getAppValue('core', 'shareapi_only_share_with_group_members', 'no') === 'yes';\n\t}", "function is_in_blocklist($user_id,$blockee) {\n\tif (file_exists(BLOCKS_L3.$user_id.'¬'.$blockee)) {\n\t\treturn true;\n\t} else if (file_exists(BLOCKS_L2.$user_id.'¬'.$blockee)) {\n\t\treturn true;\n\t} else if (file_exists(BLOCKS_L1.$user_id.'¬'.$blockee)) {\n\t\treturn true;\n\t} else if (file_exists(BLOCKS_L4.$user_id.'¬'.$blockee)) {\n\t\treturn true;\n\t} \n\treturn false;\n}", "public function shared()\n {\n // Get user\n $user_id = Auth::id();\n\n // Get shared folders and files\n $folder_ids = Share::where('user_id', $user_id)\n ->where('type', 'folder')\n ->pluck('item_id');\n\n $file_ids = Share::where('user_id', $user_id)\n ->where('type', '!=', 'folder')\n ->pluck('item_id');\n\n // Get folders and files\n $folders = FileManagerFolder::with(['parent', 'shared:token,id,item_id,permission,protected'])\n ->where('user_id', $user_id)\n ->whereIn('unique_id', $folder_ids)\n ->get();\n\n $files = FileManagerFile::with(['parent', 'shared:token,id,item_id,permission,protected'])\n ->where('user_id', $user_id)\n ->whereIn('unique_id', $file_ids)\n ->get();\n\n // Collect folders and files to single array\n return collect([$folders, $files])->collapse();\n }", "protected function setUpShares() {\n\t\t$this->fileIds[self::TEST_FILES_SHARING_API_USER1] = [];\n\t\t$this->fileIds[self::TEST_FILES_SHARING_API_USER2] = [];\n\t\t$this->fileIds[self::TEST_FILES_SHARING_API_USER3] = [];\n\t\t$this->fileIds[self::TEST_FILES_SHARING_API_USER4] = [];\n\n\t\t$this->rootView = new View('');\n\t\t$this->loginAsUser(self::TEST_FILES_SHARING_API_USER1);\n\t\t$view1 = new View('/' . self::TEST_FILES_SHARING_API_USER1 . '/files');\n\t\t$view1->mkdir('/test/sub');\n\n\t\t$this->share(\n\t\t\t\\OCP\\Share::SHARE_TYPE_GROUP,\n\t\t\t'/test',\n\t\t\tself::TEST_FILES_SHARING_API_USER1,\n\t\t\t'group1',\n\t\t\t\\OCP\\Constants::PERMISSION_ALL\n\t\t);\n\t\t$this->fileIds[self::TEST_FILES_SHARING_API_USER1][''] = $view1->getFileInfo('')->getId();\n\t\t$this->fileIds[self::TEST_FILES_SHARING_API_USER1]['test'] = $view1->getFileInfo('test')->getId();\n\t\t$this->fileIds[self::TEST_FILES_SHARING_API_USER1]['test/sub'] = $view1->getFileInfo('test/sub')->getId();\n\n\t\t$this->loginAsUser(self::TEST_FILES_SHARING_API_USER2);\n\t\t$view2 = new View('/' . self::TEST_FILES_SHARING_API_USER2 . '/files');\n\n\t\t$this->share(\n\t\t\t\\OCP\\Share::SHARE_TYPE_GROUP,\n\t\t\t'/test',\n\t\t\tself::TEST_FILES_SHARING_API_USER2,\n\t\t\t'group2',\n\t\t\t\\OCP\\Constants::PERMISSION_ALL\n\t\t);\n\t\t$this->share(\n\t\t\t\\OCP\\Share::SHARE_TYPE_GROUP,\n\t\t\t'/test/sub',\n\t\t\tself::TEST_FILES_SHARING_API_USER2,\n\t\t\t'group3',\n\t\t\t\\OCP\\Constants::PERMISSION_ALL\n\t\t);\n\n\t\t$this->fileIds[self::TEST_FILES_SHARING_API_USER2][''] = $view2->getFileInfo('')->getId();\n\t\t$this->fileIds[self::TEST_FILES_SHARING_API_USER2]['test'] = $view2->getFileInfo('test')->getId();\n\t\t$this->fileIds[self::TEST_FILES_SHARING_API_USER2]['test/sub'] = $view2->getFileInfo('test/sub')->getId();\n\n\t\t$this->loginAsUser(self::TEST_FILES_SHARING_API_USER3);\n\t\t$view3 = new View('/' . self::TEST_FILES_SHARING_API_USER3 . '/files');\n\t\t$this->fileIds[self::TEST_FILES_SHARING_API_USER3][''] = $view3->getFileInfo('')->getId();\n\t\t$this->fileIds[self::TEST_FILES_SHARING_API_USER3]['test'] = $view3->getFileInfo('test')->getId();\n\t\t$this->fileIds[self::TEST_FILES_SHARING_API_USER3]['test/sub'] = $view3->getFileInfo('test/sub')->getId();\n\n\t\t$this->loginAsUser(self::TEST_FILES_SHARING_API_USER4);\n\t\t$view4 = new View('/' . self::TEST_FILES_SHARING_API_USER4 . '/files');\n\t\t$this->fileIds[self::TEST_FILES_SHARING_API_USER4][''] = $view4->getFileInfo('')->getId();\n\t\t$this->fileIds[self::TEST_FILES_SHARING_API_USER4]['sub'] = $view4->getFileInfo('sub')->getId();\n\n\t\tforeach ($this->fileIds as $user => $ids) {\n\t\t\t$this->loginAsUser($user);\n\t\t\tforeach ($ids as $id) {\n\t\t\t\t$path = $this->rootView->getPath($id);\n\t\t\t\t$this->fileEtags[$id] = $this->rootView->getFileInfo($path)->getEtag();\n\t\t\t}\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the private 'doctrine.database_import_command' shared service.
protected function getDoctrine_DatabaseImportCommandService() { include_once \dirname(__DIR__, 4).'/vendor/symfony/console/Command/Command.php'; include_once \dirname(__DIR__, 4).'/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Command/ImportCommand.php'; include_once \dirname(__DIR__, 4).'/vendor/doctrine/doctrine-bundle/Command/Proxy/ImportDoctrineCommand.php'; $this->privates['doctrine.database_import_command'] = $instance = new \Doctrine\Bundle\DoctrineBundle\Command\Proxy\ImportDoctrineCommand(); $instance->setName('doctrine:database:import'); return $instance; }
[ "protected function getDoctrine_MappingImportCommandService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/console/Command/Command.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/doctrine-bundle/Command/DoctrineCommand.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/doctrine-bundle/Command/ImportMappingDoctrineCommand.php';\n\n $this->privates['doctrine.mapping_import_command'] = $instance = new \\Doctrine\\Bundle\\DoctrineBundle\\Command\\ImportMappingDoctrineCommand(($this->services['doctrine'] ?? $this->getDoctrineService()), $this->parameters['kernel.bundles']);\n\n $instance->setName('doctrine:mapping:import');\n\n return $instance;\n }", "protected function getDoctrine_MappingImportCommandService()\n {\n return $this->services['doctrine.mapping_import_command'] = new \\Doctrine\\Bundle\\DoctrineBundle\\Command\\ImportMappingDoctrineCommand();\n }", "protected function getImportCommandService()\n {\n $this->services['TYPO3\\\\CMS\\\\Impexp\\\\Command\\\\ImportCommand'] = $instance = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Impexp\\Command\\ImportCommand::class);\n\n $instance->setName('impexp:import');\n\n return $instance;\n }", "private function getImportCommand()\n {\n return new IndexImportCommand(self::getContainer());\n }", "protected function getSonataDumpDoctrineMetaCommandService()\n {\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\console\\\\Command\\\\Command.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\dependency-injection\\\\ContainerAwareInterface.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\framework-bundle\\\\Command\\\\ContainerAwareCommand.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\sonata-project\\\\core-bundle\\\\src\\\\CoreBundle\\\\Command\\\\SonataDumpDoctrineMetaCommand.php';\n\n return $this->services['console.command.public_alias.Sonata\\\\CoreBundle\\\\Command\\\\SonataDumpDoctrineMetaCommand'] = new \\Sonata\\CoreBundle\\Command\\SonataDumpDoctrineMetaCommand();\n }", "protected function getDoctrineMigrations_DiffCommandService()\n {\n return $this->services['doctrine_migrations.diff_command'] = new \\Doctrine\\Bundle\\MigrationsBundle\\Command\\MigrationsDiffDoctrineCommand();\n }", "protected function getDoctrine_MappingConvertCommandService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/console/Command/Command.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/doctrine-bundle/Command/Proxy/ConvertMappingDoctrineCommand.php';\n\n $this->privates['doctrine.mapping_convert_command'] = $instance = new \\Doctrine\\Bundle\\DoctrineBundle\\Command\\Proxy\\ConvertMappingDoctrineCommand();\n\n $instance->setName('doctrine:mapping:convert');\n\n return $instance;\n }", "protected function getDoctrine_MappingConvertCommandService()\n {\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\console\\\\Command\\\\Command.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\doctrine\\\\orm\\\\lib\\\\Doctrine\\\\ORM\\\\Tools\\\\Console\\\\Command\\\\ConvertMappingCommand.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\doctrine\\\\doctrine-bundle\\\\Command\\\\Proxy\\\\ConvertMappingDoctrineCommand.php';\n\n $this->privates['doctrine.mapping_convert_command'] = $instance = new \\Doctrine\\Bundle\\DoctrineBundle\\Command\\Proxy\\ConvertMappingDoctrineCommand();\n\n $instance->setName('doctrine:mapping:convert');\n\n return $instance;\n }", "protected function getRunSqlCommandService()\n {\n $this->privates['Doctrine\\\\DBAL\\\\Tools\\\\Console\\\\Command\\\\RunSqlCommand'] = $instance = new \\Doctrine\\DBAL\\Tools\\Console\\Command\\RunSqlCommand(new \\Doctrine\\Bundle\\DoctrineBundle\\Dbal\\ManagerRegistryAwareConnectionProvider(new \\Doctrine\\Bundle\\DoctrineBundle\\Registry($this, $this->parameters['doctrine.connections'], $this->parameters['doctrine.entity_managers'], 'default', 'default')));\n\n $instance->setName('dbal:run-sql');\n\n return $instance;\n }", "protected function getDoctrine_DatabaseDropCommandService()\n {\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\console\\\\Command\\\\Command.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\doctrine\\\\doctrine-bundle\\\\Command\\\\DoctrineCommand.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\doctrine\\\\doctrine-bundle\\\\Command\\\\DropDatabaseDoctrineCommand.php';\n\n $this->privates['doctrine.database_drop_command'] = $instance = new \\Doctrine\\Bundle\\DoctrineBundle\\Command\\DropDatabaseDoctrineCommand(($this->services['doctrine'] ?? $this->getDoctrineService()));\n\n $instance->setName('doctrine:database:drop');\n\n return $instance;\n }", "protected function getDoctrine_DatabaseDropCommandService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/console/Command/Command.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/doctrine-bundle/Command/DoctrineCommand.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/doctrine-bundle/Command/DropDatabaseDoctrineCommand.php';\n\n $this->privates['doctrine.database_drop_command'] = $instance = new \\Doctrine\\Bundle\\DoctrineBundle\\Command\\DropDatabaseDoctrineCommand(($this->services['doctrine'] ?? $this->getDoctrineService()));\n\n $instance->setName('doctrine:database:drop');\n\n return $instance;\n }", "protected function getDoctrineMigrations_GenerateCommandService()\n {\n return $this->services['doctrine_migrations.generate_command'] = new \\Doctrine\\Bundle\\MigrationsBundle\\Command\\MigrationsGenerateDoctrineCommand();\n }", "protected function getDoctrineMigrations_VersionCommandService()\n {\n return $this->services['doctrine_migrations.version_command'] = new \\Doctrine\\Bundle\\MigrationsBundle\\Command\\MigrationsVersionDoctrineCommand();\n }", "protected function getDumpAutoloadCommandService()\n {\n $this->services['TYPO3\\\\CMS\\\\Core\\\\Command\\\\DumpAutoloadCommand'] = $instance = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Core\\Command\\DumpAutoloadCommand::class);\n\n $instance->setName('dumpautoload');\n $instance->setAliases([0 => 'extensionmanager:extension:dumpclassloadinginformation', 1 => 'extension:dumpclassloadinginformation']);\n\n return $instance;\n }", "protected function getSonata_CoreBundle_Command_SonataDumpDoctrineMetaCommandService()\n {\n return $this->services['Sonata\\CoreBundle\\Command\\SonataDumpDoctrineMetaCommand'] = new \\Sonata\\CoreBundle\\Command\\SonataDumpDoctrineMetaCommand();\n }", "protected function getDoctrine_EnsureProductionSettingsCommandService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/console/Command/Command.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/EnsureProductionSettingsCommand.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/doctrine-bundle/Command/Proxy/EnsureProductionSettingsDoctrineCommand.php';\n\n $this->privates['doctrine.ensure_production_settings_command'] = $instance = new \\Doctrine\\Bundle\\DoctrineBundle\\Command\\Proxy\\EnsureProductionSettingsDoctrineCommand();\n\n $instance->setName('doctrine:ensure-production-settings');\n\n return $instance;\n }", "protected function getDoctrineMigrations_DumpSchemaCommandService()\n {\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\console\\\\Command\\\\Command.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\doctrine\\\\migrations\\\\lib\\\\Doctrine\\\\Migrations\\\\Tools\\\\Console\\\\Command\\\\AbstractCommand.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\doctrine\\\\migrations\\\\lib\\\\Doctrine\\\\Migrations\\\\Tools\\\\Console\\\\Command\\\\DumpSchemaCommand.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\doctrine\\\\doctrine-migrations-bundle\\\\Command\\\\MigrationsDumpSchemaDoctrineCommand.php';\n\n $this->privates['doctrine_migrations.dump_schema_command'] = $instance = new \\Doctrine\\Bundle\\MigrationsBundle\\Command\\MigrationsDumpSchemaDoctrineCommand();\n\n $instance->setName('doctrine:migrations:dump-schema');\n\n return $instance;\n }", "protected function getDoctrine_QuerySqlCommandService()\n {\n $this->privates['doctrine.query_sql_command'] = $instance = new \\Doctrine\\Bundle\\DoctrineBundle\\Command\\Proxy\\RunSqlDoctrineCommand();\n\n $instance->setName('doctrine:query:sql');\n\n return $instance;\n }", "protected function getDoctrineMigrations_SyncMetadataCommandService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/console/Command/Command.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/migrations/lib/Doctrine/Migrations/Tools/Console/Command/DoctrineCommand.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/migrations/lib/Doctrine/Migrations/Tools/Console/Command/SyncMetadataCommand.php';\n\n $this->privates['doctrine_migrations.sync_metadata_command'] = $instance = new \\Doctrine\\Migrations\\Tools\\Console\\Command\\SyncMetadataCommand(($this->privates['doctrine.migrations.dependency_factory'] ?? $this->getDoctrine_Migrations_DependencyFactoryService()), 'doctrine:migrations:sync-metadata-storage');\n\n $instance->setName('doctrine:migrations:sync-metadata-storage');\n\n return $instance;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO: Implement click() method.
public function click(): void { }
[ "public function click()\n {\n }", "public function click()\n {\n $this->con->executeStep(sprintf('_sahi._click(%s)', $this->getAccessor()));\n }", "public function action_click(): void {\n\t\t$this->triggerEvent('click');\n\t}", "public function clickFinger()\n {\n }", "function click($xpath)\n {\n \n }", "public function click(Link $link);", "public function click() {\r\n\t\tswitch($this->current) {\r\n\t\t\tdefault:\r\n\t\t\t\t$this->current = self::SEA;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase self::ISLAND:\r\n\t\t\t\t$this->current = self::NONE;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase self::SEA:\r\n\t\t\t\t$this->current = self::ISLAND;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}", "public function click($id)\n\t{\n\t\t$this->connection()->post(\"element/$id/click\", array());\n\t}", "function click($x,$y)\n\t{\n\t\treturn $this->call(\"Mouse.Click?x=\".urlencode($x).\"&y=\".urlencode($y));\n\t}", "function MouseClicked($item){}", "abstract public function clickLink($locator);", "function click($element) {\n\t\t$this->driver->findElement(WebDriverBy::CssSelector($element))->click();\n\t}", "public function click($link, $context = NULL): void {\n $this->getScenario()->runStep(new \\Codeception\\Step\\Action('click', func_get_args()));\n }", "public function pressButton();", "public function rightClick()\n {\n $this->con->executeStep(sprintf('_sahi._rightClick(%s)', $this->getAccessor()));\n }", "function writeOnClick($value) { $this->_onclick = $value; }", "public function clickFileActionButton() {\n\t\t$this->findFileActionButton()->click();\n\t}", "protected function optimal_click ($loc)\n {\n sleep(1);\n try\n {\n $this->waitForVisible($loc);\n $this->click($loc);\n }\n catch (Exception $e)\n {\n $this->fail(\"!!! FAIL: not found \". $loc);\n }\n sleep(1);\n }", "protected function click($selector) {\n $this->getSession()->getDriver()->click($selector);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a fully aliased field name for translated fields. If the requested field is configured as a translation field, the `content` field with an alias of a corresponding association is returned. Tablealiased field name is returned for all other fields.
public function translationField(string $field): string { $table = $this->table; if ($this->getLocale() === $this->getConfig('defaultLocale')) { return $table->aliasField($field); } $associationName = $table->getAlias() . '_' . $field . '_translation'; if ($table->associations()->has($associationName)) { return $associationName . '.content'; } return $table->aliasField($field); }
[ "public function aliasField(string $field): string;", "public function _getFieldTableAlias($field)\n {\n if (strpos($field, 'customer') === 0) {\n return $field .'_table.value';\n }\n\n if ($field == 'type') {\n return $this->getConnection()->getCheckSql('main_table.customer_id = 0', 1, 2);\n }\n\n if (in_array($field, array('website_id', 'group_id'))) {\n return 'store.' . $field;\n }\n\n return 'main_table.' . $field;\n }", "public function getAliasFieldName()\n {\n return $this->aliasFieldName;\n }", "protected function _getMetaFieldAlias($field)\n\t{\n\t\treturn 'meta_field_' . str_replace('-', '_', $field);\n\t}", "private function getFieldName($alias)\n {\n return isset($this->tableFields[$alias]) ? $this->tableFields[$alias] : $alias;\n }", "private function _FieldToAlias($field)\n\t{\n\t\tlist($table, $alias) = explode('_', $field);\n\t\treturn (empty($alias) ? $table : $alias);\n\t}", "private static function translate_field($field, $caption, $fieldMap) {\n if (isset($fieldMap[$field])) {\n return lang::get(ucfirst($fieldMap[$field]));\n }\n else {\n // look in the translation settings to see if this column name needs overriding\n $trans = lang::get(\"dd:$field\");\n // Only update the caption if this actually did anything\n if ($trans != \"dd:$field\" ) {\n return $trans;\n }\n else {\n return $caption;\n }\n }\n }", "public function getFieldWithTableAlias($name, $table_alias = null)\n {\n $replace = $table_alias === null ? '' : sprintf(\"%s.\", $table_alias);\n\n return $this->replaceToken($this->checkFieldExist($name)->fields[$name], $replace);\n }", "public function get_sql_column_concat_alias($field): string\n {\n return $this->object_name().'_'.$field.'_concat';\n }", "private static function translate_field($field, $caption) {\r\n // look in the translation settings to see if this column name needs overriding\r\n $trans = lang::get(\"dd:$field\");\r\n // Only update the caption if this actually did anything\r\n if ($trans != \"dd:$field\" ) {\r\n return $trans;\r\n } else {\r\n return $caption;\r\n }\r\n }", "protected function getFieldForSQL()\n {\n if ($this->isMultilingualAttribute() && Product::countTranslatedProducts()) {\n $field = sprintf(\n 'IFNULL(translation.%s, %s.%s)',\n $this->arrConfig['attribute'],\n Product::getTable(),\n $this->arrConfig['attribute']\n );\n } else {\n $field = Product::getTable() . '.' . $this->arrConfig['attribute'];\n }\n\n return $field;\n }", "public function getFieldAlias($alias)\n\t{\n\t\tif (array_key_exists($alias, $this->aliasFields))\n\t\t{\n\t\t\treturn $this->aliasFields[$alias];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $alias;\n\t\t}\n\t}", "public function alias($field = NULL, $join = NULL)\n\t{\t\n\t\t$meta = $this->meta();\n\t\t\n\t\t// Return the model's alias if nothing is passed\n\t\tif (!$field)\n\t\t{\n\t\t\treturn $meta->table;\n\t\t}\n\t\t\n\t\t// Split off the table name; we already know that\n\t\tif (strpos($field, '.') !== FALSE)\n\t\t{\t\t\t\n\t\t\tlist(, $field) = explode('.', $field);\n\t\t}\n\t\t\n\t\t// Check and concatenate\n\t\tif ($this->field($field))\n\t\t{\n\t\t\t$field = $this->field($field)->column;\n\t\t}\n\t\t\n\t\tif ($join)\n\t\t{\n\t\t\treturn $meta->table.'.'.$field;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $field;\n\t\t}\n\t}", "private function translate_field_alias($field_name) {\n $lowercase_field = strtolower($field_name);\n $alias_array = array_flip($this->addon->location_fields);\n if (isset($alias_array[$lowercase_field])) {\n $lowercase_field = $alias_array[$lowercase_field];\n }\n return $lowercase_field;\n }", "function getTableAlias(&$sql,$table,$field) {\n\t\t$alias='';\n\t\t// We replace '.' with '_' to generate alias name\n\t\t// If Table already is in Table Array we must generate an alias for it ...\n\t\t// Hmm normally we should only generate an alias if we haven't already used the table ...\n\t\t// We look for foreign table (field name with a '.').\n\t\t// get link id, link is relation to table ...\n\t\n\t\t$FT='';\n\t\tif (strpos($field,'.')>0) {\n\t\t $FTAA=t3lib_div::trimexplode('.',$field);\n \t$FT=$FTAA[0];\n\t }\n\t \n\t $link=$table.($FT?'_'.$FT:'');\n\t \n\t // Table aliases \n\t\t/*\n\t\tif (!in_array($link,$sql['tablejoins'])) {\t\t\t\n\t\t\t$sql['tablejoins'][]=$link;\n\t\t\t$sql['tableArray.'][$link]['table']=$table;\t\t\t\n\t\t\t$sql['tableArray.'][$link]['alias']=$link;\n\t\t}\n\t\t*/\n\t\t\n\t $fieldalias=str_replace('.','_',$field).'_'.$link;\t \n\t\t$sql['tableArray'][]=$link;\n\t\t// field aliases\t\t\n\t\t$sql['fields.'][$field.'.']['table']=$table;\n\t\t$sql['fields.'][$field.'.']['tablealias']=$link;\n\t\t$sql['fields.'][$field.'.']['fieldalias']=$fieldalias;\n\n\t\t//$alias=$table;\n\t\t\t\t\n\t\treturn $link;\n\t}", "public function dbFieldName($fieldName)\n\t{\n\t\t// Check if field is a raw expression\n\t\tif ($fieldName instanceof TauSqlExpression) {\n\t\t\treturn $fieldName->get();\n\t\t}\n\n\t\t// Split string at \"as,\" if available\n\t\t$pos = stripos($fieldName, \" as \");\n\t\tif ($pos !== false) {\n\t\t\t$field = substr($fieldName, 0, $pos);\n\t\t\t$alias = substr($fieldName, $pos + 4);\n\t\t} else {\n\t\t\t$field = $fieldName;\n\t\t\t$alias = null;\n\t\t}\n\n\t\t$field = trim($field, \"\\\"\\r\\n\\t \");\n\t\tif ($alias) {\n\t\t\t$alias = trim($alias, \"\\\"\\r\\n\\t \");\n\t\t\t$alias = '\"' . $this->dbEscape($alias) . '\"';\n\t\t}\n\n\t\t// Look for SQL function. \"(\" isn't allowed in field names\n\t\tif (strpos($field, \"(\")) {\n\t\t\tif ($alias) {\n\t\t\t\treturn $field . ' as ' . $alias;\n\t\t\t}\n\t\t\treturn $field;\n\t\t}\n\n\t\t// Maybe it's a SELECT ALL field\n\t\tif ($field === \"*\") {\n\t\t\treturn $field;\n\t\t}\n\n\t\t// Everyday, ordinary field name\n\t\t$parts = explode('.', $field);\n\t\tforeach ($parts as $key => $value) {\n\t\t\t$value = trim($value, \"\\\"\\r\\n\\t \");\n\t\t\tif ($value === \"*\") {\n\t\t\t\t$parts[$key] = \"*\";\n\t\t\t} else {\n\t\t\t\t$parts[$key] = '\"' . $this->dbEscape($value) . '\"';\n\t\t\t}\n\t\t}\n\t\t$field = implode(\".\", $parts);\n\n\t\tif ($alias) {\n\t\t\treturn $field . ' as ' . $alias;\n\t\t}\n\t\treturn $field;\n\t}", "public function getAliasOf()\n {\n return $this->fields['alias_of'];\n }", "public function get_field_name();", "public function getAlias(): string\n {\n if (empty($this->alias)) {\n $this->alias = $this->getPropertyPath('_');\n if (array_key_exists($this->alias, $this->parentCollection->getColumns())) {\n $this->alias = $this->getPropertyPath('_-_');\n }\n }\n\n return $this->alias;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Looks for the specified model config DB file
function get_model_config_db_path($dbFileName) { helper('string'); $mainPath = config('App')->model_config_path; $instancePath = config('App')->model_config_instance_path; $data = new \stdClass(); $data->exists = false; $data->disabled = false; $data->dirPath = $instancePath; $data->path = $instancePath . $dbFileName; // If $instancePath is whitespace/not defined, then always use $mainPath if (IsNullOrWhiteSpace($instancePath)) { $data->path = $mainPath . $dbFileName; $data->exists = file_exists($data->path); return $data; } // Test if the file exists in the instance model config directory $testPath = $instancePath . $dbFileName; if (file_exists($testPath)) { $data->path = $testPath; $data->exists = true; return $data; } // Test if the model is disabled in the instance model config directory $testPath .= '.disabled'; if (file_exists($testPath)) { $data->path = $testPath; $data->exists = false; $data->disabled = true; return $data; } // Test if the model exists in the main config directory $testPathMain = $mainPath . $dbFileName; if (file_exists($testPathMain)) { $data->path = $testPathMain; $data->exists = true; } return $data; }
[ "private function includeDB(){\n if(file_exists(MODELPATH . $this->modelName . '.php')){\n require_once MODELPATH . $this->modelName . '.php';\n return true;\n }else{\n return false;\n }\n }", "public function readDbConfig()\n {\n return parse_ini_file(dirname(__FILE__).$this->dbConf);\n }", "private static function __getDbConfig() {\n return include Sys::getCfgDir() . 'db.php';\n }", "function _loadDbConfig() {\n\t\tif (config ( 'database' ) && class_exists ( 'DATABASE_CONFIG' )) {\n\t\t\t$this->DbConfig = & new DATABASE_CONFIG ();\n\t\t\treturn true;\n\t\t}\n\t\t$this->err ( 'Database config could not be loaded.' );\n\t\t$this->out ( 'Run `bake` to create the database configuration.' );\n\t\treturn false;\n\t}", "public static function loadDBSettings() {\n $site = $_SERVER[\"SERVER_NAME\"] == \"\" ? $_SERVER[\"argv\"][1] : $_SERVER[\"SERVER_NAME\"];\n\n $databaseSettings = Registry::get(\"DATABASE_SETTING\");\n\n if (is_array($databaseSettings)) {\n foreach ($databaseSettings as $table) {\n try {\n Registry::loadFromDB($table); \n }\n catch(Exception $ex) { }\n }\n }\n \n }", "public static function getDb(){\n\t\t$db = SNECoreConfig::getDB();\n\t\treturn $db;\n\t}", "protected function parseDBConfig() {\n $configFile = ROOT_DIR . DIR_SEPARATOR . 'ini' . DIR_SEPARATOR . 'db.ini';\n\n if (file_exists($configFile)) {\n $this->db_settings = parse_ini_file($configFile, true);\n } else { \n throw new Exception('Global config file '.$configFile.' does not exist');\n }\n }", "public function getDbConfig() {\n return BizSystem::configuration()->getDatabaseInfo($this->getDatabaseName());\n }", "function getDbConfig() {\n\n $DB_CONFIG = file_get_contents(CURR_WORKING_DIR . \"config.json\");\n $DB_CONFIG = json_decode($DB_CONFIG);\n return $DB_CONFIG;\n}", "private function loadORM() {\n\t\t$orm = ActiveRecord\\Config::instance();\n\t\t$orm->set_model_directory(str_replace('/', '', $this->models_path));\n\t\t$orm->set_filename_extension('.class.php');\n\t\t$orm->set_connections($this->db_connections);\n\t\t$orm->set_default_connection($this->db_default);\n\t\treturn $orm;\n\t}", "public static function dbConfig()\n\t{\n\t\treturn Decoder::yamlParseFile(\"Config/DBConfig.yml\");\n\t}", "protected function _readDbConfig()\n {\n $this->_host = Config::DB_HOST;\n $this->_user = Config::DB_USER;\n $this->_password = Config::DB_PASS;\n $this->_dbName = Config::DB_NAME;\n }", "private function loadDatabaseConfiguration() {\n\t\t\t\n\t\t\t// Check to see if the database configuration file exists\n\t\t\tif (file_exists(\"database.config\")) {\n\t\t\t\t\n\t\t\t\t// Attempt to read the contents of the file\n\t\t\t\t$filedata = file(\"database.config\");\n\t\t\t\t\n\t\t\t\t// Update the database configuration information with the information from the file\n\t\t\t\tif (count($filedata) == 4) {\n\t\t\t\t\t$this->database_host = base64_decode($filedata[0]);\n\t\t\t\t\t$this->database_username = base64_decode($filedata[1]);\n\t\t\t\t\t$this->database_password = base64_decode($filedata[2]);\n\t\t\t\t\t$this->database_name = base64_decode($filedata[3]);\n\t\t\t\t\t$this->openDatabaseConnection();\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function configDb()\n {\n $this->_cli->writeln();\n $this->_cli->writeln($this->_cli->bold('Configuring database settings'));\n $this->_cli->writeln();\n\n $sql_config = $this->_config->configSQL('');\n $vars = new Horde_Variables();\n new Horde_Config_Form($vars, 'horde', true);\n $this->_cli->question(\n $vars,\n 'sql',\n 'phptype',\n $sql_config['switch']['custom']['fields']['phptype']);\n\n $this->writeConfig($vars);\n }", "public static function EloConfigure() {\n $conf_file = 'db.config.ini';\n $config= parse_ini_file($conf_file,true);\n\n if (!$config) \n throw new Exception(\"App::eloConfigure: could not parse config file $conf_file <br/>\");\n \n App::$origin = $config['SERVER']['origin'];\n \n \n\n $capsule = new DB();\n $capsule->addConnection($config['DB']);\n $capsule->setAsGlobal();\n $capsule->bootEloquent();\n }", "public static function getDatabaseConfiguration()\r\n {\r\n return self::autoConfig()->getConfiguration('Database');\r\n }", "function _config_db()\n {\n static $CC_DB_INFO_FILE;\n if( empty($CC_DB_INFO_FILE) )\n return( 'cc-config-db.php' );\n return( $CC_DB_INFO_FILE );\n }", "function findConfig() {\n\t$ini_array = null;\n\t$inipath = $_SERVER['DOCUMENT_ROOT'] . \"/config/database.ini\";\n\t$pathAdditions = 2;\n\n\t/*while (!file_exists($inipath) && $pathAdditions > 0) { //This loop keeps looking up a directory until we find it\n\t\t$inipath = \"../\" . $inipath;\n\t\t$pathAdditions--;\n\t}*/\n\ttry {\n\t\t$ini_array = parse_ini_file($inipath);\n\n\t\tif ($ini_array == null) return null;\n\t} catch (Exception $e) {\n\t\treturn null;\n\t}\n\n\treturn $inipath;\n}", "public function getEsolDbConfigFilePath()\n {\n $syTools = new SyTools();\n $projectDir = $syTools->getProjectDir();\n $configDir = $projectDir . '/config/packages/';\n\n if (!file_exists($configDir . 'prod' . '/esolDb.yml')) {\n $this->initEsolDbYml('prod');\n }\n if (!file_exists($configDir . 'dev' . '/esolDb.yml')) {\n $this->initEsolDbYml('dev');\n }\n if (!file_exists($configDir . 'test' . '/esolDb.yml')) {\n $this->initEsolDbYml('test');\n }\n return $this->getConfDir() . 'esolDb.yml';\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Save Additional ticket retailers with ACF
public function saveTicketRetailers() { if (isset($this->additional_ticket_types)) { update_field('field_5ae320279d7e0', $this->additional_ticket_retailers, $this->ID); } }
[ "public function save() {\n\t\tglobal $wpdb;\n\t\t$table = EM_TICKETS_TABLE;\n\t\tdo_action( 'em_ticket_save_pre', $this );\n\t\t// First the person.\n\t\tif ( $this->validate() && $this->can_manage() ) {\n\t\t\t// Now we save the ticket.\n\t\t\t$data = $this->to_array( true ); // add the true to remove the nulls.\n\t\t\tif ( ! empty( $data['ticket_meta'] ) ) {\n\t\t\t\t$data['ticket_meta'] = serialize( $data['ticket_meta'] );\n\t\t\t}\n\t\t\tif ( ! empty( $data['ticket_members_roles'] ) ) {\n\t\t\t\t$data['ticket_members_roles'] = serialize( $data['ticket_members_roles'] );\n\t\t\t}\n\t\t\tif ( ! empty( $this->ticket_meta['recurrences'] ) ) {\n\t\t\t\t$data['ticket_end'] = null;\n\t\t\t\t$data['ticket_start'] = $dat['ticket_end'];\n\t\t\t}\n\t\t\tif ( '' !== $this->ticket_id ) {\n\t\t\t\t// since currently wpdb calls don't accept null, let's build the sql ourselves.\n\t\t\t\t$set_array = array();\n\t\t\t\tforeach ( $this->fields as $field_name => $field ) {\n\t\t\t\t\tif ( empty( $data[ $field_name ] ) && $field['null'] ) {\n\t\t\t\t\t\t$set_array[] = \"{$field_name}=NULL\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$set_array[] = \"{$field_name}='\" . esc_sql( $data[ $field_name ] ) . \"'\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$sql = \"UPDATE $table SET \" . implode( ', ', $set_array ) . \" WHERE ticket_id={$this->ticket_id}\";\n\t\t\t\t$result = $wpdb->query( $sql );\n\t\t\t\t$this->feedback_message = __( 'Changes saved', 'community-portal' );\n\t\t\t} else {\n\t\t\t\tif ( isset( $data['ticket_id'] ) && empty( $data['ticket_id'] ) ) {\n\t\t\t\t\tunset( $data['ticket_id'] );\n\t\t\t\t}\n\t\t\t\t$result = $wpdb->insert( $table, $data, $this->get_types( $data ) );\n\t\t\t\t$this->ticket_id = $wpdb->insert_id;\n\t\t\t\t$this->feedback_message = __( 'Ticket created', 'community-portal' );\n\t\t\t}\n\t\t\tif ( false === $result ) {\n\t\t\t\t$this->feedback_message = __( 'There was a problem saving the ticket.', 'community-portal' );\n\t\t\t\t$this->errors[] = __( 'There was a problem saving the ticket.', 'community-portal' );\n\t\t\t}\n\t\t\t$this->compat_keys();\n\t\t\treturn apply_filters( 'em_ticket_save', ( count( $this->errors ) === 0 ), $this );\n\t\t} else {\n\t\t\t$this->feedback_message = __( 'There was a problem saving the ticket.', 'community-portal' );\n\t\t\t$this->errors[] = __( 'There was a problem saving the ticket.', 'community-portal' );\n\t\t\treturn apply_filters( 'em_ticket_save', false, $this );\n\t\t}\n\t\treturn true;\n\t}", "public function save_new_ticket(){\n $response = array();\n //write_log($_REQUEST);\n if( ! SM_Helper::check_nonce() ) {\n \n $response['status'] = 'error';\n $response['msg'] = __( 'You don\\'t have permission to save', 'sm' );\n \n }else{\n \n $error = false;\n if( !isset( $_REQUEST['ticket_title'] ) || \"\" == trim( $_REQUEST['ticket_title'] ) ){\n $error = true;\n $response['status'] = 'error';\n $response['msg' ] = __( 'Ticket title required', 'sm' );\n }\n \n if( !isset( $_REQUEST['ticket_content'] ) || \"\" == trim( $_REQUEST['ticket_content'] ) ){\n $error = true;\n $response['status'] = 'error';\n $response['msg' ] = __( 'Ticket content required', 'sm' );\n }\n \n if( ! $error ){\n \n $ticket_category = isset( $_REQUEST['ticket_category'] ) ? $_REQUEST['ticket_category'] : 0;\n \n \n $ticket = SM_Loader::Load( 'SM_Ticket_CPT' );\n \n $ticket->post_title = trim( $_REQUEST['ticket_title'] );\n $ticket->post_content = trim( $_REQUEST['ticket_content'] );\n \n if( $ticket_category ){\n $ticket->post_terms = array( SM_Config::SM_TICKET_TAXONOMY => array( $ticket_category ) );\n }\n \n $ticket->priority = isset( $_REQUEST['ticket_priority'] ) ? $_REQUEST['ticket_priority'] : SM_Config::SM_TICKET_PRIORITY_LOW;\n \n $ticket->save();\n \n $response['status'] = 'success';\n $response['msg' ] = __( 'New ticket has been created successfully', 'sm' );\n $response['ticket_id'] = intval($ticket->ID);\n \n $response['redir'] = get_permalink( $ticket->ID );\n }\n }\n echo json_encode($response); exit();\n \n }", "public function submitTicketFacilities(){\n $fd = new Freshdesk();\n $attributes = request()->all();\n $staffemail = Auth::user()->email;\n $subject = \"[FAC] \" . $attributes['date'] . \" | \" . $attributes['subject'];\n $body = \"<b>Location: </b>\" . $attributes['location'] . \"<br><b>Room: </b> \" . $attributes['room'] . \"<br><b>Date: </b> \" . $attributes['date'] . \"<br><br><b>Request Info: </b><br>\" . $attributes['description'] . \"\";\n $ticket_payload = json_encode(array(\n \"email\" => $staffemail,\n \"subject\" => $subject,\n \"description\" => $body,\n \"priority\" => 1,\n \"status\" => 2,\n \"tags\" => array(\"Web Portal\", $attributes['location'])\n ));\n $response = $fd->createTicket($ticket_payload);\n return response()->json(array($response), 200);\n }", "public function submitTicketICT(){\n $fd = new Freshdesk();\n $attributes = request()->all();\n $staffemail = Auth::user()->email;\n $subject = \"[ICT] \" . $attributes['subject'];\n $body = \"<b>Location: </b>\" . $attributes['location'] . \"<br><b>Room: </b> \" . $attributes['room'] . \"<br><b>Date: </b> \" . $attributes['date'] . \"<br><br><b>Request Info: </b><br>\" . $attributes['description'] . \"\";\n $ticket_payload = json_encode(array(\n \"email\" => $staffemail,\n \"subject\" => $subject,\n \"description\" => $body,\n \"priority\" => 1,\n \"status\" => 2,\n \"tags\" => array(\"Web Portal\", $attributes['location'])\n ));\n $response = $fd->createTicket($ticket_payload);\n return response()->json(array($response), 200);\n }", "function ticket_edit() {\n\t\t//to be written later\n\t}", "public function frontend_submission( $ticket_id ) {\n\t\t$post = $_POST;\n\t\t$this->save_custom_fields( $ticket_id, $post, false );\n\t}", "function update_passenger_ticket_info($passenger_fk, $TicketId, $TicketNumber, $IssueDate, $Fare, $SegmentAdditionalInfo,\r\n\t$ValidatingAirline, $CorporateCode, $TourCode, $Endorsement, $Remarks, $ServiceFeeDisplayType, $api_passenger_origin){\r\n\t\t\r\n\t\t $data['TicketId'] = $TicketId;\r\n\t\t $data['api_passenger_origin'] = $api_passenger_origin;\r\n\t\t $data['TicketNumber'] = $TicketNumber;\r\n\t\t $data['IssueDate'] = $IssueDate;\r\n\t\t $data['Fare'] = $Fare;\r\n\t\t $data['SegmentAdditionalInfo'] = $SegmentAdditionalInfo;\r\n\t\t $data['ValidatingAirline'] = $ValidatingAirline;\r\n\t\t $data['CorporateCode'] = $CorporateCode;\r\n\t\t $data['TourCode'] = $TourCode;\r\n\t\t $data['Endorsement'] = $Endorsement;\r\n\t\t $data['Remarks'] = $Remarks;\r\n\t\t $data['ServiceFeeDisplayType'] = $ServiceFeeDisplayType;\r\n\t\t $update_condtion['passenger_fk'] = $passenger_fk;\r\n\t\t $this->custom_db->update_record('flight_passenger_ticket_info', $data, $update_condtion);\r\n\t }", "public function saving(Ticket $ticket)\n {\n //code...\n }", "function osa_mail_ticket(&$message, $params) {\n\n $commerce_order = $params['commerce_order'];\n\n $message['subject'] = \"Your eTicket(s) from The Oakville Suzuki Association for order #{$commerce_order->order_id}\";\n $message['body'][] = <<<EOD\nThis email contains your <strong>eTicket(s)</strong> for order #{$commerce_order->order_id}.<br />\n<br />\n<span style=\"font-size: 150%;\"><strong><em>Please print this email and bring it to the concert.</em></strong></span><br />\n<br />\n<br />\nEOD;\n\n $order_wrapper = entity_metadata_wrapper('commerce_order', $commerce_order);\n foreach ($order_wrapper->commerce_line_items as $line_item_wrapper) {\n $line_item = $line_item_wrapper->value();\n $quantity = 0;\n\n if (($line_item->type == 'civi_event') && ($line_item->data['contributionTypeID'] == OSA_FINTYPE_CONCERT_TICKET)) {\n $quantity = $line_item->quantity;\n $event_id = $line_item_wrapper->civicrm_commerce_event_id->value();\n }\n elseif (($line_item->type == 'product') && ($line_item_wrapper->commerce_product->type->value() == 'commerce_ticket')) {\n $quantity = $line_item->quantity;\n $product = $line_item_wrapper->commerce_product->value();\n $event_id = $product->field_event[LANGUAGE_NONE][0]['civicrm_reference_id'];\n }\n for ($i = 1; $i <= $quantity; $i++) {\n $message['body'][] = _osa_create_ticket($event_id, $line_item->line_item_id, $i);\n }\n }\n\n/*\n require_once 'CRM/Utils/PDF/Utils.php';\n $message['params']['attachments'][] = array(\n 'filecontent' => CRM_Utils_PDF_Utils::html2pdf($tickets_html, 'eTicket.pdf', TRUE),\n 'filename' => 'eTicket.pdf',\n 'filemime' => 'application/pdf',\n );\n*/\n\n $message['body'][] = <<<EOD\n<br />\n<br />\nThank you for supporting The Oakville Suzuki Association.<br />\n<br />\n<br />\n<strong>The Oakville Suzuki Association</strong><br />\n<em>\"Music exists for the purpose of growing an admirable heart.\" - Shinichi Suzuki</em><br />\nhttp://oakvillesuzuki.org<br />\nadmin@oakvillesuzuki.org<br />\nEOD;\n\n}", "public function attach_ticket() {\n\t\tcheck_ajax_referer( 'wporg-attach-ticket', 'nonce' );\n\n\t\t$ticket_no = empty( $_REQUEST['ticket'] ) ? 0 : absint( $_REQUEST['ticket'] );\n\t\t$ticket_url = \"https://core.trac.wordpress.org/ticket/{$ticket_no}\";\n\n\t\t// Fetch the ticket.\n\t\t$resp = wp_remote_get( esc_url( $ticket_url ) );\n\t\t$status_code = wp_remote_retrieve_response_code( $resp );\n\t\t$body = wp_remote_retrieve_body( $resp );\n\n\t\t// Anything other than 200 is invalid.\n\t\tif ( 200 === $status_code && null !== $body ) {\n\t\t\t$title = '';\n\n\t\t\t// Snag the page title from the ticket HTML.\n\t\t\tif ( class_exists( 'DOMDocument' ) ) {\n\t\t\t\t$doc = new DOMDocument();\n\t\t\t\t@$doc->loadHTML( $body );\n\n\t\t\t\t$nodes = $doc->getElementsByTagName( 'title' );\n\t\t\t\t$title = $nodes->item(0)->nodeValue;\n\n\t\t\t\t// Strip off the site name.\n\t\t\t\t$title = str_ireplace( ' – WordPress Trac', '', $title );\n\t\t\t} else {\n\t\t\t\tdie( -1 );\n\t\t\t}\n\n\t\t\t$post_id = empty( $_REQUEST['post_id'] ) ? 0 : absint( $_REQUEST['post_id'] );\n\n\t\t\tupdate_post_meta( $post_id, 'wporg_ticket_number', $ticket_no );\n\t\t\tupdate_post_meta( $post_id, 'wporg_ticket_title', $title );\n\n\t\t\t$link = sprintf( '<a href=\"%1$s\">%2$s</a>', esc_url( $ticket_url ), apply_filters( 'the_title', $title ) );\n\n\t\t\t// Can haz success.\n\t\t\twp_send_json_success( array(\n\t\t\t\t'message' => $link,\n\t\t\t\t'new_nonce' => wp_create_nonce( 'wporg-attach-ticket' )\n\t\t\t) );\n\n\t\t} else {\n\t\t\t// Ticket number is invalid.\n\t\t\twp_send_json_error( array(\n\t\t\t\t'message' => __( 'Invalid ticket number.', 'wporg' ),\n\t\t\t\t'new_nonce' => wp_create_nonce( 'wporg-attach-ticket' )\n\t\t\t) );\n\t\t}\n\n\t\tdie( 0 );\n\t}", "function woo_supportpress_was_ticket_updated() {\n\t\n\tglobal $post;\n\t\n\tif(isset($_FILES['attachment']) && !empty($_FILES['attachment']['name'])) return true; /* Updated if file attached */\n\t\n\t$responsible \t\t= isset($_POST['responsible']) ? trim(stripslashes($_POST['responsible'])) : 0;\n\t$priority\t\t\t= isset($_POST['priority']) ? trim(stripslashes($_POST['priority'])) : 0;\n\t$type\t\t\t\t= isset($_POST['type']) ? trim(stripslashes($_POST['type'])) : 0;\n\t$status\t\t\t\t= isset($_POST['status']) ? trim(stripslashes($_POST['status'])) : 0;\n\t$tags\t\t\t\t= isset($_POST['tags']) ? trim(stripslashes($_POST['tags'])) : 0;\n\t\n\tif ($tags) return true; /* Return true if adding tags */\n\t\n\t$old_responsible = get_post_meta($post->ID, '_responsible', true);\n\tif ($responsible!=$old_responsible) return true;\n\t\n\tif (!$priority && !$status && !$type && !$tags) return false; /* Return false if no values sent */\n\t\n\t$old_priority \t\t= current(wp_get_object_terms( $post->ID, 'ticket_priority' ))->term_id;\n\t$old_status\t\t\t= current(wp_get_object_terms( $post->ID, 'ticket_status' ))->term_id;\n\t$old_type\t\t\t= current(wp_get_object_terms( $post->ID, 'ticket_type' ))->term_id;\n\tif ($priority!=$old_priority) return true;\n\tif ($status!=$old_status) return true;\n\tif ($type!=$old_type) return true;\n\t\n\treturn false;\n}", "public function admin_create_candidate() {\n global $wpdb;\n $this->verify_nonce( 'wp-erp-rec-job-seeker-nonce' );\n\n // default fields\n $first_name = isset( $_POST['first_name'] ) ? $_POST['first_name'] : '';\n $last_name = isset( $_POST['last_name'] ) ? $_POST['last_name'] : '';\n $email = isset( $_POST['email'] ) ? $_POST['email'] : '';\n $captcha_result = isset( $_POST['captcha_result'] ) ? $_POST['captcha_result'] : '';\n $captcha_correct_result = isset( $_POST['captcha_correct_result'] ) ? $_POST['captcha_correct_result'] : 0;\n $job_id = isset( $_POST['job_id'] ) ? $_POST['job_id'] : 0;\n $attach_id = isset( $_POST['attach_id'] ) ? $_POST['attach_id'] : 0;\n\n $db_personal_fields = get_post_meta( $job_id, '_personal_fields' );\n $meta_key = '_personal_fields';\n $personal_field_data = $wpdb->get_var(\n $wpdb->prepare( \"SELECT meta_value\n FROM {$wpdb->prefix}postmeta\n WHERE meta_key = %s AND post_id = %d\", $meta_key, $job_id ) );\n $personal_field_data = maybe_unserialize( $personal_field_data );\n\n // convert object to array\n $db_personal_fields_array = [ ];\n if ( isset( $db_personal_fields ) ) {\n foreach ( $db_personal_fields as $dbf ) {\n $db_personal_fields_array[] = (array) $dbf;\n }\n }\n\n //personal data validation\n foreach ( $db_personal_fields_array as $db_data ) {\n if ( $db_data['req'] == true ) {\n if ( $_POST[$db_data['field']] == \"\" ) {\n $this->send_error( __( 'please enter ' . str_replace( '_', ' ', $db_data['field'] ), 'wp-erp-rec' ) );\n }\n }\n }\n\n $question_answer = [ ];\n if ( isset( $_POST['question'] ) ) {\n $qset = $_POST['question'];\n $aset = isset( $_POST['answer'] ) ? $_POST['answer'] : [ ];\n $question_answer = array_combine( $qset, $aset );\n }\n\n if ( !isset( $first_name ) || $first_name == '' ) {\n $this->send_error( [ 'type' => 'first-name-error', 'message' => __( 'First name is empty', 'wp-erp-rec' ) ] );\n } elseif ( preg_match('#[\\d]#', str_replace( ' ', '', $first_name ) ) === true ) {\n $this->send_error( [ 'type' => 'first-name-error', 'message' => __( 'First name must only contain letters and space!', 'wp-erp-rec' ) ] );\n } elseif ( preg_match('#[\\d]#', str_replace( ' ', '', $last_name ) ) === true ) {\n $this->send_error( [ 'type' => 'last-name-error', 'message' => __( 'Last name must only contain letters and space!', 'wp-erp-rec' ) ] );\n } elseif ( !isset( $last_name ) || $last_name == '' ) {\n $this->send_error( [ 'type' => 'last-name-error', 'message' => __( 'Last name is empty', 'wp-erp-rec' ) ] );\n } elseif ( !filter_var( $email, FILTER_VALIDATE_EMAIL ) ) {\n $this->send_error( [ 'type' => 'invalid-email', 'message' => __( 'Invalid Email', 'wp-erp-rec' ) ] );\n } elseif ( erp_rec_is_duplicate_email( $email, $job_id ) ) {\n $this->send_error( [ 'type' => 'duplicate-email', 'message' => __( 'E-mail address already exist', 'wp-erp-rec' ) ] );\n } elseif ( !isset( $attach_id ) || $attach_id == \"\" ) {\n $this->send_error( [ 'type' => 'file-error', 'message' => __( 'Please upload your cv ( .doc, .docx or .pdf file only )', 'wp-erp-rec' ) ] );\n } else {\n // get the first or default stage for this applicant\n $stage_id = $wpdb->get_var( \"SELECT stageid FROM {$wpdb->prefix}erp_application_job_stage_relation WHERE jobid='\" . $job_id . \"' ORDER BY id LIMIT 1\" );\n\n if ( !erp_rec_is_existing_email( $email, $job_id ) ) {\n $data = array(\n 'first_name' => strip_tags( $first_name ),\n 'last_name' => strip_tags( $last_name ),\n 'email' => $email\n );\n\n $format = array(\n '%s',\n '%s',\n '%s'\n );\n\n $wpdb->insert( $wpdb->prefix . 'erp_peoples', $data, $format );\n $jobseeker_id = $wpdb->insert_id;\n\n //insert applicant IP Address\n $data = array(\n 'erp_people_id' => $jobseeker_id,\n 'meta_key' => 'ip',\n 'meta_value' => $_SERVER['REMOTE_ADDR']\n );\n\n $format = array(\n '%d',\n '%s',\n '%s'\n );\n\n $wpdb->insert( $wpdb->prefix . 'erp_peoplemeta', $data, $format );\n\n //insert job id and applicant id to application table\n $data = array(\n 'job_id' => $job_id,\n 'applicant_id' => $jobseeker_id,\n 'stage' => ( $stage_id == NULL ) ? 1 : $stage_id,\n 'exam_detail' => json_encode( $question_answer )\n );\n\n $format = array(\n '%d',\n '%d',\n '%s',\n '%s'\n );\n\n $wpdb->insert( $wpdb->prefix . 'erp_application', $data, $format );\n\n do_action( 'erp_rec_applied_job', $data );\n } else { \n $query = \"SELECT people.id\n FROM {$wpdb->prefix}erp_peoples as people\n WHERE people.email='{$email}' ORDER BY people.id DESC LIMIT 1\";\n\n $jobseeker_id = $wpdb->get_var( $query );\n\n // Buscar postulación existente\n $query = \"SELECT app.id\n FROM {$wpdb->prefix}erp_application as app\n WHERE app.applicant_id='{$jobseeker_id}' ORDER BY app.id DESC LIMIT 1\";\n\n $application_id = $wpdb->get_var( $query );\n\n // Agregar comentario sobre nueva postulación a nueva posición\n $job_title = get_the_title($job_id);\n\n $admin_user_id = 0;\n\n $comment = __('Candidate also applied to position: ', 'wp-erp-rec') . $job_title;\n $comment .= \"\\n\" . __('Name: ', 'wp-erp-rec') . $first_name . ' ' . $last_name;\n $comment .= \"\\n\" . __('CV: ', 'wp-erp-rec') . basename(get_attached_file($attach_id));\n\n $all_personal_fields = erp_rec_get_personal_fields();\n\n foreach ( $personal_field_data as $db_data ) {\n if ( json_decode( $db_data )->showfr == true\n && isset( $_POST[json_decode($db_data)->field] )\n && !empty( $_POST[json_decode($db_data)->field] ) ) {\n\n $field = json_decode( $db_data )->field;\n\n if ( json_decode( $db_data )->type == 'checkbox' ) {\n $value = implode( \",\", $_POST[$field] );\n } else {\n $value = $_POST[$field];\n }\n\n if( !empty($all_personal_fields[$field]) ) {\n $field_label = $all_personal_fields[$field]['label'];\n\n if( isset($all_personal_fields[$field]['options']) ) {\n $value = $all_personal_fields[$field]['options'][$value];\n }\n } else {\n $field_label = $field;\n }\n\n $comment .= \"\\n\" . $field_label . \": \" . $value;\n }\n }\n\n $data = array(\n 'application_id' => $application_id,\n 'comment' => $comment,\n 'user_id' => $admin_user_id\n );\n\n $format = array(\n '%d',\n '%s',\n '%d'\n );\n\n $wpdb->insert( $wpdb->prefix . 'erp_application_comment', $data, $format );\n }\n\n //insert applicant attach cv id\n $attach_metadata_id = $wpdb->get_var(\n $wpdb->prepare(\n \"SELECT meta_id FROM \" . $wpdb->prefix . \"erp_peoplemeta\n WHERE erp_people_id = %d AND meta_key = 'attach_id' AND meta_value = '%d' LIMIT 1\",\n $jobseeker_id, $attach_id\n )\n );\n\n if ( $attach_metadata_id == 0 ) {\n $data = array(\n 'erp_people_id' => $jobseeker_id,\n 'meta_key' => 'attach_id',\n 'meta_value' => $attach_id\n );\n\n $format = array(\n '%d',\n '%s',\n '%s'\n );\n\n $wpdb->insert( $wpdb->prefix . 'erp_peoplemeta', $data, $format );\n }\n\n // personal fields that is coming dynamically\n foreach ( $personal_field_data as $db_data ) {\n if ( json_decode( $db_data )->showfr == true ) {\n if ( json_decode( $db_data )->type == 'checkbox' ) {\n if ( isset( $_POST[json_decode( $db_data )->field] ) ) {\n $data = array(\n 'erp_people_id' => $jobseeker_id,\n 'meta_key' => json_decode( $db_data )->field,\n 'meta_value' => implode( \",\", $_POST[json_decode( $db_data )->field] )\n );\n $format = array(\n '%d',\n '%s',\n '%s'\n );\n $wpdb->insert( $wpdb->prefix . 'erp_peoplemeta', $data, $format );\n }\n } else {\n $data = array(\n 'erp_people_id' => $jobseeker_id,\n 'meta_key' => json_decode( $db_data )->field,\n 'meta_value' => isset( $_POST[json_decode( $db_data )->field] ) ? $_POST[json_decode( $db_data )->field] : ''\n );\n $format = array(\n '%d',\n '%s',\n '%s'\n );\n $wpdb->insert( $wpdb->prefix . 'erp_peoplemeta', $data, $format );\n }\n\n if (json_decode( $db_data )->field == 'mobile') {\n $mobile = isset( $_POST[json_decode( $db_data )->field] ) ? $_POST[json_decode( $db_data )->field] : '';\n }\n }\n }\n\n $this->send_success( [ 'message' => __( 'Your application has been received successfully. Thank you for applying.', 'wp-erp-rec' ) ] );\n }\n }", "function createTicketInfo($flag = 'allow')\r\n{\r\n global $lang_dateformat, $lang_format_2, $lang_format_1, $lang_override_logged_date, $lang_resolution_date;\r\n global $theme, $db, $lang_ticketinfo, $lang_platform, $lang_shortdesc, $info, $enable_smtp;\r\n global $lang_category, $lang_desc, $lang_email, $lang_user, $lang_update;\r\n global $lang_attachment, $enable_tattachments, $max_attachment_size, $enable_loggeddateoverride;\r\n global $lang_supporter_update, $lang_client_update, $lang_client_update_email;\r\n global $show_update_log_in_task, $lang_project, $lang_ticket,$admin,$supporter_com,$user_usu,$serie_retirada_1, $serie_colocada_1, $serie_retirada_2, $serie_colocada_2, $serie_retirada_3, $serie_colocada_3, $serie_retirada_4, $serie_colocada_4;\r\n\tglobal $data_1o_atendimento, $modelo;\r\n\r\n\t\r\n\t$ver2 = \"\";\r\n\tif ($admin == 0 && $supporter_com == 1 && $user_usu == 1){\r\n\t\t\r\n\t\t$ver2 =\"disabled=\\\"disabled\\\"\";\r\n\t}\r\n\t\r\n\t\r\n\t\r\n // hack the shortdescription field name since 'short' is illegal in js\r\n // adn disrupts the autofill. see the if flag for tcre below... for\r\n // the actual change.\r\n $shortname = \"short\";\r\n // if we call this function from tcreate we want to be able store\r\n // and pass around the vars as we wish. So we'll create some\r\n // vars based the flag.\r\n if ($flag == 'tcre') {\r\n // set the short description form element name to avoide\r\n // illegal js name\r\n $shortname = \"shortdesc\";\r\n // we are calling from tcreate so lets use javascript to make\r\n // sure we have the stuff we need.\r\n $tcre_project = 'onChange=\"refresh_project()\"';\r\n $tcre_description = 'onChange=\"refresh_desc()\"';\r\n $tcre_short = 'onChange=\"refresh_short()\"';\r\n // set and massage the vars for proper display.\r\n // the ereg replace is a hack to compensate for js thing.\r\n $info['project'] = ereg_replace(\"''\", \"'\", $_SESSION[autofill_project]);\r\n $info['description'] = ereg_replace(\"''\", \"'\", $_SESSION[autofill_desc]);\r\n $info['short'] = ereg_replace(\"''\", \"'\", $_SESSION[autofill_short]);\r\n // if we are on tcreate turn the platform and category into\r\n // jump menus.\r\n $tcrejump = 'onChange=\"MM_jumpMenu(\\'parent\\', this, 0)\"';\r\n\r\n $flag = 'allow'; // make sure we allow attachments\r\n\r\n }\r\n\r\n\techo '\t<table class=border cellSpacing=0 cellPadding=0 width=\"100%\" align=center border=0>\r\n\t<tr>\r\n\t<td>\r\n\t<table cellSpacing=1 cellPadding=5 width=\"100%\" border=0>\r\n\t<tr>\r\n\t<td class=info align=left colspan=4 align=center><b>' . $lang_ticketinfo . '</b></td>\r\n\t</tr>\r\n\t<tr>\r\n\t<td class=back2 width=27% align=right>' . $lang_platform . ':</td><td width=20% class=back><select name=platform ' . $tcrejump . ' '.$ver2.'>';\r\n\tif (isSupporter($_SESSION[user])) {\r\n\tcreatePlatformMenu(0, '');\r\n\t} else {\r\n\tcreatePlatformMenu(0, '', $_SESSION[user]);\r\n\t}\r\n\techo '\t</select></td><td class=back2 width=100 align=right>' . $lang_category . ':</td>\r\n\t<td class=back><select name=category ' . $tcrejump . ' '.$ver2.'>';\r\n\t\r\n\tif (isSupporter($_SESSION[user])) {\r\n\tcreateCategoryMenu(0);\r\n\t} else {\r\n\tcreateCategoryMenu(0, $_SESSION[user]);\r\n\t}\r\n\techo '\t</select></td>\r\n\t</tr>\r\n\t<tr>\r\n\t<td class=back2 width=27% align=right>' . $lang_project . ':</td><td width=20% class=back>\r\n\t<select name=project ' . $tcrejump . ' '.$ver2.'>';\r\n\t\r\n\tif (isSupporter($_SESSION[user])) {\r\n\tcreateProjectMenu(0);\r\n\t} else {\r\n\tcreateProjectMenu(0, $_SESSION[user]);\r\n\t}\r\n\techo '\t</select></td>\r\n\t\r\n\t<td class=back2 width=100 align=right>Modelo:<font color=red>*</font></td>\r\n\t<td class=back><input name=modelo type=text value = \"'.$modelo.'\"></td>\r\n\t\t\r\n\t</tr>\r\n\t';\r\n\techo'\t\t\t\t\t\t\t\t\t\t\t\t\t<tr>\r\n\t<td width=27% class=back2 align=right>Descrição do problema:<font color=red>*</font></td>\r\n\t<td class=back colspan=3>\r\n\t';\r\n\t// if ($_POST[short] != \"\"){\r\n\t// $info['short'] = $_POST[short];\r\n\t// }\r\n\techo '\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tNumero m&aacute;ximo de cacteres:<div id=\"Qtd\">80</div>\r\n\t<textarea name=' . $shortname . ' rows=6 cols=60 ' . $tcre_short . ' '.$ver2.' onkeypress=\"Contar(this)\">' . $info['short'] . '</textarea>\r\n\t</td>\r\n\t\r\n\t</tr>';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//<tr>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n // if ($_POST[description] != \"\"){\r\n // $info['description'] = $_POST[description];\r\n // }\r\n /*echo '\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class=back2 align=right valign=top width=27%>' . $lang_desc . ': <font color=red>*</font></td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class=back colspan=3><textarea name=description rows=5 cols=60 ' . $tcre_description . ' '.$ver2.'>' . $info['description'] . '</textarea></td>\r\n\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>';*/\r\n // determines if we are in the task update section\r\n if (isset ($info) and isset ($_GET[id])) {\r\n // if ($enable_smtp == \"win\" || $enable_smtp == \"lin\") {\r\n // echo '\r\n // <tr>\r\n // <td class=back2 align=right valign=top width=27> '.$lang_email.' '.$lang_user.': </td>\r\n // <td class=back colspan=3 valign=bottom> <textarea name=email_msg rows=5 cols=60></textarea> </td>\r\n // </tr>';\r\n // }\r\n\t\t\r\n\t\t$sql = \"\r\n\t\t\tSELECT contrato, n_tombamento, n_serie, nome_rede, endereco, solucao,diagnostico \r\n\t\t\tFROM ooz_tickets \r\n\t\t\tWHERE id='$_GET[id]'\";\r\n\t\t\t\r\n\t$query = mysql_query($sql);\r\n\t$linha = mysql_fetch_array($query);\r\n\t\t\r\n\t\t\r\n\t\t$solucao = $linha['solucao'];\r\n\t\t$diagnostico = $linha['diagnostico'];\r\n echo '\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class=back2 align=right valign=top width=27%> Diagnóstico: </td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class=back colspan=3 valign=bottom><textarea name=diagnostico rows=5 cols=60>'.$diagnostico.'</textarea><br>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<tr>\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class=back2 align=right valign=top width=27%> Solucao: </td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class=back colspan=3 valign=bottom><textarea name=solucao rows=5 cols=60>'.$solucao.'</textarea><br>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<tr>';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '\t\t\t\r\n\t\t\t\t\t\t\t\t<td width=27% class=back2 align=right>Nº serie peça retirada 1:</td>\r\n\t\t\t\t\t\t\t\t<td class=back width=20%>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<input type=text name=pcc1 size=25% value = \"'.$serie_retirada_1.'\">\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t</td> \r\n\t \r\n\t\t\t\t\t\t\t\t<td width=20% class=back2 align=right>Nº serie peça colocada 1:</td>\r\n\t\t\t\t\t\t\t\t<td class=back width=20%>\r\n\t\t\t\t\t\t\t\t<input type=text name=pcr1 size=25% value = \"'.$serie_colocada_1.'\" >\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td width=27% class=back2 align=right>Nº serie peça retirada 2:</td>\r\n\t\t\t\t\t\t\t\t<td class=back width=20%>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<input type=text name=pcc2 size=25% value = \"'.$serie_retirada_2.'\">\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t<td width=20% class=back2 align=right>Nº serie peça colocada 2:</td>\r\n\t\t\t\t\t\t\t\t<td class=back width=20%>\r\n\t\t\t\t\t\t\t\t<input type=text name=pcr2 size=25% value = \"'.$serie_colocada_2.'\">\r\n\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td width=27% class=back2 align=right>Nº serie peça retirada 3:</td>\r\n\t\t\t\t\t\t\t\t<td class=back width=20%>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<input type=text name=pcc3 size=25% value = \"'.$serie_retirada_3.'\">\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t<td width=20% class=back2 align=right>Nº serie peça colocada 3:</td>\r\n\t\t\t\t\t\t\t\t<td class=back width=20%>\r\n\t\t\t\t\t\t\t\t<input type=text name=pcr3 size=25% value = \"'. $serie_colocada_3.'\">\r\n\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td width=27% class=back2 align=right>Nº serie peça retirada 4:</td>\r\n\t\t\t\t\t\t\t\t<td class=back width=20%>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<input type=text name=pcc4 size=25% value = \"'.$serie_retirada_4.'\">\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t<td width=20% class=back2 align=right>Nº serie peça colocada 4:</td>\r\n\t\t\t\t\t\t\t\t<td class=back width=20%>\r\n\t\t\t\t\t\t\t\t<input type=text name=pcr4 size=25% value = \"'.$serie_colocada_4.'\">\r\n\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t';\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\techo '\r\n\t\t\t\t\t\t\t\t</td>\r\n\r\n\t\t\t\t\t\t\t</tr>';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo'\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class=back2 align=right valign=top width=27%> ' . $lang_update . ': </td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class=back colspan=3 valign=bottom> <textarea name=update_log rows=5 cols=60></textarea><br>';\r\n \r\n\t echo '\t\t\t\t\t\t\t\t\t\t\t\t\t<select size=\"1\" name=\"updatetype\">\r\n\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"supporter\" selected>' . $lang_supporter_update . '</option>\r\n\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"client\">' . $lang_client_update . '</option>';\r\n if ($enable_smtp == \"win\" || $enable_smtp == \"lin\") {\r\n echo ' <option value=\"clientemail\">' . $lang_client_update_email . '</option>';\r\n // }else{\r\n // echo '<input type=hidden name=updatetype value=supporter>';\r\n }\r\n\t\t\r\n\t\t\r\n\t\t\r\n echo '</select>';\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n // only display the link to the update log if show_update_log_in_task is disabled\r\n if ($show_update_log_in_task != 'On') {\r\n echo '<a href=\"updatelog.php?user=' . $_SESSION[user] . '&id=' . $info['id'] . '\" target=\"myWindow\" onClick=\"window.open(\\'\\', \\'myWindow\\',\\'location=no, status=yes, scrollbars=yes, height=500, width=600, menubar=no, toolbar=no, resizable=yes\\')\">';\r\n echo '<img border=0 src=\"../' . $theme['image_dir'] . 'log_button.jpg\"></a>';\r\n }\r\n echo '</td></tr>';\r\n }\r\n if ($enable_tattachments == 'On' && $flag == 'allow') {\r\n echo '<tr>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class=back2 align=right valign=top width=27%>' . $lang_attachment . ': </td>';\r\n\r\n echo \"<td class=back colspan=3 valign=bottom>\";\r\n echo '<input type=hidden name=\"MAX_FILE_SIZE\" value=\"' . $max_attachment_size . '\">';\r\n // echo \"<input type=\\\"file\\\" name=\\\"the_file\\\" size=35>\";\r\n echo '<input type=\"file\" name=\"SelectedFile\" size=35>';\r\n echo '</td></tr>';\r\n }\r\n // Only display these fields if the user is a supporter\r\n if (isSupporter($_SESSION[user]) && ($_GET[t] == 'tupd')) {\r\n if ($enable_loggeddateoverride == 'On') {\r\n\t\r\n\t\t\tif(empty($data_1o_atendimento)){\r\n\t\t\t\techo '</td></tr>\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<td class=back2 align=right valign=top width=27%>Data do primeiro atendimento: </td>\r\n\t\t\t\t\t\t\t<td class=back colspan=3>\r\n\t\t\t\t\t\t\t\t<strong>\r\n\t\t\t\t\t\t\t\t\t<input type=text name=prim_dia size=2 maxlength=2 onkeyup=\"if(this.value.length > 1) prim_mes.focus()\">&nbsp;:&nbsp;\r\n\t\t\t\t\t\t\t\t\t<input type=text name=prim_mes size=2 maxlength=2 onkeyup=\"if(this.value.length > 1) prim_ano.focus()\">&nbsp;:&nbsp;\r\n\t\t\t\t\t\t\t\t\t<input type=text name=prim_ano size=4 maxlength=4 onkeyup=\"if(this.value.length > 3) prim_hor.focus()\">&nbsp;&nbsp;&nbsp;\r\n\t\t\t\t\t\t\t\t\t<input type=text name=prim_hor size=2 maxlength=2 onkeyup=\"if(this.value.length > 1) prim_min.focus()\">&nbsp;:&nbsp;\r\n\t\t\t\t\t\t\t\t\t<input type=text name=prim_min size=2 maxlength=2>\r\n\t\t\t\t\t\t\t\t</strong>\r\n\t\t\t\t\t\t\t\t<br>';\r\n\t\t\t}\r\n if ($lang_dateformat == 'd/m/y') {\r\n \r\n } elseif ($lang_dateformat == 'm/d/y') {\r\n echo $lang_format_2 . '</td>';\r\n }\r\n }\r\n echo '</tr>\r\n\t\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t\t<td class=back2 align=right valign=top width=27%>' . $lang_resolution_date . ': </td>\r\n\t\t\t\t\t\t\t\t\t\t<td class=back colspan=3><strong><input type=text name=resolutiondate_1 size=2 maxlength=2 onkeyup=\"if(this.value.length > 1) resolutiondate_2.focus()\">&nbsp;:&nbsp;<input type=text name=resolutiondate_2 size=2 maxlength=2 onkeyup=\"if(this.value.length > 1) resolutiondate_3.focus()\">&nbsp;:&nbsp;<input type=text name=resolutiondate_3 size=4 maxlength=4 onkeyup=\"if(this.value.length > 3) resolutiondate_4.focus()\">&nbsp;&nbsp;&nbsp;\r\n\t\t\t\t\t\t\t\t\t\t<input type=text name=resolutiondate_4 size=2 maxlength=2 onkeyup=\"if(this.value.length > 1) resolutiondate_5.focus()\">&nbsp;:&nbsp;<input type=text name=resolutiondate_5 size=2 maxlength=2></strong><br>';\r\n if ($lang_dateformat == 'd/m/y') {\r\n echo $lang_format_1 . '</td>';\r\n } elseif ($lang_dateformat == 'm/d/y') {\r\n echo $lang_format_2 . '</td>';\r\n }\r\n echo \"</tr>\r\n\t\t\t\t\t\t\t\t\t</tr>\";\r\n }\r\n echo '\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t\t\t\t\t\t<br>';\r\n}", "function Fee_Edit($ReceiptNo, $error = '', $_err_codes = '') {\n //echo $ReceiptNo;\n if (!isset($ReceiptNo)) {\n die($this->util_model->get_err_msg(\"receiptNoNotDefined\"));\n }\n global $data;\n $data = $this->util_model->set_error($data, $error, $_err_codes);\n // where condition\n $filter_data = array(\"ReceiptNo\" => $ReceiptNo);\n // fetching data\n $data['receipt_data'] = $this->util_model->check_aready_exits(DB_PREFIX . \"fee_trn\", $filter_data, TRUE);\n if (empty($data['receipt_data'][0])) {\n die($this->util_model->get_err_msg(\"receiptNoNotFound\"));\n }\n // receipt cancelled checking\n if (!$data['receipt_data'][0]->Status) {\n die($this->util_model->get_err_msg(\"receiptCancelled\"));\n }\n\n\n $data['Form_Field_Value'] = array();\n $data['Stu_ID'] = $data['receipt_data'][0]->Stu_ID;\n $data['CourseID'] = $data['receipt_data'][0]->CourseID;\n $Stu_ID = $data['receipt_data'][0]->Stu_ID;\n $CourseID = $data['receipt_data'][0]->CourseID;\n $data['FeeTypeID'] = $data['receipt_data'][0]->FeeTypeID;\n $data['Form_Field_Value']['Total_Paid_Amt'] = $this->fee_collect_model->total_installments_amount($Stu_ID, $CourseID);\n\n $data['Form_Field_Value']['ReceiptNo'] = $ReceiptNo;\n // to get fee plan has already set or not\n if ($Stu_ID != 0 && $CourseID != 0) {\n\n $student_scnb_details = $this->admission_model->get_student_courses($Stu_ID, $CourseID);\n $student_mst_details = $this->admission_model->get_student_basic_details($Stu_ID, $data['Session_Data']['IBMS_BRANCHID']);\n //$this->util_model->printr($student_mst_details);\n if (!empty($student_mst_details[0]) && !empty($student_scnb_details[0])) {\n $data['Form_Field_Value']['BranchCode'] = $student_mst_details[0]->BranchCode;\n $data['Form_Field_Value']['EnrollNo'] = $student_mst_details[0]->EnrollNo;\n $data['Form_Field_Value']['CourseID'] = $student_scnb_details[0]->CourseID;\n $data['Form_Field_Value']['StudentName'] = $student_mst_details[0]->StudentName;\n $data['Form_Field_Value']['FatherName'] = $student_mst_details[0]->FatherName;\n $data['Form_Field_Value']['Gender'] = $student_mst_details[0]->Gender;\n $data['Form_Field_Value']['DOB'] = $student_mst_details[0]->DOB;\n $data['Form_Field_Value']['DOR'] = $student_scnb_details[0]->DOR;\n $data['Form_Field_Value']['age'] = round((date(time()) - strtotime($data['Form_Field_Value']['DOB'])) / 31556926, 0) . \" Years\";\n } else {\n echo \"<div class='container text-center'><span class='box blink'>Student Not Found, or doesn't relate to this branch !!</span></div>\";\n }\n $data['Form_Field_Value']['CourseCode'] = $this->util_model->get_a_column_value('CourseCode', DB_PREFIX . 'course_mst', array(\"CourseID\" => $CourseID, \"BranchID\" => $data['Session_Data']['IBMS_BRANCHID']));\n\n // $data['EnrollNo'] = $this->util_model->get_a_column_value(\"EnrollNo\", DB_PREFIX . \"stu_mst\", array(\"Stu_ID\" => $Stu_ID));\n $filter = array(\n \"search_via\" => array(\"Stu_ID\"),\n \"adv_search\" => \"adv_search\",\n \"search_via_value\" => array($Stu_ID),\n \"CourseList\" => array($CourseID)\n );\n //die($this->util_model->printr($filter));\n $s_courses = $this->admission_model->msearch_adm($filter);\n //$this->util_model->printr($s_courses);\n // if user id and course doen't found !!\n if (empty($s_courses))\n redirect(base_url() . \"fees/Fee_Master/index/0/0/1/RecNotFound\" . ERR_DELIMETER);\n //$this->util_model->printr($s_courses);\n $data['due_day'] = $s_courses[0]['due_day'];\n if (!$this->fee_collect_model->is_record_exits_in_fee_plan_table($Stu_ID, $CourseID)) {\n redirect(base_url() . \"fees/Fee_Master/sscfp/\" . $Stu_ID . \"/\" . $CourseID);\n }\n\n //$this->load->model('adm/admission_model');\n $courses_result = $this->admission_model->get_student_courses($Stu_ID, 1);\n $final_course_list = array();\n if (!empty($courses_result)) {\n foreach ($courses_result as $c_row) {\n $final_course_list[$c_row->CourseID] = $c_row->CourseCode;\n }\n }\n // $this->util_model->printr($final_course_list);\n $data['stu_Courses'] = $final_course_list;\n }\n\n // cheque check exits\n $data['Form_Field_Value']['BankName'] = \"\";\n $data['Form_Field_Value']['BranchName'] = \"\";\n $data['Form_Field_Value']['ChNumber'] = \"\";\n $data['Form_Field_Value']['ChDate'] = \"\";\n $data['Form_Field_Value']['ChAmount'] = \"\";\n $data['Form_Field_Value']['Cleared'] = \"\";\n $data['Form_Field_Value']['ChequeRemarks'] = \"\";\n if ($data['receipt_data'][0]->Paid_ModeID != 1) {\n $cheque_fiter_data = array(\n \"ReceiptNo\" => $data['receipt_data'][0]->ReceiptNo,\n \"Status\" => TRUE);\n $data['cheque_details'] = $this->util_model->check_aready_exits(DB_PREFIX . \"fee_cheque_details\", $cheque_fiter_data, TRUE);\n if (!empty($data['cheque_details'][0])) {\n $data['Form_Field_Value']['BankName'] = $data['cheque_details'][0]->BankName;\n $data['Form_Field_Value']['BranchName'] = $data['cheque_details'][0]->BranchName;\n $data['Form_Field_Value']['ChNumber'] = $data['cheque_details'][0]->ChNumber;\n $data['Form_Field_Value']['ChDate'] = $data['cheque_details'][0]->ChDate;\n $data['Form_Field_Value']['ChAmount'] = $data['cheque_details'][0]->ChAmount;\n $data['Form_Field_Value']['Cleared'] = $data['cheque_details'][0]->Cleared;\n $data['Form_Field_Value']['ChequeRemarks'] = $data['cheque_details'][0]->Remarks;\n }\n }\n\n // drop down list\n $data['due_days'] = $this->util_model->get_list(\"due_day\", \"due_day\", DB_PREFIX . \"fee_due_days\", $data['Session_Data']['IBMS_BRANCHID'], $sort_col = 'due_day');\n $data['fac_list'] = array(\"\" => \"Select Faculty Code\") + $this->util_model->get_list(\"Emp_ID\", \"Emp_Code\", DB_PREFIX . \"employee\", $data['Session_Data']['IBMS_BRANCHID'], $sort_col = 'Emp_Code', TRUE, 1, \" UTID=\" . $data['Branch_obj']->FacultyCode);\n $data['fac_batch_list'] = array(\"\" => \"Select Batch Code\") + $this->util_model->get_list(\"BatchID\", \"BatchCode\", DB_PREFIX . \"batch_master\", $data['Session_Data']['IBMS_BRANCHID'], $sort_col = 'BatchCode', TRUE, 1);\n $data['paid_mode'] = $this->util_model->get_list(\"Paid_ModeID\", \"Paid_ModeCode\", DB_PREFIX . \"fee_paidmode_mst\", 0, $sort_col = 'Paid_ModeCode');\n $data['FeeTypeID_list'] = $this->util_model->get_list(\"FeeTypeID\", \"FeeType_Code\", DB_PREFIX . 'fee_type_mst', $data['Session_Data']['IBMS_BRANCHID'], 'Sort,FeeType_Code');\n // month drop down list\n $month_result = $this->util_model->all_month_list();\n $data['Month_list'] = $month_result[0];\n $data['c_month'] = $month_result[1];\n\n\n foreach ($data['receipt_data'][0] as $key => $val) {\n $data['Form_Field_Value'][$key] = $val;\n }\n // $this->util_model->printr($data['Form_Field_Value']);\n\n $this->load->view('templates/header.php', $data);\n $this->load->view(\"Fee_collect/Fee_Edit.php\", $data);\n $this->load->view(\"Fee_collect/fee_collect_js.php\", $data);\n $this->load->view('templates/footer.php');\n }", "public static function ticket_select ()\n {\n global $wpdb;\n \n $inputs = input::post_is_object();\n \n $id = user_control::get_id();\n \n $qtys_value = db::ticket_get_values( 'qty', $inputs->value )-1;\n $ords_value = db::ticket_get_values( 'orders', $inputs->value )+1;\n \n self::updates( \n 'raffle'.self::$tbls[0],\n array( 'orders' => $ords_value, 'qty' => $qtys_value ),\n array( 'id' => intval( $inputs->value ) ),\n array( '%d', '%d' ),\n array( '%d' ) \n );\n \n $user_id_exists = db::user_id_exists( 'user_id', $id );\n $ticket_id_exists = db::user_id_exists( 'ticket_id', $inputs->value );\n\n if( $user_id_exists != true ) \n {\n \n self::inserts(\n 'raffle'.self::$tbls[2],\n array( \n 'user_id' => $id, \n 'ticket_id' => $inputs->value, \n 'value' => 1 \n ),\n array( '%d', '%d', '%d' )\n );\n \n _e( '<p>access submit - 1</p>', 'wp_raffle_submit_message' );\n \n } else {\n \n $user_filer = db::user_id_exists_filter( $id, $inputs->value );\n \n if( $ticket_id_exists != true ) \n {\n \n self::inserts(\n 'raffle'.self::$tbls[2],\n array( \n 'user_id' => $id, \n 'ticket_id' => $inputs->value, \n 'value' => 1 \n ),\n array( '%d', '%d', '%d' )\n ); \n \n _e( '<p>access submit - 2</p>', 'wp_raffle_submit_message' );\n \n } else {\n \n if( ! $user_filer ) \n {\n \n self::inserts(\n 'raffle'.self::$tbls[2],\n array( \n 'user_id' => $id, \n 'ticket_id' => $inputs->value, \n 'value' => 1 \n ),\n array( '%d', '%d', '%d' )\n );\n \n _e( '<p>access submit - 3</p>', 'wp_raffle_submit_message' );\n \n } else {\n \n $values = db::user_get_values_filter( 'value', $id, $inputs->value );\n \n self::updates( \n 'raffle'.self::$tbls[2],\n array( 'value' => $values+1 ),\n array( 'user_id' => $id, 'ticket_id' => intval( $inputs->value ) ),\n array( '%d' ),\n array( '%d', '%d' ) \n );\n \n _e( '<p>access submit - 4</p>', 'wp_raffle_submit_message' );\n } \n \n }\n\n }\n\n }", "public function insertTicketAction() \n {\n $auth = Zend_Auth::getInstance(); \n $userId = ($auth->getIdentity()->id) ? $auth->getIdentity()->id : $this->_userId ;\n\n $values = Array();\n\n if($this->_request->isPost())\n {\n $subject = trim($this->_getParam('txtSubject'));\n $type = trim($this->_getParam('selectType'));\n $priority = trim($this->_getParam('selectPriority')); \n $description = trim($this->_getParam('txtDescription')); \n \n //Storing submitted values to session as an array * but have to find a better way *\n $sessionTicketValues = new Zend_Session_Namespace('arrTicketValues');\n \n $arrSessionTicketValues = array(\n 'subject' => $subject, \n 'description' => $description, \n 'type' => $type, \n 'priority' => $priority, \n );\n \n $sessionTicketValues->arrTicketValues = $arrSessionTicketValues;\n \n //Check the required fields if they are not null\n if($subject == '' || $type == '' || $priority == ''|| $description == ''){\n $this->_helper->flashMessenger->setNamespace('error')->addMessage('Please fill all the required fields');\n $this->_redirect('/ticket/add-ticket');\n }\n else{\n $values = array(\n 'subject' => $subject, \n 'description' => $description, \n 'type' => $type, \n 'priority' => $priority, \n 'source' => 'Partnermobile', \n 'status' => 'Open', \n 'user_id' => $userId, \n 'created_date' => date('Y-m-d H:i:s')\n );\n\n\n $modelTickets = new Partner_Model_Tickets();\n $lastInsertId = $modelTickets->insertTicketingDetails($values);\n\n if($lastInsertId){\n $this->_helper->flashMessenger->setNamespace('success')->addMessage('Your ticket submitted successfully');\n \n //Skip header enrichment chaps to send notification. Coz the users don't have an email with registered\n //$arrSkipChapIds = array(25022,23045,81449,);\n \n //Sending notification to user but no to header enrichment chaps\n if(!$this->_headerEnrichment)\n $this->sendTicketingNotificationUser($lastInsertId);\n \n //Sending notification to agent\n $this->sendTicketingNotificationAgent($lastInsertId);\n \n //unset the session of ticket detail\n unset($sessionTicketValues->arrTicketValues);\n \n $this->_redirect('/ticket/view-tickets');\n \n }\n else{\n $this->_helper->flashMessenger->setNamespace('Error')->addMessage('Error on submiting your ticket.');\n }\n\n }\n\n $this->_redirect('/ticket/add-ticket');\n //$this->_helper->viewRenderer('add-ticket');\n }\n }", "public function update($acTicket)\r\n\t{\r\n\t\t\r\n\t}", "public function add() {\n\n $this->set('controller_name', 'Tickets');\n $this->set('controller_action', 'Adicionar');\n\n $this->set('entities', $this->Entity->find\n (\n \"list\", array\n (\n \"conditions\" => array('employee' => '1'),\n \"order\" => array('Entity.name asc')\n )\n )\n );\n\n $this->set('computer', $this->Computer->find\n (\n \"list\", array\n (\n \"fields\" => array('Computer.id', 'Computer.name'),\n \"order\" => array('Computer.name asc')\n )\n )\n );\n \n \n $this->set('device', $this->Device->find\n (\n \"list\", array\n (\n \"fields\" => array('Device.id', 'Device.name'),\n \"order\" => array('Device.name asc')\n )\n )\n );\n\n\n $this->set('problem', $this->Problem->find\n (\n \"list\", array\n (\n \"fields\" => array('Problem.id', 'Problem.problem'),\n \"order\" => array('Problem.problem asc')\n )\n )\n );\n\n\n if ($this->request->is('post') or $this->request->is('put')) {\n\n /*\n * Gerando o número do ticket\n * \n */\n\n $number = '00000';\n $lastnumber = $this->Ticket->field(\"number\", array('1'=>'1'), 'id DESC');\n\n if (preg_match('|^(?<year>[0-9]*)\\/(?<number>[0-9]+)$|siU', $lastnumber, $match)){\n $year = $match['year']; $number = $match['number'];\n\n if ((int) $year < (int) date('Y')){\n $number = '00000';\n }\n }\n\n $number = date('Y') . '/' . str_pad((int) $number+1, 5, '0', STR_PAD_LEFT);\n\n\n $this->request->data['Ticket']['number'] = $number;\n \n /*\n * Quando é enviado o ticket ele automaticamente recebe status aberto\n */\n $this->request->data['Ticket']['status'] = \"Aberto\";\n\n parent::save\n (\n \"Ticket\",\n \"Novo ticket foi enviado com sucesso!\",\n \"Ocorreu um problema ao encaminhar o ticket!\"\n );\n\n }\n\n $this->render('form');\n\n\n }", "function saveCandidate ($sheetData) {\n\n $JOB_ID = $GLOBALS['JOB_ID'];\n\n $leadDetails = array_merge([\n 'middle_name' => NULL,\n 'phone' => NULL,\n 'skype_id' => NULL,\n 'description' => NULL,\n 'address' => NULL,\n 'deleted' => false,\n 'spam' => false,\n 'read' => false,\n 'street' => NULL,\n 'city' => NULL,\n 'state' => NULL,\n 'country_code' => NULL,\n 'zip_code' => NULL,\n 'parsed_resume_id' => NULL,\n 'applicant_count' => NULL,\n 'unread_count' => NULL,\n 'from_email_conversation' => NULL,\n 'total_experience_in_months' => NULL,\n 'location' => NULL,\n 'has_resume' => false,\n 'added_by_id' => NULL,\n 'gender' => NULL,\n 'additional_detail_attributes' => \n [\n 'eeo_gender' => NULL,\n 'eeo_veteran' => NULL,\n 'eeo_ethnicity' => NULL,\n 'eeo_disabled' => NULL,\n ],\n 'source_id' => '3000028593',\n 'medium_id' => '3000026564',\n 'prospects_attributes' => \n [],\n 'qualifications_attributes' => \n [],\n 'positions_attributes' => \n [],\n 'resumes_attributes' => \n [],\n 'cover_letters_attributes' => \n [],\n 'portfolios_attributes' => \n [],\n 'other_attachments_attributes' => \n [],\n 'shared_attachments_attributes' => \n [],\n 'conversations_attributes' => \n [],\n 'user_id' => NULL,\n 'owner_id' => NULL,\n ], $sheetData); \n\n $curl = curl_init();\n\n curl_setopt_array($curl, array(\n CURLOPT_URL => \"https://tophire.freshteam.com/hire/jobs/$JOB_ID/applicants\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 0,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_POSTFIELDS => json_encode([\n 'applicant' => \n [\n 'reject_from_other_jobs' => false,\n 'read' => false,\n 'deleted' => false,\n 'rollback_cooloff' => false,\n 'skip_applicant_notification' => true,\n 'custom_field_attributes' => \n [\n ],\n 'misc' => \n [],\n 'job_id' => $JOB_ID,\n 'stage_id' => '3000296866',\n 'lead_attributes' => $leadDetails\n ,\n 'status' => NULL,\n 'interviews_attributes' => \n [],\n 'conversations_attributes' => \n [],\n 'moved_from_id' => NULL,\n 'followers_attributes' => \n [],\n 'requisition_id' => NULL,\n 'requisition_offered_id' => NULL,\n 'requisition_hired_id' => NULL,\n 'requisition_joined_id' => NULL,\n ]\n ]),\n CURLOPT_HTTPHEADER => [\n \"authority: tophire.freshteam.com\",\n \"x-ember-accept: v2.0.0.rc.88+ad9b6315\",\n \"x-csrf-token: qABozrZLDa4L3VTqyWNVPya04p8Bf4io9U1THLgz/dYRmnA9OITdLmv0rc4VQY3xAzwPgDbQFktgrEKw02ArXQ==\",\n \"authorization: JWTAuth token=dummy+token\",\n \"content-type: application/json; charset=UTF-8\",\n \"accept: application/json, text/javascript, */*; q=0.01\",\n \"sec-fetch-dest: empty\",\n \"x-requested-with: XMLHttpRequest\",\n \"user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36\",\n \"origin: https://tophire.freshteam.com\",\n \"sec-fetch-site: same-origin\",\n \"sec-fetch-mode: cors\",\n \"referer: https://tophire.freshteam.com/hire/jobs/$JOB_ID/candidates/listview\",\n \"accept-language: en-GB,en-US;q=0.9,en;q=0.8\",\n \"cookie: _hp2_ses_props.2382848529=%7B%22ts%22%3A1583167702291%2C%22d%22%3A%22tophire.freshteam.com%22%2C%22h%22%3A%22%2Fhire%2Fjobs%2F$JOB_ID%2Fcandidates%2Flistview%22%7D; _delighted_fst=1583167772215:{}; _delighted_lst=1581421998000:{%22token%22:%22lWqw08YTPniotsNzHz6ceAgS%22}; zarget_visitor_info=%7B%7D; _BEAMER_USER_ID_BGhqwDBY16511=49d24b1e-d858-458b-8e1f-f2612233fbe7; _BEAMER_FIRST_VISIT_BGhqwDBY16511=2020-03-02T16:49:40.328Z; _BEAMER_FILTER_BY_URL_BGhqwDBY16511=false; _hp2_id.2382848529=%7B%22userId%22%3A%22366753526166082%22%2C%22pageviewId%22%3A%226017826650818099%22%2C%22sessionId%22%3A%228597785792097825%22%2C%22identity%22%3A%223000078131%22%2C%22trackerVersion%22%3A%224.0%22%2C%22identityField%22%3Anull%2C%22isIdentified%22%3A1%7D; _ftcs=%7B%22authenticated%22%3A%7B%22authenticator%22%3A%22authenticator%3Adevise%22%2C%22token%22%3A%22dummy+token%22%2C%22email%22%3A%22dummy+email%22%2C%22isAuthenticated%22%3Atrue%7D%7D; _ftat=IkpXVEF1dGggdG9rZW49ZXlKaGJHY2lPaUprYVhJaUxDSmxibU1pT2lKQk1USTRSME5OSW4wLi5JbTRTTk0zUmF6TGpINGNPLk9hZTlfdU5yY3M5Q0NDWXVJVlBXbGkwRXcxeEZ0QjlqY3JFRGg1eXA3MDh1WldyTVVKeFdNcHVFUTdHNjFkZS1pQ0RTdGM3UmhZZ050azAxZGhHMjhVM2VBSVR3dmFZTGNxekhyU2JDRVZEb3hFVm93aUQ2djQxOWV1dVhiV0NQSXBOczNpU3JaYjkzVkhMX2NKSk53NXZCUWwydklCUkdKZW9aR1BjOVB6Vkl1TnRaSWI5OG12bE95OU5HNnljaGoxZXpnYUgzdXN6a2pkSWJJVXJpbUd1SHRSVUpLY1VBUDIycVpKOTNYVGQ0LnM5RXkyTVdIeU5PQkpha08zcmVwRnci--580ed98be5c23992dadcb53a6d30764229e8edb9; _session_id=TGFBcjFxbW1ENWpJdlFEdHg3Y2lSSEVYaGNSSVlZaDlpdFgza3AybllGbC9UOGFyOVBHbXAxU0tCQ3FUZlQ3Y0lsU3NtR0lnRGY5Z0ZRcXdOVnY1TGNXNEF0TUdQMzNiMWZkaGVlN201c2VQT2x2c2xRcU9QeENHMnBnRVRMd3I5ektwNGVqa1c3N0NhVVM3ZHFsZ3F3PT0tLWszSXJRUUFFVmRTVC9wTkxkY1MwZ1E9PQ%3D%3D--6bfa03eb0ae645020a5cbcdf3bf794e5477e2908\"\n ],\n ));\n\n $response = curl_exec($curl);\n\n curl_close($curl);\n prettyPrintOutput($response);\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if user is an editor (permission level 2)
public function isEditor(){ return $this->checkPermissions(2); }
[ "public function isEditor(){\n return ($this->role ==='editor') ? true : false;\n }", "public function isEditor(): bool\n {\n return $this->hasRole('editor');\n }", "public function isEditor(): bool\n {\n return $this->getClaimSafe(SharedClaimsInterface::CLAIM_USER_ROLE) === self::$userRoleEditor;\n }", "public function isEditor()\n {\n return $this->role()->where('id', $this->roles['EDITOR'])->exists();\n }", "function hasEditorPermission($uid) {\n return hasPermission($uid, 'becomeEditor');\n}", "public static function editor()\n\t{\n\t\tif(!self::guest() && self::user()->admin_type == '3')\n\t\t\treturn true;\n\t\treturn false;\n\t}", "public function isEditor()\n {\n if (auth()->guest()) {\n return false;\n }\n\n return in_array(auth()->user()->email, $this->editors);\n }", "function isEditorPu(){\n\t$userUtil = new Users('');\n\t$user2role= new mapUserRole();\n\t$userRoles=array();\n\t$roles= new Roles();\n\t$session_username = $_SESSION['sess_username'];\n\t$userId = $userUtil->findIdByUser($_SESSION['sess_username']);\t\t\n\t$rolesId=$user2role->findByUser($userId['idUser']);\n\t$isEditorPu=false;\n\tforeach($rolesId as $id){\n\t\t$type=$roles->findTypeById($id);\n\t\tif($type!='Contributor'){\n\t\t\t$isEditorPu=true;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn $isEditorPu;\n}", "private function _isEditor()\r\n\t\t{\r\n\t\t\treturn (isset($_SESSION['isEditor']) && $_SESSION['isEditor'] == true);\r\n\t\t}", "function hasEditPermission() {\n\t\tglobal $login;\n\t\treturn $login->isWebmaster();\n\t}", "public function isEditor()\r\n\t{\r\n\t\treturn $this->editor;\r\n\t}", "public function canEdit(): bool\n {\n if (Auth::getLoggedInUserId() == $this->user_id || Auth::isMod() || Auth::isAdmin()) {\n return true;\n }\n\n return false;\n }", "private function isAllowedRichEdit()\n {\n if ($this->restricted) {\n $user = common_current_user();\n return !empty($user) && $user->hasRole('richedit');\n } else {\n return true;\n }\n }", "public function canEdit()\n\t{\n\t\tif (!$this->hasId())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// User has global edit permissions\n\t\tif ($this->canDo($this->getAclPrefix() . '.edit'))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t// User has global edit permissions\n\t\tif ($this->canDo($this->getAclPrefix() . '.edit.own'))\n\t\t{\n\t\t\treturn $this->isOwner();\n\t\t}\n\n\t\treturn false;\n\t}", "function getIsEditor() {\n\t\treturn $this->getData('isEditor');\n\t}", "public function check_ifhelphub_editor() {\n\t\t$user_roles = wp_get_current_user()->roles;\n\t\tif ( in_array( 'helphub_editor', $user_roles, true ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function hasEditPermission()\n {\n if ($this->getUser() == $this->adapter->getUser()) {\n return true;\n }\n\n return false;\n }", "public function canEdit()\n {\n if (!function_exists('current_user_can')) {\n return false;\n }\n if (current_user_can('edit_post', $this->ID)) {\n return true;\n }\n return false;\n }", "private function is_elementor_editor()\n {\n if ((isset($_REQUEST['action']) && 'elementor' == $_REQUEST['action']) ||\n isset($_REQUEST['elementor-preview'])\n ) {\n return true;\n }\n\n return false;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Service with simplified mocks injected only for testing exceptions
protected function getServiceMocksForException($service) { $transport = $this->getTransportMock(); $entityFactory = \Mockery::mock('\WalmartApiClient\Factory\EntityFactoryInterface'); $collectionFactory = \Mockery::mock('\WalmartApiClient\Factory\CollectionFactoryInterface'); $serviceClass = '\\WalmartApiClient\\Service\\' . $service . 'Service'; return new $serviceClass($transport, $entityFactory, $collectionFactory); }
[ "protected function getServiceToTest()\n {\n $reflection = new \\ReflectionObject($this);\n\n $fixturesDirectory = dirname($reflection->getFileName()) . '/Expected/';\n\n $transportRequest = file_get_contents($fixturesDirectory . $this->getName() . 'Request.json');\n $transportRequest = json_encode(json_decode($transportRequest));\n $transportResponse = file_get_contents($fixturesDirectory . $this->getName() . 'Response.json');\n\n $transportMock = $this->getMock(TransportInterface::class);\n $transportMock\n ->expects($this->once())\n ->method('sendRequest')\n ->with($this->equalTo($transportRequest))\n ->willReturn($transportResponse);\n\n AnnotationRegistry::registerLoader('class_exists');\n\n $serializer = SerializerBuilder::create()\n ->setCacheDir(self::$serializerTempDirectory)\n ->build();\n\n $class = $this->getClassUnderTest();\n $service = new $class($transportMock, $serializer);\n\n return $service;\n }", "public function testServiceFailToLoad()\n {\n $di = new \\Anax\\DI\\DI();\n $di->set(\"service\", function () {\n throw new \\Exception();\n });\n $di->get(\"service\");\n }", "public function testGetForSyntheticServiceWithException() {\n $this->expectException(RuntimeException::class);\n $this->container->get('synthetic');\n }", "public function testHandleWithMockServices(): void\n {\n $this->mockService(stdClass::class, function () {\n return json_decode('{\"mock\":true}');\n });\n $this->get('/dependencies/requiredDep');\n $this->assertResponseOk();\n $this->assertResponseContains('\"mock\":true', 'Contains the data from the stdClass mock container.');\n }", "public function testCreateService()\n\t{\n\t\t$configuration = [\n\t\t\t'authorize' => []\n\t\t];\n\n\t\t$mockedSM = $this->getMock(get_class(\\Bootstrap::getServiceManager()), ['get']);\n\t\t$mockedSM->expects($this->any())\n\t\t\t->method('get')\n\t\t\t->will($this->returnValue($configuration));\n\n\t\t$this->assertInstanceOf(\n\t\t\t'Zend\\Cache\\Storage\\Adapter\\Memory',\n\t\t\t$this->factory->createService($mockedSM)\n\t\t);\n\t}", "public function testServiceNotFound(): void\n {\n $this->expectException(ServiceNotFound::class);\n $this->expectExceptionMessage('No service found for key \"foo\".');\n\n $container = $this->createMock(ContainerInterface::class);\n\n /**\n * @var ContainerInterface $container\n */\n $serviceLocator = new ServiceLocator($container);\n $serviceLocator->getService('foo');\n }", "public function testLoadFailesInServiceCreationWithCustomException()\n {\n $di = new DI();\n $service = 'failsWithException';\n\n $di->set($service, function () {\n throw new \\Exception(\"Failed creating service.\");\n });\n\n $di->get($service);\n }", "protected function mockAppService()\n\t{\n\t\tif (!($this->mock_app_service instanceof WebServices_WebService))\n\t\t{\n\t\t\t$this->mock_app_service = $this->getMock(\n\t\t\t\t'WebServices_WebService',\n\t\t\t\tarray('getEnabled', 'getReadEnabled', 'isReadEnabled', 'isEnabled', \n\t\t\t\t\t'bulkUpdateApplicationPricePoint', 'bulkUpdateApplicationStatus',\n\t\t\t\t\t'updateApplicationStatus', 'getApplicationStatus', \n\t\t\t\t\t'getApplicationStatusHistoryResponse', 'updateApplicant', 'updateContactInfo', \n\t\t\t\t\t'getEmploymentInfo', 'updateEmploymentInfo', 'updatePaydateInfo', 'insert',\n\t\t\t\t\t'insertApplicantAccount', 'getApplicationPersonalReferences',\n\t\t\t\t\t'updatePersonalReference', 'updateApplication', 'insertDoNotLoanFlag',\n\t\t\t\t\t'deleteDoNotLoanFlag', 'overrideDoNotLoanFlag', 'updateRegulatoryFlag',\n\t\t\t\t\t'getDoNotLoanFlagAll','getDoNotLoanFlagOverrideAll', 'applicationSearch',\n\t\t\t\t\t'getApplicationAuditInfo', 'createSoapClient', 'flagSearchBySsn', 'getContactInfo'\n\t\t\t\t),\n\t\t\t\tarray($this->mockApplog(),'','',''));\n\t\t\t\t$this->mock_app_service->expects($this->any())->method('createSoapClient')->will($this->returnValue($this->mockSoapClientWrapper()));\n\t\t}\n\t\treturn $this->mock_app_service;\n\t}", "public function testServiceNotFoundException()\n {\n $this->expectException(ServiceNotFoundException::class);\n $client = $this->getClientWithServiceNotFoundExceptionMock();\n $serviceService = new ServiceService($client);\n $serviceService->getByOpenDataUri('http://foo.bar/123');\n }", "public function testGetRawService()\n {\n $this->specify(\n \"Getting raw services does now work correctly\",\n function () {\n $this->phDi->set('service1', 'some-service');\n expect($this->phDi->getRaw('service1'))->equals('some-service');\n }\n );\n }", "public function testGetServiceNotFoundForOtherObject()\n {\n // Arrange\n App::shouldReceive('make')->never();\n $somethingElse = new \\stdClass();\n\n $mock = \\Mockery::mock('OtherStub')->makePartial();\n $mock->shouldReceive('setService', 'getService')->never();\n\n // test against a raw model to validate fallback to normal __get/__set functionality\n $model = new OtherStub;\n\n // Act\n $mock->noService = $somethingElse;\n $model->noService = $somethingElse;\n\n // Assert\n $this->assertSame($somethingElse, $mock->noService);\n $this->assertSame($somethingElse, $model->noService);\n }", "public function testServiceNotExists()\n {\n $this->container->get('wsw');\n }", "function s($service)\n{\n return AppKernel::getInstance()->getContainer()->get($service);\n}", "public function testManagedService(): void\n {\n $resolver = $this->createMock(ResolverInterface::class);\n $resolver\n ->expects($this->exactly(2))\n ->method('getService')\n ->with(\n 'A',\n $this->isInstanceOf(ServiceLocatorInterface::class),\n ['foo' => 'bar']\n )\n ->willReturnOnConsecutiveCalls(\n new stdClass(),\n new stdClass()\n );\n\n $resolver\n ->expects($this->exactly(2))\n ->method('hasService')\n ->with('A')\n ->willReturn(true);\n\n $container = $this->createMock(ContainerInterface::class);\n\n /**\n * @var ResolverInterface $resolver\n * @var ContainerInterface $container\n */\n $serviceLocator = new ServiceLocator($container);\n $service1 = $serviceLocator\n ->addResolver($resolver, 'invokables')\n ->getService('A', ['foo' => 'bar']);\n\n $service2 = $serviceLocator\n ->addResolver($resolver, 'invokables')\n ->getService('A', ['foo' => 'bar']);\n\n $this->assertNotSame($service1, $service2);\n }", "protected function maybeEnhanceTestCaseIfWoDiService()\n {\n try {\n $this->getMetadata()->getService('di');\n } catch (InjectionException $e) {\n $loader = new CodeceptionUnitLoader();\n $reflectionMethod = new ReflectionMethod($loader, 'enhancePhpunitTest');\n $reflectionMethod->setAccessible(true);\n $reflectionMethod->invoke($loader, $this);\n $this->getMetadata()->setServices([ 'di' => new Di() ]);\n }\n }", "public function testAddWithServiceError()\n {\n $composedEmailRepositoryWriter = (new Mockery($this))->getRepositoryMock(false, null, null, 1);\n $composedEmailWriterService = (new Mockery($this))->getRepositoryServiceMock($composedEmailRepositoryWriter);\n\n $post = [\n EmailPropertyNameList::FROM => 'test@test.com',\n EmailPropertyNameList::TO => 'test@test.com',\n EmailPropertyNameList::SUBJECT => 'subject',\n EmailPropertyNameList::BODY => 'body',\n EmailPropertyNameList::DELAY => '1',\n ];\n\n $request = (new Mockery($this))->getServerRequestMock();\n $request->expects($this->once())\n ->method('getParsedBody')\n ->willReturn($post);\n\n $response = new Response();\n\n $emailService = new EmailService(\n (new Mockery($this))->getViewServiceMock(),\n (new Mockery($this))->getLoggerMock(),\n (new Mockery($this))->getQueueServiceMock(),\n [],\n (new Mockery($this))->getRepositoryServiceMock(),\n $composedEmailWriterService,\n (new Mockery($this))->getRepositoryServiceMock(),\n (new Mockery($this))->getRepositoryServiceMock(),\n (new Mockery($this))->getSMTPServiceMock()\n );\n\n /** @var \\Slim\\Http\\Response $result */\n $result = $emailService->add($request, $response, []);\n\n $this->assertInstanceOf(ResponseInterface::class, $result);\n $this->assertEquals(500, $result->getStatusCode());\n }", "protected function getMockContainerDefinition() {\n $fake_service = new \\stdClass();\n $parameters = [];\n $parameters['some_parameter_class'] = get_class($fake_service);\n $parameters['some_private_config'] = 'really_private_lama';\n $parameters['some_config'] = 'foo';\n $parameters['some_other_config'] = 'lama';\n $parameters['factory_service_class'] = get_class($fake_service);\n // Also test alias resolving.\n $parameters['service_from_parameter'] = $this->getServiceCall('service.provider_alias');\n\n $services = [];\n $services['service_container'] = [\n 'class' => '\\Drupal\\service_container\\DependencyInjection\\Container',\n ];\n $services['other.service'] = [\n 'class' => get_class($fake_service),\n ];\n\n $services['non_shared_service'] = [\n 'class' => get_class($fake_service),\n 'shared' => FALSE,\n ];\n\n $services['other.service_class_from_parameter'] = [\n 'class' => $this->getParameterCall('some_parameter_class'),\n ];\n $services['late.service'] = [\n 'class' => get_class($fake_service),\n ];\n $services['service.provider'] = [\n 'class' => '\\Drupal\\Tests\\Component\\DependencyInjection\\MockService',\n 'arguments' => $this->getCollection([\n $this->getServiceCall('other.service'),\n $this->getParameterCall('some_config'),\n ]),\n 'properties' => $this->getCollection(['_someProperty' => 'foo']),\n 'calls' => [\n [\n 'setContainer',\n $this->getCollection([\n $this->getServiceCall('service_container'),\n ]),\n ],\n [\n 'setOtherConfigParameter',\n $this->getCollection([\n $this->getParameterCall('some_other_config'),\n ]),\n ],\n ],\n 'priority' => 0,\n ];\n\n // Test private services.\n $private_service = [\n 'class' => '\\Drupal\\Tests\\Component\\DependencyInjection\\MockService',\n 'arguments' => $this->getCollection([\n $this->getServiceCall('other.service'),\n $this->getParameterCall('some_private_config'),\n ]),\n 'public' => FALSE,\n ];\n\n $services['service_using_private'] = [\n 'class' => '\\Drupal\\Tests\\Component\\DependencyInjection\\MockService',\n 'arguments' => $this->getCollection([\n $this->getPrivateServiceCall(NULL, $private_service),\n $this->getParameterCall('some_config'),\n ]),\n ];\n $services['another_service_using_private'] = [\n 'class' => '\\Drupal\\Tests\\Component\\DependencyInjection\\MockService',\n 'arguments' => $this->getCollection([\n $this->getPrivateServiceCall(NULL, $private_service),\n $this->getParameterCall('some_config'),\n ]),\n ];\n\n // Test shared private services.\n $id = 'private_service_shared_1';\n\n $services['service_using_shared_private'] = [\n 'class' => '\\Drupal\\Tests\\Component\\DependencyInjection\\MockService',\n 'arguments' => $this->getCollection([\n $this->getPrivateServiceCall($id, $private_service, TRUE),\n $this->getParameterCall('some_config'),\n ]),\n ];\n $services['another_service_using_shared_private'] = [\n 'class' => '\\Drupal\\Tests\\Component\\DependencyInjection\\MockService',\n 'arguments' => $this->getCollection([\n $this->getPrivateServiceCall($id, $private_service, TRUE),\n $this->getParameterCall('some_config'),\n ]),\n ];\n\n // Tests service with invalid argument.\n $services['invalid_argument_service'] = [\n 'class' => '\\Drupal\\Tests\\Component\\DependencyInjection\\MockService',\n 'arguments' => $this->getCollection([\n // Test passing non-strings, too.\n 1,\n (object) [\n 'type' => 'invalid',\n ],\n ]),\n ];\n\n $services['invalid_arguments_service'] = [\n 'class' => '\\Drupal\\Tests\\Component\\DependencyInjection\\MockService',\n 'arguments' => (object) [\n 'type' => 'invalid',\n ],\n ];\n\n // Test service that needs deep-traversal.\n $services['service_using_array'] = [\n 'class' => '\\Drupal\\Tests\\Component\\DependencyInjection\\MockService',\n 'arguments' => $this->getCollection([\n $this->getCollection([\n $this->getServiceCall('other.service'),\n ]),\n $this->getParameterCall('some_private_config'),\n ]),\n ];\n\n $services['service_with_optional_dependency'] = [\n 'class' => '\\Drupal\\Tests\\Component\\DependencyInjection\\MockService',\n 'arguments' => $this->getCollection([\n $this->getServiceCall('service.does_not_exist', ContainerInterface::NULL_ON_INVALID_REFERENCE),\n $this->getParameterCall('some_private_config'),\n ]),\n\n ];\n\n $services['factory_service'] = [\n 'class' => '\\Drupal\\service_container\\ServiceContainer\\ControllerInterface',\n 'factory' => [\n $this->getServiceCall('service.provider'),\n 'getFactoryMethod',\n ],\n 'arguments' => $this->getCollection([\n $this->getParameterCall('factory_service_class'),\n ]),\n ];\n $services['factory_class'] = [\n 'class' => '\\Drupal\\service_container\\ServiceContainer\\ControllerInterface',\n 'factory' => '\\Drupal\\Tests\\Component\\DependencyInjection\\MockService::getFactoryMethod',\n 'arguments' => [\n '\\Drupal\\Tests\\Component\\DependencyInjection\\MockService',\n [NULL, 'bar'],\n ],\n 'calls' => [\n [\n 'setContainer',\n $this->getCollection([\n $this->getServiceCall('service_container'),\n ]),\n ],\n ],\n ];\n\n $services['wrong_factory'] = [\n 'class' => '\\Drupal\\service_container\\ServiceContainer\\ControllerInterface',\n 'factory' => (object) ['I am not a factory, but I pretend to be.'],\n ];\n\n $services['circular_dependency'] = [\n 'class' => '\\Drupal\\Tests\\Component\\DependencyInjection\\MockService',\n 'arguments' => $this->getCollection([\n $this->getServiceCall('circular_dependency'),\n ]),\n ];\n $services['synthetic'] = [\n 'synthetic' => TRUE,\n ];\n // The file could have been named as a .php file. The reason it is a .data\n // file is that SimpleTest tries to load it. SimpleTest does not like such\n // fixtures and hence we use a neutral name like .data.\n $services['container_test_file_service_test'] = [\n 'class' => '\\stdClass',\n 'file' => __DIR__ . '/Fixture/container_test_file_service_test_service_function.data',\n ];\n\n // Test multiple arguments.\n $args = [];\n for ($i = 0; $i < 12; $i++) {\n $services['service_test_instantiation_' . $i] = [\n 'class' => '\\Drupal\\Tests\\Component\\DependencyInjection\\MockInstantiationService',\n // Also test a collection that does not need resolving.\n 'arguments' => $this->getCollection($args, FALSE),\n ];\n $args[] = 'arg_' . $i;\n }\n\n $services['service_parameter_not_exists'] = [\n 'class' => '\\Drupal\\Tests\\Component\\DependencyInjection\\MockService',\n 'arguments' => $this->getCollection([\n $this->getServiceCall('service.provider'),\n $this->getParameterCall('not_exists'),\n ]),\n ];\n $services['service_dependency_not_exists'] = [\n 'class' => '\\Drupal\\Tests\\Component\\DependencyInjection\\MockService',\n 'arguments' => $this->getCollection([\n $this->getServiceCall('service_not_exists'),\n $this->getParameterCall('some_config'),\n ]),\n ];\n\n $services['service_with_parameter_service'] = [\n 'class' => '\\Drupal\\Tests\\Component\\DependencyInjection\\MockService',\n 'arguments' => $this->getCollection([\n $this->getParameterCall('service_from_parameter'),\n // Also test deep collections that don't need resolving.\n $this->getCollection([\n 1,\n ], FALSE),\n ]),\n ];\n\n // To ensure getAlternatives() finds something.\n $services['service_not_exists_similar'] = [\n 'synthetic' => TRUE,\n ];\n\n // Test configurator.\n $services['configurator'] = [\n 'synthetic' => TRUE,\n ];\n $services['configurable_service'] = [\n 'class' => '\\Drupal\\Tests\\Component\\DependencyInjection\\MockService',\n 'arguments' => [],\n 'configurator' => [\n $this->getServiceCall('configurator'),\n 'configureService',\n ],\n ];\n $services['configurable_service_exception'] = [\n 'class' => '\\Drupal\\Tests\\Component\\DependencyInjection\\MockService',\n 'arguments' => [],\n 'configurator' => 'configurator_service_test_does_not_exist',\n ];\n\n // Raw argument\n $services['service_with_raw_argument'] = [\n 'class' => '\\Drupal\\Tests\\Component\\DependencyInjection\\MockInstantiationService',\n 'arguments' => $this->getCollection([$this->getRaw('ccc')]),\n ];\n\n $aliases = [];\n $aliases['service.provider_alias'] = 'service.provider';\n $aliases['late.service_alias'] = 'late.service';\n\n return [\n 'aliases' => $aliases,\n 'parameters' => $parameters,\n 'services' => $services,\n 'frozen' => TRUE,\n 'machine_format' => $this->machineFormat,\n ];\n }", "public function getWrappedService()\n {\n if (null === $this->service) {\n $this->factory();\n }\n\n return $this->service;\n }", "public function testCreateRequestsContainerForConfigServiceGracefully()\n {\n $container = $this->containerBuilder->getMockForAbstractClass();\n $container->expects($this->atLeastOnce())\n ->method('has')\n ->with('config')\n ->willReturn(false);\n\n $container->expects($this->never())\n ->method('get')\n ->with('config');\n\n $result = (new ConfigFactory())->create($container);\n $this->assertInstanceOf(ConfigInterface::class, $result);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Plugin Name: WebEngage Plugin URI: Description: WebEngage lets you collect feedback from your website visitors. With WebEngage, you can also conduct insite surveys to gather realtime insights from your customers. Oh, did we tell you that you can also use WebEngage to push notification messages to visitors on your website? Yes, we made throwing discount codes to visitors on your site real easy! To get started: 1) Click the "Activate" link to the left of this description, 2) You'll be taken to the WebEngage configuration page; signup to create your account. That's it! Get an endtoend feedback, survey management and push notification solution in less than 5 minutes. Version: 2.0.2 Author: WebEngage Author URI: rendring the webengage widget code
function render_webengage() { $webengage_license_code = get_option('webengage_license_code'); // render the widget if license code is present if ($webengage_license_code && $webengage_license_code !== '') { ?> <!-- Added via WebEngage Wordpress Plugin 2.0.1 --> <script id="_webengage_script_tag" type="text/javascript"> var _weq = _weq || {}; _weq['webengage.licenseCode'] = '<?php echo $webengage_license_code; ?>'; _weq['webengage.widgetVersion'] = "4.0"; (function(d){ var _we = d.createElement('script'); _we.type = 'text/javascript'; _we.async = true; _we.src = (d.location.protocol == 'https:' ? "//ssl.widgets.webengage.com" : "//cdn.widgets.webengage.com") + "/js/widget/webengage-min-v-4.0.js"; var _sNode = d.getElementById('_webengage_script_tag'); _sNode.parentNode.insertBefore(_we, _sNode); })(document); </script> <?php } }
[ "public function getPluginDeveloper();", "function mickesplugin_page() {\n\techo \"<h1>Micke's Plugin</h1>\";\n\techo \"<p>Hello and welcome to Micke's Plugin.</p>\";\n\techo \"<p>We hope that you enjoy your experience. Hello github test ubud showing sam</p>\";\n}", "function snax_admin_settings_embedly_section_description() {\n\t?>\n\t<p><?php echo wp_kses_post( __( '<a href=\"http://Embedly.com\" target=\"_blank\">Embedly</a> is an alternative embed handler for Snax. It allows you to have unified, beautiful embeds on your site with more than 400 services supported. Free plan does not require any API key - just enable and enjoy!', 'snax' ) ); ?>\n\t</p>\n\t<?php\n}", "function main_call()\n{\n\techo (\"<h3> Website Performance Index Plugin<br> for Reef's Sites </h3>\");\n}", "public function setup()\n {\n $options = Cleeng_Core::get_config();\n // Setup admin menu\n add_action('admin_menu', array($this, 'action_admin_menu'));\n\n // Backend CSS\n wp_enqueue_style('cleengBEWidget.css', CLEENG_PLUGIN_URL . 'css/cleengBEWidget.css');\n\n wp_enqueue_script('CleengClient', 'https://' . $options['platformUrl'] . '/js-api/client.js');\n\n // register admin_init action hook\n add_action('admin_init', array($this, 'action_admin_init'));\n\n // post list\n add_action('load-edit.php', array($this, 'post_list'));\n\n // setup editor\n add_action('load-post.php', array($this, 'setup_editor'));\n add_action('load-post-new.php', array($this, 'setup_editor'));\n add_action('load-page.php', array($this, 'setup_editor'));\n add_action('load-page-new.php', array($this, 'setup_editor'));\n\n // \"Settings\" link in \"plugins\" menu\n $this_plugin = plugin_basename(realpath(dirname(__FILE__) . '/../../cleengWP.php'));\n add_filter('plugin_action_links_' . $this_plugin, array($this, 'action_plugin_action_links'), 10, 2);\n\n // in_admin_footer action handler - pass appSecureKey to CleengWidget JS object\n add_action( 'in_admin_footer', array($this, 'action_in_admin_footer') );\n\n // init session if it is not started yet\n if (!session_id()) {\n session_start();\n }\n\n // display messages saved in $_SESSION\n if (isset($_SESSION['cleeng_messages'])) {\n foreach (\n $_SESSION['cleeng_messages'] as $msg\n ) {\n $this->message($msg);\n }\n unset($_SESSION['cleeng_messages']);\n }\n // display errors saved in $_SESSION\n if (isset($_SESSION['cleeng_errors'])) {\n foreach (\n $_SESSION['cleeng_errors'] as $err\n ) {\n $this->error_message($err);\n }\n unset($_SESSION['cleeng_errors']);\n }\n add_action('wp_dashboard_setup', array($this, 'dashboard'));\n add_action('plugins_loaded', array($this, 'plugins'));\n\n }", "public function setup_plugin_url()\n {\n }", "function tb_onPluginActivate() {\r\n add_option('tagBeep_redirect_to_plugin', 'true');\r\n}", "public function plugin_enable(){\r\n\r\n\t}", "function wp_dashboard_plugins()\n {\n }", "function wp_dashboard_plugins() {}", "function getDescription() {\n return 'A plugin to test plugin helppages';\n }", "public function plugins_page() {\n\t\t$this->init_i18n_support();\n\t\t// add additional links on Plugins page\n\t\tadd_filter( 'plugin_action_links_' . IGGOGRID_BASENAME, array( $this, 'add_plugin_action_links' ) );\n\t\tadd_filter( 'plugin_row_meta', array( $this, 'add_plugin_row_meta' ), 10, 2 );\n\t}", "public function plugin_settings_description() {\n\t\t\n\t\t$description = '<p>';\n\t\t$description .= sprintf(\n\t\t\t__( 'CleverReach makes it easy to send email newsletters to your customers, manage your subscriber lists, and track campaign performance. Use Gravity Forms to collect customer information and automatically add it to your CleverReach group. If you don\\'t have a CleverReach account, you can %1$ssign up for one here.%2$s', 'gravityformscleverreach' ),\n\t\t\t'<a href=\"http://www.cleverreach.com/\" target=\"_blank\">', '</a>'\n\t\t);\n\t\t$description .= '</p>';\n\t\t\n\t\tif ( ! $this->initialize_api() ) {\n\t\t\t\n\t\t\t$description .= '<p>';\n\t\t\t$description .= __( 'Gravity Forms CleverReach Add-On requires an API Key, with reading and writing authorization, which can be found on the API page under the Extras menu in your account settings.', 'gravityformscleverreach' );\n\t\t\t$description .= '</p>';\n\t\t\t\n\t\t}\n\t\t\t\t\n\t\treturn $description;\n\t\t\n\t}", "public function Plugin() {\n \n // adds body class to our admin pages\n add_filter('admin_body_class', array($this, 'bodyClass'));\n \n // Remove Color Schemes from profile_personal_options\n add_action('admin_head', array($this, 'removeColorSchemes'));\n \n // Remove Tabs\n add_action('admin_head', array($this, 'removeHelpTab'));\n add_action('screen_options_show_screen', array($this, 'removeSOTab'), 10, 2);\n \n // Changes Footer Texts\n add_filter('admin_footer_text', array($this, 'footerLeft'));\n add_filter('update_footer', array($this, 'footerRight'), 11);\n\n // remove WP logo from adminbar\n add_action('wp_before_admin_bar_render', array($this, 'removeWPLogo'));\n\n // adds our custom site logo\n add_action('admin_bar_menu', array($this, 'customLogo'), 0);\n\n // Remove Howdy\n add_filter('admin_bar_menu', array($this, 'removeHowdy'), 25);\n \n // On Activation\n add_action('init', array($this, 'onActivation'));\n \n }", "function itcompany_register_required_plugins() {\n\t$plugins = array(\n\t\tarray(\n\t\t\t'name' => esc_html__( 'Jet Plugin Wizard', 'itcompany' ),\n\t\t\t'slug' => 'jet-plugins-wizard',\n\t\t\t'source' => 'https://github.com/ZemezLab/jet-plugins-wizard/archive/master.zip',\n\t\t\t'external_url' => 'https://github.com/ZemezLab/jet-plugins-wizard',\n\t\t),\n\t);\n\t$config = array(\n\t\t'id' => 'itcompany',\n\t\t'default_path' => '',\n\t\t'menu' => 'tgmpa-install-plugins',\n\t\t'has_notices' => true,\n\t\t'dismissable' => true,\n\t\t'dismiss_msg' => '',\n\t\t'is_automatic' => true,\n\t\t'message' => '',\n\t);\n\ttgmpa( $plugins, $config );\n}", "function rehub_plugin_intro_text( $default_text ) {\n\t$tf_support_date = '';\n\t$rehub_options = get_option( 'Rehub_Key' );\n\t$tf_username = isset( $rehub_options[ 'tf_username' ] ) ? $rehub_options[ 'tf_username' ] : '';\n\t$tf_purchase_code = isset( $rehub_options[ 'tf_purchase_code' ] ) ? $rehub_options[ 'tf_purchase_code' ] : '';\n\n\t$registeredlicense = false;\n\tif($tf_username && $tf_purchase_code){\n\t\t$registeredlicense = true;\n\t}\n\tif(!$registeredlicense){\n\t\t$default_text = sprintf( '<h3>To get access to ALL demo stacks, you must register your purchase.<br />See the <a href=\"%s\">Product Registration tab</a> for instructions on how to complete registration.</h3>', admin_url( 'admin.php?page=rehub' ) );\n\t return $default_text;\t\t\n\t}else{\n\t return '<br/><a href=\"http://rehubdocs.wpsoul.com/docs/rehub-theme/theme-install-update-translation/importing-demo-data/\" target=\"_blank\">'.__('How to use DEMO import and possible issues. Read before import','rehub-theme').'</a><br/><br/>';\n\t}\t\n\n}", "function plugin_support (){\r\n\r\n // share buttons\r\n if ($this->_options['wpsc_top_of_products_page']==\"yes\"){add_action('wpsc_top_of_products_page', 'my_wp_ecommerce_share_links' );}\r\n if ($this->_options['wpsc_product_before_description']==\"yes\"){add_action('wpsc_product_before_description', 'my_wp_ecommerce_share_links' );}\r\n if ($this->_options['wpsc_product_addon_after_descr']==\"yes\"){add_action('wpsc_product_addon_after_descr', 'my_wp_ecommerce_share_links' );}\r\n\r\n // interactive buttons\r\n // after description\r\n if ($this->_options['like_wpsc_product_addon_after_descr']==\"yes\" || $this->_options['tweet_wpsc_product_addon_after_descr']==\"yes\" || $this->_options['stumble_wpsc_product_addon_after_descr']=='yes')\r\n {\r\n add_action('wpsc_product_addon_after_descr',array($this, 'wp_ecommerce_interactive_links_top' ));}\r\n // before\r\n if ($this->_options['like_wpsc_product_before_description']==\"yes\"||$this->_options['tweet_wpsc_product_before_description']==\"yes\" || $this->_options['stumble_wpsc_product_before_description']=='yes'){\r\n add_action('wpsc_product_before_description',array($this, 'wp_ecommerce_interactive_links_top' ));\r\n }\r\n // title\r\n if ($this->_options['tweet_wpsc_top_of_products_page']==\"yes\"||$this->_options['like_wpsc_top_of_products_page']==\"yes\"||$this->_options['stumble_wpsc_top_of_products_page']==\"yes\"){\r\n add_action('wpsc_top_of_products_page',array($this, 'wp_ecommerce_interactive_links_top' ));\r\n }\r\n }", "function plugin_advancedplanning_install() {\n return true;\n}", "function mixd_wp_demo_description() {\n return __(\"This is a short description about how to use this plugin\", \"mixd-wp-demo\");\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a port check to the readiness checks.
public function checkPort(string $host, int $port): self { $this->checkers[] = new PortCheck($host, $port); return $this; }
[ "function die_port() {\n\tif ($GLOBALS['port_to_check'] == '') {\n\t\tdie ( \"checking multiple ports is not currently supported\" );\n\t}\n}", "private function init_checks() {\n\n\t\t$is_proxy_running = EE::launch( \"docker inspect -f '{{.State.Running}}' $this->proxy_type\", false, true );\n\n\t\tif ( ! $is_proxy_running->return_code ) {\n\t\t\tif ( preg_match( '/false/', $is_proxy_running->stdout ) ) {\n\t\t\t\t$this->start_proxy_server();\n\t\t\t}\n\t\t} else {\n\t\t\t/**\n\t\t\t * Checking ports.\n\t\t\t */\n\t\t\t@fsockopen( 'localhost', 80, $port_80_exit_status );\n\t\t\t@fsockopen( 'localhost', 443, $port_443_exit_status );\n\n\t\t\t// if any/both the port/s is/are occupied.\n\t\t\tif ( ! ( $port_80_exit_status && $port_443_exit_status ) ) {\n\t\t\t\tEE::error( 'Cannot create proxy container. Please make sure port 80 and 443 are free.' );\n\t\t\t}\n\t\t\t$this->create_proxy_server();\n\t\t}\n\t}", "public function withPort($port)\n\t{\n\t}", "public function setPort($port){}", "public function setPort($port)\n {\n // Check port\n if (!preg_match(\"#^[0-9]{1,5}$#\", $port)) return false;\n\n // Add port to the starting-URL\n $url_parts = PHPCrawlerUtils::splitURL($this->starting_url);\n $url_parts[\"port\"] = $port;\n $this->starting_url = PHPCrawlerUtils::buildURLFromParts($url_parts, true);\n \n return true;\n }", "public function setPort($port);", "public function hasPort(){\r\n \r\n return !is_null($this->port);\r\n \r\n }", "public function hasPort(): bool\n {\n return !empty($this->port);\n }", "public function setPort($port) { $this->port = $port; }", "public function hasPort() {\r\n return !empty($this->_port);\r\n }", "private function findPort (){\n $this->debug->log(\"findPort() for \" . $this->ip);\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_TIMEOUT, 3);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n if ($this->meta->get(\"port\") !== WemoMeta::KEY_NOT_SET)\n $port = $this->meta->get(\"port\");\n else\n $port = self::MIN_PORT - 1;\n\n while (true){ // hotloop. Should probably add a BIG max timeout here\n if ($port >= self::MAX_PORT){\n $port = self::MIN_PORT;\n sleep(self::RETRY_SLEEP);\n }\n\n curl_setopt($ch, CURLOPT_URL, \"http://\" . $this->ip . \":\" . $port);\n\n $res = curl_exec($ch);\n\n if ($res){\n $this->debug->log(\"found port \" . $port);\n $this->meta->set(\"port\", $port);\n\n return $port;\n }\n\n $port++;\n }\n\n return false;\n }", "public function checkOpenPort()\n {\n foreach ($this->servers as $index => $server) {\n foreach ($this->ports as $services => $port) {\n $conn = @fsockopen($server, $port, $errno, $errstr, 5);\n if (!$conn) {\n //Port is blocked\n echo \"$server with port $port : CLOSED\".\"<br>\";\n } else {\n //Port is open\n echo \"$server with port $port : OPEN\".\"<br>\";\n }\n }\n echo \"<br>\";\n }\n }", "public function portIsAvailable($port): bool\n {\n $process = $this->shell->execQuietly(\"netstat -vanp tcp | grep '\\.{$port}\\s' | grep -v 'TIME_WAIT' | grep -v 'CLOSE_WAIT' | grep -v 'FIN_WAIT'\");\n\n // A successful netstat command means a port in use was found\n return ! $process->isSuccessful();\n }", "function canReusePort(): bool\n{\n static $canReusePort;\n\n if ($canReusePort !== null) {\n return $canReusePort;\n }\n\n $os = (\\stripos(\\PHP_OS, \"WIN\") === 0) ? \"win\" : \\strtolower(\\PHP_OS);\n\n // Before you add new systems, please check whether they really support the option for load balancing,\n // e.g. macOS only supports it for failover, only the newest process will get connections there.\n switch ($os) {\n case \"win\":\n $canReusePort = true;\n break;\n\n case \"linux\":\n // We determine support based on Kernel version.\n // We don't care about backports, as socket transfer works fine, too.\n $version = \\trim(\\shell_exec('uname -r'));\n $version = \\implode(\".\", \\array_slice(\\explode(\".\", $version), 0, 2));\n $canReusePort = \\version_compare($version, '3.9', '>=');\n break;\n\n default:\n $canReusePort = false;\n break;\n }\n\n return $canReusePort;\n}", "public function setLocalPort($port){}", "protected function getNextPort() {\n $start = $this->config->ldap->ports->start;\n $finish = $start + $this->config->ldap->ports->max;\n \n //Get a list of all ports in use in the range\n exec('netstat -ntl', $outputs, $ret);\n if ($ret !== 0) throw new RuntimeException(\"Could not check ports\", 500, new Exception(implode(\"\\n\", $outputs)));\n $_extract = function($line) { return preg_match('/:(\\\\d+)\\s+/',$line,$m) ? $m[1] : false; };\n $_filter = function($port) use ($start, $finish) { return $port && $port >= $start && $port <= $finish; };\n $ports = array_flip(array_filter(array_unique(array_map($_extract, $outputs)), $_filter));\n \n //Return the first available port\n for($port=$start; $port<$finish; $port++) if (!array_key_exists($port, $ports)) return $port;\n \n //Couldn't find any within the allowable range?\n throw new RuntimeException(\"Could not find an available port\", 500, new Exception(\"All ports in use between $start and $finish\"));\n }", "public function testGetPort() {\n static::$_server = array(\n 'SERVER_PORT' => '80'\n );\n $request = $this->createRequest();\n\n $this->assertEquals(80, $request->getPort());\n }", "protected function hasStandardPort()\n {\n return (!$this->port || $this->port === 80 || $this->port === 443);\n }", "public function bind($address, $port){}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds the ShareConfig model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
protected function findModel($id) { if (($model = ShareConfig::findOne($id)) !== null) { return $model; } throw new NotFoundHttpException('The requested page does not exist.'); }
[ "protected function findModel($id) {\n if (($model = Config::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404);\n }\n }", "protected function findModel($id)\n\t{\n if (($model = CoreSettings::findOne($id)) !== null) {\n return $model;\n }\n\n\t\tthrow new \\yii\\web\\NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n\t}", "protected function findModel($id)\n {\n if (($model = Dmfacebookpageconfig::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = ConfigConstant::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }", "protected function findModel($masterlist_id)\n\t{\n\t\tif (($model = WiMasterlist::findOne($masterlist_id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "protected function findModel($id)\n {\n if (($model = ContentSource::findOne($id)) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }", "protected function findModel($id)\n {\n if (($model = BackendSetting::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException(Yii::t('common', 'The requested page does not exist.'));\n }\n }", "protected function findModel($id)\n {\n if (($model = GlobalConfig::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\r\n {\r\n if (($model = InsCfgValue::findOne($id)) !== null) {\r\n return $model;\r\n } else {\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }\r\n }", "protected function findModel($id)\n {\n if (($model = SettingsSocialNetworks::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = HuodongSpecialConfig::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = FwConfig::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = FwCompanySetting::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException(Yii::t('common','data_not_exist'));\n }\n }", "protected function findModel($id)\n\t{\n\t\tif (($model = Budget::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "protected function findModel($id)\n {\n if (($model = ProjectConfig::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n $modelClass = $this->getModel();\n if (($model = $modelClass->findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, Yii::t('app', 'The requested page does not exist.'));\n }\n }", "protected function findModel()\n {\n if (($model = WebsiteInfo::find()->one()) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('backend', 'The requested page does not exist.'));\n // throw new NotFoundHttpException(BackendModule::t('backend','The requested page does not exist.'));\n }", "protected function findModel($id)\n {\n if (($model = Menu::findOne([ 'id' => $id ])) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }", "protected function findModel($id)\n {\n if (($model = ApiKeys::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Summary Save a collection of QuoteLineConfigurations. It is not possible to add a new configurations.
function SaveQuoteLineConfigurations($quoteLineConfigurations) { $result = $this->sendRequest("SaveQuoteLineConfigurations", array("QuoteLineConfigurations"=>$quoteLineConfigurations)); return $this->getResultFromResponse($result); }
[ "public function saveLineItems(){\n\t\t// Insert/update new/existing items:\n\t\tif(isset($this->_lineItems)){\n\t\t\tforeach($this->_lineItems as $item){\n\t\t\t\t$item->quoteId = $this->id;\n $product = X2Model::model('Products')->findByAttributes(array(\n 'name'=>$item->name\n ));\n if (isset($product))\n $item->productId = $product->id;\n\t\t\t\t$item->save();\n\t\t\t}\n\t\t}\n\t\tif(isset($this->_deleteLineItems)) {\n\t\t\t// Delete all deleted items:\n\t\t\tforeach($this->_deleteLineItems as $item)\n\t\t\t\t$item->delete();\n\t\t\t$this->_deleteLineItems = null;\n\t\t}\n\t}", "function save_all() {\n $aConfigIds = $this->filterPOST('config_ids', 'array');\n $configName = $this->filterPOST('configName', 'string');\n \n try {\n if (!is_array($aConfigIds)) {\n throw new Exception($this->__('Incorrect input of config ids!'));\n }\n if (!$this->securityCheckToken($this->filterPOST('token', 'string'))) {\n throw new Exception($this->__('The page delay was too long'));\n }\n \n $this->db->startTransaction();\n \n $oConfig = new Config();\n foreach ($aConfigIds as $configId) {\n $configValue = $this->filterPOST('config'.$configId, 'clean_html');\n\n $oItem = new SetterGetter();\n $oItem->setValue($configValue);\n \n $r = $oConfig->Edit($configId, $oItem);\n if (!$r) {\n throw new Exception($this->__('Error while saving one of the config values'));\n }\n }\n \n $this->db->commitTransaction();\n \n // clear config values from memcache\n $Memcache = Mcache::getSingleton();\n $Memcache->delete(Config::MEMCACHE_KEY);\n }\n catch (Exception $e) {\n $this->setErrorMessage($e->getMessage());\n $this->db->rollbackTransaction();\n $this->redirect(href_admin('config/list_items') . '?name='.$configName);\n }\n \n $this->setMessage($this->__('All items were saved'));\n $this->redirect(href_admin('config/list_items') . '?name='.$configName);\n }", "public function saveConfig();", "public function save() {\r\n $oConfig = $this->getConfig();\r\n\r\n $aConfBools = oxConfig::getParameter( \"confbools\" );\r\n $aConfStrs = oxConfig::getParameter( \"confstrs\" );\r\n\r\n if ( is_array( $aConfBools ) ) {\r\n foreach ( $aConfBools as $sVarName => $sVarVal ) {\r\n $oConfig->saveShopConfVar( \"bool\", $sVarName, $sVarVal, $sOxId );\r\n }\r\n }\r\n\r\n if ( is_array( $aConfStrs ) ) {\r\n foreach ( $aConfStrs as $sVarName => $sVarVal ) {\r\n $oConfig->saveShopConfVar( \"str\", $sVarName, $sVarVal );\r\n }\r\n }\r\n }", "public function saveEverything() {\n unlink($this->getDataFolder().'auctions.json'); //Avoiding duplication glitches.\n $data = new Config($this->getDataFolder() . 'auctions.json', Config::JSON);\n foreach ($this->auctions as $aucId => $aucData) {\n $data->set($aucId, $aucData);\n }\n $data->save();\n }", "protected function saveProductTypesAndVisibilitiesInConfig()\n {\n //Type\n $configModel = Mage::getModel('core/config');\n $types = Mage::getModel('ddg_automation/adminhtml_source_sync_catalog_type')\n ->toOptionArray();\n $options = array();\n foreach ($types as $type) {\n $options[] = $type['value'];\n }\n $typeString = implode(',', $options);\n $configModel->saveConfig(\n Dotdigitalgroup_Email_Helper_Config::XML_PATH_CONNECTOR_SYNC_CATALOG_TYPE,\n $typeString\n );\n\n //Visibility\n $visibilities = Mage::getModel(\n 'ddg_automation/adminhtml_source_sync_catalog_visibility'\n )->toOptionArray();\n $options = array();\n foreach ($visibilities as $visibility) {\n $options[] = $visibility['value'];\n }\n $visibilityString = implode(',', $options);\n $configModel->saveConfig(\n Dotdigitalgroup_Email_Helper_Config::XML_PATH_CONNECTOR_SYNC_CATALOG_VISIBILITY,\n $visibilityString\n );\n }", "public function save()\n\t{\n\t\t$configurationClass = '<?php' . PHP_EOL;\n\t\t$configurationClass .= 'require_once \"TechDivision/Lang/Object.php\";' . PHP_EOL;\n\t\t$configurationClass .= 'require_once \"TechDivision/Collections/HashMap.php\";' . PHP_EOL;\n\t\t$configurationClass .= 'require_once \"TechDivision/Model/Container/Plugin.php\";' . PHP_EOL;\n\t\t$configurationClass .= 'require_once \"TechDivision/Model/Container/Entity.php\";' . PHP_EOL;\n\t\t$configurationClass .= 'require_once \"TechDivision/Model/Configuration/Interfaces/Container.php\";' . PHP_EOL;\n\t\t$configurationClass .= 'class TechDivision_Model_Configuration_Generated' . PHP_EOL;\n\t\t$configurationClass .= '\textends TechDivision_Lang_Object' . PHP_EOL;\n\t\t$configurationClass .= '\timplements TechDivision_Model_Configuration_Interfaces_Container {' . PHP_EOL;\n\t\t$configurationClass .= '\tprotected $_entities = null;' . PHP_EOL;\n\t\t$configurationClass .= '\tprotected $_plugins = null;' . PHP_EOL;\n\t\t$configurationClass .= '\tprotected $_configDate = ' . $this->_configDate . ';' . PHP_EOL;\n\t\t$configurationClass .= '\tpublic function __construct() {}' . PHP_EOL;\n\t\t$configurationClass .= '\tpublic function getConfigDate() {' . PHP_EOL;\n\t\t$configurationClass .= '\t\treturn $this->_configDate;' . PHP_EOL;\n\t\t$configurationClass .= '\t}' . PHP_EOL;\n\t\t$configurationClass .= '\tpublic function getPlugins() {' . PHP_EOL;\n\t\t$configurationClass .= '\t\treturn $this->_plugins;' . PHP_EOL;\n\t\t$configurationClass .= '\t}' . PHP_EOL;\n\t\t$configurationClass .= '\tpublic function getEntities() {' . PHP_EOL;\n\t\t$configurationClass .= '\t\treturn $this->_entities;' . PHP_EOL;\n\t\t$configurationClass .= '\t}' . PHP_EOL;\n\t\t$configurationClass .= '\tpublic function initialize($applicationName = null) {' . PHP_EOL;\n\t\t$configurationClass .= '\t\t$this->_plugins = new TechDivision_Collections_HashMap();' . PHP_EOL;\n\t\t// generated the code for all plugins\n\t\tforeach ($this->_plugins as $plugin) {\n\t\t\t$configurationClass .= ' \t$plugin = new TechDivision_Model_Container_Plugin();' . PHP_EOL;\n\t\t\t$configurationClass .= ' \t$plugin->setName(\"' . $plugin->getName() . '\");' . PHP_EOL;\n\t\t\t$configurationClass .= ' \t$plugin->setType(\"' . $plugin->getType() . '\");' . PHP_EOL;\n\t\t\t$configurationClass .= '\t\t$this->_plugins->add($plugin->getName(), $plugin);' . PHP_EOL;\n\t\t}\n\t\t$configurationClass .= '\t\t$this->_entities = new TechDivision_Collections_HashMap();' . PHP_EOL;\n\t\t// generated the code for all entitiy and session beans\n\t\tforeach ($this->_entities as $entity) {\n\t\t\t$configurationClass .= ' \t$cont = new TechDivision_Model_Container_Entity();' . PHP_EOL;\n\t\t\t$configurationClass .= ' \t$cont->setName(\"' . $entity->getName() . '\");' . PHP_EOL;\n\t\t\t$configurationClass .= ' \t$cont->setType(\"' . $entity->getType() . '\");' . PHP_EOL;\n\t\t\tforeach ($epb->getApplications() as $application) {\n\t\t\t\t$configurationClass .= ' \t$cont->addApplication(\"' . $application . '\");' . PHP_EOL;\n\t\t\t}\n\t\t\t$configurationClass .= '\t\t$this->_entities->add($cont->getName(), $cont);' . PHP_EOL;\n\t\t}\n\t\t// close the brackets and add the php delimiter\n\t\t$configurationClass .= '\t}' . PHP_EOL;\n\t\t$configurationClass .= '}' . PHP_EOL;\n\t\t$configurationClass .= '?>';\n\t\t// save the file\n\t\treturn file_put_contents(\n\t\t $this->_generatedConfigFile,\n\t\t $configurationClass\n\t\t);\n\t}", "private function save_configuration_changes(): void {\n\t\tif ($this->need_save) {\n\t\t\t$__ = [\n\t\t\t\t'config' => $this->config,\n\t\t\t];\n\t\t\t$locale = $this->application->locale;\n\t\t\tif ($this->promptYesNo($locale->__('Save changes to {config}? ', $__))) {\n\t\t\t\t$this->save_conf($this->config, ArrayTools::prefixKeys($this->options(['environment_file', 'host_setting_name']), __CLASS__ . '::'));\n\t\t\t\t$this->log('Wrote {config}', $__);\n\t\t\t}\n\t\t}\n\t}", "public function buildConfigurationSummary();", "public function saveConfiguration()\n {\n // write the formatted config file to the path\n file_put_contents(self::$config_path, $this->app['utils']->JSONFormat(self::$config));\n $this->app['monolog']->addDebug('Save configuration to '.basename(self::$config_path));\n }", "public function configureWithQuoteProvider(): array\n {\n return [\n 'with_quote_item_id' => [\n 'has_quote_item' => true,\n 'expected_response_body' => '<input id=\"product_composite_configure_input_qty\"'\n . ' class=\"input-text admin__control-text qty\" type=\"text\" name=\"qty\" value=\"1\">',\n ],\n 'without_quote_item_id' => [\n 'has_quote_item' => false,\n 'expected_response_body' => '{\"error\":true,\"message\":\"The quote items are incorrect.'\n . ' Verify the quote items and try again.\"}',\n ],\n ];\n }", "public function save()\n\t{\n\t\t$h = fopen(WEBDEV_CONFIG_FILE, 'w');\n\t\tfwrite($h, \"<?php\\n return \" .var_export($this->config->all(), true) .';');\n\t\tfclose($h);\n\t}", "public function save(){\r\n\t\t\r\n\t\tglobal $current_section;\r\n\t\t$configuration = $this->get_settings($current_section);\r\n\t\twoocommerce_update_options($configuration);\r\n\t\t\r\n }", "public function save_invoice_settings() {\n \n // Save invoice's template\n (new MidrubBaseAdminCollectionAdminHelpers\\Invoices)->save_invoice_settings();\n \n }", "public function save(): void\n {\n $areas = [];\n foreach($this->areas as $area)\n {\n $areas[$area->getName()] = $area->toArray();\n }\n\n file_put_contents($this->areaFile, json_encode($areas));\n }", "public function save()\n {\n $data = array();\n $data[] = \"; <?php die; ?>\";\n $data[] = \"; \";\n $data[] = \"; Liquid PHP Application Framework Configuration File\";\n $data[] = \"\";\n\n foreach($this->data as $a => $section)\n {\n $data[] = \"[\" . $a . \"]\";\n foreach($section as $b => $subsection)\n {\n foreach($subsection as $c => $value)\n {\n $data[] = $b . '.' . $c . '=\"' . $value . '\"';\n }\n }\n\n file_put_contents($this->filename, implode(\"\\r\\n\", $data));\n $this->requiresSave = false;\n }\n }", "function addConfiguration($name, $pricingSetClass, array $pricingElementClasses = array());", "public function saveAllCurrencies()\n {\n $this->saveDataToJsonFile($this->getAllCurrencies(), $this->basicFileDataPath . '/all_currencies.json');\n }", "function writecfg(){\n\t // read each setting from the array\n\t foreach($this->custom_settings as $cfg) {\n\t $new_values = Configure::read($this->key . '.' . $cfg['key']);\n\n\t // if the setting have changed\n\t if( md5($new_values) != $cfg['checksum']) {\n\t // make sql\n\t $this->data = array(\n\t 'id'=> $cfg['id'],\n\t 'key'=> $cfg['key'],\n\t 'values'=> $new_values);\n\t // save it\n\t $this->save($this->data);\n\t }\n\t }\n\t }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Setter method for the refunded attribute.
public function setRefunded(bool $refunded): void { $this->_refunded = $refunded; }
[ "public function setTotalRefunded($totalRefunded);", "public function refund() {\n\t\t$this->old_status = $this->status;\n\t\t$this->status = 'refunded';\n\t\t$this->pending['status'] = $this->status;\n\n\t\t$this->save();\n\t}", "public function getRefunded()\n {\n return $this->refunded;\n }", "protected function markOrderAsFullyRefunded()\n {\n $oOrder = $this->getOrder();\n $oOrder->oxorder__molliedelcostrefunded = new Field($oOrder->oxorder__oxdelcost->value);\n $oOrder->oxorder__molliepaycostrefunded = new Field($oOrder->oxorder__oxpaycost->value);\n $oOrder->oxorder__molliewrapcostrefunded = new Field($oOrder->oxorder__oxwrapcost->value);\n $oOrder->oxorder__molliegiftcardrefunded = new Field($oOrder->oxorder__oxgiftcardcost->value);\n $oOrder->oxorder__mollievoucherdiscountrefunded = new Field($oOrder->oxorder__oxvoucherdiscount->value);\n $oOrder->oxorder__molliediscountrefunded = new Field($oOrder->oxorder__oxdiscount->value);\n $oOrder->save();\n\n foreach ($this->getOrder()->getOrderArticles() as $oOrderArticle) {\n $oOrderArticle->oxorderarticles__mollieamountrefunded = new Field($oOrderArticle->oxorderarticles__oxbrutprice->value);\n $oOrderArticle->save();\n }\n\n $this->_oOrder = $oOrder; // update order for renderering the page\n $this->_aRefundItems = null;\n }", "public function setAsRefunded($transaction_id, $total_refunded)\n {\n global $wpdb;\n\n return $wpdb->update(\n $wpdb->prefix . 'wpsc_payex_transactions',\n array(\n 'is_refunded' => '1',\n 'total_refunded' => $total_refunded,\n ),\n array('transaction_id' => $transaction_id),\n array(\n '%d',\n '%d',\n ),\n array('%d')\n );\n }", "public function setTaxRefunded($taxRefunded);", "public function getDiscountRefunded();", "public function handleChargePartiallyRefunded()\n {\n $payment = $this->getPayment();\n\n if ($payment) {\n $amount = $payment->amount;\n $refunded = 0;\n\n if (isset($this->payload['data']['object']['amount']) && isset($this->payload['data']['object']['refunds']['data']['amount'])) {\n $amount = abs(Payment::parseAmount($this->payload['data']['object']['amount']));\n $refunded = abs(Payment::parseAmount($this->payload['data']['object']['refunds']['data']['amount']));\n }\n\n $payment->amount = (int) $amount - (int) $refunded;\n $payment->status = 'refunded';\n $payment->save();\n }\n\n $this->saveLog();\n return $payment;\n }", "public function getRefundedAt()\n {\n return $this->refunded_at;\n }", "public function setDiscountTaxCompensationRefunded($discountTaxCompensationRefunded);", "public function setShippingTaxRefunded($shippingTaxRefunded);", "public function getRefundedAmount()\n {\n return $this->_getAmount(self::CARD_REFUNDED_AMOUNT_KEY);\n }", "public function setRefundedSurcharges(?array $refundedSurcharges): void\n {\n $this->refundedSurcharges['value'] = $refundedSurcharges;\n }", "public function setSubtotalRefunded($subtotalRefunded);", "public function isRefunded() {\n return $this->payment == null ? false : $this->payment->getRefunded();\n }", "public function mark_order_as_refunded( $order ) {\n\n\t\t/* translators: Placeholders: %s - payment gateway title (such as Authorize.net, Braintree, etc) */\n\t\t$order_note = sprintf( esc_html__( '%s Order completely refunded.', 'woocommerce-gateway-paypal-powered-by-braintree' ), $this->get_method_title() );\n\n\t\t// Mark order as refunded if not already set\n\t\tif ( ! $order->has_status( 'refunded' ) ) {\n\t\t\t$order->update_status( 'refunded', $order_note );\n\t\t} else {\n\t\t\t$order->add_order_note( $order_note );\n\t\t}\n\t}", "public function getDiscountTaxCompensationRefunded();", "public function getTotalRefundedAmount()\n {\n return $this->total_refunded_amount;\n }", "public function isRefunded()\n {\n return $this->status === OrderLineStatus::STATUS_REFUNDED;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to update the custom view record in db.
public function updateCustomView() { $db = App\Db::getInstance(); $dbCommand = $db->createCommand(); $cvId = $this->getId(); $dbCommand->update('vtiger_customview', [ 'viewname' => $this->get('viewname'), 'setmetrics' => $this->get('setmetrics'), 'status' => $this->get('status'), 'color' => $this->get('color'), 'description' => $this->get('description'), ], ['cvid' => $cvId] )->execute(); $dbCommand->delete('vtiger_cvcolumnlist', ['cvid' => $cvId])->execute(); $dbCommand->delete('vtiger_cvstdfilter', ['cvid' => $cvId])->execute(); $dbCommand->delete('vtiger_cvadvfilter', ['cvid' => $cvId])->execute(); $dbCommand->delete('vtiger_cvadvfilter_grouping', ['cvid' => $cvId])->execute(); $this->setColumnlist(); $this->setConditionsForFilter(); }
[ "public function updateCustomView()\n\t{\n\t\t$db = App\\Db::getInstance();\n\t\t$dbCommand = $db->createCommand();\n\t\t$cvId = $this->getId();\n\t\t$dbCommand->update('vtiger_customview', [\n\t\t\t'viewname' => $this->get('viewname'),\n\t\t\t'setmetrics' => $this->get('setmetrics'),\n\t\t\t'status' => $this->get('status'),\n\t\t\t'color' => $this->get('color'),\n\t\t\t'description' => $this->get('description'),\n\t\t], ['cvid' => $cvId]\n\t\t)->execute();\n\t\t$dbCommand->delete('vtiger_cvcolumnlist', ['cvid' => $cvId])->execute();\n\t\t$dbCommand->delete('u_#__cv_condition_group', ['cvid' => $cvId])->execute();\n\t\t$dbCommand->delete('u_#__cv_duplicates', ['cvid' => $cvId])->execute();\n\t\t$this->setColumnlist();\n\t\t$this->setConditionsForFilter();\n\t\t$this->setDuplicateFields();\n\t}", "public function updateView(): void\n {\n if (!$this->special) {\n $this->_builder->submitUpdate();\n }\n $this->_data = $this->_entity->fetch($_GET['id'])[0];\n\n require VF . \"{$this->route}/update.php\";\n }", "abstract protected function updateModel();", "public function update($record);", "function update() \n {\n if(strtolower($this->name) == @$_POST['post_type']) \n {\n //set custom fields with posted value\n HTTP::setPostVars($this->Fields());\n \n $id = $_POST['post_ID'];\n \n $this->save($id);\n }\n }", "function _cloneresource_update($id, $data) {\n /*\n global $user;\n $view = cloneresource_get_view($id);\n $data->id = $id;\n $data->uid = $view->uid;\n $data->timestamp = time();\n \n\n cloneresource_write_view($data);\n */\n _cloneresource_create($data);\n return;\n}", "private function updateExistingView($request, $view_id) {\n \n $view = DB::table('dx_views')->where('id', '=', $view_id)->first();\n $this->validateTitleUniq($request, $view->title, $view->id, $view->list_id);\n \n $arr = $this->getViewFieldsValArrays($request, $view);\n \n DB::transaction(function () use ($view, $request, $arr, $view_id){\n \n // delete unused fields\n DB::table('dx_views_fields')\n ->where('view_id', '=', $view_id)\n ->whereNotIn('field_id', $arr[\"arr_all\"])\n ->where('field_id', '!=', $arr[\"id_field_id\"]) // ID field is must have\n ->delete();\n \n // update existing fields vals\n foreach($arr[\"arr_upd\"] as $upd) {\n DB::table('dx_views_fields')\n ->where('field_id', '=', $upd[\"field_id\"])\n ->where('view_id', '=', $view_id)\n ->update($upd[\"vals\"]);\n } \n \n // insert new fields\n foreach($arr[\"arr_new\"] as $new) {\n DB::table('dx_views_fields')->insert($new[\"vals\"]);\n }\n \n $this->resetDefault($request, $view); \n \n // update view metadata\n DB::table('dx_views')->where('id', '=', $view_id)->update([\n 'title' => $request->input('view_title'), \n 'is_default' => $request->input('is_default', 0),\n 'me_user_id' => ($request->input('is_my_view', 0)) ? Auth::user()->id : null\n ]);\n \n });\n }", "public function updateViewPost(){\n $newpostid = Validation::integerOnly($this->postid);\n \n \t\ttry {\n\t\t\t\t\t$this->db->beginTransaction();\n\t\t\t\t\t$sql = \"UPDATE data_post SET Viewer=Viewer+1 WHERE PostID=:postid;\";\n\t\t\t\t\t$stmt = $this->db->prepare($sql);\t\t\n\t\t\t\t\t$stmt->bindParam(':postid', $newpostid, PDO::PARAM_STR);\n\t \t\t\tif ($stmt->execute()) {\n\t\t \t\t\t$data = [\n\t\t\t \t\t\t'status' => 'success',\n\t\t\t\t\t\t\t'code' => 'RS103',\n\t\t\t\t \t\t'message' => CustomHandlers::getreSlimMessage('RS103')\n\t\t\t\t\t ];\t\n \t\t\t\t} else {\n\t \t\t\t\t$data = [\n\t\t \t\t\t\t'status' => 'error',\n\t\t \t\t\t\t'code' => 'RS203',\n\t\t\t \t\t\t'message' => CustomHandlers::getreSlimMessage('RS203')\n\t\t\t\t\t ];\n \t\t\t\t}\n\t \t\t $this->db->commit();\n\t\t } catch (PDOException $e) {\n\t\t \t $data = [\n \t\t\t \t'status' => 'error',\n\t \t\t\t\t'code' => $e->getCode(),\n\t\t \t\t 'message' => $e->getMessage()\n \t\t \t];\n\t \t\t $this->db->rollBack();\n \t\t} \n\n\t\t\treturn json_encode($data, JSON_PRETTY_PRINT);\n\t\t\t$this->db = null;\n\n }", "public function testUpdateItemCustomFields()\n {\n }", "public function testUpdateAisleCustomFields()\n {\n }", "public function EditRecord()\n {\n $rec = $this->GetActiveRecord();\n if (!$rec) return;\n $this->UpdateActiveRecord($rec);\n $this->SetDisplayMode(MODE_E);\n return $this->ReRender(true,false);\n }", "function sys_view_row_update($rows, $result_total){\r\n // $ids is combi: id form # id row\r\n $ids = $_POST[\"id\"];\r\n $id_arr = explode(\"-\", $ids);\r\n $id_view = $id_arr[0];\r\n $id_row = $id_arr[1];\r\n $result = f_m_get_txt_data(\"model/data/d_sys_view.txt\", \"\", \"id='$id_view'\", \"\", \"\", \"form_row1\");\r\n $ref_id_db = \"id\";\r\n $ref_id_form = \"id_org\";\r\n $_POST[\"id_org\"] = $id_row;\r\n // get columnnames\r\n $column = f_m_get_columns_view_model(\"model/data/d_sys_view.txt\", \"\");\r\n // first always the same\r\n $store_id_db = \"id,\";\r\n $store_id_form = \"id_org,\";\r\n // add others\r\n $column_str = \"\";\r\n for($i = 1; $i < count($column); $i++){\r\n $column_str .= $column[$i] . \",\";\r\n }\r\n $column_str = substr($column_str, 0, strlen($column_str) - 1);\r\n $store_id_db .= $column_str;\r\n $store_id_form .= $column_str;\r\n s_m_put_txt_data(\"put_sys_view_row_update\", \"update\", $result[0][\"map_file\"], $ref_id_db, $ref_id_form, $store_id_db, $store_id_form);\r\n return $result_total;\r\n}", "public function testUpdateReplenishmentProcessCustomFields()\n {\n }", "public function testUpdateCustomField()\n {\n }", "function update_feed_cck_settings_views_data($field) {\r\n}", "public function testUpdateProductionModelCustomFields()\n {\n }", "public abstract function edit($data, $db);", "public function testUpdateReplenishmentPlanCustomFields()\n {\n }", "private function updateArticleView()\n {\n if($_POST['article_view'] != 0)\n {\n $this->model->action( 'article','updateView',\n array('id_article' => (int)$this->current_id_article,\n 'id_view' => (int)$_POST['article_view']) );\n }\n else\n {\n $this->model->action( 'article','removeArticleViewRelation',\n array('id_article' => (int)$this->current_id_article) ); \n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create request for operation 'chatbotChatbotIDKtoQuestionsKTOquestionIDDelete'
protected function chatbotChatbotIDKtoQuestionsKTOquestionIDDeleteRequest($chatbot_id, $kt_oquestion_id) { // verify the required parameter 'chatbot_id' is set if ($chatbot_id === null || (is_array($chatbot_id) && count($chatbot_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $chatbot_id when calling chatbotChatbotIDKtoQuestionsKTOquestionIDDelete' ); } // verify the required parameter 'kt_oquestion_id' is set if ($kt_oquestion_id === null || (is_array($kt_oquestion_id) && count($kt_oquestion_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $kt_oquestion_id when calling chatbotChatbotIDKtoQuestionsKTOquestionIDDelete' ); } $resourcePath = '/chatbot/{chatbotID}/kto_questions/{KTOquestionID}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // path params if ($chatbot_id !== null) { $resourcePath = str_replace( '{' . 'chatbotID' . '}', ObjectSerializer::toPathValue($chatbot_id), $resourcePath ); } // path params if ($kt_oquestion_id !== null) { $resourcePath = str_replace( '{' . 'KTOquestionID' . '}', ObjectSerializer::toPathValue($kt_oquestion_id), $resourcePath ); } // body params $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( [] ); } else { $headers = $this->headerSelector->selectHeaders( [], [] ); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { $multipartContents[] = [ 'name' => $formParamName, 'contents' => $formParamValue ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); if ($apiKey !== null) { $headers['Authorization'] = $apiKey; } $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } $headers = array_merge( $defaultHeaders, $headerParams, $headers ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); }
[ "protected function chatbotChatbotIDKtoQuestionsDeleteRequest($chatbot_id)\n {\n // verify the required parameter 'chatbot_id' is set\n if ($chatbot_id === null || (is_array($chatbot_id) && count($chatbot_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $chatbot_id when calling chatbotChatbotIDKtoQuestionsDelete'\n );\n }\n\n $resourcePath = '/chatbot/{chatbotID}/kto_questions';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($chatbot_id !== null) {\n $resourcePath = str_replace(\n '{' . 'chatbotID' . '}',\n ObjectSerializer::toPathValue($chatbot_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function chatbotChatbotIDKtoAnswersDeleteRequest($chatbot_id)\n {\n // verify the required parameter 'chatbot_id' is set\n if ($chatbot_id === null || (is_array($chatbot_id) && count($chatbot_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $chatbot_id when calling chatbotChatbotIDKtoAnswersDelete'\n );\n }\n\n $resourcePath = '/chatbot/{chatbotID}/kto_answers';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($chatbot_id !== null) {\n $resourcePath = str_replace(\n '{' . 'chatbotID' . '}',\n ObjectSerializer::toPathValue($chatbot_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function delete_question_delete()\n {\n $id = (int) $this->get('id');\n\t\t//delete the selected question from database for the input question id.\n $data=$this->Model->delete_row($id,\"q_data\");\n if ($data)\n {\n\t\t\t$this->set_response(['status' => $data,'error' => 'Record deleted'], REST_Controller::HTTP_OK); \n }\n else\n {\n $this->set_response(['status' => FALSE,'error' => 'Record could not be found'], REST_Controller::HTTP_OK); \n }\n\t}", "public function testChatbotChatbotIDExamplesExampleIDDelete()\n {\n }", "protected function supportKbCategoryidQuestionidDeleteRequest($categoryid, $questionid)\n {\n // verify the required parameter 'categoryid' is set\n if ($categoryid === null || (is_array($categoryid) && count($categoryid) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $categoryid when calling supportKbCategoryidQuestionidDelete'\n );\n }\n // verify the required parameter 'questionid' is set\n if ($questionid === null || (is_array($questionid) && count($questionid) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $questionid when calling supportKbCategoryidQuestionidDelete'\n );\n }\n\n $resourcePath = '/support/kb/{categoryid}/{questionid}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($categoryid !== null) {\n $resourcePath = str_replace(\n '{' . 'categoryid' . '}',\n ObjectSerializer::toPathValue($categoryid),\n $resourcePath\n );\n }\n // path params\n if ($questionid !== null) {\n $resourcePath = str_replace(\n '{' . 'questionid' . '}',\n ObjectSerializer::toPathValue($questionid),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function chatbotChatbotIDKtoQuestionsKTOquestionIDDeleteWithHttpInfo($chatbot_id, $kt_oquestion_id)\n {\n $request = $this->chatbotChatbotIDKtoQuestionsKTOquestionIDDeleteRequest($chatbot_id, $kt_oquestion_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "public function deleteQuestion()\r\n {\r\n $query_string = \"DELETE FROM questions \";\r\n $query_string .= \"WHERE questionid= :questionid\";\r\n\r\n return $query_string;\r\n}", "public function actionDeleteComunidad()\n {\n if (Yii::$app->request->isDelete) {\n $body = Yii::$app->request->getRawBody();\n $body = Json::decode($body);\n\n $prefijo = '/rest/communities/';\n $host = ConfiguracionDspace::find()->where(\"clave='host'\")->one()->valor;\n $puerto = ConfiguracionDspace::find()->where(\"clave='puerto'\")->one()->valor;\n\n $token = $body['token'];\n $id = $body['id'];\n $url = $host . ':' . $puerto . $prefijo . $id;\n\n $headers = array(\"Content-Type: application/json\", \"Accept: application/json\", \"rest-dspace-token: \" . $token);\n\n $curl = curl_init($url);\n $options = array(\n CURLOPT_CUSTOMREQUEST => \"DELETE\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_HTTPHEADER => $headers\n );\n\n curl_setopt_array($curl, $options);\n $response = curl_exec($curl);\n curl_close($curl);\n return $response;\n }\n }", "public function testDeleteQuestionUsingDelete()\n {\n }", "protected function getDeleteRequest()\n\t{\n\t\t$url = $this->url();\n\t\t\n\t\t$url->getQuery()->setParameter('code', 204);\n\t\t\n\t\treturn new Api\\Request\\Create((string) $url);\n\t}", "public function deletequery(){\n\t\t$id = Input::get('queryId');\n\t\t$deleteQuestionwillingtohelp = Questionwillingtohelp::where('question_id', '=',$id)->delete();\n\t\t$deleteGroupQuestion = Groupquestion::where('question_id', '=',$id)->delete();\n\t\t$deleteQuestion = Question::where('id', '=',$id)->delete();\n\t\t$deleteKarmafeed = Karmafeed::where('id_type', '=',$id)->whereIn('message_type',array('KarmaQuery','OfferHelpTo'))->delete(); \n\t\t$deleteMykarma = Mykarma::where('entry_id', '=',$id)->whereIn('users_role',array('PostedQuery','OfferedHelp'))->delete();\n echo \"Question \".$id.\" deleted\";\n\t}", "public function youCanDeleteQuestions()\n {\n // Arrange...\n $this->login();\n $question = factory(Question::class)->create();\n\n // Act...\n $this->json('delete', \"questions/$question->id\");\n\n // Assert...\n $this->seeInDatabase('questions', [\n 'deleted_at' => Carbon::now()\n ]);\n }", "public function delete(){\n $question = ProfileQuestion::getByName($this->name);\n\n if($question->editable) {\n $params = json_decode($question->parameters, true);\n\n $question->delete();\n\n // Remove the language keys for the label and the options\n $keysToRemove = array(\n 'admin' => array(\n 'profile-question-' . $this->name . '-label',\n )\n );\n\n if(!empty($params['options'])) {\n foreach($params['options'] as $i => $value){\n $keysToRemove['admin'][] = 'profile-question-' . $this->name . '-option-' . $i;\n }\n }\n foreach(Language::getAll() as $language){\n $language->removeTranslations($keysToRemove);\n }\n }\n }", "public function deleted(Question $question)\n {\n //\n }", "public function testChatbotChatbotIDExpressionsExpressionIDDelete()\n {\n }", "public function testQuestionDeleteWithValidData() {\n $response = $this->get('question/' . $this->question->id . '/delete');\n $this->assertEquals('200', $response->foundation->getStatusCode());\n $this->assertEquals('general.permission', $response->content->view);\n }", "public function delete() {\n $this->autoRender = false;\n $params = $this->request->data;\n $this->BullhornConnection->BHConnect();\n $params['isDeleted']=true;\n $url = $_SESSION['BH']['restURL'] . '/entity/CandidateWorkHistory/' . $params['id'] . '?BhRestToken=' . $_SESSION['BH']['restToken'];\n $post_params = json_encode($params);\n $req_method = 'POST';\n $response = $this->BullhornCurl->curlFunction($url, $post_params, $req_method);\n echo json_encode($response);\n }", "public function testDeleteChatUsingDelete()\n {\n }", "public function doDelete(En_HttpRequest $request, En_HttpResponse $response){}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
checks if claim is new or existing, if claim is new the print checkbox will be checked. If it is existing claim it will be unchecked by default
private function checkPrintCondition() { // is queryResult is empty this means it is a new claim if(empty($this->queryResult)) { return "checked"; } }
[ "function is_agreed_fields( $user ) {\r\n ?>\r\n <table class=\"form-table\">\r\n <tr>\r\n <th>I agree to the collection of my personal data:</th>\r\n <td>\r\n\r\n\r\n <p><label for=\"\">\r\n <input\r\n id=\"is_agreed\"\r\n name=\"is_agreed\"\r\n type=\"checkbox\"\r\n value=\"agreed\"\r\n <?php echo (get_user_meta($user->ID, 'is_agreed', true) == 'agreed' ? 'checked' : ''); ?>/>\r\n\r\n </label></p>\r\n\r\n </td>\r\n </tr>\r\n </table>\r\n <?php\r\n}", "public function startNewClaim()\r\n {\r\n $this->claimType = \"new\";\r\n \r\n // print the html to the screen\r\n $this->printHTML();\r\n\r\n }", "public static function checkbox() {\r\n\r\n\t\tif( ! is_user_logged_in() AND ! bbp_is_reply_edit() ) {\r\n?>\r\n\t\t<p>\r\n\t\t\t<input name=\"bbp_anonymous_subscribe\" id=\"bbp_anonymous_subscribe\" type=\"checkbox\" value=\"1\" tabindex=\"<?php bbp_tab_index(); ?>\" checked=\"checked\" />\r\n\t\t\t<label for=\"bbp_anonymous_subscribe\"><?php _e( 'Notify me of follow-up replies via email', 'bbp-anonymous-subscriptions' ); ?></label>\r\n\t\t</p>\r\n\r\n\t\t\t<?php } /*else {\r\n\r\n\t\t\tif( bbp_is_reply_edit() ) {\r\n\r\n\t\t\t\t<p>\r\n\t\t\t\t<input name=\"bbp_anonymous_subscribe\" id=\"bbp_anonymous_subscribe\" type=\"checkbox\" <?php echo self::is_user_subscribed( get_the_author_meta( 'ID' ) ); ?> tabindex=\"<?php bbp_tab_index(); ?>\" />\r\n\t\t\t\t<label for=\"bbp_anonymous_subscribe\"><?php _e( 'Notify author of follow-up replies via email.', 'bbp-anonymous-subscriptions' ); ?></label>\r\n\t\t\t\t</p>\r\n\r\n\t\t\t<?php } ?>\r\n\r\n<?php\r\n\t\t}*/\r\n\t}", "public function cf_privacy_checkbox() {\n\t\t\t// First, we get the contact form ID's from the posts table.\n\t\t\t$forms = $this->get_forms();\n\n\t\t\t// Next, we add the acceptance tag to the CF template.\n\t\t\t$this->update_template( $forms );\n\t\t}", "function em_data_privacy_consent_checkbox( $EM_Object = false ){\n\tif( !empty($EM_Object) && (!empty($EM_Object->booking_id) || !empty($EM_Object->post_id)) ) return; //already saved so consent was given at one point\n\t$label = get_option('dbem_data_privacy_consent_text');\n\tif( function_exists('get_the_privacy_policy_link') ) $label = sprintf($label, get_the_privacy_policy_link());\n\tif( is_user_logged_in() ){\n\t //check if consent was previously given and check box if true\n $consent_given_already = get_user_meta( get_current_user_id(), 'em_data_privacy_consent', true );\n if( !empty($consent_given_already) && get_option('dbem_data_privacy_consent_remember') == 1 ) return; //ignore if consent given as per settings\n\t\tif( !empty($consent_given_already) && get_option('dbem_data_privacy_consent_remember') == 2 ) $checked = true;\n }\n if( empty($checked) && !empty($_REQUEST['data_privacy_consent']) ) $checked = true;\n\t?>\n <p class=\"input-group input-checkbox input-field-data_privacy_consent\">\n\t\t<label>\n\t\t\t<input type=\"checkbox\" name=\"data_privacy_consent\" value=\"1\" <?php if( !empty($checked) ) echo 'checked=\"checked\"'; ?>>\n\t\t\t<?php echo $label; ?>\n\t\t</label>\n <br style=\"clear:both;\">\n\t</p>\n\t<?php\n}", "function add_suspend_checkbox($profileuser) {\n\t\t?>\n\t\t\t<h3>Account Suspension</h3>\n\t\t\t<table class=\"form-table\">\n\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>Suspend User?</th>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"suspend\" id=\"suspend\"<?= get_user_meta($profileuser->ID, 'suspended', true) ? ' checked=\"checked\"' : ''; ?> value=\"true\" />\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t<?php\n\t}", "public function actionClaim() {\n return $this->render('newclaim');\n }", "function chkAndUpdatePaidMember()\n\t{\n\t\tglobal $db;\n\t\tglobal $CFG;\n\t\t$sql = 'SELECT is_paid_member FROM '.$CFG['db']['tbl']['users'].' WHERE user_id ='.$db->Param('user_id');\n\t\t$stmt = $db->Prepare($sql);\n\t\t$rs = $db->Execute($stmt, array($CFG['user']['user_id']));\n\t\tif (!$rs)\n\t\t\ttrigger_db_error($db);\n\n\t\tif($row = $rs->FetchRow())\n\t\t{\n\t\t\t$_SESSION['user']['is_paid_member']=$row['is_paid_member'];\n\t\t}\n\t}", "public function actionCheckCreate()\n\t{\n\t\tif( !isset($_SESSION['invoice_id']) ) {\n\t\t\t$model = new Invoices;\n\t\t\t$invoice_id = $model->createCartItemInvoice();\n\t\t\t$_SESSION['invoice_id'] = $invoice_id;\n\t\t}\n\t\texit;\n\t\t//return $this->render(\"paymentForm\");\n\t}", "function wpvideocoach_show_introduction()\r\n{\r\n\tglobal $wpvideocoach_introduction;\r\n\tif($wpvideocoach_introduction == 0){\r\n\t\techo \"checked='checked'\";\r\n\t}\r\n}", "function profile_enable_cb() {\n\t\tprintf( '<input name=\"rda-settings[enable_profile]\" type=\"checkbox\" value=\"1\" class=\"code\" %1$s/>%2$s',\n\t\t\tchecked( esc_attr( $this->settings['enable_profile'] ), true, false ),\n\t\t\t/* Translators: The leading space is intentional to space the text away from the checkbox */\n\t\t\t__( ' Allow users to edit their profiles in the dashboard.', 'remove_dashboard_access' )\n\t\t);\n\t}", "public function output_checkbox() {\r\n\t\tif ( $this->is_user_already_subscribed( $this->type ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\techo $this->yikes_get_checkbox();\r\n\t}", "public function check_add_employment(){\n\tif($this->dashboard_model->checkMyModule($this->session->userdata('user_role'),$this->session->userdata('add_employment')))\n\t\t{\n\t\t\t$this->session->set_userdata(array(\n\t\t\t\t 'check_add_employment_icon'\t\t=>\t\t'class=\"btn btn-sm btn-info pull-right\" '\n\t\t\t\t ));\t\n\t\t}\t\n\t\t$this->check_edit_employment();\t\t\n\t}", "public function addclaimstatus(){\n $response = $this->insertInToTable(CLAIM_STATUS, array(array('claim_status_name'=>$this->getData['addnewclaimstatus'], 'created_by'=>$this->Useconfig['user_id'], 'created_ip'=>commonfunction::loggedinIP())));\n return $response;\n }", "function _display_checkbox_field($name, $value) {\n?>\n<input type=\"checkbox\" name=\"<?php echo htmlspecialchars($this->group); ?>[<?php echo htmlspecialchars($name); ?>]\" id=\"http_authentication_<?php echo htmlspecialchars($name); ?>\"<?php if ($value) echo ' checked=\"checked\"' ?> value=\"1\" /><br />\n<?php\n }", "public function checkbox() {\n\n?>\n\t\t<p>\n\n\t\t\t<input name=\"bbp_private_reply\" id=\"bbp_private_reply\" type=\"checkbox\"<?php checked( '1', $this->is_private( bbp_get_reply_id() ) ); ?> value=\"1\" tabindex=\"<?php bbp_tab_index(); ?>\" />\n\n\t\t\t<?php if ( bbp_is_reply_edit() && ( get_the_author_meta( 'ID' ) != bbp_get_current_user_id() ) ) : ?>\n\n\t\t\t\t<label for=\"bbp_private_reply\"><?php _e( 'Set author\\'s post as private.', 'bbp_private_replies' ); ?></label>\n\n\t\t\t<?php else : ?>\n\n\t\t\t\t<label for=\"bbp_private_reply\"><?php _e( 'Set as private reply', 'bbp_private_replies' ); ?></label>\n\n\t\t\t<?php endif; ?>\n\n\t\t</p>\n\t\t\n\t\t<?php if ( !current_user_can( $this->capability ) ) return; ?>\n\t\t\n\t\t<p>\n\n\t\t\t<input name=\"bbp_moderator_only_reply\" id=\"bbp_moderator_only_reply\" type=\"checkbox\"<?php checked( '1', $this->is_moderator_only( bbp_get_reply_id() ) ); ?> value=\"1\" tabindex=\"<?php bbp_tab_index(); ?>\" />\n\n\t\t\t<?php if ( bbp_is_reply_edit() && ( get_the_author_meta( 'ID' ) != bbp_get_current_user_id() ) ) : ?>\n\n\t\t\t\t<label for=\"bbp_moderator_only_reply\"><?php _e( 'Set author\\'s post as moderator-only.', 'bbp_moderator_only_replies' ); ?></label>\n\n\t\t\t<?php else : ?>\n\n\t\t\t\t<label for=\"bbp_moderator_only_reply\"><?php _e( 'Set as moderator-only reply', 'bbp_moderator_only_replies' ); ?></label>\n\n\t\t\t<?php endif; ?>\n\n\t\t</p>\n\t\t\n<?php\n\n\t}", "function writeCheckbox ($ce) {\n\t\t\techo \"<tr><td align=\\\"right\\\"><strong>$ce->label:&nbsp;</strong></td><td>\" .\n\t\t\t\t\t\t\"<input type=\\\"checkbox\\\" name=\\\"\" . $ce->name . \"\\\" \";\n\t\t\tif ($ce->value == true)\n\t\t\t\techo \"checked\";\n\t\t\techo\t\t\t\" >\" .\n\t\t\t\t\t \"</td></tr>\";\n\t\t}", "public function add_permission_question()\n {\n // Check if functionality is enabled\n if (!$this->opt['woochimp_enabled'] || $this->opt['woochimp_enabled_checkout'] != 3) {\n return;\n }\n\n echo '<p class=\"woochimp_checkout_checkbox\" style=\"padding:15px 0;\"><input id=\"woochimp_user_preference\" name=\"woochimp_data[woochimp_user_preference]\" type=\"checkbox\" ' . ($this->opt['woochimp_default_state'] == '1' ? 'checked=\"checked\"' : '') . '> ' . $this->opt['woochimp_text_checkout'] . '</p>';\n }", "function claim($id)\n {\n if (!$this->user_model->isSiteAdmin()\n && !$this->user_model->isAdminEvent($id)\n ) {\n redirect('event/view/' . $id);\n }\n\n $this->load->model('user_admin_model', 'userAdmin');\n $this->load->model('event_model', 'eventModel');\n $this->load->model('pending_talk_claims_model', 'pendingClaimsModel');\n $this->load->helper('events_helper');\n $this->load->library('sendemail');\n\n $newClaims = $this->pendingClaimsModel->getEventTalkClaims($id);\n\n $claim = $this->input->post('claim');\n $sub = $this->input->post('sub');\n $msg = array();\n\n // look at each claim submitted and approve/deny them\n if ($claim) {\n $approved = 0;\n $denied = 0;\n\n foreach ($claim as $claimId => $claimStatus) {\n // Retreive the pending claim before approving or denying as\n // it will be removed by approveClaim() or deleteClaim().\n $pendingClaim = $this->pendingClaimsModel\n ->getClaimDetail($claimId);\n\n if ($claimStatus == 'approve') {\n $approveCheck = $this->pendingClaimsModel\n ->approveClaim($claimId);\n if ($approveCheck) {\n $approved++;\n $this->_sendClaimSuccessEmail($pendingClaim);\n }\n } elseif ($claimStatus == 'deny') {\n // delete the claim row\n $denyCheck = $this->pendingClaimsModel\n ->deleteClaim($claimId);\n if ($denyCheck) {\n $denied++;\n }\n }\n }\n if ($approved > 0) {\n $msg[] = $approved . ' claim(s) approved';\n }\n if ($denied > 0) {\n $msg[] = $denied . ' claims(s) denied';\n }\n }\n\n if (count($msg) > 0) {\n $msg = implode(',', $msg);\n // refresh the list\n $newClaims = $this->pendingClaimsModel->getEventTalkClaims($id);\n }\n\n // Data to pass out to the view\n $arr = array(\n 'claims' => $this->userAdmin->getPendingClaims('talk', $id),\n 'newClaims' => $newClaims,\n 'eventId' => $id,\n 'msg' => $msg,\n 'event_detail' => $this->eventModel->getEventDetail($id)\n );\n\n $this->template->write_view('content', 'event/claim', $arr);\n $this->template->render();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
when creation notification completed successfully
public function createSuccess();
[ "function after_create(){\n $referer_id = $this->getObject()->user_id;\n $membre = User::find($this->user_id);\n if ($this->user_id == $referer_id) {\n return;\n }\n $notif = Notification::create(\n array(\n 'user_id' => $membre->id,\n 'to_user_id' => $referer_id,\n 'content' => $membre->name().' a commenté votre publication',\n 'picture' => $membre->picture,\n 'action' => $this->getObject()->asLink(),\n 'status' => 0,\n 'model' => $this->model,\n 'record' => $this->record,\n )\n );\n }", "public function postCreationSuccessful() {\n $this->setDisplayMessage(\"Posted new message.\");\n $this->redirect();\n die();\n }", "public function notifyCreator()\n {\n if ($this->originalStatus == QuestionnaireStatus::$COMPLETED\n && $this->getStatus() == QuestionnaireStatus::$VALIDATED\n && $this->getPermissions()['validate']\n ) {\n echo 'a';\n Utility::executeCliCommand('email notifyQuestionnaireCreator '.$this->getId());\n }\n }", "public function TaskCreateSuccessful()\n {\n }", "public function after_create() {}", "public function notifyCreated()\n {\n $ticketRecord = $this->_model->fetch();\n $ticketCommentRecord = $this->_ticketCommentModel->fetch();\n $contactModel = new Core_Model_Contact($ticketRecord['contact_id']);\n\n $email = $contactModel->getWorkEmail();\n $fullName = $contactModel->getFullName();\n\n $message = \"Hello \" . $fullName . \",\\n\\n\";\n $message .= \"A comment was added to the ticket. The ticket and comment details are as below:\" . \"\\n\\n\";\n $message .= \"Latest Comment:\\n\\n\";\n $message .= $this->getCommentTextTable();\n $message .= \"\\n\\n\";\n $message .= \"Ticket Details:\\n\\n\";\n $message .= $this->getTicketTextTable();\n $message .= \"\\n\\n\";\n $this->sendEmail($email, $fullName, $message, 'Comment has been added to ticket');\n }", "protected function maybe_create_notification() {\n\t\tif ( ! $this->notification_center->get_notification_by_id( self::NOTIFICATION_ID ) ) {\n\t\t\t$notification = $this->notification();\n\t\t\t$this->notification_helper->restore_notification( $notification );\n\t\t\t$this->notification_center->add_notification( $notification );\n\t\t}\n\t}", "protected function _creationComplete()\n {\n parent::_creationComplete();\n }", "public static function createSuccess()\n {\n return array('Detail' => self::CREATE_SUCCESS);\n }", "public function assertSuccessCreate()\n {\n return $this->assertStatus(HttpFoundationResponse::HTTP_CREATED);\n }", "public function prepareNotification()\n {\n }", "protected function add_notification()\n {\n }", "private function notification(){\n\t\n\t}", "public function createNotif() {\n\n $notif = new Notification();\n $notif->getFromDBByCrit(['event' => 'alert_' . $this->getID()]);\n\n if ($notif->isNewItem()) {\n $notif->check(-1, CREATE);\n $notif->add(['name' => __('Saved search') . ' ' . $this->getName(),\n 'entities_id' => $_SESSION[\"glpidefault_entity\"],\n 'itemtype' => SavedSearch_Alert::getType(),\n 'event' => 'alert_' . $this->getID(),\n 'is_active' => 0,\n 'datate_creation' => date('Y-m-d H:i:s')\n ]);\n\n Session::addMessageAfterRedirect(__('Notification has been created!'), INFO);\n }\n }", "public function onSuccessfulRegistration();", "public function afterCreate()\n {\n\n $this->getDI()->getMail()\n ->send(array(\n $this->user->email=>$this->user->firstName\n ),\"Please confirm your mail\",'confirmation',array(\n 'confirmationUrl'=>'/confirm/'.$this->code.'/'.$this->user->email\n ));\n\n }", "public function created(Notification $notification)\n {\n SendNotification::dispatch($notification);\n }", "public function getCreatedItemMesssage()\r\n {\r\n return \"Created item!\";\r\n }", "private function newAccountNotification() {\n $this->setCommonAccountFields($this->accountData);\n $this->saveAccountData();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the cookie lifetime
public function getCookieLifetime() { return Mage::getModel('core/cookie')->getLifetime() * 1000; }
[ "protected function getCookieLifetime()\r\n {\r\n $config = $this->manager->getSessionConfig();\r\n\r\n return $config['expire_on_close'] ? 0 : Carbon::now()->addMinutes($config['lifetime']);\r\n }", "protected function getCookieLifetime()\n\t{\n\t\t$config = $this->manager->getSessionConfig();\n\n\t\treturn $config['expire_on_close'] ? 0 : Carbon::now()->addMinutes($config['lifetime']);\n\t}", "public function getCookieLifetime()\n {\n return static::COOKIE_LIFETIME;\n }", "public function getCookieLifetime()\n {\n $conf = Shop::getConfig(array(CONF_GLOBAL));\n $cookieDefaults = session_get_cookie_params();\n\n $lifetime = 0;\n\n if ($conf['global']['global_cookie_lifetime']) {\n $lifetime = $conf['global']['global_cookie_lifetime'];\n }\n\n if (!$lifetime && $cookieDefaults['lifetime']) {\n $lifetime = $cookieDefaults['lifetime'];\n }\n\n // If lifetime is 0\n if ($lifetime === 0) {\n $lifetime = self::COOKIE_EXTRA_LIFETIME;\n }\n\n return $lifetime;\n }", "public function getLifetime() {\n return $this->lifetime ?: $this->lifetime = (int) ini_get('session.cookie_lifetime');\n }", "public function getSessionCookieLifetime()\n {\n return $this->sessionCookieLifetime;\n }", "public function getCookieRestrictionLifetime()\n {\n return (int)$this->_currentStore->getConfig(self::XML_PATH_COOKIE_RESTRICTION_LIFETIME);\n }", "public function getLifetime() : string {\n if ($this->expires == 0) {\n return '';\n }\n\n return date(DATE_COOKIE, $this->expires);\n }", "public function getCookieExpire()\n\t{\n\t\treturn $this->cookieExpire;\n\t}", "public function getCookieExpiration(){\r\n return $this->_cookieExpiration;\r\n }", "protected function getLifetime()\n {\n $lifetime = config('metrics.cookie_lifetime');\n\n $dateInterval = DateInterval::createFromDateString($lifetime);\n\n $seconds = date_create('@0')->add($dateInterval)->getTimestamp();\n\n return $seconds * 60;\n }", "public function get_cookie_life() {\n\n\t\t\t$life = get_option( 'wc_sc_coupon_cookie_life', 180 );\n\n\t\t\treturn apply_filters( 'wc_sc_coupon_cookie_life', time() + ( 60 * 60 * 24 * $life ) );\n\n\t\t}", "public function getLifeTime()\n {\n if (is_null($this->_lifeTime)) {\n $configNode = Mage::app()->getStore()->isAdmin() ?\n 'admin/security/session_cookie_lifetime' : 'web/cookie/cookie_lifetime';\n $this->_lifeTime = (int) Mage::getStoreConfig($configNode);\n\n if ($this->_lifeTime < 60) {\n $this->_lifeTime = ini_get('session.gc_maxlifetime');\n }\n\n if ($this->_lifeTime < 60) {\n $this->_lifeTime = 3600; //one hour\n }\n\n if ($this->_lifeTime > self::SEESION_MAX_COOKIE_LIFETIME) {\n $this->_lifeTime = self::SEESION_MAX_COOKIE_LIFETIME; // 100 years\n }\n }\n return $this->_lifeTime;\n }", "public function getCookieExpires() {\n return $this->Cookie->getCookie('cookie_expires');\n }", "public function getCookieExpireTime()\n {\n return $this->cookie_expire_time;\n }", "private function get_cookie_expiration_time()\n {\n $session = $this->getSession();\n if( !is_array($session) ) \n { \n return false;\n }\n else\n {\n return $session['expires'];\n }\n }", "public function getCookieEndTime()\n {\n return time()+(3600*((int)$this->getCookieDuration()));\n }", "public function getLifeTime() {\n return ini_get('session.gc_maxlifetime');\n }", "public static function lifetime(): int\n {\n return config('nonce.lifetime', 900);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Prepare Quote mock for tests.
private function prepareQuoteMock() { $extensionAttributes = $this->getMockBuilder(\Magento\Quote\Api\Data\CartExtensionInterface::class) ->disableOriginalConstructor() ->setMethods(['getNegotiableQuote']) ->getMockForAbstractClass(); $this->negotiableQuote = $this->getMockBuilder(NegotiableQuoteInterface::class) ->disableOriginalConstructor() ->setMethods(['getSnapshot']) ->getMockForAbstractClass(); $this->quote->expects($this->atLeastOnce())->method('getExtensionAttributes')->willReturn($extensionAttributes); $extensionAttributes->expects($this->atLeastOnce())->method('getNegotiableQuote') ->willReturn($this->negotiableQuote); }
[ "private function getQuoteMock()\n {\n return $this->getMockBuilder(Quote::class)\n ->disableOriginalConstructor()\n ->getMock();\n }", "private function getQuoteMock()\n {\n return $this->getMockBuilder(Quote::class)\n ->setMethods(\n [\n 'setCustomerId',\n 'setCustomerEmail',\n 'setCustomerIsGuest',\n 'setCustomerGroupId',\n 'getCheckoutMethod',\n 'setCheckoutMethod',\n 'collectTotals',\n 'getId',\n 'getBillingAddress',\n 'getShippingAddress',\n 'getIsVirtual'\n ]\n )->disableOriginalConstructor()\n ->getMock();\n }", "private function prepareNegotiableQuoteMock()\n {\n $isRegularQuote = true;\n $this->negotiableQuote->expects($this->once())->method('getIsRegularQuote')->willReturn($isRegularQuote);\n $negotiatedPrice = 234;\n $this->negotiableQuote->expects($this->once())->method('getNegotiatedPriceValue')\n ->willReturn($negotiatedPrice);\n $negotiableQuoteStatus = NegotiableQuoteInterface::STATUS_EXPIRED;\n $this->negotiableQuote->expects($this->once())->method('getStatus')->willReturn($negotiableQuoteStatus);\n }", "protected function _prepareMock()\n {\n }", "private function populate_quote( $quote ): Quote {\n\t\treturn $this->quote_factory->from_stdclass( $quote );\n\t}", "protected function initCheckoutQuote()\n {\n return $this->traitInitCheckoutQuote();\n }", "protected function _prepareNewCustomerQuote()\n {\n $quote = $this->getQuote();\n $billing = $quote->getBillingAddress();\n $shipping = $quote->isVirtual() ? null : $quote->getShippingAddress();\n\n //$customer = Mage::getModel('customer/customer');\n $customer = $quote->getCustomer();\n /* @var $customer Mage_Customer_Model_Customer */\n $customerBilling = $billing->exportCustomerAddress();\n $customer->addAddress($customerBilling);\n $billing->setCustomerAddress($customerBilling);\n $customerBilling->setIsDefaultBilling(true);\n if ($shipping && !$shipping->getSameAsBilling()) {\n $customerShipping = $shipping->exportCustomerAddress();\n $customer->addAddress($customerShipping);\n $shipping->setCustomerAddress($customerShipping);\n $customerShipping->setIsDefaultShipping(true);\n } else {\n $customerBilling->setIsDefaultShipping(true);\n }\n\n Mage::helper('core')->copyFieldset('checkout_onepage_quote', 'to_customer', $quote, $customer);\n $customer->setPassword($customer->decryptPassword($quote->getPasswordHash()));\n $customer->setPasswordHash($customer->hashPassword($customer->getPassword()));\n/**\n * The magic line changes\n */\n $customer->save();\n $quote->setCustomer($customer);\n // ->setCustomerId(true);\n/**\n * End the magic line changes\n */\n }", "protected function getTestQuote()\n\t{\n\t\t$quote = new ISC_QUOTE;\n\n\t\t$billing = $quote->getBillingAddress();\n\t\t$billing->setFirstName('first');\n\t\t$billing->setLastName('last');\n\t\t$billing->setAddress1('1');\n\t\t$billing->setCity('city');\n\t\t$billing->setPhone('12345678');\n\t\t$billing->setCountryByName('Australia');\n\t\t$billing->setStateByName('New South Wales');\n\t\t$billing->setZip('2010');\n\t\t$this->assertTrue($billing->isComplete(), \"Billing address is not complete\");\n\n\t\t$shipping = $quote->createShippingAddress();\n\t\t$shipping->setFirstName('first');\n\t\t$shipping->setLastName('last');\n\t\t$shipping->setAddress1('1');\n\t\t$shipping->setCity('city');\n\t\t$shipping->setPhone('12345678');\n\t\t$shipping->setCountryByName('Australia');\n\t\t$shipping->setStateByName('New South Wales');\n\t\t$shipping->setZip('2010');\n\t\t$shipping->setHandlingCost(1.1);\n\t\t$shipping->setShippingMethod(2.2, '.', 'peritem');\n\t\t$this->assertTrue($shipping->isComplete(), \"Shipping address is not complete\");\n\t\t$this->assertTrue($shipping->hasShippingMethod(), \"Shipping address has no shipping method\");\n\n\t\treturn $quote;\n\t}", "public function testQuote()\n {\n $actual = $this->_adapter->quote('\"foo\" bar \\'baz\\'');\n $this->assertEquals($actual, $this->_quote_expect);\n }", "private function _prepareNewCustomerQuote()\n {\n $quote = $this->_quote;\n $billing = $quote->getBillingAddress();\n $shipping = $quote->isVirtual() ? null : $quote->getShippingAddress();\n\n $customer = $quote->getCustomer();\n $customerBillingData = $billing->exportCustomerAddress();\n $dataArray = $this->_objectCopyService->getDataFromFieldset('checkout_onepage_quote', 'to_customer', $quote);\n $this->_dataObjectHelper->populateWithArray(\n $customer,\n $dataArray,\n '\\Magento\\Customer\\Api\\Data\\CustomerInterface'\n );\n $quote->setCustomer($customer);\n $quote->setCustomerId(true);\n\n $customerBillingData->setIsDefaultBilling(true);\n\n if ($shipping) {\n if (!$shipping->getSameAsBilling()) {\n $customerShippingData = $shipping->exportCustomerAddress();\n $customerShippingData->setIsDefaultShipping(true);\n $shipping->setCustomerAddressData($customerShippingData);\n // Add shipping address to quote since customer Data Object does not hold address information\n $quote->addCustomerAddress($customerShippingData);\n } else {\n $shipping->setCustomerAddressData($customerBillingData);\n $customerBillingData->setIsDefaultShipping(true);\n }\n } else {\n $customerBillingData->setIsDefaultShipping(true);\n }\n $billing->setCustomerAddressData($customerBillingData);\n\n // Add billing address to quote since customer Data Object does not hold address information\n $quote->addCustomerAddress($customerBillingData);\n }", "protected function _prepareNewCustomerQuote()\n {\n $quote = $this->getQuote();\n $billing = $quote->getBillingAddress();\n $shipping = $quote->isVirtual() ? null : $quote->getShippingAddress();\n\n //$customer = Mage::getModel('customer/customer');\n $customer = $quote->getCustomer();\n /* @var $customer Mage_Customer_Model_Customer */\n $customerBilling = $billing->exportCustomerAddress();\n $customer->addAddress($customerBilling);\n $billing->setCustomerAddress($customerBilling);\n $customerBilling->setIsDefaultBilling(true);\n if ($shipping && !$shipping->getSameAsBilling()) {\n $customerShipping = $shipping->exportCustomerAddress();\n $customer->addAddress($customerShipping);\n $shipping->setCustomerAddress($customerShipping);\n $customerShipping->setIsDefaultShipping(true);\n } else {\n $customerBilling->setIsDefaultShipping(true);\n }\n\n Mage::helper('core')->copyFieldset('checkout_onepage_quote', 'to_customer', $quote, $customer);\n $customer->setPassword($customer->decryptPassword($quote->getPasswordHash()));\n $passwordCreatedTime = $this->_checkoutSession->getData('_session_validator_data')['session_expire_timestamp']\n - Mage::getSingleton('core/cookie')->getLifetime();\n $customer->setPasswordCreatedAt($passwordCreatedTime);\n $quote->setCustomer($customer)\n ->setCustomerId(true);\n $quote->setPasswordHash('');\n }", "protected function _prepareNewCustomerQuote()\n {\n $quote = $this->getQuote();\n $billing = $quote->getBillingAddress();\n $shipping = $quote->isVirtual() ? null : $quote->getShippingAddress();\n\n $customer = $quote->getCustomer();\n /* @var $customer Mage_Customer_Model_Customer */\n $customerBilling = $billing->exportCustomerAddress();\n $customer->addAddress($customerBilling);\n $billing->setCustomerAddress($customerBilling);\n $customerBilling->setIsDefaultBilling(true);\n if ($shipping && !$shipping->getSameAsBilling()) {\n $customerShipping = $shipping->exportCustomerAddress();\n $customer->addAddress($customerShipping);\n $shipping->setCustomerAddress($customerShipping);\n $customerShipping->setIsDefaultShipping(true);\n } elseif ($shipping) {\n $customerBilling->setIsDefaultShipping(true);\n }\n\n if ($quote->getCustomerTaxnumber() && !$billing->getCustomerTaxnumber()) {\n $billing->setCustomerTaxnumber($quote->getCustomerTaxnumber());\n }\n\n Mage::helper('core')->copyFieldset('checkout_onepage_quote', 'to_customer', $quote, $customer);\n $customer->setPassword($customer->decryptPassword($quote->getPasswordHash()));\n $customer->setPasswordHash($customer->hashPassword($customer->getPassword()));\n $quote->setCustomer($customer)\n ->setCustomerId(true);\n }", "public function setQuote($quote);", "protected function _prepareNewCustomerQuote()\n {\n $quote = $this->getQuote();\n $billing = $quote->getBillingAddress();\n $shipping = $quote->isVirtual() ? null : $quote->getShippingAddress();\n\n $customer = $quote->getCustomer();\n $customerBillingData = $billing->exportCustomerAddress();\n $dataArray = $this->_objectCopyService->getDataFromFieldset('checkout_onepage_quote', 'to_customer', $quote);\n $this->dataObjectHelper->populateWithArray(\n $customer,\n $dataArray,\n \\Magento\\Customer\\Api\\Data\\CustomerInterface::class\n );\n $quote->setCustomer($customer)->setCustomerId(true);\n\n $customerBillingData->setIsDefaultBilling(true);\n\n if ($shipping) {\n if (!$shipping->getSameAsBilling()) {\n $customerShippingData = $shipping->exportCustomerAddress();\n $customerShippingData->setIsDefaultShipping(true);\n $shipping->setCustomerAddressData($customerShippingData);\n // Add shipping address to quote since customer Data Object does not hold address information\n $quote->addCustomerAddress($customerShippingData);\n } else {\n $shipping->setCustomerAddressData($customerBillingData);\n $customerBillingData->setIsDefaultShipping(true);\n }\n } else {\n $customerBillingData->setIsDefaultShipping(true);\n }\n $billing->setCustomerAddressData($customerBillingData);\n // TODO : Eventually need to remove this legacy hack\n // Add billing address to quote since customer Data Object does not hold address information\n $quote->addCustomerAddress($customerBillingData);\n }", "protected function _prepareCustomerQuote()\n {\n $quote = $this->getQuote();\n $billing = $quote->getBillingAddress();\n $shipping = $quote->isVirtual() ? null : $quote->getShippingAddress();\n\n $customer = $this->customerRepository->getById($this->getCustomerSession()->getCustomerId());\n $hasDefaultBilling = (bool)$customer->getDefaultBilling();\n $hasDefaultShipping = (bool)$customer->getDefaultShipping();\n\n if ($shipping && !$shipping->getSameAsBilling() &&\n (!$shipping->getCustomerId() || $shipping->getSaveInAddressBook())\n ) {\n $shippingAddress = $shipping->exportCustomerAddress();\n if (!$hasDefaultShipping) {\n //Make provided address as default shipping address\n $shippingAddress->setIsDefaultShipping(true);\n $hasDefaultShipping = true;\n }\n $quote->addCustomerAddress($shippingAddress);\n $shipping->setCustomerAddressData($shippingAddress);\n }\n\n if (!$billing->getCustomerId() || $billing->getSaveInAddressBook()) {\n $billingAddress = $billing->exportCustomerAddress();\n if (!$hasDefaultBilling) {\n //Make provided address as default shipping address\n if (!$hasDefaultShipping) {\n //Make provided address as default shipping address\n $billingAddress->setIsDefaultShipping(true);\n }\n $billingAddress->setIsDefaultBilling(true);\n }\n $quote->addCustomerAddress($billingAddress);\n $billing->setCustomerAddressData($billingAddress);\n }\n }", "public function testCreateQuoteFromCart()\n {\n }", "private function initQuoteCharacter(): void\n {\n $this->setQuoteCharacter(self::QUOTE_SINGLE);\n }", "public function testQuoteMulti()\n {\n $this->todo('stub');\n }", "public function installQuoteData()\n {\n $quoteInstaller = $this->quoteSetupFactory->create(\n [\n 'resourceName' => 'quote_setup',\n 'setup' => $this->setup\n ]\n );\n $quoteInstaller\n ->addAttribute(\n 'quote',\n CustomFieldsInterface::CHECKOUT_PURPOSE,\n ['type' => Table::TYPE_TEXT, 'length' => '255', 'nullable' => true]\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Build the Node weight select type overview form. Loads all node and builds an overview form with weight elements
function node_weight_type_form() { $type = variable_get('node_weight_allow_type', NULL); $rows = array(); if ($type) { foreach ($type as $key => $value) { if ($value) { $rows[] = array(array('data' => l($key, 'admin/content/node_weight/'.$key))); } } } if (count($rows) > 0) { $header = array(t('Content Type')); return theme('table', array( 'header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'node-weight-type') )); } else { return 'No content type to select, you can setting '. l('here', 'admin/settings/node_weight', array('query' => drupal_get_destination())); } }
[ "function node_weight_overview_form(&$form_state, $type = NULL) {\n $node_type = arg(5);\n\tdrupal_set_title('Weight Manager for \"'.$node_type.'\"');\r\n\t$allow_type = variable_get('node_weight_allow_type', NULL);\r\n\tif ($allow_type) {\r\n\t\tforeach ($allow_type as $allow => $value) {\r\n\t\t\tif ($value) {\r\n\t\t\t\t$allow_types[] = $allow;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (isset($allow_types) && in_array($node_type, $allow_types)) {\n\t\t $nodes = array();\r\n\t\t\t$result = db_query(\"SELECT n.nid, n.title, n.type, nw.weight FROM {node} AS n LEFT JOIN {node_weight} AS nw ON n.nid = nw.nid WHERE n.type = '$node_type' ORDER BY nw.weight\");\r\n\t\t\tforeach ($result as $node) {\r\n\t\t\t\t$nodes[$node->nid] = $node;\r\n\t\t\t}\n\t\t\t\n\t\t\t$form['node_weight'] = array(\n '#type' => 'fieldset',\n '#title' => t('Node order'),\n '#tree' => TRUE,\n '#collapsible' => TRUE,\n '#collapsed' => FALSE,\n '#weight' => -10,\n );\n \r\n\t\t\t$form['node_weight']['create_new'] = array(\n\t\t\t '#type' => 'markup',\n\t\t\t '#markup' => '<ul class=\"action-links\">' . \"\\n\" . '<li>' . l('Create new '.$node_type, 'node/add/'.str_replace('_', '-', $node_type), array('query' => drupal_get_destination())) . \"</li>\\n</ul>\\n\",\n\t\t\t);\n\t\t\tif ($nodes) {\r\n\t\t\t\tforeach ($nodes as $nid => $node) {\r\n\t\t\t\t\t$form['node_weight'][$nid] = _node_weight_overview_field($node);\r\n\t\t\t\t}\n\t\t\t\t\n\t\t\t $form['node_weight']['#theme'] = 'node_weight_overview_form';\r\n\t\t\t}\n\t\t\tif (!isset($form)) {\r\n\t\t\t\tdrupal_goto('node_weight');\r\n\t\t\t}\r\n\t\t\treturn $form;\n\t\t}\n\t\telse {\n\t\t drupal_goto('node_weight');\n\t\t}\n }\n else {\r\n\t\t$form['error'] = array(\r\n\t\t\t'#type' => 'markup', \r\n\t\t\t'#markup' => 'No content type to select, you can setting '. l('here', 'admin/settings/node_weight', array('query' => drupal_get_destination())),\r\n\t\t);\r\n\t\treturn $form;\r\n\t}\n}", "function form_process_weight($element) {\n $element['#is_weight'] = TRUE;\n\n // If the number of options is small enough, use a select field.\n $max_elements = variable_get('drupal_weight_select_max', DRUPAL_WEIGHT_SELECT_MAX);\n if ($element['#delta'] <= $max_elements) {\n $element['#type'] = 'select';\n for ($n = (-1 * $element['#delta']); $n <= $element['#delta']; $n++) {\n $weights[$n] = $n;\n }\n $element['#options'] = $weights;\n $element += element_info('select');\n }\n // Otherwise, use a text field.\n else {\n $element['#type'] = 'textfield';\n // Use a field big enough to fit most weights.\n $element['#size'] = 10;\n $element['#element_validate'] = array('element_validate_integer');\n $element += element_info('textfield');\n }\n\n return $element;\n}", "function classification_additional_trees_form(){\n \n $form ['trees'] = array (\n '#type' => 'markup', \n '#value' => ' ', \n '#prefix' => '<div class=\"alternate_content\" id=\"classification_alternate_trees\">', \n '#suffix' => '</div>' );\n \n $classifications = taxonomy_get_vocabularies ();\n $classification_list [0] = 'None';\n foreach ( $classifications as $classification ) {\n if (preg_match ( \"/alternate_/i\", $classification->name )) {\n $classification_list ['' . $classification->vid . ''] = str_replace ( \"alternate_\", \"\", check_plain ( $classification->name ) );\n }\n }\n \n $form ['trees'] ['selections'] = array (\n '#type' => 'select', \n '#title' => t ( 'Select other classifications' ), \n '#options' => $classification_list, \n '#default_value' => 0, \n '#description' => t ( 'Source classification(s) from which you may drag names' ), \n '#attributes' => array (\n 'onchange' => 'javascript:EDIT.get_tree(this.value)' ) );\n \n $form ['trees'] ['classification_trees'] = array (\n '#type' => 'markup', \n '#value' => ' ', \n '#prefix' => '<div id=\"classification_tree_alternate\">', \n '#suffix' => '</div>' );\n \n return $form;\n}", "function process_weight($element) {\n for ($n = (-1 * $element['#delta']); $n <= $element['#delta']; $n++) {\n $weights[$n] = $n;\n }\n $element['#options'] = $weights;\n $element['#type'] = 'select';\n $element['#is_weight'] = TRUE;\n return $element;\n}", "function theme_cirro_core_multi_file_weight_form($variables) {\n\n\t// Init\n\t$output = '';\n\t$rows = array();\n\n\t// Load form array\n\t$form = $variables['form'];\n\n\t// Activate tabledrag shiz\n\tdrupal_add_tabledrag('draggable-table', 'order', 'sibling', 'weight-group');\n\n\t// Loop through form Elements\n\tforeach ( element_children($form['files']) as $key ) {\n\n\t\t// Init\n\t\t$element = array();\n\t\t$data = '';\n\t\t$row = array();\n\n\t\t// Skip none numeric keys\n\t\tif ( !is_numeric($key) ) continue;\n\n\t\t// Load element\n\t\t$element = &$form['files'][$key];\n\n\t\t// Add class to weight field\n\t\t$element['weight']['#attributes']['class'] = array('weight-group');\n\n\t\t// Put data fields together\n\t\t$data .= drupal_render($element['id']);\n\t\t$data .= drupal_render($element['title']);\n\n\t\t// Check for data fields\n\t\tif ( isset($element['data_fields']) ) {\n\n\t\t\t// Render fields\n\t\t\t$data_fields = drupal_render($element['data_fields']);\n\n\t\t\t// Wrap for acc\n\t\t\t$data_fields_wrapped = \"\n\t\t\t\t<div class=\\\"multi-acc-button\\\">\n\t\t\t\t\t<i class=\\\"icon-chevron-down\\\"></i>\n\t\t\t\t\tshow details\n\t\t\t\t</div>\n\t\t\t\t<div class=\\\"multi-acc-content\\\">\n\t\t\t\t\t$data_fields\n\t\t\t\t</div>\n\t\t\t\";\n\n\t\t\t// Add to data section\n\t\t\t$data .= $data_fields_wrapped;\n\n\t\t}\n\n\t\t$data_wrapped = \"\n\t\t\t<div class=\\\"multi-tool-data-col\\\">\n\t\t\t\t$data\n\t\t\t</div>\n\t\t\";\n\n\t\t// Build row\n\t\t$row = array();\n\t\t$file_thumb = drupal_render($element['file_name']);\n\t\t$row[] = \"\n\t\t\t<div class=\\\"multi-tool-thumb-col\\\">\n\t\t\t\t$file_thumb\n\t\t\t</div>\n\t\t\";\n\t\t$row[] = $data_wrapped;\n\t\t$row[] = drupal_render($element['weight']);\n\t\t$row[] = drupal_render($element['delete_link']);\n\n\t\t// Add to rows\n\t\t$rows[] = array( 'data' => $row, 'class' => array('draggable'));\n\n\t}\n\n\t// Define headers\n\t$headers = array(\n\t\t'File',\n\t\t'Data',\n\t\t'Weight',\n\t\t'',\n\t);\n\n\t// Define table vars\n\t$table_vars = array(\n\t\t'header' => $headers,\n\t\t'rows' => $rows,\n\t\t'attributes' => array(\n\t\t\t'id' => 'draggable-table',\n\t\t\t'class' => array(\n\t\t\t\t'table',\n\t\t\t\t'table-bordered',\n\t\t\t\t'table-striped'\n\t\t\t),\n\t\t),\n\t\t'caption' => 'Drag and Drop to change order',\n\t\t'colgroups' => array(),\n\t\t'sticky' => FALSE,\n\t\t'empty' => 'No Files found',\n\t);\n\n\t// Add table to output\n\t$output = theme_table($table_vars);\n\n\t// Render remaining form elements\n\t$output .= drupal_render_children($form);\n\n\treturn $output;\n\n}", "function _theforce_menu_overview_tree_form($tree) {\n $form = &drupal_static(__FUNCTION__, array('#tree' => TRUE));\n foreach ($tree as $data) {\n $title = '';\n $item = $data['link'];\n // Don't show callbacks; these have $item['hidden'] < 0.\n if ($item && $item['hidden'] >= 0) {\n $mlid = 'mlid:' . $item['mlid'];\n $form[$mlid]['#item'] = $item;\n $form[$mlid]['#attributes'] = $item['hidden'] ? array('class' => array('menu-disabled')) : array('class' => array('menu-enabled'));\n $form[$mlid]['title']['#markup'] = l($item['title'], $item['href'], $item['localized_options']);\n if ($item['hidden']) {\n $form[$mlid]['title']['#markup'] .= ' (' . t('disabled') . ')';\n }\n elseif ($item['link_path'] == 'user' && $item['module'] == 'system') {\n $form[$mlid]['title']['#markup'] .= ' (' . t('logged in users only') . ')';\n }\n\n $form[$mlid]['hidden'] = array(\n '#type' => 'checkbox',\n '#title' => t('Enable @title menu link', array('@title' => $item['title'])),\n '#title_display' => 'invisible',\n '#default_value' => !$item['hidden'],\n );\n $form[$mlid]['weight'] = array(\n '#type' => 'weight',\n '#delta' => 50,\n '#default_value' => $item['weight'],\n '#title_display' => 'invisible',\n '#title' => t('Weight for @title', array('@title' => $item['title'])),\n );\n $form[$mlid]['mlid'] = array(\n '#type' => 'hidden',\n '#value' => $item['mlid'],\n );\n $form[$mlid]['plid'] = array(\n '#type' => 'hidden',\n '#default_value' => $item['plid'],\n );\n // Build a list of operations.\n $operations = array();\n $title = t('Edit');\n if(module_exists('fawesome')){\n $title = '<i class=\"fa fa-edit\"></i> ' . $title;\n }\n $operations['edit'] = array('#type' => 'link', '#title' => $title, '#href' => 'admin/structure/menu/item/' . $item['mlid'] . '/edit', '#options' => array('html' => true, 'attributes' => array('class' => array('use-theforce'))));\n // Only items created by the menu module can be deleted.\n if ($item['module'] == 'menu' || $item['updated'] == 1) {\n $title = t('Delete');\n if(module_exists('fawesome')){\n $title = '<i class=\"fa fa-trash-o\"></i> ' . $title;\n }\n $operations['delete'] = array('#type' => 'link', '#title' => $title, '#href' => 'admin/structure/menu/item/' . $item['mlid'] . '/delete', '#options' => array('html' => true, 'attributes' => array('class' => array('use-theforce'))), '#prefix' => '&nbsp;&nbsp;&nbsp;');\n }\n // Set the reset column.\n elseif ($item['module'] == 'system' && $item['customized']) {\n $title = t('Reset');\n if(module_exists('fawesome')){\n $title = '<i class=\"fa fa-undo\"></i> ' . $title;\n }\n $operations['reset'] = array('#type' => 'link', '#title' => $title, '#href' => 'admin/structure/menu/item/' . $item['mlid'] . '/reset', '#options' => array('html' => true, 'attributes' => array('class' => array('use-theforce'))), '#prefix' => '&nbsp;&nbsp;&nbsp;');\n }\n $form[$mlid]['operations'][] = $operations;\n }\n\n if ($data['below']) {\n _theforce_menu_overview_tree_form($data['below']);\n }\n }\n return $form;\n}", "function _dataone_build_api_version_form_fields(&$form_element, $weight = 10){\n global $base_url;\n\n // Increment the weight for each API version.\n $weight_counter = $weight;\n\n $versions = _dataone_admin_version_options();\n foreach ($versions as $version_id => $version_name) {\n\n // #states input field for determining if a version section should be shown.\n $api_version_visible_input = ':input[name=\"' . DATAONE_VARIABLE_API_VERSIONS . '[' . $version_id . ']\"]';\n $form_element[$version_id] = array(\n '#type' => 'fieldset',\n '#title' => t('@version Settings', array('@version' => $version_name)),\n '#weight' => $weight_counter,\n '#states' => array(\n 'visible' => array(\n $api_version_visible_input => array('checked' => TRUE),\n ),\n ),\n );\n\n $online = _dataone_get_variable_name($version_id, DATAONE_VARIABLE_API_STATUS);\n $form_element[$version_id][$online] = array(\n '#type' => 'radios',\n '#title' => t('Member Node Online Status'),\n '#description' => t('This toggle provides a way to turn off access to the Member Node.'),\n '#options' => _dataone_admin_online_options(),\n '#default_value' => _dataone_get_variable($version_id, DATAONE_VARIABLE_API_STATUS, DATAONE_API_STATUS_DEVELOPMENT),\n '#weight' => 1,\n );\n\n $replicated = _dataone_get_variable_name($version_id, DATAONE_VARIABLE_API_REPLICATE);\n $form_element[$version_id][$replicated] = array(\n '#type' => 'radios',\n '#title' => t('Does this node replicate other Member Node objects?'),\n '#description' => t('This toggle provides a way to turn off whether the Member Node objects are replicated or not.'),\n '#options' => _dataone_admin_replicate_options(),\n '#default_value' => _dataone_get_variable($version_id, DATAONE_VARIABLE_API_REPLICATE, DATAONE_API_FALSE_STRING),\n '#weight' => 3,\n );\n\n $weight_counter++;\n $form_element[$version_id]['sync'] = array(\n '#type' => 'fieldset',\n '#title' => t('Synchronization Settings', array('@version' => $version_name)),\n '#weight' => $weight_counter,\n );\n $synchronize = _dataone_get_variable_name($version_id, DATAONE_VARIABLE_API_SYNCHRONIZE);\n $form_element[$version_id]['sync'][$synchronize] = array(\n '#type' => 'radios',\n '#title' => t('Should the node be synchronized?'),\n '#description' => t('This toggle provides a way to turn off whether the Member Node objects are synchronized or not.'),\n '#options' => _dataone_admin_synchronize_options(),\n '#default_value' => _dataone_get_variable($version_id, DATAONE_VARIABLE_API_SYNCHRONIZE, DATAONE_API_FALSE_STRING),\n '#weight' => 4,\n );\n\n $form_element[$version_id]['sync']['cron'] = array(\n '#type' => 'container',\n '#markup' => 'Cron Schedule',\n '#attributes' => array('class' => array('container-inline')),\n '#weight' => 5,\n );\n $form_element[$version_id]['sync']['cron']['description'] = array(\n '#type' => 'item',\n '#title' => t('Cron Schedule'),\n '#description' => '<br/>' . t('For details about expressing a cron schedule, see !url.', array('!url' => l('Cron Expression', DATAONE_URL_CRON_EXPRESSION, array('attributes' => array('target' => '_blank'))))),\n '#suffix' => '<br/>',\n );\n $sync_sec = _dataone_get_variable_name($version_id, DATAONE_VARIABLE_API_SYNC_SEC);\n $form_element[$version_id]['sync']['cron'][$sync_sec] = array(\n '#type' => 'textfield',\n '#title' => t('Seconds'),\n '#default_value' => _dataone_get_variable(DATAONE_API_VERSION_1, DATAONE_VARIABLE_API_SYNC_SEC, '0'),\n '#size' => 3,\n '#weight' => 1,\n );\n $sync_min = _dataone_get_variable_name($version_id, DATAONE_VARIABLE_API_SYNC_MIN);\n $form_element[$version_id]['sync']['cron'][$sync_min] = array(\n '#type' => 'textfield',\n '#title' => t('Minutes'),\n '#default_value' => _dataone_get_variable(DATAONE_API_VERSION_1, DATAONE_VARIABLE_API_SYNC_MIN, '0/3'),\n '#size' => 3,\n '#weight' => 2,\n );\n $sync_hour = _dataone_get_variable_name($version_id, DATAONE_VARIABLE_API_SYNC_HOUR);\n $form_element[$version_id]['sync']['cron'][$sync_hour] = array(\n '#type' => 'textfield',\n '#title' => t('Hour'),\n '#default_value' => _dataone_get_variable(DATAONE_API_VERSION_1, DATAONE_VARIABLE_API_SYNC_HOUR, '*'),\n '#size' => 3,\n '#weight' => 3,\n );\n $sync_mday = _dataone_get_variable_name($version_id, DATAONE_VARIABLE_API_SYNC_MDAY);\n $form_element[$version_id]['sync']['cron'][$sync_mday] = array(\n '#type' => 'textfield',\n '#title' => t('Day of Month'),\n '#default_value' => _dataone_get_variable(DATAONE_API_VERSION_1, DATAONE_VARIABLE_API_SYNC_MDAY, '*'),\n '#size' => 3,\n '#weight' => 4,\n );\n $sync_mon = _dataone_get_variable_name($version_id, DATAONE_VARIABLE_API_SYNC_MON);\n $form_element[$version_id]['sync']['cron'][$sync_mon] = array(\n '#type' => 'textfield',\n '#title' => t('Month'),\n '#default_value' => _dataone_get_variable(DATAONE_API_VERSION_1, DATAONE_VARIABLE_API_SYNC_MON, '*'),\n '#size' => 3,\n '#weight' => 5,\n );\n $sync_wday = _dataone_get_variable_name($version_id, DATAONE_VARIABLE_API_SYNC_WDAY);\n $form_element[$version_id]['sync']['cron'][$sync_wday] = array(\n '#type' => 'textfield',\n '#title' => t('Day of Week'),\n '#default_value' => _dataone_get_variable(DATAONE_API_VERSION_1, DATAONE_VARIABLE_API_SYNC_WDAY, '?'),\n '#size' => 4,\n '#weight' => 6,\n );\n $sync_year = _dataone_get_variable_name($version_id, DATAONE_VARIABLE_API_SYNC_YEAR);\n $form_element[$version_id]['sync']['cron'][$sync_year] = array(\n '#type' => 'textfield',\n '#title' => t('Year'),\n '#default_value' => _dataone_get_variable(DATAONE_API_VERSION_1, DATAONE_VARIABLE_API_SYNC_YEAR, '*'),\n '#size' => 5,\n '#weight' => 7,\n );\n\n $max_log_count = _dataone_get_variable_name($version_id, DATAONE_VARIABLE_API_MAX_LOG_COUNT);\n $form_element[$version_id][$max_log_count] = array(\n '#type' => 'textfield',\n '#title' => t('Maximum number of log entries to return.'),\n '#description' => t('Cap the number of entires the GetLogRecords() method of the DataONE Member Node API can request. Defaults to %default records.', array('%default' => DATAONE_DEFAULT_MAX_LOG_RECORDS)),\n '#default_value' => _dataone_get_variable($version_id, DATAONE_VARIABLE_API_MAX_LOG_COUNT, DATAONE_DEFAULT_MAX_LOG_RECORDS),\n '#element_validate' => array('element_validate_integer_positive'),\n '#size' => 5,\n '#weight' => 13,\n );\n\n $max_object_count = _dataone_get_variable_name($version_id, DATAONE_VARIABLE_API_MAX_OBJECT_COUNT);\n $form_element[$version_id][$max_object_count] = array(\n '#type' => 'textfield',\n '#title' => t('Maximum number of object entries to return.'),\n '#description' => t('Cap the number of entires the listObjects() method of the DataONE Member Node API can request. Defaults to %default records.', array('%default' => DATAONE_DEFAULT_MAX_OBJECT_RECORDS)),\n '#default_value' => _dataone_get_variable($version_id, DATAONE_VARIABLE_API_MAX_OBJECT_COUNT, DATAONE_DEFAULT_MAX_OBJECT_RECORDS),\n '#element_validate' => array('element_validate_integer_positive'),\n '#size' => 5,\n '#weight' => 15,\n );\n\n $sync_failed_dir = _dataone_get_variable_name($version_id, DATAONE_VARIABLE_API_SYNC_FAILED_DIR);\n $form_element[$version_id][$sync_failed_dir] = array(\n '#type' => 'textfield',\n '#title' => t('Directory for storing XML notifications of failed synchronizations.'),\n '#description' => t('The Coordinating Node will notify Member Nodes when an object failed to synchronize. The CN will call the synchronizedFailed() method which POSTs an XML exception file to the Member Node. This directory informs Drupal where to store these exceptions. NOTE: these files must only persist for as long as the synchronizationFalied() method requires and can be removed at any time afterward.'),\n '#default_value' => 'private://dataone/' . $version_id . '/exceptions',\n '#element_validate' => array('system_check_directory'),\n '#weight'=> 20,\n );\n\n\n // Increment the weight counter fo rthe next section.\n $weight_counter++;\n }\n}", "function theme_node_admin_nodes($form) {\n // Overview table:\n $header = array(NULL, t('Title'), t('Type'), t('Author'), t('Status'), t('Operations'));\n\n $output .= form_render($form['options']);\n if (isset($form['title']) && is_array($form['title'])) {\n foreach (element_children($form['title']) as $key) {\n $row = array();\n $row[] = form_render($form['nodes'][$key]);\n $row[] = form_render($form['title'][$key]);\n $row[] = form_render($form['name'][$key]);\n $row[] = form_render($form['username'][$key]);\n $row[] = form_render($form['status'][$key]);\n $row[] = form_render($form['operations'][$key]);\n $rows[] = $row;\n }\n\n }\n else {\n $rows[] = array(array('data' => t('No posts available.'), 'colspan' => '6'));\n }\n\n $output .= theme('table', $header, $rows);\n if ($form['pager']['#value']) {\n $output .= form_render($form['pager']);\n }\n\n $output .= form_render($form);\n\n return $output;\n}", "function node_types_configure($type = NULL) {\n if (isset($type)) {\n $node = new stdClass();\n $node->type = $type;\n $form['submission'] = array('#type' => 'fieldset', '#title' =>t('Submission form') );\n $form['submission'][$type . '_help'] = array(\n '#type' => 'textarea', '#title' => t('Explanation or submission guidelines'), '#default_value' => variable_get($type .'_help', ''),\n '#description' => t('This text will be displayed at the top of the %type submission form. It is useful for helping or instructing your users.', array('%type' => node_get_name($type)))\n );\n $form['submission']['minimum_'. $type .'_size'] = array(\n '#type' => 'select', '#title' => t('Minimum number of words'), '#default_value' => variable_get('minimum_'. $type .'_size', 0), '#options' => drupal_map_assoc(array(0, 10, 25, 50, 75, 100, 125, 150, 175, 200)),\n '#description' => t('The minimum number of words a %type must be to be considered valid. This can be useful to rule out submissions that do not meet the site\\'s standards, such as short test posts.', array('%type' => node_get_name($type)))\n );\n $form['workflow'] = array('#type' => 'fieldset', '#title' =>t('Workflow'));\n $form['type'] = array('#type' => 'value', '#value' => $type);\n\n $form['array_filter'] = array('#type' => 'value', '#value' => TRUE);\n return system_settings_form($type .'_node_settings', $form);\n }\n else {\n $header = array(t('Type'), t('Operations'));\n\n $rows = array();\n foreach (node_get_types() as $type => $name) {\n $rows[] = array($name, l(t('configure'), 'admin/settings/content-types/'. $type));\n }\n\n return theme('table', $header, $rows);\n }\n}", "function theme_custom_teasers_views_node_sort_form($form) {\n $rows = array();\n $output = '';\n\n foreach (element_children($form['nodes']) as $key) {\n $row = array();\n\n $row[] = drupal_render($form['nodes'][$key]['nid']) . drupal_render($form['nodes'][$key]['title']);\n\n // Add an identifying CSS class to our weight field, as it's the one\n // the tabledrag.js will be controlling. This can be anything we want it to\n // be, we'll just tell the tabledrag.js library what it should look for.\n $form['nodes'][$key]['weight']['#attributes']['class'] = 'teasers-nodes-weight';\n $row[] = drupal_render($form['nodes'][$key]['weight']);\n\n $row[] = drupal_render($form['nodes'][$key]['operations']);\n\n // Add the new row to our collection of rows, and give it the 'draggable'\n // class, indicating that it should be... well, draggable.\n $rows[] = array(\n 'data' => $row,\n 'class' => 'draggable',\n );\n }\n\n // If there were no records found, note the fact so users don't get confused\n // by a completely empty table.\n if (count($rows) == 0) {\n $output = t('No teasers have been added to this teaser view.');\n }\n else {\n // Render a list of header titles, and our array of rows, into a table. Even\n // we've already rendered all of our records, we always call drupal_render()\n // on the form itself after we're done, so hidden security fields and other\n // elements (like buttons) will appear properly at the bottom of the form.\n $header = array(t('Title'), t('Weight'), t('Operations'));\n $output .= theme('table', $header, $rows, array('id' => 'teasers-nodes'));\n $output .= drupal_render($form);\n \n // Now that we've built our output, tell Drupal to add the tabledrag.js library.\n // We'll pass in the ID of the table, the behavior we want it to use, and the\n // class that appears on each 'weight' form element it should be controlling.\n drupal_add_tabledrag('teasers-nodes', 'order', 'self', 'teasers-nodes-weight');\n }\n\n return $output;\n}", "function theme_cirro_core_multi_img_weight_form($variables) {\n\n\t// Init\n\t$output = '';\n\t$rows = array();\n\n\t// Load form array\n\t$form = $variables['form'];\n\n\t// Activate tabledrag shiz\n\tdrupal_add_tabledrag('draggable-table', 'order', 'sibling', 'weight-group');\n\n\t// Loop through form Elements\n\tforeach ( element_children($form['imgs']) as $key ) {\n\n\t\t// Init\n\t\t$element = array();\n\t\t$data = '';\n\t\t$row = array();\n\n\t\t// Skip none numeric keys\n\t\tif ( !is_numeric($key) ) continue;\n\n\t\t// Load element\n\t\t$element = &$form['imgs'][$key];\n\n\t\t// Add class to weight field\n\t\t$element['weight']['#attributes']['class'] = array('weight-group');\n\n\t\t// Put data fields together\n\t\t$data .= drupal_render($element['id']);\n\t\t$data .= drupal_render($element['img_title']);\n\t\t$data .= drupal_render($element['img_alt']);\n\t\t$data .= drupal_render($element['data_fields']);\n\n\t\t// Wrap data fields for acc\n\t\t$data_wrapped = \"\n\t\t\t<div class=\\\"multi-tool-data-col\\\">\n\t\t\t\t<div class=\\\"multi-acc-button\\\">\n\t\t\t\t\t<i class=\\\"icon-chevron-down\\\"></i>\n\t\t\t\t\tshow details\n\t\t\t\t</div>\n\t\t\t\t<div class=\\\"multi-acc-content\\\">\n\t\t\t\t\t$data\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\";\n\n\t\t// Build row\n\t\t$row = array();\n\t\t$img_thumb = drupal_render($element['thumbnail']);\n\t\t$row[] = \"\n\t\t\t<div class=\\\"multi-tool-thumb-col\\\">\n\t\t\t\t$img_thumb\n\t\t\t</div>\n\t\t\";\n\t\t$row[] = $data_wrapped;\n\t\t$row[] = drupal_render($element['weight']);\n\t\t$row[] = drupal_render($element['delete_link']);\n\n\t\t// Add to rows\n\t\t$rows[] = array( 'data' => $row, 'class' => array('draggable'));\n\n\t}\n\n\t// Define headers\n\t$headers = array(\n\t\t'File',\n\t\t'Data',\n\t\t'Weight',\n\t\t'',\n\t);\n\n\t// Define table vars\n\t$table_vars = array(\n\t\t'header' => $headers,\n\t\t'rows' => $rows,\n\t\t'attributes' => array(\n\t\t\t'id' => 'draggable-table',\n\t\t\t'class' => array(\n\t\t\t\t'table',\n\t\t\t\t'table-bordered',\n\t\t\t\t'table-striped'\n\t\t\t),\n\t\t),\n\t\t'caption' => 'Drag and Drop to change order',\n\t\t'colgroups' => array(),\n\t\t'sticky' => FALSE,\n\t\t'empty' => 'No Images found',\n\t);\n\n\t// Add table to output\n\t$output = theme_table($table_vars);\n\n\t// Render remaining form elements\n\t$output .= drupal_render_children($form);\n\n\treturn $output;\n\n}", "function social_stats_content_types_form() {\n $node_types = node_type_get_types();\n $i = 0;\n foreach ($node_types as $types) {\n $form['social_stats'][$i] = array(\n '#type' => 'fieldset',\n '#title' => $types->name,\n '#collapsible' => TRUE,\n '#collapsed' => FALSE,\n );\n $form['social_stats'][$i]['social_stats_' . $types->type] = array(\n '#type' => 'checkboxes',\n '#options' => drupal_map_assoc(array(\n t('Facebook'),\n t('Twitter'),\n t('Google Plus'),\n t('LinkedIn'),\n )),\n '#default_value' => variable_get('social_stats_' . $types->type, array(0)),\n );\n $i++;\n }\n return system_settings_form($form);\n}", "function casetracker_settings() {\n ctools_include('export');\n $templates = ctools_export_load_object('casetracker_templates', 'all');\n $node_types = node_get_types('names');\n $settings = variable_get('casetracker_case_node_types', array());\n\n $options = array('' => t('--Disabled--'));\n foreach ($templates as $v) {\n $options[$v->name] = $v->name;\n }\n\n $form['types'] = array('#tree' => true);\n foreach ($node_types as $k => $v) {\n $form['types'][$k] = array(\n '#type' => 'select',\n '#title' => $v,\n '#options' => $options,\n '#default_value' => $settings[$k],\n );\n }\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Submit'),\n );\n return $form;\n}", "function _shivanode_data_form() {\r\n global $base_root, $base_path;\r\n \r\n drupal_set_title(t('Choose Your Data'));\r\n \r\n // Get path arguments\r\n $args = arg();\r\n $type = (isset($args[1])) ? $args[1] : FALSE; \r\n $ctype = (isset($args[2])) ? $args[2] : FALSE;\r\n \r\n\t// Determine whether format=simple, if it is in the popup.\r\n $isSimple = (isset($_GET['format']) && $_GET['format'] == 'simple') ? TRUE : FALSE;\r\n\t\r\n // Set display strings\r\n if(!preg_match('/' . strtolower(SHIVA_DATA_VISUALIZATIONS) . '/', strtolower($type))) { $type = FALSE; }\r\n $sntypelabel = ($type) ? ucfirst($type) : t('Charts, Images, Networks, and Timeline');\r\n if($ctype) { $sntypelabel = ucfirst($ctype); }\r\n \r\n // Set Base Url\r\n /*\r\n $baseurl = url('node/add/shivanode');\r\n if($type) {\r\n $baseurl .= $type; // had '/nd/' . prefixed\r\n if($ctype) {\r\n $baseurl .= '/' . $ctype;\r\n }\r\n }*/\r\n \r\n // Create Form\r\n $cls = ($isSimple) ? 'simple-data-form' : '';\r\n\t$page = array();\r\n $page['#prefix'] = '<div id=\"data-element-page\">';\r\n $page['#attributes'] = array('class' => array($cls));\r\n $page['#suffix'] = '</div>';\r\n \r\n $page['isPop'] = array(\r\n '#type' => 'hidden',\r\n '#value' => (isset($_GET['format']) && $_GET['format'] == 'simple')? 1 : 0,\r\n );\r\n /*\r\n $form['did'] = array(\r\n '#type' => 'hidden',\r\n );\r\n \r\n $form['dtitle'] = array(\r\n '#type' => 'hidden',\r\n );\r\n \r\n $form['dtype'] = array(\r\n '#type' => 'hidden',\r\n );\r\n \r\n $form['vtype'] = array(\r\n '#type' => 'hidden',\r\n '#value' => $type,\r\n );\r\n \r\n $form['ctype'] = array(\r\n '#type' => 'hidden',\r\n '#value' => $ctype,\r\n );*/\r\n\t\r\n\t// if ?format=simple then it's in the popup chooser within form so don't add skip button\r\n\tif (!$isSimple) {\r\n\t\t$skiplink = url(\"node/add/shivanode/nd/$type\");\r\n\t\tif ($ctype) { $skiplink .= \"/$ctype\"; }\r\n\t $page['skip'] = array(\r\n\t '#markup' => '<p> ' . l(t('Skip this step!'), $skiplink) . '</p>',\r\n\t );\r\n\t}\r\n\t\r\n $page['p'] = array(\r\n '#type' => 'markup',\r\n '#markup' => t('<p>@type visualizations require data in the form of a Google Spreadsheet or simple CSV spreadsheet file. Below is a list of all the spreadsheets you have registered with this site as well as all the spreadsheets in your Google Drive account. Press the visualization button next to the desired data set to begin to create a visualization base on it.</p><p>If you want to switch Google Drive accounts, make sure your browser is logged into the new account, then <a href=\"@reauthlink\">click here</a>.</p>', array(\r\n '@type' => $sntypelabel, \r\n '@reauthlink' => url('gdrive/reauth')\r\n )),\r\n );\r\n \r\n // Add help link\r\n $link = _shivanode_get_help_link($sntypelabel, t('@type visualization type', array('@type' => $sntypelabel)));\r\n if ($link != '') {\r\n $page['help'] = array(\r\n '#type' => 'markup',\r\n '#markup' => '<p>' . t('For a description of how to format a spreadsheet, see the documentation for the ') . $link . '.</p>',\r\n );\r\n }\r\n \r\n // List GDocs\r\n // Call _shivanode_gdocs_view function to get HTML list of spreadsheets from view, tweak it and insert in this form\r\n $viewmarkup = _shivanode_gdocs_view($type, $ctype, $isSimple);\r\n $page['addedview'] = array(\r\n '#type' => 'markup',\r\n '#markup' => $viewmarkup,\r\n //'#prefix' => '<div class=\"\"'\r\n );\r\n \r\n // If not logged in show authorization button\r\n if (!_shivanode_check_google_login(FALSE)) {\r\n $page['spreadsheets'] = array(\r\n '#type' => 'markup',\r\n '#prefix' => '<div>',\r\n '#suffix' => '</div>',\r\n );\r\n $page['spreadsheets']['instructions'] = array(\r\n '#type' => 'markup',\r\n '#markup' =>'<p>' . t('To view spreadsheets in your Google Drive account you must give permission for this site to have read-only access to your Google Drive. To do so, you need to visit the <a href=\"@authpage\">Authorization Page</a>.', array('@authpage' => url('gdrive/auth'))) . '</p>',\r\n );\r\n }\r\n return $page;\r\n}", "function custom_teasers_views_overview_form(&$form_state) {\n $items = custom_teasers_views_load_all();\n\n $form['items']['#tree'] = TRUE;\n foreach ($items as $name => $item) {\n $form['items'][$name] = _custom_teasers_views_overview_item_field($item);\n }\n\n return $form;\n}", "function template_preprocess_ds_display_overview_form(&$vars) {\n $form = &$vars['form'];\n\n $layout = $form['#layout'];\n $build_mode = $form['#build_mode'];\n $regions = ds_regions(variable_get('ds_build_mode_'. $build_mode, 'all'), $layout == 'tabledrag' ? FALSE : TRUE);\n\n // Determine which css and js to load.\n $vars['dev_preview'] = '<p>'. l('Table drag style', $_GET['q']) .' - '. l('Dashboard style', $_GET['q'], array('query' => array('layout' => '1'))) .'</p>';\n _template_preprocess_ds_display_overview_form($vars, $regions, $layout);\n\n // Order the fields.\n $order = array();\n foreach ($form['#fields'] as $key => $field) {\n $order[$field] = $form[$field]['ds_weight']['#default_value'];\n }\n asort($order);\n\n $rows = array();\n foreach ($order as $key => $field) {\n $element = &$form[$key];\n $row = new stdClass();\n\n // Each field will have a region, store it temporarily\n $region = $element[$build_mode]['region']['#default_value'];\n\n // Add field_id key\n $row->field_id = $key;\n\n foreach (element_children($element) as $child) {\n\n // Render the display fields\n if ($child == $build_mode) {\n $row->{$child}->label = drupal_render($element[$child]['label']);\n $row->{$child}->label_edit = drupal_render($element[$child]['label_edit']);\n $row->{$child}->label_value = drupal_render($element[$child]['label_value']);\n $row->{$child}->format = drupal_render($element[$child]['format']);\n $row->{$child}->region = drupal_render($element[$child]['region']);\n }\n // Render the rest of the fields\n else {\n // Process weight.\n if ($child == 'ds_weight') {\n $element['ds_weight']['#attributes']['class'] = 'field-weight field-weight-'. $region;\n $element['ds_weight'] = process_weight($element['ds_weight']);\n }\n $row->{$child} = drupal_render($element[$child]);\n }\n }\n\n // Add draggable.\n if ($layout == 'tabledrag') {\n $row->class = 'draggable';\n if ($region == 'disabled') {\n $row->class .= ' region-css-'. $region;\n }\n }\n\n $row->label_class = 'label-field';\n $rows[$region][] = $row;\n }\n\n // Plugins available.\n $vars['plugins_tabs'] = array();\n $vars['plugins_content'] = '';\n if ($form['#plugins'] == TRUE) {\n foreach ($form['#plugin_keys'] as $key => $title) {\n $vars['plugins_tabs'][$key] = $title;\n $vars['plugins_content'][$key] = drupal_render($form[$key]);\n }\n }\n\n $vars['rows'] = $rows;\n $vars['submit'] = drupal_render($form);\n $vars['regions'] = $regions;\n $vars['build_mode'] = $build_mode;\n}", "function node_filter_form() {\n $session = &$_SESSION['node_overview_filter'];\n $session = is_array($session) ? $session : array();\n $filters = node_filters();\n\n $i = 0;\n $form['filters'] = array(\n '#type' => 'fieldset',\n '#title' => t('Show only items where'),\n '#theme' => 'node_filters',\n );\n $form['#submit'][] = 'node_filter_form_submit';\n foreach ($session as $filter) {\n list($type, $value) = $filter;\n if ($type == 'category') {\n // Load term name from DB rather than search and parse options array.\n $value = module_invoke('taxonomy', 'get_term', $value);\n $value = $value->name;\n }\n else if ($type == 'language') {\n $value = empty($value) ? t('Language neutral') : module_invoke('locale', 'language_name', $value);\n }\n else {\n $value = $filters[$type]['options'][$value];\n }\n if ($i++) {\n $form['filters']['current'][] = array('#value' => t('<em>and</em> where <strong>%a</strong> is <strong>%b</strong>', array('%a' => $filters[$type]['title'], '%b' => $value)));\n }\n else {\n $form['filters']['current'][] = array('#value' => t('<strong>%a</strong> is <strong>%b</strong>', array('%a' => $filters[$type]['title'], '%b' => $value)));\n }\n if (in_array($type, array('type', 'language'))) {\n // Remove the option if it is already being filtered on.\n unset($filters[$type]);\n }\n }\n\n foreach ($filters as $key => $filter) {\n $names[$key] = $filter['title'];\n $form['filters']['status'][$key] = array('#type' => 'select', '#options' => $filter['options']);\n }\n\n $form['filters']['filter'] = array('#type' => 'radios', '#options' => $names, '#default_value' => 'status');\n $form['filters']['buttons']['submit'] = array('#type' => 'submit', '#value' => (count($session) ? t('Refine') : t('Filter')));\n if (count($session)) {\n $form['filters']['buttons']['undo'] = array('#type' => 'submit', '#value' => t('Undo'));\n $form['filters']['buttons']['reset'] = array('#type' => 'submit', '#value' => t('Reset'));\n }\n\n drupal_add_js('misc/form.js', 'core');\n\n return $form;\n}", "public function buildForm()\n {\n $this->addSelect('default_flow_type', $this->getCodeList('FlowType', 'Activity'), trans('elementForm.default_flow_type'), $this->addHelpText('Activity_DefaultFlowType-code'), null, true);\n }", "private function prepareWeight() {\n $result = $this->getValuesForSelectorSetting(WooCommerceSettings::WC_WEIGHT_SELECTORS, 'text', false, true, true);\n if (!$result) return;\n\n $this->wcData->setWeight($result);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the value of picture_url
public function getPicture_url() { return $this->picture_url; }
[ "public function getPicUrl()\n {\n return $this->picUrl;\n }", "public function getPictureURL()\n {\n return $this->pictureURL;\n }", "public function getPictureUrl()\n {\n $user = $this->getOauthUser();\n return $user['pic_url'];\n }", "public function getPicUrl()\n {\n return $this->gift->getPicUrl();\n }", "public function getExternalPictureURL()\n {\n return $this->externalPictureURL;\n }", "public function getUrlImg()\n {\n return $this->urlImg;\n }", "public function getAvatar_url_imagen()\n {\n return $this->avatar_url_imagen;\n }", "public function get_image_src(){\r\n\t\t$this->init();\r\n\t\treturn $this->cache['url'];\r\n\t}", "public function getUrlImg(): string\n {\n return $this->url_img;\n }", "public function getPicture()\r\n {\r\n return $this->picture;\r\n }", "public function getProfilePicUrl()\n {\n return $this->profilePicUrl;\n }", "public function getImageUrl()\n {\n return $this->image['url'];\n }", "public function getLinkPic()\n {\n return $this->link_pic;\n }", "public function getProfilePictureURL() {\n //if img src is from google+\n if (substr($this->_imageSrc, 0, 4) == 'http') {\n return $this->_imageSrc;\n }\n //if img is from local folder\n else {\n return \"../static/img/profile/users/\" . $this->_imageSrc;\n }\n }", "public function getCardImgUrl()\n {\n $value = $this->get(self::CARDIMGURL);\n return $value === null ? (string)$value : $value;\n }", "public function getProfPic() {\n $response = $this->getRequest(\"me\");\n $response = json_decode($response->getBody()->getContents());\n \n if (count($response->{\"images\"}) == 0) {\n return null;\n } else {\n return $response->{\"images\"}[0]->{\"url\"};\n }\n }", "public function getPicture(){\n return $this->profile->picture;\n }", "public function getSource_picture()\n {\n return $this->source_picture;\n }", "public function getUrlImagem()\n {\n return $this->urlImagem;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Main method for downloading image by $imageUrl and save it to the directory $dir
public function download($imageUrl, $dir){ $imageInstance = $this->createImageInstance($imageUrl); if(!$imageInstance->getFileExists()){ throw new \Exception('File not exists!'); } $imageValidator = new ImageValidator(['jpg', 'png', 'gif']); if(!$imageValidator->validate($imageInstance)){ throw new \Exception('Not allowed file format!'); } $imageSaver = $this->createImageSaver($dir); return $imageSaver->save($imageInstance); }
[ "private function saveImageFromUrl($url)\n\t{\n\t $ch = curl_init($url);\n\t $fp = fopen($this->image, 'wb');\n\t curl_setopt($ch, CURLOPT_FILE, $fp);\n\t curl_setopt($ch, CURLOPT_HEADER, 0);\n\t curl_exec($ch);\n\t curl_close($ch);\n\t fclose($fp);\n\t}", "public function saveImageFromWeb($url, $dir = __DIR__ . '/../img/screen.png')\n {\n copy($url, $dir);\n }", "private function downloadImage($filename)\r\n {\r\n $filepath=$this->dirImages.\"/\".$filename;\r\n if(!is_file($filepath))\r\n {\r\n echo \"file doesn't exists\";\r\n exit();\r\n }\r\n $this->outputImageForDownload($filepath, $filename);\r\n\r\n }", "function downloadImage()\n\t{\n\t\tif ($this->isTvShowChanged==true){\n\t\t $fp = fopen ($this->outputFile, 'w+'); // open file handle\n\t\t $ch = curl_init($this->posterUrl);\n\t\t // curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // enable if you want\n\t\t curl_setopt($ch, CURLOPT_FILE, $fp); // output to file\n\t\t curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n\t\t curl_setopt($ch, CURLOPT_TIMEOUT, 1000); // some large value to allow curl to run for a long time\n\t\t curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0');\n\t\t // curl_setopt($ch, CURLOPT_VERBOSE, true); // Enable this line to see debug prints\n\t\t curl_exec($ch);\n\t\t curl_close($ch); // closing curl handle\n\t\t fclose($fp); // closing file handle\n\t\t}\n\t}", "public function download(): string {\n $url = $this->normalizeUrl($this->classicImageUrl);\n $fileData = file_get_contents($url);\n if(!is_dir(TARGET_CLASSIC_IMAGES_STORAGE)) {\n mkdir(TARGET_CLASSIC_IMAGES_STORAGE);\n }\n $filename = $this->normalizeFilename($this->findFilename($url));\n $this->image = uniqid() . $this->findExtension($filename);\n file_put_contents(TARGET_CLASSIC_IMAGES_STORAGE . DIRECTORY_SEPARATOR. $this->image, $fileData);\n return $this->image;\n }", "public function fetchFile ($url, $directory = NULL) {\n if (!isset($directory)) {\n $directory = sys_get_temp_dir() . '/noapi';\n }\n \n \n if (! is_dir($directory)) mkdir($directory, 0755, true);\n if (! is_writable($directory)) die('The cache/img directory is not writable.' . PHP_EOL);\n \n $fileName = self::fileName($url, $directory);\n \n if (! is_file($fileName)) {\n $image = file_get_contents($url);\n if (file_put_contents($fileName, $image) === false) return ;\n }\n \n return $fileName; \n\n }", "private function downloadImage($image) {\n\n if($image == \"\")\n return \"\";\n\n // Construct the download link\n $download_link = $this->setLink($this->apiLinks[\"images_download\"], \"\", $image);\n\n // Checks if the path already exists or create one\n $path = dirname(__FILE__) . \"/../../../../../web/img/episodes/thetvdb/\". $image;\n if (!file_exists(dirname($path))) {\n mkdir(dirname($path), 0777, true);\n }\n\n // Output Path\n $output = $path;\n\n // Check if the image as been already downloaded, download it if it wasnt\n if(!file_exists($output))\n file_put_contents($output, file_get_contents($download_link));\n\n\n // Construct a valid address for the img\n $output = '/img/episodes/thetvdb/'. $image;\n\n return $output;\n }", "private function downloadImage(){\n\t\t$workflowfile = $this->getWorkflowFilename(self::WORKFLOW_IMAGE_EXTENSION);\n\t\t$this->doDownloadFile($workflowfile, $this->buildImageUrl());\n\t\t$img = imagecreatefrompng($workflowfile);\n\t\tlist($width, $height) = getimagesize($workflowfile);\n\t\t$newHeight = ($height / $width) * self::WORKFLOW_IMAGE_SIZE;\n\t\t$tmp = imagecreatetruecolor(self::WORKFLOW_IMAGE_SIZE, $newHeight);\n\t\timagealphablending($tmp, false);\n\t\timagesavealpha($tmp,true);\n\t\timagecopyresampled($tmp, $img, 0, 0, 0, 0, self::WORKFLOW_IMAGE_SIZE, $newHeight, $width, $height);\n\n\t\t$mailimage = $this->getWorkflowFilename(self::WORKFLOW_SMALL_IMAGE_EXTENSION);\n\t\tif (file_exists($mailimage)) {\n\t\t\tunlink($mailimage);\n\t\t}\n\t\timagepng($tmp, $mailimage);\n\t\tchmod($mailimage, 0644);\n\t}", "public\n function saveImage(){\n $srcs = $this->srcs; \n $count2 = count($srcs);\n for($r=0;$r<= $count2-1;$r++ ){\n echo $srcs[$r];\n $ch = curl_init($srcs[$r]);\n $fp = fopen($this->saveFolder . $r .\".\" . $this->imageTypes[$r], 'wb');\n curl_setopt($ch, CURLOPT_FILE, $fp);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_exec($ch);\n curl_close($ch);\n fclose($fp);\n }\n }", "public function save()\n {\n $image = $this->transformImage(\\Image::forge(null, $this->_image->file()));\n\n $destination = APPPATH.$this->url(false);\n $dir = dirname($destination);\n\n if (!is_dir($dir)) {\n if (!@mkdir($dir, 0755, true)) {\n error_log(\"Can't create dir \".$dir);\n exit(\"Can't create dir \".$dir);\n }\n }\n $image->save($destination);\n return $destination;\n }", "function saveImage(){\n $srcs = $this->srcs; \n $count2 = count($srcs);\n for($r=0;$r<= $count2-1;$r++ ){\n echo $srcs[$r];\n $ch = curl_init($srcs[$r]);\n $fp = fopen($this->saveFolder . $r .\".\" . $this->imageTypes[$r], 'wb');\n curl_setopt($ch, CURLOPT_FILE, $fp);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_exec($ch);\n curl_close($ch);\n fclose($fp);\n }\n\n }", "function curlImage ( $url, $saveto )\n{\n $ch = curl_init( $url );\n curl_setopt( $ch, CURLOPT_HEADER, 0 );\n curl_setopt( $ch, CURLOPT_VERBOSE, false );\n curl_setopt( $ch, CURLOPT_BINARYTRANSFER, 1 );\n curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );\n curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );\n curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );\n $raw = curl_exec( $ch );\n curl_close( $ch );\n if ( file_exists( $saveto ) ) {\n unlink( $saveto );\n }\n $fp = fopen( $saveto, 'x' );\n fwrite( $fp, $raw );\n fclose( $fp );\n}", "function save_image($img,$fullpath){\n $ch = curl_init ($img);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_BINARYTRANSFER,1);\n $rawdata=curl_exec($ch);\n curl_close ($ch);\n if(file_exists($fullpath)){\n unlink($fullpath);\n }\n $fp = fopen($fullpath,'x');\n fwrite($fp, $rawdata);\n fclose($fp);\n}", "public function download()\n {\n $basedir = dirname($this->fileName);\n foreach ($this->data as $fetch) {\n $filename = $basedir . '/' . $fetch['filename'];\n if (! file_exists($filename)) {\n $this->_downloadFile($fetch['url'], $filename);\n }\n }\n }", "private function save_remote_image($url) {\n $name = array_pop(explode(\"/\", $url));\n $data = file_get_contents($url);\n $file = $this->app->config('thumb_path') . \"/$name\";\n\n $hand = fopen($file, 'w+');\n fwrite($hand, $data);\n fclose($hand);\n chmod($file, 0777);\n\n return $name;\n }", "public function getFileFromUrl($url)\n {\n $posterImgFile = file_get_contents($url);\n\n $posterFileName = uniqid() . '.jpg';\n\n file_put_contents($this->getUploadRootDir() . $posterFileName, $posterImgFile);\n\n $this->setName($posterFileName);\n\n $this->updatedAt = new \\DateTimeImmutable();\n }", "function twitpic_download($url, $path, $mime_type = 'image/jpeg')\n{\n if (OFFLINE) {\n return \"Can't download '$url' to '$path' because in OFFLINE mode.\";\n }\n\n $commands = get_commands();\n $wget = $commands['wget'];\n $convert = $commands['convert'];\n $gunzip = $commands['gunzip'];\n $grep = $commands['grep'];\n $cut = $commands['cut'];\n $xargs = $commands['xargs'];\n\n // fetch html from twitpic and grep the image file url to STDOUT\n $cmd = \"$wget --user-agent='' --verbose -t 3 -T 7 -O- %s | $gunzip -c | $grep 'img src=' | $cut -d '\\\"' -f 2 | $xargs\";\n\n // wget args to sprintf to fetch a url and save as a file\n // remove if zero-byte file because wget will just skip otherwise\n if (file_exists($path) && 0 === filesize($path)) {\n unlink($path);\n }\n\n // fetch the file\n $fetch_url = sprintf($cmd, escapeshellarg($url));\n if (VERBOSE) {\n debug(\"Fetching URL from twitpic: $fetch_url\");\n }\n $results = shell_execute($fetch_url);\n\n // check the STDOUT is valid\n if (empty($results['stdout'])) {\n return false;\n }\n $url = trim($results['stdout']);\n debug($url);\n\n // download directly\n $results = url_download($url, $path);\n if (true !== $results) {\n return $results;\n }\n\n // at this point we have the file, finally\n // convert if wrong file type for extension\n $type = mime_content_type($path);\n if ($mime_type !== $type) {\n debug(sprintf(\"Convert-ing file from '%s' to '%'\", $type, $mime_type));\n // as long as the extension is correct, convert will convert incorrect image format by extension\n // i.e. a PNG with extension JPG will be converted to JPG by doing 'convert file.jpg file.jpg'\n $file_convert = sprintf(\n '%s %s %s', $convert, escapeshellarg($path), escapeshellarg($path)\n );\n $results = shell_execute($file_convert);\n if (false === $results) {\n return false;\n } elseif (is_array($results)) {\n debug('Results:', $results);\n }\n }\n\n return true;\n}", "function download_thumb() {\n $sess = $this->session->all_userdata();\n $fileName = @$_GET['fileName'];\n $redirect_url = @$_GET['redirect_url'];\n $fullPath = REAL_PATH . serverImageRelPath . $fileName;\n $downloadResult = $this->_downloadFile($fileName, $fullPath);\n if (!$downloadResult) {\n $msg = $this->loadPo($this->config->item('error_file_found'));\n $this->log($this->user, $msg);\n $this->session->set_flashdata('message', $this->_errormsg($msg));\n redirect($redirect_url);\n }\n }", "public function save_image_to_folder($image)\n\t\t {\n\t\t\t$images_arr = json_decode($image, true);\n\t\t\textract($images_arr);\n\t\t\t$entry = base64_decode($photo);\n\t\t\t$image = imagecreatefromstring($entry);\n\t\t\t$directory = dirname(__FILE__).DIRECTORY_SEPARATOR.\"/\".$folder.\"/\".DIRECTORY_SEPARATOR.\"\".$title.\".jpg\";\n\t\t\theader ( 'Content-type:image/jpg' ); \n\t\t\timagejpeg($image, $directory);\n\t\t\timagedestroy ( $image ); \n\t\t\treturn 0;\n\t\t }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a database for this environment on a given DatabaseInstance.
public function createDatabase(DatabaseInstance $databaseInstance) { $database = $databaseInstance->databases()->create([ 'name' => $this->slug(), ]); $this->database()->associate($database); $this->save(); $database->provision(); }
[ "public function createDatabase()\n {\n\n try {\n // clone the connection and load the database name\n $connection = clone $this->getEntityManager()->getConnection();\n $dbname = $connection->getDatabase();\n // remove the the database name\n $params = $connection->getParams();\n if (isset($params[SchemaProcessorInterface::PARAM_DBNAME])) {\n unset($params[SchemaProcessorInterface::PARAM_DBNAME]);\n }\n // create a new connection WITHOUT the database name\n $cn = DriverManager::getConnection($params);\n $sm = $cn->getDriver()->getSchemaManager($cn);\n // SQLite doesn't support database creation by a method\n if ($sm instanceof SqliteSchemaManager) {\n return;\n }\n // query whether or not the database already exists\n if (!in_array($dbname, $sm->listDatabases())) {\n $sm->createDatabase($dbname);\n }\n } catch (\\Exception $e) {\n \\error($e);\n }\n }", "public function createDatabase() {\n\t\tglobal $mwtSQLTemplate;\n\t\tUtilities::createAndImportDatabase( $this->dbname, $mwtSQLTemplate );\n\t}", "public function createDatabase() {\n $database = $this->getMachineName('What is the name of the database? This ideally will match the site directory name. No special characters please.');\n $this->connectAcquiaApi();\n $this->say('<info>' . $this->acquiaDatabases->create($this->appId, $database)->message . '</info>');\n }", "public function createDatabase();", "public function createDatabase($database);", "public function createDatabase () {\n\t\t$db = $this->connectWithoutDbname();\n\t\t$setupdb->exec('CREATE DATABASE IF NOT EXISTS ' . $this->dbname);\n\t\t$db = null;\n\t}", "public function createDatabase(string $database);", "private function createDatabaseInstance() {\n return new Database([\n 'username' => $this->getConfig('database.username'),\n 'password' => $this->getConfig('database.password'),\n 'database' => $this->getConfig('database.database'),\n 'host' => $this->getConfig('database.host'),\n 'port' => $this->getConfig('database.port'),\n ]);\n }", "private function _create_db()\n {\n if(!is_object($this->db))\n $this->db = Pi_db::singleton();\n }", "public function createDatabase(): Database {\n $moduleBaseName = 'Database';\n if (! $this->isTestMode()) {\n $moduleName = $moduleBaseName . 'Mysql';\n } else {\n $moduleName = $moduleBaseName . 'Test';\n }\n $object = $this->createModule($moduleName, $moduleBaseName);\n return $object;\n }", "private static function _create_db()\n {\n $query = \"CREATE DATABASE IF NOT EXISTS `\" . self::$configuration['connection']['database'] . \"` CHARACTER SET \" . self::DEFAULT_DB_CHARSET . \" COLLATE \" . self::DEFAULT_DB_COLLATION;\n\n if (!self::$primary_connection->query($query))\n throw new Model_DALM_UNABLE_TO_CREATE_REQUIRED_DATABASE_Exception;\n }", "private function createDataBase()\n {\n try {\n $statement = \"CREATE DATABASE IF NOT EXISTS \" . $this->dbName;\n $query = $this->pdoConnection->prepare($statement);\n $query->execute();\n } catch (\\PDOException $e) {\n }\n }", "function new_db_instance() {\n return new Database(DB_HOST, DB_PORT, DB_NAME, DB_USER, DB_PWD); \n }", "public function createDatbase()\r\n\t{\r\n\t\t$db = \\DB::statement('CREATE DATABASE IF NOT EXISTS '.$this->schema);\r\n\t}", "public function createDatabase()\r\n {\r\n try {\r\n $this->conn->exec(\"CREATE DATABASE IF NOT EXISTS $this->db\");\r\n } catch (PDOException $e) {\r\n echo $e->getMessage();\r\n }\r\n\r\n }", "private function createDatabase(): void\n {\n $em = $this->entityManager;\n $metadata = $em->getMetadataFactory()->getAllMetadata();\n\n $schemaTool = new SchemaTool($em);\n $schemaTool->createSchema($metadata);\n }", "private function setupDatabase()\n {\n try {\n $db = new PDO(sprintf('mysql:host=%s;dbname=%s', $this->host, $this->dbName), $this->userName, $this->password);\n\n } catch (PDOException $e) {\n\n if (false != strpos($e->getMessage(), 'Unknown database')) {\n $db = new PDO(sprintf('mysql:host=%s', $this->host), $this->userName, $this->password);\n $db->exec(\"CREATE DATABASE IF NOT EXISTS `$this->dbName` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;\") or die(print_r($db->errorInfo(), true));\n\n } else {\n die('DB ERROR: ' . $e->getMessage());\n }\n\n $db = new PDO(sprintf('mysql:host=%s;dbname=%s', $this->host, $this->dbName), $this->userName, $this->password);\n }\n $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n return $db;\n }", "protected function bootDatabase()\r\n {\r\n $this->database = $this->make('Sun\\Contracts\\Database\\Database');\r\n\r\n $this->database->boot();\r\n\r\n $this->db = $this->database->getCapsuleInstance();\r\n }", "public function testDatabaseCreate( )\n {\n $db = $this->_getdb();\n \n $dbname = 'wp_phpunit' . rand( 0, 9999 ); /* Randomize? */\n $mysql = $db->get_mysql();\n\n $ret = $db->create( $dbname, $mysql->dbuser, $mysql->dbpasswd, $mysql->dbhost );\n $this->assertNotFalse( $ret );\n\n // Now get a list of databases and make sure our database has been created\n $dblist = $db->get_list();\n\n $dbidx = array_search( $dbname, $dblist );\n $this->assertNotFalse( $dbidx );\n\n return $dbname;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determines the ottava rima fitness of a poem stanza.
function ottava_rima_fitness($stanza, $delimiter = "\n", $syllable_tolerance = 2) { if (!is_string($stanza)) { throw new InvalidArgumentException('The stanza must be a string.'); } if (!is_string($delimiter)) { throw new InvalidArgumentException('The delimiter must be a string.'); } // Score starts at 0. $score = 0; // Separate the stanza into lines. $lines = explode($delimiter, trim($stanza)); // Ensure there are the correct amount of lines. if (count($lines) !== 8) { $score += abs(8 - count($lines)) * 20; // Ensures there are at most 8 lines. array_splice($lines, 8); // If there are less than 8, add on blank lines. for ($i = count($lines); $i < 8; $i++) { $lines[] = ''; } } $min_syllable_count = 10 - $syllable_tolerance; $max_syllable_count = 10 + $syllable_tolerance; $last_words = array(); foreach ($lines as $line) { // Adapted from: // http://stackoverflow.com/questions/790596/split-a-text-into-single-words // This will split on a group of one or more whitespace characters, but also suck in any surrounding // punctuation characters. It also matches punctuation characters at the beginning or end of the string. // This discriminates cases such as "don't" and "he said 'ouch!'" $line_words = preg_split('/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/', $line, -1, PREG_SPLIT_NO_EMPTY); // Ottava rima poems should be iambic pentameter, so we need to make sure there are 10 syllables. // We're not going to make sure it's da-DUM da-DUM da-DUM da-DUM da-DUM, even though it should be. $syllable_count = 0; foreach ($line_words as $line_word) { $syllable_count += estimate_syllables($line_word); } if ($syllable_count < $min_syllable_count && $syllable_count > $max_syllable_count) { $score += abs(10 - $syllable_count); if (OTTAVA_RIMA_FITNESS_DEBUG) { echo "'" . implode(' ', $line_words) . "' was estimated to have $syllable_count syllable(s).\n"; } } // Get the last words for rhyme detection. $last_words[] = count($line_words) > 0 ? last($line_words) : ''; } // Determine whether the a, b, and c rhymes match. list($a1, $b1, $a2, $b2, $a3, $b3, $c1, $c2) = $last_words; $score += !does_rhyme($a1, $a2) * 20; $score += !does_rhyme($a1, $a3) * 20; $score += !does_rhyme($a2, $a3) * 20; $score += !does_rhyme($b1, $b2) * 20; $score += !does_rhyme($b1, $b3) * 20; $score += !does_rhyme($b2, $b3) * 20; $score += !does_rhyme($c1, $c2) * 20; return max(0, 200 - $score); }
[ "public function fitness(): Fitness;", "abstract public function fitness( Member $member) : float;", "public abstract function fitness_function($goal = null);", "public function getFitness()\n {\n return $this->fitness;\n }", "public function getFitness();", "public function fitness(): float {\n return 6 * $this->x - $this->x * $this->x + 4 * $this->y - $this->y * $this->y;\n }", "public function getPopulationFitness()\n {\n return $this->populationFitness;\n }", "public function fitness($x) {\r\n //Reset the fitness to zero, since we dont yet know what it is.\r\n $this->fitness[$x] = 0;\r\n //Turn the array into a string, so we can evaluate it.\r\n $equation = implode('', $this->chromo[$x]);\r\n //Add a return statement so the eval returns an answer.\r\n $equation = \"return \" . $equation . \";\";\r\n //Run the equation like it was a php snippet, return anwser to $answer.\r\n $answer = eval($equation);\r\n\r\n //If resulting answer is equal to the desired result, make the fitness almost perfect.\r\n if ($answer == $this->seed[sizeof($this->seed) - 1])\r\n $this->fitness[$x] = 90;\r\n //If the answer recieved is less than the desired result, give it a moderate fitness\r\n //based on the distance from the desired result.\r\n else if ($answer < $this->seed[sizeof($this->seed) - 1])\r\n $this->fitness[$x] = ($answer * 50) / $this->seed[sizeof($this->seed) - 1];\r\n //If the chromosome size is the smallest possible give it an additional 10 fitness. \r\n //This is meant to reward shortest answers, however how do we know the shortest?\r\n if (sizeof($this->chromo[$x]) <= 3)\r\n $this->fitness[$x] += 10;\r\n //Otherwise we add on some additional fitness which scales by the size of the\r\n //current equation, less length = more fitness.\r\n else\r\n $this->fitness[$x] += $this->rep / sizeof($this->chromo[$x]);\r\n //If fitness is perfect. Preserve this perfect specimen.\r\n if ($this->fitness[$x] == 100)\r\n $this->preserved[] = $this->chromo[$x];\r\n //If it is 90 or higher, preserve it from further mutation.\r\n else if ($this->fitness[$x] > 90)\r\n $this->preserve[$x] = true;\r\n //Otherwise make sure it is not preserved.\r\n else\r\n $this->preserve[$x] = false;\r\n\r\n return $this->fitness[$x];\r\n }", "public function getMedianFitness(): float;", "public function run(): Chromosome {\n list($best, $avg) = $this->_bestAndAvgByFitness();\n for ($i = 0; $i < $this->_maxGenerations; $i++) {\n // Early exit if we beat threshold\n if ($best->fitness() >= $this->_threshold) {\n return $best;\n }\n Util::out(\n sprintf(\n \"Generation: %d, Best: %f, Average: %f\",\n $i,\n $best->fitness(),\n $avg\n )\n );\n $this->reproduceAndReplace();\n $this->mutate();\n list($highest, $avg) = $this->_bestAndAvgByFitness();\n if ($highest->fitness() > $best->fitness()) {\n $best = $highest; // Found a new best\n }\n }\n return $best; // Best we found in $this->_maxGenerations\n }", "abstract public function evaluateFitness(): void;", "public function calculate_fitness(){\n\t\t//empty fitness array\t\t\n\t\t$this->fitness = array();\n\t\t$this->types = array(0,0,0,0);\n\t\t$best_fitness = 0;\n\t\t\n\t\tmysql_connect(\"localhost\",$this->username,$this->password);\n\t\t@mysql_select_db($this->database) or die( \"Unable to select database\");\n\t\t\n\t\t//First, we fetch all the offsprings,\n\t\tforeach($this->indivs as $key=>$indiv){\t\t\t\n\t\t\t\n\t\t\t$query = \"SELECT * from $this->table\".\"_antigate\".\" where geno_id=$key\";\n\t\t\t$result = mysql_query($query);\n\t\t\tif (!$result) {\n\t\t\t echo \"Could not successfully run query 12 ($query) from DB: \" . mysql_error();\n\t\t\t exit;\n\t\t\t}\n\t\t\t\n\t\t\t$acc_fitness = array();\n\t\t\t$acc_answer = array();\n\t\t\twhile($row = mysql_fetch_assoc($result)){\n\t\t\t\t\n\t\t\t\t//first, add the user study info to our indivs\n\t\t\t\t$indiv->addAnswers($row['captcha_text'], $row['mturk_answer'], $row['antigate_answer']);\n\t\t\t\t\n\t\t\t\t//first element is Mturk, second element is antigate\n\t\t\t\t$tmp_arr = array();\n\t\t\t\tarray_push($tmp_arr, strtolower($row['mturk_answer']), strtolower($row['antigate_answer']), strtolower($row['captcha_text']));\n\t\t\t\tarray_push($acc_answer, $tmp_arr);\n\t\t\t\t\n\t\t\t\t$fit = levenshtein(strtolower($row[\"mturk_answer\"]), strtolower($row[\"antigate_answer\"]));\n\t\t\t\tarray_push($acc_fitness, $fit);\n\t\t\t\t\n\t\t\t\t//record the diff types of answers we get\n\t\t\t\tif (levenshtein(strtolower($row[\"mturk_answer\"]), strtolower($row[\"captcha_text\"]))== 0 &&\n\t\t\t\t\tlevenshtein(strtolower($row[\"antigate_answer\"]), strtolower($row[\"captcha_text\"])) ==0 ){\n\t\t\t\t\t$this->types[0]++;\n\t\t\t\t}elseif(levenshtein(strtolower($row[\"mturk_answer\"]), strtolower($row[\"captcha_text\"])) > 0 &&\n\t\t\t\t\tlevenshtein(strtolower($row[\"antigate_answer\"]), strtolower($row[\"captcha_text\"])) ==0 ){\n\t\t\t\t\t$this->types[1]++;\n\t\t\t\t}elseif(levenshtein(strtolower($row[\"mturk_answer\"]), strtolower($row[\"captcha_text\"])) == 0 &&\n\t\t\t\t\tlevenshtein(strtolower($row[\"antigate_answer\"]), strtolower($row[\"captcha_text\"])) > 0 ){\n\t\t\t\t\t$this->types[2]++;\n\t\t\t\t}elseif(levenshtein(strtolower($row[\"mturk_answer\"]), strtolower($row[\"captcha_text\"])) > 0 &&\n\t\t\t\t\tlevenshtein(strtolower($row[\"antigate_answer\"]), strtolower($row[\"captcha_text\"])) > 0 ){\n\t\t\t\t\t$this->types[3]++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$average_fit = array_sum($acc_fitness)/sizeof($acc_fitness);\n\t\t\t$consistency = 1 + levenshtein($acc_answer[0][0], $acc_answer[1][0]) +\n\t\t\t\t\t\t\tlevenshtein($acc_answer[0][1], $acc_answer[1][1]);\n\t\t\t\n\t\t\t$ease_factor = 1.0;\n\t\t\tif ((levenshtein($acc_answer[0][0], $acc_answer[0][2])==0 &&\n\t\t\t\tlevenshtein($acc_answer[1][0], $acc_answer[1][2])==0) ||\n\t\t\t\t(levenshtein($acc_answer[0][1], $acc_answer[0][2])==0 &&\n\t\t\t\tlevenshtein($acc_answer[1][1], $acc_answer[1][2])==0)){\n\t\t\t\t$ease_factor = 1.2;\n\t\t\t}\n\t\t\t\n\t\t\t$hard_factor = 1.0;\n\t\t\tif ((levenshtein($acc_answer[0][0], $acc_answer[0][2])>0 &&\n\t\t\t\tlevenshtein($acc_answer[1][0], $acc_answer[1][2])>0) ||\n\t\t\t\t(levenshtein($acc_answer[0][1], $acc_answer[0][2])>0 &&\n\t\t\t\tlevenshtein($acc_answer[1][1], $acc_answer[1][2])>0)){\n\t\t\t\t$hard_factor = 0.6;\n\t\t\t}\n\t\t\t\n\t\t\t$cur_fitness = ($average_fit/$consistency) * $ease_factor * $hard_factor;\n\t\t\t\n\t\t\t$best_fitness = ($cur_fitness > $best_fitness) ? $cur_fitness : $best_fitness;\n\t\t\n\t\t\tarray_push($this->fitness, $cur_fitness);\n\t\t\t\n\t\t\t\n\t\t\t//echo \"Trial #1: Mturk answer: \".(string)$acc_answer[0][0].\", Antigate answer: \".(string)$acc_answer[0][1].\", Text:\".(string)$acc_answer[0][2].\"\\n\";\n\t\t\t//echo \"Trial #2: Mturk answer: \".(string)$acc_answer[1][0].\", Antigate answer: \".(string)$acc_answer[1][1].\", Text: \".(string)$acc_answer[1][2].\"\\n\";\n\t\t\t//echo \"Ease factor is $ease_factor, hard factor is $hard_factor, average fit is $average_fit, consistency is $consistency, fit is $cur_fitness\\n\\n\\n\";\n\t\t\t\n\t\t}\n\t\t\n\t\t$this->average_fit = array_sum($this->fitness)/ sizeof($this->fitness);\n\t\t$this->max_fit = $best_fitness;\n\t\t\n\t\t//after fitness is calculated, we want to clean the table with user data\n\t\t$query = \"TRUNCATE $this->table\".\"_antigate\";\n\t\t$results = mysql_query($query);\n\t\tif (!$results){\n\t\t\tdie('Invalid query 9: ' . mysql_error());\n\t\t}\n\t\tmysql_close();\n\t\t\n\t\t\n\t}", "public function calculate_fitness($individual)\n {\n $data = Helper::parseChromosome((string) $individual, $this->scheme);\n\n return $this->get_fitness_score($individual, $data);\n }", "protected function calculateSum() {\n $sum = 0;\n foreach ($this->genomes as $genome) {\n if ($genome->getFitness() > $this->max) {\n $this->max = $genome->getFitness();\n }\n }\n\n // Generate sum by subtracting fitness from max fitness and add 1.\n // This ensures that lower fitnesses will get a higher select rate when\n // finding parents to produce offspring.\n foreach ($this->genomes as $genome) {\n $sum = $sum + $this->max - $genome->getFitness() + 1;\n }\n $this->sum = $sum;\n }", "public function calculateAverageFitness(): void\n {\n $total = 0;\n foreach ($this->genomes as $genome) {\n $total += $genome->getGlobalRank();\n }\n\n $this->setAverageFitness($total / count($this->genomes));\n }", "public function fitness($mistakes) {\n $result = 0;\n $mytype = $this->own_mistake_type();\n if (count($mistakes)) {\n /** qtype_correctwriting_response_mistake $mistake */\n foreach($mistakes as $mistake) {\n if (is_a($mistake, $mytype)) {\n $result += $mistake->weight;\n }\n }\n }\n return $result * -1;\n }", "protected function best()\n {\n return array_reduce($this->population, function (string $best, string $current) {\n if ( \"\" == $best ) {\n return $current;\n }\n\n if (Marmoset\\fitness($current) < Marmoset\\fitness($best)) {\n return $current;\n }\n\n return $best;\n }, \"\");\n }", "public function setFitness($fitness)\n {\n $this->fitness = $fitness;\n }", "public function roi($property)\n\t{\n\t\tif(empty($property->value) || $property->value == 0) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t$appreciation = (new RoiCalculator)->appreciationRoi($property);\n\t\t$equity = (new RoiCalculator)->equityRoi($property);\n\t\t$cash = (new RoiCalculator)->cashRoi($property);\n\n\t\t$roi = ($appreciation + $equity + $cash) / 3;\n\t\treturn $roi;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ cron for data entry from feeds dynamically generate yesterday date as &Year=2014&Month=3&Day=1& dynamically generate today date as &EndYear=2014&EndMonth=3&EndDay=18&
public function cashback_master() { $this->load->model('cron_model'); $endDate = date('Y-m-d H:i:s'); $endY = date('Y', strtotime($endDate)); $endM = date('n', strtotime($endDate)); $endD = date('j', strtotime($endDate)); $startDate = date('Y-m-d H:i:s',strtotime("-1 days")); $startY = date('Y', strtotime($startDate)); $startM = date('n', strtotime($startDate)); $startD = date('j', strtotime($startDate)); $str = "&Year=$startY&Month=$startM&Day=$startD&EndYear=$endY&EndMonth=$endM&EndDay=$endD&"; $generatedUrl = "https://admin.omgpm.com/v2/reports/affiliate/leads/leadsummaryexport.aspx?Contact=519376&Country=26&Agency=95&Status=-1".$str."DateType=0&Sort=CompletionDate&Login=7EF2CBA5FD38DEC5D11B2BE81AD47190&Format=XML&RestrictURL=0"; //echo $generatedUrl; //$generatedUrl = "http://feeds.omgeu.com/data/feed.aspx?hash=a72d4fed604a46c6b44cd495537b62f5&page=1"; //$generatedUrl = "https://admin.omgpm.com/v2/reports/affiliate/leads/leadsummaryexport.aspx?Contact=519376&Country=26&Agency=95&Status=-1&Year=2014&Month=3&Day=1&EndYear=2014&EndMonth=3&EndDay=18&DateType=0&Sort=CompletionDate&Login=7EF2CBA5FD38DEC5D11B2BE81AD47190&Format=XML&RestrictURL=0"; $url=$generatedUrl; /* help url for * https http://stackoverflow.com/questions/11883575/problems-getting-xml-content-via-https-using-simplexml-and-php */ $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_URL, $url); // get the url contents $data = curl_exec($ch); // execute curl request curl_close($ch); $xml_data = simplexml_load_string($data); /*echo '<pre>'; print_r($xml); echo '</pre>';exit;*/ if(!empty($xml_data)) { $prod_arr = $xml_data->Report->Report_Details_Group_Collection->Report_Details_Group; //echo '<pre>'; print_r($prod_arr); echo '</pre>'; if(!empty($prod_arr)) { foreach($prod_arr as $key=>$val) { $elem_obj = $val; // object for a single product $ProductAttr = (array)$elem_obj; //echo '<pre>'; print_r($ProductAttr); echo '</pre>'; if(!empty($ProductAttr)) { foreach($ProductAttr as $val) { $new_arr = array(); $new_Arr["TransactionId"] = $val["TransactionId"]; $new_Arr["UID"] = $val["UID"]; $new_Arr["MID"] = $val["MID"]; $new_Arr["Merchant"] = $val["Merchant"]; $new_Arr["PID"] = $val["PID"]; $new_Arr["Product"] = $val["Product"]; $new_Arr["SR"] = $val["SR"]; $new_Arr["VR"] = $val["VR"]; $new_Arr["NVR"] = $val["NVR"]; $new_Arr["Status"] = $val["Status"]; $new_Arr["Paid"] = $val["Paid"]; $new_Arr["UKey"] = $val["UKey"]; $new_Arr["TransactionValue"] = $val["TransactionValue"]; $new_Arr["Completed"] = date("Y-m-d H:i:s",strtotime($val["Completed"])); $new_Arr["ClickTime"] = date("Y-m-d H:i:s",strtotime($val["ClickTime"])); $new_Arr["TransactionTime"] = date("Y-m-d H:i:s",strtotime($val["TransactionTime"])); $i_ins = $this->cron_model->insert_cashback($new_Arr); } } } echo 'Data inserted succesfully'; } } }
[ "function dailyHandler() {\n\t\t$connection =& DBConnection::instance();\n\t\t$frequency = ConfigOptions::getValue(\"reports_update_frequency\");\n\t\t$iteration_days = ConfigOptions::getValue(\"reports_iteration_days\");\n\t\t$today = DateValue::makeFromString('now');\n\t\t$dates = Reports::getIterationDates($today, $iteration_days, $frequency);\n\t\t$iteration_start = $dates['start'];\n\t\t$iteration_end = $dates['end'];\n $params['start'] = $iteration_start->toMySQL();\n\t\t$params['end'] = $iteration_end->toMySQL();\n\n\t\t// If a project's start date is greater than some of its objects,\n\t\t// set the start date to earliest project object\n\t\t$query = 'CREATE temporary table '.TABLE_PREFIX.'earliest_object\n\t\t\t\t\tAS\n\t\t\t\t\tSELECT po.project_id, po.created_on\n\t\t\t\t\tFROM '.TABLE_PREFIX.'project_objects po\n\t\t\t\t\tGROUP BY po.project_id\n\t\t\t\t\tORDER BY po.created_on ASC';\n\t\t$result = $connection->execute($query);\n\t\t$query = 'UPDATE '.TABLE_PREFIX.'projects p, '.TABLE_PREFIX.'earliest_object eo\n\t\t\t\t\tSET p.starts_on = eo.created_on\n\t\t\t\t\tWHERE p.starts_on > eo.created_on';\n\t\t$result = $connection->execute($query);\n\t\t$query = 'DROP table '.TABLE_PREFIX.'earliest_object';\n\t\t$result = $connection->execute($query);\n\n\t\t// Set start date for projects if it does not exist\n\t\t$query = 'UPDATE '.TABLE_PREFIX.'projects\n\t\t\t\t SET starts_on = date(created_on)\n\t\t\t\t WHERE starts_on IS NULL';\n\t\t$result = $connection->execute($query);\n\n\t\t$master_categories = ConfigOptions::getValue(\"reports_master_categories\");\n\t\t$master_categories_count = count($master_categories);\n\t\t$master_categories_map = array();\n\t\tfor($i = 0; $i < $master_categories_count; $i++) {\n\t\t\t$master_categories_map[$master_categories[$i]] = 'cat'.$i;\n\t\t}\n\n\t\t// If table is empty, populate it from the beginning\n\t\t$query = 'SELECT count(*) as count FROM '.TABLE_PREFIX.'rep_tickets_snapshot';\n\t\t$result = $connection->execute_one($query);\n\t\tif($result['count'] <= 0)\n\t\t{\n\t\t\t$query = 'SELECT starts_on FROM '.TABLE_PREFIX.'projects WHERE starts_on IS NOT NULL ORDER BY starts_on ASC LIMIT 0,1';\n\t\t\t$result = $connection->execute_one($query);\n\t\t\tif (is_foreachable($result))\n\t\t\t{\n\t\t\t\t$beginning = DateValue::makeFromString($result['starts_on']);\n\n\t\t\t\t// Adjust beginning date if we don't have enough RAM\n\t\t\t\t$availableMemory = ini_get('memory_limit');\n\t\t\t\t$val = trim($availableMemory);\n \t\t\t$last = strtolower($val[strlen($val)-1]);\n \t\t\tswitch($last)\n \t\t\t{\n\t\t\t case 'g':\n\t\t\t $val *= 1024;\n\t\t\t case 'm':\n\t\t\t $val *= 1024;\n\t\t\t case 'k':\n\t\t\t $val *= 1024;\n \t\t\t}\n \t\t\t// Convert back to MB\n \t\t\t$availableMemory = round($val / 1024 / 1024);\n \t\t\tif ($availableMemory < 128)\n \t\t\t{\n\t\t\t\t\t$weeksToProcess = round($availableMemory/4);\n\t\t\t\t\t$beginning = DateValue::makeFromString(\"-$weeksToProcess weeks\");\n \t\t\t}\n\n\t\t\t\t// Adjust iteration start to week start from beginning date\n\t\t\t\t$dates = Reports::getIterationDates($beginning, $iteration_days, $frequency);\n\t\t\t\t$iteration_start = $dates['start'];\n\t\t\t\t$iteration_end = $dates['end'];\n\n\t\t\t\twhile($iteration_start->toMySQL() < $params['start']) {\n\t\t\t\t\t$iparams['historical'] = 1;\n\t\t\t\t\t$iparams['start'] = $iteration_start->toMySQL();\n\t\t\t\t\t$iteration_start->advance(($iteration_days * 86400));\n\t\t\t\t\t$iparams['end'] = $iteration_start->toMySQL();\n\t\t\t\t\t$entries = Reports::takeIterationSnapshot($connection, $master_categories_map, $iparams, $iteration_days);\n\t\t\t\t\t//echo \"Populating - \".$iparams['start'].' - '.$iparams['end'].\" - $entries entries processed.<br />\";\n\t\t\t\t\t$iteration_start->advance(1);\n\t\t\t\t\tunset($connection);\n\t\t\t\t\t$connection = DBConnection::instance();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$entries = Reports::takeIterationSnapshot($connection, $master_categories_map, $params, $iteration_days);\n\t\t//echo \"Reporting snapshots taken - \".$params['start'].' - '.$params['end'].' - '.$entries.' entries processed. ';\n\t\treturn;\n\t}", "function dailyHandler() {\n\n // Increase limits so that operation does not time out in between\n @ini_set('memory_limit', '256M');\n @ini_set('max_execution_time', '6000');\n\n if (!ConfigOptions::exists('reports_snapshot_taken_on')) {\n ConfigOptions::addOption('reports_snapshot_taken_on', REPORTS_PLUS_MODULE, '');\n ConfigOptions::setValue('reports_snapshot_taken_on', '');\n }\n\n $frequency = ConfigOptions::getValue(\"reports_update_frequency\");\n $iteration_days = ConfigOptions::getValue(\"reports_iteration_days\");\n $today = DateValue::makeFromString('now');\n $dates = self::getIterationDates($today, $iteration_days, $frequency);\n $iteration_start = $dates ['start'];\n $iteration_end = $dates ['end'];\n $params ['start'] = $iteration_start->toMySQL();\n $params ['end'] = $iteration_end->toMySQL();\n\n $master_categories = ConfigOptions::getValue(\"reports_master_categories\");\n $master_categories_count = count($master_categories);\n $master_categories_map = array();\n for ($i = 0; $i < $master_categories_count; $i ++) {\n $master_categories_map [strtolower(trim($master_categories [$i]))] = 'cat' . $i;\n }\n\n // If table is empty, populate it from the beginning\n $query = 'SELECT count(*) as count FROM ' . TABLE_PREFIX . 'rep_tickets_snapshot';\n $result = DB::executeFirstRow($query);\n if ($result ['count'] <= 0) {\n $query = 'SELECT created_on FROM ' . TABLE_PREFIX . 'projects WHERE created_on IS NOT NULL ORDER BY created_on ASC LIMIT 0,1';\n $result = DB::executeFirstRow($query);\n if (is_foreachable($result)) {\n $beginning = DateValue::makeFromString($result ['created_on']);\n\n // Take snapshot of last 6 months only\n // If you want take snapshot of your entire data,\n // comment out these lines\n $six_months_ago = DateValue::makeFromString(\"-6 months\");\n if ($beginning->getTimestamp() < $six_months_ago->getTimestamp()) {\n $beginning = $six_months_ago;\n }\n\n // Adjust beginning date if we don't have enough RAM\n $availableMemory = ini_get('memory_limit');\n $val = trim($availableMemory);\n $last = strtolower($val [strlen($val) - 1]);\n switch ($last) {\n case 'g' :\n $val *= 1024;\n case 'm' :\n $val *= 1024;\n case 'k' :\n $val *= 1024;\n }\n // Convert back to MB\n $availableMemory = round($val / 1024 / 1024);\n if ($availableMemory < 128) {\n $weeksToProcess = round($availableMemory / 4);\n $beginning = DateValue::makeFromString(\"-$weeksToProcess weeks\");\n }\n\n // Adjust iteration start to week start from beginning date\n $dates = self::getIterationDates($beginning, $iteration_days, $frequency);\n $iteration_start = $dates ['start'];\n $iteration_end = $dates ['end'];\n\n while ($iteration_start->toMySQL() < $params ['start']) {\n $iparams ['historical'] = 1;\n $iparams ['start'] = $iteration_start->toMySQL();\n $iteration_start->advance(($iteration_days * 86400));\n $iparams ['end'] = $iteration_start->toMySQL();\n $entries = self::takeIterationSnapshot($master_categories_map, $iparams, $iteration_days);\n //echo \"Populating - \".$iparams['start'].' - '.$iparams['end'].\" - $entries entries processed.<br />\";\n $iteration_start->advance(1);\n }\n ConfigOptions::setValue('reports_snapshot_taken_on', new DateTimeValue());\n }\n }\n if (AngieApplication::isModuleLoaded('tracking')) {\n // We are taking snapshot of all modified iterations\t\n $reports_snapshot_taken_on = ConfigOptions::getValue('reports_snapshot_taken_on', false);\n $query = \"SELECT record_date FROM `\" . TABLE_PREFIX . \"time_records` WHERE record_date < DATE(created_on)\";\n if ($reports_snapshot_taken_on != '') {\n $query .= DB::prepare(\" AND created_on BETWEEN ? AND ? AND created_on > ?\", DateValue::makeFromString('-1 day')->format('Y-m-d H:i:s'), DateValue::makeFromString('now')->format('Y-m-d H:i:s'), $reports_snapshot_taken_on);\n }\n $query .= \" GROUP BY record_date\";\n $record_dates = DB::executeFirstColumn($query);\n\n if (is_foreachable($record_dates)) {\n $iterations_affected = array();\n foreach ($record_dates as $beginning) {\n $dates = self::getIterationDates(DateValue::makeFromString($beginning), $iteration_days, $frequency);\n $iterations_affected[$dates['start']->toMySQL()] = array('start' => $dates['start']->toMySQL(),\n 'end' => $dates['end']->toMySQL(),\n 'historical' => 1\n );\n }\n }\n $iterations_affected[$params['start']] = $params;\n foreach ($iterations_affected as $vparams) {\n $entries = self::takeIterationSnapshot($master_categories_map, $vparams, $iteration_days);\n }\n ConfigOptions::setValue('reports_snapshot_taken_on', new DateTimeValue());\n } else {\n $entries = self::takeIterationSnapshot($master_categories_map, $params, $iteration_days);\n }\n\n\n //Creating & Updating financial summary table on scheduled jobs\n if (AngieApplication::isModuleLoaded('invoicing')) {\n self::updateFinancialSummary();\n }\n //echo \"Reporting snapshots taken - \".$params['start'].' - '.$params['end'].' - '.$entries.' entries processed.<br/>';\n return;\n }", "private function initNextCronRunInfo() {\n $offsetInSeconds = $this->getGMTOffset();\n\n // Next CRON event dates\n $nextCollectUrls = wp_next_scheduled(Factory::schedulingService()->eventCollectUrls);\n $nextCrawlPost = wp_next_scheduled(Factory::schedulingService()->eventCrawlPost);\n $nextRecrawlPost = wp_next_scheduled(Factory::schedulingService()->eventRecrawlPost);\n $nextDeletePosts = wp_next_scheduled(Factory::schedulingService()->eventDeletePosts);\n\n if($nextCollectUrls) $this->nextURLCollectionDate = date($this->dateFormat, $nextCollectUrls + $offsetInSeconds);\n if($nextCrawlPost) $this->nextPostCrawlDate = date($this->dateFormat, $nextCrawlPost + $offsetInSeconds);\n if($nextRecrawlPost) $this->nextPostRecrawlDate = date($this->dateFormat, $nextRecrawlPost + $offsetInSeconds);\n if($nextDeletePosts) $this->nextPostDeleteDate = date($this->dateFormat, $nextDeletePosts + $offsetInSeconds);\n\n /*\n * Next sites\n */\n\n // Get last site IDs\n $keySiteIdLastUrlCollection = Factory::urlSaver()->optionLastCheckedSiteId;\n $keySiteIdLastPostCrawl = Factory::postSaver()->optionLastCrawledSiteId;\n $keySiteIdLastPostRecrawl = Factory::postSaver()->optionLastRecrawledSiteId;\n $keySiteIdLastPostDelete = Factory::schedulingService()->optionKeyLastPostDeletedSiteId;\n\n // Get next site IDs using the last site IDs\n $nextSiteIdUrlCollection = Factory::schedulingService()->getSiteIdForEvent($keySiteIdLastUrlCollection);\n $nextSiteIdPostCrawl = Factory::schedulingService()->getSiteIdForEvent($keySiteIdLastPostCrawl);\n $nextSiteIdPostRecrawl = Factory::schedulingService()->getSiteIdForEvent($keySiteIdLastPostRecrawl);\n $nextSiteIdPostDelete = Factory::schedulingService()->getSiteIdForEvent($keySiteIdLastPostDelete);\n\n // Get the sites as WP_Post\n $sites = $this->getPosts([$nextSiteIdUrlCollection, $nextSiteIdPostCrawl, $nextSiteIdPostRecrawl, $nextSiteIdPostDelete], Environment::postType());\n\n // Assign the related class variables\n foreach($sites as $site) {\n if($site->ID == $nextSiteIdUrlCollection) $this->nextUrlCollectionSite = $site;\n if($site->ID == $nextSiteIdPostCrawl) $this->nextPostCrawlSite = $site;\n if($site->ID == $nextSiteIdPostRecrawl) $this->nextPostRecrawlSite = $site;\n if($site->ID == $nextSiteIdPostDelete) $this->nextPostDeleteSite = $site;\n }\n }", "public function crons_daily(){\n global $wpdb;\n\n $cron_daily = get_option('wooyellowcube_cron_daily');\n $current_day = date('Ymd');\n\n // Execute CRON\n if($current_day != $cron_daily){\n $this->update_stock();\n\n // Update last execution date\n update_option('wooyellowcube_cron_daily', date('Ymd'));\n }\n\n if(isset($_GET['cron_daily'])){\n \t\t$this->update_stock();\n \t}\n\n if(get_option('wooyellowcube_logs') > 1){\n $date_gap = get_option('wooyellowcube_logs') * 60 * 60 * 24;\n $wpdb->query(\"DELETE FROM wooyellowcube_logs WHERE created_at < \".(time() - $date_gap));\n }\n\n }", "public function daily($head)\r\n\t\t{\r\n\t\t\t$year = isset($_REQUEST['year']) ? $_REQUEST['year'] : 0;\r\n\t\t\t$month = isset($_REQUEST['month']) ? $_REQUEST['month'] : 0;\r\n\t\t\t$day = isset($_REQUEST['day']) ? $_REQUEST['day'] : 0;\r\n\r\n\t\t\t$head->addScript(\"scripts/date.js\");\r\n\t\t\t$head->setOnLoad(\"populate($day, $month, $year)\");\r\n\t\t\t\r\n\t\t\t$content = new FORM(NULL, NULL, \"date\");\r\n\t\t\t$content->add(new H1(NULL, NULL, \"Daily hits\"));\r\n\t\t\t$content->add(new DIV(NULL, NULL, new A(NULL, NULL,\r\n\t\t\t\t\"Back to main menu\", \"?admin\")));\r\n\t\t\t$content->add(new DIV());\r\n\t\t\t$m = new SELECT(NULL, NULL, \"month\",\r\n\t\t\t\tarray(\"onchange\"=>\"populate2()\"));\r\n\t\t\t$m->add(new OPTION(NULL, NULL, \"01\", \"January\"));\r\n\t\t\t$m->add(new OPTION(NULL, NULL, \"02\", \"February\"));\r\n\t\t\t$m->add(new OPTION(NULL, NULL, \"03\", \"March\"));\r\n\t\t\t$m->add(new OPTION(NULL, NULL, \"04\", \"April\"));\r\n\t\t\t$m->add(new OPTION(NULL, NULL, \"05\", \"May\"));\r\n\t\t\t$m->add(new OPTION(NULL, NULL, \"06\", \"June\"));\r\n\t\t\t$m->add(new OPTION(NULL, NULL, \"07\", \"July\"));\r\n\t\t\t$m->add(new OPTION(NULL, NULL, \"08\", \"August\"));\r\n\t\t\t$m->add(new OPTION(NULL, NULL, \"09\", \"September\"));\r\n\t\t\t$m->add(new OPTION(NULL, NULL, \"10\", \"October\"));\r\n\t\t\t$m->add(new OPTION(NULL, NULL, \"11\", \"November\"));\r\n\t\t\t$m->add(new OPTION(NULL, NULL, \"12\", \"December\"));\r\n\t\t\t$content->add($div = new DIV());\r\n\t\t\t$div->add(new SELECT(NULL, NULL, \"day\"));\r\n\t\t\t$div->add($m);\r\n\t\t\t$div->add(new SELECT(NULL, NULL, \"year\"));\r\n\t\t\t$content->add(new HIDDEN(\"admin\", \"1\"));\r\n\t\t\t$content->add(new HIDDEN(\"section\", \"hits\"));\r\n\t\t\t$content->add(new DIV(NULL, NULL,\r\n\t\t\t\tnew SUBMIT(NULL, NULL, \"action\", \"Select date\")));\r\n\t\t\t\r\n\t\t\t$content->add($hits = new DIV(\"hits\"));\r\n\t\t\t$time = mktime(0, 0, 0, $month, $day, $year);\r\n\t\t\t$ipaddresses = array();\r\n\t\t\t\r\n\t\t\t$count = 0;\r\n\t\t\t// Find the correct file and process it.\r\n\t\t\t$fileName = \"hits/\".date(\"Y\", $time).\"/\".date(\"Ymd\", $time);\r\n\t\t\tif (!file_exists($fileName)) return $content;\r\n\t\t\t$fp = fopen($fileName, \"r\");\r\n\t\t\twhile (!feof($fp))\r\n\t\t\t{\r\n\t\t\t\t$timestamp = NULL;\r\n\t\t\t\t$ipaddr = NULL;\r\n\t\t\t\t$referrer = NULL;\r\n\t\t\t\t$page = NULL;\r\n\t\t\t\t$host = NULL;\r\n\t\t\t\twhile ($line = trim(fgets($fp)))\r\n\t\t\t\t{\r\n\t\t\t\t\t$items = explode(\"=\", $line, 2);\r\n\t\t\t\t\tif (count($items) < 2) break;\r\n\t\t\t\t\t$name = $items[0];\r\n\t\t\t\t\t$value = $items[1];\r\n\t\t\t\t\tswitch ($name)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcase \"timestamp\":\r\n\t\t\t\t\t\t\t$timestamp = $value;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"ipaddr\":\r\n\t\t\t\t\t\t\t$ipaddr = $value;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"referrer\":\r\n\t\t\t\t\t\t\t$referrer = $value;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"page\":\r\n\t\t\t\t\t\t\t$page = $value;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif ($timestamp)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Count the hits per IP address.\r\n\t\t\t\t\tif (array_key_exists($ipaddr, $ipaddresses)) $ipaddresses[$ipaddr]++;\r\n\t\t\t\t\telse $ipaddresses[$ipaddr] = 1;\r\n\t\t\t\t\t$page = basename($page);\r\n\t\t\t\t\tif (!$page) $page = \"index.php\";\r\n\t\t\t\t\tif (strlen($page) > 80) $page = substr($page, 0, 80).\"...\";\r\n\t\t\t\t\tif (strlen($referrer) > 120) $referrer = substr($referrer, 0, 120).\"...\";\r\n\t\t\t\t\t$text = \"$timestamp&nbsp;&nbsp;$ipaddr&nbsp;$host<br />\"\r\n\t\t\t\t\t\t.\"&nbsp;&nbsp;\".$page;\r\n\t\t\t\t\tif ($referrer) $text .= \"<br />&nbsp;&nbsp;$referrer\";\r\n\t\t\t\t\t$hits->add(new DIV(NULL, NULL, $text));\r\n\t\t\t\t\t$count++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfclose($fp);\r\n\r\n\t\t\t$hits->add(new DIV());\r\n\t\t\tarsort($ipaddresses);\r\n\t\t\tforeach ($ipaddresses as $ipaddr=>$hit)\r\n\t\t\t{\r\n\t\t\t\t$hits->add(new DIV(NULL, NULL,\r\n\t\t\t\t\t\"$ipaddr&nbsp;&nbsp($hit hit\".($hit > 1 ? \"s\" : NULL).\")\"));\r\n\t\t\t}\r\n\t\t\t$hits->add(new DIV());\r\n\t\t\t$hits->add(new DIV(NULL, NULL, \"Total: $count hits\"));\r\n\t\t\treturn $content;\r\n\t\t}", "protected function get_today_url() {\n\t\treturn $this->get_persistent_url( array(\n\t\t\t'cy' => date_i18n( 'Y', $this->now ),\n\t\t\t'cm' => date_i18n( 'n', $this->now ),\n\t\t\t'cd' => date_i18n( 'j', $this->now ),\n\t\t) );\n\t}", "function add_schedule_day($date) {\n\t$page\t = \"\\\\clearpage\";\n\t$page\t.= \"\\\\period{\".$date.\"}\";\n\t$page\t.= \"\\\\hfil\\\\break \\\\\\\\ \\n\";\n\treturn $page;\n}", "function create_date_day($format, $gmepoch, $tz) \n{ \n global $board_config, $lang; \n\n $date_day = create_date($format, $gmepoch, $tz); \n if ( $board_config['time_today'] < $gmepoch) \n { \n $date_day = sprintf($lang['Today_at'], create_date($board_config['default_timeformat'], $gmepoch, $tz)); \n } \n else if ( $board_config['time_yesterday'] < $gmepoch) \n { \n $date_day = sprintf($lang['Yesterday_at'], create_date($board_config['default_timeformat'], $gmepoch, $tz)); \n } \n \n return $date_day; \n}", "public function crawlDateAction(){\n return $this->_crawl('date', 2, 15);\n }", "public function CronNewsAction(){\r\n\t ini_set('max_execution_time', 0);\r\n\t $newsModel = new NewsModel();\r\n\r\n\t $sec_to_delete_news_from_feeds = $this->getParam(\"SEC_TO_DELETE_NEWS_FROM_FEEDS\");\r\n\r\n\t $newsModel -> deleteOldNews(date(\"Y-m-d H:i:s\", time()-$sec_to_delete_news_from_feeds));\t \r\n\t \r\n\t $lastRSS = new lastRSS();\r\n\t $lastRSS->cache_dir = './rss_cache';\r\n $lastRSS->cache_time = 3600; // one hour\r\n \r\n\t $aNewsTreeFeeds = $newsModel -> getAllNewsTreeFeeds(\"\", true, true, true);\r\n\t foreach ($aNewsTreeFeeds as $newsTreeFeeds){\r\n\t \t\t \r\n\t echo $newsTreeFeeds['url'];\r\n\t echo \"<br>\";\r\n\t $aFeeds = $lastRSS->Get($newsTreeFeeds['url']);\r\n\t echo \"<pre>\";\r\n\t //print_r($aFeeds);\r\n\t //print_r($newsTreeFeeds);\r\n\t //echo $newsTreeFeeds['last_parse_date'].\"<br>\";\r\n\t $n = 0;\r\n\t if (is_array($aFeeds) && count($aFeeds)>0 && is_array($aFeeds['items'])){\r\n\t foreach ($aFeeds['items'] as $item){\r\n\t //print_r($item); echo \"<hr>\";\r\n $pubDate = (isset($item['pubDate']))?$item['pubDate']:date(\"Y-m-d H:i:s\");\r\n $title = (isset($item['title']))?$item['title']:\"\";\r\n $link = (isset($item['link']))?$item['link']:\"\";\r\n $description = (isset($item['description']))?$item['description']:\"\";\r\n $category = (isset($item['category']))?$item['category']:\"\";\r\n $enclosure = (isset($item['enclosure']))?$item['enclosure']:\"\";\r\n $enclosure_type = (isset($item['enclosure_type']))?$item['enclosure_type']:\"\";\r\n \r\n if (strtoupper($aFeeds['encoding']) != 'UTF-8' ){\r\n $title = iconv(strtoupper($aFeeds['encoding']), 'UTF-8', $title);\r\n $description = iconv(strtoupper($aFeeds['encoding']), 'UTF-8', $description);\r\n $category = iconv(strtoupper($aFeeds['encoding']), 'UTF-8', $category);\r\n $enclosure = iconv(strtoupper($aFeeds['encoding']), 'UTF-8', $enclosure);\r\n }\r\n\t\t $short_text = $newsModel -> getNWordsFromText($description, 40);\r\n\t\t $pub_date = date(\"Y-m-d H:i:s\", strtotime($pubDate));\r\n\t\t if (!$newsTreeFeeds['category_tag'] || strtoupper($newsTreeFeeds['category_tag']) == strtoupper($category)){\r\n\t\t // if RSS-feeds have different categories => it should be same as in item\r\n\t\t $pub_date_in_sec = strtotime($pub_date);\r\n\t\t if (\r\n\t\t (!$newsTreeFeeds['last_parse_date'] || $newsTreeFeeds['last_parse_date'] < $pub_date) && // check parse date\r\n\t\t (time()-$sec_to_delete_news_from_feeds < $pub_date_in_sec) // check news publication date\r\n\t\t )\r\n\t\t { // not parsed yet\r\n\t\t $n++;\r\n\t\t $newsModel -> addNews(\r\n\t\t $newsTreeFeeds['id'], $title, $link, $short_text, $description, \r\n\t\t $category, $pub_date, $enclosure, $enclosure_type, 0, 0, 0, $newsTreeFeeds['text_parse_type']);\r\n\t\t $newsModel -> setParseDate($newsTreeFeeds['feed_id'], date(\"Y-m-d H:i:s\"));\r\n\t\t }\r\n\t\t }\r\n\t }\r\n\t }\r\n\t echo \"Added \".$n.\" News\";\r\n\t echo \"</pre>\";\r\n\r\n\t echo \"<hr>\";\r\n\t }\r\n\t \r\n\t}", "public function get_today_url( $canonical = false );", "public function action_today() {\n $time = time();\n $offset = isset($_GET['offset']) ? $_GET['offset'] : '';\n if (strlen($offset) > 0) {\n $time += 86400 * $offset;\n }\n $format = isset($_GET['format']) ? $_GET['format'] : '';\n if (strlen($format) == 0) {\n echo '';\n return;\n }\n echo strftime(preg_replace('/[aAbBcdHIjmMpSUWwxXyYZ]/', '%$0', $format), $time);\n }", "function getDateLink($day, $month, $year)\n {\n $today = mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\"));\n\t\t\t\t$indate = mktime(0, 0, 0, $month , $day, $year);\n\t\t\t\t$addlink = ($indate >= $today) ? \"base.php?page=showUpcomingEvents.php&day=$day&month=$month&year=$year\": \"\";\n\n\t\t\t\treturn $addlink;\n }", "function theme_gs_helper_today($data) {\n $output = '<div class=\"day\">' . $data['day'] . '</div>';\n $output .= '<div class=\"date\">' . $data['date'] . '</div>';\n \n return $output;\n}", "function ercore_start_end_dates_displayed() {\n $ercore_date = variable_get('ercore_start_date');\n $argument_date_format = variable_get('date_format_ercore_date_format_month_day_year');\n $default = date_create(implode('/', $ercore_date));\n $dates['start'] = date_format($default, $argument_date_format);\n $dates['end'] = date($argument_date_format, strtotime('+1 year'));\n $new_dates = $dates['start'] . ' to ' . $dates['end'];\n return $new_dates;\n}", "private function buildTimeSeriesEndpointURL()\n {\n $endPoint = ForeignExchangeRepository::FIXER_API_TIMESERIES_ENPOINT_URL;\n\n $startDate = new \\DateTime();\n\n $query = [\n 'access_key' => config('fixerio.key'),\n 'base' => $this->fromCurrency,\n 'symbols' => $this->toCurrency,\n 'end_date' => (new \\DateTime())->format('Y-m-d')\n ];\n\n if (strcmp($this->period, 'WEEKLY') == 0) {\n $startDate->sub(new \\DateInterval('P1W'));\n } else if (strcmp($this->period, 'MONTHLY') == 0) {\n $startDate->sub(new \\DateInterval('P1M'));\n } else if (strcmp($this->period, 'SIX MONTHS') == 0) {\n $startDate->sub(new \\DateInterval('P6M'));\n } else if (strcmp($this->period, 'YEARLY') == 0) {\n $startDate->sub(new \\DateInterval('P1Y'));\n } else {\n //DAILY IS DEFAULT. NOTHING TO DO.\n }\n\n $query['start_date'] = $startDate->format('Y-m-d');\n\n return $endPoint . '?' . http_build_query($query);\n }", "private function getQueryStringDate() {\n\t\tif($this->date) {\n\t\t\treturn $this->date . '['.$this->qType.']';\n\t\t}\n\t\t$startDate = (new DateTime('-14 days'))->format('Ymd');\n\t\t$endDate = (new DateTime('tomorrow'))->format('Ymd');\n\t\t$qDate = '`'.$this->qType.' > '.$startDate.' < '.$endDate;\n\t\treturn $qDate;\n\t}", "function getPublishBeforeDate($date_format = DATE_ATOM) {\n if ( ( isset( $_GET['txtToDate'] ) ) && ( validDate( $_GET['txtToDate'] ) ) ) {\n\t\t$d = new Datetime($_GET['txtToDate']); \n $publishBeforeDate = $d->format($date_format);\n\t} else {\n\t\t$d = new Datetime('tomorrow'); //gets tomorrow's date;\n\t\t$publishBeforeDate = $d->format($date_format);\n }\n return $publishBeforeDate;\n}", "function getDayLink(&$conf,$timestamp, $day, $title) {\n\t\tif($day < 10) {\n\t\t\t$day = '0'.$day;\n\t\t}\n\t\t$d1 = mktime(0, 0 , 0, date('m', $timestamp), $day, date('Y', $timestamp));\n\t\t$d2 = mktime(0, 0 , 0, date('m', $timestamp), $day+1, date('Y', $timestamp));\n\n\t\t$urlParams = array(\n\t\t\t'tx_metafeedit[calendarSearch]['.$conf['pluginId'].'][year]' => date('Y', $timestamp),\n\t\t\t'tx_metafeedit[calendarSearch]['.$conf['pluginId'].'][month]' => date('m', $timestamp),\n\t\t\t'tx_metafeedit[calendarSearch]['.$conf['pluginId'].'][day]' => $day,\n\t\t\t'tx_metafeedit[calendarSearch]['.$conf['pluginId'].']['.$conf['list.']['beginDateField'].'][op]' => '>ts<',\n\t\t\t'tx_metafeedit[calendarSearch]['.$conf['pluginId'].']['.$conf['list.']['beginDateField'].'][val]' => $d1,\n\t\t\t'tx_metafeedit[calendarSearch]['.$conf['pluginId'].']['.$conf['list.']['beginDateField'].'][valsup]' => $d2,\n\t\t);\n\n\t\t$tagAttribs = ' title=\"'.$title.'\"';\n\n\t\t$lconf = array(\n\t\t\t'useCacheHash' => $this->conf['allowCaching'],\n\t\t\t'no_cache' => !$this->conf['allowCaching'],\n\t\t\t//'parameter' => $this->conf['targetPid'],\n\t\t\t'parameter' => $GLOBALS['TSFE']->id,\n\t\t\t'additionalParams' => $this->conf['parent.']['addParams'].t3lib_div::implodeArrayForUrl('',$urlParams,'',1).$this->pi_moreParams.$conf['GLOBALPARAMS'],\n\t\t\t'ATagParams' => $tagAttribs\n\t\t);\n\t\treturn $this->cObj->typoLink($day, $lconf);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructs a TamperManager object.
public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) { parent::__construct( 'Plugin/Tamper', $namespaces, $module_handler, 'Drupal\tamper\TamperInterface', 'Drupal\tamper\Annotation\Tamper' ); $this->alterInfo('tamper_info'); $this->setCacheBackend($cache_backend, 'tamper_info_plugins'); }
[ "public static function generateManager(): LaramoreManager;", "protected function createInstanceManager()\n {\n // TODO: Implement createInstanceManager() method.\n }", "private function createManager()\n {\n $config = $this->generateConfig();\n\n $algoliaManager = $this->algoliaFactory->make($config);\n $algoliaManager->setEnv($this->env);\n\n return $algoliaManager;\n }", "public static function create() {\n return new MobManagerImpl();\n }", "private function registerManager()\n {\n $class = (app()->environment() === 'testing') ? StacheTestManager::class : Manager::class;\n\n $manager = new $class(\n $this->stache,\n new Loader($this->stache),\n new UpdateManager($this->stache),\n new Persister($this->stache)\n );\n\n $this->app->instance(Manager::class, $manager);\n }", "public function getTripManager(){\n\t\tif($this->tripManager == null){\n\t\t\t$this->tripManager = new TripManager();\n\t\t}\n\t\treturn $this->tripManager;\n\t}", "public static function generateManager(): LaramoreManager\n {\n $class = config('field.constraint.manager');\n\n return new $class(static::getDefaults());\n }", "public function __construct()\n {\n $this->comp = new TokensManager;\n $this->dbMng = new DBManager;\n $this->wrapperMng = new WrapperManager;\n }", "abstract protected function createInstanceManager();", "static public function newForwarderManager()\n {\n return new MazelabVpopqmail_Model_ForwarderManager();\n }", "function &new_AsteriskManager()\n {\n $this->asm = new AGI_AsteriskManager(NULL, $this->config);\n $this->asm->pagi =& $this;\n $this->config =& $this->asm->config;\n return $this->asm;\n }", "static public function newMailRobotManager()\n {\n return new MazelabVpopqmail_Model_MailRobotManager();\n }", "public function createScriptsManager(): ScriptsManager {\n return $this->dc->create(ScriptsManager::class);\n }", "protected function getManager()\n {\n return $this->get('fhv_tmd.analyseManager');\n }", "static function getInstance(){\n\t if (!isset(self::$instance)) {\n\t self::$instance = new TeamSetManager();\n\t\t\t//Set global variable for tracker monitor instances that are disabled\n\t self::$instance->setup();\n\t } // if\n\t return self::$instance;\n\t}", "function analogue()\n {\n return Manager::getInstance();\n }", "public function getManager()\n {\n return Manager::getInstance();\n }", "public function createEmailManager() : EmailManager {\n return $this->dc->create(EmailManager::class);\n }", "public function __construct()\n {\n parent::__construct();\n $this->manager = new TeamManager();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parsed the $path for available Strata shell commands
private function parseDirectoryForCommandFiles($path) { foreach (glob($path . "*Command.php") as $filename) { if (preg_match("/(\w+?Command).php$/", $filename, $matches)) { $this->attemptRegistration($matches[1]); } } }
[ "abstract function getPathParser();", "protected function parsePath($path) {\n\t\t$pathParts = array();\n\t\tpreg_match('/(admin|site)\\/([^\\/]+)\\/?$/',$path, $pathParts);\n\t\tif (count($pathParts) != 3) {\n\t\t\treturn array();\n\t\t}\n\t\treturn array($pathParts[1], $pathParts[2]);\n\t}", "protected function getCommands()\n {\n $commands = parent::getCommands();\n\n $commands[1] = str_replace($this->path, static::normalizePath($this->path), $commands[1]);\n\n return $commands;\n }", "function getArchivingShellExec()\n {\n $ret = array();\n foreach(cleanWhitespaces(file(__DIR__ . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'packs-archiving.diz')) as $values)\n {\n $parts = explode(\"||\", $values);\n $ret[$parts[0]] = $parts[1];\n }\n return $ret;\n }", "function parse_directory_2 ($directory) {\n\t$GLOBALS[\"argv\"][] = \"-out=\\\"~/Desktop/Parser\\\"\";\n\t$GLOBALS[\"argv\"][] = \"-dir=\\\"ios:$directory\\\"\";\n\t$GLOBALS[\"argv\"][] = \"-ios\";\n\t$GLOBALS[\"argv\"][] = \"-build_skeletons\";\n}", "public function addCommands($path)\n\t{\n\t\tif (($commands=$this->findCommands($path))!==array())\n\t\t{\n\t\t\tforeach($commands as $name=>$file)\n\t\t\t{\n\t\t\t\t$this->commands[$name]=$file;\n\t\t\t}\n\t\t}\n\t}", "private function parsePath() {\r\n\t\t// Get the path from PATH_INFO\r\n\t\tif( $this->input('server', 'PATH_INFO') !== null\r\n\t\t && !empty( $this->input('server', 'PATH_INFO') )\r\n\t\t && trim($this->input('server', 'PATH_INFO'), '/') !== '' ) {\r\n\t\t\t$path = trim($this->input('server', 'PATH_INFO'), '/');\r\n\t\t} else {\r\n\t\t // PATH_INFO does not exist, use index\r\n\t\t\t$path = 'index';\r\n\t\t}\r\n\r\n\t\t// Replace any dangerous characters and make everything lower case\r\n\t\t$path = strtolower(preg_replace('/[^a-z\\/]/i', '', $path));\r\n\t\t\r\n\t\t// Remove the \"api\" prefix if there is one\r\n\t\tif(strpos($path, '/api') === 0) {\r\n\t\t $path = substr($path, 4);\r\n\t\t}\r\n\t\t\r\n\t\t// Parse the class\r\n\t\tif( count(explode('/', $path)) === 1 ) { // If there's only the class\r\n\t\t\t$class = $path;\r\n\t\t\t\t\r\n\t\t\t$this->method = 'index';\r\n\t\t}\r\n\t\telse { // Otherwise both the class and method exist\r\n\t\t\t$class = substr($path, 0, strlen( basename($path) ) * -1); // Get the path only (without the method)\r\n\t\t\t\t\r\n\t\t\t// Set the method\r\n\t\t\t$this->method = basename($path);\r\n\t\t}\r\n\t\t\r\n\t\t// Replace '/' with capitalization for every first letter in the path\r\n\t\tforeach( explode('/', trim($class, '/')) as $value ) {\r\n\t\t\t$this->class .= ucfirst($value);\r\n\t\t}\r\n\t\t\t\r\n\t\t\r\n\t\t// 'Add 'Actions' prefix so there will be no mistakes including the class\r\n\t\t$this->class = 'Actions' . $this->class;\r\n\t}", "protected function parsePath($path) {\n $controller = $this->options['controller'];\n $action = $this->options['action'];\n $parameters = [];\n\n $path = \\trim($path, '/ ');\n $fragments = \\explode('/', $path);\n if ($this->isMarkedParameter($fragments[0])) {\n $parameters = $this->parseParameters($fragments);\n } else {\n $controller = \\array_shift($fragments);\n if (!empty($fragments)) {\n if ($this->isMarkedParameter($fragments[0])) {\n $parameters = $this->parseParameters($fragments);\n } else {\n $action = \\array_shift($fragments);\n if (!empty($fragments)) {\n $parameters = $this->parseParameters($fragments);\n }\n }\n }\n }\n\n return \\compact('controller', 'action', 'parameters');\n }", "public function detectCommand($path)\n {\n if (!$path) {\n $this->install();\n $path = $this->getPath();\n }\n if (!$path || !file_exists($path)) {\n throw new InvalidConfigException('Failed to find how to run ' . $this->name);\n }\n\n return $path;\n }", "public function GetPathGammuSmsdInject ($s_path = '') {\n\t\t$ar_path = $this->aCfg['path_bin'];\n\n\t\tif (!empty($s_path)) {\n\t\t\t// Add to array\n\t\t\tarray_unshift($ar_path, $s_path);\n\t\t}\n\n\t\t// Find a usable path\n\t\t$b_found = false;\n\t\twhile (!$b_found && !empty($ar_path)) {\n\t\t\t$s_cmd = $ar_path[0] . 'gammu-smsd-inject';\n\t\t\tif (is_executable($s_cmd)) {\n\t\t\t\t$b_found = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tarray_shift($ar_path);\n\t\t}\n\t\tif ($b_found) {\n\t\t\t$this->Log('Got gammu smsd inject execute file: '\n\t\t\t\t. $s_cmd, 1);\n\t\t\t$this->aCfg['path_gammu_smsd_inject'] = $s_cmd;\n\t\t}\n\t\telse {\n\t\t\t$this->Log('Can\\' find gammu smsd inject execute file.', 5);\n\t\t\texit();\n\t\t}\n\n\t\treturn $this->aCfg['path_gammu_smsd_inject'];\n\t}", "function findshellscripts($directoryname,$eatPath = false) {\n\t$currDir = escapeshellarg($directoryname);\n\t$theList = explode(\"\\n\",trim(`find $currDir`));\n\t$currNum = 0;\n\tforeach($theList as $tryItem) {\n\t\tif (! is_dir($tryItem)) {\n\t\t\t$inFile = $tryItem;\n\t\t\tif (banghope($inFile)) {\n\t\t\t\tif (! $eatPath) {\n\t\t\t\t\t$myFiles[$currNum] = $tryItem;\n\t\t\t\t} else {\n\t\t\t\t\t$myFiles[$currNum] = basename($tryItem);\n\t\t\t\t}\n\t\t\t\t$currNum++;\n\t\t\t}\n\t\t}\n\t}\n\treturn $myFiles;\n}", "protected function parseCommand()\n\t{\n\t\t// Since we're building the options ourselves,\n\t\t// we stop adding it to the segments array once\n\t\t// we have found the first dash.\n\t\t$options_found = false;\n\n\t\t$argc = $this->getServer('argc', FILTER_SANITIZE_NUMBER_INT);\n\t\t$argv = $this->getServer('argv');\n\n\t\t// We start at 1 since we never want to include index.php\n\t\tfor ($i = 1; $i < $argc; $i ++)\n\t\t{\n\t\t\t// If there's no '-' at the beginning of the argument\n\t\t\t// then add it to our segments.\n\t\t\tif (! $options_found && strpos($argv[$i], '-') === false)\n\t\t\t{\n\t\t\t\t$this->segments[] = filter_var($argv[$i], FILTER_SANITIZE_STRING);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$options_found = true;\n\n\t\t\tif (strpos($argv[$i], '-') !== 0)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$arg = filter_var(str_replace('-', '', $argv[$i]), FILTER_SANITIZE_STRING);\n\t\t\t$value = null;\n\n\t\t\t// If the next item starts with a dash it's a value\n\t\t\tif (isset($argv[$i + 1]) && strpos($argv[$i + 1], '-') !== 0)\n\t\t\t{\n\t\t\t\t$value = filter_var($argv[$i + 1], FILTER_SANITIZE_STRING);\n\t\t\t\t$i ++;\n\t\t\t}\n\n\t\t\t$this->options[$arg] = $value;\n\t\t}\n\t}", "private function loadInstalledPaths()\n {\n if ($this->isPHPCodeSnifferInstalled() === true) {\n $output = $this->processBuilder\n ->setArguments(array('--config-show', self::PHPCS_CONFIG_KEY))\n ->getProcess()\n ->mustRun()\n ->getOutput();\n\n $phpcsInstalledPaths = str_replace(self::PHPCS_CONFIG_KEY . ': ', '', $output);\n $phpcsInstalledPaths = trim($phpcsInstalledPaths);\n\n if ($phpcsInstalledPaths !== '') {\n $this->installedPaths = explode(',', $phpcsInstalledPaths);\n }\n }\n }", "function command_list ( ) {\n\n\tglobal $atcommand_file, $atcommand_symbol;\n\n\t// Load \"atcommand_athen.conf\" into an array\n\t$atcommand = file ( $atcommand_file );\n\n\t// Create a new array\n\t$commands = array ( );\n\n\t// Remove comments & such\n\tforeach ( $atcommand as $eachcommand ) {\n\n\t\t// Remove whitespace from beginning and end of each line\n\t\t$eachcommand = trim ( $eachcommand );\n\n\t\t// If the line is not a comment or blank, add it to the new array\n\t\tif ( substr ( $eachcommand, 0, 2 ) != \"//\" && $eachcommand != \"\" ) {\n\n\t\t\t// Split the line by the colon\n\t\t\t$eachcommand = explode ( \":\", $eachcommand );\n\n\t\t\t// Remove whitespace\n\t\t\t$eachcommand[0] = trim ( $eachcommand[0] );\n\t\t\t$eachcommand[1] = trim ( $eachcommand[1] );\n\n\t\t\t// Add it to the array\n\t\t\t$commands[$eachcommand[0]] = $eachcommand[1];\n\t\t}\n\t}\n\n\t// Don't include the \"import: conf/import/atcommand_conf.txt\" line as a command\n\tif ( isset ( $commands[\"import\"] ) ) {\n\t\tunset ( $commands[\"import\"] );\n\t}\n\n\t// Use the command_symbol \"atcommand_athena.conf\" if there is one\n\tif ( isset ( $commands[\"command_symbol\"] ) ) {\n\t\t$command_symbol = $commands[\"command_symbol\"];\n\t\tunset ( $commands[\"command_symbol\"] );\n\t}\n\n\treturn $commands;\n}", "function get_cmdline($data)\r\n{\r\n $cmd_regex = '/^([^\\r]*\\r\\n)/';\r\n if(preg_match($cmd_regex, $data, $matches))\r\n {\r\n return $matches[1];\r\n }\r\n return FALSE; \r\n}", "private static function tokenize($path)\n {\n $path = (string) $path;\n $tokens = [];\n $length = strlen($path);\n $buffer = '';\n for ($i = 0; $i < $length; ++$i) {\n $char = $path[$i];\n switch ($char) {\n case '\\\\':\n if (($i + 1) === $length) { // is '\\' the last character?\n $buffer .= $char;\n break;\n }\n if (in_array($path[$i + 1], array('.', '-', '[', ']', '?', '(', '\\\\', '*'))) {\n $buffer .= $path[$i + 1];\n ++$i;\n }\n break;\n\n case '.':\n $tokens[] = array(self::T_STRING, $buffer);\n $tokens[] = array(self::T_DOT, '.');\n $buffer = '';\n break;\n\n case '[':\n if (($i + 1) === $length) { // is '[' the last character?\n $buffer .= $char;\n break;\n }\n $tokens[] = array(self::T_STRING, $buffer);\n $buffer = '';\n if (($i + 2) < $length && $path[$i + 1] . $path[$i + 2] == '*]') { // [*] ?\n $tokens[] = array(self::T_ALL_ELEMENTS, '[*]');\n $i += 2;\n } else {\n $tokens[] = array(self::T_BRACKET_OPEN, '[');\n }\n break;\n\n case ']':\n $tokens[] = array(self::T_STRING, $buffer);\n $tokens[] = array(self::T_BRACKET_CLOSE, ']');\n $buffer = '';\n break;\n\n case '?':\n $tokens[] = array(self::T_STRING, $buffer);\n $tokens[] = array(self::T_OPTIONAL, '?');\n $buffer = '';\n break;\n\n case '-': // ->\n if (($i + 1) === $length) { // is '-' the last character?\n $buffer .= $char;\n break;\n }\n if ($path[$i + 1] !== '>') {\n $buffer .= $char;\n } else {\n // Arrow \"->\" detected\n $tokens[] = array(self::T_STRING, $buffer);\n $tokens[] = array(self::T_ARROW, '->');\n $buffer = '';\n ++$i;\n }\n break;\n\n case '(': // ->\n if (($i + 1) === $length) { // is '(' the last character?\n $buffer .= $char;\n break;\n }\n if ($path[$i + 1] !== ')') {\n $buffer .= $char;\n } else {\n // parentheses \"()\" detected.\n $tokens[] = array(self::T_STRING, $buffer);\n $tokens[] = array(self::T_PARENTHESES, '()');\n $buffer = '';\n ++$i;\n }\n break;\n\n default:\n $buffer .= $char;\n break;\n }\n }\n $tokens[] = array(self::T_STRING, $buffer);\n foreach ($tokens as $key => $token) {\n if ($token[1] === '') {\n unset($tokens[$key]);\n }\n }\n\n return array_values($tokens);\n }", "function separateCommands( $prefixCmd='_' ) {\n $paths = explode( '/', $this->getPathInfo() );\n $path_info = '';\n $commands = array();\n foreach( $paths as $path ) {\n if( substr( $path, 0, 1 ) == $prefixCmd ) {\n $commands[] = $path;\n }\n else {\n if( $path_info ) $path_info .= '/';\n $path_info .= $path;\n }\n }\n $this->setPathInfo( $path_info );\n return $commands;\n }", "public function dataCodePaths() {\n\t\treturn array(\n\t\t\tarray( '/ee/a-command/', true ),\n\t\t\tarray( '/ee/abcd-command/', true ),\n\t\t\tarray( '/ee/a-b-c-d-e-f-g-h-i-j-k-l-m-n-o-p-q-r-s-t-u-v-w-x-y-z-command/', true ),\n\t\t\tarray( 'xyz/ee/abcd-command/zxy', true ),\n\n\t\t\tarray( '/php/commands/src/', true ),\n\t\t\tarray( 'xyz/php/commands/src/zyx', true ),\n\n\t\t\tarray( '/ee/-command/', false ), // No command name.\n\t\t\tarray( '/ee/--command/', false ), // No command name.\n\t\t\tarray( '/ee/abcd-command-/', false ), // End is not '-command/`\n\t\t\tarray( '/ee/abcd-/', false ), // End is not '-command/'.\n\t\t\tarray( '/ee/abcd-command', false ), // End is not '-command/'.\n\t\t\tarray( 'ee/abcd-command/', false ), // Start is not '/ee/'.\n\t\t\tarray( '/wp--cli/abcd-command/', false ), // Start is not '/ee/'.\n\t\t\tarray( '/eeabcd-command/', false ), // Start is not '/ee/'.\n\t\t\tarray( '/ee//abcd-command/', false ), // Middle contains two '/'.\n\n\t\t\tarray( '/php-/commands/src/', false ), // Start is not '/php/'.\n\t\t\tarray( 'php/commands/src/', false ), // Start is not '/php/'.\n\t\t\tarray( '/php/commands/src', false ), // End is not '/src/'.\n\t\t\tarray( '/php/commands/srcs/', false ), // End is not '/src/'.\n\t\t\tarray( '/php/commandssrc/', false ), // End is not '/src/'.\n\t\t);\n\t}", "private static function extractPath(string $path): array\n\t{\n\t\treturn explode('/', trim($path, '/'));\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create request for operation 'retrieveShippingLabel'
protected function retrieveShippingLabelRequest($body, $shipment_id, $tracking_id) { // verify the required parameter 'body' is set if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $body when calling retrieveShippingLabel' ); } // verify the required parameter 'shipment_id' is set if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $shipment_id when calling retrieveShippingLabel' ); } // verify the required parameter 'tracking_id' is set if ($tracking_id === null || (is_array($tracking_id) && count($tracking_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $tracking_id when calling retrieveShippingLabel' ); } $resourcePath = '/shipping/v1/shipments/{shipmentId}/containers/{trackingId}/label'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // path params if ($shipment_id !== null) { $resourcePath = str_replace( '{' . 'shipmentId' . '}', ObjectSerializer::toPathValue($shipment_id), $resourcePath ); } // path params if ($tracking_id !== null) { $resourcePath = str_replace( '{' . 'trackingId' . '}', ObjectSerializer::toPathValue($tracking_id), $resourcePath ); } // body params $_tempBody = null; if (isset($body)) { $_tempBody = $body; } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], ['application/json'] ); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { $multipartContents[] = [ 'name' => $formParamName, 'contents' => $formParamValue ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } $query = \GuzzleHttp\Psr7\build_query($queryParams); $sign = new SignatureSellingPartner(); $headersX = $sign->calculateSignature($this->config->getApiKey("accessKey"), $this->config->getApiKey("secretKey"), $this->config->getApiKey("region"), $this->config->getAccessToken(), $this->config->getUserAgent(), str_replace("https://", "", $this->config->getHost()), 'POST', $resourcePath, $query); $headers = array_merge( $headerParams, $headers, $headersX ); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); }
[ "function request_shipping_label($data) { \n\t\t// Note you may want to associate this in some other way, like with a database ID. \n\t\t$this->PartnerTransactionID = substr(uniqid(rand(), true), 0, 10); \n\n\t\t$xml = '<LabelRequest Test=\"YES\" LabelType=\"Default\" LabelSize=\"4X6\" ImageFormat=\"GIF\">\n\t\t\t\t\t<RequesterID>'.$this->RequesterID.'</RequesterID>\n\t\t\t\t\t<AccountID>'.$this->AccountID.'</AccountID> \n\t\t\t\t\t<PassPhrase>'.$this->PassPhrase.'</PassPhrase>\n\t\t\t\t\t<PartnerTransactionID>'.$this->PartnerTransactionID.'</PartnerTransactionID>'; \n\n\t\tif(!empty($data)) { \n\t\t\tforeach($data as $node_key => $node_value) { \n\t\t\t\t$xml .= '<'.$node_key.'>'.$node_value.'</'.$node_key.'>'; \n\t\t\t}\n\t\t} \n\t\t\t\t\t\n\t\t$xml .=\t'<ResponseOptions PostagePrice=\"TRUE\"/> \n\t\t\t\t</LabelRequest>'; \n\n\t\t$data = array(\"labelRequestXML\" => $xml); \n\t\t$request = $this->client->post('/LabelService/EwsLabelService.asmx/GetPostageLabelXML', array(), $data);\n\t\treturn $this->send_request($request);\n\t}", "function retrieveLabel($sInfo) {\n\t\tglobal $messageStack;\n\t\t$fedex_results = array();\n\t\tif (in_array($sInfo->ship_method, array('I2DEam','I2Dam','I3D'))) { // unsupported ship methods\n\t\t $messageStack->add('The ship method requested is not supported by this tool presently. Please ship the package via a different tool.','error');\n\t\t return false;\n\t\t}\n\t\tif (MODULE_SHIPPING_FEDEX_V7_TEST_MODE == 'Test') {\n\t\t\t$client = new SoapClient(PATH_TO_TEST_SHIP_WSDL, array('trace' => 1));\n\t\t} else {\n\t\t\t$client = new SoapClient(PATH_TO_SHIP_WSDL, array('trace' => 1));\n\t\t}\n\t\tfor ($key = 0; $key < count($sInfo->package); $key++) {\n\t\t $labels = array();\n\t\t $request = $this->FormatFedExShipRequest($sInfo, $key);\n//echo 'FedEx Express XML Label Submit String:'; print_r($request); echo '<br />';\n\t\t try {\n\t\t $response = $client->processShipment($request);\n//echo 'Request <pre>' . htmlspecialchars($client->__getLastRequest()) . '</pre>';\n//echo 'Response <pre>' . htmlspecialchars($client->__getLastResponse()) . '</pre>';\n//echo 'label response array = '; print_r($response); echo '<br />';\n\t\t if ($response->HighestSeverity != 'FAILURE' && $response->HighestSeverity != 'ERROR') {\n\t\t\t\tif ($key == 0) {\n\t\t\t\t\t$sInfo->master_tracking = $response->CompletedShipmentDetail->MasterTrackingId;\n\t\t\t\t}\n\t\t\t\t$net_cost = 0;\n\t\t\t\t$book_cost = 0;\n\t\t\t\t$del_date = '';\n\t\t\t\tif (isset($response->CompletedShipmentDetail->OperationalDetail->DeliveryDate)) {\n\t\t\t\t $del_code = $response->CompletedShipmentDetail->OperationalDetail->DestinationServiceArea;\n\t\t\t\t $guar_time = $this->calculateDeliveryTime($sInfo->ship_method, $del_code, $sInfo->residential_address);\n\t\t\t\t $del_date = $response->CompletedShipmentDetail->OperationalDetail->DeliveryDate . ' ' . $guar_time;\n\t\t\t\t} elseif (isset($response->CompletedShipmentDetail->OperationalDetail->MaximumTransitTime)) {\n\t\t\t\t $del_date = $this->calculateDelivery($response->CompletedShipmentDetail->OperationalDetail->MaximumTransitTime, $sInfo->residential_address);\n\t\t\t\t} elseif (isset($response->CompletedShipmentDetail->OperationalDetail->TransitTime)) {\n\t\t\t\t $del_date = $this->calculateDelivery($response->CompletedShipmentDetail->OperationalDetail->TransitTime, $sInfo->residential_address);\n\t\t\t\t}\n\t\t\t\tif (is_array($response->CompletedShipmentDetail->CompletedPackageDetails->PackageRating->PackageRateDetails)) {\n\t\t\t\t foreach ($response->CompletedShipmentDetail->CompletedPackageDetails->PackageRating->PackageRateDetails as $rate) {\n\t\t\t\t switch($rate->RateType) {\n\t\t\t\t case 'PAYOR_ACCOUNT_PACKAGE':\n\t\t\t\t case 'PAYOR_ACCOUNT_SHIPMENT': $net_cost = $rate->NetCharge->Amount; break;\n\t\t\t\t\t case 'PAYOR_LIST_SHIPMENT':\n\t\t\t\t\t case 'PAYOR_LIST_PACKAGE': $book_cost = $rate->NetCharge->Amount; break;\n\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t\tif ($response->CompletedShipmentDetail->CarrierCode == 'FXFR') { // LTL Freight\n//echo 'Request <pre>' . htmlspecialchars($client->__getLastRequest()) . '</pre>';\n\t\t\t\t $is_ltl = true; // special handling for freight, hard coded label types for now\n\t\t\t\t $tracking = $response->CompletedShipmentDetail->MasterTrackingId->TrackingNumber;\n\t\t\t\t $zone = '';\n\t\t\t\t foreach ($response->CompletedShipmentDetail->ShipmentDocuments as $document) $labels[] = $document->Parts->Image;\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t $is_ltl = false;\n\t\t\t\t $zone = $response->CompletedShipmentDetail->ShipmentRating->ShipmentRateDetails->RateZone;\n\t\t\t\t $labels[] = $response->CompletedShipmentDetail->CompletedPackageDetails->Label->Parts->Image;\n\t\t\t\t if (is_array($response->CompletedShipmentDetail->CompletedPackageDetails->TrackingIds)) { // Smart Post\n\t\t\t\t\tforeach ($response->CompletedShipmentDetail->CompletedPackageDetails->TrackingIds as $track_num) {\n\t\t\t\t\t if ($track_num->TrackingIdType == 'GROUND') $tracking = $track_num->TrackingNumber;\n\t\t\t\t\t}\n\t\t\t\t } else {\n\t\t\t\t\t$tracking = $response->CompletedShipmentDetail->CompletedPackageDetails->TrackingIds->TrackingNumber;\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t\tif (!$tracking) {\n\t\t\t\t $messageStack->add('Error - No tracking found in return string.','error');\n//echo 'label response array = '; print_r($response); echo '<br />';\n\t\t\t\t return false;\n\t\t\t\t}\n\t\t\t\t$fedex_results[$key] = array(\n\t\t\t\t\t'ref_id' => $sInfo->purchase_invoice_id . '-' . ($key + 1),\n\t\t\t\t\t'tracking' => $tracking,\n\t\t\t\t\t'zone' => $zone,\n\t\t\t\t\t'book_cost' => $book_cost,\n\t\t\t\t\t'net_cost' => $net_cost,\n\t\t\t\t\t'delivery_date' => $del_date,\n//\t\t\t\t\t'dim_weight' => $response->CompletedShipmentDetail->CompletedPackageDetails->TrackingIds->TrackingNumber,\n//\t\t\t\t\t'billed_weight' => $response->CompletedShipmentDetail->CompletedPackageDetails->TrackingIds->TrackingNumber,\n\t\t\t\t);\n\t\t\t\tif (sizeof($labels) > 0) {\n\t\t\t\t $cnt = 0;\n\t\t\t\t $date = explode('-',$sInfo->ship_date);\n\t\t\t\t $file_path = SHIPPING_DEFAULT_LABEL_DIR.$this->code.'/'.$date[0].'/'.$date[1].'/'.$date[2].'/';\n\t\t\t\t validate_path($file_path);\n\t\t\t\t foreach ($labels as $label) {\n\t\t\t\t\t$this->returned_label = $label;\n\t\t\t\t\t// check for label to be for thermal printer or plain paper\n\t\t\t\t\tif (MODULE_SHIPPING_FEDEX_V7_PRINTER_TYPE == 'Thermal') { // keep the thermal label encoded for now\n\t\t\t\t\t\t$file_name = $tracking . ($cnt > 0 ? '-'.$cnt : '') . '.lpt'; // thermal printer\n\t\t\t\t\t\tif ($is_ltl && $cnt > 0) $file_name = $tracking . '-' .$cnt . '.pdf'; // BOL must be PDF\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$file_name = $tracking . ($cnt > 0 ? '-'.$cnt : '') . '.pdf'; // plain paper\n\t\t\t\t\t}\n\t\t\t\t\tif (!$handle = fopen($file_path . $file_name, 'w')) { \n\t\t\t\t\t\t$messageStack->add('Cannot open file (' . $file_path . $file_name . ')','error');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tif (fwrite($handle, $label) === false) {\n\t\t\t\t\t\t$messageStack->add('Cannot write to file (' . $file_path . $file_name . ')','error');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tfclose($handle);\n\t\t\t\t\t$cnt++;\n//\t\t\t\t\t$messageStack->add_session('Successfully retrieved the FedEx shipping label. Tracking # ' . $fedex_results[$key]['tracking'],'success');\n\t\t\t\t }\n\t\t\t\t} else {\n\t\t\t\t\t$messageStack->add('Error - No label found in return string.','error');\n\t\t\t\t\treturn false;\t\t\t\t\n\t\t\t\t}\n\t\t } else {\n\t\t\t foreach ($response->Notifications as $notification) {\n\t\t\t\tif (is_object($notification)) {\n\t\t\t\t $message .= ' (' . $notification->Severity . ') ' . $notification->Message;\n\t\t\t\t} else {\n\t\t\t\t $message .= ' ' . $notification;\n\t\t\t\t}\n\t\t\t }\n//echo 'Request <pre>' . htmlspecialchars($client->__getLastRequest()) . '</pre>';\n\t\t\t $messageStack->add(SHIPPING_FEDEX_V7_RATE_ERROR . $message, 'error');\n\t\t\t return false;\n\t\t }\n\t\t } catch (SoapFault $exception) {\n//echo 'Request <pre>' . htmlspecialchars($client->__getLastRequest()) . '</pre>'; \n//echo 'Response <pre>' . htmlspecialchars($client->__getLastResponse()) . '</pre>';\n\t\t $message = \" [label soap fault] ({$exception->faultcode}) {$exception->faultstring}\";\n\t\t $messageStack->add(SHIPPING_FEDEX_CURL_ERROR . $message, 'error');\n\t\t return false;\n\t\t }\n\t }\n\t\treturn $fedex_results;\n\t}", "public function getShippingLabelsRequest(AccessToken $accessToken, string $region, \\DateTimeInterface $created_after, \\DateTimeInterface $created_before, ?string $ship_from_party_id = null, ?int $limit = null, string $sort_order = 'ASC', ?string $next_token = null) : RequestInterface\n {\n // verify the required parameter 'created_after' is set\n if ($created_after === null || (\\is_array($created_after) && \\count($created_after) === 0)) {\n throw new InvalidArgumentException(\n 'Missing the required parameter $created_after when calling getShippingLabels'\n );\n }\n // verify the required parameter 'created_before' is set\n if ($created_before === null || (\\is_array($created_before) && \\count($created_before) === 0)) {\n throw new InvalidArgumentException(\n 'Missing the required parameter $created_before when calling getShippingLabels'\n );\n }\n\n if ($limit !== null && $limit > 100) {\n throw new InvalidArgumentException('invalid value for \"$limit\" when calling VendorShippingLabelsApi.getShippingLabels, must be smaller than or equal to 100.');\n }\n\n if ($limit !== null && $limit < 1) {\n throw new InvalidArgumentException('invalid value for \"$limit\" when calling VendorShippingLabelsApi.getShippingLabels, must be bigger than or equal to 1.');\n }\n\n $resourcePath = '/vendor/directFulfillment/shipping/2021-12-28/shippingLabels';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $multipart = false;\n $query = '';\n\n // query params\n if (\\is_array($ship_from_party_id)) {\n $ship_from_party_id = ObjectSerializer::serializeCollection($ship_from_party_id, '', true);\n }\n\n if ($ship_from_party_id !== null) {\n $queryParams['shipFromPartyId'] = ObjectSerializer::toString($ship_from_party_id);\n }\n // query params\n if (\\is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n\n if ($limit !== null) {\n $queryParams['limit'] = ObjectSerializer::toString($limit);\n }\n // query params\n if (\\is_array($created_after)) {\n $created_after = ObjectSerializer::serializeCollection($created_after, '', true);\n }\n\n if ($created_after !== null) {\n $queryParams['createdAfter'] = ObjectSerializer::toString($created_after);\n }\n // query params\n if (\\is_array($created_before)) {\n $created_before = ObjectSerializer::serializeCollection($created_before, '', true);\n }\n\n if ($created_before !== null) {\n $queryParams['createdBefore'] = ObjectSerializer::toString($created_before);\n }\n // query params\n if (\\is_array($sort_order)) {\n $sort_order = ObjectSerializer::serializeCollection($sort_order, '', true);\n }\n\n if ($sort_order !== null) {\n $queryParams['sortOrder'] = ObjectSerializer::toString($sort_order);\n }\n // query params\n if (\\is_array($next_token)) {\n $next_token = ObjectSerializer::serializeCollection($next_token, '', true);\n }\n\n if ($next_token !== null) {\n $queryParams['nextToken'] = ObjectSerializer::toString($next_token);\n }\n\n if (\\count($queryParams)) {\n $query = \\http_build_query($queryParams);\n }\n\n if ($multipart) {\n $headers = [\n 'accept' => ['application/json'],\n 'host' => [$this->configuration->apiHost($region)],\n 'user-agent' => [$this->configuration->userAgent()],\n ];\n } else {\n $headers = [\n 'content-type' => ['application/json'],\n 'accept' => ['application/json'],\n 'host' => [$this->configuration->apiHost($region)],\n 'user-agent' => [$this->configuration->userAgent()],\n ];\n }\n\n $request = $this->httpFactory->createRequest(\n 'GET',\n $this->configuration->apiURL($region) . $resourcePath . '?' . $query\n );\n\n // for model (json/xml)\n if (\\count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = \\is_array($formParamValue) ? $formParamValue : [$formParamValue];\n\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem,\n ];\n }\n }\n $request = $request->withParsedBody($multipartContents);\n } elseif ($headers['content-type'] === ['application/json']) {\n $request = $request->withBody($this->httpFactory->createStreamFromString(\\json_encode($formParams, JSON_THROW_ON_ERROR)));\n } else {\n $request = $request->withParsedBody($formParams);\n }\n }\n\n foreach (\\array_merge($headerParams, $headers) as $name => $header) {\n $request = $request->withHeader($name, $header);\n }\n\n return HttpSignatureHeaders::forConfig(\n $this->configuration,\n $accessToken,\n $region,\n $request\n );\n }", "protected function purchaseLabelsRequest($body, $shipment_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling purchaseLabels'\n );\n }\n // verify the required parameter 'shipment_id' is set\n if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $shipment_id when calling purchaseLabels'\n );\n }\n\n $resourcePath = '/shipping/v1/shipments/{shipmentId}/purchaseLabels';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($shipment_id !== null) {\n $resourcePath = str_replace(\n '{' . 'shipmentId' . '}',\n ObjectSerializer::toPathValue($shipment_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n\n $sign = new SignatureSellingPartner();\n $headersX = $sign->calculateSignature($this->config->getApiKey(\"accessKey\"),\n $this->config->getApiKey(\"secretKey\"), $this->config->getApiKey(\"region\"),\n $this->config->getAccessToken(), $this->config->getUserAgent(), str_replace(\"https://\", \"\", $this->config->getHost()),\n 'POST', $resourcePath, $query);\n\n $headers = array_merge(\n $headerParams,\n $headers,\n $headersX\n );\n\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function getLabelRequest($get_label_request)\n {\n // verify the required parameter 'authorization' is set\n $authorization=$this->authorization;\n if ($authorization === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $authorization when calling getLabel'\n );\n }\n // verify the required parameter 'get_label_request' is set\n if ($get_label_request === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $get_label_request when calling getLabel'\n );\n }\n\n $resourcePath = '/GetLabel';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($authorization !== null) {\n $headerParams['Authorization'] = ObjectSerializer::toHeaderValue($authorization);\n }\n\n\n // body params\n $_tempBody = null;\n if (isset($get_label_request)) {\n $_tempBody = $get_label_request;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->url . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function packagesV1LabelGetRequest()\n {\n\n $resourcePath = '/packages/v1/{label}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function createShippingLabelsRequest(AccessToken $accessToken, string $region, string $purchase_order_number, \\AmazonPHP\\SellingPartner\\Model\\VendorDirectFulfillmentShipping\\CreateShippingLabelsRequest $body) : RequestInterface\n {\n // verify the required parameter 'purchase_order_number' is set\n if ($purchase_order_number === null || (\\is_array($purchase_order_number) && \\count($purchase_order_number) === 0)) {\n throw new InvalidArgumentException(\n 'Missing the required parameter $purchase_order_number when calling createShippingLabels'\n );\n }\n\n if (!\\preg_match('/^[a-zA-Z0-9]+$/', $purchase_order_number)) {\n throw new InvalidArgumentException('invalid value for \"purchase_order_number\" when calling VendorShippingLabelsApi.createShippingLabels, must conform to the pattern /^[a-zA-Z0-9]+$/.');\n }\n\n // verify the required parameter 'body' is set\n if ($body === null || (\\is_array($body) && \\count($body) === 0)) {\n throw new InvalidArgumentException(\n 'Missing the required parameter $body when calling createShippingLabels'\n );\n }\n\n $resourcePath = '/vendor/directFulfillment/shipping/2021-12-28/shippingLabels/{purchaseOrderNumber}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $multipart = false;\n $query = '';\n\n if (\\count($queryParams)) {\n $query = \\http_build_query($queryParams);\n }\n\n // path params\n if ($purchase_order_number !== null) {\n $resourcePath = \\str_replace(\n '{' . 'purchaseOrderNumber' . '}',\n ObjectSerializer::toPathValue($purchase_order_number),\n $resourcePath\n );\n }\n\n if ($multipart) {\n $headers = [\n 'accept' => ['application/json'],\n 'host' => [$this->configuration->apiHost($region)],\n 'user-agent' => [$this->configuration->userAgent()],\n ];\n } else {\n $headers = [\n 'content-type' => ['application/json'],\n 'accept' => ['application/json'],\n 'host' => [$this->configuration->apiHost($region)],\n 'user-agent' => [$this->configuration->userAgent()],\n ];\n }\n\n $request = $this->httpFactory->createRequest(\n 'POST',\n $this->configuration->apiURL($region) . $resourcePath . '?' . $query\n );\n\n // for model (json/xml)\n if (isset($body)) {\n if ($headers['content-type'] === ['application/json']) {\n $httpBody = \\json_encode(ObjectSerializer::sanitizeForSerialization($body), JSON_THROW_ON_ERROR);\n } else {\n $httpBody = $body;\n }\n\n $request = $request->withBody($this->httpFactory->createStreamFromString($httpBody));\n } elseif (\\count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = \\is_array($formParamValue) ? $formParamValue : [$formParamValue];\n\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem,\n ];\n }\n }\n $request = $request->withParsedBody($multipartContents);\n } elseif ($headers['content-type'] === ['application/json']) {\n $request = $request->withBody($this->httpFactory->createStreamFromString(\\json_encode($formParams, JSON_THROW_ON_ERROR)));\n } else {\n $request = $request->withParsedBody($formParams);\n }\n }\n\n foreach (\\array_merge($headerParams, $headers) as $name => $header) {\n $request = $request->withHeader($name, $header);\n }\n\n return HttpSignatureHeaders::forConfig(\n $this->configuration,\n $accessToken,\n $region,\n $request\n );\n }", "protected function getShippingTrackingTypesRequest()\n {\n $resourcePath = '/shipping-tracking-types';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // body params\n $_tempBody = null;\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function retrieveLabel($sInfo, $key = 0) {\n\tglobal $messageStack;\n\t$ups_results = array();\n\tif (in_array($sInfo->ship_method, array('I2DEam','I2Dam','I3D','GndFrt','EcoFrt'))) { // unsupported ship methods\n\t\t$messageStack->add('The ship method requested is not supported by this tool presently. Please ship the package via a different tool.','error');\n\t\treturn false;\n\t}\n\t$strXML = $this->FormatUPSShipRequest($sInfo);\n//echo 'Ship Request xmlString = <pre>' . $strXML . '</pre><br />';\n\t$url = (MODULE_SHIPPING_UPS_TEST_MODE == 'Test') ? MODULE_SHIPPING_UPS_SHIP_URL_TEST : MODULE_SHIPPING_UPS_SHIP_URL;\n\t$SubmitXML = GetXMLString($strXML, $url, \"POST\");\n//echo 'Ship Request response string = ' . htmlspecialchars($SubmitXML['xmlString']) . '<br />';\n\t// Check for XML request errors\n\tif ($SubmitXML['result'] == 'error') {\n\t\t$messageStack->add(SHIPPING_UPS_CURL_ERROR . $SubmitXML['message'], 'error');\n\t\treturn false;\n\t}\n\t$ResponseXML = xml_to_object($SubmitXML['xmlString']);\n\t$XMLFail = $ResponseXML->ShipmentConfirmResponse->Response->Error->ErrorCode;\n\t$XMLWarn = $ResponseXML->ShipmentConfirmResponse->Response->Error->ErrorSeverity;\n\tif ($XMLFail && $XMLWarn == 'Warning') { // soft error, report it and continue\n\t\t$messageStack->add('UPS Label Request Warning # ' . $XMLFail . ' - ' . $ResponseXML->ShipmentConfirmResponse->Response->Error->ErrorDescription, 'caution');\n\t} elseif ($XMLFail && $XMLWarn <> 'Warning') { // hard error - return with bad news\n\t\t$messageStack->add('UPS Label Request Error # ' . $XMLFail . ' - ' . $ResponseXML->ShipmentConfirmResponse->Response->Error->ErrorDescription, 'error');\n\t\treturn false;\n\t}\n\n\t$digest = $ResponseXML->ShipmentConfirmResponse->ShipmentDigest;\n\t// Now resend request with digest to get the label\n\t$strXML = $this->FormatUPSAcceptRequest($digest);\n//echo 'Accept Request xmlString = ' . htmlspecialchars($strXML) . '<br />';\n\t$url = (MODULE_SHIPPING_UPS_TEST_MODE == 'Test') ? MODULE_SHIPPING_UPS_LABEL_URL_TEST : MODULE_SHIPPING_UPS_LABEL_URL;\n\t$SubmitXML = GetXMLString($strXML, $url, \"POST\");\n//echo 'Accept Response response string = ' . htmlspecialchars($SubmitXML['xmlString']) . '<br />';\n\t// Check for XML request errors\n\tif ($SubmitXML['result'] == 'error') {\n\t\t$messageStack->add(SHIPPING_UPS_CURL_ERROR . $SubmitXML['message'], 'error');\n\t\treturn false;\n\t}\n\t$ResponseXML = xml_to_object($SubmitXML['xmlString']);\n\t$XMLFail = $ResponseXML->ShipmentAcceptResponse->Response->Error->ErrorCode;\n\t$XMLWarn = $ResponseXML->ShipmentAcceptResponse->Response->Error->ErrorSeverity;\n\tif ($XMLFail && $XMLWarn == 'Warning') { // soft error, report it and continue\n\t $messageStack->add('UPS Label Retrieval Warning # ' . $XMLFail . ' - ' . $ResponseXML->ShipmentAcceptResponse->Response->Error->ErrorDescription, 'caution');\n\t} elseif ($XMLFail && $XMLWarn <> 'Warning') { // hard error - return with bad news\n\t $messageStack->add('UPS Label Retrieval Error # ' . $XMLFail . ' - ' . $ResponseXML->ShipmentAcceptResponse->Response->Error->ErrorDescription, 'error');\n\t return false;\n\t}\n\n\t// Fetch the UPS shipment information information\n\t$ups_results = array(\n//\t\t\t'tracking_number' => $ResponseXML->ShipmentAcceptResponse->ShipmentResults->ShipmentIdentificationNumber,\n\t\t'ref_id' => $sInfo->purchase_invoice_id . '-' . ($key + 1),\n\t\t'dim_weight' => $ResponseXML->ShipmentAcceptResponse->ShipmentResults->BillingWeight->Weight,\n\t\t'zone' => 'N/A',\n\t\t'billed_weight' => $ResponseXML->ShipmentAcceptResponse->ShipmentResults->BillingWeight->Weight,\n\t\t'net_cost' => $ResponseXML->ShipmentAcceptResponse->ShipmentResults->NegotiatedRates->NetSummaryCharges->GrandTotal->MonetaryValue,\n\t\t'book_cost' => $ResponseXML->ShipmentAcceptResponse->ShipmentResults->ShipmentCharges->TotalCharges->MonetaryValue,\n\t\t'delivery_date' => 'Not Provided',\n\t);\n\t// Fetch the package information and label\n\t$returnArray = array();\n\tif (!$ResponseXML->ShipmentAcceptResponse->ShipmentResults->PackageResults) {\n\t $messageStack->add('Error - No label found in return string.','error');\n\t return false;\t\t\t\t\n\t} else {\n\t if (!is_array($ResponseXML->ShipmentAcceptResponse->ShipmentResults->PackageResults)) {\n\t\t$ResponseXML->ShipmentAcceptResponse->ShipmentResults->PackageResults = array($ResponseXML->ShipmentAcceptResponse->ShipmentResults->PackageResults);\n\t }\n\t foreach ($ResponseXML->ShipmentAcceptResponse->ShipmentResults->PackageResults as $label) {\n\t\t$returnArray[] = $ups_results + array('tracking' => $label->TrackingNumber);\n\t\t$date = explode('-', $sInfo->ship_date); // date format YYYY-MM-DD\n\t\t$file_path = DIR_FS_MY_FILES . $_SESSION['company'] . '/shipping/labels/' . $this->code . '/' . $date[0] . '/' . $date[1] . '/' . $date[2] . '/';\n\t\tvalidate_path($file_path);\n\t\t$output_label = base64_decode($label->LabelImage->GraphicImage);\n\t\t$file_name = (MODULE_SHIPPING_UPS_PRINTER_TYPE == 'EPL') ? $label->TrackingNumber.'.lpt' : $label->TrackingNumber.'.gif';\n\t\tif (!$handle = fopen($file_path . $file_name, 'w')) { \n\t\t\t$messageStack->add('Cannot open file (' . $file_path . $file_name . ')','error');\n\t\t\treturn false;\n\t\t}\n\t\tif (fwrite($handle, $output_label) === false) {\n\t\t\t$messageStack->add('Cannot write to file (' . $file_path . $file_name . ')','error');\n\t\t\treturn false;\n\t\t}\n\t\tfclose($handle);\n\t }\n\t $messageStack->add_session('Successfully retrieved the UPS shipping label. Tracking # ' . $ups_results[$key]['tracking'],'success');\n\t}\n\treturn $returnArray;\n }", "public function getShippingInformation();", "protected function _generateLabelAndReturnLabel($order, $shipment)\n {\n $parcelshop = false;\n $billingAddress = $order->getBillingAddress();\n $shippingAddress = $order->getShippingAddress();\n if (strpos($order->getShippingMethod(), 'parcelshop') !== false) {\n $parcelshop = true;\n }\n if ($parcelshop) {\n $recipient = array(\n 'name1' => $billingAddress->getFirstname() . \" \" . $billingAddress->getLastname(),\n 'name2' => $billingAddress->getCompany(),\n 'street' => $billingAddress->getStreet(1),\n 'housenumber' => $billingAddress->getStreet(2),\n 'postalcode' => $billingAddress->getPostcode(),\n 'city' => $billingAddress->getCity(),\n 'country' => $billingAddress->getCountry(),\n 'commercialAddress' => (!$billingAddress->getCompany() ? false : true),\n );\n }\n else{\n\n $recipient = array(\n 'name1' => $shippingAddress->getFirstname() . \" \" . $shippingAddress->getLastname(),\n 'name2' => $shippingAddress->getCompany(),\n 'street' => $shippingAddress->getStreet(1),\n 'housenumber' => $shippingAddress->getStreet(2),\n 'postalcode' => $shippingAddress->getPostcode(),\n 'city' => $shippingAddress->getCity(),\n 'country' => $shippingAddress->getCountry(),\n 'commercialAddress' => (!$shippingAddress->getCompany() ? false : true),\n );\n }\n $labelWebserviceCallback = Mage::getSingleton('dpd/webservice')->getShippingLabel($recipient, $order, $shipment, $parcelshop);\n\n if ($labelWebserviceCallback) {\n\n try {\n\n\n $labels = $labelWebserviceCallback->getContent()['labelResponses'];\n $labelContent = [];\n $labelTrackingNumbers = [];\n $labelIdentifier = null;\n foreach ($labels as $label) {\n\n if (!empty($label['label'])) {\n\n $labelContent[] = base64_decode($label['label']);\n }\n $labelTrackingNumbers[] = implode('', $label['parcelNumbers']);\n\n if (is_null($labelIdentifier)) {\n $labelIdentifier = $label['shipmentIdentifier'];\n }\n }\n\n if (count($labelContent) > 0 && count($labelTrackingNumbers) > 0) {\n $parcelPdf = $this->combineLabelsPdf($labelContent);\n $generatedPdf = Mage::helper('dpd')->generatePdfAndSave($parcelPdf->render(), 'orderlabels', $labelIdentifier);\n\n return [\n 'identifier' => $labelIdentifier,\n 'trackingNumbers' => $labelTrackingNumbers,\n 'shipmentPdf' => $parcelPdf,\n 'pdfLabels' => $labelContent,\n 'pdfLabelsMerged' => $parcelPdf,\n 'pdfUrl' => $generatedPdf\n ];\n }\n\n } catch (\\Exception $exception) {\n Mage::helper('dpd')->log($exception->getMessage(), Zend_Log::ERR);\n Mage::getSingleton('adminhtml/session')->addError('Something went wrong with the webservice, please check the log files.');\n return false;\n }\n\n }\n\n return false;\n }", "function retrieveLabel($sInfo) {\r\n\t\tglobal $messageStack;\r\n\t\t$fedex_results = array();\r\n\t\tif (in_array($sInfo->ship_method, array('I2DEam','I2Dam','I3D','GndFrt'))) { // unsupported ship methods\r\n\t\t\t$messageStack->add('The ship method requested is not supported by this tool presently. Please ship the package via a different tool.','error');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tfor ($key = 0; $key < count($sInfo->package); $key++) {\r\n\t\t\t$strXML = $this->FormatFedExShipRequest($sInfo, $key);\r\n//echo 'xmlString = ' . htmlspecialchars($strXML) . '<br />';\r\n\t\t\t// error check for overweight, etc\r\n\t\t\t$SubmitXML = GetXMLString($strXML, $this->rate_url, \"POST\");\r\n//echo 'response string = ' . htmlspecialchars($SubmitXML['xmlString']) . '<br />';\r\n\t\t\t// Check for XML request errors\r\n\t\t\tif ($SubmitXML['result'] == 'error') {\r\n\t\t\t\t$messageStack->add(SHIPPING_FEDEX_CURL_ERROR . $SubmitXML['message'], 'error');\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t$ResponseXML = $SubmitXML['xmlString'];\r\n\t\t\t$XMLFail = GetNodeData($ResponseXML, 'Error:Code'); // Check for errors returned from FedEx\r\n\t\t\tif ($XMLFail) {\t// fetch the error code\r\n\t\t\t\t$messageStack->add('FedEx Label Error # ' . $XMLFail . ' - ' . GetNodeData($ResponseXML, 'Error:Message'),'error');\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t// TBD check for soft errors\r\n\t\r\n\t\t\t// Fetch the FedEx label information\r\n\t\t\t$fedex_results[$key] = array(\r\n\t\t\t\t'tracking' => GetNodeData($ResponseXML, 'Tracking:TrackingNumber'),\r\n\t\t\t\t'dim_weight' => GetNodeData($ResponseXML, 'EstimatedCharges:DimWeightUsed'),\r\n\t\t\t\t'zone' => GetNodeData($ResponseXML, 'EstimatedCharges:RateZone'),\r\n\t\t\t\t'billed_weight' => GetNodeData($ResponseXML, 'EstimatedCharges:BilledWeight'),\r\n\t\t\t\t'net_cost' => GetNodeData($ResponseXML, 'EstimatedCharges:DiscountedCharges:NetCharge'),\r\n\t\t\t\t'book_cost' => GetNodeData($ResponseXML, 'EstimatedCharges:ListCharges:NetCharge'),\r\n\t\t\t\t'delivery_date' => $this->FedExDate(GetNodeData($ResponseXML, 'Routing:DeliveryDate')));\r\n\t\t\tif ($key == 0) {\r\n\t\t\t\t$sInfo->master_tracking = $fedex_results[0]['tracking'];\r\n\t\t\t\t$sInfo->form_id = GetNodeData($ResponseXML, 'Tracking:FormID');\r\n\t\t\t}\r\n\r\n\t\t\t$label = GetNodeData($ResponseXML, 'Labels:OutboundLabel');\r\n\t\t\tif ($label) {\r\n\t\t\t\t$date = explode('-',$sInfo->terminal_date); // date format YYYY-MM-DD\r\n\t\t\t\t$file_path = DIR_FS_MY_FILES . $_SESSION['company'] . '/shipping/labels/' . $this->code . '/' . $date[0] . '/' . $date[1] . '/' . $date[2] . '/';\r\n\t\t\t\tvalidate_path($file_path);\r\n\t\t\t\t// check for label to be for thermal printer or plain paper\r\n\t\t\t\tif (MODULE_SHIPPING_FEDEX_PRINTER_TYPE == 'Thermal') {\r\n\t\t\t\t\t// keep the thermal label encoded for now\r\n\t\t\t\t\t$label = base64_decode($label);\r\n\t\t\t\t\t$file_name = $fedex_results[$key]['tracking'] . '.lpt'; // thermal printer\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$label = base64_decode($label);\r\n\t\t\t\t\t$file_name = $fedex_results[$key]['tracking'] . '.pdf'; // plain paper\r\n\t\t\t\t}\r\n\t\t\t\tif (!$handle = fopen($file_path . $file_name, 'w')) { \r\n\t\t\t\t\t$messageStack->add('Cannot open file (' . $file_path . $file_name . ')','error');\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tif (fwrite($handle, $label) === false) {\r\n\t\t\t\t\t$messageStack->add('Cannot write to file (' . $file_path . $file_name . ')','error');\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tfclose($handle);\r\n\t\t\t\t$messageStack->add_session('Successfully retrieved the FedEx shipping label. Tracking # ' . $fedex_results[$key]['tracking'],'success');\r\n\t\t\t} else {\r\n\t\t\t\t$messageStack->add('Error - No label found in return string.','error');\r\n\t\t\t\treturn false;\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $fedex_results;\r\n\t}", "public function printLabelAction()\n {\n try {\n $data = Mage::helper('enterprise_rma')->decodeTrackingHash($this->getRequest()->getParam('hash'));\n\n $rmaIncrementId = '';\n if ($data['key'] == 'rma_id') {\n $this->_loadValidRma($data['id']);\n if (Mage::registry('current_rma')) {\n $rmaIncrementId = Mage::registry('current_rma')->getIncrementId();\n }\n }\n $model = Mage::getModel('enterprise_rma/shipping_info')\n ->loadPackage($this->getRequest()->getParam('hash'));\n\n $shipping = Mage::getModel('enterprise_rma/shipping');\n $labelContent = $model->getShippingLabel();\n if ($labelContent) {\n $pdfContent = null;\n if (stripos($labelContent, '%PDF-') !== false) {\n $pdfContent = $labelContent;\n } else {\n $pdf = new Zend_Pdf();\n $page = $shipping->createPdfPageFromImageString($labelContent);\n if (!$page) {\n $this->_getSession()->addError(\n Mage::helper('sales')->__('File extension not known or unsupported type in the following shipment: %s', $shipping->getIncrementId())\n );\n }\n $pdf->pages[] = $page;\n $pdfContent = $pdf->render();\n }\n\n return $this->_prepareDownloadResponse(\n 'ShippingLabel(' . $rmaIncrementId . ').pdf',\n $pdfContent,\n 'application/pdf'\n );\n }\n } catch (Mage_Core_Exception $e) {\n $this->_getSession()->addError($e->getMessage());\n } catch (Exception $e) {\n Mage::logException($e);\n $this->_getSession()\n ->addError(Mage::helper('sales')->__('An error occurred while creating shipping label.'));\n }\n $this->norouteAction();\n return;\n }", "public function getShippingInfo();", "public function createReturnLabelRequest($label_id, $create_return_label_request_body)\n {\n // verify the required parameter 'label_id' is set\n if ($label_id === null || (is_array($label_id) && count($label_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $label_id when calling createReturnLabel'\n );\n }\n if (strlen($label_id) > 25) {\n throw new \\InvalidArgumentException('invalid length for \"$label_id\" when calling LabelsApi.createReturnLabel, must be smaller than or equal to 25.');\n }\n if (strlen($label_id) < 1) {\n throw new \\InvalidArgumentException('invalid length for \"$label_id\" when calling LabelsApi.createReturnLabel, must be bigger than or equal to 1.');\n }\n if (!preg_match(\"/^se(-[a-z0-9]+)+$/\", $label_id)) {\n throw new \\InvalidArgumentException(\"invalid value for \\\"label_id\\\" when calling LabelsApi.createReturnLabel, must conform to the pattern /^se(-[a-z0-9]+)+$/.\");\n }\n\n // verify the required parameter 'create_return_label_request_body' is set\n if ($create_return_label_request_body === null || (is_array($create_return_label_request_body) && count($create_return_label_request_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $create_return_label_request_body when calling createReturnLabel'\n );\n }\n\n $resourcePath = '/v1/labels/{label_id}/return';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($label_id !== null) {\n $resourcePath = str_replace(\n '{' . 'label_id' . '}',\n ObjectSerializer::toPathValue($label_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($create_return_label_request_body)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($create_return_label_request_body));\n } else {\n $httpBody = $create_return_label_request_body;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function getShippingConfigurationsRequest(): Request\n {\n $contentType = self::contentTypes['getShippingConfigurations'];\n\n $resourcePath = '/v3/settings/shippingprofile';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n $method = 'GET';\n\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n $contentType,\n $multipart\n );\n\n $defaultHeaders = parent::getDefaultHeaders();\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n $query = ObjectSerializer::buildQuery($queryParams);\n $requestInfo = [\n 'path' => $resourcePath,\n 'method' => $method,\n 'timestamp' => $defaultHeaders['WM_SEC.TIMESTAMP'],\n 'query' => $query,\n ];\n\n // this endpoint requires Bearer authentication (access token)\n $token = $this->config->getAccessToken();\n if ($token) {\n $headers['WM_SEC.ACCESS_TOKEN'] = $token->accessToken;\n }\n\n $operationHost = $this->config->getHost();\n return new Request(\n $method,\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getShippingDescription();", "public function getShippingLabel()\n {\n $label = $this->getData('shipping_label');\n if ($label) {\n return $this->getResource()->getReadConnection()->decodeVarbinary($label);\n }\n return $label;\n }", "public function getLabelByIdRequest($label_id, $label_download_type = null)\n {\n // verify the required parameter 'label_id' is set\n if ($label_id === null || (is_array($label_id) && count($label_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $label_id when calling getLabelById'\n );\n }\n if (strlen($label_id) > 25) {\n throw new \\InvalidArgumentException('invalid length for \"$label_id\" when calling LabelsApi.getLabelById, must be smaller than or equal to 25.');\n }\n if (strlen($label_id) < 1) {\n throw new \\InvalidArgumentException('invalid length for \"$label_id\" when calling LabelsApi.getLabelById, must be bigger than or equal to 1.');\n }\n if (!preg_match(\"/^se(-[a-z0-9]+)+$/\", $label_id)) {\n throw new \\InvalidArgumentException(\"invalid value for \\\"label_id\\\" when calling LabelsApi.getLabelById, must conform to the pattern /^se(-[a-z0-9]+)+$/.\");\n }\n\n\n $resourcePath = '/v1/labels/{label_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($label_download_type !== null) {\n if('form' === 'form' && is_array($label_download_type)) {\n foreach($label_download_type as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['label_download_type'] = $label_download_type;\n }\n }\n\n\n // path params\n if ($label_id !== null) {\n $resourcePath = str_replace(\n '{' . 'label_id' . '}',\n ObjectSerializer::toPathValue($label_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all user's orders if is staff, returns all
function get_orders($user_id) { $orders_details = select_collection("orders")->find([]); if (!$orders_details) { return false; } // for customer select only his orders (or all orders for staff if (is_customer() || is_staff()) { $orders = []; foreach ($orders_details as $item) { if ($item["customer_details"]["user_id"] == $user_id ||is_staff()) { $orders[] = $item; } } if (empty($orders)) { return false; } } else { $orders = $orders_details; } $o = []; foreach ($orders as $item) { $temp["date"] = $item["date"]; $temp["name"] = $item["customer_details"]["name"]; // get total price $price = 0; foreach ($item["items"] as $it) { $product_detail = select_collection("products")->findOne(["_id" => $it["product_id"]]); $price += $it["quantity"]*$product_detail["price"]; } $temp["price"] = $price; $temp["order_id"] = $item["_id"]; $temp["status"] = $item["status"]; $o[] = $temp; } return $o; }
[ "public function getAllByUser(){\n $sql = \"SELECT o.* FROM orders AS o \"\n .\"WHERE o.user_id= {$this->getUser_id()} ORDER BY id DESC\";\n $order = $this->db->query($sql);\n return $order;\n }", "function get_orders_for_user () {\n\n\t$userID = isset($_SESSION['user']['id']) ? $_SESSION['user']['id'] : 0;\n\t$rs = get_orders_user($userID);\n\n\treturn $rs;\n}", "public function getAllUserOrders() {\n $stmt = $this->conn->prepare(\"SELECT * FROM `order` \");\n // $stmt->bind_param(\"i\", $id_user);\n $stmt->execute();\n $orders = $stmt->get_result();\n $stmt->close();\n return $orders;\n }", "public function getUserOrders() {\n \n // Make connection to database\n $db = new dbConnection();\n $conn = $db->connect();\n \n // Create an instance of orderDataService, passing in the database connection\n $orderService = new orderDataService($conn);\n // Call getAllUserOrders in orderDataService\n $orders = $orderService->getAllUserOrders();\n \n // Return array of orders\n return $orders;\n }", "public function allOrders(){\n\t\trequire 'Database.php';\n\t\t$req = $db->query(\"SELECT orders.order_id, booster_id, order_price, order_status, users.username\n\t\t FROM orders \n\t\t INNER JOIN users \n\t\t ON booster_id = users.id\n\t\t WHERE status = 'Looking for booster'\");\n\t\t$orders = $req->fetchAll();\n\n\t\treturn $orders;\n\t}", "public function getByUser()\n {\n $userId = Auth::id();\n return $this->order->where('user_id', $userId)->get();\n }", "function getCurUserOrders(){\r\n \r\n \t$rs = getOrderUser();\r\n \t \t\r\n \treturn $rs;\r\n }", "public function listOrdersAdmin()\n {\n return DB::table('cart AS c')\n ->join('user AS u', 'u.id_user', '=', 'c.id_user')\n ->join('course AS cou', 'cou.id_course', '=', 'c.id_course')\n ->orderBy('order_date', 'DESC')\n ->paginate(4);\n }", "public function getOrderList($user_id = null, $status = null)\n {\n\n $type = strtolower($status);\n if ($user_id === null && $status === null) {\n return ShopOrder::find()->all();\n }\n if ($status === null && $user_id !== null) {\n $user_order_s = ShopOrder::find()->\n where([\n 'user_id' => $user_id\n ])->all();\n \n return $$user_order_s ;\n }\n if ($status !== null && $user_id === null) {\n $user_order_s = ShopOrder::find()->where([\n 'status' => $status\n ])->all();\n return $user_order_s;\n }\n $user_order_s = ShopOrder::find()->where([\n 'user_id' => $user_id\n ])->andWhere([\n 'status' => $status\n ])->all();\n return $user_order_s;\n }", "public function userOrders($user_id)\n\t{\n\t\treturn $this->order->where('user_id', $user_id)->orderBy('id', 'desc')->get();\n\t}", "function getAllOrders()\n\t{\n\t\t$api = getApi();\n\t\t$orders = $api->rest( 'GET', '/admin/orders.json' );\n\n\t\tif( isset( $orders ) ) {\n\n\t\t\techo \"<br> All orders:<br>\";\n\t\t\t//var_dump($orders);\n\t\t\treturn $orders;\n\t\t}\n\t}", "public function getUserByStaff(){\r\n\t\t$users = User::where('role_id', 1)->get();\r\n\t\treturn $users;\r\n\t}", "public function getAllOrdersByUser($user_id)\n \t\t{\n \t\t\t$this->db->where('orde_user_id', $user_id);\n \t\t\t$query = $this->db->get(\"order\");\n \t\t\t\n \t\t\t$orders = $query->result();\n \t\t\tforeach ($orders as $o)\t{\n \t\t\t$o->order_position = $this->getAllOrderPositions($o->orde_id);\n \t\t\t}\n \n \t\t\treturn $orders;\n \t\t}", "public function orders()\n {\n return $this->hasMany(Order::class, 'user_id', 'id');\n }", "public function getAllOrder(){\n $orders = DB::table('orders')->join('users', 'orders.user_id','=', 'users.id')->select('orders.*', 'users.username')->paginate(10);\n return view('dashboard.OrderHistory',['paginator'=>$orders]);\n }", "function getUsersOrders ($userId){\r\n return $this->callApi(\"Order_GetByDateAndUser\",array(\r\n \"UserId\"=>$userId,\r\n \"Start\"=>null,\r\n \"End\"=>null\r\n ));\r\n }", "function getOrders($userId = NULL) {\n try {\n global $db;\n\n $sql = \"SELECT order_id, user_id, shipping_date \";\n $sql .= \"FROM `orders`\";\n if($userId) $sql .= \" WHERE user_id = :userId\";\n $sql .= ';';\n\n $stmt = $db->prepare($sql);\n if($userId) $stmt->bindParam(':userId', $userId);\n $stmt->execute();\n\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return $results;\n\n } catch(PDOException $e) {die(\"Failed to retrieve order list\"); }\n }", "public function getCustomerOrders();", "function demorati_get_user_orders_and_items($uid) {\n $sql = array();\n \n $sql[] = \"SELECT o.oid,\";\n $sql[] = \" o.type,\";\n $sql[] = \" o.status,\";\n $sql[] = \" o.created,\";\n $sql[] = \" p.amount_subtotal,\";\n $sql[] = \" GROUP_CONCAT(DISTINCT i.title ORDER BY i.title SEPARATOR ', ') AS items\";\n $sql[] = \"FROM demorati_order o\";\n $sql[] = \"LEFT JOIN demorati_order_item i ON o.oid = i.oid\";\n $sql[] = \"LEFT JOIN demorati_order_payment p ON o.oid = p.oid\";\n $sql[] = \"WHERE o.uid = :uid\";\n $sql[] = \"AND o.status IN ('processing', 'pending', 'complete')\";\n $sql[] = \"AND i.deleted IS NULL\";\n $sql[] = \"GROUP BY o.oid,\";\n $sql[] = \" o.type,\";\n $sql[] = \" o.status,\";\n $sql[] = \" o.created,\";\n $sql[] = \" p.amount_subtotal\";\n $sql[] = \"ORDER BY oid DESC\";\n \n $params = array(\n ':uid' => $uid\n );\n \n return db_query(\n implode(PHP_EOL, $sql), \n $params\n )->fetchAll();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Decrease number of region items, given a region id
public function decreaseNumItems($regionId) { if(!is_numeric($regionId)) { return false; } $this->dao->select( 'i_num_items' ); $this->dao->from( $this->getTableName() ); $this->dao->where( $this->getPrimaryKey(), $regionId ); $result = $this->dao->get(); $regionStat = $result->row(); if( isset( $regionStat['i_num_items'] ) ) { $this->dao->from( $this->getTableName() ); $this->dao->set( 'i_num_items', 'i_num_items - 1', false ); $this->dao->where( 'i_num_items > 0' ); $this->dao->where( 'fk_i_region_id', $regionId ); return $this->dao->update(); } return false; }
[ "function decrementItem($id);", "function decrease_capacity () {\n\t\t\n\t\tglobal $zurich;\n\t\t\n\t\t$key = get_param('close_res_number'); \n\t\tif(!$key) $key = $this->oldest();\n\t\tif ($key) {\n\t\t log_and_confirm(\"reduced capacity by closing a reservoir\", $this->id, 3);\n\t\t\tunset($this->reservoirs[$key]);\n\t\t\t}\n\t\telse {\n\t log_act(\"No reservoir to close!\", $this->id, 3);\n\t\t}\n\t}", "function region($id) {\n\t\t$this->regions[] = intval($id);\n\t}", "public function decreaseQuantity()\r\n {\r\n $cart = $this->cart;\r\n $cartProducts = $cart->cartProducts;\r\n foreach($cartProducts as $cartProduct){\r\n $cartProduct->decreaseQuantity();\r\n }\r\n }", "public function decreaseQuantity($itemId, $qty=1){\n foreach($this->items as $k=>$v){\n if($v['id']==$itemId) $this->items[$k]['qty'] = ($v['qty']-$qty);\n };\n }", "public function DeleteRegion($name){\n $regionNode = $this->_getRegionNode($name);\n $parent = $regionNode->parentNode;\n $parent->removeChild($regionNode);\n DataAccess::GetInstance()->saveXML();\n }", "public function Remove($regionName)\n {\n \n }", "public function removeItem($id){\n $this->totalQty -= $this->items[$id]['qty'];\n $this->totalPrice -= $this->items[$id]['price'];\n\n unset($this->items[$id]);\n }", "public function reduceSellIn(): void\n {\n --$this->sell_in;\n }", "public function removeAllRegions(): void\n {\n $this->regions = new ObjectStorage();\n }", "public function ReduceByOne($id)\n { \n // reduce quantity this item form cart\n $this->items[$id]['quantity']--;\n\n //reduce total price this item \n\n $this->items[$id]['price'] -=$this->items[$id]['item']['price'];\n\n $this->totalQuantity--;\n \n $this->totalPrice -= $this->items[$id]['item']['price'];\n\n //To ensure that the quantity is not reduced less than zero\n\n if($this->items[$id]['quantity'] <= 0)\n {\n unset($this->items[$id]);\n }\n }", "function hook_dashboard_regions_alter($regions) {\n // Remove the sidebar region defined by the core dashboard module.\n unset($regions['dashboard_sidebar']);\n}", "public function increaseNumItems($regionId)\n {\n if(!is_numeric($regionId)) {\n return false;\n }\n $sql = sprintf('INSERT INTO %s (fk_i_region_id, i_num_items) VALUES (%d, 1) ON DUPLICATE KEY UPDATE i_num_items = i_num_items + 1', $this->getTableName(), $regionId);\n return $this->dao->query($sql);\n }", "public function decrement_quantity(){\n\t\t$mysql = mysql_connection::get_instance();\n\t\t\n\t\t$stmt = $mysql->prepare('UPDATE `items` SET `item_quantity` = `item_quantity` - 1 WHERE `item_id` = ?');\n\t\t$stmt->bind_param('i', $this->id);\n\t\t$stmt->execute();\n\t\t$stmt->close();\n\t}", "public function removeBlock()\n{\nif ($this->blocks > 0)\n$this->blocks--;\n}", "public function decreaseRowspan($cell_id) {\n $i = $this->findRowspan($cell_id);\n if ($i == -1) {\n return;\n }\n $rs = $this->rowspans[$i]->getRowspan() - 1;\n $this->rowspans[$i]->setRowspan($rs);\n\n //remove from array\n if ($rs == 0) {\n unset($this->rowspans[$i]);\n $this->rowspans = array_values($this->rowspans);\n }\n }", "private function truncateToLimit()\n {\n if (count($this->idsBySku) > $this->idsLimit) {\n $this->idsBySku = array_slice($this->idsBySku, round($this->idsLimit / -2));\n }\n }", "public function deleteWidget($region, $id) {\n \t$this->checkSettings();\n\n $widgetsKey = NodeSettingModel::SETTING_WIDGETS . '.' . $region;\n $widgetsValue = $this->settings->get($widgetsKey);\n $widgetIds = explode(',', $widgetsValue);\n $widgetsValue = '';\n\n $foundWidget = false;\n foreach ($widgetIds as $widgetId) {\n if ($id == $widgetId) {\n \t$foundWidget = true;\n continue;\n }\n $widgetsValue .= ($widgetsValue ? NodeSettingModel::WIDGETS_SEPARATOR : '') . $widgetId;\n }\n\n if (!$foundWidget) {\n \tthrow new ZiboException('Could not find the widget with id ' . $id);\n }\n\n $this->settings = new WidgetSettings($id, $this->settings);\n $this->settings->clearWidgetProperties();\n $this->settings->set($widgetsKey, $widgetsValue);\n }", "public function decrease_item($id,$qty)\n {\n Cart::update($id,$qty -1);\n return redirect()->back();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Bootstraps application and returns Doctrine Resource instnace
private function _getDoctrineResource($environment) { /* @var $projectProfile Zend_Tool_Project_Profile */ $projectProfile = $this->_loadProfileRequired(); $applicationConfigFile = $projectProfile ->search('ApplicationConfigFile'); $applicationDirectory = $projectProfile ->search('ApplicationDirectory'); define('APPLICATION_PATH', $applicationDirectory->getPath()); $applicationOptions = array(); $applicationOptions['config'] = $applicationConfigFile->getPath(); $application = new Zend_Application($environment, $applicationOptions); $application->bootstrap(); return $application->getBootstrap() ->getPluginResource('Doctrine'); }
[ "public function appBootstrap() {\n\t\t$this->application = \n\t\t\tnew Zend_Application(APPLICATION_ENV,\n\t\t\t\t\t\t\t\tAPPLICATION_PATH . '/configs/application.ini');\n\t\t$this->application->bootstrap();\n\t\t\n\t\tZend_Controller_Front::getInstance()->setParam('bootstrap', $this->application->getBootstrap());\n\t\t$this->em = $this->application->getBootstrap()->getResource('doctrine'); \n\t}", "protected function _initModel()\n {\n //$doctrine->init();\n //$container = $this->getResource('doctrine');\n date_default_timezone_set('Europe/Warsaw');\n $config = $this->getOptions();\n// echo('<pre>');\n// print_r($config);\n// echo('</pre>');\n $this->registerAutoloaders($config);\n $container = new Bisna\\Application\\Container\\DoctrineContainer($config['resources']['doctrine']);\n \\Zend_Registry::set('doctrine', $container);\n return $container;\n }", "protected function bootstrapDoctrine () {\n\t\t$this -> register(new DoctrineServiceProvider(), array(\n\t\t\t\"db.options\" => $this -> config_loader -> getDatabaseConfig() -> preserialise()\n\t\t));\n\n\t\t$this[\"app.doctrine.cache.driver\"] = $this -> share(function () {\n\t\t\treturn $this -> instantiateDoctrineCacheDriver();\n\t\t});\n\n\t\t$this[\"app.doctrine.entitymanager\"] = $this -> share(function () {\n\t\t\treturn Generator::manufacture(\n\t\t\t\tself::getDBConnection(),\n\t\t\t\tself::getDoctrineCacheDriver(),\n\t\t\t\t$this -> instantiateDoctrineAnnotationReader(),\n\t\t\t\t$this -> config_loader -> getEntityPaths(),\n\t\t\t\t$this[\"app.config\"][\"doctrine.proxies.autogenerate_strategy\"],\n\t\t\t\t$this[\"app.config\"][\"doctrine.ensure_production_settings\"],\n\t\t\t\t$this[\"app.config\"][\"environment.root_path\"] . Generator::DOCTRINE_ANNOTATIONS_FILE_PATH,\n\t\t\t\t$this[\"app.config\"][\"doctrine.proxies.namespace\"],\n\t\t\t\t$this[\"app.config\"][\"environment.root_path\"] . $this[\"app.config\"][\"doctrine.proxies.directory\"]\n\t\t\t);\n\t\t});\n\t}", "final protected function _bootstrap($resource = null)\n {\n $this->_executeResource('zf2');\n return parent::_bootstrap($resource);\n }", "public function repository(): CrudRepository\n {\n return new ResourceRepository();\n }", "protected function _initDoctrineExtra()\n {\n \n $doctrine = $this->bootstrap('doctrine')->getResource('doctrine');\n \n $em = $doctrine->getEntityManager();\n \n Zend_Registry::set('em', $em);\n }", "public function service()\n {\n return new ResourceService();\n }", "public function getResourceInstance()\n {\n $resource_name = $this->getResourceName();\n return sfPropelVersionableBehavior::populateResourceFromVersion(new $resource_name(), $this);\n }", "protected function bootstrapDomainResources()\n {\n foreach ($this->resources as $alias => $resource) {\n $this->serviceLocator->setService($alias, $resource);\n }\n }", "private function loadResourcesManager(){\n return ReflectionManager::instanceFromFile( Configurations::get(\"app\", \"resourcesManager\")[\"class\"],\n Configurations::get(\"app\", \"resourcesManager\")[\"file\"], $this->request);\n }", "public function _initDoctrine() {\n require_once 'Doctrine.php';\n\n //Get a Zend Autoloader instance\n $loader = Zend_Loader_Autoloader::getInstance();\n\n //Autoload all the Doctrine files\n $loader->pushAutoloader(array('Doctrine', 'autoload'));\n\n //Get the Doctrine settings from application.ini\n $doctrineConfig = $this->getOption('doctrine');\n\n //Get a Doctrine Manager instance so we can set some settings\n $manager = Doctrine_Manager::getInstance();\n\n //set models to be autoloaded and not included (Doctrine_Core::MODEL_LOADING_AGGRESSIVE)\n $manager->setAttribute(\n Doctrine::ATTR_MODEL_LOADING, Doctrine::MODEL_LOADING_CONSERVATIVE);\n\n //enable ModelTable classes to be loaded automatically\n $manager->setAttribute(\n Doctrine_Core::ATTR_AUTOLOAD_TABLE_CLASSES, true\n );\n\n //enable validation on save()\n $manager->setAttribute(\n Doctrine_Core::ATTR_VALIDATE, Doctrine_Core::VALIDATE_ALL\n );\n\n //enable sql callbacks to make SoftDelete and other behaviours work transparently\n $manager->setAttribute(\n Doctrine_Core::ATTR_USE_DQL_CALLBACKS, true\n );\n\n //not entirely sure what this does :)\n $manager->setAttribute(\n Doctrine_Core::ATTR_AUTO_ACCESSOR_OVERRIDE, true\n );\n\n //enable automatic queries resource freeing\n $manager->setAttribute(\n Doctrine_Core::ATTR_AUTO_FREE_QUERY_OBJECTS, true\n );\n\n //connect to database\n $manager->openConnection($doctrineConfig['connection_string']);\n\n //set to utf8\n $manager->connection()->setCharset('utf8');\n\n return $manager;\n }", "public static function singleton()\n {\n return new Resource();\n }", "public function _initAutoloader() {\n $autoloader = Zend_Loader_Autoloader::getInstance();\n\n $resourceLoader = new Zend_Loader_Autoloader_Resource( array('basePath' => APPLICATION_PATH . '/models', 'namespace' => 'Model'));\n $resourceLoader -> addResourceType('DbTable', 'DbTable/', 'DbTable');\n $resourceLoader -> addResourceType('DbRow', 'DbRow/', 'DbRow');\n $resourceLoader -> addResourceType('Static', 'Static/', 'Static');\n }", "static function createResourceServer()\n {\n // creating HeimdallResourceServer config\n $config = Heimdall::withResourceConfig(\n new AccessTokenRepository(),\n __DIR__ . '/public.key'\n );\n\n // return a new instance of HeimdallResourceServer\n return Heimdall::initializeResourceServer($config);\n }", "public function init()\n {\n\t\t$config = new Configuration();\n\t\t$config->setProxyDir(__DIR__ . '/Cache');\n\t\t$config->setProxyNamespace('Proxies');\n\t\t\n\t\t$config->setHydratorDir(__DIR__ . '/Cache');\n\t\t$config->setHydratorNamespace('Hydrators');\n\t\t\n\t\t$reader = new AnnotationReader();\n\t\t$reader->setDefaultAnnotationNamespace('Doctrine\\ODM\\MongoDB\\Mapping\\\\');\n\t\t$config->setMetadataDriverImpl(new AnnotationDriver($reader, __DIR__ . '/Documents'));\n\t\t\n\t\t$dm = DocumentManager::create(new Connection(), $config);\n\t\t\\Zend_Registry::set('dm', $dm);\n\t\treturn $dm;\n }", "protected function init()\n {\n self::$kernel = self::createKernel();\n self::$kernel->init();\n self::$kernel->boot();\n\n $this->container = self::$kernel->getContainer();\n $this->documentManager = self::$kernel->getContainer()->get('doctrine_phpcr.odm.document_manager');\n }", "public function _construct()\n {\n $this->_init(ResourceModel::class);\n }", "protected function _initAutoloadRessource()\r\n\t{\r\n\t\t// Configuration de l'Autoload\r\n\t\t$ressourceLoader = new Zend_Loader_Autoloader_Resource(array(\r\n\t\t\t'namespace' => 'Default',\r\n\t\t\t'basePath' => dirname(__FILE__),\r\n\t\t));\r\n\t \r\n\t\t// Permet d'indiquer les répertoires dans lesquels se trouveront nos classes: l'ACL et le pugin\r\n\t\t$ressourceLoader->addResourceType('form', 'forms/', 'Form')\r\n\t\t\t\t\t\t->addResourceType('acl', 'acls/', 'Acl')\r\n\t\t\t\t\t\t->addResourceType('model', 'models/', 'Model')\r\n\t\t\t\t\t\t->addResourceType('plugin', 'plugins/', 'Controller_Plugin')\r\n\t\t\t\t\t\t// Ajout du nouveau dossier pdfs pour l'autoload\r\n\t\t\t\t\t\t->addResourceType('pdf', 'pdfs/', 'Pdf');\r\n\t \r\n\t\treturn $ressourceLoader;\r\n\t}", "public function bootstrap();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Indicates to skip this component in the converion process
public function skipComponent() : bool;
[ "public function skip()\n {\n $this->stopPropagation();\n\n $this->skipped = true;\n }", "private function skip()\n\t{\n\t\t$this->skip = TRUE;\n\t}", "public function skip()\n\t{\n\t\treturn false;\n\t}", "public function skipOperation(bool $skip): void\n {\n }", "public function skip()\n {\n }", "public function set_skip()\n\t{\n\t\t$this->__skip = true;\n\t}", "public function isSkip(): bool\n {\n return $this->mode == self::SKIP;\n }", "public function skip() {\n\t\t$this->state->token = TokenConst::$SKIP_TOKEN;\n\t}", "public function skipProcessInput();", "public function skip() {\n if (!$this->isSkipped()) {\n // Store skip data.\n $this->config->set('skipped', TRUE);\n $this->config->set('skipped_by', $this->currentUser()->id());\n $this->config->set('skipped_on', time());\n $this->config->save();\n\n // Log.\n $context = ['@name' => $this->getTitle()];\n $this->securityReview()->log($this, '@name check skipped', $context, RfcLogLevel::NOTICE);\n }\n }", "public function setSkipMode(bool $skip): void;", "public function skip()\n {\n return $this->skip;\n }", "protected function skip()\n\t\t{\n\t\t\tif ($this->space()) {\n\t\t\t\t$this->switchState(self::STATE_SKIP_SPACE);\n\t\t\t}\n\n\t\t\tif ($this->sharp() || $this->newLine()) {\n\t\t\t\t$this->switchState(self::STATE_SKIP_LINE);\n\t\t\t}\n\t\t}", "public function skipped(){\r\n\t\t\t$this->append('<span class=\"text-warning\"> Skipped</span>');\r\n\t\t}", "public function skipExecution(ProgressEvent $event)\n {\n }", "public function skip()\n\t{\n\t\treturn call_user_func_array([$this, 'markTestSkipped'], func_get_args());\n\t}", "protected function skipTurn() {\n $this->lastPiece = $this->lastPiece->opposite();\n }", "public function skipWaiting(){\n $this->proxy->skipWaitingTime();\n }", "public function isSkipped()\n {\n return (bool) $this->getOption(static::SKIP_DIFF);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Written by William Sengdara April 21, 2019 Generates a table dynamically from a SQL query : columns are used for table TH values are used for table TD Parameters: $tableid unused id to be used for the new table (e.g. table1) if set, dataTable() will be called on the table. title title above table $description description after the title $sql SQL query Example usage: $sql1 = "SELECT m.name AS `month`, (SELECT SUM(d.value) FROM sample_data_2 d WHERE d.sex_id = 1 AND d.month_id =m.id ) AS `M`, (SELECT SUM(d.value) FROM sample_data_2 d WHERE d.sex_id = 2 AND d.month_id =m.id) AS `F`, (SELECT SUM(d.value) FROM sample_data_2 d WHERE d.sex_id = 3 AND d.month_id =m.id) AS `O` FROM sample_data_2 d, sample_data_months m WHERE d.month_id = m.id GROUP BY m.id;"; $sql2 = "SELECT m.name `month`, SUM(d.value) `total` FROM sample_data_1 d, sample_data_months m WHERE d.month_id = m.id GROUP BY m.id;"; echo generateHorizontalTableFromQuery("table1", "Table Generator", "Testing the table generator", $sql1);
function generateHorizontalTableFromQuery($tableid, $title, $description, $sql){ global $database; $rec = $database->query($sql); if (!$rec || !$rec->num_rows){ return $database->error; } $field_names = array(); $fields = ""; $body = ""; // first field $field_names[] = "<th>Category</th>"; while ($row = $rec->fetch_array()){ $col = $row[0]; $field_names[] = "<th>$col</th>"; } $fields = implode("", $field_names); mysqli_data_seek($rec, 0); $keys = array(); $row = $rec->fetch_array(); $keys_ = array_keys($row); $idx = 0; foreach($keys_ as $key){ if (! is_numeric($key) && $idx > 1){ $keys[] = $key; } $idx++; } mysqli_data_seek($rec, 0); $data = ""; $body = ""; $total_fields = sizeof($field_names); // account for category $datasets = []; $idx = 1; while ($row = $rec->fetch_array()){ foreach($keys as $category) { $data = $row[$category]; if (!$data) $data = 0; $datasets[$category][] = "<td>$data</td>"; } } foreach ($datasets as $key=>$arr){ $data = implode("", $arr); $body .= "<tr><td>$key</td>$data</tr>"; $idx++; } return "<h5 style='font-weight:bold'>$title <small class='pull-right'>$description</small></h5> <div class='table-responsive' style='overflow-x:scroll;'> <table class='table table-hover table-bordered' id='$tableid'> <thead> <tr>$fields</tr> </thead> <tbody> $body </tbody> </table> </div>"; }
[ "function queryToTable($sql,$title=\"\",$outputToPage=false,$tableWidth=null)\r\n{\t\r\n\tglobal $lang;\r\n\t$QQuery = db_query($sql);\r\n\t$num_rows = db_num_rows($QQuery);\r\n\t$num_cols = db_num_fields($QQuery);\r\n\t$failedText = ($QQuery ? \"\" : \"<span style='color:red;'>ERROR - Query failed!</span>\");\r\n\t$tableWidth = (is_numeric($tableWidth) && $tableWidth > 0) ? \"width:{$tableWidth}px;\" : \"\";\r\n\t\r\n\t$html_string = \"<table class='dt2' style='font-family:Verdana;font-size:11px;$tableWidth'>\r\n\t\t\t\t\t\t<tr class='grp2'><td colspan='$num_cols'>\r\n\t\t\t\t\t\t\t<div style='color:#800000;font-size:14px;max-width:700px;'>$title</div>\r\n\t\t\t\t\t\t\t<div style='font-size:11px;padding:12px 0 3px;'>\r\n\t\t\t\t\t\t\t\t<b>{$lang['custom_reports_02']}&nbsp; <span style='font-size:13px;color:#800000'>$num_rows</span></b>\r\n\t\t\t\t\t\t\t\t$failedText\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</td></tr>\r\n\t\t\t\t\t\t<tr class='hdr2' style='white-space:normal;'>\";\r\n\t\t\t\t\t\t\t\r\n\tif ($num_rows > 0) {\r\n\t\t\r\n\t\t// Display column names as table headers\r\n\t\tfor ($i = 0; $i < $num_cols; $i++) {\r\n\t\t\t\r\n\t\t\t$this_fieldname = db_field_name($QQuery,$i);\t\t\t\r\n\t\t\t//Display the \"fieldname\"\r\n\t\t\t$html_string .= \"<td style='padding:5px;'>$this_fieldname</td>\";\r\n\t\t}\t\t\t\r\n\t\t$html_string .= \"</tr>\";\t\r\n\t\t\r\n\t\t// Display each table row\r\n\t\t$j = 1;\r\n\t\twhile ($row = db_fetch_array($QQuery)) {\r\n\t\t\t$class = ($j%2==1) ? \"odd\" : \"even\";\r\n\t\t\t$html_string .= \"<tr class='$class notranslate'>\";\t\t\t\r\n\t\t\tfor ($i = 0; $i < $num_cols; $i++) \r\n\t\t\t{\r\n\t\t\t\t// Escape the value in case of harmful tags\r\n\t\t\t\t$this_value = htmlspecialchars(html_entity_decode($row[$i], ENT_QUOTES), ENT_QUOTES);\r\n\t\t\t\t$html_string .= \"<td style='padding:3px;border-top:1px solid #CCCCCC;font-size:11px;'>$this_value</td>\";\r\n\t\t\t}\t\t\t\r\n\t\t\t$html_string .= \"</tr>\";\r\n\t\t\t$j++;\r\n\t\t}\r\n\t\t\r\n\t\t$html_string .= \"</table>\";\r\n\t\t\r\n\t} else {\r\n\t\r\n\t\tfor ($i = 0; $i < $num_cols; $i++) {\r\n\t\t\t\t\r\n\t\t\t$this_fieldname = db_field_name($QQuery,$i);\r\n\t\t\t\t\r\n\t\t\t//Display the Label and Field name\r\n\t\t\t$html_string .= \"<td style='padding:5px;'>$this_fieldname</td>\";\r\n\t\t}\r\n\t\t\r\n\t\t$html_string .= \"</tr><tr><td colspan='$num_cols' style='font-weight:bold;padding:10px;color:#800000;'>{$lang['custom_reports_06']}</td></tr></table>\";\r\n\t\t\r\n\t}\r\n\t\r\n\tif ($outputToPage) {\r\n\t\t// Output table to page\r\n\t\tprint $html_string;\r\n\t} else {\r\n\t\t// Return table as HTML\r\n\t\treturn $html_string;\r\n\t}\r\n}", "static public function table( $data, $id )\r\n { \r\n if ( empty($data) || !is_array($data) ) return ''; \r\n \r\n $table = '<table id=\"'. htmlspecialchars($id) .'\"><thead><tr><th>';\r\n $table .= implode('</th><th>', array_shift($data) );\r\n $table .= '</th></thead><tbody>';\r\n foreach ( $data as $key => $row )\r\n $table .= '<tr><td>' . implode('</td><td>',$row) . '</td></tr>';\r\n $table .= '</tbody></table>';\r\n \r\n return $table;\r\n }", "function createHorizontalTable()\n {\n if ($this->data)\n {\n $this->setStyle();\n $this->html=\"<table style=\\\"\".$this->customization[\"table_style\"].\"\\\">\";\n if($this->title)\n $this->html.=\"<tr><td colspan=\\\"\".count($this->data[0]).\"\\\" class=\\\"link_head\\\">\".$this->title.\"</td></tr>\";\n\n $this->setDisplayColumnNorder();\n\n if($this->set_column_heading)\n {\n foreach($this->customization[\"display_order\"] as $value)\n $this->html.=\"<th class=\\\"link_head\\\" style=\\\"\".$this->customization[\"th_style\"].\"\\\">\".$this->customization[\"display_columns\"][$value].\"</th>\";\n }\n\n $i=0;\n foreach($this->data as $key=>$value)\n {\n //want different formatting for alternate rows\n if($this->highlight)\n $class=($i=!$i)?\"row1\":\"row2\";\n $this->html.=\"<tr class=\\\"$class\\\" style=\\\"\".$this->customization[\"tr_style\"].\"\\\">\";\n foreach($this->customization[\"display_order\"] as $column)\n {\n $this->customization[\"column_style\"][$column]=($this->customization[\"column_style\"][$column])?$this->customization[\"column_style\"][$column]:\"text-align:center\";\n $this->html.=\"<td style=\\\"\".$this->customization[\"column_style\"][$column].\"\\\">\".$this->formatColumn($column,$this->data[$key][$column]).\"</td>\";\n }\n $this->html.=\"</tr>\";\n }\n\n $this->html.=\"</table>\";\n unset($this->title);\n return $this->html;\n }\n }", "function prikazi_sqltabelu($sql_tabela) {\n\n\tglobal $db;\n\n\techo \"<table class='dt-table'>\";\n\techo \"<h2>\" . $sql_tabela . \"</h2>\";\n\n\t// generisanje headera tabele (prikaz podataka)\n\n\t$komanda_head = \"SELECT * FROM $sql_tabela LIMIT 1\";\n\t$result_head = mysql_query($komanda_head, $db);\t\n\n\twhile ( $red = mysql_fetch_assoc($result_head) ) :\n\n\t\t$m = 0;\n\n\t\techo \"<tr class='dt-table'>\";\n\n\t\tforeach ($red as $item) {\n\t\n\t\t\t$kolona = mysql_field_name($result_head, $m);\n \t\t\techo \"<td class='dt-table'>\" . $kolona . \"</td>\";\n \t\t\t//echo \"<td>\" . $item . \"</td>\";\n \t\t$m++;\n\n\t\t}\n\n\t\techo \"</tr>\";\n\n\tendwhile;\n\n\t// generisanje tela tabele (prikaz podataka)\n\n\t$komanda_body = \"SELECT * FROM $sql_tabela\";\n\t$result_body = mysql_query($komanda_body, $db);\n\n\n\twhile ( $red = mysql_fetch_assoc($result_body) ) :\n\n\t\t$n = 0;\n\n\t\techo \"<tr class='dt-table'>\";\n\n\t\tforeach ($red as $item) {\n\t\n\t\t\t$kolona = mysql_field_name($result_body, $n);\n \t\t\techo \"<td class='dt-table'>\" . $item . \"</td>\";\n \t\t$n++;\n\n\t\t}\n\n\t\techo \"</tr>\";\n\n\tendwhile;\n\n\techo \"</table>\";\n\n}", "public function generateTable()\r\n {\r\n \r\n $table = '<table class=\"'.$this->default_class.' '.$this->table_class.'\" id=\"'.$this->table_id.'\">';\r\n $table .= '<thead><tr>';\r\n\r\n foreach($this->columns as $key => $column)\r\n {\r\n \tif($column->getIsHidden()) {\r\n \t\tcontinue;\r\n \t}\r\n \t\r\n $class = ($column->getEditable()) ? 'th_editable' : '';\r\n $table .= '<th class=\"'.$class.'\" width=\"'.$column->getWidth().'\">'.$column->getTitle().'</th>';\r\n } \r\n $rows = $table;\r\n $table .= \"</tr></thead>\";\r\n $table .= \"<tbody></tbody\";\r\n\r\n $table .= \"</table>\";\r\n \r\n $js = $this->getJavaScript();\r\n \r\n return $table.$js;\r\n\r\n }", "function sql_to_html_table($sqlresult, $delim=\"\\n\") {\n // starting table\n $htmltable = \"<table border='1' width='100%'>\" . $delim ; \n $counter = 0 ;\n // putting in lines\n while( $row = $sqlresult->fetch_assoc() ){\n if ( $counter===0 ) {\n // table header\n $htmltable .= \"<tr>\" . $delim;\n foreach ($row as $key => $value ) {\n $htmltable .= \"<th>\" . ucwords($key) . \"</th>\" . $delim ;\n }\n $htmltable .= \"</tr>\" . $delim ; \n $counter = 22;\n } \n // table body\n $htmltable .= \"<tr>\" . $delim ;\n foreach ($row as $key => $value ) {\n $htmltable .= \"<td>\" . $value . \"</td>\" . $delim ;\n }\n $htmltable .= \"</tr>\" . $delim ;\n }\n // closing table\n $htmltable .= \"</table>\" . $delim ; \n // return\n return( $htmltable ) ; \n}", "function generate_table($array, $columns, $table_id='', $table_class='') {\n $array_size = count($array);\n $col_size = ceil($array_size / $columns);\n \n $table = \"<table\";\n $table .= !empty($table_id) ? \" id='\".$table_id.\"'\" : '';\n $table .= !empty($table_class) ? \" class='\".$table_class.\"'\" : '';\n $table .= \">\\n\";\n for ($i = 0; $i < $col_size; $i++) {\n $table .= \"\\t<tr>\";\n for ($j = 0; $j < $columns; $j++) {\n $table .= (($i+$j*$col_size) < $array_size) ? '<td>'.$array[$i+$j*$col_size].'</td>' : '<td>&nbsp;</td>';\n }\n $table .= \"</tr>\\n\";\n }\n $table .= \"</table>\\n\";\n return $table;\n}", "function createHorizontalViewHTMLTable($table_name, $table_def, $data, $table_tags = '')\n{\n\t$thead_name = $table_name . '_thead';\n\t$tbody_name = $table_name . '_tbody';\n\t$tfoot_name = $table_name . '_tfoot';\n\t\n\t\n\t$html = '<TABLE id=\"'.$table_name.'\" name=\"'.$table_name.'\" '.$table_tags.'>';\t\n\t$html .= '<thead id=\"'.$thead_name.'\" name=\"'.$thead_name.'\" >' .newline();\n\t$html .= '<tr>'.newline();\n\tfor($i=0;$i<sizeof($table_def);$i++)\n\t{\n\t\t$html .= createTHFromTD_def($table_def[$i]);\n\t}\n\t$html .= '</tr>'.newline();\n\t$html .= '</thead>'.newline();\n\t//this is the body\n\t$html .= '\t<tbody id=\"'.$tbody_name.'\" name=\"'.$tbody_name.'\" >';\n\t$html .= '<tr>'.newline();\n\tfor($col=0;$col<sizeof($table_def);$col++)\n\t{\n\t\t//$html .= createTDFromTD_def($table_def[$col]);\n\t\tif(isset($table_def[$col]['tags']))\n\t\t{\n\t\t\t$html.= '<td ' . $table_def[$col]['tags']. ' >'.$data[$table_def[$col]['db_field']] . '</td>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$html.= '<td>'.$data[$table_def[$col]['db_field']] . '</td>';\n\t\t}\n\t}\n\t$html .= '</tr>'.newline();\n\t$html .= '</table>';\n\treturn $html;\n\t\n\t\n}", "public function createTable()\n\t{\n\t\t$data = $this->loadData();\n?>\n\t\t\t<table>\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>Année</th>\n\t\t\t\t\t\t<th>Mois</th>\n\t\t\t\t\t\t<th>Trial Utilisateurs</th>\n\t\t\t\t\t\t<th>Utilisateurs payants</th>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n<?php\t\t\t\t\t\n\t\tforeach($data as $users)\n\t\t{\t\n\t\t\techo \"<tr>\";\n\t\t\tfor($i=0; $i < sizeof($users); $i++)\n\t\t\t{\n\t\t\t\techo \"<td>\" . $users[$i] . \"</td>\";\n\t\t\t}\n\t\t\techo \"</tr>\";\n\n\t\t}\n\t\t\n\t\t\t\techo \"</tbody>\";\n\t\t\techo\"</table>\";\n\t}", "function make_table($query) {\r\n $table = '<table class=\"tbl\" cellpadding=\"10\" border=\"1px\"><tr>';\r\n foreach($query[0] as $key => $val) {\r\n if(!is_numeric($key)) {\r\n $table .= \"<th>$key</th>\";\r\n }\r\n }\r\n $table .= '</tr>';\r\n \r\n foreach ($query as $row) {\r\n $table .= '<tr>';\r\n foreach ($row as $k => $v) {\r\n if(!is_numeric($k)) {\r\n $table .= \"<td>$v</td>\";\r\n }\r\n }\r\n $table .= '</tr>';\r\n }\r\n $table .= '</table>';\r\n return $table;\r\n}", "function createTableFromDB3($dataArray, $height) {\n //Generates a table from an array\n global $columnNames;\n $res = \"\";\n $z = count($dataArray[0]);\n for ($x=1; $x<=$height; $x++) {\n $res .= '<tr>';\n for ($y=0; $y<$z; $y++) {\n if (isset($dataArray[$x][$y]) ) {\n $res .= '<td>' . $dataArray[$x][$y] . '</td>';\n } else {\n $res .= '<td></td>';\n }\n }\n $res .= '</tr>';\n }\n return $res;\n}", "function showDataTable(){\n\t\t$output = \"\";\n\t\t// print the table\n\t\t$output .= \"<table summary=\\\"\".$this->summary.\"\\\">\\n\";\n\t\t// print the caption\n\t\t$output .= \"<caption>\".$this->caption.\"</caption>\\n\";\n\t\t$output .= $this->showHeader();\n\t\t// initialise variables\n\t\t$altCounter = 0;\n\t\t$altClass = \"\";\n\t\t$h = 1;\n\t\t// loop each row\n\t\tfor ($x=0; $x<count($this->rows); $x++) {\n\t\t\t// if it is time to show the header\n\t\t\tif ($h==$this->headerRepeat){\n\t\t\t\t// show the header\n\t\t\t\t$output .= $this->showHeader();\n\t\t\t\t$h = 1;\n\t\t\t}\n\t\t\t$row = $this->rows[$x];\n\t\t\t// alternate the row classes\n\t\t\tif ($this->altClasses){\n\t\t\t\tif ($this->altClasses[$altCounter]!=\"\"){ $altClass = \" class=\\\"\".$this->altClasses[$altCounter].\"\\\"\"; } else { $altClass=\"\"; }\n\t\t\t\tif ($altCounter==count($this->altClasses)-1){ $altCounter=0; } else { $altCounter++; }\n\t\t\t}\n\t\t\t// set the parameters to nothing\n\t\t\t$params = \"\";\n\t\t\t// if there are parameters for this row set\n\t\t\tif (count($this->rowParams[$x])>0){\n\t\t\t\t// loop the parameters\n\t\t\t\twhile (list($attribute, $parameter) = each($this->rowParams[$x])) {\n\t\t\t\t\t// if the parameter is 'class'\n\t\t\t\t\tif (strtolower($attribute)==\"class\"){\n\t\t\t\t\t\t// replace the altClass variable\n\t\t\t\t\t\t$altClass = \" \".strtolower($attribute).\"=\\\"$parameter\\\"\";\n\t\t\t\t\t} else{\n\t\t\t\t\t\t// otherwise build the parameters\n\t\t\t\t\t\t$params .= \" \".strtolower($attribute).\"=\\\"$parameter\\\"\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// print the row\n\t\t\t$output .= \"\t<tr$altClass$params>\\n\";\n\t\t\t\t// set the colSpan to 0\n\t\t\t\t$colSpan = 0;\n\t\t\t\t$colSpanAttribute = \"\";\n\t\t\t\t// if this row has less columns than the number of fields\n\t\t\t\tif (count($row)<count($this->fields)){\n\t\t\t\t\t$colSpan = (count($this->fields)-count($row))+1;\n\t\t\t\t}\n\t\t\t\t// loop each cell\n\t\t\t\tfor ($i=0; $i<count($row); $i++) {\n\t\t\t\t\t$value = $row[$i];\n\t\t\t\t\t$value = $this->formatField($i, $x);\n\t\t\t\t\t// make the colspan attribute\n\t\t\t\t\tif ($colSpan>0 && $i==(count($row)-1)){ $colSpanAttribute = \" colspan=\\\"$colSpan\\\"\"; }\n\t\t\t\t\t// print the cell\n\t\t\t\t\t$output .= \"\t\t<td$colSpanAttribute>\".$value.\"</td>\\n\";\n\t\t\t\t}\n\t\t\t// end the row\n\t\t\t$output .= \"\t</tr>\\n\";\n\t\t\t// increment the header repeat variable\n\t\t\t$h++;\n\t\t}\n\t\t// end the table\n\t\t$output .= \"</table>\\n\\n\";\n\t\tprint $output;\n\t}", "function build_table_header($table_name, $conn){\n //get the COLUMN NAMES of the particular table passed in\n //the result will be formatted such that each COLUMN NAME is\n //in it's individual row under the COLUMN_NAME field.\n if(!($query = $conn->prepare(\"SELECT `COLUMN_NAME` \".\n \"FROM `INFORMATION_SCHEMA`.`COLUMNS` \".\n \"WHERE `TABLE_SCHEMA`='fludb' \".\n \"AND `TABLE_NAME`=? \"))){\n prepare_failed($query);\n }\n\n if(!($query->bind_param('s', $table_name))){\n bindp_failed($query);\n }\n\n if(!($query->execute())){\n execute_failed($query);\n }\n\n if(!($query->store_result())){\n store_failed($query);\n }\n\n if(!($query->bind_result($column_name))){\n bindr_failed($query);\n }\n\n if($query->num_rows > 0) {\n printf(\"<table id='outputTable'><thead>\");\n while($query->fetch()){\n echo \"<th>\".$column_name.\"</th>\";\n }\n printf(\"</thead>\");\n }\n}", "public function createTables();", "function tabledump( $result )\n{\n if($result==0)\n {\n echo \"<b>Error \".mysql_errno().\": \".mysql_error().\"</b>\";\n }\n elseif (@mysql_num_rows($result)==0)\n {\n echo \"<b>Query completed. Empty result.</b><br>\";\n }\n else\n {\n mysql_data_seek( $result, 0 );\n $nf = mysql_num_fields($result);\n $nr = mysql_num_rows($result);\n //echo \"the result:\";\n echo \"<table border='1'> <thead>\";\n\t echo \"<caption>\";\n\t //BARRY\n\t //echo \" table name code goes here\";\n\t echo \"</caption> \\n\";\n echo \"<tr>\";\n for($i=0; $i<$nf; $i++ )\n {\n echo \"<th>\".mysql_field_name($result,$i).\"</th>\";\n }\n echo \"</tr>\";\n echo \"</thead><tbody>\";\n for($i=0; $i<$nr; $i++ )\n {\n echo \"<tr>\";\n $row=mysql_fetch_row($result);\n for( $j=0; $j<$nf; $j++ )\n { echo \"<td>\".$row[$j].\"</td>\"; }\n echo \"</tr>\";\n }\n echo \"</tbody></table>\";\n }\n mysql_data_seek( $result, 0 );\n return $row;\n}", "function _table($data){\r\n\treturn sqlTable($data, null, null, false );\r\n}", "protected function StartTable()\n {\n $this->tagId = $this->tagId == \"\" ? \"\" : \"id='\" . $this->tagId . \"'\";\n $this->returnContent = \"<table $this->tagId class='$this->classes'>\";\n $this->returnContent .= \"<caption>$this->caption</caption>\";\n }", "function table_head($data = array(), $params = array()) {\n\t\t\t\t$thead = \"<thead\";\n\n\t\t\t\tif (!empty($params)) {\n\t\t\t\t\t\tforeach ($params as $param => $value) {\n\t\t\t\t\t\t\t\t$thead .= \" $param=\\\"$value\\\"\";\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$thead .= \">\\n\";\n\n\n\t\t\t\t$thead .= \"<tr>\\n\";\n\t\t\t\tforeach ($data as $head_col) {\n\t\t\t\t\t\t$thead .= $this->_make_col($head_col);\n\t\t\t\t}\n\t\t\t\t$thead .= \"</tr>\\n\";\n\t\t\t\t$thead .= \"</thead>\\n\";\n\n\t\t\t\t$this->thead = $thead;\n\n\t\t\t\t//$this->result .= $thead;\n\t\t}", "private function buildTable()\r\n\t {\r\n\t\t $output = \"<table class='dataGrid'>\";\r\n\t\t \r\n\t\t //add the header row\r\n\t\t $output .= \"<thead><tr>\";\r\n\t\t foreach ($this->fields as $label)\r\n\t\t {\r\n\t\t\t$output .= \"<th>$label</th>\"; \r\n\t\t }\r\n\t\t $output .= ($this->editAction != '') ? \"<th>Edit</th>\" : \"\";\r\n\t\t $output .= ($this->deleteAction != '') ? \"<th>Delete</th>\" : \"\";\r\n\t\t \r\n\t\t foreach ($this->customCols as $label => $val)\r\n\t\t {\r\n\t\t\t $output .= \"<th>$label</th>\";\r\n\t\t }\r\n\t\t $output .= \"</tr></thead><tbody>\";\r\n\t\t \r\n\t\t //add data rows\r\n\t\t foreach ($this->data as $row)\r\n\t\t {\r\n\t\t\t $id = $row[$this->idName];\r\n\t\t\t \r\n\t\t\t$output .= \"<tr>\";\r\n\t\t\tforeach($this->fields as $field => $lbl)\r\n\t\t\t{\r\n\t\t\t\t$output .= \"<td>$row[$field]</td>\";\t\r\n\t\t\t}\r\n\t\t\t\t $output .= ($this->editAction != '') ? \"<td class='center'><a href='\".$this->editAction.$row[$this->idName].\"'><img src='\".APP_URI.\"Assets/images/edit.png' /></a></td>\" : \"\";\r\n\t\t $output .= ($this->deleteAction != '') ? \"<td class='center'><a href='\".$this->deleteAction.$row[$this->idName].\"'><img src='\".APP_URI.\"Assets/images/delete.png' /></a></td>\" : \"\";\r\n\t\t \r\n\t\t \tforeach ($this->customCols as $colKey => $colVal)\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\t$output .= \"<td><a href='$colVal$id'>$colKey</td>\";\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$output .= \"</tr>\"; \r\n\t\t }\r\n\t\r\n\t\t \t\t \r\n\t\t $output .= \"</tbody></table>\";\r\n\t\t return $output;\r\n\t }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filter the query by a related \RewardCategory object
public function filterByRewardCategory($rewardCategory, $comparison = null) { if ($rewardCategory instanceof \RewardCategory) { return $this ->addUsingAlias(RewardTableMap::COL_REWARD_CATEGORY_ID, $rewardCategory->getRewardCategoryId(), $comparison); } elseif ($rewardCategory instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this ->addUsingAlias(RewardTableMap::COL_REWARD_CATEGORY_ID, $rewardCategory->toKeyValue('PrimaryKey', 'RewardCategoryId'), $comparison); } else { throw new PropelException('filterByRewardCategory() only accepts arguments of type \RewardCategory or Collection'); } }
[ "public function filterCategory($category);", "public function filterByReward($reward, $comparison = null)\n {\n if ($reward instanceof \\Reward) {\n return $this\n ->addUsingAlias(StoreTableMap::COL_STORE_ID, $reward->getStoreId(), $comparison);\n } elseif ($reward instanceof ObjectCollection) {\n return $this\n ->useRewardQuery()\n ->filterByPrimaryKeys($reward->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByReward() only accepts arguments of type \\Reward or Collection');\n }\n }", "public function filter_category() {\n\t\tif ( ! is_admin() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! isset( $_POST['rank_math_filter_redirections_top'] ) && ! isset( $_POST['rank_math_filter_redirections_bottom'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! Helper::has_cap( 'redirections' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$category_filter = isset( $_POST['rank_math_filter_redirections_top'] ) ? $_POST['redirection_category_filter_top'] : $_POST['redirection_category_filter_bottom'];\n\t\tif ( ! $category_filter || 'none' === $category_filter ) {\n\t\t\twp_safe_redirect( Helper::get_admin_url( 'redirections' ) );\n\t\t\texit;\n\t\t}\n\n\t\twp_safe_redirect( Helper::get_admin_url( 'redirections', [ 'redirection_category' => $category_filter ] ) );\n\t\texit;\n\t}", "public function getRewardCategories($params = [])\n {\n return $this->call('reward/category', 'get', $params);\n }", "public function filter_category_id($id)\n {\n return $this->builder->where('genre_ids', 'like', '%' . $id . '%');\n }", "public function category() \n {\n return $this->belongsTo('App\\Models\\Award\\AwardCategory', 'award_category_id');\n }", "public function filterByReward($reward, $comparison = null)\n {\n if ($reward instanceof \\Reward) {\n return $this\n ->addUsingAlias(RewardTypeTableMap::COL_REWARD_TYPE_ID, $reward->getRewardTypeId(), $comparison);\n } elseif ($reward instanceof ObjectCollection) {\n return $this\n ->useRewardQuery()\n ->filterByPrimaryKeys($reward->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByReward() only accepts arguments of type \\Reward or Collection');\n }\n }", "public function filterByCategory($category)\n {\n return $this->createQueryBuilder('u')\n ->leftJoin('u.training', 't')\n ->addSelect('t')\n ->leftJoin('t.category', 'ca')\n ->addSelect('ca')\n ->leftJoin('t.city', 'ci')\n ->addSelect('ci')\n ->leftJoin('u.feedbackTo', 'f')\n ->addSelect('f')\n ->where('ca.title = :category')\n ->setParameter(':category', $category)\n ->getQuery()->getArrayResult();\n }", "public function testResourcesAreFilteredByCategory()\n {\n $visibleResource = factory(Resource::class)->create();\n $notVisibleResource = factory(Resource::class)->create();\n\n $visibleResource->categories()->attach(factory(Category::class)->create());\n\n $this->actingAs(factory(User::class)->states('admin')->create())\n ->get('resources?filter[categories.id]='.$visibleResource->categories->first()->id)\n ->assertSuccessful()\n ->assertSee(route('resources.edit', $visibleResource))\n ->assertDontSee(route('resources.edit', $notVisibleResource));\n }", "public function getCategoryQuery($idCategory, LocaleTransfer $localeTransfer);", "public function filterByRelationship($query, Relationship $relationship, Closure $scope): void;", "public function find(int $id) : CategoryFilter;", "public function filter_by_category(){\n\t\t$check = 0;\n\t\t$where = '(';\n\t\t$categories = $this->product->categories;\n\t\tforeach ($categories as $category) {\n\t\t\t$this->session->unset_userdata($category);\n\t\t\tif($this->input->post($category)){\n\t\t\t\t$check++;\n\t\t\t\t$this->session->set_flashdata($category,$category);\n\t\t\t\t$this->db->escape($category);\n\t\t\t\t$where .= \"category = '\".$category.\"' OR \";\n\t\t\t} \n\t\t}\n\t\tif($check > 0){\n\t\t\t$where = substr($where,0,strlen($where) - 3);\n\t\t\treturn $where .= \")\";\n\t\t}\n\t}", "function addCategoryFilter($category_id){\r\n return $this->addSerialFilter('category_ids', $category_id );\r\n }", "protected function _addAllRelatedCategoriesCriteria($filter)\n {\n //i'm only applying this if we're searching for one specific category, as in 'category_id EQ SOME_ID'\n $conditionType = $filter->getConditionType() ? $filter->getConditionType() : 'eq';\n if ($conditionType != 'eq') {\n return;\n }\n\n $categoryId = $filter->getValue();\n $category = $this->categoryFactory->create()->load($categoryId);\n if (!$category->getId()) {\n return;\n }\n\n $allRelatedCategories = [];\n $allRelatedCategories[$categoryId] = $categoryId;\n\n //we unfortunately also want all the children of this category, so more loading\n $childrenIds = $category->getChildren($category, true);\n $allRelatedCategories = array_merge($allRelatedCategories, explode(',', $childrenIds));\n\n //now instead of one category, we get all it's children as well\n $filter->setValue($allRelatedCategories);\n $filter->setConditionType('in');\n }", "function jetpackme_filter_exclude_category( $filters ) {\n $filters[] = array( 'not' =>\n array( 'term' => array( 'taxonomy.ld_courses_category.slug' => 'branded' ) )\n );\n return $filters;\n}", "public function filterOwnedOrManaged();", "public function getCategory(): ActiveQuery\n {\n return $this->hasOne(Category::className(), ['id' => 'category_id']);\n }", "public function catFilter(Req $request){\n $cate=DB::table('categorys')\n ->join('subcategorys','categorys.id','=','subcategorys.category_id')\n ->join('books','books.subcategory_id','=','subcategorys.id')\n ->join('owners','books.id','=','owners.book_id')\n ->select('books.*', 'owners.owner_price')\n ->where('categorys.id',[$request->cat])\n ->get();\n return json_encode($cate);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
send invoice reminder to the customer
public function postInvoiceReminder(Request $request) { try { if ($this->isDemo()) { return $this->respondDemo(); } $transaction_id = $request->input('transaction_id'); $transaction = Transaction::OfTransaction('invoice') ->with('customer') ->find($transaction_id); $data = $request->only('email', 'subject', 'body'); if (!empty($request->input('attachment'))) { $pdf = $this->CommonUtil->generateInvoicePdf($transaction_id); $transaction->append('invoice_name'); $data['name'] = $transaction->invoice_name; $data['pdf'] = $pdf; } $customer = $transaction->customer; $customer['email'] = $data['email']; $customer->notify(new InvoiceReminder($data)); $output = $this->respondSuccess(__('messages.success')); } catch (Exception $e) { $output = $this->respondWentWrong($e); } return $output; }
[ "public function sendInvoiceToCustomer() {\n\t\t$this->order->sendInvoiceToCustomer($this->id);\n\t}", "public function getInvoiceReminder()\n {\n $transaction_id = request()->get('transaction_id');\n $project_id = request()->get('project_id');\n $transaction = Transaction::OfTransaction('invoice')\n ->where('project_id', $project_id)\n ->with('customer', 'project')->find($transaction_id);\n\n $invoice_template = System::getValue('invoice_reminder_template', $json_decode = true);\n\n $reminder['subject'] = preg_replace([\"/{customer_name}/\", \"/{project_name}/\", \"/{invoice_number}/\", \"/{due_date}/\", \"/{company_name}/\"], [$transaction->customer->company, $transaction->project->name, $transaction->ref_no, $transaction->due_date, config('app.name')], $invoice_template['subject']);\n\n $reminder['body'] = preg_replace([\"/{customer_name}/\", \"/{project_name}/\", \"/{invoice_number}/\", \"/{due_date}/\", \"/{company_name}/\"], [$transaction->customer->company, $transaction->project->name, $transaction->ref_no, $transaction->due_date, config('app.name')], $invoice_template['body']);\n\n $reminder['email'] = $transaction->customer->email;\n $reminder['attachment'] = $invoice_template['attachment'];\n\n return $this->respond($reminder);\n }", "function emailInvoice($customer, $product) { \n\n // Maybe we should also send the admins a copy of this invoice?\n // They could then be deleted as they come in or some such thing.\n\n // Set the subject.\n $subject = \"[Wireless Nomad] Monthly invoice\";\n\n // Compose a message.\n $message = \"This is an invoice from Wireless Nomad for \" .\n $customer->id . \".\\n\";\n $message .= \"\\n\";\n $message .= \"Please send a cheque to Wireless Nomad for \" . $product->name .\n \" with the amount of \" . $product->price . \".\\n\";\n\n // Send it.\n return mailWrapper($customer->email, $subject, $message);\n\n}", "function sendinvoice($orderid) {\n $email = new WC_Email_Customer_Invoice();\n $email->trigger($orderid);\n}", "public function invoiceAction() {\n /**\n * Get order id.\n */\n $orderId = $this->getRequest ()->getParam ( 'id' );\n /**\n * Check that customer login or not.\n */\n if (Mage::getSingleton ( 'customer/session' )->isLoggedIn () && isset ( $orderId )) {\n /**\n * Load order details.\n */\n $order = Mage::getModel ( \"sales/order\" )->load ( $orderId );\n } else {\n /**\n * Error message for the when unwanted person access these request.\n *\n * Redirect to view order page.\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( \"You do not have permission to access this page\" ) );\n $this->_redirect ( 'property/product/vieworder/order_id/' . $orderId );\n return;\n }\n \n try {\n /**\n * Check invoice create status.\n */\n if (! $order->canInvoice ()) {\n /**\n * Set error meesage\n *\n * And redirect to view order page.\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( \"Cannot create an invoice.\" ) );\n $this->_redirect ( 'property/product/vieworder/order_id/' . $orderId );\n return;\n }\n /**\n * Create Invoice.\n */\n $invoice = Mage::getModel ( 'sales/service_order', $order )->prepareInvoice ();\n $invoice->setRequestedCaptureCase ( Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE );\n /**\n * Register invoice.\n */\n $invoice->register ();\n $transactionSave = Mage::getModel ( 'core/resource_transaction' )->addObject ( $invoice )->addObject ( $invoice->getOrder () );\n $transactionSave->save ();\n /**\n * Send invoice email.\n */\n $invoice->getOrder ()->setCustomerNoteNotify ( true );\n $invoice->getOrder ()->setIsInProcess ( true );\n /**\n * Send invoice email.\n */\n $invoice->sendEmail ();\n /**\n * Set Invoice created success message\n * And product view order page.\n */\n Mage::getSingleton ( 'core/session' )->addSuccess ( $this->__ ( \"Invoice created sucessfully.\" ) );\n $this->_redirect ( 'property/product/vieworder/order_id/' . $orderId );\n } catch ( Mage_Core_Exception $e ) {\n /**\n * Set error message.\n * And redirect to view order page.\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( \"You do not have permission to access this page.\" ) );\n $this->_redirect ( 'property/product/vieworder/order_id/' . $orderId );\n return;\n }\n }", "public function jobExpiringInvoiceNotifyAction(){\r\n $em = $this->entityManager;\r\n $generalService = $this->generalService;\r\n $clientGeneralService = $this->clientGeneralService;\r\n $expiringInvoice = $em->getRepository(\"Transactions\\Entity\\Invoice\")->findJobExpiringInvoice();\r\n foreach ($expiringInvoice as $invoice){\r\n $template = array(\r\n \"var\"=>array(\r\n \"logo\"=>$clientGeneralService->loginPageLogo($invoice->getCustomer()->getCustomerBroker()->getBroker()->getId()),\r\n \"brokerName\"=>$invoice->getCustomer()->getCustomerBroker()->getBroker()->getCompanyName(),\r\n \"invoice\"=>$invoice,\r\n ),\r\n \"template\"=>\"general-customer-invoice-expiring\", // TODO design the mail \r\n );\r\n $messagePointers = array(\r\n \"to\" => $invoice->getCustomer()->getUser()->getEmail(),\r\n \"fromName\" => $invoice->getCustomer()->getCustomerBroker()->getBroker()->getCompanyName(),\r\n \"subject\" => \"Expiring Invoice\"\r\n );\r\n $this->generalService->sendMails($messagePointers, $template);\r\n }\r\n return $this->getResponse()->setContent(NULL);\r\n }", "public function testCustomerInvoicesV2SendPaymentReminderEmail()\n {\n }", "public function sendReminderAction()\r\n {\r\n $em = $this->entityManager;\r\n $mailService = \"\";\r\n $acquirePackageId = $this->params()->fromRoute(\"id\", NULL);\r\n if ($acquirePackageId == NULL) {\r\n $this->flashmessenger()->addErrorMessage(\"There is no Identifeir for this Acquired Package\");\r\n $this->redirect()->toRoute(\"acquired-packages\");\r\n }\r\n \r\n $acquiredPackageEntity = $em->find(\"Customer\\Entity\\CustomerPackage\", $acquirePackageId);\r\n $customerEmail = $acquiredPackageEntity->getCustomer()\r\n ->getUser()\r\n ->getEmail();\r\n \r\n /**\r\n * Process sending email to this email\r\n */\r\n \r\n $this->getResponse()->setContent(\"NULL\");\r\n }", "public function actionInvoiceCron()\n\t {\n\t \t$model = new Invoices;\n\t\t$invoices = $model->findAll(\"next_invoice_date = '\".date(\"Y-m-d\").\"'\");\n\t\t$i = 0;\n\t\tif(!empty($invoices)) { \n\t\t\t\n\t\t\tforeach( $invoices as $inv )\n\t\t\t{\n\t\t\t\t$flag = $model->createInvoiceFromInvoice($inv);\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\techo $i.' invoice created successfully';\n\t }", "public function email_reminder()\n {\n $remind=$this->Budget_model->get_budget_reminders();\n\n if ($remind) {\n \n foreach ($remind as $res) {\n \n echo $res->user_id;\n \n }\n }\n \n }", "static function Payalscheduledinvoicesend($id)\n\n {\n\n $invoice = new \\PayPal\\Api\\Invoice(); \n\n $invoice->setId($id);\n\n $invoice->send($this->_api_context); \n\n\n\n }", "private function sendInvoiceEmail()\n {\n // We can't send an invoice if we don't know the current transaction\n if (!isset($this->_postArray['brq_transactions'])) {\n return;\n }\n\n /** @var Mage_Sales_Model_Resource_Order_Invoice_Collection $invoiceCollection */\n $invoiceCollection = $this->_order->getInvoiceCollection()\n ->addFieldToFilter('transaction_id', array('eq' => $this->_postArray['brq_transactions']))\n ->setOrder('entity_id', Mage_Sales_Model_Resource_Order_Invoice_Collection::SORT_ORDER_DESC);\n\n /** @var Mage_Sales_Model_Order_Invoice $invoice */\n $invoice = $invoiceCollection->getFirstItem();\n\n if ($invoice->getId() && !$invoice->getEmailSent()) {\n $comment = $this->getNewestInvoiceComment($invoice);\n\n $invoice->sendEmail(true, $comment)\n ->setEmailSent(true)\n ->save();\n }\n }", "public function make_and_send() {\n $ride_id = (string)$this->input->post('ride_id');\n\t\tif($ride_id!=''){\n\t\t\t$this->mail_model->send_invoice_mail($ride_id);\n }\n }", "public function sendNotification()\n\t{\t\t\n\t\t\\IPS\\Email::buildFromTemplate( 'nexus', 'newInvoice', array( $this, $this->summary() ), \\IPS\\Email::TYPE_TRANSACTIONAL )\n\t\t\t->send(\n\t\t\t\t$this->member,\n\t\t\t\tarray_map(\n\t\t\t\t\tfunction( $contact )\n\t\t\t\t\t{\n\t\t\t\t\t\treturn $contact->alt_id->email;\n\t\t\t\t\t},\n\t\t\t\t\titerator_to_array( $this->member->alternativeContacts( array( 'billing=1' ) ) )\n\t\t\t\t),\n\t\t\t\t( ( in_array( 'new_invoice', explode( ',', \\IPS\\Settings::i()->nexus_notify_copy_types ) ) AND \\IPS\\Settings::i()->nexus_notify_copy_email ) ? explode( ',', \\IPS\\Settings::i()->nexus_notify_copy_email ) : array() )\n\t\t\t);\n\t}", "public function order_reminder(Request $request){\n $order_details = ProductOrder::find($request->id);\n $data['subject'] = __('your order is still in pending at').' '. get_static_option('site_'.get_default_language().'_title');\n $data['message'] = __('hello').' '.$order_details->billing_name .'<br>';\n $data['message'] .= __('your order ').' #'.$order_details->id.' ';\n $data['message'] .= __('is still in pending, to complete your booking go to');\n $data['message'] .= ' <a href=\"'.route('user.home').'\">'.__('your dashboard').'</a>';\n\n //send mail while order status change\n Mail::to($order_details->billing_email)->send(new BasicMail($data));\n\n return redirect()->back()->with(['msg' => __('Reminder Mail Send Success'),'type' => 'success']);\n }", "private function EmailUser(){\n //notifying them of the sale completion.\n }", "function reminder()\n {\n\n\t// fetch data from database\n\t \t\n \t$data['query'] = $this->model->get_entry();\n \t\n\t// get array data \t\n \t\n \tforeach ($data['query'] as $row) \n \t{\n\t\n\t\t// set array data to variables \t\n\n \t\t$client = $row->email;\n \t\t$client_name = $row->name;\n \t\t$client_link = $row->link;\n \t\t$client_duration = $row->duration;\n\n\t\t// change date format to January 01, 2012\n\t\t\n \t\t$client_startdate = date(\"F d, Y\", strtotime($row->startdate));\n \t\t$client_enddate = date(\"F d, Y\", strtotime($row->enddate));\n \t\t\n \t\t// set my own email\n \t\t\n \t\t$me = \"ulyssesr@yahoo.com\";\n \t\t \n \t}\n \t\n\t//\temail settings\n \t\t\n \t$this->email->from('uylssesr@yahoo.com','ulyssesonline.com');\n \t\t\n\t// set to clients email \t\t\n \t\t \n \t$this->email->to($client);\n \t\t\n \t// blind copy me\n \t\n \t$this->email->bcc($me);\n \t\t\n \t// subject\n \t\t\n\t$this->email->subject('Your ad link is expiring');\n\t\t\n\t// body \n \n \t$this->email->message(\n \t\t\n'Hi '.$client_name.',\n \nJust a friendly reminder from ulyssesonline.com to let you know that your link '.$client_link.' is expiring on '.$client_enddate.'. To renew, please visit http://ulyssesonline.com/advertising.\n \nBest regards,\nUlysses'\n\n\t);\n\t\n\t// finally send message\n\t \n\t$this->email->send();\n\t\n\t// redirect to view after message is sent\n\t\n\tredirect('ads/view/'.$this->uri->segment(3));\n\t\n }", "public function sendRatepayInvoiceEmail(Varien_Event_Observer $observer)\n {\n $invoiceController = $observer->getEvent()->getControllerAction();\n\n $request = $invoiceController->getRequest();\n $orderId = $request->getParam('order_id');\n $order = Mage::getModel('sales/order')->load($orderId);\n if (Mage::helper('ratepay/payment')->isRatepayPayment($order->getPayment()->getMethod())) {\n $invoiceArray = $request->getParam('invoice');\n if (isset($invoiceArray['send_email']) && $invoiceArray['send_email']) {\n Mage::helper('ratepay/email')->sendNewInvoiceEmail($order);\n }\n }\n }", "function sends_invoice( $invoice_id ) {\n \n // Get codeigniter object instance\n $CI = get_instance();\n \n // Load language\n if ( file_exists( APPPATH . 'language/' . $CI->config->item('language') . '/default_admin_lang.php' ) ) {\n $CI->lang->load( 'default_admin', $CI->config->item('language') );\n }\n if ( file_exists( APPPATH . 'language/' . $CI->config->item('language') . '/default_alerts_lang.php' ) ) {\n $CI->lang->load( 'default_alerts', $CI->config->item('language') );\n }\n \n // Load Invoice Model\n $CI->load->model('invoice');\n \n // Get the invoice's details\n $invoice = $CI->invoice->get_invoice( $invoice_id );\n \n // Verify if invoice exists\n if ( $invoice ) {\n \n // Get the invoice logo\n $invoice_logo = get_option( 'main-logo' );\n\n if ( get_option( 'invoice-logo' ) ) {\n\n $invoice_logo = get_option( 'invoice-logo' );\n\n }\n\n // Get the invoice billing period text\n $billing_period = 'Billing Period';\n\n if ( get_option( 'invoice-billing-period' ) ) {\n\n $billing_period = get_option( 'invoice-billing-period' );\n\n } \n\n // Get the invoice transaction id\n $transaction_id = 'Transaction ID';\n\n if ( get_option( 'invoice-transaction-id' ) ) {\n\n $transaction_id = get_option( 'invoice-transaction-id' );\n\n } \n\n // Get the invoice date format\n $date_format = 'dd-mm-yyyy';\n\n if ( get_option( 'invoice-date-format' ) ) {\n\n $date_format = get_option( 'invoice-date-format' );\n\n }\n \n // Get invoice's from period\n $from_period = str_replace(['dd', 'mm', 'yyyy'], [date('d', strtotime($invoice[0]->from_period)), date('m', strtotime($invoice[0]->from_period)), date('Y', strtotime($invoice[0]->from_period))], $date_format);\n \n // Get invoice's to period\n $to_period = str_replace(['dd', 'mm', 'yyyy'], [date('d', strtotime($invoice[0]->to_period)), date('m', strtotime($invoice[0]->to_period)), date('Y', strtotime($invoice[0]->to_period))], $date_format);\n \n // Get invoice's date\n $invoice_date = str_replace(['dd', 'mm', 'yyyy'], [date('d', strtotime($invoice[0]->invoice_date)), date('m', strtotime($invoice[0]->invoice_date)), date('Y', strtotime($invoice[0]->invoice_date))], $date_format); \n\n // Get the invoice hello text\n $hello_text = str_replace('[username]', $invoice[0]->username, 'Hello [username]');\n\n if ( get_option( 'invoice-hello-text' ) ) {\n\n $hello_text = str_replace('[username]', $invoice[0]->username, get_option( 'invoice-hello-text' ) );\n\n }\n\n // Get the invoice message\n $message = 'Thanks for using using our services.';\n\n if ( get_option( 'invoice-message' ) ) {\n\n $message = get_option( 'invoice-message' );\n\n }\n\n // Get the invoice date word\n $date = 'Date';\n\n if ( get_option( 'invoice-date' ) ) {\n\n $date = get_option( 'invoice-date' );\n\n }\n\n // Get the invoice description word\n $description = 'Description';\n\n if ( get_option( 'invoice-description' ) ) {\n\n $description = get_option( 'invoice-description' );\n\n } \n\n // Get the invoice description text\n $description_text = 'Upgrade Payment';\n\n if ( get_option( 'invoice-description-text' ) ) {\n\n $description_text = get_option( 'invoice-description-text' );\n\n } \n\n // Get the invoice amount word\n $amount = 'Amount';\n\n if ( get_option( 'invoice-amount' ) ) {\n\n $amount = get_option( 'invoice-amount' );\n\n } \n\n // Get the invoice amount word\n $taxes = 'Taxes';\n\n if ( get_option( 'invoice-taxes' ) ) {\n\n $taxes = get_option( 'invoice-taxes' );\n\n } \n\n // Get the invoice total word\n $total = 'Total';\n\n if ( get_option( 'invoice-total' ) ) {\n\n $total = get_option( 'invoice-total' );\n\n }\n\n // Get the no reply message\n $no_reply = 'Please do not reply to this email. This mailbox is not monitored and you will not receive a response. For assistance, please contact us to info@ouremail.com.';\n\n if ( get_option( 'invoice-no-reply' ) ) {\n\n $no_reply = get_option( 'invoice-no-reply' );\n\n } \n \n $amount_value = $invoice[0]->amount . ' ' . $invoice[0]->currency;\n \n $invoice_taxes = '';\n \n if ( $invoice[0]->taxes ) {\n \n $invoice_taxes = '<tr class=\"taxes-area\">\n <td style=\"width:80%;text-align:right;padding:0 10px 10px 0;\" class=\"invoice-taxes\">\n ' . $taxes . '</td>\n <td style=\"width:20%;text-align:right;padding:0 10px 10px 0;\">\n <span style=\"display:inline;\" class=\"invoice-taxes-value\">\n ' . $invoice[0]->taxes . ' %\n </span>\n\n </td>\n </tr>';\n\n }\n \n $body = '<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\">\n <tbody><tr><td align=\"center\" width=\"600\" valign=\"top\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tbody>\n <tr>\n <td align=\"center\" valign=\"top\" bgcolor=\"#ffffff\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"margin-bottom:10px;\" width=\"100%\">\n <tbody><tr valign=\"bottom\"> \n <td width=\"20\" align=\"center\" valign=\"top\">&nbsp;</td>\n <td align=\"left\" height=\"64\">\n <img alt=\"logo\" class=\"invoice-logo\" src=\"' . $invoice_logo . '\">\n </td> \n <td width=\"40\" align=\"center\" valign=\"top\">&nbsp;</td>\n <td align=\"right\">\n <span style=\"padding-top:15px;padding-bottom:10px;font:italic 12px;color:#757575;line-height:15px;\">\n <span style=\"display:inline;\">\n <span class=\"invoice-billing-period\">' . $billing_period . '</span> <strong><span class=\"invoice-date-format billing-period-from\">' . $from_period . '</span> ' . $CI->lang->line('ma205') . ' <span class=\"invoice-date-format billing-period-to\">' . $to_period . '</span></strong>\n </span>\n <span style=\"display:inline;\">\n <br>\n <span class=\"invoice-transaction-id\">' . $transaction_id . '</span>: <strong class=\"transaction-id\">' . $invoice[0]->transaction_id . '</strong>\n </span>\n </span>\n </td>\n <td width=\"20\" align=\"center\" valign=\"top\">&nbsp;</td>\n </tr>\n </tbody>\n </table>\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"padding-bottom:10px;padding-top:10px;margin-bottom:20px;\" width=\"100%\">\n <tbody><tr valign=\"bottom\"> \n <td width=\"20\" align=\"center\" valign=\"top\">&nbsp;</td>\n <td valign=\"top\" style=\"font-family:Calibri, Trebuchet, Arial, sans serif;font-size:15px;line-height:22px;color:#333333;\" class=\"yiv1811948700ppsans\">\n <p>\n </p><div style=\"margin-top:30px;color:#333;font-family:arial, helvetica, sans-serif;font-size:12px;\"><span style=\"color:#333333;font-weight:bold;font-family:arial, helvetica, sans-serif;\" class=\"invoice-hello-text\">' . $hello_text . '</span><p class=\"invoice-message\">' . $message . '</p><br><div style=\"margin-top:5px;\">\n <br><div class=\"yiv1811948700mpi_image\" style=\"margin:auto;clear:both;\">\n </div>\n <table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"clear:both;color:#333;font-family:arial, helvetica, sans-serif;font-size:12px;margin-top:20px;\" width=\"100%\">\n <tbody>\n <tr>\n <td style=\"text-align:left;border:1px solid #ccc;border-right:none;border-left:none;padding:5px 10px 5px 10px !important;color:#333333;\" class=\"invoice-date\" width=\"10%\">\n ' . $date . '</td>\n <td style=\"border:1px solid #ccc;border-right:none;border-left:none;padding:5px 10px 5px 10px !important;color:#333333;\" width=\"80%\" class=\"invoice-description\">\n ' . $description . '</td>\n <td style=\"text-align:right;border:1px solid #ccc;border-right:none;border-left:none;padding:5px 10px 5px 10px !important;color:#333333;\" width=\"10%\" class=\"amount\">\n ' . $amount . '</td>\n </tr>\n <tr>\n <td style=\"text-align:left;padding:10px;\" width=\"10%\" class=\"invoice-date-format invoice-created-date\">\n ' . $invoice_date . '</td> \n <td style=\"padding:10px;\" width=\"80%\">\n <span class=\"invoice-description-text\">' . $description_text . '</span>\n <br>\n\n <span style=\"display:inline;font-style: italic;color: #888888;\" class=\"invoice-plan-name\">\n </span>\n </td>\n <td style=\"text-align:right;padding:10px;\" width=\"10%\" class=\"invoice-amount\">\n ' . $amount_value . '\n </td>\n </tr>\n </tbody>\n </table>\n <table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-top:1px solid #ccc;border-bottom:1px solid #ccc;color:#333;font-family:arial, helvetica, sans-serif;font-size:12px;margin-bottom:10px;\" width=\"100%\">\n <tbody>\n <tr>\n <td>\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"width:100%;color:#333;font-family:arial, helvetica, sans-serif;font-size:12px;margin-top:10px;\">\n <tbody>\n ' . $invoice_taxes . '\n <tr>\n <td style=\"width:80%;text-align:right;padding:0 10px 10px 0;\">\n <span style=\"color:#333333;font-weight:bold;\" class=\"invoice-total\">\n ' . $total . '\n </span>\n </td>\n <td style=\"width:20%;text-align:right;padding:0 10px 10px 0;\" class=\"invoice-total-value\">\n ' . $invoice[0]->total . ' ' . $invoice[0]->currency . '\n </td>\n </tr>\n </tbody></table>\n </td>\n </tr>\n\n </tbody></table>\n <span style=\"font-size:11px;color:#333;\" class=\"invoice-no-reply\">' . $no_reply . '</span></div>\n <span style=\"font-weight:bold;color:#444;\">\n </span>\n <span>\n </span>\n </div></td>\n <td width=\"20\" align=\"center\" valign=\"top\">&nbsp;</td>\n </tr>\n </tbody>\n </table>\n <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>\n </td>\n </tr>\n </tbody>\n </table> \n </td>\n </tr>\n </tbody>\n </table>';\n \n if ( get_user_option('invoices_by_email', $invoice[0]->user_id) ) {\n\n // Sends to getted emails\n $CI->email->from($CI->config->item('contact_mail'), $CI->config->item('site_name'));\n $CI->email->to([$invoice[0]->email, $CI->config->item('notification_mail')]);\n $CI->email->subject($CI->lang->line('ma190'));\n $CI->email->message($body);\n\n if ( $CI->email->send() ) {\n\n // Set invoice status\n $CI->invoice->set_status( $invoice_id, 1 );\n\n return true;\n\n } else {\n\n return false;\n\n }\n \n } else {\n \n return false;\n \n }\n \n } else {\n \n return false;\n \n }\n \n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Property accessor for database entity. Several locations are searched, in this order: if a "getKey()" method exists it will be executed if a "fetchKey()" method exists it will be executed the first time and cached thereafter. unset($this>fetchCache[$key]) to clear for "id" the id of the row is returned (in future this may support dual primary keys) for "row" the raw row object is returned if the key is a database column in the entity it will be returned failing those, an exception is thrown
public function __get($key) { $getMethod = 'get' . $key; if (method_exists($this, $getMethod)) { return $this->$getMethod(); } $fetchMethod = 'fetch' . $key; if (method_exists($this, $fetchMethod)) { if (!array_key_exists($key, $this->fetchCache)) { $this->fetchCache[$key] = $this->$fetchMethod(); } return $this->fetchCache[$key]; } switch ($key) { case 'id': return $this->id; case 'row': return $this->row; } if (property_exists($this->row, $key)) { return $this->row->$key; } throw new \exception("Cannot acccess $key on " . get_called_class()); }
[ "public function fetch()\n {\n $where = $this->_determineWhere($this->_args);\n $limits = $this->_determineOptions($this->_options);\n\n $object = new $this->_object();\n $cacheable = $object->isCacheable();\n\n if ($cacheable) {\n $this->_fetchFromCacheOrDB($where, $limits, $object);\n } else {\n $this->_fetchFromDB($where, $limits);\n }\n }", "public function fetch ( $key ) // fetches row associated with key or NULL on failure\n\t{\n\t\t$v = $this->driver->table_fetch($this->name, $key);\n\t\t$this->rowcache_key = $key;\n\t\t$this->rowcache_value = $v;\n\t\treturn $v;\n\t}", "public function fetch_data()\n\t{\n\t\tglobal $Mysql;\n\t\t\n\t\t// Don't bother if we know there is no row for this object.\n\t\tif ( !$this->exists() )\n\t\t\treturn 0;\n\t\t\n\t\t$table_qry = $Mysql->query(\"SELECT * FROM `\". $this->db_table_name .\"` \n\t\t\tWHERE `id` = '\". $this->id .\"'\");\n\t\tif ( $table_qry->num_rows == 0 )\n\t\t\t$this->id = false;\n\t\telse\n\t\t{\n\t\t\t$table_qry->data_seek(0);\n\t\t\t$table_row = $table_qry->fetch_assoc();\n\t\t\t\n\t\t\tforeach ( $table_row as $field => $value )\n\t\t\t{\n\t\t\t\t// Skip over any of the non-database fields.\n\t\t\t\tif ( in_array($field, $this->extra_fields) )\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\t$this->$field = $value;\n\t\t\t}\n\t\t}\n\t}", "public function fetchEntityById($id);", "public function __get($Name)\r\n\t\t{\r\n\t\t\t$ClassName = get_class($this);\r\n\t\t\t$Props = get_object_vars($this);\r\n\r\n\t\t\tforeach($Props as $Prop => $Val)\r\n\t\t\t{\r\n\t\t\t\t$annotations = GetPropertyAnnotations($ClassName, $Prop);\r\n\t\t\t\t$ForeignAlias = SafeGetValue($annotations, \"fkey-alias\");\r\n\t\t\t\tif($ForeignAlias == $Name)\r\n\t\t\t\t{\r\n\t\t\t\t\t$ForeignTable = SafeGetValue($annotations, \"fkey-table\");\r\n\t\t\t\t\tif($ForeignTable != null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$ForeignType = substr($ForeignTable, 0 , -1);\r\n\t\t\t\t\t\t$CacheName = $ForeignTable . \"_\" . $Val;\r\n\t\t\t\t\t\t//Checks the cache to see if this object already exists\r\n\t\t\t\t\t\tif(!array_key_exists($CacheName, Db::$Cache))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t//If not, makes a database request to get it\r\n\t\t\t\t\t\t\tDb::$Cache[$CacheName] = (new DbHelper($ForeignType))->Find($Val);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//Returns requested object from the DB Cache\r\n\t\t\t\t\t\treturn Db::$Cache[$CacheName];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthrow new Exception(\"Invalid navigation property: \" . $Name . \"!\");\r\n\t\t}", "public function __get($property)\n {\n // check if queryset is already evaluated\n $this->getResults();\n\n return $this->_resultsCache->{$property};\n }", "public function testRetrieveNoCache() {\n $entity = new SimpleEntity();\n $entity->setName('Entity');\n $entity->setValue('EntityValue');\n $id = $this->persister->create($entity);\n $this->assertNotNull($id);\n\n $this->persister->clearCache($id);\n\n $retrieved = $this->persister->getById($id);\n $this->assertEquals('Entity', $retrieved->getName());\n $this->assertEquals('EntityValue', $retrieved->getValue());\n }", "public function fetch() {\r\n\t $class = $this->table;\r\n\t $data = \\Idk\\Database::getInstance()->orm->queryWriter->selectAllByCritWithSQL($class, $this->column, $this->entity->id, $this->orderBy . $this->order . $this->limit);\r\n\t $returnValues = array();\r\n\t\tforeach($data as $item) {\r\n\t\t\t$refClass = new ReflectionClass($class);\r\n\t\t\t\r\n\t\t\t$object = new $class();\r\n\t\t\t$object->id = $item['id'];\r\n\t\t\t$properties = $refClass->getProperties();\r\n\t\t\tIDKModel::initiateValues($object, $properties, $item);\r\n\t\t\t$returnValues[] = $object;\r\n\t\t}\r\n\t\t$this->_elements = $returnValues;\r\n \t$this->state = 1;\r\n\t}", "function refresh()\n\t\t{\n\t\t\t$id = $this->getId();\n\t\t\t$res = Database::query(\n\t\t\t\t\"SELECT * \".\n\t\t\t\t\"FROM `\". static::$_tableName .\"` \".\n\t\t\t\t\"WHERE `\". static::$_keyField .\"` = '$id'\");\n\t\t\t\n\t\t\tif ($res && Database::getRowCount($res) == 1) {\n\t\t\t\t// Fetch the row from the DB.\n\t\t\t\t$row = Database::fetchMap($res);\n\t\t\t\t$this->_recordExists = true;\n\t\t\t\t\n\t\t\t\tif (method_exists($this, 'recordLoaded')) {\n\t\t\t\t\t$this->recordLoaded($row);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tforeach ($row as $column => $value) {\n\t\t\t\t\t$this->$column = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Nothing found; this empty record remains intact.\n\t\t\t\t$this->_recordExists = false;\n\t\t\t}\n\t\t}", "public function fetch($key) {\n\t\t$stmt_cache = md5(__METHOD__);\n\t\t\n\t\tif(!isset($this->stmts[$stmt_cache])){\n\t\t\t$this->stmts[$stmt_cache] = $this->db->prepare(\"\n\t\t\t\tSELECT\n\t\t\t\t\texpires_by,\n\t\t\t\t\tdata\n\t\t\t\tFROM\n\t\t\t\t\tsb_cache_mysql\n\t\t\t\tWHERE\n\t\t\t\t\tcache_key = :cache_key\n\t\t\t\");\n\t\t\t\n\t\t}\n\t\t\n\t\t$stmt = $this->stmts[$stmt_cache];\n\t\t\n\t\t$result = $stmt->execute(Array(\n\t\t\t':cache_key' => $key\n\t\t));\n\t\t\n\t\t$rows = $stmt->fetchAll();\n\t\t\n\t\tif(isset($rows[0]) && ($rows[0]->expires_by == 0 || time() < $rows[0]->expires_by)){\n\t\t\n\t\t\t$data = @unserialize($rows[0]->data);\n\t\t\t\n\t\t\tif($data){\n\t\t\t\treturn $data;\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t$this->delete($key);\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public function lookup($key)\r\n {\r\n\t\t// create the unique cache key of the entity\r\n \t$cacheKey = $this->getCacheKey($key);\r\n \t// check if a entity with the passed primary key is available\r\n if (array_key_exists($cacheKey, $this->_entities)) {\r\n \treturn $this->_entities[$cacheKey];\r\n }\r\n // check if the requested entity exists in cache\r\n elseif($this->getCache()->test($cacheKey)) {\r\n \treturn $this->getCache()->load($cacheKey);\r\n }\r\n // if not return null\r\n else {\r\n \treturn null;\r\n }\r\n }", "public function lookup($key)\r\n {\r\n\t\t// create the unique cache key of the entity\r\n \t$cacheKey = $this->getCacheKey($key);\r\n \t// check if a entity with the passed primary key is available\r\n if (array_key_exists($cacheKey, $this->_beans)) {\r\n \treturn $this->_beans[$cacheKey];\r\n } else { // if not return null\r\n \treturn null;\r\n }\r\n }", "public function getEntity($key);", "public function GetEntityProperty();", "protected function getEntityCache()\n\t{\n\t\treturn $this->client->getEntityCache();\n\t}", "public function refresh()\n {\n $keyName = $this->keyName;\n\n //If we don't have a key we cant refresh\n if (! isset($this->$keyName))\n {\n return;\n }\n\n $dbItem = self::getOneByKey($this->getKey());\n\n //Check if we are already the same\n if ($dbItem == $this)\n {\n return;\n }\n\n //Get values from DB & check if they match. Update if needed\n foreach (get_object_vars($dbItem) as $var => $val)\n {\n if ($this->$var !== $val)\n {\n $this->$var = $val;\n }\n }\n }", "public function __get($Name)\n\t{\n\t\tif($this->dbTable === null) throw new \\Error(\"Navigation attempted on non-navigable property.\\r\\n\" . \n\t\t\"Navigation can only be done on objects created by a table context.\");\n\t\t$ClassName = get_class($this);\n\t\t$Props = get_object_vars($this);\n\n\t\tforeach ($Props as $Prop => $Val) {\n\t\t\t$annotations = Utils::GetPropertyAnnotations($ClassName, $Prop);\n\t\t\t$ForeignAlias = Utils::SafeGetValue($annotations, \"fkey-alias\");\n\t\t\tif ($ForeignAlias == $Name) {\n\t\t\t\t$ForeignTable = Utils::SafeGetValue($annotations, \"fkey-table\");\n\t\t\t\tif ($ForeignTable != null) {\n\t\t\t\t\t$ForeignType = substr($ForeignTable, 0, -1);\n\t\t\t\t\t$CacheName = $ForeignTable . \"_\" . $Val;\n\t\t\t\t\t//Checks the cache to see if this object already exists\n\t\t\t\t\tif (!array_key_exists($CacheName, Db::$Cache)) {\n\t\t\t\t\t\t//If not, makes a database request to get it\n\t\t\t\t\t\tDb::$Cache[$CacheName] = $this->dbTable->db->getRegisteredTableContext($ForeignTable)->Find($Val);\n\t\t\t\t\t}\n\t\t\t\t\t//Returns requested object from the DB Cache\n\t\t\t\t\treturn Db::$Cache[$CacheName];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthrow new \\Exception(\"Invalid navigation property: \" . $Name . \"!\");\n\t}", "public function __get($key)\n {\n if (! $this->__isset($key)) {\n // create a new blank record for the missing key\n $this->_data[$key] = $this->_model->fetchNew();\n }\n \n // convert array to record object.\n // honors single-table inheritance.\n if (is_array($this->_data[$key])) {\n \n // convert the data array to an object.\n // get the main data to load to the record.\n $load = $this->_data[$key];\n \n // done\n $this->_data[$key] = $this->_model->newRecord($load);\n }\n \n // return the record\n return $this->_data[$key];\n }", "public function refresh()\n {\n $where = $this->_getWhereQuery();\n\n $that = $this->_table->fetchRow($where);\n\n foreach($that as $key => $value)\n {\n if(substr($key, 0, 1) == '_')\n {\n continue;\n }\n $this->$key = $value;\n }\n\n $this->_isInsert = false;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a form to confirm deletion of the passed contextual rule.
function sharpspring_contextual_blocks_delete_rule_form($form, &$form_state, $rule_id) { $exists = db_select('sharpspring_contextual_block_rules', 'sbr') ->fields('sbr', array('name')) ->condition('rule_id', $rule_id) ->execute() ->fetchCol(); if (!empty($exists)) { $rule_name = (!empty($exists[0])) ? $exists[0] : ''; drupal_set_title(t('Are you sure you want to delete the rule @rule_name?', array('@rule_name' => $rule_name))); $form['rule_id'] = array( '#type' => 'hidden', '#value' => $rule_id, ); $form['rule_name'] = array( '#type' => 'hidden', '#value' => $rule_name, ); // This rule exists, show the delete button. $form['actions'] = array( '#type' => 'actions', ); $form['actions']['delete'] = array( '#type' => 'submit', '#title' => t('Are you sure you want to delete the rule?'), '#value' => 'Delete', ); $form['actions']['cancel'] = array( '#markup' => l(t('Cancel'), 'admin/config/system/sharpspring/blocks'), ); } else { // This rule does not exist, redirect back to the admin page. drupal_set_message(t('Unknown rule number, unable to delete.'), 'error'); drupal_goto('admin/config/system/sharpspring/blocks'); } return $form; }
[ "function ump_rule_delete_form_validate($form, &$form_state) {\n\n}", "function fusion_apply_rule_delete_submit($form, &$form_state) {\n $destination = array();\n if (isset($_REQUEST['destination'])) {\n $destination = drupal_get_destination();\n unset($_REQUEST['destination']);\n }\n $form_state['redirect'] = array('admin/appearance/fusion/rules/delete/'. $form_state['values']['rid'], $destination);\n}", "public function deleteForm()\n\t{\n\t\t$form = new \\IPS\\Helpers\\Form( 'form', 'delete' );\n\t\t$form->addMessage( 'node_delete_blurb_no_content' );\n\t\t\n\t\treturn $form;\n\t}", "function activity_actions_delete_form($form, &$form_state, $action) {\n $form['aid'] = array(\n '#type' => 'value',\n '#value' => $action->aid,\n );\n return confirm_form($form,\n t('Are you sure you want to delete the action %action?', array('%action' => $action->description)),\n 'admin/structure/activity',\n t('This cannot be undone.'),\n t('Delete'), t('Cancel')\n );\n}", "function scaffolding_example_delete_confirm(&$form_state, $record) {\n $form['record_id'] = array(\n '#type' => 'value',\n '#value' => $record['record_id'],\n );\n\n return confirm_form($form,\n t('Are you sure you want to delete %title?', array('%title' => $record['title'])),\n isset($_GET['destination']) ? $_GET['destination'] : 'admin/build/scaffolding_example',\n t('This action cannot be undone.'),\n t('Delete'),\n t('Cancel')\n );\n}", "function mcneese_management_redirects_delete_form($form, &$form_state, $id) {\n if (!is_null($id) && !cf_is_integer($id)) {\n if (class_exists('cf_error')) {\n cf_error::invalid_numeric('id');\n }\n\n drupal_not_found();\n drupal_exit();\n }\n\n // load existing data, if any.\n $query = db_select('mcneese_management_redirects', 'mmr');\n $query->fields('mmr', array('id', 'source'));\n $query->condition('mmr.id', $id);\n $executed = $query->execute();\n $redirect = $executed->fetchAssoc();\n\n if (empty($redirect)) {\n drupal_not_found();\n drupal_exit();\n }\n\n drupal_set_title(t(\"Delete Redirect %source (%id)\", array('%source' => $redirect['source'], '%id' => $id)), PASS_THROUGH);\n\n $form['settings'] = array(\n '#tree' => TRUE,\n );\n\n $form['settings']['confirm'] = array(\n '#type' => 'checkbox',\n '#title' => t(\"Confirm Deletion\"),\n '#description' => t(\"You must enable this checkbox to delete this redirection.\"),\n '#default_value' => FALSE,\n '#required' => TRUE,\n );\n\n $form['id'] = array(\n '#type' => 'value',\n '#value' => $id,\n );\n\n $destination = isset($_GET['destination']) ? $_GET['destination'] : 'admin/content/management/redirects';\n $form['redirect_to'] = array(\n '#type' => 'value',\n '#value' => $destination,\n );\n\n $form['actions'] = array();\n $form['actions']['submit'] = array(\n '#type' => 'submit',\n '#value' => t(\"Delete\"),\n );\n\n $form['actions']['cancel'] = array(\n '#type' => 'link',\n '#title' => t(\"Cancel\"),\n '#href' => $destination,\n '#weight' => 100,\n );\n\n return $form;\n}", "function crm_case_delete_form($form, &$form_state, $crm_case) {\n $form_state['crm_case'] = $crm_case;\n\n $form['#submit'][] = 'crm_case_delete_form_submit';\n\n $form = confirm_form($form,\n t('Are you sure you want to delete the case %name?', array('%name' => $crm_case->name)),\n 'crm/case/crm_case',\n '<p>' . t('This action cannot be undone.') . '</p>',\n t('Delete'),\n t('Cancel'),\n 'confirm'\n );\n \n return $form;\n}", "function custom_teasers_views_delete_confirm(&$form_state, $item) {\n $form['name'] = array(\n '#type' => 'value',\n '#value' => $item['name'],\n );\n\n return confirm_form($form,\n t('Are you sure you want to delete %title?', array('%title' => $item['title'])),\n isset($_GET['destination']) ? $_GET['destination'] : 'admin/build/custom_teasers',\n t('This action cannot be undone.'),\n t('Delete'),\n t('Cancel')\n );\n}", "function betgame_competition_team_delete_form($form, &$form_state, $competition, $team) {\r\n if(is_object($competition) && is_object($team)) {\r\n\r\n $form['#competition_id'] = $competition->getId();\r\n $form['#team_id'] = $team->getId();\r\n\r\n return confirm_form(\r\n $form,\r\n t('Are you sure you want to delete team %title?', array('%title' => $team->getName())),\r\n 'admin/config/betgame/competition/'.$competition->getId().'/team',\r\n t('Note: This action cannot be undone.'),\r\n t('Delete'),\r\n t('Cancel'),\r\n 'competition_team_confirm_delete');\r\n } else {\r\n return array();\r\n }\r\n}", "private function get_form_delete(){\t\treturn $this->helper_delete->get_dialog( $this->get_url_this_dele());\t}", "function delete_research_tool_confirm_form(&$form_state, $tool){\n $form['tid'] = array(\n '#type' => 'value',\n '#value' => $tool->id,\n );\n \n $question = t('Are you sure you want to delete the research tool %name?', array('%name' => $tool->name));\n $description = t('Deleting a research tool will also remove this tool from the projects that are using it.');\n return confirm_form($form, $question, 'admin/content/retools',$description, t('Delete'), t('Cancel'));\n}", "function thumbwhere_action_delete_form($form, &$form_state, $thumbwhere_action) {\n $form_state['thumbwhere_action'] = $thumbwhere_action;\n\n $form['#submit'][] = 'thumbwhere_action_delete_form_submit';\n\n $form = confirm_form($form,\n t('Are you sure you want to delete thumbwhere_action %name?', array('%name' => $thumbwhere_action->pk_action)),\n 'admin/thumbwhere/thumbwhere_actions/thumbwhere_action',\n '<p>' . t('This action cannot be undone.') . '</p>',\n t('Delete'),\n t('Cancel'),\n 'confirm'\n );\n\n return $form;\n}", "function ting_search_context_admin_context_delete_confirm_form($form, &$form_state, $context) {\n $ratings = ting_search_context_ratings_load($context->context_id);\n\n // Save the context and it's associated ratings for later processing.\n $form['ting_search_context']['context'] = array('#type' => 'value', '#value' => $context);\n $form['ting_search_context']['ratings'] = array('#type' => 'value', '#value' => $ratings);\n\n $message = format_plural(count($ratings),\n 'This action cannot be undone and will delete 1 associated rating.',\n 'This action cannot be undone and will delete @count associated ratings.'\n );\n\n return confirm_form($form,\n t('Are you sure you want to delete %context?', array('%context' => $context->name)),\n 'admin/config/ting/ting-search-context/contexts/' . $context->context_id . '/edit',\n $message,\n t('delete'),\n t('cancel')\n );\n}", "private function createDeleteForm()\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('box_delete', array('id' => '__obj_id__')))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function actionDeleteselectedform(){\n \t$id = Yii::$app->request->post('id',0);\n \t$form= Yii::$app->request->post('form',0);\n \t$model = new FormBuilder();\n \tif($form == 'instruction'){\n \t\t$model->deleteFromData($id,1);\n \t}else{\n \t\t$model->deleteFromData($id,2);\n \t}\n \treturn 'OK';\n }", "private function createDeleteForm(Attraction $attraction)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('attraction_delete', array('id' => $attraction->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(RefContrainteTravail $refContrainteTravail) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('refcontraintetravail_delete', array('idConttrav' => $refContrainteTravail->getIdconttrav())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm()\n {\n return $this->createFormBuilder()\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function getDeleteRule();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Render a title tag
protected function renderTitle() { $charset = $this->charset ? $this->charset : 'UTF-8'; $title = implode($this->separator, (array) $this->containers['title']); $html = $this->tab . '<title>' . htmlspecialchars($title, ENT_COMPAT, $charset) . '</title>' . $this->eol; return $html; }
[ "public function renderTitle();", "protected function renderTitle() {\n\t\techo '<title>' . $this->getTitle(true) . '</title>';\n\t}", "public function renderTitle()\n {\n if ($this->aRendered['title'] === false) {\n if (!empty($this->sTitle)) {\n echo PHP_EOL . \"<title>{$this->sTitle}</title>\";\n $this->aRendered['title'] = true;\n }\n }\n }", "static protected function renderTitle($title=null)\n\t{\n\t\t$title = empty($title) ? implode(self::$separator, self::$title) : $title;\n\t\t$html = empty($title) ? null : html_tag('title', null, $title) . self::$eol;\n\t\treturn $html;\n\t}", "public function getTitleTag($title) {\n return '<title>'.$title.'</title>';\n }", "private function render_title() {\n\t\tswitch ( $this->action ) {\n\t\t\tcase self::ADD:\n\t\t\t\techo '' .\n\t\t\t\t\t'\t<h1 class=\"add-entry\">' . esc_html__( 'Add glossary entry', 'glossary-by-arteeo' ) . '</h1>' .\n\t\t\t\t\t'\t<p>' . esc_html__( 'Add a new entry to the glossary.', 'glossary-by-arteeo' ) . '</p>';\n\t\t\t\tbreak;\n\t\t\tcase self::EDIT:\n\t\t\t\techo '' .\n\t\t\t\t\t'\t<h1 class=\"edit-entry\">' .\n\t\t\t\t\t\t\tesc_html__( 'Edit glossary entry', 'glossary-by-arteeo' ) .\n\t\t\t\t\t'\t</h1>' .\n\t\t\t\t\t'\t<p>' . esc_html__( 'Adjust the entry from the glossary.', 'glossary-by-arteeo' ) . '</p>';\n\t\t\t\tbreak;\n\t\t}\n\t}", "protected function renderTitle()\n {\n if ($this->title !== null) {\n return Html::tag('h3', $this->title, ['class' => 'uk-panel-title']);\n } else {\n return null;\n }\n }", "function title($title) {\n\t\tsprintf($this->tags['title'], $title);\n\t}", "private function _getTitleTag()\n {\n $retval = \"<title>\";\n $retval .= $this->_getPageTitle();\n $retval .= \"</title>\";\n return $retval;\n }", "public static function setTitle($title){\n self::$renderContent[\"title\"] = $title;\n }", "public function title() {\n\n\t\tif ( $this->title ) : ?>\n\n\t\t\t<div class=\"field-title\">\n\t\t\t\t<label <?php $this->for_attr(); ?>>\n\t\t\t\t\t<?php echo esc_html( $this->title ); ?>\n\t\t\t\t</label>\n\t\t\t</div>\n\n\t\t<?php endif;\n\n\t}", "public static function title(string $title=''):string{\n return \"<title>{$title}</title>\";\n }", "public static function titleHTML($title) {\n $subTitles = explode(\",\", $title);\n $html = CHtml::tag('strong', array('class' => 'title'), $subTitles[0]);\n return $html . \"<br/>\" . CHtml::tag('small', array('class' => 'title'), implode(\" \", array_slice($subTitles, 1)));\n }", "function title( $vContent = NULL, $aAttrs = array() )\n\t{\n\t\t$bHasEnd = TRUE;\n\t\treturn $this->_create_tag( __FUNCTION__, $aAttrs, $bHasEnd, $vContent );\n\t}", "public function title($title = NULL) {\n\t\t$this->Templates = $this->core(\"Templates\");\n\t\t\n\t\t$this->Templates->title($title);\n\t}", "public function renderPageTitle()\n\t{\n\t\t$title = $this->escape($this->getOption('page_title'));\n\t\tif ($this->getOption('show_page_title') !== true || empty($title))\n\t\t{\n\t\t\treturn '';\n\t\t}\n\t\treturn '<h1>' . $title . '</h1>';\n\t}", "protected function outputPageHeader($title) {\n $title = String::escapeHTML($title);\n echo <<<EOHTML\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n<meta name=\"generator\" content=\"Jerity Scaffold Generator\">\n<title>Jerity Scaffold :: {$title}</title>\n</head>\n<body>\n<h1>{$title}</h1>\n\nEOHTML;\n }", "function hypha_getTitle() {\n\t\tglobal $hyphaXml;\n\t\treturn getInnerHtml($hyphaXml->getElementsByTagName('title')->Item(0));\n\t}", "public function headTitle() {\n\t\treturn '<title>' . $this->headTitle . '</title>';\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
extracts values of all constants of given class with given prefix as array can be used to get all possible commands in case of these commands are defined as constants
public static function getCommandsFromClassConstants($guiClassName, $cmdConstantNameBegin = 'CMD_') { $reflectionClass = new ReflectionClass($guiClassName); $commands = null; if( $reflectionClass instanceof ReflectionClass ) { $commands = array(); foreach($reflectionClass->getConstants() as $constName => $constValue) { if( substr($constName, 0, strlen($cmdConstantNameBegin)) == $cmdConstantNameBegin ) { $commands[] = $constValue; } } } return $commands; }
[ "public static function grabPrefixedConstantsFromClass(string $class, string $prefix = ''): array\n {\n $oClass = new \\ReflectionClass($class);\n $constants = $oClass->getConstants();\n $result = [];\n\n foreach ($constants as $constant => $value) {\n if (!$prefix || \\mb_strpos($constant, $prefix) === 0) {\n $result[$constant] = $value;\n }\n }\n\n return $result;\n }", "protected static function getClassConstantsFromPrefix($prefix): array\n {\n $oClass = new \\ReflectionClass(__CLASS__);\n $aConstant = $oClass->getConstants();\n $result = [];\n\n foreach ($aConstant as $key => $value) {\n if (0 === strpos($key, $prefix)) {\n $result[] = $value;\n }\n }\n\n return $result;\n }", "protected function get_constants($object, $prefix)\n {\n $returned_constants = array();\n \n $reflection_class = new \\ReflectionClass($object);\n $constants = $reflection_class->getConstants();\n \n foreach ($constants as $constant_name => $constant_value)\n {\n if (strpos($constant_name, $prefix) === 0)\n {\n $returned_constants[$constant_name] = $constant_value;\n }\n }\n \n return $returned_constants;\n }", "function class_constants($object, string $startsWithFilter = ''): array\n {\n $objectProperties = new \\ReflectionClass($object);\n\n $constants = $objectProperties->getConstants();\n\n if ($startsWithFilter == '') {\n return $constants;\n }\n\n return array_filter($constants, function ($key) use ($startsWithFilter) {\n return starts_withEx(strtolower($key), strtolower($startsWithFilter));\n }, ARRAY_FILTER_USE_KEY);\n }", "public static function consts(): array\n {\n self::bootClass();\n\n return array_keys(self::$meta[static::class]);\n }", "private static function populateConstantList()\n\t{\n\t\t$pReflection = new ReflectionClass(__CLASS__);\n\t\t$aConstants = array_keys($pReflection->getConstants());\n\n\t\tforeach($aConstants as $sConstant)\n\t\t{\n\t\t\tself::$aConstants[strtolower($sConstant)] = $sConstant;\n\t\t}\n\n\t\treturn;\n\t}", "private static function getConstants(): array\n {\n return (new ReflectionClass(static::class))->getConstants();\n }", "public function getCommandClasses();", "public static function getConstants($classname = null) {}", "protected static function getConstants()\n {\n try{\n return (new ReflectionClass(get_called_class()))->getConstants();\n } catch(ReflectionException $e) {\n return [];\n }\n }", "public static function getAll(): array\n {\n return self::$constants;\n }", "public function provideClassConstantFetchByClassAndName(): array\n {\n if ($this->classConstantFetchByClassAndName !== [] && ! PHPUnitEnvironment::isPHPUnitRun()) {\n return $this->classConstantFetchByClassAndName;\n }\n\n $classConstFetches = $this->parsedNodeCollector->getNodesByType(ClassConstFetch::class);\n foreach ($classConstFetches as $classConstantFetch) {\n $this->addClassConstantFetch($classConstantFetch);\n }\n\n return $this->classConstantFetchByClassAndName;\n }", "private function _collectConstants( \\ReflectionClass $class, array $result )\n {\n foreach ( $class->getConstants() as $name => $value )\n {\n if ( array_key_exists( $name, $result ) === false )\n {\n $result[$name] = $value;\n }\n }\n return $result;\n }", "static function get_subcommands( $class ) {\n $reflection = new ReflectionClass( $class );\n\n $methods = array();\n\n foreach ( $reflection->getMethods() as $method ) {\n if ( !$method->isPublic() || $method->isStatic() || $method->isConstructor() )\n continue;\n\n $name = $method->name;\n\n // If reserved PHP keywords (eg list, isset...) using a leading underscore for the method (eg _list)\n if ( strpos( $name, '_' ) === 0 ) {\n $name = substr( $name, 1 );\n }\n\n $methods[] = $name;\n }\n\n return $methods;\n }", "public static function toArray(): array {\n $reflection = new ReflectionClass(__CLASS__);\n return $reflection->getConstants();\n }", "public function getConstantReflections();", "public static function getConstants()\r\n {\r\n $class = new \\ReflectionClass(__CLASS__);\r\n return $class->getConstants();\r\n }", "protected function _setCommandList()\n {\n $list = array();\n \n // loop through class stack and add commands\n $stack = $this->_stack->get();\n foreach ($stack as $class) {\n \n $dir = Solar_Dir::exists(str_replace('_', DIRECTORY_SEPARATOR, $class));\n if (! $dir) {\n continue;\n }\n \n // loop through each file in the directory\n $files = scandir($dir);\n foreach ($files as $file) {\n // file must end in .php and start with an upper-case letter\n $char = $file[0];\n $keep = substr($file, -4) == '.php' &&\n ctype_alpha($char) &&\n strtoupper($char) == $char;\n \n if (! $keep) {\n // doesn't look like a command class\n continue;\n }\n \n // the list-value is the base class name, plus the file name,\n // minus the .php extension, to give us a class name\n $val = $class . substr($file, 0, -4);\n \n // the list-key is the command name; convert the file name to a\n // command name. FooBar.php becomes \"foo-bar\".\n $key = substr($file, 0, -4);\n $key = preg_replace('/([a-z])([A-Z])/', '$1-$2', $key);\n $key = strtolower($key);\n \n // keep the command name and class name\n $list[$key] = $val;\n }\n }\n \n // override with explicit routings\n $this->_command_list = array_merge($list, $this->_routing);\n \n // sort, and done\n ksort($this->_command_list);\n }", "function allNounClasses() // array('Verb' => 'Verb', ...) PHP symbol to MySQL \"enum\" field values\r\n{ \r\n\t$r = new ReflectionClass('NounClass');\r\n\treturn $r->getConstants();\r\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the level of compression to use when using the `gzip` option. Value should be between 1 and 9. If you use a value that is out of these bounds, will default to 9.
public function setGzipLevel(int $level) { if ($level < -1 || $level > 9) { $level = 9; } $this->gzipLevel = $level; return $this; }
[ "abstract public function setCompression( $level = 9, $type = Archive::COMPRESS_AUTO );", "public function setCompressionLevel($compressionLevel = self::LEVEL_DEFAULT_COMPRESSION);", "public function enableGzipCompression() {\n\t\tif ($this->config->gzip && Titon::load('zlib')) {\n\t\t\tini_set('zlib.output_compression', true);\n\t\t\tini_set('zlib.output_compression_level', $this->config->gzipLevel);\n\t\t}\n\t}", "public function setCompressionQuality ($quality) {}", "function setCompressionMode($mode){}", "public function setCompress($value);", "function setCompression($compression){}", "function setUseHttpCompression($value)\n {\n $this->_props['UseHttpCompression'] = $value;\n }", "protected function setCompression()\n {\n $this->verbose->vvln(\n sprintf(\n ' <fg=cyan>?</fg=cyan> Compression Mode: %s',\n self::$compression[$this->builder->getConfiguration()->getCompression()]\n )\n );\n\n $this->builder->setCompression();\n }", "function ming_setswfcompression ($level) {}", "public function get_compression_level()\n\t{\n\t\treturn $this->_compression_level;\n\t}", "public function setCompression($mode) { \n switch($mode) {\n case \"gzip\":\n $this->compression = \"gz\";\n break;\n case \"bzip2\":\n $this->compression = \"bz2\";\n break;\n case \"none\":\n $this->compression = null;\n break;\n default:\n $this->log(\"Ignoring unknown compression mode: \".$mode, Project::MSG_WARN);\n $this->compression = null;\n }\n }", "public function getCompressionQuality () {}", "function ming_setswfcompression($level)\n{\n}", "public function getCompressionQuality() {\n\t}", "public function setLevel($level)\n {\n if (\n ($level < self::LEVEL_BEST_SPEED || self::LEVEL_BEST_COMPRESSION < $level)\n && self::LEVEL_DEFAULT_COMPRESSION !== $level\n ) {\n throw new IllegalArgumentException(\"Invalid compression level!\");\n }\n $this->level = $level;\n }", "function gzencode ($data, $level = null, $encoding_mode = null) {}", "public function setCompression($level = 9, $type = Archive::COMPRESS_AUTO)\n {\n if ($level < -1 || $level > 9) {\n throw new ArchiveIllegalCompressionException('Compression level should be between -1 and 9');\n }\n $this->complevel = $level;\n }", "function init_gzip() {\n\t\tglobal $config;\n\t\t$this->gzip_config['gzip'] = $config['gzip_compress'] ? 1 : intval($this->gym_master->set_module_option('gzip', $this->gym_master->override['gzip']));\n\t\t// if gunzip is only activated for GYM, we turn it on for phpBB also\n\t\tif ($this->gzip_config['gzip'] && !$config['gzip_compress']) {\n\t\t\t$config['gzip_compress'] = 1;\n\t\t}\n\t\tif (!$this->check_gzip() && $this->gzip_config['gzip']) {\n\t\t\t$this->gzip_config['gzip'] = false;\n\t\t}\n\t\t$this->gym_master->url_config['gzip_ext_out'] = $this->gzip_config['gzip'] ? '.gz' : '';\n\t\t$this->gym_master->url_config['gzip_ext_out'] = (intval($this->gym_master->set_module_option('gzip_ext', $this->gym_master->override['gzip'])) > 0) ? $this->gym_master->url_config['gzip_ext_out'] : '';\n\t\t$this->check_requested_ext();\n\t\treturn;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handles a submission for the provided source key and payload.
public function processFor($sourceKey, RequestPayload $payload) { if (!isset($this->handlers[$sourceKey])) { throw new HttpFriendlyException(sprintf('No submission handler found for "%s"', $sourceKey), 404); } // Send the validate always hook. $this->callHookFor($sourceKey, 'validateAlways', [$payload]); // Send the appropriate identity state validation hook. $activeIdentity = $this->identityManager->getActiveIdentity(); if (null !== $activeIdentity && 'identity-account' === $activeIdentity->getType()) { $this->callHookFor($sourceKey, 'validateWhenLoggedIn', [$payload, $activeIdentity]); } else { $this->callHookFor($sourceKey, 'validateWhenLoggedOut', [$payload, $activeIdentity]); } // Create the submission. $submission = $this->createSubmission($sourceKey, $payload); $identity = $this->callHookFor($sourceKey, 'createIdentityFor', [$payload]); if (!$identity instanceof Model) { // The submission did not handle its own identification. // Do the native identity/submission "dance." $identity = $this->determineIdentity($submission, $payload); } if (null !== $identity) { $identityFactory = $this->identityManager->getidentityFactoryForModel($identity); $submission->set('identity', $identity); } // Send the before save hook to allow the handler to perform additional logic. $this->callHookFor($sourceKey, 'beforeSave', [$payload, $submission]); // Throw error if unable to save the identity or the submission. if (null !== $identity && true !== $result = $identityFactory->canSave($identity)) { $result->throwException(); } if (true !== $result = $this->submissionFactory->canSave($submission)) { $result->throwException(); } // Send email notifications. $this->notificationManager->sendNotificationFor($submission); $this->notificationManager->notifySubmission($submission, $payload->getNotify()); // Send the can save hook to allow for additional save checks. $this->callHookFor($sourceKey, 'canSave', []); // Save the identity and submission if (null !== $identity) { $identityFactory->save($identity); } $this->submissionFactory->save($submission); // Send the save hook for additional saving. $this->callHookFor($sourceKey, 'save', []); // Set the active identity, if applicable. if (null !== $identity) { $this->identityManager->setActiveIdentity($identity); } // Return the response. return $this->callHookFor($sourceKey, 'createResponseFor', [$submission]); }
[ "public function handleDataSubmission() {}", "public function submit()\n {\n $this->payload = $this->prefill;\n }", "protected abstract function handleSubmittedEntity($entity, $request, $context);", "public function apply(Model $submission, RequestPayload $payload)\n {\n $submission->set('payload', $payload->toArray());\n\n $metadata = $submission->getMetadata();\n foreach ($payload->getSubmission() as $key => $value) {\n if (true === $metadata->hasAttribute($key)) {\n $submission->set($key, $value);\n }\n }\n $this->setAnswers($submission, $payload);\n }", "public function submissionPostAction()\n {\n $data = $this->getRequest()->getPost();\n try {\n $isError = false;\n if (!empty($data)) {\n Mage::getSingleton('adminhtml/session')->setFormSubmissionData($this->_filterFormDataForSession($data));\n }\n /** @var $app Mage_XmlConnect_Model_Application */\n $app = $this->_initApp('key');\n $app->loadSubmit();\n $newAppData = $this->_processUploadedFiles($app->getData(), true);\n if (!empty($newAppData)) {\n $app->setData(Mage::helper('xmlconnect')->arrayMergeRecursive($app->getData(), $newAppData));\n }\n\n $params = $app->prepareSubmitParams($data);\n $errors = $app->validateSubmit($params);\n\n if ($errors !== true) {\n foreach ($errors as $err) {\n $this->_getSession()->addError($err);\n }\n $isError = true;\n }\n if (!$isError) {\n $this->_processPostRequest();\n $history = Mage::getModel('xmlconnect/history');\n $history->setData(array(\n 'params' => $params,\n 'application_id' => $app->getId(),\n 'created_at' => Mage::getModel('core/date')->date(),\n 'store_id' => $app->getStoreId(),\n 'title' => isset($params['title']) ? $params['title'] : '',\n 'name' => $app->getName(),\n 'code' => $app->getCode(),\n 'activation_key' => isset($params['resubmission_activation_key'])\n ? $params['resubmission_activation_key'] : $params['key'],\n ));\n $history->save();\n $app->getResource()->updateApplicationStatus(\n $app->getId(), Mage_XmlConnect_Model_Application::APP_STATUS_SUCCESS\n );\n $this->_getSession()->addSuccess($this->__('App has been submitted.'));\n $this->_clearSessionData();\n $this->_redirect('*/*/edit', array('application_id' => $app->getId()));\n } else {\n Mage::getSingleton('adminhtml/session')->setLoadSessionFlag(true);\n $this->_redirect('*/*/submission', array('application_id' => $app->getId()));\n }\n } catch (Mage_Core_Exception $e) {\n $this->_getSession()->addError($e->getMessage());\n if (isset($app)) {\n Mage::getSingleton('adminhtml/session')->setLoadSessionFlag(true);\n $this->_redirect('*/*/submission', array('application_id' => $app->getId()));\n } else {\n $this->_redirect('*/*/');\n }\n } catch (Exception $e) {\n $this->_getSession()->addException($e, $this->__('Can\\'t submit application.'));\n Mage::logException($e);\n if (isset($app)) {\n Mage::getSingleton('adminhtml/session')->setLoadSessionFlag(true);\n $this->_redirect('*/*/submission', array('application_id' => $app->getId()));\n } else {\n $this->_redirect('*/*/');\n }\n }\n }", "public function __invoke()\n {\n $data = json_decode(request('payload'), true);\n\n switch (Arr::get($data, 'type')) {\n case 'block_actions':\n // The user clicked an action button, such as \"Close Results\"\n $this->handleBlockAction($data);\n break;\n\n default:\n # code...\n break;\n }\n }", "public function registerSubmissionSource(SubmissionBase $source): void {\n $this->_submission_sources[$source->getName()] = $source;\n }", "protected function executeSubmitTemplate()\n\t{\n\t\t//\n\t\t// Init local storage.\n\t\t//\n\t\t$encoder = new Encoder();\n\t\t$user = $this->offsetGet( kAPI_REQUEST_USER );\n\t\t$user_id = $user->offsetGet( kTAG_NID );\n\t\t$user_fingerprint = $user->offsetGet( kTAG_ENTITY_PGP_FINGERPRINT );\n\t\t\n\t\t//\n\t\t// Check if there is a running session.\n\t\t//\n\t\tif( ! file_exists(\n\t\t\t\tSessionBatch::LockFilePath(\n\t\t\t\t\t$user->offsetGet( kTAG_NID ) ) ) )\n\t\t{\n\t\t\t//\n\t\t\t// Instantiate session.\n\t\t\t//\n\t\t\t$session = new Session( $this->mWrapper );\n\t\t\t$session->offsetSet( kTAG_SESSION_TYPE, kTYPE_SESSION_UPLOAD );\n\t\t\t$session->offsetSet( kTAG_USER, $user_id );\n\t\t\t$session->offsetSet( kTAG_ENTITY_PGP_FINGERPRINT, $user_fingerprint );\n\t\t\t$session_id = $session->commit();\n\t\t\n\t\t\t//\n\t\t\t// Create log file.\n\t\t\t//\n\t\t\tif( kDEBUG_FLAG )\n\t\t\t\tfile_put_contents(\n\t\t\t\t\tkPATH_BATCHES_ROOT.\"/log/$session_id.log\",\n\t\t\t\t\t\"Service start: \".date( \"r\" ).\"\\n\" );\n\t\t\n\t\t\t//\n\t\t\t// Copy session in persistent user object.\n\t\t\t//\n\t\t\tUser::ResolveCollection(\n\t\t\t\tUser::ResolveDatabase( $this->mWrapper, TRUE ), TRUE )\n\t\t\t\t\t->replaceOffsets(\n\t\t\t\t\t\t$user_id,\n\t\t\t\t\t\tarray( kTAG_SESSION => $session->offsetGet( kTAG_NID ) ) );\n\t\t\n\t\t\t//\n\t\t\t// Launch batch.\n\t\t\t//\n\t\t\t$php = kPHP_BINARY;\n\t\t\t$script = kPATH_BATCHES_ROOT.'/Batch_Upload.php';\n\t\t\t$path = $this->offsetGet( kAPI_PARAM_FILE_PATH );\n\t\t\n\t\t\t//\n\t\t\t// Handle debug log.\n\t\t\t//\n\t\t\tif( kDEBUG_FLAG )\n\t\t\t\t$log = \"'\".kPATH_BATCHES_ROOT.\"/log/$session_id.txt'\";\n\t\t\telse\n\t\t\t\t$log = '/dev/null';\n\t\t\n\t\t\t//\n\t\t\t// Write to log file.\n\t\t\t//\n\t\t\tif( kDEBUG_FLAG )\n\t\t\t\tfile_put_contents(\n\t\t\t\t\tkPATH_BATCHES_ROOT.\"/log/$session_id.log\",\n\t\t\t\t\t\"Lanching batch: \".date( \"r\" ).\"\\n\" );\n\t\t\n\t\t\t//\n\t\t\t// Launch batch.\n\t\t\t//\n\t\t\t$process_id\n\t\t\t\t= exec( \"$php -f $script '$user_id' '$session_id' '$path' > '$log' &\" );\n\t\t\n\t\t\t//\n\t\t\t// Build result.\n\t\t\t//\n\t\t\t$result = array( kAPI_SESSION_ID => $session_id,\n\t\t\t\t\t\t\t kAPI_PROCESS_ID => $process_id );\n\t\t\n\t\t} // No running sessions.\n\t\t\n\t\t//\n\t\t// Handle running session.\n\t\t//\n\t\telse\n\t\t\t$result = array( kAPI_SESSION_ID => (string) $user->offsetGet( kTAG_SESSION ) );\n\n\t\t//\n\t\t// Encrypt result.\n\t\t//\n\t\t$result = JsonEncode( $result );\n\t\t$this->mResponse[ kAPI_RESPONSE_RESULTS ]\n\t\t\t= $encoder->encodeData( $result );\n\n\t\t//\n\t\t// Set encrypted state.\n\t\t//\n\t\t$this->mResponse[ kAPI_RESPONSE_STATUS ]\n\t\t\t\t\t\t[ kAPI_STATUS_CRYPTED ] = TRUE;\n\t\t\n\t}", "function SubmitSource($contest_short_name)\n {\n $contests =& CCContests::GetTable();\n $record =& $contests->GetRecordFromShortName($contest_short_name);\n CCPage::SetTitle( \"Submit Sources for '{$record['contest_friendly_name']}'\" );\n $form = new CCUploadContestSourceForm($record);\n $show = true;\n if( !empty($_POST['uploadcontestsource']) )\n {\n CCUser::CheckCredentials($_POST['upload_user']);\n\n if( $form->ValidateFields() )\n {\n $ccud = array( $record['contest_short_name'],\n $form->GetFormValue('ccud_tags') ); \n\n $upload_dir = $this->_get_upload_dir($record);\n\n $id = CCUpload::PostProcessUpload($form,$ccud,$upload_dir);\n\n if( $id )\n {\n $this->_list_contest_uploads($contest_short_name,$ccud,$id);\n $show = false;\n }\n }\n }\n \n if( $show )\n CCPage::AddForm( $form->GenerateForm() );\n }", "public function submitSample($data);", "public function submit()\n\t{\n\t\t$for_edit = $this->post_object->generate_text_for_edit();\n\n\t\t// Setup the attachments!\n\t\t$this->setup_attachments();\n\n\t\tif ($this->auth['attachments'])\n\t\t{\n\t\t\t$comments = $this->uploader->get_request_comments();\n\t\t\t$this->uploader\n\t\t\t\t->set_object_id($for_edit['object_id'])\n\t\t\t\t->get_operator()->submit($for_edit['access'], $comments);\n\t\t}\n\t}", "public abstract function post(Job &$job);", "function submit()\n {\n\t\t//all data is handled by submit2()\n }", "public function requestPost(){\n $this->source = &$_POST; //set the source to Post\n }", "abstract public function handle(WebhookPayload $payload): void;", "function processIncomingData() {\n\t \tglobal $TSFE;\n\n\t \t\t// fetch incoming POST data and restore current session data:\n\t \t$incomingData = t3lib_div::_GP($this->prefixId);\n\t \t\n\t \tif (!is_array ($this->sessionData)) {\n\t \t\t$this->sessionData = array (\n\t \t\t\t'data' => array(),\n\t \t\t\t'submitCount' => 0,\n\t \t\t\t'currentStep' => 1,\n\t\t\t\t'submissionId' => md5(t3lib_div::getIndpEnv('REMOTE_ADDR').microtime()),\n\t \t\t);\n\t \t}\n\t \tif (!is_array ($incomingData['data'])) {\n\t \t\t$incomingData['data'] = array();\n\t \t}\n\n\t \t\t// To avoid submit spamming attacks we restrict each session to a certain amount of submits:\n\t\t$this->sessionData['submitCount']++;\n\t\tif ($this->sessionData['submitCount'] < $this->maxSubmitsPerSession) {\n\n\t\t\t\t// Now proceed according to the type of submission:\n\t\t\tif (isset ($incomingData['submitcancel'])) {\n\t\t\t\t$this->submitType = 'cancel';\n\t\t\t\t$this->sessionData['data'] = array();\n\t\t\t\t$this->sessionData['currentStep'] = 1;\n\t\t\t\t\t// Reset submission id. This is used for making sure that a submission is only processed once. It must be handled by the extension\n\t\t\t\t\t// which processes the form:\n\t\t\t\t$this->sessionData['submissionId'] = md5(t3lib_div::getIndpEnv('REMOTE_ADDR').microtime());\n\t\t\t} elseif (isset ($incomingData['submitproceed'])) {\n\t\t\t\t$this->submitType = 'proceed';\n\t\t\t\t$this->sessionData['data'] = (t3lib_div::array_merge_recursive_overrule ($this->sessionData['data'], $incomingData['data']));\n\n\t\t\t\t$evalResult = $this->evaluate_stepFields ($incomingData['currentstep'], $this->sessionData['data']);\n\t\t\t\tif ($evalResult === TRUE) {\n\t\t\t\t\t$this->sessionData['currentStep']= $incomingData['currentstep'] + 1;\n\t\t\t\t} else {\n\t\t\t\t\t$this->submitType = 'evalerror';\n\t\t\t\t}\n\t\t\t} elseif (isset ($incomingData['submitback'])) {\n\t\t\t\t$this->submitType = 'back';\n\t\t\t\t$this->sessionData['data'] = (t3lib_div::array_merge_recursive_overrule ($this->sessionData['data'], $incomingData['data']));\n\t\t\t\t$this->sessionData['currentStep']= $incomingData['currentstep'] - 1;\n\t\t\t} elseif (isset ($incomingData['submitsubmit'])) {\n\t\t\t\t$this->submitType = 'submit';\n\t\t\t\t$this->sessionData['data'] = (t3lib_div::array_merge_recursive_overrule ($this->sessionData['data'], $incomingData['data']));\n\t\t\t\t$evalResult = $this->evaluate_allFields ($this->sessionData['data']);\n\t\t\t\tif ($evalResult !== TRUE) {\n\t\t\t\t\t$this->submitType = 'evalerror';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$TSFE->fe_user->setKey ('ses', $this->prefixId, $this->sessionData);\n\t\t$this->currentStep = $this->sessionData['currentStep'];\n\t }", "public function sign(string $payload, $key) : string;", "private function handlePostRequest()\n {\n // first fetch the csrf-token\n $this->fetchCsrfToken();\n \n // read the POST data sent by the form\n $requestBody = @file_get_contents(\"php://input\");\n $requestData = json_decode($requestBody);\n \n // optional: enhance the request data with the IP address for tracking purposes\n $requestData->IpAddress = $_SERVER[\"REMOTE_ADDR\"];\n \n // optional: add the campaign id to connect all form interactions to your campaign\n // $requestData->CampaignId = \"your-campaign-id\";\n \n // send the prepared request data to the system\n $requestString = json_encode($requestData);\n $response = $this->sendHttpRequest(\"POST\", $this::BASE_PATH . $this::RESULT_HEADERS_PATH, $requestString);\n \n // print the response\n echo $response;\n }", "public function handle_submit(){\n $required = array();\n foreach($required as $require){\n if(!isset($_POST[$require])){\n die(\"Invalid Request. $require is not posted.\");\n }\n } \n \n // Localise the submitted form data.\n $name = $_POST['name'];\n $email = $POST['email'];\n $phone = $_POST['phone'];\n $website = $_POST['website'];\n $message = $_POST['message'];\n\n // Add the new contact request to the database.\n $db = new Db();\n $db = $db->get();\n try{\n $db->exec(\"INSERT INTO Contact_Requests (Name, Email, Phone, Website, Message) VALUES (\n '$name',\n '$email',\n '$phone',\n '$website',\n '$message'\n )\");\n }\n catch(PDOException $e){\n die($e->getMessage());\n }\n\n // Complete. Redirect the user back to the inital page.\n if(isset($this->redirect_url)){\n header(\"Location: $this->redirect_url\");\n }\n else{\n // No redirect URL, take the user back to the homepage.\n header(\"Location: index.php\");\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given a filename, attempt to parse header comment for module meta attribute content.
public function parseMetaFromModuleFile($fn) { $src = file($fn, FILE_USE_INCLUDE_PATH | FILE_IGNORE_NEW_LINES); $meta = array( 'description' => ''); $in_header = FALSE; $past_header = FALSE; foreach ($src as $line) { $line = trim($line); if (!$past_header && $line == '/**') { // Found the start of the header comment block, so start processing. $in_header = TRUE; } else if ($line == '*/') { // Found the end of the header comment block, so stop processing. $in_header = FALSE; $past_header = TRUE; } else if (!$in_header) { if (substr($line, 0, 5) == 'class') { // Try to extract the class name. $parts = split(' ', $line); $meta['class'] = $parts[1]; } } else if ($in_header && substr($line, 0, 1) == '*') { // Lines starting with an asterisk are part of the comment. $line = trim(substr($line, 1)); if (substr($line, 0, 1) == '@') { // Comment lines starting with an @ are named attributes. $parts = split(' ', $line, 2); if (count($parts == 2)) { // As long as there's a name and a value, extract the attribute. $name = substr($parts[0], 1); if (isset($meta[$name])) { if (!is_array($meta[$name])) $meta[$name] = array($meta[$name]); $meta[$name][] = $parts[1]; } else { $meta[$name] = $parts[1]; } } } else { // This line isn't named attribute, so it's title or description. if (!isset($meta['title']) && $line) { // If there's no title yet, and the line is non-blank, capture the title. $meta['title'] = $line; } else { // All other lines pile into the description. $meta['description'] .= "$line\n"; } } } } return $meta; }
[ "public function parseMetaData() {\n\t\tif(!file_exists($this->uploadDir))\n\t\t\tmkdir($this->uploadDir); // warning, created with 0777 mode by default\n\t\t$metaDataFile = $this->uploadDir.'/'.$this->metaDataFileName;\n\t\t$this->comment = array();\n\t\tif(file_exists($metaDataFile))\n\t\t\tforeach(file($metaDataFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) as $line)\n\t\t\t\tif(preg_match('/^[ \\t]*\"(.*)\"[ \\t]*=[ \\t]*\"(.*)\"[ \\t]*$/', $line, $regs))\n\t\t\t\t\t$this->comment[$regs[1]] = $regs[2];\n\t}", "private function parse_meta(){\n\t\tif($this->text[0]!==\"[\")\n\t\t\treturn; //no meta definition\n\n\t\t// Get first line\n\t\t$m=strtok($this->text, \"\\n\");\n\t\tif(strlen($m)>1)\n\t\t\t$m=substr($m, 1, strlen($m));\n\t\telse return;\n\n\t\t//Get ID. It should be the first word starting with an alphabetic char.\n\n\t\t$tmp=sscanf(\"%s\", $m);\n\t\tif(preg_match(\"/^[a-z]$/i\", $tmp[0]))\n\t\t\t$this->label=strtolower($tmp);\n\n\t\t/*This gets a bit hairy. First we look for a description, which is\n\t\t a string enclosed in double quotes. Only one description is allowed\n\t\t in a meta def. So we'll find 0, 1 or 2 occurrences after checking for\n\t\t escape sequence \\. Any more than that is illegal.\n\t\t The description might spill into next lines, in which case we need to\n\t\t concatenate them. A new scope is opened for... well... sanity.\n\t\t*/\n\n\t\t$f=strpos($m, \"\\\"\");\n\t\tif($f===FALSE) //No description\n\t\t\tgoto desc_done;\n\t\tdo{\n\t\t\t$l=strpos($m, \"\\\"\", $f);\n\t\t\tif($l===FALSE)\n\t\t\t\t$m.=strtok($this->text, \"\\n\");\n\t\t}while($l===FALSE);\n\n\t\tif($l>$f+1 && ($f!==FALSE || $l!==FALSE))\n\t\t\t//We appear to have hit the jackpot\n\t\t\t$this->meta[\"desc\"]=trim(substr($m, $f+1, $l-1)); //off-by-1?\n\n\tdesc_done: // Screw good practice. How bad can it be?\n\t}", "protected function parseMobiHeader()\n {\n if (!$this->palmDocHeader) {\n return;\n }\n $file = $this->file;\n $this->mobiHeaderStart = $file->ftell() + 2;\n $file->fseek($this->mobiHeaderStart);\n if ($file->fread(4) === 'MOBI') {\n $this->mobiHeader = new MobiHeader(\n $this->readData($file, 4),\n $this->readData($file, 4),\n $this->readData($file, 4),\n $this->readData($file, 4),\n $this->readData($file, 4)\n );\n }\n $file->fseek($this->mobiHeaderStart + 68);\n $data = $file->fread(8);\n $title = unpack('N*', $data);\n $file->fseek($this->mobiHeaderStart + ($title[1] - 16));\n $this->title = $file->fread($title[2]);\n }", "protected abstract function readFileHeader();", "public function parseFileMeta($rawContent, array $headers)\n {\n $meta = [];\n $pattern = \"/^(?:\\xEF\\xBB\\xBF)?(\\/(\\*)|---)[[:blank:]]*(?:\\r)?\\n\"\n . \"(?:(.*?)(?:\\r)?\\n)?(?(2)\\*\\/|---)[[:blank:]]*(?:(?:\\r)?\\n|$)/s\";\n if (preg_match($pattern, $rawContent, $rawMetaMatches) && isset($rawMetaMatches[3])) {\n $meta = $this->getYamlParser()->parse($rawMetaMatches[3]) ?: [];\n $meta = is_array($meta) ? $meta : [ 'title' => $meta ];\n\n foreach ($headers as $name => $key) {\n if (isset($meta[$name])) {\n // rename field (e.g. remove whitespaces)\n if ($key != $name) {\n $meta[$key] = $meta[$name];\n unset($meta[$name]);\n }\n } elseif (!isset($meta[$key])) {\n // guarantee array key existance\n $meta[$key] = '';\n }\n }\n\n if (!empty($meta['date']) || !empty($meta['time'])) {\n // workaround for issue #336\n // Symfony YAML interprets ISO-8601 datetime strings and returns timestamps instead of the string\n // this behavior conforms to the YAML standard, i.e. this is no bug of Symfony YAML\n if (is_int($meta['date'])) {\n $meta['time'] = $meta['date'];\n $meta['date'] = '';\n }\n\n if (empty($meta['time'])) {\n $meta['time'] = strtotime($meta['date']) ?: '';\n } elseif (empty($meta['date'])) {\n $rawDateFormat = (date('H:i:s', $meta['time']) === '00:00:00') ? 'Y-m-d' : 'Y-m-d H:i:s';\n $meta['date'] = date($rawDateFormat, $meta['time']);\n }\n } else {\n $meta['date'] = $meta['time'] = '';\n }\n\n if (empty($meta['date_formatted'])) {\n if ($meta['time']) {\n $encodingList = mb_detect_order();\n if ($encodingList === array('ASCII', 'UTF-8')) {\n $encodingList[] = 'Windows-1252';\n }\n\n // phpcs:disable Generic.PHP.DeprecatedFunctions\n $rawFormattedDate = strftime($this->getConfig('date_format'), $meta['time']);\n // phpcs:enable\n\n $meta['date_formatted'] = mb_convert_encoding($rawFormattedDate, 'UTF-8', $encodingList);\n } else {\n $meta['date_formatted'] = '';\n }\n }\n } else {\n // guarantee array key existance\n $meta = array_fill_keys($headers, '');\n }\n\n return $meta;\n }", "private function _getFileHeader() {\n $template = file_get_contents(dirname(__FILE__) . '/file_header.tmpl');\n\n $template = preg_replace('/_author/i', $this->_author, $template);\n $template = preg_replace('/_package/i', $this->_package, $template);\n $template = preg_replace('/_version/i', $this->_version, $template);\n $template = preg_replace('/_serviceName/i', $this->_serviceName, $template);\n\n return $template;\n }", "private function parseHeader($fp) {\n $magic = fread($fp, 4);\n $data = fread($fp, 4);\n $header = unpack(\"lrevision\", $data);\n \n if (self::MAGIC1 != $magic\n && self::MAGIC2 != $magic) {\n return null;\n }\n\n if (0 != $header['revision']) {\n return null;\n }\n\n $data = fread($fp, 4 * 5);\n $offsets = unpack(\"lnum_strings/lorig_offset/\"\n . \"ltrans_offset/lhash_size/lhash_offset\", $data);\n return $offsets;\n }", "protected function readHeaders() {\n\t\t$f = fopen($this->filename, 'rb');\n\t\t$this->headers = array();\n\n\t\tfor (;;) {\n\t\t\t$line = fgets($f, 8192);\n\t\t\t$start = substr($line, 0, 2);\n\n\t\t\tif ($start !== '##' && $start !== '--') {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$this->headers[] = trim(substr($line, 2));\n\t\t}\n\n\t\tfclose($f);\n\t}", "function extract_title($metadata, $raw_content) {\n if (isset($metadata['title'])) return $metadata['title'];\n\n preg_match('/#\\\\s?([^\\\\n]+)/', $raw_content, $matches, PREG_UNMATCHED_AS_NULL);\n if (isset($matches) && $matches[1] != null) return $matches[1];\n return \"\";\n}", "private function getHeaderComment(){\n\t\t\t$source= \"\";\n\t\t\t\n\t\t\t$source .= FileManager::getTab() . FileManager::getComment(58, true) . FileManager::getBackSpace();\n\t\t\t$source .= FileManager::getTab() . \" **** File generated by fitzlucassen\\DALGenerator tool ****\" . FileManager::getBackSpace();\n\t\t\t$source .= FileManager::getTab() . \" * All right reserved to fitzlucassen repository on github*\" . FileManager::getBackSpace();\n\t\t\t$source .= FileManager::getTab() . \" ************* https://github.com/fitzlucassen ************\" . FileManager::getBackSpace();\n\t\t\t$source .= FileManager::getTab() . FileManager::getComment(58, false) . FileManager::getBackSpace();\n\t\t\t\n\t\t\treturn $source;\n\t\t}", "function parse_metadata( $raw_doc ) {\n /* designed to be compatible with MultiMarkdown's metadata */\n $lines = explode( PHP_EOL, $raw_doc );\n $metadata = $doc_lines = array();\n // flag to halt searching for metadata\n $parse = true;\n foreach( $lines as $line ) {\n if ( $parse ) {\n if ( preg_match( \"/^$/\", $line ) ) {\n // stop looking for meta-data, treat the rest as the document\n $parse = false;\n continue;\n }\n if ( preg_match( \"/([\\w-]+):(.*)/\", $line, $parts ) ) {\n $key = strtolower( trim( $parts[1] ) );\n $value = trim( $parts[2] );\n $metadata[$key] = array( $value );\n } elseif ( preg_match( \"/^\\s\\s\\s\\s(.+)/\", $line, $parts ) ) {\n // indenting 4 or more spaces continues the previous key\n if ( ! isset( $key ) ) {\n // the document started with an indented line\n // assume no meta-data and stop parsing\n $parse = false;\n array_push( $doc_lines, $line );\n continue;\n }\n $value = trim( $parts[1] );\n array_push( $metadata[$key], $value );\n } else {\n // not a blank line, but not metadata either\n // probably a document that begind with a normal line\n $parse = false;\n array_push( $doc_lines, $line );\n }\n } else {\n // add lines to the document\n array_push( $doc_lines, $line );\n }\n }\n $document = implode( PHP_EOL, $doc_lines );\n return( array( 'metadata' => $metadata, 'document' => $document ) );\n}", "private function parse_comments_file(){\n\t\t$xml\t\t=\tsimplexml_load_file($this->commentsfile);\n\t\t\n\t\tforeach( $xml as $comm ){\n\t\t\t$this->comments[]=new Comment((string)$comm->login,(string)$comm->content,(string)$comm->date,$this->file);\n\t\t}\n\t}", "function get_file_comments_for_data($file) {\n\t$comments = array_filter(\n\t\ttoken_get_all(file_get_contents($file)), function($entry) {\n\t\t\treturn $entry[0] == T_DOC_COMMENT;\n\t\t}\n\t);\n\n\t// Return the comments in a string\n\t$comments_string = array_shift($comments);\n\treturn $comments_string;\n}", "function extractSetup($filepath){\n\t $post = file_get_contents($filepath);\n\n\t // detect the setup block\n\t $delimiter = \"---\";\n\t $startsAt = strpos($post, $delimiter) + strlen($delimiter);\n\t $endsAt = strpos($post, $delimiter, $startsAt);\n\t $setup = substr($post, $startsAt, $endsAt - $startsAt);\n\n\t // turn the metadata into an array\n\t $metadata = preg_split(\"/\\\\r\\\\n|\\\\r|\\\\n/\", $setup, -1, PREG_SPLIT_NO_EMPTY);\n\t foreach ($metadata as $key => $value) {\n\t // extract sane key/vals \n\t $index = substr($value, 0, strpos($value, \":\"));\n\t $metadata[$index] = substr($value, strpos($value, \": \") + strlen(\": \"));\n\t unset($metadata[$key]);\n\t }\n\t // get the rest of the content\n\t $content = substr($post, $endsAt + strlen($delimiter)+2);\n\t return array(\"content\"=>$content,\"metadata\"=>$metadata);\n\t}", "protected function parseVersionFile(): void\n {\n if (! file_exists($this->version_file)) {\n return;\n }\n\n // Read file in as an array & remove any empty lines\n $version_parts = array_filter(explode(\"\\n\", @file_get_contents($this->version_file)));\n\n // First line is the version\n if (empty($version_parts) or ! $this->parseVersion(array_shift($version_parts))) {\n return;\n }\n\n // Next line is branch/pre release\n $pre_release = array_shift($version_parts);\n\n $this->pre_release = ($pre_release !== 'master') ? $pre_release : null;\n\n // Is there anything left in the file for meta?\n if (empty($version_parts)) {\n return;\n }\n\n // Everything left is the meta, so concatenate it with .'s & replace the spaces with _'s\n $this->meta = preg_replace('/\\\\s+/u', '_', implode('.', $version_parts));\n }", "public function includeHeaderComment(&$html) {\n\t\tif (!empty($this->headerComment)) {\n\t\t\t$html = preg_replace_callback(\n\t\t\t\t'/<meta http-equiv(.*)>/Usi',\n\t\t\t\tfunction ($matches) {\n\t\t\t\t\treturn trim($matches[0] . $this->newline . $this->tab . $this->tab . '<!-- ' . $this->headerComment . '-->');\n\t\t\t\t},\n\t\t\t\t$html,\n\t\t\t\t1\n\t\t\t);\n\t\t}\n\t}", "protected function parseHeader()\n\t{\n\t\t//line 1 is version header\n\t\t$this->parseVersion(fgets($this->logFile));\n\t\t\n\t\t//line 2 is timezone header\n\t\t$this->parseTimezone(fgets($this->logFile));\n\t\t\n\t\t//line 3 is client header\n\t\t$this->parseClient(fgets($this->logFile));\n\t}", "private function parseMOHeader($fp) {\n $data = fread($fp, 8);\n\t\tif(!$data) {\n\t\t\tthrow new GettextException(\"Can't fread(8) file for reading\", 202);\n\t\t}\n\t\t$header = unpack('lmagic/lrevision', $data);\n if(self::MO_MAGIC_1 != $header['magic'] && self::MO_MAGIC_2 != $header['magic']) {\n return NULL;\n }\n if(0 != $header['revision']) {\n return NULL;\n }\n $data = fread($fp, 4 * 5);\n\t\tif(!$data) {\n\t\t\tthrow new GettextException(\"Can't fread(4 * 5) file for reading\", 203);\n\t\t}\n $offsets = unpack('lnum_strings/lorig_offset/' . 'ltrans_offset/lhash_size/lhash_offset', $data);\n return $offsets;\n }", "function parseREADME()\n {\n $description = '';\n if (file_exists($this->path . DIRECTORY_SEPARATOR . 'README')) {\n $a = new \\SplFileInfo($this->path . DIRECTORY_SEPARATOR . 'README');\n foreach ($a->openFile('r') as $num => $line) {\n if (!$num) {\n $this->pxml->summary = $line;\n continue;\n }\n $description .= $line;\n }\n $this->pxml->description = $description;\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get id_product of review
public function get_id_product() { return $this->id_product; }
[ "public function getId_product()\n {\n return $this->id_product;\n }", "public function getIdProduct()\n\t{\n\t\treturn $this->id_product;\n\t}", "public function getReviewId();", "public function getIdProduct()\n {\n return $this->idProduct;\n }", "public function getIdProduct() {\n return $this->idProduct;\n }", "public function get_product_id()\n {\n }", "protected function getProductRatingId()\n {\n $url = 'rating/index/sort/rating_id/dir/desc/';\n $regex = '`rating\\/edit\\/id\\/(\\d+)`';\n $extractor = new Extractor($url, $regex);\n $match = $extractor->getData();\n\n return empty($match[1]) ? null : $match[1];\n }", "public function getIdProduct()\n {\n return $this->idProduct;\n }", "function getReviewId() {\n\t\treturn $this->getData('reviewId');\n\t}", "public function getProductID(){\n return $this->product->getID();\n }", "public function getProduct_id()\n {\n return $this->product_id;\n }", "public function getProduct_Id() {\n return $this->product_Id;\n }", "public function getReviewId()\n {\n return $this->reviewId;\n }", "public function getReviewId() {\n\t\t\t\treturn ($this->reviewId);\n\t\t\t}", "public function getIdProd()\n {\n return $this->id_prod;\n }", "public static function get_id($product)\n {\n if(FlycartWoocommerceVersion::wcVersion('3.0') || method_exists($product , 'get_id')){\n return $product->get_id();\n } else {\n $_product_id = $product->id;\n if(isset($product->variation_id)) $_product_id = $product->variation_id;\n return $_product_id;\n }\n }", "public function getProductID()\n {\n return $this->productID;\n }", "public function getProductID() {\n if (isset($this->product)) {\n return $this->product->getID();\n }\n return \"\";\n }", "public function current_product_id () {\n \n if (!isset($_GET[\"id\"])) {\n return null;\n }\n\n $user_id = $this->get_user_id(); \n $prod_id = $_GET[\"id\"];\n //CHECK IF IT IS ACCESSABLE\n $sql = \"\n SELECT prod_id \n FROM prod_acc\n WHERE user_id = ? AND prod_id = ? \n \";\n $id = $this->db_query($sql, \"ii\", array ($user_id, $prod_id));\n if(isset($id)){\n return $id[0][\"prod_id\"];\n }\n else {\n return null;\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Receive, and parse, the incoming wbxml query. According to MS docs, OR is supported in the protocol, but will ALWAYS return a searchToComplex status in Exchange 2007. Additionally, AND is ONLY supported as the topmost element. No nested AND is allowed. All such queries will return a searchToComplex status.
protected function _parseQuery($subquery = null) { $query = array(); while (($type = ($this->_decoder->getElementStartTag(self::SEARCH_AND) ? self::SEARCH_AND : ($this->_decoder->getElementStartTag(self::SEARCH_OR) ? self::SEARCH_OR : ($this->_decoder->getElementStartTag(self::SEARCH_EQUALTO) ? self::SEARCH_EQUALTO : ($this->_decoder->getElementStartTag(self::SEARCH_LESSTHAN) ? self::SEARCH_LESSTHAN : ($this->_decoder->getElementStartTag(self::SEARCH_GREATERTHAN) ? self::SEARCH_GREATERTHAN : ($this->_decoder->getElementStartTag(self::SEARCH_FREETEXT) ? self::SEARCH_FREETEXT : ($this->_decoder->getElementStartTag(Horde_ActiveSYnc::SYNC_FOLDERID) ? Horde_ActiveSync::SYNC_FOLDERID : ($this->_decoder->getElementStartTag(Horde_ActiveSync::SYNC_FOLDERTYPE) ? Horde_ActiveSync::SYNC_FOLDERTYPE : ($this->_decoder->getElementStartTag(Horde_ActiveSync::SYNC_DOCUMENTLIBRARY_LINKID) ? Horde_ActiveSync::SYNC_DOCUMENTLIBRARY_LINKID : ($this->_decoder->getElementStartTag(Horde_ActiveSync_Message_Mail::POOMMAIL_DATERECEIVED) ? Horde_ActiveSync_Message_Mail::POOMMAIL_DATERECEIVED : -1))))))))))) != -1) { switch ($type) { case self::SEARCH_AND: case self::SEARCH_OR: case self::SEARCH_EQUALTO: case self::SEARCH_LESSTHAN: case self::SEARCH_GREATERTHAN: $q = array( 'op' => $type, 'value' => $this->_parseQuery(true) ); if ($subquery) { $query['subquery'][] = $q; } else { $query[] = $q; } $this->_decoder->getElementEndTag(); break; default: if (($query[$type] = $this->_decoder->getElementContent())) { $this->_decoder->getElementEndTag(); } else { $this->_decoder->getElementStartTag(self::SEARCH_VALUE); $query[$type] = $this->_decoder->getElementContent(); switch ($type) { case Horde_ActiveSync_Message_Mail::POOMMAIL_DATERECEIVED: $query[$type] = new Horde_Date($query[$type]); break; } $this->_decoder->getElementEndTag(); }; break; } } return $query; }
[ "function parseAdvancedRequest() \n\t{\n\t\t$additionalControlId = 1;\n\t\t\n\t\t$this->_where[$this->sessionPrefix.\"_asearchnot\"] = array();\n\t\t$this->_where[$this->sessionPrefix.\"_asearchopt\"] = array();\n\t\t$this->_where[$this->sessionPrefix.\"_asearchfor\"] = array();\n\t\t$this->_where[$this->sessionPrefix.\"_asearchfor2\"] = array();\n\t\t$tosearch = 0;\n\t\t$asearchfield = postvalue(\"asearchfield\");\n\t\t$this->_where[$this->sessionPrefix.\"_asearchtype\"] = postvalue(\"type\");\n\t\tif(!$this->_where[$this->sessionPrefix.\"_asearchtype\"])\n\t\t\t$this->_where[$this->sessionPrefix.\"_asearchtype\"] = \"and\";\n\t\tif(isset($asearchfield) && is_array($asearchfield))\n\t\t{\n\t\t\tforeach($asearchfield as $field)\n\t\t\t{\n\t\t\t\t$gfield = GoodFieldName($field);\n\t\t\t\t\n\t\t\t\t$not = postvalue(\"not_\".$gfield);\n\t\t\t\t$type = postvalue(\"type_\".$gfield);\n\t\t\t\t$asopt = postvalue(\"asearchopt_\".$gfield);\n\t\t\t\t$value1 = postvalue(\"value_\".$gfield);\n\t\t\t\t$value2 = postvalue(\"value1_\".$gfield);\n\t\t\t\t\n\t\t\t\tif($value1 || $asopt=='Empty')\n\t\t\t\t{\n\t\t\t\t\t$tosearch = 1;\n\t\t\t\t\t$this->_where[$this->sessionPrefix.\"_asearchopt\"][$field] = $asopt;\n\t\t\t\t\tif(!is_array($value1))\n\t\t\t\t\t\t$this->_where[$this->sessionPrefix.\"_asearchfor\"][$field] = $value1;\n\t\t\t\t\telse\n\t\t\t\t\t\t$this->_where[$this->sessionPrefix.\"_asearchfor\"][$field] = ($value1);\n\t\t\t\t\t$this->_where[$this->sessionPrefix.\"_asearchfortype\"][$field] = $type;\n\t\t\t\t\tif($value2)\n\t\t\t\t\t\t$this->_where[$this->sessionPrefix.\"_asearchfor2\"][$field] = $value2;\n\t\t\t\t\t$this->_where[$this->sessionPrefix.\"_asearchnot\"][$field] = ($not==\"on\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif($tosearch)\n\t\t\t$this->_where[$this->sessionPrefix.\"_search\"] = 2;\n\t\telse\n\t\t\t$this->_where[$this->sessionPrefix.\"_search\"] = 0;\n\t\t$this->_where[$this->sessionPrefix.\"_pagenumber\"] = 1;\n\t}", "function searchXML($query, $xml_obj) {\n\t/**\n\t * The command for xpath to be called.\n\t * @var string\n\t */\n\t$select_xpath = \"\";\n\t$from_xpath = \"\";\n\t$where_xpath = \"\";\n\n\t//=====================================\n\t// PROCESSING THE \"FROM\" CLAUSE\n\t//=====================================\n\n\tif($query[\"FROM\"][0] == \"ROOT\") // getting rid of the ROOT literal \n\t\t$query[\"FROM\"][0] = \"\";\n\n\t// element and no attribute (el)\n\tif(($query[\"FROM\"][0]) && !isset($query[\"FROM\"][1]))\n\t\t$from_xpath .= \"//\" . $query[\"FROM\"][0] . \"[1]\"; // [1] => first occurence\n\t// attribute and no element (.attr)\n\telseif(!($query[\"FROM\"][0]) && isset($query[\"FROM\"][1]))\n\t\t$from_xpath .= \"(//@\" . $query[\"FROM\"][1] . \"/..)[1]\"; // [1] => first occurence\n\t// both element and attribute (el.attr)\n\telseif(($query[\"FROM\"][0]) && ($query[\"FROM\"][1]))\n\t\t$from_xpath .= \"//\" . $query[\"FROM\"][0] . \"[@\" . $query[\"FROM\"][1] . \"][1]\"; // [1] => first occurence\n\telse\n\t\t$from_xpath .= \"\";\n\n\t//=====================================\n\t// PROCESSING THE \"SELECT\" CLAUSE\n\t//=====================================\n\n\tif($query[\"SELECT\"] == \"*\" || $query[\"SELECT\"] == \"\")\n\t\t$select_xpath = $from_xpath;\n\telse\n\t\t$select_xpath = \"//\" . $query[\"SELECT\"];\n\n\t//=====================================\n\t// PROCESSING THE \"WHERE\" CLAUSE\n\t//=====================================\n\n\tif(isset($query[\"WHERE\"]))\n\t{\n\t\t// element and no attribute (el)\n\t\tif(($query[\"WHERE\"][0]) && !isset($query[\"WHERE\"][1]))\n\t\t{\n\t\t\t// contains\n\t\t\tif($query[\"WHERE\"][2] == \"CONTAINS\")\n\t\t\t{\n\t\t\t\tif($query[\"WHERE\"][0] == $query[\"SELECT\"]) // to est\n\t\t\t\t\t$where_xpath = \"[contains(text(), '\" . $query[\"WHERE\"][3] . \"')]\";\n\t\t\t\telse\n\t\t\t\t\t$where_xpath = \"[contains(.//\" . $query[\"WHERE\"][0] . \", '\" . $query[\"WHERE\"][3] . \"')]\";\n\t\t\t}\n\t\t\t// relational operator\n\t\t\telse\n\t\t\t\t$where_xpath = \"[\" . $query[\"WHERE\"][0] . $query[\"WHERE\"][2] . \"'\" . $query[\"WHERE\"][3] . \"']\";\n\t\t}\n\t\t// attribute and no element (.attr)\n\t\telseif(!($query[\"WHERE\"][0]) && ($query[\"WHERE\"][1]))\n\t\t{\n\t\t\t// contains\n\t\t\tif($query[\"WHERE\"][2] == \"CONTAINS\")\n\t\t\t\t$where_xpath = \"[contains(@\" . $query[\"WHERE\"][1] . \", '\" . $query[\"WHERE\"][3] . \"')]\";\n\t\t\t// relational operator\n\t\t\telse\n\t\t\t\t$where_xpath = \"[@\" . $query[\"WHERE\"][1] . $query[\"WHERE\"][2] . \"'\" . $query[\"WHERE\"][3] . \"']\";\n\t\t}\n\t\t// both element and attribute (el.attr)\n\t\telseif(($query[\"WHERE\"][0]) && ($query[\"WHERE\"][1]))\n\t\t{\n\t\t\t// contains\n\t\t\tif($query[\"WHERE\"][2] == \"CONTAINS\")\n\t\t\t{\n\t\t\t\tif($query[\"WHERE\"][0] == $query[\"SELECT\"])\n\t\t\t\t\t$where_xpath = \"[.//\" . $query[\"WHERE\"][0] . \"[contains(text(), '\" . $query[\"WHERE\"][3] . \"')]]\";\n\t\t\t\telse\n\t\t\t\t\t$where_xpath = \"[.//\" . $query[\"WHERE\"][0] . \"[contains(@\" . $query[\"WHERE\"][1] . \", '\" . $query[\"WHERE\"][3] . \"')]]\";\n\t\t\t}\n\t\t\t// relational operator\n\t\t\telse\n\t\t\t\t$where_xpath = \"[.//\" . $query[\"WHERE\"][0] . \"[@\" . $query[\"WHERE\"][1] . $query[\"WHERE\"][2] . \"'\" . $query[\"WHERE\"][3] . \"']]\";\n\t\t}\n\t\telse\n\t\t\t$where_xpath = \"\";\n\t}\n\n\t//=====================================\n\t// PROCESSING THE \"WHERE NOT\" CLAUSE\n\t//=====================================\n\n\tif(isset($query[\"WHERE NOT\"]))\n\t{\n\t\t// element and no attribute (el)\n\t\tif(($query[\"WHERE NOT\"][0]) && !($query[\"WHERE NOT\"][1]))\n\t\t{\n\t\t\t// contains\n\t\t\tif($query[\"WHERE NOT\"][2] == \"CONTAINS\")\n\t\t\t{\n\t\t\t\tif($query[\"WHERE NOT\"][0] == $query[\"SELECT\"]) // to est\n\t\t\t\t\t$where_xpath = \"[not(contains(text(), '\" . $query[\"WHERE NOT\"][3] . \"'))]\";\n\t\t\t\telse\n\t\t\t\t\t$where_xpath = \"[not(contains(.//\" . $query[\"WHERE NOT\"][0] . \", '\" . $query[\"WHERE NOT\"][3] . \"'))]\";\n\t\t\t}\n\t\t\t// relational operator\n\t\t\telse\n\t\t\t\t$where_xpath = \"[not(\" . $query[\"WHERE NOT\"][0] . $query[\"WHERE NOT\"][2] . \"'\" . $query[\"WHERE NOT\"][3] . \"')]\";\n\t\t}\n\t\t// attribute and no element (.attr)\n\t\telseif(!($query[\"WHERE NOT\"][0]) && ($query[\"WHERE NOT\"][1]))\n\t\t{\n\t\t\t// contains\n\t\t\tif($query[\"WHERE NOT\"][2] == \"CONTAINS\")\n\t\t\t\t$where_xpath = \"[not(contains(@\" . $query[\"WHERE NOT\"][1] . \", '\" . $query[\"WHERE NOT\"][3] . \"'))]\";\n\t\t\t// relational operator\n\t\t\telse\n\t\t\t\t$where_xpath = \"[not(@\" . $query[\"WHERE NOT\"][1] . $query[\"WHERE NOT\"][2] . \"'\" . $query[\"WHERE NOT\"][3] . \"')]\";\n\t\t}\n\t\t// both element and attribute (el.attr)\n\t\telseif(($query[\"WHERE NOT\"][0]) && ($query[\"WHERE NOT\"][1]))\n\t\t{\n\t\t\t// contains\n\t\t\tif($query[\"WHERE NOT\"][2] == \"CONTAINS\")\n\t\t\t{\n\t\t\t\tif($query[\"WHERE NOT\"][0] == $query[\"SELECT\"])\n\t\t\t\t\t$where_xpath = \"[not(.//\" . $query[\"WHERE NOT\"][0] . \"[contains(text(), '\" . $query[\"WHERE NOT\"][3] . \"')])]\";\n\t\t\t\telse\n\t\t\t\t\t$where_xpath = \"[not(.//\" . $query[\"WHERE NOT\"][0] . \"[contains(@\" . $query[\"WHERE NOT\"][1] . \", '\" . $query[\"WHERE NOT\"][3] . \"')])]\";\n\t\t\t}\n\t\t\t// relational operator\n\t\t\telse\n\t\t\t\t$where_xpath = \"[not(.//\" . $query[\"WHERE NOT\"][0] . \"[@\" . $query[\"WHERE NOT\"][1] . $query[\"WHERE NOT\"][2] . \"'\" . $query[\"WHERE NOT\"][3] . \"'])]\";\n\t\t}\n\t\telse\n\t\t\t$where_xpath = \"\";\n\t}\n\n\t//=====================================\n\t// PUTTING THE RESULTING PATH TOGETHER\n\t//=====================================\n\n\t$final_xpath = $from_xpath . $select_xpath . $where_xpath;\n\t$result_obj = $xml_obj->xpath($final_xpath);\n\n\tif(!$result_obj) // if nothing\n\t\treturn NULL;\n\n\tif(isset($query[\"ORDER BY\"]))\n\t\t$result_obj = orderXML($xml_obj, $result_obj, $query);\n\n\treturn $result_obj; // return the SimpleXML object\n}", "public function getQuery(){\r\n\t\t\t\r\n\t\t\t$query = \"\";\r\n\t\t\t$queryParts = array();\r\n\t\t\t\r\n\t\t\tforeach($this->filterResults as $key => $value){\r\n\t\t\t\tarray_push($queryParts, $value->query);\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif($this->logicGate == 'or'){\r\n\t\t\t\t$query = \" ( \" . join(\" or \", $queryParts) . \" ) \";\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t$query = join(\" and \", $queryParts);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn $query;\r\n\t\t}", "protected function generateBoolQuery()\n {\n $parser = new Parser();\n $parsedQuery = $parser->set_Content($this->query)->tokenize()->parse();\n if (count($parsedQuery) == 1) {\n $query_part = $this->generateSingleQuery();\n } else {\n $filter = $this->generateFilter();\n if($this->query==\"\" && ($_GET['scorecheck']=='on' ||$_GET['ancestrycheck']=='on') ){\n $filter = $this->generateFilter();\n $query_part = array('filtered' => array( 'filter' => $filter));\n }\n\n elseif (count(array_keys($this->filterFields)) < 1 && $this->year == \"\") {\n $query_part = $this->recursiveConstructBoolQuery($parsedQuery);\n } else {\n\n $filter = $this->generateFilter();\n $query_part = array('filtered' => array('query' => $this->recursiveConstructBoolQuery($parsedQuery), 'filter' => $filter));\n }\n }\n\n return $query_part;\n }", "public function conditionalOrExpression(){\n try {\n // Sparql11query.g:382:3: ( conditionalAndExpression ( OR conditionalAndExpression )* ) \n // Sparql11query.g:383:3: conditionalAndExpression ( OR conditionalAndExpression )* \n {\n $this->pushFollow(self::$FOLLOW_conditionalAndExpression_in_conditionalOrExpression1301);\n $this->conditionalAndExpression();\n\n $this->state->_fsp--;\n\n // Sparql11query.g:383:28: ( OR conditionalAndExpression )* \n //loop48:\n do {\n $alt48=2;\n $LA48_0 = $this->input->LA(1);\n\n if ( ($LA48_0==$this->getToken('OR')) ) {\n $alt48=1;\n }\n\n\n switch ($alt48) {\n \tcase 1 :\n \t // Sparql11query.g:383:29: OR conditionalAndExpression \n \t {\n \t $this->match($this->input,$this->getToken('OR'),self::$FOLLOW_OR_in_conditionalOrExpression1304); \n \t $this->pushFollow(self::$FOLLOW_conditionalAndExpression_in_conditionalOrExpression1306);\n \t $this->conditionalAndExpression();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop48;\n }\n } while (true);\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "function run ($query,$xml)\n{\n // GET AN ELEMENT\n if ($query['FROM'][0]==\"ROOT\" || $query['FROM'][0]==\"\")\n {\n $path=NULL;\n } \n else\n {\n $path=$query['FROM'][0];\n }\n // GET AN ATTRIBUTTE\n if(!empty($query['FROM'][1]))\n {\n $path=$path.\".{$query[\"FROM\"][1]}\";\n }\n $xml=my_xpath($path,$xml);\n\n if(!empty($xml))\n {\n $xml=$xml[0];\n }\n else\n return (string) NULL;\n\n // SELECT ELEMENT from FROM\n $path=$query['SELECT'];\n $xml=my_xpath($path,$xml);\n\n if(empty($xml))\n {\n return (string)NULL;\n }\n else\n {\n if(empty($query['WHERE']))\n {\n $result=$xml;\n }\n else\n {\n // WHERE\n if(empty($query['WHERE'][0]))\n {\n $path=NULL;\n }\n else\n {\n $path=$query['WHERE'][0];\n }\n\n if(!empty($query['WHERE'][1]))\n {\n $path=$path.\".{$query[\"WHERE\"][1]}\";\n }\n $result=array();\n \n foreach($xml as $element)\n {\n $flag=0;\n $validity=false;\n\n if(!empty($query['WHERE'][1]))\n {\n $tmp_array=array_keys((array)$element);\n foreach ($tmp_array as $key) {\n if(strcmp($key, \"@attributes\")==0)\n {\n $data=(array)$element;\n $data=$data[\"@attributes\"];\n if(array_key_exists($query['WHERE'][1], $data))\n {\n $flag=1;\n $part_item=$data[$query['WHERE'][1]];\n }\n }\n }\n if(isset($query['WHERE'][0]) && $query['WHERE'][0] != \"\")\n {\n if(strcmp($query['WHERE'][0], $query['SELECT'])!=0)\n {\n $flag=0;\n }\n }\n }\n if($flag)\n {\n $validity=compare_operator($query,$part_item);\n }\n else\n {\n $final=my_xpath($path,$element);\n foreach ($final as $part_item) {\n $validity=compare_operator($query,$part_item);\n break;\n }\n }\n if($query['WHERE'][4]==true)\n {\n $validity=!$validity;\n }\n if(empty($query['WHERE'][1]))\n {\n $tmp_array=array_keys((array)$part_item);\n foreach ($tmp_array as $key) {\n if(!strcmp($key, \"@attributes\") && !is_int($key))\n {\n $validity=false;\n break;\n }\n }\n }\n if($validity)\n {\n array_push($result, $element);\n }\n }\n }\n }\n if(empty($result))\n {\n return (string)NULL;\n }\n if(isset($query['LIMIT']))\n {\n $result=array_slice($result, 0, $query['LIMIT']);\n }\n return $result;\n}", "function _parse_search()\n\t{\n // -------------------------------------\n\t\t//\tHardcoded query\n\t\t// -------------------------------------\n\t\t\n\t\tif ( ee()->TMPL->fetch_param('search') !== FALSE AND ee()->TMPL->fetch_param('search') != '' )\n\t\t{\n\t\t\t$str\t= ( strpos( ee()->TMPL->fetch_param('search'), 'search&' ) === FALSE ) ? 'search&' . ee()->TMPL->fetch_param('search'): ee()->TMPL->fetch_param('search');\n \n\t\t\t// -------------------------------------\n\t\t\t//\tHandle special case of start param for pagination. When users say they want pagination but they are using the 'search' param, we need to reach into the URI and try to find the 'start' param and work from there. Kind of duct tape like.\n\t\t\t// -------------------------------------\n\t\t\t\n\t\t\tif ( ee()->TMPL->fetch_param( 'paginate' ) !== FALSE AND ee()->TMPL->fetch_param( 'paginate' ) != '' )\n\t\t\t{\n\t\t\t\tif ( preg_match( '/' . $this->parser . 'offset' . $this->separator . '(\\d+)' . '/s', ee()->uri->uri_string, $match ) )\n\t\t\t\t{\n\t\t\t\t\tif ( preg_match( '/' . $this->parser . 'offset' . $this->separator . '(\\d+)' . '/s', $str, $secondmatch ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$str\t= str_replace( $secondmatch[0], $match[0], $str );\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$str\t= str_replace( 'search' . $this->parser, 'search' . $this->parser . trim( $match[0], $this->parser ) . $this->parser, $str );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// -------------------------------------\n\t\t\t//\tHandle the special case where users have given the inclusive_keywords param\n\t\t\t// -------------------------------------\n\t\t\t\n\t\t\tif ( ee()->TMPL->fetch_param( 'inclusive_keywords' ) !== FALSE AND $this->check_no( ee()->TMPL->fetch_param('inclusive_keywords') ) )\n\t\t\t{\n\t\t\t\t$str\t= str_replace( 'search' . $this->parser, 'search' . $this->parser . 'inclusive_keywords' . $this->separator . 'no' . $this->parser, $str );\n\t\t\t}\n\t\t\t\n\t\t\t// -------------------------------------\n\t\t\t//\tHandle the special case where users have given the inclusive_categories param\n\t\t\t// -------------------------------------\n\t\t\t\n\t\t\tif ( ee()->TMPL->fetch_param( 'inclusive_categories' ) !== FALSE AND $this->check_yes( ee()->TMPL->fetch_param('inclusive_categories') ) )\n\t\t\t{\n\t\t\t\t$str\t= str_replace( 'search' . $this->parser, 'search' . $this->parser . 'inclusive_categories' . $this->separator . 'yes' . $this->parser, $str );\n\t\t\t}\n\t\t\t\n\t\t\tif ( ( $q = $this->_parse_uri( $str.'/' ) ) === FALSE )\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n \n // -------------------------------------\n\t\t//\tOtherwise we accept search queries\n\t\t//\tfrom either\tURI or POST. See if either\n\t\t//\tis present, defaulting to POST.\n\t\t// -------------------------------------\n\t\t\n\t\telse\n\t\t{\n\t\t\tif ( ( $q = $this->_parse_post() ) === FALSE )\n\t\t\t{\n\t\t\t\tif ( ( $q = $this->_parse_uri() ) === FALSE )\n\t\t\t\t{\n\t\t\t\t\tif ( ( $q = $this->_parse_from_tmpl_params() ) === FALSE )\n\t\t\t\t\t{\n\t\t\t\t\t\treturn FALSE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n \n // -------------------------------------\n\t\t//\tGood job get out\n\t\t// -------------------------------------\n\t\t\n\t\tif ( empty( $q ) ) return FALSE;\n\t\t\n\t\treturn $q;\n\t}", "public function whereComplex()\n {\n return $this->addComplexCondition('and', $this->conditions);\n }", "private function whereXML (array $q) {\n\t\t$queryString = '';\n\t\t$counter = 0;\n\n\t\tforeach ($q as $col => $value) {\n\t\t\t$counter++;\n\t\t\t$queryString .= '<Eq><FieldRef Name=\"' . $col . '\" /><Value Type=\"Text\">' . htmlspecialchars($value) . '</Value></Eq>';\n\n\t\t\t// Add additional \"and\"s if there are multiple query levels needed.\n\t\t\tif ($counter >= 2) {\n\t\t\t\t$queryString = '<And>' . $queryString . '</And>';\n\t\t\t}\n\t\t}\n\n\t\treturn '<Where>' . $queryString . '</Where>';\n\t}", "public function testParseOrWithAnd()\n\t{\n\t\t$this->parser->search = ['number' => 'www&xxx,yyy&zzz,aaa'];\n\t\t$check = $this->parser->parse();\n\t\t$assume = [];\n\t\t$assume['number'] = Func::orOp([\n\t\t\tFunc::andOp(['www', 'xxx']),\n\t\t\tFunc::andOp(['yyy', 'zzz']),\n\t\t\t'aaa'\n\t\t]);\n\t\treturn $this->assume(__FUNCTION__, $check, $assume, false);\n\t}", "public function getSearchQuery() {\n\t\treturn Convert::raw2xml($_REQUEST['Search']);\n\t}", "public function composeQuery()\n {\n $this->initQueryBody();\n if ($this->selectedFields) {\n array_set($this->queryBody, 'body._source', $this->selectedFields);\n $this->clearSelect();\n }\n if ($this->range) {\n $filter = array_get($this->queryBody, 'body.query.bool.filter');\n array_push($filter, $this->range);\n array_set($this->queryBody, 'body.query.bool.filter', $filter);\n\n }\n if ($this->terms) {\n foreach($this->terms as $condition => $conditionTerms) {\n $$condition = array_get($this->queryBody, \"body.query.bool.{$condition}\");\n $$condition = $$condition ?: [];\n foreach ($conditionTerms as $key => $value) {\n array_push($$condition, [\"term\" => [$key => $value]]);\n }\n array_set($this->queryBody, \"body.query.bool.{$condition}\", $$condition);\n }\n\n }\n if ($this->from) {\n array_set($this->queryBody, 'body.from', $this->from);\n }\n if ($this->size) {\n array_set($this->queryBody, 'body.size', $this->size);\n }\n if ($this->scrollSize) {\n array_set($this->queryBody, 'size', $this->scrollSize);\n }\n if ($this->scrollKeepTime) {\n array_set($this->queryBody, 'scroll', $this->scrollKeepTime);\n }\n if ($this->orders) {\n $orders = [];\n foreach($this->orders as $field => $value) {\n array_push($orders, [$field => [\"order\" => $value]]);\n }\n array_set($this->queryBody, 'body.sort', $orders);\n }\n }", "function buildAdvancedWhere() \n\t{\n\t\t$sWhere=\"\";\n\t\tif(isset($this->_where[$this->sessionPrefix.\"_asearchfor\"]))\n\t\t{\n\t\t\tforeach($this->_where[$this->sessionPrefix.\"_asearchfor\"] as $f => $sfor)\n\t\t\t{\n\t\t\t\t$strSearchFor = trim($sfor);\n\t\t\t\t$strSearchFor2 = \"\";\n\t\t\t\t$type=@$this->_where[$this->sessionPrefix.\"_asearchfortype\"][$f];\n\t\t\t\tif(array_key_exists($f,@$this->_where[$this->sessionPrefix.\"_asearchfor2\"]))\n\t\t\t\t\t$strSearchFor2=trim(@$this->_where[$this->sessionPrefix.\"_asearchfor2\"][$f]);\n\t\t\t\tif($strSearchFor!=\"\" || true)\n\t\t\t\t{\n\t\t\t\t\tif (!$sWhere) \n\t\t\t\t\t{\n\t\t\t\t\t\tif($this->_where[$this->sessionPrefix.\"_asearchtype\"]==\"and\")\n\t\t\t\t\t\t\t$sWhere=\"1=1\";\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$sWhere=\"1=0\";\n\t\t\t\t\t}\n\t\t\t\t\t$strSearchOption=trim($this->_where[$this->sessionPrefix.\"_asearchopt\"][$f]);\n\t\t\t\t\tif($where=StrWhereAdv($f, $strSearchFor, $strSearchOption, $strSearchFor2,$type, false))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($this->_where[$this->sessionPrefix.\"_asearchnot\"][$f])\n\t\t\t\t\t\t\t$where=\"not (\".$where.\")\";\n\t\t\t\t\t\tif($this->_where[$this->sessionPrefix.\"_asearchtype\"]==\"and\")\n\t\t\t\t\t\t\t$sWhere .= \" and \".$where;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$sWhere .= \" or \".$where;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\n\t\treturn $sWhere;\n\t}", "function buildQuery_prop_type($srchqry)\r\n\t{\r\n\t\tglobal $mainframe;\r\n\t\t//$param = $this->getState('prop_type');\r\n\t \r\n ## re-writing this functionality - Rich S Wyatt - 10/19/2010\r\n \r\n \r\n $fragment = \"(\"; \r\n \r\n $zz = 0; \r\n foreach($srchqry as $k=>$v)\r\n {\r\n if(count($v) > 0 || $v == true)\r\n {\r\n if(count($v) > 0 && $v != 1)\r\n {\r\n \r\n if($zz != 0)\r\n {\r\n $fragment .= \" OR \"; \r\n }\r\n $fragment .= \" (\". FIELDNAME_LISTING_PROP_TYPE . \" = '\". $k . \"' AND\"; \r\n $fragment .= \"( \"; \r\n $z = 0; \r\n foreach($v as $kk=>$vv)\r\n {\r\n if($z == 0)\r\n {\r\n $fragment .= FIELDNAME_LISTING_SUB_TYPE . \" = '\". $vv . \"' \"; \r\n }\r\n else\r\n {\r\n $fragment .= \"OR \". FIELDNAME_LISTING_SUB_TYPE . \" = '\". $vv . \"' \"; \r\n }\r\n \r\n $z++; \r\n }\r\n \r\n $fragment .= \"))\"; \r\n }\r\n if($v == 1)\r\n {\r\n // this is without subtypes\r\n if($zz != 0)\r\n {\r\n $fragment .= \" OR \"; \r\n }\r\n $fragment .= \" (\". FIELDNAME_LISTING_PROP_TYPE . \" = '\". $k . \"' \"; \r\n \r\n $fragment .= \")\"; \r\n } \r\n $zz++; \r\n }\r\n \r\n }\r\n $fragment .= \")\";\r\n /*\r\n\t\t$fragment = \"(\" . FIELDNAME_LISTING_SUB_TYPE . \" = '\";\r\n\r\n\t\tif ($param[0] === '0' ) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\t$fragment .= implode(\"' OR \" . FIELDNAME_LISTING_SUB_TYPE . \" = '\",$param);\r\n\t\t}\r\n\t\t\r\n\t\t$fragment .= \"'\";\r\n\t\t\r\n\t\t//CUSTOM BCO INTEGRATION\r\n\t\tif(in_array('land',$param)) {\r\n\t\t\t$fragment .= \" OR \" . FIELDNAME_LISTING_SUB_TYPE . \" = 'Farm/Ranch'\";\r\n\t\t\t$fragment .= \" OR \" . FIELDNAME_LISTING_SUB_TYPE . \" = 'Sf/Mf/Acreage'\";\r\n\t\t}\r\n\t\tif(in_array('partial',$param)) {\r\n\t\t\t$fragment .= \" OR \" . FIELDNAME_LISTING_SUB_TYPE . \" LIKE '%partial%'\";\r\n\t\t}\r\n\t\t//EOF\r\n\t\t\r\n\t\t$fragment .= \")\";\r\n **/\r\n\t\treturn $fragment; \r\n\t}", "protected function _buildQueryWhere(&$query)\n\t{\n\t\t// Apply basic filters\n\t\t$this->basicFilters($query);\n\t\t\n\t\t// Element filters\n\t\t$this->elementFilters($query);\n\t}", "public function and_where_close(){\n $this->_where[] = array('AND' => ')');\n\n return $this;\n }", "public function loadCriteriaSearch(){\n\n $request = Yii::$app->getRequest();\n $q = $request->getQueryParam('q', false);\n $s = $request->getQueryParam('s', false);\n $op = $request->getQueryParam('op', 'AND');\n// var_dump($q);exit;\n \n $checkArr = array();\n \n if ($q !== false) {\n //split to one item\n $tmpArr = explode(';', $q);\n \n foreach ($tmpArr as $one) {\n \n $tmpArr2 = explode('<=', $one);\n if (isset($tmpArr2[1])) {\n $checkArr[$tmpArr2[0]] = $one;\n continue;\n }//<=\n \n $tmpArr2 = explode('<', $one);\n if (isset($tmpArr2[1])) {\n $checkArr[$tmpArr2[0]] = $one;\n continue;\n }//<\n \n $tmpArr2 = explode('>=', $one);\n if (isset($tmpArr2[1])) {\n $checkArr[$tmpArr2[0]] = $one;\n continue;\n }//>=\n \n $tmpArr2 = explode('>', $one);\n if (isset($tmpArr2[1])) {\n $checkArr[$tmpArr2[0]] = $one;\n continue;\n }//>\n \n \n // = as default\n $tmpArr2 = explode('=', $one);\n if (isset($tmpArr2[1])) {\n $checkArr[$tmpArr2[0]] = $one;\n continue;\n }//=\n }//use attributeName as index use condition as value\n \n }//query\n // var_dump($checkArr);exit;\n \n if ($s !== false) {\n //prepare check array\n $tmpArr = explode(';', $s);\n foreach ($tmpArr as $one) {\n $tmpArr2 = explode('=', $one);\n if (isset($tmpArr2[1])) {\n $checkArr[$tmpArr2[0]] = $tmpArr2[0].\" LIKE '%$tmpArr2[1]%' \";\n }\n }//use attributeName as index use condition as value\n }//like\n \n// var_dump($checkArr);\n// exit;\n if (!empty($checkArr)) {\n $checkedArr = eeAR::validateAttributes($this->_modelName, $checkArr);\n \n //render checked condition string.\n $this->_searchCondition = eeAR::generateSearchCondtionString($checkedArr, $op);\n \n// var_dump($this->_searchCondition);\n }\n \n // var_dump($this->_criteria);\n// exit;\n \n }", "public function getQueryBuild()\n {\n $body = $this->body;\n \n if (count($this->must)) {\n $body[\"query\"][\"bool\"][\"filter\"][\"bool\"][\"must\"] = $this->must;\n }\n\n if (count($this->must_not)) {\n $body[\"query\"][\"bool\"][\"filter\"][\"bool\"][\"must_not\"] = $this->must_not;\n }\n\n // if (count($this->filter)) {\n // $body[\"query\"][\"bool\"][\"filter\"][\"bool\"][\"must\"] = $this->filter;\n // }\n\n if (count($this->and_or)) {\n $body[\"query\"][\"bool\"][\"filter\"][\"bool\"][\"must\"][]['bool']['should'] = $this->and_or;\n }\n\n if (count($this->should)) {\n $body[\"query\"][\"bool\"][\"filter\"][\"bool\"][\"should\"] = $this->should;\n }\n\n if (count($this->or_and)) {\n $body[\"query\"][\"bool\"][\"filter\"][\"bool\"][\"should\"][]['bool']['must'] = $this->or_and;\n }\n \n \n $this->body = $body;\n\n // return $body;\n return json_encode($body);\n }", "public function metaQueryRelation_AND(){\n return $this->metaQueryRelation('AND');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The comes a time when old tasks just need to be removed. So while I say hello, the tasks say goodbye. These tasks will be saved to the self::OPTION_NAME setting for safe keeping.
private function upgradeMismatchedTaskCount(): void { $new_options = []; $old_options = Option::getOptions(); $legacy_tasks = $this->getLegacyOptions(); foreach ($old_options as $option_key => $task) { $models = \array_map(static function (UpgradeModel $model): string { return Option::getOptionKey($model); }, $this->models); if (!$models) { continue; } $key = \array_search($option_key, $models, true); if ($key === false) { $legacy_tasks[$option_key] = $task; unset($old_options[$option_key]); continue; } $new_options[$option_key] = $task; } Option::updateOption($new_options); \update_option(self::OPTION_NAME, $legacy_tasks, false); unset($new_options, $old_options, $legacy_tasks); // Memory cleanup \wp_safe_redirect(\remove_query_arg(self::NONCE_NAME)); exit; }
[ "public function removeTasks() {\n\t\t\t$this->tasks->clear();\n\t\t}", "function hook_hosting_task_dangerous_tasks_alter(&$tasks) {}", "public function removeTask()\n\t{\n\t\tif(isset($this->primarySearchData[$this->ref_task]))\n\t\t{\n\t\t\tunset($this->primarySearchData[$this->ref_task]);\n\t\t}\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}", "function task_delete_task()\n\t{\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\t\t\n\t\t$task_id = intval( $this->ipsclass->input['task_id'] );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Check\n\t\t//-----------------------------------------\n\t\t\n\t\t$task = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'task_manager', 'where' => \"task_id=$task_id\" ) );\n\t\t\t\n\t\tif ( $task['task_safemode'] and ! IN_DEV )\n\t\t{\n\t\t\t$this->ipsclass->main_msg = \"You are unable to delete this task.\";\n\t\t\t$this->task_show_tasks();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Remove from the DB\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'task_manager', 'where' => 'task_id='.$task_id ) );\n\t\t\n\t\t$this->functions->save_next_run_stamp();\n\t\t\n\t\t$this->ipsclass->main_msg = 'Task deleted';\n\t\t\n\t\t$this->task_show_tasks();\n\t}", "function todo_list_options(){\n\n add_option('todo_task_list', [\n ['name' => 'Example Task 1',\n 'done' => 0],\n ['name' => 'Example Task 2',\n 'done' => 0],\n ['name' => 'Example Task 3',\n 'done' => 1]\n\n ]);\n\n\n\n\n}", "public function setTaskName($taskName){ }", "function vh_get_default_auto_clean_task_list() {\r\n $list = array();\r\n return $list;\r\n}", "function milk_ops_deactivation(){\n\t\t\n\t\t\tdelete_option($this->optionsName);\n\t\t\n\t\t}", "public function setTaskName($taskName = NULL);", "public function removeByName($name)\n {\n unset($this->tasks[$name]);\n }", "public function do_remove() {\n\n\t\t// Import instance\n\t\t$import_instance = $this->get_content_pack()->get_import_instance();\n\n\t\t// Clear task args values\n\t\t$import_instance->clear_task_args();\n\n\t\t// Mark as removed\n\t\t$import_instance->set_task_arg_value( 'remove', 'success', true );\n\n\t\t// Mark as not completed\n\t\t$import_instance->set_successful( false );\n\t}", "function argPickTask()\n {\n return [\n 'tasks' => Tasks::getUnassigned(),\n ];\n }", "public function setDefaultTask($taskName);", "public function toggleTask()\n\t{\n\t\t// Incoming\n\t\t$hostname = Request::getString('hostname', '', 'get');\n\t\t$item = Request::getString('item', '', 'get');\n\t\t// $hostname is eventually used in a string passed to an exec call, we gotta\n\t\t// clean at least some of it. See RFC 1034 for valid character set info\n\t\t$hostname = preg_replace(\"/[^A-Za-z0-9-.]/\", '', $hostname);\n\n\t\t// Get the middleware database\n\t\t$mwdb = Utils::getMWDBO();\n\n\t\t$query1 = \"SELECT @value:=value FROM hosttype WHERE name=\" . $mwdb->Quote($item) . \";\";\n\t\t$query2 = \"UPDATE host SET provisions = provisions ^ @value WHERE hostname = \" . $mwdb->Quote($hostname) . \";\";\n\n\t\t$mwdb->setQuery($query1);\n\t\tif (!$mwdb->query())\n\t\t{\n\t\t\tNotify::error(Lang::txt('COM_TOOLS_ERROR_PROVISION_UPDATE_FAILED'));\n\t\t}\n\n\t\t$mwdb->setQuery($query2);\n\t\tif (!$mwdb->query())\n\t\t{\n\t\t\tNotify::error(Lang::txt('COM_TOOLS_ERROR_PROVISION_UPDATE_FAILED'));\n\t\t}\n\n\t\t$this->cancelTask();\n\t}", "function wc_admin_update_290_update_apperance_task_option()\n {\n }", "private function updateProjectFromTaskName()\n {\n //followed by a comma-separated list of items\n \n $taskName = trim($this->name());\n \n $colonPosition = strpos($taskName, \";\");\n if($colonPosition !== false && $colonPosition != 0 && $colonPosition + 1 < strlen($taskName))\n {\n $potentialList = substr($taskName, $colonPosition + 1);\n \n $projectItems = explode(\",\", $potentialList);\n \n if(!empty($projectItems) && count($projectItems) > 1)\n {\n //We found checklist items, so convert this to a checklist and add the new items\n if($this->updateTaskType(TaskType::Project))\n {\n $sortOrder = 0;\n foreach($projectItems as $projectItem)\n {\n $projectItem = trim($projectItem);\n if(!empty($projectItem))\n {\n $task = new TDOTask();\n $task->setListId($this->listId());\n $task->setName(TDOUtil::mb_ucfirst($projectItem));\n $task->setParentId($this->taskId());\n $task->setSortOrder($sortOrder);\n \n if($task->addObject() == false)\n error_log(\"updateProjectFromTaskName failed to add task to database: $projectItem\");\n else\n $sortOrder++;\n }\n }\n \n //If we ever implement something where the tasks we're adding here can be assigned due dates, priorities,\n //etc., we will need the following call. For now we can omit it. \n// TDOTask::fixupChildPropertiesForTask($this, false);\n \n //Remove the checklist substring from the task name\n $taskName = trim(substr_replace($taskName, \"\", $colonPosition, strlen($potentialList) + 1));\n $this->setName($taskName);\n return true;\n \n }\n }\n }\n \n return false;\n }", "function setTaskName($taskName) {\n\t\t$taskNames = array(\n\t\t\t\t'AddMissingInfo', 'Dashboard', 'Dictionary', 'AdvancedHistory',\n\t\t\t\t'NotesBrowser', 'GatherWordList', 'GatherWordsBySemanticDomains',\n\t\t\t\t'ConfigureSettings');\n\n\t\tif (in_array($taskName, $taskNames)) {\n\t\t\t$this->taskName = $taskName;\n\t\t}\n\t\telse {\n\t\t\t$this->taskName = \"[Invalid taskName]\";\n\n\t\t\terror_log(\"Invalid taskName: \" . $taskName);\n\t\t\texit(\"Invalid taskName: \" . $taskName);\n\t\t}\n\t}", "public function removeAllTasks(): void\n {\n $this->removeTasks(null);\n\n // delete external tasks\n $this->removeExternalTasks();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Location of the info found. Generated from protobuf field .google.privacy.dlp.v2beta1.Location location = 4;
public function setLocation($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2beta1\Location::class); $this->location = $var; return $this; }
[ "public function getLocation()\n {\n return $this->readOneof(3);\n }", "public function getLocationField()\n {\n return $this->readOneof(6);\n }", "public function Location()\n {\n return $this->data['message']['location'];\n }", "public function setLocation($var)\n {\n GPBUtil::checkString($var, True);\n $this->location = $var;\n\n return $this;\n }", "public function setLocation($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Ads\\GoogleAds\\V14\\Common\\LocationInfo::class);\n $this->writeOneof(82, $var);\n\n return $this;\n }", "public function setMetadataLocation($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Dlp\\V2\\MetadataLocation::class);\n $this->writeOneof(8, $var);\n\n return $this;\n }", "public function getLocationInfo() {\n return $this->locationInfo;\n }", "public function getLocation() {\n $forecast = $this->getForecast();\n return $forecast['location'];\n }", "public function getLocation()\n\t{\n\t\treturn ($this->location) ? $this->location : \"Location Not Available.\";\n\t}", "public function getLocationOfPresence()\n {\n return $this->location_of_presence;\n }", "public function getLoc()\n {\n return $this->properties[static::LOC];\n }", "public function getAdditionalLocationInfo()\n {\n return $this->_fields['AdditionalLocationInfo']['FieldValue'];\n }", "public function getDocumentLocation()\n {\n return $this->readOneof(5);\n }", "public function setRecordLocation($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Dlp\\V2\\RecordLocation::class);\n $this->writeOneof(2, $var);\n\n return $this;\n }", "function setLocation($value) {\n return $this->setFieldValue('location', $value);\n }", "public function getLocationLongitude();", "public function getLocationGroup()\n {\n return $this->readOneof(34);\n }", "public function getLocation()\n {\n if ($this->foundLocation)\n {\n return $this->foundLocation;\n }\n\n return $this->resolveLocation();\n }", "public function setLocation($var)\n {\n GPBUtil::checkMessage($var, \\Restaurant_service\\Restaurant_Location::class);\n $this->location = $var;\n\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case for dataProcessingsInsights .
public function testDataProcessingsInsights() { // TODO: implement $this->markTestIncomplete('Not implemented'); }
[ "public function testDataProcessingsCreate()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testScenarioAnalysis()\n {\n }", "public function testDataProcessingsNodes()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testAnalyticsModelCounts()\n {\n }", "public function testGetEventInsights()\n {\n }", "public function testServeMetrics()\n {\n }", "public function test_processData ()\n {\n $returned = self::$main->processData();\n assert($returned['Hotel']['cost'] == 288, \"/* processed['Hotel', ['amount'] should be 288. */\");\n assert(file_exists($this->output), 'output.csv file should exist.');\n $outputFile = file_get_contents($this->output);\n assert(stripos($outputFile, 'Fuel') == 11, 'Fuel should start at 11th char.');\n }", "public function testComDayCqDamCoreProcessMetadataProcessorProcess() {\n\n }", "public function testDataProcessingsRestore()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function RunDataProcess()\n {\n // TODO: Implement RunDataProcess() method.\n }", "public function testProfileStressSummaryList()\n {\n }", "public function testAnalyticsCrashGroupsTotals()\n {\n }", "public function testAnalyticsDeviceCounts()\n {\n }", "public function testDynamicDataCountGet()\n {\n\n }", "public function testDataSetProcessorUpdate()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testAnalyticsCrashGroupModelCounts()\n {\n }", "public function test_scenario2() {\n $data = array(array('filename' => 'data/iris_anomalous.csv', 'rows' => 1));\n\n\n foreach($data as $item) {\n print \"\\nSuccessfully creating an anomaly detector from a dataset and generating the anomalous dataset\\n\";\n print \"Given I create a data source uploading a \". $item[\"filename\"]. \" file\\n\";\n $source = self::$api->create_source($item[\"filename\"], $options=array('name'=>'local_test_source', 'project'=> self::$project->resource));\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $source->code);\n $this->assertEquals(1, $source->object->status->code);\n\n print \"And I wait until the local source is ready\\n\";\n $resource = self::$api->_check_resource($source->resource, null, 20000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create dataset with local source\\n\";\n $dataset = self::$api->create_dataset($source->resource);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $dataset->code);\n $this->assertEquals(BigMLRequest::QUEUED, $dataset->object->status->code);\n\n print \"And I wait until the dataset is ready \" . $dataset->resource . \" \\n\";\n $resource = self::$api->_check_resource($dataset->resource, null, 20000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"Then I create an anomaly detector with \" . $item[\"rows\"] .\" anomalies from a dataset\\n\";\n $anomaly = self::$api->create_anomaly($dataset->resource, array('seed'=> 'BigML', 'top_n'=> $item[\"rows\"]));\n\n print \"And I wait until the anomaly detector is ready\\n\";\n $resource = self::$api->_check_resource($anomaly->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create a dataset with only the anomalies\\n\";\n $local_anomaly = new Anomaly($anomaly->resource, self::$api);\n\n $new_dataset = self::$api->create_dataset($dataset->resource, array('lisp_filter' => $local_anomaly->anomalies_filter()));\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $new_dataset->code);\n $this->assertEquals(BigMLRequest::QUEUED, $new_dataset->object->status->code);\n\n print \"And I wait until the dataset is ready \" . $new_dataset->resource . \" \\n\";\n $resource = self::$api->_check_resource($new_dataset->resource, null, 20000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n $dataset = self::$api->get_dataset($new_dataset->resource);\n print \"And I check that the dataset has \" . $item[\"rows\"] .\" rows\\n\";\n $this->assertEquals($dataset->object->rows,$item[\"rows\"]);\n\n }\n\n }", "public function testReport()\n {\n $report = $this->generateReportWithMockedData();\n\n $dateTime = $report['Date Time'];\n $cpuUtilization = $report['CPUUtilization (Percent)'];\n $diskSpaceUtilization = $report['DiskSpaceUtilization (Percent)'];\n $apachePHPHeartBeat = $report['ApachePHPHeartbeat (Count)'];\n\n foreach ($dateTime as $t) {\n // every metric column, must have a record for every $dateTime element\n $this->assertTrue(array_key_exists($t, $cpuUtilization));\n $this->assertTrue(array_key_exists($t, $diskSpaceUtilization));\n $this->assertTrue(array_key_exists($t, $apachePHPHeartBeat));\n\n // every metric column record must be numeric\n $this->assertTrue(is_numeric($cpuUtilization[$t]));\n $this->assertTrue(is_numeric($diskSpaceUtilization[$t]));\n $this->assertTrue(is_numeric($apachePHPHeartBeat[$t]));\n }\n }", "public function testAnalyticsSessionCounts()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update file sizes for all attachments (See AttachmentsUpdate::update_file_sizes() in update.php for details )
public function update_file_sizes() { // Access check. if (!JFactory::getUser()->authorise('core.admin', 'com_attachments')) { return JError::raiseError(404, JText::_('JERROR_ALERTNOAUTHOR') . ' (ERR 156)'); } require_once(JPATH_ADMINISTRATOR.'/components/com_attachments/update.php'); $msg = AttachmentsUpdate::update_file_sizes(); if ( JRequest::getBool('close') ) { $this->enqueueSystemMessage($msg); // Close this window and refesh the parent window AttachmentsJavascript::closeModal(); } else { $this->setRedirect('index.php?option=' . $this->option, $msg); } }
[ "public static function update_file_sizes()\n\t{\n\t\t// Get the component parameters\n\t\tjimport('joomla.application.component.helper');\n\t\t$params = JComponentHelper::getParams('com_attachments');\n\n\t\t// Define where the attachments go\n\t\t$upload_dir = JPATH_SITE.'/'.AttachmentsDefines::$ATTACHMENTS_SUBDIR;\n\n\t\t// Get all the attachment IDs\n\t\t$db = JFactory::getDBO();\n\t\t$query = $db->getQuery(true);\n\t\t$query->select('id')->from('#__attachments')->where('uri_type=' . $db->quote('file'));\n\t\t$db->setQuery($query);\n\t\t$attachments = $db->loadObjectList();\n\t\tif ( $db->getErrorNum() ) {\n\t\t\t$errmsg = $db->stderr() . ' (ERR 80)';\n\t\t\tJError::raiseError(500, $errmsg);\n\t\t\t}\n\t\tif ( count($attachments) == 0 ) {\n\t\t\treturn JText::_('ATTACH_NO_ATTACHMENTS_WITH_FILES');\n\t\t\t}\n\t\t$IDs = array();\n\t\tforeach ($attachments as $attachment) {\n\t\t\t$IDs[] = $attachment->id;\n\t\t\t}\n\n\t\t// Update the system filenames for all the attachments\n\t\tJTable::addIncludePath(JPATH_ADMINISTRATOR.'/components/com_attachments/tables');\n\t\t$attachment = JTable::getInstance('Attachment', 'AttachmentsTable');\n\t\t$numUpdated = 0;\n\t\tforeach ($IDs as $id) {\n\n\t\t\t$attachment->load($id);\n\n\t\t\t// Update the file size\n\t\t\t$attachment->file_size = filesize($attachment->filename_sys);\n\n\t\t\t// Update the record\n\t\t\tif (!$attachment->store()) {\n\t\t\t\t$errmsg = $attachment->getError() . ' (ERR 81)';\n\t\t\t\tJError::raiseError(500, $errmsg);\n\t\t\t\t}\n\n\t\t\t$numUpdated++;\n\t\t\t}\n\n\t\treturn JText::sprintf( 'ATTACH_UPDATED_FILE_SIZES_FOR_N_ATTACHMENTS', $numUpdated );\n\t}", "public function updateSiteSize()\r\n {\r\n $sql = sprintf(\r\n \"UPDATE\r\n site\r\n SET\r\n file_size_kb = (\r\n SELECT\r\n SUM(file_size_kb)\r\n FROM\r\n attachment\r\n WHERE\r\n site_id = %s\r\n )\r\n WHERE\r\n site_id = %s\",\r\n $this->_siteID,\r\n $this->_siteID\r\n );\r\n\r\n $this->_db->query($sql);\r\n }", "private function updateFileSize() {\n if (isset($this->document->size) && $this->document->isClean('path')) {\n return;\n }\n\n // calculate and set file size\n if (Storage::disk('documents')->exists($this->document->path)) {\n $this->document->size = Storage::disk('documents')->size($this->document->path);\n }\n }", "function get_attachments_size() {\n $size = 0;\n if(is_array($this->data->attachment_ids)) {\n foreach($this->data->attachment_ids as $id) {\n $att = new aiosc_Attachment($id);\n $size += $att->get_file_size('b');\n }\n if($size > 0) return number_format($size / 1024,2);\n else return $size;\n }\n else return $size;\n }", "function _cals_update_filecollection_file_filesize($node, $item_id) {\n\n\t$ent = entity_load_single('field_collection_item', $item_id);\n\t//printPre($ent->field_s3_file_upload['und'][0]['filename'], $ent->field_s3_path[LANGUAGE_NONE][0]['value']);\n\t\n\t//\t $ent->field_s3_to_cors_update[LANGUAGE_NONE][0]['value'] == 1 &&\n\tif(!empty($ent->field_s3_file_upload['und'][0]['filename']) && empty($ent->field_s3_file_upload['und'][0]['filesize'])){\n\n\t\tif(empty($ent->field_s3_path)) {\n\t\t\t$file = file_load($ent->field_s3_file_upload['und'][0]['fid']);\n\t\t}\n\t\telse {\n\t\t $file = _cals_importer_get_file_from_filepath($ent->field_s3_path[LANGUAGE_NONE][0]['value']);\n\t\t}\n\t\t_cals_update_filesize_from_s3_value($file);\n\t}\n\telse {\n\t return \"oops nothing to update here!\";\n\t}\n\tdrupal_goto(\"node/\" . $node->nid);\n\t\n\n}", "function get_total_attach_filesize($attach_ids)\n{\n if (!is_array($attach_ids) || !count($attach_ids)) {\n return 0;\n }\n\n $attach_ids = implode(', ', array_map('\\intval', $attach_ids));\n\n if (!$attach_ids) {\n return 0;\n }\n\n $sql = 'SELECT filesize FROM ' . BB_ATTACHMENTS_DESC . \" WHERE attach_id IN ($attach_ids)\";\n\n if (!($result = DB()->sql_query($sql))) {\n bb_die('Could not query total filesize');\n }\n\n $total_filesize = 0;\n\n while ($row = DB()->sql_fetchrow($result)) {\n $total_filesize += (int)$row['filesize'];\n }\n DB()->sql_freeresult($result);\n\n return $total_filesize;\n}", "public function imagify_update_estimate_sizes_callback() {\n\t\timagify_check_nonce( 'update_estimate_sizes' );\n\n\t\tif ( ! imagify_get_context( 'wp' )->current_user_can( 'manage' ) ) {\n\t\t\timagify_die();\n\t\t}\n\n\t\t$raw_total_size_in_library = imagify_calculate_total_size_images_library() + Imagify_Files_Stats::get_overall_original_size();\n\t\t$raw_average_per_month = imagify_calculate_average_size_images_per_month() + Imagify_Files_Stats::calculate_average_size_per_month();\n\n\t\tImagify_Data::get_instance()->set( array(\n\t\t\t'total_size_images_library' => $raw_total_size_in_library,\n\t\t\t'average_size_images_per_month' => $raw_average_per_month,\n\t\t) );\n\n\t\tdie( 1 );\n\t}", "public function getAttachmentsSize()\n\t{\n\t\tif (empty($this->attachments)) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t$totalSize = 0;\n\t\tforeach ($this->attachments as $file) {\n\t\t\t$totalSize += $file->size;\n\t\t}\n\n\t\treturn $totalSize;\n\t}", "function overallAttachmentsSize()\n{\n\t$db = database();\n\n\t// Check the size of all the directories.\n\t$request = $db->query('', '\n\t\tSELECT \n\t\t\tSUM(size)\n\t\tFROM {db_prefix}attachments\n\t\tWHERE attachment_type != {int:type}',\n\t\tarray(\n\t\t\t'type' => 1,\n\t\t)\n\t);\n\tlist ($attachmentDirSize) = $request->fetch_row();\n\t$request->free_result();\n\n\treturn byte_format($attachmentDirSize);\n}", "public function refreshSize() {\n $this->size = filesize($this->_path);\n }", "protected function updateSize()\n {\n $fstat = fstat($this->resource);\n\n if (false === $fstat) {\n $this->size = null;\n } else {\n $this->size = ! empty($fstat['size']) ? $fstat['size'] : null;\n }\n }", "public function max_attachment_size() {\n return apply_filters( 'import_attachment_size_limit', 0 );\n }", "public function setFiles() {\n\t\tfor ( $this->currentPage; $this->currentPage <= $this->totalPages; $this->currentPage ++ ) {\n\t\t\t$args = array(\n\t\t\t\t'post_type' => 'attachment',\n\t\t\t\t'numberposts' => - 1,\n\t\t\t\t'post_mime_type' => 'image',\n\t\t\t\t'post_status' => 'any',\n\t\t\t\t'post_parent' => 'any',\n\t\t\t\t'posts_per_page' => $this->postsPerPage,\n\t\t\t\t'orderby' => 'ID',\n\t\t\t\t'paged' => $this->currentPage\n\t\t\t);\n\n\t\t\t$attachments = new \\WP_Query( $args );\n\n\t\t\tif ( $attachments->have_posts() ) {\n\t\t\t\twhile ( $attachments->have_posts() ) {\n\t\t\t\t\t$attachments->the_post();\n\n\t\t\t\t\t// setup files to optimize\n\t\t\t\t\t$file = $this->setFileSizes( get_the_ID() );\n\n\t\t\t\t\t// Push original to optimize\n\t\t\t\t\t$this->setFileToOptimize( $file['original_path'] );\n\n\t\t\t\t\tforeach ( $file['sizes'] as $name => $value ) {\n\t\t\t\t\t\tif ( in_array( $name, $this->allowedSizes ) ) {\n\t\t\t\t\t\t\t$this->setFileToOptimize( $value['path'] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tunset ( $file );\n\t\t\tunset ( $args );\n\t\t\tunset ( $attachments );\n\t\t}\n\n\t\treturn true;\n\t}", "private function setFileSize()\n {\n\n }", "function the_file_size( $id ) {\n\n // Get the file path\n $file_path = get_attached_file( $id );\n\n // Get the file size\n $file_size = filesize( $file_path );\n\n // Return file size in megabytes\n $file_size = round( $file_size / 1024 / 1024, 1 );\n\n echo $file_size . ' MB';\n\n }", "public function max_attachment_size() {\n return apply_filters('import_attachment_size_limit', 0);\n }", "public function max_attachment_size() {\r\n return apply_filters('import_attachment_size_limit', 0);\r\n }", "function getAllFileSizes($baseFilename){\n\t\t $baseFilename = str_replace(\"/\", \"_\", $baseFilename); //do this for tables broken into different parts\n\t\t $fileExtensions = $this->fileExtensions;\n\t\t foreach($fileExtensions as $fileType => $ext){\n\t\t\t\t$this->getFileSize(self::CSVdirectory, $baseFilename, $fileType);\n\t\t }\n\t }", "protected function max_attachment_size() {\n\t\treturn apply_filters( 'import_attachment_size_limit', 0 );\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
setShntseq() Set the value of [shntnote] column.
public function setShntnote($v) { if ($v !== null) { $v = (string) $v; } if ($this->shntnote !== $v) { $this->shntnote = $v; $this->modifiedColumns[SalesHistoryNotesTableMap::COL_SHNTNOTE] = true; } return $this; }
[ "function setSeq($seq) {\n\t\t$this->_seq = $seq;\n\t}", "public function setSeq($seq)\n {\n $this->_data['seq'] = $seq;\n }", "public function setShnttype($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->shnttype !== $v) {\n $this->shnttype = $v;\n $this->modifiedColumns[SalesHistoryNotesTableMap::COL_SHNTTYPE] = true;\n }\n\n return $this;\n }", "public function getShntnote()\n {\n return $this->shntnote;\n }", "public static function setNote($nid, $note){\n $gid = Group::getGroupId();\n\n db_query(\"delete from group_location_note where nid = :nid and gid = :gid\", array(':nid' => $nid, ':gid' => $gid));\n\n db_query(\"INSERT INTO `group_location_note` (`nid`, `gid`, `note`) VALUES (:nid,:gid,:note)\", array(':nid' => $nid, ':gid' => $gid, ':note' => $note));\n }", "public function filterByShntnote($shntnote = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($shntnote)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SalesHistoryNotesTableMap::COL_SHNTNOTE, $shntnote, $comparison);\n }", "public function setNote(int $tick, Note $note): void\n {\n $this->notesAtTicks->put($tick, $note);\n }", "function setRawLogSeq($value)\n {\n $this->_props['RawLogSeq'] = $value;\n }", "function setSequence($sequence)\n {\n $this->sequence = $sequence;\n }", "public function setNote($note);", "function SetSashPosition($pos){}", "function setSeqEvento( $seqEvento ) {\n $this->seqEvento = $seqEvento;\n }", "public function setLockScreenFootnote($val)\n {\n $this->_propDict[\"lockScreenFootnote\"] = $val;\n return $this;\n }", "function setNotes($notes)\r\n {\r\n $this->_notes = $notes;\r\n }", "private function setSequence($sequence)\n {\n $this->_vevent->setAttribute('SEQUENCE', $sequence);\n }", "public function setNote($note) {\n\n $this->note = $note;\n }", "function setUserSequence($seq)\n{\n\t$arr_seq = array();\n\tif(isset($_SESSION['seq']))\n\t{\n\t\t$arr_seq = $_SESSION['seq'];\n\t}\n\t$arr_seq[] = $seq;\n\t$_SESSION['seq'] = $arr_seq;\n}", "function setSequence($sequence) {\n\t\treturn $this->setData('sequence', $sequence);\n\t}", "public function set_shm_seg_id($shmop_id = -1) {\n if(Validator::isa($shmop_id,\"integer\") && $shmop_id >= -1)\n $this->shm_seg_id = $shmop_id;\n else\n $this->shm_seg_id = -1;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
NOTE: this function is not in use atm Add a new option to the list ... $options is a hash of form > $options = array( 'local'=> array('option1', 'option2', ...), 'global'=> array('optionA', 'optionB', ...) );
function acl_add_option($options) { global $db, $cache; if (!is_array($options)) { return false; } $cur_options = array(); // Determine current options $sql = 'SELECT auth_option, is_global, is_local FROM ' . ACL_OPTIONS_TABLE . ' ORDER BY auth_option_id'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $cur_options[$row['auth_option']] = ($row['is_global'] && $row['is_local']) ? 'both' : (($row['is_global']) ? 'global' : 'local'); } $db->sql_freeresult($result); // Here we need to insert new options ... this requires discovering whether // an options is global, local or both and whether we need to add an permission // set flag (x_) $new_options = array('local' => array(), 'global' => array()); foreach ($options as $type => $option_ary) { $option_ary = array_unique($option_ary); foreach ($option_ary as $option_value) { $new_options[$type][] = $option_value; $flag = substr($option_value, 0, strpos($option_value, '_') + 1); if (!in_array($flag, $new_options[$type])) { $new_options[$type][] = $flag; } } } unset($options); $options = array(); $options['local'] = array_diff($new_options['local'], $new_options['global']); $options['global'] = array_diff($new_options['global'], $new_options['local']); $options['both'] = array_intersect($new_options['local'], $new_options['global']); // Now check which options to add/update $add_options = $update_options = array(); // First local ones... foreach ($options as $type => $option_ary) { foreach ($option_ary as $option) { if (!isset($cur_options[$option])) { $add_options[] = array( 'auth_option' => (string) $option, 'is_global' => ($type == 'global' || $type == 'both') ? 1 : 0, 'is_local' => ($type == 'local' || $type == 'both') ? 1 : 0 ); continue; } // Else, update existing entry if it is changed... if ($type === $cur_options[$option]) { continue; } // New type is always both: // If is now both, we set both. // If it was global the new one is local and we need to set it to both // If it was local the new one is global and we need to set it to both $update_options[] = $option; } } if (!empty($add_options)) { $db->sql_multi_insert(ACL_OPTIONS_TABLE, $add_options); } if (!empty($update_options)) { $sql = 'UPDATE ' . ACL_OPTIONS_TABLE . ' SET is_global = 1, is_local = 1 WHERE ' . $db->sql_in_set('auth_option', $update_options); $db->sql_query($sql); } $cache->destroy('_acl_options'); $this->acl_clear_prefetch(); // Because we just changed the options and also purged the options cache, we instantly update/regenerate it for later calls to succeed. $this->acl_options = array(); $this->auth_admin(); return true; }
[ "public function addOptions(array $options);", "public function addOptions($options) {\n foreach ($options as $key => $val) {\n $this->options[$key] = $val;\n }\n }", "public function add_option_to_list_and_track_setting_change($option)\n {\n }", "function todo_list_options(){\n\n add_option('todo_task_list', [\n ['name' => 'Example Task 1',\n 'done' => 0],\n ['name' => 'Example Task 2',\n 'done' => 0],\n ['name' => 'Example Task 3',\n 'done' => 1]\n\n ]);\n\n\n\n\n}", "function yourls_add_option( $name, $value = '' ) {\n\tglobal $ydb;\n\t$table = YOURLS_DB_TABLE_OPTIONS;\n\t\n\t$name = trim( $name );\n\tif ( empty( $name ) )\n\t\treturn false;\n\t\n\t// Use clone to break object refs -- see commit 09b989d375bac65e692277f61a84fede2fb04ae3\n\tif ( is_object( $value ) )\n\t\t$value = clone $value;\n\t\n\t$name = yourls_escape( $name );\n\n\t// Make sure the option doesn't already exist\n\tif ( false !== yourls_get_option( $name ) )\n\t\treturn false;\n\n\t$_value = yourls_escape( yourls_maybe_serialize( $value ) );\n\n\tyourls_do_action( 'add_option', $name, $_value );\n\n\t$ydb->query( \"INSERT INTO `$table` (`option_name`, `option_value`) VALUES ('$name', '$_value')\" );\n\t$ydb->option[ $name ] = $value;\n\treturn true;\n}", "function eventspractice_options() {\n\n $options = array (\n 'Option 1' => 'A',\n 'Option 2' => 'B',\n 'Option 3' => 'C'\n );\n\n if ( !get_option( 'eventspractice_options' ) ){\n add_option( 'eventspractice_option', $options );\n }\n update_option( 'eventspractice_option', $options );\n\n\n // add_option( 'eventspractice_option', 'My NEW Plugin Options' );\n // update_option( 'eventspractice_option', 'This is a test with the Options API' );\n // delete_option( 'eventspractice_option' );\n\n}", "public function addOptions()\n {\n // Checks if options array is bigger than 1\n if(count($this->options) <= 1){\n abort(400, \"Options array was not passed or there is only 1 option!\");\n }\n\n // Create options\n foreach ($this->options as $option) {\n Option::create([\n \"option\" => $option,\n \"pollId\" => $this->pollId\n ])->save();\n }\n }", "function addOption($option){\n\n $new = count($this->elements);\n $this->elements[$new] = $option;\n }", "function add_option_whitelist($new_options, $options = '')\n {\n }", "function add_option_whitelist($new_options, $options = '')\n{\n}", "public function register_options()\n\t{\n\t\tforeach($this->options as $option=>$value)\n\t\t{\n\t\t\tif ($this->get_option($option) === false)\n\t\t\t\t$this->update_option($option, $value);\n\t\t}\n\n\t\tforeach($this->local_options as $option=>$value)\n\t\t{\n\t\t\t$option = $this->fix_option_name($option);\n\t\t\tif (get_option($option) === false)\n\t\t\t\tupdate_option($option, $value);\n\t\t}\n\t\t\n\t\tif ($this->is_network)\n\t\t{\n\t\t\tforeach($this->site_options as $option=>$value)\n\t\t\t{\n\t\t\t\t$option = $this->fix_option_name($option);\n\t\t\t\tif (get_site_option($option) === false)\n\t\t\t\t\tupdate_site_option($option, $value);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tforeach($this->site_options as $option=>$value)\n\t\t\t{\n\t\t\t\t$option = $this->fix_option_name($option);\n\t\t\t\tif (get_option($option) === false)\n\t\t\t\t\tupdate_option($option, $value);\n\t\t\t}\n\t\t}\n\t}", "public function addOption($option){\n\t\t$this->options[] = $option;\n\t}", "function yourls_add_option( $name, $value = '' ) {\n $option = new \\YOURLS\\Database\\Options(yourls_get_db());\n $add = $option->add($name, $value);\n\n return $add;\n}", "function wct_add_options() {\n\n\t// Add default options\n\tforeach ( wct_get_default_options() as $key => $value ) {\n\t\tadd_option( $key, $value );\n\t}\n\n\t// Allow plugins to append their own options.\n\tdo_action( 'wct_add_options' );\n}", "public function ajouterOption($uneOption){\n $this->options[] = $uneOption;\n }", "public function addOption($option, $setType = 'append');", "function swpf_update_options( $options ) {\n\n\tforeach ($options as $key => $value) {\n\t\tupdate_option( $key, $value );\n\t}\n}", "public function addOption(string $_option)\n {\n $this->options[] = $_option;\n }", "function saveOptions() {\r\n\t\t\tupdate_option($this->optionsName, $this->options);\r\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Override KReport_Chart::get_y_max() to support the differing format of horizontal bar chart data. Get the maximum Y value of the chart.
function get_y_max() { return count($this->_config[self::VALUES]) -1; }
[ "public function get_max_y_value() {\n return $this->max_y_value;\n }", "public function get_y_max() {\n return $this->y_max;\n }", "function _maximumY()\n {\n if ($this->_dataset) {\n return $this->_dataset->maximumY();\n }\n }", "function get_y_max()\n\t{\n\t\t$this->sanity(__FUNCTION__);\n\n\t\t$y = array_values($this->_config[self::VALUES]);\n\t\tsort($y);\n\t\treturn array_pop($y);\n\t}", "public function getMaxY()\n {\n return $this->_maxY;\n }", "function setYAxisMaximum($max = false)\n {\n if ($max !== false) {\n $max = 1.0 * $max;\n }\n $this->yaxis_max = $max;\n }", "public function set_max_y_value($max_y_value)\n {\n $this->max_y_value = $max_y_value;\n }", "private function chartmax($data){\n\t\t\t$max = 0;\n\t\t\tforeach($data as $row){\n\t\t\t\t$max = max($max,$row['value']);\n\t\t\t}\n\t\t\treturn $max;\n\t\t}", "function set_y_right_max( $max )\n {\n $this->y2_max = floatval($max);\n }", "public function get_axis_y() {\n return $this->axis_y;\n }", "protected function BarHeight()\n {\n if(is_numeric($this->bar_width) && $this->bar_width >= 1)\n return $this->bar_width;\n $unit_h = $this->y_axes[$this->main_y_axis]->Unit();\n $bh = $unit_h - $this->bar_space;\n return max(1, $bh, $this->bar_width_min);\n }", "protected function calculateMaxY($side) {\n\t\tif ($this->ymax_type == GRAPH_YAXIS_TYPE_FIXED) {\n\t\t\treturn $this->yaxismax;\n\t\t}\n\n\t\tif ($this->ymax_type == GRAPH_YAXIS_TYPE_ITEM_VALUE) {\n\t\t\t$item = get_item_by_itemid($this->ymax_itemid);\n\t\t\t$history = Manager::History()->getLastValues([$item]);\n\t\t\tif (isset($history[$item['itemid']])) {\n\t\t\t\treturn $history[$item['itemid']][0]['value'];\n\t\t\t}\n\t\t}\n\n\t\t$maxY = null;\n\t\tfor ($i = 0; $i < $this->num; $i++) {\n\t\t\tif ($this->items[$i]['yaxisside'] != $side) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (!isset($this->data[$this->items[$i]['itemid']][GRAPH_ITEM_SIMPLE])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$data = &$this->data[$this->items[$i]['itemid']][GRAPH_ITEM_SIMPLE];\n\n\t\t\tif (!isset($data)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$calc_fnc = $this->items[$i]['calc_fnc'];\n\n\t\t\tswitch ($calc_fnc) {\n\t\t\t\tcase CALC_FNC_ALL:\n\t\t\t\tcase CALC_FNC_MAX:\n\t\t\t\t\t$val = $data['max'];\n\t\t\t\t\t$shift_val = $data['shift_max'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase CALC_FNC_MIN:\n\t\t\t\t\t$val = $data['min'];\n\t\t\t\t\t$shift_val = $data['shift_min'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase CALC_FNC_AVG:\n\t\t\t\tdefault:\n\t\t\t\t\t$val = $data['avg'];\n\t\t\t\t\t$shift_val = $data['shift_avg'];\n\t\t\t}\n\n\t\t\tif (!isset($val)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tfor ($ci = 0; $ci < min(count($val), count($shift_val)); $ci++) {\n\t\t\t\tif ($data['count'][$ci] == 0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$val[$ci] = bcadd($shift_val[$ci], $val[$ci]);\n\t\t\t}\n\n\t\t\tif (!isset($maxY)) {\n\t\t\t\tif (isset($val) && count($val) > 0) {\n\t\t\t\t\t$maxY = max($val);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$maxY = max($maxY, max($val));\n\t\t\t}\n\t\t}\n\n\t\treturn $maxY;\n\t}", "function maxValue () {\r\n $max = null;\r\n foreach ($this->data as $key => $value) {\r\n if ($max == null || $value > $max) {\r\n $max = $value;\r\n }\r\n }\r\n \r\n return $max;\r\n }", "public function getAxisDistanceY()\n\t{\n\t\treturn $this->axis_distance_y;\n\t}", "function formatYAxis($value)\n{\n return NumberFormatter::getInstance()->format($value);\n}", "public function getYAxis() {\n return $this->yAxis;\n }", "function setMaxY($maxy)\n {\n $str = \"set yrange [0:$maxy]\\n\";\n $this->send($str);\n }", "public function getHistogramMax()\n {\n return max($this->serie);\n }", "public function getYAxis()\n {\n return $this->getAsObject($this->yAxis);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a new Queen
private function newQueen(){ return array( 'type' => 'Queen', 'life' => 100, ); }
[ "public function __construct() {\n \n /* create a new queen and give her a start position\n */\n// $queen = new Queen(1, 1); // e.g. A1\n// $queen = new Queen(6, 5); // e.g. F5\n// $queen = new Queen(4, 2); // e.g. F5\n \n $res = array();\n // for each possible chessboard cell we create a new queen.\n for( $r=1;$r<=7;$r++) {\n \n for( $c=1; $c<=7; $c++ ) {\n $queen = new Queen( $r,$c );\n\n if( $queen->otherQueens == 6 ) {\n $res[] = $queen->_arrTable;\n }\n }\n \n }\n \n\n /* Create all rows and corresponding cells for the table.\n */\n foreach( $res as $k => $tableRows ) {\n foreach( $tableRows AS $s => $tableCell ) {\n $this->rows[$s] = new Row( );\n\n foreach( $tableCell as $u => $cellValue ) {\n if( $cellValue == TRUE ) {\n $this->rows[$s]->append( new Cell( 'Queen' ) );\n }\n else {\n $this->rows[$s]->append( new Cell( '&nbsp;' ) );\n }\n }\n \n }\n \n /* create new chessboard\n */\n $this->boards = new Chessboard( );\n\n /* Add rows ( and cells ) to the new board\n */\n foreach( $this->rows as $row ) {\n $this->boards->append($row);\n }\n \n $this->viewBoards[] = $this->boards;\n }\n \n \n }", "public function placeQueen(int $i, int $j): bool\n {\n // Out of bounds\n if ($i<0 || $i >= 8 || $j < 0 || $j >= 8) {\n throw new InvalidArgumentException(\"Given coordinates are out of board\");\n }\n return true;\n // This method should actually do something to private coordinates to modelise a Queen Obecjt\n }", "public function createMines()\n {\n \t$assignedMines = 0;\n\n \twhile($assignedMines < $this->mines)\n \t{\n \t\t$col = mt_rand(0, $this->columns - 1);\n \t\t$row = mt_rand(0, $this->rows - 1);\n\n \t\t$item = $this->squares->first(function ($value) use ($row, $col) {\n\t\t\t return $value->column == $col && $value->row == $row;\n\t\t\t});\n\n \t\tif(!$item->hasMine)\n \t\t{\n \t\t\t$item->hasMine = true;\n \t\t\t$item->save();\n \t\t\t$assignedMines++;\n \t\t}\n \t}\n\n return $this;\n }", "private function getBoard(): Board\n {\n return new Board($this->slots, $this->rows, $this->columns);\n }", "public function toQueue()\n {\n self::add($this);\n return $this;\n }", "function newBoard() {\n\n //clear out the board\n\t\t$this->board = array();\n\n //create the board\n for ($x = 0; $x <= 2; $x++)\n {\n for ($y = 0; $y <= 2; $y++)\n {\n $this->board[$x][$y] = null;\n }\n }\n }", "function newBoard() {\n \n //clear out the board\n\t\t$this->board = array();\n \n //create the board\n for ($x = 0; $x <= 2; $x++)\n {\n for ($y = 0; $y <= 2; $y++)\n {\n $this->board[$x][$y] = null;\n }\n }\n }", "function _isQueen($piece)\n {\n if (!isset($this->_pieces[$piece{0}][$piece{1}][$piece{2}])) {\n return false;\n }\n return $piece{1} == 'Q' ||\n ($piece{1} == 'P' &&\n $this->_pieces[$piece{0}][$piece{1}][$piece{2}][1] == 'Q');\n }", "public function get_queue()\n\t{\n\t\t$sql = 'SELECT * FROM ' . TITANIA_QUEUE_TABLE . '\n\t\t\tWHERE contrib_id = ' . $this->contrib_id . '\n\t\t\t\tAND revision_id = ' . $this->revision_id;\n\t\t$result = phpbb::$db->sql_query($sql);\n\t\t$row = phpbb::$db->sql_fetchrow($result);\n\t\tphpbb::$db->sql_freeresult($result);\n\n\t\tif ($row)\n\t\t{\n\t\t\t$queue = new titania_queue;\n\t\t\t$queue->__set_array($row);\n\t\t\treturn $queue;\n\t\t}\n\n\t\treturn false;\n\t}", "public function __construct()\n {\n for ($x = -self::BOARD_SIZE; $x <= self::BOARD_SIZE; $x++) {\n for ($y = -self::BOARD_SIZE; $y <= self::BOARD_SIZE; $y++) {\n if (abs($x) >= self::SIDE_SIZE && abs($y) >= self::SIDE_SIZE) {\n continue;\n }\n $this->board[$x][$y] = self::STONE;\n }\n }\n\n $this->board[0][0] = self::EMPTY_SLOT;\n }", "public function placeQueen(int $i, int $j)\n {\n $iMax = self::CHESSBOARD_COLUMNS-1;\n $jMax = self::CHESSBOARD_ROWS-1;\n\n if($i > $iMax || $j > $jMax) {\n throw new InvalidChessboardCoordinatesException(\"QueenAttack::placeQueen(i = $i, j = $j) Chessboard coordinates must be i = [0-$iMax], j = [0-$jMax]\");\n }\n return true;\n }", "public function messageBoard()\n {\n $messageBoard = collect($this->dock)->where('name', 'message_board')\n ->first();\n $messageBoard->bucket = $this;\n return new MessageBoard($messageBoard);\n }", "public function createQueue(string $name): Queue\n {\n return new Queue($name);\n }", "public function getBuildQueAt($offset)\n {\n return $this->get(self::BUILD_QUE, $offset);\n }", "protected function setQue($que)\n {\n $this->que = $que;\n\n return $this;\n }", "public function moveQueen()\n {\n try{\n\t\t\t$kingdom_file_name = 'kingdom.txt';\t\t\t\n\t\t\t$kingdom = null;\t\t\t\n\t\t\tif(File::exists(public_path($kingdom_file_name))){\n\t\t\t\t$kingdom = File::get(public_path($kingdom_file_name));\n\t\t\t}\n\t\t\t\n\t\t\tif($kingdom){\n\t\t\t\t$kingdom = unserialize($kingdom);\n\t\t\t\t$kingdom->move();\t\t\t\t\n\t\t\t\t$this->saveFile($kingdom_file_name,serialize($kingdom));\n\t\t\t\t$result = [\n\t\t\t\t\t\"code\" \t\t=> 200,\n\t\t\t\t\t\"message\" \t=> \"The move action was successfully done !\",\n\t\t\t\t];\n\t\t\t\treturn $result;\n\t\t\t}else{\n\t\t\t\treturn response()->json(\n\t\t\t\t\t[\n\t\t\t\t\t\t\"code\"\t\t=> 404,\n\t\t\t\t\t\t'message' \t=> \"Kingdom not found\",\n\t\t\t\t\t], \n\t\t\t\t\t404\n\t\t\t\t);\n\t\t\t}\n\t\t}catch (InvalidMoveException $e) {\n\t\t\tLogRepo::printLog('error', $e->getMessage().\" on line .\".$e->getLine());\n return response()->json(\n\t\t\t\t[\n\t\t\t\t\t\"code\"\t\t=> 400,\n\t\t\t\t\t'message' \t=> $e->getMessage(),\n\t\t\t\t], \n\t\t\t\t400\n\t\t\t);\n }catch (InvalidObjectException $e) {\n\t\t\tLogRepo::printLog('error', $e->getMessage().\" on line .\".$e->getLine());\n return response()->json(\n\t\t\t\t[\n\t\t\t\t\t\"code\"\t\t=> 400,\n\t\t\t\t\t'message' \t=> $e->getMessage(),\n\t\t\t\t], \n\t\t\t\t400\n\t\t\t);\n }catch(Exception $e){\n\t\t\tLogRepo::printLog('error', $e->getMessage().\" on line .\".$e->getLine());\n\t\t\treturn response()->json(\n\t\t\t\t[\n\t\t\t\t\t\"code\"\t\t=> 500,\n\t\t\t\t\t'message' \t=> \"An internal server error occurred\",\n\t\t\t\t], \n\t\t\t\t500\n\t\t\t);\n\t\t}\n }", "public function getQueue() : QueueInterface;", "public function getQue()\n {\n return $this->que;\n }", "public function testQueenId(): void {\n $queen = new \\Bees\\Entity\\Bee\\Queen(100);\n $this->assertEquals(100, $queen->getId());\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Change Old password ACCORDING thier Roll/ID
public function change_password($array){ $id=$array['id']; //$roll=$array['roll']; $password=md5($array['password']); $npassword=md5($array['npassword']); $cpassword=md5($array['cpassword']); //change ADMIN password which have ID==1 Always if($id==1){ if($npassword!=$cpassword){ $this->_redirect->redirect("".BASE_URL."/admin/change_password"); } else{ $query="update admin set password='$npassword' where id= '". $array['id'] ."' and password='$password'"; $count=$this->_dbh->query($query); $this->_redirect->redirect("".BASE_URL."/logout.php"); } } //change USER[Administrator] password which have roll>1 Always else if($id>1){ if($npassword!=$cpassword){ $this->_redirect->redirect("".BASE_URL."/admin/change_password");} else{ $query="update users set password='$npassword' where id= '". $array['id'] ."' and password='$password'"; $count=$this->_dbh->query($query); return true; //$this->_redirect->redirect("".BASE_URL."/logout.php"); } } }
[ "public function change_password(){\n change_password();\n }", "function changePassword($newPassword){\n\t\t$patronID = $this->getID();\n\n\t\t$connector = new ILMSConnection();\n\n\t\t$connector->addQuery(\"update patron set Password = '$newPassword' where ID = $patronID\");\n\t\t//echo \"$newPassword\";\n\t\t$connector->closeCon();\n\t}", "public function ChangePassword($newPass);", "private function updatePassword()\n {\n $db = \\phpws2\\Database::getDB();\n $tbl = $db->addTable('prop_contacts');\n $newdt = new \\phpws2\\Database\\Datatype\\Varchar($tbl, 'password', 255);\n $tbl->alter($tbl->getDataType('password'), $newdt);\n }", "function m_updatePass()\n\t\t{\n\t\t\t$this->obDb->query=\"UPDATE \".CUSTOMERS.\" SET vPassword=PASSWORD('\".$this->libFunc->m_addToDB($this->request['password']).\"')\n\t\t\tWHERE (iCustmerid_PK ='\".$_SESSION['userid'].\"')\";\n\t\t\t$this->obDb->updateQuery();\n\t\t\t$retUrl=$this->libFunc->m_safeUrl(SITE_URL.\"user/index.php?action=user.home&mode=password&msg=1\");\n\t\t\t$this->libFunc->m_mosRedirect($retUrl);\t\n\t\t\texit;\n\t\t}", "public function updatePassword(string $password, int $id);", "public function changepassword() {\n $data['parent'] = \"password\";\n $data['error'] = \"\";\n $data['message'] = \"\";\n $this->template->load('default', 'auth/changepassword', $data);\n }", "public function updateUserPassword($id,$password);", "function changePassword(\\Token $token, string $oldPassword, string $newPassword);", "function change_pwd_update_register(){\n\t\tglobal $CFG;\n\t\t$old_password = $this->My_addslashes(md5($_POST[\"old_password\"]));\n\t\t \n\t\t$new_password = md5($_POST[\"new_password\"]);\n\t \n\t\tif($this->chkPasswordInAdmin($old_password,$_SESSION['adminid'])){\n\t\t\t\t$UpQuery = \"UPDATE \".$CFG['table']['admin'].\" SET password = '\".$this->filterInput($new_password).\"' WHERE admin_id = \". $this->filterInput($_SESSION['adminid']);\n\t\t\t\t$UpResult = mysql_query($UpQuery) or die($this->mysql_error($UpQuery));\n\t\t\t}\n\t\telse{\t\n\t\t\techo \"Invalid_Old_Pwd\";\t\t\t\n\t\t\texit();\n\t\t\t}\n\t}", "public function changePassword()\n {\n\n GeneralUtility::checkReqFields(array(\"password\", \"password_again\"), $_POST);\n\n if ($_POST[\"password\"] !== $_POST[\"password_again\"])\n GeneralUtility::kill(\"The passwords don't match!\");\n\n $user = new User($_SESSION[\"uuid\"]);\n $user->update(\"password\", sha1($_POST[\"password\"]));\n\n }", "function changePass()\n{\n\tglobal $lang, $Account;\n\t$newpass = trim($_POST['password']);\n\tif(strlen($newpass)>3)\n\t{\n\t\tif($Account->setPassword($_GET['id'], $newpass) == TRUE)\n\t\t{\n\t\t\toutput_message('success','<b>Password set successfully! Please wait while your redirected...</b>\n\t\t\t<meta http-equiv=refresh content=\"3;url=?p=admin&sub=users&id='.$_GET['id'].'\">');\n\t\t}\n\t\telse\n\t\t{\n\t\t\toutput_message('error', '<b>Change Password Failed!');\n\t\t}\n\t}\n\telse\n\t{\n\t\toutput_message('error','<b>'.$lang['change_pass_short'].'</b>\n\t\t<meta http-equiv=refresh content=\"3;url=?p=admin&sub=users&id='.$_GET['id'].'\">');\n\t}\n}", "public function changePasswordAction() {\n\n\t\trequire $_SERVER['DOCUMENT_ROOT'].'/school'.'/model/teacherIdentifyItem.php';\t\n\n\t\t$this->util_->requireArg('OP');\n\t\t$this->util_->requireArg('NP');\n\t\t$identify = new teacherIdentifyItem();\n\t\t$req = array();\n\t\t$req[0] = array('key' => 'Tea_ID', 'Tea_ID' => $_POST['Account']);\n\t\t$arg = array('Password');\n\t\t$res = $identify->search($req, $arg);\n\t\t\n\t\tif($res[0]['Password'] != $_POST['OP']) {\n\t\t\tthrow new Exception('Password wrong');\n\t\t}\n\n\t\t$identify->Tea_ID = $_POST['Account'];\n\t\t$arg1 = array('Password' => $_PSOT['NP']);\n\t\t$identify->update($arg1);\n\n\t}", "public function editUserPassword()\n {\n //Edit user password query\n $editUserPasswordQuery = \"UPDATE `LPV_user`\n SET `password` = :passwords\n WHERE `id` = :currentId\";\n\n //Preparation of the \"edit\" request\n $editUserPasswordResult = $this->db->prepare($editUserPasswordQuery);\n //Recovery of values\n $editUserPasswordResult->bindValue(':currentId', $this->getId(), PDO::PARAM_INT);\n $editUserPasswordResult->bindValue(':passwords', $this->getPassword(), PDO::PARAM_STR);\n //Execute\n $editUserPasswordResult->execute();\n }", "function clientUpdatePassword($password)\n\t {\n\t\t$id = userID();\t\n\t\t$db = db();\n\t\t$sql = \"UPDATE user_accounts SET Password = ? WHERE UserID = ?\";\n\t\t$cmd = $db->prepare($sql);\n\t\t$cmd->execute(array(md5($password),$id));\n\t\t$db = null;\n\t\treturn \"Password changed.\";\t \t\n\t }", "public function editPasswordProcess() {\n\t\t$user = User::loadById($_GET['userid']);\n\n\t\tif ($user->get('password')==$_POST['oldpassword']) {\n\t\t\t$user->set('password',$_POST['password']);\n\t\t\t$user->save();\n\t\t\t$this->viewAccount();\n\t\t} else {\n\t\t\t$pageName = 'Edit Password';\n\n\t\t\tinclude_once SYSTEM_PATH.'/view/header.tpl';\n\n\t\t\techo '<h3 id=\"resign_text\" > Error: Your Current Password is incorrect </h3>\n\t\t\t\t\t\t<br><br>';\n\n\t\t\t$this->editPassword();\n\t\t}\n\t}", "public function changePassword() {\n \n if($this->validatePassword($this->oldPassword))\n {\n $this->salt = $this->generateSalt();\n $this->password = $this->hashPassword($this->newPassword, $this->salt);\n return true;\n \n }\n else {\n $this->addError('oldPassword', '<b>&#10006;</b> &nbsp; Your old password does not match our records.');\n return false;\n }\n \n \n }", "public function changePass()\n {\n\n $mdp = $this->request->getParameter( 'pass' );\n $verifPass = $this->request->getParameter( 'verifPass' );\n\n if ($mdp !== false && $verifPass !== false) {\n if ($mdp === $verifPass) {\n if (preg_match( \"#^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*\\W)(?!.*[<>]).{8,30}$#\", $mdp )) {\n $this->user->updateMdp( $mdp, $this->request->getSession()->getAttribut( 'idUser' ) );\n $this->rediriger( \"admin\", \"index\" );\n $this->request->getSession()->setFlash( 'Le mot de passe a été modifié' );\n } else {\n\n $this->request->getSession()->setFlash( 'mots de passe non autorisé' );\n }\n\n } else {\n $this->request->getSession()->setFlash( 'Les mots de passe ne sont pas identiques' );\n }\n } else {\n $this->request->getSession()->setFlash( 'Action non autorisée' );\n }\n $this->rediriger( \"admin\", \"index\" );\n\n\n }", "public function actionChangePass($id) {\n $model = new PasswordSetForm();\n if ($model->loadAccount($id) === false) {\n return 'Account with id[' . $id . '] doesn\\'t exist';\n }\n $this->prompPasswords($model);\n if ($model->save() === false) {\n echo Yii::t('user_creation', 'A problem ocurred while changing the user password');\n } else {\n echo Yii::t('user_creation', 'Account password changed successfully');\n }\n echo PHP_EOL;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
findById method find education with matched id in database
function findById($id){ Log::info("Entering EducationDataService::findById()"); try { // Select education information from the database with id $statement = $this->connection->prepare("SELECT ID, SCHOOL, DEGREE, FIELD, GRADUATION_YEAR, USER_ID FROM EDUCATION WHERE ID = :id "); if(!$statement){ echo "Something wrong in the binding process.sql error?"; exit; } //bindParam $id $statement->bindParam(':id', $id); $statement->execute(); if($statement->rowCount() == 1) { Log::info("Exit SkillDataService.findById"); //fetches education from database and returns $education $row = $statement->fetch(PDO::FETCH_ASSOC); $result = new Education($row['ID'],$row['SCHOOL'],$row['DEGREE'], $row['FIELD'], $row['GRADUATION_YEAR'], $row['USER_ID']); return $result; } }catch(PDOException $e) { // catch exception and throw DatabaseException Log::error("Exception: ", array("message " => $e->getMessage())); throw new DatabaseException("Database Exception: ". $e->getMessage(), 0, $e); } }
[ "public function education(){\n return $this->hasOne(UserEducation::class, 'user_id', 'id');\n }", "public function education()\n {\n return $this->hasOne('App\\Models\\Education','user_id','id');\n }", "public function education()\n {\n return $this->hasOne('App\\Models\\Education','education_level_id','id');\n }", "public function findById()\n\t{\n\t}", "function readByEduID($id){\n try {\n Log::info(\"Entering EducationDataService.readByEduID()\");\n \n //use the connection to create a prepared statement\n $stmt = $this->conn->prepare(\"SELECT * FROM `EDUCATION` WHERE `ID` = :id LIMIT 1\");\n \n //Bind the variables to the SQL statement\n $stmt->bindParam(':id', $id);\n \n //execute the SQL statement\n $stmt->execute();\n \n //check is a row was returned\n if($stmt->rowCount() == 0){\n Log::info(\"Exiting EducationDataService.readByEduID() with returning null\");\n return null;\n }\n else{\n //fetch all the education data\n $edu = $stmt->fetch(PDO::FETCH_ASSOC);\n \n //create variables to hold the user data\n $school = $edu['SCHOOL'];\n $degree = $edu['DEGREE']; \n $start_year = $edu['START_YEAR']; \n $end_year = $edu['END_YEAR']; \n $additional_info = $edu['ADDITIONAL_INFORMATION']; \n \n //create a new instance of an education model \n $edu_ob = new EducationModel($id, $school, $degree, $start_year, $end_year, $additional_info, null); \n \n Log::info(\"Exiting EducationDataService.readByEduID() with returning a education object\");\n return $edu_ob;\n }\n }\n catch (PDOException $e){\n Log::error(\"Exception: \", array(\"message\" => $e->getMessage()));\n throw new DatabaseException(\"Database Exception: \" . $e->getMessage(), 0, $e);\n }\n }", "function findByIdTest()\n {\n $accessoryDao = new AccessoryDao();\n return $accessoryDao->findById(2);\n }", "public function find($id): ?Teacher;", "public function findOneByIdEmployee($idEmployee);", "abstract public function findOne(int $id);", "public function findOne();", "public function findPatientById($id);", "public function findById($searchedIdLunch) { ; }", "public function find($id) {\n\t\treturn $this->employee->info()->filterById($id)->first();\n\t}", "public function getById($experienceId);", "public function find(Identity $id);", "public function educational($id){\n\t\t\n\t\t$db = $this->common();\n\t\t$data\t\t\t\t= array();\n\t\t\n\t\t$data['tables']\t\t= 'jobseeker_educational_details';\n\t\t$data['columns']\t= array('jobseeker_educational_details.highest_degree','jobseeker_educational_details.graduation_degree',\n\t\t\t\t\t\t\t\t\t'jobseeker_educational_details.post_graduation_degree','jobseeker_educational_details.PhD',\n\t\t\t\t\t\t\t\t\t'jobseeker_educational_details.other_degree');\n\t\t\t\t\t\t\t\t\t\n\t\t$data['joins']\t\t= null;\n\t\t//Add the joins\n\t\t$data['joins'][] = array(\n\t\t\t'table' => 'jobseeker_personal_details', \n\t\t\t'conditions' => array('jobseeker_educational_details.personal_id' =>'jobseeker_personal_details.id')\n\t\t);\n\t\t$data['conditions']\t\t= array('jobseeker_personal_details.id' => $id);\n\t\t$result = $db->select($data);\n\t\twhile($row = $result->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t\treturn $row;\n\t\t}\n\t}", "function findById($id){\n Log::info(\"Entering SkillDataService::findById()\");\n \n try{\n \n // Select skill with matched id\n $statement = $this->connection->prepare(\"SELECT ID, SKILL, USER_ID FROM SKILL WHERE ID = :id \");\n \n if(!$statement){\n echo \"Something wrong in the binding process.sql error?\";\n exit;\n }\n //bindParam $id\n $statement->bindParam(':id', $id);\n $statement->execute();\n \n // if finds result fetch skill information and returns result\n if($statement->rowCount() == 1){\n Log::info(\"Exit SkillDataService.findById\");\n \n //fetches user from database and returns $user\n $row = $statement->fetch(PDO::FETCH_ASSOC);\n $result = new Skill($row['ID'], $row['SKILL'], $row['USER_ID']);\n \n return $result;\n }\n \n }catch(PDOException $e)\n {\n // catch exception and throw DatabaseException\n Log::error(\"Exception: \", array(\"message \" => $e->getMessage()));\n throw new DatabaseException(\"Database Exception: \". $e->getMessage(), 0, $e);\n }\n }", "public function findById($id){\n return $this->institution->find($id);\n }", "public function findOneById($id)\n {\n $consultation = Consultation::where('id_consultation',$id)->first();\n return response()->json($consultation);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Hacked version of stream_get_meta_data function, used only for tests.
function stream_get_meta_data($stream) { if (\PhowerTest\Http\StreamTest::$streamGetMetaDataReturns !== null) { return \PhowerTest\Http\StreamTest::$streamGetMetaDataReturns; } return \stream_get_meta_data($stream); }
[ "function stream_get_meta_data ($fp) {}", "public function getMetaData() {\n\t\treturn stream_get_meta_data($this->handle);\n\t}", "public function test_no_headers_with_stream_get_meta_data()\n\t{\n\t\tHttp::setSaveFilename( 'no-header' );\n\t\t$handle = \\fopen( 'http://www.example.com/', 'r' );\n\t\t\\fread( $handle, 4096 );\n\t\t$metaData = \\stream_get_meta_data( $handle );\n\t\t\\fclose( $handle );\n\t\t// Headers are stored at index 0 of the wrapper data.\n\t\t$this->assertNull( $metaData['wrapper_data'][0] );\n\t}", "protected function getMetaData()\n\t{\n\t\treturn $this->data = json_decode(file_get_contents($this->meta_file), true);\n\t}", "private function getMetaData ()\n\t\t{\n\t\t\t$data = file_get_contents (\"META.inf\");\n\t\t\t$o = json_decode ($data,true);\n\t\t\treturn $o;\t\n\t\t}", "protected function maybe_read_meta_data()\n {\n }", "public function getStreamMetaData(): array\n {\n return \\stream_get_meta_data($this->getStream());\n }", "public function getMetaData(){\n if(!file_exists($this->fileName)){\n echo \"Error! {$this->fileName} does not exist.<br />\";\n return false;\n }\n if(!is_readable($this->fileName)){\n echo \"Error! Could not read the file. Check the file permissions.<br />\";\n return false;\n }\n $f = @fopen($this->fileName,\"rb\");\n if(!$f){\n echo \"Unknown Error! Could not read the file.<br />\";\n return;\n }\n $signature = fread($f,3);\n if($signature != \"FLV\"){\n echo \"Error! Wrong file format.<br />\";\n return false;\n }\n $this->metaData[\"version\"] = ord(fread($f,1));\n $this->metaData[\"size\"] = filesize($this->fileName);\n\n $flags = ord(fread($f,1));\n $flags = sprintf(\"%'04b\", $flags);\n $this->typeFlagsAudio = substr($flags, 1, 1);\n $this->typeFlagsVideo = substr($flags, 3, 1);\n\n for ($i=0; $i < 4; $i++) {\n $this->metaData[\"headersize\"] += ord(fread($f,1)) ;\n }\n\n $this->buffer = fread($f, 400);\n fclose($f);\n\tif(strpos($this->buffer, \"onMetaData\") === false){\n echo \"Error! No MetaData Exists.<br />\";\n return false;\n } \n\n foreach($this->metaData as $k=>$v){\n $this->parseBuffer($k);\n }\n\n return $this->metaData;\n }", "public function getMeta(): array\n {\n if (empty($this->meta)) {\n $path = $this->file->getRealPath();\n $meta = [\n 'width' => null,\n 'height' => null,\n 'duration' => 0,\n ];\n\n $cmd = $this->cmd(\"{$this->ffprobe} -i $path -loglevel quiet -show_format -show_streams -print_format json\");\n\n $process = new Process($cmd);\n $process->setTimeout($this->timeout);\n $process->run();\n $output = $process->getOutput();\n\n if ($process->isSuccessful()) {\n $output = json_decode($output);\n\n if ($output !== null) {\n $rotate = 0;\n\n foreach ($output->streams as $stream) {\n if (isset($stream->width)) {\n $meta['width'] = (int)$stream->width;\n }\n\n if (isset($stream->height)) {\n $meta['height'] = (int)$stream->height;\n }\n\n if (isset($stream->duration)) {\n $meta['duration'] = (int)$stream->duration;\n }\n\n if (isset($stream->tags->rotate)) {\n $rotate = $stream->tags->rotate;\n }\n }\n\n if ($rotate == 90 or $rotate == 270) {\n list($meta['height'], $meta['width']) = array($meta['width'], $meta['height']);\n }\n }\n else {\n $process->addErrorOutput('ffprobe output is null');\n throw new Exception($process->getErrorOutput());\n }\n }\n else {\n throw new Exception($process->getErrorOutput());\n }\n\n $this->meta = $meta;\n }\n\n return $this->meta;\n }", "protected function get_meta_data() {\n\n\t\t$post_ids = $this->get_post_ids();\n\t\t$meta_data = $this->get_meta_data_result( $post_ids );\n\n\t\t$this->parse_meta_data( $meta_data );\n\n\t\t// Little housekeeping.\n\t\tunset( $post_ids, $meta_data );\n\n\t}", "function windows_azure_storage_wp_get_attachment_metadata($data, $postID)\r\n{\r\n if (is_numeric($postID)) {\r\n // Cache this metadata. Needed for deleting files\r\n $mediaInfo = get_post_meta($postID, 'windows_azure_storage_info', true);\r\n }\r\n\r\n return $data;\r\n}", "public function metadata($data) {\n $request_url = $this->_apiURL.'metadata/'.$data.'?AccessID='.$this->_accessID.'&Expires='.$this->_expires.'&Signature='.$this->_signature;\n\n $result = $this->_curlRequest($request_url);\n \n return $result;\n }", "protected function get_meta_data() {\n //gather meta data\n if(empty($this->imagestring)) {\n $info = getimagesize($this->filename);\n\n switch ($info['mime']) {\n case 'image/gif':\n $this->image = imagecreatefromgif($this->filename);\n break;\n case 'image/jpeg':\n $this->image = imagecreatefromjpeg($this->filename);\n break;\n case 'image/png':\n $this->image = imagecreatefrompng($this->filename);\n break;\n default:\n throw new Exception('Invalid image: '.$this->filename);\n break;\n }\n } elseif (function_exists('getimagesizefromstring')) {\n $info = getimagesizefromstring($this->imagestring);\n } else {\n throw new Exception('PHP 5.4 is required to use method getimagesizefromstring');\n }\n\n $this->original_info = array(\n 'width' => $info[0],\n 'height' => $info[1],\n 'orientation' => $this->get_orientation(),\n 'exif' => function_exists('exif_read_data') && $info['mime'] === 'image/jpeg' && $this->imagestring === null ? $this->exif = @exif_read_data($this->filename) : null,\n 'format' => preg_replace('/^image\\//', '', $info['mime']),\n 'mime' => $info['mime']\n );\n $this->width = $info[0];\n $this->height = $info[1];\n\n imagesavealpha($this->image, true);\n imagealphablending($this->image, true);\n\n return $this;\n\n }", "function get_all_metadata($reset = false) {\n static $data = null;\n \n if ($reset) {\n $data = null;\n return;\n }\n \n if ($data === null) {\n $filename = get_data_filename('metadata');\n $data = read_file_as_metadata($filename);\n }\n \n return $data;\n}", "private function getMeta()\n {\n $this->meta = Storage::isFile($this->cacheFile) ? @stat($this->cacheFile): [];\n }", "private function getStreamMetaData() : array\n {\n if ($this->streamSocket === null) {\n throw new ConnectionLostException();\n }\n \n return \\stream_get_meta_data($this->streamSocket);\n }", "public function get_meta();", "protected function get_stream_meta($stream_id, $task_id, $key) {\n $result = $this->get_db()->query(\n \"SELECT value FROM \".STREAM_META_TABLE.\n \" WHERE task_id = \".sqlite_escape_string($task_id).\n \" WHERE stream_id = \".sqlite_escape_string($stream_id).\n \" WHERE key = \".sqlite_escape_string($key).\n \";\"\n );\n\n return $this->get_all_results($result);\n }", "function meta_fetch($data)\n {\n //Get default metas\n $default = $this->defaults();\n\n if (isset($data['page_meta_title']) && !empty($data['page_meta_title'])) {\n $meta['title'] = $data['page_meta_title'];\n } else {\n $meta['title'] = $default['title'];\n }\n\n if (isset($data['page_meta_keywords']) && !empty($data['page_meta_keywords'])) {\n $meta['keywords'] = $data['page_meta_keywords'];\n } else {\n $meta['keywords'] = $default['keywords'];\n }\n\n if (isset($data['page_meta_description']) && !empty($data['page_meta_description'])) {\n $meta['description'] = $data['page_meta_description'];\n } else {\n $meta['description'] = $default['description'];\n }\n\n return $meta;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
To insert transition testing data in tblstate
public function insert_transition_test_data() { $callflow_tbl = new tblcallflow; $callflow_id = $callflow_tbl->insertNewCallflow('callflow_1'); // NEW GRAPH THAT SEPARATE VALIDATION FUNCTION FROM GATHERING $this->tbl_transition->insertNewTransitionData('A', null, $callflow_id, null, '/public/TwiMLCodeToPlayMessage.xml', null, 'B', '1'); $this->tbl_transition->insertNewTransitionData('B', null, $callflow_id, null, 'Gater 5 digits', null, 'C', ''); $this->tbl_transition->insertNewTransitionData('C', null, $callflow_id, null, 'Validation', null, 'D', ''); $this->tbl_transition->insertNewTransitionData('D', '0', $callflow_id, null, 'Play invalid input, please try again', null, 'E0', ''); $this->tbl_transition->insertNewTransitionData('D', '1', $callflow_id, null, 'Play file5digits_twiML.xml', null, 'E1', ''); $this->tbl_transition->insertNewTransitionData('E0', null, $callflow_id, null, 'redirect to gathering', null, 'B', ''); $this->tbl_transition->insertNewTransitionData('E1', null, $callflow_id, null, 'Play (found sound file)', null, 'F', ''); $this->tbl_transition->insertNewTransitionData('F', null, $callflow_id, null, 'hang up', null, '', '2'); echo "Transition test data are inserted."; }
[ "public function import_into_state_tbl()\n {\n $sql = \"INSERT INTO state (country_id,s_state,WOE_ID) \n SELECT c.id,y.Name,y.WOE_ID FROM country AS c JOIN y_places AS y \n ON y.Parent_ID =c.WOE_ID AND y.Placetype='State'\";\n \n $res= $this->db->query($sql);\n //if(!empty($res))\n //$this->import_into_city_tbl();\n }", "public function testAddStateData()\n\t{\n\t\t$state_data = new StateDataTest(\n\t\t\tarray(\n\t\t\t\t'immutable_key' => 'cantchangeme',\n\t\t\t\t'mutable_key' => 'changeme'\n\t\t\t)\n\t\t);\n\t\t\n\t\t$embedded_data = 'I am beside myself';\n\t\t$embedded_state_data = new StateDataTest(\n\t\t\tarray(\n\t\t\t\t'embedded_data' => $embedded_data\n\t\t\t)\n\t\t);\n\t\t\n\t\t$second_embedded_data = 'I am beside myself again';\n\t\t$second_embedded_state_data = new StateDataTest(\n\t\t\tarray(\n\t\t\t\t'second_embedded_data' => $second_embedded_data\n\t\t\t)\n\t\t);\n\t\t\n\t\t// Adding the data is a pretty straight forward function, so not testing it specifically\n\t\t$state_data->addStateData($embedded_state_data);\n\t\t$state_data->addStateData($second_embedded_state_data);\n\t\t\n\t\t$this->assertEquals($embedded_data, $state_data->embedded_data);\n\t\t$this->assertEquals($second_embedded_data, $state_data->second_embedded_data);\n\t}", "public function insert($state) {\n //create the statement\n $statement = 'INSERT INTO State (name) VALUES (:name)';\n $query = Connection::getConnection()->prepare($statement);\n\n //bind parameters and execute query\n $name = $state->getName();\n\n\n $query->bindParam(':name', $name, PDO::PARAM_STR, 255);\n\n\n $query->execute();\n }", "public function testStore_Insert()\n {\n \t$id1 = $this->conn->store('test', array(null, 'new1', 'new row ONE', 'NEW'));\n \t$id2 = $this->conn->store('test', array('key'=>'new2', 'title'=>'new row TWO'));\n \t\n \t$result = $this->conn->query('SELECT * FROM test where status=\"NEW\"');\n \t$this->assertEquals(array($id1, 'new1', 'new row ONE', 'NEW'), $result->fetchOrdered());\n \t$this->assertEquals(array($id2, 'new2', 'new row TWO', 'NEW'), $result->fetchOrdered());\n\t}", "public function insertIntoCircuitBoardStates()\n {\n $query_string = \"INSERT INTO circuitboardstates \";\n $query_string .= \"SET \";\n $query_string .= \"switch01state = :switch01state, \";\n $query_string .= \"switch02state = :switch02state, \";\n $query_string .= \"switch03state = :switch03state, \";\n $query_string .= \"switch04state = :switch04state, \";\n $query_string .= \"fanstate = :fanstate, \";\n $query_string .= \"heatertemperature = :heatertemperature, \";\n $query_string .= \"keypadvalue = :keypadvalue\";\n\n return $query_string;\n }", "public function saveToDatabase($databaseName = \"requestDB\", $stateTableName = \"AutomataStates\", $transitionTableName = \"AutomataTransitions\") {\n\t\t// Takes credentials from config.php and connects to DB.\n\t\t$config = include('config.php');\n\t\t$databaseHostname = $config['databaseHostname'];\n\t\t$databaseUsername = $config['databaseUsername'];\n\t\t$databasePassword = $config['databasePassword'];\n\t\t$conn = new \\mysqli($databaseHostname, $databaseUsername, $databasePassword);\n\t\tif ($conn->connect_error) {\n\t\t\tdie(\"Connection Error:\".$conn->connect_error);\n\t\t}\n\t\t// Connects to DB, create if does not exist.\n\t\t$sql = \"CREATE DATABASE IF NOT EXISTS \".$databaseName;\n\t\tif ($conn->query($sql) === TRUE) {\n\t\t\t$conn->close();\n\t\t}\n\n\t\t// Creates a table for states and saves the content.\n\t\t$conn = new \\mysqli($databaseHostname, $databaseUsername, $databasePassword, $databaseName);\n\t\tif ($conn->connect_error) {\n\t\t\tdie(\"Connection Error: \".$conn->connect_error);\n\t\t}\n\n\t\t$sql = \"CREATE TABLE IF NOT EXISTS \".$stateTableName.\" (\n\t\tstateIndex INT(5) PRIMARY KEY,\n\t\tstateName VARCHAR(50) NOT NULL,\n\t\tstateID INT(5),\n\t\tstateType VARCHAR(50) NOT NULL \n\t\t)\";\n\t\tif ($conn->query($sql) === TRUE) {\n\t\t\t// Empty the table, to override the contents.\n\t\t\t$sql = \"TRUNCATE TABLE \".$stateTableName;\n\t\t\t$conn->query($sql);\n\t\t\tforeach ($this->_states as $key => $state) {\n\t\t\t\t$sql = \"INSERT INTO \".$stateTableName.\"(stateIndex, stateName, stateID, stateType) VALUES (\\\"\".$key.\"\\\", \\\"\".$state['stateName'].\"\\\", \\\"\".$state['stateID'].\"\\\", \\\"\".$state['stateType'].\"\\\")\";\n\t\t\t\tif ($conn->query($sql) === FALSE) {\n\t\t\t\t\tdie(\"Unable to add entries to table \".$stateTableName);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tdie(\"Table \".$stateTableName.\" Creation Error:\".$conn->error);\n\t\t}\n\n\t\t// Create a table for transitions and add contents.\n\t\t$sql = \"CREATE TABLE IF NOT EXISTS \".$transitionTableName.\" (\n\t\ttransitionID INT(5) PRIMARY KEY,\n\t\ttransitionName VARCHAR(50) NOT NULL,\n\t\tpresentState VARCHAR(50) NOT NULL,\n\t\tnextState VARCHAR(50) NOT NULL,\n\t\tresponse VARCHAR(50) NOT NULL \n\t\t)\";\n\t\tif ($conn->query($sql) === TRUE) {\n\t\t\t// Empty the table, to override the contents.\n\t\t\t$sql = \"TRUNCATE TABLE \".$transitionTableName;\n\t\t\t$conn->query($sql);\n\t\t\tforeach ($this->_transitions as $key => $transition) {\n\t\t\t\t$sql = \"INSERT INTO \".$transitionTableName.\"(transitionID, transitionName, presentState, nextState, response) VALUES (\\\"\".$key.\"\\\", \\\"\".$transition['transitionName'].\"\\\", \\\"\".$transition['presentState'].\"\\\", \\\"\".$transition['nextState'].\"\\\", \\\"\".$transition['response'].\"\\\")\";\n\t\t\t\tif ($conn->query($sql) === FALSE) {\n\t\t\t\t\tdie(\"Unable to add entries to table \".$transitionTableName);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tdie(\"Table \".$transitionTableName.\" Creation Error:\".$conn->error);\n\t\t}\n\n\t\t$conn->close();\n\t}", "public function testStateRecord()\n\t{\n\t\tself::$recordAccounts->changeState(\\App\\Record::STATE_TRASH);\n\t\t$this->assertSame(\\App\\Record::STATE_TRASH, (new \\App\\Db\\Query())->select(['deleted'])->from('vtiger_crmentity')->where(['crmid' => self::$recordAccounts->getId()])->scalar());\n\t\tself::$recordAccounts->changeState(\\App\\Record::STATE_ARCHIVED);\n\t\t$this->assertSame(\\App\\Record::STATE_ARCHIVED, (new \\App\\Db\\Query())->select(['deleted'])->from('vtiger_crmentity')->where(['crmid' => self::$recordAccounts->getId()])->scalar());\n\t\tself::$recordAccounts->changeState(\\App\\Record::STATE_ACTIVE);\n\t\t$this->assertSame(\\App\\Record::STATE_ACTIVE, (new \\App\\Db\\Query())->select(['deleted'])->from('vtiger_crmentity')->where(['crmid' => self::$recordAccounts->getId()])->scalar());\n\t}", "public function testAddStateSuccess()\n {\n $this->markTestIncomplete();\n }", "private function populateDummyTable() {}", "protected function insertDummyData()\n {\n $this->migrations->db()->table('migrations')->insert(array(\n array(\n 'id' => '2013-06-14 18:38:35',\n 'name' => 'migration_two',\n 'applied' => true,\n ),\n array(\n 'id' => '2013-06-14 18:38:27',\n 'name' => 'migration_one',\n 'applied' => true,\n ),\n array(\n 'id' => '2013-06-14 18:38:18',\n 'name' => 'test_migration',\n 'applied' => true,\n ),\n array(\n 'id' => '2013-06-14 07:58:39',\n 'name' => 'create_test',\n 'applied' => true,\n ),\n ));\n }", "public function testNewStatesAreAddedToTheEnd()\n\t {\n\t\t$stateMachine = new StateMachine();\n\t\t$stateMachine->addState(\n\t\t \"<?xml version=\\\"1.0\\\"?><listofitems><item id=\\\"1\\\" index=\\\"1\\\">First</item><item id=\\\"2\\\">Second</item></listofitems>\"\n\t\t);\n\t\t$stateMachine->addState(\n\t\t \"<?xml version=\\\"1.0\\\"?><listofitems><item id=\\\"2\\\">second</item><item id=\\\"3\\\">Third</item></listofitems>\"\n\t\t);\n\t\t$stateMachine->addState(\n\t\t \"<?xml version=\\\"1.0\\\"?><listofitems><item id=\\\"1\\\" index=\\\"1\\\">First</item><item id=\\\"2\\\">Second</item></listofitems>\"\n\t\t);\n\t\t$stateMachine->addState(\n\t\t \"<?xml version=\\\"1.0\\\"?><listofitems><item id=\\\"4\\\">Fourth</item></listofitems>\"\n\t\t);\n\n\t\t$this->assertEquals(true, $stateMachine->verifyIntegrity());\n\n\t\t$stateMachine->addState(\n\t\t \"<?xml version=\\\"1.0\\\"?><listofitems><item id=\\\"5\\\">fifth</item><item id=\\\"3\\\">Third</item></listofitems>\"\n\t\t);\n\n\t\t$this->assertXmlStringEqualsXmlString(\n\t\t \"<?xml version=\\\"1.0\\\"?><listofitems><item id=\\\"2\\\">second</item><item id=\\\"3\\\">Third</item></listofitems>\",\n\t\t $stateMachine->getState(2)\n\t\t);\n\n\t\t$this->assertEquals(true, $stateMachine->verifyIntegrity());\n\t }", "protected function prepareTestTableWithData()\n {\n $createTableSql = \"create table people (id INTEGER PRIMARY KEY AUTOINCREMENT, first_name TEXT NOT NULL, last_name TEXT NOT NULL)\";\n $statement = DatabaseManager::connection()->getPdo()->prepare($createTableSql);\n $statement->execute();\n\n $insertSql = \"insert into people (first_name,last_name) values ('john','doe'),('jane','doe')\";\n $statement = DatabaseManager::connection()->getPdo()->prepare($insertSql);\n $statement->execute();\n }", "public function testAddTransitionUpdatesTransitionNextStateWhenAddingTransitionWithSameStateSameSymbolAndOtherNextState(): void\n {\n $sut = new DFA(0);\n $sut->addTransition(0, 100, 1);\n $sut->addTransition(0, 100, 2);\n $sut->addSymbol(100);\n self::assertSame(2, $sut->getCurrentState());\n }", "function insert() {\n\t \t \n\t \t$sql = \"INSERT INTO evs_database.evs_expected_behavior (ept_expected_detail_en, ept_expected_detail_th, ept_pos_id, ept_kcp_id)\n\t \t\t\tVALUES(?, ?, ?, ?)\";\n\t \t$this->db->query($sql, array($this->ept_expected_detail_en, $this->ept_expected_detail_th, $this->ept_pos_id, $this->ept_kcp_id));\n\n\t }", "public function insert_datatables_state_save($insert_data)\n {\n $this->db->insert('datatables_state_save', $insert_data);\n \n return $this->db->insert_id(); \n }", "private function step_sync_table()\n {\n }", "public function test_transition_valid()\n\t{\n\t\t$sm = $this->get_statemachine_instance();\n\n\t\t$this->assertSame('pending', $sm->state());\n\n\t\t$sm->transition('active');\n\n\t\t$this->assertSame('active', $sm->state());\n\n\t\t$sm->transition('deleted');\n\n\t\t$this->assertSame('deleted', $sm->state());\n\t}", "public function testTransitionLead()\n {\n\n }", "private function _state_check()\n\t{\n\t\t// Setup State Table\n\t\tif(! $this->_ci->db->table_exists('CMS_State')) \n\t\t{\n\t\t\t$this->_ci->load->dbforge();\n\t\t\t\n\t\t\t$cols = array(\n\t\t\t\t'CMS_StateId' => array('type' => 'INT', 'constraint' => 9, 'unsigned' => TRUE, 'auto_increment' => TRUE),\t\t\t\n\t\t\t\t'CMS_StateName' => array('type' => 'VARCHAR', 'constraint' => '50', 'null' => FALSE),\n\t\t\t\t'CMS_StateValue' => array('type' => 'TEXT', 'null' => FALSE)\n\t\t\t);\n\t\t\t\n\t\t\t$this->_ci->dbforge->add_key('CMS_StateId', TRUE);\n \t$this->_ci->dbforge->add_field($cols);\n \t$this->_ci->dbforge->add_field(\"CMS_StateUpdatedAt TIMESTAMP DEFAULT now() ON UPDATE now()\");\n \t$this->_ci->dbforge->add_field(\"CMS_StateCreatedAt TIMESTAMP DEFAULT '0000-00-00 00:00:00'\");\n \t$this->_ci->dbforge->create_table('CMS_State', TRUE);\n }\t\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Map of relationships to permissions for dynamic inclusion.
public function getRelationshipPermissionMap(): array { return [ 'user' => 'users', 'payable' => 'dues-transactions', ]; }
[ "public function getRelationshipPermissionMap()\n {\n return [\n 'user' => 'users',\n 'package' => 'dues-packages',\n 'payment' => 'payments',\n 'user.teams' => 'teams-membership',\n ];\n }", "public function getRelationshipPermissionMap()\n {\n return [\n 'attendee' => 'users',\n 'recorded' => 'users',\n ];\n }", "public function getRelationshipPermissionMap()\n {\n return [\n 'creator' => 'users',\n 'template' => 'notification-templates',\n 'recipients' => 'recruiting-campaign-recipients',\n ];\n }", "public function getRelationshipPermissionMap(): array\n {\n return [\n 'recruitingResponses' => 'recruiting-responses',\n 'user' => 'users',\n ];\n }", "public function getRelationshipPermissionMap(): array\n {\n return [\n 'members' => 'read-teams-membership',\n 'attendance' => 'read-attendance',\n ];\n }", "public function getRelationshipPermissionMap()\n {\n return [\n 'transactions' => 'dues-transactions',\n ];\n }", "public function getMappingPermissions();", "public function permissions()\n\t{\n\t\treturn $this->manyShiftsToMany('Permission');\n\t}", "public function getRelationshipsInclusionMeta();", "public function permissions()\n\t{\n\t\treturn $this->has_many_and_belongs_to('Permission', 'user_permissions');\n\t}", "private function buildPermissionsMap()\n {\n $permissionsMap = [];\n $roles = $this->roles()->with('permissions')->get()->toArray();\n foreach ($roles as $role) {\n if (!empty($role['permissions'])) {\n foreach ($role['permissions'] as $permission) {\n $permissionsMap[] = $permission['name'];\n }\n }\n }\n return array_unique($permissionsMap);\n }", "public function permissions() {\n $permissions = [];\n $workflows = $this->workflowManager->getDefinitions();\n /* @var \\Drupal\\taxonomy\\Entity\\Vocabulary $vocabulary */\n foreach ($workflows as $workflow_id => $workflow) {\n foreach ($workflow['transitions'] as $transition_id => $transition) {\n $permissions['use ' . $transition_id . ' transition in ' . $workflow_id] = [\n 'title' => $this->t('Use the %label transition', [\n '%label' => $transition['label'],\n ]),\n 'description' => $this->t('Workflow group %label', [\n '%label' => $workflow['label'],\n ]),\n ];\n }\n }\n return $permissions;\n }", "protected function getPermissions()\n {\n return Permission::with('roles')->get();\n }", "public function permissions() {\n $permissions = [];\n // Permission of all node types.\n $permissions += [\n 'generate docx using node to docx' => [\n 'title' => t('Generate docx for <strong>all content types</strong>'),\n ],\n ];\n // Permissions of every node type.\n $types = NodeType::loadMultiple();\n foreach ($types as $key => $type) {\n $permissions += [\n 'generate docx using node to docx: ' . $type->get('type') => [\n 'title' => t('Generate docx for content type <strong>%type_name</strong>', ['%type_name' => $type->get('name')]),\n ],\n ];\n }\n\n return $permissions;\n }", "public function jointPermissions(): HasMany\n {\n return $this->hasMany(JointPermission::class);\n }", "public function jointPermissions()\n {\n return $this->hasMany(JointPermission::class);\n }", "public function permissions()\n {\n $pivotTable = config('permission.database.action_permissions_table');\n\n $relatedModel = config('permission.database.permissions_model');\n\n return $this->belongsToMany($relatedModel, $pivotTable, 'action_id', 'permission_id')->withTimestamps();\n }", "public function permissions() : BelongsToMany\n {\n return $this->morphToMany(Permission::class, 'model', 'model_has_permissions', 'model_id', 'permission_id');\n }", "public function getPermissionMap() {\n return $this->permissionMap;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Genero la ruta desde el id
private function generoRutaId($id) { $ruta_imagen=''; for ($f=0;$f<mb_strlen($id);$f++) { $ruta_imagen .=$id[$f] ."/"; } return $ruta_imagen; }
[ "public function constructId()\n {\n $stri_index=$this->stri_url;\n //construction de l'identifiant du menu\n $stri_index=strtr($stri_index,\".&=?/- \",\"_______\");\n \n return $stri_index;\n /* \n /// $stri_index=array_pop(get_included_files()); //génération de l'id basé sur le script appellant\n $arra_file=get_included_files();\n $stri_index=$arra_file[count($arra_file)-1];\n \n //$stri_index=crc32($stri_index);\n //$stri_index=crypt($stri_index,\"unesupergrandeclef\");\n //$stri_index=$stri_index.$stri_index.$stri_index; \n \n //construction de l'identifiant du menu\n $stri_index=strtr($stri_index,\" .&=?/-homecladivpw'\",\"_______phomecladiv8\"); //remplacement de caractère pour éviter de transmettre en claire un chemin du serveur\n $stri_index=substr($stri_index,0,75);//limitation de la taille de l'id au delà de laquel le js ne fonctionne plus\n \n return $stri_index;*/\n }", "final protected function genId(){\n\t\t$this->id = 'bele' . self::$ID_INDEX++;\n\t}", "function make_id(){\r\n\t\t// creer un hash\r\n\t\t$hash = $this->champ . $this->table . $this->sql;\r\n\t\t$this->_id = substr(md5($hash),0,6);\r\n\t}", "function notation_calculer_id($p){\n\t// on recupere le nom de la boucle \n\t$table = $p->boucles[$p->id_boucle]->id_table;\n\t$objet = objet_type($table);\n\t// on recupere le nom de la cle primaire de l'objet\n\t$_id_objet = $p->boucles[$p->id_boucle]->primary;\n\t$id_objet = champ_sql($_id_objet,$p);\n\t// pondre un identifiant !\n\treturn \"'$objet'.$id_objet.uniqid('-')\";\n}", "function genTathvaId(){\n\t\t$obj=new participant();\n\t\t$temp=$obj->getLastId();\n\t\t$temp=$temp+2002;\n\t\t$str='TAT'.\"$temp\";\n\t\treturn $str;\n\t}", "public function genero_id_turno()\n {\n $valor = valores_turno::orderBy('valor', 'DESC')->get()->pluck('valor')->first();\n\n if (empty($valor)) {\n $valor = 1;\n $inserto = valores_turno::create(['valor' => $valor]);\n } else {\n $valor = $valor + 1;\n $actualizo = valores_turno::where('id', 1)->update(['valor' => $valor]);\n }\n \n $id_usuario = Auth::user()->id;\n\n if (strlen($valor) == 1) {\n $valor = \"00000\" .$valor;\n } elseif (strlen($valor) == 2) {\n $valor = \"0000\" .$valor;\n } elseif (strlen($valor) == 3) {\n $valor = \"000\" .$valor;\n } elseif (strlen($valor) == 4) {\n $valor = \"00\" .$valor;\n } elseif (strlen($valor) == 5) {\n $valor = \"0\" .$valor;\n } elseif (strlen($valor) >= 6) {\n $valor = $valor;\n }\n\n $this->id_turno = $id_usuario. '-' .$valor;\n }", "function generarFolioPago() {\n include './conexion.php';\n $cons = $this->lastIdVenta(); //consecutivo de venta\n $key = $this->generarCodigo(6); //string de 6 numeros\n $folio = $key . '-' . $cons;\n $sql = \"INSERT INTO venta (folio) VALUES ('\" . strtoupper($folio) . \"')\";\n if ($conn->query($sql) === TRUE) {\n $last_id = $conn->insert_id; // devuelve el id de registro\n return $last_id;\n } else {\n echo \"Error: \" . $sql . \"<br>\" . $conn->error;\n }\n $conn->close();\n }", "function caricaRuolo($id) {\r\n\t\tglobal $database, $dati_db;\r\n\r\n\t\t$sql=\"SELECT * FROM \".$dati_db['prefisso'].\"etrasp_ruoli WHERE id=$id\";\r\n\t\tif ( !($risultato = $database->connessioneConReturn($sql)) ) {\r\n\t\t\tdie('Non posso caricare dati ruoli'.$sql);\r\n\t\t}\r\n\r\n\t\t$ente = $database->sqlArray($result);\r\n\r\n\t\treturn $ente;\r\n\r\n\t}", "function TourFromId( $id ) {\t\n\t$name = array();\n\t$name = ReadTourFiles();\n\t\n\t$retval = 'tour-' . $name[ $id ] . '.wtt';\n\n\treturn $retval;\n}", "public function CrearRuta($idruta) {\n\t\t$idPadre = $idruta;\n\t\t$ruta = \"\";\n\t\twhile ( $idPadre != Null ) {\n\t\t\t$recursopadre = $this->entityManager->getRepository ( Recurso::class )->findBy ( array ('idRecurso' => $idPadre \n\t\t\t) );\n\t\t\tif (is_array ( $recursopadre )) {\n\t\t\t\t$recursospadre = $recursopadre;\n\t\t\t} else\n\t\t\t\t$recursospadre [0] = $recursopadre;\n\t\t\tforeach ( $recursospadre as $recursopadre ) {\n\t\t\t\t$padre = $recursopadre->getIdRecursoPadre ();\n\t\t\t\t$nombre = $recursopadre->getRecurso ();\n\t\t\t\t$idPadre = $padre;\n\t\t\t\t$ruta = $nombre . \"/\" . $ruta;\n\t\t\t}\n\t\t\tif ($idPadre == '0') {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $ruta;\n\t}", "function toImageId($id) {\n return \"pendeltileid$id\";\n}", "public function idToPath($id);", "function caricaRuolo($id) {\n\t\tglobal $database, $dati_db;\n\n\t\t$sql=\"SELECT * FROM \".$dati_db['prefisso'].\"etrasp_ruoli WHERE id=$id\";\n\t\tif ( !($risultato = $database->connessioneConReturn($sql)) ) {\n\t\t\tdie('Non posso caricare dati ruoli'.$sql);\n\t\t}\n\n\t\t$ente = $database->sqlArray($result);\n\n\t\treturn $ente;\n\n\t}", "function genId(){\n\n\t\t$id_arr['IdCreator']=array('id'=>NULL);\n\t\t$this->create();\n\t\t$this->save($id_arr);\n\t\treturn $this->id;\n\n\t}", "function generate_id() {\r\n global $root, $cache;\r\n\r\n $last_id = $root->query(\"SELECT User FROM student ORDER BY `User` DESC LIMIT 1\");\r\n\r\n $id = $last_id[0]['User'] + 1;\r\n return $id;\r\n }", "public function generateIdSlug()\n {\n $this->setSlugValue(Slug::fromId($this->getKey()));\n }", "public function traerPorId($id)\n {\n }", "public function generatenewidTransaksi()\n {\n \t// mengambil seluruh isi tabel\n $temp = $this->findAll();\n // mengambil row terakhir \n $last = end($temp); \n\n // jika $last kosong (jika tabel masih kosong)\n if ($last == Null){\n // mengenerate id baru dengan nilai 1\n $new_id = 1;\n }else{\n // mengenerate id baru dengan nilai id terakhir + 1\n $new_id = $last['id_transaksi']+1;\n }\n\n // mengembalikan nilai \n return $new_id;\n }", "public function buscarId( ){\n\t\t$sql = \"SELECT DISTINCT U.idusuario, U.nombres, U.apellidos, U.usuario, R.idrol, R.nombrerol\n\t\t\t\tFROM usuario U\n\t\t\t\tINNER JOIN usuariofacultad UF ON ( UF.usuario = U.usuario )\n\t\t\t\tINNER JOIN UsuarioTipo UT ON (UT.UsuarioId = U.idusuario)\n INNER JOIN usuariorol UR ON (UR.idusuariotipo = UT.UsuarioTipoId)\n\t\t\t\tINNER JOIN rol R ON ( R.idrol = UR.idrol )\n\t\t\t\tWHERE U.idusuario = ?\n\t\t\t\tAND U.codigorol = 13\";\n\t\t\t\t\n\t\t$this->persistencia->crearSentenciaSQL( $sql );\n\t\t$this->persistencia->setParametro( 0 , $this->getId( ) , false );\n\t\t$this->persistencia->ejecutarConsulta( );\n\t\tif( $this->persistencia->getNext( ) ){\n\t\t\t$this->setId( $this->persistencia->getParametro( \"idusuario\" ) );\n\t\t\t$this->setNombres( $this->persistencia->getParametro( \"nombres\" ) );\n\t\t\t$this->setApellidos( $this->persistencia->getParametro( \"apellidos\" ) );\n\t\t\t$this->setUser( $this->persistencia->getParametro( \"usuario\" ) );\n\t\t\t\n\t\t\t$rol = new Rol( null );\n\t\t\t$rol->setId( $this->persistencia->getParametro( \"idrol\" ) );\n\t\t\t$rol->setNombre( $this->persistencia->getParametro( \"nombrerol\" ) );\n\t\t\t$this->setRol( $rol );\n\t\t}\n\t\t//echo $this->persistencia->getSQLListo( );\n\t\t$this->persistencia->freeResult( );\n\t\t\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filter the query on the ArstSale24mo13 column Example usage: $query>filterByArstsale24mo13(1234); // WHERE ArstSale24mo13 = 1234 $query>filterByArstsale24mo13(array(12, 34)); // WHERE ArstSale24mo13 IN (12, 34) $query>filterByArstsale24mo13(array('min' => 12)); // WHERE ArstSale24mo13 > 12
public function filterByArstsale24mo13($arstsale24mo13 = null, $comparison = null) { if (is_array($arstsale24mo13)) { $useMinMax = false; if (isset($arstsale24mo13['min'])) { $this->addUsingAlias(CustomerShiptoTableMap::COL_ARSTSALE24MO13, $arstsale24mo13['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($arstsale24mo13['max'])) { $this->addUsingAlias(CustomerShiptoTableMap::COL_ARSTSALE24MO13, $arstsale24mo13['max'], Criteria::LESS_EQUAL); $useMinMax = true; } if ($useMinMax) { return $this; } if (null === $comparison) { $comparison = Criteria::IN; } } return $this->addUsingAlias(CustomerShiptoTableMap::COL_ARSTSALE24MO13, $arstsale24mo13, $comparison); }
[ "function setRevenueFilter($min) {\n $this->WHERE['rev_avg >= '] = $min;\n }", "public function filterByArstinv24mo11($arstinv24mo11 = null, $comparison = null)\n {\n if (is_array($arstinv24mo11)) {\n $useMinMax = false;\n if (isset($arstinv24mo11['min'])) {\n $this->addUsingAlias(CustomerShiptoTableMap::COL_ARSTINV24MO11, $arstinv24mo11['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($arstinv24mo11['max'])) {\n $this->addUsingAlias(CustomerShiptoTableMap::COL_ARSTINV24MO11, $arstinv24mo11['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(CustomerShiptoTableMap::COL_ARSTINV24MO11, $arstinv24mo11, $comparison);\n }", "public function filterByArcusale24mo23($arcusale24mo23 = null, $comparison = null)\n {\n if (is_array($arcusale24mo23)) {\n $useMinMax = false;\n if (isset($arcusale24mo23['min'])) {\n $this->addUsingAlias(CustomerTableMap::COL_ARCUSALE24MO23, $arcusale24mo23['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($arcusale24mo23['max'])) {\n $this->addUsingAlias(CustomerTableMap::COL_ARCUSALE24MO23, $arcusale24mo23['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(CustomerTableMap::COL_ARCUSALE24MO23, $arcusale24mo23, $comparison);\n }", "public function filterByArstsale24mo7($arstsale24mo7 = null, $comparison = null)\n {\n if (is_array($arstsale24mo7)) {\n $useMinMax = false;\n if (isset($arstsale24mo7['min'])) {\n $this->addUsingAlias(CustomerShiptoTableMap::COL_ARSTSALE24MO7, $arstsale24mo7['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($arstsale24mo7['max'])) {\n $this->addUsingAlias(CustomerShiptoTableMap::COL_ARSTSALE24MO7, $arstsale24mo7['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(CustomerShiptoTableMap::COL_ARSTSALE24MO7, $arstsale24mo7, $comparison);\n }", "public function filterByArstsalemtd($arstsalemtd = null, $comparison = null)\n {\n if (is_array($arstsalemtd)) {\n $useMinMax = false;\n if (isset($arstsalemtd['min'])) {\n $this->addUsingAlias(ArShipToTableMap::COL_ARSTSALEMTD, $arstsalemtd['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($arstsalemtd['max'])) {\n $this->addUsingAlias(ArShipToTableMap::COL_ARSTSALEMTD, $arstsalemtd['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ArShipToTableMap::COL_ARSTSALEMTD, $arstsalemtd, $comparison);\n }", "public function filterByArstinv24mo5($arstinv24mo5 = null, $comparison = null)\n {\n if (is_array($arstinv24mo5)) {\n $useMinMax = false;\n if (isset($arstinv24mo5['min'])) {\n $this->addUsingAlias(CustomerShiptoTableMap::COL_ARSTINV24MO5, $arstinv24mo5['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($arstinv24mo5['max'])) {\n $this->addUsingAlias(CustomerShiptoTableMap::COL_ARSTINV24MO5, $arstinv24mo5['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(CustomerShiptoTableMap::COL_ARSTINV24MO5, $arstinv24mo5, $comparison);\n }", "public function filterByArstinv24mo19($arstinv24mo19 = null, $comparison = null)\n {\n if (is_array($arstinv24mo19)) {\n $useMinMax = false;\n if (isset($arstinv24mo19['min'])) {\n $this->addUsingAlias(CustomerShiptoTableMap::COL_ARSTINV24MO19, $arstinv24mo19['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($arstinv24mo19['max'])) {\n $this->addUsingAlias(CustomerShiptoTableMap::COL_ARSTINV24MO19, $arstinv24mo19['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(CustomerShiptoTableMap::COL_ARSTINV24MO19, $arstinv24mo19, $comparison);\n }", "public function filterBySalesmth13($salesmth13 = null, $comparison = null)\n {\n if (is_array($salesmth13)) {\n $useMinMax = false;\n if (isset($salesmth13['min'])) {\n $this->addUsingAlias(SaleschartTableMap::COL_SALESMTH13, $salesmth13['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($salesmth13['max'])) {\n $this->addUsingAlias(SaleschartTableMap::COL_SALESMTH13, $salesmth13['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SaleschartTableMap::COL_SALESMTH13, $salesmth13, $comparison);\n }", "public function filterByArcusale24mo22($arcusale24mo22 = null, $comparison = null)\n {\n if (is_array($arcusale24mo22)) {\n $useMinMax = false;\n if (isset($arcusale24mo22['min'])) {\n $this->addUsingAlias(CustomerTableMap::COL_ARCUSALE24MO22, $arcusale24mo22['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($arcusale24mo22['max'])) {\n $this->addUsingAlias(CustomerTableMap::COL_ARCUSALE24MO22, $arcusale24mo22['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(CustomerTableMap::COL_ARCUSALE24MO22, $arcusale24mo22, $comparison);\n }", "public function filterByArcusale24mo1($arcusale24mo1 = null, $comparison = null)\n {\n if (is_array($arcusale24mo1)) {\n $useMinMax = false;\n if (isset($arcusale24mo1['min'])) {\n $this->addUsingAlias(CustomerTableMap::COL_ARCUSALE24MO1, $arcusale24mo1['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($arcusale24mo1['max'])) {\n $this->addUsingAlias(CustomerTableMap::COL_ARCUSALE24MO1, $arcusale24mo1['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(CustomerTableMap::COL_ARCUSALE24MO1, $arcusale24mo1, $comparison);\n }", "public function filterBySalesmth24($salesmth24 = null, $comparison = null)\n {\n if (is_array($salesmth24)) {\n $useMinMax = false;\n if (isset($salesmth24['min'])) {\n $this->addUsingAlias(SaleschartTableMap::COL_SALESMTH24, $salesmth24['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($salesmth24['max'])) {\n $this->addUsingAlias(SaleschartTableMap::COL_SALESMTH24, $salesmth24['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SaleschartTableMap::COL_SALESMTH24, $salesmth24, $comparison);\n }", "public function filterByShowlat($showlat = null, $comparison = null)\n\t{\n\t\tif (is_array($showlat)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($showlat['min'])) {\n\t\t\t\t$this->addUsingAlias(Stops2011Peer::SHOWLAT, $showlat['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($showlat['max'])) {\n\t\t\t\t$this->addUsingAlias(Stops2011Peer::SHOWLAT, $showlat['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(Stops2011Peer::SHOWLAT, $showlat, $comparison);\n\t}", "public function filterByLatitude($latitude = null, $comparison = null)\n\t{\n\t\tif (is_array($latitude)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($latitude['min'])) {\n\t\t\t\t$this->addUsingAlias(Stops2011Peer::LATITUDE, $latitude['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($latitude['max'])) {\n\t\t\t\t$this->addUsingAlias(Stops2011Peer::LATITUDE, $latitude['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(Stops2011Peer::LATITUDE, $latitude, $comparison);\n\t}", "public function filterByEan13($ean13 = null, $comparison = null)\n\t{\n\t\tif (null === $comparison) {\n\t\t\tif (is_array($ean13)) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t} elseif (preg_match('/[\\%\\*]/', $ean13)) {\n\t\t\t\t$ean13 = str_replace('*', '%', $ean13);\n\t\t\t\t$comparison = Criteria::LIKE;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(Oops_Db_ProductPeer::EAN13, $ean13, $comparison);\n\t}", "public function filterByIdManufacturer($idManufacturer = null, $comparison = null)\n\t{\n\t\tif (is_array($idManufacturer)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idManufacturer['min'])) {\n\t\t\t\t$this->addUsingAlias(Oops_Db_ProductPeer::ID_MANUFACTURER, $idManufacturer['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($idManufacturer['max'])) {\n\t\t\t\t$this->addUsingAlias(Oops_Db_ProductPeer::ID_MANUFACTURER, $idManufacturer['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(Oops_Db_ProductPeer::ID_MANUFACTURER, $idManufacturer, $comparison);\n\t}", "private static function priceFilter($array, $arguments) {\n $r_array = array();\n \n foreach($array as $entry) {\n if($entry->Price >= $arguments[0] && $entry->Price <= $arguments[1])\n array_push($r_array, $entry);\n }\n \n return $r_array;\n }", "public function archiveFilter()\n\t{\n\t\tif(!$this->Input->get('archive')) return;\n\n\t\tif(preg_match(\"~^\\d{4}$~\",$this->Input->get('archive')))\n\t\t{\n\t\t\t// filter for year\n\t\t\t$year = $this->Input->get('archive');\n\t\t\treturn array\n\t\t\t(\n\t\t\t\t'where' => 'YEAR(FROM_UNIXTIME(tl_news4ward_article.start)) = ?',\n\t\t\t\t'values' => array($year)\n\t\t\t);\n\t\t}\n\t\telseif(preg_match(\"~^\\d{4}-\\d{1,2}$~\",$this->Input->get('archive')))\n\t\t{\n\t\t\t// filter for year and month\n\t\t\tlist($year,$month) = explode('-',$this->Input->get('archive'));\n\t\t\treturn array\n\t\t\t(\n\t\t\t\t'where' => 'YEAR(FROM_UNIXTIME(tl_news4ward_article.start)) = ? AND MONTH(FROM_UNIXTIME(tl_news4ward_article.start)) = ?',\n\t\t\t\t'values' => array($year, $month)\n\t\t\t);\n\t\t}\n\n\t\treturn;\n\t}", "function filterBy_S_A_F_E($SEDE, $AREA, $FACULTAD, $ESCUELA,$TABLE_I)\n{\n global $mysqli;\n $TINS = $TABLE_I;\n $query = new Query($mysqli, \"SELECT red,nombre,apellido,CONCAT(provincia,'-',clave,'-',tomo,'-',folio)AS cedula,n_ins,sede,fac_ia,esc_ia,car_ia,fac_iia,esc_iia,car_iia,fac_iiia,esc_iiia,car_iiia\n FROM \" .$TINS. \" where sede = ? AND area_i = ? AND fac_ia = ? AND esc_ia = ? \");\n $parametros = array(\"iiii\", &$SEDE, &$AREA, &$FACULTAD, &$ESCUELA);\n $data = $query->getresults($parametros);\n\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}", "private function price_filter_meta_query() {\n\t\tif ( isset( $_GET['max_price'] ) || isset( $_GET['min_price'] ) ) { // WPCS: input var ok, CSRF ok.\n\t\t\t$meta_query = wc_get_min_max_price_meta_query( $_GET ); // WPCS: input var ok, CSRF ok.\n\t\t\t$meta_query['price_filter'] = true;\n\n\t\t\treturn $meta_query;\n\t\t}\n\n\t\treturn array();\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the feedback fields to be sent to the API, if set
public function getFeedbackFields() { return $this->feedbackFields; }
[ "public function getFeedback()\n {\n return isset($this->data['feedback']) ? $this->data['feedback'] : $this->getData('feedback');\n }", "function getFeedback()\n\t{\n\t\treturn $this->feedback;\n\t}", "public function feedback(){ return $this->feedback; }", "public function getProvideFeedback()\n {\n return $this->provide_feedback;\n }", "public function getFeedbackOptions() {\n $feedback_options = array();\n\n $entity_info = entity_get_info('quiz_question_entity');\n foreach ($entity_info['view modes'] as $view_mode => $info) {\n if ($view_mode !== 'full' && $info['custom settings']) {\n $feedback_options[\"quiz_question_view_{$view_mode}\"] = t('Question') . ': ' . $info['label'];\n }\n }\n\n $feedback_options += array(\n 'attempt' => t('Attempt'),\n 'choice' => t('Choices'),\n 'correct' => t('Whether correct'),\n 'score' => t('Score'),\n 'answer_feedback' => t('Answer feedback'),\n 'question_feedback' => t('Question feedback'),\n 'solution' => t('Correct answer'),\n 'quiz_feedback' => t('@quiz feedback', array('@quiz' => QUIZZ_NAME)),\n );\n\n drupal_alter('quiz_feedback_options', $feedback_options);\n\n return $feedback_options;\n }", "public function getFeedbacks()\n {\n return $this->extract($this->fetch());\n }", "public function getAnswerFeedback()\n {\n return $this->answer_feedback;\n }", "public function getFeedbackResponse()\n {\n return $this->feedbackResponse;\n }", "final private function action_fields() {\n\t\techo json_encode( array(\n\t\t\t'fields' => $this->_fields,\n\t\t\t'required' => $this->_required,\n\t\t));\n\t}", "private function get_api_fields() {\n\t\treturn array(\n\t\t\t'short_description' => true,\n\t\t\t'active_installs' => true,\n\t\t\t'icons' => true,\n\t\t\t'sections' => false,\n\t\t);\n\t}", "function feedbackFields(): array\n{\n return Feedback::getFieldNames();\n}", "protected function get_format_parameters_for_presentation() {\n return [\n 'component' => 'mod_feedback',\n 'filearea' => 'item',\n 'itemid' => $this->data->id\n ];\n }", "public function FeedbackForm()\n {\n if ($this->Order()) {\n if ($this->IsFeedbackEnabled) {\n return OrderFormFeedback::create($this, 'FeedbackForm', $this->currentOrder);\n }\n\n return [];\n }\n\n return null;\n }", "public function feedback(){ \n\t\t$this->layout = 'iframe_dash'; \n\t\tif (!empty($this->request->data)){ \t\t\t\n\t\t$vars = array('from' => ucfirst($this->Session->read('USER.Login.first_name')).' '.ucfirst($this->Session->read('USER.Login.last_name')), 'feedback' => $this->request->data['Home']['feedback']);\n\t\t// notify superiors\t\t\t\t\t\t\n\t\tif(!$this->send_email('My PDCA - '.ucfirst($this->Session->read('USER.Login.first_name')).' '.ucfirst($this->Session->read('USER.Login.last_name')).' submitted feedback!', 'feedback_request', $this->Session->read('USER.Login.email_address'), 'helpdesk@career-tree.in',$vars)){\t\t\n\t\t\t// show the msg.\t\t\t\t\t\t\t\t\n\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>Problem in sending mail...', 'default', array('class' => 'alert alert-error'));\t\t\t\t\n\t\t}else{\t\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$this->set('feedback_submit', 1);\n\t\t}\n\t\t\n\t\t\n\t}", "public static function getSessionFields() {\n\t\t$fields = self::getMessageFields();\n\t\t$fields[] = 'order_id';\n\t\t$fields[] = 'appeal';\n\t\t$fields[] = 'processor_form';\n\t\t$fields[] = 'referrer';\n\t\t$fields[] = 'contact_id';\n\t\t$fields[] = 'contact_hash';\n\t\treturn $fields;\n\t}", "public function getDotmailerContactFields() {\n return $this->resources->GetDataFields();\n }", "function get_feedback_data(){\n\t\t$task_id = $this->input->post('field_id');\n\t\t$query = $this->InteractModal->feedback_status($task_id );\n\t\tif(!empty($query)){\n\t\t\tforeach($query as $queries){\n\t\t\t\t$price_opinion = $queries['price_opinion'];\n\t\t\t\t$interest_opinion = $queries['interest_opinion'];\n\t\t\t\t$property_quality = $queries['property_quality'];\n\t\t\t\t$showing_id = $queries['showing_id'];\n\t\t\t\t$details = $queries['details'];\n\t\t\t\t$feedback_detail = @unserialize( $details );\n\t\t\t\t$agent_name=$feedback_detail['user_name'];\n\t\t\t}\n\t\t\t$data['agent_name']= $agent_name;\n\t\t\t$data['price_opinion']= $price_opinion;\n\t\t\t$data['interest_opinion']= $interest_opinion;\n\t\t\t$data['property_quality']= $property_quality;\n\t\t $this->load->view('common/feedback_content',$data); \n\t\t}\n\t}", "function getRequestOnlyField() {\n return [\n 'api_key',\n 'user_id',\n 'order_id',\n 'product_id',\n 'first_name',\n 'last_name',\n 'address',\n 'sulte_apt_no',\n 'country',\n 'state',\n 'city',\n 'zip',\n 'ip_address',\n 'birth_date',\n 'email',\n 'phone_no',\n 'card_type',\n 'amount',\n 'currency',\n 'card_no',\n 'ccExpiryMonth',\n 'ccExpiryYear',\n 'cvvNumber',\n 'is_recurring',\n 'is_reccuring_date',\n 'shipping_first_name',\n 'shipping_last_name',\n 'shipping_address',\n 'shipping_country',\n 'shipping_state',\n 'shipping_city',\n 'shipping_zip',\n 'shipping_email',\n 'shipping_phone_no',\n 'payment_gateway_id',\n 'resubmit_transaction',\n 'descriptor',\n 'is_converted',\n 'converted_amount',\n 'converted_currency',\n 'is_converted_user_currency',\n 'converted_user_amount',\n 'converted_user_currency',\n 'is_batch_transaction',\n 'batch_transaction_counter',\n 'old_order_no',\n 'website_url_id',\n 'request_from_ip',\n 'request_origin',\n 'is_request_from_vt',\n 'response_url',\n 'redirect_url_success',\n 'redirect_url_fail',\n 'is_2ds',\n ];\n}", "public function getFeedbackList() {\n\t\t\t$result = $this->db->select(['id', 'name', 'email', 'feedback'])\n\t\t\t\t\t\t\t ->from('feedback')\n\t\t\t\t\t\t\t ->get();\n\t\t\treturn $result->result();\n\t\t\t\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks to see whether settings.php exists and creates it if it does not.
public function ensureSettingsFileExists() { $settingsFilePath = $this['site.directory'] . '/settings.php'; // Ensure the site folder exists. $this['system']->ensureFolderExists($this['site.directory']); // We need to ensure any plugin that wants to add configuration has a chance to do so. // Running this evaluates all plugin constructors. $this->exportConfiguration(); $compiler = new SettingsPHPGenerator(); $compiler->set('iniSettings', $this['settings_php.ini_set']); $compiler->set('variables', $this['settings_php.variables']); $compiler->set('snippets', $this['settings_php.snippets']); $compiler->set('requires', $this['settings_php.requires']); // If we have a site-settings.php file for this site, add it. if ($this['system']->isFile($this['site.directory'] . '/site-settings.php')) { $requires = $compiler->get('requires'); $requires[] = 'sites/' . $this['site'] . '/site-settings.php'; $compiler->set('requires', $requires); } $this['system']->writeFile($settingsFilePath, $compiler->compile()); }
[ "public function createSettingsIfMissing()\n {\n $settings_file = $this->getSettingFilePath();\n $fs = new Filesystem();\n if (!$fs->exists($settings_file)) {\n $fs->copy(DRUPAL_ROOT . '/sites/default/default.settings.php', $settings_file);\n }\n }", "public function populateSettingsFile()\n {\n $root = $this->getDrupalRootPath();\n\n // Assume Drupal scaffold created the settings.php\n $this->filesystem->chmod($root . '/sites/default/settings.php', 0664);\n\n // If we haven't already written to settings.php.\n if (!(strpos(file_get_contents($root . '/sites/default/settings.php'), 'START SHEPHERD CONFIG') !== false)) {\n // Append Shepherd-specific environment variable settings to settings.php.\n file_put_contents(\n $root.'/sites/default/settings.php',\n $this->generateSettings(),\n FILE_APPEND\n );\n }\n }", "function settingsFile() {\n \n // Assign properties to variables\n $company = self::$company;\n $domain = self::$domain;\n $support = self::$support;\n $host = self::$host;\n $name = self::$name;\n $user = self::$user;\n $pass = self::$pass;\n \n \n // Write the settings.json file\n $in\t\t\t= __DIR__.'/settings/settings.json';\n\t $make\t\t= fopen($in, 'w') or die(\"<b>Error creating settings file! Are settings folder permissions 777?</b><br>\");\n\t $inject\t= \"\n\t \n {\n\n \\\"company-name\\\" : \\\"$company\\\",\n \\\"domain-name\\\" : \\\"$domain\\\",\n \\\"support-email\\\" : \\\"$support\\\",\n\n \\\"db-host\\\" : \\\"$host\\\",\n \\\"db-name\\\" : \\\"$name\\\",\n \\\"db-user\\\" : \\\"$user\\\",\n \\\"db-pass\\\" : \\\"$pass\\\"\n \n }\n\t \n \";\n\t\n\t fwrite($make, $inject);\n\t fclose($make);\n\t \n\t return true;\n \n }", "protected function ensureSettingsCreated()\n {\n if (null === $this->settings) {\n $this->settings = new Settings();\n }\n }", "protected function generateSettingsEnv() {\n $template = sprintf(\n '%sdefault.settings.%s.php',\n $this->getSiteRoot(),\n $this->getEnv()\n );\n\n $destination = sprintf(\n '%ssettings.%s.php',\n $this->getSiteRoot(),\n $this->getEnv()\n );\n\n if (file_exists($template)) {\n // Remove existing file.\n if ($this->fileExists($destination)) {\n $this->fileUnlink($destination);\n }\n\n // Copy the template into web/sites/[site name].\n copy($template, $destination);\n\n if ($this->fileExists($destination)) {\n $this->io->success(sprintf('Generated %s',\n $destination)\n );\n }\n else {\n throw new CommandException(sprintf('Error generating %s',\n $destination\n )\n );\n }\n }\n }", "function check_config_file() {\n\tif (!file_exists(BASEPATH.'vce-config.php') && file_exists(BASEPATH.'vce-config-sample.php')) {\n\t\t$GLOBALS['using_config_sample'] = TRUE;\n\t\ttouch(BASEPATH.'vce-config.php');\n\t} elseif (!file_exists(BASEPATH.'vce-config.php') && !file_exists(BASEPATH.'vce-config-sample.php')) {\n\t\ttouch(BASEPATH.'vce-config.php');\n\t} else {\n\t\t$GLOBALS['config_file_exists'] = TRUE;\n\t}\n}", "function _check() {\n if (file_exists(CONFIGS . 'settings.yml')) {\n $this->Session->setFlash('Already Installed');\n $this->redirect('/');\n }\n }", "private function makeUserSettings()\n\t\t{\n\n\t\t\tif( FileSystem::exists( self::fileLocation( \"settings.json\") ) == false )\n\t\t\t\tthrow new \\Error(\"file does not exist: \" . self::fileLocation( \"settings.json\" ) );\n\n\t\t\tif( Debug::isCMD() )\n\t\t\t\tDebug::message(\"created user_settings.json using default settings value \" );\n\n\t\t\t$data = FileSystem::read( self::fileLocation( \"settings.json\") );\n\t\t\tFileSystem::write( self::fileLocation(), $data );\n\t\t}", "private function handleCreatedSettings()\n\t{\n\t\tforeach ($this->createdSettings[static::DEFAULT_SETTING_KEY] as $key => $createdDefaultSetting) {\n\t\t\t$setting = $this->settingsModel->create([\n\t\t\t\t'package' => $createdDefaultSetting['package'],\n\t\t\t\t'name' => $createdDefaultSetting['name'],\n\t\t\t]);\n\n\t\t\t$setting->values()->create(['value' => $createdDefaultSetting['value']]);\n\n\t\t\tunset($this->createdSettings[static::DEFAULT_SETTING_KEY][$key]);\n\t\t}\n\n\t\tif (($user = $this->guard->user()) !== null && $user->getAuthIdentifier() > 0) {\n\t\t\tforeach ($this->createdSettings[static::USER_SETTING_KEY] as $key => $createdDefaultSetting) {\n\t\t\t\t$setting = $this->settingsModel->create([\n\t\t\t\t\t'package' => $createdDefaultSetting['package'],\n\t\t\t\t\t'name' => $createdDefaultSetting['name'],\n\t\t\t\t]);\n\n\t\t\t\t$setting->values()->create([\n\t\t\t\t\t'value' => $createdDefaultSetting['value'],\n\t\t\t\t\t'user_id' => $user->getAuthIdentifier()\n\t\t\t\t]);\n\n\t\t\t\tunset($this->createdSettings[static::USER_SETTING_KEY][$key]);\n\t\t\t}\n\t\t}\n\t}", "protected function ensureGlobalSettingsFile() {\n $global_settings_path = $this->getConfigValue('docroot') . '/sites/settings/global.settings.php';\n if (!file_exists($global_settings_path)) {\n // Check whether default.global.settings.php exists in the docroot.\n $default_global_settings_path = $this->getConfigValue('docroot') . '/sites/settings/default.global.settings.php';\n\n if (!file_exists($default_global_settings_path)) {\n // If default file not in docroot, provide prompt to user to build the\n // settings files.\n $filepath = $this->getInspector()\n ->getFs()\n ->makePathRelative($this->getConfigValue('docroot') . \"/sites/settings\", $this->getConfigValue('repo.root'));\n $this->say(sprintf('The default.global.settings.php file does not exist in %s. You may need to run blt source:build:settings.', $filepath));\n $confirm = $this->confirm('Should BLT attempt to run that now? This may overwrite files.');\n if ($confirm) {\n // Set a flag to FALSE, so that in the post-command hook for\n // source:build:settings, users will not be prompted to add services\n // since already in process of adding them.\n // @see ::promptUserToAddServices()\n static::$askToAddServicesToSettings = FALSE;\n $this->invokeCommand('source:build:settings');\n static::$askToAddServicesToSettings = TRUE;\n }\n else {\n throw new BltException('Unable to create global.settings.php file.');\n }\n }\n\n // Copy the default global settings file to global.settings.php.\n $result = $this->taskFilesystemStack()\n ->copy($default_global_settings_path, $global_settings_path)\n ->setVerbosityThreshold(VerbosityThresholdInterface::VERBOSITY_VERBOSE)\n ->run();\n\n if (!$result->wasSuccessful()) {\n throw new BltException('Unable to create global.settings.php file.');\n }\n }\n\n return $global_settings_path;\n }", "private function __setupConfigFiles() {\n\t\t$this->__logMessage('Setting up config files');\n\t\t$this->__pushLogIndent();\n\n\t\t$configPath = '../../../app/Config/';\n\n\t\t$__settings = $this->__settings;\n\n\t\t// ... Not that I'm OCD or anything\n\t\tasort($__settings);\n\n\t\t// Create each of the config files\n\t\tforeach ($__settings as $settingName => $settingData) {\n\t\t\t// First check for dev/production templates\n\t\t\t$templateFilePath = makeAbsolutePath(\"../Settings/$settingName.{$this->__environmentType}.template\");\n\t\t\tif (!file_exists($templateFilePath)) {\n\t\t\t\t// Fall back to the regular template\n\t\t\t\t$templateFilePath = makeAbsolutePath(\"../Settings/$settingName.template\");\n\n\t\t\t\tif (!file_exists($templateFilePath)) {\n\t\t\t\t\t$fullFilePath = makeAbsolutePath(\"$configPath$settingName.php\");\n\t\t\t\t\tif (file_exists($fullFilePath)) {\n\t\t\t\t\t\t$this->__logMessage(\"Deleting __settings file at $fullFilePath because we couldn't find a matching template\");\n\t\t\t\t\t\tunlink($fullFilePath);\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$currentContents = file_get_contents($templateFilePath);\n\t\t\t$newContents = $this->__replaceFields($currentContents, $settingData);\n\n\t\t\tif (file_put_contents(\"$configPath$settingName.php\", $newContents) !== false) {\n\t\t\t\t$this->__logMessage(\"Created $settingName.php from template $templateFilePath\");\n\t\t\t} else {\n\t\t\t\t$this->__logMessage(\"Failed to create $settingName.php\");\n\t\t\t}\n\t\t}\n\n\t\t$this->__popLogIndent();\n\t}", "protected function updateHtAccessFile()\n {\n $htaccess_file = get_home_path() . '.htaccess';\n if ($this->createIfNotExist($htaccess_file) === false) {\n $this->addSettingsMessage(sprintf(__('%s does not exists or is not writable.', self::TEXT_DOMAIN), $htaccess_file));\n return;\n }\n $section = $this->getSettingsAsArray();\n $this->addSettingsMessage(__('Settings updated and stored in .htaccess', self::TEXT_DOMAIN), 'updated');\n self::addMarker($htaccess_file, 'CUSTOM PHP SETTINGS', $section);\n }", "private function check_wp_settings() {\r\n\t\t// WP_CACHE is already defined.\r\n\t\tif ( defined( 'WP_CACHE' ) && WP_CACHE ) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\t// Only add an error, do not return false, or page caching will not be activated.\r\n\t\t\t$this->error = new WP_Error(\r\n\t\t\t\t'no-wp-cache-constant',\r\n\t\t\t\t__( \"Hummingbird could not locate the WP_CACHE constant in wp-config.php file for WordPress. Please make sure the following line is added to the file: <br><code>define('WP_CACHE', true);</code>\", 'wphb' )\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\t$config_file = ABSPATH . 'wp-config.php';\r\n\r\n\t\t// Could not find the file.\r\n\t\tif ( ! file_exists( $config_file ) ) {\r\n\t\t\t$this->error = new WP_Error(\r\n\t\t\t\t'no-wp-config-file',\r\n\t\t\t\t__( \"Hummingbird could not locate the wp-config.php file for WordPress. Please make sure the following line is added to the file: <br><code>define('WP_CACHE', true);</code>\", 'wphb' )\r\n\t\t\t);\r\n\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// wp-config.php is not writable.\r\n\t\tif ( ! is_writable( $config_file ) || ! is_writable( dirname( $config_file ) ) ) {\r\n\t\t\t$this->error = new WP_Error(\r\n\t\t\t\t'wp-config-not-writable',\r\n\t\t\t\t__( \"Hummingbird could not write to the wp-config.php file. Please add the following line to the file manually: <br><code>define('WP_CACHE', true);</code>\", 'wphb' )\r\n\t\t\t);\r\n\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}", "private function createConfigFile(): void\n {\n if (!file_exists($this->getModulePath() . '/config.php')) {\n $configFile = fopen($this->getModulePath() . '/config.php', 'a+');\n $content = require __DIR__ . '/templates/config.php';\n fputs($configFile, $content);\n fclose($configFile);\n }\n }", "function create_settings_file()\n\t{\n\t\t$settings = array(\n\t\t\t'db_name' => $this->sets['db_name'],\n\t\t\t'db_pass' => $this->sets['db_pass'],\n\t\t\t'db_user' => $this->sets['db_user'],\n\t\t\t'db_host' => $this->sets['db_host'],\n\t\t\t'db_port' => $this->sets['db_port'],\n\t\t\t'db_socket' => $this->sets['db_socket'],\n\t\t\t'dbtype' => $this->sets['dbtype'],\n\t\t\t'installed' => $this->sets['installed'],\n\t\t\t'admin_email' => $this->sets['admin_email']\n\t\t\t);\n\t\t\t\t\n\t\t$file = \"<?php\nif (!defined('PDNSADMIN')) {\n header('HTTP/1.0 403 Forbidden');\n die;\n}\n\n\\$set = array();\n\n\";\n\t\tforeach ($settings as $set => $val)\n\t\t{\n\t\t\t$file .= \"\\$set['$set'] = '\" . str_replace(array('\\\\', '\\''), array('\\\\\\\\', '\\\\\\''), $val) . \"';\\n\";\n\t\t}\n\n\t\t$file .= '?' . '>';\n\t\treturn $file;\n\t}", "private function createConfigForSettings()\n\t{\n\t\t// Get some default values\n\t\tconfig()->set('settings.app.purchase_code', config('larapen.core.purchaseCode'));\n\t\t\n\t\t// Check DB connection and catch it\n\t\ttry {\n\t\t\t// Get all settings from the database\n\t\t\t$settings = Cache::remember('settings.active', $this->cacheExpiration, function () {\n\t\t\t\t$settings = Setting::where('active', 1)->get();\n\t\t\t\t\n\t\t\t\treturn $settings;\n\t\t\t});\n\t\t\t\n\t\t\t// Bind all settings to the Laravel config, so you can call them like\n\t\t\tif ($settings->count() > 0) {\n\t\t\t\tforeach ($settings as $setting) {\n\t\t\t\t\tif (is_array($setting->value) && count($setting->value) > 0) {\n\t\t\t\t\t\tforeach ($setting->value as $subKey => $value) {\n\t\t\t\t\t\t\tif (!empty($value)) {\n\t\t\t\t\t\t\t\tconfig()->set('settings.' . $setting->key . '.' . $subKey, $value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (\\Exception $e) {\n\t\t\tconfig()->set('settings.error', true);\n\t\t\tconfig()->set('settings.app.logo', config('larapen.core.logo'));\n\t\t}\n\t}", "static private function isConfigFileExists() {\n if (file_exists('config.php')) {\n return true;\n } else {\n \n }\n }", "public function it_updates_exisiting_setting_if_already_exists()\n {\n $this->settingStorage->set('app_name', 'QCode');\n $this->assertDatabaseHas('settings', ['name' => 'app_name', 'val' => 'QCode']);\n\n $this->settingStorage->set('app_name', 'Updated QCode');\n\n $this->assertDatabaseHas('settings', ['name' => 'app_name', 'val' => 'Updated QCode']);\n $this->assertEquals('Updated QCode', $this->settingStorage->get('app_name'));\n }", "function include_settings() {\r\n global $webrock;\r\n\r\n // Get Settings\r\n if (file_exists('webrock/webrock.settings.php'))\r\n require_once('webrock/webrock.settings.php');\r\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the web server user ID (UNIX only)
public function getWebserverUid(): int { $this->getEventManager()->trigger(__FUNCTION__, $this, ['envname' => 'ZS_WEBSERVER_UID']); return (int)$this->getParam('ZS_WEBSERVER_UID'); }
[ "function getWebServerUid() {\n\t\tglobal $wwwuser, $wwwgroup;\n\t\t$wwwuser = $wwwgroup = '';\n\n\t\tif( is_windows() ) {\n\t\t\t$wwwuser = 'SYSTEM';\n\t\t\t$wwwgroup = 'SYSTEM';\n\t\t}\n\n\t\tif( function_exists( 'posix_getuid' )) {\n\t\t\t$user = @posix_getpwuid( @posix_getuid() );\n\t\t\t$group = @posix_getpwuid( @posix_getgid() );\n\t\t\t$wwwuser = $user ? $user['name'] : false;\n\t\t\t$wwwgroup = $group ? $group['name'] : false;\n\t\t}\n\n\t\tif( !$wwwuser ) {\n\t\t\t$wwwuser = 'nobody (or the user account the web server is running under)';\n\t\t}\n\n\t\tif( !$wwwgroup ) {\n\t\t\t$wwwgroup = 'nobody (or the group account the web server is running under)';\n\t\t}\n\t}", "function get_server_user() {\n\tif (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {\n\t\treturn '';\n\t} else {\n\t\treturn @exec( 'whoami' );\n\t}\n}", "public function getUnixUsername();", "private function get_user_id() {\n if (!$this->userinfo) $this->userinfo = wp_get_current_user();\n\n return $this->userinfo && isset($this->userinfo->ID) && $this->userinfo->ID > 0 ?\n $this->userinfo->ID :\n $_SERVER[\"REMOTE_ADDR\"];\n }", "function getUserIdentifier()\n\t{\n\t\tif ($this->serverType == \"activedirectory\") {\n\t\t\treturn $this->attr_sambalogin;\n\t\t} else {\n\t\t\treturn $this->attr_login;\n\t\t}\n\t}", "function uid() {\n\t$uid = getenv( 'UID' );\n\n\tif ( false === $uid && in_array( os(), [ 'Linux', 'macOS' ] ) ) {\n\t\t$uid = check_status_or_exit( process( 'id -u' ) )( 'string_output' );\n\t}\n\n\treturn false !== $uid ? $uid : 0;\n}", "private function getUserId() {\n\t\t// Do we have a user id?\n\t\tif (!empty($this->server->post['ext_d2l_username'])) {\n\t\t\treturn strip_tags($this->server->post['ext_d2l_username']);\n\t\t}\n\n\t\treturn null;\n\t}", "function get_server_user()\n{\n\tif ( strtoupper( substr( PHP_OS , 0 , 3 ) ) === 'WIN' )\n\t{\n\t\treturn '';\n\t}\n\telse if ( SAFE_MODE === true )\n\t{\n\t\t// for Suhosin\n\t\treturn '';\n\t}\n\telse\n\t{\n\t\t// for PHP disabled_func\n\t\tset_error_handler( \"dumb_test\" );\n\n\t\t$a = exec( 'whoami' );\n\t\trestore_error_handler();\n\n\t\treturn $a;\n\t}\n}", "public function userUniqId(): string\n {\n $userInfo = array_filter($_SERVER, function ($x) {\n return in_array($x, [\n 'REMOTE_ADDR',\n 'REMOTE_HOST',\n 'REMOTE_PORT',\n 'REMOTE_USER',\n 'REDIRECT_REMOTE_USER',\n 'PHP_AUTH_USER',\n 'PHP_AUTH_PW'\n ],\n false\n );\n });\n\n $userInfoString = implode('', $userInfo);\n\n $userInfoLenght = strlen($userInfoString);\n\n $leap = intdiv($userInfoLenght, 32) + 1;\n\n $id = '';\n\n $i = 0;\n\n while ($i < $userInfoLenght) {\n $id .= $userInfoString[$i];\n $i += $leap;\n }\n\n return $id;\n }", "function getUserIdentifier() {\n if ($this->serverType == \"ActiveDirectory\") {\n return \"samaccountname\";\n } else {\n return \"uid\";\n }\n }", "public function getUserUniqueIdentifier()\n\t{\n\t\t$info = $this->getUserInfo();\n\t\t//return (int) $info['id'];\n\t\treturn $info['id'];\n\t}", "function CurrentWindowsUser() {\n\treturn ServerVar(\"AUTH_USER\"); // REMOTE_USER or LOGON_USER or AUTH_USER\n}", "private function getSystemUid(): string\n {\n if (!$this->hasShellExec()) {\n return '';\n }\n\n return match ($this->getOs()) {\n 'WIN' => $this->getWindowsUid(),\n default => trim((string) shell_exec('id -u')),\n };\n }", "function getmyuid() {}", "function auth_browseruid(){\n $uid = '';\n if (empty($_SERVER['HTTP_USER_AGENT'])) { $_SERVER['HTTP_USER_AGENT']='USER_AGENT'; }\n if (empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $_SERVER['HTTP_ACCEPT_LANGUAGE']='ACCEPT_LANGUAGE'; }\n if (empty($_SERVER['HTTP_ACCEPT_CHARSET'])) { $_SERVER['HTTP_ACCEPT_CHARSET']='ACCEPT_CHARSET'; }\n $uid .= $_SERVER['HTTP_USER_AGENT'];\n $uid .= $_SERVER['HTTP_ACCEPT_LANGUAGE'];\n $uid .= $_SERVER['HTTP_ACCEPT_CHARSET'];\n $uid .= substr($_SERVER['REMOTE_ADDR'],0,strpos($_SERVER['REMOTE_ADDR'],'.'));\n return md5($uid);\n}", "public function get_uid();", "public static function get_user_id() {\n\t\t$user_ID = get_current_user_id();\n\t\treturn $user_ID ? $user_ID : '';\n\t}", "public static function GetIdSysUser() {\n return self::GetUserSys()->id_sys_user;\n }", "public function get_user_id();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the license keys of the gameserver
public function getLicenseKeys() { $url = "services/" . $this->getId() . "/gameservers/license_keys"; $result = $this->getApi()->dataGet($url); $return = array(); if (count($result['keys']) > 0) { foreach ($result['keys'] as $key) { $return[] = LicenseKeyFactory::factory($this, $key); } } return $return; }
[ "public function claimLicenseKeys() {\n $url = \"services/\" . $this->getId() . \"/gameservers/license_keys/claim_all\";\n $result = $this->getApi()->dataPost($url);\n $return = array();\n if (count($result['keys']) > 0) {\n foreach ($result['keys'] as $key) {\n $return[] = LicenseKeyFactory::factory($this, $key);\n }\n }\n\n return $return;\n }", "public function getServerLicenseInfo ()\n {\n return $this->serverLicenseInfo;\n }", "function keyInformationForServer() {\n $rsaLengths = array(2048, 4096);\n $ecLengths = array(256);\n $rsaAlgorithms = array('SHA1');\n $ecAlgorithms = array('ecdsa-with-SHA1');\n $rsa = array();\n $ec = array();\n $rsa[PWLESS_API_PARAM_KEY_LENGTH] = $rsaLengths;\n $ec[PWLESS_API_PARAM_KEY_LENGTH] = $ecLengths;\n $rsa[PWLESS_API_PARAM_SIGNATURE_ALGORITHM] = $rsaAlgorithms;\n $ec[PWLESS_API_PARAM_SIGNATURE_ALGORITHM] = $ecAlgorithms;\n $acceptedKeys = array();\n $acceptedKeys[\"rsa\"] = $rsa;\n $acceptedKeys[\"ec\"] = $ec;\n return $acceptedKeys;\n }", "protected function getLicenseKey()\n\t{\n\t\treturn $this->getConfig()->site_config->license;\n\t}", "function edd_pup_get_license_keys( $payment_id ){\r\n\t$keys = '';\r\n\t$licenses = edd_software_licensing()->get_licenses_of_purchase( $payment_id );\r\n\r\n\tif ( $licenses ) {\r\n\t\tforeach ( $licenses as $license ){\r\n\t\t\t$meta = get_post_custom( $license->ID );\r\n\t\t\t$keys[ $meta['_edd_sl_download_id'][0] ] = array( 'license_id' => $license->ID, 'key' => $meta['_edd_sl_key'][0] );\r\n\t\t}\r\n\t}\r\n\r\n\treturn $keys;\r\n}", "function acf_pro_get_license_key() { }", "public function getEnterpriseSiteLicenseKey();", "public function get_all_license()\n {\n $sentence = new SentenceUtil();\n $sentence->fromCommand(\"/system/license/getall\");\n $this->talker->send($sentence);\n $rs = $this->talker->getResult();\n $i = 0;\n if ($i < $rs->size()) {\n return $rs->getResultArray();\n }\n }", "public function getKeys()\n {\n $private_key = $this->config->getAppValue($this->appName, \"privatekey\");\n $public_key = $this->config->getAppValue($this->appName, \"publickey\");\n\n return [$private_key, $public_key];\n }", "function acf_pro_get_license_key() {\n\t\n\t// vars\n\t$license = acf_pro_get_license();\n\t\n\t\n\t// bail early if empty\n\tif( !$license ) return false;\n\t\n\t\n\t// return\n\treturn $license['key'];\n\t\n}", "public function getMyKeys() {\n\t\t$out = $this->runGPG(\"-K --with-colons\");\n\t\t$keys = explode(\"\\n\", $out['stdout']);\n\t\tarray_pop($keys);\n\n\t\t$mykeys = array();\n\t\tforeach ($keys as $k) {\n\t\t\t$line = explode(\":\", $k);\n\t\t\tif ($line[0] == \"sec\") { // This is a key!\n\t\t\t\t$mykeys[] = $line[4];\n\t\t\t}\n\t\t}\n\t\treturn $mykeys;\n\t}", "public function getKeys(): array {\n return [\n 'client_key'=>$this->client_key,\n 'secret_key'=>$this->secret_key\n ];\n }", "public function licenseKey()\n {\n return array_get($this->config(), 'license_key');\n }", "private function getKeys()\n {\n if ($this->mode === parent::MODE_PRODUCT) {\n return $this->keys['production'];\n } else {\n return $this->keys['sandbox'];\n }\n }", "public function getLicenseKey() {\n\t\treturn $this->getValue(\"signature/data[@name='license_key']\");\n\t}", "public static function getLicenseKey()\n\t{\n\t\t$storedBlocksInfo = static::_getStoredInfo();\n\t\treturn $storedBlocksInfo ? $storedBlocksInfo->licenseKey : null;\n\t}", "function getKeys(){\n\t\ttry{\n\t\t\t$db = getConnection();\n\n\t\t\t$sql = \"SELECT * FROM network_keys WHERE name = ?\";\n\t\t\t$stmt = $db->prepare($sql);\n\t\t\t$stmt->execute(array(\"llsec\"));\n\t\t\t$llsec = $stmt->fetch()['network_key'];\n\n\t\t\t$sql = \"SELECT * FROM network_keys WHERE name = ?\";\n\t\t\t$stmt = $db->prepare($sql);\n\t\t\t$stmt->execute(array(\"dtls\"));\n\t\t\t$dtls = $stmt->fetch()['network_key'];\n\t\t}\n\t\tcatch(PDOException $e){\n\t\t echo $e->getMessage();\n\t }\n\t return array($llsec, $dtls);\n\t}", "function &getDataLicences()\n\t{\n\t\t$query = 'SELECT a.id AS value, a.name AS text' .\n\t\t\t\t\t' FROM #__oer_licenses AS a';\n\t\t\t$this->_db->setQuery($query);\n\t\t\t$licencelist = $this->_db->loadObjectList();\n\t\t\treturn $licencelist;\n\t}", "public function getLicenseCodes()\n {\n return $this->license_codes;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the Composer object.
public function getComposer(): Composer { return $this->composer; }
[ "final public function getComposer() {\n if ($this->_composer === null) {\n $this->_composer = $this->createComposer();\n }\n\n return $this->_composer;\n }", "public function composer()\n {\n return $this->composer;\n }", "function getComposer() {\n\t\treturn $this->_Composer;\n\t}", "public function getComposer(): ComposerInterface\n {\n // Update and delete use the same collection, so could return the query composer of any of both.\n return $this->update->getComposer();\n }", "public function getComposer()\n {\n return $this->composer;\n }", "public function getComposer() {\n return $this->composer;\n }", "public function getComposer()\n {\n if (! $this->composer) {\n $this->composer = json_decode($this->fsio->get('composer.json'));\n }\n return $this->composer;\n }", "static public function newComposer()\r\n {\r\n return new Core_Service_Composer();\r\n }", "public function getComposer()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('composer');\n }", "protected function getOroDistribution_ComposerService()\n {\n return $this->services['oro_distribution.composer'] = call_user_func(array('Composer\\\\Factory', 'create'), $this->get('oro_distribution.composer.io'), '/var/www/orocrm-platform/app/../composer.json');\n }", "private function getComposerJson()\n {\n $composerFile = ($this->composerFileFactory)();\n return new JsonFile($composerFile);\n }", "public function getComposerJson()\n {\n $json = $this->getPath('composer.json');\n\n if (!file_exists($json)) {\n return null;\n }\n\n return json_decode(file_get_contents($json));\n }", "private function get_composer_json() {\n\t\treturn new JsonFile( $this->get_composer_json_path() );\n\t}", "public static function getComposerJson()\n {\n if (!self::$composerJson && file_exists(static::COMPOSER_PATH))\n {\n self::$composerJson = json_decode(file_get_contents(static::COMPOSER_PATH), true) ?: [];\n }\n return self::$composerJson;\n }", "public static function GetComposerInfo()\n {\n return json_decode(static::GetComposerContent());\n }", "public function infoFromComposer() {\n\n\t\t// Get info from composer or cache\n\t\t$info = \\Cache::remember('hotcoffee_info', \\Carbon\\Carbon::now()->addDays(30), function () {\n\t\t\t$composerJson = json_decode(File::get(__DIR__.'/../composer.json'));\n\t\t\t$info = collect($composerJson)->only(['name', 'description', 'homepage', 'license']);\n\t\t\t\n\t\t\tforeach(get_object_vars($composerJson->authors[0]) as $key=>$value) {\n\t\t\t\t$info->put('author.'.$key, $composerJson->authors[0]->$key);\n\t\t\t}\n\n\t\t\treturn $info;\n\t\t});\n\n\t\t// Also put version info\n\t\t$info->put('version', $this->version);\n\t\t\n\t\treturn $info;\n\t}", "public function getComposerLoader()\n {\n return $this->composerLoader;\n }", "private function packageObject(){\n\t\t\tif( $this->_packageObj === null ){\n\t\t\t\t$this->_packageObj = Package::getByHandle( $this->pkgHandle );\n\t\t\t}\n\t\t\treturn $this->_packageObj;\n\t\t}", "private function packageObject(){\n\t\t\tif( $this->_packageObj == null ){\n\t\t\t\t$this->_packageObj = Package::getByHandle( $this->pkgHandle );\n\t\t\t}\n\t\t\treturn $this->_packageObj;\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates an existing ContentBlock model. If update is successful, the browser will be redirected to the 'view' page.
public function actionUpdate($id) { $model = $this->findModel($id); $model->citiesField = $model->cities; /** @var ContentBlock $model */ $model->content = Html::decode($model->content); $versions = ContentBlockVersions::find()->where(['content_id' => $id])->all(); if ($model->load(Yii::$app->request->post())) { $model->updated_at = time(); $post_data = Yii::$app->request->post()['ContentBlock']; $postDataCities = []; if (!empty($post_data['citiesField']) && is_array($post_data['citiesField'])) { $postDataCities = array_filter($post_data['citiesField']); } $validate = $model->validate(); if($validate) { if ($model->save()) { if (isset($postDataCities)) { $this->linkCities($model, $postDataCities); } else { $model->unlinkAll('cities', true); } } } $submitForm = ArrayHelper::getValue(Yii::$app->request->post(), 'submit_form'); if ($submitForm == 'Apply') { return $this->redirect(['update', 'id' => $model->id]); } elseif ($submitForm == 'SaveVersion') { $version = new ContentBlockVersions(); $version->created_at = time(); $version->content_id = $model->id; $version->content = $model->content; $version->save(); return $this->refresh(); } else { return $this->redirect(['view', 'id' => $model->id]); } } else { return $this->render('update', [ 'model' => $model, 'versions' => $versions, ]); } }
[ "public function updateBlock()\n {\n try {\n $this->setHeader();\n $data = json_decode(file_get_contents(\"php://input\"));\n $block = BlockModel::findById($data->id);\n if (count($block) == 0) {\n http_response_code(404);\n echo json_encode(array(\"message\" => \"Block not found, can't be updated.\"));\n } else {\n $block = $block[0];\n if (isset($data->name)) {\n $block->name = $data->name;\n }\n if (isset($data->content)) {\n $block->content = $data->content;\n }\n if (isset($data->pageId)) {\n $block->pageId = $data->pageId;\n }\n if (isset($data->orderBlock)) {\n $block->orderBlock = $data->orderBlock;\n }\n if (isset($data->idBlockType)) {\n $block->idBlockType = $data->idBlockType;\n }\n if (isset($data->idParent)) {\n $block->idParent = $data->idParent;\n }\n if (isset($data->idColumn)) {\n $block->idColumn = $data->idColumn;\n }\n if (isset($data->style)) {\n $block->styleBlock = $data->style;\n }\n \n $targetPage = PageModel::findByid($data->pageId);\n if (empty($targetPage)) {\n http_response_code(404);\n echo json_encode(array(\"message\" => \"The page you are trying to update a block on does not exists. Block not updated to base.\"));\n } else {\n $block->update();\n http_response_code(200);\n echo json_encode(array(\"message\" => \"Block successfully updated\"));\n }\n }\n } catch (Exception $e) {\n http_response_code(404);\n json_encode(array(\"message\" => $e));\n }\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id); \n \n Yii::$app->controller->page_title = 'Редактировать блок';\n \n Yii::$app->controller->breadcrumbs = [\n ['Управление блоками' => \\yii\\helpers\\Url::toRoute('manage')],\n 'Редактировать блок',\n ];\n\n if (Yii::$app->request->isPost) \n {\n $transaction = Yii::$app->db->beginTransaction();\n\n try \n {\n $model->attributes = Yii::$app->request->post('CoBlocks');\n\n if($model->save())\n { \n $transaction->commit();\n return $this->redirect(['manage']);\n }\n } \n catch (\\Exception $e) \n {\n $transaction->rollBack();\n throw $e;\n }\n } \n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function update()\n {\n $dbConn = DBModel::getConnection();\n $stmt = $dbConn->prepare(\n '\n UPDATE `edit_block`\n SET `name` = :name,\n `content` = :content,\n `pageId` = :pageId,\n `orderBlock` = :orderBlock,\n `idBlockType` = :idBlockType,\n `styleBlock` = :styleBlock\n WHERE `id` = :id'\n );\n $stmt->bindParam(':name', $this->name);\n $stmt->bindParam(':content', $this->content);\n $stmt->bindParam(':pageId', $this->pageId);\n $stmt->bindParam(':orderBlock', $this->orderBlock);\n $stmt->bindParam(':idBlockType', $this->idBlockType);\n $stmt->bindParam(':id', $this->id);\n $stmt->bindParam(':styleBlock', $this->styleBlock);\n return $stmt->execute();\n }", "public function editAction() \n {\n $session = Mage::getSingleton('adminhtml/session');\n $id = $this->getRequest()->getParam('id');\n $model = Mage::getModel('zblocks/zblocks')->load($id);\n\n if($model->getId() || !$id)\n {\n $data = $model->getData();\n $sessionData = $session->getZBlocksData(true);\n if(is_array($sessionData)) $data = array_merge($data, $sessionData);\n $session->setZBlocksData(false);\n\n Mage::register('zblocks_data', $data);\n\n $this->loadLayout();\n $this->_setActiveMenu('cms/zblocks');\n\n $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);\n\n $this->_addContent($this->getLayout()->createBlock('zblocks/adminhtml_zblocks_edit'))\n ->_addLeft($this->getLayout()->createBlock('zblocks/adminhtml_zblocks_edit_tabs'));\n\n $this->renderLayout();\n } else {\n $session->addError($this->__('The block does not exist'));\n $this->_redirect('*/*/');\n }\n }", "public function actionUpdate()\n {\n $model = $this->findModel();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n \\Yii::$app->getSession()->setFlash('success', $this->getFlashMsg('success'));\n return $this->redirect(ArrayHelper::merge(['view'], $model->getPrimaryKey(true)));\n } else {\n if ($model->hasErrors()) {\n \\Yii::$app->getSession()->setFlash('error', $this->getFlashMsg('error'));\n }\n return $this->render($this->viewID, [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate()\n {\n $model = $this->findModel(Yii::$app->request->post('id'));\n\n if ($model->load(Yii::$app->request->post(),'') && $model->save()) {\n return $this->success();\n }\n\n return $this->fail();\n }", "public function saveAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t// check if form is posted\n\t\tif($this->_request->isPost())\n\t\t{\n\t\t\t$arrData = array();\n\t\t\t$arrData['module'] \t\t= $this->_request->getPost('module');\n\t\t\t$arrData['description'] = $this->_request->getPost('description');\n\t\t\t$arrData['delta'] \t\t= $this->_request->getPost('delta');\n\t\t\t$arrData['weight'] \t\t= $this->_request->getPost('weight');\n\t\t\t$arrData['section'] \t= $this->_request->getPost('section');\n\t\t\t$arrData['layout'] \t\t= $this->_request->getPost('layout');\n\t\t\t$arrData['status']\t \t= $this->_request->getPost('status');\n\t\t\t$layout = $this->_request->getPost('layout');\n\t\t\t$id = $this->_request->getPost('id');\n\t\t\t$model->updateBlock($arrData, $id);\n\t\t\t$this->_redirect('/admin/block/list/layout/' . $layout);\n\t\t}\n\t\telse\n\t\t\t$this->_redirect('/admin/block/list');\n\t }", "public function saveContentAction() \n {\n $session = Mage::getSingleton('adminhtml/session');\n\n if($data = $this->getRequest()->getPost())\n {\n $blockModel = Mage::getModel('zblocks/zblocks')->load($data['zblock_id']);\n if(!$blockModel->getId())\n {\n $session->addError($this->__('Parent block no longer exists'));\n $this->_redirect('*/*/'); \n return;\n }\n\n $model = Mage::getModel('zblocks/content');\n try\n {\n $model\n ->setData($data)\n ->setId($this->getRequest()->getParam('id'))\n ->save();\n\n $session->addSuccess($this->__('Block %s was successfully saved', '&quot;'.$model->getTitle().'&quot;'));\n // $session->setZBlocksContentData(false);\n\n if($this->getRequest()->getParam('back'))\n $this->_redirect('*/*/editContent', array('id' => $model->getId(), 'block_id' => $data['zblock_id']));\n else\n $this->_redirect('*/*/edit', array('id' => $data['zblock_id'], 'tab' => 'content'));\n\n return;\n } \n catch (Exception $e) {\n $session->addError($e->getMessage());\n $session->setZBlocksContentData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n }\n }\n $session->addError($this->__('Unable to find a block to save'));\n $this->_redirect('*/*/');\n }", "public function updateBlocks()\n {\n $post = Yii::$app->request->post();\n\n //update blocks\n if (isset($post['Block'])) {\n foreach ($post['Block'] as $key => $val) {\n if ($this->type == self::TYPE_NON_STATIC) {\n $layout = null;\n } else {\n $layout = $this->layout;\n }\n\n if ($block = Block::findOne([\n 'title' => $key,\n 'parent' => $this->id,\n 'parent_layout' => $layout,\n ])) {\n $block->content = $val;\n if (!$block->save()) {\n //throw error\n throw new HttpException(500, 'Unable to load blocks to database');\n }\n }\n }\n\n return true;\n }\n\n return false;\n }", "public function actionUpdate()\n {\n if (!$model = $this->findModel()) {\n Yii::$app->session->setFlash(\"error\", Yii::t('modules/user', \"You are not logged in.\"));\n $this->goHome();\n }\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash(\"success\", Yii::t('modules/user', \"Changes has been saved.\"));\n return $this->refresh();\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n {\n $data=Yii::$app->request->post();\n// var_dump($data['Content']['content']);exit;\n if(isset($data['Content'])) $data['Content']['content']=$this->replaceVideo($this->replaceAudio($data['Content']['content']));\n// if(isset($data['Content'])) $data['Content']['content']=$this->replaceVideo($this->replaceAudio($data['Content']['content']));\n $model = $this->findModel($id);\n if ($model->load($data) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function update()\n\t{\n\t\t$allow = true;\n\t\t$allow = Plugins::filter( 'block_update_allow', $allow, $this );\n\t\tif ( ! $allow ) {\n\t\t\treturn null;\n\t\t}\n\t\tPlugins::act( 'block_update_before', $this );\n\n\t\t$this->data = serialize( $this->data_values );\n\t\t$result = parent::updateRecord( DB::table( 'blocks' ), array( 'id' => $this->id ) );\n\n\t\t$this->fields = array_merge( $this->fields, $this->newfields );\n\t\t$this->newfields = array();\n\n\n\t\tPlugins::act( 'block_update_after', $this );\n\t\treturn $result;\n\t}", "public function actionUpdate($id)\n{\n$model = $this->findModel($id);\n\nif ($model->load($_POST) && $model->save()) {\n Yii::$app->session->setFlash('success', Yii::t('app',\"Contract updated successfully!\"));\nreturn $this->redirect(Url::previous());\n} else {\nreturn $this->render('update', [\n'model' => $model,\n]);\n}\n}", "public function actionUpdate()\n {\n $purifier = new HtmlPurifier;\n $param = $purifier->process(Yii::$app->request->get('id'));\n $model = $this->findModel($param);\n\n //if ($model->load(Yii::$app->request->post()) && $model->save()) {\n //return $this->redirect(['view', 'id' => $model->idperscom]);\n //}\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id)\n {\n\t\t$model = (Content::find()->joinWith(['menu'])->where(['content.id'=>$id]) !== null) ? Content::find()->joinWith(['menu'])->where(['content.id'=>$id])->one() : null;\n\n if($model->load(Yii::$app->request->post()) && $model->save()) \n {\n return $this->redirect(['index']);\n } \n else \n {\n return $this->render('update', [\n 'model' => $model,\n 'category' => 'content_item',\n ]);\n }\n }", "public function actionUpdate($id) {\n $content_id = Yii::$app->request->getQueryParam('content_id');\n $model = $this->findModel(BeaconContentElements::className(), $content_id);\n if($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['list', 'id' => $id]);\n }\n else {\n return $this->render('beacon-content-element-form', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate()\n {\n\n $user_id = \\Yii::$app->user->id;\n if (isset(Contact::findOne(['userID' => $user_id])->id))\n {\n\n $id = Contact::findOne(['userID' => $user_id])->id;\n }\n else\n {\n\n return $this->redirect(['contact/create']);\n }\n\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save())\n {\n\n return $this->redirect(['document/file']);\n }\n else\n {\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id, $parent_id)\n {\n $this->layout = $this->module->layoutPure;\n\n $model = $this->findModel($id);\n\n $category = BlockCategory::findOrFail($model->parent_id);\n $block = Block::findOrFail($category->block_id);\n $parents = $category->getParents()->withoutRoot()->all();\n\n $model->setAttribute('update_user', Yii::$app->user->id);\n $model->setAttribute('update_date', date('Y-m-d H:i:s'));\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->getOldAttribute('parent_id') !== (int) $model->getAttribute('parent_id')) {\n $newCategory = BlockCategory::findOne($model->getAttribute('parent_id'));\n $model->appendTo($newCategory);\n }\n if ($model->save()) {\n TagDependency::invalidate(Yii::$app->cache, 'block_categories_' . $category->block_id);\n Yii::$app->session->setFlash('success', $block->translate->category . \" обновлен\");\n return $this->redirect(['index', 'parent_id' => $parent_id]);\n }\n }\n\n return $this->render('update', [\n 'block' => $block,\n 'category' => $category,\n 'parents' => $parents,\n 'model' => $model,\n ]);\n }", "public function actionUpdate()\n {\n if(isset(Yii::$app->request->post()['id'])){\n $id=Yii::$app->request->post()['id'];\n $akta_ppat_id=Yii::$app->request->post()['akta_ppat_id'];\n $model = $this->findModel($id, $akta_ppat_id);\n }else{\n $id=Yii::$app->request->post()['AktaPpatPihak']['id'];\n $akta_ppat_id=Yii::$app->request->post()['AktaPpatPihak']['akta_ppat_id'];\n $model = $this->findModel($id, $akta_ppat_id);\n }\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n //return $this->redirect(['view', 'id' => $model->id]);\n return $this->redirect(['akta-ppat/view', 'id' => $model->akta_ppat_id]);\n } else {\n $kelurahan = Kelurahan::find()->where(['id'=>$model->kelurahan_id])->one();\n $kecamatan = Kecamatan::find()->where(['id'=>$kelurahan->kecamatan])->one();\n $kabupaten = Kabupaten::find()->where(['id'=>$kecamatan->kabupaten])->one();\n\n $model->kelurahan_id = $kelurahan->id;\n $model->kecamatan_id = $kelurahan->kecamatan_id;\n $model->kabupaten_id = $kecamatan->kabupaten_id;\n $model->provinsi_id = $kabupaten->provinsi_id;\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get mode parameter of site.
public function getModeParameter() { $rdsParameter = $this->connection->Execute('SELECT mode FROM `admin_Site` LIMIT 1;'); return $rdsParameter->fields["mode"]; }
[ "private function getMode()\n {\n if ($this->getRequest()->getParam('store')) {\n return $this->_scopeConfig->getValue(\n Config::XML_PATH_API_DEV_MODE,\n ScopeInterface::SCOPE_STORE,\n $this->getRequest()->getParam('store')\n );\n } elseif ($this->getRequest()->getParam('website')) {\n return $this->_scopeConfig->getValue(\n Config::XML_PATH_API_DEV_MODE,\n ScopeInterface::SCOPE_WEBSITE,\n $this->getRequest()->getParam('website')\n );\n } else {\n return $this->_scopeConfig->getValue(Config::XML_PATH_API_DEV_MODE);\n }\n }", "public function getMode ()\n {\n return $this->getConfigData('mode');\n }", "public function getSiteMode() {\n\t\ttry {\n\t\t\treturn $this->getConfigSetting('site/mode');\n\t\t} catch (Exception $e) {\n\t\t\treturn static::SITE_MODE_NORMAL;\n\t\t}\n\t}", "public function getSiteMode()\n\t{\n\t\treturn $this->modeListener->getMode();\n\t}", "function getSiteMode() {\n return $this->_envOptions['siteMode'];\n }", "public static function getMode()\n\t{\n\t\treturn self::$mode;\n\t}", "public function getMode()\n\t{\n\t\treturn $this->getRequest()->getMode();\n\t}", "abstract public function getMode();", "public static function getMode()\n {\n return self::$_mode;\n }", "public function get_mode()\n {\n return $this->mode;\n }", "public function getMode()\n\t{\n\t\treturn $this->mode;\n\t}", "static function getMode()\n {\n $config = wcmConfig::getInstance();\n return $config['wcm.cache.mode'];\n }", "public function getMode()\n {\n return $this->mode;\n }", "public function getMode() {\n return $this->mode;\n }", "public function get_mode() {\n\n\t\tif ( is_null( $this->mode ) ) {\n\t\t\t$this->mode = $this->get( 'mode', 'grid' );\n\t\t}\n\n\t\treturn $this->mode;\n\t}", "public function get_mode()\n {\n return $this->m_mode;\n }", "function getMode() {\n\t\treturn $this->_mode;\n\t}", "public function getMode() {\n\t\t$ret_val = false;\n\t\tswitch ($this->_mode) {\n\t\t\tcase 'list':\n\t\t\tcase 'fixed':\n\t\t\tcase 'singleton':\n\t\t\t\t$ret_val = $this->_mode;\n\t\t\tbreak;\n\t\t}\n\t\treturn $ret_val;\n\t}", "public function getCurrentMode () {\n\t\t$data = $this->getServerData();\n\t\treturn $data['g_gametype'];\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets flag counts for all flags on an entity. Provides a count of all the flaggings for a single entity. Instead of a single response, this method returns an array of counts keyed by the flag ID:
public function getEntityFlagCounts(EntityInterface $entity);
[ "public function getFlagEntityCount(FlagInterface $flag);", "public function getFlagCount() {\n return $this->count(self::FLAG);\n }", "public function getCount()\n {\n return count($this->flags);\n }", "public function getFlagFlaggingCount(FlagInterface $flag);", "public function getFlagCount()\n {\n return (int)$this->flag_count;\n }", "public function count_all(){\r\n\t\treturn $this->db->count_all($this->tbl_incident);\r\n\t}", "public function count(FlagInterface $flag, EntityInterface $flaggable) {\n $counts = $this->flagCount->getEntityFlagCounts($flaggable);\n return empty($counts) || !isset($counts[$flag->id()]) ? '0' : $counts[$flag->id()];\n }", "public function count()\n {\n return $this->client->get('countries/count.json', 'count');\n }", "public static function getAllCount()\n {\n return self::find()->count();\n }", "public function count()\n {\n $endpoint = 'countries/count.json';\n $response = $this->request($endpoint, 'GET');\n return $response['count'];\n }", "public function get_flag_statuses() {\n\t\treturn (array) json_decode( get_option( $this->flags_option ), true );\n\t}", "abstract protected function getEntityCounts();", "public function getAllInspirationFlags(){\n\t\t$items = $this->find('all',array('conditions'=>array('model'=>'Inspiration')));\n\t\t$items['count'] = $this->find('count',array('conditions'=>array('model'=>'Inspiration')));\n\t\treturn $items;\n\t}", "public function count()\n {\n return $this->entity->count();\n }", "public function getCounts() {\n return $this->db->select(\"monitor_groups_id AS id, count(servers_id) AS servers_count\")->from(\"servers_monitor_groups\")->group_by(\"monitor_groups_id\")->get()->result_array();\n }", "public function count()\n {\n return count($this->entities);\n }", "public function getIdsCount()\n {\n return $this->count(self::IDS);\n }", "function count_flagged_objects()\r\n\t{\r\n\t\tglobal $db;\r\n\t\t$results = $db->select(tbl($this->flag_tbl.\",\".$this->type_tbl),\"id\",tbl($this->flag_tbl).\".id = \".tbl($this->type_tbl).\".\".$this->type_id_field.\" \r\n\t\t\t\t\t\t\t AND type='\".$this->type.\"' GROUP BY \".tbl($this->flag_tbl).\".id ,\".tbl($this->flag_tbl).\".type \");\r\n\t\treturn count($results);\r\n\t}", "public function getCounts($check_in_id);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Delete an existing project_area
public function delete_project_area($project_area_id) { if($this->db->delete('project_areas', array('project_area_id' => $project_area_id))) { return TRUE; } else{ return FALSE; } }
[ "function project_remove_area_tested( $project_id, $area_id ) {\n\n\t$tbl_area\t\t= AREA_TESTED_TBL;\n\t$f_area_id\t\t= $tbl_area .\".\". AREA_TESTED_ID;\n\t$f_proj_id\t\t= $tbl_area .\".\". AREA_TESTED_PROJ_ID;\n\n\tglobal $db;\n\n\t$q\t= \"\tDELETE FROM $tbl_area WHERE\n\t\t\t\t$f_proj_id = $project_id AND\n\t\t\t\t$f_area_id = $area_id\";\n\n\tdb_query($db, $q);\n}", "function deleteArea($area_id)\n\t{\n\t\t$this->db->where('area_id', $area_id);\n\t\t$this->db->delete('area');\n\t}", "function deleteAreas($id){\n $this->load->database();\n $this->db->where('AREA_ID',$id);\n $this->db->delete(\"specializationarea\");\n \n }", "function delete_area($person_id)\n {\n return $this->db->delete('areas',array('person_id'=>$person_id));\n }", "public function delete_area()\n\t{\n\t\t$this->EE->cp->set_breadcrumb(WIDGET_URL, lang('widgets_module_name'));\n\t\t$this->EE->cp->set_variable('cp_page_title', lang('widgets_delete_area'));\n\n\t\t$id = $this->EE->input->get_post('area_id');\n\n\t\t// Get the request from DB\n\t\t$this->data->widget_area = $widget_area = $this->EE->widget->get_area($id);\n\n\t\t// Not here, must be an old link\n\t\t$widget_area or $this->EE->functions->redirect(WIDGET_URL);\n\n\t\t// They hit cancel: Back to base!\n\t\t$this->EE->input->post('cancel') and $this->EE->functions->redirect(WIDGET_URL);\n\n\t\t// If the form matches validation\n\t\tif ($this->EE->input->post('confirm') )\n\t\t{\n\t\t\tif ($this->EE->widget->delete_area($id))\n\t\t\t{\n\t\t\t\t$this->EE->session->set_flashdata('message_success', sprintf(lang('widgets_deleted_area_message'), $widget_area->title));\n\t\t\t\t$this->EE->functions->redirect(WIDGET_URL);\n\t\t\t}\n\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->data->error = sprintf(lang('widgets_delete_area_failed_message'), $widget_area->title);\n\t\t\t}\n\t\t}\n\n\t\t// Set the form action\n\t\t$this->data->form_action = WIDGET_PARAMS.AMP.'method=delete_area';\n\n\t\treturn $this->EE->load->view('confirm_delete_area', $this->data, TRUE);\n\t}", "public function deleteproject()\n\n\t{\n\n\t}", "public function deleteProject() \n {\n $this->associate('Project', 'projects');\n $this->delete();\n redirect('/');\n \n }", "function drush_btranslator_btr_project_delete() {\n $origin = drush_get_option('origin');\n $project = drush_get_option('project');\n _btranslator_drush_check_params($origin, $project);\n\n $erase = drush_get_option('erase');\n $erase = ($erase == 'false' ? FALSE : TRUE);\n\n $purge = drush_get_option('purge');\n $purge = ($purge == 'false' ? FALSE : TRUE);\n\n btr::project_del($origin, $project, $erase, $purge);\n}", "public function delete($project);", "static function delete($mapid) {\n\t\tglobal $wpdb;\n\t\t$maps_table = $wpdb->prefix . 'mappress_maps';\n\t\t$posts_table = $wpdb->prefix . 'mappress_posts';\n\n\t\t// Delete from posts table\n\t\t$result = $wpdb->query($wpdb->prepare(\"DELETE FROM $posts_table WHERE mapid = %d\", $mapid));\n\t\tif ($result === false)\n\t\t\treturn false;\n\n\t\t$result = $wpdb->query($wpdb->prepare(\"DELETE FROM $maps_table WHERE mapid = %d\", $mapid));\n\t\tif ($result === false)\n\t\t\treturn false;\n\n\t\t$wpdb->query(\"COMMIT\");\n\t\treturn true;\n\t}", "public function deleting(projectcompleted $projectcompleted)\n {\n //code...\n }", "public function deletePproject() {\n\t\t$sql = \"DELETE FROM projects WHERE id = \".$_POST['id'];\n\t\tif(!$result = $this->mysqli->query($sql))\n\t\t die('There was an error running the query [' . $this->mysqli->error . ']');\n\t\tif($result)\n\t\t\techo(true);\n\t\telse \n\t\t\techo (false);\n\t}", "function area_delete_form($form, &$form_state, $areadata = NULL) {\n\tassert(!empty($areadata));\n\t$form_state['area_data'] = $areadata;\n\n\treturn confirm_form(\n\t\t$form,\n\t\tt('Delete @areaname?', array('@areaname' => $areadata['name'])),\n\t\t'area/' . $areadata['id'] . '/show',\n\t\tt(\n\t\t\t'Are you sure you want to delete the area @areaname?',\n\t\t\tarray('@areaname' => $areadata['name'])),\n\t\tt('Delete'),\n\t\tt('Cancel'));\n}", "public function deleteProject(Project $project);", "public function deleteArea(string $name) : void\n\t{\n\t\t$id = $this->getMain()->getProvider()->getAreaId($name);\n\t\t$area = $this->getMain()->getProvider()->getArea($id);\n\t\t\n\t\t$this->getMain()->getProvider()->deleteArea($area);\n\t}", "function area_delete_geometry($geometry_id) {\n\t$num_delted = db_delete('area_geometry')->condition('id', $geometry_id)\n\t\t->execute();\n\tif ($num_delted == 1)\n\t\treturn true;\n\treturn false;\n}", "function delete() {\r\n\t $_SESSION['joel'] -> plugins_apply('_project_delete', $id);\r\n\t \r\n\t $this->db->execute(\"DELETE from `\".TP.\"_tasks` WHERE `project_id` = '\".$id.\"'\");\r\n\t \r\n\t $tasks = $this->db->fetchArray(\"select id from \".TP.\" where project_id = '\".$this->project_id.\"'\");\r\n\t $this->db->execute(\"DELETE from `\".$this->table.\"` WHERE `project_id` = '\".$this->project_id.\"'\");\r\n\t}", "public function delete_area_target($IndexNo)\r\n {\r\n mysql_query(\"DELETE FROM area_targets WHERE IndexNo =\" . $IndexNo);\r\n }", "function get_eliminar_area($vals,$args){\n\textract($vals);\n\textract($args);\n\t\n\t$do_area = DB_DataObject::factory('area');\n\t$do_area -> area_id = $record[$id];\n\t$do_area -> area_baja = '0';\n\tif ($do_area -> find(true)){\n\t\treturn \"<a href=eliminar_area.php?contenido={$record[$id]}><i class='fa fa-trash-o text-bg text-danger'></i></a>\";\n\t}\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a form to edit a FundInflow entity.
private function createEditForm(FundInflow $fundInflow) { return $this->createForm('HVG\SystemBundle\Form\FundInflowType', $fundInflow, array( 'action' => $this->generateUrl('fundinflow_edit', array('id' => $fundInflow->getId())), )); }
[ "public function editAction(Request $request, FundInflow $fundInflow)\n {\n $editForm = $this->createEditForm($fundInflow);\n $editForm->handleRequest($request);\n\n if ($editForm->isSubmitted() && $editForm->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($fundInflow);\n $em->flush();\n $request->getSession()->getFlashBag()->add( 'success', 'fundInflow.flash.updated' ); \n }\n\n return $this->redirect($request->headers->get('referer'));\n }", "private function createEditForm(Income $entity)\n {\n $form = $this->createForm(new IncomeType(), $entity, array(\n 'action' => $this->generateUrl('income_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n 'attr' => array('id' => 'form')\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Fininstitut $entity)\r\n {\r\n $form = $this->createForm(new FininstitutType(), $entity, array(\r\n 'action' => $this->generateUrl('cr_backend_fininstitut_update', array('id' => $entity->getId())),\r\n 'method' => 'POST',\r\n ));\r\n\r\n $form->add('submit', 'submit', array('label' => 'Update', 'attr' => array('class' => 'btn btn-primary')));\r\n\r\n return $form;\r\n }", "private function createEditForm(Intervention $entity) {\n $form = $this->createForm(new InterventionType(), $entity, array(\n 'action' => $this->generateUrl('admin_intervention_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(informeFinanciero $entity)\n {\n $form = $this->createForm(new informeFinancieroType(), $entity, array(\n 'action' => $this->generateUrl('informefinanciero_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(Insumos $entity) {\n \n $form = $this->createForm(new InsumosType(), $entity, array(\n 'action' => $this->generateUrl('insumos_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n 'attr' => array('class' => 'form-horizontal'),\n ));\n\n return $form;\n }", "private function createEditForm(Ingress $entity)\n {\n $form = $this->createForm(new IngressType($entity->getTransport()), $entity, array(\n 'action' => $this->generateUrl('ingress_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Grabar', 'attr' => array('class' => 'btn-primary')));\n\n return $form;\n }", "private function createEditForm(Fluidite $entity)\n {\n $form = $this->createForm(new FluiditeType(), $entity, array(\n 'action' => $this->generateUrl('fluidite_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array(\n 'label' => 'Update',\n 'attr' => array(\n 'class' => 'btn ')\n \n ));\n\n return $form;\n }", "private function createEditForm($entity)\n {\n $form = $this->createForm(new FabricationType(), $entity, array(\n 'action' => $this->generateUrl('fabrication_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Modifier'));\n\n return $form;\n }", "public function edit(PolicyFlow $policy_flow)\n {\n return view('policy_flow.form', [\n 'block' => false,\n 'policy_flow' => $policy_flow,\n ]);\n }", "private function createEditForm(Furniture $entity)\n {\n $form = $this->createForm(new FurnitureType(), $entity, array(\n 'action' => $this->generateUrl('furniture_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Aktualisieren'));\n\n return $form;\n }", "private function createEditForm(InvestigadorProyecto $entity)\n {\n $form = $this->createForm(new InvestigadorProyectoType(), $entity, array(\n 'action' => $this->generateUrl('investigadorproyecto_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Actualizar'));\n\n return $form;\n }", "public function createEditForm($entity)\n {\n return parent::createEditForm($entity);\n }", "public function editAction() {\n $em = $this->getDoctrine()->getManager();\n $id = $this->getRequest()->get(\"id\");\n\n $entity = $em->getRepository('BackendBundle:Feast')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find feast entity.');\n }\n $editForm = $this->createForm(new \\CoolwayFestivales\\BackendBundle\\Form\\FeastType(), $entity);\n\n return array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView()\n );\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(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(forwardings $entity)\n {\n $form = $this->createForm(new forwardingsType(), $entity, array(\n 'action' => $this->generateUrl('forwardings_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(SkBusiness $entity) {\n $form = $this->createForm(new SkBusinessEducationType(), $entity, array(\n 'action' => $this->generateUrl('business_education_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 editPeriodForm() {\n\t\t$request = $this->getRequest();\n\t\tif ( $request->getVal( 'period' ) ) {\n\t\t\t$item = finance_api::getPeriod( $request->getVal( 'period' ) );\n\t\t} else {\n\t\t\t$item = null;\n\t\t}\n\t\t$date = $item ? db_date_to_array( $item->end_date ) : array(\n\t\t\t'tm_year' => date( 'Y' ),\n\t\t\t'tm_mon' => date( 'm' ),\n\t\t\t'tm_mday' => date( 'd' )\n\t\t);\n\t\t$date['tm_year'] = $request->getVal( 'year' ) ? $request->getVal( 'year' ) : $date['tm_year'];\n\t\t$date['tm_mon'] = $request->getVal( 'month' ) ? $request->getVal( 'month' ) : $date['tm_mon'];\n\t\t$date['tm_mday'] = $request->getVal( 'day' ) ? $request->getVal( 'day' ) : $date['tm_mday'];\n\n\t\t$text = '<form action=\"\" method=\"post\">' . \"\\n\";\n\t\t$text .= $this->dateSelect( $date );\n\n\t\tif ( $item ) {\n\t\t\t$text .= '<input name=\"id\" type=\"hidden\" value=\"' . htmlspecialchars( $request->getVal( 'period' ), ENT_QUOTES ) . '\" />' . \"\\n\";\n\t\t\t$text .= '<input type=\"submit\" name=\"action\" value=\"' . $this->msg( 'finance-update' )->text() . '\" />' . \"\\n\";\n\t\t} else {\n\t\t\t$text .= '<input type=\"submit\" name=\"action\" value=\"' . $this->msg( 'finance-add' )->text() . '\" />' . \"\\n\";\n\t\t}\n\n\t\t$text .= '</form>';\n\n\t\tif ( $item ) {\n\t\t\t$text .= '<form action=\"' . paypalCommon::pageLink( 'Special:Finance', 'Periods', '' ) . '\" method=\"post\">' . \"\\n\";\n\t\t\t$text .= '<input type=\"hidden\" name=\"id\" value=\"' . htmlspecialchars( $request->getVal( 'period' ), ENT_QUOTES ) . '\" />' . \"\\n\";\n\t\t\t$text .= '<input type=\"submit\" name=\"action\" value=\"' . $this->msg( 'delete' )->text() . '\" />' . \"\\n\";\n\t\t\t$text .= '<input type=\"submit\" value=\"' . $this->msg( 'cancel' )->text() . '\">'.\"\\n\";\n\t\t\t$text .= '</form>';\n\t\t}\n\n\t\t$this->getOutput()->addHTML( $text );\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get awardeeName value An additional test has been added (isset) before returning the property value as this property may have been unset before, due to the fact that this property is removable from the request (nillable=true+minOccurs=0)
public function getAwardeeName() { return isset($this->awardeeName) ? $this->awardeeName : null; }
[ "public function getDropoffNameAttribute()\n {\n $dropoff = $this->getDropoffOrLastWaypoint();\n\n return $dropoff->address ?? $dropoff->name ?? $dropoff->street1 ?? null;\n }", "public function getFantasyName () : ?string\n\t{ return $this->fantasyName; }", "public function getName()\n {\n if (array_key_exists(\"name\", $this->_propDict)) {\n return $this->_propDict[\"name\"];\n } else {\n return null;\n }\n }", "public function getKAName()\n {\n return isset($this->KAName) ? $this->KAName : null;\n }", "public function attorneyName()\n {\n return $this->bean->attorney()->name;\n }", "public function getApartmentComplexName()\n {\n return $this->getProperty('apartment_complex_name');\n }", "public function __get( $name ) {\n if ($name == 'presence') {\n return $this->presence;\n }\n\n throw new AblyException( 'Undefined property: '.__CLASS__.'::'.$name );\n }", "public function getNomeMae() {\r\n\t\treturn $this->_nomeMae;\r\n\t}", "public function getFullNameAttribute()\n\t{\n\t\tif ($this->name) {\n\t\t\treturn $this->offer_name.\" - \".$this->name;\n\t\t} else {\n\t\t\treturn $this->offer_name;\n\t\t}\n\t}", "function getFullNameAttribute(){\n return getFullName([$this->name,$this->name_clean]);\n }", "public function getFullNameAttribute();", "public function getPropertyA()\n {\n return $this->propertyA;\n }", "public function getDeliveryName();", "public function getValueName()\n {\n if (array_key_exists(\"valueName\", $this->_propDict)) {\n return $this->_propDict[\"valueName\"];\n } else {\n return null;\n }\n }", "public function getEmployeeName() { return $this->employeeName; }", "public function getUniqueName()\n {\n if (array_key_exists(\"uniqueName\", $this->_propDict)) {\n return $this->_propDict[\"uniqueName\"];\n } else {\n return null;\n }\n }", "public static function validatedProperty(): string;", "public function getFactApartment(): ?string\n {\n return $this->fact_apartment;\n }", "public function getAnyAbatement(){\n $properties = ['abatement', 'abatementString', 'abatementDateTime', 'abatementAge', 'abatementPeriod', 'abatementRange'];\n foreach ($properties as $property){\n if ($this->$property) {\n return $this->$property;\n }\n }\n return null;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all records for specified stage. Only one record per player is returned.
public function getAllRecordsForStage($stage_id);
[ "public function getAll()\n {\n try {\n $playerModel = $this->getModel();\n $players = $playerModel::with(['detail'])->get();\n $records = [];\n \n foreach ($players as $player) {\n $records[] = $this->transformRecord($player);\n }\n\n return $records;\n } catch (\\Exception $e) {\n Log::error(\"An error has occured: \" . $e->getMessage());\n return null;\n }\n }", "public function getAllStages()\n {\n $query = $this->db->prepare(\n 'SELECT `id`, `title`, `order`, `deleted` FROM `stages` WHERE `deleted` = 0 ORDER BY `order`;'\n );\n $query->setFetchMode(\\PDO::FETCH_CLASS, 'Portal\\Entities\\StageEntity');\n $query->execute();\n return $query->fetchAll();\n }", "public function getAllRecords() {\r\n\t\t$select = $this->makeSelect(1);\r\n\t\treturn $this->fetchAll($select);\r\n\t}", "public function getRecords();", "public static function getAllRecordsWithPlayerID($id){\n\t\t$query = \"SELECT * FROM `RECORDS` WHERE PLAYERID=$id\";\n\t\t$result = MySQL::executeQuery($query);\n\t\t$allPlayerRecords = array();\n\t\twhile($row = mysqli_fetch_assoc($result)){\n\t\t\tarray_push($allPlayerRecords, $row);\n\t\t}\n\t\treturn $allPlayerRecords;\n\t}", "public static function participants(CandidateStage $stage): ?Collection\n {\n $participants = $stage->participants()->with('participant')->get();\n $participantCollection = collect();\n foreach ($participants as $participant) {\n $participantCollection->push([\n 'id' => $participant->participant->id,\n 'name' => $participant->participant->name,\n 'avatar' => ImageHelper::getAvatar($participant->participant, 32),\n 'participated' => $participant->participated,\n 'participant_id' => $participant->id,\n 'url' => route('employees.show', [\n 'company' => $participant->participant->company,\n 'employee' => $participant->participant,\n ]),\n ]);\n }\n\n return $participantCollection;\n }", "public function getAllRecords();", "public function getDealsByStage($stageId, $labelId, $userId, $userGId, $page = null)\r\n {\r\n $conditions = array();\r\n $options = array();\r\n $conditions['Deal.stage_id'] = $stageId;\r\n $conditions['Deal.status'] = ['0', '1'];\r\n if (!empty($page)) {\r\n $page = 100 * $page;\r\n } else {\r\n $page = 0;\r\n }\r\n if ($userGId == 2) {\r\n $conditions['Deal.group_id'] = CakeSession::read(\"Auth.User.group_id\");\r\n }\r\n if (!empty($labelId)) {\r\n $conditions['LabelDeal.label_id'] = $labelId;\r\n $options[] = array(\r\n 'table' => 'label_deals',\r\n 'alias' => 'LabelDeal',\r\n 'type' => 'inner',\r\n 'conditions' => array(\r\n 'LabelDeal.deal_id = Deal.id'\r\n )\r\n );\r\n }\r\n if (!empty($userId)) {\r\n $conditions['UserDeal.user_id'] = $userId;\r\n $options[] = array(\r\n 'table' => 'user_deals',\r\n 'alias' => 'UserDeal',\r\n 'type' => 'INNER',\r\n 'conditions' => array(\r\n 'UserDeal.deal_id = Deal.id'\r\n )\r\n );\r\n }\r\n\r\n $result = $this->find('all', array(\r\n 'joins' => $options,\r\n 'conditions' => $conditions,\r\n 'fields' => array('Deal.*'),\r\n 'limit' => 100,\r\n 'offset' => $page,\r\n 'order' => 'Deal.name ASC',\r\n ));\r\n return $result;\r\n }", "function get_stage($StageId)\n {\n return $this->db->get_where('Stage',array('StageId'=>$StageId))->row_array();\n }", "public function getAllRecords() {\n\t}", "function dajSveStage(){\n\t\t\n\t\t$baza=Baza::connect();\n\t\t$baza->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t$query='Select * from stage';\n\t\t$obj=array();\n\t\tforeach($baza->query($query) as $r){\n\t\t\t$tmpObj=array('id'=>$r['id'],'snaga'=>$r['snaga'],'obrtaji'=>$r['obrtaji'],'cijena'=>$r['cijena']);\n\t\t\tarray_push($obj,$tmpObj);\n\t\t}\n\t\tBaza::disconnect();\n\t\treturn $obj;\n\t}", "protected function getRecords()\n {\n return $this->records;\n }", "function vu_rp_test_rest_record_get_all() {\n $records = [];\n\n $query = db_select('vu_rp_test_rest_responses', 'ts');\n $query->fields('ts');\n $result = $query->execute();\n while ($record = $result->fetchAssoc()) {\n $records[$record['id']] = $record;\n }\n\n return $records;\n}", "public static function all()\n {\n self::dbConnect();\n\n // @TODO: Learning from the previous method, return all the matching records\n }", "public function retrieveAllPlayerName() {\r\n\t\t$records = [ ];\r\n\t\ttry {\r\n\t\t\t$prepare = $this->plugin->database->prepare ( \"SELECT distinct pname FROM arena_player\" );\r\n\t\t\t$result = $prepare->execute ();\r\n\t\t\tif ($result instanceof \\SQLite3Result) {\r\n\t\t\t\t// $data = $result->fetchArray ( SQLITE3_ASSOC );\r\n\t\t\t\twhile ( $data = $result->fetchArray ( SQLITE3_ASSOC ) ) {\r\n\t\t\t\t\t// $dataPlayer = $data ['pname'];\r\n\t\t\t\t\t// $dataWorld = $data ['world'];\r\n\t\t\t\t\t// $dataX = $data ['x'];\r\n\t\t\t\t\t// $dataY = $data ['y'];\r\n\t\t\t\t\t// $dataZ = $data ['z'];\r\n\t\t\t\t\t$records [] = $data [\"pname\"];\r\n\t\t\t\t}\r\n\t\t\t\t// var_dump($records);\r\n\t\t\t\t$result->finalize ();\r\n\t\t\t}\r\n\t\t} catch ( \\Exception $exception ) {\r\n\t\t\treturn \"get failed!: \" . $exception->getMessage ();\r\n\t\t}\r\n\t\treturn $records;\r\n\t}", "public function records() {\n if( ! property_exists($this->response(), 'records') ) return [];\n\n return $this->response()->records;\n }", "public function records() {\n\t\treturn $this->query->range( ($this->io->current() - 1) * $this->pageSize, $this->pageSize);\n\t}", "public function all()\n {\n return OffreStage::all();\n }", "public function fetchRecords() {\n\t\tif ($this->queryType !== 'select') {\n\t\t\tthrow new Exception(\"Fetch only works on select queries!\");\n\t\t}\n\t\t$link = Database::getConnection();\n\t\tlist($query, $params) = $this->buildQuery();\n\t\t//echo pprint([$query,$params]).\"<br>\";\n\t\t$stmt = $link->prepare($query);\n\t\tif ($stmt->execute($params)) {\n\t\t\t$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t$records = [];\n\t\t\tforeach ($rows as $row) {\n\t\t\t\t$records[] = new Record($this, $row);\n\t\t\t}\n\t\t\treturn $records;\n\t\t} else {\n\t\t\tthrow new Exception(\"Select query failed!\");\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Transaction management methods This method should return TRUE if the payment gateway supports requesting a status of a specific transaction
public function supports_transaction_status_query() { return true; }
[ "public function canFetchTransactionInfo() {\n if (!$this->_getConfig()->isPaymentProcessingAllowed()) {\n return false;\n }\n return parent::canFetchTransactionInfo();\n }", "public function supportsTransactions(): bool;", "private function processTransaction()\n {\n //Check for gateway validity\n if (!$this->gatewayObjectValid) {\n $this->error = self::GATEWAY_ERROR_OBJECT_INVALID;\n\n return false;\n }\n\n//Check the relevant unique parameters\n if ($this->getTxnType() == SECUREPAY_TXN_STANDARD || $this->getTxnType() == SECUREPAY_TXN_PREAUTH) {\n if ($this->checkCCParameters() == false) {\n return false;\n }\n }\n\n//Check the common parameters\n if ($this->checkTxnParameters() == false) {\n return false;\n }\n\n//Create request message. Destroys CC/CCV values if present\n $requestMessage = $this->createXMLTransactionRequestString();\n\n//Send request\n $response = $this->sendRequest($this->gatewayURL, $requestMessage);\n\n//Save the response\n $this->responseArray['response'] = htmlentities($response);\n\n//Remove the request from memory\n unset($requestMessage);\n\n//Confirm response\n if ($response == false) {\n if (strlen($this->error) == 0) {\n $this->error = self::GATEWAY_ERROR_RESPONSE_ERROR;\n }\n\n return false;\n }\n\n//Validate it\n if ($this->responseToArray($response) === false) {\n if (strlen($this->error) == 0) {\n $this->error = self::GATEWAY_ERROR_RESPONSE_INVALID;\n }\n\n return false;\n }\n\n//The transaction is successful and \"approved\" if the above tests have been passed\n $this->responseArray['txnResult'] = true;\n\n return true;\n }", "public function supports_transactions ();", "function isPaymentPending(): bool;", "public function canFetchTransactionInfo() {\n if (!$this->_getConfig()->isPaymentProcessingAllowed($this->getStore())) {\n return false;\n }\n return parent::canFetchTransactionInfo();\n }", "abstract function supportsTransactions();", "public function getPaymentStatus();", "public function server_supports_transactions() {\n foreach ($this->about_server['methods'] as $m) {\n if ($m['description'] == 'complete any pending updates') {\n return true;\n }\n }\n return false;\n }", "public function isUnderTransaction(){ }", "function updateTransaction()\n\t{\n\t\t$this->checkSettings();\n \n\t\t$this->request_xml \t\t\t\t= \t$this->createUpdateTransactionRequest();\n\t\t$this->api_url \t\t\t\t\t= \t$this->getApiUrl();\n\t\t$this->reply_xml \t\t\t\t= \t$this->xmlPost($this->api_url, $this->request_xml);\n \n\t\tif (!$this->reply_xml)\n\t\t\treturn false;\n\n\t\t$rootNode \t\t\t\t\t\t= \t$this->parseXmlResponse($this->reply_xml);\n\t\tif (!$rootNode)\n\t\t\treturn false;\n \n\t\t$details \t\t\t\t\t\t= \t$this->processStatusReply($rootNode);\n\t\t$this->details \t\t\t\t\t= \t$details;\n\n\t\treturn true;\n\t}", "public function canExecutePayment();", "function it_exchange_2checkout_addon_process_transaction( $status, $transaction_object ) {\n\n\t// If this has been modified as true already, return.\n\tif ( $status || !isset( $_REQUEST[ 'ite-2checkout-purchase-dialog-nonce' ] ) ) {\n\n\t\treturn $status;\n\t}\n\n\treturn true;\n\n}", "private function getTransactionMode()\n {\n $gatewayUrl = $this->requestParser->getGatewayUrl(['apiOperation' => 'PAYMENT_OPTIONS_INQUIRY']);\n $jsonResponse = $this->transactionHandler->getTransactionResponse($gatewayUrl);\n $responseArray = json_decode($jsonResponse, true);\n $transactionMode = $responseArray['transactionMode'];\n if ($transactionMode === 'PURCHASE')\n return 'PAY';\n else\n return 'AUTHORIZE';\n\n }", "private function _isTransactionCompatible()\n\t{\n\t\tif(!$this->getOrder() || !($this->getOrder() instanceof Mage_Sales_Model_Order)) {\n\t\t\treturn false;\n\t\t} elseif(round(((float) $this->getOrder()->getGrandTotal() - (float) $this->getGrossAmount()), 2) != (float) 0.00) {\n\t\t\treturn false;\n\t\t} \n\n\t\t/**\n\t\t * Validates only if the consult was made by massaction option\n\t\t *\n\t\t */\n\t\tif($this->getReceivedFrom() != 3) {\n\t\t\tif($this->getOrder()->getCustomerEmail() !== $this->getSender()->getEmail()) {\n\t\t\t\treturn false;\n\t\t\t} elseif((int) count($this->getOrder()->getAllVisibleItems()) !== (int) $this->getItemCount()) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public function isUnderTransaction();", "protected function userPayment()\n {\n $this->authority = @$_GET['Authority'];\n $status = @$_GET['Status'];\n\n if ($status == 'OK') {\n\t\t\treturn true;\n }\n\n\t $this->transactionFailed();\n\t\t$this->newLog(\"Error\", \"NOK\");\n\t throw new ZarinpalException(\"Error\");\n }", "public function canUseCustomerStatus(): bool;", "public function isOnRequest() {\n \treturn $this->attributes['status'] == 2;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Increment the engagement for the current experiment.
public function interact() { // Only interact once per experiment. if ($this->session->get('interacted')) return; $experiment = Experiment::firstOrNew(['name' => $this->experiment()]); $experiment->engagement++; $experiment->save(); // Mark current experiment as interacted. $this->session->set('interacted', 1); }
[ "public function gagnerExperience()\n {\n $this->_experience++;\n }", "public function pageview()\n {\n // Only interact once per experiment.\n if ($this->session->get('pageview')) return;\n\n $experiment = Experiment::firstOrNew(['name' => $this->experiment()]);\n $experiment->visitors++;\n $experiment->save();\n\n // Mark current experiment as interacted.\n $this->session->set('pageview', 1);\n }", "public function gagnerExperience()\n {\n $this->_experience += 1;\n if($this->_experience > 100)\n {\n $this->_experience = 0;\n $this->_niveau += 1;\n $this->_forcePerso += 10;\n }\n }", "public function incrementImpressions()\n {\n $this->impressions++;\n }", "public function increment(): void\n {\n $time = $this->getTime();\n\n $this->flushOldSlots($time);\n\n $index = $this->getIndexForTime($time);\n $this->counter[$index]++;\n\n $this->lastEventTime = $time;\n }", "function increment_trial_count() {\n $this->trial_count++;\n }", "public function increment()\n {\n ++$this->listeners;\n }", "protected function increment(){\n $count = $this->model->getClickCount();\n $count++;\n $this->model->setClickCount($count);\n $this->model->save(false);\n \n }", "public function increase_view_counter()\n\t{\n\t\t$sql = 'UPDATE ' . $this->sql_table . '\n\t\t\tSET contrib_views = contrib_views + 1\n\t\t\tWHERE contrib_id = ' . $this->contrib_id;\n\t\tphpbb::$db->sql_query($sql);\n\n\t\t$this->contrib_views = $this->contrib_views + 1;\n\t}", "public function incrementCounter()\n {\n $this->elCounter++;\n }", "public function pageview()\n {\n\t// If it is bot, refuse it\n\t$agent = new Agent();\n\tif (!$agent->device() or $agent->device() == 'Bot') return;\n\n // Only interact once per experiment. \n if ($this->session->get('pageview/' . $this->prefix())) return; \n $experiment = Experiment::firstOrNew(['name' => $this->experiment()]);\n $experiment->visitors++; \n $experiment->save();\n\n $goal = Goal::firstOrCreate(['name' => 'all', 'experiment' => $this->experiment()]);\n $deviceInfo = $this->getDeviceInfo($goal);\n Goal::where('name', 'all')->where('experiment', $this->experiment())\n ->update(array_merge(['count' => ($goal->count + 1)], $deviceInfo));\n \n $this->logAll('all'); \n\n // Mark current experiment as interacted.\n $this->session->set('pageview/' . $this->prefix(), 1);\n }", "public function inc(){\n $key = input('param.key','age');\n $step = input('param.step/d',2);\n dump(memcached_inc($key,$step));\n }", "public function increaseCounter() {\n\t\tif (!isset($_SESSION['counterplugin'])) {\n\t\t\t$tmp = array();\n\t\t\t$tmp['counter'] = $this->getDbField('counter') + 1;\n\t\t\t$tmp['numberofchars'] = $this->getDbField('numberofchars');\n\t\t\t$tmp['text'] = $this->getDbField('text');\n\t\t\t$this->setDb($tmp);\n\t\t\t//Set Variable for this session so user cannot increase counter by pressing F5\n\t\t\t$_SESSION['counterplugin'] = 0;\n\t\t}\n\t}", "public function incrementViews()\n {\n $query = $this->con->prepare(\"UPDATE videos SET views=views+1 WHERE id=:id\");\n $query->bindValue( \":id\", $this->getId());\n $query->execute();\n }", "public function incrementCount()\n {\n $this->count++;\n }", "public function increment()\n\t{\n\t\treturn $this->add(1);\n\t}", "public static function increment()\n {\n self::$id++;\n }", "public function incrementViewsCount()\n {\n $key = $this->views_count_key;\n $this->$key += 1;\n $this->save();\n }", "public function increaseScore() {\n $this->score++;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generates a module update, containing one or more entity type updates. An update file will be written in the module updates dir. module dir | src | updates | "module"."update".inc foo | src | updates | foo.7001.inc
function etbx_module_update_generate($module, $version = NULL) { }
[ "public function updateModules(){\n\t\t$modules = $this->getModule(\"filesystem\")->getFiles($this->moduleDir());\n\t\t$moduleFile = <<<'S'\n<?php\n\nclass Modules{\n\n\tprivate $modules = array();\nS;\n\t\tforeach($modules as $module){\n\t\t\t$moduleUpper = ucfirst($module);\n\t\t\t$moduleLower = strtolower($module);\n\t\t\t$moduleFile .= <<<S\n\n\n /**\n\t * Returns the {$moduleUpper}Module\n\t * @return {$moduleUpper}Module\n\t */\n\tpublic function get{$moduleUpper}Module(){\n\t\tif(\nS;\n\t\t\t$moduleFile .= '!empty($this->modules[\"' . $moduleLower . '\"])){';\n\t\t\t$moduleFile .= <<<S\n\n\t\t\treturn\nS;\n\t\t\t$moduleFile .= '$this->modules[\"' . $moduleLower . '\"];';\n\t\t\t$moduleFile .= <<<S\n\n\t\t}\n\nS;\n\t\t\t$moduleFile .= '$this->modules[\"' . $moduleLower . '\"] = new ' . $moduleUpper . 'Module();';\n\t\t\t$moduleFile .= <<<S\n\n\nS;\n\t\t\t$moduleFile .= 'return $this->modules[\"' . $moduleLower . '\"];';\n\t\t\t$moduleFile .= <<<S\n\n\t}\nS;\n\t\t}\n\t\t$moduleFile .= <<<S\n\n}\n?>\nS;\n\t\tfile_put_contents($this->rootDir() . \"/Modules.php\", $moduleFile);\n\t}", "public function updateAction()\n {\n $modules = $this->_getModules();\n foreach ($modules as $module) {\n $propelAdapter = $this->_getAdapter($module);\n if ($propelAdapter) {\n $propelAdapter->migrate();\n $propelAdapter->buildSql();\n $propelAdapter->build();\n\t\t\t}\n\t\t}\n }", "function createUpdateFields()\n\t{\n\t $insertValues = \"\";\n\t $update_functions = \"\";\n\t $table = Doctrine_Core::getTable($this->tableName)->getColumns();\n\t \n\t foreach ($table as $fielname => $info)\n\t {\n\t if (strtolower($fielname) != 'id' && strtolower($fielname) != 'created_at' && strtolower($fielname) != 'updated_at')\n\t {\n\t $insertValues .= \"if (isset($\".$this->moduleNameVar.\"['\".$fielname.\"'])) {\n\t $\".$this->moduleNameVar.\"_rs->\".$fielname.\" = \\$this->update\".$this->moduleName.ucfirst($fielname).\"($\".$this->moduleNameVar.\"['\".$fielname.\"']);\n\t }\n\t \";\n\t $update_functions .= \"\n protected function update\".ucfirst($this->moduleNameVar).ucfirst($fielname).\"($\".$fielname.\" = '') {\n return $\".$fielname.\";\n }\";\n\t }\n\t }\n\t \n\t $this->update_functions = $update_functions;\n\t $this->updateFromRequestFields = $insertValues;\n\t}", "private function writeEntitiesFiles(){\n// foreach ($this->aTables as $table){\n $table[] = \"villes\";\n// var_dump($table);\n // load entity template\n $templates = file_get_contents($this->lycos(\"entitiesTemplate.php.txt\", ROOT . \"core/\"));\n\n // Replace {CREATED_DATE}\n $templates = str_replace(\"{CREATED_DATE}\", date(\"d/m/Y\"), $templates);\n\n // Replace {CLASSNAME}\n $templates = str_replace(\"{CLASSNAME}\", ucfirst($table[0]), $templates);\n\n // Get attributes' Entity\n $aAttributes = $this->getEntityAttributes($table[0]);\n// var_dump($aAttributes);\n\n // Generate and replace {DECLARATIONS}\n $templates = str_replace(\"{DECLARATIONS}\", $this->declarations($aAttributes), $templates);\n\n // Generate and replace {GETTERS}\n $templates = str_replace(\"{GETTERS}\", $this->getters($aAttributes), $templates);\n\n // Generate and replace {SETTERS}\n $templates = str_replace(\"{SETTERS}\", $this->setters($aAttributes), $templates);\n\n // Write file on Models folder\n $file = ROOT . \"models/\".ucfirst($table[0]).\".php\";\n $xfile = fopen($file, \"a\");\n fputs($xfile, $templates);\n fclose($xfile);\n chmod($file, 0777);\n// break;\n// }\n }", "private function update_modules()\n\t{\n\t\tee()->db->select('module_name, module_version');\n\t\t$query = ee()->db->get('modules');\n\n\t\tforeach ($query->result() as $row)\n\t\t{\n\t\t\t$module = strtolower($row->module_name);\n\n\t\t\t// Only update first-party modules\n\t\t\tif ( ! in_array($module, $this->native_modules))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Send version to update class and let it do any required work\n\t\t\tif (in_array($module, $this->native_modules))\n\t\t\t{\n\t\t\t\t$path = EE_APPPATH.'/modules/'.$module.'/';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$path = PATH_THIRD.$module.'/';\n\t\t\t}\n\n\t\t\tif (file_exists($path.'upd.'.$module.'.php'))\n\t\t\t{\n\t\t\t\t$this->load->add_package_path($path);\n\n\t\t\t\t$class = ucfirst($module).'_upd';\n\n\t\t\t\tif ( ! class_exists($class))\n\t\t\t\t{\n\t\t\t\t\trequire $path.'upd.'.$module.'.php';\n\t\t\t\t}\n\n\t\t\t\t$UPD = new $class;\n\t\t\t\t$UPD->_ee_path = EE_APPPATH;\n\n\t\t\t\tif ($UPD->version > $row->module_version && method_exists($UPD, 'update') && $UPD->update($row->module_version) !== FALSE)\n\t\t\t\t{\n\t\t\t\t\tee()->db->update('modules', array('module_version' => $UPD->version), array('module_name' => ucfirst($module)));\n\t\t\t\t}\n\n\t\t\t\t$this->load->remove_package_path($path);\n\t\t\t}\n\t\t}\n\t}", "public function genModule(){\n\t\t\n\t\t$name = $this->getModule();\n\t\t$src_root = $this->getRoot();\n\t\t$data_root = $this->getDataRoot();\n\t\tif(is_null($name) || is_null($src_root) || is_null($data_root)){\n\t\t echo \"Gen Module name or root dir is NULL!\\n\";\n\t\t exit();\n\t\t}\n\t\t\n\t\t$module_name = Anole_Util_Inflector::classify(strtolower($name));\n\t\t$module_path = str_replace('_','/',$module_name);\n\t\t$module_mapping = strtolower($name);\n\t\t\n\t\techo \"build module code layout...\\n\";\n\t\t//mkdir dir\n\t\tAnole_Util_File::mk(\"$src_root/$module_path/Action\");\n\t\tAnole_Util_File::mk(\"$src_root/$module_path/Model\");\n\t\tAnole_Util_File::mk(\"$src_root/$module_path/Result\");\n\t Anole_Util_File::mk(\"$src_root/$module_path/Interceptor\");\n\t \n\t echo \"build module template directory...\\n\";\n\t Anole_Util_File::mk(\"$data_root/templates/$module_mapping\");\n\t \n\t \n\t echo \"Add module meta..\\n\";\n\t $module_file = $data_root.'/config/modules.yml';\n\t if(file_exists($module_file)){\n\t $meta = Anole_Yaml_Spyc::YAMLLoad($module_file);\t\n\t }else{\n\t \t$meta = array();\n\t }\n\t $meta['all'][$module_name] = array('default_action'=>$module_name,'actived'=>1);\n\t $content = Anole_Yaml_Spyc::YAMLDump($meta);\n\t Anole_Util_File::writeFile($module_file,$content);\n\t \n\t echo \"Add module mapping...\\n\";\n\t $mapping_file = $data_root.'/config/mapping.yml';\n\t if(file_exists($mapping_file)){\n\t \t$mapping = Anole_Yaml_Spyc::YAMLLoad($mapping_file);\n\t }else{\n\t $mapping = array();\t\n\t }\n\t $mapping['all'][$module_mapping] = $module_name;\n\t $content = Anole_Yaml_Spyc::YAMLDump($mapping);\n\t Anole_Util_File::writeFile($mapping_file,$content);\n\t \n\t echo \"Module:[$module_name] genreated!\\n\";\n\t}", "public function createUpdate()\n\t{\n\t\t$temp = $this->new_location . '-update';\n\n\t\t// Remove any existing files\n\t\tif (file_exists($temp . '/index.php'))\n\t\t\t$this->_removeDirectory($temp);\n\n\t\t// Copy over the files.\n\t\t$this->_copyDirectory($this->svn_location, $temp);\n\n\t\t// Remove the uneeded files.\n\t\t$this->_remove_junk($temp, $this->install_files);\n\n\t\t// Update our installer files.\n\t\t$this->_MoveRequired($temp, $this->update_files);\n\t\t$this->_fixVersion($temp, $this->svn_location);\n\n\t\t// Remove some junk our updater doesn't need.\n\t\t$this->_removeDirectory($temp . '/other');\n\t\t$this->_remove_junk($temp, $this->update_junk_files);\t\n\t}", "public function updateModelsCommand()\n {\n GeneralUtility::makeInstance(ObjectManager::class)->get(DynamicModelGenerator::class)->generateAbstractModelsForAllModules();\n }", "function upgrade_all(){\n $upgrade = new moduleinstaller();\n //$upgrade->upgradeAll();\n $modules = $upgrade->getModules();\n\n foreach($modules as $val){\n // testing if this is working\n $options = array ('module' => $val['module_name']);\n $upgrade = new moduleinstaller($options);\n $upgrade->upgrade();\n\n //update_ini_file($options);\n common::echoMessage($upgrade->confirm);\n }\n}", "public function file_update()\n {\n $l_writeable = true;\n $l_files = 'No Files available for this update!';\n $l_files_count = 0;\n\n if (!is_writeable($this->m_dirs['absolute']))\n {\n $l_writeable = false;\n } // if\n\n if (is_dir($this->m_dirs['current_update_files']))\n {\n $l_files = new isys_update_files($this->m_dirs['current_update_files']);\n\n /** @var $l_files_array RecursiveIteratorIterator */\n $l_files_array = $l_files->getdir();\n\n $l_files = '';\n $l_files_count = 0;\n $l_filepath_length = strlen($this->m_dirs['current_update_files']);\n\n if (count($l_files_array) > 0)\n {\n foreach ($l_files_array as $l_current_file)\n {\n // We remove the whole \"/var/www/i-doit/updates/...\" / \"C:\\xampp\\htdocs\\...\" stuff.\n $l_files .= '[+] ' . substr($l_current_file, $l_filepath_length) . PHP_EOL;\n $l_files_count++;\n } // foreach\n } // if\n } // if\n\n $this->m_tpl->assign('writable', $l_writeable)\n ->assign('files', $l_files)\n ->assign('files_count', $l_files_count);\n }", "function generateMod()\n {\n GenitCli::showMessage(\"...Start generate mod.xml.\");\n $config= $this->metaGen->config;\n $packageName = $config->getPackageName();\n $moduleName = $this->metaGen->config->getModuleName();\n $destinationPath = MODULE_PATH . DIRECTORY_SEPARATOR . $moduleName;\n if (!file_exists($destinationPath)) {\n GenitCli::showMessage(\"Create directory $destinationPath\");\n mkdir($destinationPath, 0777, true);\n }\n $compDesc = $this->metaGen->config->getComponentDesc();\n $compName = $this->metaGen->config->getComponentName();\n \n $listview_uri = strtolower(str_replace(\" \", \"_\", $compDesc)) . \"_list\";\n $listview_check_uri = strtolower(str_replace(\" \", \"_\", $compDesc)) . \"_check_list\";\n $listview_approve_uri = strtolower(str_replace(\" \", \"_\", $compDesc)) . \"_approve_list\";\n\n $smarty = BizSystem::getSmartyTemplate();\n\n $smarty->assign_by_ref(\"code_generator\", $config->getCodeGeneratorName());\n\n $smarty->assign_by_ref(\"package_name\", $packageName);\n $smarty->assign_by_ref(\"module_name\", $moduleName);\n $smarty->assign_by_ref(\"module\", $moduleName);\n $smarty->assign_by_ref(\"module_title\", $this->metaGen->config->getModuleTitle());\n\n $smarty->assign_by_ref(\"comp_name\", $compName);\n $smarty->assign_by_ref(\"comp_desc\", $compDesc);\n \n $smarty->assign_by_ref(\"listview_uri\", $listview_uri);\n $smarty->assign_by_ref(\"listview_check_uri\", $listview_check_uri);\n $smarty->assign_by_ref(\"listview_approve_uri\", $listview_approve_uri);\n\n $smarty->assign_by_ref(\"acl\", $this->metaGen->options['acl']);\n $smarty->assign_by_ref(\"dashboard_enable\", $config->isGenerateDashboard());\n\n $doGen = $this->metaGen->doGen;\n\n $smarty->assign_by_ref(\"has_external_attachment\", $doGen->hasExternalAttachment());\n $smarty->assign_by_ref(\"has_external_picture\", $doGen->hasExternalPicture());\n $smarty->assign_by_ref(\"has_external_changelog\", $doGen->hasExternalChangelog());\n $smarty->assign_by_ref(\"has_check_process\", $doGen->hasCheckProcess());\n $smarty->assign_by_ref(\"has_approve_process\", $doGen->hasApproveProcess());\n\n $templateFile = $this->metaGen->getTemplatePath() . DIRECTORY_SEPARATOR . self::MOD_TEMPLATE;\n $content = $smarty->fetch($templateFile);\n\n // target file\n $destinationFile = $destinationPath . DIRECTORY_SEPARATOR .\"mod.xml\";\n file_put_contents($destinationFile, $content);\n \n GenitCli::showMessage( \"\\t\" . str_replace(MODULE_PATH, \"\", $destinationFile) . \" is generated.\" );\n \n return $destinationFile;\n }", "public function generateAll() {\n\t\t$tests = $this->config->get('vqmod_mod_test');\n\t\tif ($tests) {\n\t\t\t$files = $ofiles = $json = array();\n\t\t\t$use_errors = libxml_use_internal_errors(true); // Save error setting\n\t\t\t$xml_dir = '../vqmod/xml/';\n\t\t\t$dirfiles = glob($xml_dir . '*.xml');\n\t\t\t// Check all vQMod xml files for files to mod\n\t\t\tforeach ($dirfiles as $path) {\n\t\t\t\t$file = basename($path);\n\t\t\t\tif ($file != 'vqmod_opencart.xml') {\n\t\t\t\t\t$xml = simplexml_load_file($path);\n\t\t\t\t\tif (isset($xml->file)) {\n\t\t\t\t\t\tforeach ($xml->file as $file) {\n\t\t\t\t\t\t\t// Collect all the files to mod\n\t\t\t\t\t\t\t$thefiles = explode(',', $file['name']);\n\t\t\t\t\t\t\tforeach ($thefiles as $filename) {\n\t\t\t\t\t\t\t\t$filename = (isset($file['path']) ? $file['path'] : '') . trim($filename);\n\t\t\t\t\t\t\t\tif (!in_array($filename, $files)) $files[] = $filename;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tlibxml_use_internal_errors($use_errors); // Reset error setting\n\n\t\t\t$this->load->language('extension/modification');\n\t\t\t$this->load->model('extension/modification');\n\t\t\t// Refresh OCMOD files, clear vQMod files, and delete previous generated files\n\t\t\t$this->load->controller('extension/modification/refresh', true);\n\t\t\t$path = array('../' . $tests . 'modded/*');\n\t\t\twhile (count($path) != 0) {\n\t\t\t\t$next = array_shift($path);\n\t\t\t\tforeach (glob($next) as $file) {\n\t\t\t\t\tif (is_dir($file)) {\n\t\t\t\t\t\t$path[] = $file . '/*';\n\t\t\t\t\t}\n\t\t\t\t\t$ofiles[] = $file;\n\t\t\t\t}\n\t\t\t}\n\t\t\trsort($ofiles);\n\t\t\t$this->model_extension_modification->deleteFiles($ofiles);\n\t\t\t// Generate and copy vQMod files\n\t\t\t$success = ($files) ? false : true;\n\t\t\tif ($files) {\n\t\t\t\tforeach ($files as $file) {\n\t\t\t\t\t$genfiles = glob('../' . $file);\n\t\t\t\t\tforeach ($genfiles as $file) {\n\t\t\t\t\t\tif (is_file($file)) {\n\t\t\t\t\t\t\t$file = str_replace('../', '', $file);\n\t\t\t\t\t\t\t$getfile = (file_exists(DIR_MODIFICATION . $file) ? DIR_MODIFICATION : '') . $file;\n\t\t\t\t\t\t\t$genfile = VQMod::modcheck($getfile, $file);\n\t\t\t\t\t\t\tif (is_file($genfile)) {\n\t\t\t\t\t\t\t\t$newfile = $tests . 'modded/' . $file;\n\t\t\t\t\t\t\t\t$success = $this->model_extension_modification->copyFile($genfile, $newfile, true);\n\t\t\t\t\t\t\t\tif (!$success) {\n\t\t\t\t\t\t\t\t\t$json['error'] = 'Could not copy <b>' . $genfile . '</b> to <b>' . $newfile . '</b>';\n\t\t\t\t\t\t\t\t\tbreak 2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Copy OCMod files to test folder (if not already there)\n\t\t\tif ($success) {\n\t\t\t\t$files = array();\n\t\t\t\t$path = array(DIR_MODIFICATION . '*');\n\t\t\t\twhile (count($path) != 0) {\n\t\t\t\t\t$next = array_shift($path);\n\t\t\t\t\tforeach (glob($next) as $file) {\n\t\t\t\t\t\tif (is_dir($file)) {\n\t\t\t\t\t\t\t$path[] = $file . '/*';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$files[] = $file;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\trsort($files);\n\t\t\t\t// Copy all modification files\n\t\t\t\tforeach ($files as $file) {\n\t\t\t\t\t$newfile = str_replace(DIR_MODIFICATION, $tests . 'modded/', $file);\n\t\t\t\t\tif ($file != DIR_MODIFICATION . 'index.html' && !file_exists('../' . $newfile) && is_file($file)) {\n\t\t\t\t\t\t$success = $this->model_extension_modification->copyFile($file, $newfile, true);\n\t\t\t\t\t\tif (!$success) {\n\t\t\t\t\t\t\t$json['error'] = 'Could not copy <b>' . $file . '</b> to <b>' . $newfile . '</b>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!$json) $json['success'] = $this->language->get('text_generate_done');\n\t\t\t}\n\t\t\t$this->model_extension_modification->doFTP(false);\n\t\t}\n\t\t$this->response->addHeader('Content-Type: application/json');\n\t\t$this->response->setOutput(json_encode($json));\n\t}", "function generateMergedFile($module_config_file, $scm_path, $last_update, $layout = null) {\n global $mdoc_config;\n\n $module_config = include $module_config_file;\n foreach ($module_config[\"nav\"] as $title => $file) {\n if ( is_array($file) ) {\n $sub_array = $file;\n foreach ($sub_array as $sub_title => $sub_file) {\n $ctx = file_get_contents(dirname($module_config_file).\"/\".$sub_file.\".md\");\n $arr = explode(\"\\n---\\n\", $ctx, 2);\n if (count($arr) < 2) {\n $md = $ctx;\n } else {\n $md = $arr[1];\n }\n $contents[$title][$sub_title] = parseMarkdown($md);\n }\n } else {\n $ctx = file_get_contents(dirname($module_config_file).\"/\".$file.\".md\");\n $arr = explode(\"\\n---\\n\", $ctx, 2);\n if (count($arr) < 2) {\n $md = $ctx;\n } else {\n $md = $arr[1];\n }\n $contents[$title] = parseMarkdown($md);\n }\n }\n $data = array_merge($mdoc_config, $module_config, array(\n \"source_link\" => $scm_path,\n \"contents\" => $contents,\n \"last_update\" => date(\"dS F, Y, l\", $last_update)\n ));\n $layout = isset($layout) ? $layout : $module_config['layout'];\n $generated = applyTemplate($layout, $data);\n return $generated;\n}", "function features_override_generate() {\n $files = array();\n foreach (features_get_components() as $component => $info) {\n if (isset($info['default_hook']) && \n (!isset($info['module']) || $info['module'] != 'features_override') && \n $info['default_hook'] != 'node_info' &&\n !module_hook('features_override', $info['default_hook'] . '_alter')) {\n // Assign any component that doesn't specify a module to the features \n // module.\n $module = isset($info['module']) ? $info['module'] : 'features';\n $code = array();\n $code[] = \"/**\";\n $code[] = \" * Implementation of hook_{$info['default_hook']}_alter().\";\n $code[] = \" */\";\n $code[] = 'function features_override_'. $info['default_hook'] .'_alter(&$items) {';\n $code[] = ' features_override_features_default_alter($items, \"' . $component .'\");';\n $code[] = \"}\";\n $code = implode(\"\\n\", $code);\n $files[$module][] = $code;\n }\n }\n $generated = array();\n $dir = 'public://features_override';\n // Ensure that the directory exists and is writable, if possible.\n file_prepare_directory($dir, FILE_CREATE_DIRECTORY);\n $module_dir = drupal_get_path('module', 'features_override') . '/modules';\n // Finalize strings to be written to files and generate files.\n foreach ($files as $module => $contents) {\n $name = $module . '.features_override.inc';\n if (file_exists($module_dir . '/' . $name)) {\n $header = file_get_contents($module_dir . '/' . $name);\n }\n else {\n $header = \"<?php\";\n }\n $contents = $header . \"\\n\\n\" . implode(\"\\n\\n\", $contents) . \"\\n\";\n $dest = $dir . '/' . $name;\n file_unmanaged_save_data($contents, $dest, FILE_EXISTS_REPLACE);\n $generated[] = 'modules/' . $name;\n }\n if (!empty($generated)) {\n $additions = '';\n foreach ($generated as $file) {\n $additions .= \"files[] = $file\\n\";\n }\n $contents = file_get_contents(drupal_get_path('module', 'features_override') . '/features_override.info');\n $dest = $dir . '/features_override.info';\n file_unmanaged_save_data($contents . $additions, $dest, FILE_EXISTS_REPLACE);\n drupal_set_message(t('New include files and an updated features_override.info file were generated in !dir. The new include files and can be copied to !module_dir and features_override.info copied to the features_override install directory to enable features override functionality for additional compontent types. Please also submit these changes as a patch to the Features Overide module.', array('!dir' => $dir, '!module_dir' => $module_dir)));\n }\n}", "function etbx_module_update_filename($module, $version) {\n return concat($module, array($version, 'inc'), '.');\n}", "function translate_update($options){\n\n $module_dir = _COS_MOD_PATH . \"/$options[module]\";\n if (!file_exists($module_dir)){\n cos_cli_abort('No such module dir: ' . $module_dir);\n }\n\n $translate_dir = $module_dir . \"/lang/$options[Language]\";\n\n $translate_file = $translate_dir . \"/language.inc\";\n if (!file_exists($translate_file)){\n cos_cli_abort('No such translation file: ' . $translate_file);\n }\n\n\n include $translate_file;\n\n $lang = $_COS_LANG_MODULE;\n $translation_str = file_get_contents($translate_file) . \"\\n\";\n\n $system_file = $translate_dir . \"/system.inc\";\n\n if (file_exists($system_file)){\n $translation_sys_str = file_get_contents($system_file) .\"\\n\";\n include $system_file;\n $_COS_LANG_MODULE = array_merge($lang, $_COS_LANG_MODULE);\n }\n \n // get all files from modules dir\n $file_list = file::getFileListRecursive($module_dir);\n\n // compose a php file\n foreach ($file_list as $key => $val){\n $file_str = file_get_contents($val);\n\n // find all strings matching inside lang::translate('[]')\n $search = '/lang::translate\\(\\'([^\\']+)\\'\\)/s';\n preg_match_all($search, $file_str, $out);\n $strings = $out[1];\n\n // no strings we continue\n if (empty($strings)) continue;\n $strings = array_unique($strings);\n // we add the file info to translation as comment\n //$str.=\"// Auto updated translation \" . \" $val\\n\\n\";\n\n // and we add all strings in that file\n if (strstr($val, 'menu.inc')){\n foreach ($strings as $trans){\n if (!isset($_COS_LANG_MODULE[$trans])){\n $translation_sys_str.= \"\\$_COS_LANG_MODULE['$trans'] = '$trans';\" . \"\\n\";\n }\n }\n } else {\n foreach ($strings as $trans){\n if (!isset($_COS_LANG_MODULE[$trans])){\n $translation_str.= \"\\$_COS_LANG_MODULE['$trans'] = '$trans';\" . \"\\n\";\n }\n }\n }\n }\n\n\n $lang_dir = _COS_MOD_PATH . \"/$options[module]/lang/$options[Language]\";\n if (!file_exists($lang_dir)){\n $res = mkdir($lang_dir);\n if ($res){\n cos_cli_print(\"Dir: $lang_dir created\\n\");\n } else {\n cos_cli_abort(\"Dir could not be created: $lang_dir\\n\");\n }\n }\n\n // final: write the translation file\n $write_file = $lang_dir . \"/language.inc\";\n file_put_contents($write_file, $translation_str);\n\n // final: write the translation file\n $write_sys_file = $lang_dir . \"/system.inc\";\n file_put_contents($write_sys_file, $translation_sys_str);\n\n}", "public function buildApplyUpdates() {\n // Run the module updates.\n $successful = $this->_exec(\"$this->drush_cmd -y updatedb\")->wasSuccessful();\n $this->checkFail($successful, 'running drupal updates failed.');\n }", "function generateUpdateUpgradePackageInfoFile($packagePathInfo) { \n }", "function etbx_scan_update_files($module) {\n $updates_path = module_updates_dir_path($module);\n\n return file_scan_directory($updates_path, RGX__ETBX_UPDATE_FILE);\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The GetCurlResponse function sends an API request to Google Checkout and returns the response. The HTTP Basic Authentication scheme is used to authenticate the message. This function utilizes cURL, client URL library functions. cURL is supported in PHP 4.0.2 or later versions, documented at
function GetCurlResponse($request = '', $post_url = '', $merchant_id = '', $merchant_key = '', $add_headers = false) { global $config; $header = array(); $url_array = parse_url($post_url); $pos = strpos($url_array['path'], "checkout"); if ($pos === false || $add_headers) { $header[] = "Content-type: application/xml"; $header[] = "Accept: application/xml"; } if (extension_loaded("curl")){ $ch=curl_init($post_url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); //curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); if ($request) { curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $request); } curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); if (!empty($header)) { curl_setopt($ch, CURLOPT_USERPWD, $merchant_id . ":" . $merchant_key); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); } $response = curl_exec($ch); if (curl_errno($ch)) { trigger_error(curl_error($ch), E_USER_ERROR); } else { curl_close($ch); } } else { $curl = $config['curl']; if (!strlen($curl)) { $err = "cURL path is not set - cc transaction cannot be completed"; $this->LogMessage($err, $debug_only_msg = true); return $err; } $params = ""; if (!empty($header)) { $params .= " --basic -u " . escapeshellarg($merchant_id . ":" . $merchant_key); foreach ($header as $line){ $params .= " --header " . escapeshellarg($line); } } if (substr(php_uname(), 0, 7) == "Windows") { if ($request) $response = `$curl $params -d "$request" "$post_url"`; else $response = `$curl $params "$post_url"`; } else { $post_url = escapeshellarg($post_url); $request = escapeshellarg($request); if ($request) $response = `$curl $params -d $request $post_url`; else $response = `$curl $params $post_url`; } } // Return the response to the API request return $response; }
[ "public function getResponseCurl(){\n\n $request = $this->buildRequest();\n\n $curl = curl_init($request);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);\n $this->responseAPI = curl_exec($curl);\n curl_close($curl);\n\n $this->response = json_decode($this->responseAPI);\n\n if( !empty($this->response->error->code) ){\n\n $this->errorCode = $this->response->error->code;\n $this->errorText = $this->response->error->info;\n\n }\n\n }", "public function getCurlResponse()\n {\n return $this->curlResponse;\n }", "function http_get_response( $request ) {\n @include_once DIR_WS_CLASSES . 'http.php';\n $errmsg = array();\n $content = '';\n \n if( class_exists( 'http_class' ) ) {\n $arguments = '';\n // Instantiate the http class\n $http = new http_class;\n \n // Set Connection timeout\n $http->timeout = 0;\n \n /* Data transfer timeout */\n $http->data_timeout = 0;\n \n /* Output debugging information about the progress of the connection */\n $http->debug = 0;\n \n /* Format dubug output to display with HTML pages */\n $http->html_debug = 0;\n \n // Follow the URL of redirect responses\n $http->follow_redirect = 1;\n \n // How many consecutive redirected requests the class should follow.\n $http->redirection_limit = 5;\n \n // We already tried cURL, so leave this off.\n $http->prefer_curl = 0;\n \n $url = 'http://' . $this->usps_server . '/' . $this->api_page . '?' . $request;\n \n // Generate a list of arguments for opening a connection and make an\n // HTTP request from a given URL.\n $errmsg['args'] = $http->GetRequestArguments( $url, $arguments );\n \n // Set additional request headers */\n $arguments['Headers']['Host'] = 'production.shippingapis.com';\n $arguments['Headers']['User-Agent'] = 'osCommerce';\n $arguments['Headers']['Connection'] = 'Close';\n \n // Open the connection\n $errmsg['open'] = $http->Open($arguments);\n \n if( !tep_not_null( $errmsg['open'] ) ) {\n // Send the request\n $errmsg['send'] = $http->SendRequest( $arguments );\n \n if( !tep_not_null( $errmsg['send'] ) ) {\n $headers = array();\n $errmsg['reply_headers'] = $http->ReadReplyHeaders( $headers );\n \n if( !tep_not_null( $errmsg['reply_headers'] ) ) {\n while( ( $reply_error = $http->ReadReplyBody( $body, 1000 ) ) === '' ) {\n if( strlen( $body ) == 0 ) break;\n \n $content .= $body;\n }\n }\n }\n \n // Close the connection\n $http->Close();\n }\n \n // Add the information to the header array and return it\n $header['content'] = $content;\n $header['errmsg'] = $errmsg;\n \n return $header;\n \n } else { // http class does not exist\n return false;\n }\n }", "public function getResponse(){\t\t\n\t\t$curl = curl_init();\n\t\tcurl_setopt_array($curl, $this->getOptionValue());\n\t\t$response_curl = curl_exec($curl);\n\t\tif($response_curl === false){\n\t\t\t$response_curl = $this->curlShowError($curl);\n\t\t}\n\t\tcurl_close($curl);\n\t\treturn $response_curl;\n }", "function check_googlecheckout_response() {\n\t\t\t\n\t\t\tif (isset($_GET['googleCheckoutListener']) && $_GET['googleCheckoutListener'] == '1'):\n \t\n\t\t\t\trequire_once(GOOGLE_CHECKOUT_LIB . 'googleresponse.php');\n \t\t\t\trequire_once(GOOGLE_CHECKOUT_LIB . 'googlemerchantcalculations.php');\n \t\t\t\trequire_once(GOOGLE_CHECKOUT_LIB . 'googleresult.php');\n \t\t\t\trequire_once(GOOGLE_CHECKOUT_LIB . 'googlerequest.php');\n \n\t\t\t\tdefine('RESPONSE_HANDLER_ERROR_LOG_FILE', 'googleerror.log');\n \t\t\t\tdefine('RESPONSE_HANDLER_LOG_FILE', 'googlemessage.log');\n\n \t\t\t\t$merchant_id = $this->merchant_id; // Your Merchant ID\n \t\t\t$merchant_key = $this->merchant_key; // Your Merchant Key\n \t\t\t$currency = get_option('woocommerce_currency');\n \t\t\t\n \t\t\t// Check if this is a test purchase\n\t\t\t\tif ( $this->testmode == 'yes' ):\n\t\t\t\t\t$server_type = \"sandbox\";\t\t\n\t\t\t\telse :\n\t\t\t\t\t$server_type = \"checkout\";\t\t\n\t\t\t\tendif;\n \t\t\t\n \t\t\t\t$Gresponse = new GoogleResponse($merchant_id, $merchant_key);\n \t\t\t\t$Grequest = new GoogleRequest($merchant_id, $merchant_key, $server_type, $currency);\n\n \t\t\t\t//Setup the log file\n \t\t\t\t$Gresponse->SetLogFiles('', '', L_OFF); //Change this to L_ON to log\n\n \t\t\t\t// Retrieve the XML sent in the HTTP POST request to the ResponseHandler\n \t\t\t\t$xml_response = isset($HTTP_RAW_POST_DATA)?\n \t\t\t\t\t$HTTP_RAW_POST_DATA:file_get_contents(\"php://input\");\n \t\t\t\tif (get_magic_quotes_gpc()) {\n \t\t\t\t\t$xml_response = stripslashes($xml_response);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tlist($root, $data) = $Gresponse->GetParsedXML($xml_response);\n \t\t\t\t$Gresponse->SetMerchantAuthentication($merchant_id, $merchant_key);\n \n \t\t\t\t$googlecheckout_return_values = array(\n\t\t\t\t\t\"RefNr\" \t\t\t\t=> $data[$root]['shopping-cart']['merchant-private-data']['cart-id']['VALUE' ],\n\t\t\t\t\t\"google_order_number\" \t=> $data[$root]['google-order-number']['VALUE'],\n\t\t\t\t\t\"financial_order_state\" \t=> $data[$root]['financial-order-state']['VALUE']\n\t\t\t\t);\n\t\t\t\t\n \t\t\t\tswitch($root){\n \t\t\t\t\tcase \"new-order-notification\": {\n \t\t\t\t\t\tif ( isset($googlecheckout_return_values['google_order_number']) ) :\n \t\t\t\t\t\t\tdo_action(\"valid-googlecheckout-request\", $googlecheckout_return_values);\n \t\t\t\t\t\tendif;\n \t\t\t\t\t\t$Gresponse->SendAck();\n \t\t\t\t\tbreak;\n \t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\n\t\t\tendif;\t\t\t\t\t\t\t\t\n\t\t}", "public static function newCurlResponse(): CurlResponseInterface {\n return new CurlResponse();\n }", "protected function getBodyFromCurlResponse($response)\n {\n $headersBodyDelimiter = \"\\r\\n\\r\\n\";\n $bodyStartingPositionOffset = 4; // number of special signs in delimiter;\n\n return substr($response, strpos($response, $headersBodyDelimiter) + $bodyStartingPositionOffset);\n }", "protected function _extractCurlBody ($response)\n {\n return substr($response, $this->getInfo(CURLINFO_HEADER_SIZE));\n }", "function sendRequest(BambooHTTPRequest $request) {\n $response=new BambooHTTPResponse();\n\n $http=curl_init();\n curl_setopt($http, CURLOPT_URL, $request->url );\n curl_setopt($http, CURLOPT_CUSTOMREQUEST, $request->method );\n curl_setopt($http, CURLOPT_HTTPHEADER, $request->headers );\n curl_setopt($http, CURLOPT_POSTFIELDS, $request->content);\n\n curl_setopt($http, CURLOPT_HEADER, true );\n curl_setopt($http, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($http, CURLOPT_SSL_VERIFYPEER, 1);\n curl_setopt($http, CURLOPT_RETURNTRANSFER, 1);\n \n curl_setopt($http, CURLOPT_HTTPAUTH, CURLAUTH_BASIC );\n curl_setopt($http, CURLOPT_USERPWD, $this->basicAuthUsername.':'.$this->basicAuthPassword);\n\n $response->content=curl_exec($http);\n\n if($response->content!==false) {\n $response->statusCode = curl_getinfo($http, CURLINFO_HTTP_CODE);\n $headerSize = curl_getinfo($http,CURLINFO_HEADER_SIZE);\n $response->headers= $this->parseHeaders( substr($response->content, 0, $headerSize) );\n $response->content= substr($response->content, $headerSize );\n } else {\n $response->statusCode=0;\n $response->content=\"Connection error\";\n }\n return $response;\n }", "function get_response( $url ) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);\n\n // if it returns a 403 it will return no $output\n curl_setopt($ch, CURLOPT_FAILONERROR, 1);\n $output = curl_exec($ch);\n curl_close($ch);\n return $output;\n}", "protected function getPageCurl()\n\t{\n\t\t// initiate curl with our url\n\t\t$this->curl = curl_init($this->url);\n\n\t\t// set curl options\n\t\tcurl_setopt($this->curl, CURLOPT_HEADER, 0);\n\t\tcurl_setopt($this->curl, CURLOPT_USERAGENT, $this->user_agent);\n\t\tcurl_setopt($this->curl, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($this->curl, CURLOPT_FOLLOWLOCATION, true);\n\t\tcurl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, false);\n\t\tcurl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, false);\n\n\t\t// execute the call to google+\n\t\t$this->html = curl_exec($this->curl);\n\n\t\tcurl_close($this->curl);\n\t}", "private function _getResponse(&$connection)\n\t{\n\t\t$headers = $body = '';\n\t\t$length = 0;\n\t\t// Read the headers\n\t\twhile (!feof($connection) && $line = fgets($connection)) {\n\t\t\tif ($line == \"\\r\\n\") {\n\t\t\t\t// End of headers\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// The Google API will always send a Content-length header\n\t\t\tif (preg_match('/Content-length:\\s*(\\d+)/i',$line,$matches)) {\n\t\t\t\t$length = $matches[1];\n\t\t\t}\n\t\t\t$headers .= $line;\n\t\t}\n\t\t\n\t\tif ($this->_debug) {\n\t\t\techo $headers;\n\t\t\techo \"\\n\";\n\t\t}\n\t\t\n\t\t// Read the body\n\t\tif ($length) {\n\t\t\t$body = fread($connection,$length);\n\t\t}\n\t\t\n\t\tif ($this->_debug) {\n\t\t\techo $body;\n\t\t\techo \"\\n<<<\\n\";\n\t\t}\n\t\t\n\t\treturn array('headers' => $headers,'body' => $body);\n\t}", "private function getBitrixAuthCodeFromCurl($curl_response)\n {\n if(!preg_match('~code=([^\\&]+)~', $curl_response, $b24_auth_code))\n throw new \\Exception(\"NO PARAMETER ~CODE~ IN BITRIX24 ANSWER: ... <br>\\r\\nINPUT CURL BODY: <br>\\r\\n{$curl_response}\");\n $b24_auth_code = $b24_auth_code[1];\n\n return $b24_auth_code;\n }", "public function execCurlClientes() {\n // Cria o cURL\n $curl = curl_init();\n // Seta algumas opções\n curl_setopt_array($curl, [\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_URL => \"http://www.mocky.io/v2/598b16291100004705515ec5\",\n ]);\n // Envia a requisição e salva a resposta\n $response = curl_exec($curl);\n\n curl_close($curl);\n $response = json_decode($response, true);\n //print_r($response);die();\n return $response;\n }", "protected function fetchResponse() {\n $client = new Client();\n $response = $client->get($this->webservice_url_with_parameters);\n $this->response = $response->json();\n }", "public function download()\r\n {\r\n $this->curlOptions[ CURLOPT_CUSTOMREQUEST ] = 'DOWNLOAD';\r\n $this->curlOptions[ CURLOPT_BINARYTRANSFER ] = true;\r\n $this->curlOptions[ CURLOPT_RETURNTRANSFER ] = false;\r\n\r\n return $this->getResponse();\r\n }", "public static function makeRequest(Web_CurlRequest $request, Web_CurlResponse $response) {\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $request->getUrl()); \n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $request->getHeaders());\n\t\t\n\t\t// error_log(\"curl: \" . $request->getUrl());\n\t\t$h = $request->getHeaders();\n\t\t// error_log(\"curlheaders: \" . $h[0]);\n\t\t\n\t\t$postFields = is_array($request->getParams()) ? http_build_query($request->getParams()) : $request->getParams();\n\t\t\n\t\tif ($request->getMethod() == self::METHOD_POST) {\n\t\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $postFields);\n\t\t}\n\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 30);\n\t\tforeach ($request->getOptions() as $option => $value) {\n\t\t\tcurl_setopt($ch, $option, $value);\n\t\t}\n\n\t\t$response->setContent(curl_exec($ch));\n\n\t\tif (curl_errno($ch) != 0) {\n\t\t\t$response->setErrorNumber(curl_errno($ch));\n\t\t\t$response->setErrorMessage(curl_error($ch));\n\t\t}\n\t\t\n\t\t$info = curl_getinfo($ch);\n\t\t$response->setHttpCode($info['http_code']);\n\t\t\n\t\t$effectiveUrl = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);\n\t\t$response->setEffectiveUrl($effectiveUrl);\n\n\t\tcurl_close($ch);\n\t}", "function checkCometChatResponse($licenseKey){\n global $accessKey;\n $CometChatResponse = array();\n if (!empty($licenseKey))\n {\n $queryString = (empty($_COOKIE['software-dev'])) ? '' : '&dev=1';\n $url = \"https://secure.cometchat.com/api-software/license?accessKey=\".$accessKey.\"&licenseKey=\".$licenseKey.$queryString;\n $response = cc_curl_call($url,array());\n $response = json_decode($response,true);\n if(!empty($response) && $response['success']==1){\n $response['licensekey'] = $licenseKey;\n $result = updateAPIResponse($response);\n if(isset($result['has_plan_changed'])){\n $CometChatResponse['has_plan_changed'] = 1;\n }\n $CometChatResponse['success'] = 1;\n }else{\n $CometChatResponse['success'] = 0;\n }\n }\n return $CometChatResponse;\n}", "private function curlit() {\n $this->response = array(\n 'raw' => ''\n );\n\n // configure curl\n $c = curl_init();\n switch ($this->request_settings['method']) {\n case 'GET':\n if (isset($this->request_settings['querystring']))\n $this->request_settings['url'] = $this->request_settings['url'] . '?' . $this->request_settings['querystring'];\n break;\n case 'POST':\n curl_setopt($c, CURLOPT_POST, true);\n if (isset($this->request_settings['postfields']))\n $postfields = $this->request_settings['postfields'];\n else\n $postfields = array();\n\n curl_setopt($c, CURLOPT_POSTFIELDS, $postfields);\n break;\n default:\n if (isset($this->request_settings['postfields']))\n curl_setopt($c, CURLOPT_CUSTOMREQUEST, $this->request_settings['postfields']);\n }\n\n curl_setopt_array($c, array(\n CURLOPT_HTTP_VERSION => $this->config['curl_http_version'],\n CURLOPT_USERAGENT => $this->config['user_agent'],\n CURLOPT_CONNECTTIMEOUT => $this->config['curl_connecttimeout'],\n CURLOPT_TIMEOUT => $this->config['curl_timeout'],\n // Add the NOSIGNAL option to disable internal signals in Curl. DMI-TCAT uses signals itself and\n // this would cause a conflict.\n CURLOPT_NOSIGNAL => true,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_SSL_VERIFYPEER => $this->config['curl_ssl_verifypeer'],\n CURLOPT_SSL_VERIFYHOST => $this->config['curl_ssl_verifyhost'],\n\n CURLOPT_FOLLOWLOCATION => $this->config['curl_followlocation'],\n CURLOPT_PROXY => $this->config['curl_proxy'],\n CURLOPT_ENCODING => $this->config['curl_encoding'],\n CURLOPT_URL => $this->request_settings['url'],\n // process the headers\n CURLOPT_HEADERFUNCTION => array($this, 'curlHeader'),\n CURLOPT_HEADER => false,\n CURLINFO_HEADER_OUT => true,\n ));\n\n if (defined('CURLOPT_EXPECT_100_TIMEOUT_MS')) {\n\tcurl_setopt($c, CURLOPT_EXPECT_100_TIMEOUT_MS, 10000);\n }\n\n if ($this->config['curl_cainfo'] !== false)\n curl_setopt($c, CURLOPT_CAINFO, $this->config['curl_cainfo']);\n\n if ($this->config['curl_capath'] !== false)\n curl_setopt($c, CURLOPT_CAPATH, $this->config['curl_capath']);\n\n if ($this->config['curl_proxyuserpwd'] !== false)\n curl_setopt($c, CURLOPT_PROXYUSERPWD, $this->config['curl_proxyuserpwd']);\n\n if ($this->config['is_streaming']) {\n // process the body\n $this->response['content-length'] = 0;\n curl_setopt($c, CURLOPT_TIMEOUT, 0);\n curl_setopt($c, CURLOPT_WRITEFUNCTION, array($this, 'curlWrite'));\n }\n\n if ( ! empty($this->request_settings['headers'])) {\n foreach ($this->request_settings['headers'] as $k => $v) {\n $headers[] = trim($k . ': ' . $v);\n }\n curl_setopt($c, CURLOPT_HTTPHEADER, $headers);\n }\n\n if (isset($this->config['block']) && (true === $this->config['block']))\n return 0;\n\n // do it!\n $response = curl_exec($c);\n $code = curl_getinfo($c, CURLINFO_HTTP_CODE);\n $info = curl_getinfo($c);\n $error = curl_error($c);\n $errno = curl_errno($c);\n curl_close($c);\n\n // store the response\n $this->response['code'] = $code;\n $this->response['response'] = $response;\n $this->response['info'] = $info;\n $this->response['error'] = $error;\n $this->response['errno'] = $errno;\n\n if (!isset($this->response['raw'])) {\n $this->response['raw'] = '';\n }\n $this->response['raw'] .= $response;\n\n return $code;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Save a single operation.
public function save($operation);
[ "public function saveOperation($userid, $id, TextOperation $operation);", "protected abstract function doSave();", "public function save()\n {\n $this->log(\"save start\");\n }", "public function save() {\n if(!$this->id) {\n $this->create();\n } else {\n $this->update();\n }\n }", "public function save() {\n if (!isset($this->id)) {\n $this->insert();\n } else {\n $this->update();\n }\n }", "public function save()\n {\n $sql = new Sql();\n\n /** Utiliza a procedure 'sp_carts_save' do banco de dados. */\n $results = $sql->select(\"\n CALL sp_carts_save(:idcart, :dessessionid, :iduser, :deszipcode, :vlfreight, :nrdays)\n \", array(\n \":idcart\" => $this->getidcart(),\n \":dessessionid\" => $this->getdessessionid(),\n \":iduser\" => $this->getiduser(),\n \":deszipcode\" => $this->getdeszipcode(),\n \":vlfreight\" => $this->getvlfreight(),\n \":nrdays\" => $this->getnrdays(),\n ));\n\n $this->setData($results[0]);\n }", "public function save() {\n if(isset($this->id) === true && $this->id > 0) {\n return $this->update();\n } else {\n return $this->add();\n }\n }", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"opcao\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $perguntacodper = $this->request->getPost(\"perguntacodper\");\n $opcao = Opcao::findFirstByperguntacodper($perguntacodper);\n\n if (!$opcao) {\n $this->flash->error(\"opcao does not exist \" . $perguntacodper);\n\n $this->dispatcher->forward([\n 'controller' => \"opcao\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $opcao->perguntacodper = $this->request->getPost(\"perguntacodper\");\r\n $opcao->desopc = $this->request->getPost(\"desopc\");\r\n \n\n if (!$opcao->save()) {\n\n foreach ($opcao->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"opcao\",\n 'action' => 'edit',\n 'params' => [$opcao->perguntacodper]\n ]);\n\n return;\n }\n\n $this->flash->success(\"opcao was updated successfully\");\n\n $this->dispatcher->forward([\n 'controller' => \"opcao\",\n 'action' => 'index'\n ]);\n }", "public function save (\n\t)\t\t\t\t\t// RETURNS <void>\n\t\n\t// $entity->save();\n\t{\n\t\tself::update($this->id, $this->data);\n\t}", "public function save()\n {\n if ($this->workflow) {\n $transaction = transaction(container('docoflow.connection'));\n\n try {\n $this->workflow->save();\n\n if (($steps = $this->steps()) instanceof Step) {\n $steps->save();\n }\n\n if (($groups = $this->groups()) instanceof Group) {\n $groups->save();\n }\n\n if (($verificators = $this->verificators()) instanceof Verificator) {\n $verificators->save();\n }\n\n $transaction->commit();\n } catch (Exception $e) {\n $transaction->rollback();\n\n throw $e;\n }\n }\n }", "public function saveData();", "public function save()\n\t{\n\t\t$input = $this->getDataArray();\n\t\treturn $this->modify( $input, FALSE );\n\t}", "public function save() {\r\n $conn = GFSalsaConnector::instance();\r\n if ($conn) {\r\n $conn->saveObject($this->object, $this);\r\n }\r\n }", "public function save()\n\t{\n\t\t$input = $this->getDataArray();\n\t\treturn $this->modify( $input, FALSE );\n\t\t\n\t}", "public function save() {\n $transaction = $this->transaction;\n $transaction->changed = REQUEST_TIME;\n\n $transaction_array = array(\n 'transaction_id' => $transaction->transactionId,\n 'uid' => $transaction->uid,\n 'cashier' => $transaction->cashier,\n 'order_id' => $transaction->orderId,\n 'type' => $transaction->type,\n 'data' => $transaction->data,\n 'register_id' => $transaction->registerId,\n 'changed' => $transaction->changed,\n 'created' => $transaction->created,\n 'completed' => $transaction->completed,\n );\n\n if ($transaction->transactionId) {\n $primary_keys = 'transaction_id';\n }\n else {\n $primary_keys = array();\n }\n\n drupal_write_record($transaction::TABLE_NAME, $transaction_array, $primary_keys);\n $transaction->transactionId = $transaction_array['transaction_id'];\n unset($transaction_array);\n }", "public function save()\n {\n // Updates the database\n if ($this->update() == 0) {\n // If no object was updated insert a new one\n $this->insert();\n }\n }", "public function save()\n {\n $properties = array();\n $getFuncs = $this->getAccessorFunctions();\n\n foreach ($getFuncs as $mysqlColumnName => $callback)\n {\n /* @var $callback Callback */\n $property = $callback();\n $properties[$mysqlColumnName] = $property;\n }\n\n if (!isset($this->m_id) || $this->m_id == null)\n {\n $createdObject = $this->getTableHandler()->create($properties);\n $this->m_id = $createdObject->get_id();\n }\n else\n {\n $this->getTableHandler()->update($this->m_id, $properties);\n }\n }", "public function save($save_path = null);", "public function save()\n {\n // Get primary key\n $primary = $this->{$this->_primaryKey};\n\n if (null !== $primary && $primary > 0) {\n $this->update();\n } else {\n $this->insert();\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the index of begin/end delimiters.
protected function getDelimitersIndex($begin, $end) { $string = $this->input; $nbegin = 0; $nend = 0; $position = 0; $sbrac = false; $dbrac = false; for ($i = 0, $length = mb_strlen($string); $i < $length; ++$i) { if ('"' === $string[$i]) { $dbrac = !$dbrac; } elseif ('\'' === $string[$i]) { $sbrac = !$sbrac; } if (!$sbrac && !$dbrac && $begin === $string[$i]) { ++$nbegin; } elseif (!$sbrac && !$dbrac && $end === $string[$i]) { if (++$nend === $nbegin) { $position = $i; break; } } } return $position; }
[ "public function getEndPos(): int {\n return $this->pos + \\strlen($this->text);\n }", "function CountCharacters($startPos, $endPos){}", "function extractFromDelimiters($string, $start, $end)\n{\n if (strpos($string, $start) !== false) {\n $section_retrieved = substr($string, strpos($string, $start) + strlen($start));\n $section_retrieved = substr($section_retrieved, 0, strpos($section_retrieved, $end));\n return $section_retrieved;\n }\n return false;\n}", "public function getEndOffset()\n {\n return $this->end_offset;\n }", "function extractFromDelimiters($string, $start, $end) {\n\tif (strpos($string, $start) !== false) {\n\t\t$section_retrieved = substr($string, strpos($string, $start) + strlen($start));\n\t\t$section_retrieved = substr($section_retrieved, 0, strpos($section_retrieved, $end));\n\t\treturn $section_retrieved;\n\t} return false;\n}", "public function getIndexOfPairedBracket($i);", "public function getDelimiters(): array;", "public function getCharPositionInLine();", "function get_lap_section_index($line, $delimiter = \" \") {\n\t\t$last_i = 0;\n\t\t$lapSectIndex = array();\n\t\twhile (($i = mb_strpos($line, $delimiter, $last_i)) !== false) {\n\t\t\t$last_i = $i + 1;\n\t\t\tarray_push($lapSectIndex, $i);\n\t\t}\n\t\treturn $lapSectIndex;\n\t}", "public function getEndIdx()\n {\n return $this->get(self::END_IDX);\n }", "function getStartIndex() {\n\t\treturn ( int ) $this->startIndex < 0 ? 0 : ( int ) $this->startIndex;\n\t}", "public function getIteratorIndex () {}", "private function _findNextDelimiterIndex(string $string, int $currentIndex, string $delimiter, int $stringLen){\r\n\r\n for ($i = $currentIndex + 1; $i < $stringLen; $i++) {\r\n\r\n $char = $string[$i];\r\n\r\n if($char === $delimiter || $char === \"\\r\" || $char === \"\\n\"){\r\n\r\n return $i;\r\n }\r\n }\r\n\r\n return $stringLen;\r\n }", "function get_lap_section_index($line, $delimiter = \" \") {\n\t$last_i = 0;\n\t$lapSectIndex = array();\n\twhile (($i = strpos($line, $delimiter, $last_i)) !== false) {\n\t\t$last_i = $i + 1;\n\t\tarray_push($lapSectIndex, $i);\n\t}\n\treturn $lapSectIndex;\n}", "protected function getAtxHeaderEndTagLen($startPos, $endPos)\n\t{\n\t\t$content = substr($this->text, $startPos, $endPos - $startPos);\n\t\tpreg_match('/[ \\\\t]*#*[ \\\\t]*$/', $content, $m);\n\n\t\treturn strlen($m[0]);\n\t}", "public function getStartCharIndex()\n {\n return $this->start_char_index;\n }", "static function delimiterReplaceCallback($startDelim, $endDelim, $callback, $subject, $flags = '')\n\t{\n\t\t$inputPos = 0;\n\t\t$outputPos = 0;\n\t\t$output = '';\n\t\t$foundStart = false;\n\t\t$encStart = preg_quote($startDelim, '!');\n\t\t$encEnd = preg_quote($endDelim, '!');\n\t\t$strcmp = strpos($flags, 'i') === false ? 'strcmp' : 'strcasecmp';\n\t\t$endLength = strlen($endDelim);\n\t\t$m = array();\n\n\t\twhile ($inputPos < strlen($subject) &&\n\t\t preg_match(\"!($encStart)|($encEnd)!S$flags\", $subject, $m, PREG_OFFSET_CAPTURE, $inputPos))\n\t\t{\n\t\t\t$tokenOffset = $m[0][1];\n\t\t\tif ($m[1][0] != '')\n\t\t\t{\n\t\t\t\tif ($foundStart &&\n\t\t\t\t $strcmp($endDelim, substr($subject, $tokenOffset, $endLength)) == 0)\n\t\t\t\t{\n\t\t\t\t\t// An end match is present at the same location\n\t\t\t\t\t$tokenType = 'end';\n\t\t\t\t\t$tokenLength = $endLength;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$tokenType = 'start';\n\t\t\t\t\t$tokenLength = strlen($m[0][0]);\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ($m[2][0] != '')\n\t\t\t{\n\t\t\t\t$tokenType = 'end';\n\t\t\t\t$tokenLength = strlen($m[0][0]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new Exception('Invalid delimiter given to ' . __METHOD__);\n\t\t\t}\n\n\t\t\tif ($tokenType == 'start')\n\t\t\t{\n\t\t\t\t$inputPos = $tokenOffset + $tokenLength;\n\t\t\t\t// Only move the start position if we haven't already found a start\n\t\t\t\t// This means that START START END matches outer pair\n\t\t\t\tif (!$foundStart)\n\t\t\t\t{\n\t\t\t\t\t// Found start\n\t\t\t\t\t// Write out the non-matching section\n\t\t\t\t\t$output .= substr($subject, $outputPos, $tokenOffset - $outputPos);\n\t\t\t\t\t$outputPos = $tokenOffset;\n\t\t\t\t\t$contentPos = $inputPos;\n\t\t\t\t\t$foundStart = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ($tokenType == 'end')\n\t\t\t{\n\t\t\t\tif ($foundStart)\n\t\t\t\t{\n\t\t\t\t\t// Found match\n\t\t\t\t\t$output .= call_user_func($callback, array(\n\t\t\t\t\t\tsubstr($subject, $outputPos, $tokenOffset + $tokenLength - $outputPos),\n\t\t\t\t\t\tsubstr($subject, $contentPos, $tokenOffset - $contentPos)\n\t\t\t\t\t));\n\t\t\t\t\t$foundStart = false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Non-matching end, write it out\n\t\t\t\t\t$output .= substr($subject, $inputPos, $tokenOffset + $tokenLength - $outputPos);\n\t\t\t\t}\n\t\t\t\t$inputPos = $outputPos = $tokenOffset + $tokenLength;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new Exception('Invalid delimiter given to ' . __METHOD__);\n\t\t\t}\n\t\t}\n\t\tif ($outputPos < strlen($subject))\n\t\t{\n\t\t\t$output .= substr($subject, $outputPos);\n\t\t}\n\t\treturn $output;\n\t}", "public function getIteratorIndex(){}", "public function indexStart(): int\r\n {\r\n return $this->indexStart;\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Override returned key This overrides the key that is returned from zoho, as they send back 'vendor_credits' instead of 'vendorcredits'
public function getResourceKey() { return 'vendor_credits'; }
[ "private function cachedKey(): string\n {\n return Str::lower('exchange-rate-'.$this->companyCurrency.'-'.$this->amountCurrency.'-'.$this->amountDate->format('Y-m-d'));\n }", "function acf_pro_get_license_key() { }", "public function getProductKey();", "public function setLicenseKey()\n {\n if (!get_option('acf_pro_license') && defined('ACF_5_KEY')) {\n $save = array(\n 'key' => ACF_5_KEY,\n 'url' => home_url()\n );\n\n $save = maybe_serialize($save);\n\n $save = base64_encode($save);\n\n update_option('acf_pro_license', $save);\n }\n }", "public function getVendorKey()\n {\n return $this->getParameter('vendorKey');\n }", "public function getKeyOverride()\n\t{\n\t\treturn $this->keyOverride;\n\t}", "public function licenseCacheKey();", "function headway_get_license_key() {\n\n\tif ( defined('HEADWAY_LICENSE_KEY') )\n\t\treturn apply_filters('headway_license_key', trim(HEADWAY_LICENSE_KEY));\n\n\treturn apply_filters('headway_license_key', trim(HeadwayOption::get_from_main_site('license-key')));\n\n}", "public function getCryptKey ()\n {\n return $this->getVendorPassword();\n }", "public function capture_license_key() {\r\n\t\r\n\t// Process if no other actions are active\r\n\tif ( !isset($_GET[$this->plugin_config['plugin_prefix'].'_license_change']) ) {\r\n\t\r\n\t\t//$current_key = $this->get_license_option('license_key');\r\n\t\t\r\n\t\tif( !empty($this->license_key) ) {\r\n\t\t\t\r\n\t\t\t// Set new key\r\n\t\t\t$this->set_license_option('license_key', $this->license_key);\r\n\t\t\t\r\n\t\t}\r\n\t\r\n\t}\r\n}", "protected function cache_key() {\n\t\treturn 'tribe_plugin_upgrade_notice-' . hash( 'crc32b', $this->plugin_path . $this->current_version );\n\t}", "public function license_key() {\n\t\t\t$this->value = trim( $this->value );\n\t\t\t$this->result->valid = true;\n\t\t}", "protected function getRawCustomerKey()\n {\n return rawurlencode($this->arguments['keys']['customer_key']);\n }", "public function get_key()\n {\n return 'currencyExchange' . $this->from . '-' . $this->to;\n }", "public function setLicenseKey()\n {\n $payoneVersion = $this->getVersions();\n $licenseKey = md5($payoneVersion);\n Mage::getConfig()->saveConfig(self::CONFIG_KEY_LICENSE_KEY, $licenseKey);\n }", "function getPayuMerchantKeyLive()\n{\n\treturn \"je01qM\";\n}", "public function backportLicenseKey()\n\t{\n\t\t$legacyParamsKey = $this->getLegacyParamsKey();\n\n\t\t// Only applies to Joomla! 4\n\t\tif (!version_compare(JVERSION, '3.999.999', 'gt'))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure we DO have a J4 key\n\t\t$licenseKey = $this->getLicenseKey(false);\n\n\t\tif (empty($licenseKey))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure that the legacy key is NOT the same as the J4 key\n\t\t$legacyKey = $this->getLicenseKey(true);\n\n\t\tif ($legacyKey == $licenseKey)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Save the license key to the legacy storage (component options)\n\t\t$this->container->params->set($legacyParamsKey, $licenseKey);\n\t\t$this->container->params->save();\n\t}", "public function getAssetKey(): string\n {\n }", "function generateOrderKey() {\n\t\t$name = preg_replace(array(\"/Ä|ä/\",\"/Ö|ö/\",\"/Ü|ü/\",\"/ß/\"),array(\"ae\",\"oe\",\"ue\",\"ss\"), $this->owner->InvoiceAddress()->Surname\n\t\t);\n\t\t$prefix = \"order-\";\n\t\t\n\t\t//fw\n\t\t$prefix = \"FW-\";\n\t\t//fw\n\t\t\n\t\treturn $prefix.strtoupper(\n\t\t\tpreg_replace(\"/[^A-Za-z0-9]/\",\"\",$name) . \"-\" . preg_replace(\"/[^A-Za-z0-9]/\",\"\",$this->owner->InvoiceAddress()->ZipCode) . \"-\" . $this->owner->ID\n\t\t\t);\n\t\t\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the forum manager.
public function getForumManager() { return $this -> forumManager; }
[ "protected function getForumManager()\n {\n return $this->container->get('manager.valantir.forum');\n }", "protected function getClaroline_Manager_ForumManagerService()\n {\n return $this->services['claroline.manager.forum_manager'] = new \\Claroline\\ForumBundle\\Manager\\Manager($this->get('claroline.persistence.object_manager'), $this->get('claroline.pager.pager_factory'), $this->get('event_dispatcher'), $this->get('claroline.manager.message_manager'), $this->get('translator.default'), $this->get('router'), $this->get('claroline.manager.mail_manager'), $this);\n }", "protected function getPostManager()\n {\n return $this->container->get('forum.post.manager');\n }", "private function getManager() {\n return $this->get('pickle_blog.manager');\n }", "public function getManager()\n {\n return Manager::getInstance();\n }", "public function getForum()\n {\n return $this->hasOne(Forum::class, ['id' => 'fk_forum']);\n }", "public function getManager () {\n\t\tif ($this->_manager===null)\n\t\t{\n\t\t\tforeach ($this->getApplication()->getModules() as $module)\n\t\t\t{\n\t\t\t\tif ($module instanceof FCmsModule) $this->_manager=$module;\n\t\t\t}\n\t\t\tif ($this->_manager===null) \n\t\t\tthrow new TConfigurationException(\"cms_manager_module_not_found\");\n\t\t}\n\t\treturn $this->_manager;\n\t}", "public function MeManager()\n\t{\n\t\treturn $this->meManager;\n\t}", "protected function getMailManager()\n {\n // Persist the mail manager between invocations. This is necessary for\n // remembering and reinstating the original mail backend.\n if (is_null($this->mailManager)) {\n $this->mailManager = new DrupalMailManager($this->getDriver());\n }\n return $this->mailManager;\n }", "public function getMailingManager(){\r\n\t if (!isset($this->_oMailingManager))\r\n\t $this->_oMailingManager = new Inx_Apiimpl_Mailing_MailingManagerImpl( $this );\r\n\t return $this->_oMailingManager;\t\r\n\t}", "public function getDatabaseManager()\n {\n return $this->manager;\n }", "public function getDatabaseManager()\n\t{\n\t\treturn $this->manager;\n\t}", "public static function getManager(): self\n\t{\n\t\tif (!isset(self::$manager))\n\t\t{\n\t\t\tself::$manager = new DashboardManager();\n\t\t}\n\n\t\treturn self::$manager;\n\t}", "protected function getFeed_ForumService()\n {\n return new \\phpbb\\feed\\forum($this->get('feed.helper'), $this->get('config'), $this->get('dbal.conn'), $this->get('cache.driver'), $this->get('user'), $this->get('auth'), $this->get('content.visibility'), $this->get('dispatcher'), 'php');\n }", "protected function getFeed_ForumsService()\n {\n return new \\phpbb\\feed\\forums($this->get('feed.helper'), $this->get('config'), $this->get('dbal.conn'), $this->get('cache.driver'), $this->get('user'), $this->get('auth'), $this->get('content.visibility'), $this->get('dispatcher'), 'php');\n }", "function &getForumsAdmin() {\n\t\tif ($this->forums) {\n\t\t\treturn $this->forums;\n\t\t}\n\n\t\tif (session_loggedin()) {\n\t\t\tif (!forge_check_perm ('forum_admin', $this->Group->getID())) {\n\t\t\t\t$this->setError(_(\"You don't have a permission to access this page\"));\n\t\t\t\t$this->forums = false;\n\t\t\t} else {\n\t\t\t\t$result = db_query_params('SELECT * FROM forum_group_list_vw\n\t\t\t\t\t\t\tWHERE group_id=$1\n\t\t\t\t\t\t\tORDER BY group_forum_id',\n\t\t\t\t\t\t\tarray($this->Group->getID())) ;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->setError(_(\"You don't have a permission to access this page\"));\n\t\t\t$this->forums = false;\n\t\t}\n\n\t\t$rows = db_numrows($result);\n\n\t\tif (!$result) {\n\t\t\t$this->setError(_('Forum not found')._(': ').db_error());\n\t\t\t$this->forums = false;\n\t\t} else {\n\t\t\twhile ($arr = db_fetch_array($result)) {\n\t\t\t\t$this->forums[] = new Forum($this->Group, $arr['group_forum_id'], $arr);\n\t\t\t}\n\t\t}\n\t\treturn $this->forums;\n\t}", "public function get_field_manager() {\n return mod_dataform_field_manager::instance($this->id);\n }", "public function SiteManager()\n\t{\n\t\treturn $this->siteManager;\n\t}", "protected function getManager()\n {\n return $this->objectManager;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates grid for locations list
private function createGrid() { $builder = $this->getService('grid')->create($this->getRequest()); $builder->setFormatter(new BasicGridFormatter('location',$this->isAllow(4)));//prefix $builder->setDataManager(new BasicDataManager( $this->getDoctrine()->getEntityManager() , 'Entity\Location' )); $builder->setLimit(10); $builder->addColumn(new Column('id','#')); $builder->addColumn(new Column('name','Name')); $builder->addColumn(new Column('city','City')); $builder->addColumn(new Column('street','Street')); $builder->addColumn(new Column('number','Number')); $builder->addColumn(new Column('id','Action', new LocationIndexColumnFormatter('location', array('edit'), $this->getUser()),array())); return $builder; }
[ "private function initialiseGridCoordinateCollection(): void\n {\n for ($x=1; $x<=self::COLS; $x++) {\n for ($y=1; $y<=self::ROWS; $y++) {\n $gridCoordinateBuilder = new GridCoordinateBuilder($x, $y);\n $gridCoordinate = $gridCoordinateBuilder->build();\n $this->getGridCoordinateCollection()->addItem($gridCoordinate, $gridCoordinate->getColonSeparatedKey());\n }\n }\n }", "private function initiallize(){\n $this->grid = array();\n\n for($pos_x = 0; $pos_x < $this->grid_size; $pos_x++){\n\n for($pos_y = 0; $pos_y < $this->grid_size; $pos_y++) {\n $this->grid[ $pos_x ][ $pos_y ] = 'W';\n }\n }\n }", "abstract public function setupGrid();", "private function prepareTiles() {\n $array = range(0,6);\n\n forEach($array as $i) {\n forEach(range(0, $i) as $j) {\n $this->tiles[] = [$i, $j];\n }\n }\n }", "public function createLocationGroup();", "public function getGrid();", "public function prepareGrid();", "public function locationspagesGridAction()\n {\n $this->_initBanner();\n $this->loadLayout();\n $this->getLayout()->getBlock('magify.bannermanager.edit.tab.locations.tabs.pages')\n ->setPages($this->getRequest()->getPost('banner_locations_pages', null));\n $this->renderLayout();\n }", "function displayGrid(){\n\t\tfor($i = 0; $i < $this->size; $i++){\n\t\t\tif(($i + 1) % $this->row == 0){\n\t\t\t\techo \"<img src=\\\"images/grid\" . $this->maze[$i] . \".svg\\\" alt=\\\"\" . $this->maze[$i] . \"\\\" class=\\\"img-responsive inline-block\\\" ><br >\";\n\t\t\t} else { \n\t\t\t\techo \"<img src=\\\"images/grid\" . $this->maze[$i] . \".svg\\\" alt=\\\"\" . $this->maze[$i] . \"\\\" class=\\\"img-responsive inline-block\\\" >\";\n\t\t\t}\n\t\t}\n\t}", "private function seed_locations()\n {\n $location1 = Location::create([\n 'name' => 'Owl Books, New York',\n 'address' => '1 Broadway, New York, NY, United States'\n ]);\n $location2 = Location::create([\n 'name' => 'Owl Books, San Francisco',\n 'address' => '1 2nd St, San Francisco, CA, United States'\n ]);\n $location3 = Location::create([\n 'name' => 'Owl Books, Chicago',\n 'address' => '1 Main Street, Chicago, IL, United Statess'\n ]);\n }", "function get_loop_locations ($locations = -1) {\n $result = \"\";\n $i = 0;\n while (have_posts()) { the_post();\n // echo \"get_loop_locations: -> \".get_the_ID().\" -> \".get_the_title().\"<br />\";\n $geo = GeoPress::get_geo(get_the_ID());\n if ($geo != \"\") {\n $result[] = $geo;\n $i++;\n if ($i == $locations) {\n break;\n }\n }\n }\n // Build a hash of Location => Posts @ location\n $locations = array();\n foreach ($result as $loc) {\n if($locations[$loc->coord] == null) {\n $locations[$loc->coord] = array();\n }\n array_push($locations[$loc->coord], $loc);\n \n }\n return $locations;\t\n }", "function get_loop_locations ($locations = -1) {\n $result = \"\";\n $i = 0;\n while (have_posts()) { the_post();\n // echo \"get_loop_locations: -> \".get_the_ID().\" -> \".get_the_title().\"<br />\";\n $geo = GeoPress::get_geo(get_the_ID());\n if ($geo != \"\") {\n $result[] = $geo;\n $i++;\n if ($i == $locations) {\n break;\n }\n }\n }\n // Build a hash of Location => Posts @ location\n $locations = array();\n foreach ($result as $loc) {\n if($locations[$loc->coord] == null) {\n $locations[$loc->coord] = array();\n }\n array_push($locations[$loc->coord], $loc);\n\n }\n return $locations;\t\n }", "private function create_point_list(){\n $this->map_points['A'] = new Point( 'A', 44.968 , -94.420 );\n $this->map_points['B'] = new Point( 'B', 43.333 , -89.132 );\n $this->map_points['C'] = new Point( 'C', 33.755 , -116.359 );\n $this->map_points['D'] = new Point( 'D', 33.844 , -116.549 );\n $this->map_points['E'] = new Point( 'E', 44.920 , -93.447 );\n $this->map_points['F'] = new Point( 'F', 44.240 , -91.493 );\n $this->map_points['G'] = new Point( 'G', 44.968 , -94.419 );\n $this->map_points['H'] = new Point( 'H', 44.333 , -89.132 );\n $this->map_points['I'] = new Point( 'I', 33.755 , -116.360 );\n $this->map_points['J'] = new Point( 'J', 33.844 , -117.549 );}", "public function listLocations();", "protected function _start_grid () {}", "public function generateGrids(array $drivers);", "function __construct() {\n $cells = array();\n\n for ($row = 0; $row < WORLD_HEIGHT; $row++) {\n for ($col = 0; $col < WORLD_WIDTH; $col++) {\n $coords = new Coord($row, $col);\n $cell = new Cell();\n $cell->setState(boolval(INITIAL_SPAWN_TOLERANCE >= mt_rand() / mt_getrandmax()));\n $cells[$coords->toString()] = $cell;\n }\n }\n\n $this->cells = $cells;\n }", "private function setGridValues()\n {\n for ($i = 0; $i < $this->gridRow; $i++) {\n for ($j = 0; $j < $this->gridColumn; $j++) {\n if (\n ($i == 0 || $i == ($this->gridRow - 1))\n && ($j >= 0 && $j < $this->gridColumn)\n ) {\n $this->slot[$i][$j] = \"#\";\n } else if (\n ($j == 0 || $j == ($this->gridColumn - 1))\n && ($i >= 0 && $i < $this->gridRow)\n ) {\n $this->slot[$i][$j] = \"#\";\n } else if ($i == 2 && ($j >= 2 && $j <= 4)) {\n $this->slot[$i][$j] = \"#\";\n } else if ($i == 3 && ($j == 4 || $j == 6)) {\n $this->slot[$i][$j] = \"#\";\n } else if ($i == 4 && $j == 2) {\n $this->slot[$i][$j] = \"#\";\n } else if ($i == 4 && $j == 1) {\n $this->slot[$i][$j] = \"X\";\n $userPosition = new stdClass();\n $userPosition->row = $i;\n $userPosition->column = $j;\n $this->position_user = $userPosition;\n } else {\n $this->slot[$i][$j] = \".\";\n $clearPath = new stdClass();\n $clearPath->row = $i;\n $clearPath->column = $j;\n $this->clearPathslot[\"{$clearPath->row}::{$clearPath->column}\"] = $clearPath;\n }\n }\n }\n }", "protected function grid()\n {\n $grid = new Grid(new Direction());\n\n $grid->column('id', __('Id'));\n $grid->column('name', __(trans('hhx.name')));\n $grid->column('intro', __(trans('hhx.intro')));\n $grid->column('Img', __(trans('hhx.img')))->image();\n $grid->column('status', __(trans('hhx.status')))->using(config('hhx.status'));\n $grid->column('order_num', __(trans('hhx.order_num')));\n $grid->column('all_num', __(trans('hhx.all_num')));\n $grid->column('this_year', __(trans('hhx.this_year')));\n $grid->column('stock', __(trans('hhx.stock')));\n $grid->column('created_at', __(trans('hhx.created_at')));\n $grid->column('updated_at', __(trans('hhx.updated_at')));\n\n return $grid;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generates the xml for the collection using generatePaymentXml
public function generateCollectionXml(\SimpleXMLElement $pmtInf);
[ "protected function xmlGenerator(): void\n {\n $this->setInvoiceDetails();\n\n $this->setInvoiceBillingReferenceIfExists();\n\n $this->setPreviousInvoiceHash();\n\n $this->setAccountingSupplierParty();\n\n $this->setAccountingCustomerParty();\n\n $this->setInvoicePaymentMeans();\n\n (new XmlInvoiceItemsService($this->invoice))->generate($this->invoiceXml);\n\n $this->invoiceXml = str_replace('SET_CURRENCY', $this->invoice->currency, $this->invoiceXml);\n }", "abstract protected function generateXML();", "public function generateXml(array $collection = array())\n {\n $total = 0;\n $itemsXml = array();\n foreach ($collection as $object) {\n /** @var xPDOObject $object */\n $objectArray = $object->toArray();\n $type = $this->classKey;\n\n $objectXml = array();\n foreach ($objectArray as $key => $value) {\n if (!is_numeric($value) && !is_bool($value) && !is_null($value)) {\n // Escape any \"]]>\" occurences inside the value per http://en.wikipedia.org/wiki/CDATA#Nesting\n $value = str_replace(']]>', ']]]]><![CDATA[>', $value);\n $objectXml[] = \"<{$key}><![CDATA[{$value}]]></{$key}>\";\n } else {\n $objectXml[] = \"<{$key}>{$value}</{$key}>\";\n }\n }\n $objectXml = implode(\"\\n\\t\", $objectXml);\n $itemsXml[] = \"<{$type}>\\n\\t{$objectXml}\\n</{$type}>\";\n $total++;\n }\n $itemsXml = implode(\"\\n\", $itemsXml);\n\n $time = date('Y-m-d@H:i:s');\n $xml = <<<XML\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<data package=\"redactor\" exported=\"$time\" total=\"$total\">\n$itemsXml\n</data>\nXML;\n return $xml;\n }", "protected function createRegularPaymentXML()\n {\n $security_data = $this->makeSecurityData();\n $hash_data = $this->makeHashData($security_data);\n\n $nodes = [\n 'GVPSRequest' => [\n 'Mode' => $this->mode,\n 'Version' => 'v0.01',\n 'Terminal' => [\n 'ProvUserID' => $this->account->username,\n 'UserID' => $this->account->username,\n 'HashData' => $hash_data,\n 'ID' => $this->account->terminal_id,\n 'MerchantID' => $this->account->client_id,\n ],\n 'Customer' => [\n 'IPAddress' => $this->order->ip,\n 'EmailAddress' => $this->order->email,\n ],\n 'Card' => [\n 'Number' => $this->card->number,\n 'ExpireDate' => $this->card->month . $this->card->year,\n 'CVV2' => $this->card->cvv,\n ],\n 'Order' => [\n 'OrderID' => $this->order->id,\n 'GroupID' => '',\n 'AddressList' => [\n 'Address' => [\n 'Type' => 'S',\n 'Name' => $this->order->name,\n 'LastName' => '',\n 'Company' => '',\n 'Text' => '',\n 'District' => '',\n 'City' => '',\n 'PostalCode' => '',\n 'Country' => '',\n 'PhoneNumber' => '',\n ],\n ],\n ],\n 'Transaction' => [\n 'Type' => $this->type,\n 'InstallmentCnt' => $this->order->installment > 1 ? $this->order->installment : '',\n 'Amount' => $this->amountFormat($this->order->amount),\n 'CurrencyCode' => $this->order->currency,\n 'CardholderPresentCode' => '0',\n 'MotoInd' => 'N',\n 'Description' => '',\n 'OriginalRetrefNum' => '',\n ],\n ]\n ];\n\n return $this->createXML($nodes);\n }", "protected function getBasePaymentXML()\n {\n $xml = $this->getBaseXML();\n\n $payment = $xml->addChild('Payment');\n $txnList = $payment->addChild('TxnList');\n $txnList->addAttribute('count', 1);\n $transaction = $txnList->addChild('Txn');\n $transaction->addAttribute('ID', 1);\n $transaction->addChild('txnType', $this->txnType);\n $transaction->addChild('txnSource', 23);\n $transaction->addChild('txnChannel', 0);\n $transaction->addChild('amount', $this->getAmountInteger());\n $transaction->addChild('currency', $this->getCurrency());\n $transaction->addChild('purchaseOrderNo', $this->getTransactionId());\n\n return $xml;\n }", "public function toXml()\n\t\t{\n\t\t\t$xml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t\t\t<collection>\n\t\t\t\t<totalRecords>'.$this->getSize().'</totalRecords>\n\t\t\t\t<items>';\n\t\t\tforeach ($this->getItems() as $_item)\n\t\t\t{\n\t\t\t\t$xml .= $_item->toXml();\n\t\t\t}\n\t\t\t$xml .= '</items>\n\t\t\t\t</collection>';\n\t\t\treturn $xml;\n\t\t}", "abstract protected function buildXml();", "public function toXml()\n {\n $xml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <collection>\n <totalRecords>'.$this->_totalRecords.'</totalRecords>\n <items>';\n\n foreach ($this as $item) {\n $xml.=$item->toXml();\n }\n $xml.= '</items>\n </collection>';\n return $xml;\n }", "public function toXml()\n {\n $xml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <collection>\n <totalRecords>' . $this->getSize() . '</totalRecords>\n <items>';\n\n foreach ($this as $item) {\n $xml .= $item->toXml();\n }\n $xml .= '</items>\n </collection>';\n return $xml;\n }", "public function buildXml()\n {\n $dom = new \\DOMDocument();\n $dom->formatOutput = true;\n \n $dom->appendChild($dom->createElement('Certificate'));\n $node = simplexml_import_dom($dom);\n foreach ($this as $field => $value) {\n if (!is_object($value)) {\n $node->addChild($field, $value);\n }\n }\n \n if (! empty($this->documents)) {\n $documents = $node->addChild('documents');\n foreach ($this->documents as $document) {\n $doc = $documents->addChild('document');\n $doc->addChild('document_name', $document->document_name);\n $doc->addChild('document_type', $document->document_type);\n }\n }\n \n if (! empty($this->history)) {\n $prices = $node->addChild('prices');\n foreach ($this->history as $price) {\n $doc = $prices->addChild('price');\n $doc->addChild('creation_date', date('d-m-y h:i:s', $price->creation_date));\n $doc->addChild('price', $price->price);\n }\n }\n return $dom->saveXML();\n }", "public function toXml();", "abstract function buildXml();", "public function getXml(){\n \n if( !$this->_firstName && !$this->_cardNumber && !$this->_expirationDate){\n return false;\n }\n \n $xml = \n \"<billTo>\".\n \"<firstName>{$this->_firstName}</firstName>\".\n \"<lastName>{$this->_lastName}</lastName>\".\n //\"<company></company>\".\n \"<address>{$this->_address}</address>\".\n \"<city>{$this->_city}</city>\".\n \"<state>{$this->_state}</state>\".\n \"<zip>{$this->_zip}</zip>\".\n \"<country>{$this->_country}</country>\".\n \"<phoneNumber>{$this->_phoneNumber}</phoneNumber>\".\n \"<faxNumber>{$this->_faxNumber}</faxNumber>\".\n \"</billTo>\".\n \"<payment>\".\n \"<creditCard>\".\n \"<cardNumber>{$this->_cardNumber}</cardNumber>\";\n if($this->_expirationDate){\n $xml .= \"<expirationDate>{$this->_expirationDate}</expirationDate>\";\n }else{\n $xml .= \"<expirationDate>XXXX</expirationDate>\";\n }\n if($this->_cardCode){\n $xml .= \"<cardCode>{$this->_cardCode}</cardCode>\";\n }\n \n $xml .= \"</creditCard>\".\n \"</payment>\";\n return $xml;\n }", "abstract public function toXML();", "public function toXML();", "public function to_xml() {\n\n\t\t// Start Invoice\n\t\t$xml = '<Invoice>';\n\n\t\t// Type\n\t\t$xml .= '<Type>' . $this->get_type() . '</Type>';\n\n\t\t// Add Contact\n\t\tif ( $this->get_contact()->get_id() ) {\n\t\t\t$xml .= $this->get_contact()->id_to_xml();\n\t\t} else {\n\t\t\t$xml .= $this->get_contact()->to_xml();\n\t\t}\n\n\t\t// Date\n\t\t$xml .= '<Date>' . $this->get_date() . '</Date>';\n\n\t\t// Due Date\n\t\t$xml .= '<DueDate>' . $this->get_due_date() . '</DueDate>';\n\n\t\t// Invoice Number\n\t\t$invoice_number = $this->get_invoice_number();\n\t\tif ( null !== $invoice_number ) {\n\t\t\t$xml .= \"<InvoiceNumber>$invoice_number</InvoiceNumber>\";\n\t\t}\n\n\t\t// Line Amount Types. Always send prices exclusive VAT.\n\t\t$xml .= '<LineAmountTypes>Exclusive</LineAmountTypes>';\n\n\t\t// Get Line Items\n\t\t$line_items = $this->get_line_items();\n\n\t\t// Check line items\n\t\tif ( count( $line_items ) ) {\n\n\t\t\t// Line Items wrapper open\n\t\t\t$xml .= '<LineItems>';\n\n\t\t\t// Loop\n\t\t\tforeach ( $line_items as $line_item ) {\n\n\t\t\t\t// Add\n\t\t\t\t$xml .= $line_item->to_xml();\n\n\t\t\t}\n\n\t\t\t// Line Items wrapper close\n\t\t\t$xml .= '</LineItems>';\n\t\t}\n\n\t\t// Currency Code\n\t\t$xml .= '<CurrencyCode>' . $this->get_currency_code() . '</CurrencyCode>';\n\n\t\t// Status\n\t\t$xml .= '<Status>AUTHORISED</Status>';\n\n\t\t// Total Tax\n\t\t$xml .= '<TotalTax>' . $this->get_total_tax() . '</TotalTax>';\n\n\t\t// Total\n\t\t$xml .= '<Total>' . $this->get_total() . '</Total>';\n\n\t\t// End Invoice\n\t\t$xml .= '</Invoice>';\n\n\t\treturn $xml;\n\t}", "private function generateSetChargeXml() {\n\t\t$this->xmlResponse = new apiXmlWriter();\n\t\t$this->rawResponse = $this->xmlResponse->startElements()->addHeader($this->errorCode,$this->errorMessage,self::SET_CHARGE_REQUEST_STRING)->addBodySetCharge()->endElements()->toString();\n\t}", "public function preGenerateXml()\n {\n }", "public static function exportXML()\r\n {\r\n $productos = self::findAll();\r\n $xml=\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\";\r\n $xml.=\"<productos>\\n\";\r\n foreach ($productos as $producto) {\r\n $xml.=\"<producto>\\n\";\r\n foreach ($producto as $key=>$value) {\r\n $xml.=\"<$key>\".$value.\"</$key>\\n\"; \r\n } \r\n $xml.=\"</producto>\\n\";\r\n }\r\n $xml .= \"</productos>\";\r\n return $xml;\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns whether a from address has been set
public function fromExists () { return isset( $this->from ); }
[ "public function hasAddress(): bool;", "public function hasAddress() : bool\n {\n return isset($this->address);\n }", "public function hasAddress()\n {\n return $this->address !== null;\n }", "public function hasAddress() {\n return !empty($this->has_address);\n }", "public function checkAddressExists(){\n\t\treturn true;\n\t}", "public function hasFrom()\n {\n return $this->get(self::FROM) !== null;\n }", "public function hasFromid()\n {\n return $this->get(self::FROMID) !== null;\n }", "public function hasAddress(): bool\n {\n return (bool) $this->loadCount('addresses');\n }", "public function isSetEventAddress()\n {\n return !is_null($this->_fields['EventAddress']['FieldValue']);\n\n }", "public function hasDeliveryAddress() : bool;", "public function getIsAddress()\n {\n return isset($this->is_address) ? $this->is_address : false;\n }", "public function isAddressValid()\n {\n return $this->isValidAddress;\n }", "public function isAddressAvailable()\n {\n return $this->getStreet() !== ''\n && $this->postCode !== ''\n && $this->city !== ''\n && $this->country !== ''\n && $this->phone !== '';\n }", "public function isSetShipToAddress()\n {\n return !is_null($this->_fields['ShipToAddress']['FieldValue']);\n\n }", "public function hasStreet(): bool;", "public function hasInvoiceAddress(): bool\n {\n return isset($this->invoiceAddress);\n }", "public function hasInvoiceAddress() : bool\n {\n return isset($this->invoiceAddress);\n }", "public function hasFromFort()\n {\n return $this->from_fort !== null;\n }", "function isAddressEmpty() {\n\t\t\t$this->_getAddress( );\n\t\t\treturn $this->getAddressHelper( )->isEmpty( $this->_address );\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show Form for resubmitting documents
public function resubmitDocuments($id){ $enquiry = Enquiry::FindOrFail($id); return view('resubmit_documents')->with('enquiry',$enquiry); }
[ "function resubmitForm() {\r\n redirect('repostform');\r\n }", "public function overviewFormSubmit() {}", "protected function saveFormAction()\n {\n // Sets the post variables\n $uriManager = $this->getUriManager();\n $uriManager->setPostVariables();\n\n $this->querier = GeneralUtility::makeInstance(FormUpdateQuerier::class);\n $this->querier->injectController($this);\n $this->querier->injectQueryConfiguration();\n $this->querier->processQuery();\n\n return $this->renderForm('form');\n }", "function\n form($options = \"\")\t\t\t// I - Page options\n {\n global $PHP_SELF, $DOCUMENT_STATUSES, $DOCUMENT_STATUSES_ANY_USER;\n global $html_is_phone, $html_is_tablet;\n global $LOGIN_ID, $LOGIN_IS_ADMIN, $LOGIN_IS_EDITOR, $LOGIN_IS_OFFICER;\n\n\n if ($this->id <= 0)\n $action = \"Submit Document\";\n else\n $action = \"Save Changes\";\n\n html_form_start(\"$PHP_SELF?U$this->id$options\", FALSE, TRUE);\n\n html_form_field_start(\"status\", \"Type\");\n if ($LOGIN_IS_ADMIN || $LOGIN_IS_EDITOR || $LOGIN_IS_OFFICER)\n html_form_select(\"status\", $DOCUMENT_STATUSES, \"\", $this->status);\n else if ($this->create_id == $LOGIN_ID)\n html_form_select(\"status\", $DOCUMENT_STATUSES_ANY_USER, \"\", $this->status);\n else\n print($DOCUMENT_STATUSES[$this->status]);\n html_form_field_end();\n\n html_form_field_start(\"replaces_id\", \"Replaces\");\n if ($LOGIN_IS_ADMIN || $LOGIN_IS_EDITOR || $LOGIN_IS_OFFICER || $this->create_id == $LOGIN_ID)\n document_select(\"replaces_id\", $this->replaces_id, \"None\", \"\", TRUE);\n else if ($this->replaces_id)\n {\n $document = new document($this->replaces_id);\n if ($document->id == $this->replaces_id)\n print($document->display_name());\n else\n print(\"None\");\n }\n else\n print(\"None\");\n html_form_field_end();\n\n html_form_field_start(\"title\", \"Title\", $this->title_valid);\n if ($LOGIN_IS_ADMIN || $LOGIN_IS_EDITOR || $LOGIN_IS_OFFICER || $this->create_id == $LOGIN_ID)\n html_form_text(\"title\", \"The title/summary of the document.\", $this->title);\n else\n print(htmlspecialchars($this->title));\n html_form_field_end();\n\n html_form_field_start(\"version\", \"Version\", $this->title_valid);\n if ($LOGIN_IS_ADMIN || $LOGIN_IS_EDITOR || $LOGIN_IS_OFFICER || $this->create_id == $LOGIN_ID)\n html_form_text(\"version\", \"1.0, 1.1, 2.0, etc.\", $this->version);\n else if ($this->version != \"\")\n print(htmlspecialchars($this->version));\n else\n print(\"None\");\n html_form_field_end();\n\n html_form_field_start(\"number\", \"Standard Number\", $this->title_valid);\n if ($LOGIN_IS_ADMIN || $LOGIN_IS_EDITOR || $LOGIN_IS_OFFICER || $this->create_id == $LOGIN_ID)\n {\n html_form_text(\"series\", \"5100, etc.\", $this->series);\n print(\".\");\n html_form_text(\"number\", \"1, 2, etc.\", $this->number);\n }\n else if ($this->series != 0)\n print(\"$this->series.$this->number\");\n else\n print(\"None\");\n html_form_field_end();\n\n html_form_field_start(\"contents\", \"Abstract\", $this->contents_valid);\n if ($LOGIN_IS_ADMIN || $LOGIN_IS_EDITOR || $LOGIN_IS_OFFICER || $this->create_id == $LOGIN_ID)\n html_form_text(\"contents\", \"An abstract of the document - leave blank for minutes.\", $this->contents,\n\t\t \"Formatting/markup rules:\\n\\n\"\n\t\t .\"! Header\\n\"\n\t\t .\"!! Sub-header\\n\"\n\t\t .\"- Unordered list\\n\"\n\t\t .\"* Unordered list\\n\"\n\t\t .\"1. Numbered list\\n\"\n\t\t .\"\\\" Blockquote\\n\"\n\t\t .\"SPACE preformatted text\\n\"\n\t\t .\"[[link||text label]]\\n\", 10);\n else\n print(html_format($this->contents));\n html_form_field_end();\n\n html_form_field_start(\"editable_url\", \"Editable URL\", $this->editable_url_valid);\n if ($LOGIN_IS_ADMIN || $LOGIN_IS_EDITOR || $LOGIN_IS_OFFICER || $this->create_id == $LOGIN_ID)\n {\n html_form_url(\"editable_url\", \"http://ftp.pwg.org/pub/pwg/WORKGROUP/wd/wd-something-YYYYMMDD.docx\", $this->editable_url);\n if (!$html_is_phone && !$html_is_tablet)\n {\n\tprint(\"<br>Or upload the file: \");\n\thtml_form_file(\"editable_file\");\n }\n }\n else if ($this->editable_url != \"\")\n {\n $link = htmlspecialchars($this->editable_url, ENT_QUOTES);\n print(\"<a href=\\\"$link\\\">$link</a>\");\n }\n else\n print(\"None\");\n html_form_field_end();\n\n html_form_field_start(\"clean_url\", \"Clean Copy URL\", $this->clean_url_valid);\n if ($LOGIN_IS_ADMIN || $LOGIN_IS_EDITOR || $LOGIN_IS_OFFICER || $this->create_id == $LOGIN_ID)\n {\n html_form_url(\"clean_url\", \"http://ftp.pwg.org/pub/pwg/WORKGROUP/wd/wd-something-YYYYMMDD.pdf\", $this->clean_url);\n if (!$html_is_phone && !$html_is_tablet)\n {\n\tprint(\"<br>Or upload the file: \");\n\thtml_form_file(\"clean_file\");\n }\n }\n else if ($this->clean_url != \"\")\n {\n $link = htmlspecialchars($this->clean_url, ENT_QUOTES);\n print(\"<a href=\\\"$link\\\">$link</a>\");\n }\n else\n print(\"None\");\n html_form_field_end();\n\n html_form_field_start(\"redline_url\", \"Redlined Copy URL\", $this->redline_url_valid);\n if ($LOGIN_IS_ADMIN || $LOGIN_IS_EDITOR || $LOGIN_IS_OFFICER || $this->create_id == $LOGIN_ID)\n {\n html_form_url(\"redline_url\", \"http://ftp.pwg.org/pub/pwg/WORKGROUP/wd/wd-something-YYYYMMDD-rev.pdf\", $this->redline_url);\n if (!$html_is_phone && !$html_is_tablet)\n {\n\tprint(\"<br>Or upload the file: \");\n\thtml_form_file(\"redline_file\");\n }\n }\n else if ($this->redline_url != \"\")\n {\n $link = htmlspecialchars($this->redline_url, ENT_QUOTES);\n print(\"<a href=\\\"$link\\\">$link</a>\");\n }\n else\n print(\"None\");\n html_form_field_end();\n\n html_form_field_start(\"workgroup_id\", \"Workgroup\");\n if ($LOGIN_IS_ADMIN || $LOGIN_IS_EDITOR || $LOGIN_IS_OFFICER || $this->create_id == $LOGIN_ID)\n workgroup_select(\"workgroup_id\", $this->workgroup_id, \"None\");\n else if ($this->workgroup_id)\n print(workgroup_name($this->workgroup_id));\n else\n print(\"None\");\n html_form_field_end();\n\n // Submit\n if ($LOGIN_IS_ADMIN || $LOGIN_IS_EDITOR || $LOGIN_IS_OFFICER || $this->create_id == $LOGIN_ID)\n html_form_end(array(\"SUBMIT\" => \"+$action\"));\n else\n html_form_end(array());\n }", "public function form()\n\t{\n\t\tFoundry::requireLogin();\n\n\t\t$ajax = Foundry::ajax();\n\n\t\t$element \t= JRequest::getVar( 'element' ,'');\n\t\t$group \t\t= JRequest::getVar( 'group' ,'');\n\t\t$uid \t\t= JRequest::getInt( 'id');\n\n\t\t// $preview = 'halo this is a preview.';\n\t\t$share \t\t= Foundry::get( 'Repost', $uid, $element, $group );\n\t\t$preview \t= $share->preview();\n\n\t\t// Get dialog\n\t\t$theme = Foundry::themes();\n\t\t$theme->set( 'preview', $preview );\n\n\t\t$html = $theme->output( 'site/repost/dialog.form' );\n\n\t\treturn $ajax->resolve( $html );\n\t}", "function showDeletionForm() {\n\t\t$titleObj = SpecialPage::getTitleFor( 'SpamRegex' );\n\t\t$this->context->getOutput()->addHTML(\n\t\t\tHtml::openElement( 'form', [ 'method' => 'post', 'action' => $titleObj->getFullURL() ] ) .\n\t\t\t\t'<br />' .\n\t\t\t\t$this->context->msg( 'spamregex-unblock-form-text' )->escaped() .\n\t\t\t\t$this->context->msg( 'word-separator' )->escaped() .\n\t\t\t\t'<br />' .\n\t\t\t\tHtml::input( 'text', $this->context->getRequest()->getText( 'text' ) ) .\n\t\t\t\tHtml::hidden( 'action', 'delete' ) .\n\t\t\t\tHtml::hidden( 'token', $this->context->getUser()->getEditToken() ) .\n\t\t\t\tHtml::submitButton( $this->context->msg( 'ipusubmit' )->escaped(), [ 'id' => 'spamregex-submit-btn' ] ) .\n\t\t\t\t'<br />' .\n\t\t\tHtml::closeElement( 'form' )\n\t\t);\n\t}", "function displayForm() {\n\t\t$out = $this->getOutput();\n\t\t$request = $this->getRequest();\n\t\t$user = $this->getUser();\n\n\t\t$p = new Poll();\n\t\t$poll_info = $p->getPoll( $request->getInt( 'id' ) );\n\n\t\tif(\n\t\t !isset($poll_info['id']) ||\n\t\t\t!$poll_info['id'] ||\n\t\t\t!( $user->isAllowed( 'polladmin' ) || $user->getID() == $poll_info['user_id'] )\n\t\t) {\n\t\t\t$out->setPageTitle( $this->msg( 'poll-woops' )->plain() );\n\t\t\t$out->addHTML( $this->msg( 'poll-edit-invalid-access' )->text() );\n\t\t\treturn false;\n\t\t}\n\n\t\t$poll_image_tag = '';\n\t\tif( $poll_info['image'] ) {\n\t\t\t$poll_image_width = 150;\n\t\t\t$poll_image = wfFindFile( $poll_info['image'] );\n\t\t\t$poll_image_url = $width = '';\n\t\t\tif ( is_object( $poll_image ) ) {\n\t\t\t\t$poll_image_url = $poll_image->createThumb( $poll_image_width );\n\t\t\t\tif ( $poll_image->getWidth() >= $poll_image_width ) {\n\t\t\t\t\t$width = $poll_image_width;\n\t\t\t\t} else {\n\t\t\t\t\t$width = $poll_image->getWidth();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$poll_image_tag = '<img width=\"' . $width . '\" alt=\"\" src=\"' . $poll_image_url . '\"/>';\n\t\t}\n\n\t\t$poll_page = Title::newFromID( $request->getInt( 'id' ) );\n\t\t$prev_qs = '';\n\t\tif( $request->getInt( 'prev_poll_id' ) ) {\n\t\t\t$prev_qs = 'prev_id=' . $request->getInt( 'prev_poll_id' );\n\t\t}\n\n\t\t$out->setPageTitle( $this->msg( 'poll-edit-title', $poll_info['question'] )->plain() );\n\n\t\t$form = \"<div class=\\\"update-poll-left\\\">\n\t\t\t<form action=\\\"\\\" method=\\\"post\\\" enctype=\\\"multipart/form-data\\\" name=\\\"form1\\\">\n\t\t\t<input type=\\\"hidden\\\" name=\\\"poll_id\\\" value=\\\"{$poll_info['id']}\\\" />\n\t\t\t<input type=\\\"hidden\\\" name=\\\"prev_poll_id\\\" value=\\\"\" . $request->getInt( 'prev_id' ) . '\" />\n\t\t\t<input type=\"hidden\" name=\"poll_image_name\" id=\"poll_image_name\" />\n\n\t\t\t<h3>' . $this->msg( 'poll-edit-answers' )->text() . '</h3>';\n\n\t\t$x = 1;\n\t\tforeach( $poll_info['choices'] as $choice ) {\n\t\t\t$form .= \"<div class=\\\"update-poll-answer\\\">\n\t\t\t\t\t<span class=\\\"update-poll-answer-number secondary\\\">{$x}.</span>\n\t\t\t\t\t<input type=\\\"text\\\" tabindex=\\\"{$x}\\\" id=\\\"poll_answer_{$x}\\\" name=\\\"poll_answer_{$x}\\\" value=\\\"\" .\n\t\t\t\t\t\thtmlspecialchars( $choice['choice'], ENT_QUOTES ) . '\" />\n\t\t\t\t</div>';\n\t\t\t$x++;\n\t\t}\n\n\t\tglobal $wgRightsText;\n\t\tif ( $wgRightsText ) {\n\t\t\t$copywarnMsg = 'copyrightwarning';\n\t\t\t$copywarnMsgParams = array(\n\t\t\t\t'[[' . $this->msg( 'copyrightpage' )->inContentLanguage()->plain() . ']]',\n\t\t\t\t$wgRightsText\n\t\t\t);\n\t\t} else {\n\t\t\t$copywarnMsg = 'copyrightwarning2';\n\t\t\t$copywarnMsgParams = array(\n\t\t\t\t'[[' . $this->msg( 'copyrightpage' )->inContentLanguage()->plain() . ']]'\n\t\t\t);\n\t\t}\n\n\t\t$form .= '</form>\n\t\t\t</div><!-- .update-poll-left -->\n\n\t\t\t\n\t\t<div class=\"visualClear\"></div>\n\t\t<!--<div class=\"update-poll-warning\">' . $this->msg( $copywarnMsg, $copywarnMsgParams )->parse() . \"</div>-->\n\t\t<div class=\\\"update-poll-buttons\\\">\n\t\t\t<input type=\\\"button\\\" class=\\\"site-button\\\" value=\\\"\" . $this->msg( 'poll-edit-button' )->plain() . \"\\\" size=\\\"20\\\" onclick=\\\"document.form1.submit()\\\" />\n\t\t\t<input type=\\\"button\\\" class=\\\"site-button\\\" value=\\\"\" . $this->msg( 'poll-cancel-button' )->plain() . \"\\\" size=\\\"20\\\" onclick=\\\"window.location='\" . $poll_page->getFullURL( $prev_qs ) . \"'\\\" />\n\t\t</div>\";\n\t\treturn $form;\n\t}", "function showPreviewForm()\n {\n $ok = $this->preview();\n if (!$ok) {\n // @todo FIXME maybe provide a cancel button or link back?\n return;\n }\n\n $this->elementStart('div', 'entity_actions');\n $this->elementStart('ul');\n $this->elementStart('li', 'entity_subscribe');\n $this->elementStart('form', array('method' => 'post',\n 'id' => 'form_ostatus_sub',\n 'class' => 'form_remote_authorize',\n 'action' =>\n $this->selfLink()));\n $this->elementStart('fieldset');\n $this->hidden('token', common_session_token());\n $this->hidden('profile', $this->profile_uri);\n if ($this->oprofile->isGroup()) {\n // TRANS: Button text.\n $this->submit('submit', _m('Join'), 'submit', null,\n // TRANS: Tooltip for button \"Join\".\n _m('BUTTON','Join this group'));\n } else {\n // TRANS: Button text.\n $this->submit('submit', _m('BUTTON','Confirm'), 'submit', null,\n // TRANS: Tooltip for button \"Confirm\".\n _m('Subscribe to this user'));\n }\n $this->elementEnd('fieldset');\n $this->elementEnd('form');\n $this->elementEnd('li');\n $this->elementEnd('ul');\n $this->elementEnd('div');\n }", "public function showResendForm() {\r\n\r\n return view('auth.activate.resend');\r\n }", "public function submit_view (){\n extract( $this->kernel->params );\n\n if( $this->acl and !$this->kernel->acl_can_read() ){\n $this->kernel->templ->assign(\"result_message\", \"no_access\");\n return;\n }\n\n if( $this->row = $this->getOne( $id ) ){\n $this->kernel->params_html = array_merge( $this->kernel->params_html, $this->row );\n $this->kernel->templ->assign(\"params\", $this->kernel->params_html);\n }\n\n $this->template = SUBMIT_VIEW;\n\n }", "function ShowFinalStep()\n\t{\n\t\t$formsession = IEM::sessionGet('Form');\n\n\t\t$GLOBALS['Action'] = 'Finish';\n\n\t\t$formid = 0; $loaded = false;\n\n\t\tif (isset($formsession['FormID'])) {\n\t\t\t$formid = (int)$formsession['FormID'];\n\t\t}\n\n\t\t$formapi = $this->GetApi();\n\n\t\tif ($formid > 0) {\n\t\t\t$loaded = $formapi->Load($formid);\n\t\t\tif ($loaded) {\n\t\t\t\t$GLOBALS['CancelButton'] = GetLang('EditFormCancelButton');\n\t\t\t\t$GLOBALS['Heading'] = GetLang('EditForm');\n\t\t\t\t$GLOBALS['Intro'] = GetLang('EditFormIntro');\n\n\t\t\t\t$GLOBALS['HTMLHelpTip'] = $this->_GenerateHelpTip('HLP_ErrorPageHTML');\n\n\t\t\t\tif ($formsession['FormType'] == 'm') {\n\t\t\t\t\t$GLOBALS['HTMLHelpTip'] = $this->_GenerateHelpTip('HLP_ErrorPageHTML_Modify');\n\n\t\t\t\t\t$form_lists = $formapi->Get('lists');\n\t\t\t\t\t$form_customfields = $formapi->Get('customfields');\n\t\t\t\t\t$form_design = $formapi->Get('design');\n\t\t\t\t\t$form_format = $formapi->Get('chooseformat');\n\t\t\t\t\t$form_changeformat = $formapi->Get('changeformat');\n\t\t\t\t\t$form_usecaptcha = $formapi->Get('usecaptcha');\n\n\t\t\t\t\t// in case the lists were in the $_POST variable in different order or something,\n\t\t\t\t\t// we'll sort them before doing a comparison.\n\t\t\t\t\tsort($form_lists);\n\t\t\t\t\tsort($formsession['IncludeLists']);\n\n\t\t\t\t\t// if the form itself is the same (includes the same options, lists etc)\n\t\t\t\t\tif (\n\t\t\t\t\t\t$form_lists == $formsession['IncludeLists']\n\t\t\t\t\t\t&& $form_customfields == $formsession['CustomFieldsOrder']\n\t\t\t\t\t\t&& $form_design == $formsession['FormDesign']\n\t\t\t\t\t\t&& $form_format == $formsession['SubscriberChooseFormat']\n\t\t\t\t\t\t&& $form_changeformat == $formsession['SubscriberChangeFormat']\n\t\t\t\t\t\t&& trim($form_usecaptcha) == trim($formsession['UseCaptcha'])\n\t\t\t\t\t) {\n\t\t\t\t\t\t// then just get the old html so we can edit it.\n\t\t\t\t\t\t$GLOBALS['EditFormHTMLContents'] = htmlspecialchars($formapi->Get('formhtml'), ENT_QUOTES, SENDSTUDIO_CHARSET);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// if any of the options have been changed, regenerate the html.\n\t\t\t\t\t\t$formapi->Set('formtype', $formsession['FormType']);\n\t\t\t\t\t\t$formapi->Set('design', $formsession['FormDesign']);\n\t\t\t\t\t\t$formapi->Set('lists', $formsession['IncludeLists']);\n\t\t\t\t\t\t$formapi->Set('customfields', $formsession['CustomFields']);\n\t\t\t\t\t\t// overide the value of this based on the formsession.\n\t\t\t\t\t\t$formapi->Set('fieldorder', $formsession['CustomFieldsOrder']);\n\t\t\t\t\t\t$formapi->Set('changeformat', $formsession['SubscriberChangeFormat']);\n\t\t\t\t\t\t$formapi->Set('usecaptcha', $formsession['UseCaptcha']);\n\t\t\t\t\t\t$GLOBALS['EditFormHTMLContents'] = htmlspecialchars($formapi->GetHTML(), ENT_QUOTES, SENDSTUDIO_CHARSET);\n\n\t\t\t\t\t\t$GLOBALS['Warning'] = sprintf(GetLang('FormContentsHaveChanged'), $formid);\n\t\t\t\t\t\t$GLOBALS['Message'] = $this->ParseTemplate('WarningMsg', true, false);\n\t\t\t\t\t}\n\t\t\t\t\t$GLOBALS['EditFormHTML'] = $this->ParseTemplate('Form_Edit_HTML', true, false);\n\t\t\t\t}\n\n\t\t\t\tif ($formsession['FormType'] == 'f') {\n\t\t\t\t\t$GLOBALS['HTMLHelpTip'] = $this->_GenerateHelpTip('HLP_ErrorPageHTML_SendFriend');\n\n\t\t\t\t\t$form_design = $formapi->Get('design');\n\t\t\t\t\t$form_format = $formapi->Get('chooseformat');\n\t\t\t\t\tif (\n\t\t\t\t\t\t$form_design == $formsession['FormDesign'] &&\n\t\t\t\t\t\t$form_format == $formsession['SubscriberChooseFormat']\n\t\t\t\t\t) {\n\t\t\t\t\t\t// then just get the old html so we can edit it.\n\t\t\t\t\t\t$GLOBALS['EditFormHTMLContents'] = htmlspecialchars($formapi->Get('formhtml'), ENT_QUOTES, SENDSTUDIO_CHARSET);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// if any of the options have been changed, regenerate the html.\n\t\t\t\t\t\t$formapi->Set('formtype', $formsession['FormType']);\n\t\t\t\t\t\t$formapi->Set('design', $formsession['FormDesign']);\n\t\t\t\t\t\t$GLOBALS['EditFormHTMLContents'] = htmlspecialchars($formapi->GetHTML(), ENT_QUOTES, SENDSTUDIO_CHARSET);\n\n\t\t\t\t\t\t$GLOBALS['Warning'] = sprintf(GetLang('FormContentsHaveChanged'), $formid);\n\t\t\t\t\t\t$GLOBALS['Message'] = $this->ParseTemplate('WarningMsg', true, false);\n\t\t\t\t\t}\n\t\t\t\t\t$GLOBALS['EditFormHTML'] = $this->ParseTemplate('Form_Edit_HTML', true, false);\n\t\t\t\t}\n\n\t\t\t\t$GLOBALS['ErrorPageHTML'] = $formapi->pages['ErrorPage']['html'];\n\t\t\t\t$GLOBALS['ErrorPageURL'] = $formapi->pages['ErrorPage']['url'];\n\t\t\t}\n\t\t}\n\n\t\tif ($formid <= 0 || !$loaded) {\n\t\t\t$GLOBALS['CancelButton'] = GetLang('CreateFormCancelButton');\n\t\t\t$GLOBALS['Heading'] = GetLang('CreateForm');\n\t\t\tswitch ($formsession['FormType']) {\n\n\t\t\t\tcase 'f':\n\t\t\t\t\t$GLOBALS['HTMLHelpTip'] = $this->_GenerateHelpTip('HLP_ErrorPageHTML_SendFriend');\n\n\t\t\t\t\t// because this is a send-to-friend form, we have to set all the form api variables before we can get the html back.\n\t\t\t\t\t$formapi->Set('formtype', 'f');\n\t\t\t\t\t$formapi->Set('design', $formsession['FormDesign']);\n\t\t\t\t\t$GLOBALS['EditFormHTMLContents'] = htmlspecialchars($formapi->GetHTML(), ENT_QUOTES, SENDSTUDIO_CHARSET);\n\t\t\t\t\t$GLOBALS['EditFormHTML'] = $this->ParseTemplate('Form_Edit_HTML', true, false);\n\t\t\t\t\t$GLOBALS['ErrorPageHTML'] = GetLang('FormErrorPageHTML_SendFriend');\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'm':\n\t\t\t\t\t// because this is a modify details form, we have to set all the form api variables before we can get the html back.\n\n\t\t\t\t\t$GLOBALS['HTMLHelpTip'] = $this->_GenerateHelpTip('HLP_ErrorPageHTML_Modify');\n\n\t\t\t\t\t$formapi->Set('formtype', 'm');\n\t\t\t\t\t$formapi->Set('design', $formsession['FormDesign']);\n\t\t\t\t\t$formapi->Set('lists', $formsession['IncludeLists']);\n\t\t\t\t\t$formapi->Set('customfields', $formsession['CustomFields']);\n\t\t\t\t\t$formapi->Set('fieldorder', $formsession['CustomFieldsOrder']);\n\t\t\t\t\t$formapi->Set('usecaptcha', $formsession['UseCaptcha']);\n\t\t\t\t\t$GLOBALS['EditFormHTMLContents'] = htmlspecialchars($formapi->GetHTML(), ENT_QUOTES, SENDSTUDIO_CHARSET);\n\t\t\t\t\t$GLOBALS['EditFormHTML'] = $this->ParseTemplate('Form_Edit_HTML', true, false);\n\t\t\t\t\t$GLOBALS['ErrorPageHTML'] = GetLang('FormErrorPageHTML_Modify');\n\t\t\t\tbreak;\n\n\t\t\t\tcase 's':\n\t\t\t\t\t$GLOBALS['HTMLHelpTip'] = $this->_GenerateHelpTip('HLP_ErrorPageHTML_Subscribe');\n\n\t\t\t\t\t$GLOBALS['ErrorPageHTML'] = GetLang('FormErrorPageHTML_Subscribe');\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'u':\n\t\t\t\t\t$GLOBALS['HTMLHelpTip'] = $this->_GenerateHelpTip('HLP_ErrorPageHTML_Unsubscribe');\n\n\t\t\t\t\t$GLOBALS['ErrorPageHTML'] = GetLang('FormErrorPageHTML_Unsubscribe');\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$GLOBALS['ErrorPageURL'] = 'http://';\n\t\t}\n\n\t\t$GLOBALS['ErrorPageUrlStyle'] = 'none';\n\t\t$GLOBALS['ErrorPageHTMLStyle'] = \"''\";\n\t\t$GLOBALS['ErrorPageUrlField'] = '';\n\t\t$GLOBALS['ErrorPageHTMLField'] = ' CHECKED';\n\n\t\tif ($GLOBALS['ErrorPageURL'] != 'http://' && $GLOBALS['ErrorPageURL'] != '') {\n\t\t\t$GLOBALS['ErrorPageUrlStyle'] = \"''\";\n\t\t\t$GLOBALS['ErrorPageHTMLStyle'] = 'none';\n\t\t\t$GLOBALS['ErrorPageUrlField'] = ' CHECKED';\n\t\t\t$GLOBALS['ErrorPageHTMLField'] = '';\n\t\t}\n\n\t\t$GLOBALS['HTMLContent'] = $this->GetHTMLEditor($GLOBALS['ErrorPageHTML'], false, 'errorhtml', 'exact', 260, 400);\n\t\t$GLOBALS['HTMLEditorName'] = 'errorhtml';\n\t\t$GLOBALS['ErrorHTML'] = $this->ParseTemplate('Form_Editor_HTML', true, false);\n\n\t\t$GLOBALS['Intro'] = GetLang('FinalPageIntro');\n\n\t\t$this->ParseTemplate('Form_Form_Step3');\n\t}", "public function openForm() {\n\t\t$this->html = \"<form action='{$this->action}' method='{$this->method}'>\" . PHP_EOL;\n\t}", "function add_document_form_submit( $form, &$form_state ) {\n $values = $form_state[ 'values' ][ 'field_student_documents' ][ 'und' ];\n $type = $form_state[ 'values' ][ 'document_type' ];\n $clientid = $form_state[ 'values' ][ 'clientid' ];\n agent_handle_newdocuments( $type, $values, $clientid );\n _drupal_to_sugar_application_api( $form_state[ 'values' ], 'STEP-3(Upload Document)', $clientid );\n drupal_set_message( 'Documents are saved!' );\n $options = array( 'absolute' => TRUE, 'fragment' => 'tab/2' );\n $redirect = 'agent/client/add/' . $clientid . '/document';\n drupal_goto( $redirect );\n}", "public function closeForm() {\n\t\t$this->html .= \"<div><input type='submit' value='{$this->value}'/></div>\" . PHP_EOL;\n\t\t$this->html .= \"</form>\" . PHP_EOL;\n\t}", "function post_your_cv_page()\n {\n echo resume_form();\n }", "function on_Submit() {\n /* \"fix\" the IE image button issue */\n $thebutton=getButton();\n // Determine if OK was clicked\n if ($thebutton==\"OK\" & $this->hasAccess('w')) { \n foreach ($this->fields as $fieldname => $field) {\n \t$dbfieldname=$field->dbname;\n \t$fieldname=$field->name; \n \tif (($dbfieldname<>\"\") & !$this->fields[$fieldname]->hasAttribute('s')){\n \t\t$value=$this->fields[$fieldname]->getValue();\n\t \t$GLOBALS['registry']->setValue($this->registrymodule,$this->registrysection,$dbfieldname,$value); \n }\n }\n $GLOBALS['content']['statusline']=\"[OK: The registry has been updated]\";\n } else { \n $GLOBALS['content']['statusline']=\"[Cancel: The action has been cancelled]\";\n }\n \n if ($GLOBALS['req_rootform']==false) {\n // force using the foreign key values saved in the object by clearing the request vars\n $GLOBALS['req_foreign_key_name']=\"\";\n $GLOBALS['req_foreign_key_value']='';\n $GLOBALS['req_form_new']=\"\";\n }\n\n\t\tif ($this->jumplist[$thebutton]) {\n \t$formid=$this->jumplist[$thebutton];\n } else {\n \t$formid=$this->_parent_form_name;\n }\n return $this->decodeFormID($formid); \n }", "private function output_form( ) {\n\t\tglobal $wgOut;\n\t\t$this->setHeaders();\n\t\t$wgOut->addWikiMsg( 'archivelinks-view-archive-desc' );\n\n\t\t$wgOut->addHTML(\n\t\t\tHTML::openElement( 'form', array( 'method' => 'get', 'action' => SpecialPage::getTitleFor( 'ViewArchive' )->getLocalUrl() ) ) .\n\t\t\tHTML::openElement( 'fieldset' ) .\n\t\t\tHTML::element('legend', null, wfMsg('ViewArchive') ) .\n\t\t\tXML::inputLabel( wfMsg( 'archivelinks-view-archive-url-field' ), 'archive_url', 'archive-links-archive-url', 120 ) .\n\t\t\tHTML::element( 'br' ) .\n\t\t\tXML::submitButton( wfMsg( 'archivelinks-view-archive-submit-button' ) ) .\n\t\t\tHTML::closeElement( 'fieldset' ) .\n\t\t\tHTML::closeElement( 'form' )\n\t\t\t);\n\t}", "function om_show_om_showreport_form_submit($form, &$form_state) {\n $form_state['rebuild'] = TRUE;\n}", "function print_question_form_end($question, $submitscript='') {\n // It prints the submit, copy, and cancel buttons and the standard hidden form fields\n global $USER;\n echo '<tr valign=\"top\">\n <td colspan=\"2\" align=\"center\">\n <input type=\"submit\" '.$submitscript.' value=\"'.get_string('savechanges').'\" /> ';\n if ($question->id) {\n echo '<input type=\"submit\" name=\"makecopy\" '.$submitscript.' value=\"'.get_string(\"makecopy\", \"quiz\").'\" /> ';\n }\n echo '<input type=\"submit\" name=\"cancel\" value=\"'.get_string(\"cancel\").'\" />\n <input type=\"hidden\" name=\"sesskey\" value=\"'.$USER->sesskey.'\" />\n <input type=\"hidden\" name=\"id\" value=\"'.$question->id.'\" />\n <input type=\"hidden\" name=\"qtype\" value=\"'.$question->qtype.'\" />';\n // The following hidden field indicates that the versioning code should be turned on, i.e.,\n // that old versions should be kept if necessary\n echo '<input type=\"hidden\" name=\"versioning\" value=\"on\" />\n </td></tr>';\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
tribe events: replace wording / EXAMPLE OF CHANGING ANY TEXT (STRING) IN THE EVENTS CALENDAR See the codex to learn more about WP text domains: Example Tribe domains: 'tribeeventscalendar', 'tribeeventscalendarpro'... Put your custom text here in a key => value pair Example: 'Text you want to change' => 'This is what it will be changed to'. The text you want to change is the key, and it is casesensitive. The text you want to change it to is the value. You can freely add or remove key => values, but make sure to separate them with a comma. This example changes the label "Venue" to "Location", "Related Events" to "Similar Events", and "(Now or date) onwards" to "Calendar you can discard the dynamic portion of the text as well if desired.
function tribe_replace_strings() { $custom_text = [ 'Upcoming' => 'On View', // 'Related %s' => 'Similar %s', // '%s onwards' => 'Calendar', ]; return $custom_text; }
[ "function tribe_custom_theme_text ( $translation, $text, $domain ) {\n\n\t// Put your custom text here in a key => value pair\n\t// Example: 'Text you want to change' => 'This is what it will be changed to'\n\t// The text you want to change is the key, and it is case-sensitive\n\t// The text you want to change it to is the value\n\t// You can freely add or remove key => values, but make sure to separate them with a comma\n\t// This example changes the label \"Venue\" to \"Location\", and \"Related Events\" to \"Similar Events\"\n\t$custom_text = array(\n\t\t'Venue' => 'Location',\n 'Category: ' => 'Style: ',\n 'Additional information' => 'Additional Details'\n\t);\n\n // If this text domain starts with \"tribe-\", \"the-events-\", or \"event-\" and we have replacement text\n \tif( (strpos($domain, 'tribe-') === 0 || strpos($domain, 'the-events-') === 0 || strpos($domain, 'event-') === 0) && array_key_exists($translation, $custom_text) ) {\n\t\t$translation = $custom_text[$translation];\n\t}\n\n return $translation;\n}", "function pmpro_events_pmpro_text_filter( $text ) {\r\n\tglobal $post;\r\n\r\n\t$event_slugs = apply_filters( 'pmpro_events_supports_event_slug', array( 'event' ) );\r\n\r\n\tif( is_singular( $event_slugs ) ) {\r\n\t\t$text = str_replace( 'content', 'event', $text );\r\n\t}\r\n\treturn $text;\r\n}", "function replace_en($string, $eventTitle=''){\n\t\t\t\treturn (empty($eventTitle))?\n\t\t\t\t\tstr_replace('[event-name]', \"<span class='eventName'>Event Name</span>\", $string):\n\t\t\t\t\tstr_replace('[event-name]', $eventTitle, $string);\n\t\t\t}", "function theme_change_fields( $translated_text, $text, $domain ) {\n\t\t$lang = qtrans_getLanguage();\n\t\tswitch ( $translated_text ) {\n\t\n\t\t\tcase 'Some text' :\n\t\n\t\t\t\t$translated_text = __( 'First Name ', 'theme_text_domain' ) . $lang;\n\t\t\t\tbreak;\n\t\n\t\t\tcase 'Email' :\n\t\n\t\t\t\t$translated_text = __( 'Email Address', 'theme_text_domain' );\n\t\t\t\tbreak;\n\t\t}\n\t\n\t\n\t\treturn $translated_text;\n\t}", "function mbwt_text_changes( $translated_text, $text, $domain ) {\n\n\tswitch ( $translated_text ) {\n\t\tcase 'Sort by newness' :\n\t\t\t$translated_text = __( 'Sort by Date Added', 'theme_text_domain' );\n\t\tbreak;\n\t}\n\n\treturn $translated_text;\n}", "function acf_change_scholarship_abstract_label($field ){\n switch($_GET['scholarship_category']){\n case 'Book Chapter':\n $field['label'] = \"Essay Abstract\";\n break;\n case 'Film':\n case 'Book':\n case 'Blog Post';\n case 'Conference Paper':\n case 'Dissertation':\n case 'Exhibition Catalog':\n case 'Review':\n $field['label'] = $_GET['scholarship_category'] . \" Abstract\";\n break;\n case 'Digital Humanities':\n case 'Exhibition Curated': \n $field['label'] = \"Description\";\n break;\n }\n\n return $field;\n}", "static public function text_changes( $translated_text, $text, $domain ) {\n if ( 'woocommerce' == $domain ) {\n if ( 'Related Products' == $text ) {\n $translated_text = __( 'You may also like', 'functionality-plugin' );\n }\n }\n\n return $translated_text;\n }", "function _ReplaceCustomFields(&$text, &$subscriberaddress)\n\t{\n\t\tif (!isset($this->_RecipientsCustomFields[$subscriberaddress])) {\n\t\t\treturn;\n\t\t}\n\n\t\t$info = $this->_RecipientsCustomFields[$subscriberaddress];\n\n\t\t$text = str_replace(array('%LISTS%', '%lists%'), '%%listname%%', $text);\n\n\t\t$text = str_replace(array('%BASIC:EMAIL%', '%basic:email%', '%email%', '%EMAIL%'), '%%emailaddress%%', $text);\n\n\t\t$basefields = array('emailaddress', 'confirmed', 'format', 'subscribedate', 'listname');\n\t\tforeach ($basefields as $p => $field) {\n\t\t\t$field = strtolower($field);\n\n\t\t\tif (!isset($info[$field])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$fielddata = $info[$field];\n\t\t\tif ($field == 'subscribedate') {\n\t\t\t\t$fielddata = date(LNG_DateFormat, $fielddata);\n\t\t\t}\n\t\t\t$fieldname = '%%' . $field . '%%';\n\t\t\t$text = str_replace($fieldname, $fielddata, $text);\n\t\t\tunset($fielddata);\n\t\t}\n\n\t\t$web_version_link = SENDSTUDIO_APPLICATION_URL . '/display.php?M=' . $info['subscriberid'];\n\t\t$web_version_link .= '&C=' . $info['confirmcode'];\n\n\t\tif (isset($info['listid'])) {\n\t\t\t$web_version_link .= '&L=' . $info['listid'];\n\t\t}\n\n\t\tif (isset($info['newsletter'])) {\n\t\t\t$web_version_link .= '&N=' . $info['newsletter'];\n\t\t}\n\n\t\tif (isset($info['autoresponder'])) {\n\t\t\t$web_version_link .= '&A=' . $info['autoresponder'];\n\t\t}\n\n\t\t$text = str_replace(array('%%webversion%%', '%%WEBVERSION%%'), $web_version_link, $text);\n\n\t\t$mailinglist_archives_link = SENDSTUDIO_APPLICATION_URL . '/rss.php?M=' . $info['subscriberid'];\n\t\t$mailinglist_archives_link .= '&C=' . $info['confirmcode'];\n\n\t\tif (isset($info['listid'])) {\n\t\t\t$mailinglist_archives_link .= '&L=' . $info['listid'];\n\t\t}\n\n\t\t$text = str_replace(array('%%mailinglistarchive%%', '%%MAILINGLISTARCHIVE%%'), $mailinglist_archives_link, $text);\n\n\n\t\t$confirmlink = SENDSTUDIO_APPLICATION_URL . '/confirm.php?E=' . urlencode($info['emailaddress']);\n\t\tif (isset($info['listid'])) {\n\t\t\t$confirmlink .= '&L=' . $info['listid'];\n\t\t}\n\n\t\t$confirmlink .= '&C=' . $info['confirmcode'];\n\n\t\t$text = str_replace(array('%%confirmlink%%', '%%CONFIRMLINK%%', '%CONFIRMLINK%', '%confirmlink%'), $confirmlink, $text);\n\n\t\t$text = str_replace(array('%basic:confirmlink%', '%BASIC:CONFIRMLINK%'), $confirmlink, $text);\n\n\t\t$unsubscribelink = SENDSTUDIO_APPLICATION_URL . '/unsubscribe.php?';\n\n\t\t$linkdata = 'M=' . $info['subscriberid'];\n\n\t\t// so we can track where someone unsubscribed from, we'll add that into the url.\n\t\tif (isset($info['newsletter'])) {\n\t\t\t$linkdata .= '&N=' . $info['statid'];\n\t\t}\n\n\t\tif (isset($info['autoresponder'])) {\n\t\t\t$linkdata .= '&A=' . $info['statid'];\n\t\t}\n\n\t\tif (isset($info['listid'])) {\n\t\t\t$linkdata .= '&L=' . $info['listid'];\n\t\t}\n\n\t\t$linkdata .= '&C=' . $info['confirmcode'];\n\n\t\t$unsubscribelink .= $linkdata;\n\n\t\t$text = str_replace(array('%basic:confirmunsublink%', '%BASIC:CONFIRMUNSUBLINK%'), $confirmlink, $text);\n\n\t\t$open_image = '<img src=\"' . SENDSTUDIO_APPLICATION_URL . '/open.php?' . str_replace('&C='.$info['confirmcode'], '', $linkdata) . '\">';\n\n\t\tif (!$this->disableunsubscribe) {\n\t\t\t// preg_replace takes up too much memory so we'll do double replace.\n\t\t\t// we can't do it as an array because that takes up too much memory as well.\n\t\t\t$text = str_replace(array('%%UNSUBSCRIBELINK%%','%%unsubscribelink%%'), $unsubscribelink, $text);\n\n\t\t\t$text = str_replace(array('%basic:unsublink%', '%BASIC:UNSUBLINK%'), $unsubscribelink, $text);\n\n\t\t\t$text = str_replace(array('%%UNSUBSCRIBE%%','%%unsubscribe%%'), $unsubscribelink, $text);\n\n\t\t\t$text = str_replace('%%openimage%%', $open_image, $text);\n\n\t\t\tpreg_match_all('/%%modifydetails_(.*?)%%/i', $text, $matches);\n\t\t\tif (isset($matches[1]) && !empty($matches[1])) {\n\t\t\t\tforeach ($matches[1] as $p => $mtch) {\n\t\t\t\t\t$replaceurl = SENDSTUDIO_APPLICATION_URL . '/modifydetails.php?' . $linkdata . '&F=' . $mtch;\n\t\t\t\t\t$text = str_replace($matches[0][$p], $replaceurl, $text);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$matches = array();\n\n\t\t\tpreg_match('/%%sendfriend_(.*?)%%/i', $text, $matches);\n\t\t\tif (isset($matches[1]) && !empty($matches[1])) {\n\t\t\t\t$extra = '';\n\t\t\t\tif (isset($info['newsletter'])) {\n\t\t\t\t\t$extra = '&i=' . $info['newsletter'];\n\t\t\t\t}\n\n\t\t\t\tif (isset($info['autoresponder'])) {\n\t\t\t\t\t$extra = '&i=' . $info['autoresponder'];\n\t\t\t\t}\n\n\t\t\t\t$replaceurl = SENDSTUDIO_APPLICATION_URL . '/sendfriend.php?' . $linkdata . '&F=' . $matches[1] . $extra;\n\n\t\t\t\t$text = str_replace($matches[0], $replaceurl, $text);\n\t\t\t}\n\t\t\t$matches = array();\n\n\t\t} else {\n\t\t\t$text = str_replace('%%openimage%%', '', $text);\n\t\t\t$text = preg_replace('/%%modifydetails_(.*)%%/i', '#', $text);\n\t\t\t$text = preg_replace('/%%sendfriend_(.*)%%/i', '#', $text);\n\n\t\t\t$text = str_replace(array('%%UNSUBSCRIBELINK%%','%%unsubscribelink%%'), '#', $text);\n\t\t\t$text = str_replace(array('%basic:unsublink%', '%BASIC:UNSUBLINK%'), '#', $text);\n\t\t\t$text = str_replace(array('%%UNSUBSCRIBE%%','%%unsubscribe%%'), '#', $text);\n\t\t}\n\n\t\tif (isset($info['CustomFields'])) {\n\t\t\t$customfields = $info['CustomFields'];\n\n\t\t\tforeach ($customfields as $p => $details) {\n\t\t\t\t$fieldname = '%%' . str_replace(' ', '\\\\s+', preg_quote(strtolower($details['fieldname']), '/')) . '%%';\n\n\t\t\t\t$replacetext = '';\n\t\t\t\tif (is_null($details['data']) || $details['data'] == '') {\n\t\t\t\t\tif (isset($details['defaultvalue'])) {\n\t\t\t\t\t\t$replacetext = $details['defaultvalue'];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$replacetext = $details['data'];\n\t\t\t\t}\n\t\t\t\t$text = preg_replace('/'. $fieldname . '/is', $replacetext, $text);\n\t\t\t\tif (isset($details['fieldid'])) {\n\t\t\t\t\t$text = preg_replace('/%field\\:' . $details['fieldid'] . '%/i', $replacetext, $text);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tunset($info);\n\t}", "function acf_change_scholarship_date_label($field ){\n switch($_GET['scholarship_category']){\n \tcase 'Film':\n \t\t$field['label'] = \"Release Date\";\n \t\tbreak;\n case 'Exhibition Curated':\n $field['label'] = \"Exhibition Year\";\n }\n\n return $field;\n}", "function revcon_change_post_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}", "function ufclas_replace_iframe_title($text){\n\n\n $replace = array(\n // 'WORD TO REPLACE' => 'REPLACE WORD WITH THIS'\n '<iframe ' => '<iframe title=\"'. get_the_title() . ' Media Content\"',\n );\n $text = str_replace(array_keys($replace), $replace, $text);\n return $text;\n}", "function wp_localize_community_events() {}", "function wsr_change_translate_text( $translated_text ) {\n\tif ( $translated_text == 'Old Text' ) {\n\t\t$translated_text = 'New Translation';\n\t}\n\treturn $translated_text;\n}", "function howdy_message($translated_text, $text, $domain) {\r\n $new_message = str_replace('Howdy', 'Welcome', $text);\r\n return $new_message;\r\n}", "function change_post_label() {\n global $menu;\n global $submenu;\n $menu[5][0] = 'Eventos';\n $submenu['edit.php'][5][0] = 'Eventos';\n\t$submenu['edit.php'][10][0] = 'Adicionar Evento';\n\t$submenu['edit.php'][15][0] = 'Unidades';\n\t$submenu['edit.php'][16][0] = 'Tags';\t\n echo '';\n}", "public function getText(){\n $search = array(\"{INT}\", \"{FEED}\", \"{ENTRY}\", \"{USER}\", \"{TEXT}\");\n $params = array(\n $this->int,\n $this->feed ? '<a href=\"'.$this->feed->getLink().'\">'.$this->feed->name.'</a>' : \"\",\n $this->entry ? '<a href=\"'.$this->entry->getLink().'\">'.$this->entry->title.'</a>' : \"\",\n $this->user ? $this->user->username : \"\",\n $this->text\n );\n return str_replace($search, $params, t(\"event.\".$this->type));\n }", "function get_notification_text($text, $map, $map_index)\n{\n $new_text = $text;\n foreach ($map as $marker=>$replace)\n {\n $new_text = str_replace($marker, $replace[$map_index], $new_text);\n }\n\n return $new_text;\n}", "function wp_localize_community_events()\n {\n }", "public function escape_and_translate( &$value, $key ) {\n\t\tif ( 'label' === $key || 'description' === $key ) {\n\t\t\t$value = esc_html__( $value, 'mildtowild-utility' );\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
to check individual auditor is registered to renewal...
public function auditorIsReg(Request $request) { if (isset($request->token) && isset($request->email)) { $loggedUserEmail = $request->email; $loggedUserId = User::where('email', $loggedUserEmail)->value('id'); $auditorDetails = AuditorRenewal::where('token', $request->token)->first(); if ($auditorDetails) { $createdUserId = Auditor::where('id', $auditorDetails->auditor_id)->value('created_by'); if ($loggedUserId === $createdUserId) { $auditorDetails = AuditorRenewal::where('token', $request->token)->first(); if (($auditorDetails->status == $this->settings('AUDITOR_RENEWAL_PROCESSING', 'key')->id) || ($auditorDetails->status == $this->settings('AUDITOR_RENEWAL_REQUEST_TO_RESUBMIT', 'key')->id)) { $audId = $auditorDetails['auditor_id']; return response()->json([ 'message' => 'Registered Auditor.', 'status' => true, 'audId' => $audId, ], 200); } else { return response()->json([ 'message' => 'Not Registered as a Auditor.', 'status' => false, ], 200); } } else { return response()->json([ 'message' => 'Unauthorized User', 'status' => false, '1' => $loggedUserId, '2' => $createdUserId, ], 200); } } else { return response()->json([ 'message' => 'Invalid Token', 'status' => false, ], 200); } } else { return response()->json([ 'message' => 'We can \'t find a User.', 'status' => false, ], 200); } }
[ "public function checkSubscriptionStatus()\r\n {\r\n global $database;\r\n\r\n $q = 'Select * from users where email=\"' . $_SESSION['email'] . '\"';\r\n $result = mysqli_fetch_object($database->query($q));\r\n\r\n $date1 = date_create($result->register_date);\r\n $date2 = date_create(date(\"Y-m-d\"));\r\n $days = date_diff($date1, $date2)->days;\r\n // print_r($days);\r\n if ($days > 21) { // 21 days check\r\n if (!$result->subscription_status && !$result->tranxid) {\r\n header(\"Location: /subscribe\");\r\n }\r\n }\r\n }", "function checkAlreadyRegistered (){\n \n \n $con = new EplGoConnect();\n \n $alreadyReg = false;\n \n $con->dbConnect();\n //Get the user if their expiration date is more then 20 day away\n $sql = \"Select user_key, EplGoExpires from registrant \n\t\t\t\twhere user_key=? and EplGoExpires = '\" . $this->getExpiration() .\"'\" ;\n \n $con->prepareSQL($sql);\n \n $paramArray = $this->getUserKey();\n $con->dbexec($paramArray);\n \n $registrant = $con->dbfetchAll();\n \n\n \n \n if (count($registrant)>0){\n $this->setUserExpirationDate($registrant[0]['EplGoExpires']);\n $alreadyReg = true;\n }\n\n\n //print_r($registrant);\n \n return $alreadyReg;\n \n }", "function trial_expiration_checker() {\n \n}", "public function hasExpiredSubscriptions(): bool;", "public function license_check_event() {\n\t\t$license = get_option( 'pronamic_pay_license_key' );\n\n\t\t$this->check_license( $license );\n\t}", "public function checkIfAccountExpired()\n {\n $days = config('plans.freeForXDays');\n\n //note: this query is MySQL only. DATEDIFF function not available in sqlite\n $expiredUserIds = DB::table('users')\n ->select('id')\n ->where('confirmed', 1)\n ->where(function ($query) use ($days) {\n $query->where(function ($query) {\n $query->whereNotNull('trial_ends_at');\n $query->whereRaw('DATEDIFF(`trial_ends_at`, NOW()) = -1');\n })->orWhere(function ($query) {\n $query->where('is_grandfathered', 1);\n $query->whereRaw('DATEDIFF(DATE_ADD(`created_at`, INTERVAL 1 YEAR), NOW()) = -1');\n })->orWhere(function ($query) use ($days) {\n $query->where('is_grandfathered', 0);\n $query->whereRaw('DATEDIFF(DATE_ADD(`created_at`, INTERVAL ' . $days . ' DAY), NOW()) = -1');\n });\n })->groupBy('id')\n ->lists('id');\n\n if(count($expiredUserIds)) {\n foreach($expiredUserIds as $id) {\n $user = $this->userRepository->find($id);\n $this->rentalService->deactivateTrialNow($user);\n }\n }\n }", "private function checkRecurringPayments()\n {\n $AuthUser = $this->getVariable(\"AuthUser\");\n\n $recurring = false;\n $gateway = $AuthUser->get(\"data.recurring_payments.gateway\");\n\n if ($gateway == \"stripe\") {\n $subscription_id = $AuthUser->get(\"data.recurring_payments.stripe.subscription_id\");\n if ($subscription_id) {\n try {\n \\Stripe\\Stripe::setApiKey($this->integrations->get(\"data.stripe.secret_key\"));\n $subscription = \\Stripe\\Subscription::retrieve($subscription_id);\n\n if (empty($subscription->canceled_at)) {\n $recurring = true;\n }\n } catch (\\Exception $e) {\n // Not subscribed\n }\n }\n }\n\n $this->setVariable(\"recurring_payments\", $recurring);\n if ($recurring) {\n $this->setVariable(\"recurring_gateway\", $gateway)\n ->setVariable(\"recurring_subscription\", $subscription);\n }\n }", "public function status_subscription(){\n\t\t\treturn true;\n\t\t}", "private function has_premium_subscription_expired()\n {\n }", "protected function renewal(): bool\n {\n // If we're not in a webhook, it's not possible to be an auto-renewal\n if (!$this->webhook) {\n return false;\n }\n\n // Check if the user's active sub is from before the current date\n /** @var \\Laravel\\Cashier\\Subscription $sub */\n $sub = \\Laravel\\Cashier\\Subscription::where('user_id', $this->user->id)->where('stripe_status', 'active')->first();\n if (empty($sub)) {\n return false;\n }\n return $sub->created_at->lessThan(Carbon::yesterday());\n }", "public function is_renewable() {\n\t\treturn isset( $this->data['subscriptions_renewable'] ) && $this->data['subscriptions_renewable'];\n\t}", "public function payerExist(){\r\n $payerId = $this->getPayerRef();\r\n $customer = Mage::getModel('customer/customer')->load($payerId);\r\n if(!$customer->getId()){\r\n $customer = $payerId;\r\n }\r\n\r\n $collection = mage::getModel('realex/tokencard')->getCollection()->addCustomerFilter($customer);\r\n\r\n if($collection->count() > 0){\r\n return '1';\r\n }\r\n return '0';\r\n }", "public function subscriptionRequired();", "protected function has_valid_premium_subscription()\n {\n }", "public function updateLicenseStatus()\n {\n $transient = get_transient($this->slug);\n\n // If set and valid, return.\n if (VALID === $transient) {\n error_log('Active...');\n return;\n }\n // If expired, do something to never req again.\n\n // If not then, perform a check\n // error_log('Checking ...');\n // $response = $this->checkLicenseKey();\n }", "protected function recurring(): bool\n {\n return !$this->onTrial() && !$this->current_subscription->cancelled();\n }", "function infoSubscription()\r\n {\r\n $ret = false;\r\n\r\n if ( $this->InfoSubscription == 1 )\r\n {\r\n $ret = true;\r\n }\r\n return $ret;\r\n }", "public function can_be_renewed() {\n\n\t\t$can_be_renewed = parent::can_be_renewed();\n\n\t\t// make sure that besides the subscription the membership has an order linked\n\t\tif ( $this->has_subscription() && $this->order_contains_subscription() && ( $subscription = $this->get_subscription() ) ) {\n\n\t\t\t// check if the subscription has a valid status to be resubscribed\n\t\t\t$can_be_renewed = $subscription->has_status( array( 'expired', 'cancelled', 'pending-cancel', 'on-hold' ) );\n\n\t\t\t// memberships on installment plans can be renewed only if not on fixed dates in the past\n\t\t\tif ( $can_be_renewed && $this->has_installment_plan() && $this->get_plan() && $this->plan->is_access_length_type( 'fixed' ) ) {\n\n\t\t\t\t$fixed_end_date = $this->plan->get_access_end_date( 'timestamp' );\n\t\t\t\t$can_be_renewed = ! empty( $fixed_end_date ) ? $fixed_end_date < current_time( 'timestamp', true ) : $can_be_renewed;\n\t\t\t}\n\t\t}\n\n\t\treturn $can_be_renewed;\n\t}", "function check_assignments_and_notify_subscribers() {\n global $DB;\n\n $now = time();\n echo 'time';\n echo $now;\n\n $instances = $DB->get_records_sql('select * from mdl_assign');\n\n foreach ($instances as $record) {\n echo $cid = $record->id;\n echo $assignmentame = $record->name;\n echo $deadline = $record->duedate;\n echo $difference = $record->difference = $deadline - $now;\n $this->check_courses_and_subscribed_users($difference, $cid, $assignmentame, $deadline);\n }\n return true;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Acces au nom d'une licence Retourne une chaine contenant le nom d'une licence connaissant son id
function getNomLicence(int $i): string{ $sql = "SELECT nom FROM licence WHERE id_licence = :ref"; $req_select = $this->db->prepare($sql); $req_select ->execute(array(':ref'=>$i)); $res = $req_select->fetch(PDO::FETCH_NUM); return $res[0]; }
[ "public function getLicencia()\r\n\t\t{\r\n\t\t\treturn $this->_nro_licencia;\r\n\t\t}", "protected function set_license_id(){\n\t\t$this->license_id = \\EDD_Software_Licensing::instance()->get_license_by_key( $this->code );\n\t}", "function DBgetLicense(){\n\t\t \n\t\t $db = $this->startDB();\n\t\t \n\t\t $sql = \"SELECT fs.fk_license, cc.LINK_DEED as id, cc.NAME as name\n\t\t FROM \".$this->penelopeTabID.\" AS extab\n\t\t JOIN space ON extab.uuid = space.uuid\n\t\t JOIN file_summary AS fs ON space.source_id = fs.source_id\n\t\t JOIN w_lu_creative_commons AS cc ON fs.fk_license = cc.PK_LICENSE\n\t\t GROUP BY fs.source_id\n\t\t ORDER BY fs.fk_license DESC\n\t\t \";\n\t\t \n\t\t $result = $db->fetchAll($sql); \n\t\t if($result){\n\t\t\t\t$output = $result[0];\n\t\t\t\tif(stristr($output[\"id\"], \"creativecommons\")){\n\t\t\t\t\t $output[\"name\"] = \"Creative Commons \".$output[\"name\"];\n\t\t\t\t}\n\t\t\t\tunset($output[\"fk_license\"]);\n\t\t\t\treturn $output;\n\t\t }\n\t\t else{\n\t\t\t\treturn array(\"id\" => \"http://creativecommons.org/licenses/by/3.0\",\n\t\t\t\t\t\t\t\t \"name\" => \"Creative Commons Attribution\"\n\t\t\t\t\t\t\t\t );\n\t\t }\n\t\t \n\t\t \n\t }", "public function getLicenseNameAttribute(): string\n {\n // Return the SPDX identifier as a fallback\n return self::LICENSES[$this->cost] ?? $this->cost;\n }", "public function getLicNo()\n {\n return $this->licNo;\n }", "public function get_licence()\n {\n return 'Licensed on the same terms as Composr';\n }", "public function getLicenseId()\n {\n\n return $this->license_id;\n }", "public function getLicenciaGenerada()\r\n\t\t{\r\n\t\t\treturn $this->_nroLicencia;\r\n\t\t}", "public function getLicenseId() \n {\n return $this->LicenseId;\n }", "function getLicense()\r\n {\r\n\r\n $query = \"SELECT id, license_name license FROM sw_license WHERE active = 'Yes' ORDER BY license_name\";\r\n $utildb = $this->getdb();\r\n $res = $utildb->query( $query );\r\n if ( $res == false ) {\r\n echo \"ERROR: \" . $this->getdb()->error;\r\n } else {\r\n return $res->fetch_all(MYSQLI_ASSOC);\r\n }\r\n\r\n }", "public function getLicense();", "public function poseeLicencia()\r\n\t {\r\n\t \t$result = false;\r\n\t \t$this->_licencia = '';\r\n\t \t$findModel = self::findContribuyente();\r\n\t \tif ( count($findModel) > 0 ) {\r\n\t \t\tif ( strlen($findModel->id_sim) > 1 ) {\r\n\t \t\t\t$result = true;\r\n\t \t\t\t$this->_licencia = $findModel->id_sim;\r\n\t \t\t}\r\n\t \t}\r\n\r\n\t \treturn $result;\r\n\t }", "function acf_pro_get_license() { }", "public function license()\n {\n return $this->belongsTo('CityBoard\\Entities\\License');\n }", "public function getNomProdLicence() {\n return $this->nomProdLicence;\n }", "public function getLicenseId(): ?string\n {\n return $this->getParam(self::LICENSE_ID);\n }", "function &getDataLicences()\n\t{\n\t\t$query = 'SELECT a.id AS value, a.name AS text' .\n\t\t\t\t\t' FROM #__oer_licenses AS a';\n\t\t\t$this->_db->setQuery($query);\n\t\t\t$licencelist = $this->_db->loadObjectList();\n\t\t\treturn $licencelist;\n\t}", "public function getFkImobiliarioLicenca()\n {\n return $this->fkImobiliarioLicenca;\n }", "function acf_pro_get_license_key() { }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Negative test for getStatusChecksHost() No HostStatus for Host with id found
public function testGetStatusChecksHostNoHostStatuses() { $client = static::createClient(); $host = new Host(); $host->setName("Test-Host-monitor-17".mt_rand()); $host->setDomainName("test.".mt_rand().".de"); $host->setPort(8443); $host->setSettings("settings"); $this->em->persist($host); $this->em->flush(); $client->request( 'GET', '/monitoring/checks/hosts/'.$host->getId(), array(), array(), array( 'CONTENT_TYPE' => 'application/json', 'HTTP_Authorization' => $this->token ) ); $this->assertEquals(404, $client->getResponse()->getStatusCode()); $this->assertEquals('{"error":{"code":404,"message":"No HostStatuses for Host with ID '.$host->getId().' found"}}', $client->getResponse()->getContent()); $host = $this->em->getRepository(Host::class)->find($host->getId()); $this->em->remove($host); $this->em->flush(); }
[ "public function testGetStatusChecksHostNoHost()\n {\n $client = static::createClient();\n\n $client->request(\n 'GET',\n '/monitoring/checks/hosts/999999',\n array(),\n array(),\n array(\n 'CONTENT_TYPE' => 'application/json',\n 'HTTP_Authorization' => $this->token\n )\n );\n\n $this->assertEquals(404, $client->getResponse()->getStatusCode());\n $this->assertEquals('{\"error\":{\"code\":404,\"message\":\"No Host for ID 999999 found\"}}', $client->getResponse()->getContent());\n }", "public function testDeleteContainerStatusNoHostStatus()\n {\n $client = static::createClient();\n\n\n $client->request(\n 'DELETE',\n '/monitoring/checks/9999999/hosts',\n array(),\n array(),\n array(\n 'CONTENT_TYPE' => 'application/json',\n 'HTTP_Authorization' => $this->token\n )\n );\n\n $this->assertEquals(404, $client->getResponse()->getStatusCode());\n $this->assertEquals('{\"error\":{\"code\":404,\"message\":\"No HostStatus for ID 9999999 found\"}}', $client->getResponse()->getContent());\n }", "public function testConfigureStatusCheckForHostValidationFailed()\n {\n $client = static::createClient();\n\n $host = new Host();\n $host->setName(\"Test-Hosst-monitor-1\".mt_rand());\n $host->setDomainName(\"test.\".mt_rand().\".de\");\n $host->setPort(8443);\n $host->setSettings(\"settings\");\n\n $hostStatus = new HostStatus();\n $hostStatus->setNagiosEnabled(true);\n $hostStatus->setNagiosName(\"myNagiosTestDevice123465798\");\n $hostStatus->setCheckName(\"http\");\n $hostStatus->setSourceNumber(0);\n $hostStatus->setNagiosUrl(\"nagios.example.com\");\n\n $host->addStatus($hostStatus);\n\n $this->em->persist($host);\n $this->em->persist($hostStatus);\n $this->em->flush();\n\n\n $client->request(\n 'PUT',\n '/monitoring/checks/'.$hostStatus->getId().'/hosts',\n array(),\n array(),\n array(\n 'CONTENT_TYPE' => 'application/json',\n 'HTTP_Authorization' => $this->token\n ),'{\n \"nagiosEnabled\": true,\n \"nagiosName\": \"my-nagios-device\",\n \"nagiosUrl\": \"https://nagios.example.com\",\n \"checkName\" : \"check_http\",\n \"sourceNumber\" : \"A\"\n }'\n );\n\n $this->assertEquals(400, $client->getResponse()->getStatusCode());\n $this->assertEquals('{\"error\":{\"code\":400,\"message\":{\"sourceNumber\":\"This value should be of type int.\"}}}', $client->getResponse()->getContent());\n\n $hostStatus = $this->em->getRepository(HostStatus::class)->find($hostStatus->getId());\n $host = $this->em->getRepository(Host::class)->find($host->getId());\n $this->em->remove($host);\n $this->em->remove($hostStatus);\n $this->em->flush();\n }", "public function testGetServiceStatusNotFoundHost()\n {\n $this->monitoringService->expects($this->once())\n ->method('findOneHost')\n ->willReturn(null);\n\n $metricController = new MetricController($this->metricService, $this->monitoringService);\n $metricController->setContainer($this->container);\n\n $this->expectException(EntityNotFoundException::class);\n $this->expectExceptionMessage('Host 1 not found');\n $metricController->getServiceStatus(1, 1, $this->start, $this->end);\n }", "abstract function hostStatus($name,$id=0);", "public function testThatItReturnsOfflineForanUnresolvedHost()\n {\n $url = 'http://www.unresolvabledomainnameipromiseyouyyy.com';\n $status = $this->checker->check($url);\n\n $this->assertFalse($status->isRespondingOk());\n $this->assertTrue($status->hostIsUnresolvable());\n $this->assertTrue($status->isNotResponding());\n }", "public function testMissingParameterAddCheckHost() {\n $check = $this->default_check;\n $check['host'] = null;\n $this->pingdom->addCheck($check);\n }", "public function checkHost()\n {\n if (!$this->hostProcessed) {\n $this->processHost();\n $this->hostProcessed = true;\n }\n }", "public function testThatAOnlineHostWithBadUrlReturnsNotA200()\n {\n $url = 'http://www.google.com/ughhhh.htm';\n $status = $this->checker->check($url);\n\n $this->assertTrue($status->isRespondingButNotOk());\n $this->assertNotEquals($status->getStatusCode(), 200);\n }", "private function getHostStatus(): string\n {\n return ($this->statistics['packet_loss'] < 100) ? 'Ok' : 'Unreachable';\n }", "public function host_status()\n\t{\n\t\t$auth = new Nagios_auth_Model();\n\t\t$show_passive_as_active = config::get('checks.show_passive_as_active', '*');\n\n\t\tif ($show_passive_as_active) {\n\t\t\t$active_checks_condition = ' AND (active_checks_enabled=1 OR passive_checks_enabled=1) ';\n\t\t\t$disabled_checks_condition = ' AND (active_checks_enabled!=1 AND passive_checks_enabled!=1) ';\n\t\t\t\n\t\t} else {\n\t\t\t$active_checks_condition = ' AND active_checks_enabled=1 ';\n\t\t\t$disabled_checks_condition = ' AND active_checks_enabled!=1 ';\n\t\t}\n\n\t\t$access_check = '';\n\t\t$access_check_xtra = ' WHERE ';\n\t\tif (!$auth->view_hosts_root && $auth->id) {\n\t\t\t$access_check = \"INNER JOIN contact_access ON host.id=contact_access.host \".\n\t\t\t\t\"WHERE contact_access.service IS NULL \".\n\t\t\t\t\"AND contact_access.contact=\".$auth->id;\n\t\t\t$access_check_xtra = ' AND ';\n\t\t}\n\n\t\t$sql = \"SELECT \".\n\t\t\t\"(SELECT COUNT(*) FROM host \".$access_check.\") AS total_hosts, \\n\".\n\t\t\t\"(SELECT COUNT(*) FROM host \".$access_check.$access_check_xtra.\" flap_detection_enabled!=1) AS flap_disabled_hosts, \\n\".\n\t\t\t\"(SELECT COUNT(*) FROM host \".$access_check.$access_check_xtra.\" is_flapping=1) AS flapping_hosts, \\n\".\n\t\t\t\"(SELECT COUNT(*) FROM host \".$access_check.$access_check_xtra.\" notifications_enabled!=1) AS notification_disabled_hosts, \\n\".\n\t\t\t\"(SELECT COUNT(*) FROM host \".$access_check.$access_check_xtra.\" event_handler_enabled!=1) AS event_handler_disabled_hosts, \\n\".\n\t\t\t\"(SELECT COUNT(*) FROM host \".$access_check.$access_check_xtra.\" active_checks_enabled!=1) AS active_checks_disabled_hosts, \\n\".\n\t\t\t\"(SELECT COUNT(*) FROM host \".$access_check.$access_check_xtra.\" passive_checks_enabled!=1) AS passive_checks_disabled_hosts, \\n\".\n\t\t\t\"(SELECT COUNT(*) FROM host \".$access_check.$access_check_xtra.\" current_state=\".self::HOST_UP.$disabled_checks_condition.\") AS hosts_up_disabled, \\n\".\n\t\t\t\"(SELECT COUNT(*) FROM host \".$access_check.$access_check_xtra.\" current_state=\".self::HOST_UP.\" \".$active_checks_condition.\" ) AS hosts_up_unacknowledged, \\n\".\n\t\t\t\"(SELECT COUNT(*) FROM host \".$access_check.$access_check_xtra.\" current_state=\".self::HOST_UP.\" ) AS hosts_up, \\n\".\n\t\t\t\"(SELECT COUNT(*) FROM host \".$access_check.$access_check_xtra.\" current_state=\".self::HOST_DOWN.\" AND scheduled_downtime_depth>0 ) AS hosts_down_scheduled, \\n\".\n\t\t\t\"(SELECT COUNT(*) FROM host \".$access_check.$access_check_xtra.\" current_state=\".self::HOST_DOWN.\" AND problem_has_been_acknowledged=1 ) AS hosts_down_acknowledged, \\n\".\n\t\t\t\"(SELECT COUNT(*) FROM host \".$access_check.$access_check_xtra.\" current_state=\".self::HOST_DOWN.$disabled_checks_condition.\") AS hosts_down_disabled, \\n\".\n\t\t\t\"(SELECT COUNT(*) FROM host \".$access_check.$access_check_xtra.\" current_state=\".self::HOST_DOWN.\" AND scheduled_downtime_depth = 0 AND problem_has_been_acknowledged!=1 \".$active_checks_condition.\") AS hosts_down_unacknowledged, \\n\".\n\t\t\t\"(SELECT COUNT(*) FROM host \".$access_check.$access_check_xtra.\" current_state=\".self::HOST_DOWN.\") AS hosts_down, \\n\".\n\t\t\t\"(SELECT COUNT(*) FROM host \".$access_check.$access_check_xtra.\" current_state=\".self::HOST_UNREACHABLE.\" AND scheduled_downtime_depth>0 ) AS hosts_unreachable_scheduled, \\n\".\n\t\t\t\"(SELECT COUNT(*) FROM host \".$access_check.$access_check_xtra.\" current_state=\".self::HOST_UNREACHABLE.\" AND problem_has_been_acknowledged=1 ) AS hosts_unreachable_acknowledged, \\n\".\n\t\t\t\"(SELECT COUNT(*) FROM host \".$access_check.$access_check_xtra.\" current_state=\".self::HOST_UNREACHABLE.$disabled_checks_condition.\") AS hosts_unreachable_disabled, \\n\".\n\t\t\t\"(SELECT COUNT(*) FROM host \".$access_check.$access_check_xtra.\" current_state=\".self::HOST_UNREACHABLE.\" AND scheduled_downtime_depth = 0 AND problem_has_been_acknowledged!=1 \".$active_checks_condition.\") AS hosts_unreach_unacknowledged, \\n\".\n\t\t\t\"(SELECT COUNT(*) FROM host \".$access_check.$access_check_xtra.\" current_state=\".self::HOST_UNREACHABLE.\") AS hosts_unreachable, \\n\".\n\t\t\t\"(SELECT COUNT(*) FROM host \".$access_check.$access_check_xtra.\" current_state=\".self::HOST_PENDING .\" \".$active_checks_condition.\") AS hosts_pending_disabled, \\n\".\n\t\t\t\"(SELECT COUNT(*) FROM host \".$access_check.$access_check_xtra.\" current_state=\".self::HOST_PENDING .\") AS hosts_pending, \\n\".\n\t\t\t\"(SELECT COUNT(*) FROM host \".$access_check.$access_check_xtra.\" check_type=\".self::HOST_CHECK_ACTIVE.\") AS total_active_host_checks, \\n\".\n\t\t\t\"(SELECT COUNT(*) FROM host \".$access_check.$access_check_xtra.\" check_type>\".self::HOST_CHECK_ACTIVE.\") AS total_passive_host_checks, \\n\".\n\t\t\t\"(SELECT MIN(latency) FROM host \".$access_check.$access_check_xtra.\" last_check!=0) AS min_host_latency, \\n\".\n\t\t\t\"(SELECT MAX(latency) FROM host \".$access_check.$access_check_xtra.\" last_check!=0) AS max_host_latency, \\n\".\n\t\t\t\"(SELECT SUM(latency) FROM host \".$access_check.$access_check_xtra.\" last_check!=0) AS total_host_latency, \\n\".\n\t\t\t\"(SELECT MIN(execution_time) FROM host \".$access_check.$access_check_xtra.\" last_check!=0) AS min_host_execution_time, \\n\".\n\t\t\t\"(SELECT MAX(execution_time) FROM host \".$access_check.\") AS max_host_execution_time, \\n\".\n\t\t\t\"(SELECT SUM(execution_time) FROM host \".$access_check.\") AS total_host_execution_time\";\n\t\tif (!$auth->view_hosts_root && $auth->id) {\n\t\t\t$sql .= \" FROM host \".\n\t\t\t\t\"INNER JOIN contact_access ON host.id=contact_access.host \".\n\t\t\t\t\"WHERE contact_access.service IS NULL \".\n\t\t\t\t\"AND contact_access.contact=\".$auth->id.\n\t\t\t\t\" GROUP BY contact_access.contact\";\n\t\t}\n\n\t\t$result = $this->db->query($sql);\n\n\t\t$host = $result->current();\n\t\tif ($result===false || !count($result)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->total_hosts = $host->total_hosts;\n\t\t$this->flap_disabled_hosts = $host->flap_disabled_hosts;\n\t\t$this->flapping_hosts = $host->flapping_hosts;\n\t\t$this->notification_disabled_hosts = $host->notification_disabled_hosts;\n\t\t$this->event_handler_disabled_hosts = $host->event_handler_disabled_hosts;\n\t\t$this->active_checks_disabled_hosts = $host->active_checks_disabled_hosts;\n\t\t$this->passive_checks_disabled_hosts = $host->passive_checks_disabled_hosts;\n\n\t\t$this->hosts_up_disabled = $host->hosts_up_disabled;\n\t\t$this->hosts_up_unacknowledged = $host->hosts_up_unacknowledged;\n\t\tif ($show_passive_as_active) {\n\t\t\t$this->hosts_up_unacknowledged += $this->hosts_up_disabled;\n\t\t\t$this->hosts_up_disabled = 0;\n\t\t}\n\n\t\t$this->hosts_up = $host->hosts_up;\n\t\t$this->hosts_down_scheduled = $host->hosts_down_scheduled;\n\t\t$this->hosts_down_acknowledged = $host->hosts_down_acknowledged;\n\n\t\t$this->hosts_down_disabled = $show_passive_as_active ? 0 : $host->hosts_down_disabled;\n\n\t\t$this->hosts_down_unacknowledged = $host->hosts_down_unacknowledged;\n\t\t$this->hosts_down = $host->hosts_down;\n\t\t$this->hosts_down_acknowledged = $host->hosts_down_acknowledged;\n\t\t$this->hosts_down_disabled = $host->hosts_down_disabled;\n\t\t$this->hosts_down_unacknowledged = $host->hosts_down_unacknowledged;\n\t\t$this->hosts_unreachable_scheduled = $host->hosts_unreachable_scheduled;\n\t\t$this->hosts_unreachable_acknowledged = $host->hosts_unreachable_acknowledged;\n\n\t\t$this->hosts_unreachable_disabled = $show_passive_as_active ? 0 : $host->hosts_unreachable_disabled;\n\n\t\t$this->hosts_unreach_unacknowledged = $host->hosts_unreach_unacknowledged;\n\t\t$this->hosts_unreachable = $host->hosts_unreachable;\n\n\t\t$this->hosts_pending_disabled = $show_passive_as_active ? 0 : $host->hosts_pending_disabled;\n\n\t\t$this->hosts_pending = $host->hosts_pending;\n\n\t\t$this->total_host_health = $this->hosts_up;\n\t\t$this->potential_host_health = ($this->hosts_up + $this->hosts_down + $this->hosts_unreachable);\n\t\t$this->total_active_host_checks = $host->total_active_host_checks;\n\t\t$this->min_host_latency = number_format($host->min_host_latency, 3);\n\t\t$this->max_host_latency = number_format($host->max_host_latency, 3);\n\t\t$this->min_host_execution_time = number_format($host->min_host_execution_time, 3);\n\t\t$this->max_host_execution_time = number_format($host->max_host_execution_time, 3);\n\t\t$this->total_host_latency = number_format($host->total_host_latency, 3);\n\t\t$this->total_host_execution_time = number_format($host->total_host_execution_time, 3);\n\t\t$this->total_passive_host_checks = $host->total_passive_host_checks;\n\n\t\t$this->host_data_present = true;\n\t\treturn true;\n\t}", "function testParseUnknownHost() {\n $this->assertEqual(api_init::getHostConfig('unknonw.okapi.ch'),\n null);\n }", "public function testGetHostInvalid()\n {\n $ipAddress = \"333.217.812.75\";\n $exp = null;\n $res = $this->validator->getHost($ipAddress);\n\n $this->assertEquals($res, $exp);\n }", "public function testGetCurrentVHostStatistics()\n {\n\n try {\n $result = $this->api->getCurrentVHostStatistics(Configuration::$DEFAULT_SERVER,Configuration::$DEFAULT_VHOST);\n $this->assertInstanceOf(CurrentVHostStatistics::class,$result);\n\n } catch (ApiException $notExpected) {\n $this->fail();\n echo $notExpected->getMessage();\n }\n\n $this->assertTrue(TRUE);\n\n }", "function acknowledgeHostDisable()\n{\n global $pearDB, $tab, $_GET, $is_admin, $centreon;\n $actions = false;\n $actions = $centreon->user->access->checkAction(\"host_disacknowledgement\");\n\n if ($actions == true || $is_admin) {\n $flg = send_cmd(\n \" REMOVE_HOST_ACKNOWLEDGEMENT;\" . urldecode($_GET[\"host_name\"]),\n GetMyHostPoller($pearDB, urldecode($_GET[\"host_name\"]))\n );\n return $flg;\n }\n\n return null;\n}", "public function test_ping_unreachable() {\n\n\n\t\t$webhook = LLMS_REST_API()->webhooks()->create( array(\n\t\t\t'delivery_url' => 'https://fake.tld',\n\t\t\t'topic' => 'course.created',\n\t\t) );\n\n\t\tremove_filter( 'llms_rest_webhook_pre_ping', '__return_true' );\n\n\t\t$ret = $webhook->ping();\n\t\t$this->assertIsWPError( $ret );\n\t\t$this->assertWPErrorCodeEquals( 'llms_rest_webhook_ping_unreachable', $ret );\n\n\t}", "function update_host_status($status, $host_id, &$hosts, &$ping, $ping_availability, $print_data_to_stdout) {\n\t$issue_log_message = false;\n\t$ping_failure_count = read_config_option(\"ping_failure_count\");\n\t$ping_recovery_count = read_config_option(\"ping_recovery_count\");\n\t$hosts[$host_id][\"status_fail_date\"] = '0000-00-00 00:00:00';\n\t$hosts[$host_id][\"status_rec_date\"] = '0000-00-00 00:00:00';\n\n\tif ($status == HOST_DOWN) {\n\t\t/* update total polls, failed polls and availability */\n\t\t$hosts[$host_id][\"failed_polls\"]++;\n\t\t$hosts[$host_id][\"total_polls\"]++;\n\t\t$hosts[$host_id][\"availability\"] = 100 * ($hosts[$host_id][\"total_polls\"] - $hosts[$host_id][\"failed_polls\"]) / $hosts[$host_id][\"total_polls\"];\n\n\t\t/* determine the error message to display */\n\t\tif (($ping_availability == AVAIL_SNMP_AND_PING) || ($ping_availability == AVAIL_SNMP_OR_PING)) {\n\t\t\tif (($hosts[$host_id][\"snmp_community\"] == \"\") && ($hosts[$host_id][\"snmp_version\"] != 3)) {\n\t\t\t\t/* snmp version 1/2 without community string assume SNMP test to be successful\n\t\t\t\t due to backward compatibility issues */\n\t\t\t\t$hosts[$host_id][\"status_last_error\"] = $ping->ping_response;\n\t\t\t}else {\n\t\t\t\t$hosts[$host_id][\"status_last_error\"] = $ping->snmp_response . \", \" . $ping->ping_response;\n\t\t\t}\n\t\t}elseif ($ping_availability == AVAIL_SNMP) {\n\t\t\tif (($hosts[$host_id][\"snmp_community\"] == \"\") && ($hosts[$host_id][\"snmp_version\"] != 3)) {\n\t\t\t\t$hosts[$host_id][\"status_last_error\"] = \"Device does not require SNMP\";\n\t\t\t}else {\n\t\t\t\t$hosts[$host_id][\"status_last_error\"] = $ping->snmp_response;\n\t\t\t}\n\t\t}else {\n\t\t\t$hosts[$host_id][\"status_last_error\"] = $ping->ping_response;\n\t\t}\n\n\t\t/* determine if to send an alert and update remainder of statistics */\n\t\tif ($hosts[$host_id][\"status\"] == HOST_UP) {\n\t\t\t/* increment the event failure count */\n\t\t\t$hosts[$host_id][\"status_event_count\"]++;\n\n\t\t\t/* if it's time to issue an error message, indicate so */\n\t\t\tif ($hosts[$host_id][\"status_event_count\"] >= $ping_failure_count) {\n\t\t\t\t/* host is now down, flag it that way */\n\t\t\t\t$hosts[$host_id][\"status\"] = HOST_DOWN;\n\n\t\t\t\t$issue_log_message = true;\n\n\t\t\t\t/* update the failure date only if the failure count is 1 */\n\t\t\t\tif ($ping_failure_count == 1) {\n\t\t\t\t\t$hosts[$host_id][\"status_fail_date\"] = date(\"Y-m-d H:i:s\");\n\t\t\t\t}\n\t\t\t/* host is down, but not ready to issue log message */\n\t\t\t} else {\n\t\t\t\t/* host down for the first time, set event date */\n\t\t\t\tif ($hosts[$host_id][\"status_event_count\"] == 1) {\n\t\t\t\t\t$hosts[$host_id][\"status_fail_date\"] = date(\"Y-m-d H:i:s\");\n\t\t\t\t}\n\t\t\t}\n\t\t/* host is recovering, put back in failed state */\n\t\t} elseif ($hosts[$host_id][\"status\"] == HOST_RECOVERING) {\n\t\t\t$hosts[$host_id][\"status_event_count\"] = 1;\n\t\t\t$hosts[$host_id][\"status\"] = HOST_DOWN;\n\n\t\t/* host was unknown and now is down */\n\t\t} elseif ($hosts[$host_id][\"status\"] == HOST_UNKNOWN) {\n\t\t\t$hosts[$host_id][\"status\"] = HOST_DOWN;\n\t\t\t$hosts[$host_id][\"status_event_count\"] = 0;\n\t\t} else {\n\t\t\t$hosts[$host_id][\"status_event_count\"]++;\n\t\t}\n\t/* host is up!! */\n\t} else {\n\t\t/* update total polls and availability */\n\t\t$hosts[$host_id][\"total_polls\"]++;\n\t\t$hosts[$host_id][\"availability\"] = 100 * ($hosts[$host_id][\"total_polls\"] - $hosts[$host_id][\"failed_polls\"]) / $hosts[$host_id][\"total_polls\"];\n\n\t\tif ((($ping_availability == AVAIL_SNMP_AND_PING) ||\n\t\t\t($ping_availability == AVAIL_SNMP_OR_PING) ||\n\t\t\t($ping_availability == AVAIL_SNMP)) &&\n\t\t\t(!is_numeric($ping->snmp_status))) {\n\t\t\t$ping->snmp_status = 0.000;\n\t\t}\n\n\t\tif ((($ping_availability == AVAIL_SNMP_AND_PING) ||\n\t\t\t($ping_availability == AVAIL_SNMP_OR_PING) ||\n\t\t\t($ping_availability == AVAIL_PING)) &&\n\t\t\t(!is_numeric($ping->ping_status))) {\n\t\t\t$ping->ping_status = 0.000;\n\t\t}\n\t\t/* determine the ping statistic to set and do so */\n\t\tif (($ping_availability == AVAIL_SNMP_AND_PING) ||\n\t\t\t($ping_availability == AVAIL_SNMP_OR_PING)) {\n\t\t\tif (($hosts[$host_id][\"snmp_community\"] == \"\") && ($hosts[$host_id][\"snmp_version\"] != 3)) {\n\t\t\t\t$ping_time = 0.000;\n\t\t\t}else {\n\t\t\t\t/* calculate the average of the two times */\n\t\t\t\t$ping_time = ($ping->snmp_status + $ping->ping_status) / 2;\n\t\t\t}\n\t\t}elseif ($ping_availability == AVAIL_SNMP) {\n\t\t\tif (($hosts[$host_id][\"snmp_community\"] == \"\") && ($hosts[$host_id][\"snmp_version\"] != 3)) {\n\t\t\t\t$ping_time = 0.000;\n\t\t\t}else {\n\t\t\t\t$ping_time = $ping->snmp_status;\n\t\t\t}\n\t\t}elseif ($ping_availability == AVAIL_NONE) {\n\t\t\t$ping_time = 0.000;\n\t\t}else{\n\t\t\t$ping_time = $ping->ping_status;\n\t\t}\n\n\t\t/* update times as required */\n\t\t$hosts[$host_id][\"cur_time\"] = $ping_time;\n\n\t\t/* maximum time */\n\t\tif ($ping_time > $hosts[$host_id][\"max_time\"])\n\t\t\t$hosts[$host_id][\"max_time\"] = $ping_time;\n\n\t\t/* minimum time */\n\t\tif ($ping_time < $hosts[$host_id][\"min_time\"])\n\t\t\t$hosts[$host_id][\"min_time\"] = $ping_time;\n\n\t\t/* average time */\n\t\t$hosts[$host_id][\"avg_time\"] = (($hosts[$host_id][\"total_polls\"]-1-$hosts[$host_id][\"failed_polls\"])\n\t\t\t* $hosts[$host_id][\"avg_time\"] + $ping_time) / ($hosts[$host_id][\"total_polls\"]-$hosts[$host_id][\"failed_polls\"]);\n\n\t\t/* the host was down, now it's recovering */\n\t\tif (($hosts[$host_id][\"status\"] == HOST_DOWN) || ($hosts[$host_id][\"status\"] == HOST_RECOVERING )) {\n\t\t\t/* just up, change to recovering */\n\t\t\tif ($hosts[$host_id][\"status\"] == HOST_DOWN) {\n\t\t\t\t$hosts[$host_id][\"status\"] = HOST_RECOVERING;\n\t\t\t\t$hosts[$host_id][\"status_event_count\"] = 1;\n\t\t\t} else {\n\t\t\t\t$hosts[$host_id][\"status_event_count\"]++;\n\t\t\t}\n\n\t\t\t/* if it's time to issue a recovery message, indicate so */\n\t\t\tif ($hosts[$host_id][\"status_event_count\"] >= $ping_recovery_count) {\n\t\t\t\t/* host is up, flag it that way */\n\t\t\t\t$hosts[$host_id][\"status\"] = HOST_UP;\n\n\t\t\t\t$issue_log_message = true;\n\n\t\t\t\t/* update the recovery date only if the recovery count is 1 */\n\t\t\t\tif ($ping_recovery_count == 1) {\n\t\t\t\t\t$hosts[$host_id][\"status_rec_date\"] = date(\"Y-m-d H:i:s\");\n\t\t\t\t}\n\n\t\t\t\t/* reset the event counter */\n\t\t\t\t$hosts[$host_id][\"status_event_count\"] = 0;\n\t\t\t/* host is recovering, but not ready to issue log message */\n\t\t\t} else {\n\t\t\t\t/* host recovering for the first time, set event date */\n\t\t\t\tif ($hosts[$host_id][\"status_event_count\"] == 1) {\n\t\t\t\t\t$hosts[$host_id][\"status_rec_date\"] = date(\"Y-m-d H:i:s\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t/* host was unknown and now is up */\n\t\t\t$hosts[$host_id][\"status\"] = HOST_UP;\n\t\t\t$hosts[$host_id][\"status_event_count\"] = 0;\n\t\t}\n\t}\n\t/* if the user wants a flood of information then flood them */\n\tif (read_config_option(\"log_verbosity\") >= POLLER_VERBOSITY_HIGH) {\n\t\tif (($hosts[$host_id][\"status\"] == HOST_UP) || ($hosts[$host_id][\"status\"] == HOST_RECOVERING)) {\n\t\t\t/* log ping result if we are to use a ping for reachability testing */\n\t\t\tif ($ping_availability == AVAIL_SNMP_AND_PING) {\n\t\t\t\tcacti_log(\"Host[$host_id] PING: \" . $ping->ping_response, $print_data_to_stdout);\n\t\t\t\tcacti_log(\"Host[$host_id] SNMP: \" . $ping->snmp_response, $print_data_to_stdout);\n\t\t\t} elseif ($ping_availability == AVAIL_SNMP) {\n\t\t\t\tif (($hosts[$host_id][\"snmp_community\"] == \"\") && ($hosts[$host_id][\"snmp_version\"] != 3)) {\n\t\t\t\t\tcacti_log(\"Host[$host_id] SNMP: Device does not require SNMP\", $print_data_to_stdout);\n\t\t\t\t}else{\n\t\t\t\t\tcacti_log(\"Host[$host_id] SNMP: \" . $ping->snmp_response, $print_data_to_stdout);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcacti_log(\"Host[$host_id] PING: \" . $ping->ping_response, $print_data_to_stdout);\n\t\t\t}\n\t\t} else {\n\t\t\tif ($ping_availability == AVAIL_SNMP_AND_PING) {\n\t\t\t\tcacti_log(\"Host[$host_id] PING: \" . $ping->ping_response, $print_data_to_stdout);\n\t\t\t\tcacti_log(\"Host[$host_id] SNMP: \" . $ping->snmp_response, $print_data_to_stdout);\n\t\t\t} elseif ($ping_availability == AVAIL_SNMP) {\n\t\t\t\tcacti_log(\"Host[$host_id] SNMP: \" . $ping->snmp_response, $print_data_to_stdout);\n\t\t\t} else {\n\t\t\t\tcacti_log(\"Host[$host_id] PING: \" . $ping->ping_response, $print_data_to_stdout);\n\t\t\t}\n\t\t}\n\t}\n\n\t/* if there is supposed to be an event generated, do it */\n\tif ($issue_log_message) {\n\t\tif ($hosts[$host_id][\"status\"] == HOST_DOWN) {\n\t\t\tcacti_log(\"Host[$host_id] ERROR: HOST EVENT: Host is DOWN Message: \" . $hosts[$host_id][\"status_last_error\"], $print_data_to_stdout);\n\t\t} else {\n\t\t\tcacti_log(\"Host[$host_id] NOTICE: HOST EVENT: Host Returned from DOWN State: \", $print_data_to_stdout);\n\t\t}\n\t}\n\n\tdb_execute(\"update host set\n\t\tstatus = '\" . $hosts[$host_id][\"status\"] . \"',\n\t\tstatus_event_count = '\" . $hosts[$host_id][\"status_event_count\"] . \"',\n\t\tstatus_fail_date = '\" . $hosts[$host_id][\"status_fail_date\"] . \"',\n\t\tstatus_rec_date = '\" . $hosts[$host_id][\"status_rec_date\"] . \"',\n\t\tstatus_last_error = '\" . $hosts[$host_id][\"status_last_error\"] . \"',\n\t\tmin_time = '\" . $hosts[$host_id][\"min_time\"] . \"',\n\t\tmax_time = '\" . $hosts[$host_id][\"max_time\"] . \"',\n\t\tcur_time = '\" . $hosts[$host_id][\"cur_time\"] . \"',\n\t\tavg_time = '\" . $hosts[$host_id][\"avg_time\"] . \"',\n\t\ttotal_polls = '\" . $hosts[$host_id][\"total_polls\"] . \"',\n\t\tfailed_polls = '\" . $hosts[$host_id][\"failed_polls\"] . \"',\n\t\tavailability = '\" . $hosts[$host_id][\"availability\"] . \"'\n\t\twhere hostname = '\" . $hosts[$host_id][\"hostname\"] . \"'\");\n}", "function dlhc_skip_if_health_checker() {\n return dlhc_is_health_check();\n}", "public function checkHost() {\n\n\t\t\t//Get the host\n\t\t\t$host = $_SERVER['HTTP_HOST'];\n\n\t\t\t//Verify if host is permited or no\n\t\t\treturn in_array($host, $this->hosts ) ? true : false;\n\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If this backend allows the user to update their name.
public function canUserUpdateName($usr_id) { return true; }
[ "public function setName($name){\r\n\t\t\r\n\t\t$dbConnection = DB::getInstance();\r\n\t\t$dbConnection->update(\"user\", \"userName ='\".$this->getUserName().\"'\", array(\"name\"=> $name));\r\n\t\tif($dbConnection->error()){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$this->name = $name;\r\n\t\treturn true;\r\n\t}", "public function changeUserName(){\n $user = $this->core->getUser();\n if(isset($_POST['user_firstname_change']) && isset($_POST['user_lastname_change'])) {\n $newFirstName = trim($_POST['user_firstname_change']);\n $newLastName = trim($_POST['user_lastname_change']);\n // validateUserData() checks both for length (not to exceed 30) and for valid characters.\n if ($user->validateUserData('user_preferred_firstname', $newFirstName) === true && $user->validateUserData('user_preferred_lastname', $newLastName) === true) {\n\t\t\t\t$user->setPreferredFirstName($newFirstName);\n\t\t\t\t$user->setPreferredLastName($newLastName);\n\t\t\t\t//User updated flag tells auto feed to not clobber some of the user's data.\n\t\t\t\t$user->setUserUpdated(true);\n\t\t\t\t$this->core->getQueries()->updateUser($user);\n }\n else {\n $this->core->addErrorMessage(\"Preferred names must not exceed 30 chars. Letters, spaces, hyphens, apostrophes, periods, parentheses, and backquotes permitted.\");\n }\n }\n }", "function canChangeUserName(){\n\t\treturn true;\n\t}", "public function update()\n {\n if(!isset($_GET['name']))\n die('no name specified');\n \n $tool = $this->get_tool();\n $tool->name = $_GET['name'];\n $tool->save();\n die('Name Saved!!');\n }", "function updateUserFirstName() {\n $firstName = $_POST['firstName'];\n if ($GLOBALS['config']['usel']['fname'][$_SESSION['auth']['accesslevel']]) {\n return $this->M_Users->updateUserFirstName($this->UserID, $firstName);\n } else {\n return \"insufficent permissions.\";\n }\n }", "public function changeLastName()\n {\n\n global $name_msg;\n\n $lastname = request()->input('lname');\n\n $user = auth()->user();\n $oldlastname = $user->last_name;\n\n if ($lastname !== $oldlastname) {\n\n $user->last_name = $lastname;\n $user->save();\n\n $name_msg = \"Name changed successfully!\";\n }\n }", "function editUserName ($user, $updatedUserDetails) {\n\t\n\t$db = $_SESSION['db'];\n\t\n\t$sql = \"UPDATE Users SET userName='{$updatedUserDetails}' WHERE userName='{$user}'\";\n\t\n\tif (mysqli_query($db, $sql)){\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n\t \n }", "public function change_Name($name) {\n\t$query = $this->_bdd->prepare(\"update SITE set Nom=:nom\");\n\t$query->bindParam(\":nom\", $name);\n\t$query->execute();\n\treturn $query->rowCount() == 1;\n }", "public function canChangeDisplayName() {\n\t\tif ($this->userSession instanceof IUserSession) {\n\t\t\t$user = $this->userSession->getUser();\n\t\t\tif (\n\t\t\t\t($this->config->getSystemValue('allow_user_to_change_display_name') === false) &&\n\t\t\t\t(($user !== null) && (!$this->groupManager->isAdmin($user->getUID()))) &&\n\t\t\t\t(($user !== null) && (!$this->groupManager->getSubAdmin()->isSubAdmin($user)))\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t$backend = $this->account->getBackendInstance();\n\t\tif ($backend === null) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $backend->implementsActions(Backend::SET_DISPLAYNAME);\n\t}", "public function userHasInputtedName()\n\t{\n\t\treturn (isset($_POST[self::$name]) ? true : false);\n\t\t\n\t}", "public function testUpdateUserName()\n {\n $user = User::find(1);\n $user -> name = 'Steve Smith';\n $this->assertTrue($user -> save());\n $this->assertTrue($user -> name == 'Steve Smith');\n }", "private function __validate_name() {\n if (isset($this->initial_data[\"name\"])) {\n # Ensure the name is not already in use\n if (!APITools\\is_authentication_server($this->initial_data[\"name\"])) {\n $this->validated_data[\"name\"] = $this->initial_data[\"name\"];\n } else {\n $this->errors[] = APIResponse\\get(5026);\n }\n } else {\n $this->errors[] = APIResponse\\get(5035);\n }\n }", "public function ChangeNameAction() {\n }", "private function update_user_name() {\n $this->_logger->entrance();\n $name = fs_request_get( 'fs_user_name_' . $this->get_unique_affix(), '' );\n\n $api = $this->get_api_user_scope();\n $user = $api->call( \"?plugin_id={$this->_plugin->id}&fields=id,first,last\", 'put', array(\n 'name' => $name,\n ) );\n\n if ( ! isset( $user->error ) ) {\n $this->_user->first = $user->first;\n $this->_user->last = $user->last;\n $this->_store_user();\n } else {\n // handle different error cases.\n\n }\n\n return $user;\n }", "public function changePetName($arg)\n {\n $do = $this->mysql->QUERY('UPDATE player_pet SET NAME = ? WHERE USER_ID = ? AND PLAYER_ID = ?',\n [\n $arg,\n $this->__get('USER_ID'),\n $this->__get('PLAYER_ID'),\n ]\n );\n if ($do) {\n $MSG = 'Changed Pet Name';\n\n return self::addlog($MSG, LogType::NORMAL);\n }\n\n return false;\n }", "public function edit_user_name()\n\t{ \n\t\tif(!$this->UserID){\t\t\t\n\t\t\turl::redirect(PATH); \t\n\t\t}\n\t\t$user_id = $this->input->get(\"user_id\"); \t\t\t\t\t\t\n\t\t$followup_record = $this->users->get_edit_name($user_id);\t\n\t\texit;\t\n\n\t}", "public function actionChangeApplicationName() {\n $model = Admin::model()->findByPk(1);\n if (isset($_POST['Admin'])) {\n $model->setAttributes($_POST['Admin']);\n if ($model->save()) {\n $this->redirect('index');\n }\n }\n $this->render('changeApplicationName', array(\n 'model' => $model\n ));\n }", "private function usersnickname() {\n if ($this->get_request_method() == \"PUT\" && !empty($this->args[1]) && !empty($this->_raw['nickname'])) {\n $res = $this->db->query(\"UPDATE users SET nickname = \\\"\" . $this->_raw['nickname'] . \"\\\" WHERE idUser='\" . $this->args[1] . \"'\");\n if ($res->rowCount() > 0) {\n $this->response('', 200);\n } else\n $this->response('', 400);\n } else\n $this->response('', 400);\n }", "public function setName($name){\n $this->auth_name = $name;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a random number between 0 and 9
protected function rand_num() { return mt_rand(0, 9); }
[ "public static function rand_num() {\r\n\t\treturn mt_rand(0, 9);\r\n\t}", "function random9or1() {\n\t\t\n\t\tsrand(make_seed());\n\t\t$value = 9 * rand(0, 1);\n\t\tif ($value == 0) {\n\t\t\t$value = 1000;\n\t\t}\n\t\t\n\t\treturn $value;\n\t\t\n\t}", "public function getRandomNumber(): int\n {\n return random_int(1, 9);\n }", "private function _random_number() {\r\n $number_arr = array(\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\");\r\n $i = rand(0, 9);\r\n return $number_arr[$i];\r\n }", "private function randomNumber() {\n $length = 10;\n $result = '';\n for($i = 0; $i < $length; $i++) {\n $result .= mt_rand(0, 9);\n }\n return $result;\n }", "private function generateRandom()\n {\n return rand(0, 100) / 10;\n }", "function generateRandomNumber() {\n return chr(mt_rand(48, 57));\n }", "public function getRandomInt();", "public static function generateRandomeNum() {\n return time().rand(1,10000);\n }", "private function _generateNumber()\n {\n return mt_rand($this->_minValue, $this->_maxValue);\n }", "private function _genRandomNumber() {\n\t\treturn substr(md5(rand(100, 999)), 4, 8);\n\t}", "private function randNumbers()\n {\n return str_pad(rand(0, 999), 3, '0');\n }", "function randomNumber() {\n return rand(1, 32768);\n}", "public function getRandomInt()\n {\n return random_int(0, 1);\n }", "public function generateSixDigitRandomNumber(){\n\t\t\t$randomNumber = mt_rand(100000, 999999);\n\t\t\treturn $randomNumber;\n\t\t}", "public function getRandom()\n {\n $this->number = rand(1, 100);\n }", "public function three_digit(){\n $random_number = mt_rand(100, 999); //three digit random number\n return $random_number;\n}", "private function rand(){\n\t\t\n\t\t$p = rand(1,2);\n\t\t\n\t\t$n = rand(141,172);\n\n\t\twhile ( $n == 148 || $n == 149 || $n == 158 || $n == 159 || $n == 168 || $n == 169 ) {\n\t\t\t$n = rand(141,172);\n\t\t}\n\t\t\n\t\tif ( 1 == $p ) {\n\t\t\t// lettera\n\t\t\t$oct = octdec($n);\n\t\t\treturn chr($oct);\n\t\t} else {\n\t\t\t// numero\n\t\t\treturn rand(0,10); \n\t\t}\n\t\t\n\t}", "public function Random_3_digit()\n {\n // TODO change\n return rand(101, 999);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if 'timestamp_minimum_wanted' has a value
public function hasTimestampMinimumWanted() { return $this->timestamp_minimum_wanted !== null; }
[ "function dateNotBeforeEarliestDatestamp($date) {\n if($date==\"*\") { //A date of \"*\" means \"all dates\" which means it can't possibly be before the earliest datestamp. Return TRUE in this case.\n return TRUE;\n }\n require(\"config.php\"); //Load OAI-PMH configuration\n $dateGiven=strtotime($date); //Convert the date given into an easy-to-use integer.\n $earliest=strtotime($EARLIEST_DATESTAMP); //Convert the earliest datestamp into an easy-to-use integere\n if($dateGiven<$earliest) { //If the date given is less than the earliest date (i.e. it is earlier), return FALSE.\n return FALSE;\n }\n return TRUE;\n}", "public function get_timestamp_min_limit_test_cases() {\n $now = time();\n $todaymidnight = usergetmidnight($now);\n $tomorrowmidnight = $todaymidnight + DAYSECS;\n $eightam = $todaymidnight + (60 * 60 * 8);\n $starttime = (new DateTime())->setTimestamp($eightam);\n\n return [\n 'before min' => [\n $starttime,\n [\n ($starttime->getTimestamp() + 1),\n 'some error'\n ],\n $tomorrowmidnight\n ],\n 'equal min' => [\n $starttime,\n [\n $starttime->getTimestamp(),\n 'some error'\n ],\n $todaymidnight\n ],\n 'after min' => [\n $starttime,\n [\n ($starttime->getTimestamp() - 1),\n 'some error'\n ],\n $todaymidnight\n ]\n ];\n }", "function timestampWithinLimit($timestamp) {\n\t\t$time_now = time();\n\t\t$time_diff = $time_now - $timestamp;\n\t\tif ($time_diff < $this->time_limit) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function alexa_validate_timestamp ($timestamp) {\n\n\t// Ensure that the timestamp from within the HTTP request JSON is within the past minute\n\tif (time() - strtotime($timestamp) > 60) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "function wp_xprt_is_valid_timestamp( $timestamp ) {\n return ( (string ) (int) $timestamp === $timestamp )\n && ($timestamp <= PHP_INT_MAX)\n && ($timestamp >= ~PHP_INT_MAX);\n}", "public function isProvidingTimestamp(): bool;", "public function isTimestampValid()\n {\n return $this->hasTimestamp() && intval($this->timestamp) > time();\n }", "public function getApparentTemperatureMinTime()\n {\n $field = 'apparentTemperatureMinTime';\n return empty($this->_point_data->$field) ? false : $this->_point_data->$field;\n }", "public function checkMinimumTimeDuration($attributes, $params) {\n\t\tif ($this->is_minimum == 1) {\n\t\t\t$difference = round(abs(strtotime($this->finish_time) - strtotime($this->start_time)) / 60, 2);\n\t\t\tif ($this->minimum_time > $difference) {\n\t\t\t\t$this->addError('minimum_time', 'Minimum booking time exceeds session length - please adjust the session start/finish time or reduce the minimum booking time');\n\t\t\t}\n\t\t}\n\t}", "function is_timestamp($timestamp)\n{\n\t$check = (is_int($timestamp) || is_float($timestamp)) ? $timestamp : (string) (int) $timestamp;\n\treturn ($check === $timestamp) && ( (int) $timestamp <= PHP_INT_MAX) && ( (int) $timestamp >= ~PHP_INT_MAX);\n}", "function is_too_late($timestamp = null)\r\n {\r\n // If no 'due' time is set, then nothing is too early\r\n if (empty($this->moodle_assignment_instance->timedue) || $this->moodle_assignment_instance->timedue <= 0) return false;\r\n // Use the current timestamp if need be\r\n if ($timestamp == null) $timestamp = time();\r\n \r\n // Check the time\r\n if ($timestamp > $this->moodle_assignment_instance->timedue) {\r\n // It's late... check if late submissions are prevented\r\n if (empty($this->moodle_assignment_instance->preventlate)) {\r\n return -1;\r\n } else {\r\n return 1;\r\n }\r\n }\r\n // It's OK\r\n return 0;\r\n }", "function wpcf_fields_date_timestamp_is_valid( $timestamp ) {\n /*\n * http://php.net/manual/en/function.strtotime.php\n * The valid range of a timestamp is typically\n * from Fri, 13 Dec 1901 20:45:54 UTC\n * to Tue, 19 Jan 2038 03:14:07 UTC.\n * (These are the dates that correspond to the minimum\n * and maximum values for a 32-bit signed integer.)\n * Additionally, not all platforms support negative timestamps,\n * therefore your date range may be limited to no earlier than\n * the Unix epoch.\n * This means that e.g. dates prior to Jan 1, 1970 will not\n * work on Windows, some Linux distributions,\n * and a few other operating systems.\n * PHP 5.1.0 and newer versions overcome this limitation though. \n */\n // MIN 'Jan 1, 1970' - 0 | Fri, 13 Dec 1901 20:45:54 UTC\n $_min_timestamp = fields_date_timestamp_neg_supported() ? -2147483646 : 0;\n // MAX 'Tue, 19 Jan 2038 03:14:07 UTC' - 2147483647\n $_max_timestamp = 2147483647;\n\treturn WPToolset_Field_Date_Scripts::_isTimestampInRange($timestamp);\n //return is_numeric( $timestamp ) && $_min_timestamp <= $timestamp && $timestamp <= $_max_timestamp;\n}", "public function filter_min_time( $min_time ) {\n\t\treturn $this->filter_time( $min_time, NULL );\n\t}", "private function validateTimestamp()\n {\n if (Settings::get('skip_timestamp_validation', false)) {\n return;\n }\n\n if (($this->stamp > time() - 360) && ($this->stamp < time() + 360)) {\n return;\n }\n\n throw new OnePilotException('bad-timestamp', 403);\n }", "public function setMinimumLeadTime($val)\n {\n $this->_propDict[\"minimumLeadTime\"] = $val;\n return $this;\n }", "public function timeMin(){\n\t\treturn $this->timeMin;\n\t}", "public function testWrongMinOption()\n {\n $this->prepareAssert()->process(\n '2016-01-01',\n array(\n 'min' => 'foo-bar',\n )\n );\n }", "function getEarliestDatestamp() {\n\t\t$result =& $this->retrieve(\n\t\t\t'SELECT MIN(r.datestamp)\n\t\t\tFROM records r, archives a\n\t\t\tWHERE r.archive_id = a.archive_id AND a.enabled = 1'\n\t\t);\n\n\t\tif (isset($result->fields[0])) {\n\t\t\t$timestamp = strtotime($this->datetimeFromDB($result->fields[0]));\n\t\t}\n\t\tif (!isset($timestamp) || $timestamp == -1) {\n\t\t\t$timestamp = 0;\n\t\t}\n\n\t\t$result->Close();\n\t\tunset($result);\n\n\t\treturn $timestamp;\n\t}", "public function isPotentialMin();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds the number of users for a particular version //
function versionUsers($app,$version) { if (!array_key_exists($app['id'],$this->knownVersions)) { // reload the version number cache for the supplied app if needed $cutoff = date('Y-m-d', time()-(86400*30)); $incrementColumn = ($app['incrementType']=='build'?'last_build':'last_version'); $versionsSql = "SELECT `" . $incrementColumn . "` as 'version', COUNT(*) AS 'users_count' FROM `" . sql_safe($app['users_table']) . "` WHERE `last_seen`>='" . sql_safe($cutoff) . "' GROUP BY `" . $incrementColumn . "`"; $versionsResult = $this->Shimmer->query($versionsSql); if ($versionsResult) { $versionList = array(); while ($versionRow = mysql_fetch_array($versionsResult)) { $versionNumber = $versionRow['version']; if (strlen($versionNumber)>0) { array_push($versionList, array( 'version' => $versionNumber, 'users' => $versionRow['users_count'] )); } } $this->knownVersions[$app['id']] = $versionList; } } $incrementKey = ($app['incrementType']=='build'?'build':'version'); foreach ($this->knownVersions[$app['id']] as $versionPair) { if ($versionPair['version']==$version[$incrementKey]) return intval($versionPair['users']); } return 0; }
[ "function getVersionCount()\n\t{\n\t\t$query \t= 'SELECT count(*) as num'\n\t\t\t\t.' FROM #__flexicontent_versions AS v'\n\t\t\t\t.' LEFT JOIN #__users AS ua ON ua.id = v.created_by'\n\t\t\t\t.' WHERE item_id = ' . (int) $this->_id\n\t\t\t\t;\n\t\t$this->_db->setQuery($query);\n\t\treturn $this->_db->loadResult();\n\t}", "public static function getUsersCount();", "function UserCount()\n{\n\tglobal $log;\n\t$log->debug(\"Entering UserCount() method ...\");\n\tglobal $adb;\n\t$result=$adb->query(\"select * from ec_users where deleted =0;\");\n\t$user_count=$adb->num_rows($result);\n\t$result=$adb->query(\"select * from ec_users where deleted =0 AND is_admin != 'on';\");\n\t$nonadmin_count = $adb->num_rows($result);\n\t$admin_count = $user_count-$nonadmin_count;\n\t$count=array('user'=>$user_count,'admin'=>$admin_count,'nonadmin'=>$nonadmin_count);\n\t$log->debug(\"Exiting UserCount method ...\");\n\treturn $count;\n}", "function UserCount()\r\n{\r\n\tglobal $log;\r\n\t$log->debug(\"Entering UserCount() method ...\");\r\n\tglobal $adb;\r\n\t$result=$adb->mquery(\"select * from vtiger_users where deleted =0\", array());\r\n\t$user_count=$adb->num_rows($result);\r\n\t$result=$adb->mquery(\"select * from vtiger_users where deleted =0 AND is_admin != 'on'\", array());\r\n\t$nonadmin_count = $adb->num_rows($result);\r\n\t$admin_count = $user_count-$nonadmin_count;\r\n\t$count=array('user'=>$user_count,'admin'=>$admin_count,'nonadmin'=>$nonadmin_count);\r\n\t$log->debug(\"Exiting UserCount method ...\");\r\n\treturn $count;\r\n}", "public function countUsers();", "public function getUserCount()\n {\n ///etc/openvpn/openvpn.log\n // Check openvpn status log for active client count\n $cmd = \"cat /etc/openvpn/openvpn-status.log | egrep -c '^client'\";\n $op = $this->run( $cmd );\n if( count($op) == 1 && is_numeric($op[0]) ){\n return $op[0];\n }else{\n $this->cmdException($op, __FUNCTION__);\n }\n }", "public static function verifiedUserCount();", "public function countUser();", "public static function notVerifiedUserCount();", "function numusers( $room = '' )\r\n{\r\n\tif($room)\r\n\t{\r\n\t\t$stmt = new Statement(\"SELECT COUNT(*) AS numb FROM {$GLOBALS['fc_config']['db']['pref']}connections WHERE userid IS NOT NULL AND userid <> ? AND roomid=?\",214);\r\n\t\t$rs = $stmt->process( SPY_USERID , $room );\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$stmt = new Statement(\"SELECT COUNT(*) AS numb FROM {$GLOBALS['fc_config']['db']['pref']}connections,{$GLOBALS['fc_config']['db']['pref']}rooms\r\n\t\t\t\t\t\t\t WHERE userid IS NOT NULL AND userid <> ? AND ispublic IS NOT NULL\r\n\t\t\t\t\t\t\t AND {$GLOBALS['fc_config']['db']['pref']}connections.roomid = {$GLOBALS['fc_config']['db']['pref']}rooms.id\");\r\n\t\t$rs = $stmt->process( SPY_USERID );\r\n\t}\r\n\r\n\t$rec = $rs->next();\r\n\treturn $rec?$rec['numb']:0;\r\n}", "function getNumUsers(){\n$sql = \"SELECT COUNT(*) FROM users;\";\n$row = runQuery($sql,false);\n$numUsers = $row['COUNT(*)'];\nreturn $numUsers;\n}", "protected function countUsers() {\n $nbUsers = 0;\n\n $sql = \"SELECT COUNT(uid) AS nbUsers FROM oc_users\";\n $st = $this->db->prepare($sql);\n $st->execute();\n\n if ($st->rowCount() > 0) {\n $row = $st->fetch(PDO::FETCH_ASSOC);\n $nbUsers = $row['nbUsers'];\n }\n else {\n $this->display(\"ERROR : No table `oc_users` in base \" . DB_BASE .\".\");\n }\n\n return $nbUsers;\n }", "public function getNrUsers()\n {\n\n return $this->nr_users;\n }", "function get_user_votes()\n{\n\tglobal $_USER, $_TABLES;\n\n\t$query = \"SELECT COUNT(`user_id`) as count FROM {$_TABLES['votes']} WHERE `user_id` = {$_USER['uid']}\";\n\t$result = DB_query($query);\n\n\treturn DB_fetchArray($result)['count'];\n}", "function member_count()\n\t{\n\t\tglobal $conn, $config;\n\t\t$member_count_sql = 'SELECT count(userdb_id) as member_count FROM ' . $config['table_prefix'] . 'userdb WHERE userdb_is_agent = \\'no\\' AND userdb_is_admin = \\'no\\'';\n\t\t$member_count = $conn->Execute($member_count_sql);\n\t\t$member_count = $member_count->fields['member_count'];\n\t\treturn $member_count;\n\t}", "function GetNumUsers() {\n\t\n\t\t\tif ($result = $this->connection->query('SELECT * FROM users')) {\n\t\t\t\techo json_encode($result->num_rows);\n\t\t\t\t$result->close();\n\t\t\t}\n\t\t\t\t\n\t\t\t$this->connection->close();\n\t\t}", "public function getUsersCount()\n {\n return $this->count(self::_USERS);\n }", "public static function GetUseUserCount() {\n\n $statement = Database::prepare(\"SELECT count(*) FROM member WHERE lastConnTime > 0\");\n $statement->execute();\n $count = $statement->fetch(\\PDO::FETCH_NUM);\n return $count[0] == null ? 0 : $count[0];\n }", "function get_cloud_users_count(){\r\n\r\n\t\t// GET request url to mongolab password field exclude\r\n\t\t$get_url = \"https://api.mongolab.com/api/1/databases/$this->DB/collections/$this->COLLECTION?c=true&apiKey=$this->MONGOLAB_API_KEY\";\r\n\t\t$curl = curl_init();\r\n\t\tcurl_setopt($curl, CURLOPT_URL, $get_url);\r\n\t\tcurl_setopt($curl, CURLOPT_HEADER, false); \r\n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER,true);\r\n\t\tcurl_setopt($curl, CURLOPT_SSL_VERIFYPEER,0);\r\n\t\tcurl_setopt($curl, CURLOPT_SSL_VERIFYHOST,0);\r\n\t\t$response = curl_exec($curl);\r\n\t\tcurl_close($curl);\r\n\t\treturn $response;\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get or set php command that will be used to trigger the migrate script This needs to be configurable in case the CLI php version is different than the webroot (eg 7.4 vs. 8.1) Example: $deploy>php('keyhelpphp81');
public function php($phpCommand = '') { if ($phpCommand) $this->php = $phpCommand; return $this->php; }
[ "public function php()\n {\n if (defined('PHP_BINDIR') && PHP_BINDIR) {\n return PHP_BINDIR . '/php';\n }\n if (defined('PHP_BINARY') && PHP_BINARY) {\n return PHP_BINARY . '/php';\n }\n if (defined('PHP_BINDER') && PHP_BINDER) {\n return PHP_BINDER . '/php';\n }\n return 'php';\n }", "protected function phpBinary()\n {\n return (new PhpExecutableFinder())->find(false) ?: 'php';\n }", "protected function getPhpPath()\n {\n $runningOnWindows = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN');\n if ($runningOnWindows) {\n return 'php';\n } else {\n return '/usr/bin/php';\n }\n }", "protected function getPhpExecutable(): string\n {\n return (new PhpExecutableFinder)->find();\n }", "public function getPHPExecutable() {\n\t\tif (!$this->phpExecutable) {\n\t\t\t$this->phpExecutable = $this->getConfiguration('phpExecutable');\n\t\t\tif (!$this->phpExecutable) {\n\t\t\t\tif (isset($this->settings['phpExecutable'])) {\n\t\t\t\t\t$this->phpExecutable = $this->settings['phpExecutable'];\n\t\t\t\t} else {\n\t\t\t\t\t$this->phpExecutable = $this->getPHPExecutableFromPath();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->phpExecutable = trim($this->phpExecutable);\n\t\t}\n\t\treturn $this->phpExecutable;\n\t}", "public function getPhpExecutablePath(string $phpVersion = null): string\n {\n if (! $phpVersion) {\n return BREW_PREFIX.'/bin/php';\n }\n\n $phpVersion = PhpFpm::normalizePhpVersion($phpVersion);\n\n // Check the default `/opt/homebrew/opt/php@8.1/bin/php` location first\n if ($this->files->exists(BREW_PREFIX.\"/opt/{$phpVersion}/bin/php\")) {\n return BREW_PREFIX.\"/opt/{$phpVersion}/bin/php\";\n }\n\n // Check the `/opt/homebrew/opt/php71/bin/php` location for older installations\n $phpVersion = str_replace(['@', '.'], '', $phpVersion); // php@8.1 to php81\n if ($this->files->exists(BREW_PREFIX.\"/opt/{$phpVersion}/bin/php\")) {\n return BREW_PREFIX.\"/opt/{$phpVersion}/bin/php\";\n }\n\n // Check if the default PHP is the version we are looking for\n if ($this->files->isLink(BREW_PREFIX.'/opt/php')) {\n $resolvedPath = $this->files->readLink(BREW_PREFIX.'/opt/php');\n $matches = $this->parsePhpPath($resolvedPath);\n $resolvedPhpVersion = $matches[3] ?: $matches[2];\n\n if ($this->arePhpVersionsEqual($resolvedPhpVersion, $phpVersion)) {\n return BREW_PREFIX.'/opt/php/bin/php';\n }\n }\n\n return BREW_PREFIX.'/bin/php';\n }", "public static function getPhpBin()\n {\n $php_bin = shell_exec('which php-cgi');\n $php_bin = preg_replace('/\\R/', '', $php_bin);\n\n if (sizeof(self::$INCLUDE_PATH)) {\n $include_path = implode(':', self::$INCLUDE_PATH)\n .':'.get_include_path();\n $php_bin .= \" -d include_path=\\\"{$include_path}\\\"\";\n }\n if (sizeof(self::$INI_SET)) {\n foreach (self::$INI_SET as $ini_set) {\n $php_bin .= \" -d {$ini_set}\";\n }\n }\n\n return $php_bin;\n }", "private static function detectPhpExecutable(): string\n {\n $php = (new PhpExecutableFinder())->find();\n\n if (false === $php) {\n throw new RuntimeException('Cannot find php executable');\n }\n\n return $php;\n }", "static public function getCurrentPhpName()\n {\n if (self::$currentPhpVersion !== null) {\n return self::$currentPhpVersion;\n }\n return getenv('PHPBREW_PHP');\n }", "function php_path()\n{\n if (PHP_PATH != '')\n return PHP_PATH;\n else\n return \"/usr/bin/php\";\n}", "static function get_path_php()\r\n\t{\r\n\t\treturn self::get_path() . '/php';\r\n\t}", "protected function getPhpBinary()\n {\n $path = $this->binary;\n\n if (! windows_os()) {\n $path = escapeshellarg($path);\n }\n\n $args = $this->binaryArgs;\n\n if(is_array($args)) {\n $args = implode(' ', $args);\n }\n\n return trim($path .' ' .$args);\n }", "public static function getBinary(): string\n {\n $customPath = Env::string('PHP_BINARY_CUSTOM');\n if (!isStrEmpty($customPath)) {\n return $customPath;\n }\n\n // HHVM\n if (self::isHHVM()) {\n if (($binary = \\getenv('PHP_BINARY')) === false) {\n $binary = \\PHP_BINARY;\n }\n\n return \\escapeshellarg($binary) . ' --php';\n }\n\n if (\\defined('PHP_BINARY')) {\n return \\escapeshellarg(\\PHP_BINARY);\n }\n\n $binaryLocations = [\n \\PHP_BINDIR . '/php',\n \\PHP_BINDIR . '/php-cli.exe',\n \\PHP_BINDIR . '/php.exe',\n ];\n\n foreach ($binaryLocations as $binary) {\n if (\\is_readable($binary)) {\n return $binary;\n }\n }\n\n return 'php';\n }", "protected function getArtisanBaseCommand(): ?string\n {\n return strtolower(\n (new ArgvInput())->getFirstArgument()\n );\n }", "public function getExecPHP() {\n\t\treturn $this->execPHP;\n\t}", "protected function runtime() { return 'php:'.PHP_VERSION; }", "public function getCronCommand()\n {\n return '* * * * * `which php` ' . $this->getArtisanLocation() . ' schedule:run 1>> /dev/null 2>&1';\n }", "protected function phpBinary()\n {\n return ProcessUtils::escapeArgument((new PhpExecutableFinder)->find(false));\n }", "protected function getPhpcsCommand()\n {\n // Determine the path to the main PHPCS file.\n $phpcsPath = $this->getPHPCodeSnifferInstallPath();\n if (file_exists($phpcsPath . '/bin/phpcs') === true) {\n // PHPCS 3.x.\n $phpcsExecutable = './bin/phpcs';\n } else {\n // PHPCS 2.x.\n $phpcsExecutable = './scripts/phpcs';\n }\n\n return vsprintf(\n '%s %s',\n array(\n 'php executable' => $this->getPhpExecCommand(),\n 'phpcs executable' => $phpcsExecutable,\n )\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }