query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Updates the given BlogEntry object | public function updateAction(BlogEntry $blogEntry) {
$this->blogEntryRepository->update($blogEntry);
$this->flashMessageContainer->add('Updated the blog.');
$this->redirect('index');
} | [
"public abstract function modifyBlogEntry(BlogEntry $blogEntry);",
"public function update(Entry $entry);",
"private function updateBlogEntry() {\n\n if (isset($_POST['submit']) && 'Save' == trim($_POST['submit'])) {\n\n // @todo security.\n\n // Get the blog title from the post variables.\n if (isset($_POST['title']) && !empty($_POST['title'])) {\n $blog_title = $_POST['title'];\n }\n else {\n // Display a message if no title is given.\n $message = 'Please enter a blog title';\n $this->messages->setMessage($message, 'error');\n }\n\n // Get the blog body from the post variables.\n if (isset($_POST['body']) && !empty($_POST['body'])) {\n $blog_body = $_POST['body'];\n }\n else {\n // Display a message if no body is given.\n $message = 'Please enter a blog body';\n $this->messages->setMessage($message, 'error');\n }\n\n // Get the blog id from the post variables.\n if (isset($_POST['blog_id']) && !empty($_POST['blog_id'])) {\n $blog_id = $_POST['blog_id'];\n }\n else {\n // Exception, if the blog id is missing\n // as we cannot update the blog entry without it's id.\n throw new \\Exception('Error - the blog id is missing.');\n }\n\n if (!empty($blog_title) && !empty($blog_body) && !empty($blog_id)) {\n // Blog model should save this blog entry.\n $this->blog_model->saveBlogEntry($blog_title, $blog_body, $blog_id);\n if (!empty($blog_id)) {\n $settings = new Settings();\n // Redirect the user to the detail page of this new blog entry.\n header('Location: ' . $settings->protocol . $settings->domain . '/index.php?action=blog-detail&id=' . $blog_id, 1);\n }\n }\n\n }\n\n }",
"protected function updateAndPersistBlog() {}",
"public function updated(BlogPost $blogPost)\n {\n\n }",
"function update_object( $blog_id, $fields ) {}",
"public function updated(BlogPost $blogPost)\n {\n //\n }",
"function update_blog($blog) {\n\t\t$this->opendb();\n\t\t$sql = 'UPDATE BLOG SET TITLE=:TITLE,SEGMENT=:SEGMENT,STATUS=:STATUS,PUBLISH_DTTM=:PUBLISH_DTTM,\n\t\t\tCONTENT=:CONTENT,CONTENT_SUMMARY=:CONTENT_SUMMARY,LAST_UPDATED_DTTM=CURRENT_TIMESTAMP,CONTENT_TYPE=:CONTENT_TYPE,\n\t\t\tCONTENT_PATH=:CONTENT_PATH WHERE BLOG_ID=:BLOG_ID';\n\t\t$stmt = $this->prepare($sql);\n\t\t$stmt->bindValue(':BLOG_ID', $blog['BLOG_ID'], SQLITE3_TEXT);\n\t\t$stmt->bindValue(':TITLE', $blog['TITLE'], SQLITE3_TEXT);\n\t\t$stmt->bindValue(':SEGMENT', $blog['SEGMENT'], SQLITE3_TEXT);\n\t\t$stmt->bindValue(':STATUS', $blog['STATUS'], SQLITE3_TEXT);\n\t\t$stmt->bindValue(':PUBLISH_DTTM', $blog['PUBLISH_DTTM'], SQLITE3_TEXT);\n\t\t$stmt->bindValue(':CONTENT', $blog['CONTENT'], SQLITE3_TEXT);\t\n\t\t$stmt->bindValue(':CONTENT_SUMMARY', $blog['CONTENT_SUMMARY'], SQLITE3_TEXT);\t\n\t\t$stmt->bindValue(':CONTENT_TYPE', $blog['CONTENT_TYPE'], SQLITE3_TEXT);\n\t\t$stmt->bindValue(':CONTENT_PATH', $blog['CONTENT_PATH'], SQLITE3_TEXT);\n\t\t$result = $stmt->execute();\t\t\n\t\t$this->close();\n\n\t\t$this->save_tags($blog);\n\n\t\treturn $blog;\n\t}",
"public function executeUpdateBlogPost(sfWebRequest $request)\n {\n $b = BlogPostTable::getInstance()->find($request->getParameter('id'));\n\n $b->setTitle($request->getParameter('title'));\n\n $this->getContext()->getConfiguration()->loadHelpers(array('Url'));\n\n switch ($request->getParameter('return'))\n {\n case 'without':\n $returnAction = 'blog_post/actionWithoutLayout';\n break;\n\n case 'with':\n $returnAction = 'blog_post/actionWithLayout';\n break;\n\n default:\n $this->forward404('unknown return');\n break;\n }\n\n list($action, $module) = explode('/', $returnAction);\n\n $b->save();\n\n $this->redirect($returnAction);\n }",
"public function updateAction(\\Lobacher\\Simpleblog\\Domain\\Model\\Blog $blog) {\r\n $this->blogRepository->update($blog);\r\n $this->redirect('list');\r\n }",
"public function editAction(BlogEntry $blogEntry) {\n\t\t$this->view->assign('blog', $blogEntry);\n\t}",
"public function editEntry() : void\n {\n $this->loginService->check();\n\n $error = null;\n\n $entry = new EntryModel();\n $entry->entryID = e($_GET['eid']);\n\n if($entry->entryID !== null)\n {\n if (isset($_POST['update']))\n {\n $content = trim($_POST['blogcontent']);\n $title = trim($_POST['blogtitle']);\n\n if(!empty($content) && !empty($title))\n {\n $entry->blogtitle = e($_POST['blogtitle']);\n $entry->blogcontent = e($_POST['blogcontent']);\n $this->entryRepository->updateEntry($entry);\n }\n else\n {\n $error = 'Der Eintrag darf nicht leer sein.';\n }\n\n }\n if (isset($_POST['delete'])) {\n $this->entryRepository->deleteById($entry);\n header('Location: userEntries');\n }\n }\n else\n {\n $error = 'Post nicht gefunden.';\n }\n\n $entry = $this->entryRepository->findByIdAndAuthor($entry->entryID, $_SESSION['login']);\n\n $this->render('layout/header', [\n 'navigation' => $this->loginService->getNavigation()\n ]);\n $this->render('User/editEntry', [\n 'entry' => $entry,\n 'error' => $error\n ]);\n }",
"public function save_entry_update() {\n\t\tglobal $wpdb;\n\n\t\tif ( !isset( $_REQUEST['action'] ) || !isset( $_GET['page'] ) )\n\t\t\treturn;\n\n\t\tif ( 'vfb-entries' !== $_GET['page'] )\n\t\t\treturn;\n\n\t\tif ( 'update_entry' !== $_REQUEST['action'] )\n\t\t\treturn;\n\n\t\tif ( !isset( $_POST['entry_id'] ) )\n\t\t\treturn;\n\n\t\t$entry_id = absint( $_POST['entry_id'] );\n\n\t\tcheck_admin_referer( 'update-entry-' . $entry_id );\n\n\t\t// Get this entry's data\n\t\t$entry = $wpdb->get_var( $wpdb->prepare( \"SELECT data FROM $this->entries_table_name WHERE entries_id = %d\", $entry_id ) );\n\n\t\t$data = unserialize( $entry );\n\n\t\t// Loop through each field in the update form and save in a way we can use\n\t\tforeach ( $_POST['field'] as $key => $value ) {\n\t\t\t$fields[ $key ] = $value;\n\t\t}\n\n\t\tforeach ( $data as $key => $value ) :\n\n\t\t\t$id = $data[ $key ]['id'];\n\n\t\t\t// Special case for checkbox and radios not showing up in $_POST\n\t\t\tif ( !isset( $fields[ $id ] ) && in_array( $data[ $key ][ 'type' ], array( 'checkbox', 'radio' ) ) )\n\t\t\t\t$data[ $key ]['value'] = '';\n\n\t\t\t// Only update value if set in $_POST\n\t\t\tif ( isset( $fields[ $id ] ) ) {\n\t\t\t\tif ( in_array( $data[ $key ][ 'type' ], array( 'checkbox' ) ) )\n\t\t\t\t\t$data[ $key ]['value'] = implode( ', ', $fields[ $id ] );\n\t\t\t\telse\n\t\t\t\t\t$data[ $key ]['value'] = esc_html( $fields[ $id ] );\n\t\t\t}\n\t\tendforeach;\n\n\t\t$where = array( 'entries_id' => $entry_id );\n\t\t// Update entry data\n\t\t$wpdb->update( $this->entries_table_name, array( 'data' => serialize( $data ), 'notes' => $_REQUEST['entries-notes'] ), $where );\n\t}",
"public function update() {\n\n if ( is_null( $this->id ) ) trigger_error ( \"Post::update(): Attempt to update an Post object that does not have its ID property set.\", E_USER_ERROR );\n\n // Update the Post\n $connection = connect();\n $sql = \"UPDATE post SET publicationDate=FROM_UNIXTIME(:publicationDate), title=:title, text=:text, link=:link, type=:type, buttonText=:buttonText, photoLink=:photoLink WHERE id = :id\";\n $st = $connection->prepare ( $sql );\n $st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\n $st->bindValue( \":publicationDate\", $this->publicationDate, PDO::PARAM_INT );\n $st->bindValue( \":title\", $this->title, PDO::PARAM_STR );\n $st->bindValue( \":text\", $this->text, PDO::PARAM_STR );\n $st->bindValue( \":link\", $this->link, PDO::PARAM_STR );\n $st->bindValue( \":type\", $this->type, PDO::PARAM_STR );\n $st->bindValue( \":buttonText\", $this->buttonText, PDO::PARAM_STR );\n $st->bindValue( \":photoLink\", $this->photoLink, PDO::PARAM_STR );\n if (!$st->execute()) {\n $connection = null;\n return 'failed';\n };\n $connection = null;\n }",
"function bpb_extended_blog_update( $object = '', $item_id = 0, $content = '' ) {\n\t// Only do something if on single blog\n\tif ( bpb_extended_is_single_item() ) {\n\t\tif ( empty( $object ) ) {\n\t\t\t$object = $_POST['object'];\n\t\t\t$item_id = $_POST['item_id'];\n\t\t\t$content = $_POST['content'];\n\t\t}\n\n\t\tif ( $object != buddypress()->blogs->id ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn bpb_extended_activity_publish( array(\n\t\t\t'item_id' => $item_id,\n\t\t\t'content' => $content,\n\t\t) );\n\t}\n}",
"public function updated(Entry $entry)\n {\n // update the elasticsearch index\n // $entry->updateIndex();\n }",
"public function updated(ShopBlog $shopBlog)\n {\n //\n }",
"public function updated(BlogNav $blogNav)\n {\n //\n }",
"public function postUpdate(Model $model, $entry) {\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the value of BackupVolumes. | public function getBackupVolumes(): array {
return $this->backupVolumes;
} | [
"public function getVolumes()\n {\n return $this->volumes;\n }",
"public function getVolumes()\n {\n return $this->apiCall('get', '/volumes', [], ['auto-fill' => true]);\n }",
"public function getVolumeBackup()\n {\n return $this->volume_backup;\n }",
"public function volumes(): array\n {\n return $this->get('volumes', []);\n }",
"public function getItemVolumes(): array\n {\n return $this->item_volumes;\n }",
"public function getRestoreVolumes(): array {\n return $this->restoreVolumes;\n }",
"public function retrieve_volumes()\n {\n $http_method = \"GET\";\n $endpoint = \"/volumes\";\n\n $result = $this->call_scaleway_api($this->token, $http_method, $endpoint, array(), array());\n\n return $result;\n }",
"public function getVolumesFrom() : array\n {\n return $this->volumesFrom;\n }",
"public function getVolumes(): int\n {\n if (\\is_int($this->volumes)) {\n return $this->volumes;\n }\n\n preg_match_all('/^( {2})\\w+: {}$/im', $this->getDockerComposeContent(), $matches);\n $volumes = \\count($matches[0]);\n $this->volumes = $volumes;\n\n return $this->volumes;\n }",
"function getVolumeSettings() {\n\t\t$volumes = array();\n\n\t\tif ( isset( $this->projectInfo[0]['info'] ) ) {\n\t\t\t$infos = $this->projectInfo[0]['info'];\n\n\t\t\t// first member is a count.\n\t\t\tarray_shift( $infos );\n\t\t\tforeach ( $infos as $info ) {\n\t\t\t\t$substrings=explode( '=', $info );\n\t\t\t\tif ( ( count( $substrings ) == 2 ) and ( $substrings[0] == 'use_volume' ) ) {\n\t\t\t\t\t$volumes[] = $substrings[1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $volumes;\n\t}",
"public function getBackups()\n {\n return $this->backups;\n }",
"public function getVolumeList()\n {\n $rest = $this->newRequest();\n $response = $rest->sendRequest('GET', '?volumeList');\n return @json_decode($response, false, 512, JSON_BIGINT_AS_STRING);\n }",
"public function getBackupList () {\r\n\t$this->ensureLoggedIn();\r\n\r\n\treturn $this->request(array('req' => 'getbackuplist'));\r\n\t}",
"protected function getBackups() : array{\n if(!$this->session->has(self::PREV_BOARD_SESSION_KEY))\n $this->setBackups([]);\n\n return $this->session->get(self::PREV_BOARD_SESSION_KEY);\n }",
"protected function getBackups()\n {\n return collect(Folder::getFiles(storage_path('backups')))->map(function ($file) {\n return (new \\SplFileInfo(root_path($file)));\n });\n }",
"public function getBackups () {\r\n $this->ensureLoggedIn();\r\n\r\n return $this->request(array('req' => 'getbackups'));\r\n }",
"function list_backups() {\n\n // Get response from the server.\n $resp = $this->curl_call('act=backups');\n $resp = unserialize($resp);\n return $resp['backups'];\n }",
"public function listVolumesUseruploaded($optParams = array())\n {\n $params = array();\n $params = array_merge($params, $optParams);\n return $this->call('list', array($params), \"Google_Service_Books_Volumes\");\n }",
"public function getVolume()\n {\n return $this->volume;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compare gears core and current core | private function check_core($version){
return version_compare($version,COGEAR,'<=');
} | [
"function _maybe_update_core()\n {\n }",
"public static function get_current_core_hashes() {\n\t\treturn self::get_core_hashes( $GLOBALS['wp_version'], get_locale() );\n\t}",
"function _maybe_update_core()\n{\n}",
"public function compareUpdates($a, $b) {\n if ($a->part() == $b->part()) {\n if ($a->nr() < $b->nr())\n return -1;\n else\n return 1;\n }\n else if ($a->part() == \"core\")\n return -1;\n else\n return 1;\n }",
"public function coreStatus($core)\n {\n $status = $this->admin->createStatus();\n $status->setCore($core);\n\n $this->admin->setAction($status);\n $response = $this->client->coreAdmin($this->admin);\n\n return $response->getStatusResult();\n }",
"public function getPreferredCoreId() {\n\n $core = $this->getPreferredCore();\n\n return $core['core_id'];\n\n }",
"public function getActiveSolrCores()\n\t{\n\t\t$availableCores = $this->ultility->getAvailableCores();\n\t\t$activeSolrCores = array();\n\t\t\n\t\tforeach ($availableCores as $solrcore => $infoArray)\n\t\t{\n\t\t\tif ( isset($infoArray['stores']) && strlen(trim($infoArray['stores'], ',')) > 0 )\n\t\t\t{\n\t\t\t\t$infoArray['stores'] = trim($infoArray['stores'], ',');\n\t\t\t\t$activeSolrCores[$solrcore] = $infoArray;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $activeSolrCores;\n\t}",
"function version_compare($version1,$version2,$compare_symbol=NULL)\n{\n\treturn 0;\n}",
"public function coreIsActive($core)\n {\n // Request the status of the full core name\n $result = $this->coreCommand('STATUS', $core);\n return isset($result->status->$core->uptime);\n }",
"public function getPreferredCoreUrl() {\n\n $core = $this->getPreferredCore();\n\n return 'http://' . $core['balancer'] . '/solr/' . $core['core_id'];\n\n }",
"public function version(){\n\t\treturn self::core9_version;\n\t}",
"private function formatCoreCompatibilityString($coreMin = null, $coreMax = null)\n {\n $coreMin = !empty($coreMin) ? $coreMin : '1.4.0';\n $coreMax = !empty($coreMax) ? $coreMax : '2.9.99';\n\n return $coreMin . ' - ' . $coreMax;\n }",
"public function getAvailableCore(){\n $locales = $this->locales;\n if( is_null($locales) ){\n $locales = array();\n // get official locales from API if we have network\n if( $cached = $this->wp_get_available_translations() ){\n $english_name = 'english_name';\n $native_name = 'native_name';\n }\n // else fall back to bundled data cached\n else {\n $english_name = 0;\n $native_name = 1;\n $cached = Loco_data_CompiledData::get('locales');\n // debug so we can see on front end that data was offline\n // $locales['en-debug'] = ( new Loco_Locale('en','','debug') )->setName('OFFLINE DATA');\n }\n foreach( $cached as $tag => $raw ){\n $locale = Loco_Locale::parse($tag);\n if( $locale->isValid() ){\n $locale->setName( $raw[$english_name], $raw[$native_name] );\n $locales[ (string) $tag ] = $locale;\n }\n /* Skip invalid language tags, e.g. \"pt_PT_ao90\" should be \"pt_PT_ao1990\"\n * No point fixing invalid tags, because core translation files won't match. \n else {\n Loco_error_AdminNotices::debug( sprintf('Invalid locale: %s', $tag) );\n }*/\n }\n $this->locales = $locales;\n }\n return $locales;\n }",
"public function getCore(): string\n {\n return (string) $this->getOption('core');\n }",
"public static function getCores() {\n self::$core = self::getCodeFilesInDir(BASEPATH . 'core');\n return array_keys(self::$core);\n }",
"function drush_dslm_switch_core() {\n // Bootstrap dslm, this grabs the instantiated and configured Dslm library object\n if (!$dslm = _dslm_bootstrap()) {\n return FALSE;\n }\n\n $args = drush_get_arguments();\n $core = isset($args[1]) ? $args[1] : FALSE;\n // If we still don't have a core string try to get on iteractively\n if (!$core) {\n $core_list = $dslm->getCores();\n $pick_core = drush_choice($core_list['all']);\n if (!$pick_core) {\n return FALSE;\n }\n $core = $core_list['all'][$pick_core];\n }\n\n $run = $dslm->switchCore($core);\n if (!$run) {\n return drush_set_error($dslm->lastError());\n }\n else {\n // @todo: get $dslm->newSite to return validated switch information rather than TRUE\n // for reporting here.\n drush_log('The links have been switched', 'ok');\n return TRUE;\n }\n}",
"public function setCore(string $core): self;",
"public function isCore()\n {\n return $this->extension === 'core';\n }",
"protected function get_installed_core_version() {\n\t\tglobal $wp_version;\n\n\t\treturn $wp_version;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Translates a commaseperated string of skill IDs to a comma (plus space) seperated skill name string. | function skillsTrans($str) {
$trans = array_map(create_function('$s', 'global $skillididx; return $skillididx[$s];'), is_array($str) ? $str : explode(',', $str));
return is_array($str) ? $trans : implode(', ', $trans);
} | [
"function generateSkillsString(\n\t$userid, $rotaid, $skillid\n){\n\treturn implode(\n\t\t'-',\n\t\tarray(\n\t\t\t$userid, \n\t\t\t$skillid\n\t\t)\n\t);\n}",
"public static function GetSkillsByJobString($jobId) {\n\t\t\t\n\t\t\t$skills = \\Classes\\Skill::GetSkillsByJob($jobId);\n\t\t\t\n\t\t\t$skillsList = Array();\n\t\t\t\n\t\t\tforeach ($skills as $skill) {\n\t\t\t\t$skillsList[] = $skill->skillId;\n\t\t\t}\n\t\t\t\n\t\t\treturn join(\",\",$skillsList);\n\t\t\t\n\t\t}",
"public function compress_skills($skills) {\r\n\r\n\t\tif(!is_array($skills)) {\r\n\t\t\t$skills = array($skills);\r\n\t\t}\r\n\r\n\t\tif(!isset($skills) || !$skills || count($skills) <= 0) {\r\n\t\t\treturn '';\r\n\t\t}\r\n\r\n\t\t$string = '';\r\n\t\tforeach($skills as $skill) {\r\n\t\t\tif(empty($string)) {\r\n\t\t\t\t$string = $skill;\r\n\t\t\t} else {\r\n\t\t\t\t$string = $string . ',' . $skill;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn $string;\r\n\t}",
"private function buildSkills($skills) {\n $result = \"\";\n foreach($skills as $skill) {\n $skillName = trim($skill);\n switch ($skillName) {\n case \"javascript\":\n $skillName = \"js\";\n break;\n case \"express\":\n $skillName = \"exp\";\n break;\n case \"python\":\n $skillName = \"py\";\n break;\n case \"mysql\":\n $skillName = \"sql\";\n break;\n default:\n break;\n }\n $result = $result . \"<div class='tooltip $skill'><p class='skillText'>$skillName</p><span class='tooltiptext'>$skill</span></div>\";\n }\n return $result;\n }",
"function convert_ids_to_name($ids)\n {\n \tif (empty($ids)) return '';\n\n \tif (is_string($ids)) $ids = explode(',', $ids);\n\n foreach ($ids as $key => $id) {\n $genres[] = $this->get_full_name_string($id);\n }\n\n/*\n \t$query= $this->db->select('name')\n \t->where_in('id', $ids)\n \t->get($this->_table);\n\n \t$genres = array();\n \tif ($query->num_rows())\n \t{\n \t\tforeach ($query->result() as $key => $value) {\n \t\t\t//$genres[] = $value->name;\n var_dump($value);\n $genres[] = $this->get_full_name_string($value->id);\n \t\t}\n \t}\t\n*/\n \treturn implode('; ', $genres);\n }",
"public function quoteNames(string $input): string\n {\n // Eg: \"id, name ...\" or \"id as ID, ...\".\n preg_match_all('~([^\\s,]+)~i', $input, $match);\n\n $names = array_filter($match[1], 'strlen');\n if (!$names) {\n return $input;\n }\n\n foreach ($names as $i => $name) {\n $names[$i] = $this->quoteName($name);\n }\n\n return join(', ', $names);\n }",
"function joinComma() {\n\t\t\treturn CStr::joinParam(', ');\n\t\t}",
"public static function account_id2name( $_account_id ) {\n\t\t$account_ids = is_array( $_account_id ) ? $_account_id : explode( ',', $_account_id );\n\t\tforeach ( $account_ids as $account_id ) {\n\t\t\tif ( $account_lid = $GLOBALS['egw']->accounts->id2name( $account_id )) {\n\t\t\t\t$account_lids[] = $account_lid;\n\t\t\t}\n\t\t}\n\t\treturn is_array( $_account_id ) ? $account_lids : implode( ',', (array)$account_lids );\n\t}",
"public function explodeSkills($request_skills)\n {\n $request_skills = explode(', ', $request_skills);\n $skills = $this->whereIn('name', $request_skills)->get();\n return $skills;\n }",
"public function getUserSkillsString() {\n // Get grades from E-A having keys 1-5\n $grades = array_combine(range(1, 5), range('E', 'A'));\n\n // Set empty string initially\n $userSkillsString = '';\n // Collect all skills in format {Skill Description} ({Skill Value}) \\n\n foreach ($this->userSkills as $userSkill) {\n if ($userSkill->value > 0) {\n $userSkillsString .= sprintf(\"%s (%s) <br />\", $userSkill->skills->description, $grades[$userSkill->value]);\n }\n }\n\n // In case no skill is found with value higher than 0, then return N/A message\n if ($userSkillsString === '') {\n $userSkillsString = 'No specified skills';\n }\n\n // Return message containing processed data\n return $userSkillsString;\n }",
"protected function get_multi_price_modifier_names ($audio_job_id)\n {\n \t$db = $this->getAdaptor();\n \t$stmt = null;\n \t$names = array();\n \t$args = array($audio_job_id);\n \n \t$sql = \"SELECT spm.name\n FROM audio_jobs_price_modifiers ajpm\n INNER JOIN s_service_price_modifier AS sspm ON sspm.id = ajpm.service_price_modifier_id\n INNER JOIN s_price_modifier AS spm ON spm.id = sspm.price_modifier_id\n WHERE audio_job_id = ?\";\n \n \t$stmt = new Zend_Db_Statement_Mysqli($db, $sql);\n \t$stmt->execute($args);\n \n \t// Loop through the rows to get the names\n \twhile ($row = $stmt->fetch())\n \t{\n \t\t$names[] = $row[\"name\"];\n \t}\n \n \treturn implode(\", \", $names);\n }",
"public function getApellidosNombre() {\n $texto = $this->getApellidos() . \", \" . $this->getNombre();\n if ($texto == \", \")\n $texto = \"\";\n return $texto;\n }",
"public function getCommaNameAttribute()\n {\n return $this->last.', '.$this->first.' '.$this->middle;\n }",
"private function formatSkill(string $skill): string\n {\n // First, remove all whitespace from the skill name.\n // Then, lowercase the entire skill.\n // Lastly, uppercase the first letter, to match the expected Skill key.\n return ucfirst(\n strtolower(\n preg_replace('/\\s/', '', $skill)\n )\n );\n }",
"private function parseGenre($ids)\n {\n $genre = [];\n\n foreach($ids as $id) {\n $genre[] = isset($this->genreList()[$id]) ? $this->genreList()[$id] : '';\n }\n\n return implode($genre, ', ');\n }",
"function getSkillNameFromSkillId($skillId)\n\t\t{\n\t\t\t$skillDetails = $this->manage_content->getValue_where('skills', '*', 'skillId', $skillId);\n\t\t\treturn $skillDetails[0]['name'];\n\t\t}",
"function convertArrayToCommaseparatedString($inputArray) {\n\t\t$result = '';\n\n\t\tforeach ($inputArray as $uid) {\n\t\t\t$result .= ', ' . $uid;\n\t\t}\n\n\t\treturn trim($result, ',');\n\t}",
"public function getIdsString(){\n\t\treturn implode(',', $this->getMenuitemIds());\n\t}",
"function tag_id_from_string($tag_names_or_ids_csv) {\n\n $tag_names_or_ids = explode(',', $tag_names_or_ids_csv);\n\n $tag_ids = array();\n foreach ($tag_names_or_ids as $name_or_id) {\n\n if (is_numeric($name_or_id)){\n $tag_ids[] = $name_or_id;\n }\n elseif (is_string($name_or_id)) {\n $tag_ids[] = tag_id( $name_or_id );\n }\n\n }\n\n $tag_ids_csv = implode(',',$tag_ids);\n $tag_ids_csv = str_replace(' ', '', $tag_ids_csv);\n\n return rtrim($tag_ids_csv, ',');\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fix some mangled hublocs from a bug long ago | function update_r1097() {
$r = q("select hubloc_id, hubloc_addr from hubloc where hubloc_addr like '%%/%%'");
if($r) {
foreach($r as $rr) {
q("update hubloc set hubloc_addr = '%s' where hubloc_id = %d limit 1",
dbesc(substr($rr['hubloc_addr'],0,strpos($rr['hubloc_addr'],'/'))),
intval($rr['hubloc_id'])
);
}
}
return UPDATE_SUCCESS;
} | [
"function fixPathway(){\n\t\treturn 'Warning: fixPathway depreciated';\n\t\t/*\n\t\t$pathway =& bfDocument::getPathWay();\n\n\t\t$arr = array();\n\t\tforeach ($pathway->_pathway as $link){\n\t\tif (substr($link->name,0,2) != 'bf') $arr[] = $link;\n\t\t}\n\t\t$pathway->_pathway =& $arr;\n\t\t*/\n\t}",
"public function fix() {}",
"private function upgrade_77()\n {\n }",
"function sanitize_trackback_urls($to_ping)\n {\n }",
"private function fix_remote_host()\n\t{\n\t\t$new_remote_host = ( isset( $_SERVER['REMOTE_HOST'] ) ) ? $_SERVER['REMOTE_HOST'] : @gethostbyaddr( $_SERVER['REMOTE_ADDR'] );\n\t\tif ( $new_remote_host != $_SERVER['REMOTE_ADDR'] )\n\t\t\t$_SERVER['REMOTE_HOST'] = esc_html( $new_remote_host );\n\t}",
"function sanitize_trackback_urls($to_ping)\n{\n}",
"private function upgrade_73()\n {\n }",
"public function fixSpatial()\r\n \t{\r\n \t}",
"public function fixSpatial()\n \t{\n \t}",
"public function fixSpatial()\n\t{\n\t}",
"public function testSiteMapRebuild() {\n\n\t}",
"private function correctPushLink(){\n $this->wapPushLink = trim($this->wapPushLink);\n if($this->wapPushLink && (strpos($this->wapPushLink, 'http://') === FALSE)) // wapPushLink Должна включать http://\n $this->wapPushLink = 'http://'.$this->wapPushLink;\n }",
"private function resolveHtmlLinks()\n {\n // 1. Check that the main part is a html part\n // 2. Go through the related parts and build up a structure of available\n // CIDS and locations\n // 3. Substitute in this message.\n }",
"function webscheme_fixloadurls(&$webscheme) {\r\n\t$webscheme->ws_loadurls = webscheme_remslashes($webscheme->ws_loadurls);\r\n\t$loadurls = preg_split(\"/\\s+/\", $webscheme->ws_loadurls, 0, PREG_SPLIT_NO_EMPTY);\t\r\n\t$webscheme->ws_loadurls = webscheme_db_json_encode($loadurls);\r\n}",
"function syncml_upgrade1_6()\n{\n\tforeach($GLOBALS['egw_setup']->db->select('egw_contentmap','map_id,map_guid,map_locuid',false,__LINE__,__FILE__,false,'','syncml') as $row)\n\t{\n\t\t$guid_parts = explode('-',$row['map_guid']);\n\t\tif (count($guid_parts) > 2)\n\t\t{\n\t\t\tarray_pop($guid_parts);\t// remove last part (install_id)\n\n\t\t\t$GLOBALS['egw_setup']->db->update('egw_contentmap',array(\n\t\t\t\t'map_guid' => implode('-',$guid_parts),\n\t\t\t),$row,__LINE__,__FILE__,'syncml');\n\t\t}\n\t}\n\treturn $GLOBALS['setup_info']['syncml']['currentver'] = '1.6.001';\n}",
"function _ChangePlaceholders()\n\t{\n\t\tif ($this->placeholders_changed) {\n\t\t\treturn;\n\t\t}\n\t\t$this->body['h'] = str_replace(array('%BASIC:ARCHIVELINK%', '%basic:archivelink%'), '%%mailinglistarchive%%', $this->body['h']);\n\n\t\t/**\n\t\t * This is a fix for DevEdit where it prefixed non-absolute link to make it an absolute link. (This only happens in IE6)\n\t\t *\n\t\t * This create a problem where SendStudio insert a \"customfield\" link, such as: <a href=\"%%unsubscribelink%%\">Unsubscribe me</a>,\n\t\t * and DevEdit replace it with something like: <a href=\"http://beta/ssnx/admin/de/%%unsubscribelink%%/\">Unsubscribe me</a>\n\t\t *\n\t\t * In order to fix this, I modified SendStudio insert. So insetead of inserting a \"relative link\", I insert a base-h link.\n\t\t * So the link will look like this: <a href=\"http://%%unsubscribelink%%/\">Unsubscribe me</a>.\n\t\t * This changes are made in javascript.php under InsertLink function.\n\t\t */\n\t\t$this->body['h'] = preg_replace('~<a(.*?)href=[\"|\\']http://%%(unsubscribelink|modifydetails_|sendfriend_)(\\d*?)%%/[\"|\\']>(.*?)</a>~i', '<a${1}href=\"%%${2}${3}%%\">${4}</a>',$this->body['h']);\n\n\n\t\tif (!preg_match('/<a(.+)href=[\"\\']*%%mailinglistarchive%%[\"\\']*(.*)>/i', $this->body['h'])) {\n\t\t\t$this->body['h'] = str_replace('%%mailinglistarchive%%', '<a href=\"%%mailinglistarchive%%\">%%mailinglistarchive%%</a>', $this->body['h']);\n\t\t}\n\n\t\tif (!preg_match('/<a(.+)href=[\"\\']*%%webversion%%[\"\\']*(.*)>/i', $this->body['h'])) {\n\t\t\t$this->body['h'] = str_replace('%%webversion%%', '<a href=\"%%webversion%%\">%%webversion%%</a>', $this->body['h']);\n\t\t}\n\n\t\t$this->body['h'] = str_replace(array('%BASIC:UNSUBLINK%', '%basic:unsublink%'), '%%unsubscribelink%%', $this->body['h']);\n\n\t\tif (!preg_match('/<a(.+)href=[\"\\']*%%unsubscribelink%%[\"\\']*(.*)>/i', $this->body['h'])) {\n\t\t\t$this->body['h'] = str_replace(array('%%unsubscribelink%%', '%%UNSUBSCRIBELINK%%'), '<a href=\"%%unsubscribelink%%\">%%unsubscribelink%%</a>', $this->body['h']);\n\t\t}\n\n\t\tif (!preg_match('/<a(.+)href=[\"\\']*%%unsubscribe%%[\"\\']*(.*)>/i', $this->body['h'])) {\n\t\t\t$this->body['h'] = str_replace(array('%%unsubscribe%%', '%%UNSUBSCRIBE%%'), '<a href=\"%%unsubscribe%%\">%%unsubscribe%%</a>', $this->body['h']);\n\t\t}\n\n\t\t$this->body['h'] = str_replace(array('%BASIC:CONFIRMLINK%', '%basic:confirmlink%'), '%%confirmlink%%', $this->body['h']);\n\n\t\tif (!preg_match('/<a(.+)href=[\"\\']*%%confirmlink%%[\"\\']*(.*)>/i', $this->body['h'])) {\n\t\t\t$this->body['h'] = str_replace(array('%%confirmlink%%','%CONFIRMLINK%'),'%confirmlink%',$this->body['h']);\n\t\t\t$this->body['h'] = str_replace('%confirmlink%', '<a href=\"%%confirmlink%%\">%%confirmlink%%</a>', $this->body['h']);\n\t\t}\n\n\t\tif (!preg_match('/<a(.+)href=[\"\\']*%%modifydetails_(.*?)%%[\"\\']*(.*)>/i', $this->body['h'])) {\n\t\t\t$this->body['h'] = preg_replace('/%%MODIFYDETAILS_(.*?)%%/i', '<a href=\"%%MODIFYDETAILS_\\\\1%%\">%%MODIFYDETAILS_\\\\1%%</a>', $this->body['h']);\n\t\t}\n\n\t\tif (!preg_match('/<a(.+)href=[\"\\']*%basic:modifydetails_(.*?)%[\"\\']*(.*)>/i', $this->body['h'])) {\n\t\t\t$this->body['h'] = preg_replace('/%BASIC:MODIFYDETAILS_(.*?)%/i', '<a href=\"%BASIC:MODIFYDETAILS_\\\\1%\">%BASIC:MODIFYDETAILS_\\\\1%</a>', $this->body['h']);\n\t\t}\n\n\t\t$this->body['h'] = preg_replace('/%BASIC:MODIFYDETAILS_(.*?)%/i', '%%modifydetails_\\\\1%%', $this->body['h']);\n\n\t\tif (!preg_match('/<a(.+)href=[\"\\']*%%sendfriend_(.*?)%%[\"\\']*(.*)>/i', $this->body['h'])) {\n\t\t\t$this->body['h'] = preg_replace('/%%sendfriend_(.*?)%%/i', '<a href=\"%%sendfriend_\\\\1%%\">%%sendfriend_\\\\1%%</a>', $this->body['h']);\n\t\t}\n\t\t$this->placeholders_changed = true;\n\t}",
"function that_was_a_freebie(){\n $this->EE->uri->segments = array();\n $this->EE->uri->rsegments = array();\n $this->EE->uri->_explode_segments();\n }",
"private function upgrade_145()\n {\n }",
"function wppsh_get_hubs() {\n $hub = get_option('wppsh_hub_urls');\n if (!$hub) {\n return \"http://pubsubhubbub.appspot.com\\nhttp://superfeedr.com/hubbub\";\n } else {\n return $hub;\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the conjunction of this && value. | public function andAlso($value)
{
return self::get($this->value && self::primitive($value));
} | [
"function and_ () {\n $this->where_ .= ' AND ';\n $this->conjunked = true;\n return $this;\n }",
"public function metaQueryRelation_AND(){\n return $this->metaQueryRelation('AND');\n }",
"public function isConjunction()\n {\n return in_array($this->getWord(), ['and', 'or']);\n }",
"public function _and() {\n\t\t$args = func_get_args();\n\t\t$this->add($args, GlueDB_Fragment_Operand_Bool::_AND);\n\t\treturn $this;\n\t}",
"public static function logicalAnd()\n {\n return self::getTestCase()->logicalAnd();\n }",
"public function do_and() {\n\t\treturn $this->condition_factory->do_and( func_get_args() );\n\t}",
"public function getFilterConjunction(): string\n {\n return $this->filterConjunction;\n }",
"public function wAnd()\n {\n $this->setDefaultOperator(PredicateSet::OP_AND);\n \n if (func_num_args()) {\n call_user_func_array([$this, 'condition'], func_get_args());\n $this->endAnd();\n }\n \n return $this;\n }",
"public function and(): QueryString\n {\n return $this->defaultOperator('AND');\n }",
"#[PrimiFunc]\n\tpublic static function and(BoolValue $a, BoolValue $b): BoolValue {\n\t\treturn Interned::bool($a->value && $b->value);\n\t}",
"public function and(string ...$commands) : string\n {\n return implode(' && ', $commands);\n }",
"public function conditionalAndExpression(){\n $value = null;\n\n $v1 = null;\n\n $v2 = null;\n\n\n $v = array();\n try {\n // Sparql10.g:308:5: (v1= valueLogical ( AND v2= valueLogical )* ) \n // Sparql10.g:308:7: v1= valueLogical ( AND v2= valueLogical )* \n {\n $this->pushFollow(self::$FOLLOW_valueLogical_in_conditionalAndExpression1899);\n $v1=$this->valueLogical();\n\n $this->state->_fsp--;\n\n $v[] = $v1;\n // Sparql10.g:308:44: ( AND v2= valueLogical )* \n //loop56:\n do {\n $alt56=2;\n $LA56_0 = $this->input->LA(1);\n\n if ( ($LA56_0==$this->getToken('AND')) ) {\n $alt56=1;\n }\n\n\n switch ($alt56) {\n \tcase 1 :\n \t // Sparql10.g:308:46: AND v2= valueLogical \n \t {\n \t $this->match($this->input,$this->getToken('AND'),self::$FOLLOW_AND_in_conditionalAndExpression1905); \n \t $this->pushFollow(self::$FOLLOW_valueLogical_in_conditionalAndExpression1909);\n \t $v2=$this->valueLogical();\n\n \t $this->state->_fsp--;\n\n \t $v[]=$v2;\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop56;\n }\n } while (true);\n\n\n }\n\n $value = new Erfurt_Sparql_Query2_ConditionalAndExpression($v);\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 $value;\n }",
"private function getConjunctions()\r\n {\r\n return $this->conjunctions;\r\n }",
"public function andOperatorAction()\n {\n $this->_sign = true;\n //$this->_currentConjunction[end(array_keys($this->_currentConjunction))][1] = $this->_sign;\n if ($this->_higherPriorityOperator === QueryParser::OPERATOR_OR) {\n $this->_conjunctions[] = $this->_currentConjunction;\n $this->_currentConjunction = [];\n } else {\n $this->_currentConjunction[end(array_keys($this->_currentConjunction))][1] = $this->_sign;\n }\n }",
"public function db_and() {\n return new Condition('AND');\n }",
"public function compileAnd($query)\n {\n return $query ? $this->wrap($query, '(&') : '';\n }",
"public function setConditionModeToAnd()\n {\n return $this->setConditionMode(self::CONDITION_MODE_AND);\n }",
"public function and_where_open()\n {\n $this->_where[] = array('AND' => '(');\n return $this;\n }",
"public function and_where_open(){\n $this->_where[] = array('AND' => '(');\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
How many alerts are queued? | public function count()
{
return \count($this->alerts);
} | [
"public function queueCount();",
"public function queueCount()\n {\n return $this->mockHandler->count();\n }",
"public function count() {\n return count($this->queues);\n }",
"public function count() {\n return count($this->queue);\n }",
"public static function get_active_alert_count() {\n\n\t\treturn ( count( self::$active_errors ) + count( self::$active_warnings ) );\n\t}",
"public function getPendingEventsCount()\n {\n return inotify_queue_len($this->_inotify);\n }",
"public static function countMessages()\n {\n assert(is_array(self::$queue), 'Static member \"queue\" is expected to be an array.');\n return count(self::$queue);\n }",
"public function getNumQueued()\n {\n return $this->getNumStatus(QueueModel::STATUS_WAITING);\n }",
"public static function count()\n {\n return count(static::$events);\n }",
"private function getCountOfMessages(){\n\t\t\n\t\t$ipAddress = (isset($_SERVER['REMOTE_ADDR'])) ? $_SERVER['REMOTE_ADDR'] : '';\n\t\t$database = new Database;\n\t\t$query = $database->getCount('message_queues', \n\t\t\t\t\t\t\t\t\t \" ip_address='$ipAddress' AND DATE(`created_at`) = CURDATE() \");\n\t\t$exec = $database->query($query);\n\t\tif ($exec) {\n\t\t\t$row = $database->fetchArray($exec);\n\t\t\treturn $row['count'];\n\t\t}\n\n\t\treturn 0;\n\t}",
"public function quantity()\n {\n return count($this->queue);\n }",
"protected function countMessages()\n {\n $count = $this->declareQueue(\n $this->queueName,\n $this->passive,\n $this->durable,\n $this->exclusive,\n $this->auto_delete\n );\n if (is_array($count) && $count[0] == $this->queueName) {\n return $count[1];\n }\n return 0;\n }",
"public function count() {\n\t\treturn count( self::$handlers );\n\t}",
"public function getQueuePendingRetryCount()\n {\n return Mage::getModel('avatax_records/queue')->getCollection()\n ->addFieldToFilter('status', OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_RETRY)\n ->getSize();\n }",
"public function countAll() {\n return count($this->getQueue());\n }",
"public function sendCount();",
"public function stats()\n\t{\n\t\t$stats = array('ready'=>0);\n\n\t\tforeach($this->_listening as $queue)\n\t\t{\n\t\t\t$stats['ready'] += $queue->GetQueueAttributes('ApproximateNumberOfMessages');\n\t\t}\n\n\t\treturn $stats;\n\t}",
"public function count()\n {\n return count($this->_backend->getMessages());\n }",
"public function getCompletedCount();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates inner join. If right column is null it tries to join table on same column name as in left table. | public function innerJoin($table, $leftColumn, $rightColumn = null)
{
return $this->addJoin($table, $leftColumn, $rightColumn);
} | [
"private function join()\n {\n $a = $this->prefix($this->pk(), $this->table());\n $b = $this->prefix($this->pk(), $this->ee_table);\n\n ee()->db->join($this->ee_table, $a . ' = ' . $b, 'inner');\n }",
"public function InnerJoin()\n\t\t{\n\t\t\treturn $this->AddSubComponent(ExtensionsHandler()->ExtendableObject('\\DaFramework\\Model\\Abstraction\\InnerJoin'));\n\t\t}",
"public function innerJoin($table, $local, $foreign, $alias = null);",
"static function Inner()\n {\n return new self('INNER JOIN');\n }",
"public function innerJoin($table, $condition);",
"public function rightJoin($table_name, string $col1 = null, string $col2 = null): self;",
"public function innerJoin(string $table, string $on) : SqlQueryable;",
"public function fullOuterJoin($table);",
"function right_join($table, $on) {\n\t\treturn $this->join($table, $on, 'left');\n\t}",
"public function innerJoin($table, array $joins);",
"public function innerJoin($table, $alias = NULL, $condition = NULL, $arguments = array());",
"public function rightJoin($table, $condition = null, $alias = null);",
"public function testBuildJoinDefaultWithTwoJoinOn()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->joinOn('id', 'id')\n ->joinOn('user_id', 'type_id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 ON table1.id = table2.id AND table1.user_id = table2.type_id',\n $query->buildJoin()\n );\n }",
"public function join($tableName, $expression = '', $alias = '', $args = []);",
"function &right_join($table, $cond = false)\n\t{\n\t\treturn $this->join($table, $cond, 'RIGHT');\n\t}",
"function db_get_right_join($table,$table_b,$col, $where=''){\n $res = array();\n $iConn = mysqli_connect(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME);//connect to database\n $query = \"Select * from $table $where as A RIGHT JOIN $table_b as B ON A.$col = B.$col\";\n $result = mysqli_query($iConn,$query) or die(mysqli_error($iConn));\n while ($row = mysqli_fetch_array($result)) {\n array_push($res,$row);\n }\n \n return $res;\n @mysqli_close($iConn);\n}",
"function &outer_join($table, $cond = false)\n\t{\n\t\treturn $this->join($table, $cond, 'OUTER');\n\t}",
"public function __construct($leftColumn = null, $rightColumn = null, $joinType = null)\n\t{\n\t\tif(!is_null($leftColumn)) {\n\t\t if (!is_array($leftColumn)) {\n\t\t // simple join\n\t\t $this->addCondition($leftColumn, $rightColumn);\n\t\t } else {\n\t\t // join with multiple conditions\n\t\t if (count($leftColumn) != count($rightColumn) ) {\n\t\t\t throw new PropelException(\"Unable to create join because the left column count isn't equal to the right column count\");\n\t\t }\n\t\t foreach ($leftColumn as $key => $value)\n\t\t {\n\t\t $this->addCondition($value, $rightColumn[$key]);\n\t\t }\n\t\t }\n\t\t $this->setJoinType($joinType);\n\t\t}\n\t}",
"protected abstract function getJoinStatement();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests that routes are rebuilt during install and uninstall of modules. | public function testRouteRebuild() {
// Remove the routing table manually to ensure it can be created lazily
// properly.
Database::getConnection()->schema()->dropTable('router');
$this->container->get('module_installer')->install(['router_test']);
$route = $this->container->get('router.route_provider')->getRouteByName('router_test.1');
$this->assertEquals('/router_test/test1', $route->getPath());
$this->container->get('module_installer')->uninstall(['router_test']);
$this->setExpectedException(RouteNotFoundException::class);
$this->container->get('router.route_provider')->getRouteByName('router_test.1');
} | [
"public function testAppsAppRoutesRoutePatch()\n {\n }",
"public function testOnAlterRoutesWithNonAdminRoutes() {\n $event = $this->getMockBuilder('Drupal\\Core\\Routing\\RouteBuildEvent')\n ->disableOriginalConstructor()\n ->getMock();\n $route_collection = new RouteCollection();\n $route_collection->add('test', new Route('/admin/foo', ['_controller' => 'Drupal\\ExampleController']));\n $route_collection->add('test2', new Route('/bar', ['_controller' => 'Drupal\\ExampleController']));\n // Non content routes, like ajax callbacks should be ignored.\n $route3 = new Route('/bar', ['_controller' => 'Drupal\\ExampleController']);\n $route3->setMethods(['POST']);\n $route_collection->add('test3', $route3);\n // Routes with the option _admin_route set to TRUE will be included.\n $route4 = new Route('/bar', ['_controller' => 'Drupal\\ExampleController']);\n $route4->setOption('_admin_route', TRUE);\n $route_collection->add('test4', $route4);\n // Non-HTML routes, like api_json routes should be ignored.\n $route5 = new Route('/bar', ['_controller' => 'Drupal\\ExampleController']);\n $route5->setRequirement('_format', 'api_json');\n $route_collection->add('test5', $route5);\n // Routes which include HTML should be included.\n $route6 = new Route('/bar', ['_controller' => 'Drupal\\ExampleController']);\n $route6->setRequirement('_format', 'json_api|html');\n $route_collection->add('test6', $route6);\n\n $event->expects($this->once())\n ->method('getRouteCollection')\n ->will($this->returnValue($route_collection));\n\n $this->state->expects($this->once())\n ->method('set')\n ->with('routing.non_admin_routes', ['test2', 'test4', 'test6']);\n $this->preloader->onAlterRoutes($event);\n $this->preloader->onFinishedRoutes(new Event());\n }",
"public function testOnAlterRoutesWithAdminPathNoAdminRoute() {\n $event = $this->getMockBuilder('Drupal\\Core\\Routing\\RouteBuildEvent')\n ->disableOriginalConstructor()\n ->getMock();\n $route_collection = new RouteCollection();\n $route_collection->add('test', new Route('/foo/admin/foo', ['_controller' => 'Drupal\\ExampleController']));\n $route_collection->add('test2', new Route('/bar/admin/bar', ['_controller' => 'Drupal\\ExampleController']));\n $route_collection->add('test3', new Route('/administrator/a', ['_controller' => 'Drupal\\ExampleController']));\n $route_collection->add('test4', new Route('/admin', ['_controller' => 'Drupal\\ExampleController']));\n $event->expects($this->once())\n ->method('getRouteCollection')\n ->will($this->returnValue($route_collection));\n\n $this->state->expects($this->once())\n ->method('set')\n ->with('routing.non_admin_routes', ['test', 'test2', 'test3']);\n $this->preloader->onAlterRoutes($event);\n $this->preloader->onFinishedRoutes(new Event());\n }",
"public function testInstallUninstall() {\n $modules = ['multiversion', 'relaxed'];\n $this->moduleInstaller->install($modules);\n $this->assertModules($modules, TRUE);\n $this->assertModuleConfig('relaxed');\n $relaxed_config = \\Drupal::config('relaxed.settings')->get('resources');\n $rest_config = \\Drupal::config('rest.settings')->get('resources');\n foreach ($relaxed_config as $key => $item) {\n $this->assertTrue(isset($rest_config[$key]), \"Relaxed module configuration ($key) found in Rest module configuration.\");\n }\n // Only uninstall Relaxed.\n $this->moduleInstaller->uninstall(['relaxed']);\n $rest_config = \\Drupal::config('rest.settings')->get('resources');\n $this->assertModules(['relaxed'], FALSE);\n $this->assertNoModuleConfig('relaxed');\n foreach ($relaxed_config as $key => $item) {\n $this->assertTrue(!isset($rest_config[$key]), \"Relaxed module configuration ($key) not found in Rest module configuration.\");\n }\n }",
"public function testTestModuleRoutesLoaded()\n {\n $client = $this->createClient();\n $client->request('POST', '/test_module_loaded');\n $this->assertTrue($client->getResponse()->isOk());\n\n $client = $this->createClient();\n $client->request('GET', '/test_module_loaded');\n $this->assertTrue($client->getResponse()->isOk());\n }",
"protected function setUpRoutes()\n {\n }",
"public function testModuleRoute()\n {\n $modules = 'user|my-admin';\n\n $manager = $this->getUrlManager([\n 'rules' => [\n \"<module:$modules>\" => '<module>',\n \"<module:$modules>/<controller>\" => '<module>/<controller>',\n \"<module:$modules>/<controller>/<action>\" => '<module>/<controller>/<action>',\n '<url:[a-zA-Z0-9-/]+>' => 'site/index',\n ],\n ]);\n\n $result = $manager->parseRequest($this->getRequest('user'));\n $this->assertEquals(['user', []], $result);\n $result = $manager->parseRequest($this->getRequest('user/somecontroller'));\n $this->assertEquals(['user/somecontroller', []], $result);\n $result = $manager->parseRequest($this->getRequest('user/somecontroller/someaction'));\n $this->assertEquals(['user/somecontroller/someaction', []], $result);\n\n $result = $manager->parseRequest($this->getRequest('users/somecontroller/someaction'));\n $this->assertEquals(['site/index', ['url' => 'users/somecontroller/someaction']], $result);\n\n }",
"function testInitializeAndRoutingPrefixes() {\n\t\t$restore = Configure::read('Routing');\n\t\tConfigure::write('Routing.prefixes', array('admin', 'super_user'));\n\t\tRouter::reload();\n\t\t$this->Controller->Auth->initialize($this->Controller);\n\n\t\t$this->assertTrue(isset($this->Controller->Auth->actionMap['delete']));\n\t\t$this->assertTrue(isset($this->Controller->Auth->actionMap['view']));\n\t\t$this->assertTrue(isset($this->Controller->Auth->actionMap['add']));\n\t\t$this->assertTrue(isset($this->Controller->Auth->actionMap['admin_view']));\n\t\t$this->assertTrue(isset($this->Controller->Auth->actionMap['super_user_delete']));\n\n\t\tConfigure::write('Routing', $restore);\n\t}",
"public function test_route_override() {\n\t\tregister_rest_route(\n\t\t\t'test-ns',\n\t\t\t'/test',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET' ),\n\t\t\t\t'callback' => '__return_null',\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t\t'should_exist' => false,\n\t\t\t)\n\t\t);\n\t\tregister_rest_route(\n\t\t\t'test-ns',\n\t\t\t'/test',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'POST' ),\n\t\t\t\t'callback' => '__return_null',\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t\t'should_exist' => true,\n\t\t\t),\n\t\t\ttrue\n\t\t);\n\n\t\t// Check we only have one route.\n\t\t$endpoints = $GLOBALS['wp_rest_server']->get_routes();\n\t\t$endpoint = $endpoints['/test-ns/test'];\n\t\t$this->assertCount( 1, $endpoint );\n\n\t\t// Check it's the right one.\n\t\t$this->assertArrayHasKey( 'should_exist', $endpoint[0] );\n\t\t$this->assertTrue( $endpoint[0]['should_exist'] );\n\t}",
"public function testRoutes()\n {\n $this->assertContains('flatView', $this->routedMethods);\n }",
"private function updateRoutes()\n {\n $stub = $this->stub.'/routes';\n $path = base_path('routes');\n (new Filesystem)->copyDirectory($stub, $path);\n }",
"protected function installRoutes(): void\n {\n $this->copy('routes/web.stub', base_path('routes/web.php'));\n }",
"function test_get_routes() {\n\t\t// NB: I'd mostly iterate over all endpoints, checking for is_callable(),\n\t\t// and dispatch() does this check, but that's only at runtime, but\n\t\t// you could use that as a template for this test.\n\t\t$this->markTestIncomplete('Missing test implementation.');\n\t}",
"function node_post_update_rebuild_node_revision_routes() {\n // Empty update to rebuild routes.\n}",
"public function test_custom_routes_registered() {\n $routes = $this->server->get_routes();\n $custom_routes = array(\n DISQUS_REST_NAMESPACE,\n DISQUS_REST_NAMESPACE . '/sync/webhook',\n DISQUS_REST_NAMESPACE . '/sync/status',\n DISQUS_REST_NAMESPACE . '/sync/enable',\n DISQUS_REST_NAMESPACE . '/sync/disable',\n DISQUS_REST_NAMESPACE . '/settings'\n );\n\n foreach ( $custom_routes as $custom_route ) {\n $this->assertArrayHasKey( $custom_route, $routes, 'Custom route \"' . $custom_route . '\" not registered' );\n }\n }",
"public function testReplaceNamespacedRouteStatus()\n {\n\n }",
"public function replaceBreezeRoutes()\n {\n (new Filesystem())->ensureDirectoryExists(resource_path('routes'));\n (new Filesystem())->copy(__DIR__ . '/../../routes/web.php', base_path('routes/web.php'));\n (new Filesystem())->delete(base_path('routes/auth.php'));\n }",
"public function test_admin_restart_match()\n {\n $this->assertTrue($this->postScriptumServer->adminRestartMatch());\n }",
"public function test_admin_restart_match()\n {\n $this->assertTrue($this->btwServer->adminRestartMatch());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns current controller name | public function getControllerName()
{
return AppHelper::getControllerName();
} | [
"public static function controllerName()\n {\n return self::$currentMvc->controllerName();\n }",
"public static function getControllerName()\r\n\t{\r\n\t return self::$controller_name;\r\n\t}",
"protected function getControllerName()\n {\n return strtolower($this->controllerContext->getRequest()->getControllerName());\n }",
"public function getCurrentController()\n {\n return $this->_klevuhttp->getControllerName();\n }",
"public function getControllerName();",
"public function getControllerName() {\n\t\treturn empty($this->_controller) ? 'index' : $this->_controller;\n\t}",
"public function getControllerName()\n\t{\n\t\treturn str_replace('Controller' , '' , $this->controller);\n\t}",
"public function getControllerName() {}",
"public function getControllername()\r\n {\r\n return $this->controllername;\r\n }",
"public function getControllerName(){}",
"protected function getControllerName()\r\n {\r\n $route = $this->getRoute();\r\n return $this->formatControllerName($route['controller']);\r\n }",
"protected function getControllerName()\n {\n return preg_replace(\"/(.*)[\\\\\\\\](.*)(Controller)/\", '$2', get_class($this));\n }",
"public function getControllerName()\n {\n $controller = $this->formatControllerName(\n $this->params()->fromRoute('controller')\n );\n\n return $controller;\n }",
"public function getControllerName() {\n\t\tif (empty($this->controllerName)) {\n\t\t\t$parts = t3lib_div::trimExplode('_', get_class($this));\n\t\t\t$this->controllerName = implode('_', array_slice($parts, 3)); // throw away \"tx\", \"<condensedExtKey>\", \"controller\"\n\t\t}\n\t\treturn $this->controllerName;\n\t}",
"public function getControllerName()\n {\n if (isset($_GET[self::CONTROLLER_PARAM])\n && $this->isValidController($_GET[self::CONTROLLER_PARAM])\n ) {\n return $_GET[self::CONTROLLER_PARAM];\n }\n return self::DEFAULT_CONTROLLER;\n }",
"public function getBaseControllerName();",
"protected function getControllerName()\n {\n return strtolower(\n preg_replace('/([a-z\\d])([A-Z])/', '\\1_\\2', \n preg_replace('/([A-Z]+)([A-Z][a-z])/', '\\1_\\2', str_replace('Controller', '', get_class($this)))\n )\n );\n }",
"protected function getControllerPublicName(): string\n {\n return Dispatcher::getInstance()->getController();\n }",
"public function GetControllerName ();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Output only. The lifecycle state of the folder. Updates to the lifecycle_state must be performed via [DeleteFolder] and [UndeleteFolder]. Generated from protobuf field .google.cloud.resourcemanager.v2.Folder.LifecycleState lifecycle_state = 4; | public function setLifecycleState($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\ResourceManager\V2\Folder_LifecycleState::class);
$this->lifecycle_state = $var;
return $this;
} | [
"public function setLifecycle($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Storage\\V2\\Bucket\\Lifecycle::class);\n $this->lifecycle = $var;\n\n return $this;\n }",
"public function setLifecycleState($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Cloud\\Dialogflow\\V2\\Conversation\\LifecycleState::class);\n $this->lifecycle_state = $var;\n\n return $this;\n }",
"public function getLifecycleState()\n {\n return $this->lifecycle_state;\n }",
"public function createLifecycleXml($lifecycle)\n\t{\n\t\t$content = \"<LifecycleConfiguration>\\n\";\n\n\t\tforeach ($lifecycle as $rule)\n\t\t{\n\t\t\t$content .= \"<Rule>\\n\";\n\n\t\t\tforeach ($rule as $ruleKey => $ruleValue)\n\t\t\t{\n\t\t\t\tif (strcmp($ruleKey, \"Action\") === 0)\n\t\t\t\t{\n\t\t\t\t\t$content .= \"<Action><\" . $ruleValue . \"/></Action>\\n\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$content .= \"<\" . $ruleKey . \">\\n\";\n\n\t\t\t\t\tforeach ($ruleValue as $condition => $conditionValue)\n\t\t\t\t\t{\n\t\t\t\t\t\t$content .= \"<\" . $condition . \">\" . $conditionValue . \"</\" . $condition . \">\\n\";\n\t\t\t\t\t}\n\n\t\t\t\t\t$content .= \"</\" . $ruleKey . \">\\n\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$content .= \"</Rule>\\n\";\n\t\t}\n\n\t\t$content .= \"</LifecycleConfiguration>\";\n\n\t\treturn $content;\n\t}",
"public function actionGetFilemanagerFolderState()\n {\n return Yii::$app->adminuser->identity->setting->get('filemanagerFolderId', 0);\n }",
"public function getFolder(){\n if(!$this->isPropertyAvailable('Folder')){\n $this->setProperty(\"Folder\", new Folder($this->getContext(),new ResourcePathEntity($this->getContext(),$this->getResourcePath(), \"Folder\")),false);\n }\n return $this->getProperty(\"Folder\");\n }",
"public function setLifecycleStage($var)\n {\n GPBUtil::checkString($var, True);\n $this->lifecycle_stage = $var;\n\n return $this;\n }",
"public function getLifecycle()\n {\n return isset($this->lifecycle) ? $this->lifecycle : null;\n }",
"public function setIsFolder($val)\n {\n $this->_propDict[\"isFolder\"] = boolval($val);\n return $this;\n }",
"public function setIsFolder($isFolder): void\n {\n $this->attributes['isFolder'] = VT::toBool($isFolder);\n }",
"public function setIsFolder($isFolder)\n {\n $this->isFolder = VT::toBool($isFolder);\n }",
"function statFolder()\n {\n }",
"public function getFolder()\n {\n return $this->getProperty(\"Folder\",\n new Folder($this->getContext(),new ResourcePath(\"Folder\", $this->getResourcePath())));\n }",
"function ajax_setFolderStatus($_folder)\n\t{\n\t\ttranslation::add_app('mail');\n\t\t//error_log(__METHOD__.__LINE__.array2string($_folder));\n\t\tif ($_folder)\n\t\t{\n\t\t\t$this->mail_bo->getHierarchyDelimiter(false);\n\t\t\t$oA = array();\n\t\t\tforeach ($_folder as $_folderName)\n\t\t\t{\n\t\t\t\tlist($profileID,$folderName) = explode(self::$delimiter,$_folderName,2);\n\t\t\t\tif (is_numeric($profileID))\n\t\t\t\t{\n\t\t\t\t\tif ($profileID != $this->mail_bo->profileID) continue; // only current connection\n\t\t\t\t\tif ($folderName)\n\t\t\t\t\t{\n\t\t\t\t\t\t$fS = $this->mail_bo->getFolderStatus($folderName,false,false,false);\n\t\t\t\t\t\tif (in_array($fS['shortDisplayName'],mail_bo::$autoFolders)) $fS['shortDisplayName']=lang($fS['shortDisplayName']);\n\t\t\t\t\t\t//error_log(__METHOD__.__LINE__.array2string($fS));\n\t\t\t\t\t\tif ($fS['unseen'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$oA[$_folderName] = $fS['shortDisplayName'].' ('.$fS['unseen'].')';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($fS['unseen']==0 && $fS['shortDisplayName'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$oA[$_folderName] = $fS['shortDisplayName'];\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//error_log(__METHOD__.__LINE__.array2string($oA));\n\t\t\tif ($oA)\n\t\t\t{\n\t\t\t\t$response = egw_json_response::get();\n\t\t\t\t$response->call('app.mail.mail_setFolderStatus',$oA);\n\t\t\t}\n\t\t}\n\t}",
"public function getFolderID()\n {\n return $this->folderID;\n }",
"public function isFolder()\r\n\t{\r\n\t\treturn true;\r\n\t}",
"public function folderName() { return $this->folderName; }",
"public function getFolderId()\n {\n return $this->folder_id;\n }",
"function saveFolderState($folder_id, $open)\r\n\t{\r\n\t\tPSU::db('go')->Execute(\"UPDATE folder SET open=$open WHERE id=$folder_id AND wp_id=?\", array($_SESSION['wp_id']));\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO: Implement orHavin() method. | public function orHavin()
{
} | [
"public function orFilterHavin()\n {\n }",
"public function or()\n\t{\n\t}",
"public function orWhere();",
"public function _or() {\n \treturn $this->_binOp('or');\n }",
"public abstract function or(Result $r): Result;",
"public function db_or()\n {\n return db_or();\n }",
"abstract protected function perform_or($first, $second);",
"public function beginOr() {\n\t\t$this->and_or_stack[] = [\n\t\t 'type' => 'OR', \n\t\t 'cards' => []\n\t\t];\n\t}",
"abstract public function unwrapOr($optb);",
"public function AddOr($or){\r\n\t\t$this->argent += abs(intval($or));\r\n\t}",
"public function has_or_relation()\n {\n }",
"public function andar()\n {\n }",
"function variant_or($left, $right) {}",
"public function or_replace()\n\t{\n\t}",
"public function _or()\n {\n return $this->addOperator(OperadorLogico::o);\n }",
"abstract public function getOr($value);",
"public function getType() { return 'or'; }",
"public function orWhere($cond);",
"protected function _or()\n\t{\n\t\t$targetRegister = $this->_getTargetRegister();\n\t\t$value1 = $this->_getNextInstruction();\n\t\t$value2 = $this->_getNextInstruction();\n\n\t\t$result = $value1 | $value2;\n\t\t$this->_setRegister($targetRegister, $result);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
admin_delete() allows an admin to delete a Location url: /admin/Locations/delete/1 | function admin_delete($id = null) {
// if the id is null
if (!$id) {
// set flash message
$this->Session->setFlash('Invalid id for Location', 'flash_bad');
// redirect
$this->redirect(array('action'=>'index'));
}
// set the id of the location
$this->Location->id = $id;
// try to change status from 1 to 0
if ($this->Location->saveField('status', 0)) {
// set flash message
$this->Session->setFlash('The Location was successfully deleted.', 'flash_good');
} else {
// set flash message
$this->Session->setFlash('The Location could not be deleted. Please try again.', 'flash_bad');
}
// redirect
$this->redirect(array('action'=>'index'));
} | [
"function delete_location() {\n\t $this->slplus->currentLocation->set_PropertiesViaDB( $this->slplus->ajax->query_params['location_id'] );\n\n\t $status = $this->slplus->currentLocation->delete();\n\t if ( is_int( $status ) ) {\n\t\t $count = $status;\n\t\t $status = 'ok';\n\t } else {\n\t $count = '0';\n\t\t $status = 'error';\n\t }\n\n\n\t $response = array(\n\t 'status' => $status,\n\t\t 'count' => $count,\n\t 'action' => 'delete_location',\n\t 'location_id' => $this->slplus->ajax->query_params['location_id'],\n\t );\n\n\t wp_die( json_encode( $response ) );\n }",
"public function delete_menu_location() {\n\n check_admin_referer( 'megamenu_delete_menu_location' );\n\n $locations = get_option( 'megamenu_locations' );\n\n $location_to_delete = esc_attr( $_GET['location'] );\n\n if ( isset( $locations[ $location_to_delete ] ) ) {\n unset( $locations[ $location_to_delete ] );\n update_option( 'megamenu_locations', $locations );\n }\n\n do_action(\"megamenu_after_delete_menu_location\");\n\n do_action(\"megamenu_delete_cache\");\n\n $this->redirect( admin_url( 'admin.php?page=maxmegamenu_menu_locations&delete_location=true' ) );\n\n }",
"public function deleteAction()\n { \n $get = Zend_Registry::get('getFilter');\n \n if (!isset($get->locationId)) {\n throw new Ot_Exception_Input('msg-error-locationIdNotSet');\n }\n \n $location = new Location();\n \n $thisLocation = $location->find($get->locationId);\n \n if (is_null($thisLocation)) {\n throw new Ot_Exception_Data('msg-error-noLocation'); \n }\n \n $this->view->location = $thisLocation;\n \n $form = Ot_Form_Template::delete('deleteForm'); \n \n if ($this->_request->isPost() && $form->isValid($_POST)) {\n $where = $location->getAdapter()->quoteInto('locationId = ?', $get->locationId);\n $location->delete($where);\n \n $this->_helper->flashMessenger->addMessage('msg-info-locationDeleted');\n \n $this->_helper->redirector->gotoUrl('/workshop/location/index');\n }\n \n $this->_helper->pageTitle('workshop-location-delete:title');\n $this->view->form = $form;\n }",
"function delete()\n {\n $this->Location()->forceDelete();\n parent::delete();\n }",
"function fn_warehouses_store_locator_delete_store_location_post($store_location_id, $affected_rows, $deleted)\n{\n /** @var \\Tygh\\Addons\\Warehouses\\Manager $manager */\n $manager = Tygh::$app['addons.warehouses.manager'];\n $manager->removeWarehouse($store_location_id);\n}",
"public function admin_delete(){\n \n // Load the satellite in question\n $satellite = $this->Satellite->find('first', array('conditions' => array('Satellite.id' => $this->params->id)));\n if($satellite){\n // Delete the satellite\n $delete_attempt = $this->Satellite->delete($this->params->id);\n if ($delete_attempt){\n $this->Session->setFlash('Satellite \\''.$satellite['Satellite']['name'].'\\' successfully deleted.', 'default', array('class' => 'alert alert-success'));\n CakeLog::write('admin', '[success] Satellite \\''.$satellite['Satellite']['name'].'\\' deleted.');\n $this->redirect(array('controller' => 'satellite', 'action' => 'index', 'admin' => true));\n } else {\n $this->Session->setFlash('There was an error deleting the \\''.$satellite['Satellite']['name'].'\\' satellite.', 'default', array('class' => 'alert alert-error'));\n CakeLog::write('admin', '[success] Satellite \\''.$satellite['Satellite']['name'].'\\' could not be deleted.');\n $this->redirect(array('controller' => 'satellite', 'action' => 'index', 'admin' => true));\n }\n } else {\n $this->Session->setFlash('That satellite could not be found.', 'default', array('class' => 'alert alert-error'));\n $this->redirect(array('controller' => 'satellite', 'action' => 'index', 'admin' => true));\n }\n }",
"public function deleted(Location $location)\n {\n //\n }",
"public function actionDelete_store_location()\n\t{\n\t\t// current product\n\t\t$ids = $_POST['ids'];\n\t\t\n\t\tif (is_array($ids) && sizeof($ids)) {\n\t\t\t$image_base_path = Yii::app()->params['root_url'].'images/stores/';\t\t\t\n\t\t\t\n\t\t\tforeach ($ids as $id) {\n\t\t\t\tif (!$s = Tbl_StoreLocations::model()->findByPk($id)) throw new CException(Yii::t('global','ERROR_INVALID_ID'));\t\n\t\t\t\t\n\t\t\t\tif ($s->image && is_file($image_base_path.$s->image)) unlink($image_base_path.$s->image);\n\t\t\t\t\n\t\t\t\t$criteria=new CDbCriteria; \n\t\t\t\t$criteria->condition='id=:id'; \n\t\t\t\t$criteria->params=array(':id'=>$id);\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t// delete all\n\t\t\t\tTbl_StoreLocations::model()->deleteAll($criteria);\t\t\t\n\t\t\t}\n\t\t}\t\t\n\t}",
"function delete()\n\t\t{\n\t\t\tglobal $allLocations;\n\n\t\t\t$index = getKeyById($allLocations, $this->get_id());\n\n\t\t\tif ($index !== null)\n\t\t\t{\n\t\t\t\tunset($allLocations[$index]);\n\t\t\t\twriteLocationsToXML();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn \"DLT: Location doesn't exist!\";\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\t\t\t\n\t\t}",
"function deleteAdmin() {\n\t\ttry{\n\t\t\tglobal $database;\n\n\t\t\t$adminId = $_POST['adminId'];\n\n\t\t\t$admin = new admin($database, $adminId);\n\t\t\t$admin->delete();\n\t\t} catch(dbException $db){\n\t\t\t\techo $db->alert();\t\t\n\t\t}\n\t}",
"public static function location_delete($EM_Location){\n\t\tglobal $wpdb, $sitepress;\n\t\tif( EM_ML::is_original($EM_Location) ){\n\t\t\t//check to see if there's any translations of this event\n\t\t $location = EM_ML::get_translation($EM_Location);\n\t\t\t//if so check if the default language still exists\n\t\t\tif( $EM_Location->location_id != $location->location_id && !empty($location->location_id) ){\n\t\t\t\t//make that translation the master event by changing event ids of bookings, tickets etc. to the new master event\n\t\t\t\t$wpdb->update(EM_EVENTS_TABLE, array('location_id'=>$location->location_id), array('location_id'=>$EM_Location->location_id));\n\t\t\t\t//also change wp_postmeta\n\t\t\t\t$EM_Location->ms_global_switch();\n\t\t\t\t$wpdb->update($wpdb->postmeta, array('meta_value'=>$location->location_id), array('meta_key'=>'_location_id', 'meta_value'=>$EM_Location->location_id));\n\t\t\t\t$EM_Location->ms_global_switch_back();\n\t\t\t\tdo_action('em_ml_transfer_original_location', $location, $EM_Location); //other add-ons with tables with location_id foreign keys should hook here and change\n\t\t\t}\n\t\t}\n\t}",
"public function actionDelete() {\n $id = Yii::app()->request->getPost('id');\n $this->loadModel($id)->delete();\n\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n //if (!isset($_GET['ajax']))$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n }",
"public function adminProductDeleteAction()\n {\n $this->checkAdmin();\n //products model\n $vars['admin'] = \"\";\n $this->model->deleteProduct(intval($this->route['id']));\n $this->view->redirect(\"/SafeRideStore/admin/products\");\n }",
"function delete_location ($id) {\r\r\n\t$db = $GLOBALS[\"db\"];\r\r\n\t/* all ok -> sqlquery */\r\r\n\t\r\r\n\techo \"<h1>$id</h1>\";\r\r\n\t$location_name = get_location_name ($id);\r\r\n\t$result1 = mysqli_query ($db, \"DELETE FROM location_products WHERE `location_id` = '$id'\");\r\r\n\tif ($result1) {\r\r\n\t\t$error = \"Информация о продуктах филиала \\\"<strong>$location_name</strong>\\\" была успешно удалена!<br><br>\";\r\r\n\t\t$result2 = mysqli_query ($db, \"DELETE FROM locations WHERE `id` = '$id'\");\r\r\n\t\t\r\r\n\t\tif ($result2) {\r\r\n\t\t\t$error = show_error($error.\"Филиал \\\"<strong>$location_name</strong>\\\" был успешно удален!\", \"success\", 0);\r\r\n\t\t\t\r\r\n\t\t\techo \"<meta http-equiv='refresh' content='0;URL=locations.php'>\";\r\r\n\t\t}\r\r\n\t\telse {\r\r\n\t\t\t$mysqli_error = mysqli_error($db);\r\r\n\t\t\t$error = show_error($error.\"Филиал \\\"<strong>$location_name</strong>\\\" был успешно удален!\", \"success\", 0);\r\r\n\t\r\r\n\t\t\techo \"<meta http-equiv='refresh' content='0;URL=locations.php'>\";\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\treturn $error;\r\r\n\t}\r\r\n}",
"public function deleted(Admin $admin)\n {\n //\n }",
"public function deleteAction()\n {\n if ( $this->getRequest()->getParam('id') > 0) {\n try {\n $administrativedocument = Mage::getModel('bs_administrativedoc/administrativedocument');\n $administrativedocument->setId($this->getRequest()->getParam('id'))->delete();\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('bs_administrativedoc')->__('Administrative Document was successfully deleted.')\n );\n $this->_redirect('*/*/');\n return;\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_administrativedoc')->__('There was an error deleting administrative document.')\n );\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n Mage::logException($e);\n return;\n }\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_administrativedoc')->__('Could not find administrative document to delete.')\n );\n $this->_redirect('*/*/');\n }",
"public function deleteAction() {\r\n $this->_helper->layout->setLayout('admin-simple');\r\n $this->view->id = $id = $this->_getParam('id');\r\n\r\n if ($this->getRequest()->isPost()) {\r\n if (!empty($id))\r\n Engine_Api::_()->getItem('siteiosapp_menus', $id)->delete();\r\n\r\n $this->_forward('success', 'utility', 'core', array(\r\n 'smoothboxClose' => 10,\r\n 'parentRefresh' => 10,\r\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('Deleted Successfully!'))\r\n ));\r\n }\r\n }",
"public function location_delete($loc_id){\n $this->db->set('status','0');\n $this->db->where('id',$loc_id);\n $this->db->update('org_location');\n return true;\n }",
"function deleteLocation($id) {\r\n\r\n\t\t//Find all users from the database and store in the variable users\r\n\t\t$users = $this->findAllUsers();\r\n\r\n\t\tforeach($users as $user) :\r\n\t\t\t//If a user is location at the location we must set the location_id to 0\r\n\t\t\tif($user['users']['location_id'] == $id) {\r\n\t\t\t\t$this->query('UPDATE users SET location_id=' . 0 .' WHERE id='. $user['users']['id'] .';');\r\n\t\t\t} //end if\r\n\t\tendforeach;\r\n\r\n\t\treturn ($this->query('DELETE FROM locations WHERE locations.id = '. $id .';'));\r\n\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fields for creating new questions are added to the quiz_questions_form | function _quiz_add_fields_for_creating_questions(&$form, &$types, &$quiz) {
// Display links to create other questions.
$form['additional_questions'] = array(
'#type' => 'fieldset',
'#title' => t('Create new question'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$url_query = drupal_get_destination();
$url_query['quiz_nid'] = $quiz->nid;
$url_query['quiz_vid'] = $quiz->vid;
$create_question = FALSE;
foreach ($types as $type => $info) {
$url_type = str_replace('_', '-', $type);
$options = array(
'attributes' => array('title' => t('Create @name', array('@name' => $info['name']))),
'query' => $url_query,
);
$access = node_access('create', $type);
if ($access) {
$create_question = TRUE;
}
$form['additional_questions'][$type] = array(
'#markup' => '<div class="add-questions">' . l($info['name'], "node/add/$url_type", $options) . '</div>',
'#access' => $access,
);
}
if (!$create_question) {
$form['additional_questions']['create'] = array(
'#type' => 'markup',
'#markup' => t('You have not enabled any question type module or no has permission been given to create any question.'),
// @todo revisit UI text
);
}
} | [
"public function addQuestionAndAnswers () {\n global $tpl, $ilTabs;\n $ilTabs->activateTab(\"editQuiz\");\n $this->initAddQuestionAndAnswersForm();\n }",
"public function initAddQuestionAndAnswersForm () {\n global $tpl, $ilCtrl;\n\n $my_tpl = new ilTemplate(\"tpl.question_and_answers.html\", true, true,\n \"Customizing/global/plugins/Services/Repository/RepositoryObject/MobileQuiz\");\n $rtokenFactory = new ilCtrl();\n $my_tpl->setVariable(\"ACTION_URL\",$this->ctrl->getFormAction($this));\n $my_tpl->setVariable(\"SUBMIT_BUTTON\", $this->txt(\"save\"));\n $my_tpl->setVariable(\"NEW_QUESTION\", $this->txt(\"question_add_head\"));\n $my_tpl->setVariable(\"QUESTION\", $this->txt(\"question_add_text\"));\n $my_tpl->setVariable(\"QUESTION_TYPE\", $this->txt(\"question_add_type\"));\n $my_tpl->setVariable(\"CHOICES\", $this->txt(\"choice_add_texts\"));\n $my_tpl->setVariable(\"VAR_1\", \"value1\");\n $my_tpl->setVariable(\"COMMAND\", \"cmd[createQuestionAndAnswers]\");\n $my_tpl->setVariable(\"MINIMUM\", $this->txt(\"choice_add_numeric_minimum\"));\n $my_tpl->setVariable(\"MAXIMUM\", $this->txt(\"choice_add_numeric_maximum\"));\n $my_tpl->setVariable(\"STEP\", $this->txt(\"choice_add_numeric_steprange\"));\n $my_tpl->setVariable(\"CORRECT_VALUE\", $this->txt(\"choice_add_numeric_correctvalue\"));\n $my_tpl->setVariable(\"TOLERANCE_RANGE\", $this->txt(\"choice_add_numeric_tolerenace_range\"));\n $my_tpl->setVariable(\"SELECTED_SINGLE\", 'selected=\"selected\"');\n\n $my_tpl->setVariable(\"HIDE_NUMERIC_BLOCK\", 'style=\"display:none;\"');\n $my_tpl->setVariable(\"HIDE_SINGLE_CHOICE_BLOCK\", 'style=\"display:none;\"');\n\n $html = $my_tpl->get();\n $tpl->setContent($html);\n }",
"public function createQuestionAndAnswers () {\n global $tpl, $lng, $ilCtrl, $ilTabs;\n\n // create wizard object\n include_once('class.ilObjMobileQuizWizard.php');\n $wiz = new ilObjMobileQuizWizard();\n\n\n $ilTabs->activateTab(\"editQuiz\");\n\n\n if ($wiz->checkInput()){\n $wiz->createQuestionAndAnswers($this->object);\n ilUtil::sendSuccess($this->txt(\"question_obj_create\"), true);\n $ilCtrl->redirect($this, \"editQuiz\");\n }\n $this->initAddQuestionAndAnswersFormAfterError();\n //$tpl->setContent(\"Test\");\n }",
"protected function addQuestionToolbarForm()\n\t{\n\t\tglobal $lng, $ilCtrl, $tpl;\n\n\t\tinclude_once \"Services/Form/classes/class.ilPropertyFormGUI.php\";\n\t\t$form = new ilPropertyFormGUI();\n\t\t$form->setFormAction($ilCtrl->getFormAction($this, \"addQuestionToolbar\"));\n\t\t$form->setTitle($lng->txt(\"survey_add_new_question\"));\n\n\t\t// question types\n\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php\";\n\t\t$questiontypes = ilObjSurveyQuestionPool::_getQuestiontypes();\n\t\t$type_map = array();\n\t\tforeach($questiontypes as $trans => $item)\n\t\t{\n\t\t\t$type_map[$item[\"questiontype_id\"]] = $trans;\n\t\t}\n\t\tinclude_once(\"./Services/Form/classes/class.ilSelectInputGUI.php\");\n\t\t$si = new ilSelectInputGUI($lng->txt(\"question_type\"), \"qtype\");\n\t\t$si->setOptions($type_map);\n\t\t$form->addItem($si);\n\n\t\t$pages = $this->object->getSurveyPages();\n\t\tif($pages)\n\t\t{\n\t\t\t$pages_drop = array(\"fst\"=>$lng->txt(\"survey_at_beginning\"));\n\t\t\tforeach($pages as $idx => $questions)\n\t\t\t{\n\t\t\t\t$question = array_shift($questions);\n\t\t\t\tif($question[\"questionblock_id\"])\n\t\t\t\t{\n\t\t\t\t\t$pages_drop[$idx+1] = $lng->txt(\"survey_behind_page\").\" \".$question[\"questionblock_title\"];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$pages_drop[$idx+1] = $lng->txt(\"survey_behind_page\").\" \".strip_tags($question[\"title\"]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$pos = new ilSelectInputGUI($lng->txt(\"position\"), \"pgov\");\n\t\t\t$pos->setOptions($pages_drop);\n\t\t\t$form->addItem($pos);\n\n\t\t\t$pos->setValue($this->current_page);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// #9089: 1st page \n\t\t\t$pos = new ilHiddenInputGUI(\"pgov\");\n\t\t\t$pos->setValue(\"fst\");\n\t\t\t$form->addItem($pos);\n\t\t}\n\n\t\tif($this->object->isPoolActive())\n\t\t{\n\t\t\t$this->editor_gui->createQuestionObject($form);\n\t\t}\n\n\t\t$form->addCommandButton(\"addQuestionToolbar\", $lng->txt(\"create\"));\n\t\t$form->addCommandButton(\"renderPage\", $lng->txt(\"cancel\"));\n\n\t\treturn $tpl->setContent($form->getHTML());\n\t}",
"public function ajaxAddQuestion(){\n\t\t$Quizs__questionManager = new \\Manager\\Quizs__questionManager();\n\t\t$Quizs__questionManager->setTable('quizs__questions');\n\t\t$Quizs__questionManager->insert([\t\t\t\n\t\t\t\"quiz_id\" => (int) $_POST[\"quizId\"],\n\t\t\t\"question_id\" => (int) $_POST[\"questionId\"],\n\t\t\t\"is_active\" => 1,\n\t\t]);\n\t}",
"protected function _prepareForm()\n {\n $helper = Mage::helper('oggetto_faq');\n $model = $this->getCurrentQuestionsModel();\n\n $form = new Varien_Data_Form([\n 'id' => 'edit_form',\n 'action' => $this->getUrl('*/*/save', [\n 'id' => $this->getRequest()->getParam('id')\n ]),\n 'method' => 'post',\n 'enctype' => 'multipart/form-data'\n ]);\n\n $this->setForm($form);\n\n\n $fieldset = $form->addFieldset('edit_form', ['legend' => $helper->__('Questions Information')]);\n\n $fieldset->addField('name', 'label', [\n 'label' => $helper->__('User name'),\n 'name' => 'name',\n ]);\n $fieldset->addField('email', 'label', [\n 'label' => $helper->__('User email'),\n 'name' => 'email',\n ]);\n $fieldset->addField('question_text', 'editor', [\n 'label' => $helper->__('Question text'),\n 'name' => 'question_text',\n ]);\n $fieldset->addField('answer_text', 'editor', [\n 'label' => $helper->__('Answer text'),\n 'name' => 'answer_text',\n ]);\n $fieldset->addField('created_at', 'label', [\n 'label' => $helper->__('Created'),\n 'name' => 'created_at',\n ]);\n $fieldset->addField('with_feedback', 'label', [\n 'label' => $helper->__('With feedback'),\n 'name' => 'with_feedback',\n ]);\n $fieldset->addField('was_notified', 'label', [\n 'label' => $helper->__('Was notified to user'),\n 'name' => 'was_notified',\n ]);\n\n $form->setUseContainer(true);\n\n $form->setValues($model->getData());\n\n return parent::_prepareForm();\n }",
"public function addNew(Question $question);",
"public function newQuestionAction()\r\n {\r\n\t $_SESSION['lastpage'] = 'question/new-question'; \r\n $this->initialize();\r\n \r\n if(\\Jovis\\User\\UserSession::IsAuthenticated()) { \r\n \r\n\t\t $form = new \\Jovis\\HTMLForm\\CFormAddQuestion();\r\n\t\t $form->setDI($this->di);\r\n\t\t\t\r\n\t\t //Om check har ett värde har formuläret postats och sidan körs vidare via form-objektet, \r\n\t\t //om check är tom fortsätter den här \r\n\t\t //funktionen köras och formuläret visas. \r\n\t\t \r\n\t\t $form->check();\r\n\t\t \r\n\t\t $this->di->theme->setTitle(\"Lägg till fråga\");\r\n\t\t $this->di->views->add('question/add', [\r\n\t\t\t 'title' => \"Lägg till fråga:\",\r\n\t\t\t 'content' => $form->getHTML(),\r\n\t\t\t]);\r\n\r\n\t\t\t\r\n\t }\r\n\t else\r\n\t {\r\n\t\t $this->di->theme->setTitle(\"Lägg till fråga\");\r\n\t\t $this->di->views->add('question/add', [\r\n\t\t\t 'title' => \"Lägg till fråga:\",\r\n\t\t\t 'content' => \"Logga in för att kunna ställa en fråga\",\r\n\t\t\t]);\r\n\t }\r\n }",
"public function fieldCreateAction() {\n parent::fieldCreateAction();\n\n //GENERATE FORM\n $form = $this->view->form;\n\n if ($form) {\n\n //$form->setTitle('Add Profile Question');\n $form->removeElement('show');\n $form->addElement('hidden', 'show', array('value' => 0));\n\n $display = $form->getElement('display');\n $display->setLabel('Show on profile page?');\n\n $display->setOptions(array('multiOptions' => array(\n 1 => 'Show on profile page',\n 0 => 'Hide on profile page'\n )));\n\n $search = $form->getElement('search');\n $search->setLabel('Show on the search options?');\n\n $search->setOptions(array('multiOptions' => array(\n 0 => 'Hide on the search options',\n 1 => 'Show on the search options'\n )));\n }\n }",
"function quiz_questions_form($form, $form_state, $quiz) {\n\n $types = quiz_get_question_types();\n\n _quiz_add_fields_for_creating_questions($form, $types, $quiz);\n\n // Display questions in this quiz.\n $form['question_list'] = array(\n '#type' => 'fieldset',\n '#title' => t('Questions in this @quiz', array('@quiz' => QUIZ_NAME)),\n '#theme' => 'question_selection_table',\n '#collapsible' => TRUE,\n '#attributes' => array('id' => 'mq-fieldset'),\n 'question_status' => array('#tree' => TRUE),\n );\n\n // Add randomization settings if this quiz allows randomized questions\n _quiz_add_fields_for_random_quiz($form, $quiz);\n\n $include_random = $quiz->randomization == 2;\n // @todo deal with $include_random\n $questions = quiz_get_questions($quiz->nid, $quiz->vid);\n\n if (empty($questions)) {\n $form['question_list']['no_questions'] = array(\n '#markup' => '<div id = \"no-questions\">' . t('There are currently no questions in this @quiz. Assign existing questions by using the question browser below. You can also use the links above to create new questions.', array('@quiz' => QUIZ_NAME)) . '</div>',\n );\n }\n\n // We add the questions to the form array\n _quiz_add_questions_to_form($form, $questions, $quiz, $types);\n\n // Show the number of questions in the table header.\n $always_count = isset($form['question_list']['titles']) ? count($form['question_list']['titles']) : 0;\n $form['question_list']['#title'] .= ' (' . $always_count . ')';\n\n // Give the user the option to create a new revision of the quiz\n _quiz_add_revision_checkbox($form, $quiz);\n\n // Timestamp is needed to avoid multiple users editing the same quiz at the same time.\n $form['timestamp'] = array('#type' => 'hidden', '#default_value' => REQUEST_TIME);\n\n $form['actions']['#type'] = 'actions';\n\n $form['actions']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Submit'),\n '#submit' => array('quiz_questions_form_submit'),\n );\n return $form;\n}",
"public function create()\n {\n \n if (!checkRole(getUserGrade(1)))\n {\n prepareBlockUserMessage();\n return back();\n }\n\n $data['title'] = getPhrase('create');\n $data['active_class'] = 'faqs';\n $data['record'] = FALSE;\n\n \n $data['categories'] = FaqQuestion::getFaqCategories();\n\n return view('admin.faq_questions.add-edit', $data);\n }",
"protected function _prepareForm()\n {\n $question = $this->_coreRegistry->registry('question_data');\n $product = $this->_productFactory->create()->load($question->getProductId());\n\n /** @var \\Magento\\Framework\\Data\\Form $form */\n $form = $this->_formFactory->create(\n [\n 'data' => [\n 'id' => 'edit_form',\n 'action' => $this->getUrl(\n 'question/*/save',\n [\n 'id' => $this->getRequest()->getParam('id'),\n 'ret' => $this->_coreRegistry->registry('ret')\n ]\n ),\n 'method' => 'post',\n ],\n ]\n );\n\n $fieldset = $form->addFieldset(\n 'question_details',\n ['legend' => __('Question Details'), 'class' => 'fieldset-wide']\n );\n\n\n $fieldset->addField(\n 'product_name',\n 'note',\n [\n 'label' => __('Product'),\n 'text' => '<a href=\"' . $this->getUrl(\n 'catalog/product/edit',\n ['id' => $product->getId()]\n ) . '\" onclick=\"this.target=\\'blank\\'\">' . $this->escapeHtml(\n $product->getName()\n ) . '</a>'\n ]\n );\n\n try {\n $customer = $this->customerRepository->getById($question->getCustomerId());\n $customerText = __(\n '<a href=\"%1\" onclick=\"this.target=\\'blank\\'\">%2 %3</a> <a href=\"mailto:%4\">(%4)</a>',\n $this->getUrl('customer/index/edit', ['id' => $customer->getId(), 'active_tab' => 'question']),\n $this->escapeHtml($customer->getFirstname()),\n $this->escapeHtml($customer->getLastname()),\n $this->escapeHtml($customer->getEmail())\n );\n } catch (\\Magento\\Framework\\Exception\\NoSuchEntityException $e) {\n $customerText = ($question->getStoreId() == \\Magento\\Store\\Model\\Store::DEFAULT_STORE_ID)\n ? __('Administrator') : __('Guest');\n }\n\n $fieldset->addField('customer', 'note', ['label' => __('Author'), 'text' => $customerText]);\n\n\n $fieldset->addField(\n 'status_id',\n 'select',\n [\n 'label' => __('Status'),\n 'required' => true,\n 'name' => 'status_id',\n 'values' => $this->_questionData->getQuestionStatusesOptionArray()\n ]\n );\n\n /**\n * Check is single store mode\n */\n\n $fieldset->addField(\n 'select_stores',\n 'hidden',\n ['name' => 'stores[]', 'value' => $this->_storeManager->getStore(true)->getId()]\n );\n $question->setSelectStores($this->_storeManager->getStore(true)->getId());\n\n\n $fieldset->addField(\n 'question_content',\n 'textarea',\n ['label' => __('Question'), 'required' => true, 'name' => 'question_content', 'style' => 'height:10em;']\n );\n\n $fieldset->addField(\n 'answer_content',\n 'editor',\n [\n 'title' => __('Answer'),\n 'label' => __('Answer'),\n 'name' => 'answer_content',\n 'style' => 'height:24em;',\n 'config' => $this->_wysiwygConfig->getConfig()\n ]\n );\n\n $fieldset->addField(\n 'priority',\n 'text',\n ['label' => __('Priority'), 'required' => false, 'name' => 'priority']\n );\n\n $form->setUseContainer(true);\n $form->setValues($question->getData());\n $this->setForm($form);\n return parent::_prepareForm();\n }",
"public function createComponentQuestionForm() {\n $form = new Form;\n\n $form->addHidden('test_id');\n $form->addHidden('id');\n $form->addTextArea('text', 'Text')->setRequired();\n $form->addSubmit('submit');\n $form->setDefaults($this->questions->getById($this->questionId));\n $form->onSuccess[] = $this->questionFormSucceeded;\n\n return $form;\n }",
"function questionCreation_mform(&$mform) {\n global $DB;\n $repeatarray = array();\n\n $repeatarray[] = &$mform->createElement('static', 'question_achor',\n '<a name=\"q{no}\"></a>', '');\n //Question Header\n $repeatarray[] = &$mform->createElement('header', 'question_header_x',\n get_string('question', 'local_evaluations') . ' {no}');\n\n //Question Dialog\n $repeatarray[] = &$mform->createElement('textarea', 'question_x',\n get_string('question_c', 'local_evaluations'),\n array('rows' => 8, 'cols' => 65));\n //$repeatarray[] = &$mform->createElement('htmleditor', 'question_x', get_string('question_c', 'local_evaluations'));\n //Question Types\n $question_types = $DB->get_records('evaluations_question_types');\n $question_types_choices = array();\n //print_object(&$mform);exit();\n foreach ($question_types as $id => $question_type) {\n $question_types_choices[$id] = $question_type->name;\n }\n\n $attributes = array();\n $repeatarray[] = &$mform->createElement('select', 'question_type_id',\n get_string('type_c', 'local_evaluations'),\n $question_types_choices, $attributes);\n\n //james down up delete button\n $mform->registerNoSubmitButton('delete_question_x');\n $mform->registerNoSubmitButton('swapup_question_x');\n $mform->registerNoSubmitButton('swapdown_question_x');\n\n $repeatarray[] = $mform->createElement('html',\n '<div class=\"question_controls\">');\n $repeatarray[] = $mform->createElement('submit', 'delete_question_x',\n get_string('delete'));\n $repeatarray[] = $mform->createElement('html', '</div>');\n\n $repeatarray[] = $mform->createElement('html',\n '<div class=\"question_controls\">');\n $repeatarray[] = $mform->createElement('submit', 'swapup_question_x',\n get_string('up'));\n $repeatarray[] = $mform->createElement('html', '</div>');\n\n $repeatarray[] = $mform->createElement('html',\n '<div class=\"question_controls\">');\n $repeatarray[] = $mform->createElement('submit', 'swapdown_question_x',\n get_string('down'));\n $repeatarray[] = $mform->createElement('html', '</div>');\n\n //Hidden\n //$repeatarray[] = &$mform->createElement('hidden', 'position_x', 0); \n $repeatarray[] = &$mform->createElement('hidden', 'questionid_x', 0);\n $repeatarray[] = &$mform->createElement('hidden', 'question_std', 0);\n\n return $repeatarray;\n}",
"private function createQuiz() {\n\n $newQuiz = new Quiz();\n $newQuiz->difficulty_level_id = $this->difficulty;\n $newQuiz->num_of_questions = $this->length;\n $newQuiz->save();\n\n $this->quizId = $newQuiz->id;\n }",
"protected function definition() {\n global $COURSE, $CFG, $DB, $PAGE, $OUTPUT;\n\n $qtype = $this->qtype();\n $langfile = \"qtype_$qtype\";\n $mform = $this->_form;\n\n // Standard fields at the start of the form.\n $mform->addElement('header', 'generalheader', get_string(\"general\", 'form'));\n\n if (!isset($this->question->id)) {\n if (!empty($this->question->formoptions->mustbeusable)) {\n $contexts = $this->contexts->having_add_and_use();\n } else {\n $contexts = $this->contexts->having_cap('moodle/question:add');\n }\n\n // Adding question.\n $mform->addElement('questioncategory', 'category', get_string('category', 'question'), array('contexts' => $contexts));\n } else if (!($this->question->formoptions->canmove || $this->question->formoptions->cansaveasnew)) {\n // Editing question with no permission to move from category.\n $mform->addElement('questioncategory', 'category', get_string('category', 'question'),\n array('contexts' => array($this->categorycontext)));\n $mform->addElement('hidden', 'usecurrentcat', 1);\n $mform->setType('usecurrentcat', PARAM_BOOL);\n $mform->setConstant('usecurrentcat', 1);\n } else {\n // Editing question with permission to move from category or save as new q.\n $currentgrp = array();\n $currentgrp[0] = $mform->createElement('questioncategory', 'category', get_string('categorycurrent', 'question'),\n array('contexts' => array($this->categorycontext)));\n // Validate if the question is being duplicated.\n $beingcopied = false;\n if (isset($this->question->beingcopied)) {\n $beingcopied = $this->question->beingcopied;\n }\n if (($this->question->formoptions->canedit || $this->question->formoptions->cansaveasnew) && ($beingcopied)) {\n // Not move only form.\n $currentgrp[1] = $mform->createElement('checkbox', 'usecurrentcat', '',\n get_string('categorycurrentuse', 'question'));\n $mform->setDefault('usecurrentcat', 1);\n }\n $currentgrp[0]->freeze();\n $currentgrp[0]->setPersistantFreeze(false);\n $mform->addGroup($currentgrp, 'currentgrp', get_string('categorycurrent', 'question'), null, false);\n\n if (($beingcopied)) {\n $mform->addElement('questioncategory', 'categorymoveto', get_string('categorymoveto', 'question'),\n array('contexts' => array($this->categorycontext)));\n if ($this->question->formoptions->canedit || $this->question->formoptions->cansaveasnew) {\n // Not move only form.\n $mform->disabledIf('categorymoveto', 'usecurrentcat', 'checked');\n }\n }\n }\n\n if (class_exists('qbank_editquestion\\\\editquestion_helper') && !empty($this->question->id) && !$this->question->beingcopied) {\n // Add extra information from plugins when editing a question (e.g.: Authors, version control and usage).\n $functionname = 'edit_form_display';\n $questiondata = [];\n $plugins = get_plugin_list_with_function('qbank', $functionname);\n foreach ($plugins as $componentname => $plugin) {\n $element = new StdClass();\n $element->pluginhtml = component_callback($componentname, $functionname, [$this->question]);\n $questiondata['editelements'][] = $element;\n }\n $mform->addElement('static', 'versioninfo', get_string('versioninfo', 'qbank_editquestion'),\n $PAGE->get_renderer('qbank_editquestion')->render_question_info($questiondata));\n }\n\n $mform->addElement('text', 'name', get_string('tasktitle', 'qtype_lti'),\n array('size' => 50, 'maxlength' => 255));\n $mform->setType('name', PARAM_TEXT);\n\n $mform->addRule('name', null, 'required', null, 'client');\n\n $mform->addElement('hidden', 'instancecode', ' instance code');\n $mform->setType('instancecode', PARAM_TEXT);\n if (!empty($this->question->options->instancecode)) {\n $instancecode = $this->question->options->instancecode;\n } else {\n $instancecode = uniqid('');\n }\n $mform->setDefault('instancecode', $instancecode);\n\n $mform->addElement('text', 'defaultmark', get_string('maxpoints', 'qtype_lti'), array('size' => 7));\n $mform->setType('defaultmark', PARAM_FLOAT);\n $mform->setDefault('defaultmark', 1);\n $mform->addRule('defaultmark', null, 'required', null, 'client');\n\n $mform->addElement('editor', 'questiontext', get_string('stem', 'qtype_lti'),\n array('rows' => 15, 'class' => 'qtype_lti_stem_hidden'), $this->editoroptions);\n $mform->setType('questiontext', PARAM_RAW);\n\n $mform->setDefault('questiontext', array('text' => ' '));\n\n if (class_exists('qbank_editquestion\\\\editquestion_helper')) {\n $mform->addElement('select', 'status', get_string('status', 'qbank_editquestion'),\n \\qbank_editquestion\\editquestion_helper::get_question_status_list());\n }\n\n $mform->addElement('editor', 'generalfeedback', get_string('generalfeedback', 'question'),\n array('rows' => 10), $this->editoroptions);\n $mform->setType('generalfeedback', PARAM_RAW);\n $mform->addHelpButton('generalfeedback', 'generalfeedback', 'qtype_lti');\n\n $mform->addElement('text', 'idnumber', get_string('idnumber', 'question'), 'maxlength=\"100\" size=\"10\"');\n $mform->addHelpButton('idnumber', 'idnumber', 'question');\n $mform->setType('idnumber', PARAM_RAW);\n\n\n // Any questiontype specific fields.\n\n if ($type = optional_param('type', false, PARAM_ALPHA)) {\n component_callback(\"ltisource_$type\", 'add_instance_hook');\n }\n\n $this->typeid = 0;\n\n // Tool settings.\n $tooltypes = $mform->addElement('select', 'typeid', get_string('external_tool_type', 'qtype_lti'));\n // Type ID parameter being passed when adding an preconfigured tool from activity chooser.\n $typeid = optional_param('typeid', false, PARAM_INT);\n if ($typeid) {\n $mform->getElement('typeid')->setValue($typeid);\n }\n $mform->addHelpButton('typeid', 'external_tool_type', 'qtype_lti');\n $toolproxy = array();\n\n // Array of tool type IDs that don't support ContentItemSelectionRequest.\n $noncontentitemtypes = [];\n\n foreach (qtype_lti_get_types_for_add_instance() as $id => $type) {\n if (!empty($type->toolproxyid)) {\n $toolproxy[] = $type->id;\n $attributes = array('globalTool' => 1, 'toolproxy' => 1);\n $enabledcapabilities = explode(\"\\n\", $type->enabledcapability);\n if (!in_array('Result.autocreate', $enabledcapabilities)) {\n $attributes['nogrades'] = 1;\n }\n if (!in_array('Person.name.full', $enabledcapabilities) && !in_array('Person.name.family', $enabledcapabilities) &&\n !in_array('Person.name.given', $enabledcapabilities)) {\n $attributes['noname'] = 1;\n }\n if (!in_array('Person.email.primary', $enabledcapabilities)) {\n $attributes['noemail'] = 1;\n }\n } else if ($type->course == $COURSE->id) {\n\n $attributes = array('editable' => 1, 'courseTool' => 1, 'domain' => $type->tooldomain);\n } else if ($id != 0) {\n $attributes = array('globalTool' => 1, 'domain' => $type->tooldomain);\n } else {\n $attributes = array();\n }\n\n if ($id) {\n $config = qtype_lti_get_type_config($id);\n if (!empty($config['contentitem'])) {\n $attributes['data-contentitem'] = 1;\n $attributes['data-id'] = $id;\n } else {\n $noncontentitemtypes[] = $id;\n }\n }\n $tooltypes->addOption($type->name, $id, $attributes);\n }\n\n // Add button that launches the content-item selection dialogue.\n // Set contentitem URL.\n $contentitemurl = new moodle_url('/question/type/lti/contentitem.php');\n $contentbuttonattributes = ['data-contentitemurl' => $contentitemurl->out(false)];\n $contentbuttonlabel = get_string('selectcontent', 'qtype_lti');\n $contentbutton = $mform->addElement('button', 'selectcontent', $contentbuttonlabel, $contentbuttonattributes);\n // Disable select content button if the selected tool doesn't support content item or it's set to Automatic.\n $allnoncontentitemtypes = $noncontentitemtypes;\n $allnoncontentitemtypes[] = '0'; // Add option value for \"Automatic, based on tool URL\".\n\n $mform->disabledIf('selectcontent', 'typeid', 'in', $allnoncontentitemtypes);\n\n $mform->addElement('text', 'toolurl', get_string('launch_url', 'qtype_lti'), array('size' => '64'));\n $mform->setType('toolurl', PARAM_URL);\n $mform->addHelpButton('toolurl', 'launch_url', 'qtype_lti');\n\n $mform->addElement('checkbox', 'unlockabletoolurl', get_string('unlockabletoolurl_edit', 'qtype_lti'));\n $mform->addHelpButton('unlockabletoolurl', 'unlockabletoolurl_edit', 'qtype_lti');\n\n if (isset(get_config('qtype_lti')->unlockabletoolurl_adv)) {\n if (get_config('qtype_lti')->unlockabletoolurl_adv == 1) {\n $mform->setAdvanced('unlockabletoolurl');\n }\n }\n\n if (isset($this->question->id)) {\n $mform->disabledIf('toolurl', null);\n }\n if (isset(get_config('qtype_lti')->unlockabletoolurl)) {\n if (get_config('qtype_lti')->unlockabletoolurl == 0) {\n $mform->disabledIf('unlockabletoolurl', null);\n }\n }\n\n $mform->addElement('text', 'securetoolurl', get_string('secure_launch_url', 'qtype_lti'), array('size' => '64'));\n $mform->setType('securetoolurl', PARAM_URL);\n $mform->setAdvanced('securetoolurl');\n $mform->addHelpButton('securetoolurl', 'secure_launch_url', 'qtype_lti');\n $mform->disabledIf('securetoolurl', 'typeid', 'in', $noncontentitemtypes);\n\n $mform->addElement('hidden', 'urlmatchedtypeid', '', array('id' => 'id_urlmatchedtypeid'));\n $mform->setType('urlmatchedtypeid', PARAM_INT);\n\n $launchoptions = array();\n $launchoptions[QTYPE_LTI_LAUNCH_CONTAINER_DEFAULT] = get_string('default', 'qtype_lti');\n $launchoptions[QTYPE_LTI_LAUNCH_CONTAINER_EMBED] = get_string('embed', 'qtype_lti');\n $launchoptions[QTYPE_LTI_LAUNCH_CONTAINER_EMBED_NO_BLOCKS] = get_string('embed_no_blocks', 'qtype_lti');\n $launchoptions[QTYPE_LTI_LAUNCH_CONTAINER_REPLACE_MOODLE_WINDOW] = get_string('existing_window', 'qtype_lti');\n $launchoptions[QTYPE_LTI_LAUNCH_CONTAINER_WINDOW] = get_string('new_window', 'qtype_lti');\n\n $mform->addElement('select', 'launchcontainer', get_string('launchinpopup', 'qtype_lti'), $launchoptions,\n 'class=\"qtype_lti_stem_hidden\"');\n $mform->setDefault('launchcontainer', QTYPE_LTI_LAUNCH_CONTAINER_DEFAULT);\n $mform->addHelpButton('launchcontainer', 'launchinpopup', 'qtype_lti');\n $mform->setAdvanced('launchcontainer');\n\n $mform->addElement('text', 'resourcekey', get_string('resourcekey', 'qtype_lti'));\n $mform->setType('resourcekey', PARAM_TEXT);\n $mform->setAdvanced('resourcekey');\n $mform->addHelpButton('resourcekey', 'resourcekey', 'qtype_lti');\n $mform->setForceLtr('resourcekey');\n $mform->disabledIf('resourcekey', 'typeid', 'in', $noncontentitemtypes);\n\n // Hacky solution for \"advanced\" to work without hurting boost theme.\n global $PAGE;\n $themeisboost = 0;\n\n if (strpos($PAGE->theme->name, 'boost') !== false) {\n $themeisboost = 1;\n }\n\n if ($themeisboost == 0) {\n $mform->addElement('html', '<div class=\"fitem advanced\">');\n }\n\n // Disable Auto-fill in a nasty way.\n $mform->addElement('password', 'password', get_string('password', 'qtype_lti'), array('readonly'=>'true', 'onfocus'=>'this.removeAttribute(\"readonly\");'));\n $mform->setType('password', PARAM_TEXT);\n $mform->setAdvanced('password', true);\n $mform->addHelpButton('password', 'password', 'qtype_lti');\n $mform->disabledIf('password', 'typeid', 'in', $noncontentitemtypes);\n if ($themeisboost == 0) {\n $mform->addElement('html', '</div>');\n }\n\n $mform->addElement('textarea', 'instructorcustomparameters', get_string('custom', 'qtype_lti'),\n array('rows' => 4, 'cols' => 60));\n $mform->setType('instructorcustomparameters', PARAM_TEXT);\n $mform->setAdvanced('instructorcustomparameters');\n $mform->addHelpButton('instructorcustomparameters', 'custom', 'qtype_lti');\n $mform->setForceLtr('instructorcustomparameters');\n\n $mform->addElement('text', 'icon', get_string('icon_url', 'qtype_lti'), array('size' => '64'));\n $mform->setType('icon', PARAM_URL);\n $mform->setAdvanced('icon');\n $mform->addHelpButton('icon', 'icon_url', 'qtype_lti');\n $mform->disabledIf('icon', 'typeid', 'in', $noncontentitemtypes);\n\n $mform->addElement('text', 'secureicon', get_string('secure_icon_url', 'qtype_lti'), array('size' => '64'));\n $mform->setType('secureicon', PARAM_URL);\n $mform->setAdvanced('secureicon');\n $mform->addHelpButton('secureicon', 'secure_icon_url', 'qtype_lti');\n $mform->disabledIf('secureicon', 'typeid', 'in', $noncontentitemtypes);\n\n $ctxcourse = context_course::instance($COURSE->id);\n\n $editurl = new moodle_url('/question/type/lti/instructor_edit_tool_type.php',\n array('sesskey' => sesskey(), 'course' => $COURSE->id));\n $ajaxurl = new moodle_url('/question/type/lti/ajax.php');\n\n // All these icon uses are incorrect. LTI JS needs updating to use AMD modules and templates so it can use\n // the mustache pix helper - until then LTI will have inconsistent icons.\n $jsinfo = (object)array('edit_icon_url' => (string)$OUTPUT->image_url('t/edit'),\n 'add_icon_url' => (string)$OUTPUT->image_url('t/add'), 'delete_icon_url' => (string)$OUTPUT->image_url('t/delete'),\n 'green_check_icon_url' => (string)$OUTPUT->image_url('i/valid'),\n 'warning_icon_url' => (string)$OUTPUT->image_url('warning', 'qtype_lti'),\n 'instructor_tool_type_edit_url' => $editurl->out(false), 'ajax_url' => $ajaxurl->out(true), 'courseId' => $COURSE->id,\n 'questionid' => isset($this->question->id) ? $this->question->id : null,\n 'can_add_course_tool' => has_capability('qtype/lti:addcoursetool', $ctxcourse));\n\n $module = array('name' => 'qtype_lti_edit', 'fullpath' => '/question/type/lti/form.js',\n 'requires' => array('base', 'io', 'querystring-stringify-simple', 'node', 'event', 'json-parse'),\n 'strings' => array(array('addtype', 'qtype_lti'), array('edittype', 'qtype_lti'), array('deletetype', 'qtype_lti'),\n array('delete_confirmation', 'qtype_lti'), array('cannot_add', 'qtype_lti'), array('cannot_edit', 'qtype_lti'),\n array('cannot_delete', 'qtype_lti'), array('global_tool_types', 'qtype_lti'),\n array('course_tool_types', 'qtype_lti'), array('using_tool_configuration', 'qtype_lti'),\n array('using_tool_cartridge', 'qtype_lti'), array('domain_mismatch', 'qtype_lti'),\n array('custom_config', 'qtype_lti'), array('tool_config_not_found', 'qtype_lti'),\n array('tool_config_duplicate_url', 'qtype_lti'), array('tool_config_not_valid', 'qtype_lti'),\n array('tooltypeadded', 'qtype_lti'),\n array('tooltypedeleted', 'qtype_lti'), array('tooltypenotdeleted', 'qtype_lti'),\n array('tooltypeupdated', 'qtype_lti'), array('forced_help', 'qtype_lti')));\n\n if (!empty($typeid)) {\n $mform->setAdvanced('typeid');\n $mform->setAdvanced('toolurl');\n }\n\n $PAGE->requires->js_init_call('M.qtype_lti.editor.init', array(json_encode($jsinfo)), true, $module);\n\n // Simplify screen by showing configuration details only if not preset (when new) or have the capabilities to do so (when\n // editing).\n\n if (optional_param('update', 0, PARAM_INT)) {\n $listtypes = has_capability('qtype/lti:addgloballypreconfigedtoolinstance', $ctxcourse);\n $listoptions = has_capability('qtype/lti:adddefaultinstance', $ctxcourse);\n } else {\n $listtypes = !$typeid;\n $listoptions = !$typeid && has_capability('qtype/lti:adddefaultinstance', $ctxcourse);\n }\n if (!$listtypes) {\n $mform->removeElement('typeid');\n $mform->addElement('hidden', 'typeid', $typeid);\n $mform->setType('typeid', PARAM_INT);\n }\n if (!$listoptions) {\n $mform->removeElement('selectcontent');\n $mform->removeElement('toolurl');\n $mform->removeElement('securetoolurl');\n $mform->removeElement('launchcontainer');\n $mform->removeElement('resourcekey');\n $mform->removeElement('password');\n $mform->removeElement('instructorcustomparameters');\n $mform->removeElement('icon');\n $mform->removeElement('secureicon');\n }\n\n $courseid = optional_param('courseid', 1, PARAM_INT);\n $mform->addElement('hidden', 'course', $courseid);\n $mform->setType('course', PARAM_INT);\n\n $mform->addElement('hidden', 'cmid', 0);\n $mform->setType('cmid', PARAM_INT);\n $mform->setDefault('cmid', 0);\n\n // Privacy.\n $mform->addElement('hidden', 'instructorchoicesendname', 1);\n $mform->setType('instructorchoicesendname', PARAM_INT);\n\n $mform->addElement('hidden', 'instructorchoicesendemailaddr', 1);\n $mform->setType('instructorchoicesendemailaddr', PARAM_INT);\n\n $mform->addElement('hidden', 'instructorchoiceacceptgrades', 1);\n $mform->setType('instructorchoiceacceptgrades', PARAM_INT);\n\n $mform->addElement('hidden', 'instructorchoiceallowroster', 1);\n $mform->setType('instructorchoiceallowroster', PARAM_INT);\n\n $mform->addElement('hidden', 'instructorchoiceallowroster', 1);\n $mform->setType('instructorchoiceallowroster', PARAM_INT);\n\n $mform->addElement('hidden', 'instructorchoiceallowsetting', 1);\n $mform->setType('instructorchoiceallowsetting', PARAM_INT);\n\n $mform->addElement('hidden', 'showdescription', 0, array('id' => 'id_showdescription'));\n $mform->setType('showdescription', PARAM_INT);\n $mform->addElement('hidden', 'showtitlelaunch', 1, array('id' => 'id_showtitlelaunch'));\n $mform->setType('showtitlelaunch', PARAM_INT);\n $mform->addElement('hidden', 'showdescriptionlaunch', 1, array('id' => 'id_showdescriptionlaunch'));\n $mform->setType('showdescriptionlaunch', PARAM_INT);\n\n $this->add_hidden_fields();\n if (core_tag_tag::is_enabled('core_question', 'question') && class_exists('qbank_tagquestion\\\\tags_action_column') &&\n \\core\\plugininfo\\qbank::is_plugin_enabled('qbank_tagquestion')) {\n $this->add_tag_fields($mform);\n }\n\n if (!empty($this->customfieldpluginenabled) && $this->customfieldpluginenabled) {\n // Add custom fields to the form.\n $this->customfieldhandler = qbank_customfields\\customfield\\question_handler::create();\n $this->customfieldhandler->set_parent_context($this->categorycontext); // For question handler only.\n $this->customfieldhandler->instance_form_definition($mform, empty($this->question->id) ? 0 : $this->question->id);\n }\n\n\n $this->add_interactive_settings(true, true);\n\n $mform->addElement('hidden', 'qtype');\n $mform->setType('qtype', PARAM_ALPHA);\n\n $mform->addElement('hidden', 'makecopy');\n $mform->setType('makecopy', PARAM_INT);\n\n $buttonarray = array();\n $buttonarray[] = $mform->createElement('submit', 'updatebutton', get_string('savechangesandcontinueediting', 'question'));\n if ($this->can_preview()) {\n if (class_exists('qbank_editquestion\\\\editquestion_helper')) {\n if (\\core\\plugininfo\\qbank::is_plugin_enabled('qbank_previewquestion')) {\n $previewlink = $PAGE->get_renderer('qbank_previewquestion')->question_preview_link($this->question->id,\n $this->context, true);\n $buttonarray[] = $mform->createElement('static', 'previewlink', '', $previewlink);\n }\n } else {\n $previewlink = $PAGE->get_renderer('core_question')->question_preview_link($this->question->id, $this->context, true);\n $buttonarray[] = $mform->createElement('static', 'previewlink', '', $previewlink);\n }\n }\n\n $mform->addGroup($buttonarray, 'updatebuttonar', '', array(' '), false);\n $mform->closeHeaderBefore('updatebuttonar');\n\n $this->add_action_buttons(true, get_string('savechanges'));\n\n if ((!empty($this->question->id)) && (!($this->question->formoptions->canedit || $this->question->formoptions->cansaveasnew))) {\n $mform->hardFreezeAllVisibleExcept(array('categorymoveto', 'buttonar', 'currentgrp'));\n }\n }",
"public function addQuestion() {\n\t\t$result = $this->Posting->addQuestion();\n\t\tif (isset($result['data'])) {\n\t\t\t$view = new View($this, false);\n\t\t\t$data = $result['data'];\n\t\t\t$element = $data['element'];\n\t\t\tunset($data['element']);\n\t\t\t$currentUser=$this->Auth->user();\n\t\t\t$data['loggedin_userid'] = $currentUser['id'];\n\t\t\t$data['loggedin_user_type'] = $currentUser['type'];\n\t\t\t$data['username'] = $currentUser['username'];\n\t\t\t$view->set($data);\n\t\t\t$viewContent = $view->element($element);\n\t\t\tunset($result['data']);\n\t\t\t$result['content'] = $viewContent;\n\t\t}\n\t\t$this->data = $result;\n\t}",
"public function getPostCreateQuestion()\n {\n $title = \"Ask Question\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n $user = $this->di->get(\"authHelper\")->getLoggedInUser();\n\n if (!$user) {\n $this->di->get(\"response\")->redirect(\"user/login\");\n }\n\n $form = new QuestionForm($this->di);\n $form->check();\n $view->add(\"comment/question-form\", [\"form\" => $form->getHTML([\"use_buttonbar\" => false])]);\n return $pageRender->renderPage([\"title\" => $title]);\n }",
"public function new_question() {\n // Check if the current user is admin and if session exists\n $this->check_session($this->user_role, 1);\n \n // Load Admin Helper\n $this->load->helper('admin_helper');\n $res = '1';\n // Check if data was submitted\n if ($this->input->post()) {\n // Add form validation\n $this->form_validation->set_rules('question', 'Question', 'trim|required');\n $this->form_validation->set_rules('response', 'Response', 'trim|required');\n // Get data\n $question = $this->input->post('question');\n $response = $this->input->post('response');\n // Check form validation\n if ($this->form_validation->run() == false) {\n $res = 'popup_fon(\\'sube\\', \\''.$this->lang->line('mu59').'\\', 1500, 2000);';\n } else {\n if($this->questions->save_question($question, $response)) {\n $res = 'popup_fon(\\'subi\\', \\''.$this->lang->line('mi28').'\\', 1500, 2000); setTimeout(function() {document.location.href=\"'.$this->config->base_url() . 'admin/tickets\";}, 5000);';\n } else {\n $res = 'popup_fon(\\'sube\\', \\''.$this->lang->line('mu59').'\\', 1500, 2000);';\n }\n }\n }\n $this->body = 'admin/tickets';\n $this->content = ['res' => '', 'result' => $res];\n $this->admin_layout();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the usedLicenseCount The number of VPP licenses in use. | public function setUsedLicenseCount($val)
{
$this->_propDict["usedLicenseCount"] = $val;
return $this;
} | [
"public function setUsedLicenseCount($val)\n {\n $this->_propDict[\"usedLicenseCount\"] = intval($val);\n return $this;\n }",
"public function setUsedLicenseCount(?int $value): void {\n $this->getBackingStore()->set('usedLicenseCount', $value);\n }",
"public function setTotalLicenseCount($val)\n {\n $this->_propDict[\"totalLicenseCount\"] = intval($val);\n return $this;\n }",
"public function setProductCount($productCount);",
"public function setUsedLicenses($usedLicenses)\n {\n $this->usedLicenses = $usedLicenses;\n return $this;\n }",
"public function setUsedUsers($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (int) $v;\n }\n\n if ($this->used_users !== $v) {\n $this->used_users = $v;\n $this->modifiedColumns[] = LicensePeer::USED_USERS;\n }\n\n\n return $this;\n }",
"public function setTotalLicenseCount(?int $value): void {\n $this->getBackingStore()->set('totalLicenseCount', $value);\n }",
"public function setLicensedUserCount(?int $value): void {\n $this->getBackingStore()->set('licensedUserCount', $value);\n }",
"final public function setTransCnt($count) : void\r\n\t{\r\n\t\t$this->transCnt = $count;\r\n\t}",
"public function setTotalLicenses($val)\n {\n $this->_propDict[\"totalLicenses\"] = intval($val);\n return $this;\n }",
"public function getUsedLicenseCount()\n {\n if (array_key_exists(\"usedLicenseCount\", $this->_propDict)) {\n return $this->_propDict[\"usedLicenseCount\"];\n } else {\n return null;\n }\n }",
"private function setCount($count) {\n $this->count = $count;\n }",
"public function setCount($count) {\n\t\t$this->_count = $count;\n\t}",
"public function setVotesCount($votesCount) {\n\t\t$this->votesCount = $votesCount;\n\t}",
"public function resetPartialUserLicenses($v = true)\n {\n $this->collUserLicensesPartial = $v;\n }",
"public function resetPartialLicenses($v = true)\n {\n $this->collLicensesPartial = $v;\n }",
"public function setFailedLicensesCount(?int $value): void {\n $this->getBackingStore()->set('failedLicensesCount', $value);\n }",
"public function setCount($count);",
"public function setLicense($license)\r\n {\r\n $this->license = $license;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the public 'sylius.fixture.example_factory.shipping_category' shared service. | protected function getSylius_Fixture_ExampleFactory_ShippingCategoryService()
{
return $this->services['sylius.fixture.example_factory.shipping_category'] = new \Sylius\Bundle\CoreBundle\Fixture\Factory\ShippingCategoryExampleFactory(${($_ = isset($this->services['sylius.factory.shipping_category']) ? $this->services['sylius.factory.shipping_category'] : $this->get('sylius.factory.shipping_category')) && false ?: '_'});
} | [
"protected function getSylius_Controller_ShippingCategoryService()\n {\n $this->services['sylius.controller.shipping_category'] = $instance = new \\Sylius\\Bundle\\ResourceBundle\\Controller\\ResourceController($this->get('sylius.controller.configuration_factory')->createConfiguration('sylius', 'shipping_category', NULL));\n\n $instance->setContainer($this);\n\n return $instance;\n }",
"public function getShippingCategoryDetails()\n {\n return $this->shippingCategoryDetails;\n }",
"public function getCategoryService()\n {\n return $this->_categoryService;\n }",
"protected function getSylius_Fixture_ShippingMethodService()\n {\n return $this->services['sylius.fixture.shipping_method'] = new \\Sylius\\Bundle\\CoreBundle\\Fixture\\ShippingMethodFixture(${($_ = isset($this->services['doctrine.orm.default_entity_manager']) ? $this->services['doctrine.orm.default_entity_manager'] : $this->get('doctrine.orm.default_entity_manager')) && false ?: '_'}, ${($_ = isset($this->services['sylius.fixture.example_factory.shipping_method']) ? $this->services['sylius.fixture.example_factory.shipping_method'] : $this->get('sylius.fixture.example_factory.shipping_method')) && false ?: '_'});\n }",
"public function getCategoryService()\n {\n return $this->get('talkfest.service.category');\n }",
"public function getShippingService()\n {\n return $this->shippingService;\n }",
"public function getShippingProfileCategoryGroup()\n {\n return $this->shippingProfileCategoryGroup;\n }",
"protected function getSylius_Fixture_TaxCategoryService()\n {\n return $this->services['sylius.fixture.tax_category'] = new \\Sylius\\Bundle\\CoreBundle\\Fixture\\TaxCategoryFixture(${($_ = isset($this->services['doctrine.orm.default_entity_manager']) ? $this->services['doctrine.orm.default_entity_manager'] : $this->get('doctrine.orm.default_entity_manager')) && false ?: '_'}, ${($_ = isset($this->services['sylius.fixture.example_factory.tax_category']) ? $this->services['sylius.fixture.example_factory.tax_category'] : $this->get('sylius.fixture.example_factory.tax_category')) && false ?: '_'});\n }",
"protected function getSylius_Factory_ShippingMethodService()\n {\n return $this->services['sylius.factory.shipping_method'] = new \\Sylius\\Component\\Resource\\Factory\\TranslatableFactory(new \\Sylius\\Component\\Resource\\Factory\\Factory('Sylius\\\\Component\\\\Core\\\\Model\\\\ShippingMethod'), ${($_ = isset($this->services['sylius.translation_locale_provider.admin']) ? $this->services['sylius.translation_locale_provider.admin'] : $this->get('sylius.translation_locale_provider.admin')) && false ?: '_'});\n }",
"public function getCategoryService()\n {\n if (null === $this->categoryService)\n $this->categoryService = $this->getService('category');\n return $this->categoryService;\n }",
"protected function getSylius_Factory_TaxCategoryService()\n {\n return $this->services['sylius.factory.tax_category'] = new \\Sylius\\Component\\Resource\\Factory\\Factory('Sylius\\\\Component\\\\Taxation\\\\Model\\\\TaxCategory');\n }",
"public function get_shipping_class()\n {\n }",
"protected function getProductCategoryService()\n {\n return $this->services['App\\\\Backend\\\\ImportProduct\\\\Business\\\\Model\\\\Update\\\\ProductCategory'] = new \\App\\Backend\\ImportProduct\\Business\\Model\\Update\\ProductCategory(($this->services['App\\\\Client\\\\Category\\\\Business\\\\CategoryBusinessFacade'] ?? $this->getCategoryBusinessFacadeService()), ($this->services['App\\\\Client\\\\Product\\\\Business\\\\ProductBusinessFacade'] ?? $this->getProductBusinessFacadeService()), ($this->services['App\\\\Backend\\\\ImportProduct\\\\Business\\\\Model\\\\IntegrityManager\\\\CategoryIntegrityManager'] ?? $this->getCategoryIntegrityManagerService()), ($this->services['App\\\\Backend\\\\ImportProduct\\\\Business\\\\Model\\\\IntegrityManager\\\\ValueIntegrityManager'] ?? $this->getValueIntegrityManagerService()));\n }",
"public function get_shipping_class() {\n\n\t\tif ( ! $this->shipping_class ) {\n\n\t\t\t$classes = get_the_terms( $this->id, 'product_shipping_class' );\n\n\t\t\tif ( $classes && ! is_wp_error( $classes ) ) {\n\t\t\t\t$this->shipping_class = current( $classes )->slug;\n\t\t\t} else {\n\t\t\t\t$this->shipping_class = '';\n\t\t\t}\n\n\t\t}\n\n\t\treturn $this->shipping_class;\n\t}",
"protected function getSylius_OrderProcessing_ShippingProcessorService()\n {\n return $this->services['sylius.order_processing.shipping_processor'] = new \\Sylius\\Component\\Core\\OrderProcessing\\ShippingChargesProcessor($this->get('sylius.repository.adjustment'), $this->get('sylius.shipping_calculator'));\n }",
"public function get_shipping_class() {\n\t\tif ( ! $this->variation_shipping_class ) {\n\t\t\t$classes = get_the_terms( $this->variation_id, 'product_shipping_class' );\n\n\t\t\tif ( $classes && ! is_wp_error( $classes ) ) {\n\t\t\t\t$this->variation_shipping_class = esc_attr( current( $classes )->slug );\n\t\t\t} else {\n\t\t\t\t$this->variation_shipping_class = parent::get_shipping_class();\n\t\t\t}\n\t\t}\n\n\t\treturn $this->variation_shipping_class;\n\t}",
"protected function getSonata_Classification_Serializer_Handler_CategoryService()\n {\n return $this->services['sonata.classification.serializer.handler.category'] = new \\Sonata\\ClassificationBundle\\Serializer\\CategorySerializerHandler(${($_ = isset($this->services['sonata.classification.manager.category']) ? $this->services['sonata.classification.manager.category'] : $this->get('sonata.classification.manager.category')) && false ?: '_'});\n }",
"protected function getSylius_Factory_ShipmentService()\n {\n return $this->services['sylius.factory.shipment'] = new \\Sylius\\Component\\Resource\\Factory\\Factory('Sylius\\\\Component\\\\Core\\\\Model\\\\Shipment');\n }",
"private function getShippingMethodService()\n {\n if ($this->shippingMethodsService === null) {\n $this->shippingMethodsService = ServiceRegister::getService(ShippingMethodService::CLASS_NAME);\n }\n\n return $this->shippingMethodsService;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Flush the received requests from the server | public function flush()
{
$this->client->delete('guzzle-server/requests')->send();
} | [
"public static function flush()\n {\n self::send('DELETE', '/guzzle-server/requests');\n }",
"public function flush()\n {\n $this->send();\n $this->clear();\n }",
"public function flush()\n {\n if ($this->isFlushed === false) {\n // send response headers\n $this->sendResponseHeader();\n $this->sendContentTypeHeader();\n $this->sendHeaders();\n \n $this->isFlushed = true;\n }\n \n // send output\n $this->streamWriter->flush();\n }",
"public function flush(): void\n {\n if (count($this->data) > 0) {\n $ch = curl_init($this->url);\n\n $options = [\n CURLOPT_FORBID_REUSE => false,\n CURLOPT_FRESH_CONNECT => false,\n CURLOPT_CUSTOMREQUEST => 'POST',\n CURLOPT_POSTFIELDS => json_encode($this->data),\n CURLOPT_HTTPHEADER => [\n 'Content-Type: application/json'\n ]\n ];\n\n curl_setopt_array($ch, $options);\n $result = curl_exec($ch);\n\n // If result is true than close connection and clear data\n if ($result) {\n curl_close($ch);\n $this->data = null;\n $this->data = [];\n }\n }\n }",
"public function flush() {\n\t\t// calling callback\n\t\tif ($this->contentCallback)\n\t\t\tcall_user_func($this->contentCallback, $this->httpStorage);\n\n\t\t// sending everything to next filter\n\t\tif (!$this->getOutput()->isHeadersListSent())\n\t\t\t$this->getOutput()->setStatusCode($this->httpStorage->getStatusCode());\n\t\tforeach ($this->httpStorage->getHeadersList() as $h => $v)\n\t\t\t$this->getOutput()->setHeader($h, $v);\n\n\t\t$this->getOutput()->appendData($this->httpStorage->getData());\n\t\t$this->httpStorage = new HTTPResponseStorage();\n\n\t\t// \n\t\t$this->outputResponse->flush();\n\t}",
"public function flush(): void\n {\n $this->logger = null;\n\n $this->connections = [];\n\n $this->dispatcher->forgetAll();\n }",
"public function stream_flush();",
"public function flush() {\n\t\tfflush($this->out);\n\t}",
"private function _flushContent()\n {\n @ob_flush();\n @flush();\n }",
"static function flush(){\n if (ob_get_length()){\n ob_flush();\n }\n flush();\n }",
"public abstract function stream_flush();",
"protected function flush() {\n fflush($this->pipes[1]);\n $content = stream_get_contents($this->pipes[1]);\n $this->debug('flush', $content);\n // Get rid of output.\n $this->output = array();\n }",
"function flush_all($server, $port, $delay);",
"public function flush()\n {\n $this->out->flush();\n }",
"public function flush(){\r\n foreach($this->handlers as $handler){\r\n $handler['handler']\r\n ->setHttpContext($this->httpContext)\r\n ->setProcessor($this->processor)\r\n ->setLevelFilters($handler['filters'])\r\n ->write($this->logs, $this->extra);\r\n }\r\n }",
"public static function fcgiFlush()\n {\n echo(str_repeat(' ', 300));\n @flush();\n\t\t@ob_flush();\n }",
"public function flush()\n {\n $messages = $this->_messages;\n\n $this->_messages = [];\n\n $this->dispatch($messages);\n }",
"public function flush(){\r\n\t\t\t$this->sendContentTypeHeader();\r\n\t\t\tif($this->_bufferOutput)\r\n\t\t\t\tob_flush();\r\n\t\t}",
"public function flush() {\n $queueSize = $this->queueSize();\n if ($queueSize > 0) {\n $this->logInfo('Flushing queue of size ' . $queueSize);\n $this->sendBatch($this->_queue);\n $this->_queue = array();\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation listsChangereasonChangereasonIdGet Fetch Change Reason specified by changereasonId. | public function listsChangereasonByIdget($changereason_id)
{
$response = ChangeReason::findOrFail($changereason_id);
return response()->json($response, 200);
} | [
"public function listsChangereasonput($changereason_id)\r\n {\r\n $input = Request::all();\r\n $reason = ChangeReason::findOrFail($changereason_id);\r\n $reason->update([ 'name' => $input['name'] ]);\r\n if($reason->save()){\r\n return response()->json(['msg' => 'Updated change']);\r\n }else{\r\n return response('Oops, seems like something went wrong while trying to update reason');\r\n }\r\n }",
"public function listsChangereasonget()\r\n {\r\n $response = ChangeReason::all();\r\n return response()->json($response, 200);\r\n }",
"public static function getParticularReason($reason_id){\n return DB::table('table_absence_reasons')\n ->select('table_absence_reasons.reason_description')\n ->where(['table_absence_reasons.reason_id' => $reason_id])\n ->get();\n }",
"function GetReasons()\n\t{\n\t\t$result = $this->sendRequest(\"GetReasons\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}",
"public\n function getReason($id = null, $decision_maker = null)\n {\n $reason = HrInviteRefusingReason::where('id', $id)\n ->where('decision_maker', $decision_maker)->first();\n\n return $reason['reason'];\n }",
"public function get($changeId, $optParams = array()) {\n $params = array('changeId' => $changeId);\n $params = array_merge($params, $optParams);\n $data = $this->__call('get', array($params));\n if ($this->useObjects()) {\n return new Google_Change($data);\n } else {\n return $data;\n }\n }",
"public function getRiskImpactchanges($risk_id) \n\t{\n\t\t$sql = \"select * from t_risk_impact_change\n\t\t\t\twhere risk_id = ? and switch_flag='P' \";\n\t\t$par = array('uid' => $risk_id);\n\t\t\n\t\t$query = $this->db->query($sql, $par);\n\t\t$res = array();\n\t\tforeach($query->result_array() as $row) {\n\t\t\t$res[] = $row;\n\t\t}\n\t\t\n\t\treturn $res;\n\t}",
"public function getChangesByID($id)\n {\n return $this\n ->where('id_item', $id)\n ->get();\n }",
"public function getReasonId()\n {\n return $this->reason_id;\n }",
"function getChangeRequests($surferId) {\n $sql = \"SELECT surferchangerequest_data, surferchangerequest_type\n FROM %s\n WHERE surferchangerequest_surferid='%s'\n ORDER BY surferchangerequest_time DESC\";\n $params = array($this->tableChangeRequests, $surferId);\n $result = array();\n if ($res = $this->databaseQueryFmt($sql, $params)) {\n while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n if (!isset($result[ $row['surferchangerequest_type' ]])) {\n $result[ $row['surferchangerequest_type'] ] = $row['surferchangerequest_data'];\n }\n }\n return $result;\n }\n return FALSE;\n }",
"public function getActionPlanchanges($risk_id) \n\t{\n\t\t$sql = \"SELECT a.*,c.id AS id_ap,\n DATE_FORMAT(a.due_date, '%d-%m-%Y') AS due_date,\n DATE_FORMAT(a.due_date, '%d-%m-%Y') AS due_date_v,\n b.division_name AS division_v\n FROM t_risk_action_plan_change a\n JOIN m_division b ON a.division = b.division_id\n LEFT JOIN m_action_plan c ON a.`ap_code` = c.id AND a.`division` = c.`division`\n where a.risk_id = ? and switch_flag='P' \";\n\t\t$par = array('uid' => $risk_id);\n\t\t\n\t\t$query = $this->db->query($sql, $par);\n\t\t$res = array();\n\t\tforeach($query->result_array() as $row) {\n\t\t\t$res[] = $row;\n\t\t}\n\t\t\n\t\treturn $res;\n\t}",
"function getcancel_reasons_buyer() {\r\n\t\t// import the country DB\r\n\t\t$carriers = array();\r\n\t\tApp::import(\"Model\",\"Reason\");\r\n\t\t$this->Reason = &new Reason();\r\n\t\t$reasons = $this->Reason->find('list',array('conditions'=>array('Reason.status'=>'0'),'fields'=>array('Reason.id','Reason.title')));\r\n\t\treturn $reasons;\r\n\t}",
"public function getReasonId(): int\n {\n return $this->reasonId;\n }",
"function getrefund_reasons_seller() {\r\n\t\t// import the country DB\r\n\t\t$carriers = array();\r\n\t\tApp::import(\"Model\",\"Reason\");\r\n\t\t$this->Reason = &new Reason();\r\n\t\t$reasons = $this->Reason->find('list',array('conditions'=>array('Reason.status'=>'2'),'fields'=>array('Reason.id','Reason.title')));\r\n\t\treturn $reasons;\r\n\t}",
"public function getRejectedReasonsList($vendorId) {\n $connection = $this->resourceConnection->getConnection(ResourceConnection::DEFAULT_CONNECTION);\n $table = $connection->getTableName('bakeway_order_rejected_reasons');\n $query = 'SELECT reason_content FROM `' . $table . '` WHERE is_for_seller=1 AND is_active=1';\n $result = $connection->fetchAll($query);\n return json_decode(json_encode($result, false));\n }",
"public function get_reason_data()\n\t{\n\t\t// storing request (ie, get/post) global array to a variable\n\t\t$requestData= $_REQUEST;\n\t\t$reason=$this->home->getreasons($requestData,$where=null);\n\t\techo $reason;\n\t}",
"private function Get_ACH_Reason(&$data)\n\t{\n\n $sql = '-- /* SQL LOCATED IN file=' . __FILE__ . ' line=' . __LINE__ . ' method=' . __METHOD__ . \" */\n\t\t\tselect \n\t\t\t\trc.name as reason\n\t\t\tfrom \n\t\t\t\ttransaction_register tr\n\t\t\t\tJOIN ach ON (tr.ach_id = ach.ach_id)\n\t\t\t\tJOIN ach_return_code rc ON (rc.ach_return_code_id = ach.ach_return_code_id)\n\t\t\twhere \n\t\t\t\ttr.ach_id is not null \n\t\t\t\tand transaction_status = 'failed' \n\t\t\t\tand tr.application_id = {$data->application_id}\n\t\t\torder by tr.date_modified desc limit 1\n \t\";\n \t\n $data->reason_for_ach_return = array_pop($this->Get_LDB()->Get_Column($sql));\n\t\n\t}",
"public function getReasonIdentifier()\n {\n return $this->reasonIdentifier;\n }",
"function crmReasonToReadable($reasonId) {\n return Yourdelivery_Model_Crm_Ticket::getReasonAsText($reasonId);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set cookie file for current request | function setCookieFile( $path )
{
//Create directory if not exists
$dir = dirname($path);
if( !file_exists( $dir ) )
{
mkdir( $dir, 0755, true );
}
$this->_cookie_file_path = $path;
$this->setOptions(array(
CURLOPT_COOKIEFILE => $path,
CURLOPT_COOKIEJAR => $path
));
return $this;
} | [
"public function setCookiesFile( $file ) {\n\t\tcurl_setopt( $this->curl, CURLOPT_COOKIEFILE, $file );\n\t\tcurl_setopt( $this->curl, CURLOPT_COOKIEJAR, $file );\n\t}",
"public function setCookieFile($file = \"\")\n {\n $this->cookieFile = $file;\n return $this;\n }",
"public function setCookieJar($file)\n {\n $this->cookie_jar = $file;\n }",
"public function setCoookieFilePath()\n {\n $hash = md5($this->baseLocation . '-' . $this->login . '-' . $this->shopIdent);\n $this->cookieFilePath = $this->tmpDir . DIRECTORY_SEPARATOR . 'epoint_swisspost_cookie_' . $hash . '.txt';\n }",
"private static function setCookieJar(){\n\t\t\n\t\t// Create the file\n\t\t$cj = tempnam(\"/tmp\", \"cj\");\n\t\t$fh = fopen($cj, \"w+\"); fclose($fh);\n\t\t\n\t\t// Save the cookiejar file\n\t\tself::$cookiejar = $cj;\n\t\t\n\t\t// Validate the cookiejar\n\t\tif(!file_exists($cj)) die(\"Could not create cookiejar file.\");\n\t\tif(!is_readable($cj)) die(\"Cannot read cookiejar file.\");\n\t\tif(!is_writable($cj)) die(\"Cannot write to cookiejar file.\");\n\t\t\n\t\treturn;\n\t}",
"public function set()\n\t{\n\t\t$cookie = $this->_package();\n\t\tsetcookie($this->cookiename, $cookie, 0);\n\t\t//sfwLogger::log(\"sfwCookie: set() - all done!\", LOGGER_LEVEL_DEBUG);\n }",
"public function setCookieFilePath($cookiePath)\n {\n //Set the path of the cookie file as supplied\n $this->cookieFilePath = $cookiePath;\n //Set the cookie storing files\n //Cookie files are necessary since we are logging and session data needs to be saved\n curl_setopt($this->curlHandle, CURLOPT_COOKIEJAR, $this->cookieFilePath);\n curl_setopt($this->curlHandle, CURLOPT_COOKIEFILE, $this->cookieFilePath);\n\n }",
"public function setCookieFile($cookieFile)\n\t{\n\t\tcurl_setopt($this->ch, CURLOPT_COOKIEFILE, $cookieFile);\n\t}",
"public function SetoptCookie ($cookiefile = '') {\n\t\tif (!empty($cookiefile))\n\t\t\t$this->mCookiefile = $cookiefile;\n\t\t// /dev/null is useless cookie file, so does empty filename\n\t\tif (!empty($this->mCookiefile)\n\t\t\t&& ('/dev/null' != $this->mCookiefile)) {\n\t\t\tcurl_setopt($this->mSh, CURLOPT_COOKIEFILE, $this->mCookiefile);\n\t\t\tcurl_setopt($this->mSh, CURLOPT_COOKIEJAR, $this->mCookiefile);\n\t\t}\n\t}",
"public function set_auth_cookie()\n {\n $this->cookie = $this->_mkcookie($this->now);\n rcube_utils::setcookie($this->cookiename, $this->cookie, 0);\n $_COOKIE[$this->cookiename] = $this->cookie;\n }",
"function store_cookies($cookie_file)\n\t{\n\t\tcurl_setopt ($this->ch, CURLOPT_COOKIEJAR, $cookie_file);\n\t\tcurl_setopt ($this->ch, CURLOPT_COOKIEFILE, $cookie_file);\n\t}",
"function store_cookies($cookie_file)\n\t{\n\t\t// use cookies on each request (cookies stored in $cookie_file)\n\t\tcurl_setopt ($this->ch, CURLOPT_COOKIEJAR, $cookie_file);\n\t\tcurl_setopt ($this->ch, CURLOPT_COOKIEFILE, $cookie_file);\n\t}",
"public function setCookies() {\n\t\t\n\t\t}",
"protected function writeCookie()\n {\n // Create a cookie to send off\n $cookie = new Cookie(\n $this->context->name,\n $this->identity->getTokenString(),\n $this->identity->expires,\n $this->context->path);\n\n // Just store this away for now\n $this->cookieJar[] = $cookie;\n }",
"private function _set_cookie()\n\t{\t\t\n\t\t// Serialize the userdata for the cookie\n\t\t$cookie_data = serialize($this->userdata['user_data']);\n\t\t\n\t\t// Expiration time\n\t\t$expire = ($this->expire_on_close) ? 0 : $this->sess_expiration + time();\n\t\t\n\t\t// Set the cookie\n\t\tsetcookie(\n\t\t\t$this->cookie_name,\n\t\t\t$cookie_data,\n\t\t\t$expire,\n\t\t\t$this->cookie_path,\n\t\t\t$this->cookie_domain,\n\t\t);\n\t}",
"function setCookie($cookie);",
"private function setCookie() {\r\n\t\t$data = md5($this->id.'|'.$this->username.'|'.$this->created);\r\n\t\tsetcookie($this->cookieName, $data, time() + $this->cookieDuration, '/', '.'.$this->domain); // two week login cookie\r\n\t}",
"public function requestCookie(){\n $this->source = &$_COOKIE; //set the source to Cookie\n }",
"public function storeCookies($cookie_file)\n {\n // use cookies on each request (cookies stored in $cookie_file)\n curl_setopt($this->ch, CURLOPT_COOKIEJAR, $cookie_file);\n curl_setopt($this->ch, CURLOPT_COOKIEFILE, $cookie_file);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Regex callback for wp_kses_decode_entities() | function _wp_kses_decode_entities_chr( $match )
{
return chr( $match[ 1 ] );
} | [
"function _wp_kses_decode_entities_chr($matches)\n {\n }",
"function _wp_kses_decode_entities_chr( $match ) {\n return chr( $match[1] );\n}",
"function cmail_xss_entity_decode_callback($matches)\n{ \n return chr(hexdec($matches[1]));\n}",
"function wp_kses_decode_entities($string) {\n\t$string = preg_replace('/&#([0-9]+);/e', 'chr(\"\\\\1\")', $string);\n\t$string = preg_replace('/&#[Xx]([0-9A-Fa-f]+);/e', 'chr(hexdec(\"\\\\1\"))', $string);\n\n\treturn $string;\n}",
"function wp_kses_named_entities($matches)\n {\n }",
"function wp_kses_normalize_entities( $string )\n{\n // Disarm all entities by converting & to &\n $string = str_replace( '&', '&', $string );\n\n // Change back the allowed entities in our entity whitelist\n $string = preg_replace_callback( '/&([A-Za-z]{2,8}[0-9]{0,2});/', 'wp_kses_named_entities', $string );\n $string = preg_replace_callback( '/&#(0*[0-9]{1,7});/', 'wp_kses_normalize_entities2', $string );\n $string = preg_replace_callback( '/&#[Xx](0*[0-9A-Fa-f]{1,6});/', 'wp_kses_normalize_entities3', $string );\n\n return $string;\n}",
"function wp_kses_normalize_entities2( $matches )\n{\n if ( empty( $matches[ 1 ] ) ) {\n return '';\n }\n\n $i = $matches[ 1 ];\n if ( valid_unicode( $i ) ) {\n $i = str_pad( ltrim( $i, '0' ), 3, '0', STR_PAD_LEFT );\n $i = \"&#$i;\";\n }\n else {\n $i = \"&#$i;\";\n }\n\n return $i;\n}",
"function wp_kses_normalize_entities3($matches) {\n if ( empty($matches[1]) )\n return '';\n\n $hexchars = $matches[1];\n return ( ( ! valid_unicode(hexdec($hexchars)) ) ? \"&#x$hexchars;\" : '&#x'.ltrim($hexchars,'0').';' );\n}",
"function wp_kses_js_entities($string) {\n\treturn preg_replace('%&\\s*\\{[^}]*(\\}\\s*;?|$)%', '', $string);\n}",
"function wp_filter_kses($data) {\n\tglobal $allowedtags;\n\treturn addslashes( wp_kses(stripslashes( $data ), $allowedtags) );\n}",
"function maus_content_filter( $content ) {\n $content = html_entity_decode($content);\n // run your code on $content and\n return $content;\n}",
"public static function wp_kses_named_entities($matches) {\n $allowedentitynames = array(\n 'nbsp', 'iexcl', 'cent', 'pound', 'curren', 'yen',\n 'brvbar', 'sect', 'uml', 'copy', 'ordf', 'laquo',\n 'not', 'shy', 'reg', 'macr', 'deg', 'plusmn',\n 'acute', 'micro', 'para', 'middot', 'cedil', 'ordm',\n 'raquo', 'iquest', 'Agrave', 'Aacute', 'Acirc', 'Atilde',\n 'Auml', 'Aring', 'AElig', 'Ccedil', 'Egrave', 'Eacute',\n 'Ecirc', 'Euml', 'Igrave', 'Iacute', 'Icirc', 'Iuml',\n 'ETH', 'Ntilde', 'Ograve', 'Oacute', 'Ocirc', 'Otilde',\n 'Ouml', 'times', 'Oslash', 'Ugrave', 'Uacute', 'Ucirc',\n 'Uuml', 'Yacute', 'THORN', 'szlig', 'agrave', 'aacute',\n 'acirc', 'atilde', 'auml', 'aring', 'aelig', 'ccedil',\n 'egrave', 'eacute', 'ecirc', 'euml', 'igrave', 'iacute',\n 'icirc', 'iuml', 'eth', 'ntilde', 'ograve', 'oacute',\n 'ocirc', 'otilde', 'ouml', 'divide', 'oslash', 'ugrave',\n 'uacute', 'ucirc', 'uuml', 'yacute', 'thorn', 'yuml',\n 'quot', 'amp', 'lt', 'gt', 'apos', 'OElig',\n 'oelig', 'Scaron', 'scaron', 'Yuml', 'circ', 'tilde',\n 'ensp', 'emsp', 'thinsp', 'zwnj', 'zwj', 'lrm',\n 'rlm', 'ndash', 'mdash', 'lsquo', 'rsquo', 'sbquo',\n 'ldquo', 'rdquo', 'bdquo', 'dagger', 'Dagger', 'permil',\n 'lsaquo', 'rsaquo', 'euro', 'fnof', 'Alpha', 'Beta',\n 'Gamma', 'Delta', 'Epsilon', 'Zeta', 'Eta', 'Theta',\n 'Iota', 'Kappa', 'Lambda', 'Mu', 'Nu', 'Xi',\n 'Omicron', 'Pi', 'Rho', 'Sigma', 'Tau', 'Upsilon',\n 'Phi', 'Chi', 'Psi', 'Omega', 'alpha', 'beta',\n 'gamma', 'delta', 'epsilon', 'zeta', 'eta', 'theta',\n 'iota', 'kappa', 'lambda', 'mu', 'nu', 'xi',\n 'omicron', 'pi', 'rho', 'sigmaf', 'sigma', 'tau',\n 'upsilon', 'phi', 'chi', 'psi', 'omega', 'thetasym',\n 'upsih', 'piv', 'bull', 'hellip', 'prime', 'Prime',\n 'oline', 'frasl', 'weierp', 'image', 'real', 'trade',\n 'alefsym', 'larr', 'uarr', 'rarr', 'darr', 'harr',\n 'crarr', 'lArr', 'uArr', 'rArr', 'dArr', 'hArr',\n 'forall', 'part', 'exist', 'empty', 'nabla', 'isin',\n 'notin', 'ni', 'prod', 'sum', 'minus', 'lowast',\n 'radic', 'prop', 'infin', 'ang', 'and', 'or',\n 'cap', 'cup', 'int', 'sim', 'cong', 'asymp',\n 'ne', 'equiv', 'le', 'ge', 'sub', 'sup',\n 'nsub', 'sube', 'supe', 'oplus', 'otimes', 'perp',\n 'sdot', 'lceil', 'rceil', 'lfloor', 'rfloor', 'lang',\n 'rang', 'loz', 'spades', 'clubs', 'hearts', 'diams',\n 'sup1', 'sup2', 'sup3', 'frac14', 'frac12', 'frac34',\n 'there4',\n );\n\n if ( empty($matches[1]) )\n return '';\n\n $i = $matches[1];\n return ( ( ! in_array($i, $allowedentitynames) ) ? \"&$i;\" : \"&$i;\" );\n }",
"function mb_ereg_replace () {}",
"function tep_decode_specialchars($string)\n{\n $string = str_replace('>', '>', $string);\n $string = str_replace('<', '<', $string);\n $string = str_replace(''', \"'\", $string);\n $string = str_replace('"', \"\\\"\", $string);\n $string = str_replace('&', '&', $string);\n\n return $string;\n}",
"function scrub_out($string) {\n\n return htmlentities($string, ENT_QUOTES, Config::get('site_charset'));\n\n}",
"function wp_kses($string, $allowed_html, $allowed_protocols = array ('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet')) {\n\t$string = wp_kses_no_null($string);\n\t$string = wp_kses_js_entities($string);\n\t$string = wp_kses_normalize_entities($string);\n\t$allowed_html_fixed = wp_kses_array_lc($allowed_html);\n\t$string = wp_kses_hook($string, $allowed_html_fixed, $allowed_protocols); // WP changed the order of these funcs and added args to wp_kses_hook\n\treturn wp_kses_split($string, $allowed_html_fixed, $allowed_protocols);\n}",
"function textarea_filter($content) {\n\treturn apply_filters('the_content', htmlspecialchars_decode($content));\n}",
"function _wp_specialchars_decode($string, $quote_style = ENT_NOQUOTES)\n{\n $string = (string)$string;\n\n if (0 === strlen($string)) {\n return '';\n }\n\n // Don't bother if there are no entities - saves a lot of processing.\n if (strpos($string, '&') === false) {\n return $string;\n }\n\n // Match the previous behaviour of _wp_specialchars() when the $quote_style is not an accepted value.\n if (empty($quote_style)) {\n $quote_style = ENT_NOQUOTES;\n } elseif (!in_array($quote_style, array(0, 2, 3, 'single', 'double'), true)) {\n $quote_style = ENT_QUOTES;\n }\n\n // More complete than get_html_translation_table( HTML_SPECIALCHARS ).\n $single = array(\n ''' => '\\'',\n ''' => '\\'',\n );\n $single_preg = array(\n '/�*39;/' => ''',\n '/�*27;/i' => ''',\n );\n $double = array(\n '"' => '\"',\n '"' => '\"',\n '"' => '\"',\n );\n $double_preg = array(\n '/�*34;/' => '"',\n '/�*22;/i' => '"',\n );\n $others = array(\n '<' => '<',\n '<' => '<',\n '>' => '>',\n '>' => '>',\n '&' => '&',\n '&' => '&',\n '&' => '&',\n );\n $others_preg = array(\n '/�*60;/' => '<',\n '/�*62;/' => '>',\n '/�*38;/' => '&',\n '/�*26;/i' => '&',\n );\n\n if (ENT_QUOTES === $quote_style) {\n $translation = array_merge($single, $double, $others);\n $translation_preg = array_merge($single_preg, $double_preg, $others_preg);\n } elseif (ENT_COMPAT === $quote_style || 'double' === $quote_style) {\n $translation = array_merge($double, $others);\n $translation_preg = array_merge($double_preg, $others_preg);\n } elseif ('single' === $quote_style) {\n $translation = array_merge($single, $others);\n $translation_preg = array_merge($single_preg, $others_preg);\n } elseif (ENT_NOQUOTES === $quote_style) {\n $translation = $others;\n $translation_preg = $others_preg;\n }\n\n // Remove zero padding on numeric entities.\n $string = preg_replace(array_keys($translation_preg), array_values($translation_preg), $string);\n\n // Replace characters according to translation table.\n return strtr($string, $translation);\n}",
"public static function wp_kses_named_entities($matches) {\n\t\tif ( empty($matches[1]) )\n\t\t\treturn '';\n\n\t\t\t$allowedentitynames = array(\n\t\t\t\t'nbsp', 'iexcl', 'cent', 'pound', 'curren', 'yen',\n\t\t\t\t'brvbar', 'sect', 'uml', 'copy', 'ordf', 'laquo',\n\t\t\t\t'not', 'shy', 'reg', 'macr', 'deg', 'plusmn',\n\t\t\t\t'acute', 'micro', 'para', 'middot', 'cedil', 'ordm',\n\t\t\t\t'raquo', 'iquest', 'Agrave', 'Aacute', 'Acirc', 'Atilde',\n\t\t\t\t'Auml', 'Aring', 'AElig', 'Ccedil', 'Egrave', 'Eacute',\n\t\t\t\t'Ecirc', 'Euml', 'Igrave', 'Iacute', 'Icirc', 'Iuml',\n\t\t\t\t'ETH', 'Ntilde', 'Ograve', 'Oacute', 'Ocirc', 'Otilde',\n\t\t\t\t'Ouml', 'times', 'Oslash', 'Ugrave', 'Uacute', 'Ucirc',\n\t\t\t\t'Uuml', 'Yacute', 'THORN', 'szlig', 'agrave', 'aacute',\n\t\t\t\t'acirc', 'atilde', 'auml', 'aring', 'aelig', 'ccedil',\n\t\t\t\t'egrave', 'eacute', 'ecirc', 'euml', 'igrave', 'iacute',\n\t\t\t\t'icirc', 'iuml', 'eth', 'ntilde', 'ograve', 'oacute',\n\t\t\t\t'ocirc', 'otilde', 'ouml', 'divide', 'oslash', 'ugrave',\n\t\t\t\t'uacute', 'ucirc', 'uuml', 'yacute', 'thorn', 'yuml',\n\t\t\t\t'quot', 'amp', 'lt', 'gt', 'apos', 'OElig',\n\t\t\t\t'oelig', 'Scaron', 'scaron', 'Yuml', 'circ', 'tilde',\n\t\t\t\t'ensp', 'emsp', 'thinsp', 'zwnj', 'zwj', 'lrm',\n\t\t\t\t'rlm', 'ndash', 'mdash', 'lsquo', 'rsquo', 'sbquo',\n\t\t\t\t'ldquo', 'rdquo', 'bdquo', 'dagger', 'Dagger', 'permil',\n\t\t\t\t'lsaquo', 'rsaquo', 'euro', 'fnof', 'Alpha', 'Beta',\n\t\t\t\t'Gamma', 'Delta', 'Epsilon', 'Zeta', 'Eta', 'Theta',\n\t\t\t\t'Iota', 'Kappa', 'Lambda', 'Mu', 'Nu', 'Xi',\n\t\t\t\t'Omicron', 'Pi', 'Rho', 'Sigma', 'Tau', 'Upsilon',\n\t\t\t\t'Phi', 'Chi', 'Psi', 'Omega', 'alpha', 'beta',\n\t\t\t\t'gamma', 'delta', 'epsilon', 'zeta', 'eta', 'theta',\n\t\t\t\t'iota', 'kappa', 'lambda', 'mu', 'nu', 'xi',\n\t\t\t\t'omicron', 'pi', 'rho', 'sigmaf', 'sigma', 'tau',\n\t\t\t\t'upsilon', 'phi', 'chi', 'psi', 'omega', 'thetasym',\n\t\t\t\t'upsih', 'piv', 'bull', 'hellip', 'prime', 'Prime',\n\t\t\t\t'oline', 'frasl', 'weierp', 'image', 'real', 'trade',\n\t\t\t\t'alefsym', 'larr', 'uarr', 'rarr', 'darr', 'harr',\n\t\t\t\t'crarr', 'lArr', 'uArr', 'rArr', 'dArr', 'hArr',\n\t\t\t\t'forall', 'part', 'exist', 'empty', 'nabla', 'isin',\n\t\t\t\t'notin', 'ni', 'prod', 'sum', 'minus', 'lowast',\n\t\t\t\t'radic', 'prop', 'infin', 'ang', 'and', 'or',\n\t\t\t\t'cap', 'cup', 'int', 'sim', 'cong', 'asymp',\n\t\t\t\t'ne', 'equiv', 'le', 'ge', 'sub', 'sup',\n\t\t\t\t'nsub', 'sube', 'supe', 'oplus', 'otimes', 'perp',\n\t\t\t\t'sdot', 'lceil', 'rceil', 'lfloor', 'rfloor', 'lang',\n\t\t\t\t'rang', 'loz', 'spades', 'clubs', 'hearts', 'diams',\n\t\t\t\t'sup1', 'sup2', 'sup3', 'frac14', 'frac12', 'frac34',\n\t\t\t\t'there4',\n\t\t\t);\n\n\t\t$i = $matches[1];\n\t\treturn ( ! in_array( $i, $allowedentitynames ) ) ? \"&$i;\" : \"&$i;\";\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Read all product based on product ids included in the $ids variable | public function readByIds($ids)
{
// str_repeat repeating ? how much gets id and then subtraction -1.
$ids_arr = str_repeat('?,', count($ids) - 1) . '?';
// query to select products
$query = <<<SQL
SELECT id, name, price, img_url FROM . $this->table_name . WHERE id IN ({$ids_arr}) ORDER BY name;
SQL;
// $query = "SELECT id, name, price, img_url FROM " . $this->table_name . " WHERE id IN ({$ids_arr}) ORDER BY name";
$stmt = $this->conn->prepare($query);
// execute query
$stmt->execute($ids);
// return values from database
return $stmt;
} | [
"public function readByIds($ids){\r\n \r\n\t $ids_arr = str_repeat('?,', count($ids) - 1) . '?';\r\n\t \r\n\t // query to select products\r\n\t $query = \"SELECT id, name, price FROM \" . $this->table_name . \" WHERE id IN ({$ids_arr}) ORDER BY name\";\r\n\t $stmt = $this->conn->prepare($query);\r\n\t \r\n // execute query\r\n\t $stmt->execute($ids);\r\n\t \r\n // return values from database\r\n\t return $stmt;\r\n\t}",
"function readByIds($ids){\r\n\r\n\t$ids_arr = str_repeat('?,', count($ids) - 1) . '?';\r\n\r\n\t// query to select products\r\n\t$query = \"SELECT id, name, price FROM \" . $this->table_name . \" WHERE id IN ({$ids_arr}) ORDER BY name\";\r\n\r\n\t// prepare query statement\r\n\t$stmt = $this->conn->prepare($query);\r\n\r\n\t// execute query\r\n\t$stmt->execute($ids);\r\n\r\n\t// return values from database\r\n\treturn $stmt;\r\n}",
"public function get_product_data_by_ids($ids, $fields = null) {\n # if $ids is integer, transfer to Array\n if (!is_array($ids)) {\n $ids = array(intval($ids));\n }\n\n $msg = new xmlrpcmsg('execute');\n $msg->addParam(new xmlrpcval($this->dbname, \"string\"));\n $msg->addParam(new xmlrpcval($this->uid, \"int\"));\n $msg->addParam(new xmlrpcval($this->password, \"string\"));\n\n $msg->addParam(new xmlrpcval('product.product', \"string\"));\n $msg->addParam(new xmlrpcval('read', \"string\"));\n\n # product ids\n //$ids = array(25);\n $msg->addParam($this->_format($ids));\n\n # fields\n if (empty($fields)) {\n $msg->addParam(new xmlrpcval(null, \"null\"));\n } else {\n //$fields = array('name', 'code', 'product_brand_id', 'list_price', 'image', 'image_medium', 'image_small', 'description', 'weight', 'qty_available', 'sale_ok');\n //$fields = array('warranty', 'ean13', 'supply_method', 'uos_id', 'list_price', 'seller_info_id', 'weight', 'track_production', 'color', 'incoming_qty', 'image', 'standard_price', 'cost_method', 'price_extra', 'mes_type', 'uom_id', 'code', 'description_purchase', 'default_code', 'name_template', 'property_account_income', 'lst_price', 'price', 'location_id', 'id', 'message_summary', 'uos_coeff', 'delivery_count', 'procure_method', 'sale_ok', 'message_follower_ids', 'qty_available', 'categ_id', 'product_manager', 'property_stock_account_output', 'track_outgoing', 'company_id', 'message_ids', 'product_tmpl_id', 'state', 'message_is_follower', 'loc_rack', 'uom_po_id', 'pricelist_id', 'price_margin', 'property_stock_account_input', 'virtual_available', 'description', 'reception_count', 'track_incoming', 'property_stock_production', 'seller_qty', 'supplier_taxes_id', 'volume', 'sale_delay', 'loc_row', 'seller_delay', 'warehouse_id', 'description_sale', 'active', 'property_stock_inventory', 'variants', 'partner_ref', 'valuation', 'loc_case', 'weight_net', 'packaging', 'seller_id', 'name', 'type', 'property_account_expense', 'orderpoint_ids', 'property_stock_procurement', 'outgoing_qty', 'taxes_id', 'produce_delay', 'seller_ids', 'rental', 'message_unread');\n $msg->addParam($this->_format($fields));\n }\n\n $context= array(\n 'lang' => 'zh_CN',\n 'bin_size' => false,\n 'tz' => 'Asiz/Shanghai',\n 'uid' => $this->uid,\n );\n $msg->addParam($this->_format($context));\n\n $resp = $this->sock->send($msg);\n $val = $resp->value();\n $data = $this->_parse($val);\n return $data;\n }",
"public function readByIds($ids)\n {\n $ids_arr = str_repeat('?,', count($ids) - 1) . '?';\n \n // query to select items\n $sql = \"SELECT menu_id, menu_name, menu_price FROM \" . $this->table_name . \" WHERE menu_id IN ({$ids_arr}) ORDER BY menu_name\";\n \n // prepare query statement\n $stmt = $this->conn->prepare($sql);\n \n // execute query\n $stmt->execute($ids);\n \n // return values from database\n return $stmt;\n }",
"public function readAllProducts(){\r\n $sql = 'SELECT * FROM products';\r\n $param = array();\r\n include_once __DIR__.'/../objects/Product.php';\r\n return $this->crud->readMultiRows($sql, $param, 'product_id', 'Product');\r\n }",
"public function productIDs() {\n // Get all ID's from all products and returns it\n $db = new db();\n $sql = \"SELECT idProduct FROM Product WHERE status=1\";\n $input = array();\n\n return($db->readData($sql, $input));\n }",
"public function loadMultiple(array $ids = []);",
"public function getByIds($ids);",
"public function getProductsItems($orderIds) {\r\n // $result = $this->connection->query(\"\r\n // SELECT p.id, op.order_id, p.product_name, op.product_count, op.product_price, op.product_price_without_vat, op.product_purchase_price, p.category_id\r\n // FROM your_products_table as p\r\n // JOIN yout_order_products_table as op ON (p.id = op.product_id)\r\n // WHERE op.order_id IN ('\". implode(\"', '\", $orderIds).\"')\r\n // \");\r\n \r\n $result = array(\r\n array(\r\n 'id' => \"1\",\r\n 'order_id' => \"1\",\r\n 'product_name' => \"Example product name\",\r\n 'product_count' => 2,\r\n 'product_price' => 500.0,\r\n 'product_price_without_vat' => 400.0,\r\n 'product_purchase_price' => 500.0,\r\n 'category_id' => \"2\"\r\n )\r\n );\r\n return $result;\r\n }",
"public function getProductsById($id) {\n }",
"public function updateSpecificProductIds($ids);",
"public function mGet($ids);",
"private function showProductsById()\n { \n $productNum1 = $this->productDao->getById(1);\n $productNum9 = $this->productDao->getById(9);\n \n echo PHP_EOL;\n echo 'Product with id 1: ' . PHP_EOL; print_r($productNum1);\n echo 'Product with id 9: ' . PHP_EOL; print_r($productNum9);\n }",
"protected function set_product_ids() {\n\n\t\t// get the products selected for the report\n\t\t$this->product_ids = isset( $_GET['product_ids'] ) ? array_filter( array_map( 'absint', (array) $_GET['product_ids'] ) ) : array();\n\t}",
"public function getListOfProdsByIds($ids)\n {\n $ProductsArr = Product::whereIn('id', $ids)->get();\n\n return $ProductsArr;\n }",
"function release_load_multiple(array $ids) {\n return entity_load('release', $ids);\n}",
"public function getRelatedProducts($id);",
"public function get_all_prod_by_id() {\r\n global $database;\r\n $query = $database->query(\"SELECT * FROM products WHERE product_id = '{$this->product_id}'\");\r\n return $query;\r\n }",
"public function getProductById($id);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
echo 'A venda do produto '. $produto .' na data '. $data .' com a quantidade de '. $quantidade .' possui um valor cada de '. $valorTotal; | public function exibirVenda()
{
return 'A venda do produto '. $this->produto .' na data '. $this->data .' com a quantidade de '. $this->quantidade .' possui um valor cada de '. $this->valorTotal;
} | [
"function valorTotalVenda($idvenda, $frete, $porConta, $idtipoprofissional){\n $SqlValor = \"SELECT valor FROM t_valor_profissional WHERE idtipoprofissional = $idtipoprofissional\";\n $resultValor = parent::Execute($SqlValor);\n $rsValor = parent::ArrayData($resultValor);\n $Sql = \"SELECT * FROM t_vendas_produtos V \n INNER JOIN t_produtos P ON P.idproduto = V.idproduto \n WHERE V.idvenda = $idvenda\";\n $result = parent::Execute($Sql);\n while($rs = parent::ArrayData($result)){\n $produtos += ($rs[$rsValor['valor']] - $rs['desconto']) * $rs['quantidade'];\n }\n if($porConta == 1){\n $produtos -= $frete;\n }\n return \"R$ \" . number_format($produtos, 2, ',', '.');\n }",
"function pintar($carrito){\r\n echo(\"<br/><table class='table table-striped'>\");\r\n $total = 0;\r\n foreach($carrito as $compra){\r\n echo(\"<tr>\");\r\n $total += $compra[\"precio\"];\r\n foreach($compra as $value => $val){\r\n echo(\"<th>$value</th>\");\r\n echo(\"<td>$val</td>\");\r\n }\r\n \r\n echo(\"</tr>\");\r\n }\r\n echo(\"<tr>\");\r\n echo \"<td></td>\";\r\n echo \"<td></td>\";\r\n echo \"<td></td>\";\r\n echo \"<td></td>\";\r\n echo (\"<th>Precio Total</th>\");\r\n echo (\"<td>\".$total.\"</td>\");\r\n echo (\"<th>Precio+IVA</th>\");\r\n echo (\"<td>\". subtotal($carrito).\"</td>\");\r\n echo(\"</tr>\");\r\n echo(\"</table>\");\r\n }",
"private function costoTot(){\n if ($this->disponibile == 'Disponibile'){\n return $this->prezzo_unitario * $this->quantita;\n } else{\n return 'Prezzo totale non disponibile';\n }\n }",
"public function gerencial_valorInventario(){\n\t\t\n\t\t$resultado = 0;\n\t\t\n\t\t$query = \"SELECT cantidad, idProducto\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t tb_productos_sucursal\";\n\t\t\n\t\t\n\t\t$conexion = parent::conexionCliente();\n\t\t\n \tif($res = $conexion->query($query)){\n \n /* obtener un array asociativo */\n while ($filas = $res->fetch_assoc()) {\n \t\n\t\t\t\t$idproducto = $filas['idProducto'];\n\t\t\t\t$cantidad\t= $filas['cantidad']; \n\t\t\t\t\n\t\t\t\t$query2 = \"SELECT precio \n\t\t\t\t\t\t\tFROM tb_productos WHERE idProducto = '$idproducto'\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif($res2 = $conexion->query($query2)){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t while ($filas2 = $res2->fetch_assoc()) {\n\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t\t$precio = str_replace('.', '',$filas2['precio']);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$subtotal = $precio * $cantidad;\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t $resultado = $resultado + $subtotal;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t }\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\n } \n \n }//fin if\n\t\t\n return $resultado;\t\n\t\t\n\t}",
"public function parcela(){\n $desconto = $this->precoTotal / 10;\n return $desconto;\n }",
"public function totaliza_pedido()\r\n {\r\n\r\n $this->mgt_nota_fiscal_valor_produtos->Text = '0.00';\r\n $this->mgt_nota_fiscal_valor_ipi->Text = '0.00';\r\n $this->mgt_nota_fiscal_valor_produtos->Text = '0.00';\r\n\r\n $valor_desconto = 0;\r\n $valor_pedido = 0;\r\n $valor_ipi = 0;\r\n $valor_total = 0;\r\n $desconto = $this->mgt_nota_fiscal_cliente_desconto->Text;\r\n $frete = $this->mgt_nota_fiscal_valor_frete->Text;\r\n\r\n if($desconto < 0)\r\n {\r\n $desconto = 0;\r\n }\r\n\r\n if($frete < 0)\r\n {\r\n $frete = 0;\r\n }\r\n\r\n $Comando_SQL = \"select * from mgt_notas_entradas_produtos where mgt_nota_entrada_produto_numero_nota = \" . trim($this->mgt_nota_fiscal_faturamento->Text) . \" order by mgt_nota_entrada_produto_numero\";\r\n\r\n GetConexaoPrincipal()->SQL_MGT_Notas_Entradas_Produtos->Close();\r\n GetConexaoPrincipal()->SQL_MGT_Notas_Entradas_Produtos->SQL = $Comando_SQL;\r\n GetConexaoPrincipal()->SQL_MGT_Notas_Entradas_Produtos->Open();\r\n\r\n if((GetConexaoPrincipal()->SQL_MGT_Notas_Entradas_Produtos->EOF) != 1)\r\n {\r\n while((GetConexaoPrincipal()->SQL_MGT_Notas_Entradas_Produtos->EOF) != 1)\r\n {\r\n $valor_ipi = $valor_ipi + GetConexaoPrincipal()->SQL_MGT_Notas_Entradas_Produtos->Fields['mgt_nota_entrada_produto_valor_ipi'];\r\n $valor_pedido = $valor_pedido + GetConexaoPrincipal()->SQL_MGT_Notas_Entradas_Produtos->Fields['mgt_nota_entrada_produto_valor_total'];\r\n\r\n GetConexaoPrincipal()->SQL_MGT_Notas_Entradas_Produtos->Next();\r\n }\r\n }\r\n\r\n if($desconto > 0)\r\n {\r\n $valor_desconto = (($valor_pedido * $desconto) / 100);\r\n }\r\n else\r\n {\r\n $valor_desconto = 0;\r\n }\r\n\r\n $valor_total = ((($valor_pedido + $valor_ipi) + $frete) - $valor_desconto);\r\n\r\n $this->mgt_nota_fiscal_valor_produtos->Text = number_format($valor_pedido, \"2\", \".\", \"\");\r\n $this->mgt_nota_fiscal_valor_ipi->Text = number_format($valor_ipi, \"2\", \".\", \"\");\r\n $this->mgt_nota_fiscal_valor_produtos->Text = number_format($valor_total, \"2\", \".\", \"\");\r\n }",
"public function totaliza_pedido()\r\n {\r\n\r\n $valor_desconto = 0;\r\n $valor_pedido = 0;\r\n $valor_ipi = 0;\r\n $valor_total = 0;\r\n $desconto = $this->mgt_pedido_cliente_desconto->Text;\r\n $frete = $this->mgt_pedido_valor_frete->Text;\r\n\r\n if($desconto < 0)\r\n {\r\n $desconto = 0;\r\n }\r\n\r\n if($frete < 0)\r\n {\r\n $frete = 0;\r\n }\r\n\r\n $this->mgt_pedido_valor_desconto->Text = '0.00';\r\n $this->mgt_pedido_valor_pedido->Text = '0.00';\r\n $this->mgt_pedido_valor_ipi->Text = '0.00';\r\n $this->mgt_pedido_valor_total->Text = '0.00';\r\n\r\n $Comando_SQL = \"select * from mgt_pedidos_produtos where mgt_pedido_produto_numero_pedido = \" . trim($this->mgt_pedido_numero->Text) . \" order by mgt_pedido_produto_numero\";\r\n\r\n GetConexaoPrincipal()->SQL_MGT_Pedidos_Produtos->Close();\r\n GetConexaoPrincipal()->SQL_MGT_Pedidos_Produtos->SQL = $Comando_SQL;\r\n GetConexaoPrincipal()->SQL_MGT_Pedidos_Produtos->Open();\r\n\r\n if((GetConexaoPrincipal()->SQL_MGT_Pedidos_Produtos->EOF) != 1)\r\n {\r\n while((GetConexaoPrincipal()->SQL_MGT_Pedidos_Produtos->EOF) != 1)\r\n {\r\n $valor_ipi = $valor_ipi + GetConexaoPrincipal()->SQL_MGT_Pedidos_Produtos->Fields['mgt_pedido_produto_valor_ipi'];\r\n $valor_pedido = $valor_pedido + GetConexaoPrincipal()->SQL_MGT_Pedidos_Produtos->Fields['mgt_pedido_produto_valor_total'];\r\n\r\n GetConexaoPrincipal()->SQL_MGT_Pedidos_Produtos->Next();\r\n }\r\n }\r\n\r\n if($desconto > 0)\r\n {\r\n $valor_desconto = (($valor_pedido * $desconto) / 100);\r\n }\r\n else\r\n {\r\n $valor_desconto = 0;\r\n }\r\n\r\n $valor_total = ((($valor_pedido + $valor_ipi) + $frete) - $valor_desconto);\r\n\r\n $this->mgt_pedido_valor_desconto->Text = number_format($valor_desconto, \"2\", \".\", \"\");\r\n $this->mgt_pedido_valor_pedido->Text = number_format($valor_pedido, \"2\", \".\", \"\");\r\n $this->mgt_pedido_valor_ipi->Text = number_format($valor_ipi, \"2\", \".\", \"\");\r\n $this->mgt_pedido_valor_total->Text = number_format($valor_total, \"2\", \".\", \"\");\r\n }",
"function totalCalc($precio, $descuento)\n{\n $total = finalPrice($precio, $descuento);\n return $precio . '-' . $total;\n}",
"public function totaliza_pedido()\r\n {\r\n\r\n $valor_desconto = 0;\r\n $valor_pedido = 0;\r\n $valor_ipi = 0;\r\n $valor_total = 0;\r\n $desconto = $this->mgt_pedido_cliente_desconto->Text;\r\n $frete = $this->mgt_pedido_valor_frete->Text;\r\n\r\n if($desconto < 0)\r\n {\r\n $desconto = 0;\r\n }\r\n\r\n if($frete < 0)\r\n {\r\n $frete = 0;\r\n }\r\n\r\n $this->mgt_pedido_valor_desconto->Text = '0.00';\r\n $this->mgt_pedido_valor_pedido->Text = '0.00';\r\n $this->mgt_pedido_valor_ipi->Text = '0.00';\r\n $this->mgt_pedido_valor_total->Text = '0.00';\r\n\r\n $Comando_SQL = \"select * from mgt_cotacoes_produtos where mgt_cotacao_produto_numero_cotacao = '\" . trim($this->mgt_pedido_numero->Text) . \"' order by mgt_cotacao_produto_numero\";\r\n\r\n GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Close();\r\n GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->SQL = $Comando_SQL;\r\n GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Open();\r\n\r\n if((GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->EOF) != 1)\r\n {\r\n while((GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->EOF) != 1)\r\n {\r\n $valor_ipi = $valor_ipi + GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Fields['mgt_cotacao_produto_valor_ipi'];\r\n $valor_pedido = $valor_pedido + GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Fields['mgt_cotacao_produto_valor_total'];\r\n\r\n GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Next();\r\n }\r\n }\r\n\r\n if($desconto > 0)\r\n {\r\n $valor_desconto = (($valor_pedido * $desconto) / 100);\r\n }\r\n else\r\n {\r\n $valor_desconto = 0;\r\n }\r\n\r\n $valor_total = ((($valor_pedido + $valor_ipi) + $frete) - $valor_desconto);\r\n\r\n $this->mgt_pedido_valor_desconto->Text = number_format($valor_desconto, \"2\", \".\", \"\");\r\n $this->mgt_pedido_valor_pedido->Text = number_format($valor_pedido, \"2\", \".\", \"\");\r\n $this->mgt_pedido_valor_ipi->Text = number_format($valor_ipi, \"2\", \".\", \"\");\r\n $this->mgt_pedido_valor_total->Text = number_format($valor_total, \"2\", \".\", \"\");\r\n }",
"private function total()\n \t{\n // Obteniendo el precio total de los productos de la sesión.\n \t\t$prodCanasta = \\Session::get('prodCanasta');\n \t\t$total = 0;\n // Sumando el precio de cada producto.\n \t\tforeach ($prodCanasta as $item) {\n \t\t\t$total += $item->precio * $item->cantidad;\n \t\t}\n \t\treturn $total;\n \t}",
"function Incrementa($valor){\r\n $this->quantidade += $valor;\r\n echo 'Novo valor de quantidade: ' . $this->quantidade . '<br>';\r\n }",
"function mostrarProductos($usuario) {\r\n global $conexion;\r\n\r\n $sql = \"SELECT nom_producto, precio, imagen, cesta.cantidad FROM productos\r\n INNER JOIN cesta ON productos.id_prod = cesta.id_prod\r\n WHERE id_usuario = '\".$usuario.\"';\";\r\n\r\n $resultado = $conexion->query($sql);\r\n\r\n $total = 0;\r\n\r\n if($resultado->num_rows > 0) {\r\n while($registro = $resultado->fetch_object()) {\r\n $totalCantidad = $registro->precio * $registro->cantidad;\r\n echo \"<tr><td>\" . $registro->nom_producto . \"</td>\";\r\n echo \"<td>\" . number_format($registro->precio, 2, \",\", \".\" ) . \" €</td>\";\r\n echo \"<td><img src='\" . $registro->imagen . \"'></td>\";\r\n echo \"<td>\" . $registro->cantidad . \"</td>\";\r\n echo \"<td>\" . number_format($totalCantidad, 2, \",\", \".\") . \" €</td></tr>\";\r\n $total += floatval($registro->precio) * $registro->cantidad;\r\n }\r\n $resultado->close();\r\n echo \"<tr><td colspan='4'> TOTAL: </td>\";\r\n echo \"<td>\" . number_format($total, 2, \",\", \".\") . \" €</td></tr>\";\r\n }\r\n $conexion->close();\r\n }",
"function texto_total($cadena='',$cadena2='',$pos=15,$tam=0,$alinea=\"L\",$borde=0,$fillColor=0,$tfuente=8,$estilo=\"\"){\n\t\t$this->textoTotales=array('pos'=>$pos,'ancho'=>$tam,'texto'=>$cadena,'texto2'=>$cadena2,\n\t\t\t\t\t\t\t\t'borde'=>$borde,'alinea'=>$alinea,'relleno'=>$fillColor,\n\t\t\t\t\t\t\t\t'tfuente'=>$tfuente,'estilo'=>$estilo);\n\t}",
"function tampilUang($total){\n $totalAkhir = 0;\n $totalNominal = 0;\n foreach($total as $nominal => $jumlah){\n $totalNominal = $nominal * $jumlah;\n echo \"<br>Nominal Rp. $nominal sebanyak $jumlah lembar.\";\n $totalAkhir += $totalNominal;\n }\n echo \"<br>Total uang sekarang adalah <b>Rp. $totalAkhir</b>\";\n }",
"public function actionGenerarTotal() {\n \tif (isset(Yii::app()->session['Articulo'])) {\n $arrArticulos = Yii::app()->session['Articulo'];\n\t\t\t\n \t\t }\n \t\t $Total=0;\n \tfor ($i=0; $i <count($arrArticulos) ; $i++) { \n \t\t$Total=$Total+($arrArticulos[$i][2]*$arrArticulos[$i][1]);\n \t} \n echo $Total;\n }",
"public function formattedTotal(): string;",
"function price_and_name($productName, $productPrice, $userName, $userGroup , $group) {\n return 'Product : ' . $productName . ', Price : ' . $productPrice . '€' . '<br>'. 'Bought by :'. ' ' . $userName . ' ' . 'Group from : ' . $userGroup . '<br>' . 'Price to pay with reduction' . ' ' . priceDid($productPrice , $userGroup , $group) . '€';\n}",
"public function getCostoTotalItem()\n\t{\n\t\tif (!isset($_POST['cantidad'], $_POST['clave'], $_POST['idCosto']))\n\t\t{\n\t\t\t$this->json = \"\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$evento = $this->model->getEvento($this->sess->get('id_evento'));\n\t\t\t$clave = $_POST['clave'];\n\t\t\t$idCosto = $_POST['idCosto'];\n\t\t\t$cantidad = $_POST['cantidad'];\n\n\t\t\t$costo = $this->evt->getCostoItem($clave, $idCosto, $evento->evt_idEvento);\n\n\t\t\tif (empty($cantidad) || empty($clave) || empty($idCosto))\n\t\t\t{\n\t\t\t\t$this->json = \"\";\n\t\t\t}\n\t\t\telse if (is_numeric($cantidad))\n\t\t\t{\n\t\t\t\t$total = $costo->costo * $cantidad;\n\t\t\t\t$this->json = $this->func->moneda2screen($total);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->json = \"\";\n\t\t\t}\n\t\t}\n\n\t\techo $this->json;\n\t}",
"function variancia(){\n if(isset($_SESSION['totalelementos']) && isset($_SESSION['totalelementos'])){\n $xx2 = $_SESSION['xx2'];\n $i = $_SESSION['totalelementos'];\n //algum bug ele esta pegando metade do valor\n \n echo \"<div class='alert alert-warning' role='alert'>\n verificar tabela para ver os Valores de X no calculo\n </div>\";\n echo \"<p>S<sup>2</sup> = \", $xx2,\" / ( \", $i ,\" - 1)</p>\";\n $variancia = $xx2/ ($i-1);\n echo \"<p>S<sup>2</sup> = $variancia </p>\";\n $_SESSION['variancia'] = $variancia;\n \n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
normal: test nested transactions | public function test1()
{
try
{
$this->db->beginTransaction();
$this->db->beginTransaction();
$this->db->commit();
$this->db->beginTransaction();
$this->db->commit();
$this->db->commit();
}
catch ( ezcDbTransactionException $e )
{
$this->fail( "Exception (" . get_class( $e ) . ") caught: " . $e->getMessage() );
}
} | [
"public function testTransactionNested() {\n\t\t$conn = $this->getMock('MockPDO');\n\t\t$db = new DboTestSource();\n\t\t$db->setConnection($conn);\n\t\t$db->useNestedTransactions = true;\n\t\t$db->nestedSupport = true;\n\n\t\t$conn->expects($this->at(0))->method('beginTransaction')->will($this->returnValue(true));\n\t\t$conn->expects($this->at(1))->method('exec')->with($this->equalTo('SAVEPOINT LEVEL1'))->will($this->returnValue(true));\n\t\t$conn->expects($this->at(2))->method('exec')->with($this->equalTo('RELEASE SAVEPOINT LEVEL1'))->will($this->returnValue(true));\n\t\t$conn->expects($this->at(3))->method('exec')->with($this->equalTo('SAVEPOINT LEVEL1'))->will($this->returnValue(true));\n\t\t$conn->expects($this->at(4))->method('exec')->with($this->equalTo('ROLLBACK TO SAVEPOINT LEVEL1'))->will($this->returnValue(true));\n\t\t$conn->expects($this->at(5))->method('commit')->will($this->returnValue(true));\n\n\t\t$this->_runTransactions($db);\n\t}",
"public function testTransactionNested() {\n\t\t$conn = $this->getMock ( 'MockPDO' );\n\t\t$db = new DboTestSource ();\n\t\t$db->setConnection ( $conn );\n\t\t$db->useNestedTransactions = true;\n\t\t$db->nestedSupport = true;\n\t\t\n\t\t$conn->expects ( $this->at ( 0 ) )->method ( 'beginTransaction' )->will ( $this->returnValue ( true ) );\n\t\t$conn->expects ( $this->at ( 1 ) )->method ( 'exec' )->with ( $this->equalTo ( 'SAVEPOINT LEVEL1' ) )->will ( $this->returnValue ( true ) );\n\t\t$conn->expects ( $this->at ( 2 ) )->method ( 'exec' )->with ( $this->equalTo ( 'RELEASE SAVEPOINT LEVEL1' ) )->will ( $this->returnValue ( true ) );\n\t\t$conn->expects ( $this->at ( 3 ) )->method ( 'exec' )->with ( $this->equalTo ( 'SAVEPOINT LEVEL1' ) )->will ( $this->returnValue ( true ) );\n\t\t$conn->expects ( $this->at ( 4 ) )->method ( 'exec' )->with ( $this->equalTo ( 'ROLLBACK TO SAVEPOINT LEVEL1' ) )->will ( $this->returnValue ( true ) );\n\t\t$conn->expects ( $this->at ( 5 ) )->method ( 'commit' )->will ( $this->returnValue ( true ) );\n\t\t\n\t\t$this->_runTransactions ( $db );\n\t}",
"public function testVirtualNestedTransaction(): void\n {\n //starting 3 virtual transaction\n $this->connection->begin();\n $this->connection->begin();\n $this->connection->begin();\n $this->assertTrue($this->connection->getDriver()->inTransaction());\n\n $this->connection->delete('things', ['id' => 1]);\n $result = $this->connection->execute('SELECT * FROM things');\n $this->assertCount(1, $result->fetchAll());\n\n $this->connection->commit();\n $this->assertTrue($this->connection->getDriver()->inTransaction());\n $this->connection->rollback();\n $this->assertFalse($this->connection->getDriver()->inTransaction());\n\n $result = $this->connection->execute('SELECT * FROM things');\n $this->assertCount(2, $result->fetchAll());\n }",
"public function testVirtualNestedTransaction3(): void\n {\n //starting 3 virtual transaction\n $this->connection->begin();\n $this->connection->begin();\n $this->connection->begin();\n\n $this->connection->delete('things', ['id' => 1]);\n $result = $this->connection->execute('SELECT * FROM things');\n $this->assertCount(1, $result->fetchAll());\n $this->connection->commit();\n $this->connection->commit();\n $this->connection->commit();\n\n $result = $this->connection->execute('SELECT * FROM things');\n $this->assertCount(1, $result->fetchAll());\n }",
"public function testTransactionNestedDisabled() {\n\t\t$conn = $this->getMock('MockPDO');\n\t\t$db = new DboTestSource();\n\t\t$db->setConnection($conn);\n\t\t$db->useNestedTransactions = false;\n\t\t$db->nestedSupport = true;\n\n\t\t$conn->expects($this->once())->method('beginTransaction')->will($this->returnValue(true));\n\t\t$conn->expects($this->never())->method('exec');\n\t\t$conn->expects($this->once())->method('commit')->will($this->returnValue(true));\n\n\t\t$this->_runTransactions($db);\n\t}",
"public function testNestedTransactionRollbackExceptionNotThrown(): void\n {\n $this->connection->transactional(function () {\n $this->connection->transactional(function () {\n return true;\n });\n\n return true;\n });\n $this->assertFalse($this->connection->inTransaction());\n\n $this->connection->transactional(function () {\n $this->connection->transactional(function () {\n return true;\n });\n\n return false;\n });\n $this->assertFalse($this->connection->inTransaction());\n\n $this->connection->transactional(function () {\n $this->connection->transactional(function () {\n return false;\n });\n\n return false;\n });\n $this->assertFalse($this->connection->inTransaction());\n }",
"public function testAdjustTransaction()\n {\n }",
"public function testTransaction2()\n {\n }",
"public function testCommittedTransaction() {\n try {\n // Create two nested transactions. The changes should be committed.\n $this->transactionOuterLayer('A');\n\n // Because we committed, both of the inserted rows should be present.\n $saved_age = $this->connection->query('SELECT [age] FROM {test} WHERE [name] = :name', [':name' => 'DavidA'])->fetchField();\n $this->assertSame('24', $saved_age, 'Can retrieve DavidA row after commit.');\n $saved_age = $this->connection->query('SELECT [age] FROM {test} WHERE [name] = :name', [':name' => 'DanielA'])->fetchField();\n $this->assertSame('19', $saved_age, 'Can retrieve DanielA row after commit.');\n }\n catch (\\Exception $e) {\n $this->fail($e->getMessage());\n }\n }",
"public function testAdjustTransaction1()\n {\n }",
"public function testGetTransaction()\n {\n putenv('DB_CONNECTION=sqlite_testing');\n\n $user = factory(\\App\\User::class)->make();\n\n $this->be($user);\n\n $user->save();\n\n $item = factory(\\App\\item::class)->make();\n\n $item->save();\n\n Log::shouldReceive('info');\n\n $repository = new Repositories\\TransactionRepository(new Transaction);\n $repository->insert($user->email, $item->id, '', 0);\n\n $this->assertDatabaseHas('transactions', [\n 'email' => $user->email,\n 'item_fk'=>$item->id,\n 'tokens_spent'=>0\n ]);\n\n $transaction = $repository->get($user->email, $item->id);\n \n $this->assertTrue($transaction->email = $user->email && $transaction->item_fk = $item->id);\n }",
"public function testTransactionPost()\n {\n }",
"public function test7()\n {\n try\n {\n $this->db->beginTransaction();\n $this->db->commit();\n $this->db->rollback();\n }\n catch ( ezcDbTransactionException $e )\n {\n return;\n }\n\n $this->fail( \"The case with consequent BEGIN, COMMIT, ROLLBACK did not fail.\\n\" );\n }",
"public function testTransactionAllCommit_concurrent2() {\r\n\r\n\t\t$obj = new TestModel2($this->adapter);\r\n\t\t$obj->field1 = 'foo';\r\n\t\t$obj->save();\r\n\t\t$id1 = $obj->id;\r\n\t\t$obj = new TestModel2($this->adapter);\r\n\t\t$obj->field1 = 'bar';\r\n\t\t$obj->save();\r\n\t\t$id2 = $obj->id;\r\n\r\n\t\t$txn1 = new Transaction();\r\n\t\tusleep(100); //sleep 100ms to ensure txn2 is benind txn1\r\n\t\t$txn2 = new Transaction();\r\n\t\t$this->assertTrue($txn2->getTimestamp() > $txn1->getTimestamp(), 'Transaction 2 is not newer than transaction 1');\r\n\r\n\t\t//transaction 1\r\n\t\t$obj_txn1 = new TestModel2($this->adapter);\r\n\t\t$obj_txn2 = new TestModel2($this->adapter);\r\n\t\t$obj_txn1->joinTransaction($txn1);\r\n\t\t$obj_txn2->joinTransaction($txn2);\r\n\n\t\t$obj_txn2->getById($id1);\r\n\t\t$obj_txn2->field1 = 'foo2';\r\n\t\t$obj_txn2->save();\r\n\n\t\ttry {\r\n\t\t\t$obj_txn1->getById($id1); //should throw exception\n\t\t\t$this->fail('Dirty read did not throw exception');\n\t\t} catch (OptimisticLockException $ex) {\n\n\t\t}\r\n\t}",
"public function testTransactionAllCommit_concurrent3() {\r\n\r\n\t\t$obj = new TestModel2($this->adapter);\r\n\t\t$obj->field1 = 'foo';\r\n\t\t$obj->save();\r\n\t\t$id1 = $obj->id;\r\n\t\t$obj = new TestModel2($this->adapter);\r\n\t\t$obj->field1 = 'bar';\r\n\t\t$obj->save();\r\n\t\t$id2 = $obj->id;\r\n\r\n\t\t$txn1 = new Transaction();\r\n\t\tusleep(100); //sleep 100ms to ensure txn2 is benind txn1\r\n\t\t$txn2 = new Transaction();\r\n\t\t$this->assertTrue($txn2->getTimestamp() > $txn1->getTimestamp(), 'Transaction 2 is not newer than transaction 1');\r\n\r\n\t\t//transaction 1\r\n\t\t$obj_txn1 = new TestModel2($this->adapter);\r\n\t\t$obj_txn2 = new TestModel2($this->adapter);\r\n\t\t$obj_txn1->joinTransaction($txn1);\r\n\t\t$obj_txn2->joinTransaction($txn2);\r\n\r\n\t\t$obj_txn1->getById($id1);\n\t\t$obj_txn2->getById($id1);\n\n\t\t$obj_txn2->field1 = 'foo2';\r\n\t\t$obj_txn2->save();\n\t\t$obj_txn1->field1 = 'foo1';\n\r\n\t\ttry {\r\n\t\t\t$obj_txn1->save();\n\t\t\t$this->fail('Late write did not throw exception');\r\n\t\t} catch (OptimisticLockException $ex) {\r\n\r\n\t\t}\r\n\t}",
"public function test6()\n {\n try\n {\n $this->db->beginTransaction();\n $this->db->rollback();\n $this->db->commit();\n }\n catch ( ezcDbTransactionException $e )\n {\n return;\n }\n\n $this->fail( \"The case with consequent BEGIN, ROLLBACK, COMMIT did not fail.\\n\" );\n }",
"public function testSplitTransaction()\r\n {\r\n }",
"public function testPostTransactions()\n {\n }",
"public function testTransactionRaw()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If field 'row_display_name' is added to a layout, it will be used to rename the row to a more userfriendly name | function my_acf_flexible_content_layout_title( $title, $field, $layout, $i ) {
// Remove layout title from text
// Load text sub field
if ($field = get_sub_field('row_display_name')) {
$text = get_sub_field('row_type');
if ($text['value'] == 'standard') {
$text = 'Standard Row';
} elseif ($text['value'] == 'full-bleed') {
$text = 'Full Bleed Row';
} else {
$number = get_sub_field('number_of_columns');
$text = $number.' Column';
}
$title = '';
$title .= $field.' - '. $text;
}
return $title;
} | [
"abstract protected function define_row_submitter_title();",
"public function alterDisplay(&$rows) {\n $entryFound = FALSE;\n\n foreach ($rows as $rowNum => $row) {\n // make count columns point to detail report\n // convert sort name to links\n if (array_key_exists('civicrm_contact_sort_name', $row) &&\n array_key_exists('civicrm_contact_id', $row)\n ) {\n //NYSS 2059\n $url = CRM_Utils_System::url( 'civicrm/contact/view',\n 'reset=1&cid='.$row['civicrm_contact_id'],\n $this->_absoluteUrl, $this->_id, $this->_drilldownReport\n );\n $rows[$rowNum]['civicrm_contact_sort_name_link'] = $url;\n $rows[$rowNum]['civicrm_contact_sort_name_hover'] = ts('View Contact Detail Report for this contact');\n $entryFound = TRUE;\n }\n\n // Handle ID to label conversion for contact fields\n $entryFound = $this->alterDisplayContactFields($row, $rows, $rowNum, 'contact/summary', 'View Contact Summary') ? TRUE : $entryFound;\n\n // skip looking further in rows, if first row itself doesn't\n // have the column we need\n if (!$entryFound) {\n break;\n }\n }\n }",
"public function moduleRowName() {\n\t\treturn Language::_(\"Cpanel.module_row\", true);\n\t}",
"function get_row_layout()\n{\n}",
"function get_row_layout() {}",
"function get_row_layout() { }",
"protected function getRowLabel()\n {\n if ($this->rowLabel === null)\n {\n return '';\n }\n else\n {\n return '.'. $this->rowLabel;\n }\n }",
"function renderRow( $row ){\n $html = \"\";\n $html .= \" <li class=\\\"\".intval($row[\"id\"]).\"\\\">\\n\";\n $this->issearchrow = true;\n $aFields = sizeof( $this->aResultsFields ) > 0 ? $this->aResultsFields : array_keys( $row );\n foreach( $this->aFields as $key => $field ){\n if( $field->hascolumn ) $this->aFields[$key]->setFromDb( $row[$key] );\n }\n if( strstr( $this->access, \"r\" ) !== false ) $name = \"<a href=\\\"\".SITE_ROOT.$this->tablename.\"/edit/\".intval($row[\"id\"]).\"\\\">\".htmlentities( $this->getName() ).\"</a>\";\n else $name = htmlentities( $this->getName() );\n $html .= \" <h3>\".$name.\"</h3>\\n\";\n foreach( $aFields as $key ){\n if( empty( $this->aFields[$key] ) ) continue;\n if( $this->isListedBy( $key ) ) continue;\n // Don't display the row ID\n if( preg_match( \"/^id/\", $key ) ) continue;\n if( !$this->aFields[$key]->display ) continue;\n $html .= \" <h4 class=\\\"\".$this->aFields[$key]->type.\" \".$this->aFields[$key]->columnname.\" field\\\">\".$this->aFields[$key]->displayname.\"</h4>\\n\";\n $html .= \" <div class=\\\"\".$this->aFields[$key]->type.\" \".$this->aFields[$key]->columnname.\" field\\\">\".$this->aFields[$key]->toHtml().\"</div>\\n\";\n }\n $html .= \" <hr/>\\n\";\n if( strstr( $this->access, \"u\" ) ) $html .= \" <p class=\\\"edit\\\"><a class=\\\"edit\\\" href=\\\"\".SITE_ROOT.$this->tablename.\"/edit/\".intval($row[\"id\"]).\"\\\">edit</a></p>\\n\";\n if( strstr( $this->access, \"d\" ) ) $html .= \" <p class=\\\"delete\\\"><a class=\\\"delete\\\" href=\\\"\".SITE_ROOT.$this->tablename.\"/delete/\".intval($row[\"id\"]).\"\\\">delete</a></p>\\n\";\n $html .= \" <hr/>\\n\";\n $html .= \" </li>\\n\";\n return $html;\n }",
"public function setDisplayName($display_name);",
"public function getItemDetailsRowLabel(Varien_Object $row)\n {\n return $row->getLabel();\n }",
"function TitleRow($Fields, $Display = FALSE)\n {\n $TitleRow = [];\n \n # Sets an array which will define the Links of Sorting in each displayable Field\n for ($i=0; $i<count($Fields['Field']); $i++)\n {\n $SortBy = array_search($Fields['Field'][$i], $this->SortFields);\n if ($SortBy === FALSE) { $TitleRow[\"Link\"][$i] = \"\"; continue; }\n $qs = $_SERVER['QUERY_STRING'];\n \n if (preg_match('#SortBy=[0-9]+(&|$)#i', $qs, $matches) > 0)\n $qs = str_replace($matches[0], \"SortBy=\".$SortBy.$matches[1], $qs);\n else\n $qs = $qs.\"&SortBy=$SortBy\";\n \n if (preg_match('#AscDesc=[0-9]+(&|$)#i', $qs, $matches) > 0)\n $qs = str_replace($matches[0], \"AscDesc=\".((int)!$this->AscDesc).$matches[1], $qs);\n else\n $qs = $qs.\"&AscDesc=\".((int)!$this->AscDesc);\n \n $TitleRow[\"Link\"][$i] = $_SERVER['PHP_SELF'].\"?\".htmlentities($qs);\n }\n \n /*\n * Find the current SortBy Value - By what Field is it sorted right now.\n * This is to determine at which field (column) will the Sort Icon (Ascending or Descending) will be displayed\n */\n if (preg_match('#SortBy=([0-9]+)(&|$)#i', $_SERVER['QUERY_STRING'], $matches) > 0)\n $CurrentSortBy = trim($matches[1]);\n else \n $CurrentSortBy = $this->SortBy;\n \n $key = array_search($this->SortFields[$CurrentSortBy], $Fields[\"Field\"]);\n $TitleRow[\"SortIcon\"][\"Key\"] = $key;\n $TitleRow[\"SortIcon\"]['Image'] = CB_ICO.($this->AscDesc == 0 ? \"s_asc.png\" : \"s_desc.png\");\n $TitleRow[\"SortIcon\"]['Width'] = 11;\n $TitleRow[\"SortIcon\"]['Height'] = 9;\n \n /*\n * Display The cells <td></td> of each Field - Easier rather than displaying it one by one outside of function\n * If not displaying ($Display = FALSE) then the array $TitleRow is returned - it contains all the required\n * attributes. $TitleRow is the EXACT array for displaying within this function (Just below)\n */\n if ($Display === TRUE)\n {\n for ($i=0; $i<count($Fields['Field']); $i++)\n {\n /*\n * Take this example\n * isset($a) ? $a == \"\" ? '' : 'class=\"'.$a.'\"' : ''\n * $a is replaced by the long array name like $Fields['CSS']['td']['Class'][$i]\n */\n echo '<td'.\n (isset($Fields['CSS']['td']['Class'][$i]) ? $Fields['CSS']['td']['Class'][$i] == \"\" ? '' : ' class=\"'.$Fields['CSS']['td']['Class'][$i].'\"' : '').\n (isset($Fields['CSS']['td']['Style'][$i]) ? $Fields['CSS']['td']['Style'][$i] == \"\" ? '' : ' style=\"'.$Fields['CSS']['td']['Style'][$i].'\"' : '').\n '>';\n \n echo $TitleRow['Link'][$i] != \"\" ?\n '<a href=\"'.$TitleRow['Link'][$i].'\"'.\n (isset($Fields['CSS']['a']['Class'][$i]) ? $Fields['CSS']['a']['Class'][$i] == \"\" ? '' : ' class=\"'.$Fields['CSS']['a']['Class'][$i].'\"' : '').\n (isset($Fields['CSS']['a']['Style'][$i]) ? $Fields['CSS']['a']['Style'][$i] == \"\" ? '' : ' style=\"'.$Fields['CSS']['a']['Style'][$i].'\"' : '').\n '>'.$Fields['Name'][$i].\n '</a>'\n : $Fields['Name'][$i];\n \n if ($TitleRow['SortIcon']['Key'] == $i)\n echo ' <a href=\"'.$TitleRow['Link'][$i].'\"><img src=\"'.$TitleRow['SortIcon']['Image'].'\" alt=\"\"/></a>';\n echo '</td>';\n }\n }\n \n /*\n * Return if $Display is FALSE\n * Returns all attributes for displaying - better have $Display = TRUE for this function as it can do all\n * displaying here - Classname and Style\n */\n if ($Display === FALSE)\n return $TitleRow;\n }",
"public function GetRowTemplateName() {\n\n return $this->RenderInline ? 'RowForInline' : 'Row';\n }",
"abstract protected function define_column_submitter_name_title();",
"static function makeRowLabel($record) {\n global $user;\n // Start with client.\n if ($user->isPluginEnabled('cl'))\n $label = $record['client'];\n\n // Add project.\n if (!empty($label) && !empty($record['project'])) $label .= ' - ';\n $label .= $record['project'];\n\n // Add task.\n if (!empty($label) && !empty($record['task'])) $label .= ' - ';\n $label .= $record['task'];\n\n // Add custom field 1.\n if ($user->isPluginEnabled('cf')) {\n if (!empty($label) && !empty($record['cf_1_value'])) $label .= ' - ';\n $label .= $record['cf_1_value'];\n }\n\n return $label;\n }",
"protected function gridRoomNameColumn($data, $row)\n {\n \t$modelRoom = Room::model()->findByPk($data->bookingDays[0]->id_room);\n\t\t\n \treturn $modelRoom->title;\n }",
"public function col_enrolkeyname($row) {\n $param = [\n 'courseid' => $row->courseid,\n 'id' => $row->id,\n 'type' => 'self',\n ];\n $url = new moodle_url('/enrol/editinstance.php', $param);\n\n return \\html_writer::link($url, $row->enrolkeyname);\n }",
"function column_name( $affiliate ) {\n\t\t$base = affwp_admin_url( 'affiliates', array( 'affiliate_id' => $affiliate->affiliate_id ) );\n\t\t$row_actions = array();\n\t\t$name = affiliate_wp()->affiliates->get_affiliate_name( $affiliate->affiliate_id );\n\t\t$username = affwp_get_affiliate_username( $affiliate->ID );\n\n\t\t$base_query_args = array(\n\t\t\t'page' => 'affiliate-wp-affiliates',\n\t\t\t'affiliate_id' => $affiliate->ID\n\t\t);\n\n\t\t// Main 'Name' link.\n\t\tif ( ! $name ) {\n\t\t\t$affiliate_name = __( '(user deleted)', 'affiliate-wp' );\n\t\t} else {\n\t\t\t$affiliate_name = $name;\n\t\t}\n\n\t\t$value = sprintf( '<a href=\"%1$s\">%2$s</a>',\n\t\t\tesc_url( add_query_arg(\n\t\t\t\tarray_merge( $base_query_args, array(\n\t\t\t\t\t'affwp_notice' => false,\n\t\t\t\t\t'action' => 'edit_affiliate',\n\t\t\t\t) )\n\t\t\t) ),\n\t\t\t$affiliate_name\n\t\t);\n\n\t\t// Reports.\n\t\t$row_actions['reports'] = $this->get_row_action_link(\n\t\t\t__( 'Reports', 'affiliate-wp' ),\n\t\t\tarray(\n\t\t\t\t'page' => 'affiliate-wp-reports',\n\t\t\t\t'tab' => 'referral',\n\t\t\t\t'affiliate_login' => $username,\n\t\t\t\t'range' => 'this_month'\n\t\t\t)\n\t\t);\n\n\t\tif ( $name ) {\n\t\t\t// Edit User.\n\t\t\t$row_actions['edit_user'] = $this->get_row_action_link(\n\t\t\t\t__( 'Edit User', 'affiliate-wp' ),\n\t\t\t\tarray(),\n\t\t\t\tarray( 'base_uri' => get_edit_user_link( $affiliate->user_id ) )\n\t\t\t);\n\t\t}\n\n\t\tif ( strtolower( $affiliate->status ) == 'active' ) {\n\n\t\t\t// Deactivate.\n\t\t\t$row_actions['deactivate'] = $this->get_row_action_link(\n\t\t\t\t__( 'Deactivate', 'affiliate-wp' ),\n\t\t\t\tarray_merge( $base_query_args, array(\n\t\t\t\t\t'affwp_notice' => 'affiliate_deactivated',\n\t\t\t\t\t'action' => 'deactivate'\n\t\t\t\t) ),\n\t\t\t\tarray( 'nonce' => 'affiliate-nonce' )\n\t\t\t);\n\n\t\t} elseif( strtolower( $affiliate->status ) == 'pending' ) {\n\n\t\t\t// Review.\n\t\t\t$row_actions['review'] = $this->get_row_action_link(\n\t\t\t\t__( 'Review', 'affiliate-wp' ),\n\t\t\t\tarray_merge( $base_query_args, array(\n\t\t\t\t\t'affwp_notice' => false,\n\t\t\t\t\t'action' => 'review_affiliate'\n\t\t\t\t) ),\n\t\t\t\tarray( 'nonce' => 'affiliate-nonce' )\n\t\t\t);\n\n\t\t\t// Accept.\n\t\t\t$row_actions['accept'] = $this->get_row_action_link(\n\t\t\t\t__( 'Accept', 'affiliate-wp' ),\n\t\t\t\tarray_merge( $base_query_args, array(\n\t\t\t\t\t'affwp_notice' => 'affiliate_accepted',\n\t\t\t\t\t'action' => 'accept'\n\t\t\t\t) ),\n\t\t\t\tarray( 'nonce' => 'affiliate-nonce' )\n\t\t\t);\n\n\t\t\t// Reject.\n\t\t\t$row_actions['reject'] = $this->get_row_action_link(\n\t\t\t\t__( 'Reject', 'affiliate-wp' ),\n\t\t\t\tarray_merge( $base_query_args, array(\n\t\t\t\t\t'affwp_notice' => 'affiliate_rejected',\n\t\t\t\t\t'action' => 'reject'\n\t\t\t\t) ),\n\t\t\t\tarray( 'nonce' => 'affiliate-nonce' )\n\t\t\t);\n\n\t\t} else {\n\n\t\t\t// Activate.\n\t\t\t$row_actions['activate'] = $this->get_row_action_link(\n\t\t\t\t__( 'Activate', 'affiliate-wp' ),\n\t\t\t\tarray_merge( $base_query_args, array(\n\t\t\t\t\t'affwp_notice' => 'affiliate_activated',\n\t\t\t\t\t'action' => 'activate'\n\t\t\t\t) ),\n\t\t\t\tarray( 'nonce' => 'affiliate-nonce' )\n\t\t\t);\n\n\t\t}\n\n\t\t// Delete.\n\t\t$row_actions['delete'] = $this->get_row_action_link(\n\t\t\t__( 'Delete', 'affiliate-wp' ),\n\t\t\tarray_merge( $base_query_args, array(\n\t\t\t\t'affwp_notice' => false,\n\t\t\t\t'action' => 'delete'\n\t\t\t) ),\n\t\t\tarray( 'nonce' => 'affiliate-nonce' )\n\t\t);\n\n\t\t/**\n\t\t * Filters the row actions array for the Affiliates list table.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t * @param array $row_actions Row actions array.\n\t\t * @param \\AffWP\\Affiliate $affiliate Current affiliate.\n\t\t */\n\t\t$row_actions = apply_filters( 'affwp_affiliate_row_actions', $row_actions, $affiliate );\n\n\t\t$value .= '<div class=\"row-actions\">' . $this->row_actions( $row_actions, true ) . '</div>';\n\n\t\t/**\n\t\t * Filters the name column data for the affiliates list table.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t * @param string $value Data shown in the Name column.\n\t\t * @param \\AffWP\\Affiliate $affiliate The current affiliate object.\n\t\t */\n\t\treturn apply_filters( 'affwp_affiliate_table_name', $value, $affiliate );\n\t}",
"public function getRowDescription($row) {\n\t\t\tif ($this->row_description_provider <> null) {\n\t\t\t\treturn call_user_func($this->row_description_provider, $row);\n\t\t\t}\n\t\t\t$s = \"Row on table \".$this->name.\": \";\n\t\t\t$first = true;\n\t\t\tforeach ($this->columns as $col) {\n\t\t\t\tif ($first) $first = false; else $s .= \", \";\n\t\t\t\t$s .= $col->name.\"=\";\n\t\t\t\tif (isset($row[$col->name])) $s .= toHTML($row[$col->name]);\n\t\t\t\telse $s .= \"NULL\";\n\t\t\t}\n\t\t\treturn $s;\n\t\t}",
"function excel_get_titles_row() {\n\t$t_columns = excel_get_columns();\n\t$t_ret = '<Row>';\n\n\tforeach( $t_columns as $t_column ) {\n\t\t$t_custom_field = column_get_custom_field_name( $t_column );\n\t\tif( $t_custom_field !== null ) {\n\t\t\t$t_ret .= excel_format_column_title( lang_get_defaulted( $t_custom_field ) );\n\t\t} else {\n\t\t\t$t_column_title = column_get_title( $t_column );\n\t\t\t$t_ret .= excel_format_column_title( $t_column_title );\n\t\t}\n\t}\n\n\t$t_ret .= '</Row>';\n\n\treturn $t_ret;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Export the supplied personal data for all review activities in contextlist | public static function export_user_data(approved_contextlist $contextlist) {
global $DB;
if (!$contextlist->count()) {
return;
}
$user = $contextlist->get_user();
list($contextsql, $contextparams) = $DB->get_in_or_equal($contextlist->get_contextids(), SQL_PARAMS_NAMED);
$sql = "SELECT cm.id AS cmid,
rwu.userid,
rwu.rate,
rwu.text,
rwu.timeadded
FROM {context} c
JOIN {course_modules} cm ON cm.id = c.instanceid
JOIN {review} rw ON rw.id = cm.instance
JOIN {review_userreviews} rwu ON rwu.reviewid = rw.id
WHERE c.id $contextsql
AND rwu.userid = :userid
ORDER BY cm.id, ci.position, ci.id
";
$params = ['userid' => $user->id] + $contextparams;
$lastcmid = null;
$itemdata = [];
$userreviews = $DB->get_recordset_sql($sql, $params);
foreach ($userreviews as $userreview) {
if ($lastcmid !== $userreview->cmid) {
if ($itemdata) {
self::export_checklist_data_for_user($itemdata, $lastcmid, $user);
}
$itemdata = [];
$lastcmid = $userreview->cmid;
}
$reviewdata[] = (object)[
'userid' => $userreview->userid,
'rate' => $userreview->rate ? $userreview->rate : '',
'text' => $userreview->text ? $userreview->text : '',
'timeadded' => $userreview->timeadded ? transform::datetime($userreview->timeadded) : '',
];
}
$userreviews->close();
if ($reviewdata) {
self::export_review_data_for_user($reviewdata, $lastcmid, $user);
}
} | [
"public static function export_user_data(approved_contextlist $contextlist);",
"public static function export_user_data(approved_contextlist $contextlist) {\n global $DB;\n\n if (!count($contextlist)) {\n return;\n }\n\n $syscontextapproved = false;\n\n foreach ($contextlist->get_contexts() as $context) {\n if ($context->id == SYSCONTEXTID) {\n $syscontextapproved = true;\n break;\n }\n }\n\n if (!$syscontextapproved) {\n return;\n }\n\n $user = $contextlist->get_user();\n $writer = writer::with_context(\\context_system::instance());\n $subcontext = [get_string('pluginname', 'local_dev')];\n\n $activity = $DB->get_records('dev_activity', ['userid' => $user->id], '', 'id, version, gitcommits, gitmerges');\n if ($activity) {\n $writer->export_data($subcontext, (object) ['contributions' => array_values(array_map(function($record) {\n unset($record->id);\n return $record;\n }, $activity))]);\n unset($activity);\n }\n\n $commits = $DB->get_records('dev_git_commits', ['userid' => $user->id], 'repository, authordate',\n 'id, repository, commithash, authordate, authorname, authoremail, subject, merge, issue, tag');\n if ($commits) {\n $writer->export_related_data($subcontext, 'gitcommits', array_values(array_map(function($record) {\n unset($record->id);\n $record->authordate = transform::datetime($record->authordate);\n return $record;\n }, $commits)));\n unset($commits);\n }\n\n $aliases = $DB->get_records('dev_git_user_aliases', ['userid' => $user->id], '',\n 'id, fullname, email');\n if ($aliases) {\n $writer->export_related_data($subcontext, 'aliases', array_values(array_map(function($record) {\n unset($record->id);\n return $record;\n }, $aliases)));\n unset($aliases);\n }\n\n $tracker = $DB->get_records('dev_tracker_activities', ['userid' => $user->id], '',\n 'id, uuid, title, userfullname, userlink, category, link, timecreated');\n if ($tracker) {\n $writer->export_related_data($subcontext, 'tracker', array_values(array_map(function($record) {\n unset($record->id);\n return $record;\n }, $tracker)));\n unset($tracker);\n }\n }",
"public static function export_user_data(approved_contextlist $contextlist) {\n self::export_user_data_lti_submissions($contextlist);\n\n self::export_user_data_lti_types($contextlist);\n\n self::export_user_data_lti_tool_proxies($contextlist);\n }",
"public static function export_user_data(approved_contextlist $contextlist) {\n global $DB;\n\n if (empty($contextlist->count())) {\n return;\n }\n\n $user = $contextlist->get_user();\n\n list($contextsql, $contextparams) = $DB->get_in_or_equal($contextlist->get_contextids(), SQL_PARAMS_NAMED);\n\n $sql = 'SELECT cm.id AS cmid,\n ss.id AS submissionid, sa.id AS answerid, sa.content AS answer,\n ss.timecreated, ss.timemodified,\n si.id AS itemid, si.plugin\n FROM {context} c\n INNER JOIN {course_modules} cm ON cm.id = c.instanceid AND c.contextlevel = :contextlevel\n INNER JOIN {modules} m ON m.id = cm.module AND m.name = :modname\n INNER JOIN {surveypro} s ON s.id = cm.instance\n INNER JOIN {surveypro_item} si ON si.surveyproid = s.id\n INNER JOIN {surveypro_submission} ss ON ss.surveyproid = s.id\n INNER JOIN {surveypro_answer} sa ON sa.submissionid = ss.id AND sa.itemid = si.id\n WHERE c.id '.$contextsql.'\n AND ss.userid = :userid\n AND si.type = :type\n ORDER BY cmid, submissionid, answerid';\n\n $params = ['modname' => 'surveypro', 'contextlevel' => CONTEXT_MODULE, 'userid' => $user->id, 'type' => 'field'];\n $params = $params + $contextparams;\n\n $surveyproanswers = $DB->get_recordset_sql($sql, $params);\n\n $lastcmid = null;\n $lastsubmissionid = null;\n foreach ($surveyproanswers as $surveyproanswer) {\n $itemcontent = self::export_get_itemcontent($surveyproanswer);\n\n if ($surveyproanswer->cmid != $lastcmid) {\n // Send current $surveyprodata.\n if (!empty($lastcmid)) {\n $context = \\context_module::instance($lastcmid);\n self::export_surveypro_data_for_user($surveyprodata, $context, $user);\n if (!empty($attachments)) {\n self::export_surveypro_attachments($attachments, $context);\n }\n }\n // Reset surveyprodata to start again.\n $surveyprodata = [\n 'submissions' => []\n ];\n $attachments = [];\n\n // Store the current answer.\n self::store_current_data($surveyprodata, $surveyproanswer, $itemcontent, $attachments);\n\n // Update the indicators.\n $lastcmid = $surveyproanswer->cmid;\n $lastsubmissionid = $surveyproanswer->submissionid;\n } else {\n // In the frame of the same surveypro, submission has changed.\n if ($surveyproanswer->submissionid != $lastsubmissionid) {\n // Store the current answer.\n self::store_current_data($surveyprodata, $surveyproanswer, $itemcontent, $attachments);\n\n // Update the indicator.\n $lastsubmissionid = $surveyproanswer->submissionid;\n } else {\n // Only the itemid changed. So: same surveypro and same submission.\n // Store the current answer.\n self::store_current_data($surveyprodata, $surveyproanswer, $itemcontent, $attachments);\n }\n }\n }\n\n if ($surveyproanswer->cmid == $lastcmid) {\n $context = \\context_module::instance($lastcmid);\n // Send current $surveyprodata.\n self::export_surveypro_data_for_user($surveyprodata, $context, $user);\n if (!empty($attachments)) {\n self::export_surveypro_attachments($attachments, $context);\n }\n }\n }",
"public static function _export_user_data(approved_contextlist $contextlist) {\n global $DB;\n\n if (empty($contextlist->count())) {\n return;\n }\n\n $user = $contextlist->get_user();\n $context = \\context_user::instance($user->id);\n $contexts = $contextlist->get_contexts();\n foreach ($contexts as $specificcontext) {\n // Sanity check that context is at the user context level.\n if ($specificcontext->contextlevel !== CONTEXT_USER) {\n continue;\n }\n $sql = \"SELECT *\n FROM {local_lsf_course}\n WHERE (requesterid = :userid)\";\n $contextparams['userid'] = $user->id;\n\n $coursesrequested = $DB->get_recordset_sql($sql, $contextparams);\n $sql = \"SELECT *\n FROM {local_lsf_course}\n WHERE (acceptorid = :userid)\";\n $coursesaccepted = $DB->get_recordset_sql($sql, $contextparams);\n\n if (empty($courserequested) && empty($coursesaccepted)) {\n return;\n }\n\n foreach ($coursesrequested as $courserequest) {\n $contextdatatowrite[] = self::create_data_to_write('requester', $courserequest, $user->username);\n }\n foreach ($coursesaccepted as $courserequest) {\n $contextdatatowrite[] = self::create_data_to_write('acceptor', $courserequest, $user->username);\n }\n }\n $subcontext = [\n get_string('pluginname', 'local_lsf_unification')\n ];\n if (!empty($contextdatatowrite)) {\n writer::with_context($context)->export_data($subcontext, (object)$contextdatatowrite);\n }\n }",
"public static function export_data_for_null_provider(approved_contextlist $contextlist) {\n $user = $contextlist->get_user();\n foreach ($contextlist as $context) {\n $data = static::get_context_data($context, $user);\n static::export_context_files($context, $user);\n\n writer::with_context($context)->export_data([], $data);\n }\n }",
"public function export_all_data_for_user(int $userid, string $component) {\n $contextlist = $this->get_contexts_for_userid($userid, $component);\n\n $approvedcontextlist = new \\core_privacy\\tests\\request\\approved_contextlist(\n \\core_user::get_user($userid),\n $component,\n $contextlist->get_contextids()\n );\n\n $classname = $this->get_provider_classname($component);\n $classname::export_user_data($approvedcontextlist);\n }",
"public function test_export_context_data_module_context_only() {\n $this->resetAfterTest();\n\n // Create a course and a single module.\n $course1 = $this->getDataGenerator()->create_course(['fullname' => 'Course 1', 'shortname' => 'C1']);\n $context1 = context_course::instance($course1->id);\n $modassign = $this->getDataGenerator()->create_module('assign', ['course' => $course1->id, 'name' => 'assign test 1']);\n $assigncontext = context_module::instance($modassign->cmid);\n\n // Now, let's assume during user info export, only the coursemodule context is returned in the contextlist_collection.\n $user = $this->getDataGenerator()->create_user();\n $collection = new \\core_privacy\\local\\request\\contextlist_collection($user->id);\n $approvedlist = new \\core_privacy\\local\\request\\approved_contextlist($user, 'mod_assign', [$assigncontext->id]);\n $collection->add_contextlist($approvedlist);\n\n // Now, verify that core_course will detect this, and add relevant contextual information.\n \\core_course\\privacy\\provider::export_context_data($collection);\n $writer = \\core_privacy\\local\\request\\writer::with_context($context1);\n $this->assertTrue($writer->has_any_data());\n $writerdata = $writer->get_data();\n $this->assertObjectHasAttribute('fullname', $writerdata);\n $this->assertObjectHasAttribute('shortname', $writerdata);\n $this->assertObjectHasAttribute('idnumber', $writerdata);\n $this->assertObjectHasAttribute('summary', $writerdata);\n }",
"public function exportData(){\n\n\t\t//Login & valid password required\n\t\tuser_login_required();\n\t\tcheck_post_password(userID, \"password\");\n\n\t\t//Generate and get data set\n\t\t$data = components()->account->export(userID);\n\n\t\t//Process data set\n\n\n\t\t//Find the users to fetch information about too\n\t\t$users = array();\n\t\t$add_user_id = function(int $userID, array &$list){\n\t\t\tif(!in_array($userID, $list))\n\t\t\t\t$list[] = $userID;\n\t\t};\n\t\t\n\t\t//Friends\n\t\tforeach($data[\"friends_list\"] as $friend)\n\t\t\t$add_user_id($friend->getFriendID(), $users);\n\t\t\n\t\t//Posts\n\t\tforeach($data[\"posts\"] as $num => $post){\n\t\t\t$add_user_id($post->get_userID(), $users);\n\n\t\t\t//Process post comments\n\t\t\tif($post->has_comments()){\n\t\t\t\tforeach($post->get_comments() as $comment)\n\t\t\t\t\t$add_user_id($comment->get_userID(), $users);\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t//Comments\n\t\tforeach($data[\"comments\"] as $num => $comment)\n\t\t\t$add_user_id($comment->get_userID(), $users);\n\t\t\n\t\t//Conversation members\n\t\tforeach($data[\"conversations_list\"] as $num => $conversation){\n\t\t\tforeach($conversation->get_members() as $member)\n\t\t\t\t$add_user_id($member, $users);\n\t\t}\n\n\t\t//Conversation messages\n\t\tforeach($data[\"conversations_messages\"] as $num => $conversation){\n\t\t\tforeach($conversation as $message)\n\t\t\t\t$add_user_id($message->get_userID(), $users);\n\t\t}\n\n\t\t//Fetch information about related users\n\t\t$data[\"users_info\"] = components()->user->getMultipleUserInfos($users);\n\n\n\n\n\t\t//Prepare API return\n\t\t//Advanced user information\n\t\t$data[\"advanced_info\"] = userController::advancedUserToAPI($data[\"advanced_info\"]);\n\n\t\t//Posts\n\t\tforeach($data[\"posts\"] as $num => $post)\n\t\t\t$data[\"posts\"][$num] = PostsController::PostToAPI($post);\n\t\t\n\t\t//Comments\n\t\tforeach($data[\"comments\"] as $num => $comment)\n\t\t\t$data[\"comments\"][$num] = CommentsController::commentToAPI($comment);\n\n\t\t//Likes\n\t\tforeach($data[\"likes\"] as $num => $like)\n\t\t\t$data[\"likes\"][$num] = LikesController::UserLikeToAPI($like);\n\t\t\n\t\t//Survey responses\n\t\tforeach($data[\"survey_responses\"] as $num => $response)\n\t\t\t$data[\"survey_responses\"][$num] = SurveysController::SurveyResponseToAPI($response);\n\t\t\n\t\t//Movies\n\t\tforeach($data[\"movies\"] as $num => $movie)\n\t\t\t$data[\"movies\"][$num] = MoviesController::MovieToAPI($movie);\n\n\t\t//All conversations messages from user\n\t\tforeach($data[\"all_conversation_messages\"] as $num => $message)\n\t\t\t$data[\"all_conversation_messages\"][$num] = ConversationsController::ConvMessageToAPI($message);\n\n\t\t//Conversations list\n\t\tforeach($data[\"conversations_list\"] as $num => $conversation)\n\t\t\t$data[\"conversations_list\"][$num] = ConversationsController::ConvInfoToAPI($conversation);\n\t\t\n\t\t//Conversation messages\n\t\tforeach($data[\"conversations_messages\"] as $convID=>$messages){\n\t\t\tforeach($messages as $num=>$message)\n\t\t\t\t$data[\"conversations_messages\"][$convID][$num] = ConversationsController::ConvMessageToAPI($message); \n\t\t}\n\n\t\t//Friends list\n\t\tforeach($data[\"friends_list\"] as $num => $friend)\n\t\t\t$data[\"friends_list\"][$num] = friendsController::parseFriendAPI($friend);\n\n\t\t//Users information\n\t\tforeach($data[\"users_info\"] as $num => $user)\n\t\t\t$data[\"users_info\"][$num] = userController::userToAPI($user);\n\t\t\n\t\treturn $data;\n\t\n\t}",
"public function test_export_user_data_no_data() {\n global $USER;\n $this->resetAfterTest();\n $this->setAdminUser();\n\n $approvedcontextlist = new \\core_privacy\\tests\\request\\approved_contextlist(\n \\core_user::get_user($USER->id),\n 'mod_quiz',\n []\n );\n\n provider::export_user_data($approvedcontextlist);\n $this->assertDebuggingNotCalled();\n\n // No data should have been exported.\n $writer = \\core_privacy\\local\\request\\writer::with_context(\\context_system::instance());\n $this->assertFalse($writer->has_any_data_in_any_context());\n }",
"function bp_activity_personal_data_exporter( $email_address, $page ) {\n\t$number = 50;\n\n\t$email_address = trim( $email_address );\n\n\t$data_to_export = array();\n\n\t$user = get_user_by( 'email', $email_address );\n\n\tif ( ! $user ) {\n\t\treturn array(\n\t\t\t'data' => array(),\n\t\t\t'done' => true,\n\t\t);\n\t}\n\n\t$activities = bp_activity_get( array(\n\t\t'display_comments' => 'stream',\n\t\t'per_page' => $number,\n\t\t'page' => $page,\n\t\t'show_hidden' => true,\n\t\t'filter' => array(\n\t\t\t'user_id' => $user->ID,\n\t\t),\n\t) );\n\n\t$user_data_to_export = array();\n\t$activity_actions = bp_activity_get_actions();\n\n\tforeach ( $activities['activities'] as $activity ) {\n\t\tif ( ! empty( $activity_actions->{$activity->component}->{$activity->type}['format_callback'] ) ) {\n\t\t\t$description = call_user_func( $activity_actions->{$activity->component}->{$activity->type}['format_callback'], '', $activity );\n\t\t} elseif ( ! empty( $activity->action ) ) {\n\t\t\t$description = $activity->action;\n\t\t} else {\n\t\t\t$description = $activity->type;\n\t\t}\n\n\t\t$item_data = array(\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Activity Date', 'buddypress' ),\n\t\t\t\t'value' => $activity->date_recorded,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Activity Description', 'buddypress' ),\n\t\t\t\t'value' => $description,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Activity URL', 'buddypress' ),\n\t\t\t\t'value' => bp_activity_get_permalink( $activity->id, $activity ),\n\t\t\t),\n\t\t);\n\n\t\tif ( ! empty( $activity->content ) ) {\n\t\t\t$item_data[] = array(\n\t\t\t\t'name' => __( 'Activity Content', 'buddypress' ),\n\t\t\t\t'value' => $activity->content,\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Filters the data associated with an activity item when assembled for a WP personal data export.\n\t\t *\n\t\t * Plugins that register activity types whose `action` string doesn't adequately\n\t\t * describe the activity item for the purposes of data export may filter the activity\n\t\t * item data here.\n\t\t *\n\t\t * @since 4.0.0\n\t\t *\n\t\t * @param array $item_data Array of data describing the activity item.\n\t\t * @param BP_Activity_Activity $activity Activity item.\n\t\t */\n\t\t$item_data = apply_filters( 'bp_activity_personal_data_export_item_data', $item_data, $activity );\n\n\t\t$data_to_export[] = array(\n\t\t\t'group_id' => 'bp_activity',\n\t\t\t'group_label' => __( 'Activity', 'buddypress' ),\n\t\t\t'item_id' => \"bp-activity-{$activity->id}\",\n\t\t\t'data' => $item_data,\n\t\t);\n\t}\n\n\t// Tell core if we have more items to process.\n\t$done = count( $activities['activities'] ) < $number;\n\n\treturn array(\n\t\t'data' => $data_to_export,\n\t\t'done' => $done,\n\t);\n}",
"public function actionReviewexport()\n\t{\n\t\tif(isset($_POST['Export'])) {\n extract($_POST['Export']);\n if (empty($date_start)) $date_start = date(\"Y-m-d\", time() - 86400);//one day ago\n if (empty($date_end)) $date_end = date(\"Y-m-d\");//today.\n\n $startstamp = strtotime($date_start);\n $endstamp = strtotime($date_end);\n $nofday = round( ($endstamp - $startstamp) / 86400 );\n\n define('DS', DIRECTORY_SEPARATOR);\n $exportfile = dirname(dirname(dirname(__FILE__))) . DS . \"assets\" . DS . \"reviewhistorydata.csv\";\n if (file_exists($exportfile)) unlink($exportfile);//remove the old files\n\n $fp = fopen($exportfile, 'a+');\n $els = array(\"Date\",\"Sites Acquired\",\"Pending\",\"Pending TO Approved\",\"Pending TO Accepted\",\n \"Approved TO Pre QA\",\"Approved TO Accepted\",\"Content Sent\",\"Email Sent\",\"Email Open\",\"Email Received\");\n fputcsv($fp, $els);\n\n for($i = 0; $i<$nofday; $i++) {\n $currentdate = date(\"Y-m-d H:i:s\", $startstamp + ($i*86400));\n $dateaftercurrent = date(\"Y-m-d H:i:s\", $startstamp + ($i*86400) + 86400);\n $els = array();\n $els[\"currentdate\"] = $currentdate;\n\n //Total Sites Acquired\n $q = \"SELECT COUNT( * ) AS total FROM lkm_inventory\n WHERE acquireddate >= '{$currentdate}' AND acquireddate < '{$dateaftercurrent}'\";\n $totalacquired = Yii::app()->db->createCommand($q)->queryRow();\n $totalac = 0;\n if ($totalacquired) $totalac = $totalacquired['total'];\n $els[\"totalac\"] = $totalac;\n\n $els[\"pending\"] = 0; //\"Total Sites moved into pending\"\n $els[\"p2approved\"] = 0; //\"Total Sites moved FROM pending TO Approved\"\n $els[\"p2accepted\"] = 0; //\"Total Sites moved FROM pending TO Accepted\"\n $els[\"a2preqa\"] = 0; //\"Total Sites moved FROM Approved TO Pre QA\"\n $els[\"a2accept\"] = 0; //\"Total Sites moved FROM Approved TO Accepted\"\n $q = \"SELECT COUNT( * ) AS iocount, oldiostatus, iostatus FROM lkm_io_history\n WHERE created >= '{$currentdate}' AND created < '{$dateaftercurrent}'\n GROUP BY oldiostatus, iostatus\";\n $taskscount = Yii::app()->db->createCommand($q)->queryAll();\n if ($taskscount) {\n foreach ($taskscount as $tc) {\n if ($tc[\"iostatus\"] == 21) {\n $els[\"pending\"] = $tc[\"iocount\"];\n } else if($tc[\"oldiostatus\"] == 21 && $tc[\"iostatus\"] == 3) {\n $els[\"p2approved\"] = $tc[\"iocount\"];\n } else if($tc[\"oldiostatus\"] == 21 && $tc[\"iostatus\"] == 2) {\n $els[\"p2accepted\"] = $tc[\"iocount\"];\n } else if($tc[\"oldiostatus\"] == 3 && $tc[\"iostatus\"] == 31) {\n $els[\"a2preqa\"] = $tc[\"iocount\"];\n } else if($tc[\"oldiostatus\"] == 3 && $tc[\"iostatus\"] == 2) {\n $els[\"a2accept\"] = $tc[\"iocount\"];\n }\n }\n }\n\n //Total pieces of content sent\n $q = \"SELECT COUNT( DISTINCT model_id ) AS total FROM `lkm_operation_trail` \n WHERE created >= '{$currentdate}' AND created < '{$dateaftercurrent}'\n AND `new_value` LIKE '%s:8:\".'\"sentdate\";s:10:\"2%'.\"' AND model='Task'\";\n $contentsent = Yii::app()->db->createCommand($q)->queryRow();\n $totalcs = 0;\n if ($contentsent) $totalcs = $contentsent['total'];\n $els[\"totalcs\"] = $totalcs;\n\n\n //##24 hours of Emails Sent, Open, and Received\n $q = \"SELECT COUNT( * ) AS total FROM `lkm_outreach_email` \n WHERE send_time >= '{$currentdate}' AND send_time < '{$dateaftercurrent}'\";\n $emailsent = Yii::app()->db->createCommand($q)->queryRow();\n $totales = 0;\n if ($emailsent) $totales = $emailsent['total'];\n $els[\"totales\"] = $totales;\n\n //24 hours of Emails Open\n $q = \"SELECT COUNT( * ) AS total FROM `lkm_outreach_email` \n WHERE open_time >= '{$currentdate}' AND open_time < '{$dateaftercurrent}'\";\n $emailopen = Yii::app()->db->createCommand($q)->queryRow();\n $totaleo = 0;\n if ($emailopen) $totaleo = $emailopen['total'];\n $els[\"totaleo\"] = $totaleo;\n\n //24 hours of Emails Received\n $q = \"SELECT COUNT( * ) AS total FROM `lkm_outreach_email` \n WHERE first_reply_time >= '{$currentdate}' AND first_reply_time < '{$dateaftercurrent}'\";\n $emailreply = Yii::app()->db->createCommand($q)->queryRow();\n $totaler = 0;\n if ($emailreply) $totaler = $emailreply['total'];\n $els[\"totaler\"] = $totaler;\n\n\n fputcsv($fp, $els);\n }\n fclose($fp);\n\n header(\"Location:assets/reviewhistorydata.csv\");\n Yii::app()->end();\n\t\t}\n\n\t\t$this->render('reviewexport',array(\n\t\t\t//'model'=>$model,//nothing need to pass through\n\t\t));\n\t}",
"function wp_ajax_wp_privacy_export_personal_data()\n {\n }",
"function wp_register_comment_personal_data_exporter($exporters)\n{\n}",
"function wp_ajax_wp_privacy_export_personal_data()\n{\n}",
"public function test_export_user_data() {\n $user = $this->getDataGenerator()->create_user();\n $usercontext = \\context_user::instance($user->id);\n $monitorgenerator = $this->getDataGenerator()->get_plugin_generator('tool_monitor');\n\n $this->setUser($user);\n $rulerecord = (object)['name' => 'privacy rule'];\n $rule = $monitorgenerator->create_rule($rulerecord);\n\n $secondrulerecord = (object)['name' => 'privacy rule2'];\n $rule2 = $monitorgenerator->create_rule($secondrulerecord);\n\n $subscription = (object)['ruleid' => $rule->id, 'userid' => $user->id];\n $subscription = $monitorgenerator->create_subscription($subscription);\n\n $writer = \\core_privacy\\local\\request\\writer::with_context($usercontext);\n $this->assertFalse($writer->has_any_data());\n\n $approvedlist = new approved_contextlist($user, 'tool_monitor', [$usercontext->id]);\n provider::export_user_data($approvedlist);\n\n // Check that the rules created by this user are exported.\n $this->assertEquals($rulerecord->name, $writer->get_data([get_string('privacy:createdrules', 'tool_monitor'),\n $rulerecord->name . '_' . $rule->id])->name);\n $this->assertEquals($secondrulerecord->name, $writer->get_data([get_string('privacy:createdrules', 'tool_monitor'),\n $secondrulerecord->name . '_' . $rule2->id])->name);\n\n // Check that the subscriptions for this user are also exported.\n $this->assertEquals($rulerecord->name, $writer->get_data([get_string('privacy:subscriptions', 'tool_monitor'),\n $rulerecord->name . '_' . $subscription->id, 'Site' , 'All events'])->name);\n }",
"function wp_register_comment_personal_data_exporter($exporters)\n {\n }",
"function exportProfiles(){\n exportGeneric(\"profile\", [\"include\" => [\"aged_id_pretty\", \"name\", \"surname\", \"date_of_birth\", \"profile_type\", \"age\", \"sex\"]]);\n}",
"function getactivityAction()\n {\n if (!$this->_authenticate()) {\n return;\n }\n\n try {\n $request = $this->getRequest();\n $helper = Mage::helper('eyehubspot');\n $multistore = $request->getParam ('multistore', self::IS_MULTISTORE );\n $maxperpage = $request->getParam('maxperpage', self::MAX_CUSTOMER_PERPAGE);\n $maxAssociated = $request->getParam('maxassoc', self::MAX_ASSOC_PRODUCT_LIMIT);\n $start = date('Y-m-d H:i:s', $request->getParam('start', 0));\n $end = date('Y-m-d H:i:s', time() - 300);\n $websiteId = Mage::app()->getWebsite()->getId();\n $store = Mage::app()->getStore();\n $storeId = Mage::app()->getStore()->getId();\n $collection = Mage::getModel('customer/customer')->getCollection();\n $resource = Mage::getSingleton('core/resource');\n $read = $resource->getConnection('core_read');\n $customerData = array();\n\n try {\n // because of limitations in the log areas of magento, we cannot use the\n // standard collection to retreive the results\n $select = $read->select()\n ->from(array('lc' => $resource->getTableName('log/customer')))\n ->joinInner(\n array('lv' => $resource->getTableName('log/visitor')),\n 'lc.visitor_id = lv.visitor_id'\n )\n ->joinInner(\n array('vi' => $resource->getTableName('log/visitor_info')),\n 'lc.visitor_id = vi.visitor_id'\n )\n ->joinInner(\n array('c' => $resource->getTableName('customer/entity')),\n 'c.entity_id = lc.customer_id',\n array('email' => 'email', 'customer_since' => 'created_at')\n )\n ->joinInner(\n array('p' => $resource->getTableName('log/url_info_table')),\n 'p.url_id = lv.last_url_id',\n array('last_url' => 'p.url', 'last_referer' => 'p.referer')\n )\n ->where('lc.customer_id > 0');\n // only add the filter if website id > 0\n if (!($multistore) && $websiteId) {\n \t$select->where(\"c.website_id = '$websiteId'\");\n }\n $select->where(\"lv.last_visit_at >= '$start'\")\n ->where(\"lv.last_visit_at < '$end'\")\n ->order('lv.last_visit_at')\n ->limit($maxperpage);\n\n $collection = $read->fetchAll($select);\n } catch (Exception $e) {\n $this->_outputError(self::ERROR_CODE_UNSUPPORTED_SQL, 'DB Exception on query', $e);\n return;\n }\n\n foreach ($collection as $assoc) {\n $log = new Varien_Object($assoc);\n $customerId = $log->getCustomerId();\n\n // merge and replace older data with newer\n if (isset($customerData[$customerId])) {\n $temp = $customerData[$customerId];\n $log->addData($temp->getData());\n $log->setFirstVisitAt($temp->getFirstVisitAt());\n } else {\n $log->setViewed($helper->getProductViewedList($customerId, $multistore, $maxAssociated));\n $log->setCompare($helper->getProductCompareList($customerId, $multistore, $maxAssociated));\n $log->setWishlist($helper->getProductWishlist($customerId, $multistore, $maxAssociated));\n }\n\n $log->unsetData('session_id');\n $customerData[$customerId] = $log;\n }\n } catch (Exception $e) {\n $this->_outputError(\n self::ERROR_CODE_UNKNOWN_EXCEPTION,\n 'Unknown exception on request',\n $e\n );\n return;\n }\n\n $this->_outputJson(array(\n 'visitors' => $helper->convertAttributeData($customerData),\n 'website' => $websiteId,\n 'store' => $storeId\n ));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets a collection of ChildMemberRespone objects related by a onetomany relationship to the current object. It will also schedule objects for deletion based on a diff between old objects (aka persisted) and new objects from the given Propel collection. | public function setMemberRespones(Collection $memberRespones, ConnectionInterface $con = null)
{
/** @var ChildMemberRespone[] $memberResponesToDelete */
$memberResponesToDelete = $this->getMemberRespones(new Criteria(), $con)->diff($memberRespones);
$this->memberResponesScheduledForDeletion = $memberResponesToDelete;
foreach ($memberResponesToDelete as $memberResponeRemoved) {
$memberResponeRemoved->setProduk(null);
}
$this->collMemberRespones = null;
foreach ($memberRespones as $memberRespone) {
$this->addMemberRespone($memberRespone);
}
$this->collMemberRespones = $memberRespones;
$this->collMemberResponesPartial = false;
return $this;
} | [
"public function touchOwners()\n {\n foreach ($this->getTouchedRelations() as $relation) {\n $this->$relation()->touch();\n\n if ($this->$relation instanceof self) {\n $this->$relation->fireModelEvent('saved', false);\n\n $this->$relation->touchOwners();\n } elseif ($this->$relation instanceof Collection) {\n $this->$relation->each->touchOwners();\n }\n }\n }",
"public function touchOwners()\n {\n foreach ($this->touches as $relation) {\n if ($this->$relation instanceof self) {\n $this->$relation->touch();\n $this->$relation->touchOwners();\n } elseif (is_array($this->$relation)) {\n foreach ($this->$relation as $relation) {\n $relation->touchOwners();\n }\n }\n }\n }",
"public function setNotificacionsRelatedById_receptor(PropelCollection $notificacionsRelatedById_receptor, PropelPDO $con = null)\n\t{\n\t\t$this->notificacionsRelatedById_receptorScheduledForDeletion = $this->getNotificacionsRelatedById_receptor(new Criteria(), $con)->diff($notificacionsRelatedById_receptor);\n\n\t\tforeach ($notificacionsRelatedById_receptor as $notificacionRelatedById_receptor) {\n\t\t\t// Fix issue with collection modified by reference\n\t\t\tif ($notificacionRelatedById_receptor->isNew()) {\n\t\t\t\t$notificacionRelatedById_receptor->setUsuarioRelatedById_receptor($this);\n\t\t\t}\n\t\t\t$this->addNotificacionRelatedById_receptor($notificacionRelatedById_receptor);\n\t\t}\n\n\t\t$this->collNotificacionsRelatedById_receptor = $notificacionsRelatedById_receptor;\n\t}",
"public function setMensajesRelatedByIdrespuesta(Collection $mensajesRelatedByIdrespuesta, ConnectionInterface $con = null)\n {\n $this->clearMensajesRelatedByIdrespuesta();\n $currentMensajesRelatedByIdrespuesta = $this->getMensajesRelatedByIdrespuesta();\n\n $mensajesRelatedByIdrespuestaScheduledForDeletion = $currentMensajesRelatedByIdrespuesta->diff($mensajesRelatedByIdrespuesta);\n\n foreach ($mensajesRelatedByIdrespuestaScheduledForDeletion as $toDelete) {\n $this->removeMensajeRelatedByIdrespuesta($toDelete);\n }\n\n foreach ($mensajesRelatedByIdrespuesta as $mensajeRelatedByIdrespuesta) {\n if (!$currentMensajesRelatedByIdrespuesta->contains($mensajeRelatedByIdrespuesta)) {\n $this->doAddMensajeRelatedByIdrespuesta($mensajeRelatedByIdrespuesta);\n }\n }\n\n $this->collMensajesRelatedByIdrespuestaPartial = false;\n $this->collMensajesRelatedByIdrespuesta = $mensajesRelatedByIdrespuesta;\n\n return $this;\n }",
"public function syncManyFollowings(Collection $entities);",
"public function setTelefones(PropelCollection $telefones, PropelPDO $con = null)\n {\n $telefonesToDelete = $this->getTelefones(new Criteria(), $con)->diff($telefones);\n\n $this->telefonesScheduledForDeletion = unserialize(serialize($telefonesToDelete));\n\n foreach ($telefonesToDelete as $telefoneRemoved) {\n $telefoneRemoved->setPessoa(null);\n }\n\n $this->collTelefones = null;\n foreach ($telefones as $telefone) {\n $this->addTelefone($telefone);\n }\n\n $this->collTelefones = $telefones;\n $this->collTelefonesPartial = false;\n\n return $this;\n }",
"public function touchOwners()\n {\n foreach ($this->touches as $relation) {\n $this->$relation()->touch();\n\n if (! is_null($this->$relation)) {\n $this->$relation->touchOwners();\n }\n }\n }",
"private function ormCascadeUpdate()\n {\n foreach ($this->orm['relations'] as $class => $relDetail)\n {\t \n\t // Make sure the related object is available. It should always be.\n\t if (!isset($this->$class))\n\t {\n\t continue;\n\t }\n\t \n\t // $ref will be a pointer to the related object.\t \n\t $ref = $this->$class;\n\n\t if ($ref->isDirty())\n\t {\n\t $ref->ormUpdate(); \n\t }\n }\n }",
"public function setRuangsRelatedByIdRuang(PropelCollection $ruangsRelatedByIdRuang, PropelPDO $con = null)\n {\n $ruangsRelatedByIdRuangToDelete = $this->getRuangsRelatedByIdRuang(new Criteria(), $con)->diff($ruangsRelatedByIdRuang);\n\n $this->ruangsRelatedByIdRuangScheduledForDeletion = unserialize(serialize($ruangsRelatedByIdRuangToDelete));\n\n foreach ($ruangsRelatedByIdRuangToDelete as $ruangRelatedByIdRuangRemoved) {\n $ruangRelatedByIdRuangRemoved->setRuangRelatedByParentIdRuang(null);\n }\n\n $this->collRuangsRelatedByIdRuang = null;\n foreach ($ruangsRelatedByIdRuang as $ruangRelatedByIdRuang) {\n $this->addRuangRelatedByIdRuang($ruangRelatedByIdRuang);\n }\n\n $this->collRuangsRelatedByIdRuang = $ruangsRelatedByIdRuang;\n $this->collRuangsRelatedByIdRuangPartial = false;\n\n return $this;\n }",
"public function updatePivotRecords()\n {\n $pivots = $this->entityMap->getPivotRelationships();\n\n foreach ($pivots as $pivot) {\n if (array_key_exists($pivot, $this->relationships)) {\n $this->updatePivotRelation($pivot);\n }\n }\n }",
"public function touchOwners()\n {\n foreach ($this->touches as $relation) {\n $this->{$relation}()->touch();\n }\n }",
"public function setOOEntrys(PropelCollection $oOEntrys, PropelPDO $con = null)\n\t{\n\t\t$this->oOEntrysScheduledForDeletion = $this->getOOEntrys(new Criteria(), $con)->diff($oOEntrys);\n\n\t\tforeach ($oOEntrys as $oOEntry) {\n\t\t\t// Fix issue with collection modified by reference\n\t\t\tif ($oOEntry->isNew()) {\n\t\t\t\t$oOEntry->setUser($this);\n\t\t\t}\n\t\t\t$this->addOOEntry($oOEntry);\n\t\t}\n\n\t\t$this->collOOEntrys = $oOEntrys;\n\t}",
"public function setMous(PropelCollection $mous, PropelPDO $con = null)\n {\n $mousToDelete = $this->getMous(new Criteria(), $con)->diff($mous);\n\n $this->mousScheduledForDeletion = unserialize(serialize($mousToDelete));\n\n foreach ($mousToDelete as $mouRemoved) {\n $mouRemoved->setDudi(null);\n }\n\n $this->collMous = null;\n foreach ($mous as $mou) {\n $this->addMou($mou);\n }\n\n $this->collMous = $mous;\n $this->collMousPartial = false;\n\n return $this;\n }",
"public function setMensajeRespuestasRelatedByIdmensaje(Collection $mensajeRespuestasRelatedByIdmensaje, ConnectionInterface $con = null)\n {\n /** @var ChildMensajeRespuesta[] $mensajeRespuestasRelatedByIdmensajeToDelete */\n $mensajeRespuestasRelatedByIdmensajeToDelete = $this->getMensajeRespuestasRelatedByIdmensaje(new Criteria(), $con)->diff($mensajeRespuestasRelatedByIdmensaje);\n\n \n //since at least one column in the foreign key is at the same time a PK\n //we can not just set a PK to NULL in the lines below. We have to store\n //a backup of all values, so we are able to manipulate these items based on the onDelete value later.\n $this->mensajeRespuestasRelatedByIdmensajeScheduledForDeletion = clone $mensajeRespuestasRelatedByIdmensajeToDelete;\n\n foreach ($mensajeRespuestasRelatedByIdmensajeToDelete as $mensajeRespuestaRelatedByIdmensajeRemoved) {\n $mensajeRespuestaRelatedByIdmensajeRemoved->setMensajeRelatedByIdmensaje(null);\n }\n\n $this->collMensajeRespuestasRelatedByIdmensaje = null;\n foreach ($mensajeRespuestasRelatedByIdmensaje as $mensajeRespuestaRelatedByIdmensaje) {\n $this->addMensajeRespuestaRelatedByIdmensaje($mensajeRespuestaRelatedByIdmensaje);\n }\n\n $this->collMensajeRespuestasRelatedByIdmensaje = $mensajeRespuestasRelatedByIdmensaje;\n $this->collMensajeRespuestasRelatedByIdmensajePartial = false;\n\n return $this;\n }",
"public function setMembrosRelatedByFilialId(PropelCollection $membrosRelatedByFilialId, PropelPDO $con = null)\n\t{\n\t\t$this->membrosRelatedByFilialIdScheduledForDeletion = $this->getMembrosRelatedByFilialId(new Criteria(), $con)->diff($membrosRelatedByFilialId);\n\n\t\tforeach ($membrosRelatedByFilialId as $membroRelatedByFilialId) {\n\t\t\t// Fix issue with collection modified by reference\n\t\t\tif ($membroRelatedByFilialId->isNew()) {\n\t\t\t\t$membroRelatedByFilialId->setIgrejaRelatedByFilialId($this);\n\t\t\t}\n\t\t\t$this->addMembroRelatedByFilialId($membroRelatedByFilialId);\n\t\t}\n\n\t\t$this->collMembrosRelatedByFilialId = $membrosRelatedByFilialId;\n\t}",
"public function setParticipantes(Collection $participantes, ConnectionInterface $con = null)\n {\n /** @var ChildParticipante[] $participantesToDelete */\n $participantesToDelete = $this->getParticipantes(new Criteria(), $con)->diff($participantes);\n\n\n //since at least one column in the foreign key is at the same time a PK\n //we can not just set a PK to NULL in the lines below. We have to store\n //a backup of all values, so we are able to manipulate these items based on the onDelete value later.\n $this->participantesScheduledForDeletion = clone $participantesToDelete;\n\n foreach ($participantesToDelete as $participanteRemoved) {\n $participanteRemoved->setEvento(null);\n }\n\n $this->collParticipantes = null;\n foreach ($participantes as $participante) {\n $this->addParticipante($participante);\n }\n\n $this->collParticipantes = $participantes;\n $this->collParticipantesPartial = false;\n\n return $this;\n }",
"public function setCartsRelatedByUpdatedBy(PropelCollection $cartsRelatedByUpdatedBy, PropelPDO $con = null)\n {\n $this->cartsRelatedByUpdatedByScheduledForDeletion = $this->getCartsRelatedByUpdatedBy(new Criteria(), $con)->diff($cartsRelatedByUpdatedBy);\n\n foreach ($this->cartsRelatedByUpdatedByScheduledForDeletion as $cartRelatedByUpdatedByRemoved) {\n $cartRelatedByUpdatedByRemoved->setsfGuardUserRelatedByUpdatedBy(null);\n }\n\n $this->collCartsRelatedByUpdatedBy = null;\n foreach ($cartsRelatedByUpdatedBy as $cartRelatedByUpdatedBy) {\n $this->addCartRelatedByUpdatedBy($cartRelatedByUpdatedBy);\n }\n\n $this->collCartsRelatedByUpdatedBy = $cartsRelatedByUpdatedBy;\n }",
"public function setwpPostsRelatedById(PropelCollection $wpPostsRelatedById, PropelPDO $con = null)\n {\n $this->wpPostsRelatedByIdScheduledForDeletion = $this->getwpPostsRelatedById(new Criteria(), $con)->diff($wpPostsRelatedById);\n\n foreach ($wpPostsRelatedById as $wpPostRelatedById)\n {\n // Fix issue with collection modified by reference\n if ($wpPostRelatedById->isNew())\n {\n $wpPostRelatedById->setwpPostRelatedByPostParent($this);\n }\n $this->addwpPostRelatedById($wpPostRelatedById);\n }\n\n $this->collwpPostsRelatedById = $wpPostsRelatedById;\n }",
"public function setReferences(Collection $references);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Disable a module from its slug. | public function disable($slug)
{
return response()->json([$slug => Module::disable($slug)]);
} | [
"public function disable(Module $module);",
"protected function disable_module()\n {\n global $moduleList;\n foreach ($this->modulesInPackage as $module) {\n unset($moduleList[array_search($module, $moduleList)]);\n }\n }",
"function variable_module_disable($module) {\n}",
"public function disableModule($moduleName = 'Demo'){\n \n Module::disable($moduleName); \n return true;\n }",
"function admin_disable($id = null) {\n\n\t\t$module = $this->Module->read(null, $id);\n\n\t\t/**\n\t\t * Read the \"Status\" component for more informations.\n\t\t * Dir : controllers/components/status.php\n\t\t */\n\t\tif (!empty($module)) {\n\n\t\t\t$module['Module']['status'] = 1;\n\n\t\t\t/**\n\t\t\t * Change the module status.\n\t\t\t * Redirect the user to index page.\n\t\t\t */\n\t\t\tif ($this->Module->save($module)) {\n\t\t\t\t$this->Session->setFlash(__d('core', 'The module has been disabled.', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t}\n\t\t}\n\n\t}",
"function hook_modules_disabled($modules) {\n if (in_array('lousy_module', $modules)) {\n mymodule_enable_functionality();\n }\n}",
"public function disable()\n {\n $this->switchActive(false, 'disabling', 'disabled');\n }",
"public function disableModule()\n {\n $this->setConfigValue('newrelicreporting/general/enable', 0);\n }",
"public function disable()\n {\n $this->app['events']->fire('plugin.disabling', [$this]);\n\n $this->setActive(0);\n\n $this->app['events']->fire('plugin.disabled', [$this]);\n }",
"public function getDisableModule(){\n \n return $this->_disabledModules;\n }",
"protected function registerDisableCommand()\n {\n $this->app->singleton('command.module.disable', function () {\n return new \\Pw\\Core\\Console\\Commands\\ModuleDisableCommand();\n });\n\n $this->commands('command.module.disable');\n }",
"public function disable_extension()\r\n {\r\n \tif (APP_VER < 2.0)\r\n \t{\r\n \t\treturn ee()->output->show_user_error('general', str_replace('%url%', \r\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\tBASE.AMP.'C=modules',\r\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\tee()->lang->line('disable_module_to_disable_extension')));\r\n\t\t}\t\t\t\t\t\r\n\t}",
"static function deactivate($module_name)\n\t{\n\t\t$installer_class = ucfirst($module_name).'_Installer';\n\t\tif (is_callable( array($installer_class, \"deactivate\") ))\n\t\t{\n\t\t\tcall_user_func_array(array(\n\t\t\t\t$installer_class,\n\t\t\t\t\"deactivate\"\n\t\t\t), array());\n\t\t}\n\n\t\t$module = self::get($module_name);\n\t\tif ($module->loaded())\n\t\t{\n\t\t\t$module->active = false;\n\t\t\t$module->save();\n\t\t}\n\n\t\t//clear any cache for sure\n\t\tGleez::cache('load_modules', '');\n\n\t\tModule::load_modules(TRUE);\n\n\t\tKohana::$log->add(LOG::INFO, 'Deactivated module :module_name', array(':module_name' => $module_name) );\n\t}",
"public function disable()\n {\n $this->data['enabled'] = false;\n }",
"public function disable(): void\n {\n $prepared = $this->database->prepare(\n 'UPDATE \"' . NEL_PLUGINS_TABLE . '\" SET \"enabled\" = 0 WHERE \"plugin_id\" = ?');\n $this->database->executePrepared($prepared, [$this->id()]);\n }",
"public function disable();",
"function admin_disable($id = null) {\n\n\t\t$offer = $this->Offer->read(null, $id);\n\n\t\t/**\n\t\t * Read the \"Status\" component for more informations.\n\t\t * Dir : controllers/components/status.php\n\t\t */\n\t\tif (!empty($offer)) {\n\n\t\t\t$offer['Offer']['status'] = 1;\n\n\t\t\t/**\n\t\t\t * Change the module status.\n\t\t\t * Redirect the user to index page.\n\t\t\t */\n\t\t\tif ($this->Offer->save($offer)) {\n\t\t\t\t$this->Session->setFlash(__d('core', 'The offer has been disabled.', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t}\n\t\t}\n\n\t}",
"public function disableProduct($id)\r\n {\r\n }",
"public function disable()\n {\n $this->server_item->setDisabled(true);\n $this->course_item->setDisabled(true);\n $this->clearCommandButtons();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter the query on the id_product column Example usage: $query>filterByIdProduct(1234); // WHERE id_product = 1234 $query>filterByIdProduct(array(12, 34)); // WHERE id_product IN (12, 34) $query>filterByIdProduct(array('min' => 12)); // WHERE id_product >= 12 $query>filterByIdProduct(array('max' => 12)); // WHERE id_product | public function filterByIdProduct($idProduct = null, $comparison = null)
{
if (is_array($idProduct)) {
$useMinMax = false;
if (isset($idProduct['min'])) {
$this->addUsingAlias(ReviewPeer::ID_PRODUCT, $idProduct['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($idProduct['max'])) {
$this->addUsingAlias(ReviewPeer::ID_PRODUCT, $idProduct['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ReviewPeer::ID_PRODUCT, $idProduct, $comparison);
} | [
"public function filterByIdProduct($idProduct = null, $comparison = null)\n\t{\n\t\tif (is_array($idProduct)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idProduct['min'])) {\n\t\t\t\t$this->addUsingAlias(Oops_Db_ProductAttributePeer::ID_PRODUCT, $idProduct['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($idProduct['max'])) {\n\t\t\t\t$this->addUsingAlias(Oops_Db_ProductAttributePeer::ID_PRODUCT, $idProduct['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_ProductAttributePeer::ID_PRODUCT, $idProduct, $comparison);\n\t}",
"function setProductFilter($productId) {\n\t\t\treturn $this->addFieldToFilter( 'product_id', $productId );\n\t\t}",
"public function filterByProductId($productId = null, $comparison = null)\n {\n if (is_array($productId)) {\n $useMinMax = false;\n if (isset($productId['min'])) {\n $this->addUsingAlias(ProductPeer::PRODUCT_ID, $productId['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($productId['max'])) {\n $this->addUsingAlias(ProductPeer::PRODUCT_ID, $productId['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(ProductPeer::PRODUCT_ID, $productId, $comparison);\n }",
"public function filterByIdProductAttribute($idProductAttribute = null, $comparison = null)\n\t{\n\t\tif (is_array($idProductAttribute)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idProductAttribute['min'])) {\n\t\t\t\t$this->addUsingAlias(Oops_Db_CustomizationPeer::ID_PRODUCT_ATTRIBUTE, $idProductAttribute['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($idProductAttribute['max'])) {\n\t\t\t\t$this->addUsingAlias(Oops_Db_CustomizationPeer::ID_PRODUCT_ATTRIBUTE, $idProductAttribute['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_CustomizationPeer::ID_PRODUCT_ATTRIBUTE, $idProductAttribute, $comparison);\n\t}",
"public function filterByIdproducto($idproducto = null, $comparison = null)\n {\n if (is_array($idproducto)) {\n $useMinMax = false;\n if (isset($idproducto['min'])) {\n $this->addUsingAlias(ProductomaterialPeer::IDPRODUCTO, $idproducto['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idproducto['max'])) {\n $this->addUsingAlias(ProductomaterialPeer::IDPRODUCTO, $idproducto['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(ProductomaterialPeer::IDPRODUCTO, $idproducto, $comparison);\n }",
"public function filterByProductId($productId = null, $comparison = null)\n {\n if (is_array($productId)) {\n $useMinMax = false;\n if (isset($productId['min'])) {\n $this->addUsingAlias(DegressifProductsTableMap::PRODUCT_ID, $productId['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($productId['max'])) {\n $this->addUsingAlias(DegressifProductsTableMap::PRODUCT_ID, $productId['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(DegressifProductsTableMap::PRODUCT_ID, $productId, $comparison);\n }",
"public function getProductsByUserFiltered($start, $limit, $user, $categoria, $fechaMin, $fechaMax, $textFilter): array {\n\n $idUser = $user->getId();\n $categoria = intval($categoria);\n\n $productos = \"\";\n\n $sql = \"SELECT * FROM Productos WHERE Usuario = :usuario order by Fecha LIMIT :start, :limit\";\n\n if (empty($fechaMin) && empty($fechaMax) && empty($textFilter) && !empty($categoria)){ //Sols categoria\n $sql = \"SELECT * FROM Productos where (Usuario = :usuario) and (Categoria=:categoria) order by Fecha LIMIT :start, :limit\";\n\n }elseif(!empty($fechaMin) && !empty($fechaMax) && !empty($textFilter) && !empty($categoria)){ //TOT\n $sql = \"SELECT * FROM Productos where (Usuario = :usuario) and (Categoria=:categoria) and (Fecha BETWEEN :fechaMin AND :fechaMax) and (Nombre LIKE :textFilter or Descripcion LIKE :textFilter2) order by Fecha LIMIT :start, :limit\";\n\n }elseif(!empty($fechaMin) && !empty($fechaMax) && empty($textFilter) && empty($categoria)){ //Sols dates\n $sql =\"SELECT * FROM Productos where (Usuario = :usuario) and (Fecha BETWEEN :fechaMin AND :fechaMax) order by Fecha LIMIT :start, :limit\";\n\n }elseif(empty($fechaMin) && empty($fechaMax) && !empty($textFilter) && empty($categoria)){ //Sols text\n $sql = \"SELECT * FROM Productos where (Usuario = :usuario) and (Nombre LIKE :textFilter or Descripcion LIKE :textFilter2) order by Fecha LIMIT :start, :limit\";\n\n }elseif(!empty($fechaMin) && !empty($fechaMax) && !empty($textFilter) && empty($categoria)){ //Sols dates i text\n $sql = \"SELECT * FROM Productos where (Usuario = :usuario) and (Fecha BETWEEN :fechaMin AND :fechaMax) and (Nombre LIKE :textFilter or Descripcion LIKE :textFilter2) order by Fecha LIMIT :start, :limit\";\n\n }elseif(empty($fechaMin) && empty($fechaMax) && !empty($textFilter) && !empty($categoria)){ //Sols categories i text\n $sql = \"SELECT * FROM Productos where (Usuario = :usuario) and (Categoria = :categoria) and (Nombre LIKE :textFilter or Descripcion LIKE :textFilter2) order by Fecha LIMIT :start, :limit\";\n\n }elseif(!empty($fechaMin) && !empty($fechaMax) && empty($textFilter) && !empty($categoria)){ //Sols categories i dates\n $sql = \"SELECT * FROM Productos where (Usuario = :usuario) and (Categoria = :categoria) and (Fecha BETWEEN :fechaMin AND :fechaMax) order by Fecha LIMIT :start, :limit\";\n\n }\n\n $result = $this->pdo->prepare($sql);\n\n if (empty($fechaMin) && empty($fechaMax) && empty($textFilter) && !empty($categoria)){ //Soles categoria\n $result->bindParam(':usuario', $idUser, PDO::PARAM_INT);\n $result->bindParam(':categoria', $categoria, PDO::PARAM_INT);\n\n }elseif(!empty($fechaMin) && !empty($fechaMax) && !empty($textFilter) && !empty($categoria)){ //TOT\n $result->bindParam(':usuario', $idUser, PDO::PARAM_INT);\n $result->bindParam(':categoria', $categoria, PDO::PARAM_INT);\n $result->bindParam(':fechaMin', $fechaMin);\n $result->bindParam(':fechaMax', $fechaMax);\n $textFilter = \"%\".$textFilter.\"%\";\n $result->bindParam(':textFilter', $textFilter, PDO::PARAM_STR);\n $result->bindParam(':textFilter2', $textFilter, PDO::PARAM_STR);\n\n }elseif(!empty($fechaMin) && !empty($fechaMax) && empty($textFilter) && empty($categoria)){ //Soles dates\n $result->bindParam(':usuario', $idUser, PDO::PARAM_INT);\n $result->bindParam(':fechaMin', $fechaMin);\n $result->bindParam(':fechaMax', $fechaMax);\n\n }elseif(empty($fechaMin) && empty($fechaMax) && !empty($textFilter) && empty($categoria)){ //Soles text\n $result->bindParam(':usuario', $idUser, PDO::PARAM_INT);\n $textFilter = \"%\".$textFilter.\"%\";\n $result->bindParam(':textFilter', $textFilter, PDO::PARAM_STR);\n $result->bindParam(':textFilter2', $textFilter, PDO::PARAM_STR);\n }elseif(!empty($fechaMin) && !empty($fechaMax) && !empty($textFilter) && empty($categoria)){ //Text i dates\n $result->bindParam(':usuario', $idUser, PDO::PARAM_INT);\n $textFilter = \"%\".$textFilter.\"%\";\n $result->bindParam(':textFilter', $textFilter, PDO::PARAM_STR);\n $result->bindParam(':textFilter2', $textFilter, PDO::PARAM_STR);\n $result->bindParam(':fechaMin', $fechaMin);\n $result->bindParam(':fechaMax', $fechaMax);\n\n }elseif(empty($fechaMin) && empty($fechaMax) && !empty($textFilter) && !empty($categoria)){ //Sols categories i text\n\n $textFilter = \"%\".$textFilter.\"%\";\n\n $result->bindParam(':categoria', $categoria, PDO::PARAM_INT);\n $result->bindParam(':usuario', $idUser, PDO::PARAM_INT);\n $result->bindParam(':textFilter', $textFilter, PDO::PARAM_STR);\n $result->bindParam(':textFilter2', $textFilter, PDO::PARAM_STR);\n\n }elseif(!empty($fechaMin) && !empty($fechaMax) && empty($textFilter) && !empty($categoria)){ //Sols categories i dates\n $result->bindParam(':usuario', $idUser, PDO::PARAM_INT);\n $result->bindParam(':categoria', $categoria, PDO::PARAM_INT);\n $result->bindParam(':fechaMin', $fechaMin);\n $result->bindParam(':fechaMax', $fechaMax);\n }\n\n $result->bindParam(\":start\", $start, PDO::PARAM_INT);\n $result->bindParam(\":limit\", $limit, PDO::PARAM_INT);\n $result->bindParam(':usuario', $idUser, PDO::PARAM_INT);\n\n $result->execute();\n\n $productos = $result->fetchAll(PDO::FETCH_CLASS | PDO::FETCH_PROPS_LATE, $this->className);\n\n return $productos;\n\n }",
"public function filterByIdproducto($idproducto = null, $comparison = null)\n {\n if (is_array($idproducto)) {\n $useMinMax = false;\n if (isset($idproducto['min'])) {\n $this->addUsingAlias(PedidoPeer::IDPRODUCTO, $idproducto['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idproducto['max'])) {\n $this->addUsingAlias(PedidoPeer::IDPRODUCTO, $idproducto['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(PedidoPeer::IDPRODUCTO, $idproducto, $comparison);\n }",
"public function filterByProductsId($productsId = null, $comparison = null)\n {\n if (is_array($productsId)) {\n $useMinMax = false;\n if (isset($productsId['min'])) {\n $this->addUsingAlias(ProductsDomainsPricesPeer::PRODUCTS_ID, $productsId['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($productsId['max'])) {\n $this->addUsingAlias(ProductsDomainsPricesPeer::PRODUCTS_ID, $productsId['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(ProductsDomainsPricesPeer::PRODUCTS_ID, $productsId, $comparison);\n }",
"public function getProductsById($id) {\n }",
"public function testFilterById()\n {\n // find by single id\n $book = PropelQuery::from('Book b')\n ->where('b.Title like ?', 'Don%')\n ->orderBy('b.ISBN', 'desc')\n ->findOne();\n\n $c = BookQuery::create()->filterById($book->getId());\n\n $book2 = $c->findOne();\n\n $this->assertTrue($book2 instanceof Book);\n $this->assertEquals('Don Juan', $book2->getTitle());\n\n //find range\n $booksAll = PropelQuery::from('Book b')\n ->orderBy('b.ID', 'asc')\n ->find();\n\n $booksIn = BookQuery::create()\n ->filterById(array($booksAll[1]->getId(), $booksAll[2]->getId()))\n ->find();\n\n $this->assertTrue($booksIn[0] == $booksAll[1]);\n $this->assertTrue($booksIn[1] == $booksAll[2]);\n\n // filter by min value with greater equal\n $booksIn = null;\n\n $booksIn = BookQuery::create()\n ->filterById(\n array('min' => $booksAll[2]->getId()))\n ->find();\n\n $this->assertTrue($booksIn[1] == $booksAll[3]);\n\n // filter by max value with less equal\n $booksIn = null;\n\n $booksIn = BookQuery::create()\n ->filterById(\n array('max' => $booksAll[1]->getId()) )\n ->find();\n\n $this->assertTrue($booksIn[1] == $booksAll[1]);\n\n // check backwards compatibility:\n // SELECT FROM `book` WHERE book.id IN (:p1,:p2)\n // must be the same as\n // SELECT FROM `book` WHERE (book.id>=:p1 AND book.id<=:p2)\n\n $minMax = BookQuery::create()\n ->filterById(\n array('min' => $booksAll[1]->getId(),\n 'max' => $booksAll[2]->getId())\n )\n ->find();\n\n $In = BookQuery::create()\n ->filterById(\n array($booksAll[1]->getId(),\n $booksAll[2]->getId())\n )\n ->find();\n\n $this->assertTrue($minMax[0] === $In[0]);\n $this->assertTrue(count($minMax->getData()) === count($In->getData()));\n }",
"public function findProduct($id);",
"public function getProductByFilter($filter)\r\n\t{\r\n\t\tif(!empty($filter))\r\n\t\t{\r\n\t\t\t$sql= new Sql($this->adapter);\r\n\t\t\t$select = $sql->select('products')->where(\"category_id=$filter\");\r\n\t\t\t$st = $sql->prepareStatementForSqlObject($select)->execute();\r\n\t\t\t$rs = new ResultSet();\r\n\t\t\treturn $rs->initialize($st)->buffer()->toArray();\r\n\t\t}\r\n\t}",
"public function getFilter($id);",
"public function getProductListById($id) \n {\n $rows = new Query();\n\n $result = $rows->select(['product.id', 'product.supplier_id', 'supplier.supplier_code', 'supplier.supplier_name', 'product.product_code', 'product.product_name', 'product.quantity', 'product.cost_price', 'product.selling_price' ])\n ->from('product')\n ->join('INNER JOIN', 'supplier', 'product.supplier_id = supplier.id')\n ->where(['product.id' => $id])\n ->andWhere(['product.status' => 1])\n ->orderBy('product.id')\n ->all();\n\n if( count($result) > 0 ) {\n return $result;\n }else {\n return 0;\n } \n }",
"public function filterByProductoId($productoId = null, $comparison = null)\n {\n if (is_array($productoId)) {\n $useMinMax = false;\n if (isset($productoId['min'])) {\n $this->addUsingAlias(PromocionPeer::PRODUCTO_ID, $productoId['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($productoId['max'])) {\n $this->addUsingAlias(PromocionPeer::PRODUCTO_ID, $productoId['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(PromocionPeer::PRODUCTO_ID, $productoId, $comparison);\n }",
"public function loadFilteredProducts(){\n\t $params = $this->getRequest()->getParams(); \n\t\t$_from = (isset($params[\"from\"])?intval($params[\"from\"]):0);\n\t\t$_to =(isset($params[\"to\"])?intval($params[\"to\"]):0); \n\t\t$category_id =(isset($params[\"category_id\"])?intval($params[\"category_id\"]):0); \n\t\t$_limit_start =(isset($params[\"limit_start\"])?intval($params[\"limit_start\"]):0);\n\t\t$flg_pr =(isset($params[\"flg_pr\"])?intval($params[\"flg_pr\"]):0);\n\t\t$_limit_end = intval($params[\"number_of_product_display\"]); \n\t\t \n\t\t$collection = Mage::getModel('catalog/product')->getCollection(); \n\t\t$collection->addAttributeToSelect('image'); \n\t\t$collection->addStoreFilter();\n\t\tMage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);\n\t\tMage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection); \n\t\t$this->addProductAttributesAndPrices($collection); \n\t\t \n\t\tif($category_id>0){\n\t\t\t $collection->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'inner')\n\t\t\t\t->addAttributeToFilter('category_id', array('in' => array($category_id)));\n\t\t}else{\n\t\t\t\t$category_res = $this->_getCategories();\n\t\t\t\t$_all_active_category = array();\n\t\t\t\tforeach($category_res as $_category){\n\t\t\t\t\t$_all_active_category[] =\t$_category->getId();\n\t\t\t\t}\n\t\t\t\t$collection->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'inner')\n\t\t\t\t\t->addAttributeToFilter('category_id', array('in' => $_all_active_category)); \n\t\t} \n\t\t \n\t\t$collection->getSelect()->where('price_index.min_price <= '.$_to.' and price_index.min_price >= '.$_from)->limit($_limit_end,$_limit_start)->group('e.entity_id')->order('price_index.min_price', 'asc');\n\t\t$collection->load();\n\t\treturn $collection;\n\t}",
"public function filter_ticket_product_id_query( $query ) {\n\t\tglobal $typenow;\n\n\t\tif ( 'event_ticket' !== $typenow ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( empty( $_GET['filter_ticket_product_id'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! empty( $query->query_vars['suppress_filters'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$query->query_vars['meta_query'] = array(\n\t\t\tarray(\n\t\t\t\t'key' => '_product_id',\n\t\t\t\t'value' => absint( $_GET['filter_ticket_product_id'] ),\n\t\t\t)\n\t\t);\n\t}",
"public function filterByIdProducto($idProducto = null, $comparison = null)\n\t{\n\t\tif (is_array($idProducto)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idProducto['min'])) {\n\t\t\t\t$this->addUsingAlias(DetallePedidoPeer::ID_PRODUCTO, $idProducto['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($idProducto['max'])) {\n\t\t\t\t$this->addUsingAlias(DetallePedidoPeer::ID_PRODUCTO, $idProducto['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(DetallePedidoPeer::ID_PRODUCTO, $idProducto, $comparison);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Affiche la table Contact Person | public function showContactPersonsTable() {
$stmt = $this->connect()->query("SELECT * FROM contact_person");
echo "<h3>Contact Person Table</h3>";
echo "<table><tr><td>" . "phone_number" . "</td><td>" . "email" . "</td></tr>";
while ($row = $stmt->fetch()) {
echo "<tr><td>" . $row['phone_number'] . "</td><td>" . $row['email'] . "</td></tr>";
}
echo "</table>";
} | [
"public function countPersonContacts()\n {\n\n $db = $this->getDb();\n \n $sql = <<<SQL\nSELECT\n count(contact.rowid) as number\nFROM\n core_contact_r contact\nJOIN core_person_r person\n ON contact.id_person = person.rowid\nWHERE person.type = 1;\n \nSQL;\n \n return $db->select($sql)->getField('number');\n\n }",
"public function allPersons()\n {\n // con consultas SQL\n $Persons = $this->db->query(\"SELECT * FROM persons\");\n // Retornar el resultado (Arreglo de Objetos)\n return $Persons->getResult();\n\n // 2. Query Builder: retornar todos los registros de la tabla Personas\n // con métodos predefinidos. Para que funcione se debe consultar en la\n // vista como un arreglo asociativo. Ejm: person['name']\n // $Persons = $this->orderBy('id_person', 'ASC')->findAll();\n // Retornar el resultado (Arreglo Asociativo)\n // return $Persons;\n }",
"function getAllDataOnTable(){\n\t\t$contacts = $this->emailModel->getList('contacts');\n\t\t$data = \"\";\n\t\tforeach($contacts as $contact){\n\t\t\t$data .= '<tr><td>'.$contact->name.'</td>';\n\t\t\t$data .= '<td>'.$contact->email.'</td>';\n\t\t\t$data .= '<td>'.$contact->mobile.'</td></tr>';\n\t\t}\n\t\techo $data;\n\t}",
"public function forPerson(Person $person)\n {\n return Contact::where('person_id', $person->id)\n ->orderBy('created_at', 'asc')\n ->get();\n }",
"function getPeople() {\n $conn = dbConnect();\n $conn->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);\n $data_people = $conn->query('SELECT id_people, first_name, last_name, email, name FROM people JOIN company ON fk_comp = id_company');\n return $data_people;\n}",
"public function buscar_informacion_contacto(){\n \n \t\t$consulta->$this->db->query(\"SELECT * FROM contacto\");\n \n \twhile($filas=$consulta->fetch_assoc()){\n \n \t\t$this->informacion[]=$filas;\n \n \t}\n \n \treturn $this->informacion;\n\t}",
"public function getContactos();",
"public function listPersons() {\n $stm = $this->prepare(\"select id, fname, sname from serverside19_persons\");\n $stm->execute();\n return $stm->fetchAll(PDO::FETCH_CLASS); \n }",
"function get_contact_person($person_id)\n {\n return $this->db->get_where('contact_person',array('person_id'=>$person_id))->row_array();\n }",
"public function getAll(){\r\n\t\t$sql=\"select * from person_salle_confe\";\r\n\t\treturn $this->_db->query($sql);\r\n\t}",
"function member_contact_table ($opts) {\n \n // Get contact data\n $data = member_contact_data($opts);\n $contact = $data[0];\n if (empty($contact) || count($contact) < 1) {\n return array();\n }\n \n // Initialize table\n $table = array(\n \"id\" => '',\n \"class\" => '',\n \"rows\" => array(),\n \"columns\" => array()\n );\n \n // Add columns\n $table['columns'][] = array(\"title\"=>'Name', 'class'=>'', 'id'=>'');\n $table['columns'][] = array(\"title\"=>'Email', 'class'=>'', 'id'=>'');\n $table['columns'][] = array(\"title\"=>'Phone', 'class'=>'', 'id'=>'');\n $table['columns'][] = array(\"title\"=>'Emergency contact', 'class'=>'', 'id'=>'');\n $table['columns'][] = array(\"title\"=>'Emergency phone', 'class'=>'', 'id'=>'');\n \n // Add row\n $table['rows'][] = array(\n member_name($contact['firstName'], $contact['middleName'], $contact['lastName']),\n $contact['email'],\n $contact['phone'],\n $contact['emergencyName'],\n $contact['emergencyPhone']\n );\n \n return $table;\n}",
"function get_person_data_row($person)\n{\n\t$CI =& get_instance();\n\t$controller_name = strtolower(get_class($CI));\n\n\treturn array (\n\t\t'people.person_id' => $person->person_id,\n\t\t'last_name' => $person->last_name,\n\t\t'first_name' => $person->first_name,\n\t\t'email' => empty($person->email) ? '' : mailto($person->email, $person->email),\n\t\t'phone_number' => $person->phone_number,\n\t\t'messages' => empty($person->phone_number) ? '' : anchor(\"Messages/view/$person->person_id\", '<span class=\"glyphicon glyphicon-phone\"></span>',\n\t\t\tarray('class'=>'modal-dlg', 'data-btn-submit' => $CI->lang->line('common_submit'), 'title'=>$CI->lang->line('messages_sms_send'))),\n\t\t'edit' => anchor($controller_name.\"/view/$person->person_id\", '<span class=\"glyphicon glyphicon-edit\"></span>',\n\t\t\tarray('class'=>'modal-dlg', 'data-btn-submit' => $CI->lang->line('common_submit'), 'title'=>$CI->lang->line($controller_name.'_update'))\n\t));\n}",
"public function listPersons()\n {\n $pgw = $this->di['personGateway'];\n return $pgw->fetchAll();\n }",
"public function getDatatableContact()\n {\n $contact = Contact::select(['id', 'name', 'email', 'phone', 'country_id', 'message', 'created_at']);\n\n return DataTables::of($contact)\n ->editColumn('country_id' , function($contact){\n $country = Country::where('id' , $contact->country_id)->first();\n $country_description = CountryDescription::where('country_id' , $country['id'])->first();\n return $country_description['name'];\n })\n ->addColumn('action', function ($contact) {\n return '<a href=\"' . $contact->id . '/show\" class=\" btn btn-primary\" title=\"'._i(\"Show\").'\"><i class=\"ti-eye\"></i> </a>' . \" \" .\n '<a href=\"' . $contact->id . '/delete\" class=\" waves-effect waves-light btn btn-danger\" title=\"'._i(\"Delete\").'\"><i class=\"ti-trash\"></i> </a>' . \" \";\n })\n ->make(true);\n }",
"public function getContacts();",
"public function contacts(){\n return $this->hasMany('Asterisk\\Modules\\PRM\\Models\\Peoples\\Contacts');\n }",
"public function indexAction() {\n\t\t$this->view->assign('contactpeople', $this->contactPersonRepository->findAll());\n\t}",
"public function detailsAction()\n {\n $adapter = $this->getServiceLocator()->get('Book\\Db');\n $personTable = new PersonRowTable($adapter);\n $result = $personTable->select(array('id' => 1));\n return array('person' => $result->current());\n }",
"public function getContactInformation();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the list of schemas. | public function getSchemas(): array
{
return $this->schemas;
} | [
"public function getSchemaList()\n {\n $sql = \"SELECT nspname FROM pg_catalog.pg_namespace WHERE nspname !~ '^pg_'\";\n $result_handler = pg_query($this->connection->getHandler(), $sql);\n $schemas = array();\n\n while ($schema = pg_fetch_assoc($result_handler))\n {\n $schemas[] = $schema['nspname'];\n }\n\n return $schemas;\n }",
"public static function getSchemas()\n {\n return self::$schemas;\n }",
"function getSchemas(): array {\n return $this->schemas;\n }",
"public function getSchemasCollection(): array\n {\n return $this->marketingCloud->request('GET', '/contacts/v1/schema');\n }",
"public function all(): array {\n $this->loadSchema('');\n\n return $this->schemas;\n }",
"public function schemaList() { \n\t\treturn $this->query(\"\n\t\t\tSELECT nspname\n\t\t\tFROM pg_catalog.pg_namespace\n\t\t\tWHERE nspname <> 'information_schema' AND nspname !~ E'^pg_'\"\n\t\t)->column();\n\t}",
"public function getSchemaListToGenerate() {\n return null; // will generate all schemas\n }",
"function getSchemas() {\n\t\tglobal $conf;\n\n\t\tif (!$conf['show_system']) {\n\t\t\t$where = \"WHERE nspname NOT LIKE 'pg@_%' ESCAPE '@' AND nspname != 'information_schema'\";\n\t\t}\n\t\telse $where = \"WHERE nspname !~ '^pg_t(emp_[0-9]+|oast)$'\";\n\t\t$sql = \"\n\t\t\tSELECT pn.nspname, pu.usename AS nspowner,\n\t\t\t\tpg_catalog.obj_description(pn.oid, 'pg_namespace') AS nspcomment\n\t\t\tFROM pg_catalog.pg_namespace pn\n\t\t\t\tLEFT JOIN pg_catalog.pg_user pu ON (pn.nspowner = pu.usesysid)\n\t\t\t{$where}\n\t\t\tORDER BY nspname\";\n\n\t\treturn $this->selectSet($sql);\n\t}",
"protected function allSchemas(): array\n {\n return [\n Comments\\CommentSchema::class,\n Images\\ImageSchema::class,\n Posts\\PostSchema::class,\n Tags\\TagSchema::class,\n Users\\UserSchema::class,\n Videos\\VideoSchema::class,\n ];\n }",
"public function getSchemaNames();",
"public function listSchemas($databaseName = null)\n {\n if ($this->getDatabaseDriverName($databaseName) == 'pgsql') {\n $schemas = DB::connection($databaseName)->table('information_schema.schemata')\n ->select('schema_name')\n ->where('schema_name', 'not like', 'pg_%')\n ->where('schema_name', '<>', 'information_schema')\n ->get();\n\n return $schemas;\n }\n return [];\n }",
"function ls() { \n // @todo - these must become a setting of sorts.\n $excludeDirs = ['node_modules','build','dist','vendor','.cache', '.git'];\n\n $findCommand = \"find . -type d \\( \" . join(' -o ', array_map(fn($n) => '-name '.$n, $excludeDirs)) .\" \\) -prune -false -o -type f -name '*.simpleschema*'\";\n\n\n $schemas = explode(\"\\n\", trim(`$findCommand`));\n\n return $schemas;\n }",
"private function selectSchema(): array\n {\n return $this->db->getDoctrineSchemaManager()->listTables();\n }",
"public function getLinkedSchemas(): array\n {\n return $this->linkedSchema;\n }",
"public function getSchemas()\n {\n if (!$this->schemas) {\n $schemas = $this->getAttachedSchemas();\n\n if ($this->owner->hasExtension('Hierarchy')) {\n $schemas->merge($this->getInheritedSchemas());\n $schemas->removeDuplicates();\n $schemas->sort('Title');\n }\n\n $this->schemas = $schemas;\n }\n\n return $this->schemas;\n }",
"public function listSchemas($customerId, $optParams = [])\n {\n $params = ['customerId' => $customerId];\n $params = array_merge($params, $optParams);\n return $this->call('list', [$params], SchemasModel::class);\n }",
"public function getSchemaCollection();",
"protected static function getConfigSchemas() {\n return array ();\n }",
"public function getModelSchemas(): Collection\n {\n Utils::invariant(\n ! empty($this->modelSchemas),\n 'No model schemas defined on \"'.get_class($this).'\"'\n );\n\n return collect($this->modelSchemas)->map(function (string $class) {\n return $this->registry->getModelSchema($class);\n });\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets new milliseconds for the date object Example: setMilliSecond(550, 2) > equals +5 Sec +50 MilliSec | public function setMilliSecond($milli = null, $precision = null)
{
if ($milli === null) {
list($milli, $time) = explode(" ", microtime());
$milli = intval($milli);
$precision = 6;
} else if (!is_numeric($milli)) {
#require_once 'Zend/Date/Exception.php';
throw new Zend_Date_Exception("invalid milli second ($milli) operand", 0, null, $milli);
}
if ($precision === null) {
$precision = $this->_precision;
}
if (!is_int($precision) || $precision < 1 || $precision > 9) {
#require_once 'Zend/Date/Exception.php';
throw new Zend_Date_Exception("precision ($precision) must be a positive integer less than 10", 0, null, $precision);
}
$this->_fractional = 0;
$this->addMilliSecond($milli, $precision);
return $this;
} | [
"public function setMilliSecond($milli = null, $precision = null);",
"public function setMilliSecond($milli = null, $precision = null)\n {\n if ($milli === null) {\n [$milli, $time] = explode(\" \", microtime());\n $milli = (int)$milli;\n $precision = 6;\n } else if (!is_numeric($milli)) {\n require_once 'Zend/Date/Exception.php';\n throw new Zend_Date_Exception(\"invalid milli second ($milli) operand\", 0, null, $milli);\n }\n\n if ($precision === null) {\n $precision = $this->_precision;\n }\n\n if (!is_int($precision) || $precision < 1 || $precision > 9) {\n require_once 'Zend/Date/Exception.php';\n throw new Zend_Date_Exception(\"precision ($precision) must be a positive integer less than 10\", 0, null, $precision);\n }\n\n $this->_fractional = 0;\n $this->addMilliSecond($milli, $precision);\n return $this;\n }",
"public function set_Milliseconds()\n\t{\n\t\t$this -> _timeArray[\"milliseconds\"] = substr($st = microtime(),0,strpos($st,\" \"));\n\t}",
"function setTime($name, $value) {}",
"public function setDurationInMilliseconds(?int $value): void {\n $this->getBackingStore()->set('durationInMilliseconds', $value);\n }",
"public function milliseconds(int $x)\n {\n $this->dateTime->modify(\n sprintf('-%s milliseconds', abs($x))\n );\n return $this->dateTime;\n }",
"function millis() {\nlist($msec, $sec) = explode(' ', microtime());\nreturn $msectime = (float)sprintf('%.0f', (floatval($msec) + floatval($sec)) * 1000);\n}",
"public function setTime($oVal = null)\n {\n modOxUtilsDate::getInstance()->UNITSetTime($oVal);\n }",
"function setMinute( $value )\r\n {\r\n $value = min( $value, 59 );\r\n $this->SecondsElapsed = ( ( $this->hour() * 3600 ) + ( $value * 60 ) + $this->second() );\r\n }",
"public function addMilliseconds($value)\r\n {\r\n $this->addTime(TimeSpan::fromMilliseconds($value));\r\n $this->addDate($this->year, $this->month, $this->day);\r\n return $this;\r\n }",
"public function setSec($value): void\n {\n $this->fixedTime = new Time($value, $this->fixedTime->getMicroSeconds());\n }",
"function setjDate($jdate) \n { \n $full = ($jdate - 2440587.5) * 86400;\n $nix = $full >= 0 ? floor($full) : ceil($full); \n $mnix = (($full - $nix) * 1000000) % 1000000; \n $this->_time[\"microseconds\"] = $mnix;\n $this->_time[\"gmtime\"] = $nix;\n $this->_dirty = true; \n }",
"function setTimeStamp( $value )\r\n {\r\n $formattedTime =& date('His', $value );\r\n\r\n if ( preg_match( \"/([0-9]{2})([0-9]{2})([0-9]{2})/\", $formattedTime, $valueArray ) )\r\n {\r\n $this->setHour( min( $valueArray[1], 23 ) );\r\n $this->setMinute( min( $valueArray[2], 59 ) );\r\n $this->setSecond( min( $valueArray[3], 59 ) );\r\n }\r\n else\r\n {\r\n print( \"<b>Error:</b> eZTime::setTimeStamp() received wrong time format.\" );\r\n }\r\n\r\n }",
"#[@arg]\n public function setTimes($times= 100000) {\n $this->times= (int)$times;\n }",
"public static function setMicroAdjustment($microseconds) \n {\n self::$microadjustment = $microseconds % 1000000;\n }",
"public function setSeconds($second = 0) {\n\t\tlist($H, $i, $s, $m, $d, $Y) = DateTimeToolkit::breakdown($this->ts);\n\t\t\n\t\treturn new DateTime(mktime($H, $i, $second, $m, $d, $Y));\n\t}",
"function setReceivedelay($milliseconds)\n {\n if (is_integer($milliseconds) && $milliseconds >= 100) {\n $this->_receivedelay = $milliseconds;\n } else {\n $this->_receivedelay = 100;\n }\n }",
"function setReconnectdelay($milliseconds)\n {\n if (is_integer($milliseconds)) {\n $this->_reconnectdelay = $milliseconds;\n } else {\n $this->_reconnectdelay = 10000;\n }\n }",
"public function setTime($time) {\n $this->_time = $time;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hook to product actions | public function hookProductActions()
{
return $this->hookProductFooter();
} | [
"public function getProductAction();",
"public function hookActionProductDelete()\n {\n\n }",
"public function hookActionOrderDetail()\n {\n\n }",
"public function restore_woocommerce_product_shop_actions() {\n add_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10 );\n add_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_sale_flash', 10 );\n\n add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );\n add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );\n add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 );\n }",
"public function productsAction()\r\n {\r\n \r\n }",
"public function upsellproductsAction() {\n\n }",
"public function postInstallActions():void;",
"public function productsAction() {\n\t\t\n\t\t// Product view vars go here\n\t\t\n\t}",
"public function hookActionProductSave()\n {\n $enable_reviews = Tools::getValue('enable_reviews');\n Configuration::updateValue('SIMPLECOMMENTS_REVIEWS', $enable_reviews);\n }",
"public function eventBeforeEditProduct() {\n\n\t}",
"public function postInstallActions(): void\n {\n }",
"public function hookactionCartSave()\n {\n if (!isset($this->context->cart)) {\n return;\n }\n\n if (!Tools::getIsset('id_product')) {\n return;\n }\n\n $cart = array(\n 'controller' => Tools::getValue('controller'),\n 'addAction' => Tools::getValue('add') ? 'add' : '',\n 'removeAction' => Tools::getValue('delete') ? 'delete' : '',\n 'extraAction' => Tools::getValue('op'),\n 'qty' => (int)Tools::getValue('qty', 1)\n );\n\n $cart_products = $this->context->cart->getProducts();\n if (isset($cart_products) && count($cart_products)) {\n foreach ($cart_products as $cart_product) {\n if ($cart_product['id_product'] == Tools::getValue('id_product')) {\n $add_product = $cart_product;\n }\n }\n }\n\n if ($cart['removeAction'] == 'delete') {\n $add_product_object = new Product((int)Tools::getValue('id_product'), true, (int)Configuration::get('PS_LANG_DEFAULT'));\n if (Validate::isLoadedObject($add_product_object)) {\n $add_product['name'] = $add_product_object->name;\n $add_product['manufacturer_name'] = $add_product_object->manufacturer_name;\n $add_product['category'] = $add_product_object->category;\n $add_product['reference'] = $add_product_object->reference;\n $add_product['link_rewrite'] = $add_product_object->link_rewrite;\n $add_product['link'] = $add_product_object->link_rewrite;\n $add_product['price'] = $add_product_object->price;\n $add_product['ean13'] = $add_product_object->ean13;\n $add_product['id_product'] = Tools::getValue('id_product');\n $add_product['id_category_default'] = $add_product_object->id_category_default;\n $add_product['out_of_stock'] = $add_product_object->out_of_stock;\n $add_product['minimal_quantity'] = 1;\n $add_product['unit_price_ratio'] = 0;\n $add_product = Product::getProductProperties((int)Configuration::get('PS_LANG_DEFAULT'), $add_product);\n }\n }\n\n if (isset($add_product) && !in_array((int)Tools::getValue('id_product'), self::$products)) {\n self::$products[] = (int)Tools::getValue('id_product');\n $ga_products = $this->wrapProduct($add_product, $cart, 0, true);\n\n if (array_key_exists('id_product_attribute', $ga_products) && $ga_products['id_product_attribute'] != '' && $ga_products['id_product_attribute'] != 0) {\n $id_product = $ga_products['id_product_attribute'];\n } else {\n $id_product = Tools::getValue('id_product');\n }\n\n $gacart = $this->_manageData(\"\", \"R\");\n\n if ($cart['removeAction'] == 'delete') {\n $ga_products['quantity'] = -1;\n } elseif ($cart['extraAction'] == 'down') {\n if (array_key_exists($id_product, $gacart)) {\n $ga_products['quantity'] = $gacart[$id_product]['quantity'] - $cart['qty'];\n } else {\n $ga_products['quantity'] = $cart['qty'] * -1;\n }\n } elseif (Tools::getValue('step') <= 0) { // Sometimes cartsave is called in checkout\n if (array_key_exists($id_product, $gacart)) {\n $ga_products['quantity'] = $gacart[$id_product]['quantity'] + $cart['qty'];\n }\n }\n\n $gacart[$id_product] = $ga_products;\n $this->_manageData($gacart, 'W');\n }\n }",
"public function hookActionCartSave($params)\n {\n\n \n }",
"function sellAction()\n\t{\n\t\tvar_dump(\"Sell Action Call\");\n\t\t\n\t}",
"public function setup_actions()\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 }",
"private function actions() {\n\t\t\t/**\n\t\t\t * Setup actions\n\t\t\t */\n\t\t\t\\WPGraphQL\\Extensions\\QL_Events\\Type_Registry::add_actions();\n\t\t}",
"function sj_bookly_custom_hook() {\n \t\tdo_action('sj_bookly_custom_hook');\n \t}",
"function edit_product_in_admin(){\n\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the notApplicableCount Number of not applicable devices | public function getNotApplicableCount()
{
if (array_key_exists("notApplicableCount", $this->_propDict)) {
return $this->_propDict["notApplicableCount"];
} else {
return null;
}
} | [
"public function getNotApplicableDeviceCount()\n {\n if (array_key_exists(\"notApplicableDeviceCount\", $this->_propDict)) {\n return $this->_propDict[\"notApplicableDeviceCount\"];\n } else {\n return null;\n }\n }",
"public function getNotApplicableUserCount()\n {\n if (array_key_exists(\"notApplicableUserCount\", $this->_propDict)) {\n return $this->_propDict[\"notApplicableUserCount\"];\n } else {\n return null;\n }\n }",
"public function getDetectionScriptNotApplicableDeviceCount()\n {\n if (array_key_exists(\"detectionScriptNotApplicableDeviceCount\", $this->_propDict)) {\n return $this->_propDict[\"detectionScriptNotApplicableDeviceCount\"];\n } else {\n return null;\n }\n }",
"public function getNotInstalledDeviceCount()\n {\n if (array_key_exists(\"notInstalledDeviceCount\", $this->_propDict)) {\n return $this->_propDict[\"notInstalledDeviceCount\"];\n } else {\n return null;\n }\n }",
"public function getNotApplicableDeviceCount(): ?int {\n $val = $this->getBackingStore()->get('notApplicableDeviceCount');\n if (is_null($val) || is_int($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'notApplicableDeviceCount'\");\n }",
"public function getNotAssignedCount(): int;",
"public function setNotApplicableDeviceCount($val)\n {\n $this->_propDict[\"notApplicableDeviceCount\"] = intval($val);\n return $this;\n }",
"public function getUnknownDeviceCount()\n {\n if (array_key_exists(\"unknownDeviceCount\", $this->_propDict)) {\n return $this->_propDict[\"unknownDeviceCount\"];\n } else {\n return null;\n }\n }",
"public function getUnavailableCouponsCount()\n {\n return $this->count(self::unavailable_coupons);\n }",
"private function getEcmtRemovalNoOfPermitsAnswer()\n {\n return $this->getFirstIrhpPermitApplication()->countPermitsRequired();\n }",
"public function getUnviewedCount()\n {\n return $this->notificationMapper->countUnviewed();\n }",
"public function getUnknownCount()\n {\n return $this->countUnknown;\n }",
"public function getUnknownCount()\r\n {\r\n return $this->countUnknown;\r\n }",
"public function insufficientCount()\n {\n $result = [];\n if(!$this->isSufficient()) {\n $result[0] = 0;\n $userGift = $this->cashoutRequest->user->gifts()->where('id', $this->gift->id)->first();\n\n if($userGift) {\n $result[0] = $userGift->pivot->count;\n }\n\n $result[1] = $this->quantity;\n }\n\n return $result;\n }",
"public function getNotInstalledUserCount()\n {\n if (array_key_exists(\"notInstalledUserCount\", $this->_propDict)) {\n return $this->_propDict[\"notInstalledUserCount\"];\n } else {\n return null;\n }\n }",
"public function getNumOfPotentialWithFailDecisions()\n\t{\n\t\treturn $this->num_of_potential_problems_fail;\n\t}",
"public function getFailedDeviceCount()\n {\n if (array_key_exists(\"failedDeviceCount\", $this->_propDict)) {\n return $this->_propDict[\"failedDeviceCount\"];\n } else {\n return null;\n }\n }",
"public function getAbleAppCount()\n {\n return $this->get(self::_ABLE_APP_COUNT);\n }",
"public function riskyCount(): int\n {\n return count($this->risky);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the authorsrc for this event. | public function getAuthorsrc()
{
return $this->authorsrc;
} | [
"public function getSourceAuthor() {\n\t\treturn $this->sourceAuthor;\n\t}",
"public function getAuthorEmail()\n {\n if ($this->getCollectorId())\n {\n return $this->getCollector()->getEmail();\n }\n else\n {\n return parent::getAuthorEmail();\n }\n }",
"public function getAuthor() : string\n {\n return $this->author;\n }",
"public function getAuthorUsername() :string {\n\t\treturn $this->authorUsername;\n\t}",
"public function getAuthorUsername(): string {\n\t\treturn $this->authorUsername;\n\t}",
"public function getAuthor()\n {\n return $this->author;\n }",
"public function getAuthorUrl()\n {\n return $this->authorUrl;\n }",
"public function getAuthorEmail()\r\n {\r\n return $this->authorEmail;\r\n }",
"public function getAuthor()\n {\n return $this->escape($this->getDefaultConfigValue('author'));\n }",
"public function getAnswerAuthorEmail()\n {\n return $this->getData(self::ANSWER_AUTHOR_EMAIL);\n }",
"public function getAuthorId()\n {\n return $this->base->post_author;\n }",
"public function get_author() {\n\t\treturn $this->get_data( 'Author' );\n\t}",
"public function getAuthorUsername(): string {\n\t\treturn ($this->authorUsername);\n\t}",
"public function getAuthorId()\n {\n return $this->author_id;\n }",
"public function getAuthorId()\n {\n\n return $this->author_id;\n }",
"public function getauthorId() {\n\t\treturn ($this->authorId);\n\t}",
"public function getApplicationAuthor()\n {\n return $this->applicationAuthor;\n }",
"public function getAuthorName()\n {\n if ($this->getCollectorId())\n {\n return $this->getCollector()->getDisplayName()\n ?: $this->getCollector()->getUsername();\n }\n else\n {\n return parent::getAuthorName();\n }\n }",
"public function getTodoAuthor() : string {\n\t\treturn($this->todoAuthor);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation getConversationsCobrowsesessionParticipantWrapup Get the wrapup for this conversation participant. | public function getConversationsCobrowsesessionParticipantWrapup($conversationId, $participantId, $provisional = 'false')
{
list($response) = $this->getConversationsCobrowsesessionParticipantWrapupWithHttpInfo($conversationId, $participantId, $provisional);
return $response;
} | [
"public function getConversationsChatParticipantWrapupcodes($conversationId, $participantId)\n {\n list($response) = $this->getConversationsChatParticipantWrapupcodesWithHttpInfo($conversationId, $participantId);\n return $response;\n }",
"public function getConversationsCobrowsesessionParticipantWrapupcodesWithHttpInfo($conversationId, $participantId)\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\WrapupCode[]';\n $request = $this->getConversationsCobrowsesessionParticipantWrapupcodesRequest($conversationId, $participantId);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\WrapupCode[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 413:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 415:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 503:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 504:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getConversationsCobrowsesessions()\n {\n list($response) = $this->getConversationsCobrowsesessionsWithHttpInfo();\n return $response;\n }",
"public function getConversationsMessageParticipantWrapupcodes($conversationId, $participantId)\n {\n list($response) = $this->getConversationsMessageParticipantWrapupcodesWithHttpInfo($conversationId, $participantId);\n return $response;\n }",
"public function current_conversation() {\n\t\t$current_event = CafeEvent::current($this->dbh);\n\t\t$round = $current_event->current_round();\n\t\t$sth = $this->dbh->prepare('select UserConversation.ConversationID from UserConversation inner join Conversation on Conversation.ConversationID = UserConversation.ConversationID where UserConversation.UserID = ? and Conversation.RoundID = ?');\n\t\t$sth->execute([$this->id, $round->id]);\n\t\t$row = $sth->fetch();\n\t\tif($row)\n\t\t\treturn new CafeConversation($this->dbh, $row['ConversationID']);\n\n\t\treturn NULL;\n\t}",
"public function getConversation()\n {\n return $this->get(self::CONVERSATION);\n }",
"public function getConversationsCallbackParticipantWrapupcodes($conversationId, $participantId)\n {\n list($response) = $this->getConversationsCallbackParticipantWrapupcodesWithHttpInfo($conversationId, $participantId);\n return $response;\n }",
"public function getConversationsChatParticipantWrapupAsync($conversationId, $participantId, $provisional = 'false')\n {\n return $this->getConversationsChatParticipantWrapupAsyncWithHttpInfo($conversationId, $participantId, $provisional)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getConversationsEmailParticipantWrapup($conversationId, $participantId, $provisional = 'false')\n {\n list($response) = $this->getConversationsEmailParticipantWrapupWithHttpInfo($conversationId, $participantId, $provisional);\n return $response;\n }",
"protected function listConversations() {\n $conversations = Participant::where('user_id', Auth::user()->id)->get(['conversation_id']);\n\n return Conversation::with(['participants' => function($query) {\n $query->with(['user' => function($query) {\n $query->select('id', 'username', 'picture');\n }]);\n }])->whereIn('id', $conversations)->get();\n }",
"public function getConversationsCallParticipantWrapup($conversationId, $participantId, $provisional = 'false')\n {\n list($response) = $this->getConversationsCallParticipantWrapupWithHttpInfo($conversationId, $participantId, $provisional);\n return $response;\n }",
"public function getConversationsCallbackParticipantWrapup($conversationId, $participantId, $provisional = 'false')\n {\n list($response) = $this->getConversationsCallbackParticipantWrapupWithHttpInfo($conversationId, $participantId, $provisional);\n return $response;\n }",
"public function getConversation()\n {\n return $this->conversation;\n }",
"public function patchConversationsCobrowsesessionParticipant($conversationId, $participantId, $body = null)\n {\n $this->patchConversationsCobrowsesessionParticipantWithHttpInfo($conversationId, $participantId, $body);\n }",
"public function getConversationsCobrowsesessionsAsyncWithHttpInfo()\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\CobrowseConversationEntityListing';\n $request = $this->getConversationsCobrowsesessionsRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function conversation_for_round($round_id) {\n\t\t\t$sth = $this->dbh('select ConversationID from Conversation where TableID = ? and RoundID = ?');\n\t\t\t$sth-execute([$this->id, $round_id]);\n\t\t\tif($row = $sth->fetch(PDO::FETCH_NUM)) {\n\t\t\t\treturn new CafeConversation($this->dbh, $row[0]);\n\t\t\t}\n\t\t\treturn NULL;\n\t}",
"public function getConversationsEmailParticipantWrapupcodesWithHttpInfo($conversationId, $participantId)\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\WrapupCode[]';\n $request = $this->getConversationsEmailParticipantWrapupcodesRequest($conversationId, $participantId);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\WrapupCode[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 413:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 415:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 503:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 504:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getConversationsChatParticipantWrapupWithHttpInfo($conversationId, $participantId, $provisional = 'false')\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\AssignedWrapupCode';\n $request = $this->getConversationsChatParticipantWrapupRequest($conversationId, $participantId, $provisional);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\AssignedWrapupCode',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 413:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 415:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 503:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 504:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"protected function getConversationsCobrowsesessionParticipantWrapupRequest($conversationId, $participantId, $provisional = 'false')\n {\n // verify the required parameter 'conversationId' is set\n if ($conversationId === null || (is_array($conversationId) && count($conversationId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $conversationId when calling getConversationsCobrowsesessionParticipantWrapup'\n );\n }\n // verify the required parameter 'participantId' is set\n if ($participantId === null || (is_array($participantId) && count($participantId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $participantId when calling getConversationsCobrowsesessionParticipantWrapup'\n );\n }\n\n $resourcePath = '/api/v2/conversations/cobrowsesessions/{conversationId}/participants/{participantId}/wrapup';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($provisional !== null) {\n $queryParams['provisional'] = ObjectSerializer::toQueryValue($provisional);\n }\n\n // path params\n if ($conversationId !== null) {\n $resourcePath = str_replace(\n '{' . 'conversationId' . '}',\n ObjectSerializer::toPathValue($conversationId),\n $resourcePath\n );\n }\n // path params\n if ($participantId !== null) {\n $resourcePath = str_replace(\n '{' . 'participantId' . '}',\n ObjectSerializer::toPathValue($participantId),\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 ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires 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 }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Method: finalize Finalizes the page request. This includes saving all necessary variables to the session. | public function finalize() {
$_SESSION['user_'.Dispatcher::inst()->activeSite['publicdir']] = $this->user;
MessageQueue::serialize();
Session::write_close(); // Write session before headering.
} | [
"public function finalize() {\n\t\t$presenter = $this->getPresenter();\n\t\t$this->saveSession();\n\t\t$presenter->redirect('this');\t\n\t}",
"public function FinalizeRequest()\n {\n $this->AttachHeaders();\n $this->AttachCookies();\n $this->AttachPostParameters();\n }",
"public function finalize()\n {\n // nothing to do, therefore intentionelly left blank\n }",
"public static function finalize() {\n $stylesheets = self::stylesheets();\n $javascripts = self::javascripts();\n $classes_html = implode(' ', self::$classes['html']);\n self::$classes['html'] = array();\n ob_start();\n $content = self::$content;\n include_once(self::$theme_path . '/templates/html.tpl.php');\n self::$result = ob_get_clean();\n }",
"public function _replyToFinalizeInPageTabs() { $this->_finalizeInPageTabs(); }",
"private static function requestEnd()\n {\n $_GET = array();\n $_POST = array();\n }",
"public function finish() {\n\t\t$this->_view->init();\n\t\t$this->_view->sendHeaders();\n\t\techo $this->getView()->render();\n\t\t$this->getSession()->close();\n }",
"function page_footer() {\n\t\tif (webpulse::variable_get('cache', 0)) {\n\t\t\twebpulse::page_set_cache();\n\t\t}\n\t\t\n\t\t//module_invoke_all('exit');\n\t}",
"public function finish(){\n \n //--SUBMIT POST FROM PREVIOUS PAGE---//\n $this->saveSnapshot();\n //-----------------------------------//\n \n //remove currently active timer\n testTimer('unset', $this->ass_code, 0);\n \n $content = $this->getView('pages/candidate/finish');\n \n $html = [\n 'includeSiteLevelJS' => [\n 'public/js/testtaking.js'\n ],\n 'content' => $content, \n ];\n $this->renderView('layouts/candidate', $html);\n \n \n }",
"public function finalize() {\n if ( in_array($this->status, array(204, 304)) ) {\n $this->body('');\n unset($this->headers['Content-Type']);\n }\n }",
"public function endPage();",
"public function __destruct() {\r\n $this->pagefooter();\r\n\techo $this->content;\r\n }",
"public function finish() {\n session_destroy();\n Util::redis()->delete(\"session_\" . $this->sessionId);\n Util::noSessionRedirect();\n }",
"function __destruct()\n {\n if ($this->renderPage) {\n $this->_template->render($this->renderHeader);\n }\n }",
"public function finalize() {\n $this->log('== Finalizing the exporter job ==');\n $this->set_timestamp_last();\n $this->job_success('Done!');\n }",
"public static function end(){\r\n\t\tsession_write_close();\r\n\t}",
"public function __destruct() {\n\t\t$this->saveSessionVars();\n\t}",
"public function endPage()\n\t{\n\t\t$this->event->trigger ( self::EVENT_END_PAGE );\n\t\tob_end_flush ();\n\t}",
"public function finish()\n {\n $p = $this->page;\n if ($p->is_ajax_request) {\n exit_json($this->response);\n }\n\n $to = ($_GET['return_uri']) ?: $_SERVER['HTTP_REFERER'];\n $get = ($this->response['status'] == 'OK')\n ? array('status' => 'OK')\n : $this->response;\n\n $get = '?return='.rawurlencode(serialize($get));\n\n $p->redirect($to.$get, 302);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the regime agricole. | public function getRegimeAgricole() {
return $this->regimeAgricole;
} | [
"public function getTvaRegime() {\n return $this->tvaRegime;\n }",
"public function getUserregtime()\n {\n return $this->userregtime;\n }",
"public function getCodeRegimeTva() {\n return $this->codeRegimeTva;\n }",
"protected function getRegio()\n {\n return $this->regio;\n }",
"public function getTvaRegime(): ?string {\n return $this->tvaRegime;\n }",
"public function getRegisterTime()\n {\n return $this->register_time;\n }",
"public function getRegimeMatrimoniale(): ?string {\n return $this->regimeMatrimoniale;\n }",
"public function getSpecialRegimes(): SpecialRegimes\n {\n if (isset($this->specialRegimes) === false) {\n $this->specialRegimes = new SpecialRegimes($this->getErrorRegistor());\n }\n \\Logger::getLogger(\\get_class($this))\n ->info(__METHOD__.\" get\");\n return $this->specialRegimes;\n }",
"public function getGeheimeVraag() {\n\t\treturn $this->geheimeVraag;\n\t}",
"public function getRegdate()\n {\n return $this->regdate;\n }",
"public function getPlafondAutreRegime(): ?float {\n return $this->plafondAutreRegime;\n }",
"public function getGevalAddtimeAgain()\n {\n return $this->geval_addtime_again;\n }",
"public function getLgAddTime()\n {\n return $this->LgAddTime;\n }",
"public function getRegisterAgentTime()\n {\n return $this->register_agent_time;\n }",
"public function getTem_reg(){\n return $this->tem_reg;\n }",
"function getTime() \n {\n $this->calibrate();\n return $this->_time['gmtime'];\n }",
"public function getRegDate()\n\t{\n\t\treturn $this->reg_date;\n\t}",
"public function getRegDate()\n {\n return $this->regDate;\n }",
"public function getIdReg()\n {\n return $this->id_reg;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the number of related CostDoc objects. | public function countCostDocs(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
{
$partial = $this->collCostDocsPartial && !$this->isNew();
if (null === $this->collCostDocs || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collCostDocs) {
return 0;
}
if ($partial && !$criteria) {
return count($this->getCostDocs());
}
$query = CostDocQuery::create(null, $criteria);
if ($distinct) {
$query->distinct();
}
return $query
->filterByDoc($this)
->count($con);
}
return count($this->collCostDocs);
} | [
"public function getChildDocumentsCount() {}",
"public function getTotalDocs()\n {\n $labelMapper = $this->db->mapper('Documer\\Entity\\Label');\n\n return count($labelMapper->all());\n }",
"public function getReferenceCount() {}",
"public function count_references()\n {\n return $this->link->count_references($this);\n }",
"public function count()\n {\n return count($this->documents);\n }",
"public function count()\n {\n return count($this->_docs);\n }",
"function getTotalNumObjects()\r\n\t{\r\n\t\treturn $this->numTotalObjects;\r\n\t}",
"public function getReferenceCount() : int {}",
"public function getOccurrences()\n {\n return count($this->getInvoices());\n }",
"function get_object_count()\r\n {\r\n return $this->get_browser()->count_gutenberg_publications($this->get_condition());\r\n }",
"public function countHasOneRelations()\n {\n return count( $this->hasOne );\n }",
"public function countDescendants();",
"public function getReferenceCount()\n {\n return $this->getProperty(\"ReferenceCount\");\n }",
"protected abstract function doGetNumberOfReferences(Resource $resource);",
"public function getReviewsCount();",
"public function loadCount($relations);",
"public function count() {\r\n return count($this->objects);\r\n }",
"public function countOwnDocuments() {\n return $this->getAttributesDocuments(false, false, true);\n }",
"public function getTotalDocs()\n {\n return count($this->labels);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test Getting the id of the aligned TextSegment | public function testGetTextSegmentId()
{
$this->assertEquals(2, $this->alignment->getTextSegmentId());
} | [
"public function testGetTextSegment()\n {\n $this->assertEquals($this->alignment->getTextSegmentId(), $this->alignment->getTextSegment()->getId());\n }",
"public function getTextSegment()\n {\n return $this->text_segment;\n }",
"function getAlignedTextSegFromMediaSeg(MediaFileSegmentInteface $media_file_seg);",
"public function testFormat4SingleSegmentWithIdRangeOffset()\n {\n // arrange\n $format4 = new Format4();\n $format4->setSegCountX2(2);\n $format4->setStartCodes([50]);\n $format4->setEndCodes([52]);\n $format4->setIdDeltas([-10]);\n $format4->setIdRangeOffsets([2]);\n $format4->setGlyphIndexArray([3, 4, 5]);\n\n // act\n $characterMapping = $this->visitor->visitFormat4($format4);\n\n // assert\n $this->assertCount(3, $characterMapping);\n $this->assertSame([50 => 3, 51 => 4, 52 => 5], $characterMapping);\n }",
"function getParentMediaAlignedText();",
"static function get_segment($id){\n\t\t$start_marker = \"#zazzle_acc_start \".$id;\n\t\t$end_marker = \"#zazzle_acc_end \".$id.\"\\n\";\n\t\t\n\t\t$start = strpos(self::$FDATA, $start_marker);\n\t\t$end = strpos(self::$FDATA, $end_marker);\n\t\t\n\t\t//echo \"--Start: \".$start.\"<br>\";\n\t\t//echo \"--End: \".$end.\"<br>\";\n\t\t\n\t\tif($start === false){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$segment = substr(self::$FDATA, $start, $end - $start +strlen($end_marker));\n\t\t//echo \"--Segment: \".$segment.\"<br>\";\n\t\treturn $segment;\n\t}",
"public function getSpanId()\n {\n return \"\";\n }",
"public function getSegmentId()\n {\n return $this->segment_id;\n }",
"public function testGetId()\n {\n $this->assertEquals(2, $this->alignment->getId());\n }",
"public function getIdSegmentation()\n {\n return $this->id_segmentation;\n }",
"public function testFormat4SingleSegment()\n {\n // arrange\n $format4 = new Format4();\n $format4->setSegCountX2(2);\n $format4->setStartCodes([50]);\n $format4->setEndCodes([52]);\n $format4->setIdDeltas([-10]);\n $format4->setIdRangeOffsets([0]);\n $format4->setGlyphIndexArray([]);\n\n // act\n $characterMapping = $this->visitor->visitFormat4($format4);\n\n // assert\n $this->assertCount(3, $characterMapping);\n $this->assertSame([50 => 40, 51 => 41, 52 => 42], $characterMapping);\n }",
"public function testDimensionGetSegmentBydimensionIdsegmentId()\n {\n }",
"public function getSegmentID()\n {\n return $this->SegmentID;\n }",
"public function getTextAlignment () {}",
"public function spanId()\n {\n return $this->info['spanId'];\n }",
"public function spanId()\n {\n return $this->spanId;\n }",
"public function getAlignment(): int {}",
"function getCurrentTextPos(){}",
"public function getDrawText();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show the form for editing a coffee resource. | public function edit(Coffee $coffee)
{
return view('admin.coffees.edit', compact('coffee'));
} | [
"public function edit_form()\n {\n return View::make(\"app.edit\");\n }",
"public static function edit_form()\n {\n $user = Users::findOne($_SESSION['user']);\n\n View::make('user/edit.html', array('user' => $user));\n }",
"public function edit_item()\n {\n $this->check_authorization();\n \n $id = $this->get_arg('id', 0);\n $item = Item::find($id); \n $data['item'] = $item;\n $data['breadcrumbs'] = $this->generate_breadcrumbs(\n $item->category_id,\n array('/show_item?id='.$item->id => $item->name)\n );\n\n return new View('item_form', $data); \n }",
"public function editForm(): void\n {\n $this->categoryId = $_GET['id'];\n\n $editCategory = $this->categoryModel->displayOneCategory($this->categoryId);\n\n $this->name = $editCategory['name'];\n }",
"public function editAction() {\n // get contact id from request params (get param)\n $id = $this->route_params[\"id\"];\n // if id is invalid redirect to 404 page\n if (filter_var($id, FILTER_VALIDATE_INT) === false) {\n $this->show404();\n return;\n }\n\n $contact_obj = new Contact();\n // find the contact details by id\n $contact = $contact_obj->findById($id);\n\n if ($contact == false) {\n //set error message in session\n $_SESSION[\"error_message\"] = \"Contact not found or deleted\";\n // redirect to show all contacts if contacts not found\n header(\"Location: /contacts\");\n return;\n }\n // render the edit form \n View::renderTemplate(\"contacts/edit.twig.php\", [\n \"contact\" => $contact\n ]);\n }",
"private function editForm()\n {\n $m = $this->getViewModel();\n\n $blog = $m->blog;\n\n $m->isApprover = true; // isApprover()\n\n $stylelist = BlogView::getStyleList();\n\n $id = $blog->id;\n \n \n if ($m->revid === 0) {\n $m->revid = intval($blog->revision);\n }\n\n $m->revision = BlogRevision::findFirst('blog_id='.$id.' and revision='.$m->revid);\n \n // submit choices\n $m->rev_list = [\n 'Save' => 'Save',\n 'Revision' => 'Save as new revision',\n ];\n\n $m->title = '#' . $id;\n $m->stylelist = $stylelist;\n $m->catset = BlogView::getCategorySet($id);\n $m->events = BlogView::getEvents($id);\n $m->metatags = BlogView::getMetaTags($id);\n $m->content = $m->url = $this->url;\n\n return $this->render('blog', 'edit');\n }",
"public function editForm()\n {\n $photo = App::get('database')->select('photos', 'id', $_GET['id']);\n return view('photos.edit', compact('photo'));\n }",
"public function edit()\n {\n return view('project/edit');\n }",
"public function edit(Resource $resource)\n {\n //\n return view('resources.edit', compact('resource'));\n }",
"public function actionEdit()\n\t{\n\t \t// render the template, pass model on render template\n \t$this->renderTemplate('weatheroots/_edit');\n\t}",
"public function getShowEdit(){\n\t\t$data=array(\n\t\t\t\"product_id\"=>$_GET['product_id'],\n\t\t\t\"id\"=>$_GET['id'],\n\t\t\t\"key\"=>$_GET['key'],\n\t\t\t\"value\"=>$_GET['value'],\n\t\t\t\"value_type\"=>$_GET['value_type']);\n\t\t$this->setTitle('Edit Meta Data Fields');\n\t\t$this->setContent( $this->getView('shopify/editForm',$data, dirname(__DIR__)) );\n\t}",
"public function editAction() {\n $value_id = $this->getCurrentOptionValue()->getId();\n\n # Options\n $option_model = new Inbox_Model_Option();\n\n $this->view->option = $option_model->find($value_id, \"value_id\");\n if(!$this->view->option->getId()) {\n $this->view->option\n ->setValueId($value_id)\n ->save();\n }\n\n $limit = 5000;\n if($this->view->option->getLimit()) {\n $limit = $this->view->option->getLimit();\n }\n\n $message_model = new Inbox_Model_CustomerMessage();\n $this->view->messages = $message_model->findByValueId($value_id, $limit);\n\n\n $this->view->form_option = new Inbox_Form_Option();\n $this->view->form_option->setValueId($value_id);\n $this->view->form_option->populate($this->view->option->getData());\n\n # Customers\n $customer_model = new Customer_Model_Customer();\n $this->view->customers = $customer_model->findByAppId($this->getApplication()->getId());\n\n parent::editAction();\n }",
"public function edit()\n {\n return view('backend.profile.edit');\n }",
"public function edit($id)\n {\n $servicioCrmXFormulario = $this->servicioCrmXFormularioRepository->findWithoutFail($id);\n\n if (empty($servicioCrmXFormulario)) {\n Flash::error('ServicioCrmXFormulario not found');\n\n return redirect(route('admin.servicioCrmXFormularios.index'));\n }\n\n return view('admin.servicioCrmXFormularios.edit')->with('servicioCrmXFormulario', $servicioCrmXFormulario);\n }",
"public function editAction($id)\n {\n\n /** @var Customer $oCustomer */\n $oCustomer = CustomerQuery::create()->findOneById($id);\n\n if (count($oCustomer) === 0) {\n throw $this->createNotFoundException('Unable to find Customer entity.');\n }\n\n $oEditForm = $this->createEditForm($oCustomer);\n $oDeleteForm = $this->createDeleteForm($id);\n\n return $this->render('SlashworksAppBundle:Customer:edit.html.twig', array(\n 'entity' => $oCustomer,\n 'edit_form' => $oEditForm->createView(),\n 'delete_form' => $oDeleteForm->createView(),\n ));\n }",
"protected function editAction()\n {\n $this->editAction\n ->setAccess($this, Access::CAN_EDIT)\n ->setOwnerAccess($this)\n ->execute($this, UserEntity::class, UserActionEvent::class, NULL, __METHOD__, [], ['user_id' => $this->thisRouteID()])\n ->render()\n ->with(\n [\n 'user' => $this->toArray($this->findOr404()),\n 'check_icon' => '<li><ion-icon name=\"checkmark-outline\"></ion-icon></li>',\n 'close_icon' => '<ion-icon name=\"close-outline\"></ion-icon>'\n ]\n )\n ->form($this->formUser)\n ->end();\n }",
"public function edit () {\n $news = new News();\n $news = $news->selectOne('news', $_GET['id']);\n return $this->view('edit', ['news' => $news]);\n }",
"public function edit($id)\n {\n $coffeeOrigin = $this->coffeeOriginRepository->findWithoutFail($id);\n\n if (empty($coffeeOrigin)) {\n Flash::error('Coffee Origin not found');\n\n return redirect(route('coffeeOrigins.index'));\n }\n\n return view('coffee_origins.edit')->with('coffeeOrigin', $coffeeOrigin);\n }",
"public function edit($id)\n\t{\n\t\t$flower = Flower::find($id);\n\n\t\treturn View::make('flowers.edit', compact('flower'));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This condition is relevant only for versioned objects. An object version satisfies this condition only if these many days have been passed since it became noncurrent. The value of the field must be a nonnegative integer. If it's zero, the object version will become eligible for Lifecycle action as soon as it becomes noncurrent. Generated from protobuf field int32 days_since_noncurrent_time = 9; | public function getDaysSinceNoncurrentTime()
{
return isset($this->days_since_noncurrent_time) ? $this->days_since_noncurrent_time : 0;
} | [
"public function testIsNewerThanFalse() {\n\t\t\t$time = time();\n\t\t\t$lastRefresh = date('Y-m-d H:i:s', $time - 10);\n\t\t\t$userData = ['id' => 1, 'last_refresh' => $lastRefresh];\n\t\t\t$this->CurrentUser->setSettings($userData);\n\n\t\t\t$this->assertFalse($this->LastRefresh->isNewerThan($time));\n\t\t\t$this->assertFalse($this->LastRefresh->isNewerThan(date('Y-m-d H:i:s', $time)));\n\t\t}",
"private function currentDayIsNotLastDay(): bool\n {\n return $this->first_day->diffInDays($this->current_day) < config('app.total_days_of_gameplay');\n }",
"protected function getTokenTimeNotBefore(): int\n {\n return (time() + envValue('TOKEN_NOT_BEFORE', 0));\n }",
"public function getWouldBeDaysLate() {\n return max(0, $this->hasDueDate() ? DateUtils::calculateDayDiff($this->getSubmissionDueDate()) : 0);\n }",
"public function getOperationalDays(DateTimeInterface $obj_until, DateTimeInterface $obj_since = null);",
"public function isYesterday();",
"function custom_wc_od_is_current_day_disabled( $disabled, $timestamp, $args, $context ) {\n\tif (\n\t\t! $disabled && // Not disabled yet.\n\t\t( isset( $args['type'] ) ) && 'delivery' === $args['type'] && // Only for delivery.\n\t\tin_array( $context, array( 'checkout', 'checkout-auto' ), true ) && // Checkout context.\n\t\tdate( 'Y-m-d', $timestamp ) === wc_od_get_local_date( false ) // It's the current date.\n\t) {\n\t\t$delivery_day = wc_od_get_delivery_day( date( 'w', $timestamp ) );\n\n\t\t// The delivery day has time frames defined.\n\t\tif ( $delivery_day->has_time_frames() ) {\n\t\t\t$checkout = WC_OD()->checkout();\n\n\t\t\t$time_frames = wc_od_get_time_frames_for_date(\n\t\t\t\t$timestamp,\n\t\t\t\tarray(\n\t\t\t\t\t'shipping_method' => $checkout->get_shipping_method(),\n\t\t\t\t),\n\t\t\t\t$context\n\t\t\t);\n\n\t\t\t// But there is no time frames to select. So, disable the current date.\n\t\t\tif ( $time_frames->is_empty() ) {\n\t\t\t\t$disabled = true;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $disabled;\n}",
"public function remainingDays()\n {\n if ($this->hasExpired()) {\n return (int) 0;\n }\n\n return (int) Carbon::now()->diffInDays(Carbon::parse($this->expires_on));\n }",
"public function inPast(): bool\n {\n return $this->getTimestamp() < time();\n }",
"public function getNotBeforeTime()\n {\n return $this->not_before_time;\n }",
"public function InFuture()\n {\n return strtotime($this->value ?? '') > DBDatetime::now()->getTimestamp();\n }",
"function IsPastOrToday() {\n $today = date('Y-m-d');\n return $this->owner->RAW() <= $today;\n }",
"public function hasLateDaysRemaining() {\n return $this->getLateDaysRemaining() > 0;\n }",
"public function vacation_hours_since_lock ()\n\t{\n\t\treturn $this->e_vacation - 1;\n\t}",
"public static function mark7DaysNoMoving(){\n \n $sql = \"\n SELECT \n ec1.ecnt_id \n FROM\n ecnt_container ec1 \n LEFT OUTER JOIN ecnt_container ec2 \n ON ec1.ecnt_container_nr = ec2.ecnt_container_nr \n AND ec1.ecnt_datetime < ec2.ecnt_datetime \n WHERE NOT ec1.ecnt_move_code IN ('VF', 'VE') \n AND ec2.ecnt_id IS NULL \n AND ec1.ecnt_datetime < ADDDATE(NOW(), - 7)\n \";\n $data = Yii::app()->db->createCommand($sql)->queryAll();\n $count = 0;\n foreach($data as $row){\n if(self::registreError($row['ecnt_id'],'7days')){\n $count ++;\n }\n }\n\n return $count;\n \n }",
"public function test_flag_course_past_enddate_future_child() {\n $this->resetAfterTest();\n\n $this->setup_basics('PT1H', 'PT1H', 'PT1H', 'P5Y');\n\n $course = $this->getDataGenerator()->create_course([\n 'startdate' => time() - (2 * YEARSECS),\n 'enddate' => time() - YEARSECS,\n ]);\n $forum = $this->getDataGenerator()->create_module('forum', ['course' => $course->id]);\n\n // Flag all expired contexts.\n $manager = new \\tool_dataprivacy\\expired_contexts_manager();\n list($flaggedcourses, $flaggedusers) = $manager->flag_expired_contexts();\n\n $this->assertEquals(0, $flaggedcourses);\n $this->assertEquals(0, $flaggedusers);\n }",
"public function setCntToday($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (int) $v;\n }\n\n if ($this->cnt_today !== $v) {\n $this->cnt_today = $v;\n $this->modifiedColumns[] = AdvsPeer::CNT_TODAY;\n }\n\n\n return $this;\n }",
"public function setSince($var)\n {\n GPBUtil::checkString($var, True);\n $this->since = $var;\n\n return $this;\n }",
"public function getExpirationDateThreshold($currentDate=null)\n {\n $currentDate = $currentDate ?: Mage::getSingleton('core/date')->gmtDate();\n $days = $this->getDaysBeforeExpiredPaymentNotification();\n\n $expirationDate = date('Y-m-d', strtotime(\"+{$days} days {$currentDate}\"));\n\n return $expirationDate;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the live mode. Defined as true if live keys were used in the request. Defined as false if test keys were used in the request. | private function setLiveMode($liveMode) {
$this->liveMode = $liveMode;
} | [
"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 getLiveMode() {\n return $this->liveMode;\n }",
"public function isLive()\n {\n return 'live' == $this->getMode();\n }",
"public function checkLiveTestMode() {\n\t\tif(!ZAMP_LIVE_TEST_MODE)\n\t\t\treturn;\n\t\t\n\t\t$block_test_mode_access = true;\n\t\t\n\t\tif($accessKey = $this->_request->get('zamp_live_test_mode_access_key')) {\n\t\t\t$host = preg_replace('/^www\\./i', '', $this->_request->server('HTTP_HOST'));\n\t\t\t\n\t\t\t$cookieInfo = session_get_cookie_params();\n\t\t\t\n\t\t\tif($accessKey == ZAMP_LIVE_TEST_MODE_ACCESS_KEY) {\n\t\t\t\tsetcookie('zamp_live_test_mode_key', ZAMP_LIVE_TEST_MODE_ACCESS_KEY, time() + 86400, '/', '.'.$host, $cookieInfo['secure'], $cookieInfo['httponly']);\n\t\t\t\t\n\t\t\t\t$block_test_mode_access = false;\n\t\t\t}\n\t\t\telseif($accessKey == 'stop') {\n\t\t\t\tsetcookie('zamp_live_test_mode_key', '', time() - 86400, '/', '.'.$host, $cookieInfo['secure'], $cookieInfo['httponly']);\n\t\t\t\t$block_test_mode_access = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$liveTestModeKey = $this->_request->cookie('zamp_live_test_mode_key');\n\t\t\n\t\tif(\n\t\t\t(\n\t\t\t\tempty($liveTestModeKey)\n\t\t\t\t\t||\n\t\t\t\t($liveTestModeKey != ZAMP_LIVE_TEST_MODE_ACCESS_KEY)\n\t\t\t)\n\t\t\t\t&&\n\t\t\t$block_test_mode_access\n\t\t) {\n\t\t\tZamp_General::setHeader(503);\n\t\t\theader('Retry-After: 3600');\n\t\t\t\n\t\t\tif(SET_ZAMP_HEADER)\n\t\t\t\theader(\"X-Powered-By: Zamp PHP/\".ZAMP_VERSION);\n\t\t\t\n\t\t\tif(isset($this->_view)) {\n\t\t\t\t$errorFile = 'zamp_live_test_mode'.$this->_view->_view_template_extension;\n\t\t\t\tif(file_exists($errorFilePath = _APPLICATION_CORE_.'view/'.$this->_config['viewTemplate']['template_name'].'/'.$errorFile) or file_exists($errorFilePath = _APPLICATION_CORE_.'view/default/'.$errorFile)) {\n\t\t\t\t\t$errorFilePath = 'file:'.preg_replace('@(\\\\\\|/{2,})@', '/', realpath($errorFilePath));\n\t\t\t\t\t$this->_view->display($errorFilePath);\n\t\t\t\t\tcleanExit();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$fileName = _PROJECT_PATH_.\"Zamp/Exception/template/zamp_live_test_mode.html.php\";\n\t\t\trequire_once $fileName;\n\t\t\tcleanExit();\n\t\t}\n\t}",
"protected function isLiveStripeKey()\n {\n return substr($this->stripeClient->getApiKey(), 3, 4) === 'live';\n }",
"public function isLive() : bool\n {\n return $this->live;\n }",
"public function isLive()\n {\n return $this->live;\n }",
"function isLive() {\n \treturn $this->getStatusID() == LIVE;\n }",
"function isLive(){ return $_ENV['CURRENT_ENVIRONMENT'] == ENVIRONMENT_LIVE; }",
"function isLive() {\r\n\t\tif(preg_match('/experiments.dev|localhost/', $_SERVER['SERVER_NAME'])) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}",
"function switchToLive(){ $_ENV['CURRENT_ENVIRONMENT'] = ENVIRONMENT_LIVE; }",
"public function isLive() {\r\n\t\treturn $this->_life === self::STATE_LIVE;\r\n\t}",
"public function setAllowPrivateLiveFlag($value)\n {\n return $this->set(self::ALLOWPRIVATELIVEFLAG_, $value);\n }",
"public function live()\n {\n return env('PAYPAL_MODE') == 'live';\n }",
"public function isLiveRequest()\n {\n if (! isset($this->_isLiveRequest)) {\n $request = Yii::$app->request;\n $this->_isLiveRequest = $request instanceof Request && $request->isLiveUsed();\n }\n\n return $this->_isLiveRequest;\n }",
"protected function isFromSyncToLive(): bool\n {\n $bool = $this->option('live');\n\n return ! empty($bool) ? true : false;\n }",
"public function getIsLive(): bool\n {\n /** @var WebApplication|ConsoleApplication $this */\n if (is_bool($on = $this->getConfig()->getGeneral()->isSystemLive)) {\n return $on;\n }\n\n return (bool)$this->getProjectConfig()->get('system.live');\n }",
"public function isLivePreview()\n\t{\n\t\treturn craft()->request->isLivePreview();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
filters a FileList by the uID of the approving User. | public function filterByApproverUID($uID)
{
$this->filter('fv.fvApproverUID', $uID);
} | [
"public function filterByApproverUserID($uID)\n {\n /** @var Concrete\\Core\\File\\FileList $instance */\n return $instance->filterByApproverUserID($uID);\n }",
"public function filterByAuthorUserID($uID)\n {\n /** @var Concrete\\Core\\File\\FileList $instance */\n return $instance->filterByAuthorUserID($uID);\n }",
"function filterRestricted( $productfiles, $user_id )\r\n {\r\n (array) $productfiles;\r\n $filtered = array();\r\n $unfiltered = array();\r\n \r\n foreach ($productfiles as $productfile)\r\n {\r\n if (TiendaHelperProductDownload::canDownload( $productfile->productfile_id, $user_id))\r\n {\r\n $filtered[] = $productfile;\r\n }\r\n else \r\n {\r\n \t$unfiltered[] = $productfile;\r\n }\r\n }\r\n \r\n $allItems = array( 0=>$filtered, 1=>$unfiltered );\r\n return $allItems;\r\n }",
"function filterByOwner($user_id);",
"function AddUserIDFilter($sFilter) {\n\t\tglobal $Security;\n\t\t$sFilterWrk = \"\";\n\t\t$id = (CurrentPageID() == \"list\") ? $this->CurrentAction : CurrentPageID();\n\t\tif (!$this->UserIDAllow($id) && !$Security->IsAdmin()) {\n\t\t\t$sFilterWrk = $Security->UserIDList();\n\t\t\tif ($sFilterWrk <> \"\")\n\t\t\t\t$sFilterWrk = '`id` IN (' . $sFilterWrk . ')';\n\t\t}\n\n\t\t// Call User ID Filtering event\n\t\t$this->UserID_Filtering($sFilterWrk);\n\t\tew_AddFilter($sFilter, $sFilterWrk);\n\t\treturn $sFilter;\n\t}",
"public function userIdFiltering(&$filter)\n {\n // Enter your code here\n }",
"public static function GetFilesForUser($userId){\r\n\t\t\r\n\t\tConnect::init();\r\n\t\t\r\n\t\tsettype($userId, 'integer'); // clean\r\n\t\r\n\t\t$result = mysql_query(\"SELECT Files.FileId, Files.FileUniqId, Files.UniqueName, Files.FileName, \r\n\t\t\tFiles.Size, Files.Width, Files.Height, Files.IsPublic, Files.Thumbnail, Files.UserId, Files.SiteId,\r\n\t\t\tFiles.ContentType, Files.Created, Users.FirstName, Users.LastName,\r\n\t\t\tFiles.IsImage, Files.IsResized\r\n\t\t\tFROM Files, Users\r\n\t\t\tWHERE Files.UserId = $userId AND Files.UserId = Users.UserId ORDER BY Files.Created DESC\");\r\n\t\t\r\n\t\tif(!$result) {\r\n\t\t die(\"Could not successfully run query File->GetListByPost\" . mysql_error() . \"<br>\");\r\n\t\t exit;\r\n\t\t}\r\n\t\t\r\n\t\treturn $result;\r\n\t}",
"function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}",
"function UserID_Filtering(&$filter) {\r\n\r\n\t\t// Enter your code here\r\n\t}",
"public function getFilesOfCurrentUser()\r\n {\r\n $query = 'SELECT uploads.uploadid, uploads.filename, uploads.timestamp,';\r\n $query.= ' count(downloads.downloadid) as downloadcount, uploads.name, uploads.description, uploads.access';\r\n $query.= ' FROM uploads';\r\n $query.= ' LEFT JOIN downloads ON downloads.uploadid = uploads.uploadid';\r\n $query.= ' WHERE uploads.userid = :userid';\r\n $query.= ' GROUP BY uploads.uploadid, uploads.filename, uploads.timestamp, uploads.name, uploads.description, uploads.access';\r\n $query.= ' ORDER BY uploads.uploadid DESC';\r\n $query.= ' LIMIT 10 OFFSET 0';\r\n\r\n $stmt = $this->dbConnection->prepare($query);\r\n $stmt->execute([\r\n ':userid' => $this->userModel->getLoggedInUserId(),\r\n ]);\r\n $recordset = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\r\n\r\n return $this->parseUploadsRecordset($recordset);\r\n }",
"public function addUserIDFilter($filter = \"\")\n {\n global $Security;\n $filterWrk = \"\";\n $id = (CurrentPageID() == \"list\") ? $this->CurrentAction : CurrentPageID();\n if (!$this->userIDAllow($id) && !$Security->isAdmin()) {\n $filterWrk = $Security->userIdList();\n if ($filterWrk != \"\") {\n $filterWrk = '(select main_campaigns.vendor_id from main_campaigns where main_transactions.campaign_id = main_campaigns.id) IN (' . $filterWrk . ')';\n }\n }\n\n // Call User ID Filtering event\n $this->userIdFiltering($filterWrk);\n AddFilter($filter, $filterWrk);\n return $filter;\n }",
"private static function move_user_id_param_to_filter( $atts, &$view ) {\n\t\tif ( ! $atts['user_id'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get the userID field in the form\n\t\t$user_id_fields = FrmField::get_all_types_in_form( $view->frm_form_id, 'user_id' );\n\t\t$user_id_field = reset( $user_id_fields );\n\n\t\t// Get the user value\n\t\tif ( 'current' === $atts['user_id'] ) {\n\t\t\t$user_val = get_current_user_id();\n\t\t} else {\n\t\t\t$user_val = $atts['user_id'];\n\t\t}\n\n\t\t// Replace userID filter or add a new one\n\t\tself::add_or_update_filter( $user_id_field->id, $user_val, $view );\n\t}",
"public function getFilesCurrentUser(User $user)\n {\n }",
"public function getUsersItems($user_id);",
"public function list_owned_files() {\n $stmt = $this->pdo->prepare('select filename from file where user_id = :id');\n $stmt->bindValue(':id', $this->id);\n $stmt->execute();\n $res = $stmt->fetchAll();\n $result = array();\n foreach ($res as $f) {\n array_push($result, $f['filename']);\n }\n return $result;\n }",
"function mf_get_filtered_users_ids($dbh,$filter_data,$exclude_admin=true){\n\n\t\t//set column properties for basic fields\n\t\t$column_name_lookup['user_fullname']\t= 'Name';\n\t\t$column_name_lookup['user_email']\t\t= 'Email';\n\t\t$column_name_lookup['priv_administer']\t= 'Admin Privileges';\n\t\t$column_name_lookup['status']\t\t\t= 'Status';\n\t\t\n\t\t$column_type_lookup['user_fullname']\t= 'text';\n\t\t$column_type_lookup['user_email']\t\t= 'text';\n\t\t$column_type_lookup['priv_administer'] \t= 'admin';\n\t\t$column_type_lookup['status']\t\t\t= 'status';\n\t\t\n\t\t\n\t\t$column_prefs = array('user_fullname','user_email','priv_administer','status');\n\t\t\n\t\t\n\t\t//determine column labels\n\t\t//the first 2 columns are always id and row_num\n\t\t$column_labels = array();\n\n\t\t$column_labels[] = 'mf_id';\n\t\t$column_labels[] = 'mf_row_num';\n\t\t\n\t\tforeach($column_prefs as $column_name){\n\t\t\t$column_labels[] = $column_name_lookup[$column_name];\n\t\t}\n\n\t\t//get the entries from ap_form_x table and store it into array\n\t\t$column_prefs_joined = '`'.implode(\"`,`\",$column_prefs).'`';\n\t\t\n\t\t//check for filter data and build the filter query\n\t\tif(!empty($filter_data)){\n\n\t\t\tif($filter_type == 'all'){\n\t\t\t\t$condition_type = ' AND ';\n\t\t\t}else{\n\t\t\t\t$condition_type = ' OR ';\n\t\t\t}\n\n\t\t\t$where_clause_array = array();\n\n\t\t\tforeach ($filter_data as $value) {\n\t\t\t\t$element_name \t = $value['element_name'];\n\t\t\t\t$filter_condition = $value['filter_condition'];\n\t\t\t\t$filter_keyword = addslashes($value['filter_keyword']);\n\n\t\t\t\t$filter_element_type = $column_type_lookup[$element_name];\n\n\t\t\t\t$temp = explode('_', $element_name);\n\t\t\t\t$element_id = $temp[1];\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($filter_condition == 'is'){\n\t\t\t\t\t\t$where_operand = '=';\n\t\t\t\t\t\t$where_keyword = \"'{$filter_keyword}'\";\n\t\t\t\t}else if($filter_condition == 'is_not'){\n\t\t\t\t\t\t$where_operand = '<>';\n\t\t\t\t\t\t$where_keyword = \"'{$filter_keyword}'\";\n\t\t\t\t}else if($filter_condition == 'begins_with'){\n\t\t\t\t\t\t$where_operand = 'LIKE';\n\t\t\t\t\t\t$where_keyword = \"'{$filter_keyword}%'\";\n\t\t\t\t}else if($filter_condition == 'ends_with'){\n\t\t\t\t\t\t$where_operand = 'LIKE';\n\t\t\t\t\t\t$where_keyword = \"'%{$filter_keyword}'\";\n\t\t\t\t}else if($filter_condition == 'contains'){\n\t\t\t\t\t\t$where_operand = 'LIKE';\n\t\t\t\t\t\t$where_keyword = \"'%{$filter_keyword}%'\";\n\t\t\t\t}else if($filter_condition == 'not_contain'){\n\t\t\t\t\t\t$where_operand = 'NOT LIKE';\n\t\t\t\t\t\t$where_keyword = \"'%{$filter_keyword}%'\";\n\t\t\t\t}else if($filter_condition == 'less_than' || $filter_condition == 'is_before'){\n\t\t\t\t\t\t$where_operand = '<';\n\t\t\t\t\t\t$where_keyword = \"'{$filter_keyword}'\";\n\t\t\t\t}else if($filter_condition == 'greater_than' || $filter_condition == 'is_after'){\n\t\t\t\t\t\t$where_operand = '>';\n\t\t\t\t\t\t$where_keyword = \"'{$filter_keyword}'\";\n\t\t\t\t}else if($filter_condition == 'is_admin'){\n\t\t\t\t\t\t$where_operand = '=';\n\t\t\t\t\t\t$where_keyword = \"'1'\";\n\t\t\t\t}else if($filter_condition == 'is_not_admin'){\n\t\t\t\t\t\t$where_operand = '=';\n\t\t\t\t\t\t$where_keyword = \"'0'\";\n\t\t\t\t}else if($filter_condition == 'is_active'){\n\t\t\t\t\t\t$where_operand = '=';\n\t\t\t\t\t\t$where_keyword = \"'1'\";\n\t\t\t\t}else if($filter_condition == 'is_suspended'){\n\t\t\t\t\t\t$where_operand = '=';\n\t\t\t\t\t\t$where_keyword = \"'2'\";\n\t\t\t\t}\n\t\t \t\t\t\n\t\t\t\t$where_clause_array[] = \"{$element_name} {$where_operand} {$where_keyword}\"; \n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$where_clause = implode($condition_type, $where_clause_array);\n\t\t\t\n\t\t\tif(empty($where_clause)){\n\t\t\t\t$where_clause = \"WHERE `status` > 0\";\n\t\t\t}else{\n\t\t\t\t$where_clause = \"WHERE ({$where_clause}) AND `status` > 0\";\n\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\n\t\t}else{\n\t\t\t$where_clause = \"WHERE `status` > 0\";\n\t\t}\n\n\n\t\t$query = \"select \n\t\t\t\t\t\t`user_id`,\n\t\t\t\t\t\t`user_id` as `row_num`,\n\t\t\t\t\t\t`user_fullname`,\n\t\t\t\t\t\t`user_email`,\n\t\t\t\t\t\tif(`priv_administer`=1,'Administrator','') `priv_administer`,\n\t\t\t\t\t\tif(`status`=1,'Active','Suspended') `status`\n\t\t\t\t from \n\t\t\t\t \t\".MF_TABLE_PREFIX.\"users A \n\t\t\t\t \t{$where_clause} \";\n\t\t\n\t\t$params = array();\n\t\t$sth = mf_do_query($query,$params,$dbh);\n\t\t\n\t\t$filtered_user_id_array = array();\n\t\twhile($row = mf_do_fetch_result($sth)){\n\t\t\tif($exclude_admin){\n\t\t\t\tif($row['user_id'] != 1){ \n\t\t\t\t\t$filtered_user_id_array[] = $row['user_id'];\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$filtered_user_id_array[] = $row['user_id'];\n\t\t\t}\n\t\t}\n\n\t\treturn $filtered_user_id_array;\n\n\t}",
"function ListFilteredFiles($Thefile,$userID,$tp) {\r\r\r\rglobal $wpdb;\r\rglobal $tp;\t\rglobal $post;\rglobal $wp_query;\r\r$upload_dir = wp_upload_dir();\t\t\r\r\t\t$ext = pathinfo($Thefile, PATHINFO_EXTENSION);\r\r\t\t \r\r\t\t$tExt = SetIcon($ext);\r\r\t\t\r\r\t\t\r\r\t\t\r\r\t\t\r\r\t\t\r\r\t\t\r\r\t\t\r\r\t\t\r\r\t\t\r\r\t\t\t\t\t\t\t\t\r\r\t\techo '<tr><td width=\"60%\" ><input type=\"checkbox\" name=\"change_cat'.$tp .'\" value=\"addit\" /> <input type=\"hidden\" name=\"file'.$tp.'\" value=\"'.$Thefile.'\" ><input type=\"hidden\" name=\"changecat_user'.$tp.'\" value=\"'.$userNum.'\"><img src=\"'. $tExt.'\" width=\"20\" > '.pathinfo($Thefile, PATHINFO_FILENAME) .'</td>';\r\r \r\r $getDescr = $wpdb->get_var(\"SELECT description FROM \". $wpdb->prefix . \"userfile_data WHERE filename = '\".$Thefile .\"' and user_id='\" .$userID. \"'\");\r\r \r\r \r\r echo '<td><textarea name=\"notes'.$tp.'\" rows=3 cols=30>'. \t$getDescr .'</textarea></td>';\t\t\t\t\r\r\r\r \r\r echo '<td>'.GetTimeStamp($Thefile,$userNum) .'</td>';\r\r\t\t\r\r\t\t\r\r\t\t\r\r\t\t echo '<td>';\r\r\t\t\t\t\t$currOpts_defcat = get_option('file_manger_defaultcat');\r\r\t\t\t\t\t\t\t$getCrntCat = $wpdb->get_var(\"SELECT category FROM \". $wpdb->prefix . \"userfile_data WHERE filename = '\".$Thefile .\"' and user_id='\" .$userID. \"'\");\t \r\r\t\t\t\t\t\t\t\t \r\r\t\t\t\t\t\t\t\tif (!$getCrntCat) {\t \r\r\t\t\t\t\t\t\t\techo $currOpts_defcat;\t\r\r\t\t\t\t\t\t\t\t}else{\r\r\t\t\t\t\t\t\t\techo $getCrntCat;\r\r\t\t\t\t\t\t\t\t}\r\r\t\t echo'</td>';\t\r\r\t\t\r\r\t\t\r\r\t\t\r\r\t\t\r\r\t\techo '<td align=\"right\">';\r\r\t\t\r\r\t\tif (is_admin()){\r\r\t\t\r\techo '<td class=\"'.$TheClass.'\"><a href=\"href=\"admin.php?page=manage-files-main&theDLfile='.$userID.'/'.$Thefile.'\" ><img title=\"Download '.$Thefile.'\" src=\"'.plugins_url( '/user-files/img/download.png' , dirname(__FILE__) ). '\" alt=\"\" width=\"20\" height=\"20\" /></a> '; \r\t\t}else{\r\t\t\r\t\t\techo '<td class=\"'.$TheClass.'\"><a href=\"href=\"'.site_url().'?p='.$post->ID.'&theDLfile='.$userID.'/'.$Thefile.'\" ><img title=\"Download '.$Thefile.'\" src=\"'.plugins_url( '/user-files/img/download.png' , dirname(__FILE__) ). '\" alt=\"\" width=\"20\" height=\"20\" /></a> '; \r\t\t\r\t\t}\r\t\t\r\r\t\t\r\r\t\tif(get_option('file_manger_allow_del')=='yes') {\r\t\t\r\t\tif(is_admin()){\r\t\techo ' | <a href=\"href=\"admin.php?page=manage-files-main&deletefile='.$userNum.'/'.$files.'\"><img title=\"Delete '.$files.'\" src=\"'.plugins_url( '/user-files/img/delete.png ' , dirname(__FILE__) ). '\" alt=\"\" width=\"20\" height=\"20\" /></a> </td></tr>';\r\r\t\t\t}else{\r\t\t\t\r\t\t\t\techo ' | <a href=\"href=\"'.site_url().'?p='.$post->ID.'&deletefile='.$userNum.'/'.$files.'\"><img title=\"Delete '.$files.'\" src=\"'.plugins_url( '/user-files/img/delete.png ' , dirname(__FILE__) ). '\" alt=\"\" width=\"20\" height=\"20\" /></a> </td></tr>';\r\t\t\t\r\t\t\t}\r\t\t\r\t\t\r\t\t}else{\r\r\t\techo '</form></td></tr>';\r\r\r\r\t\t\r\r\t\t}//end if\r\r$tp++; \r\r}",
"public function getApprovedFiles(int $id);",
"public function filterByUserid($usrcid = null, $comparison = null) {\n\t\treturn $this->filterByUsrcid($usrcid, $comparison);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle the venda "deleted" event. | public function deleted(Venda $venda)
{
//
} | [
"public function deleted()\n {\n // do something after delete\n }",
"public function deleted(Event $event)\n {\n //\n }",
"public\n function deleted(Event $event)\n {\n //\n }",
"abstract public function handleDelete($event);",
"public function forceDeleted(Venda $venda)\n {\n //\n }",
"public function on_delete() {}",
"public function handleAssetDeleted(AssetDeleted $event)\n {\n $this->addEntry(\"Deleted asset '\".$event->asset->url().\"'\");\n }",
"public function deleted(Entry $entry)\n {\n //\n }",
"public function deleted()\n {\n }",
"protected function afterDeletion() {}",
"public function deleted(Contato $contato)\n {\n //\n }",
"public function forceDeleted(Event $event)\n {\n //\n }",
"public function deleted(EntryInterface $entry)\n {\n //$this->dispatch(new DeleteStream($entry));\n\n parent::deleted($entry);\n }",
"protected function afterDelete () {}",
"public function deleted(ContatoEmail $contatoEmail)\n {\n //\n }",
"public static function deleted($callback)\n {\n static::registerModelEvent('deleted', $callback);\n }",
"public function deleted(Video $video)\n {\n //\n }",
"public function deleted(Vote $vote)\n {\n //\n }",
"public function deleted()\n {\n // Delete related images when model is deleted\n $this->deleteImages();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Rotates the stream file if due | private function rotateStreamFile() {
// Close the stream
fclose($this->statusStream);
// Create queue file with timestamp so they're both unique and naturally ordered
$queueFile = $this->queueDir . '/' . self::QUEUE_FILE_PREFIX . '.' . date('Ymd-His') . '.queue';
// Do the rotate
rename($this->streamFile, $queueFile);
// Did it work?
if (!file_exists($queueFile)) {
throw new Exception('Failed to rotate queue file to: ' . $queueFile);
}
// At this point, all looking good - the next call to getStream() will create a new active file
// $this->log('Successfully rotated active stream to queue file: ' . $queueFile) . "\n";
} | [
"private function rotateStreamFile() {\n // Close the stream\n fclose($this->statusStream);\n\n // Create queue file with timestamp so they're both unique and naturally ordered\n $queueFile = $this->queueDir . '/' . self::QUEUE_FILE_PREFIX . '.' . date('Ymd-His') . '.queue';\n\n // Do the rotate\n rename($this->streamFile, $queueFile);\n\n // Did it work?\n if (!file_exists($queueFile)) \n throw new Exception('Failed to rotate queue file to: ' . $queueFile);\n\n // At this point, all looking good - the next call to getStream() will create a new active file\n $this->log('Successfully rotated active stream to queue file: ' . $queueFile);\n }",
"private function rotateStreamFile()\n {\n // Close the stream\n fclose($this->statusStream);\n\n // Create queue file with timestamp so they're both unique and naturally ordered\n $queueFile = $this->queueDir . '/' . self::QUEUE_FILE_PREFIX . '.' . date('Ymd-His') . '.queue';\n\n // Do the rotate\n rename($this->streamFile, $queueFile);\n\n // Did it work?\n if (!file_exists($queueFile)) {\n throw new Exception('Failed to rotate queue file to: ' . $queueFile);\n }\n\n // At this point, all looking good - the next call to getStream() will create a new active file\n $this->log('Successfully rotated active stream to queue file: ' . $queueFile);\n }",
"private function rotateStreamFile()\n {\n // Close the stream\n fclose($this->statusStream);\n\n // Create queue file with timestamp so they're both unique and naturally ordered\n $queueFile = $this->queueDir . '/' . self::QUEUE_FILE_PREFIX . '.' . date('Ymd-His') . '.queue';\n\n // Do the rotate\n rename($this->streamFile, $queueFile);\n\n // Did it work?\n if (!file_exists($queueFile))\n {\n throw new Exception('Failed to rotate queue file to: ' . $queueFile);\n }\n\n // At this point, all looking good - the next call to getStream() will create a new active file\n log2file('QueueCollector.rotateStreamFile','Successfully rotated active stream to queue file: ' . $queueFile);\n }",
"private function rotate() {\n copy($this->sFilePath, $this->sFilePath . \"_\" . date('Y-m-d_H_i_s'));\n clearstatcache(); // Drop internal php cache with file's stat\n file_put_contents($this->sFilePath, \"\"); //清空文件内容\n chmod($this->sFilePath, $this->hStat[\"mode\"]); // Change CTime\n\t flock($this->lock_fp, LOCK_UN); // 释放锁定\n\t fclose($this->lock_fp);\n }",
"private function rotate_log() {\n\n\t\t// rotate\n\t\t$path_info = pathinfo( $this->log_file );\n\t\t$base_directory = $path_info['dirname'];\n\t\t$base_name = $path_info['basename'];\n\t\t$num_map = array();\n\n\t\tforeach ( new DirectoryIterator( $base_directory ) as $fInfo ) {\n\n\t\t\tif ( $fInfo->isDot() || ! $fInfo->isFile() ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( preg_match( '/^' . $base_name . '\\.?([0-9]*)$/', $fInfo->getFilename(), $matches ) ) {\n\n\t\t\t\t$num = $matches[1];\n\t\t\t\t$old_file = $fInfo->getFilename();\n\n\t\t\t\tif ( $num == '' ) {\n\t\t\t\t\t$num = - 1;\n\t\t\t\t}\n\n\t\t\t\t$num_map[ $num ] = $old_file;\n\n\t\t\t}\n\n\t\t}\n\n\t\tkrsort( $num_map );\n\n\t\tforeach ( $num_map as $num => $old_file ) {\n\n\t\t\t$new_file = $num + 1;\n\t\t\t@rename( $base_directory . DIRECTORY_SEPARATOR . $old_file, $this->log_file . '.' . $new_file );\n\n\t\t}\n\n\t\t$this->start_log();\n\n\t}",
"protected function rotate()\n {\n $dir = $this->getDirectory();\n\n // skip GC of old logs if files are unlimited\n if (0 === $this->maxFiles) {\n return;\n }\n\n $logFiles = glob($dir . '/db_query.' . $this->queries->context . '.*.log' );\n\n if ($this->maxFiles >= count($logFiles)) {\n // no files to remove\n return;\n }\n\n // Sorting the files by name to remove the older ones\n usort($logFiles, function ($a, $b) {\n return strcmp($b, $a);\n });\n\n // Remove max files - 1 as we are always adding a file after a rotate\n foreach (array_slice($logFiles, $this->maxFiles-1) as $file) {\n if (is_writable($file)) {\n // suppress errors here as unlink() might fail if two processes\n // are cleaning up/rotating at the same time\n set_error_handler(function ($errno, $errstr, $errfile, $errline) {});\n unlink($file);\n restore_error_handler();\n }\n }\n\n $this->mustRotate = false;\n }",
"protected function rotateLogFile(): void\n {\n if (file_exists($this->logFileUrl . '.lock')) {\n return;\n } else {\n touch($this->logFileUrl . '.lock');\n }\n\n if ($this->logFilesToKeep === 0) {\n unlink($this->logFileUrl);\n } else {\n for ($logFileCount = $this->logFilesToKeep; $logFileCount > 0; --$logFileCount) {\n $rotatedLogFileUrl = $this->logFileUrl . '.' . $logFileCount;\n if (file_exists($rotatedLogFileUrl)) {\n if ($logFileCount == $this->logFilesToKeep) {\n unlink($rotatedLogFileUrl);\n } else {\n rename($rotatedLogFileUrl, $this->logFileUrl . '.' . ($logFileCount + 1));\n }\n }\n }\n rename($this->logFileUrl, $this->logFileUrl . '.1');\n }\n\n unlink($this->logFileUrl . '.lock');\n }",
"public function rotateLogs()\n {\n $files = $this->findLogs();\n if ($files) {\n $this->makeDir();\n foreach ($files as $file) {\n $this->zipAndDeleteFile($file);\n }\n }\n }",
"private function isRotationNeeded()\n {\n clearstatcache();\n \n if (! file_exists($this->file)) {\n return false;\n }\n \n $result = false;\n \n $attributes = stat($this->file);\n \n if ($attributes == false || $attributes['size'] >= $this->maxLogSize * 1024 * 1024) {\n $result = true;\n }\n \n return $result;\n }",
"static function rotateLog( $fileName )\n {\n $maxLogrotateFiles = eZLog::maxLogrotateFiles();\n if ( $maxLogrotateFiles == 0 )\n {\n return;\n }\n for ( $i = $maxLogrotateFiles; $i > 0; --$i )\n {\n $logRotateName = $fileName . '.' . $i;\n if ( file_exists( $logRotateName ) )\n {\n if ( $i == $maxLogrotateFiles )\n {\n @unlink( $logRotateName );\n }\n else\n {\n $newLogRotateName = $fileName . '.' . ($i + 1);\n eZFile::rename( $logRotateName, $newLogRotateName );\n }\n }\n }\n if ( file_exists( $fileName ) )\n {\n $newLogRotateName = $fileName . '.' . 1;\n eZFile::rename( $fileName, $newLogRotateName );\n return true;\n }\n return false;\n }",
"private function _logRotate() {\n try {\n $dir = getcwd();\n $dir = \"{$dir}\".DS.\"Core\".DS.\"framework\".DS.\"lib\".DS.\"error\".DS.\"logs\".DS;\n $logs = @scandir($dir,1);\n if (count($logs)>2) {\n foreach ($logs as $logFile) {\n $filename = $dir.$logFile;\n if ( !is_dir($filename) ) {\n $info = pathinfo($filename);\n $ext = $info[\"extension\"];\n if ($ext==\"log\") {\n $lines = count(file($filename));\n\n if ( ($lines>=5000) && ($lines%5000==0) ) {\n $gzLines = array();\n $gzFile = \"{$filename}.gz\";\n if (file_exists($gzFile)) {\n $logInfo = \"\";\n $lines = gzfile($gzFile);\n foreach ($lines as $line) {\n $logInfo.=\"{$line}\";\n }\n\n $contents = \"\";\n $fp = fopen($filename,\"r\");\n if ($fp) {\n $contents .= fgets($fp,1024);\n }\n fclose($fp);\n\n $logInfo = $logInfo.$contents;\n\n $gzLog = gzopen ($gzFile,\"w9\");\n gzwrite ($gzLog,$logInfo);\n gzclose ($gzLog);\n unlink($filename);\n return true;\n }\n else {\n $contents = \"\";\n $fp = fopen($filename,\"r\");\n if ($fp) {\n $contents .= fgets($fp,1024);\n }\n fclose($fp);\n $gzLog = gzopen ($gzFile,\"w9\");\n gzwrite ($gzLog,$contents);\n gzclose ($gzLog);\n unlink($filename);\n return true;\n }\n }\n }\n }\n\n\n }\n }\n\n }\n\n catch (Exception $ex) {\n return false;\n }\n }",
"public function CheckAndRotateLogFile()\n\t{\n\t\t$oConfig = utils::GetConfig();\n\t\t$sItopTimeZone = $oConfig->Get('timezone');\n\t\t$timezone = new DateTimeZone($sItopTimeZone);\n\n\t\tif ($this->GetLastModifiedDateForFile() === null)\n\t\t{\n\t\t\tif (!$this->IsLogFileExists())\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$iLogDateLastModifiedTimeStamp = filemtime($this->sLogFileFullPath);\n\t\t\tif ($iLogDateLastModifiedTimeStamp === false)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$oDateTime = DateTime::createFromFormat('U', $iLogDateLastModifiedTimeStamp);\n\t\t\t$oDateTime->setTimezone($timezone);\n\t\t\t$this->SetLastModifiedDateForFile($oDateTime);\n\t\t}\n\n\t\t$oNow = new DateTime('now', $timezone);\n\t\t$bShouldRotate = $this->ShouldRotate($this->GetLastModifiedDateForFile(), $oNow);\n\t\tif (!$bShouldRotate)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$this->RotateLogFile($this->GetLastModifiedDateForFile());\n\t}",
"public function getRotatingFilename();",
"function rotate_log( $file_name )\r\n {\r\n $max_logrotate_files = MAX_LOGROTATE_FILES;\r\n for ( $i = $max_logrotate_files; $i > 0; --$i )\r\n {\r\n $log_rotate_name = $file_name . '.' . $i;\r\n if ( @file_exists( $log_rotate_name ) )\r\n {\r\n if ( $i == $max_logrotate_files )\r\n {\r\n \t@unlink( $log_rotate_name );\r\n }\r\n else\r\n {\r\n\t $new_log_rotate_name = $file_name . '.' . ($i + 1);\r\n\t @rename( $log_rotate_name, $new_log_rotate_name );\r\n }\r\n }\r\n }\r\n if ( @file_exists( $file_name ) )\r\n {\r\n\t $new_log_rotate_name = $file_name . '.' . 1;\r\n\t @rename( $file_name, $new_log_rotate_name );\r\n\t return true;\r\n }\r\n return false;\r\n }",
"private function rotateIfNeeded()\n {\n if (isset($this->interval) && $this->interval >= 0) {\n $modificationTime = $this->getLastModificationTime();\n\n if (null === $modificationTime) {\n $this->regen();\n } elseif (($modificationTime + $this->interval) < time()) {\n $this->rotate();\n }\n }\n }",
"public function logRotate() {\n }",
"public function rotate()\n {\n // Update the current user to the next user\n $this->current_user()->associate($this->next_user->id);\n\n // Update the date of the next rotation\n $this->last_change = now();\n $this->next_change = $this->next_change->addSeconds($this->period);\n $this->save();\n\n // Mark all draft entries as \"final\"\n $this->entries()->whereStatus('draft')->update(['status' => 'final']);\n }",
"public function rotateLogs() {\n\t\tif (\n\t\t\t\tdf_cfg()->logging()->isEnabled()\n\t\t\t&&\n\t\t\t\tdf_enabled(Df_Core_Feature::LOGGING)\n\t\t) {\n\t\t\t$lastRotationFlag = df_model('df_logging/flag')->loadSelf();\n\t\t\t//$lastRotationTime = $lastRotationFlag->getFlagData();\n\t//\t\t$rotationFrequency =\n\t//\t\t\t3600 * 24 * df_cfg()->admin()->logging()->archiving()->getFrequency()\n\t//\t\t;\n\t//\t\tif (!$lastRotationTime || ($lastRotationTime < time() - $rotationFrequency)) {\n\t\t\t\tMage::getResourceModel('df_logging/event')->rotate(\n\t\t\t\t\t3600 * 24 * (df_cfg()->admin()->logging()->archiving()->getLifetime())\n\t\t\t\t);\n\t//\t\t}\n\t\t\t$lastRotationFlag->setFlagData(time())->save();\n\t\t}\n\t}",
"public function stream_close() {\n // If file mode we opened with is only for reading,\n // don't resave the file.\n if ((strpos($this->mode, 'r') !== FALSE) &&\n (strpos($this->mode, '+') === FALSE)) {\n fclose($this->handle);\n return;\n }\n\n $encryption_profile = $this->extractEncryptionProfile($this->uri);\n\n // Encrypt file and save.\n rewind($this->handle);\n $file_contents = stream_get_contents($this->handle);\n file_put_contents($this->getLocalPath(), $this->encrypt($file_contents, $encryption_profile));\n // Store important file info.\n $this->setFileInfo($file_contents, $this->uri);\n // Close handle and reset manual key.\n fclose($this->handle);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the filledAttendeesCount property value. The current number of customers in the appointment. | public function setFilledAttendeesCount(?int $value): void {
$this->getBackingStore()->set('filledAttendeesCount', $value);
} | [
"public function numberOfAttendees(): int\n {\n return $this->attendees()->count();\n }",
"public function setMaximumAttendeesCount($val)\n {\n $this->_propDict[\"maximumAttendeesCount\"] = intval($val);\n return $this;\n }",
"public function setContactCount($value)\n {\n return $this->set(self::CONTACTCOUNT, $value);\n }",
"public function fill(int $count, int $value) : void {}",
"public function setEmailCount(?int $value): void {\n $this->getBackingStore()->set('emailCount', $value);\n }",
"public function setAttendees(?array $value): void {\n $this->getBackingStore()->set('attendees', $value);\n }",
"public function setCompleteUsersCount(?int $value): void {\n $this->getBackingStore()->set('completeUsersCount', $value);\n }",
"public function setIncompleteUsersCount(?int $value): void {\n $this->getBackingStore()->set('incompleteUsersCount', $value);\n }",
"public function setAttendees($val)\n {\n $this->_propDict[\"attendees\"] = $val;\n return $this;\n }",
"public function setMaxAttendees($max): void {\n\t\tif (!empty($max) && !is_numeric($max)) {\n\t\t\t$max = null;\n\t\t}\n\t\t\n\t\t$this->max_attendees = $max;\n\t}",
"public function setAdHocMeetingsAttendedCount($val)\n {\n $this->_propDict[\"adHocMeetingsAttendedCount\"] = intval($val);\n return $this;\n }",
"public function setTenantAttachDeviceCount($val)\n {\n $this->_propDict[\"tenantAttachDeviceCount\"] = $val;\n return $this;\n }",
"public function setFieldCount() {\r\n\t\t$this->fieldCount = count($this->fieldNames);\r\n\t}",
"public function setCompliantDeviceCount($val)\n {\n $this->_propDict[\"compliantDeviceCount\"] = intval($val);\n return $this;\n }",
"public function increaseNumberOfOffers() {\n $this->numberOfOffers++;\n }",
"public function setActiveGradeInquiriesCount(int $count) {\n $this->active_grade_inquiries_count = $count;\n }",
"public function resetPartialBookingDayCustomers($v = true)\n {\n $this->collBookingDayCustomersPartial = $v;\n }",
"public function setAttachmentsCount($c)\n\t{\n\t\t$this->setItemsCount($c);\n\t}",
"public function setEnrolledDeviceCount(?int $value): void {\n $this->getBackingStore()->set('enrolledDeviceCount', $value);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
test grabbing a Comment by profile id | public function testGetValidCommentByProfileId() : void {
//count the number of rows and save it for later
$numRows = $this->getConnection()->getRowCount("comment");
//create a new Comment and insert it into mySQL
$commentId = generateUuidV4();
$comment = new Comment($commentId, $this->art->getArtId(), $this->profile->getProfileId(), $this->VALID_COMMENTCONTENT, $this->VALID_COMMENTDATETIME);
$comment->insert($this->getPDO());
//grab the data from mySQL and enforce that the fields match our expectations
$results = Comment::getCommentByCommentProfileId($this->getPDO(), $this->profile->getProfileId());
$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount("comment"));
$this->assertCount(1, $results);
$this->assertContainsOnlyInstancesOf("Edu\\Cnm\\AbqStreetArt\\Comment", $results);
//grab the result from the array and validate it
$pdoComment = $results[0];
//TODO do I need to include this code?
//$this->assertEquals($pdoComment->getCommentId(), $this->comment->getCommentId());
$this->assertEquals($pdoComment->getCommentArtId(), $this->art->getArtId());
$this->assertEquals($pdoComment->getCommentProfileId(), $this->profile->getProfileId());
//format the date to seconds since the beginning of time to avoid round off error
$this->assertEquals($pdoComment->getCommentDateTime()->getTimestamp(), $this->VALID_COMMENTDATETIME->getTimestamp());
} | [
"public function testGetValidCommentByProfileId() : void {\n\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"comment\");\n\n\t\t//creating Uuid\n\t\t$commentId = generateUuidV4();\n\n\t\t// create a new Comment and insert to into mySQL\n\t\t$comment = new Comment($commentId, $this->event->getEventId(), $this->profile->getProfileId(), $this->VALID_COMMENT_CONTENT, $this->VALID_COMMENT_DATE);\n\t\t$comment->insert($this->getPDO());\n\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$results = Comment::getCommentByCommentProfileId($this->getPDO(), $this->profile->getProfileId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"comment\"));\n\t\t$this->assertCount(1, $results);\n\n\t\t// grab the result from the array and validate it\n\t\t$pdoComment = $results[0]->comment;\n\t\t$this->assertEquals($pdoComment->getCommentId(), $commentId);\n\t\t$this->assertEquals($pdoComment->getCommentEventId(), $this->event->getEventId());\n\t\t$this->assertEquals($pdoComment->getCommentProfileId(), $this->profile->getProfileId());\n\t\t$this->assertEquals($pdoComment->getCommentContent(), $this->VALID_COMMENT_CONTENT);\n\t\t$this->assertEquals($results[0]->profileName, $this->profile->getProfileName());\n\n\n\t\t//format the date two seconds since the beginning of time to avoid round off error\n\t\t$this->assertEquals($pdoComment->getCommentDate()->getTimeStamp(), $this->VALID_COMMENT_DATE->getTimestamp());\n\t}",
"public function testGetValidCommentByCommentProfileId() {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"comment\");\n\t\t// create and insert new comment to into mySQL\n\t\t$commentId = generateUuidV4();\n\t\t$comment = new Comment($commentId, $this->profile->getProfileId(), $this->trail->getTrailId(), $this->VALID_COMMENT_CONTENT, $this->VALID_COMMENT_TIMESTAMP);\n\t\t$comment->insert($this->getPDO());\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$results = Comment::getCommentByCommentProfileId($this->getPDO(), $comment->getCommentProfileId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"comment\"));\n\t\t$this->assertCount(1, $results);\n\t\t$this->assertContainsOnlyInstancesOf(\"Edu\\\\Cnm\\\\AbqOutside\\\\Comment\", $results);\n\t\t// grab the result from the array and validate it\n\t\t$pdoComment = $results[0];\n\t\t$this->assertEquals($pdoComment->getCommentId(), $commentId);\n\t\t$this->assertEquals($pdoComment->getCommentProfileId(), $this->profile->getProfileId());\n\t\t$this->assertEquals($pdoComment->getCommentTrailId(), $this->trail->getTrailId());\n\t\t$this->assertEquals($pdoComment->getCommentContent(), $this->VALID_COMMENT_CONTENT);\n\t\t//format the date two seconds after beginning of time, for round off error\n\t\t$this->assertEquals($pdoComment->getCommentTimestamp()->getTimestamp(), $this->VALID_COMMENT_TIMESTAMP->getTimestamp());\n\t}",
"public function testGetInvalidCommentByCommentId(): void {\n\t\t// grab a profile id that exceeds the maximum allowable profile id\n\t\t$comment = Comment::getCommentByCommentId($this->getPDO(), generateUuidV4());\n\t\t$this->assertNull($comment);\n\t}",
"public function testProfilePrototypeFindByIdComments()\n {\n\n }",
"public function testGetOneComment()\n {\n $client = static::createClient(array(), array(\n 'PHP_AUTH_USER' => 'testeur',\n 'PHP_AUTH_PW' => 'testeur',\n ));\n $client->request('GET', '/api/gags/1/comments/1');\n\n $this->assertEquals(200, $client->getResponse()->getStatusCode());\n $this->assertContains('{\"id\":1', $client->getResponse()->getContent());\n }",
"public function testMakeCommentOnCard() {\n $content = 'Wonderful!';\n $commentid1 = Comment::comment($this->user2->get_id(), $content, \n\t\t\t\t NULL, 0, $this->cardid1, NULL, $this->con);\n\n // check if this comment is inserted into the table\n $result = select_from(\"comments\", \"*\", \"WHERE `commentid` = '$commentid1'\", $this->con);\n\n $this->assertEquals(1, $result->num_rows);\n while ($row = mysqli_fetch_assoc($result)) {\n $this->assertEquals($content, $row['content']);\n $this->assertEquals('', $row['reply_commentid']); // NULL is '' in mysql?\n $this->assertEquals('0', $row['type']);\n $this->assertEquals($this->cardid1, $row['targetid']);\n }\n }",
"function getCommentInstance($id)\n\t{\n $uri = \"/comment/\" . $this->username . \"/\" . $id . \"/\";\n return $this->json_client->GET($uri);\n\t}",
"public function testProfilePrototypeGetComments()\n {\n\n }",
"public function testFindScreenCommentById()\n {\n $user = User::findOne(1002);\n\n $this->specify('Non existing comment', function () use ($user) {\n $comment = $user->findScreenCommentById(0);\n verify($comment)->null();\n });\n\n $this->specify('Existing comment from a screen owned by a different user', function () use ($user) {\n $comment = $user->findScreenCommentById(1004);\n verify($comment)->null();\n });\n\n $this->specify('Existing comment from a screen owned by the current user', function () use ($user) {\n $comment = $user->findScreenCommentById(1001);\n verify($comment)->isInstanceOf(ScreenComment::className());\n });\n\n $this->specify('Super user - existing comment from a screen owned by a different user', function () use ($user) {\n $super = clone $user;\n $super->type = User::TYPE_SUPER;\n\n verify($super->findScreenCommentById(1004, true))->null();\n verify($super->findScreenCommentById(1004))->isInstanceOf(ScreenComment::className());\n });\n\n $this->specify('Super user - existing comment from a screen owned by the current user', function () use ($user) {\n $super = clone $user;\n $super->type = User::TYPE_SUPER;\n\n verify($super->findScreenCommentById(1001, true))->isInstanceOf(ScreenComment::className());\n verify($super->findScreenCommentById(1001))->isInstanceOf(ScreenComment::className());\n });\n }",
"public function testFindScreenCommentById()\n {\n $project = Project::findOne(1001);\n\n $this->specify('Nonexisting comment', function () use ($project) {\n $comment = $project->findScreenCommentById(0);\n verify($comment)->null();\n });\n\n $this->specify('Existing comment from a screen owned by a different user', function () use ($project) {\n $comment = $project->findScreenCommentById(1004);\n verify($comment)->null();\n });\n\n $this->specify('Existing comment from a screen owned by the current user', function () use ($project) {\n $comment = $project->findScreenCommentById(1001);\n verify($comment)->isInstanceOf(ScreenComment::className());\n });\n }",
"function test_getComment() {\r\n\t\t$testResults1 = CommentDB::getComment($this->rowset);\r\n\t\t$this->validate($testResults1, $this->rowset);\r\n\t}",
"public function testThatWeCanGetSpecificComment(): void\n {\n $this->withHeaders([\n 'Authorization' => 'Bearer ' . $this->token\n ])->json('POST', '/api/v1/articles/1/comments', [\n 'description' => 'Comment description1',\n ]);\n\n $response = $this->json('GET', '/api/v1/articles/1/comments/1');\n\n $response\n ->assertStatus(200)\n ->assertJson([\n 'description' => 'Comment description1'\n ]);\n }",
"public function findComment($id);",
"public function testGetCommentById()\n {\n $date = new \\Datetime();\n $client = self::createClient();\n $user = $this->createUser(\n 'yet_anotherUser@example.com',\n 'foo',\n '042515183',\n '80.00',\n 'https://imapictureofnothing.com',\n 'testme',\n 'now', ['ROLE_USER', 'ROLE_ADMIN']);\n\n $shift = new ScheduledShift();\n $shift->setOnDuty($user);\n $shift->setStart($date);\n $shift->setEnd($date);\n $shift->setIsApproved(true);\n $shift->setShiftStatus('primary');\n $em = $this->getEntityManager();\n $em->persist($shift);\n $em->flush();\n\n $comment = new ShiftComments();\n $comment->setAuthoredBy($user);\n $comment->setShift($shift);\n $comment->setComment('I am another comment, Blah Blah Blah!');\n $comment->setDateOfComment($date);\n $comment->setRecipient($user);\n $comment->setIsPrivate(true);\n $comment->setSubject('Comment!');\n $comment->setMarkedAsRead(false);\n $em = $this->getEntityManager();\n $em->persist($comment);\n $em->flush();\n\n $client->request('GET', '/comments/'.$comment->getId());\n $this->assertResponseStatusCodeSame(200);\n }",
"public function findCommentById($id);",
"public function testGetComment()\n {\n $model = UserScreenCommentRel::findOne(1001);\n $query = $model->getComment();\n\n verify($query)->isInstanceOf(ActiveQuery::className());\n verify('Should be hasOne relation', $query->multiple)->false();\n verify('Query result should be valid ScreenComment model', $model->comment)->isInstanceOf(ScreenComment::className());\n verify('Query result comment id should match', $model->comment->id)->equals($model->screenCommentId);\n }",
"public function test_a_user_can_browse_comments() {\n\t\t$user = User::factory()->create(); \n $forum = Forum::factory()->create(['user_id' => $user->id]);\n\t\t$post = Post::factory()->create(['user_id' => $user->id,\n 'forum_id' => $forum->id]);\n $comment = Comment::factory()->create(['user_id' => $user->id,\n 'post_id' => $post->id]);\n\n\t\t$response = $this->get('/api/posts/' . $post->id . '/comments');\n\t\t$response->assertSee($comment->body);\n\t\t$response->assertStatus(200);\n\t}",
"public function testGetComment()\n\t{\n\t\t$returnData = new stdClass;\n\t\t$returnData->code = 200;\n\t\t$returnData->body = $this->sampleString;\n\n\t\t$this->client->expects($this->once())\n\t\t\t->method('get')\n\t\t\t->with('/gists/comments/523')\n\t\t\t->will($this->returnValue($returnData));\n\n\t\t$this->assertThat(\n\t\t\t$this->object->comments->get(523),\n\t\t\t$this->equalTo(json_decode($this->sampleString))\n\t\t);\n\t}",
"public function testMakeCommentOnDeck() {\n $content = 'Brilliant work!';\n $commentid1 = Comment::comment($this->user2->get_id(), $content, \n\t\t\t\t NULL, 1, $this->deckid1, NULL, $this->con);\n\n // check if this comment is inserted into the table\n $result = select_from(\"comments\", \"*\", \"WHERE `commentid` = '$commentid1'\", $this->con);\n\n $this->assertEquals(1, $result->num_rows);\n while ($row = mysqli_fetch_assoc($result)) {\n $this->assertEquals($content, $row['content']);\n $this->assertEquals('', $row['reply_commentid']);\n $this->assertEquals('1', $row['type']);\n $this->assertEquals($this->deckid1, $row['targetid']);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a total expence based on $report | static function getExpense( $report = null ) {
switch ( gettype( $report ) ) {
case 'NULL':
$report = finance_api::getPeriod();
case 'object':
$report = finance_api::getReport( $report );
case 'array':
}
$total = 0;
foreach ( $report as $item ) {
if ( $item->amount < 0 ) {
$total += $item->amount;
}
}
return -$total;
} | [
"function getTotalofReports(){\r\n $books = getReportofTotal();\r\n $totalIncome = 0;\r\n\r\n for($ctr = 0; $ctr < count($books); $ctr++){\r\n $totalIncome += $books[$ctr][2];\r\n }\r\n\r\n return $totalIncome;\r\n }",
"public function retrieveTotalReport()\n {\n return $this->start()->uri(\"/api/report/totals\")\n ->get()\n ->go();\n }",
"public function reporteMensualTotal(){\n\n }",
"function getActivityExpenseAmount(){\n\t\t$expenselines = $this->getExpensesDetails();\n\t\t$expensetotal = 0;\n\t\tif($expenselines){\n\t\t\tforeach ($expenselines as $expense){\n\t\t\t\t$expensetotal += isEmptyString($expense->getAmount()) ? 0 : $expense->getAmount();\n\t\t\t}\n\t\t}\n\t\treturn $expensetotal;\n\t}",
"public function getTotalEssais()\n {\n $total = 0;\n if(isset($this->stats))\n {\n foreach($this->stats as $val) $total += $val['essais'];\n }\n \n return $total;\n }",
"public function getExpenseReport()\n\t{\n\t\treturn $this->expense_report;\n\t}",
"public function calculateAdjustmentsTotal();",
"static function getFavTotals($report)\r\n {\r\n global $user;\r\n\r\n $mdb2 = getConnection();\r\n\r\n $where = ttReportHelper::getFavWhere($report);\r\n\r\n // Start with a query for time items.\r\n if ($report['show_cost']) {\r\n if (MODE_TIME == $user->tracking_mode) {\r\n $sql = \"select sum(time_to_sec(l.duration)) as time,\r\n sum(cast(l.billable * coalesce(u.rate, 0) * time_to_sec(l.duration)/3600 as decimal(10,2))) as cost,\r\n null as expenses \r\n from tt_log l\r\n left join tt_users u on (l.user_id = u.id) $where\";\r\n } else {\r\n $sql = \"select sum(time_to_sec(l.duration)) as time,\r\n sum(cast(l.billable * coalesce(upb.rate, 0) * time_to_sec(l.duration)/3600 as decimal(10,2))) as cost,\r\n null as expenses\r\n from tt_log l\r\n left join tt_user_project_binds upb on (l.user_id = upb.user_id and l.project_id = upb.project_id) $where\";\r\n }\r\n } else\r\n $sql = \"select sum(time_to_sec(l.duration)) as time, null as cost, null as expenses from tt_log l $where\";\r\n\r\n // If we have expenses, query becomes a bit more complex.\r\n if ($report['show_cost'] && $user->isPluginEnabled('ex')) {\r\n $where = ttReportHelper::getFavExpenseWhere($report);\r\n $sql_for_expenses = \"select null as time, sum(cost) as cost, sum(cost) as expenses from tt_expense_items ei $where\";\r\n // Create a combined query.\r\n $sql = \"select sum(time) as time, sum(cost) as cost, sum(expenses) as expenses from (($sql) union all ($sql_for_expenses)) t\";\r\n }\r\n\r\n // Execute query.\r\n $res = $mdb2->query($sql);\r\n if (is_a($res, 'PEAR_Error')) die($res->getMessage());\r\n\r\n $val = $res->fetchRow();\r\n $total_time = $val['time'] ? sec_to_time_fmt_hm($val['time']) : null;\r\n if ($report['show_cost']) {\r\n $total_cost = $val['cost'];\r\n if (!$total_cost) $total_cost = '0.00';\r\n if ('.' != $user->decimal_mark)\r\n $total_cost = str_replace('.', $user->decimal_mark, $total_cost);\r\n $total_expenses = $val['expenses'];\r\n if (!$total_expenses) $total_expenses = '0.00';\r\n if ('.' != $user->decimal_mark)\r\n $total_expenses = str_replace('.', $user->decimal_mark, $total_expenses);\r\n }\r\n\r\n if ($report['period'])\r\n $period = new Period($report['period'], new DateAndTime($user->date_format));\r\n else {\r\n $period = new Period();\r\n $period->setPeriod(\r\n new DateAndTime($user->date_format, $report['period_start']),\r\n new DateAndTime($user->date_format, $report['period_end']));\r\n }\r\n\r\n $totals['start_date'] = $period->getStartDate();\r\n $totals['end_date'] = $period->getEndDate();\r\n $totals['time'] = $total_time;\r\n $totals['cost'] = $total_cost;\r\n $totals['expenses'] = $total_expenses;\r\n\r\n return $totals;\r\n }",
"public function actionGetTotalByCriteria()\n {\n // Find export ID\n $exportId = craft()->request->getParam('id');\n if (! $exportId) {\n $this->redirect('amforms/exports');\n }\n\n // Get the export\n $export = craft()->amForms_exports->getExportById($exportId);\n if (! $export) {\n throw new Exception(Craft::t('No export exists with the ID “{id}”.', array('id' => $exportId)));\n }\n\n // Get total submissions by criteria\n craft()->amForms_exports->saveTotalByCriteria($export);\n\n // Redirect to exports!\n $this->redirect('amforms/exports');\n }",
"function cash_flow_exp($report_hash) {\r\n\t\t$reports = new reports($this->current_hash);\r\n\t\t$_POST['report_hash'] = $report_hash;\r\n\t\t$_POST['doit_print'] = 1;\r\n\t\t// Populate data for reports object.\r\n\t\t$reports->doit_cash_flow_exp();\r\n\t\t$sched_start_date = $reports->current_report['sched_start_date'];\r\n\t\t$day_sched = $reports->current_report['day_schedule'];\r\n\r\n\t\t// Start the PDF document ( A4 size x:595.28 y:841.89 )\r\n\t\t$this->pdf = new Cezpdf();\r\n\r\n\t\t$title = MY_COMPANY_NAME.\" Cash Flow Expectations Report\";\r\n\t\t$creation_date = date(TIMESTAMP_FORMAT,time());\r\n\r\n\t\t$this->pdf->addInfo('Title',$title);\r\n\t\t$this->pdf->addInfo('CreationDate',$creation_date);\r\n\r\n\t\t// Print header\r\n\t\t$headerObj = $this->pdf->openObject();\r\n\t\t$this->pdf->saveState();\r\n\t\t$this->pdf->selectFont('include/fonts/Helvetica.afm');\r\n\t\t$this->pdf->ezText((defined('MY_COMPANY_NAME') ? MY_COMPANY_NAME : NULL),16,array('justification' => 'center'));\r\n\t\t$this->pdf->ezText(\"Cash Flow Expectations Report\",16,array('justification' => 'center'));\r\n\t\t$this->pdf->ezText(\"As of \".date(DATE_FORMAT,strtotime($sched_start_date)),12,array('justification' => 'center', 'leading' => 15));\r\n\t\t$this->pdf->addText(20,$this->pdf->y + 60, 8, \"Printed by \".$_SESSION['my_name']);\r\n\t\t$this->pdf->addText(470, $this->pdf->y + 60, 8, \"Printed on \".date(DATE_FORMAT).\" at \".date(TIMESTAMP_FORMAT));\r\n\t\t// Column headers\r\n\t\t//date(DATE_FORMAT,strtotime($val['invoice_date'].\" +\".($val['payment_terms'] ? $val['payment_terms'] : DEFAULT_CUST_PAY_TERMS).\" days\")),\r\n\t\t$cols = array(\"invoice_no\"\t =>\t\"Invoice No.\",\r\n\t\t\t\t\t\t \"invoice_date\" =>\t\"Invoice Date\",\r\n\t\t\t\t\t\t \"due_date\" => \"Due Date\",\r\n\t\t\t\t\t\t \"expected\" => \"Expected\",\r\n\t\t\t\t\t\t \"past\"\t => \"Past\",\r\n\t\t\t\t\t\t \"sched1\" => date(DATE_FORMAT,strtotime($sched_start_date.\" +\".$day_sched.\" days\")),\r\n\t\t\t\t\t\t \"sched2\" => date(DATE_FORMAT,strtotime($sched_start_date.\" +\". 2 * $day_sched.\" days\")),\r\n\t\t\t\t\t\t \"sched3\" => date(DATE_FORMAT,strtotime($sched_start_date.\" +\". 3 * $day_sched.\" days\")),\r\n\t\t\t\t\t\t \"future\" => \"Future\");\r\n\r\n\t\t// Calculate x coordinate for each column\r\n\t\t$start = $this->pdf->ez['leftMargin'] + 30; // X coordinate of first column\r\n\t\t$space = 60; // space between invoice detail columns\r\n\t\t$space2 = 55;\r\n\t\t$right_adj = 15;\r\n\t\t$col5 = $start + 3 * $space + $space2 - 10;\r\n\t\t$col6 = $col5 + $space2 + 5;\r\n\t\t$col7 = $col6 + $space2 + 5;\r\n\t\t$col8 = $col7 + $space2 + 5;\r\n\t\t$col9 = $col8 + $space2 -15;\r\n\t\t$font_size = 8;\r\n\r\n\t\t// Print header for each column\r\n\t\t$this->pdf->ezSetDy(-20);\r\n\t\t$this->pdf->addText($start, $this->pdf->y,$font_size,\"<b>\".$cols['invoice_no'].\"</b>\");\r\n\t\t$this->pdf->addText($start + $space, $this->pdf->y,$font_size,\"<b>\".$cols['invoice_date'].\"</b>\");\r\n\t\t$this->pdf->addText($start + 2 * $space, $this->pdf->y,$font_size,\"<b>\".$cols['due_date'].\"</b>\");\r\n\t\t$this->pdf->addText($start + 3 * $space, $this->pdf->y,$font_size,\"<b>\".$cols['expected'].\"</b>\");\r\n\t\t$this->pdf->addTextWrap($col5, $this->pdf->y, $space2, $font_size,\"<b>\".$cols['past'].\"</b>\",'right');\r\n\t\t$this->pdf->addTextWrap($col6, $this->pdf->y, $space2, $font_size,\"<b>\".$cols['sched1'].\"</b>\",'right');\r\n\t\t$this->pdf->addTextWrap($col7, $this->pdf->y, $space2, $font_size,\"<b>\".$cols['sched2'].\"</b>\", 'right');\r\n\t\t$this->pdf->addTextWrap($col8, $this->pdf->y, $space2, $font_size,\"<b>\".$cols['sched3'].\"</b>\",'right');\r\n\t\t$this->pdf->addTextWrap($col9, $this->pdf->y, $space2, $font_size,\"<b>\".$cols['future'].\"</b>\",'right');\r\n\t\t$this->pdf->setStrokeColor(0,0,0);\r\n\t\t$this->pdf->setLineStyle(1);\r\n\t\t$this->pdf->line($this->pdf->ez['leftMargin'], $this->pdf->y - 5,$this->pdf->ez['pageWidth'] - $this->pdf->ez['rightMargin'],$this->pdf->y - 5);\r\n\r\n\t\t$y_head = $this->pdf->y;\r\n\t\t$this->pdf->restoreState();\r\n\t\t$this->pdf->closeObject();\r\n\t\t$this->pdf->addObject($headerObj,'all');\r\n\r\n\t\t$this->pdf->ezSetMargins(($this->pdf->ez['pageHeight'] - $y_head) + 20,30,30,30);\r\n\r\n\t\t// Print footer\r\n\t\t$bottomFoot = $this->pdf->openObject();\r\n\t\t$this->pdf->saveState();\r\n\t\t$this->pdf->selectFont('include/fonts/Helvetica.afm');\r\n\r\n\t\t$this->pdf->setStrokeColor(.8,.8,.8);\r\n\t\t$this->pdf->setLineStyle(1);\r\n\t\t$this->pdf->line(30,30,565.28,30);\r\n\t\t$this->pdf->restoreState();\r\n\t\t$this->pdf->closeObject();\r\n\r\n\t\t$this->pdf->addObject($bottomFoot,'all');\r\n\t\t$this->pdf->ezStartPageNumbers(550,22,6);\r\n\t\t$this->pdf->selectFont('include/fonts/Helvetica.afm');\r\n\r\n\t\t// Options for each column\r\n\t\t$options_columns =\r\n\t\t\t\t\t\tarray (\"invoice_no\" => array ('justification' => 'left', 'width'=>$space),\r\n\t\t\t\t\t\t\t\"invoice_date\" => array ('justification' => 'left', 'width'=>$space),\r\n\t\t\t\t\t\t\t\"due_date\" => array ('justification' => 'left', 'width'=>$space),\r\n\t\t\t\t\t\t\t\"expected\" => array ('justification' => 'left', 'width'=>$space),\r\n\t\t\t\t\t\t\t\"past\" \t=> array ('justification' => 'right', 'width'=>$space2),\r\n\t\t\t\t\t\t\t\"sched1\" => array ('justification' => 'right', 'width'=>$space2),\r\n\t\t\t\t\t\t\t\"sched2\" => array ('justification' => 'right', 'width'=>$space2),\r\n\t\t\t\t\t\t\t\"sched3\" => array ('justification' => 'right', 'width'=>$space2),\r\n\t\t\t\t\t\t\t\"future\" => array ('justification' => 'right', 'width'=>$space2 - 5));\r\n\t\t$options_details =\r\n\t\t\t\t\t\tarray('fontSize'\t=> 7,\r\n\t\t\t\t\t\t 'width'\t\t\t=> 535.28,\r\n\t\t\t\t\t\t 'xPos'\t\t\t\t=> 60,\r\n\t\t\t\t\t\t 'xOrientation'\t\t=> 'right',\r\n\t\t\t\t\t\t 'showLines'\t\t=> 0,\r\n\t\t\t\t\t\t 'lineCol'\t\t\t=>\tarray(.8,.8,.8),\r\n\t\t\t\t\t\t 'shaded'\t\t\t=> 0,\r\n\t\t\t\t\t\t 'showHeadings' \t=> 0,\r\n\t\t\t\t\t\t 'rowGap'\t\t\t=>\t5,\r\n\t\t\t\t\t\t 'colGap'\t\t\t=>\t5,\r\n\t\t\t\t\t\t 'titleFontSize'\t=>\t10,\r\n\t\t\t\t\t\t 'shadeCol'\t\t\t=> array(.94,.94,.94),\r\n\t\t\t\t\t\t 'cols'\t\t\t\t=>\t$options_columns\r\n\t\t\t\t\t\t);\r\n\r\n\t\tif (is_array($reports->results)) {\r\n\t\t\t$k = 0;\r\n\r\n\t\t\twhile (list($customer_hash, $invoice_array) = each($reports->results)) {\r\n\t\t\t\t$total_past = $total_sched1 = $total_sched2 = $total_sched3 = $total_future = 0;\r\n\r\n\t\t\t\t$bottom_line_y = $this->pdf->y;\r\n\t\t\t\t$top_line_y = $bottom_line_y + 15;\r\n\t\t\t\t$x = 45;\r\n\r\n\t\t\t\t$this->pdf->setStrokeColor(.7,.7,.7);\r\n\t\t\t\t$this->pdf->setColor(.8,.8,.8);\r\n\t\t\t\t$this->pdf->setLineStyle(1);\r\n\t\t\t\t$this->pdf->line($this->pdf->ez['leftMargin'],$top_line_y,$this->pdf->ez['pageWidth'] - $this->pdf->ez['rightMargin'],$top_line_y);\r\n\t\t\t\t$this->pdf->line($this->pdf->ez['leftMargin'],$bottom_line_y,$this->pdf->ez['pageWidth'] - $this->pdf->ez['rightMargin'],$bottom_line_y);\r\n\t\t\t\t$this->pdf->filledRectangle($this->pdf->ez['leftMargin'],$bottom_line_y,$this->pdf->ez['pageWidth'] - $this->pdf->ez['rightMargin'] - $this->pdf->ez['leftMargin'],15);\r\n\r\n\t\t\t\t$this->pdf->setColor(0,0,0);\r\n\t\t\t\t$this->pdf->ezSetDy(15);\r\n\t\t\t\t$this->pdf->ezText(stripslashes($invoice_array['customer_name']), 12);\r\n\t\t\t\t$this->pdf->ezSetDy(-10);\r\n\t\t\t\t$details_f = array();\r\n\r\n\t\t\t\tfor ($i = 0; $i < count($invoice_array['pay_schedule']); $i++) {\r\n\t\t\t\t\t$invoice_amt = array();\r\n\t\t\t\t\t\tswitch ($invoice_array['pay_schedule'][$i]['sched']) {\r\n\t\t\t\t\t\t\tcase 'past':\r\n\t\t\t\t\t\t\t\t$total_past += $invoice_array['pay_schedule'][$i]['invoice']['balance'];\r\n\t\t\t\t\t\t\t\t$invoice_amt['past'] = $invoice_array['pay_schedule'][$i]['invoice']['balance'];\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase '1':\r\n\t\t\t\t\t\t\t\t$total_sched1 += $invoice_array['pay_schedule'][$i]['invoice']['balance'];\r\n\t\t\t\t\t\t\t\t$invoice_amt['sched1'] = $invoice_array['pay_schedule'][$i]['invoice']['balance'];\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase '2':\r\n\t\t\t\t\t\t\t\t$total_sched2 += $invoice_array['pay_schedule'][$i]['invoice']['balance'];\r\n\t\t\t\t\t\t\t\t$invoice_amt['sched2'] = $invoice_array['pay_schedule'][$i]['invoice']['balance'];\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase '3':\r\n\t\t\t\t\t\t\t\t$total_sched3 += $invoice_array['pay_schedule'][$i]['invoice']['balance'];\r\n\t\t\t\t\t\t\t\t$invoice_amt['sched3'] = $invoice_array['pay_schedule'][$i]['invoice']['balance'];\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase 'future':\r\n\t\t\t\t\t\t\t\t$total_future += $invoice_array['pay_schedule'][$i]['invoice']['balance'];\r\n\t\t\t\t\t\t\t\t$invoice_amt['future'] = $invoice_array['pay_schedule'][$i]['invoice']['balance'];\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t$details_f[] = array(\"invoice_no\" \t\t=> $invoice_array['pay_schedule'][$i]['invoice']['invoice_no'],\r\n\t\t\t\t\t\t\t\t\t\t\"invoice_date\" \t\t=> date(DATE_FORMAT,strtotime($invoice_array['pay_schedule'][$i]['invoice']['invoice_date'])),\r\n\t\t\t\t\t\t\t\t\t\t\"due_date\" \t\t\t=> $invoice_array['pay_schedule'][$i]['invoice']['due_date'],\r\n\t\t\t\t\t\t\t\t\t\t\"expected\"\t\t\t=> date(DATE_FORMAT,$invoice_array['pay_schedule'][$i]['invoice']['exp_date']),\r\n\t\t\t\t\t\t\t\t\t\t\"past\"\t\t\t\t=> $this->format_dollars($invoice_amt['past']),\r\n\t\t\t\t\t\t\t\t\t\t\"sched1\"\t\t \t=> $this->format_dollars($invoice_amt['sched1']),\r\n\t\t\t\t\t\t\t\t\t\t\"sched2\"\t\t \t=> $this->format_dollars($invoice_amt['sched2']),\r\n\t\t\t\t\t\t\t\t\t\t\"sched3\"\t\t \t=> $this->format_dollars($invoice_amt['sched3']),\r\n\t\t\t\t\t\t\t\t\t\t\"future\"\t\t\t=> $this->format_dollars($invoice_amt['future']));\r\n\r\n\t\t\t\t}\r\n\t\t\t\t\tif ($reports->current_report['showdetail'] == 2)\r\n\t\t\t\t\t\t$this->pdf->ezTable($details_f, $cols, \"\", $options_details);\r\n\t\t\t\t\t$total = $total_past + $total_sched1 + $total_sched2 + $total_sched3 + $total_future;\r\n\r\n\t\t\t\t\t$grand_total['past'] += $total_past;\r\n\t\t\t\t\t$grand_total['sched1'] += $total_sched1;\r\n\t\t\t\t\t$grand_total['sched2'] += $total_sched2;\r\n\t\t\t\t\t$grand_total['sched3'] += $total_sched3;\r\n\t\t\t\t\t$grand_total['future'] += $total_future;\r\n\r\n\t\t\t\t\t// Display totals for each schedule that has a balance\r\n\t\t\t\t\t$this->pdf->setStrokeColor(0,0,0);\r\n\t\t\t\t\t$this->pdf->setLineStyle(.5,'','',array(2,1));\r\n\t\t\t\t\t$s = 5;\r\n\t\t\t\t\t$h = 10;\r\n\t\t\t\t\tif ($total_past != 0) {\r\n\t\t\t\t\t\tif ($reports->current_report['showdetail'] == 2)\r\n\t\t\t\t\t\t\t$this->pdf->line($col5 + $right_adj, $this->pdf->y,$col5 + $space2 + $s, $this->pdf->y);\r\n\t\t\t\t\t\t$this->pdf->addTextWrap($col5 + $s, $this->pdf->y - $h, $space2, 7, $this->format_dollars($total_past), 'right');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($total_sched1 != 0) {\r\n\t\t\t\t\t\tif ($reports->current_report['showdetail'] == 2)\r\n\t\t\t\t\t\t\t$this->pdf->line($col6 + $right_adj, $this->pdf->y,$col6 + $space2 + $s, $this->pdf->y);\r\n\t\t\t\t\t\t$this->pdf->addTextWrap($col6 + $s, $this->pdf->y - $h, $space2, 7, $this->format_dollars($total_sched1), 'right');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($total_sched2 != 0) {\r\n\t\t\t\t\t\tif ($reports->current_report['showdetail'] == 2)\r\n\t\t\t\t\t\t\t$this->pdf->line($col7 + $right_adj, $this->pdf->y,$col7 + $space2 - $s, $this->pdf->y);\r\n\t\t\t\t\t\t$this->pdf->addTextWrap($col7 - $s, $this->pdf->y - $h, $space2, 7, $this->format_dollars($total_sched2), 'right');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($total_sched3 != 0) {\r\n\t\t\t\t\t\tif ($reports->current_report['showdetail'] == 2)\r\n\t\t\t\t\t\t\t$this->pdf->line($col8 + $right_adj, $this->pdf->y,$col8 + $space2 - 2 * $s, $this->pdf->y);\r\n\t\t\t\t\t\t$this->pdf->addTextWrap($col8 - 2 * $s, $this->pdf->y - $h, $space2, 7, $this->format_dollars($total_sched3), 'right');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($total_future != 0) {\r\n\t\t\t\t\t\tif ($reports->current_report['showdetail'] == 2)\r\n\t\t\t\t\t\t\t$this->pdf->line($col9 + $right_adj, $this->pdf->y,$col9 + $space2, $this->pdf->y);\r\n\t\t\t\t\t\t$this->pdf->addTextWrap($col9, $this->pdf->y - $h, $space2, 7, $this->format_dollars($total_future), 'right');\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$this->pdf->ezSetDy(-30);\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// Calculate and display the grand total of each aging schedule.\r\n\t\t\t$grand_total_all = $grand_total['past'] + $grand_total['sched1'] + $grand_total['sched2'] + $grand_total['sched3'] + $grand_total['future'];\r\n\r\n\t\t\t// Display totals for each column\r\n\t\t\t$bottom_line_y = $this->pdf->y;\r\n\t\t\t$top_line_y = $bottom_line_y + 20;\r\n\t\t\t$s = 5;\r\n\r\n\t\t\t$this->pdf->setStrokeColor(.7,.7,.7);\r\n\t\t\t$this->pdf->setColor(.8,.8,.8);\r\n\t\t\t$this->pdf->setLineStyle(1);\r\n\t\t\t$this->pdf->filledRectangle($this->pdf->ez['leftMargin'],$bottom_line_y,$this->pdf->ez['pageWidth'] - $this->pdf->ez['rightMargin'] - $this->pdf->ez['leftMargin'],15);\r\n\t\t\t$this->pdf->setColor(0,0,0);\r\n\t\t\t$this->pdf->addTextWrap($col5 + $s, $bottom_line_y + 2, $space2, 8, \"<b>\".$this->format_dollars($grand_total['past']).\"</b>\", 'right');\r\n\t\t\t$this->pdf->addTextWrap($col6 + $s, $bottom_line_y + 2, $space2, 8, \"<b>\".$this->format_dollars($grand_total['sched1']).\"</b>\", 'right');\r\n\t\t\t$this->pdf->addTextWrap($col7, $bottom_line_y + 2, $space2, 8, \"<b>\".$this->format_dollars($grand_total['sched2']).\"</b>\", 'right');\r\n\t\t\t$this->pdf->addTextWrap($col8, $bottom_line_y + 2, $space2, 8, \"<b>\".$this->format_dollars($grand_total['sched3']).\"</b>\", 'right');\r\n\t\t\t$this->pdf->addTextWrap($col9, $bottom_line_y + 2, $space2, 8, \"<b>\".$this->format_dollars($grand_total['future']).\"</b>\", 'right');\r\n\t\t\t$this->pdf->ezSetDy(-40);\r\n\r\n\t\t}\r\n\r\n\t}",
"public function getSummaryReport(){\n $payPalReportData = $this->getPayPalReport();\n $moneybookersReportData = $this->getMoneybookersReport();\n\n $summaryReportData = array();\n foreach($payPalReportData as &$payPalReportElement){\n $summaryReportData[$payPalReportElement['u_id']] = $payPalReportElement;\n $summaryReportData[$payPalReportElement['u_id']]['paypal_amount'] = $payPalReportElement['p_amount'];\n unset($summaryReportData[$payPalReportElement['u_id']]['p_amount']);\n unset($payPalReportElement);\n }\n \n foreach($moneybookersReportData as &$moneybookersReportElement){\n //add and sum\n if(isset($summaryReportData[$moneybookersReportElement['u_id']])){\n $summaryReportData[$moneybookersReportElement['u_id']]['moneybookers_amount'] = $moneybookersReportElement['p_amount'];\n }else {\n $summaryReportData[$moneybookersReportElement['u_id']] = $moneybookersReportElement;\n $summaryReportData[$moneybookersReportElement['u_id']]['moneybookers_amount'] = $moneybookersReportElement['p_amount'];\n }\n \n unset($summaryReportData[$moneybookersReportElement['u_id']]['p_amount']);\n unset($moneybookersReportData); \n }\n \n //make sum of amount\n foreach($summaryReportData as &$summaryReportElement){\n if(!isset($summaryReportElement['paypal_amount']))\n $summaryReportElement['paypal_amount'] = 0;\n \n if(!isset($summaryReportElement['moneybookers_amount']))\n $summaryReportElement['moneybookers_amount'] = 0;\n \n $summaryReportElement['total_amount'] = round($summaryReportElement['paypal_amount'] + $summaryReportElement['moneybookers_amount'], 2);\n }\n \n return $summaryReportData;\n }",
"public function totalEarned() {\n $total = 0;\n\n foreach ($this->all() as $record)\n if ($record->transactionType == 'Return' || $record->transactionType == 'Sold')\n $total += $record->cost;\n\n return $total;\n }",
"function income_statement($report_hash) {\r\n $reports = new reports($this->current_hash);\r\n $reports->fetch_report_settings($report_hash);\r\n $_POST['report_hash'] = $report_hash;\r\n $_POST['doit_print'] = 1;\r\n\r\n // Populate data for reports object.\r\n $reports->doit_income_statement($report_hash);\r\n\r\n // Start the PDF document ( A4 size x:595.28 y:841.89 )\r\n $this->pdf = new Cezpdf();\r\n\r\n $title = MY_COMPANY_NAME.\" Income Statement\";\r\n $creation_date = date(TIMESTAMP_FORMAT,time());\r\n\r\n $this->pdf->addInfo('Title',$title);\r\n $this->pdf->addInfo('CreationDate',$creation_date);\r\n\r\n // Print header\r\n $headerObj = $this->pdf->openObject();\r\n $this->pdf->saveState();\r\n $this->pdf->selectFont('include/fonts/Helvetica.afm');\r\n $this->pdf->ezText((defined('MY_COMPANY_NAME') ? MY_COMPANY_NAME : NULL),16,array('justification' => 'center'));\r\n $this->pdf->ezText(\"Income Statement\",16,array('justification' => 'center'));\r\n $this->pdf->ezText(($reports->report_date_start ? date(DATE_FORMAT,strtotime($reports->report_date_start)).\" - \" : \"Through \").date(DATE_FORMAT,strtotime($reports->report_date_end)),12,array('justification' => 'center'));\r\n $this->pdf->addText(20,$this->pdf->y + 60, 8, \"Printed by \".$_SESSION['my_name']);\r\n $this->pdf->addText(470, $this->pdf->y + 60, 8, \"Printed on \".date(DATE_FORMAT).\" at \".date(TIMESTAMP_FORMAT));\r\n $this->pdf->setStrokeColor(0,0,0);\r\n $this->pdf->setLineStyle(1);\r\n $this->pdf->line($this->pdf->ez['leftMargin'], $this->pdf->y - 5,$this->pdf->ez['pageWidth'] - $this->pdf->ez['rightMargin'],$this->pdf->y - 5);\r\n\r\n $y_head = $this->pdf->y;\r\n $this->pdf->restoreState();\r\n $this->pdf->closeObject();\r\n $this->pdf->addObject($headerObj,'all');\r\n\r\n $this->pdf->ezSetMargins(($this->pdf->ez['pageHeight'] - $y_head) + 20,30,30,30);\r\n\r\n // Print footer\r\n $bottomFoot = $this->pdf->openObject();\r\n $this->pdf->saveState();\r\n $this->pdf->selectFont('include/fonts/Helvetica.afm');\r\n\r\n $this->pdf->setStrokeColor(.8,.8,.8);\r\n $this->pdf->setLineStyle(1);\r\n $this->pdf->line(30,30,565.28,30);\r\n $this->pdf->restoreState();\r\n $this->pdf->closeObject();\r\n\r\n $this->pdf->addObject($bottomFoot,'all');\r\n $this->pdf->ezStartPageNumbers(550,22,6);\r\n $this->pdf->selectFont('include/fonts/Helvetica.afm');\r\n\r\n // Calculate x coordinate for each column\r\n $start = $this->pdf->ez['leftMargin']; // X coordinate of first column\r\n $space = 400; // Space between columns\r\n $space2 = 100;\r\n $col1 = $start + 15;\r\n $col2 = $start + $space;\r\n $child_adj = 15;\r\n $col_adj = 36;\r\n\r\n // Set font sizes for each element in printed report\r\n $font_size_h1 = 12; // Sales Rep Name\r\n $font_size_h2 = 10; // Company Name\r\n $font_size_h3 = 10; // Proposal Description\r\n\r\n $accounts =& $reports->accounts;\r\n if (is_array($accounts)) {\r\n // Income\r\n $in =& $accounts['IN'];\r\n reset($in);\r\n $total_in = 0;\r\n $this->pdf->addText($start, $this->pdf->y,$font_size_h2,\"<b>Income</b>\");\r\n $this->pdf->ezSetDy(-20);\r\n while (list($account_hash,$info) = each($in)) {\r\n \tif ($info['total'] != 0 || !$reports->current_report['hide_empty'] || $info['placeholder'] == 1 || $reports->child[$account_hash]) {\r\n\t\t\t\t\t$total_in += $info['total'];\r\n\t\t\t\t\t$this->pdf->addText($col1, $this->pdf->y,$font_size_h2,($info['account_no'] ? $info['account_no'].\" - \" : NULL).$info['account_name']);\r\n\t\t\t\t\t$this->pdf->addTextWrap($col2, $this->pdf->y,$space2,$font_size_h2,$this->format_dollars_show_zero($info['total']),'right');\r\n\t\t\t\t\t$this->pdf->ezSetDy(-20);\r\n\t\t\t\t\tif ($reports->child[$account_hash]) {\r\n\t\t\t\t\t\t$child_total = $info['total'];\r\n\t\t\t\t\t\treset($reports->child[$account_hash]);\r\n\t\t\t\t\t\twhile(list($child_hash,$child_info) = each($reports->child[$account_hash])) {\r\n if ($child_info['total'] != 0 || !$reports->current_report['hide_empty']) {\r\n\t\t\t\t\t\t\t\t$total_in += $child_info['total'];\r\n\t\t\t\t\t\t\t\t$child_total += $child_info['total'];\r\n\t\t\t\t\t\t\t\t$this->pdf->addText($col1 + $child_adj, $this->pdf->y,$font_size_h2,($child_info['account_no'] ? $child_info['account_no'].\" - \" : NULL).$child_info['account_name']);\r\n\t\t\t\t\t\t\t\t$this->pdf->addTextWrap($col2, $this->pdf->y,$space2,$font_size_h2,$this->format_dollars_show_zero($child_info['total']),'right');\r\n\t\t\t\t\t\t\t\t$this->pdf->ezSetDy(-20);\r\n }\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$this->pdf->setStrokeColor(.7,.7,.7);\r\n\t\t\t\t\t\t$this->pdf->setLineStyle(1);\r\n\t\t\t\t\t\t$this->pdf->line($col2 + $col_adj,$this->pdf->y + 12,$col2 + $space2,$this->pdf->y + 12);\r\n\t\t\t\t\t\t$this->pdf->addText($col1,$this->pdf->y,$font_size_h2,\"Total \".$info['account_name']);\r\n\t\t\t\t\t\t$this->pdf->addTextWrap($col2,$this->pdf->y,$space2, $font_size_h2,$this->format_dollars_show_zero($child_total),'right');\r\n\t\t\t\t\t\t$this->pdf->ezSetDy(-25);\r\n\t\t\t\t\t}\r\n \t}\r\n\r\n }\r\n // Total Income\r\n $this->pdf->setColor(.7,.7,.7);\r\n $this->pdf->filledRectangle($start,$this->pdf->y - 3,$space + $space2,15);\r\n $this->pdf->setColor(0,0,0);\r\n $this->pdf->addText($col1,$this->pdf->y,$font_size_h2,\"<b>Total Income</b>\");\r\n $this->pdf->addTextWrap($col2,$this->pdf->y,$space2,$font_size_h2,\"<b>\".$this->format_dollars_show_zero($total_in).\"</b>\",'right');\r\n $this->pdf->ezSetDy(-25);\r\n\r\n // Cost of Goods Sold\r\n $cg =& $accounts['CG'];\r\n reset($cg);\r\n $total_cg = 0;\r\n $this->pdf->addText($start, $this->pdf->y,$font_size_h2,\"<b>Cost of Goods Sold</b>\");\r\n $this->pdf->ezSetDy(-20);\r\n while (list($account_hash,$info) = each($cg)) {\r\n if ($info['total'] != 0 || !$reports->current_report['hide_empty'] || $info['placeholder'] == 1 || $reports->child[$account_hash]) {\r\n $total_cg += $info['total'];\r\n $this->pdf->addText($col1, $this->pdf->y,$font_size_h2,($info['account_no'] ? $info['account_no'].\" - \" : NULL).$info['account_name']);\r\n $this->pdf->addTextWrap($col2, $this->pdf->y,$space2,$font_size_h2,$this->format_dollars_show_zero($info['total']),'right');\r\n $this->pdf->ezSetDy(-20);\r\n if ($reports->child[$account_hash]) {\r\n $child_total = $info['total'];\r\n reset($reports->child[$account_hash]);\r\n while(list($child_hash,$child_info) = each($reports->child[$account_hash])) {\r\n if ($child_info['total'] != 0 || !$reports->current_report['hide_empty']) {\r\n $total_cg += $child_info['total'];\r\n $child_total += $child_info['total'];\r\n $this->pdf->addText($col1 + $child_adj, $this->pdf->y,$font_size_h2,($child_info['account_no'] ? $child_info['account_no'].\" - \" : NULL).$child_info['account_name']);\r\n $this->pdf->addTextWrap($col2, $this->pdf->y,$space2,$font_size_h2,$this->format_dollars_show_zero($child_info['total']),'right');\r\n $this->pdf->ezSetDy(-20);\r\n }\r\n }\r\n $this->pdf->setStrokeColor(.7,.7,.7);\r\n $this->pdf->setLineStyle(1);\r\n $this->pdf->line($col2 + $col_adj,$this->pdf->y + 12,$col2 + $space2,$this->pdf->y + 12);\r\n $this->pdf->addText($col1,$this->pdf->y,$font_size_h2,\"Total \".$info['account_name']);\r\n $this->pdf->addTextWrap($col2,$this->pdf->y,$space2,$font_size_h2,$this->format_dollars_show_zero($child_total),'right');\r\n $this->pdf->ezSetDy(-25);\r\n }\r\n }\r\n }\r\n\r\n // Total COGS\r\n $this->pdf->setColor(.7,.7,.7);\r\n $this->pdf->filledRectangle($start,$this->pdf->y - 3,$space + $space2,15);\r\n $this->pdf->setColor(0,0,0);\r\n $this->pdf->addText($col1,$this->pdf->y,$font_size_h2,\"<b>Total Cost of Goods Sold</b>\");\r\n $this->pdf->addTextWrap($col2,$this->pdf->y,$space2,$font_size_h2,\"<b>\".$this->format_dollars_show_zero($total_cg).\"</b>\",'right');\r\n $this->pdf->ezSetDy(-30);\r\n\r\n // Gross Profit\r\n $this->pdf->addText($start,$this->pdf->y,$font_size_h1,\"<b>Gross Profit</b>\");\r\n $this->pdf->addTextWrap($col2,$this->pdf->y,$space2,$font_size_h1,\"<b>\".$this->format_dollars_show_zero($total_in - $total_cg).\"</b>\",'right');\r\n $this->pdf->ezSetDy(-30);\r\n\r\n // Expenses\r\n $ex =& $accounts['EX'];\r\n reset($ex);\r\n $total_ex = 0;\r\n $this->pdf->addText($start, $this->pdf->y,$font_size_h2,\"<b>Expenses</b>\");\r\n $this->pdf->ezSetDy(-20);\r\n while (list($account_hash,$info) = each($ex)) {\r\n \tif ($info['total'] != 0 || !$reports->current_report['hide_empty'] || $info['placeholder'] == 1 || $reports->child[$account_hash]) {\r\n\t\t\t\t\t$total_ex += $info['total'];\r\n\t\t\t\t\t$this->pdf->addText($col1, $this->pdf->y,$font_size_h2,($info['account_no'] ? $info['account_no'].\" - \" : NULL).$info['account_name']);\r\n\t\t\t\t\t$this->pdf->addTextWrap($col2, $this->pdf->y,$space2,$font_size_h2,$this->format_dollars_show_zero($info['total']),'right');\r\n\t\t\t\t\t$this->pdf->ezSetDy(-20);\r\n\t\t\t\t\tif ($reports->child[$account_hash]) {\r\n\t\t\t\t\t\t$child_total = $info['total'];\r\n\t\t\t\t\t\treset($reports->child[$account_hash]);\r\n\t\t\t\t\t\twhile(list($child_hash,$child_info) = each($reports->child[$account_hash])) {\r\n\t\t\t\t\t\t\tif ($child_info['total'] != 0 || !$reports->current_report['hide_empty']) {\r\n\t\t\t\t\t\t\t\t$total_ex += $child_info['total'];\r\n\t\t\t\t\t\t\t\t$child_total += $child_info['total'];\r\n\t\t\t\t\t\t\t\t$this->pdf->addText($col1 + $child_adj, $this->pdf->y,$font_size_h2,($child_info['account_no'] ? $child_info['account_no'].\" - \" : NULL).$child_info['account_name']);\r\n\t\t\t\t\t\t\t\t$this->pdf->addTextWrap($col2, $this->pdf->y,$space2,$font_size_h2,$this->format_dollars_show_zero($child_info['total']),'right');\r\n\t\t\t\t\t\t\t\t$this->pdf->ezSetDy(-20);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$this->pdf->setStrokeColor(.7,.7,.7);\r\n\t\t\t\t\t\t$this->pdf->setLineStyle(1);\r\n\t\t\t\t\t\t$this->pdf->line($col2 + $col_adj,$this->pdf->y + 12,$col2 + $space2,$this->pdf->y + 12);\r\n\t\t\t\t\t\t$this->pdf->addText($col1,$this->pdf->y,$font_size_h2,\"Total \".$info['account_name']);\r\n\t\t\t\t\t\t$this->pdf->addTextWrap($col2,$this->pdf->y,$space2,$font_size_h2,$this->format_dollars_show_zero($child_total),'right');\r\n\t\t\t\t\t\t$this->pdf->ezSetDy(-25);\r\n\t\t\t\t\t}\r\n \t}\r\n }\r\n // Total Expenses\r\n $this->pdf->setColor(.7,.7,.7);\r\n $this->pdf->filledRectangle($start,$this->pdf->y - 3,$space + $space2,15);\r\n $this->pdf->setColor(0,0,0);\r\n $this->pdf->addText($col1,$this->pdf->y,$font_size_h2,\"<b>Total Expenses</b>\");\r\n $this->pdf->addTextWrap($col2,$this->pdf->y,$space2,$font_size_h2,\"<b>\".$this->format_dollars_show_zero($total_ex).\"</b>\",'right');\r\n $this->pdf->ezSetDy(-30);\r\n\r\n $total_ex += $total_cg;\r\n\r\n // Net Income\r\n $this->pdf->addText($start,$this->pdf->y,$font_size_h1,\"<b>Net Income</b>\");\r\n $this->pdf->addTextWrap($col2,$this->pdf->y,$space2,$font_size_h1,\"<b>\".$this->format_dollars_show_zero($total_in - $total_ex).\"</b>\",'right');\r\n }\r\n }",
"private function sumTotalSales()\n {\n return Auth::user()->sale_reports()->sum('total');\n }",
"function dw_campaigns_pp_fundraising_total() {\n global $dw_campaign_module_path;\n\n $report_rows = array();\n $campaigns = dw_campaigns_get_active_campaigns('nodeid');\n\n// $campaigns_by_contribution_page_id = dw_campaigns_get_active_campaigns(TRUE);\n\n $i = 0;\n\n $headers = array(\n array(\n 'data' => t('Name'),\n ),\n array(\n 'data' => t('Location'),\n ),\n array(\n 'data' => t('Email'),\n ),\n array(\n 'data' => t('Phone'),\n ),\n array(\n 'data' => t('Tags'),\n ),\n array(\n 'data' => t('Total Raised'),\n ),\n array(\n 'data' => t('Confirmed Donations'),\n ),\n );\n\n $headers_values = array();\n foreach($headers as $row) {\n $headers_values[] = $row['data'];\n }\n\n $basename = \"report-pp-fundraising-total-\" . time() . \".csv\";\n $file = $dw_campaign_module_path . \"/civi_cache/\" . $basename;\n $fp = fopen($file, \"w\");\n\n fputcsv($fp, array_values($headers_values));\n\n foreach($campaigns as $campaign_id => $campaign) {\n $res = _dw_campaigns_get_pcps_for_campaign($campaign);\n\n foreach($res as $pcp) {\n $i++;\n $pcp_count += 1;\n $params = array(\n 'contact_id' => $pcp->contact_id,\n 'returnFirst' => 1\n );\n $contact = _dw_civicrm_contact_get($params);\n\n $dummy = new stdClass;\n $dummy->id = $pcp->id;\n $totals = dw_campaigns_get_contribution_total_for_pcp($dummy);\n\n $donations_count = $totals['count'];\n //$online_total = $totals['online'];\n $online_total = $totals['online'] - $totals['offline_already_imported'];\n $offline_pending_total = $totals['offline'];\n $offline_total = $totals['offline'] + $totals['offline_already_imported'];\n $offline_pending_count = $totals['offline_pending_count'];\n $total_total = $totals['total'];\n //$confirmed_total = $totals['online'] + $totals['offline_already_imported'];\n $confirmed_total = $totals['online'];\n\n $res = _dw_civicrm_tag_entity_display(array('entity_id' => $pcp->contact_id));\n $tags = isset($res->Result->result) ? $res->Result->result : '';\n if($tags == '0') {\n $tags = '';\n }\n\n $row = array(\n 'name' => $contact->display_name,\n 'location' => $campaign->title,\n 'email' => $contact->email,\n 'phone' => $contact->phone,\n 'tags' => $tags,\n 'total_total' => sprintf(\"%.02f\", $total_total),\n 'confirmed_total' => sprintf(\"%.02f\", $confirmed_total)\n );\n\n $values = array_values($row);\n fputcsv($fp, $values);\n\n $report_rows[] = $row;\n }\n\n }\n\n if($mode == 'CSV') {\n\n $date = date(\"Y-m-d_His\");\n $fsize = filesize($file);\n\n header(\"Pragma: public\"); // required\n header(\"Expires: 0\");\n header(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n header(\"Cache-Control: private\",false); // required for certain browsers\n header(\"Content-Type: application/force-download\"); \n header(\"Content-Disposition: attachment; filename=\\\"$outfile\\\"\");\n header(\"Content-Transfer-Encoding: binary\");\n header(\"Content-Length: $fsize\");\n header(\"Content-type: text/csv\");\n\n echo file_get_contents($file);\n\n die;\n } else {\n\n return theme('dw_campaigns_reports_pp_fundraising_total', array('headers' => $headers, 'rows' => $report_rows, 'filename' => $file));\n }\n}",
"public function total_income_report()\r\n {\r\n echo json_encode($this->reports_model->total_income_report());\r\n }",
"private function totalRecords() {\n return count($this->report);\n }",
"public function calcularTotal() {\n $total = 0;\n foreach ($this->lineadeDocumento as $linea) {\n $total += $linea->getPrecioT();\n }\n $this->total = $total;\n }",
"function getReport() ;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Incrememts patch level of software | public static function incrementPatchLevel() {
self::$patch_level++;
} | [
"public final function getBuild()\r\n {\r\n /**\r\n * DO NOT FORGET !!! to update GEMS__PATCH_LEVELS:\r\n *\r\n * For new installations the initial patch level should\r\n * be THIS LEVEL plus one.\r\n *\r\n * This means that future patches for will be loaded,\r\n * but that previous patches are ignored.\r\n */\r\n return 58;\r\n }",
"public function isYoungerPatchReleaseAvailable() {}",
"public function browserVersionPatch(): int;",
"private function infoFlags() {\n return $this->version << 12;\n }",
"public function isYoungerPatchReleaseAvailable() : bool {}",
"public function isYoungerPatchDevelopmentReleaseAvailable() {}",
"public function getPatchVersion(): int\n {\n return $this->parseVersion()->patch;\n }",
"public function getYoungestPatchDevelopmentRelease() {}",
"function getCompatibilityLevel()\n {\n return $this->_props['CompatibilityLevel'];\n }",
"public function getPatch(): int\n {\n return $this->patch;\n }",
"public function getSupportLevel()\n {\n return $this->supportLevel;\n }",
"public function getYoungestPatchRelease() {}",
"public function getSupportLevel() {\n\t\treturn $this->_supportLevel;\n\t}",
"function GetOSMinorVersion(){}",
"function GetToolkitMinorVersion(){}",
"public function getMajorVersion(){ }",
"private function getCurrentInfirmaryPower(): int\n\t{\n\t\treturn $this->building->getCurrentPower($this->getInfirmary()->getArrayName(), $this->getInfirmary()->getLevel());\n\t}",
"public function getRegenIncreasePerLevel() : float;",
"public function testUpdateNetworkFirmwareUpgrades()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the selected mailbox | public function getSelectedMailbox() {
return $this->selectedMailbox;
} | [
"public function getMailbox()\n {\n return $this->mailbox;\n }",
"function get_mailbox() {\r\n global $cache_nonexistantoptions;\r\n\r\n $mailbox = get_settings('imap_authentication_mailbox');\r\n if (! $mailbox or $cache_nonexistantoptions['imap_authentication_mailbox']) {\r\n $mailbox = '{localhost:143}INBOX';\r\n IMAPAuthentication::add_mailbox_option($mailbox);\r\n }\r\n\r\n return $mailbox;\r\n }",
"public function getMailbox();",
"public function getMailbox()\n {\n $this->setUp();\n return $this->mailbox;\n }",
"function getMailboxName() {\n return array_var($this->mailbox_parameters,'mailbox_name', null);\n }",
"public function inbox()\n {\n return $this->mailbox(Mailbox::INBOX);\n }",
"public function getOtherMailbox()\n {\n return $this->getAttribute($this->schema->otherMailbox());\n }",
"public function getMailbox(string $name): MailboxInterface;",
"public function getMailbox($name)\n\t{\n\t\t$this->mailboxes !== NULL || $this->initializeMailboxes();\n\t\tif(isset($this->mailboxes[$name])) {\n\t\t\treturn $this->mailboxes[$name];\n\t\t} else {\n\t\t\tthrow new ConnectionException(\"Mailbox '$name' does not exist.\");\n\t\t}\n\t}",
"public function selectMailbox( $mailbox, $readOnly = false )\n {\n if ( $this->state != self::STATE_AUTHENTICATED &&\n $this->state != self::STATE_SELECTED &&\n $this->state != self::STATE_SELECTED_READONLY )\n {\n throw new ezcMailTransportException( \"Can't call selectMailbox() when not successfully logged in.\" );\n }\n\n $tag = $this->getNextTag();\n\n // if the mailbox selection will be successful, $state will be STATE_SELECTED\n // or STATE_SELECTED_READONLY, depending on the $readOnly parameter\n if ( $readOnly !== true ) \n {\n $this->connection->sendData( \"{$tag} SELECT \\\"{$mailbox}\\\"\" );\n $state = self::STATE_SELECTED;\n }\n else\n {\n $this->connection->sendData( \"{$tag} EXAMINE \\\"{$mailbox}\\\"\" );\n $state = self::STATE_SELECTED_READONLY;\n }\n\n // if the selecting of the mailbox fails (with \"NO\" or \"BAD\" response\n // from the server), $state reverts to STATE_AUTHENTICATED\n $response = trim( $this->getResponse( $tag ) );\n if ( $this->responseType( $response ) == self::RESPONSE_OK )\n {\n $this->state = $state;\n $this->selectedMailbox = $mailbox;\n }\n else\n {\n $this->state = self::STATE_AUTHENTICATED;\n $this->selectedMailbox = null;\n throw new ezcMailTransportException( \"Could not select mailbox '{$mailbox}': {$response}.\" );\n }\n }",
"public function selectMailbox(string $mailbox)\n {\n $storage = $this->getStorage();\n $storage->selectFolder($mailbox);\n $this->messageCache = [];\n }",
"function setMailbox($value) {\n return $this->setFieldValue('mailbox', $value);\n }",
"public function getMailboxById($id)\n {\n return ($account = $this->getRemoteById($id))\n ? substr($id, strlen($account) + 1)\n : '';\n }",
"protected function selectInbox()\n {\n $this->_writeCommand(\"A\" . $this->codeCounter, \"EXAMINE INBOX\");\n $this->_readResponse(\"A\" . $this->codeCounter);\n }",
"public function getMailboxes()\n {\n return $this->getKey('Mailboxes');\n }",
"private function _getMailboxes(){\n\t\treturn Mailbox::model()->findByAttribute('domain_id', $this->remoteModelId);\n\t}",
"function getSentboxMessage() {\n $sql = \"SELECT * FROM `mail` WHERE sender_id = ?\";\n return getAll($sql, [getLogin()['mid']]);\n}",
"function GetBounceMailbox($header=false)\n\t{\n\t\tif (!is_object($header)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!isset($header->from) || empty($header->from)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treset($header->from);\n\t\t$from_header = current($header->from);\n\t\t$mailbox = strtolower($from_header->mailbox);\n\n\t\treturn $mailbox;\n\t}",
"function getMailboxType($mailbox)\n {\n $list = &Kolab_List::singleton();\n $folder = $list->getFolder($mailbox);\n if (is_a($folder, 'PEAR_Error')) {\n return $folder;\n }\n return $folder->getType();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Should create a meta tag with client hints | public function test_cl_client_hints_meta_tag()
{
$doc = new DOMDocument();
$doc->loadHTML(cl_client_hints_meta_tag());
$tags = $doc->getElementsByTagName('meta');
$this->assertEquals($tags->length, 1);
$this->assertEquals($tags->item(0)->getAttribute('content'), 'DPR, Viewport-Width, Width');
$this->assertEquals($tags->item(0)->getAttribute('http-equiv'), 'Accept-CH');
} | [
"abstract function setExtraMetaTags();",
"public function metaTag(): string\n {\n return '<meta name=\"robots\" content=\"'.($this->shouldIndex() ? 'index, follow' : 'noindex, nofollow').'\">';\n }",
"private function setMetaTags()\n\t{\n\t\t//http://www.jeevansathi.com/<bride>-<mother-tongue>-<religion>-<caste>-<username/userID>-profiles \n\t\t$casteAllow=0;\n\t\tif(CommonUtility::CasteAllowed($this->profile->getRELIGION()))\n\t\t\t$casteAllow=1;\n\n\t\t//Canonical url\n\t\t$can_url=$this->MTONGUE.\"-\".$this->religionSelf;\n\t\tif($casteAllow)\n\t\t\t$can_url.=\"-\".$this->CASTE;\n\t\t\t\n\t\t//Title\n\t\t//strip tags check added to remove meta content in page title\n\t\tif($this->GOTHRA && strip_tags($this->GOTHRA)!=\"\")\n\t\t\t$gotra=\" - \".$this->GOTHRA;\n\t\tif($this->CITY_RES || $this->COUNTRY_RES)\n\t\t{\n\t\t\t$location=\" - \";\n\t\t\tif($this->CITY_RES)\n\t\t\t\t$location=$location.$this->CITY_RES.\", \";\n\t\t\tif($this->COUNTRY_RES)\n\t\t\t\t$location=$location.$this->COUNTRY_RES;\n\t\t\t\t\n\t\t}\t\n\t\t$title=$this->MTONGUE;\n\t\tif($casteAllow)\n\t\t\t$title.=\" - \".$this->CASTE;\n\t\t\t\n\t\t$title.=\" - \".$this->religionSelf.$gotra;\n\t\t\n\t\tif($location)\n\t\t\t$title=$title.$location;\n\t\t$title=$title.\" - \".$this->AGE.\" - \".$this->profile->getUSERNAME();\n\t\t\n\t\t//Removal of extra - from location\n\t\t$location=ltrim($location,\" - \");\n\t\t//Meta description\n\t\t$desc=\"Looking for an ideal \".$this->MTONGUE;\n\t\tif($casteAllow)\n\t\t\t$desc.=\" \".$this->CASTE;\n\t\t$desc.=\" \".$this->religionSelf;\n\t\t\n\t\tif($this->profile->getGENDER()==\"M\")\n\t\t{\n\t\t\t$whois=\"groom\";\n\t\t\n\t\t\t$title=\"Groom - \".$title;\n\t\t\t$desc=$desc.\" Groom in $location\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$whois=\"bride\";\n\t\t\n\t\t\t$title=\"Bride - \".$title;\n\t\t\t$desc=$desc.\" Bride in $location\";\n\t\t}\n\t\t$desc=$desc.\"? Your dream Life Partner is just a click away.\";\n\t\tif(!$this->loginData)\n\t\t\t$desc=$desc.\" Log on to Jeevansathi.com Now!\";\n\t\t\t\n\t\t$response=sfContext::getInstance()->getResponse();\n\t\t$title=htmlspecialchars_decode($title,ENT_QUOTES);\n\t\t$response->setTitle($title);\n\n\t\t$can_url=CommonUtility::CanonicalProfile($this->profile);\n\t\t$response->setCanonical(sfConfig::get(\"app_site_url\").\"/\".$can_url);\n\n\t\t$desc=htmlspecialchars_decode($desc,ENT_QUOTES);\n\t\t$response->addMeta('description', $desc);\n\t\t\n\t\t$response->addVaryHttpHeader(\"User-Agent\");\n\t\t$keyword=$this->MTONGUE.\" \".ucfirst($whois).\"s, \";\n\t\tif($casteAllow)\n\t\t\t$keyword.=$this->CASTE.\" \".ucfirst($whois).\"s, \";\n\t\t\n\t\t\n\t\t$keyword.=$location.\" \".ucfirst($whois).\"s, \".ucfirst($whois).\", \".ucfirst($whois).\"s, \".$this->religionSelf.\" \".ucfirst($whois).\"s, Life partner, find \".$whois.\"s, find $whois, $whois matchmaking, \".$this->OCCUPATION.\" \".($whois).\"s, Jeevansathi.com, Indian matrimony, matrimony, matrimonial, matrimonial\";\n\t\t$keyword=htmlspecialchars_decode($keyword,ENT_QUOTES);\n\t\t$response->addMeta(\"keyword\",$keyword);\n\t\t\n\t\t}",
"protected function buildMeta() {\n parent::buildMeta();\n if(isset($this->config['appid'])) {\n $this->meta['appid'] = $this->config['appid'];\n }\n }",
"public function drawBasicMetatags() {\n \n //Meta\n echo '\n<!-- Site basic URL -->\n<base href=\"'.ShaContext::getSiteFullUrl().'/\" >\n \n<!-- Meta tags -->\n<meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\" >\n<meta name=\"viewport\" content=\"width=device-width, user-scalable=no, initial-scale=1\">\n<meta http-equiv=\"content-language\" content=\"'.ShaContext::getLanguage()->getValue(\"language_abr\").'\" >\n<meta name=\"category\" content=\"'.ShaParameter::get(\"SITE_CATEGORY\").'\" >\n<meta name=\"Revisit-After\" content=\"'.$this->getValue('page_client_cache_duration').' days\" >\n<meta name=\"robots\" content=\"'.$this->getValue('page_robots').'\" >\n \n<!-- favicon -->\n<link rel=\"icon\" type=\"image/png\" href=\"favicon.png\" >\n \n<!-- Page info -->\n<title>[SHA_TITLE]</title>\n<meta name=\"description\" content=\"[SHA_DESCRIPTION]\" >\n<meta name=\"keywords\" content=\"'.$this->writeKeyWord($this->_shaPageObjects).'\" >\n';\n }",
"public function set_standard_meta()\n\t{\n\t\t// Meta description.\n\t\t$meta_description = $this->get_meta_description();\n\t\tif (! empty($meta_description)) {\n\t\t\t$this->add_tag(\n\t\t\t\t'meta',\n\t\t\t\t[\n\t\t\t\t\t'name' => 'description',\n\t\t\t\t\t'content' => \\esc_attr($meta_description),\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\n\t\tif ( ! empty( $meta_keywords ) ) {\n\t\t\t$this->add_tag(\n\t\t\t\t'meta',\n\t\t\t\t[\n\t\t\t\t\t'name' => 'keywords',\n\t\t\t\t\t'content' => esc_attr( implode( ',', array_filter( $meta_keywords ) ) ),\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\n\t\t// Canoncial url.\n\t\tif (! empty($canonical_url)) {\n\t\t\t$this->set_canonical_url($canonical_url);\n\t\t}\n\n\t\t// Deindex URL.\n\t\tif (absint($deindex_url)) {\n\t\t\t$this->add_tag(\n\t\t\t\t'meta',\n\t\t\t\t[\n\t\t\t\t\t'name' => 'robots',\n\t\t\t\t\t'content' => 'noindex',\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\t}",
"public function addMetadata()\n {\n if (phpQuery::pq('meta[content=\"sitecake\"]', $this->evaluated)->count() === 0) {\n phpQuery::pq('head', $this->evaluated)->prepend('<meta name=\"application-name\" content=\"sitecake\"/>');\n }\n }",
"protected function createMetaResponseData() : void\n {\n $this->meta = new Metadata($this->dom);\n }",
"function genMetaData($decription, $name, $image, $url)\n{\n echo \"\n <meta name='author' content='David McClarty, Musat Valentina'>\n <meta name='keywords' content='hot-spots, Brisbane, rate, review'>\n <meta name='robots' content='noindex'> <!-- do not index this page -->\n <!-- search engine -->\n <meta name='description' content='{$decription}'>\n <meta name='image' content='{$image}'>\n <!-- Google -->\n <meta itemprop='name' content='{$name}'>\n <meta itemprop='description' content='{$decription}'>\n <meta itemprop='image' content='{$image}'>\n <!-- Twitter -->\n <meta name='twitter:card' content='summary'>\n <meta name='twitter:title' content='{$name}'>\n <meta name='twitter:description' content='{$decription}'>\n <meta name='twitter:image:src' content='{$image}'>\n <!-- OG -->\n <meta name='og:title' content='{$name}'>\n <meta name='og:description' content='{$decription}'>\n <meta name='og:image' content='{$image}'>\n <meta name='og:url' content='{$url}'>\n <meta name='og:site_name' content='Brisbane Hot-Spot Finder'>\n <meta name='og:type' content='website'> \n \";\n}",
"protected function buildMeta() {\n parent:: buildMeta();\n\n $signedPackage = $this->getSignPackage();\n\n $this->meta['signedPackage'] = $signedPackage;\n $this->meta['debug'] = $this->app['debug'];\n\n $shortUrl = $this->buildShortUrl();\n $this->meta['link'] = $shortUrl;\n $this->meta['hash'] = $shortUrl;\n\n //\n $this->app['htmlblock']->addTemplate('body.end', '@CoreModules/Identity/templates/wechat_js.html.twig', $this->meta);\n }",
"public static function insertMeta()\n\t{\n\t\t$settings = app()->controller->settings;\n\t\t\n\t\t//register meta description\n\t\tcs()->registerMetaTag($settings['meta_description'], 'description');\n\t\t\n\t\t//register meta keywords\n\t\tcs()->registerMetaTag($settings['meta_keywords'], 'keywords');\n\t}",
"public function seo_meta_information() {\n ?>\n <meta name=\"description\" content=\"web Ddesign and development materials\">\n <meta name=\"keywords\" content=\"HTML, CSS, JavaScript, php, wordpress, laravel\">\n <meta name=\"author\" content=\"moshiur rahman\">\n <?php\n }",
"function include_metas()\n{\n $context = sfContext::getInstance();\n $i18n = sfConfig::get('sf_i18n') ? $context->getI18N() : null;\n foreach ($context->getResponse()->getMetas() as $name => $content)\n {\n echo tag('meta', array('name' => $name, 'content' => null === $i18n ? $content : $i18n->__($content))).\"\\n\";\n }\n}",
"protected static function addMeta() {\n // Todo: compan_* variables from command line otherwise use this one\n File::addContent(\n self::$root_dir_default_theme.'Page.ss', \n ' <meta name=\"author\" content=\"'.self::$project_company.', '.self::$project_company_adress.', '.self::$project_company_destination.', '.self::$project_company_web.', '.self::$project_company_email.'\">', \n '<meta http-equiv'\n );\n File::replaceContent(\n self::$root_dir_default_theme.'Page.ss',\n '$MetaTags(false)',\n '$MetaTags(true)'\n );\n }",
"function bbp_register_meta()\n{\n}",
"function meta( $aAttrs = array() )\n\t{\n\t\t$bHasEnd = FALSE;\n\t\treturn $this->_create_tag( __FUNCTION__, $aAttrs, $bHasEnd, NULL );\n\t}",
"public function getMetaTags()\n {\n $lines = [\n '<title>'.$this->secure(self::getTitle()).'</title>',\n '<meta name=\"description\" content=\"'.$this->secure(self::getDescription()).'\">',\n '<meta name=\"keywords\" content=\"'.$this->secure(self::getKeywords()).'\">',\n '',\n '<!-- Hello, -->',\n '<meta name=\"author\" content=\"'.$this->secure(self::getAuthor('Marek Gogoľ - marekgogol.sk')).'\">',\n '',\n '<meta property=\"og:title\" content=\"'.$this->secure(self::getTitle()).'\">',\n '<meta property=\"og:description\" content=\"'.$this->secure(self::getDescription()).'\">',\n '<meta property=\"og:locale\" content=\"'.Gettext::getLocale(app()->getLocale()).'\" />',\n '<meta property=\"og:type\" content=\"website\">',\n '<meta property=\"og:site_name\" content=\"'.$this->secure(env('APP_NAME')).'\">',\n ];\n\n //Push images into meta tags\n foreach ($this->getImages() as $image) {\n $lines[] = '<meta property=\"og:image\" content=\"'.$this->secure($image).'\">';\n }\n\n /*\n * Twitter tags\n */\n $lines = array_merge($lines, [\n '<meta name=\"twitter:title\" content=\"'.$this->secure(self::getTitle()).'\" />',\n '<meta name=\"twitter:description\" content=\"'.$this->secure(self::getDescription()).'\" />',\n ]);\n\n foreach ($this->getImages() as $image) {\n $lines[] = '<meta name=\"twitter:image\" content=\"'.$this->secure($image).'\">';\n }\n\n if ( $url = $this->getCanonicalUrl() ){\n $lines[] = '<link rel=\"canonical\" href=\"'.$this->secure($url).'\">';\n }\n\n return $lines;\n }",
"public function get_metadata(){\n\t\t$this->meta_description = \"Encuentra los mejores preescolares, primarias, secundarias y bachilleratos públicos y privados en tu zona. Consulta información de la infraestructura disponible en el plantel y revisa qué dicen otros padres sobre los maestros, el nivel y las instalaciones de cada escuela. Encuentra bibliotecas cercanas a tu escuela o tu casa.\";\n\t}",
"function loadMeta(){\n echo \"<!-- Metadata here -->\\n\";\n ?>\n<meta charset=\"<?php echo $this->charset;?>\"/>\n<meta name=\"viewport\" content=\"<?php echo $this->viewport;?>\"/>\n<?php\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Busca un objeto Monitor en la base de datos. | public function select($monitor){
$id=$monitor->getId();
try {
$sql= "SELECT `id`, `marca`, `modelo`, `serial`, `pulgadas`, `observacion`, `estado`, `cargo_id`"
."FROM `monitor`"
."WHERE `id`='$id'";
$data = $this->ejecutarConsulta($sql);
for ($i=0; $i < count($data) ; $i++) {
$monitor->setId($data[$i]['id']);
$monitor->setMarca($data[$i]['marca']);
$monitor->setModelo($data[$i]['modelo']);
$monitor->setSerial($data[$i]['serial']);
$monitor->setPulgadas($data[$i]['pulgadas']);
$monitor->setObservacion($data[$i]['observacion']);
$monitor->setEstado($data[$i]['estado']);
$cargo = new Cargo();
$cargo->setId($data[$i]['cargo_id']);
$monitor->setCargo_id($cargo);
}
return $monitor; } catch (SQLException $e) {
throw new Exception('Primary key is null');
return null;
}
} | [
"private function createMonitor()\n {\n $servico = factory(Modulos\\Integracao\\Models\\Servico::class)->create([\n 'ser_nome' => \"Monitor\",\n 'ser_slug' => \"get_tutor_online_time\"\n ]);\n\n $ambienteServico = factory(\\Modulos\\Integracao\\Models\\AmbienteServico::class)->create([\n 'asr_amb_id' => $this->ambiente->amb_id,\n 'asr_ser_id' => $servico->ser_id,\n 'asr_token' => \"abcdefgh12345\"\n ]);\n }",
"public function monitor()\n {\n return $this->belongsTo('App\\Models\\Monitor');\n }",
"public function insert($monitor){\n $id=$monitor->getId();\n$marca=$monitor->getMarca();\n$modelo=$monitor->getModelo();\n$serial=$monitor->getSerial();\n$pulgadas=$monitor->getPulgadas();\n$observacion=$monitor->getObservacion();\n$estado=$monitor->getEstado();\n$cargo_id=$monitor->getCargo_id()->getId();\n\n try {\n $sql= \"INSERT INTO `monitor`( `id`, `marca`, `modelo`, `serial`, `pulgadas`, `observacion`, `estado`, `cargo_id`)\"\n .\"VALUES ('$id','$marca','$modelo','$serial','$pulgadas','$observacion','$estado','$cargo_id')\";\n return $this->insertarConsulta($sql);\n } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n }\n }",
"public static function getMonitor(): Monitor\n {\n return Factory::makeInstance(Monitor::class);\n }",
"function monitor(){\r\n \tif ($this->monitor == null){\r\n \t\t$this->monitor = new SOS_Scheduler_Job_monitor();\r\n \t}\r\n \treturn $this->monitor;\r\n }",
"function getMonitor($monitor_id) {\n\t\tif (!isset($this->__monitores[$monitor_id])) {\n\t\t\t$this->getMonitores(REP_DATOS_CLIENTE, $monitor_id);\n\t\t}\n\t\tif (isset($this->__monitores[$monitor_id])) {\n\t\t\treturn $this->__monitores[$monitor_id];\n\t\t}\n\t\telse {\n\t\t\treturn null;\n\t\t}\n\t}",
"public function actualizar(Monitor $monitor) {\n try {\n $sql = \"UPDATE monitores\n SET \n num_titulo=?,\n cert_delitos=?\n WHERE id_monitor = ?\";\n\n $this->pdo->prepare($sql)\n ->execute(\n array(\n $monitor->getNum_titulo(),\n $monitor->getCert_delitos()\n )\n );\n } catch (Exception $e) {\n die($e->getMessage());\n }\n }",
"public function obtener($id) {\n try {\n $stm = $this->pdo->prepare(\"SELECT id_monitor, nombre, apellidos, dni, fec_nac, telefono, email, num_titulo, cert_delitos \n FROM monitores \n INNER JOIN usuarios ON monitores.id_monitor=usuarios.id_usuario\n WHERE id_monitor = ?\");\n\n\n $stm->execute(array($id));\n return $stm->fetchObject(\"Monitor\");\n } catch (Exception $e) {\n die($e->getMessage());\n }\n }",
"public static function getMonitorName(int $monitor) : string {}",
"public function listar() {\n try {\n $result = array();\n\n $stm = $this->pdo->prepare(\"SELECT id_monitor, nombre, apellidos, dni, fec_nac, telefono, email, num_titulo, cert_delitos\n FROM monitores\n INNER JOIN usuarios ON monitores.id_monitor=usuarios.id_usuario\");\n $stm->execute();\n\n return $stm->fetchAll(PDO::FETCH_CLASS, 'Monitor');\n } catch (Exception $e) {\n die($e->getMessage());\n }\n }",
"function actionOpenMonitor(){\n $userId=$this->_userId;\n $id = Yii::$app->request->post('id');\n\n if( !$this->actionCheckmaxnumber() ){\n return SeaShellResult::error('超出最大可监控数 ' .$this->maxmonitor. \"个\");\n }\n\n $model = new Monitor();\n $res = $model->openMonitor($id,$userId);\n\n if(!$res){\n return SeaShellResult::error('开启失败,请联系管理员');\n }\n return SeaShellResult::success('1');\n }",
"public function monitor()\n {\n return new MonitorConsumer($this);\n }",
"public function getMonitorInfo() {\r\n\t\t$monitor_info = mysql_query(\"SELECT * FROM monitor_info\") or die(mysql_error());\r\n\t\treturn $monitor_info;\r\n }",
"public function getMonitoring()\n {\n return $this->hasOne(Monitoring::className(), ['id' => 'monitoringId']);\n }",
"public function getMonitorSystem()\n {\n return $this->monitor_system;\n }",
"function _monitor($get){\n\n switch($get['action']){\n\n case 'monitorinsert':\n $stmt = $get['con']->prepare($get['conf']['Monitor']['INSERT']);\n $stmt->bindValue(':monitorname',$get['monitorname'], PDO::PARAM_STR);\n $stmt->bindValue(':monitortype',$get['monitortype'], PDO::PARAM_STR);\n $stmt->bindValue(':argument' ,$get['argument'], PDO::PARAM_STR);\n $stmt->bindValue(':timeout' ,$get['timeout'], PDO::PARAM_INT);\n $stmt->bindValue(':retry' ,$get['retry'], PDO::PARAM_INT);\n $stmt->execute();\n $res['result']=0;\n $monitor_id = $get['con']->lastInsertId();\n $res['list'] = json_encode(\"'monitor_id':$monitor_id\");\n break;\n\n case 'monitorselect':\n $stmt = $get['con']->prepare($get['conf']['Monitor']['SELECT']);\n $stmt->bindValue(':offset' ,$get['offset'], PDO::PARAM_INT);\n $stmt->bindValue(':count' ,$get['count'], PDO::PARAM_INT);\n $stmt->execute();\n $res['result'] = !($stmt->rowCount());\n $rows = array();\n while($row = $stmt->fetch()){\n $rows[$row[0]] = array(\n 'monitor_id' => $row[\"monitor_id\"]\n ,'monitorname' => $row[\"monitorName\"]\n ,'monitortype' => $row[\"monitorType\"]\n ,'timeout' => $row[\"timeout\"]\n ,'retry' => $row[\"retry\"]\n ,'argument' => $row[\"argument\"]\n );\n }\n $res['list'] = json_encode($rows);\n break;\n\n case 'monitorupdate':\n $stmt = $get['con']->prepare($get['conf']['Monitor']['UPDATE']);\n $stmt->bindValue(':checked',$get['checked'], PDO::PARAM_INT);\n $stmt->bindValue(':monitor_id',$get['monitor_id'], PDO::PARAM_INT);\n $stmt->execute();\n $res['result']=0;\n break;\n\n case 'monitordelete':\n $stmt = $get['con']->prepare($get['conf']['Monitor']['DELETE']);\n $stmt->bindValue(':monitor_id',$get['monitor_id'], PDO::PARAM_INT);\n $stmt->execute();\n $res['result']=0;\n $res['list']=$get['monitor_id'];\n break;\n }\n return $res;\n}",
"public function findAll()\n {\n $this->query('SELECT * FROM monitor ORDER BY ID');\n $monitors = $this->resultSet();\n return $monitors;\n }",
"public function getMessageMonitor()\n {\n return $this->messageMonitor;\n }",
"public function setMessageMonitor(MonitorInterface $messageMonitor)\n {\n $this->messageMonitor = $messageMonitor;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes all resources that has this one as parent. | public function deleteChildren()
{
static::deleteAll(['parent' => $this->id]);
} | [
"public function unset_on_parent() {\n\t\t$this->parent->delete_by_key( $this->key );\n\t}",
"public function delete() {\n\t\tif(!$this->hasChildren())\n\t\t\tparent::delete();\n\t}",
"public function deleteAllResources() {\n\t\t$this->resources = array();\n\t}",
"private function deleteChildren()\n {\n foreach ($this->yieldSingle(RecursiveEvent::get()->filter('ParentID', $this->ID)) as $child) {\n $child->doUnpublish();\n $child->doArchive();\n }\n }",
"public function delete_recursive()\n {\n foreach ($this->get_children_recursive()->getAsArray() as $child)\n $child->delete();\n $this->delete();\n }",
"public function destroy() {\r\n $this->deleted = true;\r\n $id = mysql_real_escape_string($this->id);\r\n mysql_query(\"UPDATE `content` SET `deleted` = true WHERE `id` = '{$id}' LIMIT 1;\");\r\n foreach($this->get_children() as $child) {\r\n $child->parent = $this->parent;\r\n $child->save();\r\n }\r\n }",
"public function deleteAllResources()\n {\n $this->getDao()->deleteAll();\n }",
"public function removeResourceParents(ResourceInterface $resource);",
"public function deleteAll()\n {\n foreach ($this->_styles as $style) {\n $instance = $style['instance'];\n $instance->delete();\n }\n $this->delete();\n }",
"public function deleteAllRelations() {\n\t\t$this->comments()->delete();\n\t\t$this->likes()->delete();\n\t\t$this->views()->delete();\n // delete the post\n return parent::delete();\n\t}",
"public function unsetParent() {\n\t\tunset($this->parent);\n\t}",
"public function remove() {\n if($this->parent) {\n $this->parent->removeItem($this);\n $this->parent = null;\n }\n }",
"public function delete()\n {\n if( ! $this->get_id() ) return;\n\n $results = array();\n\n // Delete the object from the model's table\n $results[] = $this->_db->delete(\n $this->_table_name,\n array(\n 'id' => $this->_id\n )\n );\n\n // Delete settings from the model's meta table.\n $results[] = $this->_db->delete(\n $this->_meta_table_name,\n array(\n 'parent_id' => $this->_id\n )\n );\n\n // Query for child objects using the relationships table.\n\n $children = $this->_db->get_results(\n \"\n SELECT child_id, child_type\n FROM $this->_relationships_table\n WHERE parent_id = $this->_id\n AND parent_type = '$this->_type'\n \"\n );\n\n // Delete each child model\n foreach( $children as $child ) {\n $model = Ninja_Forms()->form()->get_model( $child->child_id, $child->child_type );\n $model->delete();\n }\n\n // Delete all relationships\n $this->_db->delete(\n $this->_relationships_table,\n array(\n 'parent_id' => $this->_id,\n 'parent_type' => $this->_type\n )\n );\n\n // return False if there are no query errors.\n return in_array( FALSE, $results );\n }",
"static function deleteChildrenByParent(ProjectObjectTemplate $parent) {\n\t\t $type = ucfirst(strtolower($parent->getType()));\n\n\t\t if ($type == \"Milestone\" || $type == \"Task\") {\n\t\t\t try {\n\t\t\t\t DB::beginWork('Deleting '.$type.' @ ' . __CLASS__);\n\n\t\t\t\t switch($type) {\n\t\t\t\t\t case \"Milestone\":\n\t\t\t\t\t\t // remember task templates we have to delete\n\t\t\t\t\t\t $task_ids = DB::executeFirstColumn(\"SELECT id FROM \" . TABLE_PREFIX . \"project_object_templates WHERE parent_id = ? AND type = ?\", $parent->getId(), \"Task\");\n\n\t\t\t\t\t\t // find all subtask templates\n\t\t\t\t\t\t $subtask_ids = DB::executeFirstColumn(\"SELECT id FROM \" . TABLE_PREFIX . \"project_object_templates WHERE parent_id IN (?) AND type = ?\", $task_ids, \"Subtask\");\n\n\t\t\t\t\t\t // delete subtask templates\n\t\t\t\t\t\t DB::execute(\"DELETE FROM \" . TABLE_PREFIX . \"project_object_templates WHERE id IN (?)\", $subtask_ids);\n\n\t\t\t\t\t\t // delete task templates themselves\n\t\t\t\t\t\t DB::execute(\"DELETE FROM \" . TABLE_PREFIX . \"project_object_templates WHERE id IN (?)\", $task_ids);\n\t\t\t\t\t\t break;\n\t\t\t\t\t case \"Task\":\n\t\t\t\t\t\t // delete subtask templates\n\t\t\t\t\t\t DB::execute(\"DELETE FROM \" . TABLE_PREFIX . \"project_object_templates WHERE parent_id = ? AND type = ?\", $parent->getId(), \"Subtask\");\n\t\t\t\t\t\t break;\n\t\t\t\t } // switch\n\n\t\t\t\t DB::commit($type.' deleted @ ' . __CLASS__);\n\t\t\t } catch (Exception $e) {\n\t\t\t\t DB::rollback('Failed to delete '.$type.' @ ' . __CLASS__);\n\n\t\t\t\t throw $e;\n\t\t\t } // try\n\t\t } //if\n\n\t\t return true;\n\t }",
"function deleteAllTree() {\n // loop on all items\n $nullVal = NULL;\n $coll = $this->getFoldersCollection($nullVal);\n while ($folder = $coll->getNext()) {\n if ($folder->otherValues[REPOFIELDIDRESOURCE] != 0) {\n $lo = createLO($folder->otherValues[REPOFIELDOBJECTTYPE]);\n // delete categorized resource\n require_once(_lms_ . '/lib/lib.kbres.php');\n $kbres = new KbRes();\n $kbres->deleteResourceFromItem(\n $folder->otherValues[REPOFIELDIDRESOURCE], $folder->otherValues[REPOFIELDOBJECTTYPE], 'course_lo'\n );\n // ---------------------------\n $ok = $lo->del($folder->otherValues[REPOFIELDIDRESOURCE]);\n }\n }\n // remove all records from repo\n parent::deleteAllTree();\n }",
"public function delete()\n\t{\n\t\t$this->get(true, true);\n\t\tforeach ($this->data as $key => $value)\n\t\t{\n\t\t\t$value->delete();\n\t\t}\n\t\trmdir($this->root);\n\t}",
"abstract public function clearParentResourcesAfterFork();",
"function deleteChilds(){\n\t\t$this->db->query('SELECT ID FROM ' . NEWSLETTER_TABLE . ' WHERE ParentID=' . intval($this->ID));\n\t\t$ids = $this->db->getAll(true);\n\t\tforeach($ids as $id){\n\t\t\t$child = new self($id);\n\t\t\t$child->delete();\n\t\t\t$child = new self();\n\t\t}\n\t}",
"function removeFromParent()\n\t{\n\t \tif (isset($this->parent))\n\t \t{\n\t \t\t$index = $this->parent->getIndex($this);\n\t \t\t$this->parent->remove($index);\n\t \t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the iterator classname for the ArrayObject. | public function getIteratorClass () {} | [
"public function getIteratorClass(): string {\n throw new \\Exception('This ' . __CLASS__ . ' does not support this action but it must implement it, because it is extending \\ArrayObject.');\n }",
"public function getIteratorName() {\n return null;\n }",
"protected function getClassName(): string\n {\n return ArrayCollection::class;\n }",
"public function getIteratorClass() {\n return $this->iteratorClass;\n }",
"protected function getIteratorClass()\n {\n return new ArrayIterator($this->getOriginal());\n }",
"public function getResultIteratorClassName(string $tableName): string;",
"public function getClassName(): string\n {\n return $this->reflectedObject->getName();\n }",
"private function getTypeName()\n {\n $split = explode(\"\\\\\", $this->className);\n return array_values(array_slice($split, -1))[0];\n }",
"public function getArrayName()\n {\n return $this->array_name;\n }",
"static function getName($obj)\n\t{\n\t\tif (is_array($obj))\n\t\t{\n\t\t\treturn \"Array\";\n\t\t}\n\n\t\treturn get_class($obj);\n\t}",
"public function getClassName() {\r\n\t\treturn $this->class_name;\r\n\t}",
"public function getClassName() {\n return $this->class_name;\n }",
"public function getClassName($object);",
"public function getClassName(){\r\n return array_pop(explode('\\\\', get_class($this)));\r\n }",
"function getClassname() {\n\t\treturn $this->_Classname;\n\t}",
"public function get_class_name()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->getValue('interface_class_name');\n }",
"public function GetClassName() {\n\t\treturn \"DBObj_\".$this->extname.\"_\".$this->tblname;\n\t}",
"protected function getClassName()\n {\n return basename($this->getNameInput());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get animal food ration | public function getFoodRation(): Food
{
return $this->foodRation;
} | [
"public function getFood()\n {\n return $this->food;\n }",
"private function respirate($animal){\r\n\t\techo $animal->breathe().\"<br/>\";\r\n\t }",
"public function makeFood(): Food{\n $asianFood = new AsianFood;\n return $asianFood->getDescription();\n }",
"public function foodName()\n {\n return static::randomElement(static::$foodNames);\n }",
"public function getNome(){\n return $this->nome_animal;\n }",
"public function getMeal()\n {\n return $this->meal;\n }",
"public function getCaractereAnimal()\n {\n return $this->caractereAnimal;\n }",
"public function getType_animal()\n {\n return $this->Type_animal;\n }",
"function eatfood(){\n\t\tif($this->quality > 5){\n\t\t\t$this->quality = $this->quality - 5;\n\t\t\t$this->stamina = $this->stamina + 15;\n\t\t\t$this->brain->setstate(\"gohome\");\n\t\t\t$this->appendtoturn(\"<b>\" . $this->type . \"</b>(\" . $this->stamina . \") ant ate a part of it's food!\");\n\t\t} else {\n\t\t\t$this->stamina += $this->quality * 3;\n\t\t\t$this->quality = 0;\n\t\t\t$this->hasfood = false;\n\t\t\t$this->brain->setstate(\"findleaf\");\n\t\t\t$this->appendtoturn(\"<b>\" . $this->type . \"</b>(\" . $this->stamina . \") ant ate all the food it was holding!\");\n\t\t}\n\t\t$this->appendtoturn(\"<b>\" . $this->type . \"</b>(\" . $this->stamina . \") ant looks healthier!\");\n\t}",
"public function getisFood();",
"public function getNomAnimal()\n {\n return $this->Nom_animal;\n }",
"public function getAnimal(): Animal\n {\n return $this->animal;\n }",
"public function getType()\n {\n return $this->type_animal;\n }",
"function getAnimals(){ return $this->allAnimals; }",
"public function getFoodTypeAsName() {\n\n $foodTypeName;\n\n //All of these cases are made for Harvard, not for BC, but they can easily be changed to something more suiting our needs. A lot of the earlier entries would still suit our purposes- it's only 27 on which need revision to say things like \"At Hillside\" or \"In the Chocolate Bar\" or some such.\n //Another thought, though, is to have two seperate case statements, one of which would filter as below by \"foodType\" and other of which would filter by \"location\", allowing us to write some simple code which would check the food type and location and then display (\"%s is being served at %s\", foodType, location)\n\n switch ($this->foodType) {\n case \"01\":\n $foodTypeName = \"Breakfast Meats\";\n break;\n case \"02\":\n $foodTypeName = \"Breakfast Entrees\";\n break;\n case \"03\":\n $foodTypeName = \"Breakfast Bakery\";\n break;\n case \"04\":\n $foodTypeName = \"Breakfast Misc\";\n break;\n case \"05\":\n $foodTypeName = \"Breakfast Breads\";\n break;\n case \"06\":\n $foodTypeName = \"Seasonal\";\n break;\n case \"07\":\n $foodTypeName = \"Today's Soup\";\n break;\n case \"08\":\n $foodTypeName = \"Made to Order Bar\";\n break;\n case \"09\":\n $foodTypeName = \"Brunch\";\n break;\n case \"10\":\n $foodTypeName = \"Salad Bar\";\n break;\n case \"11\":\n $foodTypeName = \"Sandwich Bar\";\n break;\n case \"12\":\n $foodTypeName = \"Entrees\";\n break;\n case \"13\":\n $foodTypeName = \"Accompaniments\";\n break;\n case \"14\":\n $foodTypeName = \"Starch & Potatoes\";\n break;\n case \"15\":\n $foodTypeName = \"Vegetables\";\n break;\n case \"16\":\n $foodTypeName = \"Fruit, Fresh, Caned & Frozen\";\n break;\n case \"17\":\n $foodTypeName = \"Desserts\";\n break;\n case \"18\":\n $foodTypeName = \"Bread, Rolls, Misc Bakery\";\n break;\n case \"19\":\n $foodTypeName = \"From the Grille\";\n break;\n case \"20\":\n $foodTypeName = \"Bean, Whole Grain\";\n break;\n case \"21\":\n $foodTypeName = \"Basic Food Table\";\n break;\n case \"22\":\n $foodTypeName = \"Brown Rice Station\";\n break;\n case \"23\":\n $foodTypeName = \"Make or Build Your Own\";\n break;\n case \"24\":\n $foodTypeName = \"Special Bars - Board Menu\";\n break;\n case \"25\":\n $foodTypeName = \"Culinary Display\";\n break;\n case \"27\":\n $foodTypeName = \"In Addition at Annenberg\";\n break;\n case \"28\":\n $foodTypeName = \"Bag Lunches\";\n break;\n case \"29\":\n $foodTypeName = \"Production Salads\";\n break;\n case \"30\":\n $foodTypeName = \"A C I\";\n break;\n case \"31\":\n $foodTypeName = \"Chef's Choice\";\n break;\n case \"40\":\n $foodTypeName = \"Festive Meals\";\n break;\n case \"41\":\n $foodTypeName = \"Kosher Table\";\n break;\n case \"42\":\n $foodTypeName = \"Fly-By\";\n break;\n case \"43\":\n $foodTypeName = \"Continental Breakfast\";\n break;\n case \"44\":\n $foodTypeName = \"Vegetarian Station\";\n break;\n case \"45\":\n $foodTypeName = \"Pasta a la Carte\";\n break;\n case \"46\":\n $foodTypeName = \"Love Your Heart Menu\";\n break;\n case \"90\":\n $foodTypeName = \"Brain Break\";\n break;\n case \"99\":\n $foodTypeName = \"Misc. Supplies\";\n break;\n default:\n $foodTypeName = \"Other\";\n }\n return $foodTypeName;\n }",
"function getAnimalById($animalId){ return $this->allAnimals[$animalId]; }",
"public function isFood() {\n\t\treturn $this->food;\n\t}",
"public function getFoodsData()\n {\n return $this->foods;\n }",
"public function getDescriptionAnimal()\n {\n return $this->descriptionAnimal;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a datatable describing how much space is taken up by each numeric archive table. | public function getMetricDataSummary()
{
Piwik::checkUserHasSuperUserAccess();
return $this->getTablesSummary($this->metadataProvider->getAllNumericArchiveStatus());
} | [
"function diskUsageTable ($c,$table) {\n$extension = array(\"_retention\", \"_hour\", \"_day\", \"_uniq\", \"_path\", \"_referrer\", \"_keyword\", \"_browser\", \"_os\", \"_country\", \"_host\", \"_acces\", \"_pages\", \"_iplist\");\n$table_size = 0;\nforeach ($extension as $ext) {\n\t$thetable = \"$table$ext\";\n\t$result = mysql_query (\"show table status like '$thetable'\",$c);\n\t$row = mysql_fetch_array($result);\n\t// $number_line = $row['Rows']; // Get number of lines in tables\n\t$table_size += ($row['Data_length'] + $row['Index_length']);\n}\n$table_size = size_hum_read($table_size);\nreturn $table_size;\n}",
"private function size_to_free() {\r\n\t\r\n\t\tglobal $wpdb;\r\n\t\t$should_resize = false;\r\n\t\r\n\t\t$query = 'SHOW TABLE STATUS FROM ' . DB_NAME;\r\n\t\t$results = $wpdb->get_results($query, ARRAY_A);\r\n\t\t\t\r\n\t\t$sum_free = 0;\r\n\t\tforeach($results as $result) {\r\n\t\t\t$sum_free = $sum_free + $result['Data_free'];\r\n\t\t} // end foreach\r\n\t\t\r\n\t\treturn $sum_free;\r\n\t\t\r\n\t}",
"function get_table_sizes() {\n\t\tglobal $wpdb;\n\n\t\tstatic $return;\n\n\t\tif ( ! empty( $return ) ) {\n\t\t\treturn $return;\n\t\t}\n\n\t\t$return = array();\n\n\t\t$sql = $wpdb->prepare(\n\t\t\t\"SELECT TABLE_NAME AS 'table',\n\t\t\tROUND( ( data_length + index_length ) / 1024, 0 ) AS 'size'\n\t\t\tFROM INFORMATION_SCHEMA.TABLES\n\t\t\tWHERE INFORMATION_SCHEMA.TABLES.table_schema = %s\n\t\t\tAND INFORMATION_SCHEMA.TABLES.table_type = %s\n\t\t\tORDER BY TABLE_NAME\",\n\t\t\tDB_NAME,\n\t\t\t'BASE TABLE'\n\t\t);\n\n\t\t$results = $wpdb->get_results( $sql, ARRAY_A );\n\n\t\tif ( ! empty( $results ) ) {\n\t\t\tforeach ( $results as $result ) {\n\t\t\t\tif ( $this->get_legacy_alter_table_name() == $result['table'] ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$return[ $result['table'] ] = $result['size'];\n\t\t\t}\n\t\t}\n\n\t\t// \"regular\" is passed to the filter as the scope for backwards compatibility (a possible but never used scope was \"temp\").\n\t\treturn apply_filters( 'wpmdb_table_sizes', $return, 'regular' );\n\t}",
"public function getTableSize() {\n \n $table_values = [];\n \n if ($this -> ifTableExists() !== FALSE) { // if table exists\n\n $st = $this -> dbo -> prepare(\"SELECT * FROM \" . $this -> table_name);\n\n $st -> execute();\n\n return [\n 'rows_count' => $st -> rowCount(),\n 'columns_count' => $st -> columnCount()\n ];\n\n } else {\n \n return FALSE;\n \n }\n }",
"function PMA_getValuesForInnodbTable($current_table, $is_show_stats, $sum_size)\n{\n $formatted_size = $unit = '';\n\n if (($current_table['ENGINE'] == 'InnoDB'\n && $current_table['TABLE_ROWS'] < $GLOBALS['cfg']['MaxExactCount'])\n || !isset($current_table['TABLE_ROWS'])\n ) {\n $current_table['COUNTED'] = true;\n $current_table['TABLE_ROWS'] = $GLOBALS['dbi']\n ->getTable($GLOBALS['db'], $current_table['TABLE_NAME'])\n ->countRecords(true);\n } else {\n $current_table['COUNTED'] = false;\n }\n\n // Drizzle doesn't provide data and index length, check for null\n if ($is_show_stats && $current_table['Data_length'] !== null) {\n $tblsize = $current_table['Data_length'] + $current_table['Index_length'];\n $sum_size += $tblsize;\n list($formatted_size, $unit) = PMA_Util::formatByteDown(\n $tblsize, 3, (($tblsize > 0) ? 1 : 0)\n );\n }\n\n return array($current_table, $formatted_size, $unit, $sum_size);\n}",
"public function get_current_db_size() {\n\n\t\t$wp_optimize = WP_Optimize();\n\n\t\t$wpdb = $GLOBALS['wpdb'];\n\t\t$total_gain = 0;\n\t\t$total_size = 0;\n\t\t$no = 0;\n\t\t$row_usage = 0;\n\t\t$data_usage = 0;\n\t\t$index_usage = 0;\n\t\t$overhead_usage = 0;\n\t\t\n\t\t$tablesstatus = $this->get_tables();\n\n\t\tforeach ($tablesstatus as $tablestatus) {\n\t\t\t$row_usage += $tablestatus->Rows;\n\t\t\t$data_usage += $tablestatus->Data_length;\n\t\t\t$index_usage += $tablestatus->Index_length;\n\n\t\t\tif ('InnoDB' != $tablestatus->Engine) {\n\t\t\t\t$overhead_usage += $tablestatus->Data_free;\n\t\t\t\t$total_gain += $tablestatus->Data_free;\n\t\t\t}\n\t\t}\n\n\t\t$total_size = ($data_usage + $index_usage);\n\t\treturn array($wp_optimize->format_size($total_size), $wp_optimize->format_size($total_gain));\n\t}",
"function _vacuspeed_tool_create_counts_table() {\n // get counts array\n $session_data = &vacuspeed_tool_session_data();\n $counts = $session_data['counts'];\n\n $header = array(\n array('data' => t('Counts'), 'class' => 'column-layer'),\n array('data' => t('100x50'), 'class' => 'column-100x50'),\n array('data' => t('50x50'), 'class' => 'column-50x50'),\n array('data' => t('50x25'), 'class' => 'column-50x25'),\n array('data' => t('25x25'), 'class' => 'column-25x25'),\n array('data' => t('Cut'), 'class' => 'column-cut'),\n array('data' => t('Total'), 'class' => 'column-total'),\n );\n\n // create rows with stored counts\n $rows = array();\n $row_total = array();\n foreach ($counts as $layer => $tile_counts) {\n $row = array(\n array('data' => $layer == 'totals' ? t('Total') : $layer, 'class' => 'column-layer'),\n array('data' => $tile_counts['100x50'], 'class' => 'column-100x50'),\n array('data' => $tile_counts['50x50'], 'class' => 'column-50x50'),\n array('data' => $tile_counts['50x25'], 'class' => 'column-50x25'),\n array('data' => $tile_counts['25x25'], 'class' => 'column-25x25'),\n array('data' => $tile_counts['CUT'], 'class' => 'column-cut'),\n array('data' => $tile_counts['total'], 'class' => 'column-total'),\n );\n if ($layer == 'totals') {\n $row_total = array(\n 'data' => $row,\n 'class' => array('row-total'),\n );\n continue;\n }\n $rows[] = $row;\n\n }\n\n // set total or empty row\n if (empty($rows)) {\n $rows[] = array(\n array('data' => t('There are no Vacuspeed numbers available!'), 'colspan' => 7)\n );\n\n } else {\n // add total row to table\n $rows[] = $row_total;\n\n }\n\n // return the table render array\n return array(\n '#theme' => 'table',\n '#header' => $header,\n '#rows' => $rows,\n '#attributes' => array('id' => 'table-counts'),\n '#prefix' => '<div id=\"counts-table-wrapper\">',\n '#suffix' => '</div>',\n );\n}",
"function qa_db_table_size()\n{\n\tif (defined('QA_MYSQL_USERS_PREFIX')) { // check if one of the prefixes is a prefix itself of the other\n\t\tif (stripos(QA_MYSQL_USERS_PREFIX, QA_MYSQL_TABLE_PREFIX) === 0)\n\t\t\t$prefixes = array(QA_MYSQL_TABLE_PREFIX);\n\t\telseif (stripos(QA_MYSQL_TABLE_PREFIX, QA_MYSQL_USERS_PREFIX) === 0)\n\t\t\t$prefixes = array(QA_MYSQL_USERS_PREFIX);\n\t\telse\n\t\t\t$prefixes = array(QA_MYSQL_TABLE_PREFIX, QA_MYSQL_USERS_PREFIX);\n\n\t} else\n\t\t$prefixes = array(QA_MYSQL_TABLE_PREFIX);\n\n\t$size = 0;\n\tforeach ($prefixes as $prefix) {\n\t\t$statuses = qa_db_read_all_assoc(qa_db_query_raw(\n\t\t\t\"SHOW TABLE STATUS LIKE '\" . $prefix . \"%'\"\n\t\t));\n\n\t\tforeach ($statuses as $status)\n\t\t\t$size += $status['Data_length'] + $status['Index_length'];\n\t}\n\n\treturn $size;\n}",
"public function getTableArchiveNumericName()\n {\n return $this->tableArchiveNumeric->getTableName();\n }",
"private function getNumericTableName()\n\t{\n\t\tif (is_null($this->tableName))\n\t\t{\n\t\t\t$table = Piwik_ArchiveProcessing::makeNumericArchiveTable($this->getFirstArchive()->getPeriod());\n\t\t\t$this->tableName = $table->getTableName();\n\t\t}\n\n\t\treturn $this->tableName;\n\t}",
"function table_size($table) {\n\t$query = \"SELECT COUNT(*) FROM $table\";\n\t$res = pg_query($query);\n\t$size = pg_fetch_assoc($res);\n\treturn $size['count'];\n}",
"function GetTableSize($table)\r\n{\r\n\tif ($this->tablestatus === false)\r\n\t{\r\n\t\t$this->Exec('SHOW TABLE STATUS');\r\n\t\t$this->tablestatus = array();\r\n\t\twhile ($record = $this->GetRecord())\r\n\t\t{\r\n\t\t\tarray_push($this->tablestatus, $record);\r\n\t\t}\r\n\t}\r\n\r\n\tforeach ($this->tablestatus as $a)\r\n\t{\r\n\t\tif (!strcasecmp($a['Name'], $this->tblprefix . $table)) return $a['Data_length'] + $a['Index_length'];\r\n\t}\r\n\treturn false;\r\n}",
"public function getSummary () {\n\t\t#coopy/TableDiff.hx:1177: characters 9-36\n\t\t$ds = new DiffSummary();\n\t\t#coopy/TableDiff.hx:1178: characters 9-37\n\t\t$ds->row_deletes = $this->row_deletes;\n\t\t#coopy/TableDiff.hx:1179: characters 9-37\n\t\t$ds->row_inserts = $this->row_inserts;\n\t\t#coopy/TableDiff.hx:1180: characters 9-37\n\t\t$ds->row_updates = $this->row_updates;\n\t\t#coopy/TableDiff.hx:1181: characters 9-39\n\t\t$ds->row_reorders = $this->row_reorders;\n\t\t#coopy/TableDiff.hx:1182: characters 9-37\n\t\t$ds->col_deletes = $this->col_deletes;\n\t\t#coopy/TableDiff.hx:1183: characters 9-37\n\t\t$ds->col_inserts = $this->col_inserts;\n\t\t#coopy/TableDiff.hx:1184: characters 9-37\n\t\t$ds->col_updates = $this->col_updates;\n\t\t#coopy/TableDiff.hx:1185: characters 9-37\n\t\t$ds->col_renames = $this->col_renames;\n\t\t#coopy/TableDiff.hx:1186: characters 9-39\n\t\t$ds->col_reorders = $this->col_reorders;\n\t\t#coopy/TableDiff.hx:1187: characters 9-68\n\t\t$ds->row_count_initial_with_header = $this->align->getSource()->get_height();\n\t\t#coopy/TableDiff.hx:1188: characters 9-66\n\t\t$ds->row_count_final_with_header = $this->align->getTarget()->get_height();\n\t\t#coopy/TableDiff.hx:1189: characters 9-86\n\t\t$ds->row_count_initial = $this->align->getSource()->get_height() - $this->align->getSourceHeader() - 1;\n\t\t#coopy/TableDiff.hx:1190: characters 9-84\n\t\t$ds->row_count_final = $this->align->getTarget()->get_height() - $this->align->getTargetHeader() - 1;\n\t\t#coopy/TableDiff.hx:1191: characters 9-55\n\t\t$ds->col_count_initial = $this->align->getSource()->get_width();\n\t\t#coopy/TableDiff.hx:1192: characters 9-53\n\t\t$ds->col_count_final = $this->align->getTarget()->get_width();\n\t\t#coopy/TableDiff.hx:1193: lines 1193-1195\n\t\t$ds->different = ($this->row_deletes + $this->row_inserts + $this->row_updates + $this->row_reorders + $this->col_deletes + $this->col_inserts + $this->col_updates + $this->col_renames + $this->col_reorders) > 0;\n\t\t#coopy/TableDiff.hx:1196: characters 9-18\n\t\treturn $ds;\n\t}",
"private function get_DB_size() {\n global $DB;\n $sql = \"SELECT table_name AS table_name,\n ROUND(((data_length + index_length) / 1024 / 1024), 2) AS table_size\n FROM information_schema.TABLES\n WHERE table_schema = :databasename\n ORDER BY (data_length + index_length) DESC;\";\n\n $params = ['databasename' => $this->get_DB_name()];\n $records = $DB->get_records_sql($sql, $params);\n $total = 0;\n\n foreach ($records as $record) {\n $total += (float) $record->table_size;\n }\n return $total . \" MB\"; // Total is in MB\n }",
"public function stationsTableSizeGet()\n {\n return $this->rulesReadProcess($this->stationTableRules()); \n }",
"public function counttable() {\n return count($this->tab);\n }",
"function OptimizeTables() {}",
"public function getTableSizeBytes()\n {\n return $this->tableSizeBytes;\n }",
"private function fragmentedTables() {\t\t$result = mysql_query(\"SELECT\n\t\t\t\t\t\t\t\t\tCOUNT(TABLE_NAME) as Frag\n\t\t FROM\n\t\t \t\tinformation_schema.TABLES\n\t\t WHERE\n\t\t \t\tTABLE_SCHEMA NOT IN ('information_schema','mysql')\n\t\t \t\tAND Data_free > \".$this->fragmentation_data_free_threshold);\n\t\t//@todo this is stupid there is no real need for a while loop here\n\t\twhile ($row = mysql_fetch_assoc($result)) {\n\t\t\t$this->data[] = array('Fragmented_table_count' => $row[\"Frag\"]);\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return Renderimages of a given member. | function get_RenderImages($class_id=-1, $race_id=-1, $member_name='', $member_xml=false,$realm='')
{
global $db, $eqdkp, $user, $conf_plus,$eqdkp_root_path;
$ret_val = false ;
$img_folder = $eqdkp_root_path.'games/'.$eqdkp->config['default_game']."/3dmodel/" ;
if ( (($race_id == -1) or ($class_id == -1)) and (strlen($member_name) >1) )
{
$sql = "SELECT member_class_id, member_race_id from ".MEMBERS_TABLE. " WHERE member_name ='".$member_name."'" ;
$result = $db->query($sql);
$row = $db->fetch_record($result);
$race_id = $row['member_race_id'];
$class_id = $row['member_class_id'];
}
$imgs = array();
$gender = '0';
if (get_Gender($member_name)=='Female') {
$gender = '1';
}
$imgs[] = $img_folder.$class_id."_".$race_id."_".$gender.'.jpg' ; //T4
foreach($imgs as $value)
{
if(file_exists($value))
{
$ret_val .= '<img src='.$value.'> ' ;
}
}
return $ret_val ;
} | [
"private function _getImages(&$members) {\n \t$images = array();\n \t$i = 0;\n\n $jinput = JFactory::getApplication()->input;\n \t$itemId = $jinput->getInt('Itemid', 0);\n \t\n \t//Get images\n \tforeach($members as $member)\n \t{\n if($member->url_photo != \"\")\n {\n $images[$i]['img'] = str_ireplace(JURI::root(), '', JResearch::getUrlByRelative($member->url_photo));\n $images[$i]['imgalt'] = $member->firstname.' '.$member->lastname;\n $images[$i]['imgtitle'] = 'Image of '.$member->firstname.' '.$member->lastname;\n $images[$i]['hreftitle'] = 'Show me details of '.$member->firstname.' '.$member->lastname;\n $images[$i++]['url'] = JURI::base().'index.php?option=com_jresearch&view=member&task=show&id='.$member->id.(!empty($itemId) ? '&Itemid='.$itemId : '');\n }\n \t}\n \t\n \t//If no images are present, fill with \"no image\"\n \tif (count($images) == 0 ) {\n $images[0]['img'] = str_ireplace(JURI::root(), '', JURI::base().'components/com_jresearch/assets/qmark.jpg');\n $images[0]['imgalt'] = 'No images found!';\n $images[0]['imgtitle'] = 'No images found!';\n $images[0]['hreftitle'] = 'No images found!';\n $images[0]['url'] = 'index.php'.(!empty($itemId) ? '?Itemid='.$itemId : '');\n }\n\t\t\n return $images;\n }",
"public function transform(Member $member)\n {\n\n $getImage = (count($member->image) > 0) ? 'upload/members/' . $member->image->filename : 'images/blank.png';\n\n\t\treturn [\n\t\t\t'name' => $member->name,\n\t\t\t'slug' => $member->slug,\n\t\t\t'logoFilePathSm' => $getImage,\n\t\t];\n }",
"public function getImages() ;",
"abstract public function getImages();",
"function get_images() \t{\n\t \t\treturn $this->getImages();\n\t \t}",
"public function getImages();",
"function clanpress_the_squad_member_avatar( $member = null ) {\n $member = isset( $member ) ? $member : clanpress_get_squad_member();\n echo bp_core_fetch_avatar(array(\n 'item_id' => $member->ID,\n 'type' => 'full',\n ));\n}",
"public function getImages()\n {\n }",
"public function images()\n {\n return get_field('images');\n }",
"public function render()\n {\n $items = implode('', $this->getImages());\n\n return '<div class=\"gallery\">'.$items.'</div>';\n }",
"public function getTeamMemberImage()\n {\n return $this->teamMemberImage;\n }",
"function theme_images()\n { \n return theme_facilities('images');\n }",
"public function getImagesByUser(): string {\n $imageModel = new ImageModel($this->db);\n $images = $imageModel->getImagesByUser($this->userId);\n $numberOfImages = $imageModel->countImagesByUser($this->userId);\n\n $properties = [\n 'images' => $images,\n 'numberOfImages' => $numberOfImages,\n\t\t\t'isAuth' => $this->isAuthenticated(),\n\t\t\t'uId' => $this->returnUserCookie(),\n\t\t];\n\t\treturn $this->render('my-gallery.twig', $properties);\n\t}",
"public function get_member_photo_url($member)\n {\n return '';\n }",
"public function user_images()\n\t{\n\t\treturn $this->_xmlrpc_request('grav.userimages');\n\t}",
"public function getImages()\n {\n return $this->data['fields']['images'];\n }",
"function images()\r\n {\r\n $return_array = array();\r\n $image_array = array();\r\n\r\n $db =& eZDB::globalDatabase();\r\n $db->array_query( $image_array, \"SELECT ImageID FROM eZMail_MailImageLink WHERE MailID='$this->ID'\" );\r\n\r\n for ( $i = 0; $i < count( $image_array ); $i++ )\r\n {\r\n $return_array[$i] = new eZImage( $image_array[$i][$db->fieldName( \"ImageID\" )], false );\r\n }\r\n return $return_array;\r\n }",
"private function get_item_images() {\n\t\t$this->output .= new WPSEO_News_Sitemap_Images( $this->item, $this->options );\n\t}",
"protected function render() {\n\n\t\t$settings = $this->get_settings_for_display();\n\t\tif ( 'left' === $settings['image_position'] || 'right' === $settings['image_position'] ) {\n\t\t\tif ( 'tablet' === $settings['member_mob_view'] ) {\n\t\t\t\t$this->add_render_attribute( 'member-classname', 'class', 'uael-member-stacked-tablet' );\n\t\t\t}\n\t\t\tif ( 'mobile' === $settings['member_mob_view'] ) {\n\t\t\t\t$this->add_render_attribute( 'member-classname', 'class', 'uael-member-stacked-mobile' );\n\t\t\t}\n\t\t\tif ( 'middle' === $settings['member_image_valign'] ) {\n\t\t\t\t$this->add_render_attribute( 'member-classname', 'class', 'uael-member-image-valign-middle' );\n\t\t\t} else {\n\t\t\t\t$this->add_render_attribute( 'member-classname', 'class', 'uael-member-image-valign-top' );\n\t\t\t}\n\t\t}\n\t\t$this->add_render_attribute( 'member-classname', 'class', 'uael-team-member' );\n\n\t\t$fallback_defaults = array(\n\t\t\t'fa fa-facebook',\n\t\t\t'fa fa-twitter',\n\t\t\t'fa fa-google-plus',\n\t\t);\n\n\t\t?>\n\t\t<div <?php echo wp_kses_post( $this->get_render_attribute_string( 'member-classname' ) ); ?>>\t\n\t\t\t<div class = \"uael-team-member-wrap\" >\n\t\t\t\t<div class=\"uael-member-wrap\" >\n\t\t\t\t\t<?php\n\t\t\t\t\t$has_image = $settings['image']['url'];\n\t\t\t\t\tif ( $has_image ) :\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<div class=\"uael-team-member-image\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t$image_html = Group_Control_Image_Size::get_attachment_image_html( $settings );\n\t\t\t\t\t\t\techo '<div class=elementor-animation-' . esc_attr( $settings['hover_animation'] ) . '>' . wp_kses_post( $image_html ) . '</div>';\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$this->add_render_attribute( 'member_content', 'class', 'uael-team-member-content' );\n\t\t\t\t\t$this->add_render_attribute( 'team_member_name', 'class', 'uael-team-name' );\n\t\t\t\t\t$this->add_inline_editing_attributes( 'team_member_name' );\n\t\t\t\t\t?>\n\t\t\t\t\t<div <?php echo wp_kses_post( $this->get_render_attribute_string( 'member_content' ) ); ?>>\n\t\t\t\t\t<?php if ( '' !== $settings['team_member_name'] ) { ?>\n\t\t\t\t\t\t<div class=\"uael-team-member-name\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t$name = $settings['team_member_name'];\n\t\t\t\t\t\t\t$name_html = sprintf( '<%1$s %2$s>%3$s</%1$s>', $settings['name_size'], $this->get_render_attribute_string( 'team_member_name' ), $name );\n\t\t\t\t\t\t\techo wp_kses_post( $name_html );\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( 'yes' === $settings['separator_settings'] ) {\n\t\t\t\t\t\tif ( 'below_name' === $settings['separator_position'] ) {\n\t\t\t\t\t\t\t$this->get_separator_position();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->add_render_attribute( 'team_member_desig', 'class', 'uael-team-desig' );\n\t\t\t\t\t$this->add_inline_editing_attributes( 'team_member_desig' );\n\t\t\t\t\t?>\n\t\t\t\t\t<?php if ( '' !== $settings['team_member_desig'] ) { ?>\n\t\t\t\t\t\t<div class=\"uael-team-member-designation\">\n\t\t\t\t\t\t\t<div <?php echo wp_kses_post( $this->get_render_attribute_string( 'team_member_desig' ) ); ?>><?php echo wp_kses_post( $settings['team_member_desig'] ); ?>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( 'yes' === $settings['separator_settings'] ) {\n\t\t\t\t\t\tif ( 'below_desig' === $settings['separator_position'] ) {\n\t\t\t\t\t\t\t$this->get_separator_position();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->add_render_attribute( 'team_member_desc', 'class', 'uael-team-desc' );\n\t\t\t\t\t$this->add_inline_editing_attributes( 'team_member_desc' );\n\t\t\t\t\t?>\n\t\t\t\t\t<?php if ( '' !== $settings['team_member_desc'] ) { ?>\n\t\t\t\t\t\t<div class=\"uael-team-member-desc\">\n\t\t\t\t\t\t\t<div <?php echo wp_kses_post( $this->get_render_attribute_string( 'team_member_desc' ) ); ?>><?php echo wp_kses_post( $settings['team_member_desc'] ); ?></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( 'yes' === $settings['separator_settings'] ) {\n\t\t\t\t\t\tif ( 'below_desc' === $settings['separator_position'] ) {\n\t\t\t\t\t\t\t$this->get_separator_position();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t?>\n\t\t\t\t\t<?php if ( 'yes' === $settings['social_icons_settings'] ) { ?>\n\t\t\t\t\t\t<div class=\"elementor-social-icons-wrapper\">\n\t\t\t\t\t\t\t<div class=\"uael-team-social-icon\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tforeach ( $settings['social_icon_list'] as $index => $item ) {\n\n\t\t\t\t\t\t\t\tif ( UAEL_Helper::is_elementor_updated() ) {\n\n\t\t\t\t\t\t\t\t\t$migration_allowed = \\Elementor\\Icons_Manager::is_migration_allowed();\n\n\t\t\t\t\t\t\t\t\t$migrated = isset( $item['__fa4_migrated']['new_social'] );\n\t\t\t\t\t\t\t\t\t$is_new = empty( $item['social'] ) && $migration_allowed;\n\t\t\t\t\t\t\t\t\t$social = '';\n\n\t\t\t\t\t\t\t\t\t// add old default.\n\t\t\t\t\t\t\t\t\tif ( empty( $item['social'] ) && ! $migration_allowed ) {\n\t\t\t\t\t\t\t\t\t\t$item['social'] = isset( $fallback_defaults[ $index ] ) ? $fallback_defaults[ $index ] : 'fa fa-wordpress';\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif ( ! empty( $item['social'] ) ) {\n\t\t\t\t\t\t\t\t\t\t$social = str_replace( 'fa fa-', '', $item['social'] );\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif ( ( $is_new || $migrated ) && 'svg' !== $item['new_social']['library'] ) {\n\t\t\t\t\t\t\t\t\t\t$social = explode( ' ', $item['new_social']['value'], 2 );\n\t\t\t\t\t\t\t\t\t\tif ( empty( $social[1] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t$social = '';\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t$social = str_replace( 'fa-', '', $social[1] );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( 'svg' === $item['new_social']['library'] ) {\n\t\t\t\t\t\t\t\t\t\t$social = '';\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$link_key = 'link_' . $index;\n\t\t\t\t\t\t\t\t\t$class_animation = ' elementor-animation-' . $settings['icon_hover_animation'];\n\n\t\t\t\t\t\t\t\t\t$this->add_render_attribute( $link_key, 'href', $item['link']['url'] );\n\n\t\t\t\t\t\t\t\t\t$this->add_render_attribute(\n\t\t\t\t\t\t\t\t\t\t$link_key,\n\t\t\t\t\t\t\t\t\t\t'class',\n\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'elementor-icon',\n\t\t\t\t\t\t\t\t\t\t\t'elementor-social-icon',\n\t\t\t\t\t\t\t\t\t\t\t'elementor-social-icon-' . $social . $class_animation,\n\t\t\t\t\t\t\t\t\t\t\t'elementor-repeater-item-' . $item['_id'],\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\tif ( $item['link']['is_external'] ) {\n\t\t\t\t\t\t\t\t\t\t$this->add_render_attribute( $link_key, 'target', '_blank' );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( $item['link']['nofollow'] ) {\n\t\t\t\t\t\t\t\t\t\t$this->add_render_attribute( $link_key, 'rel', 'nofollow' );\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<a <?php echo wp_kses_post( $this->get_render_attribute_string( $link_key ) ); ?>>\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-screen-only\"><?php echo esc_attr( ucwords( $social ) ); ?></span>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\tif ( $is_new || $migrated ) {\n\t\t\t\t\t\t\t\t\t\t\t\\Elementor\\Icons_Manager::render_icon( $item['new_social'] );\n\t\t\t\t\t\t\t\t\t\t} elseif ( ! empty( $item['social'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t<i class=\"<?php echo esc_attr( $item['social'] ); ?>\"></i>\n\t\t\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t} elseif ( ! empty( $item['social'] ) ) {\n\t\t\t\t\t\t\t\t\t$social = str_replace( 'fa fa-', '', $item['social'] );\n\t\t\t\t\t\t\t\t\t$link_key = 'link_' . $index;\n\t\t\t\t\t\t\t\t\t$this->add_render_attribute( $link_key, 'href', $item['link']['url'] );\n\t\t\t\t\t\t\t\t\tif ( $item['link']['is_external'] ) {\n\t\t\t\t\t\t\t\t\t\t$this->add_render_attribute( $link_key, 'target', '_blank' );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( $item['link']['nofollow'] ) {\n\t\t\t\t\t\t\t\t\t\t$this->add_render_attribute( $link_key, 'rel', 'nofollow' );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$class_animation = ' elementor-animation-' . $settings['icon_hover_animation'];\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<a class=\"elementor-icon elementor-social-icon elementor-social-icon-<?php echo esc_attr( $social ) . esc_attr( $class_animation ); ?>\" <?php echo wp_kses_post( $this->get_render_attribute_string( $link_key ) ); ?>>\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-screen-only\"><?php echo esc_attr( ucwords( $social ) ); ?></span>\n\t\t\t\t\t\t\t\t\t\t<i class=\"<?php echo esc_attr( $item['social'] ); ?>\"></i>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t\t<?php\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the color of the pixel on position $x,$y from the image $file | public function GetPixelColor($file, $x, $y)
{
// Get extension
$extension = end(explode(".", $file));
// Get image source
$this->Load($file);
$image = $this->GetResource();
// Get pixel color
$rgb = imagecolorat($image, $x, $y);
$r = ($rgb >> 16) & 0xFF;
$g = ($rgb >> 8) & 0xFF;
$b = $rgb & 0xFF;
// Return pixel color
return array($r,$g,$b);
} | [
"public function getImagePixelColor ($x, $y) {}",
"function get_color($x, $y)\n{\n\tglobal $image;\n\t\n\treturn $image[$y-1][$x-1];\n}",
"public function getPixelColorIndex($x, $y){\n\t\t$x = abs($x); $y = abs($y);\n\t\t// If it's a gif, return each\n\t\tif(is_array($this->gif_sources)){\n\t\t\t$ret = array();\n\t\t\tforeach($this->gif_sources as $img)\n\t\t\t\tarray_push($ret, $img->getPixelColorIndex($x, $y));\n\t\t\treturn $ret;\n\t\t}\n\t\t\n\t\ttry{\n\t\t\t$r = imagecolorat($this->image, $x, $y);\n\t\t}catch(Exception $e){\n\t\t\techo \"<pre>\"; debug_print_backtrace(); exit;\n\t\t}\n\t\treturn $r;\n\t}",
"function imagecolorat($image, $x, $y)\n{\n}",
"public function getPixel(int $x, int $y) : int;",
"static private function getRGBFromPixel($image, $x, $y) {\r\n $rgb = imagecolorat($image, $x, $y);\r\n $red = ($rgb >> 16) & 0xFF;\r\n $green = ($rgb >> 8) & 0xFF;\r\n $blue = $rgb & 0xFF;\r\n return array($red, $green, $blue);\r\n }",
"public function getColorAt($x, $y)\n {\n $pixel = $this->_imageHandler->getImagePixelColor($x, $y);\n\n $color = $pixel->getColor();\n $rgbaColor = [\n 'red' => $color['r'],\n 'green' => $color['g'],\n 'blue' => $color['b'],\n 'alpha' => (1 - $color['a']) * 127,\n ];\n return $rgbaColor;\n }",
"function GetPixel($red, $green, $blue){}",
"public function getColorAt($x, $y)\n {\n // Coordinates must be on the canvas\n if ($x < 0 || $x > $this->getWidth() || $y < 0 || $y > $this->getHeight()) {\n return false;\n }\n\n // Get the color of this pixel and convert it to RGBA\n $color = imagecolorat($this->image, $x, $y);\n $rgba = imagecolorsforindex($this->image, $color);\n $rgba['alpha'] = 127 - ($color >> 24) & 0xFF;\n\n return $rgba;\n }",
"public function getColorAt( $x, $y ) \n {\n $color = imagecolorat( $this->resource, $x, $y );\n\n // The alpha is represented in a 7bit fassion only by gd. Therefore it\n // needs normalization.\n $alpha = round( ( (int)( ( $color >> 24 ) & 0xFF ) / 127 ) * 255);\n\n return array( \n ( $color >> 16 ) & 0xFF,\n ( $color >> 8 ) & 0xFF,\n ( $color ) & 0xFF,\n (int)$alpha\n );\n }",
"function wb_get_pixel($source, $xpos, $ypos) {}",
"public function getPixelRgb($x, $y) {\n return imagecolorat($this->image, $x, $y);\n }",
"function GetPixel(){\r\n\r\n // Get the (32 bit) RGB value from the current image\r\n $RGB = imagecolorat($this->Canvas, $this->PixelPointer['x'], $this->PixelPointer['y']);\r\n\r\n // Obtain the individual values for each primary colour\r\n $R = ($RGB >> 16) & 0xFF;\r\n $G = ($RGB >> 8) & 0xFF;\r\n $B = ($RGB >> 0) & 0xFF;\r\n\r\n // Return the individual RGB values in an array\r\n return array($R, $G, $B);\r\n }",
"public function getPixel(Coordinate $coordinate);",
"function getColorFromImage($image_url) {\n\t\t$image_data = getimagesize($image_url);\n\t\t$width = $image_data[0];\n\t\t$height = $image_data[1];\n\n\t\t$pixel = imagecreatetruecolor(1, 1);\n\n\t\tif ($image_data[\"mime\"] == \"image/jpeg\") {\n\t\t\t$image = imagecreatefromjpeg($image_url);\n\t\t} else if ($image_data[\"mime\"] == \"image/png\") {\n\t\t\t$image = imagecreatefrompng($image_url);\t\t\t\n\t\t\timagealphablending($pixel, false);\n\t\t\timagesavealpha($pixel, true);\n\t\t\t$transparent = imagecolorallocatealpha($pixel, 255, 255, 255, 127);\n\t\t\timagefilledrectangle($pixel, 0, 0, 1, 1, $transparent);\n\t\t} else {\n\t\t\t// echo $image_data['mime'];\n\t\t}\n\n\t\timagecopyresampled($pixel, $image, 0, 0, 0, 0, 1, 1, $width, $height);\n\t\t$color = imagecolorsforindex($pixel, imagecolorat($pixel, 0, 0));\n\n\t\treturn $color;\n\t}",
"function getCoords ($pic, $r, $g, $b) {\n // put rgb args into array for comparison in loop \n $argrgb = array('red' => $r, 'green' => $g, 'blue' => $b);\n\n // create image resource of picture \n $image = imagecreatefromjpeg($pic);\n\n // get width and height of image\n list($width, $height) = getimagesize($pic);\n\n // loop through each column\n for ($y = 0; $y <= $height; $y++) {\n // loop through each pixel of the current row\n for ($x = 0; $x <= $width; $x++) {\n // get index of color at specific x,y coord\n $color_index = imagecolorat($image, $x, $y);\n // returns pixel color as array of red,green,blue,alpha\n $rgb = imagecolorsforindex($image, $color_index);\t\t \n // pop the alpha value off the end of the array\n array_pop($rgb); \n // compare pixel arrays. if they are the same, empty array is returned\n $result = array_diff($rgb, $argrgb);\n // if empty array is returned... \n if (empty($result))\n // add the coordinate to our list\n $dotCoords[] = array('x' => $x, 'y' => $y);\n } // end $x\n } // end $y\n // return list of coords\n return $dotCoords;\n}",
"#[Pure]\nfunction imagecolorclosest(GdImage $image, int $red, int $green, int $blue): int {}",
"function get_colors($image, $pixel_skip = 1)\n{\n $colors_arr = [];\n\n // took this method for php.net\n $size = getimagesize($image);\n $width = $size[0];\n $height = $size[1];\n\n // took this code from php.net i wanted to know how to support all the files\n $image = imagecreatefromstring(file_get_contents($image));\n \n for ($x = 0; $x < $size[0]; $x += $pixel_skip) {\n\n for ($y = 0; $y < $size[1]; $y += $pixel_skip) {\n\n // learned this two methods from php.net\n $pixel_color = imagecolorat($image, $x, $y);\n $index_of_color = imagecolorsforindex($image, $pixel_color);\n\n $color_value_hexa = convert_rgb($index_of_color);\n\n // i'm checking that the hex color is in the the arr since we defined it as a key we use the array_key_exists\n if (array_key_exists($color_value_hexa, $colors_arr)) {\n $colors_arr[$color_value_hexa]++;\n } else {\n $colors_arr[$color_value_hexa] = 1;\n }\n }\n }\n arsort($colors_arr);\n return $colors_arr;\n}",
"static function getRGBImage($path){\n\t\t$image = imagecreatefromjpeg($path); // imagecreatefromjpeg/png/\n\t\t\n\t\t$width = imagesx($image);\n\t\t$height = imagesy($image);\n\t\t\n\t\t$colors = array(\"red\"=>0,\"green\"=>0,\"blue\"=>0);\n\t\t\n\t\tfor ($y = 0; $y < $height-1; $y=$y+3) {\n\t\t\t$y_array = array() ;\n\t\t\t\n\t\t\tfor ($x = 0; $x < $width-1; $x=$x+3) {\n\t\t\t\t$rgb = imagecolorat($image, $x, $y);\n\t\t\t\t\n\t\t\t\t$r = ($rgb >> 16) & 0xFF;\n\t\t\t\t$g = ($rgb >> 8) & 0xFF;\n\t\t\t\t$b = $rgb & 0xFF;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$x_array = array($r, $g, $b) ;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$colors[\"red\"]=$colors[\"red\"]+$r;\n\t\t\t\t$colors[\"green\"]=$colors[\"green\"]+$g;\n\t\t\t\t$colors[\"blue\"]=$colors[\"blue\"]+$b;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t$colors[\"red\"]=$colors[\"red\"]/($height/3*$width/3);\n\t\t$colors[\"green\"]=$colors[\"green\"]/($height/3*$width/3);\n\t\t$colors[\"blue\"]=$colors[\"blue\"]/($height/3*$width/3);\n\t\t\n\t\treturn $colors;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the zone ID. | public function getZoneId(): string
{
return $this->zoneId;
} | [
"public function getZoneId()\n {\n return $this->zone_id;\n }",
"public function getZoneId() : string\n {\n return $this->zoneId;\n }",
"public function getIdZone() {\n return intval($this->idZone);\n }",
"function getZoneId() {\t\n\n\t\t// Get service object\n\t\t$service = $this->service;\n\t\t\n\t\t// Connect to API in order to get zone ID value\n\t\t$client = new uber_api_client(UBER_API_URL, UBER_API_USER,UBER_API_TOKEN);\n\t\t\n\t\ttry {\n\t\t\t$hosted_zone_id = $client->call('client.service_metadata_single',array(\n\t\t\t\t'service_id' => $service['packid'],\n\t\t\t\t'variable' => 'amazon_zone_id'\n\t\t\t));\n\t\t\t\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\tprint 'Error: '. $e->getMessage() .' ('. $e->getCode() .')';die();\n\t\t}\t\n\n\t\treturn $hosted_zone_id;\n\t}",
"public function getTimeZoneId(){}",
"public function getTimeZoneId()\n {\n return (string) $this->timeZone->getDefault()->getID();\n }",
"public function getZoneId() {\n // If there is no zone set and the account only has a single zone.\n try {\n $zones_from_api = $this->zoneApi->listZones();\n }\n catch (CloudFlareException $e) {\n $this->logger->error($e->getMessage());\n return NULL;\n }\n\n $num_zones_from_api = count($zones_from_api);\n $is_single_zone_cloudflare_account = $num_zones_from_api == 1;\n if ($is_single_zone_cloudflare_account) {\n // If there is a default zone return it so we can set it in CMI.\n $zone_id = $zones_from_api[0]->getZoneId();\n return $zone_id;\n }\n\n // If the zone has multiple accounts and none is specified in CMI we cannot\n // move forward.\n if (!$is_single_zone_cloudflare_account) {\n $link_to_settings = Url::fromRoute('cloudflare.admin_settings_form')->toString();\n $message = $this->t('No default zone has been entered for CloudFlare. Please go <a href=\"@link_to_settings\">here</a> to set.', ['@link_to_settings' => $link_to_settings]);\n $this->logger->error($message);\n return NULL;\n }\n }",
"function zen_get_zone_id($country_id, $zone_name) {\n global $db;\n $zone_id_query = $db -> Execute(\"select * from \" . TABLE_ZONES . \" where zone_country_id = '\" . $country_id . \"' and zone_name = '\" . $zone_name . \"'\");\n\n if (!$zone_id_query->RecordCount()) {\n return 0;\n }\n else {\n return $zone_id_query->fields['zone_id'];\n }\n }",
"public function getTimeZoneId()\n {\n if (!$this->uninitializedTimeZoneId) {\n return $this->timezoneId;\n }\n\n return date_default_timezone_get();\n }",
"function getIdZoneTmp() {\n return intval($this->idZoneTmp);\n }",
"public function getZone()\n {\n return isset($this->zone) ? $this->zone : '';\n }",
"function tep_get_zone_id($country_id, $zone_name) {\n $zone_id_query = tep_db_query(\"select * from \" . TABLE_ZONES . \" where zone_country_id = '\" . $country_id . \"' and zone_name = '\" . $zone_name . \"'\");\n if (!tep_db_num_rows($zone_id_query)) {\n return 0;\n }\n else {\n $zone_id_row = tep_db_fetch_array($zone_id_query);\n return $zone_id_row['zone_id'];\n }\n }",
"public function getZone()\n {\n return $this->zone;\n }",
"public function getTimezoneIdentifier()\n {\n return $this->timezoneIdentifier;\n }",
"public function get_zone_id_from_package($package);",
"public function GetZone($zone, $country_id)\r\n {\r\n $query = $this->db->query(\"SELECT DISTINCT * FROM \" . DB_PREFIX . \"zone WHERE name = '\" . $this->db->escape($zone). \"' AND country_id = '\" . (int)($country_id). \"'\");\r\n foreach ($query->rows as $result)\r\n {\r\n return $result['zone_id'];\r\n }\r\n }",
"private static function getZoneId($domain)\n\t{\n\t\t// send an api request to get the domain zone details\n\t\t$response = self::$guzzle->request('GET', 'zones?name='.$domain);\n\n\t\t// get the json response\n\t\t$responseBody = $response->getBody();\n\n\t\t// convert the json response to an object\n\t\t$stdClassResObj = json_decode($responseBody);\n\n\t\t// extract zone info object for the root domain\n\t\t$domainInfoObj = $stdClassResObj->result[0];\t\n\n\t\treturn $domainInfoObj->id;\n\t}",
"public function getTzid()\n {\n return $this->tzid;\n }",
"public function getShippingZoneId(): ?int\n {\n return $this->shipping_zone_id;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Perform SkipJacks RuleA function. Split the data into 4 parts, 2 bytes each: W0, W1, W2, W3. | private function ruleA(&$bytes, $key, $i)
{
$w = str_split($bytes, 2);
if($this->operation() == parent::ENCRYPT)
{
/*
* Set the W3 as the old W2
* Set the W2 as the old W1
* Set the W1 as the G(W0)
* Set the W0 as the W1 xor W4 xor i
*/
$w[4] = $w[3];
$w[3] = $w[2];
$w[2] = $w[1];
$w[1] = $this->gPermutation($w[0], $key);
$hex1 = $this->str2Hex($w[1]);
$hex4 = $this->str2Hex($w[4]);
$hexi = $this->dec2Hex($i);
$w[0] = $this->xorHex($hex1, $hex4, $hexi);
$w[0] = $this->hex2Str($w[0]);
}
else // parent::DECRYPT
{
/*
* Set W4 as W0 xor W1 xor i
* Set W0 as Inverse G(W1)
* Set W1 as the old W2
* Set W2 as the old W3
* Set W3 as W4
*/
$hex0 = $this->str2Hex($w[0]);
$hex1 = $this->str2Hex($w[1]);
$hexi = $this->dec2Hex($i);
$w[4] = $this->xorHex($hex0, $hex1, $hexi);
$w[4] = $this->hex2Str($w[4]);
$w[0] = $this->gPermutation($w[1], $key);
$w[1] = $w[2];
$w[2] = $w[3];
$w[3] = $w[4];
}
// glue all the pieces back together
$bytes = $w[0].$w[1].$w[2].$w[3];
} | [
"private static function step4()\n {\n if (self::$k < 1) { return; }\n switch (self::$buffer[self::$k - 1]) {\n case 'a':\n if (self::ends(\"al\")) { break; }\n return;\n case 'c':\n if (self::ends(\"ance\")) { break; }\n if (self::ends(\"ence\")) { break; }\n return;\n case 'e':\n if (self::ends(\"er\")) break;\n return;\n case 'i':\n if (self::ends(\"ic\")) break;\n return;\n case 'l':\n if (self::ends(\"able\")) break;\n if (self::ends(\"ible\")) break;\n return;\n case 'n':\n if (self::ends(\"ant\")) break;\n if (self::ends(\"ement\")) break;\n if (self::ends(\"ment\")) break;\n if (self::ends(\"ent\")) break;\n return;\n case 'o':\n if (self::ends(\"ion\") && self::$j >= 0 &&\n (self::$buffer[self::$j] == 's' ||\n self::$buffer[self::$j] == 't')) break;\n if (self::ends(\"ou\")) break;\n return;\n /* takes care of -ous */\n case 's':\n if (self::ends(\"ism\")) break;\n return;\n case 't':\n if (self::ends(\"ate\")) break;\n if (self::ends(\"iti\")) break;\n return;\n case 'u':\n if (self::ends(\"ous\")) break;\n return;\n case 'v':\n if (self::ends(\"ive\")) break;\n return;\n case 'z':\n if (self::ends(\"ize\")) break;\n return;\n default:\n return;\n }\n if (self::m() > 1) self::$k = self::$j;\n }",
"public final function ZNNSchemaReader($challenge_packet)\n {// N2wReaders::ZZNSchemaReader();\n $c = $this->getC($challenge_packet);\n $b = $this->getB($challenge_packet);\n $a = $this->getA($challenge_packet);\n $z = \"0\";\n $ab = $a.$b;\n $bc = $b.$c;\n $words = null;\n // resolve tens\n if((int)$a ===0 && (int)$c === 0){\n $words = $this->tens[(int)$bc];\n }else if((int)$a ===0 && (int)$b === 1){\n // solve teens\n $words = $this->teens[(int)$bc];\n }else{\n // means its an ordinary two digit\n $once_words = $this->ones[(int)$c];\n $ten_words = $this->tens[(int)$b.$z];\n $words = $ten_words.\" \".$once_words;\n }\n\n return $words ;\n\n }",
"function funpack($format, $data){\n\t$pos=0;\n foreach ($format as $key => $len) {\n \tif(substr($key,0,4)!='skip')$result[$key] = trim(substr($data, $pos, $len));\n $pos+= $len;\n }\n return $result;\n}",
"public final function NNNSchemaReader($challenge_packet)\n { //N2wReaders::NNNSchemaReader();\n $c = $this->getC($challenge_packet);\n $b = $this->getB($challenge_packet);\n $a = $this->getA($challenge_packet);\n $z = \"0\";\n $words = null;\n\n // means its an ordinary two digit\n $once_words = $this->ones[(int)$c];\n $ten_words = $this->tens[(int)$b.$z];\n $hundred_words = $this->hundreds[(int)$a.$z.$z];\n $words = $hundred_words.\" and \".$ten_words.\" \".$once_words;\n\n\n\n //echo $words;\n return $words ;\n }",
"public function skipBytes($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }",
"private function step3a()\n {\n if ( ($position = $this->search(array('heid'))) !== false) {\n if ($this->inR2($position)) {\n $letter = UTF8::substr($this->word, -5, 1);\n if ($letter !== 'c') {\n $this->word = UTF8::substr($this->word, 0, $position);\n\n if ( ($position = $this->search(array('en'))) !== false) {\n if ($this->inR1($position)) {\n $word = UTF8::substr($this->word, 0, $position);\n if ($this->hasValidEnEnding($word)) {\n $this->word = $word;\n $this->unDoubling();\n }\n }\n }\n }\n }\n }\n\n }",
"function scrambleAudioData(&$data, $format)\n {\n if ($format == 'wav') {\n $start = strpos($data, 'data') + 4; // look for \"data\" indicator\n if ($start === false) $start = 44; // if not found assume 44 byte header\n } else { // mp3\n $start = 4; // 4 byte (32 bit) frame header\n }\n\n $start += rand(1, 64); // randomize starting offset\n $datalen = strlen($data) - $start - 256; // leave last 256 bytes unchanged\n\n for ($i = $start; $i < $datalen; $i += 64) {\n $ch = ord($data{$i});\n if ($ch < 9 || $ch > 119) continue;\n\n $data{$i} = chr($ch + rand(-8, 8));\n }\n }",
"protected function onSkip(Blackbox_Data $data, Blackbox_IStateData $state_data)\n\t{\n\t\t// by default, rules fail if they are skipped.\n\t\treturn FALSE;\n\t}",
"protected function scrambleAudioData(&$data, $format='mp3')\r\n\t{\r\n\t\tif ($format == 'wav') {\r\n\t\t\t$start = strpos($data, 'data') + 4; // look for \"data\" indicator\r\n\t\t\tif ($start === false) $start = 44; // if not found assume 44 byte header\r\n\t\t} else { // mp3\r\n\t\t\t$start = 4; // 4 byte (32 bit) frame header\r\n\t\t}\r\n\t\t\r\n\t\t$start += rand(1, 64); // randomize starting offset\r\n\t\t$datalen = strlen($data) - $start-256; // leave last 256 bytes unchanged\r\n\t\t\r\n\t\tfor ($i = $start; $i < $datalen; $i += 64) {\r\n\t\t\t$ch = ord($data{$i});\r\n\t\t\tif ($ch < 9 || $ch > 119) continue;\r\n\t\t\t$data{$i} = chr($ch + rand(-8, 8));\r\n\t\t}\r\n\t\t/*\r\n\t\t$step\t= 1;\r\n\t\tfor ($i = $start; $i < $datalen; $i += $step) {\r\n\t\t\t$ch = ord($data{$i});\r\n\t\t\tif ($ch == 0 || $ch == 255) continue;\r\n\t\t\t\r\n\t\t\tif ($ch < 16 || $ch > 239) {\r\n\t\t\t\t$ch += rand(-6, 6);\r\n\t\t\t} else {\r\n\t\t\t\t$ch += rand(-12, 12);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ($ch < 0) $ch = 0; else if ($ch > 255) $ch = 255;\r\n\r\n\t\t\t$data{$i} = chr($ch);\r\n\t\t\t\r\n\t\t\t$step = rand(1,4);\r\n\t\t}\r\n\t\t*/\r\n\t\treturn $data;\r\n\t}",
"protected function skip(){\n do {\n readBlock();\n } while ($blockSize > 0);\n }",
"function cards2hand($hand)\n{\n global $nums,$nums2,$nums3,$cols,$cols2;\n\n /* what is it */\n $flush='x';\n if(substr_count($hand,'s')>=5)$flush='s';\n if(substr_count($hand,'d')>=5)$flush='d';\n if(substr_count($hand,'h')>=5)$flush='h';\n if(substr_count($hand,'c')>=5)$flush='c';\n \n /* rf */\n if(substr_count($hand,'a'.$flush)\n and \n substr_count($hand,'k'.$flush)\n and \n substr_count($hand,'q'.$flush)\n and \n substr_count($hand,'j'.$flush)\n and \n substr_count($hand,'t'.$flush))\n {return 'rf';}\n \n /* sf */\n for($i=13;$i>=5;$i--)\n if(substr_count($hand,$nums2[$i ].$flush)\n and \n substr_count($hand,$nums2[$i-1].$flush)\n and \n substr_count($hand,$nums2[$i-2].$flush)\n and \n substr_count($hand,$nums2[$i-3].$flush)\n and \n substr_count($hand,$nums2[$i-4].$flush))\n {return 'sf'.$nums2[$i-0];}\n \n /* 4k */\n for($i=14;$i>1;$i--)\n if(substr_count($hand,$nums2[$i])==4)\n {\n $kicker=0;\n for($j=0;$j<strlen($hand)/2;$j++)\n {\n if($nums3[$hand[$j*2]]!=$i and $nums3[$hand[$j*2]]>$kicker)$kicker=$nums3[$hand[$j*2]];\n }\n return '4k'.$nums2[$i].$nums2[$kicker];\n }\n \n /* fh */\n for($i=14;$i>1;$i--)\n if(substr_count($hand,$nums2[$i])==3)\n {\n for($j=14;$j>1;$j--)\n {\n if($i!=$j and substr_count($hand,$nums2[$j])>=2)\n {\n return 'fh'.$nums2[$i].$nums2[$j];\n }\n }\n }\n \n /* fl */\n if($flush!='x')\n {\n $kicker1=0;\n $kicker2=0;\n $kicker3=0;\n $kicker4=0;\n $kicker5=0;\n for($j=0;$j<strlen($hand)/2;$j++)\n {\n if($nums3[$hand[$j*2]+1]==$flush)\n {\n if($nums3[$hand[$j*2]]>$kicker1)\n {\n $kicker5=$kicker4;\n $kicker4=$kicker3;\n $kicker3=$kicker2;\n $kicker2=$kicker1;\n $kicker1=$nums3[$hand[$j*2]];\n }\n else if($nums3[$hand[$j*2]]>$kicker2)\n {\n $kicker5=$kicker4;\n $kicker4=$kicker3;\n $kicker3=$kicker2;\n $kicker2=$nums3[$hand[$j*2]];\n }\n else if($nums3[$hand[$j*2]]>$kicker3)\n {\n $kicker5=$kicker4;\n $kicker4=$kicker3;\n $kicker3=$nums3[$hand[$j*2]];\n }\n else if($nums3[$hand[$j*2]]>$kicker4)\n {\n $kicker5=$kicker4;\n $kicker4=$nums3[$hand[$j*2]];\n }\n else if($nums3[$hand[$j*2]]>$kicker5)\n {\n $kicker5=$nums3[$hand[$j*2]];\n }\n }\n }\n return 'fl'.$nums2[$kicker1].$nums2[$kicker2].$nums2[$kicker3].$nums2[$kicker4].$nums2[$kicker5];\n }\n \n /* st */\n for($i=14;$i>=5;$i--)\n if(substr_count($hand,$nums2[$i ])\n and \n substr_count($hand,$nums2[$i-1])\n and \n substr_count($hand,$nums2[$i-2])\n and \n substr_count($hand,$nums2[$i-3])\n and \n substr_count($hand,$nums2[$i-4]))\n {return 'st'.$nums2[$i-0];}\n \n /* 3k */\n for($i=14;$i>1;$i--)\n if(substr_count($hand,$nums2[$i])==3)\n {\n $kicker1=0;\n $kicker2=0;\n for($j=0;$j<strlen($hand)/2;$j++)\n {\n if($nums3[$hand[$j*2]]!=$i)\n {\n if($nums3[$hand[$j*2]]>$kicker1)\n {\n $kicker2=$kicker1;\n $kicker1=$nums3[$hand[$j*2]];\n }\n else if($nums3[$hand[$j*2]]>$kicker2)\n {\n $kicker2=$nums3[$hand[$j*2]];\n }\n }\n }\n return '3k'.$nums2[$i].$nums2[$kicker1].$nums2[$kicker2];\n }\n\n /* 2p */\n for($i=14;$i>1;$i--)\n if(substr_count($hand,$nums2[$i])==2)\n {\n for($j=14;$j>1;$j--)\n {\n if($i!=$j and substr_count($hand,$nums2[$j])==2)\n {\n $kicker=0;\n for($k=0;$k<strlen($hand)/2;$k++)\n {\n if($nums3[$hand[$k*2]]!=$i and $nums3[$hand[$k*2]]!=$j and $nums3[$hand[$k*2]]>$kicker)$kicker=$nums3[$hand[$k*2]];\n }\n return '2p'.$nums2[$i].$nums2[$j].$nums2[$kicker];\n }\n }\n }\n\n /* 2k */\n for($i=14;$i>1;$i--)\n if(substr_count($hand,$nums2[$i])==2)\n {\n $kicker1=0;\n $kicker2=0;\n $kicker3=0;\n for($j=0;$j<strlen($hand)/2;$j++)\n {\n if($nums3[$hand[$j*2]]!=$i)\n {\n if($nums3[$hand[$j*2]]>$kicker1)\n {\n $kicker3=$kicker2;\n $kicker2=$kicker1;\n $kicker1=$nums3[$hand[$j*2]];\n }\n else if($nums3[$hand[$j*2]]>$kicker2)\n {\n $kicker3=$kicker2;\n $kicker2=$nums3[$hand[$j*2]];\n }\n else if($nums3[$hand[$j*2]]>$kicker3)\n {\n $kicker3=$nums3[$hand[$j*2]];\n }\n }\n }\n return '2k'.$nums2[$i].$nums2[$kicker1].$nums2[$kicker2].$nums2[$kicker3];\n }\n \n /* hc */\n $kicker1=0;\n $kicker2=0;\n $kicker3=0;\n $kicker4=0;\n $kicker5=0;\n for($j=0;$j<strlen($hand)/2;$j++)\n {\n if($nums3[$hand[$j*2]]>$kicker1)\n {\n $kicker5=$kicker4;\n $kicker4=$kicker3;\n $kicker3=$kicker2;\n $kicker2=$kicker1;\n $kicker1=$nums3[$hand[$j*2]];\n }\n else if($nums3[$hand[$j*2]]>$kicker2)\n {\n $kicker5=$kicker4;\n $kicker4=$kicker3;\n $kicker3=$kicker2;\n $kicker2=$nums3[$hand[$j*2]];\n }\n else if($nums3[$hand[$j*2]]>$kicker3)\n {\n $kicker5=$kicker4;\n $kicker4=$kicker3;\n $kicker3=$nums3[$hand[$j*2]];\n }\n else if($nums3[$hand[$j*2]]>$kicker4)\n {\n $kicker5=$kicker4;\n $kicker4=$nums3[$hand[$j*2]];\n }\n else if($nums3[$hand[$j*2]]>$kicker5)\n {\n $kicker5=$nums3[$hand[$j*2]];\n }\n }\n return 'hc'.$nums2[$kicker1].$nums2[$kicker2].$nums2[$kicker3].$nums2[$kicker4].$nums2[$kicker5];\n}",
"private static function split3($a) {\n $a = (string)$a;\n $pre = array(\"\", \"\", \"\");\n for ($i = strlen($a) - 1; $i >= 0; $i--) {\n if (is_numeric($a[$i])) {\n if (strlen($pre[0]) > 0)\n $pre[0] = $a[$i] . $pre[0];\n else\n $pre[1] = $a[$i] . $pre[1];\n }\n else {\n if (strlen($pre[1]) > 0)\n $pre[0] = $a[$i] . $pre[0];\n else\n $pre[2] = $a[$i] . $pre[2];\n }\n }\n return $pre;\n }",
"private static function step3()\n {\n switch (self::$buffer[self::$k]) {\n case 'e':\n if (self::ends(\"icate\")) { self::r(\"ic\"); break; }\n if (self::ends(\"ative\")) { self::r(\"\"); break; }\n if (self::ends(\"alize\")) { self::r(\"al\"); break; }\n break;\n case 'i':\n if (self::ends(\"iciti\")) { self::r(\"ic\"); break; }\n break;\n case 'l':\n if (self::ends(\"ical\")) { self::r(\"ic\"); break; }\n if (self::ends(\"ful\")) { self::r(\"\"); break; }\n break;\n case 's':\n if (self::ends(\"ness\")) { self::r(\"\"); break; }\n break;\n }\n }",
"public function skipEmptyLines(): void\n {\n if (preg_match('/(?:\\s*+)++/A', $this->data, $match, 0, $this->cursor)) {\n $this->moveCursor($match[0]);\n }\n }",
"function rm_mplex() {\n\tglobal $fp;\n\t$header = ord(fgetc($fp)); \t//we read first the header byte\n\t$flag = $header & 0x07;\t\t//right 3 bits are flag\n\t$id = $header >> 3;\t\t//left 5 bits are ID\n\n\t$len = ord(fgetc($fp));\t\t//length is next byte\n\t$data = fread($fp, $len);\t//we read that much bytes\n\n\treturn array('id' => $id, 'flag' => $flag, 'data' => $data); //we return an array with ID, flag, data\n}",
"private function splitData($data)\n\t{\n\t\t$length = strlen($data);\n\t\t$chains = [];\n\n\t\tfor ($i = 0; $i < $length; $i++) {\n\n\t\t\t$e = $this->getEncoder($data[$i], $i);\n\t\t\t$chain = $data[$i];\n\t\t\t$end = false;\n\n\t\t\twhile($this->encoders[$e]->canEncode($data[$i])){\n\t\t\t\t$i++;\n\t\t\t\tif (isset($data[$i])){\n\t\t\t\t\t$chain .= $data[$i];\n\t\t\t\t} else {\n\t\t\t\t\t$end = TRUE;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!$end){\n\t\t\t\t$chain = substr($chain, 0, -1);\n\t\t\t\t$i--;\n\t\t\t}\n\t\t\t$chains[] = [$chain, $e];\n\t\t}\n\n\t\treturn $chains;\n\t}",
"function PacketLOOP2ToData($p) {\n\t\t$str =\"Ch1/Ch2/Ch3/CBarTrend/CPacketType/vUnused1/\";\n\t\t$str.=\"vBarometer/vInsideTemperature/CInsideHumidity/vOutsideTemperature/CWindSpeed/CUnused2/vWindDirection/\";\n\t\t$str.=\"vWindSpeed10MinutesAvg/vWindSpeed2MinutesAvg/vWindGust10MinutesAvg/vWindGust10MinutesDirectionAvg/sUnused3/sUnused4/\";\n\t\t$str.=\"sDewPoint/CUnused5/COutsideHumidity/CUnused6/sHeatIndex/sWindChill/sTHSWIndex/vRainRate/cUV/vSolarRadiation/vStormRain/vStartDateofcurrentStorm/\";\n\t\t$str.=\"vDailyRain/vLast15minRain/vLastHourRain/vDailyET/vLast24HourRain/CBarometricReductionMethod/sUserEnteredBarometricOffset/sBarometricCalibrationNumber/sBarometricSensorRawReading/sAbsoluteBarometricPressure/sAltimeterSetting/CUnused7/CUnused8/\";\n\t\t$str.=\"CNext10minWindSpeedGraphPointer/CNext15minWindSpeedGraphPointer/CNextHourlyWindSpeedGraphPointer/CNextDailyWindSpeedGraphPointer/CNextMinuteRainGraphPointer/CNextRainStormGraphPointer/CIndextotheMinutewithinanHour/CNextMonthlyRain/CNextYearlyRain/CNextSeasonalRain/\";\n\t\t$str.=\"v6UnusedBlock/CLF/CCR/vCRC\";\n\n\t\t$ret = unpack($str, $p);\n\t\treturn $ret;\n\t\t}",
"function getnoaafile ($filename,$year,$m) {\r\n global $SITE; \r\n $rawdata = array();\r\n if (file_exists($filename)) { \r\n $fd = @fopen($filename,'r');\r\n $i = 0;\r\n $startdt = 0;\r\n if ( $fd ) {\r\n \r\n while ( !feof($fd) ) { \r\n \r\n // Get one line of data\r\n $gotdat = trim ( fgets($fd,8192) );\r\n $i++ ;\r\n if ($startdt == 1 ) {\r\n if ( strpos ($gotdat, \"--------------\" ) !== FALSE ){\r\n if ($i != ($first_dash_line+1)){\r\n $startdt = 2;\r\n } \r\n } else {\r\n $gotdat = str_replace(\",\",\".\",$gotdat); \r\n $foundline = preg_split(\"/[\\n\\r\\t ]+/\", $gotdat ); \r\n $rawdata[intval ($foundline[0]) -1 ] = $foundline;\r\n }\r\n }\r\n \r\n if ($startdt == 0 ) {\r\n if ( strpos ($gotdat, \"--------------\" ) !== FALSE ){\r\n $startdt = 1;\r\n $first_dash_line = $i;\r\n } \r\n }\r\n }\r\n // Close the file we are done getting data\r\n fclose($fd);\r\n }\r\n }\r\n $rawdata = check_for_overrides($year,$m,$rawdata,'noaa','');\r\n return($rawdata);\r\n}",
"private static function step1ab()\n {\n if (self::$buffer[self::$k] == 's') {\n if (self::ends(\"sses\")) {\n self::$k -= 2;\n } else if (self::ends(\"ies\")) {\n self::setto(\"i\");\n } else if (self::$buffer[self::$k - 1] != 's') {\n self::$k--;\n }\n }\n if (self::ends(\"eed\")) {\n if (self::m() > 0) self::$k--;\n } else if ((self::ends(\"ed\") || self::ends(\"ing\")) &&\n self::vowelinstem()) {\n self::$k = self::$j;\n if (self::ends(\"at\")) {\n self::setto(\"ate\");\n } else if (self::ends(\"bl\")) {\n self::setto(\"ble\");\n } else if (self::ends(\"iz\")) {\n self::setto(\"ize\");\n } else if (self::doublec(self::$k)) {\n self::$k--;\n $ch = self::$buffer[self::$k];\n if ($ch == 'l' || $ch == 's' || $ch == 'z') self::$k++;\n } else if (self::m() == 1 && self::cvc(self::$k)) {\n self::setto(\"e\");\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get stories from a task | public function getStoriesForTask($task_gid, $params = array(), $options = array()) {
$path = "/tasks/{task_gid}/stories";
$path = str_replace("{task_gid}", $task_gid, $path);
return $this->client->getCollection($path, $params, $options);
} | [
"public function get_stories() {\n \n /* this is NOT the way to this, this is just simulating pulling all the\n stories from the database. This is where you normally write your db query*/\n\n // put all stories in a single array to fake getting them from a database\n $stories = [$this->story1, $this->story2, $this->story3];\n \n // send the stories array of arrays back to the controller\n return $stories;\n }",
"private function _fetch()\n {\n if (is_null($this->_story)) {\n $this->_story = $GLOBALS['injector']->getInstance('Jonah_Driver')->getStory(\n $this->_params['source'],\n $this->_params['story'],\n !empty($this->_params['countReads']));\n }\n\n return $this->_story;\n }",
"public function get_story()\n {\n return $this->thread->get_story();\n }",
"public function get_stories() {\n global $wpdb;\n\n $stories = $wpdb->get_results(\n \t\t\"select ID, post_title, post_name from \" . $wpdb->posts . \" \" .\n \t \t\"where post_type = 'agilepress-stories' and post_status = 'publish' \" .\n \t\t\"order by post_name\");\n\n if (!$stories) {\n $stories = \"\";\n }\n\n return $stories;\n }",
"public function getStory(){\n\t\treturn $this->__get('story');\n\t}",
"function psc_get_story($id) {\n\tglobal $wpdb, $psc;\n\t$query = 'SELECT * FROM '.$psc->data.' WHERE id = '.$id;\n\t\n\treturn $wpdb->get_results($query);\n}",
"public function get_ask_stories_ids() {\n\n\t\t\t$client = new GuzzleHttp\\Client();\n\n\t\t\t$res = $client->get($this->endpoint.'askstories.json');\n\n\t\t\t$data = $res->json();\n\n\t\t\treturn $data;\n\t\t}",
"public function getAllStories()\n {\n return Story::all();\n }",
"public function getTasks();",
"public function getStory()\n {\n return $this->story;\n }",
"public function get_stories(): array {\n\t\t$stories_query = new WP_Query();\n\n\t\t/**\n\t\t * List of story posts.\n\t\t *\n\t\t * @var WP_Post[] $result\n\t\t */\n\t\t$result = $stories_query->query( $this->query_args );\n\n\t\tupdate_post_thumbnail_cache( $stories_query );\n\n\t\treturn $result;\n\t}",
"Public function getStory(){\n\t\t\n\t\t$xpath = new DOMXPath($this->doc);\t\n\t\t\n\t\t$stories = $this->doc->getElementsByTagName('p');\t\t\n\t\t$stories_arr = array ();\n\t\t\n\t\tforeach ($stories as $story){\n\t\t\t$stories_arr[] = $story->nodeValue;\n\t\t}\n\t\t\n\t\tforeach ($xpath->query('//div[@class=\"zn-body__paragraph\"]') as $div){\n\t\t\t$stories_arr[] = $div->textContent;\n\t\t}\n\t\tif ($stories_arr){\t\t\n\t\t\treturn $stories_arr;\n\t\t}\n\t\telse{\n\t\t\treturn \"Not story content found.\";\n\t\t}\n\t}",
"public function getTask($task_id);",
"public function getStories($project, $filter = '') {\n\n\t\t\t// Encode the filter\n\t\t\t$filter = urlencode($filter);\n\n\t\t\t// Make the fields safe\n\t\t\t$filter = escapeshellcmd($filter);\n\t\t\t$project = escapeshellcmd($project);\n\n\t\t\t// Request the stories\n\t\t\t$cmd = \"curl -H \\\"X-TrackerToken: {$this->token}\\\" \"\n\t\t\t\t . \"-X GET \"\n\t\t\t\t . \"https://www.pivotaltracker.com/services/v3/projects/$project/stories\";\n\t\t\t// Add the filter, if it was specified\n\t\t\tif ($filter != '') $cmd .= \"?filter=$filter\";\n\t\t\t$xml = shell_exec($cmd);\n\t\t\t\n\t\t\t// Return an object\n\t\t\t$story = new SimpleXMLElement($xml);\n\t\t\treturn $story;\n\t\n\t\t}",
"function wmf_get_page_stories() {\n\t// See the \"Stories\" field for how this data gets set.\n\t$stories = get_post_meta( get_the_ID(), 'stories', true );\n\t$story_ids = $stories['stories_list'] ?? [];\n\n\tif ( empty( $story_ids ) ) {\n\t\treturn [];\n\t}\n\n\t$stories = get_posts(\n\t\tarray(\n\t\t\t'post_type' => 'story',\n\t\t\t'post_status' => 'publish',\n\t\t\t'post__in' => $story_ids,\n\t\t\t'posts_per_page' => count( $story_ids ),\n\t\t\t'suppress_filters' => false,\n\t\t)\n\t);\n\n\treturn $stories;\n}",
"public function getTask(array $task);",
"public function getTaskList();",
"public function getTasklist();",
"static function stories() {\r\n $query = 'SELECT short_title AS \"title\", slug FROM Story ORDER BY storyid';\r\n $db = new DB();\r\n $params = array(array());\r\n $result = $db->run($query, $params);\r\n $db->close();\r\n return $result;\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if application charge is accepted | public function checkApplicationCharge()
{
Log::debug('ShopifyApi.checkApplicationCharge');
$status = 'do not know';
$activated_on = null;
$shopId = $this->shopifyHelper->getShopId('ShopifyApi.checkApplicationCharge');
$appChargeDB = ApplicationCharge::whereRaw('shop_id = ?', array($shopId))->get()->first();
if ($appChargeDB != null) {
$charge_id = $appChargeDB->charge_id;
$statusDB = $appChargeDB->status;
Log::debug("ShopifyApi.checkApplicationCharge for shopId=$shopId, charge_id=$charge_id, statusDB=$statusDB");
$url = "/admin/recurring_application_charges/$charge_id.json";
// shopify call
$appCharge = $this->call('GET', $url);
Log::debug("ShopifyApi.checkApplicationCharge shopify result = " . json_encode($appCharge));
// $appCharge = $result['recurring_application_charge'];
$status = $appCharge['status'];
$activated_on = $appCharge['activated_on'];
$cancelled_on = $appCharge['cancelled_on'];
Log::debug("ShopifyApi.checkApplicationCharge for shopId=$shopId, charge_id=$charge_id, status=$status, activated_on=$activated_on, cancelled_on=$cancelled_on");
// update DB
$appChargeDB->status = $status;
$appChargeDB->activated_on = $activated_on;
$appChargeDB->cancelled_on = $cancelled_on;
$appChargeDB->save();
}
return $status;
} | [
"public function isAgbAccepted() {\n\t\t$this->getAgbAccepted();\n\t}",
"private function _checkRatePAY()\n {\n return $this->_checkCurrency() && $this->_checkCountry() && !$this->_checkDenied() && $this->_checkAge();\n }",
"function check_autopay_capable()\n\t{\n\t\tlog_write(\"debug\", \"invoice_autopay\", \"Executing check_autopay_capable()\");\n\n\n\t\t// fetch customer/vendor information\n\t\tif ($this->type_invoice == \"ap\")\n\t\t{\n\t\t\t$this->id_org\t= sql_get_singlevalue(\"SELECT vendorid as value FROM account_ar WHERE id='\". $this->id_invoice .\"' LIMIT 1\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->id_org\t= sql_get_singlevalue(\"SELECT customerid as value FROM account_ar WHERE id='\". $this->id_invoice .\"' LIMIT 1\");\n\t\t}\n\n\n\t\t// check credit pool\n\t\tif ($this->type_invoice == \"ap\")\n\t\t{\n\t\t\t$credit = sql_get_singlevalue(\"SELECT SUM(amount_total) as value FROM vendors_credits WHERE id_vendor='\". $this->id_org .\"' LIMIT 1\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$credit = sql_get_singlevalue(\"SELECT SUM(amount_total) as value FROM customers_credits WHERE id_customer='\". $this->id_org .\"' LIMIT 1\");\n\t\t}\n\n\t\tif ($credit > 0)\n\t\t{\n\t\t\tlog_write(\"debug\", \"invoice_autopay\", \"There is credit ($credit) available for autopayments\");\n\n\t\t\t$this->capable = 1;\n\t\t\treturn 1;\n\t\t}\n\n\n\t\t// no autopayment sources\n\t\treturn 0;\n\n\t}",
"public function canBuy(){\r\n $cur_time = self::currentServerTime();\r\n if(\r\n ($this->status == 20 || $this->status == 30)\r\n && ($this->start_time < $cur_time)\r\n && ($this->end_time > $cur_time)\r\n && ($this->current_sold < $this->max_sold)\r\n && ($this->is_delete = 0)\r\n && ($this->stop = 0)\r\n && ($this->published == 20)\r\n ){\r\n return true;\r\n }\r\n return false;\r\n }",
"public function canBeGranted(): bool\n {\n return\n $this->isUnderConsideration()\n && $this->licence->isValid()\n && (string)$this->getBusinessProcess() === RefData::BUSINESS_PROCESS_APGG;\n }",
"public function isAwaitingConfirmation() {\n if(isset($this->data['charge']))\n return $this->data['charge']['status'] === 'successful' ? false : true;\n else\n return true;\n }",
"function isPaymentPending(): bool;",
"public function paymentCheck(){\n\t\treturn true;\n\t}",
"public function shouldAcceptLicense()\n {\n return !Config::get('licenseAccepted');\n }",
"protected function has_valid_premium_subscription()\n {\n }",
"function Is_Service_Charge_Payment($event)\n{\n\tif(in_array($event->context, array('generated', 'arrange_next')))\n\t{\n\t\tforeach($event->amounts as $ea)\n\t\t{\n\t\t\tif($ea->event_amount_type == 'service_charge' && $ea->amount < 0)\n\t\t\t\treturn TRUE;\n\t \t}\n\t}\n\treturn FALSE;\n}",
"public function isServiceAvailable()\n {\n return $this->client->cardPaymentService()->monitor();\n }",
"public function confirmPayment(): bool;",
"public function needsPayment()\n {\n return $this->getBalance()->isPositive();\n }",
"function purchase_request_valid($code)\n{\t#if ($purchase_details['customer_code'] ... )\n\t\n\t#Is the IP address of our customer the same as Backup Machine saw? \n\t#This could be considered sufficient to say that the customer is logged in.\n\t#They are paying for this customer's purchase, so they have little to gain from this...\n\t\n\t$envip = $_SERVER['REMOTE_ADDR'];\n\tif ($purchase_details['client_ip'] != $client_ip)\n\t{\n\t\t#TODO: Log that this failed for debug purposes\n\t\treturn False;\n\t}\n\t\n\treturn True;\n}",
"public function isAccepted()\n {\n return $this->status === 'accepted';\n }",
"public function accepted()\n {\n return $this->status() === 202;\n }",
"public function paymentRequired()\n {\n return $this->status() === 402;\n }",
"public function testAcceptPaymentDispute()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the value of paymentEngine | public function setPaymentEngine($paymentEngine)
{
$this->paymentEngine = $paymentEngine;
return $this;
} | [
"private function set_payment_data()\n {\n $this->payment_data = [\n \"paymentType\" => $this->order->get_payment_method(),\n \"priceCOD\" => 0.0,\n ];\n }",
"public function setPaymentMethod($value) \n {\n $this->_fields['PaymentMethod']['FieldValue'] = $value;\n return;\n }",
"public function setObject(Wpjb_Model_Payment $payment)\n {\n $this->_data = $payment;\n }",
"public function setPayment(Payment $payment)\n {\n $this->payment = $payment;\n }",
"protected function setAmount($value){\r\n }",
"protected function setEngine(): void\n {\n $this->engine = null;\n\n $candidateEngines = [\n self::ENGINE_LIBSODIUM,\n self::ENGINE_OPENSSL_GCM,\n self::ENGINE_OPENSSL,\n self::ENGINE_EVAL,\n ];\n if (isset($this->preferredEngine)) {\n $temp = [$this->preferredEngine];\n $candidateEngines = array_merge(\n $temp,\n array_diff($candidateEngines, $temp)\n );\n }\n foreach ($candidateEngines as $engine) {\n if ($this->isValidEngineHelper($engine)) {\n $this->engine = $engine;\n break;\n }\n }\n if (!$this->engine) {\n $this->engine = self::ENGINE_INTERNAL;\n }\n\n $this->changed = $this->nonIVChanged = true;\n }",
"public function onBeforePayment() {\n\t\tif ($currency = Session::get('SWS.Currency')) {\n\n\t\t\t//Get the exchange rate, alter the amount\n\t\t\t$rate = ExchangeRate::get()\n\t\t\t\t->where(\"\\\"Currency\\\" = '$currency'\")\n\t\t\t\t->limit(1)\n\t\t\t\t->first();\n\n\t\t\tif ($rate && $rate->exists()) {\n\t\t\t\t$this->owner->Currency = $rate->Currency;\n\t\t\t\t$this->owner->CurrencySymbol = $rate->CurrencySymbol;\n\t\t\t\t$this->owner->ExchangeRate = $rate->Rate;\n\t\t\t}\n\t\t}\n\t\telse { //Currency has not been set in the session, assume base currency\n\t\t\t$shopConfig = ShopConfig::current_shop_config();\n\n\t\t\t$this->owner->Currency = $shopConfig->BaseCurrency;\n\t\t\t$this->owner->CurrencySymbol = $shopConfig->BaseCurrencySymbol;\n\t\t\t$this->owner->ExchangeRate = 1.0; //1 to 1 exchange rate\n\t\t}\n\t\t$this->owner->write();\n\t}",
"public function setPaymentProvider(PaymentProvider $paymentProvider)\n {\n $this->paymentProvider = $paymentProvider;\n }",
"function setAmount($amount);",
"protected function setPaymentMethod()\n {\n $payment = $this->quote->getPayment();\n $payment->setMethod(Paypal::PAYMENT_METHOD_CODE);\n $this->quote->setPayment($payment);\n }",
"protected function setOfferValue ()\n {\n $this->request->coupon_benefits[ $this->offerNature ] = $this->offer->rate;\n }",
"public function setEngine($engine)\n {\n $this->engine = $engine;\n }",
"protected function setPaymenttoken($paymentToken) {\n $this->paymentToken = $paymentToken;\n }",
"public function setPaymentData($value)\n {\n return $this->getCustomer()->setPaymentData($value);\n }",
"public function setPaymentResponse($paymentResponse)\n {\n\n Logger::getInstance()->info(\"Setting Payment Response...\");\n //Get Plain Text\n $plainText = $this->decrypt($paymentResponse);\n //Set Plain Text to extract values from plain text\n $this->setXMLResponse($plainText);\n }",
"public function setPaymentData(string $key, $value)\n {\n $this->paymentData[$key] = $value;\n }",
"public function setPaymentIDAttribute($value) {\n $this->attributes['payment_id'] = $value;\n }",
"function set_engine( $engine ) {\n\t\t$this->engine = $engine;\n\t}",
"public function setPaymentOffer(?string $paymentOffer);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all EventGuestLists by homeowner id filter by event end date | public function getNotificationsEventGuestList($homeOwnerId); | [
"public function load_team_events()\n {\n $where_statement =\n \"WHERE owner_id=?ORDER BY start_datetime ASC\";\n return $this->list_load( $where_statement );\n }",
"function getEventList(&$calendar, $start_date, $end_date, $info = '') {\n\tglobal $adb, $current_user, $mod_strings, $app_strings, $cal_log, $theme, $currentModule;\n\t$list_max_entries_per_page = GlobalVariable::getVariable('Application_ListView_PageSize', 20, $currentModule);\n\t$listview_max_textlength = GlobalVariable::getVariable('Application_ListView_Max_Text_Length', 40, $currentModule);\n\t$Entries = array();\n\t$userprivs = $current_user->getPrivileges();\n\t$cal_log->debug('> getEventList');\n\n\t$and = \"AND ((((dtstart >= ? AND dtstart <= ?) OR (dtend >= ? AND dtend <= ?) OR (dtstart <= ? AND dtend >= ?)) AND vtiger_recurringevents.activityid is NULL)\n\t\tOR\n\t\t(\n\t\t\t(CAST(CONCAT(vtiger_recurringevents.recurringdate,' ',time_start) AS DATETIME) >= ?\n\t\t\t\tAND CAST(CONCAT(vtiger_recurringevents.recurringdate,' ',time_start) AS DATETIME) <= ?)\n\t\t\tOR (dtend >= ? AND dtend <= ?) OR (CAST(CONCAT(vtiger_recurringevents.recurringdate,' ',time_start) AS DATETIME) <= ? AND dtend >= ?)\n\t\t)\n\t)\";\n\t$crmEntityTable = CRMEntity::getcrmEntityTableAlias('cbCalendar');\n\t$query = \"SELECT vtiger_groups.groupname, vtiger_users.ename as user_name,vtiger_crmentity.smownerid, vtiger_crmentity.crmid,vtiger_activity.*\n\t\tFROM vtiger_activity\n\t\tINNER JOIN \".$crmEntityTable.\" ON vtiger_crmentity.crmid = vtiger_activity.activityid\n\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\tLEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid\n\t\tLEFT OUTER JOIN vtiger_recurringevents ON vtiger_recurringevents.activityid = vtiger_activity.activityid\n\t\tWHERE vtiger_crmentity.deleted = 0 AND vtiger_activity.activitytype != 'Emails' $and \";\n\n\t$list_query = $query.' AND vtiger_crmentity.smownerid = ' . $current_user->id;\n\n\t$query_filter_prefix = calendarview_getSelectedUserFilterQuerySuffix();\n\t$query .= $query_filter_prefix;\n\n\t$startDate = new DateTimeField($start_date.' 00:00');\n\t$endDate = new DateTimeField($end_date. ' 23:59');\n\t$params = $info_params = array(\n\t\t$startDate->getDBInsertDateTimeValue(), $endDate->getDBInsertDateTimeValue(),\n\t\t$startDate->getDBInsertDateTimeValue(), $endDate->getDBInsertDateTimeValue(),\n\t\t$startDate->getDBInsertDateTimeValue(), $endDate->getDBInsertDateTimeValue(),\n\t\t$startDate->getDBInsertDateTimeValue(), $endDate->getDBInsertDateTimeValue(),\n\t\t$startDate->getDBInsertDateTimeValue(), $endDate->getDBInsertDateTimeValue(),\n\t\t$startDate->getDBInsertDateTimeValue(), $endDate->getDBInsertDateTimeValue()\n\t);\n\tif ($info != '') {\n\t\t$groupids = explode(',', fetchUserGroupids($current_user->id)); // Explode can be removed, once implode is removed from fetchUserGroupids\n\t\tif (count($groupids) > 0) {\n\t\t\t$com_q = ' AND (vtiger_crmentity.smownerid = ? OR vtiger_groups.groupid in ('. generateQuestionMarks($groupids) .')) GROUP BY vtiger_activity.activityid';\n\t\t} else {\n\t\t\t$com_q = ' AND vtiger_crmentity.smownerid = ? GROUP BY vtiger_activity.activityid';\n\t\t}\n\n\t\t$pending_query = $query.\" AND (vtiger_activity.eventstatus = 'Planned')\".$com_q;\n\t\t$total_q = $query.$com_q;\n\t\t$info_params[] = $current_user->id;\n\n\t\tif (count($groupids) > 0) {\n\t\t\t$info_params[] = $groupids;\n\t\t}\n\n\t\t$total_res = $adb->pquery($total_q, $info_params);\n\t\t$total = $adb->num_rows($total_res);\n\n\t\t$res = $adb->pquery($pending_query, $info_params);\n\t\t$pending_rows = $adb->num_rows($res);\n\t\t$cal_log->debug('< getEventList');\n\t\treturn array('totalevent'=>$total,'pendingevent'=>$pending_rows);\n\t}\n\tif (!$userprivs->hasGlobalReadPermission() && !$userprivs->hasModuleReadSharing(getTabid('cbCalendar'))) {\n\t\t$sec_parameter=getCalendarViewSecurityParameter();\n\t\t$query .= $sec_parameter;\n\t}\n\t$group_cond = ' GROUP BY vtiger_activity.activityid ORDER BY vtiger_activity.date_start,vtiger_activity.time_start ASC';\n\n\tif (GlobalVariable::getVariable('Application_ListView_Compute_Page_Count', 0)) {\n\t\t$count_result = $adb->pquery(mkCountQuery($query), $params);\n\t\t$noofrows = $adb->query_result($count_result, 0, 'count');\n\t} else {\n\t\t$noofrows = null;\n\t}\n\t$queryMode = (isset($_REQUEST['query']) && $_REQUEST['query'] == 'true');\n\t//$viewid is used as a key for cache query and other info so pass the dates as viewid\n\t$viewid = $start_date.$end_date;\n\t$start = ListViewSession::getRequestCurrentPage($currentModule, $adb->convert2sql($query, $params), $viewid, $queryMode);\n\n\t$navigation_array = VT_getSimpleNavigationValues($start, $list_max_entries_per_page, $noofrows);\n\n\t$start_rec = ($start-1) * $list_max_entries_per_page;\n\t$end_rec = $navigation_array['end_val'];\n\n\t$list_query = $adb->convert2Sql($query, $params);\n\t$_SESSION['Calendar_listquery'] = $list_query;\n\n\tif ($start_rec < 0) {\n\t\t$start_rec = 0;\n\t}\n\t$query .= $group_cond.\" limit $start_rec,$list_max_entries_per_page\";\n\n\t$result = $adb->pquery($query, $params);\n\t$rows = $adb->num_rows($result);\n\t$c = 0;\n\tif ($start > 1) {\n\t\t$c = ($start-1) * $list_max_entries_per_page;\n\t}\n\tfor ($i=0; $i<$rows; $i++) {\n\t\t$element = array();\n\t\t$element['no'] = $c+1;\n\t\t$image_tag = '';\n\t\t$contact_data = '';\n\t\t$more_link = '';\n\t\t$start_time = $adb->query_result($result, $i, 'time_start');\n\t\t$end_time = $adb->query_result($result, $i, 'time_end');\n\t\t$date_start = $adb->query_result($result, $i, 'date_start');\n\t\t$due_date = $adb->query_result($result, $i, 'due_date');\n\t\t$date = new DateTimeField($date_start.' '.$start_time);\n\t\t$endDate = new DateTimeField($due_date.' '.$end_time);\n\t\tif (!empty($start_time)) {\n\t\t\t$start_time = $date->getDisplayTime();\n\t\t}\n\t\tif (!empty($end_time)) {\n\t\t\t$end_time = $endDate->getDisplayTime();\n\t\t}\n\t\t$format = $calendar['calendar']->hour_format;\n\t\t$value = getaddEventPopupTime($start_time, $end_time, $format);\n\t\t$start_hour = $value['starthour'].':'.$value['startmin'].''.$value['startfmt'];\n\t\t$end_hour = $value['endhour'] .':'.$value['endmin'].''.$value['endfmt'];\n\t\t$element['starttime'] = $date->getDisplayDate().' '.$start_hour;\n\t\t$element['endtime'] = $endDate->getDisplayDate().' '.$end_hour;\n\t\t$contact_id = $adb->query_result($result, $i, 'contactid');\n\t\t$id = $adb->query_result($result, $i, 'activityid');\n\t\t$subject = $adb->query_result($result, $i, 'subject');\n\t\t$eventstatus = $adb->query_result($result, $i, 'eventstatus');\n\t\t$assignedto = $adb->query_result($result, $i, 'user_name');\n\t\t$userid = $adb->query_result($result, $i, 'smownerid');\n\t\t$idShared = 'normal';\n\t\tif (!empty($assignedto) && $userid != $current_user->id && $adb->query_result($result, $i, 'visibility') == 'Public') {\n\t\t\t$row = $adb->pquery('select * from vtiger_sharedcalendar where sharedid=? and userid=?', array($current_user->id, $userid));\n\t\t\t$no = $adb->getRowCount($row);\n\t\t\tif ($no > 0) {\n\t\t\t\t$idShared = 'shared';\n\t\t\t} else {\n\t\t\t\t$idShared = 'normal';\n\t\t\t}\n\t\t}\n\t\tif ($listview_max_textlength && (strlen($subject) > $listview_max_textlength)) {\n\t\t\t$subject = substr($subject, 0, $listview_max_textlength).'...';\n\t\t}\n\t\tif ($contact_id != '') {\n\t\t\t$displayValueArray = getEntityName('Contacts', $contact_id);\n\t\t\tif (!empty($displayValueArray)) {\n\t\t\t\tforeach ($displayValueArray as $field_value) {\n\t\t\t\t\t$contactname = $field_value;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$contact_data = '<b>'.$contactname.'</b>,';\n\t\t}\n\t\t$more_link = \"<a href='index.php?action=DetailView&module=cbCalendar&record=\".$id.\"&activity_mode=Events&viewtype=calendar' class='webMnu'>[\"\n\t\t\t.$mod_strings['LBL_MORE'].'...]</a>';\n\t\t$type = $adb->query_result($result, $i, 'activitytype');\n\t\tif ($type == 'Call') {\n\t\t\t$image_tag = \"<img src='\" . vtiger_imageurl('Calls.gif', $theme). \"' align='middle'> \".$app_strings['Call'];\n\t\t} elseif ($type == 'Meeting') {\n\t\t\t$image_tag = \"<img src='\" . vtiger_imageurl('Meetings.gif', $theme). \"' align='middle'> \".$app_strings['Meeting'];\n\t\t} else {\n\t\t\t$image_tag = ' '.getTranslatedString($type);\n\t\t}\n\t\t$element['eventtype'] = $image_tag;\n\t\t$element['eventdetail'] = $contact_data.' '.$subject.' '.$more_link;\n\t\tif ($idShared == 'normal') {\n\t\t\tif (isPermitted('cbCalendar', 'EditView') == 'yes' || isPermitted('cbCalendar', 'Delete') == 'yes') {\n\t\t\t\t$element['action'] = \"<img onClick='getcalAction(this,\\\"eventcalAction\\\",\".$id.',\"'.$calendar['view'].'\",\"'.$calendar['calendar']->date_time->hour.'\",\"'\n\t\t\t\t\t.$calendar['calendar']->date_time->get_DB_formatted_date().\"\\\",\\\"event\\\");' src='\" . vtiger_imageurl('cal_event.jpg', $theme). \"' border='0'>\";\n\t\t\t}\n\t\t} else {\n\t\t\tif (isPermitted('cbCalendar', 'EditView') == 'yes' || isPermitted('cbCalendar', 'Delete') == 'yes') {\n\t\t\t\t$element['action']=\"<img onClick=\\\"alert('\".$mod_strings[\"SHARED_EVENT_DEL_MSG\"].\"')\\\"; src='\" . vtiger_imageurl('cal_event.jpg', $theme). \"' border='0'>\";\n\t\t\t}\n\t\t}\n\t\tif (getFieldVisibilityPermission('Events', $current_user->id, 'eventstatus') == '0') {\n\t\t\tif (!is_admin($current_user) && $eventstatus != '') {\n\t\t\t\t$roleid=$current_user->roleid;\n\t\t\t\t$roleids = array();\n\t\t\t\t$subrole = getRoleSubordinates($roleid);\n\t\t\t\tif (count($subrole)> 0) {\n\t\t\t\t\t$roleids = $subrole;\n\t\t\t\t}\n\t\t\t\t$roleids[] = $roleid;\n\n\t\t\t\t// check if the table contains the sortorder column .If present in the main picklist table, then the role2picklist will be applicable for this table\n\t\t\t\t$res = $adb->pquery('select * from vtiger_eventstatus where eventstatus=?', array(decode_html($eventstatus)));\n\t\t\t\t$picklistvalueid = $adb->query_result($res, 0, 'picklist_valueid');\n\t\t\t\tif ($picklistvalueid != null) {\n\t\t\t\t\t$pick_query=\"select * from vtiger_role2picklist where picklistvalueid=$picklistvalueid and roleid in (\". generateQuestionMarks($roleids) .')';\n\t\t\t\t\t$res_val=$adb->pquery($pick_query, array($roleids));\n\t\t\t\t\t$num_val = $adb->num_rows($res_val);\n\t\t\t\t}\n\t\t\t\tif ($num_val > 0) {\n\t\t\t\t\t$element['status'] = getTranslatedString(decode_html($eventstatus));\n\t\t\t\t} else {\n\t\t\t\t\t$element['status'] = \"<font color='red'>\".$app_strings['LBL_NOT_ACCESSIBLE'].\"</font>\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$element['status'] = getTranslatedString(decode_html($eventstatus));\n\t\t\t}\n\t\t}\n\t\tif (!empty($assignedto)) {\n\t\t\t$element['assignedto'] = $assignedto;\n\t\t} else {\n\t\t\t$element['assignedto'] = $adb->query_result($result, $i, 'groupname');\n\t\t}\n\t\t$element['visibility'] = $adb->query_result($result, $i, 'visibility');\n\t\t$c++;\n\t\t$Entries[] = $element;\n\t}\n\t$ret_arr[0] = $Entries;\n\t$ret_arr[1] = $navigation_array;\n\t$cal_log->debug('< getEventList');\n\treturn $ret_arr;\n}",
"public function fetchEvents() \n {\n if(Auth::user()->isActivated() == false)\n return null;\n $partnerid = request()->partner_id;\n\n $start_date = date(\"Y-m-d\");\n $end_date = mktime(0, 0, 0, date('m'), date('d')+1, date('y'));\n //$events = EventModel::whereBetween('event_start', '=', array($start_date, $end_date))->get();\n $events = EventModel::where('partner_id', '=', $partnerid)\n ->orderBy('event_start', 'desc')\n ->get();\n return $events;\n }",
"public function getEventGuestListById($id);",
"function nice_get_events($only_owned,$it,$edit_viewable_events=true)\n{\n\t$where=array();\n\tif (!is_null($only_owned)) $where['e_submitter']=$only_owned;\n\tif (!$edit_viewable_events) $where['e_is_public']=0;\n\tif ($GLOBALS['SITE_DB']->query_value('calendar_events','COUNT(*)')>500) warn_exit(do_lang_tempcode('TOO_MANY_TO_CHOOSE_FROM'));\n\t$events=$GLOBALS['SITE_DB']->query_select('calendar_events',array('id','e_title','e_type'),$where);\n\t$list=new ocp_tempcode();\n\tforeach ($events as $event)\n\t{\n\t\tif (!has_category_access(get_member(),'calendar',strval($event['e_type']))) continue;\n\n\t\t$list->attach(form_input_list_entry(strval($event['id']),$event['id']==$it,get_translated_text($event['e_title'])));\n\t}\n\n\treturn $list;\n}",
"public function getEventList($conditions='', $limit = '', $orderBy=' endDate DESC'){\n\n global $sessionHandler;\n $instituteId=$sessionHandler->getSessionVariable('InstituteId');\n $sessionId=$sessionHandler->getSessionVariable('SessionId');\n \n /*$query=\"SELECT e.eventId,e.eventTitle,e.shortDescription,e.longDescription,e.startDate,e.endDate\n FROM event e \n WHERE e.instituteId=$instituteId AND e.sessionId=$sessionId \n $conditions ORDER BY $orderBy $limit \" ; */\n\n $query=\"SELECT e.eventId,e.eventTitle,e.shortDescription,e.longDescription,e.startDate,e.endDate\n FROM event e \n WHERE e.instituteId=$instituteId AND e.sessionId=$sessionId \n $conditions ORDER BY $orderBy $limit \" ; \t\t \n //echo $query; \n return SystemDatabaseManager::getInstance()->executeQuery($query,\"Query: $query\"); \n}",
"public function getEventList()\n {\n // check if user has permission to get events\n if ( !$this->user->checkPrivilige(PERM_EVENT, PERM_DESCR_EDIT_EVENT) ) {\n $this->throwException(USER_HAS_NO_RIGHT, \"User has no right to edit event\");\n }\n //$this->response(QR_SUCCESS_GET_UNUSED_HASHES, $this->qr->getUsedHashes());\n if ( !($this->qr->getEvents($this->user->getUserId())) ) {\n $this->throwException(EVENT_FAILED_TO_LIST_CODES, \"Unable to obtain eventlist\");\n } else {\n $this->response(EVENT_SUCCESS_GET_LIST, $this->qr->unusedHash());\n }\n \n }",
"function dmh_list_upcoming_events_for_a_venue( $post ) {\n\n\t$query_params = array(\n array(\n 'status' => 'publish',\n 'Datetime.DTT_EVT_start' => array(\n '>',\n date( current_time( 'mysql' ) ),\n 'Datetime.DTT_EVT_end' => array(\n '<',\n date( current_time( 'mysql' ) )\n )\n )\n ),\n\t\t'order_by' => 'Datetime.DTT_EVT_start',\n\t\t'order' => 'ASC'\n );\n\n $events = EEH_Venue_View::get_venue( $post->ID )->events( $query_params );\n\n\techo '<h2>Upcoming screenings:</h2><ul>';\n\n foreach ( $events as $event ) {\n\n\t\t$event_dt = $event->first_datetime();\n\n echo '<li>';\n echo '<a href=\"' . get_permalink( $event->get( 'EVT_ID' ) ) . '\">' . $event_dt->start_date( 'n/j/Y' ) . ' - ' . $event->get( 'EVT_name' ) . '</a>';\n echo '</li>';\n\n }\n\n echo '</ul>';\n\n}",
"public function admin_evnt_list()\n {\n $this->paginate = array(\n 'limit' => 10,\n 'order' => array('Event.created' => 'asc' ),\n );\n $data = $this->paginate('Event');\n\n $this->set('events', $data);\n $this->render('/Events/event_list');\n }",
"public function viewguestlist($aData)\n\t{\n\t\tif (!isset($aData['iEventId']))\n\t\t{\n\t\t\treturn array(\n\t\t\t\t'error_code' => 1,\n\t\t\t\t'error_element' => 'iEventId',\n\t\t\t\t'error_message' => Zend_Registry::get('Zend_Translate') -> _(\"Parameter is not valid!\")\n\t\t\t);\n\t\t}\n\t\t$viewer = Engine_Api::_() -> user() -> getViewer();\n\t\t$members = null;\n\t\t$event = Engine_Api::_() -> getItem('event', $aData['iEventId']);\n\t\tif (!$event)\n\t\t{\n\t\t\treturn array(\n\t\t\t\t'error_code' => 1,\n\t\t\t\t'error_message' => Zend_Registry::get('Zend_Translate') -> _(\"Event is not valid!\")\n\t\t\t);\n\t\t}\n\t\t$iRsvp = isset($aData['iRSVP']) ? (int)$aData['iRSVP'] : 2;\n\t\t$iPageSize = isset($aData['iLimit']) ? (int)$aData['iLimit'] : -1;\n\n\t\tif ($viewer -> getIdentity() && $event -> isOwner($viewer))\n\t\t{\n\t\t\t$select = $event -> membership() -> getMembersSelect(false);\n\t\t\tif (isset($aData['iLastMemberIdViewed']) && $aData['iLastMemberIdViewed'] > 0)\n\t\t\t{\n\t\t\t\t$select -> where(\"user_id > ?\", $aData['iLastMemberIdViewed']);\n\t\t\t}\n\t\t\t$select -> order(\"user_id\");\n\t\t\t$waitingMembers = Zend_Paginator::factory($select);\n\t\t\tif ($iRsvp == 3)\n\t\t\t{\n\t\t\t\t$members = $waitingMembers;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (!$members)\n\t\t{\n\t\t\t$select = $event -> membership() -> getMembersObjectSelect();\n\t\t\t$select -> where(\"rsvp = ?\", $iRsvp);\n\n\t\t\tif (isset($aData['iLastMemberIdViewed']) && $aData['iLastMemberIdViewed'] > 0)\n\t\t\t{\n\t\t\t\t$select -> where(\"user_id > ?\", $aData['iLastMemberIdViewed']);\n\t\t\t}\n\t\t\t$select -> order(\"displayname\");\n\t\t\t$members = Zend_Paginator::factory($select);\n\t\t}\n\n\t\t// Set item count per page and current page number\n\t\t$members -> setItemCountPerPage($iPageSize);\n\t\t/**\n\t\t * @var array\n\t\t */\n\t\t$aResult = array();\n\t\tforeach ($members as $member)\n\t\t{\n\t\t\tif (!empty($member -> resource_id))\n\t\t\t{\n\t\t\t\t$memberInfo = $member;\n\t\t\t\t$member = Engine_Api::_() -> user() -> getUser($memberInfo -> user_id);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$memberInfo = $event -> membership() -> getMemberInfo($member);\n\t\t\t}\n\t\t\t$sProfileImage = $member -> getPhotoUrl(TYPE_OF_USER_IMAGE_ICON);\n\t\t\t$sBigProfileImage = $member -> getPhotoUrl(TYPE_OF_USER_IMAGE_PROFILE);\n\t\t\t\n\t\t\tif ($sProfileImage != \"\")\n\t\t\t{\n\t\t\t\t$sProfileImage = Engine_Api::_() -> ynmobile() ->finalizeUrl($sProfileImage);\n\t\t\t\t$sBigProfileImage = Engine_Api::_() -> ynmobile() ->finalizeUrl($sBigProfileImage);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sProfileImage = NO_USER_ICON;\n\t\t\t\t$sProfileImage = NO_USER_NORMAL;\n\t\t\t}\n\t\t\t$aResult[] = array(\n\t\t\t\t'iEventId' => $event -> getIdentity(),\n\t\t\t\t'iTypeId' => 0,\n\t\t\t\t'iRSVP' => $memberInfo -> rsvp,\n\t\t\t\t'iUserId' => $member -> getIdentity(),\n\t\t\t\t'sFullName' => $member -> getTitle(),\n\t\t\t\t'sUserImage' => $sProfileImage,\n\t\t\t\t'sBigUserImage' => $sBigProfileImage\n\t\t\t);\n\t\t}\n\t\treturn $aResult;\n\t}",
"public function listEvents()\n {\n $query = Core::query('campaign-events-list');\n $query->bindValue(':campaign', $this->_campaign['id']);\n $query->execute();\n return $query->fetchAll(PDO::FETCH_ASSOC);\n }",
"private function _getEventList(){\n\t\t/* variable initialization */\n\t\t$strWhereClauseArr\t= array('company_code' => $this->getCompanyCode());\n\t\t$strFilterArr\t\t= array('table'=>'events_'.$this->getCompanyCode());\n\t\t/* Getting the status list */\n\t\treturn\t$this->_objDataOperation->getDataFromTable($strFilterArr, $strWhereClauseArr);\n\t}",
"public function getEventList($conditions='', $limit = '', $orderBy=' e.eventTitle'){\n\n global $sessionHandler;\n $roleId=$sessionHandler->getSessionVariable('RoleId');\n $instituteId=$sessionHandler->getSessionVariable('InstituteId');\n $sessionId=$sessionHandler->getSessionVariable('SessionId');\n\n $query=\"SELECT e.eventId,e.eventTitle,e.shortDescription,e.longDescription,e.startDate,e.endDate\n FROM event e\n WHERE e.instituteId='$instituteId' AND e.sessionId='$sessionId'\n AND e.roleIds LIKE '%~$roleId~%'\n $conditions ORDER BY $orderBy $limit \" ;\n //echo $query;\n return SystemDatabaseManager::getInstance()->executeQuery($query,\"Query: $query\");\n}",
"public function load_team_information_events()\n {\n $where_statement =\n \"WHERE owner_id=? AND type=1 ORDER BY start_datetime ASC\";\n return $this->list_load( $where_statement );\n }",
"function retrieve_venue_guest_lists($tv_id, $date, $team_fan_page_id){\n\t\t\n\t\t$date = '2012-012-05';\n\t\t\n\t\t$sql = \"SELECT\n\t\t\n\t\t\t\t\t'promoter'\t\t\t\t\tas reservation_type,\n\t\t\t\t\t'false'\t\t\t\t\t\tas guest_of,\n\t\t\t\t\tpgla.id\t\t\t\t\t\tas pgla_id,\n\t\t\t\t\tpgla.user_promoter_id\t\tas pgla_user_promoter_id,\n\t\t\t\t\tpgla.team_venue_id\t\t\tas pgla_team_venue_id,\n\t\t\t\t\tpgla.day\t\t\t\t\tas pgla_day,\n\t\t\t\t\tpgla.name\t\t\t\t\tas pgla_name,\n\t\t\t\t\tpgla.image\t\t\t\t\tas pgla_image,\n\t\t\t\t\tpgl.date\t\t\t\t\tas pgl_date,\n\t\t\t\t\tpglr.id\t\t\t\t\t\tas pglr_id,\n\t\t\t\t\tpglr.create_time\t\t\tas pglr_create_time,\n\t\t\t\t\tpglr.user_oauth_uid\t\t\tas pglr_user_oauth_uid,\n\t\t\t\t\tpglr.host_message\t\t\tas pglr_host_message,\n\t\t\t\t\tpglr.checked_in\t\t\t\tas pglr_checked_in,\n\t\t\t\t\tpglr.checked_in_time\t\tas pglr_checked_in_time,\n\t\t\t\t\tpglr.checked_in_by_host\t\tas pglr_checked_in_by_host,\n\t\t\t\t\tpglr.table_request\t\t\tas pglr_table_request,\n\t\t\t\t\tup.users_oauth_uid\t\t\tas up_users_oauth_uid,\n\t\t\t\t\tu.first_name\t\t\t\tas u_first_name,\n\t\t\t\t\tu.last_name \t\t\t\tas u_last_name,\n\t\t\t\t\tu.full_name \t\t\t\tas u_full_name\n\t\t\t\t\t\n\n\t\t\t\tFROM \tpromoters_guest_lists_reservations pglr\n\t\t\t\t\n\t\t\t\tJOIN\tpromoters_guest_lists pgl\n\t\t\t\tON \t\tpglr.promoter_guest_lists_id = pgl.id\n\t\t\t\t\n\t\t\t\tJOIN\tpromoters_guest_list_authorizations pgla\n\t\t\t\tON \t\tpgl.promoters_guest_list_authorizations_id = pgla.id\n\t\t\t\t\n\t\t\t\tJOIN\tusers_promoters up \n\t\t\t\tON \t\tpgla.user_promoter_id = up.id\n\t\t\t\t\n\t\t\t\tJOIN \tpromoters_teams pt\n\t\t\t\tON \t\tpt.promoter_id = up.id\n\t\t\t\t\n\t\t\t\tJOIN\tusers u \n\t\t\t\tON \t\tup.users_oauth_uid = u.oauth_uid\n\t\t\t\t\n\t\t\t\tWHERE\t\n\t\t\t\t\n\t\t\t\t\t\tpgla.deactivated = 0\n\t\t\t\tAND\t\tpgl.date = ?\n\t\t\t\tAND\t\tpglr.approved = 1\n\t\t\t\tAND\t\tpgla.team_venue_id = ?\n\t\t\t\tAND\t\tup.banned = 0\n\t\t\t\tAND \tpt.approved = 1\n\t\t\t\tAND\t\tpt.quit = 0\n\t\t\t\tAND \tpt.banned = 0\n\t\t\t\tAND\t\tpt.team_fan_page_id = ?\";\n\t\t$query = $this->db->query($sql, array($date, $tv_id, $team_fan_page_id));\n\t\t$promoter_result = $query->result();\n\t\t\n\t\t//attach entourages\n\t\tforeach($promoter_result as &$res){\n\t\t\t\t\t\n\t\t\t$sql = \"SELECT\n\t\t\t\n\t\t\t\t\t\toauth_uid \t\tas oauth_uid\n\t\t\t\t\t\t\n\t\t\t\t\tFROM\tpromoters_guest_lists_reservations_entourages pglre\n\t\t\t\t\t\n\t\t\t\t\tWHERE\tpglre.promoters_guest_lists_reservations_id = ?\";\t\n\t\t\t$query = $this->db->query($sql, array($res->pglr_id));\n\t\t\t$res->pglre = $query->result();\n\t\t\t\n\t\t}unset($res);\n\t\t\n\t\t\n\t\t// ----- repeat for venue guest lists\n\t\t\n\t\t$sql = \"SELECT\n\t\t\n\t\t\t\t\t'team'\t\t\t\t\t\tas reservation_type,\n\t\t\t\t\t'false'\t\t\t\t\t\tas guest_of,\n\t\t\t\t\ttgla.id\t\t\t\t\t\tas tgla_id,\n\t\t\t\t\ttgla.team_venue_id\t\t\tas tgla_team_venue_id,\n\t\t\t\t\ttgla.day\t\t\t\t\tas tgla_day,\n\t\t\t\t\ttgla.name\t\t\t\t\tas tgla_name,\n\t\t\t\t\ttgla.image\t\t\t\t\tas tgla_image,\n\t\t\t\t\ttgl.date\t\t\t\t\tas tgl_date,\n\t\t\t\t\ttglr.id\t\t\t\t\t\tas tglr_id,\n\t\t\t\t\ttglr.create_time\t\t\tas tglr_create_time,\n\t\t\t\t\ttglr.user_oauth_uid\t\t\tas tglr_user_oauth_uid,\n\t\t\t\t\ttglr.host_message\t\t\tas tglr_host_message,\n\t\t\t\t\ttglr.checked_in\t\t\t\tas tglr_checked_in,\n\t\t\t\t\ttglr.checked_in_time\t\tas tglr_checked_in_time,\n\t\t\t\t\ttglr.checked_in_by_host\t\tas tglr_checked_in_by_host,\n\t\t\t\t\ttglr.table_request\t\t\tas tglr_table_request\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tFROM \tteams_guest_lists_reservations tglr \n\t\t\t\t\t\n\t\t\t\t\tJOIN \tteams_guest_lists tgl \n\t\t\t\t\tON \t\ttglr.team_guest_list_id = tgl.id \n\n\t\t\t\t\tJOIN \tteams_guest_list_authorizations tgla\n\t\t\t\t\tON \t\ttgl.team_guest_list_authorization_id = tgla.id\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tWHERE\t\n\t\t\t\t\t\t\ttgla.deactivated = 0\n\t\t\t\t\tAND\t\ttgl.date = ?\n\t\t\t\t\tAND \ttgla.team_venue_id = ?\n\t\t\t\t\tAND \ttglr.approved = 1\";\n\t\t$query = $this->db->query($sql, array($date, $tv_id));\n\t\t$team_result = $query->result();\n\t\t\n\t\tforeach($team_result as &$res){\n\t\t\t\t\t\n\t\t\t$sql = \"SELECT\n\t\t\t\n\t\t\t\t\t\toauth_uid \t\tas oauth_uid\n\t\t\t\t\t\t\n\t\t\t\t\tFROM\tteams_guest_lists_reservations_entourages tglre\n\t\t\t\t\t\n\t\t\t\t\tWHERE\ttglre.team_guest_list_reservation_id = ?\";\t\n\t\t\t$query = $this->db->query($sql, array($res->tglr_id));\n\t\t\t$res->tglre = $query->result();\t\n\t\t\t\n\t\t}unset($res);\n\t\t\n\t\t\n\t\t$final_result = array_merge($promoter_result, $team_result);\n\t\t\n\t\t\n\t\t//remove all entourage users that are ALSO head users of guest lists\n\t\t// --------------------------------------------------------------------------------------------\n\t\tforeach($final_result as $key => &$group){\n\t\t\t\n\t\t\t \n\t\t\tif($group->reservation_type == 'promoter'){\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t//for all entourage users in all requests, check to see if they're a head user on any request made this week & venue\n\t\t\t\tforeach($group->pglre as $key => $ent_user){\n\t\t\t\t\t\n\t\t\t\t\tforeach($final_result as $request){\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(isset($request->pglr_user_oauth_uid)){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($ent_user->oauth_uid == $request->pglr_user_oauth_uid){\n\t\t\t\t\t\t\t\t//there is a match, remove this ent_user from this request\n\t\t\t\t\t\t\t\tunset($group->pglre[$key]);\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}elseif(isset($request->tglr_user_oauth_uid)){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($ent_user->oauth_uid == $request->tglr_user_oauth_uid){\n\t\t\t\t\t\t\t\t//there is a match, remove this ent_user from this request\n\t\t\t\t\t\t\t\tunset($group->pglre[$key]);\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t}elseif($group->reservation_type == 'team'){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t//for all entourage users in all requests, check to see if they're a head user on any request made this week & venue\n\t\t\t\tforeach($group->tglre as $key => $ent_user){\n\t\t\t\t\t\n\t\t\t\t\tforeach($final_result as $request){\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(isset($request->pglr_user_oauth_uid)){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($ent_user->oauth_uid == $request->pglr_user_oauth_uid){\n\t\t\t\t\t\t\t\t//there is a match, remove this ent_user from this request\n\t\t\t\t\t\t\t\tunset($group->tglre[$key]);\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}elseif(isset($request->tglr_user_oauth_uid)){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($ent_user->oauth_uid == $request->tglr_user_oauth_uid){\n\t\t\t\t\t\t\t\t//there is a match, remove this ent_user from this request\n\t\t\t\t\t\t\t\tunset($group->tglre[$key]);\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t// --------------------------------------------------------------------------------------------\n\t\t\n\t\t$cmp_function = function($a, $b){\n\t\t\t\t\t\t\n\t\t\tif(isset($a->pglr_create_time)){\n\t\t\t\t$a_create_time = $a->pglr_create_time;\n\t\t\t}elseif(isset($a->tglr_create_time)){\n\t\t\t\t$a_create_time = $a->tglr_create_time;\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($b->pglr_create_time)){\n\t\t\t\t$b_create_time = $b->pglr_create_time;\n\t\t\t}elseif(isset($b->tglr_create_time)){\n\t\t\t\t$b_create_time = $b->tglr_create_time;\n\t\t\t}\n\t\t\t\n\t\t\treturn $a_create_time - $b_create_time;\n\t\t}; \n\t\t\n\t\tusort($final_result, $cmp_function);\n\t\t\n\t\t// --------------------------------------------------------------------------------------------\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t/*\n\t\n\t\t// Move all entourage users to head users that are also 'guests of' some other bloke\n\t\t// --------------------------------------------------------------------------------------------\n\t\t$entourage_reservations = array();\n\t\tforeach($final_result as $key => $result){\n\t\n\t\t\tif($result->reservation_type == 'promoter'){\n\t\t\t\n\t\t\t\t\n\t\t\t\tforeach($result->pglre as $pglre_user){\n\t\t\t\t\t\n\t\t\t\t\t$test_check = false;\n\t\t\t\t\tforeach($entourage_reservations as $ent_res){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($ent_res->reservation_type == 'promoter'){\n\t\t\t\t\t\t\tif($ent_res->pglr_user_oauth_uid == $pglre_user->oauth_uid){\n\t\t\t\t\t\t\t\t$test_check = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tif($ent_res->tglr_user_oauth_uid == $pglre_user->oauth_uid){\n\t\t\t\t\t\t\t\t$test_check = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t \n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!$test_check){\n\t\t\t\t\t\t//user is NOT in the array already, go ahead and add\n\t\t\t\t\t\t\n\t\t\t\t\t\t$ent_res_obj \t\t\t\t\t\t\t= new stdClass;\n\t\t\t\t\t\t$ent_res_obj->reservation_type\t \t\t= 'promoter';\n\t\t\t\t\t\t$ent_res_obj->guest_of \t\t\t\t\t= array($result->pglr_user_oauth_uid);\n\t\t\t\t\t\t$ent_res_obj->pgla_id \t\t\t\t\t= $result->pgla_id;\n\t\t\t\t\t\t$ent_res_obj->pgla_user_promoter_id \t= $result->pgla_user_promoter_id;\n\t\t\t\t\t\t$ent_res_obj->pgla_team_venue_id\t\t= $result->pgla_team_venue_id;\n\t\t\t\t\t\t$ent_res_obj->pgla_day \t\t\t\t\t= $result->pgla_day;\n\t\t\t\t\t\t$ent_res_obj->pgla_name \t\t\t\t= $result->pgla_name;\n\t\t\t\t\t\t$ent_res_obj->pgla_image \t\t\t\t= $result->pgla_image;\n\t\t\t\t\t\t$ent_res_obj->pgl_date \t\t\t\t\t= $result->pgl_date;\n\t\t\t\t\t\t$ent_res_obj->pglr_id \t\t\t\t\t= $result->pglr_id;\n\t\t\t\t\t\t$ent_res_obj->pglr_create_time \t\t\t= $result->pglr_create_time;\n\t\t\t\t\t\t$ent_res_obj->pglr_user_oauth_uid \t\t= $pglre_user->oauth_uid;\n\t\t\t\t\t\t$ent_res_obj->pglr_host_message \t\t= $result->pglr_host_message;\n\t\t\t\t\t\t$ent_res_obj->pglr_checked_in \t\t\t= $result->pglr_checked_in;\n\t\t\t\t\t\t$ent_res_obj->pglr_checked_in_time \t\t= $result->pglr_checked_in_time;\n\t\t\t\t\t\t$ent_res_obj->pglr_checked_in_by_host \t= $result->pglr_checked_in_by_host;\n\t\t\t\t\t\t$ent_res_obj->pglr_table_request \t\t= $result->pglr_table_request;\n\t\t\t\t\t\t$ent_res_obj->up_users_oauth_uid \t\t= $result->up_users_oauth_uid;\n\t\t\t\t\t\t$ent_res_obj->u_first_name \t\t\t\t= $result->u_first_name;\n\t\t\t\t\t\t$ent_res_obj->u_last_name \t\t\t\t= $result->u_last_name;\n\t\t\t\t\t\t$ent_res_obj->u_full_name \t\t\t\t= $result->u_full_name;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$entourage_reservations[] = $ent_res_obj;\n\t\t\t\t\t\t$test_check = false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tforeach($result->tglre as $tglre_user){\n\t\t\t\t\t\n\t\t\t\t\t$test_check = false;\n\t\t\t\t\tforeach($entourage_reservations as $ent_res){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($ent_res->reservation_type == 'promoter'){\n\t\t\t\t\t\t\tif($ent_res->pglr_user_oauth_uid == $pglre_user->oauth_uid){\n\t\t\t\t\t\t\t\t$test_check = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tif($ent_res->tglr_user_oauth_uid == $pglre_user->oauth_uid){\n\t\t\t\t\t\t\t\t$test_check = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t \n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!$test_check){\n\t\t\t\t\t\t//user is NOT in the array already, go ahead and add\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$ent_res_obj \t\t\t\t\t\t\t= new stdClass;\n\t\t\t\t\t\t$ent_res_obj->reservation_type\t \t\t= 'team';\n\t\t\t\t\t\t$ent_res_obj->guest_of \t\t\t\t\t= array($result->tglr_user_oauth_uid);\n\t\t\t\t\t\t$ent_res_obj->tgla_id \t\t\t\t\t= $result->tgla_id;\n\t\t\t\t\t\t$ent_res_obj->tgla_team_venue_id\t\t= $result->tgla_team_venue_id;\n\t\t\t\t\t\t$ent_res_obj->tgla_day \t\t\t\t\t= $result->tgla_day;\n\t\t\t\t\t\t$ent_res_obj->tgla_name \t\t\t\t= $result->tgla_name;\n\t\t\t\t\t\t$ent_res_obj->tgla_image \t\t\t\t= $result->tgla_image;\n\t\t\t\t\t\t$ent_res_obj->tgl_date \t\t\t\t\t= $result->tgl_date;\n\t\t\t\t\t\t$ent_res_obj->tglr_id \t\t\t\t\t= $result->tglr_id;\n\t\t\t\t\t\t$ent_res_obj->tglr_create_time \t\t\t= $result->tglr_create_time;\n\t\t\t\t\t\t$ent_res_obj->tglr_user_oauth_uid \t\t= $tglre_user->oauth_uid;\n\t\t\t\t\t\t$ent_res_obj->tglr_host_message \t\t= $result->tglr_host_message;\n\t\t\t\t\t\t$ent_res_obj->tglr_checked_in \t\t\t= $result->tglr_checked_in;\n\t\t\t\t\t\t$ent_res_obj->tglr_checked_in_time \t\t= $result->tglr_checked_in_time;\n\t\t\t\t\t\t$ent_res_obj->tglr_checked_in_by_host \t= $result->tglr_checked_in_by_host;\n\t\t\t\t\t\t$ent_res_obj->tglr_table_request \t\t= $result->tglr_table_request;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$entourage_reservations[] = $ent_res_obj;\n\t\t\t\t\t\t$test_check = false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\t\n\t\t\t\t\n\t\t\t\n\t\t}\n\n\t*/\n\t\t// --------------------------------------------------------------------------------------------\n\n\t\t\n\t\t\t\t\n\t\treturn $final_result;\n\t}",
"function getEvents() {\n\t$alluser = new Event();\n\t$alluser->getAllEvents();\n}",
"function event_list_range($mysqli, $start, $end)\n{\n\t$where = 'start_time>=\\'' . date(MYSQL_DATETIME_FMT, $start) . '\\' AND\n\t start_time<=\\'' . date(MYSQL_DATETIME_FMT, $end) . '\\'';\n\treturn __event_list($mysqli, $where);\n}",
"public function getRemindersEvents($homeday, $username, $start_date) {\n\n\t\tGLOBAL $accountingpref, $db;\n\n\t\t$count\t\t= 0;\n\t\t$asmt_count\t= 0;\n\t\t$table_row\t= '';\n\t\t// Code for Admin Preferences for Admin_Management\n\t\t$sql = \"SELECT admin from sysuser where username=$username\";\n\t\t$rs = mysql_query($sql,$db);\n\t\t$row = mysql_fetch_assoc($rs);\n\t\t$admin_pref = $row['admin'];\n\t\t$chkdata = strpos($admin_pref, '+14+');//$admin_pref!='NO' $chkdata !== false\n\t\t\n\t\t$rem_query\t= 'SELECT \n\t\t\t\t\t\t\ttasklist.sno, tasklist.title,' . tzRetQueryStringSelBoxDate(\"tasklist.startdate\", \"Date\", \"/\") . \", tasklist.contactsno, tasklist.modulename, tasklist.cuser,cpr.activity_status\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\ttasklist\n\t\t\t\t\t\t\tLEFT JOIN cmngmt_pr cpr ON (tasklist.sno = cpr.tysno AND cpr.title= 'Task')\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t((tasklist.cuser = '$username' AND tasklist.sendto = '') OR FIND_IN_SET('$username', tasklist.sendto)) AND tasklist.startdate <= '$start_date' AND\n\t\t\t\t\t\t\tDATE_ADD(tasklist.remdate, INTERVAL IF(tasklist.CTIME='00:00:00', '23:59:59', tasklist.CTIME) HOUR_SECOND) >= \n\t\t\t\t\t\t\tDATE_ADD(STR_TO_DATE('$start_date', '%Y-%m-%d'), INTERVAL CURTIME() HOUR_SECOND)\n\t\t\t\t\t\t\tAND tasklist.rem = 'Yes' AND (tasklist.status = 'active' OR tasklist.status = 'new') AND tasklist.taskstatus != 'Completed' $groupby\n\t\t\t\t\t\tORDER BY\n\t\t\t\t\t\t\ttasklist.startdate DESC\";\n\n\t\t$rem_result\t= mysql_query($rem_query, $db);\n\n\t\twhile ($rem_row = mysql_fetch_row($rem_result)) {\n\n\t\t\t$contact_name\t= '';\n\n\t\t\t$count++;\n\n\t\t\tif (substr($rem_row[3], 0, 3) == 'con') {\n\n\t\t\t\t$con_query\t= \"SELECT name FROM consultant_list WHERE username='\". $rem_row[3] . \"'\";\n\n\t\t\t\t$con_result\t= mysql_query($con_query, $db);\n\n\t\t\t\t$con_row\t= mysql_fetch_row($con_result);\n\n\t\t\t\t$contact_name\t= $con_row[0];\n\n\t\t\t} elseif (substr($rem_row[3],0,3) == 'sub') {\n\n\t\t\t\t$sub_query\t= \"SELECT CONCAT_WS(' ', fname, mname, lname) FROM subconsultant WHERE subconid='\" . $rem_row[3] . \"'\";\n\n\t\t\t\t$sub_result\t= mysql_query($sub_query, $db);\n\n\t\t\t\t$sub_row\t= mysql_fetch_row($sub_result);\n\n\t\t\t\t$contact_name\t= $sub_row[0];\n\n\t\t\t} elseif (substr($rem_row[3], 0, 3) == 'emp') {\n\n\t\t\t\t$emp_query\t= \"SELECT name FROM emp_list WHERE sno='\" . substr($rem_row[3], 3, strlen($rem_row[3])) . \"'\";\n\n\t\t\t\t$emp_result\t= mysql_query($emp_query, $db);\n\n\t\t\t\t$emp_row\t= mysql_fetch_row($emp_result);\n\n\t\t\t\t$contact_name\t= $emp_row[0];\n\n\t\t\t} elseif (substr($rem_row[3], 0, 3) == 'acc') {\n\n\t\t\t\t$sta_query\t= \"SELECT\n\t\t\t\t\t\t\t\t\tstaffacc_cinfo.cname\n\t\t\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t\t\tstaffacc_list\n\t\t\t\t\t\t\t\t\tLEFT JOIN staffacc_cinfo ON staffacc_list.username = staffacc_cinfo.username\n\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t\tstaffacc_list.username='\" . $rem_row[3] . \"'\";\n\n\t\t\t\t$sta_result\t= mysql_query($sta_query, $db);\n\n\t\t\t\t$sta_row\t= mysql_fetch_row($sta_result);\n\n\t\t\t\t$contact_name\t= $sta_row[0];\n\n\t\t\t} elseif (substr($rem_row[3], 0, 4) == 'oppr') {\n\n\t\t\t\t$stf_query\t= \"SELECT CONCAT_WS(' ', fname, mname, lname) FROM staffoppr_contact WHERE sno='\" . substr($rem_row[3], 4, strlen($rem_row[3])) . \"'\";\n\n\t\t\t\t$stf_result\t= mysql_query($stf_query, $db);\n\n\t\t\t\t$stf_row\t= mysql_fetch_row($stf_result);\n\n\t\t\t\t$contact_name\t= $stf_row[0];\n\n\t\t\t} elseif (substr($rem_row[3], 0, 3) == 'com') {\n\n\t\t\t\t$stc_query\t= \"SELECT cname FROM staffoppr_cinfo WHERE sno='\".substr($rem_row[3],3,strlen($rem_row[3])).\"'\";\n\n\t\t\t\t$stc_result\t= mysql_query($stc_query, $db);\n\n\t\t\t\t$stc_row\t= mysql_fetch_row($stc_result);\n\n\t\t\t\t$contact_name\t= $stc_row[0];\n\n\t\t\t} elseif (substr($rem_row[3], 0, 4) == 'cand') {\n\n\t\t\t\t$can_query\t= \"SELECT CONCAT_WS(' ',fname,mname,lname) FROM candidate_general WHERE username='\".$rem_row[3].\"'\";\n\n\t\t\t\t$can_result\t= mysql_query($can_query, $db);\n\n\t\t\t\t$can_row\t= mysql_fetch_row($can_result);\n\n\t\t\t\t$contact_name\t= $can_row[0];\n\n\t\t\t} elseif (substr($rem_row[3], 0, 3) == 'req') {\n\n\t\t\t\t$pos_query\t= \"SELECT postitle FROM posdesc WHERE posid='\" . substr($rem_row[3], 3, strlen($rem_row[3])) . \"'\";\n\n\t\t\t\t$pos_result\t= mysql_query($pos_query, $db);\n\n\t\t\t\t$pos_row\t= mysql_fetch_row($pos_result);\n\n\t\t\t\t$contact_name\t= $pos_row[0];\n\n\t\t\t\t$rem_row[4]\t= ($rem_row[4] == 'Marketing->Candidates') ? 'Req_Mngmt' : $rem_row[4];\n\t\t\t}\n\n\t\t\tif ($contact_name == '' && $rem_row[4] == 'Collaboration->Task_Manager') {\n\n\t\t\t\t$emp_query\t= \"SELECT name FROM emp_list WHERE username='\" . $rem_row[5] . \"'\";\n\n\t\t\t\t$emp_result\t= mysql_query($emp_query, $db);\n\n\t\t\t\t$emp_row\t= mysql_fetch_row($emp_result);\n\n\t\t\t\t$contact_name\t= $emp_row[0];\n\t\t\t}\n\n\t\t\tif (trim($contact_name) != '')\n\t\t\t$contact_name\t= \"( $contact_name )\";\n\n\t\t\tif ($rem_row[4] == '') {\n\t\t\t\tif($chkdata == false && $rem_row[6] == '1'){\n\t\t\t\t\t\t//Hiding the appointments which are hidden from Admin for those who don't have access to Admin>>Data Management\n\t\t\t\t\t}else{\n\t\t\t\t$table_row\t.= \"<tr class=tr1bgcolor><td><a href=javascript:showTaskEdit('','\" . $rem_row[0] . \"','\" . $rem_row[3] . \"');>\" . dispfdb($rem_row[2] . ' - ' . $rem_row[1] . $contact_name). ' </a></td></tr>';\n\t\t\t}\n\n\t\t\t} elseif ($rem_row[4] == 'Collaboration->Task_Manager') {\n\t\t\t\tif($chkdata == false && $rem_row[6] == '1'){\n\t\t\t\t\t\t//Hiding the appointments which are hidden from Admin for those who don't have access to Admin>>Data Management\n\t\t\t\t\t}else{\n\n\t\t\t\t$table_row\t.= \"<tr class=tr1bgcolor><td><a href=\\\"javascript:winopen1('pathlocator.php?ptype=Task&mname=$rem_row[4]&addr=$username&recsno=$rem_row[0]&con_id=$rem_row[3]&homeday=$homeday')\\\">\" . dispfdb($rem_row[2] . ' - ' . $rem_row[1] . $contact_name) . ' </a></td></tr>';\n\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tif($chkdata == false && $rem_row[6] == '1'){\n\t\t\t\t\t\t//Hiding the appointments which are hidden from Admin for those who don't have access to Admin>>Data Management\n\t\t\t\t\t}else{\n\t\t\t\t$table_row\t.= \"<tr class=tr1bgcolor><td><a href=\\\"javascript:winopen('pathlocator.php?ptype=Task&mname=$rem_row[4]&addr=$username&recsno=$rem_row[0]&con_id=$rem_row[3]&module=CRM')\\\">\" . dispfdb($rem_row[2] . ' - ' . $rem_row[1] . $contact_name). ' </a></td></tr>';\n\t\t\t}\n\t\t\t}\n\n\t\t} // end-of-while\n\n\t\t$appno\t= '';\n\n\t\t$nCurrDateVal\t= mktime(date('h'), date('i'), 0, date('m', strtotime($start_date)), date('d', strtotime($start_date)), date('Y', strtotime($start_date)));\n\n\t\t//For getting the timestamp value of the date selected in edesk calendar.\n\t\t$day_select_home\t= getCurTime($start_date);\n\n\t\t$utzos\t= getUserSTZOffset();\n\n\t\tif ($utzos == '')\n\t\t$utzos\t= 0;\n\n\t\tlist ($gmtMon, $gmtDay, $gmtYr, $gmtHr, $gmtMin)\t= explode('/', gmdate('m/d/Y/H/i'));\n\n\t\t$getGMTTime\t\t= mktime($gmtHr, $gmtMin, 0, $gmtMon, $gmtDay, $gmtYr);\n\n\t\t$dayCurrTime\t= $getGMTTime + ($utzos);\n\n\t\tlist ($hr, $min)\t= explode(':', date('H:i', $dayCurrTime));\n\n\t\tlist ($yr, $mon, $day)\t= explode('-', $start_date);\n\n\t\t$daySelDate\t= mktime($hr, $min, 0, $mon, $day, $yr);\n\n\t\t$apmt_query\t\t= \"SELECT \n\t\t\t\t\t\t\t\tappointments.title, appointments.sno, UNIX_TIMESTAMP(CONVERT_TZ(NOW(),'EST5EDT','GMT')) - '$utzos', IF(appointments.recurrence='none', (appointments.sdatetime + '$utzos'), (recurrences.otime + '$utzos')) sdatetime, appointments.event, DATE_FORMAT(FROM_UNIXTIME(appointments.sdatetime + '$utzos'), '%l:%i%p') stime, '', appointments.contactsno, appointments.modulename, appointments.username, appointments.rtime, appointments.priority, appointments.recurrence, appointments.enddate, appointments.recurrence_type, appointments.recurrence_subtype, appointments.recurrence_day, appointments.recurrence_week, appointments.recurrence_month, appointments.enddate_option, '',cpr.activity_status\n\t\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t\tappointments\n\t\t\t\t\t\t\t\tLEFT JOIN recurrences ON recurrences.ano = appointments.sno\n\t\t\t\t\t\t\t\tLEFT JOIN cmngmt_pr cpr ON (tasklist.sno = cpr.tysno AND cpr.title= 'Appointment')\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\tappointments.status='active' AND \n\t\t\t\t\t\t\t\t(appointments.username='$username' OR FIND_IN_SET('$username', appointments.approved) > 0 OR \n\t\t\t\t\t\t\t\tFIND_IN_SET('$username', appointments.tentative)>0) AND appointments.dis='Yes' AND \n\t\t\t\t\t\t\t\t(((IF(appointments.recurrence = 'none', (appointments.sdatetime + '$utzos'), (recurrences.otime + '$utzos'))) - $daySelDate) <= appointments.rtime \n\t\t\t\t\t\t\t\tAND ((IF(appointments.recurrence='none', (appointments.sdatetime + '$utzos'), (recurrences.otime + '$utzos'))) - $daySelDate) >= 0 ) \n\t\t\t\t\t\t\tORDER BY \n\t\t\t\t\t\t\t\tsdatetime, appointments.title ASC\";\n\n\t\t$apmt_result\t= mysql_query($apmt_query, $db);\n\n\t\twhile ($arow = mysql_fetch_array($apmt_result)) {\n\n\t\t\t$gtimeval\t= '';\n\n\t\t\tif ($arow[4] != 'allday')\n\t\t\t$gtimeval\t= $arow[5];\n\n\t\t\t$flag\t= TRUE;\n\n\t\t\tif (substr($arow[7], 0, 3) == 'con') {\n\n\t\t\t\t$con_query\t= \"SELECT astatus FROM consultant_list WHERE username='\" . $arow[7] . \"'\";\n\n\t\t\t\t$con_result\t= mysql_query($con_query, $db);\n\n\t\t\t\t$con_row\t= mysql_fetch_row($con_result);\n\n\t\t\t\tif ($con_row[0]==\"RARCH\" || $con_row[0]==\"backup\" || $con_row[0]==\"ARCH\" || $con_row[0]==\"DELE\" || $con_row[0]==\"INACT\") {\n\n\t\t\t\t\t$flag\t= FALSE;\n\t\t\t\t}\n\n\t\t\t} elseif (substr($arow[7], 0, 3) == 'sub') {\n\n\t\t\t\t$sub_query\t= \"SELECT status FROM subconsultant WHERE subconid='\" . $arow[7] . \"'\";\n\n\t\t\t\t$sub_result\t= mysql_query($sub_query, $db);\n\n\t\t\t\t$sub_row\t= mysql_fetch_row($sub_result);\n\n\t\t\t\tif ($sub_row[0]==\"INACTIVE\" || $sub_row[0]==\"backup\") {\n\n\t\t\t\t\t$flag\t= FALSE;\n\t\t\t\t}\n\n\t\t\t} elseif (substr($arow[7], 0, 3) == 'emp') {\n\n\t\t\t\t$emp_query\t= \"SELECT lstatus FROM emp_list WHERE sno='\" . substr($arow[7], 3, strlen($arow[7])) . \"'\";\n\n\t\t\t\t$emp_result\t= mysql_query($emp_query, $db);\n\n\t\t\t\t$emp_row\t= mysql_fetch_row($emp_result);\n\n\t\t\t\tif ($emp_row[0] != \"DA\") {\n\n\t\t\t\t\t$flag\t= TRUE;\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$flag\t= FALSE;\n\t\t\t\t}\n\n\t\t\t} elseif (substr($arow[7], 0, 3) == 'acc') {\n\n\t\t\t\t$sta_query\t= \"SELECT status FROM staffacc_list WHERE username='\" . $arow[7] . \"'\";\n\n\t\t\t\t$sta_result\t= mysql_query($sta_query, $db);\n\n\t\t\t\t$sta_row\t= mysql_fetch_row($sta_result);\n\n\t\t\t\tif ($sta_row[0]==\"ACTIVE\") {\n\n\t\t\t\t\t$flag\t= TRUE;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$flag\t= FALSE;\n\t\t\t\t}\n\n\t\t\t} elseif (substr($arow[7], 0, 4) == 'oppr') {\n\n\t\t\t\t$stc_query\t= \"SELECT status FROM staffoppr_contact WHERE sno='\".substr($arow[7],4,strlen($arow[7])).\"'\";\n\n\t\t\t\t$stc_result\t= mysql_query($stc_query, $db);\n\n\t\t\t\t$stc_row\t= mysql_fetch_row($stc_result);\n\n\t\t\t\tif ($stc_row[0]==\"INACTIVE\") {\n\n\t\t\t\t\t$flag\t= FALSE;\n\t\t\t\t}\n\n\t\t\t} elseif (substr($arow[7], 0, 3) == 'com') {\n\n\t\t\t\t$stf_query\t= \"SELECT status FROM staffoppr_cinfo WHERE sno='\" . substr($arow[7], 3, strlen($arow[7])) . \"'\";\n\n\t\t\t\t$stf_result\t= mysql_query($stf_query, $db);\n\n\t\t\t\t$stf_row\t= mysql_fetch_row($stf_result);\n\n\t\t\t\tif ($stf_row[0]==\"INACTIVE\") {\n\n\t\t\t\t\t$flag\t= FALSE;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($flag) {\n\n\t\t\t\t$new_class\t= '';\n\n\t\t\t\tif ($arow['priority'] == 'High')\n\t\t\t\t$new_class\t= \"class='apply-priority-edesk'\";\n\n\t\t\t\t$count ++;\n\n\t\t\t\t$openModulename\t= ($arow[9]==$username) ? $arow[8] : 'Collaboration->Scheduler';\n\n\t\t\t\t$openWinname\t= ($openModulename == 'Collaboration->Scheduler') ? '3' : '';\n\t\t\t\tif($chkdata == false && $arow[21] == '1'){\n\t\t\t\t\t\t//Hiding the appointments which are hidden from Admin for those who don't have access to Admin>>Data Management\n\t\t\t\t\t}else{\n\t\t\t\t$table_row\t.= \"\n\t\t\t\t\t<tr class='tr1bgcolor'>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<a href=\\\"javascript:winopen\" . $openWinname . \"('pathlocator.php?ptype=Appointment&mname=$openModulename&addr=$username&recsno=$arow[1]&con_id=$arow[7]&thisday=$homeday')\\\" \" . $new_class . '>' . date('m/d/Y', $arow[3]) . ' ' . $gtimeval . ' - ' . $arow[0] . '</a>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>';\n\t\t\t\t}\n\t\t\t}\n\n\t\t} // end-of-while\n\n\n\t\tif (chkUserPref($accountingpref, '11')) {\n\n\t\t\tif (isset($homeday))\n\t\t\t$cur_time\t= $homeday;\n\t\t\telse\n\t\t\t$cur_time\t= time();\n\n\t\t\t//$asmt_query\t= 'SELECT\n\t\t\t//\t\t\t\t\temp_list.sno, ' . tzRetQueryStringSTRTODate('empcon_jobs.s_date', '%m-%d-%Y', 'Date', '-') . ',' . \n\t\t\t//\t\t\t\t\ttzRetQueryStringSTRTODate('empcon_jobs.e_date', '%m-%d-%Y', 'Date', '-') . \n\t\t\t//\t\t\t\t\t\", empcon_jobs.project, empcon_jobs.username, empcon_jobs.rtime, empcon_jobs.sno, empcon_jobs.assg_status\n\t\t\t//\t\t\t\tFROM\n\t\t\t//\t\t\t\t\temp_list\n\t\t\t//\t\t\t\t\tLEFT JOIN empcon_jobs ON emp_list.username = empcon_jobs.username\n\t\t\t//\t\t\t\tWHERE\n\t\t\t//\t\t\t\t\temp_list.lstatus != 'DA' AND empcon_jobs.jtype != '' AND empcon_jobs.jotype != '0'\n\t\t\t//\t\t\t\t\tAND ((empcon_jobs.assg_status = 'approved') OR (empcon_jobs.assg_status = 'pending' AND empcon_jobs.modulename = 'my placement'))\n\t\t\t//\t\t\t\t\tAND (UNIX_TIMESTAMP(empcon_jobs.e_date) - $cur_time) <= rtime AND empcon_jobs.rtime != 0\n\t\t\t//\t\t\t\t\tAND empcon_jobs.jtype = 'OP'\n\t\t\t//\t\t\t\tGROUP BY\n\t\t\t//\t\t\t\t\tempcon_jobs.sno\n\t\t\t//\t\t\t\tORDER BY\n\t\t\t//\t\t\t\t\tDATE_FORMAT(STR_TO_DATE(empcon_jobs.e_date, '%m-%d-%Y'), '%Y-%m-%d')\";\n\t\t\t\t\t\t\t\t\n\t\t\t$asmt_query = \"SELECT emp_list.sno,\n\t\t\t\t\t\t\t\t\tDATE_FORMAT(STR_TO_DATE(IF(hrcon_jobs.s_date = '0-0-0', '00-00-0000', hrcon_jobs.s_date), '%m-%d-%Y'), '%m-%d-%Y'),\n\t\t\t\t\t\t\t\t\tDATE_FORMAT(STR_TO_DATE(IF(hrcon_jobs.e_date = '0-0-0', '00-00-0000', hrcon_jobs.e_date), '%m-%d-%Y'), '%m-%d-%Y'),\n\t\t\t\t\t\t\t\t\thrcon_jobs.project,\n\t\t\t\t\t\t\t\t\thrcon_jobs.username,\n\t\t\t\t\t\t\t\t\thrcon_jobs.rtime,\n\t\t\t\t\t\t\t\t\thrcon_jobs.sno,\n\t\t\t\t\t\t\t\t\thrcon_jobs.ustatus\n\t\t\t\t\t\t FROM emp_list LEFT JOIN hrcon_jobs ON emp_list.username = hrcon_jobs.username\n\t\t\t\t\t\t WHERE emp_list.lstatus != 'DA' AND hrcon_jobs.jtype != '' AND hrcon_jobs.jotype != '0' AND ((hrcon_jobs.ustatus = 'active') OR (hrcon_jobs.ustatus = 'pending' AND hrcon_jobs.modulename = 'my placement')) AND (UNIX_TIMESTAMP(hrcon_jobs.e_date) - $cur_time) <= rtime AND hrcon_jobs.rtime != 0 AND hrcon_jobs.jtype = 'OP'\n\t\t\t\t\t\t GROUP BY hrcon_jobs.sno\n\t\t\t\t\t\t ORDER BY DATE_FORMAT(STR_TO_DATE(hrcon_jobs.e_date, '%m-%d-%Y'), '%Y-%m-%d')\";\n\n\t\t\t$asmt_result\t= mysql_query($asmt_query, $db);\n\n\t\t\twhile ($asmt_row = mysql_fetch_row($asmt_result)) {\n\n\t\t\t\t$asmt_count\t++;\n\n\t\t\t\t$start_date\t\t\t= explode('-', $asmt_row[1]);\n\t\t\t\t$asmt_start_date\t= $start_date[0] . '/' . $start_date[1] . '/' . $start_date[2];\n\n\t\t\t\t$end_date\t\t\t= explode('-', $asmt_row[2]);\n\t\t\t\t$asmt_end_date\t\t= $end_date[0] . '/' . $end_date[1] . '/' . $end_date[2];\n\n\t\t\t\t$asg_status\t= 'approved';\n\n\t\t\t\t$recsno\t\t= $asmt_row[6] . '| 15 |' . $asg_status . '|' . $asmt_row[0];\n\n\t\t\t\tif ($asmt_row[3] != '') {\n\n\t\t\t\t\t$table_row\t.= \"\n\t\t\t\t\t\t<tr class='tr1bgcolor'>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<a href=\\\"javascript:winopen4('pathlocator.php?ptype=Assignment&mname=Accounting->Assignments&recsno=$recsno&con_id=$asmt_row[4]&val_hr=$asmt_row[6]')\\\">\" . $asmt_start_date . ' - '. $asmt_end_date . ' - ' . $asmt_row[3] . '</a>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>';\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$table_row\t.= \"\n\t\t\t\t\t\t<tr class='tr1bgcolor'>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<a href=\\\"javascript:winopen4('pathlocator.php?ptype=Assignment&mname=Accounting->Assignments&recsno=$recsno&con_id=$asmt_row[4]&val_hr=$asmt_row[6]')\\\">\" . $asmt_start_date . ' - '. $asmt_end_date . ' - Project ' . '</a>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>';\n\t\t\t\t}\n\t\t\t}\n\n\t\t} // end-of-if\n\n\t\tif (($count == 0) && ($asmt_count == 0)) {\n\n\t\t\t$table_row\t= '<tr><td><i>You have no reminders today.</i></td></tr>';\n\t\t}\n\n\t\treturn $table_row;\n\t}",
"function getEvents($event) {\n $event_criteria = new CDbCriteria;\n $episode_id = $event->episode->id;\n $event_criteria->compare('episode_id', $episode_id);\n return Event::model()->findAll($event_criteria);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Close select one within many If optional arguments $first and $last are specified, numeric options are automatically created and appended for each possibility. You may still wish to create one "none selected" option with an empty value if you'd like before calling this. | public function endSelectOne($first, $last)
{
$out = '';
if (is_numeric($first)
&& is_numeric($last)
) {
$last = min($last, $first + 500);
for ($i=$first; $i <= $last; $i++) {
$out .= "\t<option value=\"{$i}\">{$i}\n";
};
};
$out .= "</select>\n";
return $out;
} | [
"private function SelectClose( $tag )\r\n\t{\r\n\t\t$this->appendHTML( \" </select>\" );\r\n\t\t$this->appendBreak( $tag );\r\n\t}",
"function __create_select_range($min, $max, $name, $by = 1, $add_blank = false, $select = \"\", $ignore_auto_select = false, $tags = \"\", $substitutions_array = false)\n{\n\techo \"<select name='\" . $name . \"' id='\" . $name . \"' $tags>\";\n\tif ($add_blank) {\n\t\t$add_blank_string = ($add_blank === true) ? '' : $add_blank;\n\t\techo \"<option label='$add_blank_string' value=''\";\n\t\tif ($select == \"\")\n\t\t\techo \" selected\";\n\t\techo \">$add_blank_string</option>\";\n\t}\n\tfor ($i=$min;$i<=$max;$i+=$by) {\n\t\t$value = $i;\n\t\tif ($substitutions_array && is_array($substitutions_array) && array_key_exists($value, $substitutions_array)) {\n\t\t\t$value = $substitutions_array[$value];\n\t\t}\n\t\techo \"<option label='\".$value.\"' value='\".$i.\"'\";\n\t\tif (($i === $select) || (($select == \"\") && ($add_blank === false) && ($ignore_auto_select == false)))\n\t\t\techo \" selected\";\n\t\techo \">\".$value.\"</option>\";\n\t}\n\techo \"</select>\";\n}",
"public function selectEnd() {\r\n return '</select>';\r\n }",
"function SetSelectionEnd($pos){}",
"public static function renderOptionGroupClose(){\n\t\tself::out(\n\t\t\tself::closeTag('optgroup')\n\t\t);\n\t}",
"public function closeOptionsDeclaration(): void\n {\n $this->optionsState = 'closed';\n }",
"protected function endOptgroup()\n {\n $this->html .= $this->indent(1, \"</optgroup>\");\n $this->optlevel -= 1;\n }",
"function dropDown($array,$multi,$size,$name,$result)\r\n{\r\n /**\r\n *Format the select option\r\n */\r\n echo \"<select name=\\\"$name\";\r\n \r\n if ($multi == 1)\r\n {\r\n echo \"[]\\\" size=\\\"$size\\\" multiple=\\\"multiple\\\">\";\r\n }\r\n else\r\n {\r\n echo \"\\\">\\n\";\r\n }\r\n \r\n if($multi == 0)\r\n {\r\n /**\r\n * Loop through non-multi array.\r\n * */\r\n foreach($array as $field => $value)\r\n {\r\n echo \"<option value=\\\"$value\\\"\";\r\n if($value == $result[$name]){echo \" selected=\\\"selected\\\" \";}\r\n echo \">$field</option>\\n\";\r\n } \r\n }\r\n else\r\n {\r\n /**\r\n * Loop through a multi-array\r\n * */\r\n \r\n ## Save the current value\r\n $value_count = $result[$name];\r\n ## SOME SELECT ALLS = -1, SO NEED TO OFFSET THAT\r\n if ($value_count == -1){ $value_count = max($array);}\r\n \r\n foreach($array as $field => $value)\r\n {\r\n echo \"<option value=\\\"$value\\\"\";\r\n if($value == $value_count)\r\n {\r\n echo \" selected=\\\"selected\\\" \";\r\n $value_count -= $value_count;\r\n }\r\n echo \">$field</option>\\n\";\r\n }\r\n }\r\n echo \"</select>\\n\";\r\n \r\n}",
"function number_range_form($field_name, $start, $stop, $range, $available, $add_null = true)\n{\n\n $start = (int) $start;\n $stop = (int) $stop;\n $range = (int) $range;\n\n $return_string = (($add_null) ? \"<option value=\\\"\\\">\" . translate(\"select\") . \"</option>\\n\" : \"\");\n $count = $start;\n while ($count <= $stop) {\n $return_string .= \"\\n<option value=\\\"\" . $count . \"\\\" \" . is_selected_option($available, $count) . \">\" . $count . \"</option>\\n\";\n $count = $count + $range;\n }\n return \"\n <select name=\\\"\" . $field_name . \"\\\">\n \"\n . $return_string . \"\n </select>\";\n}",
"function GetSelectionNEnd($selection){}",
"function create_numeric_dropdown($name, $selected = NULL, $blank = true) {\n\techo \"<select id=\\\"\" . htmlentities ( $name, ENT_QUOTES, 'UTF-8' ) . \"\\\" name=\\\"\" . htmlentities ( $name, ENT_QUOTES, 'UTF-8' ) . \"\\\" class=\\\"form-field\\\" style=\\\"width:50px;\\\" onClick=\\\"javascript:showHelp('\" . htmlentities ( $name, ENT_QUOTES, 'UTF-8' ) . \"Help');updateScore();\\\">\\n\";\n\t\n\t// If the blank is true\n\tif ($blank == true) {\n\t\techo \" <option value=\\\"\\\">--</option>\\n\";\n\t}\n\t\n\t// For each option\n\tfor($value = 0; $value <= 10; $value ++) {\n\t\t// If the option is selected\n\t\tif (\"$selected\" === \"$value\") {\n\t\t\t$text = \" selected\";\n\t\t} else\n\t\t\t$text = \"\";\n\t\t\n\t\techo \" <option value=\\\"\" . $value . \"\\\"\" . $text . \">\" . $value . \"</option>\\n\";\n\t}\n\t\n\techo \" </select>\\n\";\n}",
"public function testRemoveLastOption()\n {\n $count = count( $this->command->options );\n\n $this->command->removeOption( $this->command->options[ $count - 1 ]->longCode );\n\n $this->assertEquals( $count - 1, count( $this->command->options ) );\n }",
"function create_select_range($name, $lbound, $ubound, $increment = 1,\n $default = false, $name_function = false, $attrs = false)\n{\n $options = array();\n\n for ($i = $lbound; $i <= $ubound; $i += $increment) {\n if ($name_function !== false) {\n $text = $name_function($i);\n } else {\n $text = $i;\n }\n $options[$i] = $text;\n }\n return create_select($name, $options, $default, $attrs);\n}",
"public function endControls() {\n\t\techo PHtml::closeTag('ul');\n\t\techo PHtml::closeTag('div');\n\t}",
"function clearOptions($children = array())\n {\n $tag = strtolower($this->tag);\n $namespace = '';\n if (false !== strpos($this->tag, ':')) {\n $bits = explode(':',$this->tag);\n $namespace = $bits[0] . ':';\n $tag = strtolower($bits[1]);\n }\n\n // this is not a select element\n if (strlen($tag) && ($tag != 'select')) {\n return false;\n }\n\n // clear this select's options\n $this->children = array(null);\n $this->values = array(null);\n\n // If called with an array of new options go ahead and set them\n $this->setOptions($children);\n\n return true;\n }",
"function html_drop_down_number($name, $low, $high, $selected) {\r\n if (!$low or !$high) {\r\n $out = \"Error!!\";\r\n return $out;\r\n }\r\n if ($low >= $high) {\r\n $out = \"Wrong usage!\";\r\n return $out;\r\n }\r\n $out = \"<select name=\\\"$name\\\">\";\r\n while ($low <= $high) {\r\n if ($low == $selected and $low != \"\") {\r\n $out.=\"<option selected value=$low>$low</option>\";\r\n $low++;\r\n } else {\r\n $out.=\"<option value=$low>$low</option>\";\r\n $low++;\r\n }\r\n }\r\n $out.=\"</select>\";\r\n return $out;\r\n}",
"function select_number_tag($name, $value, $options = array(), $html_options = array())\n{\n $increment = _get_option($options, 'increment', 1);\n\n $range = array();\n $max = _get_option($options, 'end', 10) + $increment;\n for ($x = _get_option($options, 'start', 1); $x < $max; $x += $increment)\n {\n $range[(string) $x] = $x;\n }\n\n if (_get_option($options, 'reverse'))\n {\n $range = array_reverse($range, true);\n }\n\n return select_tag($name, options_for_select($range, $value, $options), $html_options);\n}",
"public function end_el(&$output, $item, $depth = 0, $args = array()) {\r\n\t\t$output .= \"</option>\\n\";\r\n\t}",
"function DISTR_commaSeperatedSelections($selName,$first,$variable,$values)\n{\n\t$singleValue = DISTR_listCommaSeperated($variable,$values);\n\n\t$out=\"<select name=\\\"$selName\\\" size=\\\"1\\\">\";\n\n\t//check if $first is set\n\tif ((strlen($first) > 0) && (in_array($first, $singleValue)))\n\t\t{\n\t\t\t$out.=\"<option value=\\\"$first\\\">$first</option>\";\n\t\t}\n\telse\n\t\t//set to a value that won't be exist\n\t\t$first = \"gdasbawtdbacyhsr648vasdztc43vdca5x43vra65we4vxd56s\";\n\n\tforeach($singleValue as $dist)\n\t\tif ($dist != $first)\n\t\t{\n\t\t\t$out.=\"<option value=\\\"$dist\\\">$dist</option>\";\n\t\t};\n\n\t$out.=\"</select>\";\n\n\treturn($out);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the name of the default primary column. | protected function get_default_primary_column_name()
{
} | [
"protected function get_primary_column_name()\n {\n }",
"protected function get_primary_column_name() {\n\t\treturn 'ID';\n\t}",
"public function defaultColumn()\n {\n return $this->fk ?: snake_case(last(explode('\\\\', get_class($this))));\n }",
"private function getTablePrimaryColumn()\n {\n $aryColumns = $this->getDbObject()->getTableColumns();\n $strPrimaryKey = '';\n foreach($aryColumns as $strKey => $aryProperties)\n {\n if(isset($aryProperties[DBTable::DB_PRIMARY]) && $aryProperties[DBTable::DB_PRIMARY] === true)\n {\n $strPrimaryKey = $strKey;\n break;\n }\n }\n return $strPrimaryKey;\n }",
"protected function get_primary_col() {\n\t\tstatic $column;\n\n\t\tif( ! isset( $column ) )\n\t\t\t$column = $this->get_column_by( true, 'primary' );\n\n\t\treturn $column;\n\t}",
"public function getTablePrimaryField(): string\n {\n return $this->getTableColumnName($this->primaryField);\n }",
"protected function getDefaultOrderByColumn(): string\n {\n return $this->getOrderByModel()->getKeyName();\n }",
"public function _current_model_primary_key(){\n $table_columns = $this->_context->meta();\n\n $primary_key_column = NULL;\n foreach ($table_columns as $col) :\n if($col->primary_key):\n $primary_key_column = $col->name;\n endif;\n endforeach;\n\n return $primary_key_column;\n }",
"public function getCustomEntityPrimaryKeyColumnName()\n {\n return self::CUSTOM_TABLE_PRIMARY_KEY_COLUMN;\n }",
"function get_primary_key_column()\n {\n return $this->_primary_key_column;\n }",
"public function getDefaultColumn(): string|null;",
"private function getPrimaryName() {\n return 'id_' . $this->table;\n }",
"public static function getPrimaryKeyColumn() {\n\t\treturn self::getInstance()->cols['id'];\n\t}",
"protected function getPkColumn() {\n\t\treturn isset($this->fields[$this->primaryKey]['column']) ?\n\t\t\t\t$this->fields[$this->primaryKey]['column'] :\n\t\t\t\t$this->primaryKey;\n\t}",
"protected function getModelKeyColumnName()\n {\n return config('inventory.model_primary_field_attribute') ?? 'inventoriable_id';\n }",
"public function getIdColumn() {\n\t\treturn $this->caseInsensitive ? strtolower($this->idColumn) : $this->idColumn;\n\t}",
"public function getDefaultDatabaseColumn(Field $field) : string\n {\n return $field->name;\n }",
"protected function getPrimaryKeyName()\n {\n return $this->primary_key;\n }",
"private function generateDefaultModelColumn(): string\n {\n return (string) Str::of(get_called_class())\n ->classBasename()\n ->replace('Relay', '')\n ->snake()\n ->append('_id');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prepare transaction request acl post | protected function _prepareAclPost(){
$acl = array();
$acl['post']['PaReq'] = $this->_response->getPareq();
$acl['action'] = $this->_response->getUrl();
$acl['post']['MD'] = $this->_createMd();
$acl['post']['TermUrl'] = $this->getCallbackUrl();
mage::getSingleton('realex/session')->setTransactionData($acl);
$this->_service->debugData(array('request'=>$this->_getHelper()->xmlToArray($acl)));
return $this;
} | [
"abstract protected function _buildPostAuthorizationRequest(Request $request);",
"public function postGenerateTransaction()\n\t{\n\t\t//if($this->_isValidRequest())\n\t\t//{\n\t\t\t$params = array(\n\t\t\t\t\t'first_name' => Input::get('first_name'),\n\t\t\t 'last_name' => Input::get('last_name'),\n\t\t\t 'email' => Input::get('email'),\n\t\t\t 'password' => Input::get('password'),\n\t\t\t\t\t'product_id' => Input::get('product_id'),\n\t\t\t\t\t'plan_id' => Input::get('plan_id'),\n\t\t\t\t\t'pay_id' => Input::get('pay_id'),\n\t\t\t\t\t'stripe_token' => Input::get('stripe_token'),\n\t\t\t\t\t'paypal_sub_id' => Input::get('paypal_sub_id'),\n\t\t\t\t\t'amount' => Input::get('amount'),\n\t\t\t\t\t'affiliate_id' => Input::get('affiliate_id'),\n\t\t\t);\n\n\t\t\tif(Transaction::addManually($params))\n\t\t\t{\n\t\t\t\tdie(json_encode(array('data'=>array('success'=>TRUE))));\n\t\t\t}\n\t\t//}\n\t}",
"protected function buildFormPostRequest()\n {\n $directRequest->setFormPost(true);\n $directRequest->setFileUpload($request->getArgument('extUpload') === 'true');\n\n $packageKey = $request->getArgument('packageKey');\n $subpackageKey = $request->hasArgument('subpackageKey') ? $request->getArgument('subpackageKey') : '';\n\n $directRequest->addTransaction(\n $request->getArgument('extAction'), $request->getArgument('extMethod'), null, $request->getArgument('extTID'), $packageKey, $subpackageKey\n );\n }",
"private function initPostRequest()\n {\n $this\n ->addCurlOption(CURLOPT_URL, $this->getUrl())\n ->addCurlOption(CURLOPT_CUSTOMREQUEST, HttpMethodResolver::HTTP_POST)\n ->addCurlOption(CURLOPT_POSTFIELDS, $this->getQuery())\n ;\n }",
"public function testCreateTransactionRequest()\n {\n }",
"public function setPseTransactionRequest($attrs){\n\n /**\n * Validating additional informatión\n */\n\n $additionalDataArray = $this->getAdditionalDataArrayObjects($attrs['additionalData']);\n\n\n /**\n * Validating and setting up the payer Person Object\n */\n $this->setPayer($attrs['payer']); \n \n /**\n * Validating and setting up the buyer Person Object\n */ \n $this->setBuyer($attrs['buyer']); \n\n /**\n * Validating and setting Shipping Person Object\n */\n $this->setShipping($attrs['shipping']); \n\n /**\n * setting additional Data\n */\n $attrs['additionalData'] = $additionalDataArray;\n\n /**\n * setting payer\n */\n $attrs['payer'] = $this->getPayer();\n\n /**\n * setting buyer\n */\n $attrs['buyer'] = $this->getBuyer();\n\n /**\n * setting shipping\n */\n $attrs['shipping'] = $this->getShipping();\n\n\n /**\n * setting ip address\n */\n $attrs['ipAddress'] = $this->getClientIp();\n\n /**\n * calidating and setting the reansaction RequestS\n */\n $this->validateSetTransactionRequest($attrs);\n\n \n }",
"private function prepareRequest()\n {\n $this->requestBody = json_encode($this->tasks);\n }",
"public function prepareTransaction();",
"public function post_transaction( $transaction );",
"abstract protected function prepareRequest(): void;",
"public function setTransactionId($transaction_id)\r\n{\r\n$this->post_data['transactionId'] = $transaction_id;\r\n}",
"protected function buildPostRequest()\n {\n $this->setUri($this->request->getUri());\n $this->setOption(CURLOPT_POST, true);\n $this->setOption(CURLOPT_POSTFIELDS, $this->request->getParameters());\n }",
"public function saveTransaction()\n {\n $transaction = Transaction::where('request_type', 'mandate_token')->where(['unique_id' => $this->id])->firstOrNew();\n\n $transaction->request_type = 'mandate_token';\n $transaction->unique_id = $this->id;\n $transaction->orderid = $this->subscription_reference;\n $transaction->response_format = $this->responseFormat ?? 'HTML';\n $transaction->request_payload = $this->list()->toJson();\n\n if (isset($this->response)) {\n $transaction->request_payload = collect($this->response)->toJson();\n }\n\n $transaction->save();\n }",
"public function testPostAuthorizables()\n {\n $client = static::createClient();\n\n $path = '/libs/granite/security/post/authorizables';\n\n $crawler = $client->request('POST', $path);\n }",
"public function addNewPreauthorisationRequest() {\n return $this->addNewTxn(self::getNewTxnByType(self::PREAUTHORISE));\n }",
"public function asPostRequest()\n {\n $url = $this->asUrl();\n\n return parent::request('POST', $url, $this->post_data, $this->fqb_access_token, $this->fqb_etag);\n }",
"protected function createRegularPaymentPOST()\n {\n $IsLive = $this->mode=='TEST'?false:true;\n $paynet = new \\PaynetClient($this->account->secret_key, $IsLive);\n \n $paymentParams \t\t\t\t = new \\PaymentParameters();\n $paymentParams->amount \t = (string) $this->amountFormat($this->order->amount);\n $paymentParams->reference_no \t= (string) $this->order->id;\n $paymentParams->pan \t = $this->card->number;\n $paymentParams->month \t = $this->card->month;\n $paymentParams->year \t = $this->card->year;\n $paymentParams->cvc \t = (string) $this->card->cvv;\n $paymentParams->card_holder_mail= (string) filter_var($this->order->email, FILTER_VALIDATE_EMAIL)?$this->order->email:\"msn@msn.com\";\n $paymentParams->description \t= (string) isset($this->order->description)?$this->order->description:\"\";\n if($this->account->is_installment){\n $paymentParams->instalment \t= (int) $this->order->installment?:0;\n }\n $paymentParams->add_commission \t= $this->account->is_commission?true:false;\n\n if($this->account->ratio_code){\n $paymentParams->ratio_code \t= (string) $this->account->ratio_code;\n }\n if($this->account->agent_id){\n $paymentParams->agent_id \t= (string) $this->account->agent_id;\n }\n $paymentParams->transaction_type= (int) $this->type;\n\n $result \t\t\t= $paynet->PaymentPost($paymentParams);\n $XactId \t\t\t= $result->xact_id;\n $this->data = $result;\n if($result->is_succeed == true and filter_var($this->order->email, FILTER_VALIDATE_EMAIL) and $this->account->is_slip_post==true){\n $SlipParams \t\t\t\t= new \\SlipParameters();\n $SlipParams->xact_id \t \t= (string) $XactId;\n $SlipParams->email \t\t\t= (string) $this->order->email;\n $SlipParams->send_mail\t\t= true;\n $SlipResult\t\t \t\t\t= $paynet->SlipPost($SlipParams);\n }\n return $this;\n }",
"public function getPostData()\n {\n $this->setMerchantOrderId(Tools::getValue('merchant_order_id'));\n $this->setHmac(Tools::getValue('hmac'));\n $this->setAction(Tools::getValue('action'));\n $this->setEmail(Tools::getValue('email'));\n $this->setFirstName(Tools::getValue('first_name'));\n $this->setLastName(Tools::getValue('last_name'));\n }",
"protected function _getRequest()\r\n {\r\n $request = Mage::getModel('paygate/authorizenet_request')\r\n ->setTerms('Y')\r\n ->setUn($this->getConfigData('login'))\r\n ->setPswd($this->getConfigData('trans_key'));\r\n\r\n return $request;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO: Implement updateCategory() method | public function updateCategory(Category $category)
{
} | [
"public function updateCategory()\n {\n $categoryXml = $this->getXmlCategory($this->_category->getId());\n $categoryXml->getElementsByTagName('parent_id')->item(0)->nodeValue = $this->_category->getParentId();\n $categoryXml->getElementsByTagName('name')->item(0)->nodeValue = $this->_category->getName();\n $categoryXml->getElementsByTagName('url')->item(0)->nodeValue = $this->_category->getUrl();\n }",
"public function modifyCategory()\n {\n $pdo = DBConfig::openConnection();\n $query = $pdo->prepare('UPDATE Categories SET Name=:Name, Description=:Description, imgURL=:imgURL WHERE classID=:classID');\n $query->bindValue(':classID', $this->classID, PDO::PARAM_STR);\n $query->bindValue(':Name', $this->name, PDO::PARAM_STR);\n $query->bindValue(':Description', $this->description, PDO::PARAM_STR);\n $query->bindValue(':imgURL', $this->imgURL, PDO::PARAM_STR);\n $query->execute();\n $query->CloseCursor();\n DBConfig::closeConnection($pdo);\n }",
"public function updateCategory()\n {\n\n /** Hook point */\n $this->hooks->call_hook('templates_updateCategory_pre');\n\n if ($this->input->post('catname') && $this->input->post('catid'))\n {\n $this->MTemplates->updateCategory($this->input->post('catname'), $this->input->post('catid'));\n\n /** Hook point */\n $this->hooks->call_hook('templates_updateCategory_success');\n\n $this->data['return']['responseCode'] = 1;\n $this->data['return']['responseHTML'] = $this->lang->line('templates_updateCategory_success');\n\n }\n else\n {\n /** Hook point */\n $this->hooks->call_hook('templates_uupdateCategory_error_missingdata');\n\n $this->data['return']['responseCode'] = 0;\n $this->data['return']['responseHTML'] = $this->lang->line('templates_updateCategory_error1');\n\n }\n\n /** Hook point */\n $this->hooks->call_hook('templates_updateCategory_post');\n\n die(json_encode($this->data['return']));\n\n }",
"private function update_categories() {\n\t\t\t$categories = get_categories();\n\t\t\tforeach ( $categories as $category ) {\n\t\t\t\t$this->connection->hmSet(\n\t\t\t\t\t'category:' . $category->term_id,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'term_id' => $category->term_id,\n\t\t\t\t\t\t'name' => $category->name,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}\n\t\t}",
"private function update() {\n // Update data\n if ($this->categories->update()) {\n redirect('categories');\n } else {\n show_error('Have problem updating category');\n }\n }",
"protected function categoryChanged() {\n if ( $url_tag_id = $this->get('url_tag_id') ) {\n // Update category_id on site url_tag record\n $url_tag = new UrlTag($this->container, $url_tag_id);\n $url_tag->update(['category_id'=>$this->get('category_id')]);\n }\n $cs = new CategorySite($this->container);\n $cs->findOrCreate(['site_id'=>$this->id(), 'category_id'=>$this->get('category_id')]);\n }",
"public function updateCategory()\n {\n\n //check if the user is logged and user permission\n if (UserManager::isUserLogged()) {\n if (UserManager::getPermission($_SESSION['email']) == ADMIN) {\n\n //check post variables\n if (isset($_POST['name'])) {\n\n //test values\n $name = Validator::testInput($_POST['name']);\n\n //session variables\n $_SESSION['update_category_name'] = $name;\n\n //check every field\n if (Validator::checkText($name)) {\n\n //create category\n $category = new CategoryModel($name, null);\n\n //try to update category\n if (CategoryManager::updateCategory($category, $_SESSION['update_category_id'])) {\n\n //delete session variables\n unset($_SESSION['update_category_name']);\n\n MessageManager::setSuccessMsg('Il nome categoria è stato modificato con successo');\n MessageManager::unsetErrorMsg();\n header('Location: ' . URL . 'category');\n exit;\n\n } else {\n MessageManager::setErrorMsg('Il nome della categoria è già utilizzato');\n }\n\n } else {\n MessageManager::setErrorMsg(\"Nome non valido, da 1 a 50 lettere\");\n }\n\n }\n\n //reload add user page\n header('Location: ' . URL . 'category/showUpdateCategoryPage/' . $_SESSION['update_category_id']);\n exit;\n }\n //redirect to catalog page\n header('Location: ' . URL . 'catalog/');\n exit;\n\n }\n header('Location: ' . URL . 'home ');\n exit;\n }",
"public function updated(Category $Category)\n {\n //code...\n }",
"public function testCreateUpdateCategory()\n {\n }",
"public function testUpdateTaskCategory()\n {\n }",
"function wp_update_category($catarr)\n {\n }",
"function loadCategory() {\n $this->category = $this->getCategory(\n $this->params['cat_id'], $this->lngSelect->currentLanguageId\n );\n $this->categoryPermissions = $this->calculatePermissions($this->category);\n $this->loadPermissions();\n }",
"public function setCategory($category) {$this->category = $category;}",
"public function updateCategoryToDb() {\r\n // redirect to Login if not login\r\n $this->redirectToLogin();\r\n\r\n $this->load->helper( 'url' );\r\n $this->load->model( 'category' );\r\n\r\n $category = array(\r\n 'category_name' => $this->input->post( 'category-name' ),\r\n 'parent_id' => $this->input->post( 'parent-id' ),\r\n 'category_desc' => $this->input->post( 'category-desc' ),\r\n 'category_cover' => $this->input->post( 'category-cover-image' )\r\n );\r\n\r\n // update category\r\n $this->db->where( 'category_id', $this->input->post( 'category_id' ) );\r\n $this->db->update( 'category_table', $category );\r\n\r\n redirect( base_url().'admin/managecategory' );\r\n }",
"public function UpdateCategoriesLowerCategoryName(){\n try{\n $mongoCriteria = new EMongoCriteria;\n $mongoModifier = new EMongoModifier;\n $categories = $this->getCategories();\n foreach ($categories as $key => $value) {\n $categoryId = $value['CategoryId'];\n $categoryname = strtolower($value['CategoryName']);\n $mongoModifier->addModifier('LowerCategoryName', 'set', $categoryname);\n $mongoCriteria->addCond('CategoryId', '==', (int) $categoryId);\n $CategoriesTagCollection = CurbSideCategoryCollection::model()->updateAll($mongoModifier, $mongoCriteria);\n }\n } catch (Exception $ex) {\n Yii::log(\"CurbSideCategoryCollection:UpdateCategoriesLowerCategoryName::\".$ex->getMessage().\"--\".$ex->getTraceAsString(), 'error', 'application');\n }\n }",
"public function categorySync()\n {\n try {\n $_categorias = $this->get_category_by_slug();\n\n if (isset($_categorias->CATEGORIES) && count($_categorias->CATEGORIES) > 0) {\n DB::beginTransaction();\n foreach ($_categorias->CATEGORIES as $category) {\n $category_data = [];\n $category_data['category_id'] = $category->category_id;\n $category_data['title'] = $category->category_title;\n $category_data['description'] = $category->category_description;\n $category_data['slug'] = $category->category_slug;\n $category_data['courses_total'] = $category->category_courses_total;\n $category_data['image'] = $category->category_image;\n $category_data['icon'] = $category->category_icon;\n $newCategory = Category::updateOrCreate(['category_id' => $category->category_id], $category_data);\n }\n DB::commit();\n }\n } catch (Throwable $th) {\n DB::rollback();\n throw $th;\n }\n }",
"function categoryUpdate($category_id, $name=''){\r\n\t\t$method='category.update';\r\n\t\t$tags=array(\r\n\t\t\t'category_id'=>$category_id,\r\n\t\t\t'name'=>$name\r\n\t\t);\r\n\t\t$response=$this->prepare_xml($method,$tags);\r\n\t\t$obj=$this->xml_obj($response);\r\n\t\treturn $obj;\r\n\t}",
"public static function updateCategory()\n {\n global $cont;\n $catId = $_POST['cat_id'];\n $catName = $_POST['cat_name'];\n $categories = $cont->prepare(\"UPDATE categories SET `name` = ? WHERE id = ?\");\n $categories->execute([$catName , $catId]);\n session_start();\n $_SESSION['message'] = \"category was updated\";\n header(\"location:../admin/pages/tables/Categories.php\");\n\n \n }",
"public function updateTaskCategoryAction()\n {\n $params = array();\n $params['title_lang1'] = $this->getPost('titleLang1');\n $params['title_lang2'] = $this->getPost('titleLang2');\n $params['parentid'] = intval($this->getPost('parentId'));\n $params['id'] = $this->getPost('id');\n $params['pic'] = $_FILES['pic'];\n\n $result = $this->_serviceModel->saveCategory($params);\n $this->echoJson($result);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test setting a maximum ABV that is too large (greater than 100). | public function testSettingAMaximumAbvThatIsTooHigh()
{
$punkApi = new PunkAPI();
$this->expectException(InvalidArgumentException::class);
$punkApi->setAbvUpperBound(107);
} | [
"function _checkMaxLimt()\r\n {\r\n if ($this->data[$this->name]['max_limit'] >= $this->data[$this->name]['min_limit']) {\r\n return true;\r\n }\r\n return false;\r\n }",
"public function testRangeCheckInclusivityOnMaximumLimit() {\n $Check = new FireCheck\\Range(0, 14, FireCheck\\Range::INCLUSIVE_CHECK);\n $code = $Check->passesCheck(14);\n $this->assertSame(FireCheck\\ErrorCodes::MAXIMUM_LIMIT_ERROR, $code);\n }",
"public function testSettingAMinimumAbvThatIsTooHigh()\n {\n $punkApi = new PunkAPI();\n $this->expectException(InvalidArgumentException::class);\n $punkApi->setAbvLowerBound(107);\n }",
"private function validateMaxBreadcrumbsOptions(int $value): bool\n {\n return $value >= 0 && $value <= self::DEFAULT_MAX_BREADCRUMBS;\n }",
"public function testCheckMaxAmount() {\n $amount = 1000;\n $this->assertTrue($this->tranche->checkMaxAmount($amount));\n }",
"function validate_max_receive($max)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (!is_numeric($max) || $max < 0)\n return lang('syncthing_max_receive_kw') . ' - ' . lang('base_invalid');\n }",
"function setMax($value) { $this->_max=$value; }",
"public function testSettingAMaximumIbuThatIsTooHigh()\n {\n $punkApi = new PunkAPI();\n $this->expectException(InvalidArgumentException::class);\n $punkApi->setIbuUpperBound(102);\n }",
"public final function setMax($max){\n\t\tif(FW_Validate::isInteger($max)){\n\t\t\t$this->max = $max;\n\t\t}\n\t}",
"function max_value_limit()\r\r\n\t{\r\r\n\t\t$required_array = array();\r\r\n\t\tif(!empty($this->max_value_limit))\r\r\n\t\t{\r\r\n\t\t\t$required_array = $this->max_value_limit;\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\tforeach($required_array as $required_element)\r\r\n\t\t{\r\r\n\t\t\tif(!empty($required_element))\r\r\n\t\t\t{\r\r\n\t\t\t\t$field_name = $required_element['field_name'];\r\r\n\t\t\t\t$max_value_of_integer = trim($required_element['max_value']);\r\r\n\t\t\t\t$value_to_check = trim($this->array_to_validate[$field_name]); \r\r\n\t\t\t\tif($value_to_check!='')\r\r\n\t\t\t\t{\t\r\r\n\t\t\t\t\tif(($value_to_check) > $max_value_of_integer)\r\r\n\t\t\t\t\t{\r\r\n\t\t\t\t\t\t$this->error_array[] = array(\r\r\n\t\t\t\t\t\t\t\t\t\t'error_field'\t=> trim($field_name),\r\r\n\t\t\t\t\t\t\t\t\t\t'error' \t\t=> constant(\"LANG_VALIDATE_FIELD_SHOULD_BE_LESS_THAN\").' '.$max_value_of_integer.'.'\r\r\n\t\t\t\t\t\t\t\t\t);\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t}\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\t}",
"public function testValidateGreaterThanMax(): void\n {\n $this->assertFalse($this->validate('40', [20, 30]));\n }",
"public function test_max_value($s_field_name, $m_max)\n\t{\n\t\t$m = $this->get_field($s_field_name);\n\t\t$b_return = ($m > $m_max) ? FALSE : TRUE;\n\t\treturn $b_return;\n\t}",
"function mf_validate_max_length($value){\r\n\t\tglobal $mf_lang;\r\n\r\n\t\t$target_value = $value[0];\r\n\t\t$exploded \t = explode('#',$value[1]);\r\n\t\t\r\n\t\t$range_limit_by = $exploded[0];\r\n\t\t$range_max\t\t= (int) $exploded[1];\r\n\t\t\r\n\t\tif($range_limit_by == 'c' || $range_limit_by == 'd'){\r\n\t\t\t$target_length = strlen($target_value);\r\n\t\t}elseif ($range_limit_by == 'w'){\r\n\t\t\t$target_length = count(preg_split(\"/[\\s\\.]+/\", $target_value, NULL, PREG_SPLIT_NO_EMPTY));\r\n\t\t}\r\n\t\t\r\n\t\tif($target_length > $range_max){\r\n\t\t\treturn 'error_no_display';\r\n\t\t}else{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}",
"public function testSettingTheMaximumIbuAndGettingTheSameValueBack()\n {\n $punkApi = new PunkAPI();\n\n // test setting a maximum IBU and getting the same value back\n $randomIbu = rand(1, 100);\n $punkApi->setIbuUpperBound($randomIbu);\n $this->assertEquals(\n $randomIbu,\n $punkApi->getIbuUpperBound()\n );\n }",
"private function valMax($field, $max){\n if(is_array($field) && sizeof($field) <= $max) return true;\n if(is_string($field) && strlen($field) <= $max) return true;\n if (is_numeric($field) && $field <= $max) return true;\n return false;\n }",
"public function testSettingAMinimumEbcThatIsTooHigh()\n {\n $punkApi = new PunkAPI();\n $this->expectException(InvalidArgumentException::class);\n $punkApi->setEbcLowerBound(28);\n }",
"function has_max_length($value) {\n\t\t\treturn strlen($value) <= $max;\n\t\t}",
"public function setMaximum($maxlength);",
"public function testGetMaxDefaultValue()\n {\n self::assertEquals(0, $this->fixture->getMax());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create the rss feed for the 10 most recent headlines | public function executeHeadlineFeed()
{
//get the 10 most recent headlines based off created_at date
$c = new Criteria();
$c->addDescendingOrderByColumn(HeadlinePeer::CREATED_AT);
$c->setLimit('10');
$headlines = HeadlinePeer::doSelect($c);
//set up the rss feed
$feed = new sfAtom1Feed();
$feed->setTitle('OpenEats Headlines');
$feed->setLink('@homepage');
$feed->setDescription('A list of news makers at the OpenEats recipe site');
//take the headline object and set the rss feed vars
foreach ($headlines as $headline)
{
$item = new sfFeedItem();
$item->setTitle($headline->getHeadlineTitle());
$item->setLink('@get_headline?headlinestriptitle='.$headline->getHeadlineStripTitle());
$item->setPubdate($headline->getCreatedAt('U'));
$item->setUniqueId($headline->getHeadlineStripTitle());
$item->setDescription($headline->getHeadlineIntro());
$feed->addItem($item);
}
$this->feed = $feed;
} | [
"function rssHeadlines()\n{\n global $app, $INCLUDE_DIR, $ACMSCfg;\n\n // Get load the RSS generator class\n //require_once($INCLUDE_DIR . \"xmlwriterclass.php\");\n //require_once($INCLUDE_DIR . \"rss_writer_class.php\");\n require_once(\"feedcreator.class.php\");\n\n $pubCount = 0; // How many headlines have we published?\n $catID = 0;\n\n $rss = new UniversalFeedCreator();\n $rss->useCached(); // use cached version if age < 1 hour\n $rss->title = $ACMSCfg['mod_stories']['rssTitle'];\n $rss->description = $ACMSCfg['mod_stories']['rssDescription'];\n $rss->link = \"http://\" . $_SERVER[\"SERVER_NAME\"] . \"/\";\n $rss->cssStyleSheet = \"http://www.w3.org/2000/08/w3c-synd/style.css\";\n $rss->syndicationURL = \"http://\" . $_SERVER[\"SERVER_NAME\"] . \"/\" . $_SERVER[\"PHP_SELF\"]; \n $rss->descriptionHtmlSyndicated = true;\n $rss->editor = \"\";\n $rss->webmaster= \"\";\n $rss->pubDate = \"\";\n $rss->category = \"\";\n $rss->docs = \"\";\n $rss->ttl = \"\";\n $rss->rating = \"\";\n $rss->skipHours = \"\";\n $rss->skipDays = \"\";\n\n $img = new FeedImage();\n $img->title = $ACMSCfg['mod_stories']['rssImgTitle'];\n $img->url = \"http://\" . $_SERVER[\"SERVER_NAME\"] . $ACMSCfg['rssImgPath'];\n $img->link = \"http://\" . $_SERVER[\"SERVER_NAME\"] . \"/\";\n $img->description = $ACMSCfg['mod_stories']['rssImgDesc'];\n $rss->image = $image;\n $rss->language = \"\";\n $rss->copyright = $ACMSCfg['mod_stories']['rssCopyright'];\n\n //error_reporting(0);\n\n // Get the chunk ID's of the stories to display.\n $curDate = date(\"Y-m-d H-i-s\");\n $expPart = \"and Chunks_story.ExpireDate > '$curDate'\";\n\n $catTable = \"\";\n $catWhere = \"\";\n if ($catID) {\n $catTable = \", CategoryItems\";\n $catWhere = \" and Chunks.ChunkID = CategoryItems.ChunkID and CategoryItems.CategoryID = $catID\";\n }\n $sql = \"select Chunks.ChunkName, Chunks_story.PostDate from Chunks, Chunks_story $catTable where Chunks.Handler = 'story' and Chunks_story.ChunkID = Chunks.ChunkID and Chunks_story.PostDate < '$curDate' $expPart $catWhere order by \" . $this->order;\n $result = mysql_query($sql, $app->acmsDB);\n if (!$result) {\n $app->writeLog(\"stories:listHeadlines - error performing query '$sql'\");\n return;\n }\n \n // If there are no stories, return.\n if (!mysql_num_rows($result)) {\n return;\n }\n\n $storyIDs = array();\n // Load them into memory. They are in order.\n while ($curRow = mysql_fetch_array($result)) {\n array_push($storyIDs, $curRow[\"ChunkName\"]);\n }\n\n $showCount = 0;\n // Go through the chunks until we're done.\n foreach($storyIDs as $chunkName) {\n $cc = new chunkClass(\"story\");\n // echo \"$chunkName<br>\";\n if ($cc->fetch($chunkName)) {\n $showIt = 1;\n // Check for a category ID\n if ($catID) {\n $showIt = $app->isInCategory($catID, $cc->get(\"ChunkID\"));\n }\n if (!$showIt) continue;\n $showCount++;\n // Search for a page separator.\n $myChunk = $this->categoryIcon($cc->get(\"ChunkID\"), 1, 1);\n $myChunk .= $cc->parse();\n $extra = \"\";\n // Since its been parsed, get the whole page break.\n if (strpos($myChunk, $this->pageSep) !== FALSE) {\n list($myChunk, $extra) = split($this->pageSep, $myChunk, 2);\n }\n $weight = $this->baseWeight+$pubCount; \n\n // We need to set the block we use as well.\n $pubCount++;\n\n $item = new FeedItem();\n $item->title = $cc->get(\"Title\");\n $item->link = \"http://\" . $_SERVER[\"SERVER_NAME\"] . \"/stories/\" . $cc->get(\"ChunkName\");\n $item->description = $myChunk;\n $item->source = \"http://\" . $_SERVER[\"SERVER_NAME\"] . \"/\";\n $item->author = $ACMSCfg['mod_stories']['rssAuthor'];\n $pDate = strtotime($cc->get(\"PostDate\"));\n $curDate = date(\"Y-m-d H-i-s\");\n $item->pubDate = date(\"Y-m-d\", $pDate) . \"T\" . date(\"H-i-s\");\n $item->date = date(\"r\", $pDate);\n $item->descriptionHtmlSyndicated =true;\n $item->descriptionTruncSize = 1000;\n $item->category = \"\";\n $item->comments = \"\";\n $item->guid = \"\";\n $rss->addItem($item);\n }\n if ($pubCount >= $this->rssCount) {\n break;\n }\n }\n\n if (!$showCount) {\n $app->addBlock(10, CONTENT_ZONE, \"Stories\", \"No matching stories were found.\");\n } else {\n // Set the page title if we need to.\n if (!strlen($app->pageTitle)) {\n if ($catID) {\n $app->setPageTitle(\"Stories - \" . $app->getCategoryTitle($catID));\n } else {\n $app->setPageTitle($this->pageTitle);\n }\n }\n }\n\n $content = \"\";\n ob_end_clean();\n echo $rss->saveFeed(\"RSS2.0\", \"/tmp/feed.xml\");\n /*\n if ($rss->writerss($content)) {\n ob_end_clean();\n header(\"Content-Type: text/xml; charset=\\\"\".$rss->outputencoding.\"\\\"\");\n Header(\"Content-Length: \".strval(strlen($content)));\n echo $content;\n } else {\n echo \"Error generating rss feed.\";\n }\n */\n exit;\n}",
"function rss() {\n require_once ANGIE_PATH . '/classes/feed/init.php';\n\n $projects = Projects::findNamesByUser($this->logged_user);\n\n $feed = new Feed($this->owner_company->getName() . ' - ' . lang('Recent activities'), ROOT_URL);\n $feed->setDescription(lang('Recent activities in active projects'));\n\n $activities = ActivityLogs::findActiveProjectsActivitiesByUser($this->logged_user, 50);\n if(is_foreachable($activities)) {\n foreach($activities as $activity) {\n $object = $activity->getObject();\n $activity_title = $activity_body = $activity->renderHead();\n $activity_title = strip_tags($activity_title);\n\n if ($activity->has_body && ($body = trim($activity->renderBody()))) {\n $activity_body.=$body;\n } // if\n\n $item = new FeedItem($activity_title, $object->getViewUrl(), $activity_body, $activity->getCreatedOn());\n $item->setId(extend_url($object->getViewUrl(), array('guid' => $activity->getId())));\n $feed->addItem($item);\n } // foreach\n } // if\n\n print render_rss_feed($feed);\n die();\n }",
"public function rssFeedAction()\n {\n $rss = new RssReader('http://www.vg.no/rss/nyfront.php?frontId=1');\n $rss->fetchData();\n $rss->sortDataByDate();\n\n $this->view->articles = $rss->getData();\n }",
"private function makeRSS() {\r\n\t\t//header('Content-Type: application/rss+xml; charset=ISO-8859-1');\r\n\t\theader('Content-Type: text/xml; charset=ISO-8859-1');\r\n\r\n\t\t//header\r\n\t\t$this->feed = '<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>'.PHP_EOL;\r\n\t\t$this->feed.= '<!-- generator=\"open[qoob]\" -->'.PHP_EOL;\r\n\t\t$this->feed.= '<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">'.PHP_EOL;\r\n\t\t//channel\r\n\t\t$this->feed.= ' <channel>'.PHP_EOL;\r\n\t\t$this->feed.= ' <title>'.$this->title.'</title>'.PHP_EOL;\r\n if($this->descriptionHtml){\r\n\t\t\t$this->feed.= ' <description><![CDATA['.$this->description.']]></description>'.PHP_EOL;\r\n\t\t} else {\r\n\t\t\t$this->feed.= ' <description>'.$this->description.'</description>'.PHP_EOL;\r\n\t\t}\r\n\t\t$this->feed.= ' <link>'.$this->link.'</link>'.PHP_EOL;\r\n $this->feed.= ' <lastBuildDate>'.date(\"r\", time()).'</lastBuildDate>'.PHP_EOL;\r\n $this->feed.= ' <generator>open[qoob]</generator>'.PHP_EOL;\r\n $this->feed.= ' <atom:link href=\"'.RAW_URL.'\" rel=\"self\" type=\"application/rss+xml\" />'.PHP_EOL;\r\n //body\r\n for($i=0; $i<count($this->posts); $i++) {\r\n \t$this->feed.= ' <item>'.PHP_EOL;\r\n \t$this->feed.= ' <title>'.$this->posts[$i]['title'].'</title>'.PHP_EOL;\r\n \t$this->feed.= ' <link>'.$this->posts[$i]['link'].'</link>'.PHP_EOL;\r\n \t$this->feed.= ' <guid>'.$this->posts[$i]['link'].'</guid>'.PHP_EOL;\r\n\t if($this->posts[$i]['descriptionHtml']){\r\n\t\t\t\t$this->feed.= ' <description><![CDATA['.$this->posts[$i]['description'].']]></description>'.PHP_EOL;\r\n\t\t\t} else {\r\n\t\t\t\t$this->feed.= ' <description>'.$this->posts[$i]['description'].'</description>'.PHP_EOL;\r\n\t\t\t}\r\n\t\t\t$this->feed.= ' <author>'.$this->posts[$i]['author'].'</author>'.PHP_EOL;\r\n\t\t\t//$this->feed.= ' <category>technology</category>'.PHP_EOL;\r\n\t\t\t$this->feed.= ' <pubDate>'.date(\"r\", $this->posts[$i]['date']).'</pubDate>'.PHP_EOL;\r\n \t$this->feed.= ' </item>'.PHP_EOL;\r\n }\r\n //footer\r\n\t\t$this->feed.= ' </channel>'.PHP_EOL;\r\n\t\t$this->feed.= '</rss>'.PHP_EOL;\r\n\t}",
"public function rss() {\n $rss = new RSSFeed($this->Children(), $this->Link(), 'Latest News');\n $rss->outputToBrowser();\n }",
"public static function generateRssFeeds()\n {\n $newsmanager = new NewsManager();\n if (count(rex_clang::getAll()) >= 1) {\n foreach (rex_clang::getAll() as $key => $lang) {\n if ($lang->isOnline()) {\n $newsmanager->generateRssFeed($lang);\n }\n }\n }\n }",
"public static function getFeeds()\n\t{\n\t\t$rssUrl = Yii::app()->user->getState('rss_url');\n\t\t$rawFeed = file_get_contents($rssUrl);\n\t\tif($rawFeed!='') {\n\t\t\t// give an XML object to be iterate\n\t\t\t$xml = new SimpleXMLElement($rawFeed);\n\t\t\t$criteria = new CDbCriteria();\n\t\t\t$criteria->condition = 't.company_id=:company_id';\n\t\t\t$criteria->params = array(':company_id'=>Yii::app()->user->getState('globalId'));\n\t\t\t$rss_notification = RssNotification::model()->find($criteria);\n\t\t\t\n\t\t\t$post_pubDate = \"\";\n\t\t\t$post_url = \"\";\n\t\t\t$post_title = \"\";\n\t\t\t$data = '';\n\t\t\tforeach($xml->channel->item as $item)\n\t\t\t{\n\t\t\t\t$post_pubDate = $item->pubDate;\n\t\t\t\t$post_url = self::strip_cdata($item->link);\n\t\t\t\t$post_title = self::strip_cdata($item->title);\n\t\t\t\tif(strtotime($post_pubDate)>strtotime($rss_notification->last_post_pubDate)) {\n\t\t\t\t\t$data.= $post_pubDate;\n\t\t\t\t\t$data.= \"\\n\";\n\t\t\t\t\t\n\t\t\t\t\t$info = new Info();\n\t\t\t\t\t$info->user_id = Yii::app()->user->getState('userId');\n\t\t\t\t\t$info->company_id = Yii::app()->user->getState('globalId');\n\t\t\t\t\t$info->access_level_id = 1;\n\t\t\t\t\t$info->info_type_id = 2;\n\t\t\t\t\t$info->title = $post_title; \n\t\t\t\t\t$info->content = $post_url;\n\t\t\t\t\t$info->date_create = date('Y-m-d H:i:s', strtotime($post_pubDate));\n\t\t\t\t\t$info->save();\n\t\t\t\t}\n\t\t\t}\n\t\t\t//update the last post date time to now\n\t\t\tRssNotification::model ()->updateByPk ( $rss_notification->id, array (\n\t\t\t\t'last_post_pubDate' => date('Y-m-d H:i:s')\n\t\t\t) );\n\t\t\techo $data;\n\t\t}\n\t}",
"function generate_rss_podcast_feed() {\n //Open new file to write\n $rss_feed_file = new SplFileObject(\"../ccnice_rss.xml\",\"w\");\n\n // Retrieve the 100 most recent entries\n $result = $this->pdo->query('SELECT * FROM files WHERE publishedfile = 1 ORDER BY date DESC LIMIT 100');\n\n // Write the head of the file\n $feed_head = ''; //TODO\n\n // Build item list\n \n // Build feed tail\n $feed_tail = '</channel></rss>';\n\n // Concatenate the 3 parts and then write to the file\n\n\n\n $rss_feed_file->fwrite($rss_feed);\n $rss_feed_file = null;\n\n return;\n }",
"function wd_news() {\n\t\t\tinclude_once( ABSPATH . WPINC . '/feed.php' );\n\t\t\tif ( $rssobj = fetch_feed( 'https://webdesires.co.uk/feed/' ) ) {\n\t\t\t\t\n\t\t\t\t$content = '<ul>';\n\t\t\t\t$maxitems = $rssobj->get_item_quantity( 5 ); \n\n\t\t\t\t// Build an array of all the items, starting with element 0 (first element).\n\t\t\t\t$rss = $rssobj->get_items( 0, $maxitems );\n\t\t\t\t\n\t\t\t\tforeach ( $rss as $item ) {\n\t\t\t\t\t$content .= '<li class=\"schema\">';\n\t\t\t\t\t$content .= '<a class=\"rsswidget\" href=\"'.clean_url( $item->get_permalink(), $protocolls=null, 'display' ).'\">'. htmlentities($item->get_title()) .'</a> ';\n\t\t\t\t\t$content .= '</li>';\n\t\t\t\t}\n\t\t\t\t$this->postbox('schemalatest', 'Latest from WebDesires Blog', $content);\n\t\t\t} else {\n\t\t\t\t$this->postbox('schemalatest', 'Latest from WebDesires Blog', 'Nothing to say...');\n\t\t\t}\n\t\t}",
"function cdc_get_top_stories( $number_of_days = 1, $posts_per_page = 5 ){\n\t$output = array();\n\t$cache_key = 'cdc_top_posts_' . $number_of_days . '_' . $posts_per_page;\n\t\n\tif ( function_exists( 'wpcom_vip_top_posts_array' ) ) {\n\t\t$top_posts = wp_cache_get( $cache_key );\n\n\t\tif( false === $top_posts ) {\n\t\t\t$top_posts = wpcom_vip_top_posts_array( $number_of_days, $posts_per_page );\n\n\t\t\tif( is_array( $top_posts ) ) {\n\t\t\t\t$filtered_top_posts = array();\n\n\t\t\t\tforeach( $top_posts as $top_post ) {\n\t\t\t\t\t$post = get_post( $top_post['post_id'] );\n\n\t\t\t\t\tif( $post && $post->post_type == 'post' )\n\t\t\t\t\t\t$filtered_top_posts[] = $top_post;\n\t\t\t\t}\n\n\t\t\t\t$top_posts = $filtered_top_posts;\n\t\t\t}\n\n\t\t\twp_cache_add( $cache_key, $top_posts );\n\t\t}\n\n\t\tif ( is_array( $top_posts ) )\n\t\t\t$output = $top_posts;\n\t} else {\n\t\t$args = array(\n\t\t\t'numberposts' => (int) $posts_per_page,\n\t\t\t'orderby' => 'modified'\n\t\t);\n\n\t\t$rand_posts = get_posts( $args );\n\t\t$views = 10;\n\n\t\tforeach( $rand_posts as $post ) :\n\t\t\t$output[] = array(\n\t\t\t\t'post_id' => $post->ID,\n\t\t\t\t'post_title' => get_the_title( $post->ID ),\n\t\t\t\t'post_permalink' => get_permalink( $post->ID ),\n\t\t\t\t'views' => $views\n\t\t\t);\n\n\t\t\t$views--;\n\t\tendforeach;\n\t}\n\t\n\treturn $output;\n}",
"function fullhistory_xml_head() {\n\tglobal $wp_query;\n\t$found_posts = $wp_query->found_posts;\n\t$per_page = get_query_var( 'posts_per_page' );\n\n\t// If the total number of posts fits within a single page, use RFC5005\n\t// section 2 (\"Complete Feeds\").\n\tif ( $found_posts <= $per_page ) {\n\t\techo \"\\t<fh:complete xmlns:fh=\\\"http://purl.org/syndication/history/1.0\\\"/>\\n\";\n\t\treturn;\n\t}\n\n\t// Otherwise, use the more complicated section 4 (\"Archived Feeds\").\n\t// Namespaces vary based on whether this is an RSS or an Atom feed, so\n\t// look that up now.\n\t$feed_type = get_query_var( 'feed' );\n\tif ( 'feed' === $feed_type ) {\n\t\t$feed_type = get_default_feed();\n\t}\n\n\t// WordPress 5.3.0 provides \"get_self_link()\" but this is a copy of that\n\t// function to support earlier versions. Code style warnings are\n\t// suppressed here because this is how it works in core.\n\t$host = wp_parse_url( home_url() );\n\t$self = set_url_scheme( 'http://' . $host['host'] . wp_unslash( $_SERVER['REQUEST_URI'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized\n\n\t// Strip off query parameters which we use for archive pages, to get a\n\t// feed URL that is a reasonable choice for \"current\" feed.\n\t$current_feed = remove_query_arg( array( 'order', 'orderby', 'paged', 'modified' ), $self );\n\n\t// Only allow feed pages to be considered archived if they are in\n\t// ascending order by modification date, so their contents stay\n\t// relatively stable.\n\tif ( get_query_var( 'order' ) === 'ASC' && get_query_var( 'orderby' ) === 'modified' ) {\n\t\t// If this _is_ an archived page, then RFC5005 says we \"SHOULD\"\n\t\t// both mark it as an archive and also link to the current\n\t\t// syndication feed that this archive belongs to.\n\t\techo \"\\t<fh:archive xmlns:fh=\\\"http://purl.org/syndication/history/1.0\\\"/>\\n\";\n\t\tfullhistory_atom_link( $feed_type, 'current', $current_feed );\n\n\t\t// Note: The 'paged' query variable is reported as 0 if unspecified.\n\t\t$prev_page = get_query_var( 'paged' ) - 1;\n\t} else {\n\t\t// Otherwise, set up a prev-archive link under the assumption\n\t\t// that the feed we're generating right now is the current\n\t\t// syndication document.\n\t\t//\n\t\t// Note: WordPress supports a lot of possible query parameters\n\t\t// that could change which entries we're returning right now,\n\t\t// so this assumption could lead to weird results. But\n\t\t// automatic tools won't usually be looking for RFC5005\n\t\t// metadata in feeds with odd query parameters set, so it\n\t\t// should be harmless.\n\t\t//\n\t\t// Point to the newest page, which may not be complete yet, but\n\t\t// that's okay because as it changes the link computed below\n\t\t// will change.\n\t\t$prev_page = (int) ceil( $found_posts / $per_page );\n\t}\n\n\t// Only page 2 and later can have a prev-archive link, since there is\n\t// no archive earlier than page 1.\n\tif ( $prev_page >= 1 ) {\n\t\t// Repeat the current query, but one page earlier, and only the\n\t\t// last (most recently modified) post from that page. If this\n\t\t// wasn't already a query for an archive page, then the\n\t\t// order/orderby parameters may need to be overridden.\n\t\t$prev_query = new WP_Query(\n\t\t\tarray_merge(\n\t\t\t\t$wp_query->query_vars,\n\t\t\t\tarray(\n\t\t\t\t\t'no_found_rows' => true,\n\t\t\t\t\t'order' => 'ASC',\n\t\t\t\t\t'orderby' => 'modified',\n\t\t\t\t\t'posts_per_rss' => 1,\n\t\t\t\t\t'offset' => $prev_page * $per_page - 1,\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t$prev_post = $prev_query->posts[0];\n\n\t\t// The combination of modification time (in GMT, so time-zone\n\t\t// changes don't affect this) and the post's URL should be\n\t\t// enough to trigger a cache update if anything important\n\t\t// changes.\n\t\t$mod_key = implode(\n\t\t\t'|',\n\t\t\tarray(\n\t\t\t\t$prev_post->post_modified_gmt,\n\t\t\t\tget_permalink( $prev_post ),\n\t\t\t)\n\t\t);\n\n\t\t// Turn the key into a short URL-safe string. This doesn't need\n\t\t// to be secure: if someone with control of the site wants to\n\t\t// make RSS readers not see some updates, they have easier\n\t\t// options already. It just needs to give good odds that if the\n\t\t// key parameters change, the hash will also change.\n\t\t$mod_key = hash( 'fnv1a64', $mod_key );\n\n\t\t// Earlier, $current_feed was constructed by stripping off all\n\t\t// the order, orderby, modified, and paged query parameters.\n\t\t// Construct a new link by adding them back now with the right\n\t\t// values.\n\t\t$prev_archive = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'order' => 'ASC',\n\t\t\t\t'orderby' => 'modified',\n\t\t\t\t'modified' => $mod_key,\n\t\t\t),\n\t\t\t$current_feed\n\t\t);\n\n\t\t// Linking to page 1 is special because if you pass 'paged=1',\n\t\t// WordPress redirects to a canonical URL with that page number\n\t\t// removed. Rather than triggering an extra HTTP request due to\n\t\t// the redirect, skip adding the query parameter in that case.\n\t\tif ( $prev_page > 1 ) {\n\t\t\t$prev_archive = add_query_arg( 'paged', $prev_page, $prev_archive );\n\t\t}\n\n\t\tfullhistory_atom_link( $feed_type, 'prev-archive', $prev_archive );\n\t}\n}",
"protected function _getRssFeed( $items = 5 )\n\t{\n\t\t$_baseUrl = $_url = PS::_gp('appUrl');\n\t\t$_rssDataUrl = $_baseUrl . '/?rss';\n\n\t\t$_rssData = <<<HTML\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t<rss xmlns:atom=\"http://www.w3.org/2005/Atom\" version=\"2.0\">\n\t\t<channel>\n\t\t\t<title>Generation Station: Recent Posts</title>\n\t\t\t<link target=\"_top\" rel=\"_top\"><![CDATA[{$_rssDataUrl}]]></link>\n\t\t <atom:link type=\"application/rss+xml\" href=\"{$_rssDataUrl}\" rel=\"self\"/>\n\t\t\t<description>Generation Station: Recent Posts</description>\n\t\t\t<language>en-us</language>\nHTML;\n\n \t\t$_users = User::model()->findAll(\n\t\t\tarray(\n\t\t\t\t'select' => 'pform_user_id_text, high_score_nbr, full_name_text',\n\t\t\t\t'condition' => 'pform_type_code = 1000',\n\t\t\t\t'limit' => $items,\n\t\t\t\t'order' => 'high_score_nbr desc'\n\t\t\t)\n\t\t);\n\n\t\t$_count = 1;\n\n\t\tforeach ( $_users as $_user )\n\t\t{\n\t\t\t$_displayName = PS::nvl( $_user->full_name_text, 'Mystery Player' );\n\t\t\t$_score = number_format( $_user->high_score_nbr, 0);\n\t\t\t$_details =<<<HTML\n\t\t<div style=\"text-align:center!important;width:150px!important;border:2px solid #ccc!important;-moz-border-radius:8px!important;-webkit-border-radius:8px!important;\">\n\t\t\t#{$_count}<br />\n\t\t\t<img src=\"http://graph.facebook.com/{$_user->pform_user_id_text}/picture\" /><br />\n\t\t\t{$_displayName}<br />\n\t\t\t{$_score}\n\t\t</div>\nHTML;\n\n\t\t\t$_rssData .=<<<HTML\n\t\t\t<item>\n\t\t\t\t<title><![CDATA[{$_displayName}]]></title>\n\t\t\t\t<link target=\"_top\" rel=\"_top\"><![CDATA[{$_url}]]></link>\n\t\t\t\t<description><![CDATA[{$_details}]]></description>\n\t\t\t</item>\nHTML;\n\n\t\t\t$_count++;\n\t\t}\n\n\t\t$_rssData .= '</channel></rss>';\n\n\t\treturn $_rssData;\n\t}",
"public function rss_updates()\n\t{\n\t\t$info = array(\n\t\t\t'title' \t\t=> 'Chocobo Riding - Mises à jour',\n\t\t\t'link'\t\t\t=> 'http://chocobo-riding.menencia.com',\n\t\t\t'description' \t=> \"Fil RSS des mises à jour de Chocobo Riding.\");\n\t\t$items = array();\n\t\t\n\t\t$topics = ORM::factory('topic')\n\t\t\t->where('theme_id', 1)\n\t\t\t->where('status', 0)\n\t\t\t->orderby('created', 'desc')\n\t\t\t->find_all(20);\n\t\t\n\t\tforeach ($topics as $topic)\n\t\t{\n\t\t \t$comment = $topic->comments[0];\n\t\t \t\n\t\t \t$items[] = array(\n\t\t \t\t'title'\t\t\t=> $topic->title,\n\t\t \t'link' \t\t\t=> 'http://chocobo-riding.menencia.com/topic/view/'.$topic->id,\n\t\t \t'guid' \t\t\t=> 'http://chocobo-riding.menencia.com/topic/view/'.$topic->id,\n\t\t \t'description' \t=> nl2br($comment->content),\n\t\t \t//'author' \t\t=> $post->user->username,\n\t\t \t'pubDate' \t=> date('D\\, j M Y H\\:i\\:s ', $topic->created).\"+0400\"\n\t\t );\n\t\t}\n\t\t\n\t\techo feed::create($info, $items);\n\t\t$this->profiler = null;\n $this->auto_render = false;\n header(\"content-type: application/xml\");\n\t}",
"function wt_build_news($itemLimit)\r\n{\r\ndefine(\"UPDATE_HOURS\", 2);\r\n$rssFilename = \"rss/health.rss\";\r\n$urls[] = \"http://www.after50health.com/feed\";\r\n$urls[] = \"http://z.about.com/6/g/nutrition/b/rss2.xml\";\r\n$urls[] = \"http://rss.msnbc.msn.com/id/13594277/device/rss/rss.xml\";\r\n$urls[] = \"http://feeds.ezinearticles.com/category/Health-and-Fitness:Weight-Loss.xml\";\r\n$urls[] = \"http://rssfeeds.usatoday.com/Usatodaycom-Weightloss\";\r\n$urls[] = \"http://www.weightlossrss.net/?feed=rss2\";\r\n$urls[] = \"http://rss.msnbc.msn.com/id/3034510/device/rss/rss.xml\";\r\n$urls[] = \"http://topics.nytimes.com/topics/reference/timestopics/subjects/e/exercise/index.html?rss=1\";\r\n$urls[] = \"http://www.fitness.com/generated/rss_exercises.xml\";\r\n$urls[] = \"http://feeds.health.com/health/eating?format=xml\";\r\n$urls[] = \"http://rss.allrecipes.com/daily.aspx?hubID=84\";\r\n$inFile = @file_get_contents($rssFilename);\r\n$writeFlg = false;\r\n\r\n$inFile = explode(\"|**|\",$inFile,2);\r\n// rebuild every 2 hours\r\nif (!$inFile || (strtotime(\"now\") - $inFile[0] > (UPDATE_HOURS * 60 * 60)))\r\n{\r\n\t$news = \"\";\r\n\trequire(\"magpie/rss_fetch.inc\");\r\n\tshuffle($urls);\r\n\t$itemCnt = 0;\r\n\tforeach($urls as $url)\r\n\t{\r\n\t\t$rss = @fetch_rss($url);\r\n\t\tif ($rss)\r\n\t\t{\r\n\t\t\t$titleFlg = true;\r\n\t\t\tfor ($i = 0; $i < min(5,sizeof($rss->items)); $i++)\r\n\t\t\t{\r\n\t\t\t\t$item = $rss->items[$i];\r\n\t\t\t\tif (!isset($item['pubdate'])) \r\n\t\t\t\t\t$pubdate = date(\"Y-m-d\");\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$pDate = explode(\" \",trim($item['pubdate']));\r\n\t\t\t\t\t$pubdate = \"\";\r\n\t\t\t\t\tfor ($k=0; $k < 4; $k++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (isset($pDate[$k]))\r\n\t\t\t\t\t\t\t$pubdate .= $pDate[$k].\" \";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (isset($item['title']) && isset($item['description']) && isset($item['link'])\r\n\t\t\t\t\t&& (strtotime(\"now\") - strtotime($pubdate)) <= (8 * 24 * 60 * 60)) \r\n\t\t\t\t{\r\n\t\t\t\t\tif ($titleFlg)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$news .= \"<h3>\".$rss->channel['title'].\"</h3>\";\r\n\t\t\t\t\t\t$titleFlg = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$news .= \"<h3>\".$item['title'].\"</h3>\";\r\n\t\t\t\t\t$news .= \"<p>\".$item['description'].\"</p>\";\r\n\t\t\t\t\t//if (isset($item['pubdate'])) $news .= \"<p>\".$item['pubdate'].\"</p>\";\r\n\t\t\t\t\t$news .= \"<p>Full story: <a href='\".$item['link'].\"'>\".$item['link'].\"</a></p>\";\r\n\t\t\t\t\t$itemCnt += 1;\r\n\t\t\t\t\tif ($itemCnt >= $itemLimit) break 2;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$news = $inFile[1];\r\n\t\t}\r\n\t}\r\n\t$writeFlg = true;\r\n}\r\nelse\r\n{\r\n\t$news = $inFile[1];\r\n}\r\n$outFile[] = strtotime(\"now\").\"|**|\";\r\n$outFile[] = $news;\r\nif ($writeFlg) file_put_contents($rssFilename,$outFile);\r\nreturn $news;\r\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}",
"function generate_rss($posts){\n\t\n\t$feed = new Feed();\n\t$channel = new Channel();\n\t\n\t$channel\n\t\t->title(config('blog.title'))\n\t\t->description(config('blog.description'))\n\t\t->url(site_url())\n\t\t->appendTo($feed);\n\n\tforeach($posts as $p){\n\t\t\n\t\t$item = new Item();\n\t\t$item\n\t\t\t->title($p->title)\n\t\t\t->description($p->body)\n\t\t\t->url($p->url)\n\t\t\t->appendTo($channel);\n\t}\n\t\n\techo $feed;\n}",
"function do_feed_rss() {}",
"public function rssFeedsAction()\r\n {\r\n $feed = new \\Zend\\Feed\\Writer\\Feed;\r\n $feed->setTitle('My Newsstand');\r\n $feed->setLink('http://my.news.app');\r\n $feed->setFeedLink('http://my.news.app', 'atom');\r\n $feed->addAuthor(array(\r\n 'name' => 'Test',\r\n 'email' => 'test@gmail.com',\r\n 'uri' => BASE_URL,\r\n ));\r\n $feed->setDateModified(time());\r\n $feed->addHub(BASE_URL);\r\n \r\n $entry = $feed->createEntry();\r\n $entry->setTitle('Top 10 Latest News');\r\n $entry->setLink(BASE_URL);\r\n $entry->addAuthor(array(\r\n 'name' => 'Test',\r\n 'email' => 'test@gmail.com',\r\n 'uri' => BASE_URL,\r\n ));\r\n $entry->setDateModified(time());\r\n $entry->setDateCreated(time());\r\n $entry->setDescription('This RSS feed includes latest 10 news articles');\r\n $entry->setContent(\r\n 'I am not writing the article. The example is long enough as is ;).'\r\n );\r\n $feed->addEntry($entry);\r\n \r\n $out = $feed->export('atom');\r\n \r\n echo $out;\r\n }",
"protected function getContentsRss1()\n {\n $index = 0;\n\n foreach($this->_datas->item as $post) {\n $dcData = $post->children('http://purl.org/dc/elements/1.1/');\n\n $row = array(\n 'title' => $post->title->__toString(),\n 'pubDate' => $dcData->date->__toString(),\n 'datetime' => new DateTime($dcData->date->__toString()),\n 'link' => $post->link->__toString(),\n 'description' => html_entity_decode($post->description->__toString()),\n 'content' => html_entity_decode($this->_datas->item[$index]->children('content', true)->encoded->__toString()),\n 'author' => $dcData->creator->__toString(),\n 'category' => array(),\n 'tag' => array(), // TODO: Unimplemented\n );\n\n // Check PR Entry\n if(strpos($row['title'], 'PR:') !== false) {\n continue;\n }\n\n foreach($dcData->subject as $category) {\n $row['category'][] = $category->__toString();\n }\n\n $this->_posts[] = $row;\n $index ++;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/Lista Professor para o select | public function databaseAltTurmaListProfessor() {
/*Instancia o objeto de acesso ao banco*/
$objDataBase = new conexao();
$conect = $objDataBase->bd();
$query = "SELECT uf.id, u.nome
FROM usuario u";
$query .= " JOIN usuario_funcao uf
ON u.id = uf.usuarioid";
$query .= " JOIN funcao f
ON uf.funcaoid = f.id";
$query .= " WHERE f.funcao = 'professor'";
$query .= " ORDER BY u.nome ASC";
$result = mysqli_query($conect, $query);
return $result;
} | [
"function profsList(){\n\t\t\n\t\t//Call Connection function\n\t\t$conn = manageExamApplication::dbConn();\n\t\t\n\t\t//Fetch all records from user table\n\t\t$query = $conn->prepare(\"SELECT id,prenom FROM user\"); \n\t\t$query->execute();\n\t\t\n\t\t//Intialize variable\n\t\t$profs = '';\n\t\t\n\t\t\n\t\t//Execute Loop\n\t\twhile ($prof = $query->fetch()){\n\t\t\t$profs .= '<option value=\"'.$prof['id'].'\">'.$prof['prenom'].'</option>';\n\t\t} \n\t\t//Echo users list\n\t\techo $profs;\n\t}",
"public function getSelectProyecto()\n {\n //Instancia de informes\n $informes = new informes();\n //Lista del menu Nivel 1\n $listaProyectos = $informes->getProyectos();\n //Se recorre array de nivel 1\n if (isset($listaProyectos)) {\n echo '<option selected value=\"0\">Todos...</option>';\n for ($i = 0; $i < sizeof($listaProyectos); $i++) {\n //Valida si es el valor\n if ($valor == $listaProyectos[$i][\"id_proyecto\"]) {\n $seleccionado = \"selected\";\n } else {\n $seleccionado = \"\";\n }\n echo '<option value=\"' . $listaProyectos[$i][\"id_proyecto\"] . '\" ' . $seleccionado . '>' . $listaProyectos[$i][\"nombre_proyecto\"] . '</option>';\n }\n }\n }",
"public function llenaTipoPresupuesto()\n {\n\n $db = new Conexion();\n $sql = $db->query(\"SELECT * FROM tipo_presupuesto\");\n while ($registros = $db->recorrer($sql)) {\n ?>\n\t\t\t<option <?php echo 'value=\"' . $registros[\"idtipo_presupuesto\"] . '\"';\n if ($registros[\"idtipo_presupuesto\"] == $this->tipo_presupuesto_fijo) {echo ' selected';}\n ?>>\n\t\t\t\t<?=$registros[\"denominacion\"]?>\n\t\t\t</option>\n\t\t\t<?\n }\n\n }",
"function listeProfs()\r\n{\r\n\treturn SelectQueryMultiple('SELECT * FROM PROF ORDER BY PR_nom, PR_prenom');\r\n}",
"public function combobox_docentes()\n {\n $query = $this->conn->prepare(\"SELECT id_docente,nombres, prim_apellido FROM docente WHERE id_tipo_usuario = '3'\");\n $query->execute();\n \n while($row=$query->fetch(PDO::FETCH_ASSOC))\n {\n echo '<option value=\"'.$row['id_docente'].'\">'.$row['nombres'].' '.$row['prim_apellido'].'</option>'; \n }\n\n }",
"public function select($pregunta);",
"function GetSelectProvincias(){\n\t$default=0;\n\t\n\t$sql = \"SELECT pv_codigo id, pv_descripcion descripcion\n\t\t\tFROM cpv_provincias\n\t\t WHERE pv_fechabaja IS NULL\n\t\tORDER BY pv_descripcion\";\n\t\t\n\t$result = CreateSelectHTML($sql, 'Provincia', 'width:100%;', $default);\n\n\treturn $result; \t\t \n}",
"public function select($persona_has_grupo);",
"public function select($colaborador);",
"public function selectCliente() {\n $this->consulta2= $this->con->query(\"SELECT * FROM usuarios WHERE privilegio = 4 ORDER BY apellido,nombre ASC\");\n while ($this->datos2= $this->consulta2->fetch_array()) {\n ?>\n <option value=\"<?php echo $this->datos2['idUsuario']; ?>\"><?php echo $this->datos2['apellido'].\", \".$this->datos2['nombre']; ?></option>\n <?php\n }\n $this->con->close();\n }",
"private function getDadosProfessores(){\n $a_professor = new ProfessorModel();\n return $a_professor->_list();\n }",
"public function select($peticiones_analisis);",
"function getComboResponsaveis(){\n\t\t\t$usuario = new Usuario;\n\t\t\t$permissao = new Permissao;\n\t\t\t$usuario\n\t\t\t\t->alias('u')\n\t\t\t\t->join($permissao,'inner','up','id_usuario','id_usuario')\n\t\t\t\t->where('id_projeto='.$_SESSION['id_projeto_logado'].' and tipo <> 3')\n\t\t\t\t->order('u.nome')\n\t\t\t\t->find();\n\t\t\t$usuarios = $usuario->allToArray();\n\t\t\t\n\t\t\tforeach($usuarios as $item) {\n\t\t\t\t$result .= '<option value=\"'.$item['id_usuario'].'\"';\n\t\t\t\tif (!empty($_SESSION['upd_requisicao'])) {\n\t\t\t\t\tif($item['id_usuario']==$_SESSION['obj_requisicao']['id_usuario_responsavel']) $result .= ' selected';\n\t\t\t\t}\n\t\t\t\tif($_SESSION['responsavel_log'] == $item['id_usuario']) $result .= ' selected';\n\t\t\t\t$result .= '>'.$item['nome'].'</option>';\n\t\t\t}\n\t\t\treturn $result;\n\t\t}",
"function selectQuestionDetailParticipationsList()\n\t{\n\t\t\t\n\t\t$tblNameList = array(\n\t\t\t'nq_participations', 'nq_participants'\n\t\t);\n\t\t\n\t\t$nameTables = get_module_course_tbl($tblNameList, claro_get_current_course_id());\n $sql = \"select nq_participations.IDParticipant, nq_participations.IDQuestion, nq_participations.Pointage, nq_participations.PointageAuto, nq_participations.ReponseHTML, nq_participants.IDParticipant, nq_participants.Prenom, nq_participants.Nom, nq_participants.Groupe, nq_participants.Matricule, nq_participants.Courriel, nq_participants.Coordonnees, nq_participants.ParticipationDate, nq_participants.Final, nq_participants.IDQuiz, nq_participants.Actif, UNIX_TIMESTAMP(nq_participants.ParticipationDate) as ParticipationDateUT from `\".$nameTables['nq_participations'].\"` AS nq_participations, `\".$nameTables['nq_participants'].\"` AS nq_participants where nq_participations.IDQuestion = '\".$this->getIdQuestion().\"' and nq_participations.IDParticipant = nq_participants.IDParticipant\";\n\t\tif ( false !== ($result = claro_sql_query_fetch_all_rows($sql)) )\n\t\t{\n\t\t\treturn $result;\n\t\t}\n\t\telse\n\t\t{\t\t\t\t\n\t\t\treturn claro_failure::set_failure('SELECTED_FAILED');\n\t\t}\n\t\t\t\n\t}",
"function selectQuestionDetailParticipationsListCurrentUser()\n\t{\n\t\t\t\n\t\t$tblNameList = array(\n\t\t\t'nq_participations', 'nq_participants'\n\t\t);\n\t\t\n\t\t$nameTables = get_module_course_tbl($tblNameList, claro_get_current_course_id());\n $sql = \"select nq_participations.IDParticipant, nq_participations.IDQuestion, nq_participations.Pointage, nq_participations.PointageAuto, nq_participations.ReponseHTML, nq_participants.IDParticipant, nq_participants.Prenom, nq_participants.Nom, nq_participants.Groupe, nq_participants.Matricule, nq_participants.Courriel, nq_participants.Coordonnees, nq_participants.ParticipationDate, nq_participants.Final, nq_participants.IDQuiz, nq_participants.Actif, UNIX_TIMESTAMP(nq_participants.ParticipationDate) as ParticipationDateUT from `\".$nameTables['nq_participations'].\"` AS nq_participations, `\".$nameTables['nq_participants'].\"` AS nq_participants where nq_participants.currentUserId = '\".$this->getCurrentUserid().\"' and nq_participations.IDQuestion = '\".$this->getIdQuestion().\"' and nq_participations.IDParticipant = nq_participants.IDParticipant\";\n\t\tif ( false !== ($result = claro_sql_query_fetch_all_rows($sql)) )\n\t\t{\n\t\t\treturn $result;\n\t\t}\n\t\telse\n\t\t{\t\t\t\t\n\t\t\treturn claro_failure::set_failure('SELECTED_FAILED');\n\t\t}\n\t\t\t\n\t}",
"public function getSelectForActividades(){\n $informacion = Crud::vistaXTablaModel(\"actividades\"); //se obtienen todos los grupos de la bd mediante la conexion al modelo\n if(!empty($informacion)){\n foreach ($informacion as $row => $item) {\n echo \"<option value='\".$item['id'].\"'>\".$item['nombre'].\"</option>\";\n }\n }\n }",
"function fill_search_prod(){\n\t\t$user_info = select(\"select codigo from producto where activo=1\");\n\t\techo('<optgroup label=\"Codigo\">');\n\t\tfor($i=0;$i<count($user_info);$i++){\n\t\t\techo('<option value=\"'.array_values($user_info[$i])[0].'\">'.array_values($user_info[$i])[0].'</option>');\n\t\t}\n\t\techo('<optgroup label=\"Nombre\">');\n\t\t$user_info = select(\"select codigo, nombre from producto where activo=1\");\n\t\tfor($i=0;$i<count($user_info);$i++){\n\t\t\techo('<option value=\"'.array_values($user_info[$i])[0].'\">'.array_values($user_info[$i])[1].'</option>');\n\t\t}\n\t}",
"function getSelectSport($ListeSport){\n\n\t\techo(\"<select name=\\\"Sports\\\">\");\n\t\techo(\"<option value=\\\"\\\"> ----- Choisir ----- </option>\");\n\n\t\tfor ($i=0;$i<count($ListeSport);$i++){\n\t\t\techo(\"<option value=\".$ListeSport[i]->getId().\">\".$ListeSport[i]->getLibelle().\" </option>\");\n\t\t}\n\t\techo(\"</select>\");\t\n\t}",
"public function combo() {\n $comando = $this->db->prepare(\"select idveiculo, placa from veiculo \");\n $comando->execute();\n if ($comando->rowCount() > 0) {\n while ($row = $comando->fetch(PDO::FETCH_ASSOC)) {\n ?>\n\n <option value=\"<?php print($row['placa']); ?>\">\n <?php print($row['placa']); ?></option>\n\n <?php\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Position the 'cursor' at a given Y | public function setCursorY($y)
{
// Don't use SetY():
// - This also resets fpdf->x !!!
// - fpdf->SetY moves the cursor from the bottom for negative values
// $this->fpdf->SetY($this->fpdf->tMargin + $this->parseGlobalValue_v($y));
$this->fpdf->y = $this->fpdf->tMargin + $this->parseGlobalValue_v($y);
return $this;
} | [
"public function moveCursorTo(int $x, int $y)\n {\n $this->cursorX = $x;\n $this->cursorY = $y;\n\n $this->cursor->moveTo($x, $y);\n }",
"private function moveCursor($x = null, $y = null)\n {\n $y = ($y ?? $this->y) + $this->yLimit;\n $x = ($x ?? $this->x) + $this->xLimit;\n $this->control(\"{$y};{$x}H\");\n }",
"public function setY($y) {}",
"public function setY($y)\n {\n $this->setElement(1, $y);\n }",
"private function setCursor()\n {\n $this->tcpdf->SetXY(\n self::CURSOR_X,\n self::CURSOR_Y\n );\n }",
"public function setY($y) {\n\t\t$this->y = $y;\n\t}",
"function set_vertical_scroll_pos($y)\n\t{\n\t\treturn $this->call(\"Browser.SetVerticalScrollPos?y=\".urlencode($y));\n \t}",
"function wxSetCursor(wxCursor $cursor){}",
"function SetGridCursor($row, $col, wxGridCellCoords $coords){}",
"function GetMouseY(): int { return 0; }",
"public function ezSetY($y)\n {\n // used to change the vertical position of the writing point.\n $this->y = $y;\n if ($this->y < $this->ez['bottomMargin']) {\n // then make a new page\n $this->ezNewPage();\n }\n }",
"public function setRelY($relY) { throw new NonCursesException('Tried to setRelY on main screen.'); }",
"function get_position ()\n \t{\n \t\t$res = $this->call(\"Mouse.GetXY\");\n \t\t$pos =strpos($res,\" \");\n \t\t$this->x = substr($res ,0,$pos);\n \t\t$this->y = substr($res ,$pos+1,strlen($res)-$pos-1);\n \t}",
"function PositionFromPointClose($x, $y){}",
"public function set_cursor($val){\r\n\t\t$this->options['cursor'] = $val; //Sets cursor property\r\n\t}",
"function glfwGetCursorPos(GLFWwindow $window, float &$xpos, float &$ypos) : void {}",
"public function setPosition($x, $y) {\n $this->x = $x;\n $this->y = $y;\n }",
"public function getPositionY()\n {\n return $this->position_y;\n }",
"public function setY($value) {\n $this->y = $value;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function print for selector clock size list | function print_thesize_list($size){
$size_list = array("50","75","100","150","180","200","250","300");
echo "\n";
foreach($size_list as $isize)
{
$check_value = "";
if ($isize == $size)
$check_value = ' SELECTED ';
echo '<option value="'.$isize.'" '.$check_value .'>'.$isize.'</option>';
echo "\n";
}
} | [
"function print_thelength_list($size){\n\t $size_list = array(\"short\",\"continent\",\"long\");\n\n\t echo \"\\n\";\n\tforeach($size_list as $isize)\n\t{\n\t\t$check_value = \"\";\n\t\tif ($isize == $size)\n\t \t\t$check_value = ' SELECTED ';\n\t\techo '<option value=\"'.$isize.'\" '.$check_value .'>'.$isize.'</option>';\n\t\techo \"\\n\";\n\t}\n}",
"function printBarsTimesSelectors() {\n\t\t$db = new DatabaseInteraction();\n\t\t$bars = $db->getBarData();\n\t\n\t\t$barOptionElements = \"<option value=''></option>\"; //first blank bar option\n\t\t$timeOptionElements = \"<option value=''></option>\"; //first blank time option\n\t\n\t\tforeach ($bars as $bar) {\n\t\t\t$barOptionElements .= \"<option value='\".$bar[1].\"'>\".$bar[1].\"</option>\";\n\t\t}\n\t\n\t\tfor ($i=7;$i<13;$i++) {\n\t\t\tif ($i!=12) {\n\t\t\t\t$timeOptionElements .= \"<option value='\".($i+12).\":00:00'>\".$i.\":00</option>\";\n\t\t\t} else {\n\t\t\t\t$timeOptionElements .= \"<option value='\".($i-12).\":00:00'>\".$i.\":00</option>\";\n\t\t\t}\n\t\t}\n\t\t$timeOptionElements .= \"<option value='1'>1:00</option>\";\n\t\n\t\t//Output 5 bar and time selections\n\t\tfor ($i=0;$i<4;$i++) {\n\t\t\tprint \"<select name='bar\".($i+1).\"'>\";\n\t\t\tprint $barOptionElements;\n\t\t\tprint \"</select> - \";\n\t\t\t\n\t\t\tprint \"<select name='bar\".($i+1).\"start'>\";\n\t\t\tprint $timeOptionElements;\n\t\t\tprint \"</select><br/>\";\n\t\t}\n\t}",
"public function getLabelSize() {\n\t\t$labelsPrint = \" \";\n\t\n\t\tforeach ($this->labelSize as $key => $value) {\n\t\t\t$labelsPrint .= $key . $value . \" \";\n\t\t}\n\t\n\t\treturn $labelsPrint;\n\t}",
"function print_time_combo($nam)\n{\n\tprint(\"<select size=\\\"1\\\" name=\\\"cmb\" . $nam . \"Hour\\\">\\n\");\n\tfor ( $i=0; $i < 24; $i++ ) {\n\t\tprintf(\"\\t<option value='%d'>%02d:00</option>\\n\",$i,$i);\n\t\t}\n\tprint(\"</select>\\n\");\n}",
"function report_roster_get_options_size() {\n $sizes = array();\n\n foreach (array('small', 'medium', 'large') as $size) {\n $pixels = (int) get_config('report_roster', \"size_$size\");\n $label = get_string(\"size:$size\", 'report_roster');\n\n if ($pixels > 0) {\n $sizes[$pixels] = $label;\n }\n }\n\n return $sizes;\n}",
"public function menuDisplaySize()\n {\n\n ///@todo extend this\n return '<span>found <strong>'.$this->dataSize.'</strong> entries</span>';\n\n }",
"private function screenSizes()\n {\n $a_lines = array();\n $a_sizes = array();\n $a_data = $this->stats->getScreenSizes($this->i_startDate,$this->i_endDate);\n krsort($a_data, SORT_STRING);\n \n $i=0;\n foreach ($a_data as $a_size) {\n $a_lines[] = array(\n 'color' => $this->a_colors[$i],\n 'text' => $a_size['width'].'X'.$a_size['height']\n );\n \n $a_sizes[] = $a_size['amount'];\n $i++;\n }\n \n $this->template->set('screenSizesTitle', $this->language->get('system/admin/stats/screenSizes'));\n $this->template->set('lines',json_encode($a_lines));\n $this->template->set('screenSizes',json_encode($a_sizes));\n }",
"public function output(){\n echo ($this->showSize ? str_pad($this->size(), 10,' ', STR_PAD_LEFT) . ' ' : '') . $this->pad($this->depth) . \"{$this->name}\\n\";\n }",
"private function renderCacheSizeInfo(): void\n {\n // Print section header\n echo '<h2>' . esc_html__('Cache status', 'bc-cache') . '</h2>';\n\n // Gather cache statistics (age and size), if available.\n $cache_info = [];\n\n if (\\is_int($cache_age = $this->cache->getAge())) {\n $cache_info[] = \\sprintf(\n esc_html__('Cache has been fully flushed %s ago.', 'bc-cache'),\n '<strong><abbr title=\"' . wp_date('Y-m-d H:i:s', $cache_age) . '\">' . human_time_diff($cache_age) . '</abbr></strong>'\n );\n }\n\n if (\\is_int($cache_files_size = $this->list_table->getCacheFilesSize())) {\n $cache_info[] = \\sprintf(\n esc_html__('Cache files occupy %s of space in total.', 'bc-cache'),\n '<strong><abbr title=\"' . \\sprintf(_n('%d byte', '%d bytes', $cache_files_size, 'bc-cache'), $cache_files_size) . '\">' . size_format($cache_files_size) . '</abbr></strong>'\n );\n }\n\n if ($cache_info !== []) {\n echo '<p>' . \\implode(' ', $cache_info) . '</p>';\n }\n }",
"function print_options(){\n\t\tforeach ($this->options as $value) {\n\t\t\t$this->print_option($value);\n\t\t}\n\t}",
"function printOptions()\n {\n $lines = $this->outputOptions();\n echo join( \"\\n\" , $lines );\n }",
"public function sizeAction() \n {\n return $this->render->display(\"Settings/Size/size_tab\", array(\n 'sizes' => $this->parser->factory('Xml')->loadXml('filter')->getNode('size/item')->nodeToArray()\n ));\n }",
"public function getSizeElement() {\n $back = '<select id=\"size-select\" name=\"sizeID\">';\n foreach($this->productType->getSizes() as $key=>$val) {\n $back .= '<option value=\"'.$key.'\">'.$val.'</option>' ;\n }\n return $back.'</select>';\n }",
"private function display_options ()\n {\n foreach ($this->available as $key => $value) {\n display ( \"$key - $value\" );\n }\n }",
"public function getInputSize() {\n\t\t$inputsPrint = \" \";\n\t\n\t\tforeach ($this->inputSize as $key => $value) {\n\t\t\t$inputsPrint .= $key . $value . \" \";\n\t\t}\n\t\n\t\treturn $inputsPrint;\n\t}",
"protected function printRuntime()\n {\n $endTime = microtime(true);\n $time = $endTime - $this->startTime;\n printf(\"Total time: %01.2f secs \\r\\n\", $time);\n }",
"function FDISK_printAllBars2()\n{\n\t$param = FDISK_fdiskSessionParam();\n\n\tfor ($vDev=0; $vDev < $param['dev_amount']; $vDev++)\n\t\t{\n\t\t\techo(\"<br><span class=\\\"title\\\">\".$param[\"dev$vDev\".\"_path\"].\": \".$param[\"dev$vDev\".\"_size\"].\" MB</span>\");\n\t\t\tFDISK_printBars($param,$param[\"dev$vDev\".\"_path\"], true);\n\t\t\techo(\"<br>\");\n\t\t};\n}",
"public function showInfo() {\n $iteration = $this->iteration; // get frame count\n $cell_Count = $this->cellCount(); // run counter function throughout grid\n print str_repeat('*', $this->options['width']) . \"\\n\"; // draw a border and go to next line\n echo \"\\033[K\"; // delete the info from the last iteration of the game\n echo \"Generation: $iteration . No of cells: $cell_Count \\n\" ; // return a nice string of data for the new iteration\n }",
"public function printNumberOfSelectedDots()\n {\n echo 'Current number of selected dots is ' . $this->iNumberOfSelectedDots . PHP_EOL;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the os param as an integer. | public static function getOsAsInteger()
{
if (self::isAndroid()) {
return ANDROID_OS;
}
if (self::isIos()) {
return IOS_OS;
}
return OTHER_OS;
} | [
"public function getOSID()\n {\n return $this->_intOSID;\n }",
"public function getAppOSId()\n {\n return $this->getValue('nb_app_os_id');\n }",
"public function toInt() : int {\n return (string) $this->version;\n }",
"function request_as_integer($params = 0)\n{\n\tif (request_is_post()) {\n\t\t$req_post = Request::input('POST');\n\t\t$arr = $req_post($params)->asInteger();\n\t} elseif (request_is_get()) {\n\t\t$req_get = Request::input('GET');\n\t\t$arr = $req_get($params)->asInteger();\n\t} elseif (request_is_delete()) {\n\t\t$req_del = Request::input('DELETE');\n\t\t$arr = $req_del($params)->asInteger();\n\t} elseif (request_is_put()) {\n\t\t$req_put = Request::input('PUT');\n\t\t$arr = $req_put($params)->asInteger();\n\t}\n\n\treturn $arr;\n}",
"function read_env_int($var, $default) {\r\n $result = $default;\r\n if (isset($_POST[$var]))\r\n $result = intval($_POST[$var]);\r\n else\r\n if (isset($_GET[$var]))\r\n $result = intval($_GET[$var]);\r\n return $result;\r\n }",
"public function getOSID()\n {\n $imageid = intval(\n $_REQUEST['image_id']\n );\n $osname = self::getClass(\n 'Image',\n $imageid\n )->getOS()->get('name');\n echo json_encode($osname ? $osname : _('No Image specified'));\n exit;\n }",
"public function getOsVersion()\n {\n return $this->os_version;\n }",
"public static function getVersionAsInteger()\n {\n if (self::$_version === null) {\n self::_determineVersion();\n }\n return self::$_version;\n }",
"public function getOsVersion()\n {\n if ($this->getIsApp()) {\n return $this->getAppVersion();\n }\n\n return $this->getHelper()->version($this->getOsName());\n }",
"public function getOsType()\n {\n if (is_null($this->_osType)) {\n switch (php_uname('s')) {\n case 'Darwin':\n $this->_osType = self::OS_OSX;\n break;\n case 'Linux':\n $this->_osType = self::OS_LINUX;\n break;\n default:\n $this->_osType = 'N/A';\n break;\n }\n }\n return $this->_osType;\n }",
"public function getMiscArgument()\r\n {\r\n /* Split function parameter into module name and function name. */\r\n $instanceParts = explode(':', $this->_instanceName, 3);\r\n\r\n if (isset($instanceParts[2]))\r\n {\r\n return unserialize($instanceParts[2]);\r\n }\r\n else\r\n {\r\n return 0;\r\n }\r\n }",
"public function getOs0()\n\t{\n\t\treturn $this->os0;\n\t}",
"public function os_version()\n {\n $show = $this->fetchParam(\"show\", NULL, NULL, FALSE, TRUE);\n $os_version_major = $this->getBrowserInfo()['os_version_major'];\n $os_version_minor = $this->getBrowserInfo()['os_version_minor'];\n $os_version_patch = $this->getBrowserInfo()['os_version_patch'];\n $version = $os_version_major . '.' . $os_version_minor . '.' . $os_version_patch;\n\n switch ($show)\n {\n case 'major':\n return $os_version_major;\n break;\n case 'minor':\n return $os_version_minor;\n break;\n case 'patch':\n return $os_version_patch;\n break;\n case 'all':\n return $version;\n break;\n }\n }",
"public function getCodigoParametro(): int\n {\n return $this->codigoParametro;\n }",
"public function getInt(string $path): int;",
"public function getOsVersion() : string\n {\n return $this->osVersion;\n }",
"public function getOs()\n\t{\n\t\treturn $this->get(self::OS);\n\t}",
"function xhprof_get_uint_param($param, $default = 0) {\n $val = xhprof_get_param_helper($param);\n\n if ($val === null)\n $val = $default;\n\n // trim leading/trailing whitespace\n $val = trim($val);\n\n // if it only contains digits, then ok..\n if (ctype_digit($val)) {\n return $val;\n }\n\n xhprof_error(\"$param is $val. It must be an unsigned integer.\");\n return null;\n}",
"public function asInt();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add initial CMS Areas | protected function addCmsAreas(): self
{
$sDefaultAreaData = json_encode([
[
'slug' => 'html',
'data' => [
'body' => implode(PHP_EOL, [
'<p style="padding: 2rem; border:1px solid #ccc; background: #eee;">',
'This CMS area can be edited in the CMS',
'</p>',
]),
],
],
]);
$aAreas = [
[
'label' => 'A CMS Area',
'description' => 'A sample CMS area',
'widget_data' => $sDefaultAreaData,
],
];
/** @var Cms\Model\Area $oModel */
$oModel = Factory::model('Area', 'nails/module-cms');
foreach ($aAreas as $aArea) {
$oModel->create($aArea);
}
return $this;
} | [
"private function InitAreas()\n {\n $sql = Access::SqlBuilder();\n $tbl = Area::Schema()->Table();\n $where = $sql->Equals($tbl->Field('Layout'), $sql->Value($this->layout->GetID()))\n ->And_($sql->IsNull($tbl->Field('Previous')));\n $area = Area::Schema()->First($where);\n while ($area)\n {\n $this->areas[$area->GetName()] = $area;\n $area = Area::Schema()->ByPrevious($area);\n }\n }",
"private function createAreas(): Areas\n { \n return clone $this->getDefaultEntity(new Areas());\n }",
"function set_sections()\n\t{\n\t\t$EE =& get_instance();\n\t\t\n\t\t$js = <<<EOF\n$(document).ready(function() {\n\tel = $(\"#navigationTabs li a:contains('Publish')\").siblings().clone();\n\tif (el.html() != null)\n\t{\n\t\tel.html( el.html().replace(/content_publish&M=entry_form/g, \"content_edit\") );\n\t\t$(\"#navigationTabs li a:contains('Edit')\").parent().addClass(\"parent\");\n\t\t$(\"#navigationTabs li a:contains('Edit')\").parent().append( \"<ul>\"+el.html()+\"</ul>\" );\n\t}\n});\nEOF;\n \t$EE->cp->add_to_head('<script type=\"text/javascript\" charset=\"utf-8\">'.$js.'</script>');\n\n\t\t$this->sections[] = '<script type=\"text/javascript\" charset=\"utf-8\">$(\"#accessoryTabs a.sc_edit_menu\").parent().remove();</script>';\n\t}",
"function content_areas_admin( ){\n\trequire HOME . '_plugins/Content-Areas/admin/index.php';\n}",
"public function admin_add() {\n\t\tif (!$this->CmsContent->hasLayouts()) {\n\t\t\t$this->notice(\n\t\t\t\t__d('cms', 'You need to create some layouts before you can create content'),\n\t\t\t\tarray(\n\t\t\t\t\t'level' => 'warning',\n\t\t\t\t\t'redirect' => array(\n\t\t\t\t\t\t'controller' => 'global_layouts',\n\t\t\t\t\t\t'plugin' => 'contents',\n\t\t\t\t\t\t'action' => 'index'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tparent::admin_add();\n\t\t$contentTags = ClassRegistry::init('Contents.GlobalTag')->find('all');\n\t\t$this->set(compact('contentTags'));\n\t}",
"function addLocations(){\n $l = $this->api->locate('addons', __NAMESPACE__, 'location');\n\t\t$addon = $this->api->locate('addons', __NAMESPACE__);\n $this->api->pathfinder->addLocation($addon, array(\n \t'template' => 'templates',\n //'css' => 'templates/css',\n 'js' => 'js',\n ))->setParent($l);\n\t}",
"private function maybeCreateAreas()\n {\n /** @var AreaProperties $area */\n foreach ($this->newAreas as $area) {\n $post = array(\n 'post_type' => 'kb-dyar',\n 'post_title' => $area->name,\n 'post_name' => $area->id,\n 'post_status' => 'publish'\n );\n $id = wp_insert_post($post);\n\n if ($id) {\n $storage = new DataProvider($id, 'post');\n $storage->add('_area', $area->export());\n // custom meta data which is specific to wp database structure/queries\n // not exactly area related data\n $storage->update('_kb_added_by_code', '1');\n }\n\n $trans = get_transient('kb_dynamic_areas');\n\n if (!$trans) {\n $trans = array();\n }\n\n $trans[] = $area->id;\n set_transient('kb_dynamic_areas', $trans, 60 * 15);\n }\n\n }",
"function area_show_all_areas() {\n\tglobal $user;\n\t\n\tdrupal_add_library('system', 'ui.dialog');\n\t$observation_path = drupal_get_path('module', 'area');\n\tdrupal_add_css($observation_path . '/css/area.css');\n\t\n\t$output['message'] = array(\n\t\t\t'#type' => 'markup',\n\t\t\t'#markup' => '\n\t\t\t<div id=\"message\" style=\"display: none; height: auto;\">\n\t\t\t\t<div class=\"messages status\"></div>\n\t\t\t</div>'\n\t);\n\n\t$output['map'] = array(\n\t\t\t'#mapid' => 'areamap',\n\t\t\t'#search' => true,\n\t\t\t'#ch1903' => true,\n\t\t\t'#geometries_fetch_url' => base_path() . 'areas/json',\n\t\t\t'#geometries_autoload' => false,\n\t\t\t'#infowindow_content_fetch_url_area' => base_path()\n\t\t\t\t\t. 'area/{ID}/areaoverview/ajaxform',\n\t\t\t'#theme' => 'area'\n\t);\n\n\t$output['space'] = array(\n\t\t\t'#type' => 'markup',\n\t\t\t'#markup' => '<p/>'\n\t);\n\t\n\tif(user_access(AREA_CREATE)) {\n\t\tglobal $base_url;\n\t\t$iconBaseUrl = '/' . path_to_theme() . '/images/icons/enabled/';\n\t\t\n\t\t$output['create'] = array(\n\t\t\t\t'#type' => 'markup',\n\t\t\t\t'#markup' => '<a href=\"'.$base_url.'/area/new\"> <img src=\"' . $iconBaseUrl . 'Add.png\" alt=\"' . t('Create a new area') . '\" title=\"' . t('Create a new area') . '\" />'.t('Create a new area').'</a>',\n\t\t);\n\t}\n\t\n\t$output['area_table'] = array(\n\t\t'#theme' => 'datatable',\n\t\t'#header' => area_get_standard_datatable_headers(12,\n\t\t'DESC'),\n\t\t'#title' => t('Areas'),\n\t\t'#id_table' => DATATABLE_AREA,\n\t\t'#options' => array(\n\t\t\t\t\t'jsonUrl' => base_path() . \"areas/get/all\",\n\t\t\t\t\t'rowClick' => 'rowClick',\n\t\t\t\t\t'rowClickHandler' \t\t=> \"function rowClick(celDiv, id) {\n\t\t\t\t\t\tjQuery(celDiv).click(\n\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\tareamap.selectGeometry(id);\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'rpShowAll' => true,\n\t\t\t'preProcessHandler' => 'area.tablePreProcess',\n \t\t\t'onSuccessHandler' => ( ($user->uid == 0) ? '' : 'area.onTableSuccess' ),\t/* only show the delete and export buttons if user is logged in */\n\t\t\t'gallery_enabled' => true,\n\t\t\t'gallery_image_sources' => false,\n\t\t\t// Filters to add to the filterDiv above the table. The gallery image source\n\t\t\t// filter has a weight of 10, the table/gallery buttons 4 and 5 respectively.\n\t\t\t'custom_filter' => array(\n\t\t\t\t'acl_filter' => array(\n\t\t\t\t\t'#type' => 'select',\n\t\t\t\t\t'#name' => 'acl_filter',\n\t\t\t\t\t'#title' => t('Areas') . ':',\n\t\t\t\t\t'#options' => array(\n\t\t\t\t\t\t'all' => t('Public'),\n\t\t\t\t\t\t'own' => t('Own'),\n\t\t\t\t\t\t'writeable' => t('Editables')),\n\t\t\t\t\t'#attributes' => array(\n\t\t\t\t\t\t'class' => array('acl_filter')),\n\t\t\t\t\t'#weight' => 8\n\t\t\t\t),\n\t\t\t),\n\t\t 'date' => array(\n\t\t \t'dbDateField' => \"date\",\n\t\t \t'dbDateFieldType' => DBDateFieldType::TIMESTAMP)\t\t\t\t\t\n\t\t)\n\t\t\n\t);\t\n\t\n\treturn $output;\n}",
"public function set_sections()\n {\n // Hide accessory tab\n $this->sections[] = '<script type=\"text/javascript\">$(\"#accessoryTabs a.jw_pages_uri\").parent().remove();</script>';\n\n // Only add js when publishing a new entry to the `Pages` channel\n if (\n ee()->input->get_post('entry_id') === false\n && in_array(ee()->input->get_post('channel_id'), $this->channel_ids)\n && ee()->input->get_post('C') === 'content_publish'\n ) {\n // Load in necessary js files\n ee()->cp->add_js_script(array(\n 'plugin' => array('ee_url_title')\n ));\n\n ee()->javascript->output('\n $(\"#pages__pages_uri\").val(\"\");\n\n $(\"#title\").on(\"keyup keydown change\", function() {\n $(this).ee_url_title(\"#pages__pages_uri\");\n $(\"#pages__pages_uri\").val(\"/\" + $(\"#pages__pages_uri\").val());\n });\n ');\n }\n }",
"public static function hook_admin_areas()\n {\n global $admin_areas, $txt;\n\n // This isn't a shameless copy of the instruction in Admin.php, I just want to\n // add it after the second menu\n $admin_areas = array_merge(array_splice($admin_areas, 0, 2), array(\n 'weportal' => array(\n 'title' => $txt['weportal'],\n 'permission' => array('manage_weportal'),\n 'areas' => array(\n 'providers' => array(\n 'label' => $txt['wep_providers'],\n 'file' => array('Dragooon:WePortal', 'WePortal'),\n 'function' => 'WePortalProviders',\n 'icon' => 'delete.png',\n 'bigicon' => 'delete.png',\n 'subsections' => array(\n 'index' => array($txt['wep_providers_list']),\n 'add' => array($txt['wep_add_provider']),\n ),\n ),\n ),\n ),\n ), $admin_areas);\n }",
"public function getBackendAreas(): AreasCollection;",
"public function loadEmployeeAreaAssets()\n\t{\n\t\t$document = JFactory::getDocument();\n\t\t// css\n\t\t$document->AddStyleSheet(VAPASSETS_URI . 'css/vap-emparea.css');\n\t\tVikAppointments::load_font_awesome();\n\n\t\t// js\n\t\tVikAppointments::load_css_js();\n\t\tVikAppointments::load_fancybox();\n\t\tVikAppointments::load_complex_select();\n\t\tVikAppointments::load_utils();\n\t\tVikAppointments::load_currency_js();\n\t\t$this->addScript(VAPASSETS_URI . 'js/jquery-ui.sortable.min.js');\n\t\t$this->addScript(VAPASSETS_URI . 'js/vap-emparea.js');\n\n\t\t$document->addScriptDeclaration(\n<<<JS\nvar EmployeeArea = new EmployeeArea('#empareaForm');\n\njQuery(document).ready(function() {\n\tjQuery('.vap-list-pagination .hasTooltip').removeClass('hasTooltip').removeAttr('title').attr('data-original-title', '');\n});\nJS\n\t\t);\n\t}",
"public function register_widget_areas() {\n\n genesis_register_widget_area(\n array(\n 'id' => 'footer-center',\n 'name' => __( 'Footer Center', 'agrilife_extension_unit' ),\n 'description' => __( 'This is the footer widget area. It appears above the required links. This widget area is not equipped to display any widget, and works best with the Simple Social widget', 'agrilife_extension_unit' ),\n '_genesis_builtin' => false,\n )\n );\n\n genesis_register_widget_area(\n array(\n 'id' => 'home-sidebar',\n 'name' => __( 'Home Sidebar', 'agrilife_extension_unit' ),\n 'description' => __( 'This is the Home sidebar widget area. It appears in the right column of the home page. This widget area is not equipped to display any widget, and works best with menus and Genesis Featured Posts', 'agrilife_extension_unit' ),\n '_genesis_builtin' => false,\n )\n );\n\n }",
"public function assetsLanding() {\n\n // Adiciona o CSS da Landing Page\n $this->assets->addCss(DEFAULT_LANDING_CSS);\n\n // Adiciona o JS da Landing Page\n $this->assets->addJs(DEFAULT_LANDING_JS);\n }",
"function collage_widgets_init() {\n\t// Area 1, located at the top of the sidebar.\n\tregister_sidebar( array(\n\t\t'name' => 'Primary Widget Area',\n\t\t'id' => 'primary-widget-area',\n\t\t'description' => 'The primary widget area',\n\t\t'before_widget' => '<li id=\"%1$s\" class=\"widget-container %2$s\">',\n\t\t'after_widget' => '</li>',\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t) );\n\n}",
"public function registerWidgetAreas()\n {\n $avalibleAreas = self::avalibleWidgets();\n $enabledAreas = get_theme_mod('active_header_widgets');\n\n if (!is_array($avalibleAreas) || empty($avalibleAreas) || !is_array($enabledAreas) || empty($enabledAreas)) {\n return;\n }\n\n $widgetAreas = array();\n\n foreach ($avalibleAreas as $area) {\n if (in_array($area['id'], $enabledAreas)) {\n $widgetAreas[] = $area;\n }\n }\n\n if (empty($widgetAreas)) {\n return;\n }\n\n foreach ($widgetAreas as $area) {\n register_sidebar(array(\n 'id' => $area['id'],\n 'name' => __($area['name'], 'municipio'),\n 'description' => __('Sidebar that sits just before the footer, takes up 100% of the widht.', 'municipio'),\n 'before_widget' => '<div class=\"%2$s\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3>',\n 'after_title' => '</h3>'\n ));\n }\n }",
"protected function initSections()\n {\n $this->structure[static::SECTIONS_KEY] = [\n 'type' => 'nav',\n 'config' => [\n 'label' => $this->component->getData('label'),\n ],\n 'children' => [],\n ];\n }",
"function publicsource_add_homepage_widget_areas() {\n\t$sidebars = array(\n\t\tarray(\n\t\t\t'name' => __( 'Homepage Interstitial 1', 'publicsource' ),\n\t\t\t'id' => 'homepage-interstitial-1',\n\t\t\t'description' => __( 'This widget area appears directly below the top stories section.', 'publicsource' ),\n\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"%2$s clearfix homepage-interstitial-1\">',\n\t\t\t'after_widget' => '</aside>',\n\t\t\t'before_title' => '<h3 class=\"widgettitle\">',\n\t\t\t'after_title' => '</h3>',\n\t\t),\n\t\tarray(\n\t\t\t'name' => __( 'Homepage Interstitial 2', 'publicsource' ),\n\t\t\t'id' => 'homepage-interstitial-2',\n\t\t\t'description' => __( 'This widget area appears directly above the featured story section.', 'publicsource' ),\n\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"%2$s clearfix homepage-interstitial-2\">',\n\t\t\t'after_widget' => '</aside>',\n\t\t\t'before_title' => '<h3 class=\"widgettitle\">',\n\t\t\t'after_title' => '</h3>',\n\t\t),\n\t\tarray(\n\t\t\t'name' => __( 'Homepage Interstitial 3', 'publicsource' ),\n\t\t\t'id' => 'homepage-interstitial-3',\n\t\t\t'description' => __( 'This widget area appears directly below the featured story section.', 'publicsource' ),\n\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"%2$s clearfix homepage-interstitial-3\">',\n\t\t\t'after_widget' => '</aside>',\n\t\t\t'before_title' => '<h3 class=\"widgettitle\">',\n\t\t\t'after_title' => '</h3>',\n\t\t),\n\t\tarray(\n\t\t\t'name' => __( 'Homepage Interstitial 4', 'publicsource' ),\n\t\t\t'id' => 'homepage-interstitial-4',\n\t\t\t'description' => __( 'This widget area appears directly above the investigations section.', 'publicsource' ),\n\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"%2$s clearfix homepage-interstitial-4\">',\n\t\t\t'after_widget' => '</aside>',\n\t\t\t'before_title' => '<h3 class=\"widgettitle\">',\n\t\t\t'after_title' => '</h3>',\n\t\t),\n\t\tarray(\n\t\t\t'name' => __( 'Homepage Sidebar', 'publicsource' ),\n\t\t\t'id' => 'homepage-sidebar',\n\t\t\t'description' => __( 'Primary homepage sidebar, appears next to the grid of four stories below the top stories section', 'publicsource' ),\n\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"%2$s clearfix homepage-sidebar\">',\n\t\t\t'after_widget' => '</aside>',\n\t\t\t'before_title' => '<h3 class=\"widgettitle\">',\n\t\t\t'after_title' => '</h3>',\n\t\t),\n\t\tarray(\n\t\t\t'name' => __( 'Home Category Grid', 'publicsource' ),\n\t\t\t'id' => 'home-category-grid',\n\t\t\t'description' => __( 'This area should be filled with two Largo Recent Posts widgets.', 'publicsource' ),\n\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"%2$s span3 clearfix\">',\n\t\t\t'after_widget' => '</aside>',\n\t\t\t'before_title' => '<h3 class=\"widgettitle\">',\n\t\t\t'after_title' => '</h3>',\n\t\t),\n\t\tarray(\n\t\t\t'name' => __( 'Home Bottom Feature', 'publicsource' ),\n\t\t\t'id' => 'home-bottom-feature',\n\t\t\t'description' => __( 'This area should be filled with one Largo Recent Posts widget.', 'publicsource' ),\n\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"%2$s clearfix\">',\n\t\t\t'after_widget' => '</aside>',\n\t\t\t'before_title' => '<h3 class=\"widgettitle\">',\n\t\t\t'after_title' => '</h3>',\n\t\t),\n\t);\n\n\tforeach ( $sidebars as $sidebar ) {\n\t\tregister_sidebar( $sidebar );\n\t}\n}",
"protected function setupMenus() {\n $this->drupalPlaceBlock('local_actions_block', ['region' => 'content']);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new set with the given enumeration objects or values removed | public function withoutIterable(iterable $enumerators): self
{
$clone = clone $this;
foreach ($enumerators as $enumerator) {
$clone->{$this->fnDoUnsetBit}(($this->enumeration)::get($enumerator)->getOrdinal());
}
return $clone;
} | [
"public function removeSets();",
"public function toSet();",
"public function testEnumerationSetDelete()\r\n {\r\n\r\n }",
"public function uniqueSet();",
"public function removeFromSet($fieldName, array $values);",
"public function filterNotNull(): Set;",
"public function to_set() {\n return new Set(...$this->to_a());\n }",
"public function toHashSet(): HashSet;",
"public function testDeconvertSet()\n {\n $serializer = new Gson3;\n\n $deconverted = $serializer->deconvertSet([\n \"friend\",\n [\n \"@type\" => \"g:Int32\",\n \"@value\" => 2009,\n ],\n TRUE,\n ]);\n\n $this->assertEquals([\n \"friend\",\n 2009,\n TRUE,\n ], $deconverted, \"Incorrect deconversion for Set\");\n }",
"function difference($other) {\n $a = dict();\n foreach($this->_dct as $k => $v)\n $a[$k] = 1;\n foreach(func_get_args() as $x) {\n foreach(iter($x) as $v)\n unset($a[$v]);\n }\n return set($a->keys());\n }",
"public function toImmSet();",
"public function except($keys): CollectionInterface;",
"function remove_product_types( $types ){\n unset( $types['grouped'] );\n unset( $types['external'] );\n\n return $types;\n}",
"function remove_product_types( $types ){\n unset( $types['grouped'] );\n unset( $types['external'] );\n unset( $types['variable'] );\n\n return $types;\n}",
"public function toSet($use = self::USE_VALUES)\n {\n return new Set(($use === self::USE_KEYS) ? array_keys($this->array) : array_values($this->array));\n }",
"public static function set_clear_value(&$set, $value) {\r\n\t\t$new_set = array();\r\n\t\tself::set_force_array($set);\r\n\t\tforeach($set as $v) {\r\n\t\t\tif ($v !== $value) {\r\n\t\t\t\t$new_set[] = $v;\r\n\t\t\t}\r\n\t\t} \r\n\t\t$set = $new_set;\r\n\t}",
"public static function toSet() : CollectorImpl {\n\n\t\t$collectorImpl = new CollectorImpl (new HashSet());\n\t\t$collectorImpl->setAccumulator (function (Object $object) use (&$collectorImpl) {\n\t\t\t $collectorImpl->getSupplier()->add ($object);\n\t\t });\n\t\treturn $collectorImpl;\n\t}",
"public function removeIterable(iterable $enumerators): void\n {\n $bitset = $this->bitset;\n\n try {\n foreach ($enumerators as $enumerator) {\n $this->{$this->fnDoUnsetBit}(($this->enumeration)::get($enumerator)->getOrdinal());\n }\n } catch (\\Throwable $e) {\n // reset all changes until error happened\n $this->bitset = $bitset;\n throw $e;\n }\n }",
"function wf_crm_get_empty_sets() {\n $sets = wf_crm_get_fields('sets');\n foreach (array_keys(wf_crm_get_fields()) as $key) {\n list($set) = explode('_', $key);\n unset($sets[$set]);\n }\n return $sets;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SQLite Snippets Escape the characters in text that could break the PHP | function api_sqlite_escape($text){
$ret = str_replace("'","''",$text);
return $ret;
} | [
"function getEscaped( $text )\n\t{\n\t\treturn sqlite_escape_string($text);\n\t}",
"function _sql_escape() { }",
"function bb2_db_escape($string) {\n\treturn $string;\n#\treturn $GLOBALS['lbdata']->Quote($string);\n}",
"function db_driver_escape($data)\n{\n global $_db;\n\n if ($_db['resource'][$_db['target']]['config']['type'] === 'pdo_mysql') {\n return '\\'' . addslashes($data) . '\\'';\n } elseif ($_db['resource'][$_db['target']]['config']['type'] === 'pdo_pgsql' or $_db['resource'][$_db['target']]['config']['type'] === 'pdo_sqlite' or $_db['resource'][$_db['target']]['config']['type'] === 'pdo_sqlite2') {\n return '\\'' . str_replace('\\'', '\\'\\'', $data) . '\\'';\n }\n}",
"function db_escape($string) {\n\treturn pg_escape_string($string);\n}",
"function web_to_SQL_quotes($string) {\r\n\t\treturn str_replace(array('\"',\"'\",\";\",\" \"),array(\"ʹ\",\"ʺ\",\"\",\"\"),$string); }",
"private function quote( )\n {\n if ( @ count( $this->data_buffer ) == 0 )\n return;\n foreach ( $this->data_buffer as $key => $val )\n {\n if ( in_array( $key, $this->string_fields ))\n $this->data_buffer[$key] = @\"'\".mysql_real_escape_string($val,underQL::$db_handle).\"'\";\n else\n $this->data_buffer[$key] = $val;\n }\n }",
"function customAddSlashes($text)\r\n{\r\n global $database;\r\n // mysql specific addslashes\r\n if ($database == \"mysql\" OR $database == 'mysql5') {\r\n $text = addslashes($text);\r\n } elseif ($database == \"sqlite\") {\r\n $text = sqlite_escape_string($text);\r\n }\r\n\r\n return $text;\r\n}",
"function db_driver_escape($data)\n{\n global $_db;\n\n return '\\'' . addslashes($data) . '\\'';\n}",
"function db_driver_unescape($data)\n{\n global $_db;\n\n if ($_db['resource'][$_db['target']]['config']['type'] === 'pdo_mysql') {\n $data = regexp_replace('(^\\'|\\'$)', '', $data);\n $data = stripslashes($data);\n\n return $data;\n } elseif ($_db['resource'][$_db['target']]['config']['type'] === 'pdo_pgsql' or $_db['resource'][$_db['target']]['config']['type'] === 'pdo_sqlite' or $_db['resource'][$_db['target']]['config']['type'] === 'pdo_sqlite2') {\n $data = regexp_replace('(^\\'|\\'$)', '', $data);\n $data = str_replace('\\'\\'', '\\'', $data);\n\n return $data;\n }\n}",
"function dbescape ($s)\n {\n global $dbcon;\n return $dbcon->real_escape_string ($s);\n }",
"function db_driver_unescape($data)\n{\n global $_db;\n\n $data = regexp_replace('(^\\'|\\'$)', '', $data);\n $data = stripslashes($data);\n\n return $data;\n}",
"function esc_sql($data)\n {\n }",
"function db2str(& $string) {\n\tif (get_magic_quotes_runtime())\n\t\treturn htmlspecialchars(stripslashes($string));\n\treturn htmlspecialchars($string);\n}",
"public function escape($string)\n {\n if (!function_exists('sqlite_escape_string')) {\n return str_replace(\"'\", \"''\", $string);\n }\n\n return sqlite_escape_string($string);\n }",
"function sanitize($data) {\n return pg_escape_string($data);\n }",
"public function escapeString($connection, $escape_string){}",
"function sqlsafe ($str) {\n //$str = str_replace(\"'\", \"''\", $str);\n //$str = stripslashes($str);\n $str = addslashes($str);\n return $str;\n}",
"abstract protected function escape(string $insert): string;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a valid post_id string for a given term and taxonomy. No longer needed since WP introduced the termmeta table in WP 4.4. | function acf_get_term_post_id( $taxonomy, $term_id ) {
_deprecated_function( __FUNCTION__, '5.9.2', 'string format term_%d' );
return 'term_' . $term_id;
} | [
"function acf_get_term_post_id( $taxonomy, $term_id ) {\n}",
"public function termId() { return $this->post->term_id; }",
"function the_term_id($term) {\n echo get_term_id($term);\n }",
"protected function get_posted_term_id( $taxonomy ) {\n\t\treturn \\filter_input( \\INPUT_POST, WPSEO_Meta::$form_prefix . 'primary_' . $taxonomy . '_term', \\FILTER_SANITIZE_NUMBER_INT );\n\t}",
"protected function idForTerm($term) {\n\n if (empty($term) OR ! is_string($term)) {\n\n return false;\n }\n else {\n\n $rs = $this->id_for_term_statement->execute(array(':name' => $term));\n\n if ($rs !== true) {\n\n $this->handleError('error executing \"id_for_term_statement\" with name = \"' . $term . '\"', $this->id_for_term_statement);\n }\n else {\n\n while ($row = $this->id_for_term_statement->fetch(PDO::FETCH_OBJ)) {\n\n if ( ! empty($row->id)) {\n\n return $row->id;\n }\n }\n\n // If we've gotten this far, it means that there is not currently a term\n // in the database with this name, so we need to create one\n $insert_values = array(\n ':name' => $term,\n ':slug' => str_replace(' ', '-', strtolower(mb_convert_encoding($term, 'ASCII'))),\n );\n\n $rs2 = $this->create_term_with_name_statement->execute($insert_values);\n\n if ($rs2 !== true) {\n\n $this->handleError('error executing \"create_term_with_name_statement\" with name = \"' . $term . '\" and slug = \"' . $insert_values[':slug'] . '\"', $this->create_term_with_name_statement);\n }\n else {\n\n $term_id = $this->pdo->lastInsertId();\n\n $rs3 = $this->add_term_to_taxonomy_statement->execute(array(':term_id' => $term_id));\n\n if ($rs3 !== true) {\n\n $this->handleError('error executing \"add_term_to_taxonomy_statement\" with term_id = \"' . $term_id . '\"', $this->add_term_to_taxonomy_statement);\n }\n else {\n\n return $this->pdo->lastInsertId();\n }\n }\n }\n }\n }",
"function sptt_get_related_term_for_post( $post = null ) {\n\t$_post = get_post( $post );\n\t$term_id = (int) get_post_meta( $_post->ID, '_sptt_term_id', true );\n\tif ( 0 == $term_id )\n\t\treturn false;\n\treturn $term_id;\n}",
"function _snasolutions_get_tid_from_term($term) {\n return $term->tid;\n}",
"function taxonomy_image_plugin_term_taxonomy_id( $term_id, $taxonomy ) {\n\t$data = get_term( $term_id, $taxonomy );\n\tif ( isset( $data->term_taxonomy_id ) ) {\n\t\treturn (int) $data->term_taxonomy_id;\n\t}\n\treturn 0;\n}",
"public static function convertTermNameToTermID( $termName = '' )\n\t\t{\n\n\t\t\tif( empty( $termName ) ){\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$termObject = get_term_by( 'name', $termName, static::$submissionCategorySlug );\n\n\t\t\tif( $termObject && isset( $termObject->term_id ) ){\n\t\t\t\treturn $termObject->term_id;\n\t\t\t}\n\n\t\t\treturn false;\n\n\t\t}",
"function get_tid_from_term_name($term_name, $vocabulary) {\n $arr_terms = taxonomy_get_term_by_name($term_name, $vocabulary);\n if (!empty($arr_terms)) {\n $arr_terms = array_values($arr_terms);\n $tid = $arr_terms[0]->tid;\n }\n else {\n $vobj = taxonomy_vocabulary_machine_name_load($vocabulary);\n $term = new stdClass();\n $term->name = $term_name;\n $term->vid = $vobj->vid;\n taxonomy_term_save($term);\n $tid = $term->tid;\n }\n return $tid;\n}",
"public static function from_primary_term( $post_id, $taxonomy ) {\n\t\t$message = \\sprintf(\n\t\t\t/* translators: 1: expands to the term id. 2: expand to the taxonomy */\n\t\t\t\\__( 'There is no primary term found for post id %1$s and taxonomy %2$s.', 'wordpress-seo' ),\n\t\t\t$post_id,\n\t\t\t$taxonomy\n\t\t);\n\n\t\treturn self::create_and_log_exception( $message );\n\t}",
"public function getTermId() {\n\t\treturn $this->getOsidIdFromString($this->row['SSBSECT_TERM_CODE'], 'term/');\n }",
"private static function _get_term_id( $term_name, $term_parent, $taxonomy, &$post_terms ) {\r\n\t\t// WordPress encodes special characters, e.g., \"&\" as HTML entities in term names\r\n\t\t$term_name = _wp_specialchars( $term_name );\r\n\r\n\t\t// Is this term already in the cache?\r\n\t\tif ( isset( MLAOptions::$mla_term_cache[ $taxonomy ] ) && isset( MLAOptions::$mla_term_cache[ $taxonomy ][ $term_parent ] ) && isset( MLAOptions::$mla_term_cache[ $taxonomy ][ $term_parent ][ $term_name ] ) ) {\r\n\t\t\treturn MLAOptions::$mla_term_cache[ $taxonomy ][ $term_parent ][ $term_name ];\r\n\t\t}\r\n\r\n\t\t// Is this term already assigned to the item?\r\n\t\tif ( is_array( $post_terms ) ) {\r\n\t\t\t$term_id = 0;\r\n\t\t\tforeach( $post_terms as $post_term ) {\r\n\t\t\t\tMLAOptions::$mla_term_cache[ $taxonomy ][ $post_term->parent ][ $post_term->name ] = $post_term->term_id;\r\n\t\t\t\tif ( $term_name == $post_term->name && $term_parent == $post_term->parent ) {\r\n\t\t\t\t\t$term_id = $post_term->term_id;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif ( 0 < $term_id ) {\r\n\t\t\t\treturn $term_id;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Consider get_terms() or (just term_exists() for both cases)\r\n\t\tif ( 0 === $term_parent ) {\r\n\t\t\t$post_term = get_term_by( 'name', $term_name, $taxonomy ); // Consider get_terms() for identical names\r\n\t\t\tif ( false !== $post_term ) {\r\n\t\t\t\tMLAOptions::$mla_term_cache[ $taxonomy ][ $term_parent ][ $term_name ] = $post_term->term_id;\r\n\t\t\t\treturn $post_term->term_id;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$post_term = term_exists( $term_name, $taxonomy, $term_parent );\r\n\t\t\tif ( $post_term !== 0 && $post_term !== NULL ) {\r\n\t\t\t\tMLAOptions::$mla_term_cache[ $taxonomy ][ $term_parent ][ $term_name ] = absint( $post_term['term_id'] );\r\n\t\t\t\treturn absint( $post_term['term_id'] );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$post_term = wp_insert_term( $term_name, $taxonomy, array( 'parent' => $term_parent ) );\r\n\t\tif ( ( ! is_wp_error( $post_term ) ) && isset( $post_term['term_id'] ) ) {\r\n\t\t\tMLAOptions::$mla_term_cache[ $taxonomy ][ $term_parent ][ $term_name ] = $post_term['term_id'];\r\n\t\t\treturn $post_term['term_id'];\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}",
"private function getTopicTIDByTerm($term) {\n $map = $this->getNewCleanTopicsTaxonomyTIDLookup();\n $result = NULL;\n\n foreach ($map as $lookUp) {\n if ( $lookUp['name'] === $term ) {\n $result = $lookUp['tid'];\n break;\n }\n }\n\n return $result;\n }",
"public function get_relation_id( $site_id, $term_taxonomy_id ) {\n\n\t\t$translation_ids = $this->content_relations->get_existing_translation_ids(\n\t\t\t$site_id,\n\t\t\t0,\n\t\t\t$term_taxonomy_id,\n\t\t\t0,\n\t\t\t'term'\n\t\t);\n\t\tif ( ! $translation_ids ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$relation = reset( $translation_ids );\n\n\t\treturn $relation['ml_source_blogid'] . '-' . $relation['ml_source_elementid'];\n\t}",
"function applyTerm( $postId, $termName, $taxonomySlug ) {\n\n $term = get_term_by( 'name', $termName, $taxonomySlug );\n\n if( $term ) {\n $termId = $term->term_id;\n } else {\n $result = wp_insert_term( $termName, $taxonomySlug );\n $termId = $result[ 'term_id' ];\n }\n\n wp_set_object_terms( $postId, $termId, $taxonomySlug, true );\n}",
"public function callbackTermId($term) {\n return $term['id'];\n }",
"function get_post_meta_key_of_post_term_order( string $taxonomy ): string {\n\t$inst = _get_instance();\n\treturn \"_$taxonomy{$inst->key_order}\";\n}",
"private function get_or_create_term( $term, $taxonomy, $institution_name = null ) {\n\t\trequire_once ABSPATH . '/wp-admin/includes/taxonomy.php';\n\n\t\tif ( is_null( $institution_name ) ) {\n\t\t\t$term = wp_create_term( $term, $taxonomy );\n\t\t} else {\n\t\t\t$term = wp_create_term( $term . ' (' . $institution_name . ')', $taxonomy );\n\t\t}\n\n\t\treturn absint( $term['term_id'] );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Return array of game info | public function get_game_info_array()
{
return $this->GAME_INFO;
} | [
"public function getInfo() {\n $conn = new DB();\n $infos = [];\n $req = $conn->connect()->prepare(\"SELECT * FROM infogame\");\n $req->execute();\n $data = $req->fetchAll();\n foreach($data as $data_info) {\n $infos[] = new infogame($data_info['dev'], $data_info['genre'],\n $data_info['content'], $data_info['id']);\n }\n return $infos;\n }",
"public function GetGameInfos() {\n $req = Manager::dbConnect()->prepare(\"SELECT *\n FROM games\n WHERE idGame = :idGame\");\n $req->bindValue('idGame', Manager::escape($this->getIdGame()), PDO::PARAM_STR);\n $req->execute();\n $result = $req->fetch();\n\n return $result;\n }",
"public function GetGameInfo()\r\n\t{\r\n\t\t$this->GetGameModel();\r\n\r\n\t\t$entities = [];\r\n\t\tforeach ($this->GameModel['entities'] as $key => $obj) {\r\n\t\t\t$entity = [\r\n\t\t\t\t'name' => $obj->GetName(),\r\n\t\t\t\t'alive' => $obj->GetIsAlive(),\r\n\t\t\t\t'EntityType' => $obj->GetEntityType(),\r\n\t\t\t\t'feedHistory' => $obj->GetFeedHistory(),\r\n\t\t\t];\r\n// echo \"<pre>\";print_r($entity);die(\"->stoppp\");\r\n\t\t\t$entities[] = $entity;\t\t\r\n\t\t}\r\n\r\n\t\t$this->GameModel['entities'] = $entities;\r\n\t\treturn $this->GameModel;\r\n\t}",
"function getGameList() {\n\t\t\n\t\t$returnArr = array();\n\t\t\n\t\t$result = $this->MySQL->query(\"SELECT * FROM \".$this->strTableName.\" ORDER BY ordernum DESC\");\n\t\twhile($row = $result->fetch_assoc()) {\n\t\t\t$returnArr[] = $row[$this->strTableKey];\n\t\t}\n\t\t\n\t\treturn $returnArr;\n\t\t\n\t}",
"public function loadGame()\n {\n $gameInfo = []; // get it from DB\n\n // Returns Game entity with all available data for this game.\n return $gameInfo;\n }",
"public function getCurrentPokemonInfo():array {\n if (!$this->player) return [\"name\"=>\"\",\"type\"=>\"\",\"stamina\"=>0,\"attack\"=>0,\"defense\"=>0];\n \n $pokemon = $this->player->getPokemon();\n if (!$pokemon) return [\"name\"=>\"\",\"type\"=>\"\",\"stamina\"=>0,\"attack\"=>0,\"defense\"=>0];\n \n $level = $this->player->getLevel();\n return $this->getPokemonInfo($pokemon, (int)$level);\n }",
"private function getRelevantGames() {\n // query the database\n $dir = 'sqlite:C:\\Apache24\\htdocs\\rps-game\\server\\db\\game.db';\n $dbh = new \\PDO($dir) or die(\"cannot open the database\");\n $query = $dbh->prepare('SELECT * FROM games');\n $query->execute(array());\n $results = $query->fetchAll();\n\n // process the results\n $games = array(\n 'myGames' => array(),\n 'openGames' => array(),\n );\n foreach ($results as $value) {\n $gameObj = \\GuzzleHttp\\json_decode($value['game_state']);\n if (!$gameObj->isGameOver) {\n\n // currently playing this game\n if (\n $gameObj->player1->name == $this->sender->name\n || $gameObj->player2->name == $this->sender->name\n ) {\n $games['myGames'][$value['game_id']] = $gameObj;\n continue;\n }\n\n // this game has an empty seat\n if (\n $gameObj->player1->name == FALSE\n || $gameObj->player2->name == FALSE\n ) {\n $games['openGames'][$value['game_id']] = $gameObj;\n continue;\n }\n\n }\n }\n\n return $games;\n }",
"public function getGameData()\n {\n return $this->gameData;\n }",
"private function getPlayerinfo()\r\n\t{\r\n\t\t$data = $this->cmd(\"\\xFF\\xFF\\xFF\\xFF\\x55\" . pack(\"H*\", $this->challengeNumber));\r\n\t\t\r\n\t\t$rtn[\"type\"]\t= $this->getPacketData($data, \"byte\");\r\n\t\t$rtn[\"player\"]\t= $this->getPacketData($data, \"byte\", true);\r\n\t\t\r\n\t\tfor($i = 0; $i < $rtn[\"player\"]; $i++)\r\n\t\t{\r\n\t\t\t$rtn[\"players\"][$i][\"index\"]\t= $this->getPacketData($data, \"byte\", true);\r\n\t\t\t$rtn[\"players\"][$i][\"name\"]\t= $this->getPacketString($data);\r\n\t\t\t$rtn[\"players\"][$i][\"kills\"]\t= $this->getPacketData($data, \"long\", true);\r\n\t\t\t$rtn[\"players\"][$i][\"connected\"]= $this->hex2float(hexdec($this->getPacketData($data, \"float\")));\r\n\t\t}\r\n\t\t\r\n\t\t$this->playerinfo = $rtn;\r\n\t}",
"public function getCurrentPlayerInfo():array {\n if (!$this->player) return false;\n\n $username = $this->player->getUsername();\n $level = (int)$this->player->getLevel();\n $xp = (int)$this->player->getXp();\n\n return [\"name\"=>$username,\"level\"=>$level,\"xp\"=>$xp];\n }",
"public static function readgamestat($i)\n {\n //this array contains the info that will be returned\n $info = array(\n 'num_players' => trim(str_replace('Players: ', '', $i[1])),\n 'map' => trim(str_replace('Map: ', '', $i[2])),\n 'mode' => trim(str_replace('Gamemode: ', '', $i[3])),\n 'timeleft' => trim(str_replace('Timeleft: ', '', $i[4])),\n );\n //support for the teambased gamemodes\n if ($info['mode'] == 'Capture the Flag' || $info['mode'] == 'Infiltration' || $info['mode'] == 'Teammatch') {\n $info['teams']['alpha'] = trim(str_replace('Team 1: ', '', $i[5]));\n $info['teams']['bravo'] = trim(str_replace('Team 2: ', '', $i[6]));\n $info['teams']['charlie'] = trim(str_replace('Team 3: ', '', $i[7]));\n $info['teams']['delta'] = trim(str_replace('Team 4: ', '', $i[8]));\n $players_line = 10;\n } else {\n $players_line = 6;\n }\n $pla = '';\n //get the player info a string\n for ($l = $players_line; $line = $i[$l], $l < count($i); ++$l) {\n $pla .= $line;\n }\n //explode then chunk that string\n $players_info = array_chunk(explode(\"\\n\", $pla), 5);\n //kill the last element since its empty\n array_pop($players_info);\n //add each player to the new array\n foreach ($players_info as $p) {\n $info['players'][] = array(\n 'name' => $p[0],\n 'kills' => $p[1],\n 'deaths' => $p[2],\n 'team' => $p[3],\n 'ping' => $p[4],\n );\n }\n //return the info\n return $info;\n }",
"public function getGame();",
"protected function getAllDatas()\n {\n $result = array();\n\n // Global / static information\n $result['cardinfos'] = $this->cardBasis;\n $result['locationinfos'] = $this->locations;\n $result['tileinfos'] = $this->tiles;\n\n $result = array_merge($result, $this->getPrivateGameInfos(self::getCurrentPlayerId()));\n $result = array_merge($result, $this->getPublicGameInfos());\n return $result;\n }",
"protected function games($args) {\n\t\t\t//if $args[0] then pull just a specific game\t\t\t\n//\t\t\t$array = array(\n//\t\t\t\t\"games\" => array(\n//\t\t\t\t\tarray(\n//\t\t\t\t\t\t\"appid\" => $args[0],\n//\t\t\t\t\t\t\"usertoken\" => $this->method,\n//\t\t\t\t\t\t\"value\" => $this->endpoint,\n//\t\t\t\t\t\t\"logo\" => \"www.image.com\"\n//\t\t\t\t\t),\n//\t\t\t\t\tarray(\n//\t\t\t\t\t\t\"appid\" => $this->verb,\n//\t\t\t\t\t\t\"usertoken\" => $this->blah,\n//\t\t\t\t\t\t\"value\" => $_GET['key'],\n//\t\t\t\t\t\t\"logo\" => $_POST['key']\n//\t\t\t\t\t)\n//\t\t\t\t)\n//\t\t\t);\n\t\t\t$array = array(\n\t\t\t\t\n\t\t\t\t\tarray(\n\t\t\t\t\t\t\"appid\" => 4000,\n\t\t\t\t\t\t\"name\" => \"Garry's Mod\",\n\t\t\t\t\t\t\"playtime_forever\" => 220,\n\t\t\t\t\t\t\"img_icon_url\" => \"d9101cbeddcc4ff06c7fa1936c3f381b0bbf2e92\",\n\t\t\t\t\t\t\"img_logo_url\" => \"dca12980667e32ab072d79f5dbe91884056a03a2\",\n\t\t\t\t\t\t\"has_community_visible_stats\" => true\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t\"appid\" => 6310,\n\t\t\t\t\t\t\"name\" => \"The Longest Journey\",\n\t\t\t\t\t\t\"playtime_forever\" => 23,\n\t\t\t\t\t\t\"img_icon_url\" => \"7d6b1336162f7c26a61ffe0d456efc07d41f26cf\",\n\t\t\t\t\t\t\"img_logo_url\" => \"958177d7ecf0e96d750d0814cc40645660636434\"\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t\"appid\" => 220,\n\t\t\t\t\t\t\"name\" => \"Half-Life 2\",\n\t\t\t\t\t\t\"playtime_forever\" => 0,\n\t\t\t\t\t\t\"img_icon_url\" => \"fcfb366051782b8ebf2aa297f3b746395858cb62\",\n\t\t\t\t\t\t\"img_logo_url\" => \"e4ad9cf1b7dc8475c1118625daf9abd4bdcbcad0\",\n\t\t\t\t\t\t\"has_community_visible_stats\" => true\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t\"appid\" => 15100,\n\t\t\t\t\t\t\"name\" => \"Assassin's Creed\",\n\t\t\t\t\t\t\"playtime_forever\" => 942,\n\t\t\t\t\t\t\"img_icon_url\" => \"cd8f7a795e34e16449f7ad8d8190dce521967917\",\n\t\t\t\t\t\t\"img_logo_url\" => \"5450218e6f8ea246272cddcb2ab9a453b0ca7ef5\"\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t\"appid\" => 16600,\n\t\t\t\t\t\t\"name\" => \"Trials 2: Second Edition\",\n\t\t\t\t\t\t\"playtime_forever\" => 280,\n\t\t\t\t\t\t\"img_icon_url\" => \"96c292be9e397fd9ac6b4b18eecb4f3fa622093e\",\n\t\t\t\t\t\t\"img_logo_url\" => \"808b7091e67e61f13ba15993301b7d732ddceaf3\",\n\t\t\t\t\t\t\"has_community_visible_stats\" => true\n\t\t\t\t\t)\n\t\t\t\t\n\t\t\t);\t\t\t\t\n\n\t\t\treturn $array;\n\t\t\t//{'values':[\n\t\t\t//{}\n\t\t\t//]}\n\t\t\t//if ($this->method == 'GET') {\n\t\t\t//\treturn \"Your name is \";\n\t\t\t//} else {\n\t\t\t//\treturn \"Only accepts GET requests\";\n\t\t\t//}\n\t\t}",
"public static function gameInformation()\n {\n return \"<comment>\". self::GAME_NAME .\"</comment>: \"\n . \"A game that deals seven cards from a deck to players. \"\n . \"The highest value of all cards, held by a player, determines the winner.\\n\\n\";\n }",
"function retrieveGameInfo($name) {\n \t# Open and validate the Database connection.\n \t$conn = connect();\n\n if ($conn != null) {\n \t$sql = \"SELECT * FROM Games WHERE Name = '$name'\";\n\t\t\t$result = $conn->query($sql);\n\n\t\t\tif ($result->num_rows == 0) {\n\t\t\t\t# There are no games that match the searchTerm in the database.\n\t\t\t\t$conn->close();\n\t\t\t\treturn errors(460);\n\t\t\t}\n\n\t\t\t# Get game information\n\t\t\twhile ($row = $result -> fetch_assoc()) {\n $ans = array(\"status\" => \"COMPLETE\", \"state\" => $row[\"State\"], \"imageSource\" => $row[\"ImageSource\"],\n \"PlayStation\" => $row[\"PlayStation\"], \"PlayStation2\" => $row[\"PlayStation2\"],\n \"PlayStation3\" => $row[\"PlayStation3\"], \"PlayStation4\" => $row[\"PlayStation4\"],\n \"PSP\" => $row[\"PSP\"], \"GameboyAdvance\" => $row[\"GameboyAdvance\"],\n \"NintendoDS\" => $row[\"NintendoDS\"], \"Nintendo3DS\" => $row[\"Nintendo3DS\"],\n \"NintendoSwitch\" => $row[\"NintendoSwitch\"], \"XboxOne\" => $row[\"XboxOne\"],\n \"Blizzard\" => $row[\"Blizzard\"], \"GOG\" => $row[\"GOG\"], \"Epic\" => $row[\"Epic\"],\n \"Origin\" => $row[\"Origin\"], \"Steam\" => $row[\"Steam\"], \"Twitch\" => $row[\"Twitch\"],\n \"UPlay\" => $row[\"UPlay\"], \"Microsoft\" => $row[\"Microsoft\"]);\n\t\t\t}\n\n\t\t\t$conn->close();\n\t\t\treturn $ans;\n }\n else {\n \t# Connection to Database was not successful.\n \t$conn->close();\n \treturn errors(400);\n }\n\t}",
"protected function getAllDatas()\n {\n $result = array();\n \n $current_player_id = self::getCurrentPlayerId(); // !! We must only return informations visible by this player !!\n $isActivePlayer = $current_player_id == self::getActivePlayerId();\n\n $result['game_number'] = self::getGameStateValue('game_number');\n\n $result['location_total'] = self::getGameStateValue('location_total');\n\n $result['location_number'] = self::getGameStateValue('location_number');\n\n $result['location_marker_total'] = $this->getLocation()['max_tokens'];\n\n $result['location_marker'] = self::getGameStateValue('location_marker');\n\n $result['players'] = self::getPlayerStats();\n\n $result['active_player'] = self::getActivePlayerId();\n\n $result['hogwarts_cards_descriptions'] = $this->hogwartsCardsLibrary->hogwartsCards;\n $result['villain_descriptions'] = $this->villainCardsLibrary->villainCards;\n $result['dark_arts_descriptions'] = $this->darkArtsCardsLibrary->darkArtsCards;\n\n $result['hand'] = $this->getDeck($current_player_id)->getCardsInLocation('hand');\n\n $result['played_cards'] = $this->getDeck(self::getActivePlayerId())->getCardsInLocation('played');\n\n $result['dark_arts_cards'] = $this->darkArtsCards->getCardsInLocation('hand');\n\n $result['hogwarts_cards'] = $this->hogwartsCards->getCardsInLocation('revealed');\n\n $result['effects'] = $this->getActiveEffects();\n\n if ($isActivePlayer == true) {\n $result['acquirable_hogwarts_cards'] = $this->getAcquirableHogwartsCards($current_player_id);\n }\n\n $result['villains_max'] = self::getGameStateValue('villains_max');\n $result['villains_left'] = $this->villainCards->countCardInLocation('deck');\n $villain1 = $this->villainCards->getPlayerHand(1);\n if (count($villain1) > 0) {\n $result['villain_1'] = reset($villain1);\n $result['villain_1_dmg'] = self::getGameStateValue('villain_1_dmg');\n }\n $villain2 = $this->villainCards->getPlayerHand(2);\n if (count($villain2) > 0) {\n $result['villain_2'] = reset($villain2);\n $result['villain_2_dmg'] = self::getGameStateValue('villain_2_dmg');\n }\n $villain3 = $this->villainCards->getPlayerHand(3);\n if (count($villain3) > 0) {\n $result['villain_3'] = reset($villain3);\n $result['villain_3_dmg'] = self::getGameStateValue('villain_3_dmg');\n }\n\n return $result;\n }",
"public function pullGameData()\n {\n // Make the query to retreive game information from games table in database: \n $q = \"SELECT id_team, date, time, opponent, venue, result, note\n FROM games\n WHERE id_game = {$this->id_game}\n LIMIT 1\";\n\n // Execute the query & store result\n $result = $this->dbObject->getRow($q);\n\n // Found result\n if($result !== false) {\n $this->setGameAttributes($result['id_team'], $result['date'], $result['time'],\n $result['opponent'], $result['venue'], $result['result'],\n $result['note']);\n }\n }",
"function get_additional_information($profile){\r\n $account_info = file_get_contents($profile.\"/games/?tab=all\");\r\n\r\n //Get the position of the nearest unique identifier for the array\r\n $begin = strpos($account_info, \"var rgGames\");\r\n //Get the position of the opening array character\r\n $start = strpos($account_info, \"[\", $begin);\r\n //Get the position of the end of the array, add one extra so the array is properly closed\r\n $end = strpos($account_info, \"]\", $begin) + 1;\r\n //Get the contents of whatever is between $start and $end\r\n $json = (substr($account_info, $start, ($end - $start)));\r\n //Go from json string to php array (ended up being an StdClass, whoops)\r\n $array = json_decode($json);\r\n\r\n //Iterate through $array and find all the information related to CSGO\r\n foreach($array as $item){\r\n if($item->appid == \"730\"){\r\n return withStatus($item, 200);\r\n }\r\n }\r\n //returns false if CSGO is not found in the array\r\n return withStatus(\"game not found\", 404);\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'weatherPostalCodeGet' | protected function weatherPostalCodeGetRequest($postal_code)
{
// verify the required parameter 'postal_code' is set
if ($postal_code === null) {
throw new \InvalidArgumentException(
'Missing the required parameter $postal_code when calling weatherPostalCodeGet'
);
}
$resourcePath = '/weather/{postal_code}/';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($postal_code !== null) {
$resourcePath = str_replace(
'{' . 'postal_code' . '}',
ObjectSerializer::toPathValue($postal_code),
$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
$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);
}
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('api_token');
if ($apiKey !== null) {
$queryParams['api_token'] = $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(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | [
"public function v1AddressZipCodeRequest($zip_code)\n {\n // verify the required parameter 'zip_code' is set\n if ($zip_code === null || (is_array($zip_code) && count($zip_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $zip_code when calling v1AddressZipCode'\n );\n }\n\n $resourcePath = '/v1/address/zip_code';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($zip_code)) {\n $zip_code = ObjectSerializer::serializeCollection($zip_code, '', true);\n }\n if ($zip_code !== null) {\n $queryParams['zip_code'] = $zip_code;\n }\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('api_key');\n if ($apiKey !== null) {\n $queryParams['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\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function listCitiesRequest($postal_code = null, $city = null, string $contentType = self::contentTypes['listCities'][0])\n {\n\n\n\n\n $resourcePath = '/info/cities';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $postal_code,\n 'postal_code', // param base name\n 'string', // openApiType\n 'form', // style\n true, // explode\n false // required\n ) ?? []);\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $city,\n 'city', // param base name\n 'string', // openApiType\n 'form', // style\n true, // explode\n false // required\n ) ?? []);\n\n\n\n\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', ],\n $contentType,\n $multipart\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 (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if (!empty($this->config->getAccessToken())) {\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 $operationHost = $this->config->getHost();\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'GET',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getAddress($zipcode)\n\t{\n\t\t$url =\"https://maps.googleapis.com/maps/api/geocode/json?address=\".$zipcode.\"&key=AIzaSyA3n1_WGs2PVEv2JqsmxeEsgvrorUiI5Es\";\n\t\t$json = json_decode(file_get_contents($url),true);\n\t\t$city = '';\n\t\t$state = '';\n\t\t$country = '';\n\n\t\tif($json['results']==[]){\n\t\t\treturn 'error';\n\t\t}else{\n\t\t\tforeach ($json['results'] as $result) {\n\t\t\t\tforeach($result['address_components'] as $addressPart) {\n\t\t\t\t\tif ((in_array('locality', $addressPart['types'])) && (in_array('political', $addressPart['types'])))\n\t\t\t\t\t\t$city = $addressPart['long_name'];\n\t\t\t\t\telse if ((in_array('administrative_area_level_1', $addressPart['types'])) && (in_array('political', $addressPart['types'])))\n\t\t\t\t\t\t$state = $addressPart['short_name'];\n\t\t\t\t\telse if ((in_array('country', $addressPart['types'])) && (in_array('political', $addressPart['types'])))\n\t\t\t\t\t\t$country = $addressPart['long_name'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$address = array();\n\t\t\t$address['city'] = $city;\n\t\t\t$address['state'] = $state;\n\t\t\t$address['country'] = $country;\n\t\t\treturn $address;\n\t\t}\n\n\n\n\t\t/*get address from IP address*/\n//\t\t$ip = $request->ip();\n//\t\t$details = json_decode(file_get_contents(\"http://ipinfo.io/23.247.115.83/json\"),true);\n//\t\t$city = $details['city'];\n//\t\t$state = $details['region'];\n//\t\t$country = $details['country'];\n//\t\treturn $city.','.$state.','.$country;\n\t}",
"function get_epc(WP_REST_Request $request)\n{\n $args = getRequestArgs();\n $url = add_query_arg( array(\n 'postcode' => $request['postcode'],\n 'address' => $request['address'],\n 'size' => $request['size']\n ), 'https://epc.opendatacommunities.org/api/v1/domestic/search?');\n return response_body_or_else_error(wp_remote_get($url, $args), 'EPC_SEARCH_API_ERROR');\n}",
"protected function getUserCountryRequest()\n {\n\n $resourcePath = '/accounts/{clientId}/country';\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 ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/x-www-form-urlencoded']\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 }",
"protected function newWitnessAddressRequest()\n {\n\n $resourcePath = '/v1/newaddress';\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 ['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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function postcodeAddressAction() {\n\t\t$result = new stdClass();\n\t\t$result->error = false;\n\n\t\t$resultIndex = 0;\n\t\t$indexCounter = 0;\n\n\t\t$postcode = $this->getRequest()->getParam( 'postcode' );\n\t\t$postcode = urlencode( trim( $postcode ) );\n\t\t$specificCountry = trim( $this->getRequest()->getParam( 'country' ) );\n\n\t\t$result->data = new stdClass();\n\n\t\t$r = json_decode( file_get_contents( \"http://maps.googleapis.com/maps/api/geocode/json?address=\" . $postcode . \"&sensor=true\" ) );\n\t\tif ( $r->status == \"OK\" ) {\n\t\t\t// if a specific country is specified, find the index among multiple results\n\t\t\tif ( !empty( $specificCountry ) ) {\n\t\t\t\tforeach ( $r->results as $resultInstance ) {\n\t\t\t\t\tforeach ( $resultInstance->address_components as $address_component ) {\n\t\t\t\t\t\tif ( $address_component->types[0] == 'country' ) {\n\t\t\t\t\t\t\tif ( $address_component->long_name == $specificCountry )\n\t\t\t\t\t\t\t\t$resultIndex = $indexCounter;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$indexCounter++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( count( $r->results[ $resultIndex ]->address_components ) > 0 ) {\n\t\t\t\tforeach ( $r->results[ $resultIndex ]->address_components as $address_component ) {\n\t\t\t\t\t$result->error = true;\n\t\t\t\t\tforeach ( $address_component->types as $type ) {\n\t\t\t\t\t\tif ( $type == \"locality\" ) {\n\t\t\t\t\t\t\t$result->error = false;\n\t\t\t\t\t\t\t$result->data->city = $address_component->long_name;\n\t\t\t\t\t\t} elseif ( $type == \"administrative_area_level_1\" ) {\n\t\t\t\t\t\t\t$result->error = false;\n\t\t\t\t\t\t\t$result->data->state = $address_component->short_name;\n\t\t\t\t\t\t} elseif ( $type == \"country\" ) {\n\t\t\t\t\t\t\t$result->error = false;\n\t\t\t\t\t\t\t$countryOption = Mage::helper( 'anattadesign_awesomecheckout' )->getAllowedCountryOptionById( $address_component->short_name );\n\t\t\t\t\t\t\t$result->data->country = $address_component->long_name;\n\t\t\t\t\t\t\tif ( $countryOption ) {\n\t\t\t\t\t\t\t\t$result->data->country_id = $countryOption['value'];\n\t\t\t\t\t\t\t\t$result->data->country = $countryOption['label'];\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} else {\n\t\t\t\t$result->error = true;\n\t\t\t}\n\t\t} else {\n\t\t\t$result->error = true;\n\t\t}\n\n\t\t$this->getResponse()->setBody( Mage::helper( 'core' )->jsonEncode( $result ) );\n\t}",
"public function getWeatherByZipCode($zip)\n {\n return $this->makeWeatherRequest($zip);\n }",
"protected function countriesRequest()\n {\n\n $resourcePath = '/countries';\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 zipcodeAction() {\n Mage::app();\n umask(0);\n Mage::app(\"default\");\n $model = Mage::getModel('zipcode/zipcode');\n $collection = $model->getCollection();\n $custs = $collection->getData();\n $items = count($custs);\n $value = json_decode(file_get_contents('php://input'));\n $zeep = $value->zip;\n $i = 0;\n foreach ($collection as $items) {\n if ($zeep >= $items->getZipcodeFrom() && $zeep <= $items->getZipcodeTo()) {\n $response1[] = array('values' => 1, 'message' => $items->getMessage());\n $i = 0;\n } else {\n if ($i == 0) {\n $response1[] = array('status' => 0, 'message' => 'Not available in your location yet!');\n }\n $response1[] = array('values' => 0, 'message' => $items->getMessage());\n }\n $i++;\n }\n // $this->response($this->json($response1), 200);\n $jsonData = $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));\n }",
"protected function getCountriesRequest()\n {\n\n $resourcePath = '/api/V1/GetCountries';\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 ['application/json', 'text/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/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\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 getCityByPincode(){\n\n\t\t$cus_pincode = $this->input->get_post('cus_pincode');\n\n $query = $this->Common_model->getCityPincode($cus_pincode);\n \n echo json_encode($query);\n\t}",
"protected function infoAvailableCountriesRequest()\n {\n\n $resourcePath = '/info/countries';\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 ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\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\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 getPostalCodeType();",
"public function query($query)\n\t{\n\t\t// Reset the status message to be empty, so that it won't\n\t\t// cascade between calls\n\t\t$this->status_message = null;\n\n\t\t// Generate the URL for our API query\n\t\t$url = $this->createUrl($query);\n\n\t\t// Run the query\n\t\t$this->raw_response = file_get_contents($url);\n\n\t\t// Unserialize the result\n\t\t$response = unserialize($this->raw_response);\n\n\t\t// If we don't have a result set or our result was invalid\n\t\tif ($response === false || !isset($response['ResultSet']))\n\t\t{\n\t\t\t// Construct and throw the exception\n\t\t\t$status = self::ERROR_BAD_RESPONSE;\n\t\t\t$errMsg = self::getErrorMessage($status);\n\t\t\tthrow new GeoCode_Exception($errMsg, $status, $this);\n\t\t}\n\n\t\t// Get the first result\n\t\t$result = current($response['ResultSet']);\n\n\t\t// If we have a warning\n\t\tif (isset($result['warning']))\n\t\t{\n\t\t\t// Set the status message for use with the warning constant\n\t\t\t$this->status_message = $result['warning'];\n\t\t}\n\n\t\t// Set the clean query to the address returned\n\t\t// NOTE: Don't worry if they are empty entries, they will be removed by the trim()\n\t\t$clean_query = $result['Address'] .', '. $result['City'] .', ';\n\n\t\t// Special handling for state/zip combox to allow them to\n\t\t// have a space between them and a comma after\n\t\tif (!empty($result['State']))\n\t\t{\n\t\t\t$clean_query .= $result['State'];\n\t\t\tif (!empty($result['Zip']))\n\t\t\t{\n\t\t\t\t$clean_query .= ' '.$result['Zip'];\n\t\t\t}\n\t\t\t$clean_query .= ', ';\n\t\t}\n\t\telseif (!empty($result['Zip']))\n\t\t{\n\t\t\t$clean_query .= $result['Zip'].', ';\n\t\t}\n\n\t\t// Add contry\n\t\t$clean_query .= $result['Country'];\n\n\t\t// Clean anything extra\n\t\t$clean_query = trim($clean_query, ' ,');\n\n\t\t// Format the data\n\t\t$data = array(\n\t\t\t'query' => $query,\n\t\t\t'clean_query' => $clean_query,\n\t\t\t'accuracy' => $this->getAccuracyConst($result['precision']),\n\t\t\t'latitude' => $result['Latitude'],\n\t\t\t'longitude' => $result['Longitude'],\n\t\t\t'street' => $result['Address'],\n\t\t\t'state' => $result['State'],\n\t\t\t'city' => $result['City'],\n\t\t\t'zip' => $result['Zip'],\n\t\t\t'country' => $result['Country'],\n\t\t);\n\n\t\t// Create and return the result\n\t\treturn new GeoCode_Result($this, $data);\n\t}",
"protected function customerPincodeCheckPostRequest($body)\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 customerPincodeCheckPost'\n );\n }\n\n $resourcePath = '/customer/pincode-check';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\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 // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY');\n if ($apiKey !== null) {\n $headers['X-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\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public static function fromPostalCode($postal_code)\n\t{\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); \n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 8);\n\t\t$http_query = self::$GOOGLE_MAPS_API;\n\t\t$http_query .= \"json?\";\n\t\t$http_query .= \"address=\";\n\t\t$http_query .= $postal_code;\n\t\t$http_query = substr($http_query, 0, 1024);\n\n\t\tif (\\Cache::has(GOOGLE_API_CACHE_PREFIX.md5($http_query)))\n\t\t{\n\t\t\t$response = \\Cache::get(GOOGLE_API_CACHE_PREFIX.md5($http_query));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $http_query);\n\t\t\t$response = curl_exec($ch);\n\t\t\tcurl_close($ch);\n\t\t\t\\Cache::put(GOOGLE_API_CACHE_PREFIX.md5($http_query), $response, GOOGLE_API_CACHE_TIMEOUT);\n\t\t}\n\n\t\tif (! $response)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$response = json_decode($response, true);\n\t\t$resolved_state_province = '';\n\n\t\ttry\n\t\t{\n\t\t\tforeach($response['results'][0]['address_components'] as $component)\n\t\t\t\tif(in_array('country', $component['types']))\n\t\t\t\t\t$resolved_country = $component['long_name'];\n\n\t\t\tforeach($response['results'][0]['address_components'] as $component) \n\t\t\t\tif(in_array('administrative_area_level_1', $component['types']))\n\t\t\t\t\t$resolved_state_province = $component[$resolved_country == 'Canada' ? 'long_name' : 'short_name'];\n\t\t}\n\t\tcatch (\\ErrorException $e)\n\t\t{\n\t\t\t/**\n\t\t\t * \\ErrorException: Undefined offset.\n\t\t\t * This means Google has changed the format of the JSON returned by this\n\t\t\t * API. This should really never happen. Handle it however you like.\n\t\t\t */\n\t\t}\n\n\t\tif (!isset($resolved_country) || !isset($resolved_state_province))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$d = new Destination($resolved_country, $resolved_state_province, $postal_code);\n\t\treturn $d;\n\t}",
"public function zipCodeInfo(){\n\t\t$zip = $_POST['zip'];\n\t\t$url=\"https://maps.googleapis.com/maps/api/geocode/json?address=\".urlencode($zip).\"&sensor=false&key=AIzaSyA863uhw0eIufXkjyziP9nZIo9uJAKo2ZU\";\n\t\t$details=file_get_contents($url);\n\t\t$results=json_decode($details,true);\n\t\tif(!empty($results['results'][0])){\n\t //$city =$results['results'][0]['address_components'][1]['long_name'];\n\t // $address=$results['results'][0]['address_components'][3]['long_name'];\n\t\t\t$formattedAddress=$results['results'][0]['formatted_address'];\n\t\t\tif(!empty($results['results'][0]['address_components'])){\n\t\t\t\t$address=$results['results'][0]['address_components'][3]['long_name'];\n\t\t\t\tdie(json_encode(['success'=>true,'address'=>$formattedAddress]));\n\t\t\t}else{\n\t\t\t\tdie(json_encode(['success'=>true,'address'=>$formattedAddress])); \n\t\t\t}\n\t\t}else{\n\t\t\tdie(json_encode(['success'=>false,'message'=>\"invalid zipcode\"]));\n\t\t}\n\t}",
"function mapit_get_example_postcode($id) {\n global $mapit_client;\n $params = func_get_args();\n $result = $mapit_client->call('MaPit.get_example_postcode', $params);\n return $result;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the public 'TYPO3\CMS\T3editor\Registry\AddonRegistry' shared autowired service. | protected function getAddonRegistryService()
{
return $this->services['TYPO3\\CMS\\T3editor\\Registry\\AddonRegistry'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstanceForDi(\TYPO3\CMS\T3editor\Registry\AddonRegistry::class);
} | [
"protected function getRegistryService()\n {\n return $this->services['TYPO3\\\\CMS\\\\Core\\\\Registry'] = \\TYPO3\\CMS\\Core\\ServiceProvider::getRegistry($this);\n }",
"protected function getAddon()\n {\n return $this->addon;\n }",
"protected function getEmConfUtilityService()\n {\n return $this->services['TYPO3\\\\CMS\\\\Extensionmanager\\\\Utility\\\\EmConfUtility'] = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Extensionmanager\\Utility\\EmConfUtility::class);\n }",
"protected function getWPSEOAddonManagerService()\n {\n }",
"function GhostPool_Addons_Manager() {\n\treturn GhostPool_Addons_Manager::instance();\n}",
"public function getAddon() {\n\t\treturn AddonManager::getFromId($this->aid);\n\t}",
"public static function get_addon_manager()\n {\n }",
"protected function getWidgetRegistryService()\n {\n $this->services['TYPO3\\\\CMS\\\\Dashboard\\\\WidgetRegistry'] = $instance = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Dashboard\\WidgetRegistry::class, $this);\n\n $instance->registerWidget('t3newsWidgetConfiguration');\n $instance->registerWidget('sysLogErrorsWidgetConfiguration');\n $instance->registerWidget('docGettingStartedWidgetConfiguration');\n $instance->registerWidget('docTypoScriptReferenceWidgetConfiguration');\n $instance->registerWidget('docTSconfigWidgetConfiguration');\n $instance->registerWidget('t3informationWidgetConfiguration');\n $instance->registerWidget('typeOfUsersWidgetConfiguration');\n $instance->registerWidget('t3securityAdvisoriesWidgetConfiguration');\n $instance->registerWidget('failedLoginsWidgetConfiguration');\n\n return $instance;\n }",
"public static function registry() {\n if ( ! static::$use_registry ) {\n static::$use_registry = false;\n } else if ( null === static::$registry ) {\n static::init_registry();\n }\n return static::$registry;\n }",
"protected function getRendererRegistryService()\n {\n return $this->services['TYPO3\\\\CMS\\\\Core\\\\Resource\\\\Rendering\\\\RendererRegistry'] = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Core\\Resource\\Rendering\\RendererRegistry::class);\n }",
"function get_registry()\n\t{\n\t\tif (!isset($this->_registry)) {\n\t\t\t$this->_registry = C_Component_Registry::get_instance();\n\t\t}\n\n\t\treturn $this->_registry;\n\t}",
"protected function getHelperService()\n {\n return $this->services['TYPO3\\\\CMS\\\\Extensionmanager\\\\Utility\\\\Repository\\\\Helper'] = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Extensionmanager\\Utility\\Repository\\Helper::class);\n }",
"protected function getDriverRegistryService()\n {\n return $this->services['TYPO3\\\\CMS\\\\Core\\\\Resource\\\\Driver\\\\DriverRegistry'] = \\TYPO3\\CMS\\Core\\ServiceProvider::getDriverRegistry($this);\n }",
"protected function getInstallUtilityService()\n {\n $this->services['TYPO3\\\\CMS\\\\Extensionmanager\\\\Utility\\\\InstallUtility'] = $instance = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Extensionmanager\\Utility\\InstallUtility::class);\n\n $instance->setLogger(($this->services['_early.TYPO3\\\\CMS\\\\Core\\\\Log\\\\LogManager'] ?? $this->get('_early.TYPO3\\\\CMS\\\\Core\\\\Log\\\\LogManager', 1))->getLogger('TYPO3\\\\CMS\\\\Extensionmanager\\\\Utility\\\\InstallUtility'));\n $instance->injectEventDispatcher(($this->services['Psr\\\\EventDispatcher\\\\EventDispatcherInterface_decorated_1'] ?? $this->getEventDispatcherInterfaceDecorated1Service()));\n $instance->injectDependencyUtility(($this->services['TYPO3\\\\CMS\\\\Extensionmanager\\\\Utility\\\\DependencyUtility'] ?? $this->getDependencyUtilityService()));\n $instance->injectFileHandlingUtility(($this->services['TYPO3\\\\CMS\\\\Extensionmanager\\\\Utility\\\\FileHandlingUtility'] ?? $this->getFileHandlingUtilityService()));\n $instance->injectListUtility(($this->services['TYPO3\\\\CMS\\\\Extensionmanager\\\\Utility\\\\ListUtility'] ?? $this->getListUtilityService()));\n $instance->injectExtensionRepository(($this->services['TYPO3\\\\CMS\\\\Extensionmanager\\\\Domain\\\\Repository\\\\ExtensionRepository'] ?? $this->getExtensionRepositoryService()));\n $instance->injectPackageManager(($this->services['_early.TYPO3\\\\CMS\\\\Core\\\\Package\\\\PackageManager'] ?? $this->get('_early.TYPO3\\\\CMS\\\\Core\\\\Package\\\\PackageManager', 1)));\n $instance->injectCacheManager(($this->services['TYPO3\\\\CMS\\\\Core\\\\Cache\\\\CacheManager'] ?? $this->getCacheManagerService()));\n $instance->injectRegistry(($this->services['TYPO3\\\\CMS\\\\Core\\\\Registry'] ?? $this->getRegistryService()));\n $instance->injectLateBootService(($this->services['TYPO3\\\\CMS\\\\Install\\\\Service\\\\LateBootService'] ?? $this->getLateBootServiceService()));\n\n return $instance;\n }",
"public static function instance() {\n\n if (!isset(self::$instance) && !(self::$instance instanceof LandzaiElement_Elementor_Addons)) {\n\n self::$instance = new LandzaiElement_Elementor_Addons;\n\n self::$instance->setup_constants();\n\n self::$instance->includes();\n\n self::$instance->hooks();\n\n }\n return self::$instance;\n }",
"public static function getRegistry() {\n global $registry;\n return $registry;\n }",
"protected function getConfigurationManagerService()\n {\n return $this->services['TYPO3\\\\CMS\\\\Extbase\\\\Configuration\\\\ConfigurationManager'] = \\TYPO3\\CMS\\Extbase\\ServiceProvider::getConfigurationManager($this);\n }",
"public static function getInstance()\n {\n if (self::$_registry === null) {\n self::init();\n }\n\n return self::$_registry;\n }",
"public static function getInstance()\n\t{\n\t\tif (self::$_registry === null) {\n\t\t\tself::init();\n\t\t}\n\t\n\t\treturn self::$_registry;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ dunghd 19/03/2012 Unit test function searchBusinessNearByLocation | public function test_search_business_nearyby_location()
{
// Search keyword
$keyword = 'hotel';
$location = 'Sydney, NSW';
$search = new SearchModel;
$result = $search->searchBusinessNearByLocation($keyword,$location);
// log to file
$xml = new Array2xml('results','business');
$xml->createNode( $result['matches'] );
if(file_exists(dirname(__FILE__) . '/log/' . __FUNCTION__ . '.xml'))
unlink(dirname(__FILE__) . '/log/' . __FUNCTION__ . '.xml');
file_put_contents(dirname(__FILE__) . '/log/' . __FUNCTION__ . '.xml',$xml);
} | [
"public function testLocationsGeoSearch()\n {\n }",
"public function testLocationsSearch()\n {\n }",
"function testNearbysearch() {\n //$this->markTestSkipped();\n $response = helper::jsonDecode($this->_rest->get($this->_restaurants_search_uri, array('location' => '-33.8670522,151.1957362', 'radius' => '500000000', 'limit' => 5)));\n $this->assertEquals(ApiHelper::MESSAGE_200, $response['status']);\n $this->assertTrue(isset($response['results']));\n $this->assertNotEmpty($response['results']);\n return $response;\n }",
"public function testSearchLocations()\n {\n\n }",
"public function testPostLocationsSearch()\n {\n }",
"public function testHotelGeosearchByCircle()\n {\n }",
"public function testLocationSearchPost()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"function ciniki_ags_locationSearch($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'),\n 'start_needle'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Search String'),\n 'limit'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Limit'),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n\n //\n // Check access to tnid as owner, or sys admin.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'ags', 'private', 'checkAccess');\n $rc = ciniki_ags_checkAccess($ciniki, $args['tnid'], 'ciniki.ags.locationSearch');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Get the list of locations\n //\n $strsql = \"SELECT ciniki_ags_locations.id, \"\n . \"ciniki_ags_locations.name, \"\n . \"ciniki_ags_locations.category, \"\n . \"ciniki_ags_locations.flags, \"\n . \"ciniki_ags_locations.address1, \"\n . \"ciniki_ags_locations.address2, \"\n . \"ciniki_ags_locations.city, \"\n . \"ciniki_ags_locations.province, \"\n . \"ciniki_ags_locations.postal, \"\n . \"ciniki_ags_locations.country, \"\n . \"ciniki_ags_locations.latitude, \"\n . \"ciniki_ags_locations.longitude, \"\n . \"ciniki_ags_locations.primary_image_id, \"\n . \"ciniki_ags_locations.synopsis \"\n . \"FROM ciniki_ags_locations \"\n . \"WHERE ciniki_ags_locations.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND (\"\n . \"name LIKE '\" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \"OR name LIKE '% \" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \") \"\n . \"\";\n if( isset($args['limit']) && is_numeric($args['limit']) && $args['limit'] > 0 ) {\n $strsql .= \"LIMIT \" . ciniki_core_dbQuote($ciniki, $args['limit']) . \" \";\n } else {\n $strsql .= \"LIMIT 25 \";\n }\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.ags', array(\n array('container'=>'locations', 'fname'=>'id', \n 'fields'=>array('id', 'name', 'category', 'flags', 'address1', 'address2', 'city', 'province', 'postal', 'country', 'latitude', 'longitude', 'primary_image_id', 'synopsis')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['locations']) ) {\n $locations = $rc['locations'];\n $location_ids = array();\n foreach($locations as $iid => $location) {\n $location_ids[] = $location['id'];\n }\n } else {\n $locations = array();\n $location_ids = array();\n }\n\n return array('stat'=>'ok', 'locations'=>$locations, 'nplist'=>$location_ids);\n}",
"public function testGetNearestLocations()\n {\n $request = new NearestLocationsRequest();\n $request->setCountryCode('NL')\n ->setPostalcode('2132WT')\n ->setCity('Hoofddorp')\n ->setStreet('Siriusdreef')\n ->setHouseNumber(42)\n ->setDeliveryDate('01-01-2030')\n ->setOpeningTime('09:00:00')\n ->addDeliveryOptions('PG');\n $response = $this->client->getAPI('location')->getNearestLocations($request);\n $this->assertTrue(count($response->getLocations()) >0);\n }",
"public function testLocationInformation()\n {\n }",
"public function test_suggest_location()\n\t{\t\t\n\t\t// Search keyword\n\t\t$location = 'Woll';\n\t\t\n\t\t$search = new SearchEngine;\n\t\t$result = $search->suggestLocation($location);\n\t\t\n\t\t// log to file\t\t\n\t\t$xml = new Array2xml();\n\t\t$xml->createNode( $result );\n\t\t\n\t\tif(file_exists(dirname(__FILE__) . '/log/' . __FUNCTION__ . '.xml'))\t\t\n\t\t\tunlink(dirname(__FILE__) . '/log/' . __FUNCTION__ . '.xml');\t\t\n\t\tfile_put_contents(dirname(__FILE__) . '/log/' . __FUNCTION__ . '.xml',$xml);\t\t\n\t\t\n\t}",
"function search(array $location, $keywords, $radius = 2000);",
"public function test_find_business_by_name()\n\t{\t\t\n\t\t\t\n\t\t\n\t}",
"function search($term, $location) {\n\n //$place = $location.' USA';\n $place = (empty($location)) ? 'USA' : $location.' USA';\n\n \t$bearer_token = obtain_bearer_token();\n\n \t$globaldata = globaldata();\n\n $url_params = array();\n \n $url_params['term'] = $term;\n $url_params['location'] = $place;\n $url_params['limit'] = $globaldata['search_limit'];\n \n $req = request($bearer_token, $globaldata['api_host'], $globaldata['search_path'], $url_params);\n\n\n $biz = json_decode($req);\n\n return $biz->businesses;\n }",
"public function testGetNearestLocationsGeo()\n {\n $request = new NearestLocationsGeoRequest();\n $request->setCountryCode('NL')\n ->setLatitude('52.2864669620795')\n ->setLongitude('4.68239055845954')\n ->setDeliveryDate('01-01-2030')\n ->setOpeningTime('09:00:00')\n ->addDeliveryOptions('PG');\n $response = $this->client->getAPI('location')->getNearestLocationsGeo($request);\n $this->assertTrue(count($response->getLocations()) >0);\n }",
"function locationSearch() {\n $location = $_GET['location_search'];\n\n if (empty($_GET['location_search'])) {\n $marker_location = allResults();\n } else {\n $lat = substr($location, 0, 12);\n $long = substr($location, -12);\n $earth_rad = 6371;\n \t\t$search_rad = 1;\n\n \t\t$max_lat = $lat + rad2deg($search_rad/$earth_rad);\n \t\t$min_lat = $lat - rad2deg($search_rad/$earth_rad);\n \t\t$max_long = $long + rad2deg($search_rad/$earth_rad/cos(deg2rad($lat)));\n \t\t$min_long = $long - rad2deg($search_rad/$earth_rad/cos(deg2rad($lat)));\n\n \t\t$max_lat = number_format((float)$max_lat, 8, '.', '');\n \t\t$min_lat = number_format((float)$min_lat, 8, '.', '');\n \t\t$max_long = number_format((float)$max_long, 8, '.', '');\n \t\t$min_long = number_format((float)$min_long, 8, '.', '');\n\n $result = $GLOBALS['pdo']->prepare('SELECT id, name, street, suburb, latitude, longitude FROM items WHERE latitude BETWEEN :minlat AND :maxlat AND longitude BETWEEN :minlong AND :maxlong ORDER BY (POW((latitude - :lat),2) + POW((longitude - :long),2)),2');\n $result->bindValue(':minlat', $min_lat);\n $result->bindValue(':maxlat', $max_lat);\n $result->bindValue(':minlong', $min_long);\n $result->bindValue(':maxlong', $max_long);\n $result->bindValue(':lat', $lat);\n $result->bindValue(':long', $long);\n $result->execute();\n $marker_location = array();\n\n if ($result->rowCount() > 0) {\n echo \"<h3>Parks within a $search_rad km radius</h3>\";\n echo '<div id=\"search_map\"></div>';\n echo '<table id=\"results_table\">';\n echo '<th>Park Name</th>';\n echo '<th>Street Name</th>';\n echo '<th>Suburb</th>';\n\n foreach ($result as $row) {\n $name = strtolower($row['name']);\n $street = strtolower($row['street']);\n $suburb = strtolower($row['suburb']);\n $marker_location[] = array($row['id'], $name, $street, $row['latitude'], $row['longitude']);\n echo '<tr>';\n echo \"<td>$name<br>\";\n echo \"<a href=\\\"Park.php?id=$row[id]\\\">See reviews</a></td>\";\n echo \"<td>$street</td>\";\n echo \"<td>$suburb</td>\";\n echo '</tr>';\n }\n echo '</table>';\n } else {\n echo '<h3>No parks found near you</h3>';\n }\n }\n return $marker_location;\n }",
"public function testListZRLocations()\n {\n }",
"function getPeopleNear($POD,$query,$lat,$lon,$distance,$sort='distance asc',$count=20,$offset=0) {\n\t\n\tlist($south,$north,$west,$east) = $POD->getBoundingBox($lat,$lon,$distance);\n\n\t$poly = \"Polygon(({$north} {$east},{$north} {$west},{$south} {$west},{$south} {$east},{$north} {$east}))\";\n\n\t$query[\"u.location,MBRWithin(u.location,GeomFromText('${poly}'))\"] = 1;\n\t\n\n\treturn $POD->getPeopleSortedByDistance($query,$lat,$lon,$sort,$count,$offset);\n\n}",
"public function testGeoQueries() {\n\t\t$coords = [84.13, 11.38];\n\t\t$coords2 = array_map(function($point) { return $point + 5; }, $coords);\n\t\t$conditions = ['location' => ['$near' => $coords]];\n\n\t\t$query = new Query(compact('conditions') + ['model' => $this->_model]);\n\t\t$result = $query->export($this->_db);\n\t\t$this->assertEqual($result['conditions'], $conditions);\n\n\t\t$conditions = ['location' => [\n\t\t\t'$within' => ['$box' => [$coords2, $coords]]\n\t\t]];\n\t\t$query = new Query(compact('conditions') + ['model' => $this->_model]);\n\t\t$result = $query->export($this->_db);\n\t\t$this->assertEqual($conditions, $result['conditions']);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Executes this Choreo. Execution object provides access to results appropriate for this ListAudits Choreo. | public function execute($inputs = array(), $async = false, $store_results = true)
{
return new Zendesk_TicketAudits_ListAudits_Execution($this->session, $this, $inputs, $async, $store_results);
} | [
"public function getAudits()\n {\n return $this->audits;\n }",
"public function getAudits() {\n $user = $this->auth->user();\n\n if(!$user) {\n return CustomResponsesHandler::response([\n \"code\" => 401,\n \"message\" => \"Permisos denegados para el cliente\",\n \"response\" => null\n ]);\n } else {\n\n $audit = Audit::where('client_id', $user->id)->get(['audits.*']);\n\n foreach ($audit as $key => $value) {\n $documents = AuditDocuments::join('documents', 'documents.id', '=', 'audits_has_documents.document_id')\n ->where('audit_id',$value->id)\n ->select('documents.*')\n ->get();\n $audit[$key][\"documents\"] = $documents;\n }\n if($audit->count()) {\n return CustomResponsesHandler::response([\n \"code\" => 200,\n \"message\" => \"Listado de auditorias\",\n \"response\" => array(\"audits\" => $audit)\n ]);\n } else {\n return CustomResponsesHandler::response([\n \"code\" => 202,\n \"message\" => \"No se encontraron auditorias\",\n \"response\" => null\n ]);\n }\n }\n }",
"static function get_audits(): array {\n\n $audits = [];\n\n if (MJKBod_ACF::have_rows(MJKBod_ACF::audits)) {\n\t while (MJKBod_ACF::have_rows(MJKBod_ACF::audits)) {\n the_row();\n\n $statement = MJKBod_ACF::sub(MJKBod_ACF::audit);\n $year_end = MJKBod_ACF::sub(MJKBod_ACF::audit_ye);\n\n $audits[] = ['statement' => $statement, 'year_end' => $year_end];\n }\n }\n\n // Sort by date -- newest first\n usort($audits, function(array $a, array $b): int {\n \t$pri_a = JKNTime::dt($a['year_end']);\n\t $pri_b = JKNTime::dt($b['year_end']);\n\t return $pri_b <=> $pri_a;\n });\n\n return $audits;\n }",
"public function index()\n\t{\n\t\t$audits = Audit::all();\n\n\t\treturn View::make('audits.index', compact('audits'));\n\t}",
"public function getAudits($clientID)\n {\n return $this->database->retrieve(\"SELECT Audit.auditID, location, dateCreated, dateScored FROM Audit, ScoredAudits\n WHERE clientID = 4 AND Audit.auditID = ScoredAudits.auditID ORDER BY dateCreated;\");\n }",
"public function audits()\n {\n return $this->morphMany(Auditing::class, 'auditable');\n }",
"public function getAuditItems() {\n\t\treturn $this->auditItems;\n\t}",
"public function executeAuditList(sfWebRequest $request) {\n //fetch request parameters\n $user_id = $request->getParameter('user_id');\n $product_id = $request->getParameter('type');\n //fetch user audit records for given company\n $this->product_audit_records = Doctrine::getTable('Producto')->getUserAuditRecords($user_id, $product_id);\n }",
"public function getAuditorias($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif(null === $this->collAuditorias || null !== $criteria) {\n\t\t\tif ($this->isNew() && null === $this->collAuditorias) {\n\t\t\t\t// return empty collection\n\t\t\t\t$this->initAuditorias();\n\t\t\t} else {\n\t\t\t\t$collAuditorias = AuditoriaQuery::create(null, $criteria)\n\t\t\t\t\t->filterByUsuario($this)\n\t\t\t\t\t->find($con);\n\t\t\t\tif (null !== $criteria) {\n\t\t\t\t\treturn $collAuditorias;\n\t\t\t\t}\n\t\t\t\t$this->collAuditorias = $collAuditorias;\n\t\t\t}\n\t\t}\n\t\treturn $this->collAuditorias;\n\t}",
"public function actionIndex()\n {\n $searchModel = new AuditLogSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function audits(): HasMany\n {\n return $this->hasMany(\\App\\Models\\Audit::class);\n }",
"public function auditions() {\n return $this->hasMany('App\\Audition', 'student_id', 'student_id');\n }",
"public function actionIndex()\n {\n $searchModel = new AuditEntrySearch;\n $dataProvider = $searchModel->search(Yii::$app->request->get());\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n 'searchModel' => $searchModel,\n ]);\n }",
"static function getAudits( \\Silex\\Application $app ) {\n\n\t\t// Obtem os filtros especificados\n\t\t$usuario = $app[\"request\"]->get(\"usuario\");\n\t\t$ip = $app[\"request\"]->get(\"ip\");\n\t\t$evento = $app[\"request\"]->get(\"evento\");\n\t\t\n\t\t// Obtem a lista com resultados paginados\n\t\t$arr = \\SiMCE\\Classes\\Audit::getByQuery(\n\t\t\t\" data >= :inicio AND data <= :fim AND ( unidades_id = :unidade OR unidades_id IS NULL ) ORDER BY data DESC\",\n\t\t\tarray(\n\t\t\t\t'inicio' => $app[\"request\"]->get('inicio') . ' 00:00:00',\n\t\t\t\t'fim' => $app[\"request\"]->get('fim') . ' 23:59:59',\n\t\t\t\t'unidade' => $app[\"user\"]->getUnidade()\n\t\t\t)\n\t\t);\n\n\t\tforeach($arr as $idx => &$v) {\n\t\t\tif (!empty($usuario)) {\n\t\t\t\tif (stristr($v['usuarios_id'],$usuario) === false) {\n\t\t\t\t\tunset($arr[$idx]);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!empty($ip)) {\n\t\t\t\tif (stristr($v['ip'],$ip) === false) {\n\t\t\t\t\tunset($arr[$idx]);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!empty($evento)) {\n\t\t\t\tif (stristr($v['acao'], $evento) === false) {\n\t\t\t\t\tunset($arr[$idx]);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Retorna as dados\n\t\treturn $app->json( array(\n\t\t\t'aaData' => array_slice( $arr, $app[\"request\"]->get(\"iDisplayStart\"), $app[\"request\"]->get(\"iDisplayLength\")),\n\t\t\t'iTotalRecords' => count($arr),\n\t\t\t'iTotalDisplayRecords' => count($arr),\n\t\t\t'sEcho' => $app['request']->get('sEcho'),\n\t\t\t\t\"id\" => $app['user']->getUnidade(),\n\t\t\t\t\"o_id\" => $app['request']->get('operacao')\n\t\t));\n\t\t\n\t}",
"public function addAudits( \\Doctrine\\Common\\Collections\\ArrayCollection $audits )\n {\n foreach( $audits as $audit )\n {\n $this->addAudit( $audit );\n }\n\n return $this;\n }",
"public function countAuditorAction()\n {\n $user_id = $this->log_user_data->user_id;\n $status = array(0,3);\n $this->db->select('po.id')\n ->from('purchase_order po')\n ->where('po.approve_by', $user_id)\n ->where_in('po.status', $status);\n return $this->db->get();\n }",
"public function Fetch_Failed_Document_Audits($execution_id)\n\t\t{\n\t\t\t$query = \"\n\t\t\t\tselect\n\t\t\t\t\tdoc.document_id,\n\t\t\t\t\tdoc.application_id,\n\t\t\t\t\tpart.file_name,\n\t\t\t\t\tpa0.part_audit_id,\n\t\t\t\t\tunix_timestamp(pa0.date_audit) date_audit,\n\t\t\t\t\tpa0.part_id,\n\t\t\t\t\tpa0.audit_status\n\t\t\t\tfrom part_audit pa0\n\t\t\t\tjoin part on part.part_id = pa0.part_id\n\t\t\t\tjoin document_part dp on dp.part_id = pa0.part_id\n\t\t\t\tjoin document doc on doc.document_id = dp.document_id\t\t\t\t\n\t\t\t\twhere pa0.execution_id = $execution_id\n\t\t\t\tand pa0.audit_status in ('MODIFIED','MISSING')\";\n\t\t\t\n\t\t\t$result = $this->mysqli->Query($query, CONDOR_DB_NAME);\n\t\t\t\n\t\t\t$audits = array();\n\t\t\t\n\t\t\twhile ($audit = $result->Fetch_Object_Row())\n\t\t\t{\n\t\t\t\t$audits[$audit->document_id][] = $audit;\n\t\t\t}\n\t\t\t\n\t\t\treturn $audits;\t\n\t\t}",
"public function getAuditTimestamps();",
"public function getIncompleteAudits()\n {\n return $this->database->retrieve(\"SELECT auditID,location,dateCreated FROM Audit WHERE completed = false\");\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prints the current page name as a CSSsafe string | function the_page_id() {
echo Utils::cssSafe(Filter::get(current_page(), 'name'));
} | [
"function CurrentPageName() {\n\treturn GetPageName(ScriptName());\n}",
"function curPageName() {\n\treturn substr($_SERVER[\"SCRIPT_NAME\"], strrpos($_SERVER[\"SCRIPT_NAME\"], \"/\") + 1);\n}",
"function current_page_name() {\r\n return basename($_SERVER['SCRIPT_FILENAME']);\r\n }",
"function Show_site_name() {\r\n print(\"<h1>$this->site_name</h1>\\n\");\r\n }",
"function page_title()\n\t{\n\t $page = isset($_GET['page']) ? htmlspecialchars($_GET['page']) : 'Home';\n\t echo ucwords(str_replace('-', ' ', $page));\n\t}",
"function page_name() {\n\t\t// Bring in $page_name and $subpage_name if set\n\t\tglobal $page_name;\n\t\tglobal $subpage_name;\n\t\t\n\t\t// If both $subpage_name and $page_name are set, return both\n\t\tif(isset($page_name) && isset($subpage_name)) {\n\t\t\treturn $subpage_name . \" - \" . $page_name;\n\t\t} else { // Otherwise just return the $page_name\n\t\t\treturn $page_name;\n\t\t};\n\t}",
"function page_title()\n {\n $page = isset($_GET['page']) ? htmlspecialchars($_GET['page']) : 'Home';\n\n return ucwords(str_replace('-', ' ', $page));\n }",
"function getCurrentUrlPageName() : string\n {\n return isNotNullOrEmptyArrayKey($_SERVER, 'PHP_SELF') ? basename($_SERVER['PHP_SELF']) : '';\n }",
"function PrintSiteName()\n\t{\n\t\t$name = GetTitle('parameters/preferences', 2);\n\t\techo $name;\n\t}",
"public function page_name ()\n {\n return $this->app->page_names->change_home;\n }",
"static private function getCurrentPagePrefix()\n {\n $current_story_level = self::getCurrentStoryLevel();\n\n $url = '';\n\n for ($i = 0; $i < $current_story_level; $i++) {\n $url .= '../';\n }\n\n return $url;\n }",
"public function page_name ()\n {\n return $this->app->page_names->user_home;\n }",
"function print_name() { \n\n\t\t$this->format_name();\n\t\techo \"<span title=\\\"\" . $this->title . \"\\\">\" . $this->name . \"</span>\";\n\n\t}",
"public function getPageName()\n {\n return $this->_getData('page_name');\n }",
"public function getPageName(): string;",
"function getCustomPageLabel($name){\n\t\t$name = str_replace('_',' ', $name);\n\t\treturn ucwords($name);\n\t}",
"public function showSiteName();",
"public function get_frontpage_name()\n {\n // loads the associated object\n //if (empty($this->frontpage))\n // $this->frontpage = new SystemProgram($this->frontpage_id);\n // \n // returns the associated object\n return '-- NC --';//$this->frontpage->name;\n }",
"public function getCurrentPageHTML()\r\n {\r\n return '<span id=\"pageNumberHTML1' . md5($this->_instanceName)\r\n . '\">' . $this->getCurrentPage() . '</span>';\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build an IP detector instance from the configured settings. | public static function build() {
$proxy = ITSEC_Modules::get_setting( 'global', 'proxy' );
return self::build_for_type( $proxy );
} | [
"public static function build($name)\n {\n if (self::ipLookupEnabled()) {\n $customProviders = config('tracker.lookup.custom_providers');\n\n if ($customProviders && array_key_exists($name, $customProviders)) {\n\n // Use of a custom IP address lookup provider\n\n if (!in_array(IpProvider::class, class_implements($customProviders[$name]))) {\n\n // The custom IP provider class doesn't\n // implement the required interface\n\n throw new CustomIpProviderException;\n }\n\n return new $customProviders[$name];\n\n } else {\n\n // Use of an officially supported IP address lookup provider\n\n switch ($name) {\n case 'ip2location-lite':\n return new Ip2LocationLite;\n case 'ip-api':\n return new IpApi;\n default:\n throw new IpProviderException;\n }\n }\n }\n }",
"protected function setDevice()\n {\n DeviceParserAbstract::setVersionTruncation(DeviceParserAbstract::VERSION_TRUNCATION_NONE);\n\n $this->piwik = new DeviceDetector($this->{self::USER_AGENT});\n $this->piwik->discardBotInformation();\n $this->piwik->skipBotDetection();\n $this->piwik->parse();\n\n foreach ($this->config as $method) {\n $method = ucwords(str_replace(['-', '_'], ' ', $method));\n $method = str_replace(' ', '', $method);\n\n if (method_exists($this, \"getFromPiwik\" . $method)) {\n $this->{\"getFromPiwik\" . $method}();\n }\n }\n\n return $this;\n }",
"public function _constructIPG()\n {\n if ($this->getConfigData('testmode') == 1) :\n return (new Payments())->environmentUrls(array(\n \"merchantId\" => $this->getConfigData('merchant_key'),\n \"password\" => $this->getConfigData('merchant_password'),\n \"sessionToken\" => $this->getConfigData('testtoken'),\n \"action\" => $this->getConfigData('testpayment'),\n \"baseUrl\" => $this->getConfigData('testbase'),\n \"jsToken\" => $this->getConfigData('testjs'),\n ));\n endif;\n return (new Payments())->environmentUrls(array(\n \"merchantId\" => $this->getConfigData('merchant_key'),\n \"password\" => $this->getConfigData('merchant_password'),\n \"sessionToken\" => $this->getConfigData('livetoken'),\n \"action\" => $this->getConfigData('livepayment'),\n \"baseUrl\" => $this->getConfigData('livebase'),\n \"jsToken\" => $this->getConfigData('livejs'),\n ));\n }",
"public function __construct($settings){\r\n $settings = (array)$settings;\r\n \r\n if(!empty($settings[\"serviceId\"])){\r\n $this->serviceId = trim($settings[\"serviceId\"]);\r\n }\r\n \r\n if(!empty($settings[\"secret\"])){\r\n $this->secret = trim($settings[\"secret\"]);\r\n }\r\n \r\n if(!empty($settings[\"allowedIPAddresses\"])){\r\n $this->allowedIPAddresses = (array)$settings[\"allowedIPAddresses\"];\r\n }\r\n }",
"public function __construct($settings = array()) {\n\n\t\t$defaultSettings = array(\n\t\t\t\t'username' => SafechargeConstants::REQUEST_DEFAULT_USERNAME,\n\t\t\t\t'password' => SafechargeConstants::REQUEST_DEFAULT_PASSWORD,\n\t\t\t\t'timeout' => SafechargeConstants::REQUEST_DEFAULT_TIMEOUT,\n\t\t\t\t'live' => SafechargeConstants::REQUEST_DEFAULT_LIVE,\n\n\t\t\t\t'log' => '',\n\n\t\t\t\t'padFrom' => SafechargeConstants::DEFAULT_PAD_FROM,\n\t\t\t\t'padTo' => SafechargeConstants::DEFAULT_PAD_TO,\n\t\t\t\t'padWith' => SafechargeConstants::DEFAULT_PAD_WITH,\n\n\t\t\t\t'instanceId' => rand(1,100000),\n\t\t\t);\n\t\t$this->settings = array_merge($defaultSettings, $settings);\n\n\t\t$this->log(\"Initialized\");\n\t}",
"public static function init(): self\n {\n return new self(new DisputeEvidenceFile());\n }",
"public function setUp() {\n $this->_ipv = new Norse\\IPViking(array(\n 'proxy' => 'http://geofilter.test.com/',\n 'api_key' => '1234',\n 'curl_class' => 'NorseTest\\Curl',\n ));\n }",
"public static function create()\n\t{\n\t\treturn new Faett_Piwik_Service();\n\t}",
"public function parseIp(): void\n {\n $this->type = self::TYPE_STRING;\n $this->example = $this->faker->ipv4;\n }",
"public function __construct()\n {\n $this->ipHandler = new SchoolIpHandler();\n }",
"function acquire_ip_details($ip_addr) {\n $ip = new Ip();\n\n $ip->ip = $ip_addr;\n $ip->agent = $_SERVER['HTTP_USER_AGENT'];\n $ip->domain = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\n $ip->hostname = gethostbyaddr($ip->ip);\n\n $geoplugin = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $ip->ip));\n\n $ip->city = $geoplugin['geoplugin_city'];\n $ip->region = $geoplugin['geoplugin_region'];\n $ip->country = $geoplugin['geoplugin_countryName'];\n $ip->country_code = $geoplugin['geoplugin_countryCode'];\n\n if (is_numeric($geoplugin['geoplugin_latitude']) && is_numeric($geoplugin['geoplugin_longitude'])) {\n $ip->latitude = $geoplugin['geoplugin_latitude'];\n $ip->longitude = $geoplugin['geoplugin_longitude'];\n }\n\n return $ip;\n}",
"public static function create()\n {\n $vimeoExtractor = VimeoExtractor::create();\n $youtubeExtractor = YoutubeExtractor::create();\n $dailymotionExtractor = DailymotionExtractor::create();\n return new self([$vimeoExtractor,\n $youtubeExtractor,\n $dailymotionExtractor],\n $filter = []);\n }",
"public static function init(): self\n {\n return new self(new TipSettings());\n }",
"public function newDeviceFromDetection()\n {\n $this->detect();\n\n $device_uuid = Str::uuid()->toString() . Str::random(64);\n $data = $this->detectData['data'];\n $device_type = $this->detectData['device_type'];\n $ip = Request::ip();\n\n return new Device(compact('device_uuid', 'data', 'device_type', 'ip'));\n }",
"public function __construct($ip, $network_size)\n {\n $this->validateInputs($ip, $network_size);\n\n $this->ip = $ip;\n $this->network_size = $network_size;\n $this->quads = explode('.', $ip);\n $this->subnet_mask = 0xFFFFFFFF << (32 - $this->network_size);\n }",
"public static function fromString($IP);",
"public function __construct(){\r\n\t\t//Determine clients IP with get method\r\n\t\t$this->ip = $this->get();\r\n\t}",
"private function init()\n {\n // return the configurations from the config file\n $this->configurations = $this->helper->getConfigurations();\n\n // return an instance of the corresponding Provider concrete according to the configuration\n $this->provider = $this->provider_factory->create($this->configurations);\n }",
"public static function init(): self\n {\n return new self(new DisputeEvidence());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns all messages containing the specified search string, most recent first | public function searchMessages($string)
{
$query = $this->db->query("SELECT user_username, text, posted_at
FROM Messages
WHERE text
LIKE '%$string%'
ORDER BY posted_at
DESC");
return $query->result_array();
} | [
"public function searchMessages($string) {\n return $this->db->select('*')\n ->from('Messages')\n ->like('text', $string)\n ->order_by('posted_at', 'DESC')\n ->get()\n ->result_array();\n }",
"public function searchMessages($term) {\n $search_string = '\"%'.$term.'%\"';\n $query = 'SELECT user_username, text, posted_at FROM Messages WHERE text LIKE '.$search_string.' ORDER BY posted_at DESC';\n $query = $this->db->query($query);\n return $query->result();\n }",
"public function getList($search = null) {\n try {\n if ($search == null) {\n $sql = \"SELECT * FROM `messages` ORDER BY `MessageID` DESC\";\n } else {\n $sql = \"SELECT * FROM `messages` WHERE (`SenderEmail` LIKE '%{$search}%' OR `Subject` LIKE '%{$search}%') ORDER BY `MessageID` DESC\";\n }\n $stmt = $this->conn->query($sql, PDO::FETCH_ASSOC);\n $result = $stmt->fetchAll();\n return $result;\n } catch (PDOException $err) {\n $_SESSION[\"message\"] = msgPrep(\"danger\", \"Error - Message/getList Failed: {$err->getMessage()}\");\n return false;\n }\n }",
"public function SearchMessages($keyword){\n $messages = $this->getMessages(\"WHERE `title` LIKE '%$keyword%' OR `message` LIKE '%$keyword%'\");\n return $messages;\n }",
"public function messagesNewestFirst() {\n return $this->messages()->orderBy('created_at', 'desc')->get();\n }",
"function rpm_search_pms($search_for, $match)\n{\n\tglobal $db, $db_prefix;\n\tif ($match == 'exact')\n\t{\n\t\t$sql = \"SELECT DISTINCT `id`, `subject`, `sent`\n\t\t\tFROM `\" . $db_prefix . \"_private_messages` \n\t\t\tWHERE `text` LIKE '%\" . $search_for . \"%'\n\t\t\tORDER BY `sent` DESC\";\n\t}\n\telseif ($match == 'all')\n\t{\n\t\t$a = explode(' ', $search_for);\n\t\t$ands = implode(\"%' AND `message` LIKE '%\", $a);\n\t\t$sql = \"SELECT DISTINCT `id`, `subject`, `sent`\n\t\t\tFROM `\" . $db_prefix . \"_private_messages`\n\t\t\tWHERE `text` LIKE '%\" . $ands . \"%'\n\t\t\tORDER BY `sent` DESC\";\n\t}\n\telse\n\t{\n\t\t$a = explode(' ', $search_for);\n\t\t$ors = implode(\"%' OR `text` LIKE '%\", $a);\n\t\t$sql = \"SELECT DISTINCT `id`, `subject`, `sent`\n\t\t\tFROM `\" . $db_prefix . \"_private_messages`\n\t\t\tWHERE `text` LIKE '%\" . $ors . \"%' \n\t\t\tORDER BY `sent` DESC\";\n\t}\n\t\n\t$result = $db->sql_query($sql);\n\t$pms = array();\n\twhile($array = $db->sql_fetchrow($result))\n\t{\n\t\t$pms[] = $array;\n\t}\n$db->sql_freeresult($result);\n\treturn $pms;\n}",
"public function search($query = \"ALL\")\n\t{\n\t\t$ids = imap_search($this->stream(), $query);\n\t\t$messages = [];\n\t\t$factory = new MessageFactory($this);\n\t\t\n\t\tif ($ids) {\n\t\t\tforeach ($ids as $id) {\n\t\t\t\t$messages[] = $factory->create($id);\n\t\t\t}\n\t\t}\n\t\t\n\t\tusort($messages, [$this, \"sort\"]);\n\t\t\n\t\treturn $messages;\n\t}",
"public function findByText($message);",
"public function getMessageSecondSearch($cnt, $userid, $search, $searchby, $period_query) {\n\n if (!empty($search)) {\n if (!empty($searchby) && $searchby != \"organisation\") {\n //for name\n $query = \"SELECT m. * ,s.received_as, s.user_id, a.name, a.middle_name, a.surname, s.msg_read\n\t\t\t\t\tFROM messaging m, msg_sent_to s, add_user_list a\n\t\t\t\t\tWHERE m.msg_id = s.msg_id\n\t\t\t\t\tAND m.sent_by = a.user_id\";\n\n $query.=\" \" . \"AND m.sent_by = '$userid'\";\n\n $query.=\" \" . \"AND s.sent_to_archive = 'N'\n\t\t\t\t\tAND m.msg_type = 'Message'\";\n if ($searchby == \"subject\") {\n $query.=\" \" . \"AND m.subject LIKE '%$search%'\";\n } elseif ($searchby == \"message\") {\n $query.=\" \" . \"AND m.message LIKE '%$search%'\";\n } elseif ($searchby == \"sender\") {\n $query.=\" \" . \"AND (m.sent_as LIKE '%$search%')\";\n } elseif ($searchby == \"receiver\") {\n $query.=\" \" . \"AND (s.received_as LIKE '%$search%')\";\n }\n $query.=\" \" . $period_query;\n $query.=\" \" . \"ORDER BY m.msg_id DESC\";\n } elseif (!empty($searchby) && $searchby == \"organisation\") {\n $query = \"SELECT m. *,s.received_as, s.user_id, o.name, s.msg_read\n\t\t\t\t\tFROM messaging m, msg_sent_to s, organisation o, liason_officer l1, lo_org l2\n\t\t\t\t\tWHERE m.msg_id = s.msg_id\n\t\t\t\t\tAND l1.lo_id = l2.lo_id\n\t\t\t\t\tAND l2.org_id = o.org_id\n\t\t\t\t\tAND l1.user_id = s.user_id\";\n $query.=\" \" . \"AND m.sent_by = '$userid'\";\n\n $query.=\" \" . \"AND s.sent_to_archive = 'N'\n\t\t\t\t\tAND m.msg_type = 'Message'\n\t\t\t\t\tAND o.name LIKE '%$search%' \" . $period_query . \" \" . \"\n\t\t\t\t\tORDER BY m.msg_id DESC\";\n }\n $value = $this->getDBRecords($query);\n $cnt = count($value);\n $results = array();\n for ($i = 0; $i < $cnt; $i++) {\n $results[$i][\"msg_id\"] = $value[$i]['msg_id'];\n $results[$i][\"msg_type\"] = $value[$i]['msg_type'];\n $results[$i][\"priority\"] = $value[$i]['priority'];\n $results[$i][\"subject\"] = $value[$i]['subject'];\n $results[$i][\"received_as\"] = $value[$i]['received_as'];\n $results[$i][\"user_id\"] = $value[$i]['user_id'];\n if ($value[$i]['msg_read'] == 'Y')\n $status = \"read\"; else\n $status=\"unread\";\n $results[$i][\"status\"] = $status;\n $results[$i][\"sent_date\"] = $this->getMessageDate($value[$i]['msg_sent_dt']);\n $results[$i][\"sent_by_name\"] = $this->correctstring($value[$i]['sent_as']);\n $from = $value[$i]['user_id'];\n include MODEL_PATH . \"getCompanydet.php\";\n $this->smarty->assign('orgname', $orgname);\n }\n }\n $this->smarty->assign('results', $results);\n return $cnt;\n }",
"public function test_get_most_recent_message() {\n // Create some users.\n $user1 = self::getDataGenerator()->create_user();\n $user2 = self::getDataGenerator()->create_user();\n\n // The person doing the search.\n $this->setUser($user1);\n\n // Send some messages back and forth.\n $time = 1;\n $this->send_fake_message($user1, $user2, 'Yo!', 0, $time + 1);\n $this->send_fake_message($user2, $user1, 'Sup mang?', 0, $time + 2);\n $this->send_fake_message($user1, $user2, 'Writing PHPUnit tests!', 0, $time + 3);\n $this->send_fake_message($user2, $user1, 'Word.', 0, $time + 4);\n\n // Retrieve the most recent messages.\n $message = \\core_message\\api::get_most_recent_message($user1->id, $user2->id);\n\n // Check the results are correct.\n $this->assertEquals($user2->id, $message->useridfrom);\n $this->assertEquals($user1->id, $message->useridto);\n $this->assertContains('Word.', $message->text);\n }",
"public function search_queue(string $to_email = '', string $from_email = '', string $subject = '', string $message = '')\n{\n\n // Go through queue\n $results = array();\n foreach ($this->queue as $msg) { \n\n // Search\n if ($to_email != '' && $msg->get_to_email() != $to_email) { continue; }\n if ($from_email != '' && $msg->get_from_email() != $from_email) { continue; }\n if ($subject != '' && !preg_match(\"/$subject/i\", $msg->get_subject())) { continue; }\n if ($message != '' && !preg_match(\"/$message/i\", $msg->get_message())) { continue; }\n\n // Add to results\n $results[] = $msg;\n }\n\n // Return\n return $results;\n\n}",
"protected function loadMessages()\n {\n // if not yet loaded, get messages\n if (!isset($this->messages))\n {\n $this->getConnection();\n \n // test if sorting asc or descending\n $reverse = ($this->sortOrder == self::DESC) ? 1 : 0;\n\n $filterCriteria = $this->getFilterCriteria();\n $sortColumn = strtolower($this->sortColumn);\n \n // lookup table for imap-header-property-names to imap-sort-constant \n $sortMapping = array(\n 'date' => SORTARRIVAL,\n 'from' => SORTFROM,\n 'to' => SORTTO,\n 'cc' => SORTCC,\n 'subject' => SORTSUBJECT,\n 'size' => SORTSIZE,\n );\n \n // get translation for sorting\n if (isset($sortMapping[$sortColumn]))\n {\n // regular search\n if (!is_array($filterCriteria))\n {\n $msgNrs = imap_sort($this->stream, $sortMapping[$sortColumn], $reverse, SE_UID, $filterCriteria);\n }\n // support for OR in search\n else\n {\n // get all messages\n $allMsgNrs = imap_sort($this->stream, $sortMapping[$sortColumn], $reverse, SE_UID);\n $results = array();\n \n // request results for every or\n foreach ($filterCriteria as $filterCriterion)\n {\n $newResults = imap_sort($this->stream, $sortMapping[$sortColumn], $reverse, SE_UID, $filterCriterion);\n // do a union with previous results\n if ($result != false)\n {\n $results = array_merge($results, $newResults);\n }\n }\n \n // return the intersection\n $msgNrs = array_intersect($allMsgNrs, $results); \n }\n }\n else\n {\n $filterCriteria = ($filterCriteria != null) ? $filterCriteria : 'ALL';\n \n // regular search\n if (!is_array($filterCriteria))\n {\n $msgNrs = imap_search($this->stream, $filterCriteria, SE_UID); \n }\n // support for OR in search\n else\n {\n // get all messages\n $allMsgNrs = imap_search($this->stream, 'ALL', SE_UID);\n $results = array();\n \n // request results for every or\n foreach ($filterCriteria as $filterCriterion)\n {\n $newResults = imap_search($this->stream, $filterCriterion, SE_UID);\n // do a union with previous results\n if ($newResults != false)\n {\n $results = array_merge($results, $newResults);\n }\n }\n \n // return the intersection\n $msgNrs = array_intersect($allMsgNrs, $results); \n } \n \n if ($this->sortOrder == self::DESC)\n {\n $msgNrs = array_reverse($msgNrs);\n }\n }\n \n // if no results found, set to empty array\n if ($msgNrs == false)\n {\n $msgNrs = array();\n }\n \n // use the offset and limit\n if ($this->getLimit())\n {\n $msgNrs = array_slice($msgNrs, $this->getOffset(), $this->getLimit());\n }\n \n // used for the iterator\n $this->messages = $this->getByIds($msgNrs, $this->showDeleted);\n }\n }",
"public function searchMessage($message_id)\n\t{\n\t\tif (!isset($this->_cache['search_message']))\n\t\t\t$this->_cache['search_message'] = array();\n\n\t\tif (!isset($this->_cache['search_message'][$message_id]))\n\t\t{\n\t\t\t$call = $this->api_commands['search_message'];\n\t\t\t$uri = $this->getApiUrl() . strtr($call['url'], array('{message-id}' => $message_id));\n\n\t\t\t$response = $this->request($uri, array(), $call['method']);\n\n\t\t\t$this->_cache['search_message'][$message_id] = $response->isSuccessful() ? $response->getBody() : null;\n\t\t}\n\n\t\treturn $this->_cache['search_message'][$message_id];\n\t}",
"public function searchMessages($criteria, $sortBy = SORTDATE, $reverse = true, $options = 0) {\n\t\t// Search using the criteria and search terms\n\t\tif(is_array($criteria)) {\n\t\t\t// Build the search string from the given criteria array.\n\t\t\t$searchString = $this->buildSearchString($criteria);\n\t\t} else {\n\t\t\t// There are no search terms, so just use the criteria (some criteria such as ALL, do not have searches)\n\t\t\t$searchString = strtoupper($criteria);\n\t\t}\n\n\t\treturn $this->imap->sort($searchString, $sortBy, $reverse, $options);\n\t}",
"function searchMessages($text, User $user)\n {\n return MessageTable::getInstance()\n ->createQuery()\n ->where('discussion_id=? and match(text) against (?)', array($this->getId(), $text))\n ->andWhereIn('private_user_id', array(0, $user->getId()))\n ->orderBy('id asc')\n ->execute();\n }",
"public function search(string $criteria): MessageCollection\n {\n if (!$this->stream) {\n $this->stream = $this->connect();\n }\n\n $messages = new MessageCollection();\n\n if ($results = imap_search($this->stream, $criteria, SE_UID)) {\n foreach ($results as $result) {\n $messages->add(new Message($this->stream, (int)$result));\n }\n }\n\n return $messages;\n }",
"public function searchMessages(array $params)\n {\n $search = '';\n while (count($params)) {\n $search .= trim(array_shift($params)).' ';\n }\n $result = $this->talk('UID SEARCH', array((string) $search));\n if (empty($result) || !isset($result[0][1])) {\n return array();\n }\n array_shift($result[0]);\n return $result[0];\n }",
"public function search($phrase) \n {\n $msgs = Message::where('message', 'LIKE', '%' . $phrase . '%')->get();\n\n return response()->json($msgs);\n }",
"function filterMessagesByContent($db, $filter) {\n $response = $db->query(\"SELECT * FROM messages WHERE message LIKE '%$filter%';\");\n return turnQueryToReverseArray($response);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a tournament in the database | protected function createTournament(\AcceptanceTester $I, $attributes = [])
{
$faker = \Faker\Factory::create();
$tournamentName = implode('-', $faker->words());
$tournamentTitle = Strings::formatForTitle(implode('_', $faker->words()));
$open = Carbon::now()->subDay(1)->toDateTimeString();
$close = Carbon::now()->addMonth(1)->toDateTimeString();
$occuring = Carbon::now()->addMonth(1)->addDay(1)->toDateTimeString();
$attr = Arrays::defaultAttributes(
[
'name' => $tournamentName,
'title' => $tournamentTitle,
'max_players' => 5,
'max_teams' => 5,
'sign_up_open' => $open,
'sign_up_close' => $close,
'game_id' => $I->grabFromDatabase('champ_games', 'id', array('name' => 'league-of-legends')),
'occurring' => $occuring,
'sign_up_form' => '{"tournament":["Tournament Name","required|exists:mysql_champ.tournaments,name","hidden","' . $tournamentName . '"],"team-name":["Team Name","required|uniqueWidth:mysql_champ.teams,=name,tournament_id>{{tournament_id}}","text",""]}',
'sign_up_form_shortcode' => '[build-form name="' . $tournamentName . '-sign-up" new_line="," delimiter="|" start="' . strtotime($open) . '" expires="' . strtotime($close) . '" questions="Tournament Name|hidden|' . $tournamentName . ',Team Name|text"]'
],
$attributes);
$query = 'INSERT INTO champ_tournaments (';
foreach (array_keys($attr) as $key) {
$query .= '`' . $key . '`,';
}
$query = rtrim($query, ',');
$query .= ") VALUES (";
foreach (array_values($attr) as $value) {
$query .= "'$value',";
}
$query = rtrim($query, ',');
$query .= ")";
$I->runQuery($I,
[
'server' => env('DB_HOST'),
'user' => env('DB_USERNAME'),
'password' => env('DB_PASSWORD'),
'database' => env('DB_DATABASE'),
],
$query);
return $attr;
} | [
"public function actionCreate()\n {\n $model = new Tournament();\n\n if ($model->load(Yii::$app->request->post()) && $model->createNewTournament()) {\n\n return $this->redirect(['view', 'id' => $model->id_t]);\n }\n\n return $this->render('create', [\n 'model' => $model\n ]);\n }",
"public function createtournament(Request $request)\n {\n $t = new tournament();\n $t->name = $request->get('name');\n $t->password = $request->get('password');\n $t->settings = serialize(array('scoreboard'=>1));\n $t->save();\n\n $tm = new tournamentPlayer();\n $tm->tid = $t->id;\n $tm->uid = Auth::id();\n $tm->admin = 1;\n $tm->save();\n\n return redirect( 'lobby?tid='.$t->id );\n }",
"public function created(Tournament $tournament): void\n {\n $tournament->stages()->create();\n }",
"function tourney_rank_create($tournament, $contestant) {\n if (!$contestant) return FALSE;\n db_insert('tourney_rank')\n ->fields(array(\n 'tournament' => $tournament->id,\n 'entity_type' => $contestant->entity_type,\n 'entity_id' => $contestant->entity_id,\n 'wins' => 0,\n 'losses' => 0,\n 'rank' => 0,\n ))\n ->execute();\n return TRUE;\n}",
"public function actionCreate() {\n $model = new TournamentForm();\n// if($_POST){\n// D($_POST);\n// }\n if ($model->load(Yii::$app->request->post()) && $model->save(Yii::$app->request->post())) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function createTournament($params)\n {\n $response = Guzzle::post(\"tournaments\", $params);\n return new Tournament($response->tournament);\n }",
"public function addTournament($name){\n\t\tif($this->db->insert(SPORT_LEAGUE_DB_PREFIX . \"tournaments\", array('name' => $name))){\n\t\t\treturn $this->db->insert_id;\n\t\t}\n\n\t\treturn false;\n\t}",
"function Create() {\n $db = new DB();\n\n $data = [\n \"id\" => $this->id,\n \"name\" => $this->name,\n \"crest\" => $this->crest,\n ];\n\n if ($team_id = $db->modify(\"INSERT INTO Team (id, name, crest) VALUES (:id, :name, :crest)\", $data)) {\n return $team_id;\n } else\n return false;\n }",
"public function createTeam()\n\t\t\t\t{\n\t\t\t\t\t\t\t\t$arrFields = array(\"teamtitle\",\"teamdescription\");\n\t\t\t\t\t\t\t\t$arrValues = array($this->getTeamTitle(),$this->getTeamDescription());\n\n\t\t\t\t\t\t\t\t$objDatabase = new Database();\n\t\t\t\t\t\t\t\t$objFeedback = new Feedback();\n\n\t\t\t\t\t\t\t\tif($objDatabase->insert('teams',$arrFields,$arrValues))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn false;\n\n\t\t\t\t}",
"public function actionTournament()\n {\n $u_id = Yii::app()->user->id;\n $isAdmin = array_key_exists($u_id, $this->admin);\n\n if (($_SERVER['SERVER_ADDR'] == $_SERVER['REMOTE_ADDR']) || $isAdmin) {\n \n $criteria1 = new CDbCriteria();\n $criteria1->addCondition('active = :active');\n $criteria1->params[\":active\"] = 1;\n $sports = Sport::model()->findAll($criteria1);\n\n foreach ($sports as $sport) {\n $this->tournamentPopulate($sport);\n }\n \n } else {\n die(\"Access forbidden!\");\n }\n \n exit();\n }",
"public function insert_teams(){\n foreach ($this->team_names as &$team_name) {\n $myTeam = new Team($team_name);\n $myTeam->save();\n }\n }",
"public function createTeam($teamName, $student, $league);",
"function createTournament()\n{\n global $link;\n\n $name = trim($_POST[\"name\"]);\n $date = trim($_POST[\"date\"]);\n\n if (!empty($name) && !empty($date)) {\n \n $sql = \"INSERT INTO toernooi (description, date) VALUES (?, ?)\";\n\n if ($stmt = mysqli_prepare($link, $sql)) {\n mysqli_stmt_bind_param($stmt, \"ss\", $name, $date);\n if (mysqli_stmt_execute($stmt)) {\n header(\"location:../?page=toernooien\");\n } else {\n echo $sql;\n }\n }\n mysqli_stmt_close($stmt);\n }\n else{\n echo \"<script type='text/javascript'>alert('Niet alle velden zijn ingevuld. Probeer opnieuw.');</script>\";\n }\n mysqli_close($link);\n}",
"private function createPlayer()\n {\n $response = $this->actingAs( $this->user )->call(\n 'POST', \n $this->URL, \n ['name' => 'Taylor']\n );\n $response->assertStatus(400);\n\n $response = $this->actingAs( $this->user )->call(\n 'POST', \n $this->URL, \n [\n 'name' => 'Taylor1',\n 'trip_id' => '1',\n 'email' => \"1@123.com\",\n ]\n );\n $response->assertStatus(302);\n\n $response = $this->actingAs( $this->user )->call(\n 'POST', \n $this->URL, \n [\n 'name' => 'Taylor2',\n 'trip_id' => '1',\n 'email' => \"ctest@gmail.com\",\n ]\n );\n $response->assertStatus(302);\n\n $response = $this->actingAs( $this->user )->call(\n 'POST', \n $this->URL, \n [\n 'name' => 'Taylor3',\n 'trip_id' => '1',\n ]\n );\n $response->assertStatus(302);\n }",
"public function create()\n {\n $errors = [];\n if ($_SERVER['REQUEST_METHOD'] === 'POST') {\n if (isset($_POST['team_name']) && !empty($_POST['team_name'])) {\n $team = new Team();\n $team->setName($_POST['team_name']);\n\n $this->teamRepository->insert($team);\n header('Location: /team');\n exit;\n } else {\n $errors[] = 'Missing fields';\n }\n }\n require_once 'src/View/Team/create.php';\n }",
"public function creating(Team $team)\n {\n //\n }",
"public function register(Tournament $tournament){\n if(\n $tournament->status->id !== current(current(\\App\\Status::where('name', 'Public Open')->where('allowed','App\\Tournament')->pluck('id'))) ||\n count($tournament->registrations->where('user_id', Auth::user()->id)) >= 1\n ){\n return redirect()->route('tournamentList');\n }\n\n TournamentRegistration::create([\n 'user_id' => Auth::user()->id,\n 'tournament_id' => $tournament->id,\n 'status_id' => current(current(\\App\\Status::where('name', 'Register')->where('allowed','App\\TournamentRegistration')->pluck('id'))),\n 'accepted' => 2,\n ]);\n\n session()->flash('success', 'Je hebt je succesvol ingeschreven voor dit tournament');\n return back();\n }",
"public function save(Tournament $tournament)\r\n {\r\n $this->_em->persist($tournament);\r\n $this->_em->flush();\r\n }",
"public function setTournament(Tournament $tournament);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
display the sponsorship page | public function sponsorship(){
return view('pages.sponsorship');
} | [
"function _show_sponsors() {\n\t// Loading the DAO class\n\t$dao = new SponsorDAO();\n\t\n\tif ( Input::get('remove') ) {\n\t\t$dao->remove( $dao->get( Input::get('remove') ) );\n\t\t$message = __('A sponsor was removed!', 'wp-sfw-plugin');\n\t}\n\t\n\t$acive_sponsors\t\t= $dao->getAll( 'name', false, false, 'active' ); // Getting all active sponsors\n\t$inacive_sponsors\t= $dao->getAll( 'name', false, false, 'inactive' ); // Getting all inactive sponsors\n\t$sponsors\t\t\t= $dao->getAll( 'name' ); // Getting all sponsors\n\n\tinclude 'views/sponsor_list.php';\n}",
"private function Seesponsor(){\n\n\t\t/* * * * * * * * * * * * * * * * * * * * * * * *\n * <head> STUFF </head>\n */\n\t\tdefine(\"PAGE_TITLE\", SITE_NAME . \" - Sponsors\");\n\t\tdefine(\"PAGE_DESCR\", SITE_NAME . \" All our sponsors\");\n\t\tdefine(\"PAGE_ID\", \"seeSponsor\");\n\t\t\n\t\t\n\t\t$AllSponsors = $this->model = new SponsorModel();\n\t\t/* All sponsors who gave */\n $AllSponsor = $AllSponsors->Seesponsor();\n\n\t\t/* Construct the array to pass */\n\t\t$array = array();\n\t\t$array['sponsors'] = $AllSponsor;\n\n\t\t/* Load the view */\n\t\t$this->load->view('sponsor', 'seeSponsor', $array);\n\t\n\t}",
"public function sponsor()\n\t{\n\t $iThreadId = (int)$this->get('thread_id');\n\t $iType = (int)$this->get('type');\n\n\t if (Phpfox::getService('forum.thread.process')->sponsor($iThreadId, $iType))\n\t {\n\t\t\t// ajax call to change the hidden status for the spans\n\t\t\tif ($iType == '2')\n\t\t\t{\n\t\t\t Phpfox::getService('ad.process')->addSponsor(array('module' => 'forum', 'section'=>'thread', 'item_id' => $iThreadId));\n\t\t\t // making sponsored means hide sponsor and show unsponsor\n\t\t\t $this->call('$(\"#js_sponsor_thread_'.$iThreadId.'\").hide();');\n\t\t\t $this->call('$(\"#js_unsponsor_thread_'.$iThreadId.'\").show();');\n\t\t\t $this->alert(Phpfox::getPhrase('forum.thread_successfully_sponsored'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t Phpfox::getService('ad.process')->deleteAdminSponsor('forum-thread', $iThreadId);\n\t\t\t $this->call('$(\"#js_sponsor_thread_'.$iThreadId.'\").show();');\n\t\t\t $this->call('$(\"#js_unsponsor_thread_'.$iThreadId.'\").hide();');\n\t\t\t $this->alert(Phpfox::getPhrase('forum.thread_successfully_unsponsored'));\n\t\t\t}\n\t }\n\t else\n\t {\n\t\t// bad attempt\n\n\t }\n\t}",
"public function getSponsor();",
"function manage_sponsors()\n\n\t{\n\n\t\taccess_control($this);\n\n\t\t\n\n\t\t# Get the passed details into the url data array if any\n\n\t\t$urldata = $this->uri->uri_to_assoc(3, array('m', 'i'));\n\n\t\t\n\n\t\t# Pick all assigned data\n\n\t\t$data = assign_to_data($urldata);\n\n\t\t\n\n\t\t#Get the paginated list of the students\n\n\t\t$data = paginate_list($this, $data, 'search_sponsors', array('searchstring'=> ' AND school = '.$this->myschool['id'], 'orderby'=>'firstname'));\n\n\t\t\t\t\n\n\t\t$data = add_msg_if_any($this, $data);\n\n\t\t$this->load->view('sponsors/manage_sponsors_view', $data);\n\n\t}",
"public function sponsors()\n {\n return view('main.sponsors');\n }",
"public function sponsors()\n {\n return View::make('static.sponsors');\n }",
"public function indexAction() {\n\n\t\t$this -> cacheService -> clearPageCache($pidList);\n\n\t\t// angemeldeter Benutzer ist Patenkind\n\t\tif ($this -> sponsorshipKonfigurationRepository -> isPatenkind($this -> uid)) {\n\n\t\t\t// zurückziehen einer Anfrage\n\t\t\tif ($this -> request -> hasArgument('pid')) {\n\t\t\t\t$this -> requestId = $this -> request -> getArgument('pid');\n\t\t\t\t$this -> action = \"revoke\";\n\t\t\t} else {\n\n\t\t\t\t$activeSponsor = $this -> sponsorshipKonfigurationRepository -> getActiveSponsor($this -> uid);\n\t\t\t\t$this -> view -> assign('activeSponsor', $activeSponsor);\n\t\t\t\t$this -> view -> assign('activeSponsorCheck', count($activeSponsor) > 0);\n\n\t\t\t\t$pendingSponsor = $this -> sponsorshipKonfigurationRepository -> getPendingSponsor($this -> uid);\n\t\t\t\t$this -> view -> assign('pendingSponsor', $pendingSponsor);\n\t\t\t\t$this -> view -> assign('pendingSponsorCheck', count($pendingSponsor) > 0);\n\n\t\t\t\t$this -> viewNotEmpty = $this -> viewNotEmpty || count($activeSponsor) > 0 || count($pendingSponsor) > 0;\n\t\t\t}\n\t\t}\n\n\t\t// angemeldeter Nutzer ist Pate\n\t\telseif ($this -> sponsorshipKonfigurationRepository -> isPate($this -> uid)) {\n\n\t\t\t$this -> view -> assign('isPate', '1');\n\n\t\t\t// annehmen der Anfrage durch den Paten\n\t\t\tif ($this -> request -> hasArgument('an')) {\n\t\t\t\t$this -> requestId = $this -> request -> getArgument('an');\n\t\t\t\t$this -> action = \"accept\";\n\t\t\t}\n\n\t\t\t// ablehnen der Anfrage durch den Paten\n\t\t\telseif ($this -> request -> hasArgument('ab')) {\n\t\t\t\t$this -> requestId = $this -> request -> getArgument('ab');\n\t\t\t\t$this -> action = \"refuse\";\n\t\t\t} else {\n\n\t\t\t\t$activeChildren = $this -> sponsorshipKonfigurationRepository -> getActiveChildren($this -> uid);\n\t\t\t\t$this -> view -> assign('activeChildren', $activeChildren);\n\t\t\t\t$this -> view -> assign('activeChildrenCheck', count($activeChildren) > 0);\n\n\t\t\t\t$pendingChildren = $this -> sponsorshipKonfigurationRepository -> getPendingChildren($this -> uid);\n\t\t\t\t$this -> view -> assign('pendingChildren', $pendingChildren);\n\t\t\t\t$this -> view -> assign('pendingChildrenCheck', count($pendingChildren) > 0);\n\n\t\t\t\t$this -> viewNotEmpty = $this -> viewNotEmpty || count($activeChildren) > 0 || count($pendingChildren) > 0;\n\t\t\t}\n\n\t\t}\n\n\t\tif (isset($this -> requestId)) {\n\n\t\t\t// Anfrage ist bereits beantwortet\n\t\t\tif (!$this -> sponsorshipKonfigurationRepository -> connectionIsPending($this -> requestId)) {\n\t\t\t\t$this -> action = \"answered\";\n\t\t\t}\n\n\t\t\t$connection = $this -> sponsorshipKonfigurationRepository -> getConnection($this -> requestId);\n\t\t\t$this -> sponsorId = $connection[0]['pate'];\n\t\t\t$this -> childId = $connection[0]['paten_kind'];\n\t\t}\n\n\t\tswitch ($this -> action) {\n\t\t\tcase 'revoke' :\n\t\t\t\t// zurückziehen\n\t\t\t\t$this -> sponsorshipLinkRepository -> deleteConnection($this -> requestId, null, $this -> uid);\n\t\t\t\t$this -> view -> assign('ms', Tx_Extbase_Utility_Localization::translate(page_verwaltung_ms_back, DdSponsorship));\n\t\t\t\tbreak;\n\t\t\tcase 'accept' :\n\t\t\t\t// annehmen\n\t\t\t\t$this -> sponsorshipLinkRepository -> changeState($this -> requestId, 1);\n\t\t\t\t$this -> view -> assign('ms', Tx_Extbase_Utility_Localization::translate(page_verwaltung_ms_angenommen, DdSponsorship));\n\t\t\t\t$subject = Tx_Extbase_Utility_Localization::translate(email_anfrage_angenommen, DdSponsorship);\n\t\t\t\t$this -> sendEmail($subject, 'angenommen');\n\t\t\t\tbreak;\n\t\t\tcase 'refuse' :\n\t\t\t\t// ablehnen\n\t\t\t\t$this -> sponsorshipLinkRepository -> changeState($this -> requestId, 3);\n\t\t\t\t$this -> view -> assign('ms', Tx_Extbase_Utility_Localization::translate(page_verwaltung_ms_abgelehnt, DdSponsorship));\n\t\t\t\t$subject = Tx_Extbase_Utility_Localization::translate(email_anfrage_abgelehnt, DdSponsorship);\n\t\t\t\t$this -> sendEmail($subject, 'abgelehnt');\n\t\t\t\tbreak;\n\t\t\tcase 'answered' :\n\t\t\t\t// bereits beantworted\n\t\t\t\t$this -> view -> assign('ms', Tx_Extbase_Utility_Localization::translate(page_verwaltung_ms_beantwortet, DdSponsorship));\n\t\t\t\tbreak;\n\n\t\t\tcase 'view' :\n\t\t\t\t// normaler Seitenaufruf\n\t\t\t\t$this -> view -> assign('verwalten_url', $this -> config[0][page_verwaltung_uid]);\n\t\t\t\t$this -> view -> assign('details_url', $this -> config[0][page_details_uid]);\n\t\t\t\t$this -> view -> assign('profil_id', $this -> config[0][page_profil_real_uid]);\n\t\t\t\t$this -> view -> assign('admin_email', $this -> settings['sponsorship_admin_email']);\n\n\t\t\t\t$closedSponsors = $this -> sponsorshipKonfigurationRepository -> getClosedSponsors($this -> uid);\n\t\t\t\t$this -> view -> assign('closedSponsors', $closedSponsors);\n\t\t\t\t$this -> view -> assign('closedSponsorsCheck', count($closedSponsors) > 0);\n\n\t\t\t\t$closedChildren = $this -> sponsorshipKonfigurationRepository -> getClosedChildren($this -> uid);\n\t\t\t\t$this -> view -> assign('closedChildren', $closedChildren);\n\t\t\t\t$this -> view -> assign('closedChildrenCheck', count($closedChildren) > 0);\n\n\t\t\t\t$this -> viewNotEmpty = $this -> viewNotEmpty || count($closedSponsors) > 0 || count($closedChildren) > 0;\n\n\t\t\t\t// Hinweis zeigen, wenn die Ansicht leer ist\n\t\t\t\tif (!$this -> viewNotEmpty)\n\t\t\t\t\t$this -> view -> assign('ms', Tx_Extbase_Utility_Localization::translate(page_verwaltung_ms_leer, DdSponsorship));\n\n\t\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\t// nicht angemeldet\n\t\t\t\t\t$this -> view -> assign('ms', Tx_Extbase_Utility_Localization::translate(page_verwaltung_ms_abgemeldet, DdSponsorship));\n\t\t\t\tbreak;\n\t\t}\n\n\t}",
"public function sponsorBanners()\n {\n $pageTitle = \"Sponsor Banners | WeAfrican\";\n $homeBanners = HomePageBanner::where('user_id', Auth::id())->get();\n return view('my-account.sponsor', compact('pageTitle','homeBanners'));\n }",
"public function sponsorsAction()\n {\n $content = $this->renderView('UmbrellaFrontendBundle:Pages:sponsors.html.twig');\n\n return new Response($content);\n }",
"public function sponsor(Apartment $apartment)\n {\n if (Auth::user()->id == $apartment->user_id){\n // leggo l'elenco dele sponsorship presenti nel DB, ottengo una collection\n $sponsorships = Sponsorship::all();\n\n return view('admin.sponsor', ['apartment' => $apartment, 'sponsorships' => $sponsorships]);\n\n } else {\n // l'appartamento in aggiornamento non appartiene all'utente loggato\n // visualizzo una pagina che lo informa\n return view('admin.not_authorized');\n }\n }",
"public function indexAction()\n {\n $sponsors = $this->getDoctrine()->getManager()\n ->getRepository('Entity:Sponsor')\n ->getAll();\n\n return [\n 'sponsors' => $sponsors,\n ];\n }",
"public function edit()\n {\n $sponsors = Sponsor::orderby('value', 'desc')->get();\n\n return view('admin.editSponsors', compact('sponsors'));\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('UserBundle:Sponsorship')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"function UpdateSponsor()\n\t\t{\n\t\t\tglobal $_CONF;\n\t\t\t$this->AffiliateAuthenticate();\n\t\t\t\n\t\t\t$loggedInAffiliate = $_SESSION['username'];\n\t\t\t$affID = $this->oModel->getAffiliateID($loggedInAffiliate);\n\t\t\t\n\t\t\t$this->oModel->Sponsor->id\t\t\t\t\t= $_POST['id'];\n\t\t\t$this->oModel->Sponsor->sponsor_url\t\t\t= $_POST['sponsor_url'];\n\t\t\t$this->oModel->Sponsor->sponsor_name\t\t\t= \thtmlentities(trim($_REQUEST['sponsor_name']), ENT_QUOTES);\n\t\t\t$this->oModel->Sponsor->sponsor_description \t=\thtmlentities(trim($_REQUEST['sponsor_description']), ENT_QUOTES);\n\t\t\t$this->oModel->Sponsor->sponsor_url\t\t\t=\ttrim($_REQUEST['sponsor_url']);\n\t\t\t\n\t\t\t$art_id = $this->oModel->updateSponsor($affID);\n\t\t\t\n\t\t\tif($art_id) {\t\t\t\n\t\t\t\t$msg = \"Sponsor updated successfully.\";\t\t\t\t\n\t\t\t\techo \"<script>location='index.php?stage=affiliates&mode=AffiliateDashboard&msg=\".$msg.\"'</script>\";\n\t\t\t\tdie();\n\t\t\t} else {\t\t\t\t\t\t\t\t\n\t\t\t\t$msg = \"server_error.\";\t\n\t\t\t\techo \"<script>location='index.php?stage=affiliates&mode=AddNewSponsors&msg=\".$msg.\"'</script>\";\n\t\t\t\tdie($msg);\n\t\t\t}\t\t\t\n\t\n\t\n\t\n\t\t}",
"public function sponsorList()\n {\n return \"Bob's Shoe Emporium\";\n }",
"public function topViewed()\n {\n $user = Auth::user();\n\n $location = getLocation();\n if(Sponsorship::where('user_id', '=', $user->id)->exists())\n {\n $sponsorship = Sponsorship::where('user_id', '=', $user->id)->first();\n $userSponsor = Sponsor::where('id', '=', $sponsorship->sponsor_id)->first();\n }\n else\n {\n $userSponsor = null;\n }\n\n $sponsors = filterContentLocationAllTime($user, 0, 'Sponsor', 'views');\n\n return view ('sponsors.topViewed')\n ->with(compact('user', 'sponsors', 'userSponsor'))\n ->with('location', $location);\n }",
"public function approved_by_sourcing_list()\n {\n \n $this->load->helper('url');\n\n\n\t\t$this->load->view('QCS/list_sourcingapproveinPR');\n }",
"public function IsSponsor()\n\t{\n\t\treturn $this->group->Code == 'sponsor';\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Payout Swift Settings Post | public function payout_swift_settings_post()
{
if ($this->earnings_admin_model->update_swift_payout_settings()) {
$this->session->set_flashdata('msg_swift', 1);
$this->session->set_flashdata('success', trans("msg_updated"));
} else {
$this->session->set_flashdata('msg_swift', 1);
$this->session->set_flashdata('error', trans("msg_error"));
}
redirect($this->agent->referrer());
} | [
"public function payout_paypal_settings_post()\n {\n if ($this->earnings_admin_model->update_paypal_payout_settings()) {\n $this->session->set_flashdata('msg_paypal', 1);\n $this->session->set_flashdata('success', trans(\"msg_updated\"));\n } else {\n $this->session->set_flashdata('msg_paypal', 1);\n $this->session->set_flashdata('error', trans(\"msg_error\"));\n }\n redirect($this->agent->referrer());\n }",
"public function saveSettings_post() {\n log_message('info', 'saveSettings_post');\n $decodedToken = AUTHORIZATION::validateToken();\n $acceptedKeys = array('name*', 'businessName*', 'email*', 'phone*', 'password*');\n $input = $this->post();\n AUTHORIZATION::validateRequestInput($acceptedKeys, $input);\n $userInfo = AUTHORIZATION::validateUser($decodedToken->id);\n\n $updateData = array(\n 'name' => $input['name'],\n 'business_name' => $input['businessName'],\n 'email' => $input['email'],\n 'phone' => $input['phone']\n );\n\n if (!is_null($input['password'])) {\n $options = [\n 'cost' => 12,\n ];\n $password = password_hash(base64_decode($input['password']), PASSWORD_BCRYPT, $options);\n $updateData['password'] = $password;\n }\n\n $status = $this->UserModel->updateUser($updateData, array('id' => $userInfo['id']));\n log_message('info', 'saveSettings_post settings update - '.$userInfo['id']);\n $output = array(\n 'status' => true,\n 'message' => 'saved successfully');\n $httpCode = REST_Controller::HTTP_OK;\n $this->response($output, $httpCode);\n }",
"public function post_app_settings() {\n\t\tif( ! wp_verify_nonce( $_POST['_wpnonce'], 'configure-account_'. $this->user->ID ) ) {\n\t\t\t wp_nonce_ays( 'configure-account_'. $this->user->ID );\n\t\t}\n\t\tif( empty( $this->gitlab_account_data ) ) {\n\t\t\t$this->gitlab_account_data = array( 'config' => array() );\n\t\t}\n\t\t$this->gitlab_account_data['config'] = array(\n\t\t\t'clientId' => $_POST['client-id'],\n\t\t\t'clientSecret' => $_POST['client-secret'],\n\t\t\t'domain' => $_POST['domain'],\n\t\t\t'redirectUri' => $this->get_cb_url()\n\t\t);\n\t\tadd_user_meta( $this->user->ID, 'wpglib_account', $this->gitlab_account_data, true );\n\t\twp_redirect( $this->get_page_url() . '&success=1' );\n\t\texit;\n\t}",
"public function payout_iban_settings_post()\n {\n if ($this->earnings_admin_model->update_iban_payout_settings()) {\n $this->session->set_flashdata('msg_iban', 1);\n $this->session->set_flashdata('success', trans(\"msg_updated\"));\n } else {\n $this->session->set_flashdata('msg_iban', 1);\n $this->session->set_flashdata('error', trans(\"msg_error\"));\n }\n redirect($this->agent->referrer());\n }",
"function aegean_epay_settings_submit($form, $form_state) {\n variable_set('aegean_epay_endpoint', $form_state['values']['aegean_epay_endpoint']);\n variable_set('aegean_epay_project_salt', $form_state['values']['aegean_epay_project_salt']);\n variable_set('aegean_epay_project_shortcode', $form_state['values']['aegean_epay_project_shortcode']);\n $payment_options = aegean_epay_parse_payment_options($form_state['values']['aegean_epay_payment_options']);\n // Options will be turned into objects.\n variable_set('aegean_epay_payment_options', json_encode($payment_options));\n variable_set('aegean_epay_help', $form_state['values']['aegean_epay_help']);\n drupal_set_message(\"Settings saved.\");\n}",
"public function postLicenseSettingsPage() {\n $data = $_POST;\n $success = true;\n\n // If the user wants to deactivate the plugin on current domain\n if(isset($data[\"deactivate\"]) && $data[\"deactivate\"]) {\n $success = $this->deactivate(true);\n if($success) {\n deactivate_plugins(plugin_basename($this->pluginFilePath), true);\n wp_redirect(admin_url(\"plugins.php\"));\n return;\n }\n } else {\n\n // Save settings\n if (isset($data[$this->getLicenseKeyOptionName()])) {\n update_option($this->getLicenseKeyOptionName(), $data[$this->getLicenseKeyOptionName()], true);\n }\n\n// if(isset($data[$this->getLicenseEmailOptionName()])) {\n// update_option($this->getLicenseEmailOptionName(), $data[$this->getLicenseEmailOptionName()], true);\n// }\n\n $this->validate();\n $this->scheduleEvents();\n }\n\n // Redirect back\n $url = admin_url(sprintf('options-general.php?page=%s&success=%s', $this->getPageSlug(), $success ? 'true' : 'false'));\n wp_redirect($url);\n }",
"function wpsc_merchant_paymentsense_settings_form_submit() {\r\n\treturn wpsc_merchant_paymentsense::submit_paymentsense_settings_form();\r\n}",
"function wpsc_merchant_rbsworldpay_redirect_settings_form_submit() {\n\n\treturn wpsc_merchant_rbsworldpay_redirect::submit_rbsworldpay_redirect_settings_form();\n\t\n}",
"function edd_payza_add_settings( $settings ) {\r\n $ap_settings = array(\r\n array(\r\n 'id' => 'payza_settings',\r\n 'name' => '<strong>' . __( 'Payza Gateway Settings', 'eddap' ) . '</strong>',\r\n 'desc' => __( 'Configure your Payza Settings', 'eddap' ),\r\n 'type' => 'header'\r\n ),\r\n array(\r\n 'id' => 'payza_merchant_id',\r\n 'name' => __( 'Merchant ID', 'eddap' ),\r\n 'desc' => __( 'Enter your Payza merchant Email', 'eddap' ),\r\n 'type' => 'text',\r\n 'size' => 'regular'\r\n )\r\n );\r\n return array_merge( $settings, $ap_settings );\r\n}",
"public function email_settings_post()\n {\n check_permission('settings');\n if ($this->settings_model->update_email_settings()) {\n $this->session->set_flashdata('success', trans(\"msg_updated\"));\n $this->session->set_flashdata('message_type', \"email\");\n redirect($this->agent->referrer());\n } else {\n $this->session->set_flashdata('error', trans(\"msg_error\"));\n $this->session->set_flashdata('message_type', \"email\");\n redirect($this->agent->referrer());\n }\n\n }",
"private function _saveSettingsBasic()\r\n\t{\r\n\t\tif (!isset($_POST['paypal_usa_account']) || !$_POST['paypal_usa_account'])\r\n\t\t\t$this->_error[] = $this->l('Your Paypal Business Account is required.');\r\n\t\tif (!isset($_POST['paypal_usa_api_username']) || !$_POST['paypal_usa_api_username'])\r\n\t\t\t$this->_error[] = $this->l('Your Paypal API Username is required.');\r\n\t\tif (!isset($_POST['paypal_usa_api_password']) || !$_POST['paypal_usa_api_password'])\r\n\t\t\t$this->_error[] = $this->l('Your Paypal API Password is required.');\r\n\t\tif (!isset($_POST['paypal_usa_api_signature']) || !$_POST['paypal_usa_api_signature'])\r\n\t\t\t$this->_error[] = $this->l('Your Paypal API Signature is required.');\r\n\r\n\t\tConfiguration::updateValue('PAYPAL_USA_ACCOUNT', pSQL(Tools::getValue('paypal_usa_account')));\r\n\t\tConfiguration::updateValue('PAYPAL_USA_API_USERNAME', pSQL(Tools::getValue('paypal_usa_api_username')));\r\n\t\tConfiguration::updateValue('PAYPAL_USA_API_PASSWORD', pSQL(Tools::getValue('paypal_usa_api_password')));\r\n\t\tConfiguration::updateValue('PAYPAL_USA_API_SIGNATURE', pSQL(Tools::getValue('paypal_usa_api_signature')));\r\n\t\tConfiguration::updateValue('PAYPAL_USA_SANDBOX', (bool)Tools::getValue('paypal_usa_sandbox'));\r\n\r\n\t\t/* PayPal Express Checkout options */\r\n\t\tif (Configuration::get('PAYPAL_USA_EXPRESS_CHECKOUT') && !isset($_POST['paypal_usa_checkbox_shopping_cart']) && !isset($_POST['paypal_usa_checkbox_product']))\r\n\t\t\t$this->_error[] = $this->l('As PayPal Express Checkout is enabled, please select where it should be displayed.');\r\n\t\telse\r\n\t\t{\r\n\t\t\tConfiguration::updateValue('PAYPAL_USA_EXP_CHK_PRODUCT', isset($_POST['paypal_usa_checkbox_product']));\r\n\t\t\tConfiguration::updateValue('PAYPAL_USA_EXP_CHK_SHOPPING_CART', isset($_POST['paypal_usa_checkbox_shopping_cart']));\r\n\t\t\tConfiguration::updateValue('PAYPAL_USA_EXP_CHK_BORDER_COLOR', pSQL(Tools::getValue('paypal_usa_checkbox_border_color')));\r\n\t\t}\r\n\r\n\t\t/* Automated check to verify the API credentials configured by the merchant */\r\n\t\tif (Configuration::get('PAYPAL_USA_API_USERNAME') && Configuration::get('PAYPAL_USA_API_PASSWORD') && Configuration::get('PAYPAL_USA_API_SIGNATURE'))\r\n\t\t{\r\n\t\t\t$result = $this->postToPayPal('GetBalance', '');\r\n\t\t\tif (strtoupper($result['ACK']) != 'SUCCESS' && strtoupper($result['ACK']) != 'SUCCESSWITHWARNING')\r\n\t\t\t\t$this->_error[] = $this->l('Your Paypal API crendentials are not valid, please double-check their values or contact PayPal.');\r\n\t\t}\r\n\r\n\t\tif (!count($this->_error))\r\n\t\t\t$this->_validation[] = $this->l('Congratulations, your configuration was updated successfully');\r\n\t}",
"function pn_edd_add_settings( $settings ) {\n\n\t$paynow_gateway_settings = array(\n\t\tarray(\n\t\t\t'id' => 'paynow_gateway_settings',\n\t\t\t'name' => '<strong>' . __( 'Paynow Gateway Settings', 'pw_edd' ) . '</strong>',\n\t\t\t'desc' => __( 'Configure the gateway settings', 'pw_edd' ),\n\t\t\t'type' => 'header'\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'paynow_live_api_id',\n\t\t\t'name' => __( 'Merchant API ID', 'pw_edd' ),\n\t\t\t'desc' => __( 'Enter your live API ID, found in your gateway Account Settings', 'pw_edd' ),\n\t\t\t'type' => 'text',\n\t\t\t'size' => 'regular'\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'paynow_live_api_secret_key',\n\t\t\t'name' => __( 'Merchant API Key', 'pw_edd' ),\n\t\t\t'desc' => __( 'Enter your live API key, found in your gateway Account Settings', 'pw_edd' ),\n\t\t\t'type' => 'text',\n\t\t\t'size' => 'regular'\n\t\t)\n\t);\n\n\treturn array_merge( $settings, $paynow_gateway_settings );\n}",
"public function save_gateway() {\n\t\tif ( isset( $_POST['wpjobster_save_' . $this->unique_slug] ) ) {\n\n\t\t\t// _enable and _button_caption are mandatory\n\t\t\tupdate_option( 'wpjobster_' . $this->unique_slug . '_enable', trim( $_POST['wpjobster_' . $this->unique_slug . '_enable'] ) );\n\t\t\tupdate_option( 'wpjobster_' . $this->unique_slug . '_button_caption', trim( $_POST['wpjobster_' . $this->unique_slug . '_button_caption'] ) );\n\n\t\t\t// you can add here any other information that you need from the user\n\t\t\tupdate_option( 'wpjobster_ipaygh_enablesandbox', trim( $_POST['wpjobster_ipaygh_enablesandbox'] ) );\n\t\t\tupdate_option( 'wpjobster_ipaygh_lmk', trim( $_POST['wpjobster_ipaygh_lmk'] ) );\n\t\t\tupdate_option( 'wpjobster_ipaygh_tmk', trim( $_POST['wpjobster_ipaygh_tmk'] ) );\n\t\t\t// wpjobster_ipaygh_tsk\n\t\t\tupdate_option( 'wpjobster_ipaygh_success_page', trim( $_POST['wpjobster_ipaygh_success_page'] ) );\n\t\t\tupdate_option( 'wpjobster_ipaygh_failure_page', trim( $_POST['wpjobster_ipaygh_failure_page'] ) );\n\n\t\t\techo '<div class=\"updated fade\"><p>' . __( 'Settings saved!', 'wpjobster-ipaygh' ) . '</p></div>';\n\t\t}\n\t}",
"public static function register_payment_settings() {\n\n\t\t// Addon page\n\t\t$args = array(\n\t\t\t'slug' => self::get_settings_page( false ),\n\t\t\t'title' => __( 'Sprout Invoices Payment Settings', 'sprout-invoices' ),\n\t\t\t'menu_title' => __( 'Payment Settings', 'sprout-invoices' ),\n\t\t\t'weight' => 15,\n\t\t\t'reset' => false,\n\t\t\t'section' => 'settings',\n\t\t\t'tab_only' => true,\n\t\t\t'ajax' => true,\n\t\t\t'ajax_full_page' => true,\n\t\t\t);\n\t\tdo_action( 'sprout_settings_page', $args );\n\n\t\t// Settings\n\t\t$settings = array(\n\t\t\t'si_general_settings' => array(\n\t\t\t\t'title' => '',\n\t\t\t\t'weight' => 0,\n\t\t\t\t'tab' => self::get_settings_page( false ),\n\t\t\t\t'callback' => array( __CLASS__, 'settings_description' ),\n\t\t\t\t'settings' => array(\n\t\t\t\t\tself::ENABLED_PROCESSORS_OPTION => array(\n\t\t\t\t\t\t'label' => __( 'Payment Processors', 'sprout-invoices' ),\n\t\t\t\t\t\t'option' => array( __CLASS__, 'display_payment_methods_field' ),\n\t\t\t\t\t\t),\n\t\t\t\t\tself::MONEY_FORMAT_OPTION => array(\n\t\t\t\t\t\t'label' => __( 'Money Format', 'sprout-invoices' ),\n\t\t\t\t\t\t'option' => array(\n\t\t\t\t\t\t\t'type' => 'bypass',\n\t\t\t\t\t\t\t'output' => get_option( self::MONEY_FORMAT_OPTION ),\n\t\t\t\t\t\t\t'description' => sprintf( __( 'Money formatting is based on the local (%s) this WordPress install was configured with during installation. Please review the Sprout Invoices knowledgebase if this needs to be changed.', 'sprout-invoices' ), '<code>'.get_locale().'</code>' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\tdo_action( 'sprout_settings', $settings, self::SETTINGS_PAGE );\n\t}",
"public function save() {\n $payout = wp_insert_post( array(\n 'ID' => $this->get_id(),\n 'post_type' => 'edd_payout',\n 'post_status' => 'publish',\n 'post_title' => $this->get_id(),\n 'meta_input' => array(\n 'txn_id' => $this->get_txn_id(),\n 'notes' => $this->get_notes(),\n 'errors' => $this->get_errors(),\n 'status' => $this->get_status(),\n 'details' => $this->get_details(),\n 'amount' => $this->get_amount(),\n 'fees' => $this->get_fees(),\n 'recipients' => $this->get_recipients(),\n )\n ) );\n\n EDD_Commissions_Payouts()->helper->log( \n __( 'Payout initiated', 'edd-commissions-payouts' ), \n 'Payout', \n array( 'payout_post_id' => $payout, 'response' => $this->get_details() )\n );\n\n return new EDD_Commissions_Payout( $payout );\n }",
"public static function postSettings()\r\n {\r\n $config = (array)config('setting', []);\r\n\r\n if (empty($config)) {\r\n return;\r\n }\r\n\r\n $settings = array_dot($config);\r\n\r\n static::updateSettings($settings, false, true);\r\n }",
"public function postSettings() {\n Ekaruz::updateDetail(request()->all());\n\n session()->flash('message','Settings updated successfully');\n return redirect('/settings');\n }",
"public function save_user_setting_post() {\n\n $user_id = $this -> post('user_id') ? $this -> post('user_id') : \"\";\n $update_data = array();\n if (null !== ($this -> post('wishlist_notification'))) {\n $update_data['WishlistNotification'] = $this -> post('wishlist_notification');\n }\n\n if (null !== ($this -> post('favorite_notification'))) {\n $update_data['FavoriteNotification'] = $this -> post('favorite_notification');\n }\n\n if (null !== ($this -> post('other_notification'))) {\n $update_data['OtherRetailer'] = $this -> post('other_notification');\n }\n\n\n $result = $this -> usermodel -> save_notification_setting($user_id, $update_data);\n\n if ($result) {\n $retArr['status'] = SUCCESS;\n $retArr['message'] = \"Settings saved successfully\";\n $this -> response($retArr, 200); // 200 being the HTTP response code\n die;\n }\n else {\n\n $retArr['status'] = FAIL;\n $retArr['message'] = \"Error in saving your settings\";\n $this -> response($retArr, 200); // 200 being the HTTP response code\n }\n }",
"function my_em_paypal_api_keys_save() {\n update_option('em_paypal_api', array (\n 'username' => 'cleblanc-facilitator_api1.care4nurses.org',\n 'password' => '4B6CJF8ZMCJZZU79',\n 'signature' => 'ANAhfQvjC-U8ClXWFXJwsmR-MeJKAt4KxHelJ2thsRwByfTtfv71ROML',\n ));\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a new virtual empty archive, the name will be the default name when the archive is flushed. | function CreateNew($ArchName='new.zip') {
if (!isset($this->Meth8Ok)) $this->__construct(); // for PHP 4 compatibility
$this->Close(); // note that $this->ArchHnd is set to false here
$this->Error = false;
$this->ArchFile = $ArchName;
$this->ArchIsNew = true;
$bin = 'PK'.chr(05).chr(06).str_repeat(chr(0), 18);
$this->CdEndPos = strlen($bin) - 4;
$this->CdInfo = array('disk_num_curr'=>0, 'disk_num_cd'=>0, 'file_nbr_curr'=>0, 'file_nbr_tot'=>0, 'l_cd'=>0, 'p_cd'=>0, 'l_comm'=>0, 'v_comm'=>'', 'bin'=>$bin);
$this->CdPos = $this->CdInfo['p_cd'];
} | [
"function createArchive() {\n\t\t$this->editArchive();\n\t}",
"function CreateNew($ArchName='new.zip') {\n\t\tif (!isset($this->Meth8Ok)) $this->__construct(); // for PHP 4 compatibility\n\t\t$this->Close(); // note that $this->ArchHnd is set to false here\n\t\t$this->Error = false;\n\t\t$this->ArchFile = $ArchName;\n\t\t$this->ArchIsNew = true;\n\t\t$bin = 'PK'.chr(05).chr(06).str_repeat(chr(0), 18);\n\t\t$this->CdEndPos = strlen($bin) - 4;\n\t\t$this->CdInfo = array('disk_num_curr'=>0, 'disk_num_cd'=>0, 'file_nbr_curr'=>0, 'file_nbr_tot'=>0, 'l_cd'=>0, 'p_cd'=>0, 'l_comm'=>0, 'v_comm'=>'', 'bin'=>$bin);\n\t\t$this->CdPos = $this->CdInfo['p_cd'];\n\t}",
"function CreateNew($ArchName = 'new.zip')\n\t{\n\t\tif (!isset($this->Meth8Ok)) $this->__construct(); // for PHP 4 compatibility\n\t\t$this->Close(); // note that $this->ArchHnd is set to false here\n\t\t$this->Error = false;\n\t\t$this->ArchFile = $ArchName;\n\t\t$this->ArchIsNew = true;\n\t\t$bin = 'PK' . chr(05) . chr(06) . str_repeat(chr(0), 18);\n\t\t$this->CdEndPos = strlen($bin) - 4;\n\t\t$this->CdInfo = array('disk_num_curr' => 0, 'disk_num_cd' => 0, 'file_nbr_curr' => 0, 'file_nbr_tot' => 0, 'l_cd' => 0, 'p_cd' => 0, 'l_comm' => 0, 'v_comm' => '', 'bin' => $bin);\n\t\t$this->CdPos = $this->CdInfo['p_cd'];\n\t}",
"public function create()\n {\n $this->exclude_files_by_pattern();\n $this->_obj->create_archive();\n }",
"public function createVersion() {\n\t\tif(!file_exists($this->owner->getFullPath())) return;\n\n\t\t$version = new FileVersion();\n\t\t$version->FileID = $this->owner->ID;\n\t\t$version->write();\n\n\t\t$this->owner->CurrentVersionID = $version->ID;\n\t\t$this->owner->write();\n\t}",
"public static function archive() {\r\n return new FileAttributes(\"ARCHIVE\", 32);\r\n }",
"public function testCreateArchiveOfDefaultTypeByTag()\n {\n $archive = self::$uploadApi->createArchive(\n [\n 'tags' => self::$ARCHIVE_TEST_TAGS,\n 'target_tags' => self::$UNIQUE_TEST_TAG,\n ]\n );\n\n self::assertValidArchive(\n $archive,\n 'zip',\n [\n 'resource_count' => 2,\n 'file_count' => 2,\n ]\n );\n self::assertContains(self::$UNIQUE_TEST_TAG, $archive['tags']);\n }",
"private function createZipBackup() {\n\t\t$zip = new \\ZipArchive ();\n\t\t$file_name = $this->file_name . '.zip';\n\t\tif ($zip->open ( $file_name, \\ZipArchive::CREATE ) === TRUE) {\n\t\t\t$zip->addFile ( $this->file_name, basename ( $this->file_name ) );\n\t\t\t$zip->close ();\n\t\t\t\n\t\t\t@unlink ( $this->file_name );\n\t\t}\n\t}",
"protected function createFileArchiver() {\n\t\tYii::import('qs.files.archivers.*');\n\t\t$config = array(\n\t\t\t'class' => 'QsFileArchiverTar',\n\t\t);\n\t\t$component = Yii::createComponent($config);\n\t\t$component->init();\n\t\treturn $component;\n\t}",
"public function createZipArchive(): void {\n try {\n $version = $this->getPtVersion();\n $this->prepareStagingFolder($version);\n $filesystem = new Filesystem();\n if (!$filesystem->exists($this->outdir)) {\n $filesystem->mkdir($this->outdir, 0755);\n }\n\n $wversionzip = \"{$this->ptname}.{$version}.zip\";\n $woversionzip = \"{$this->ptname}.zip\";\n\n $wversionfname = self::$with_version_appended_fname;\n $woversionfname = self::$without_version_appended_fname;\n\n file_put_contents(\"{$this->outdir}{$wversionfname}\", $wversionzip);\n file_put_contents(\"{$this->outdir}{$woversionfname}\", $woversionzip);\n\n $this->zipDir(\"./{$this->ptname}\", \"{$this->outdir}{$wversionzip}\");\n $this->zipDir(\"./{$this->ptname}\", \"{$this->outdir}{$woversionzip}\");\n\n $this->deleteStagingFolder();\n } catch (Exception $exception) {\n echo $exception->getMessage();\n }\n }",
"function xml_create_archive()\n\t{\n\t\t$this->xml->xml_set_root( 'xmlarchive', array( 'generator' => 'IPB', 'created' => time() ) );\n\t\t$this->xml->xml_add_group( 'fileset' );\n\t\t\n\t\t$entry = array();\n\t\t\n\t\tforeach( $this->file_array as $f )\n\t\t{\n\t\t\t$content = array();\n\t\t\t\n\t\t\tforeach ( $f as $k => $v )\n\t\t\t{\n\t\t\t\tif ( $k == 'content' )\n\t\t\t\t{\n\t\t\t\t\t$v = chunk_split(base64_encode($v));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$content[] = $this->xml->xml_build_simple_tag( $k, $v );\n\t\t\t}\n\t\t\t\n\t\t\t$entry[] = $this->xml->xml_build_entry( 'file', $content );\n\t\t}\n\t\t\n\t\t$this->xml->xml_add_entry_to_group( 'fileset', $entry );\n\t\t\n\t\t$this->xml->xml_format_document();\n\t}",
"public function createSwapFile()\n {\n if (!$this->files->exists('/swapfile')) {\n $this->cli->run('fallocate -l 1G /swapfile');\n $this->cli->run('chmod 600 /swapfile');\n $this->cli->run('mkswap /swapfile');\n $this->cli->run('swapon /swapfile');\n $this->cli->run('echo \"/swapfile none swap sw 0 0\" >> /etc/fstab');\n $this->cli->run('echo \"vm.swappiness=30\" >> /etc/sysctl.conf');\n $this->cli->run('echo \"vm.vfs_cache_pressure=50\" >> /etc/sysctl.conf');\n }\n }",
"function createVolume( $zone, $size, $name, $description ) {\n\t\t# Unimplemented\n\t\treturn null;\n\t}",
"public function createDefault()\n {\n $this->setDefaultContent();\n $fileController = $this->generator->formatControllersPath()\n . PhpInterface::SLASH\n . $this->generator->defaultController\n . DefaultInterface::CONTROLLER_POSTFIX\n . PhpInterface::PHP_EXT;\n $isCreated = FileManager::createFile($fileController, $this->sourceCode);\n if($isCreated)\n {\n Console::out($fileController . PhpInterface::SPACE . Console::CREATED, Console::COLOR_GREEN);\n }\n }",
"protected function createTestArchiver() {\n\t\t$fileArchiverConfig = array(\n\t\t\t'class' => 'QsFileArchiverRar'\n\t\t);\n\t\treturn Yii::createComponent($fileArchiverConfig);\n\t}",
"public function crear(){\n\t\t$this->archivo = fopen($this->nombre , \"w+\");\n\t}",
"public function create()\n {\n return view('archives.create');\n }",
"public function __construct()\n {\n parent::__construct( \"The archive is empty.\" );\n }",
"public function __construct($name) {\n\t\t$zvol_exists = true;\n\t\t$this->name = $name;\n\t\t$cmd = \"zfs list -p -H -t volume \\\"\" . $name . \"\\\" 2>&1\";\n\t\ttry {\n\t\t\tOMVModuleZFSUtil::exec($cmd, $out, $res);\n\t\t}\n\t\tcatch (\\OMV\\ExecException $e) {\n\t\t\t$zvol_exists = false;\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the time format Sets the time / date format for asn1map(). | function setTimeFormat($format)
{
$this->format = $format;
} | [
"public function set_time_format($in) {\n\t\t$this->time_format = $in;\n\t}",
"function setTimeFormat($fmt)\n {\n $this->__time_format = $fmt ;\n }",
"public function setTimeFormatISO8601(): void {\n $this->timeFieldFormat = 'Y-m-d\\TH:i:s.uP';\n }",
"function pkTimeFormat($time = 0, $type = '%d.%m.%Y - %H:%M')\n{\n\treturn formattime($time, 0, $type);\n}",
"public function setFormat(string $format): void\n {\n parent::setFormat($format);\n\n // set the correct time format\n if (strpos($this->logFormat, '%{u}t') !== false){\n $this->timeFormat = 'D M d H:i:s.u Y';\n }\n }",
"static function SetTimestamp($format){}",
"public function timeFormat($timeFormat = 'H:i')\n {\n \t$this->data(['altFormat' => $timeFormat]);\n \treturn $this;\n }",
"public function setTime($time, $format = null, $locale = null);",
"public function formatTime() {\n\t $timeFormat = \\GO::user() ? \\GO::user()->time_format : \\GO::config()->default_time_format;\n\t return parent::format($timeFormat);\n\t}",
"public function testsetTimeFormat(): void\n {\n $this->assertFalse(PEAR::isError($this->l->setTimeFormat(I18Nv2_DATETIME_FULL)));\n }",
"public function setTime($time) {\n $this->_creationDate = strval(date('Y-m-d\\TH:i:s\\Z', $time));\n }",
"function setTimeFromString($time)\n\t{\n\t\tpreg_match(\"/(\\-)?([0-9]*):([0-5]{1}[0-9]{1})(:([0-5]{1}[0-9]{1}(.[0-9]*)?))?(\\s+(am|pm))?$/\", $time, $time_split);\n\n\t\tif (isset($time_split[1]) && $time_split[1] == '-') {\n\t\t\t//$this->setSign(-1);\n\t\t} else {\n\t\t\t//$this->setSign(1);\n\t\t}\n\n\t\tif (isset($time_split[2])) {\n\t\t\tif (isset($time_split[8]) == 'pm') {\n\t\t\t\t$this->setHours($time_split[2] + 12);\n\t\t\t} else {\n\t\t\t\t$this->setHours($time_split[2]);\n\t\t\t}\n\t\t}\n\n\t\tif (isset($time_split[3])) {\n\t\t\t$this->setMinutes($time_split[3]);\n\t\t}\n\n\t\tif (isset($time_split[5])) {\n\t\t\t$this->setSeconds($time_split[5]);\n\t\t}\n\t\treturn $this;\n\t}",
"public function testMarshalWithLocaleParsingWithFormat(): void\n {\n $this->type->useLocaleParser()->setLocaleFormat('hh:mm a');\n\n $expected = new Time('13:54:00');\n $result = $this->type->marshal('01:54 pm');\n $this->assertEquals($expected, $result);\n }",
"protected function convertTimesToRFC2822() {\n foreach ($this->_props as $prop => $settings) {\n if ($settings['type'] == 'date') {\n $this->_props[$prop]['value'] = Time::toRFC2822($settings['value']);\n }\n }\n }",
"public function setTime($time){\n\t\tif(is_string($time)){\n\t\t\tlist($h,$m) = explode(\",\", $time);\n\t\t}elseif(is_array($time)){\n\t\t\t$h = $time[0];\n\t\t\t$m = $time[1];\n\t\t}\n\t\tif(isset($h)){\n\t\t\t$this->setHours($h)->setMinutes($m);\n\t\t\t\n\t\t\tif(!$this->is24hTimeFormat()){\n\t\t\t\tif((int)$h > 11){\n\t\t\t\t\t$this->setDayPart('pm');\n\t\t\t\t}else{\n\t\t\t\t\t$this->setDayPart('am');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this;\n\t}",
"public static function defaultTimeFormat(string $format)\n {\n static::$defaultTimeFormat = $format;\n }",
"private function correct_time_string()\n\t\t{\n\t\t\t$m_message_time = $this->c_arr_download_message_data['message-time'];\n\t\t\t$m_message_time = str_replace('am', '', $m_message_time);\n\t\t\t$m_message_time = str_replace('pm', '', $m_message_time);\n\t\t\t$this->c_arr_download_message_data['message-time'] = $m_message_time;\n\t\t}",
"public function timeFormat()\n\t{\n\t\treturn $this->format_time;\n\t}",
"function FormatTime($time, $format = \"%H:%M:%S\") {\n\t\tif(is_numeric($time)) {\n\t\t\treturn strftime($time, $format);\n\t\t}\n\t\t$v = $time;\n\t\t$t = strtotime($v);\n\t\tif($t > -1) {\n\t\t\t$v = strftime($format, $t);\n\t\t}\n\t\treturn $v;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Metodo para eliminar un preDetalle | function deletePreDetalle(){
$sql='DELETE FROM prepedidos WHERE IdCliente = ?';
$params=array($this->cliente);
return Database::executeRow($sql, $params);
} | [
"function deletePreDetalle2()\n {\n $sql='DELETE FROM predetalle WHERE idPreDetalle = ?';\n $params=array($this->idPre);\n return Database::executeRow($sql, $params);\n }",
"function deletePreDetalle(){\n $sql='DELETE FROM predetalle WHERE idCliente = ?';\n $params=array($this->cliente);\n return Database::executeRow($sql, $params);\n }",
"public function eliminarPreguntas(Pregunta $pre)\n {\n }",
"function opcion__eliminar()\n\t{\n\t\t$id_proyecto = $this->get_id_proyecto_actual();\n\t\tif ( $id_proyecto == 'toba' ) {\n\t\t\tthrow new toba_error(\"No es posible eliminar el proyecto 'toba'\");\n\t\t}\n\t\ttry {\n\t\t\t$p = $this->get_proyecto();\n\t\t\tif ( $this->consola->dialogo_simple(\"Desea ELIMINAR los metadatos y DESVINCULAR el proyecto '\"\n\t\t\t\t\t.$id_proyecto.\"' de la instancia '\"\n\t\t\t\t\t.$this->get_id_instancia_actual().\"'\") ) {\n\t\t\t\t$p->eliminar_autonomo();\n\t\t\t}\n\t\t} catch (toba_error $e) {\n\t\t\t$this->consola->error($e->__toString());\n\t\t}\n\t\t$this->get_instancia()->desvincular_proyecto( $id_proyecto );\n\t}",
"public function eliminaProfilo(){\n\t\t$view = USingleton::getInstance('VAmministratore');\n\t\t$session=USingleton::getInstance('USession');\n\t\t$username=$view->getUtente();\n\t\t\t\t\n\t\t//elimina tutte le preenotazioni fatte dall'utente aggiornando i posti\n\t\t//liberi nelle partite a cui era prenotato\n\t\t$FPrenotazione=new FPrenotazione();\n\t\t$prenotazioni=$FPrenotazione->loadfromuser($username);\n\t\t$FPartita = new FPartita();\n\t\tfor ($i=0; $i<count($prenotazioni) && $prenotazioni!=''; $i++) {\n\t\t\t$PartitaID=$prenotazioni[$i]->getPartitaID();\n\t\t\t$FPrenotazione->delete($prenotazioni[$i]);\n\t\t\t$partita=$FPartita->load($PartitaID);\n\t\t\t$ndisponibili=$partita->getNdisponibili();\n\t\t\t$partita->setNdisponibili($ndisponibili+1);\n\t\t\t$FPartita->update($partita);\n\t\t}\n\t\t\n\t\t//elimina tutte le partite create dell'utente con tutte le relative prenotazioni associate\n\t\t$partite=$FPartita->loadfromcreatore($username);\n\t\tfor($i=0; $i<count($partite) && $partite!=''; $i++){\n\t\t\t$array_partite[$i]=$partite[$i]->getAllArray();\n\t\t\t$session->imposta_valore('idpartita', $array_partite[$i]['IDpartita']);\n\t\t\t$this->eliminaPartita();\n\t\t}\n\t\t\n\t\t//elimina tutti gli annunci pubblicati\n\t\t$FAnnuncio=new FAnnuncio();\n\t\t$annunci=$FAnnuncio->loadfromuser($username);\n\t\tif($annunci!='')\n\t\t\t$FAnnuncio->deleterel($annunci);\n\t\t\n\t\t//elimina il profilo dell'utente\n\t\t$FUtente = new FUtente();\n\t\t$utente= $FUtente->load($username);\n\t\t$FUtente->delete($utente);\n\t\t\n\t\t$view->setLayout('amministratore_conferma_profilo_el');\n\t\treturn $view->processaTemplate();\n\t}",
"public function preRemove() {\n\t\t// action uniquement si on est sur la commande J0 //\n\t\tif ($this->getType()=='info') {\n\t\t\tif ($this->getConfiguration(\"originalCmdId\")=='') {\n\t\t\t\t// suppression des jours \"complémentaires\" //\n\t\t\t\t$_EqlGC = $this->getEqLogic();\n\t\t\t\tfor ($_i=1;$_i<=6;$_i++) {\n\t\t\t\t\t$_eqLogId = 'iCal-'.$this->getId().'-J'.$_i;\n\t\t\t\t\t$_oCmd = $_EqlGC->getCmd('info',$_eqLogId);\n\t\t\t\t\tif (is_object($_oCmd)) {\n\t\t\t\t\t\t$this->_log->add($this->logFN(), 'debug', '['.$this->_whatLog.'|'.$this->getEqLogic()->getId().'|'.$this->getId().'] preRemove(): delete cmd:\"'.$_oCmd->getName().'\" - eqLogicId='.$_eqLogId);\n\t\t\t\t\t\t$_oCmd->remove();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// suppression des commandes actions //\n\t\t\t\t$_eqLogId = 'iCal-'.$this->getId().'-ExecFunction';\n\t\t\t\t$_oCmd = $_EqlGC->getCmd('action',$_eqLogId);\n\t\t\t\tif (is_object($_oCmd)) {\n\t\t\t\t\t$this->_log->add($this->logFN(), 'debug', '['.$this->_whatLog.'|'.$this->getEqLogic()->getId().'|'.$this->getId().'] preRemove(): delete cmd:\"'.$_oCmd->getName().'\" - eqLogicId='.$_eqLogId);\n\t\t\t\t\t$_oCmd->remove();\n\t\t\t\t}\n\t\t\t}\n\t\t\t// suppression du cache // \n\t\t\tcache::byKey('iCalendar::'.$this->getId().'::PeriodeEvents')->remove();\n\t\t\tcache::byKey('iCalendar::'.$this->getId().'::EventsActionsList')->remove();\n\t\t\t// suppression des fichiers //\n\t\t\t$_aSD = array_diff(scandir(ICALENDAR_CACHE_PATH), array('.','..'));\n\t\t\t$_iCalCmdID = $this->getId();\n\t\t\tforeach ($_aSD as $_f) {\n\t\t\t\t$_af = explode('-', $_f);\n\t\t\t\tif ($_af[0] == 'iCal'.$_iCalCmdID) {\n\t\t\t\t\tiCalendarTools::cleanCacheFile($_f);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function eliminar_paquete_unico() {\n $idPaquete = $_REQUEST[\"idpaquete\"];\n $observacion_eliminar = $_REQUEST[\"observacionEliminar\"];\n $resultado_paquete = $this->paquete_model->id_paquete($idPaquete);\n $resultado_paquete->observaciones=$observacion_eliminar;\n $this->paquete_model->crear_paquete_eliminado($resultado_paquete);\n $id_pxp = $resultado_paquete->id_pxp;\n $id_sede = $resultado_paquete->id_sede;\n $this->paquete_model->eliminar_paquete($id_pxp,$id_sede);\n $this->paquete_model->eliminar_sesiones_x_paquete($id_pxp,$id_sede);\n echo \"OK\";\n }",
"final protected function eliminar(){\n\t\tif($this->sublinea != null){\n\t\t\tthrow new Exception('Sublinea sin datos');\n\t\t}\n\t\tDataAccess::delete($this->sublinea);\t\n\t}",
"public function deleteIrRemout(){\n }",
"protected function before_remove() {\n\n\t}",
"function supprimerParagraphe() {\r\n\t\tmysql_query(\"DELETE FROM if_paragraphe WHERE numpara='$this->numpara'\");\r\n\t\tmysql_query(\"DELETE FROM if_liens WHERE numpara='$this->numpara'\");\r\n\t\tmysql_query(\"DELETE FROM if_para_photo WHERE numpara='$this->numpara'\");\r\n\t}",
"function eliminaProyecto(){\n \t$this->buffer=0;\n \tif(count($this->data) > 0){\n \t\t$this->buffer = $this->eliminaProyectoCompleto($this->data,$this->session);\n \t}\n }",
"public function eliminar()\n\t{\n\t\t$descripcion=array(); //array para almacenar la informacion de la entidad\n\t\t//Concateno el where para eliminar los registros de la entidad\n\t\t$sql=\"DELETE FROM noticia WHERE not_id = \".$this -> getNotId();\n\n\t\tif(isset($this -> auditoria_tabla) and $this -> auditoria_tabla)\n\t\t{\n\t\t\t//Consulto la informacion que se registro luego de la actualizacion\n\t\t\t$noticia = $this -> consultarId($this -> getNotId());\n\t\t\t\t\t$descripcion[]=\"not_id = \".$noticia -> getNotId();\n\t\t\t\t\t$descripcion[]=\"not_fecha = \".$noticia -> getNotFecha();\n\t\t\t\t\t$descripcion[]=\"not_titulo = \".$noticia -> getNotTitulo();\n\t\t\t\t\t$descripcion[]=\"not_lead = \".$noticia -> getNotLead();\n\t\t\t\t\t$descripcion[]=\"not_texto = \".$noticia -> getNotTexto();\n\t\t\t\t\t$descripcion[]=\"not_activo = \".$noticia -> getNotActivo();\n\t\t\t\t\t$descripcion[]=\"not_nts_id = \".$noticia -> getNotNtsId();\n\t\t\t\t\t$descripcion[]=\"not_usu_id = \".$noticia -> getNotUsuId();\n\t\t\t$descripcion_antigua = implode(\", \", $descripcion);\n\t\t}\n\t\t\n\t\t//Si la ejecucion es exitosa entonces devuelvo el numero de registros borrados\n\t\tif($this -> getConexion() -> Execute($sql))\n\t\t{\n\t\t\t$registros_eliminados=$this -> getConexion() -> Affected_Rows();\n\t\t\t\n\t\t\t//Si se pudo eliminar el registro entonces registro la auditoria sobre la tabla\n\t\t\tif(isset($this -> auditoria_tabla) and $this -> auditoria_tabla and $registros_eliminados)\n\t\t\t{\n\t\t\t\t/**\n\t\t\t\t * instanciacion de la clase auditoria_tabla para la eliminacion de un registro\n\t\t\t\t */\n\t\t\t\t$objAuditoriaTabla = new AuditoriaTabla();\n\t\t\t\t$objAuditoriaTabla->crearBD(\"sisgot_adodb\");\n\t\t\t\t$objAuditoriaTabla->setAutTabla(\"noticia\");\n\t\t\t\t$objAuditoriaTabla->setAutTablaId($this -> getNotId());\n\t\t\t\t$objAuditoriaTabla->setAutUsuId($objAuditoriaTabla -> obtenerUsuarioActual());\n\t\t\t\t$objAuditoriaTabla->setAutFecha(\"NOW()\", \"sql\");\n\t\t\t\t$objAuditoriaTabla->setAutDescripcionAntigua($descripcion_antigua);\n\t\t\t\t$objAuditoriaTabla->setAutDescripcionNueva(\"\");\n\t\t\t\t$objAuditoriaTabla->setAutTransaccion(\"ELIMINAR\");\n\t\t\t\t$aut_id=$objAuditoriaTabla->insertar();\n\t\t\t\t\n\t\t\t\tif(!$aut_id)\n\t\t\t\t{\n\t\t\t\t\techo \"<b>Error al almacenar informacion en la tabla de auditoria_tabla</b><br/>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $registros_eliminados;\n\t\t}\n\t\t//Sino imprimo el mensaje de error\n\t\telse\n\t\t\techo $this -> getConexion() -> ErrorMsg().\" <strong>SQL: \".$sql.\"<br/>En la linea \".__LINE__.\"<br/></strong>\";\n\n\t\treturn 0;\n\t}",
"public function EliminarParalelo($cod){\n $resultado = $this->bd->query(\"DELETE FROM snp_para WHERE PAR_CODIGO = $cod\");\n return $resultado;\n }",
"public function eliminar() {\n //$this->delete();\n $campo_fecha_eliminacion = self::DELETED_AT;\n $this->$campo_fecha_eliminacion = date('Y-m-d H:i:s');\n $this->status = 0;\n $this->save();\n }",
"function preUndelete()\n {\n return \"\";\n }",
"function elimina_aux() {\t\r\n\t\t$query = \"DROP TABLE IF EXISTS aux\"; \r\n\t\t$this->pregunta_query($query); \r\n\t}",
"public function deleteRecargas()\n {\n $recargas = $this->getRecargas();\n if (count($recargas)) {\n // Si tengo vieja las vuelo e inserto las nuevas\n $recargas[0]->delete([$this->primkeys[0] => $this->getIdPED()]);\n }\n }",
"function supprimerEpreuveBDD($epreuve)\n{\n\t$bdd = new BDD();\n\t$req = $epreuve->delete($bdd->getBDD());\n\tinserer_transaction($req, $epreuve->get_attr());\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks if the object has the given attribute | private function has_attribute($attribute){
//this fetchs all the variables(attributes)of the object [private or public]
$object_vars= $this->attributes();
//checks if the attribute is part of the object_vars
return array_key_exists($attribute, $object_vars);
} | [
"private function has_attribute($attribute){\n $object_vars=$this->attributes();\n return array_key_exists($attribute,$object_vars);\n }",
"public function hasAttr($attr) {\n return $this->$attr;\n }",
"public function attributeExists($attribute);",
"public function isProperty($attribute);",
"public function hasAttributes();",
"public function hasAttributes () {}",
"public function __isset( $attribute ){\n return isset( $this->_attributes[ $attribute ] );\n }",
"protected function hasAttribute($model, $attribute){\n return array_key_exists($attribute, $model->getAttributes());\n }",
"abstract public function has_attributes(): bool;",
"public function hasAttribute($identifier)\n {\n if (!$this->exists()) {\n $idText = $this->identifierText();\n throw new ObjectDoesNotExist(\"$idText does not exist, cannot check if attribute exists\");\n }\n // If attribute is meant to be removed, return false\n if (isset($this->attributesRemove[$identifier])) {\n return false;\n }\n if (isset($this->attributesNew[$identifier]) || isset($this->attributesChange[$identifier]) || isset($this->_attributes[$identifier])) {\n return true;\n }\n $this->loadAttributeMap();\n return isset($this->_attributes[$identifier]);\n }",
"public function attributeProperty(string $attribute): bool;",
"function isAttr($attrName, $object)\n{\n Assert::assertNotNull($object, 'object ' . get_class($object) . ' is not empty');\n Assert::assertObjectHasAttribute($attrName, $object);\n}",
"function supportsAttribute($attribute);",
"public function hasParameter(string $attribute): bool;",
"public function supportsAttribute($attribute);",
"public function has_attr( $attr )\n\t{\n\t\treturn isset( $this->_attrs[$attr] );\n\t}",
"public function attributeExists(string $attrName): bool;",
"public function handleAsAttribute(string $key): bool\n {\n if (property_exists($this, $key)) {\n return true;\n }\n\n if (parent::getAttribute($key) !== null) {\n return true;\n }\n\n if (array_key_exists($key, $this->getTableFields())) {\n return true;\n }\n\n if (method_exists($this, $key)) {\n return true;\n }\n\n return false;\n }",
"function objectHasAttribute($attributeName)\n{\n return call_user_func_array(\n 'PHPUnit_Framework_Assert::objectHasAttribute',\n func_get_args()\n );\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get the topic_ids of all childs of the passed topic including itself | static function getChildTopicIds($topic_id)
{
$constraints = ForumPPEntry::getConstraints($topic_id);
$stmt = DBManager::get()->prepare("SELECT topic_id
FROM forumpp_entries WHERE lft >= ? AND rgt <= ?");
$stmt->execute(array($constraints['lft'], $constraints['rgt']));
return $stmt->fetchAll(PDO::FETCH_COLUMN);
} | [
"public function getTopicIds() {\n\t\t$ids = array();\n\t\t$topics = $this->getTopics();\n\t\tforeach ($topics as $topic) {\n\t\t\t$ids[] = $topic->getId();\n\t\t}\n\t\treturn $ids;\n\t}",
"public function get_children_topics($id_parent = NULL)\n { \n //@todo VERSION WITH ORM\n \n //VERSION WITHOUT ORM\n $sql_arguments = array($id_parent);\n $sql = '';\n //get the parent topic from his slug\n \n $query_parent = 'SELECT parent.id, parent.idParent, parent.slug, '\n . ' parent.wording_i18n, parent.text_i18n, parent.photopath, '\n . ' parent.photofilename, parent.showing_order '\n . ' FROM '\n . ' topics AS parent ';\n \n if(is_null($id_parent)){\n $query_parent .= ' WHERE parent.id IS NULL';\n } else {\n $query_parent .= ' WHERE parent.id = ?';\n }\n \n //$sql .= ' UNION ';\n \n //get children topics\n $sql .= ' SELECT child.id, child.idParent, child.slug, '\n . ' child.wording_i18n, child.text_i18n, child.photopath, '\n . ' child.photofilename, child.showing_order '\n . ' FROM '\n . ' topics AS child '; \n \n if(is_null($id_parent)){\n $sql .= ' WHERE child.idParent IS NULL';\n } else {\n $sql .= ' WHERE child.idParent = ?';\n }\n //@todo : order by\n \n //parent topic will be placed first in the array\n //children topics are ordered in showing order : ready for the view!\n \n $query = $this->db->query($sql, $sql_arguments);\n $topics = $query->result_array();\n \n if (count($topics) < 1) {\n $query = $this->db->query($query_parent, $sql_arguments);\n $topics = $query->result_array();\n }\n \n return $topics;\n //@todo : sanitize this query (using ORM : do NOT use MySql ticks)\n }",
"function tep_get_parent_topics(&$topics, $topics_id) {\n $parent_topics_query = tep_db_query(\"select parent_id from \" . TABLE_TOPICS . \" where topics_id = '\" . (int)$topics_id . \"'\");\n while ($parent_topics = tep_db_fetch_array($parent_topics_query)) {\n if ($parent_topics['parent_id'] == 0) return true;\n $topics[sizeof($topics)] = $parent_topics['parent_id'];\n if ($parent_topics['parent_id'] != $topics_id) {\n tep_get_parent_topics($topics, $parent_topics['parent_id']);\n }\n }\n }",
"public function getTopicIds() {\n \t$val = $this->cacheGetObj('topic_ids');\n \tif (is_null($val)) {\n \t\t$val = array();\n \t\t$ids = $this->getOffering()->getTopicIds();\n \t\twhile ($ids->hasNext()) {\n \t\t\t$val[] = $ids->getNextId();\n \t\t}\n \t\t$this->cacheSetObj('topic_ids', $val);\n \t}\n \treturn new phpkit_id_ArrayIdList($val);\n\t}",
"public static function get_topic_ids_array() {\n try {\n $db = ADODB::connect();\n $query = \"SELECT topic_id, title FROM tbl_topic WHERE deleted=0\";\n $rs = $db->Execute($query);\n $topic_ids = array();\n while (!$rs->EOF) {\n #$topic_ids[] = $rs->fields['topic_id'];\n $topic_ids[$rs->fields['topic_id']] = $rs->fields['title'];\n $rs->MoveNext();\n }\n return $topic_ids;\n } catch (exception $e) {\n Info::exception_handler($e, __file__, get_class($this), __FUNCTION__, __LINE__);\n }\n }",
"public function parent_topics() {\n return $this->belongsToMany('App\\Topic', 'topic_subtopic', 'subtopic_id', 'parent_topic_id')->withTimestamps();\n }",
"public function getParentIdsByChild($id);",
"public function getTopicIds() {\n \tif (!isset($this->allTopicIds)) {\n \t\t$this->allTopicIds = array_merge($this->topicIds, $this->session->getRequirementTopicIdsForCourse($this->getId()), $this->session->getLevelTopicIdsForCourse($this->getId()));\n \t}\n \treturn new phpkit_id_ArrayIdList($this->allTopicIds);\n }",
"function bbp_forum_query_topic_ids($forum_id)\n{\n}",
"private function getChildren($id)\n {\n $controller = new TopicDbMapper();\n $topic = $controller->getById($id);\n if ($topic) {\n $result = $topic->toArray();\n $topic_children = $controller->getSubtopicsByTopicId($id);\n\n $children = array();\n if ($topic_children) {\n foreach ($topic_children as $child) {\n\n if (count($topic_children) > 0) {\n array_push($children, $this->getChildren($child->getId()));\n } else {\n array_push($children, $child->toArray());\n }\n }\n }\n $result['children'] = $children;\n\n $result['documents'] = array_merge($result['documents'], $this->getDocuments($id));\n return $result;\n }\n }",
"public function getChildrenIds()\n {\n $this->children = array();\n $this->getChildren($this->resource);\n\n /* prepare children ids for invokeEvents */\n $childrenIds = array();\n /** @var modResource $child */\n foreach ($this->children as $child) {\n $childrenIds[] = $child->get('id');\n }\n return $childrenIds;\n }",
"public function createChildTree($topic){\n\t\t$children ='';\n\t\tif(!empty($topic['children'])){\n\t\t\t$children = '<ul>';\n\t\t\tforeach($topic['children'] as $child){\n\t\t\t\n\t\t\t\t$children .=' <li style=\"padding:0px\"><a href=\"#\"\n\t \t\t\t\t\t\t\t\t\ttopicid = \"'.$child[\"id\"].'\"\n\t \t\t\t\t\t\t\t\t\tsectionid = \"'.$child[\"sectionId\"].'\"\n\t \t\t\t\t\t\t\t\t\tclass = \"topicItem\" >'\n\t\t\t\t\t\t\t\t.Html::encode($child[\"title\"]).'</a>';\n\t\t\t\t\t$children.=self::createChildTree($child);\n\t\t\t\t$children.='</li>';\t\t\t\t\t\t\n\t\t\t}\n\t\t\t$children .= '</ul>';\n\t\t}\n\t\t\n\t\treturn $children;\n\t}",
"function getChildrenIds(){\n\t\treturn array_keys($this->_children);\n\t}",
"public function subtopics() {\n return $this->belongsToMany('App\\Topic', 'topic_subtopic', 'parent_topic_id', 'subtopic_id')->withTimestamps();\n }",
"public function getChildrenIds()\n {\n return array_map(\n function ($value) {\n return $value->getId();\n }, $this->children\n );\n }",
"public function get_child_ids() {\n $childids = array();\n foreach ($this->items as $child) {\n $childids[] = $child->id;\n }\n return $childids;\n }",
"public static function getTopicSubtopics($topicid) {\n return static::where('topicid',$topicid)->where('hide',0)->latest('updated_at')->get(['stopic_id','stopic']);\n }",
"public function parentIds(): array\n {\n $this->queryVars['number'] = $this->queryVars['number'] ?? 0;\n $this->queryVars['fields'] = 'id=>parent';\n $this->queryVars['no_found_rows'] = true;\n\n return $this->runQuery()->get_terms();\n }",
"function bbp_forum_query_subforum_ids($forum_id)\n{\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle the Admin "restored" event. | public function restored(Admin $admin)
{
//
} | [
"function post_restoreItem() {\n }",
"protected function afterRestore() {}",
"protected function beforeRestore() {}",
"public function restored(Employee $employee)\n {\n event(new EmployeeUpdated($employee, \"restore\"));\n }",
"public function restored(Event $event)\n {\n //\n }",
"function admin_restore()\n\t{\n\t\t$this->Site->id = $this->site_id();\n\t\t$stripe_id = $this->Site->field('stripe_id'); # Subscription.\n\t\t$plan = $this->Site->field('plan'); \n\t\tif($plan == 'Trial') { $plan = null; }\n\t\t$created = $this->Site->field('created'); \n\t\t$trial_days = (strtotime(date(\"Y-m-d\")) - strtotime(date(\"Y-m-d\", $created))) / (60*60*24);\n\n\t\tif((empty($plan) && $trial_days > Configure::read(\"trial_days\")) || # Trial expired\n\t\t\t!empty($plan) && (empty($stripe_id) || !$this->Stripe->validCreditCard())) # Or credit card not valid. MUST ASK\n\t\t{\n\t\t\t$this->redirect(\"/admin/stripe/stripe_billing/setup\");\n\t\t} else {\n\t\t\t# Otherwise, just restore subscription!\n\t\t\tif($error = $this->StripeBilling->saveSubscription())\n\t\t\t{\n\t\t\t\t$this->setError($error, \"/admin/sites/view\");\n\t\t\t}\n\t\t}\n\n\t\t$this->Site->saveField(\"disabled\", null);\n\t\t$this->setSuccess(\"Your website has been reinstated.\", \"/admin/sites/view\");\n\t}",
"public function restore(Admin $admin, District $district)\n {\n //\n }",
"protected function trashRestoreAction()\n {\n $this->changeStatusAction\n ->setAccess($this, Access::CAN_RESTORE_TRASH)\n ->execute($this, UserEntity::class, UserActionEvent::class, NULL, __METHOD__, [], [],\n ['deleted_at' => NULL, 'deleted_at_datetime' => NULL])\n ->endAfterExecution();\n }",
"public function doRestore()\r\n {\r\n try {\r\n $this->restoreTables($this->tables);\r\n } catch (Exception $e) {\r\n $this->logResult(\"Failure : \" . $e->getMessage());\r\n }\r\n }",
"public function action_restore_events() {\n\t\t\tif ( ! isset( $_GET['action'] ) || 'tribe-restore' !== $_GET['action'] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$event = get_post( absint( $_GET['post'] ) );\n\n\t\t\tif ( ! $event instanceof WP_Post ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( Tribe__Events__Main::POSTTYPE !== $event->post_type ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( self::$ignored_status !== $event->post_status ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! function_exists( 'wp_get_referer' ) ) {\n\t\t\t\tif ( ! empty( $_SERVER['REQUEST_URI'] ) ) {\n\t\t\t\t\t$sendback = $_SERVER['REQUEST_URI'];\n\t\t\t\t} elseif ( ! empty( $_REQUEST['_wp_http_referer'] ) ) {\n\t\t\t\t\t$sendback = $_REQUEST['_wp_http_referer'];\n\t\t\t\t} elseif ( ! empty( $_SERVER['HTTP_REFERER'] ) ) {\n\t\t\t\t\t$sendback = $_SERVER['HTTP_REFERER'];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$sendback = wp_get_referer();\n\t\t\t}\n\n\t\t\t$sendback = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'locked', 'ids' ), $sendback );\n\n\t\t\tif ( isset( $_REQUEST['ids'] ) ) {\n\t\t\t\t$post_ids = explode( ',', $_REQUEST['ids'] );\n\t\t\t} elseif ( ! empty( $_REQUEST['post'] ) ) {\n\t\t\t\t$post_ids = array_map( 'intval', (array) $_REQUEST['post'] );\n\t\t\t}\n\n\t\t\t$restored = 0;\n\t\t\tforeach ( (array) $post_ids as $post_id ) {\n\t\t\t\tif ( ! current_user_can( 'delete_post', $post_id ) ) {\n\t\t\t\t\twp_die( esc_html__( 'You do not have permission to restore this post.', 'the-events-calendar' ) );\n\t\t\t\t}\n\n\t\t\t\tif ( ! $this->restore_event( $post_id ) ) {\n\t\t\t\t\twp_die( esc_html__( 'Error restoring from Ignored Events.', 'the-events-calendar' ) );\n\t\t\t\t}\n\n\t\t\t\t$restored++;\n\t\t\t}\n\t\t\t$sendback = add_query_arg( 'restored', $restored, $sendback );\n\n\t\t\twp_redirect( $sendback );\n\t\t\texit;\n\t\t}",
"protected static function registerRestoredHandler()\n {\n static::restored(function ($model) {\n foreach ($model->deletesWith() as $relation) {\n if ($model->{$relation}()->getMacro('onlyTrashed')) {\n $model->{$relation}()->onlyTrashed()->get()->each(function ($related) {\n $related->restore();\n });\n }\n }\n });\n }",
"public function admin_recover() {\n\t\t$this->_recover();\n\t}",
"public function handleAfterRestoreOrderEvent(Event $e)\n {\n $subOrders = SubOrder::find()->commerceOrderId($e->sender->id)->trashed()->all();\n if( empty($subOrders) ) return;\n\n Craft::$app->getElements()->restoreElements($subOrders);\n }",
"public function restored(Recordable $model): void\n {\n Accountant::record($model, 'restored');\n\n // Once the event terminates, the state is reverted\n static::$restoring = false;\n }",
"public function restored(Incidente $incidente)\n {\n //\n }",
"public function restore()\r\n {\r\n $handlerFunctionName = 'restore_'.$this->handlerType.'_handler';\r\n $handlerFunctionName();\r\n }",
"public function restored(SalesReceipt $salesReceipt)\n {\n //\n }",
"function restoreEvent($eventId)\n {\n // restore the event\n mysql_query(\"UPDATE argus_events SET status = 'SAVED' where event_id = '\".$eventId.\"' AND status = 'DELETED'\") or die(mysql_error());\n \n return;\n }",
"public function restore() {\n $id = \\Input::get('id');\n if($subscriber = Subscriber::onlyTrashed()->find($id)) {\n $subscriber->restore();\n } else {\n // does not exist or is already restored\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all festival types | public static function getAllFestivalTypes()
{
$database = DatabaseFactory::getFactory()->getConnection();
$sql = "SELECT * FROM fest_type";
$query = $database->query($sql);
// fetchAll() is the PDO method that gets all result rows
return $query->fetchAll();
} | [
"public function types()\n {\n return $this->all('rdf:type');\n }",
"public function getTypes()\n {\n }",
"public function getAllMealTypes()\n {\n return MealFoodType::all();\n }",
"public function getAllTypes(): array\n {\n return $this->types;\n }",
"public function getTypes()\n {\n return $this->get('Types');\n }",
"public function getQueryTypes();",
"public function getAlltype()\n\t{\n\t\treturn $this->alltype;\n\t}",
"public function getAllSchemeTypesQuery()\n {\n\t\t$sql = $this->getQueryContent('allSchemeTypesQuery');\n\t\treturn $this->db->fireSqlFetchAll($sql,'allSchemeTypesQuery');\n\t}",
"private function allTypes(){\n if(!$this->hasAirline()){\n return Redirect::to('/backend/home');\n }\n //returns array of all types\n $types = AircraftType::all();\n $list = array();\n foreach($types as $t){\n array_push($list, $t->name);\n }\n return $list; \n }",
"public function getAll() : array\n {\n return $this->types;\n }",
"public function get_types()\n\t{\n\t\treturn $this->driver_query('type_list', FALSE);\n\t}",
"public function getFilterTypes();",
"function erp_get_people_types() {\n return apply_filters( 'erp_people_types', [] );\n}",
"public function getAllTypes()\n {\n return $this->connection->select(\n $this->grammar->compileGetAllTypes()\n );\n }",
"public static function getAll()\r\n {\r\n return self::$typeRegistry;\r\n }",
"public static function getAllTypes() {\n $query = Zend_Registry::getInstance()->entitymanager->createQuery('select t from Default_Model_Objecttype t group by t.name');\n return $query->getResult();\n }",
"public function showTypes()\n {\n if ($results = $this->model->getAllFood())\n {\n $this->page->food_types = $results;\n }\n else\n {\n $this->page->setTemplate('noResults');\n }\n }",
"public static function getTypes() {\r\n $db = static::getDB();\r\n $stmt = $db->query(\r\n \"SELECT * FROM runtype\"\r\n );\r\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n \r\n return $results;\r\n }",
"public function listAllType(){\n try {\n return $this->identityTypeGateway->getAllTypes();\n } catch (Exception $ex) {\n throw $ex;\n }catch (PDOException $e){\n throw $e;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the content of the member variable foods. | public function getFoodsData()
{
return $this->foods;
} | [
"public function getFood()\n {\n return $this->food;\n }",
"public function getListFood(){\r\n\t\treturn MongoDatabase::getAllDataFrom(\"MonAn\");\t\t\r\n\t}",
"public function foodName()\n {\n return static::randomElement(static::$foodNames);\n }",
"public static function listAllergicFoodItems() {\n\t\t$allergicFoodItems = array(\n\t\t\t1 => __('Shellfish'),\n\t\t\t2 => __('Milk'),\n\t\t\t3 => __('Peanut')\n\t\t);\n\t\treturn $allergicFoodItems;\n\t}",
"function getMeals() {\r\n return array(\"breakfast\", \"lunch\", \"dinner\");\r\n }",
"function getFoods($food)\n{\n\t// Send the command to the database\n\t$food = mysql_real_escape_string($food);\n\t$query = \"select FD_ID, L_FD_NME from FOOD_NM where L_FD_NME like '%$food%'\";\n\t$result = mysql_query($query);\n\tif(!$result)\n\t{\n\t\tdie(\"Could not get foods from database: \".mysql_error());\n\t}\n\n\t// Process the rows and return the data\n\t$foods = array();\n\twhile(($row = mysql_fetch_array($result)))\n\t{\n\t\t$foods[$row[\"FD_ID\"]] = $row[\"L_FD_NME\"];\n\t}\n\treturn $foods;\n}",
"public function getFacts()\n {\n return $this->facts;\n }",
"function getAllFoods() {\n $sql = \"SELECT pantry.name AS name, pantry.expiration_date AS expiration_date, food_type.name AS food_type, pantry.id AS id FROM pantry LEFT JOIN food_type ON pantry.food_type = food_type.id ORDER BY food_type\";\n $result = $this->conn->query($sql);\n\n if ($result->num_rows > 0) {\n return $result->fetch_all(MYSQLI_ASSOC);\n }\n\n return false;\n }",
"public function isFood() {\n\t\treturn $this->food;\n\t}",
"function get_all_food_names() {\n\tglobal $link;\n\t$results = array();\n\t$q = mysqli_query($link,\"SELECT * FROM \" . FOOD . \";\") or die(mysqli_error($link));\n\n\twhile ($q_food = mysqli_fetch_assoc($q)) {\n\t\t$results[] = $q_food;\n\t}\n\n\tmysqli_free_result($q);\n\n\treturn $results;\n}",
"function getMeals()\r\n {\r\n\r\n return array(\"breakfast\", \"brunch\", \"lunch\", \"dinner\");\r\n }",
"public function showFoodList()\n {\n $template = 'admin/show_foods.html.twig';\n $foods = $this->getDoctrine()->getRepository(Food::class)->findAll();\n\n $args = [\n 'page_name' => 'Admin Panel - foods',\n 'foodlist' => $foods\n ];\n\n\n return $this->render($template, $args);\n }",
"public function getAll() {\n return Foods::all();\n }",
"static function getMeals()\r\n {\r\n return array(\"breakfast\", \"brunch\", \"lunch\", \"dinner\");\r\n }",
"public function getPeople(){\n return $this->film['people'];\n }",
"public function get_members(){\n\t\t$members_string = '';\n\t\tforeach($this->_members as $member){\n\t\t\t$members_string .= $member.', ';\n\t\t}\n\n\t\treturn 'This flock has '.$this->_get_number_members().' members : ['. $members_string.']';\n\t}",
"public function getFleets(){\n\t\treturn $this->fleets;\n\t}",
"public function it_lists_all_food_units_and_includes_calories_for_a_specific_food()\n {\n $this->markTestIncomplete();\n $this->logInUser();\n\n $response = $this->apiCall('GET', '/api/foodUnits?includeCaloriesForSpecificFood=true&food_id=2');\n $content = json_decode($response->getContent(), true);\n// dd($content);\n\n $this->checkFoodUnitKeysExist($content[0]);\n $food = $content[1];\n\n $this->assertEquals(6, $food['id']);\n $this->assertEquals('grams', $food['name']);\n $this->assertEquals('food', $food['for']);\n $this->assertNull($food['calories']);\n $this->assertEquals('5.00', $content[1]['calories']);\n\n $this->assertEquals(200, $response->getStatusCode());\n }",
"public static function getPopulation() {\n\t\t\treturn self::$populationPokemons;\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets value of 'has_order' property | public function setHasOrder($value)
{
return $this->set(self::has_order, $value);
} | [
"function setOrder($order) \n\t{\n $this->order = $order;\n }",
"public function setOrder($order);",
"public function setOrder()\n {\n $this->setOrderValue();\n }",
"public function setOrdered( $ordered ) {\n\t\t$this->ordered = $ordered;\n\t}",
"public function setOrder(?Order $order): void\n {\n $this->order = $order;\n }",
"function setOrder($order=\"DESC\")\r\n {\r\n $this->order = $order;\r\n }",
"function setOrder(&$order) {\r\n\r\n\t\t$this->order =& $order;\t// Array (List)\r\n\r\n\t}",
"public function hasOrder()\n {\n return $this->_has('_order');\n }",
"protected function setOrderState()\n {\n $this->paymentFactory->getPayment($this->sgOrder->getPaymentMethod())\n ->setOrderStatus($this->mageOrder, $this->sgOrder);\n }",
"function setOrder($order=\"DESC\"){\n\t\t\t$this->order = $order;\n\t\t}",
"public function set_order( $name, $order ) {\n\t\t\n\t\tif( !is_string( $name ) ) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif( !is_numeric( $order ) ) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif( isset( $this->elements[$name] ) ) {\n\t\t\t$this->elements[$name]->set_order( $order );\n\t\t\t$this->prepare_components();\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif( isset( $this->groups[$name] ) ) {\n\t\t\t$this->groups[$name]->set_order( $order );\n\t\t\t$this->prepare_components();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\t\t\n\t}",
"public function setOrder(Tx_Justimmo_Domain_Model_Order $order) {\n\t\t$this->setOrderBy($order->getValue());\n\t\t$this->setOrderType($order->getDirection());\n\t}",
"function setNoteOrder() {\n\t\t$this->order = $_POST['order'];\n\t\t\n\t\t$stmt = $this->db->prepare('UPDATE note_user_preferences SET NoteOrder = :order WHERE UserId = :id ');\n\t\t$stmt->execute(array(':order' => $this->order, ':id' => $this->id));\n\t}",
"public function setOrderBy($order)\n\t{\n\t\tinclude(\"/m23/inc/i18n/\".$GLOBALS[\"m23_language\"].\"/m23base.php\");\n\n\t\tif ((ORDERBY_STATUS == $order) || (ORDERBY_CLIENT == $order) || (ORDERBY_INSTALLDATE == $order) || (ORDERBY_LASTMODIFY == $order) || (ORDERBY_IP == $order) || (ORDERBY_MAC))\n\t\t{\n\t\t\t$this->orderBy = $order;\n\t\t\treturn(true);\n\t\t}\n\t\telse\n\t\t\tdie(1);\n\t}",
"public function testGetAndSetOrderableFunction()\n {\n $orderable = true;\n $this->assertEquals($orderable, $this->product->setOrderable($orderable)->isOrderable());\n }",
"public function setOrderNumber($order_number);",
"public function hasOrder()\n {\n return (Mage::registry('Object_Cache_Order')) ? true : false;\n }",
"function order($value)\n\t{\n\t\t$this->order = $value;\n\t}",
"public function setReorder($bool)\n\t{\n\t\t$this->reorder = $bool;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a list of batches | public function getBatches(){
return $this->get("/batch");
} | [
"public function getBatches()\n {\n $batches = $this->db->query(\"SELECT * FROM batch\")->fetchAll();\n return $batches;\n }",
"public static function getBatchs(){\n $batchs;\n \n // List of batchs created manually, this would come from db\n for($i=1;$i<=5;$i++){\n $batch=new Batch();\n $batch->id=$i;\n ($i!=5)?$batch->status=\"dispatched\":$batch->status=\"not dispatched\";\n $batchs[]=$batch;\n }\n\n return $batchs;\n }",
"public function getBatchs()\n {\n return $this->batchs;\n }",
"public function findAllBatches()\n {\n return Doctrine_Query::create()\n ->from('AlcheckBatch b')\n ->orderBy('b.id desc')\n ->where('b.description != ?', 'Dummy batch')\n ->execute();\n }",
"public function listBatches()\n {\n $sql = \"select batches.batchID, createTime, createdBy, comment, count(UserName) as numTickets from batch, batches WHERE batches.batchID = batch.batchID GROUP BY batches.batchID\";\n \n $result = $this->db->queryAll($sql);\n \n // Always check that result is not an error\n if (PEAR::isError($result)) {\n ErrorHandling::fatal_db_error('Getting list of batches failed: ', $result);\n }\n \n /*$results = array();\n foreach ($result as $row)\n {\n $results[] = $row[0];\n }*/\n \n return $result;\n }",
"public function getBatchCount()\n {\n return $this->batches;\n }",
"public function getBatch() {\n return $batch;\n }",
"public function getBatchItems()\n {\n return $this->batchItems;\n }",
"public function getBatch()\n {\n return $this->batch;\n }",
"public function batches()\n\t{\n\t\treturn $this->hasMany('Batch', 'revision_id', 'id');\n\t}",
"public function getBatch()\r\r\n {\r\r\n return $this->batch;\r\r\n }",
"public function batches()\n\t{\n\t\treturn $this->hasMany('Batch', 'product_id', 'id');\n\t}",
"public function getMigrationBatches()\n {\n return $this->table()\n ->orderBy('batch', 'asc')\n ->orderBy('migration', 'asc')\n ->pluck('batch', 'migration')->all();\n }",
"public function getBatch() {\n return $this->_batch;\n }",
"public function batchTasks()\n {\n return $this->batch;\n }",
"public function batch(int $n = 50) : array;",
"private function getBatchOrders()\n {\n return array_slice($this->ordersToSync, 0, $this->batchSize);\n }",
"public function getBatch() {\n return [\n 'oid' => $this->oid,\n 'status' => $this->status,\n 'date_last' => $this->date_last,\n 'date_scheduled' => $this->date_scheduled,\n 'active' => $this->active\n ];\n }",
"abstract public function batch(int $n = 50) : array;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the value of field command_type | public function getCommandType()
{
return $this->command_type;
} | [
"public function getCmdType();",
"public function getCommandType()\n {\n return $this->commandType;\n }",
"public function messageType(): string\n {\n return DomainMessage::TYPE_COMMAND;\n }",
"protected function getCommandAndType($value, Command $command)\r\n\t{\r\n\t\t$key = $command->template . '.' . $command->instruction;\r\n\r\n\t\tif ($command->marker === '@@')\r\n\t\t{\r\n\t\t\treturn Constant::T_COMMAND_TYPE_BLOCK_END;\r\n\t\t}\r\n\t\telse if ($command->marker == '@' && $keyword = $this->keywordList->get($key))\r\n\t\t{\r\n\t\t\t$command->instruction = $keyword;\r\n\r\n\t\t\t$this->commandCount++;\r\n\r\n\t\t\tif ($keyword['hasBody'])\r\n\t\t\t{\r\n\t\t\t\treturn Constant::T_COMMAND_TYPE_BLOCK_START;\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn Constant::T_COMMAND_TYPE_LINE;\t\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Constant::T_COMMAND_TYPE_NONE;\r\n\t}",
"public function commandValue()\n {\n return $this->parseCommand()[1];\n }",
"public function getTypeoperation()\n {\n return $this->typeoperation;\n }",
"public function getType() {\n return $this->model->botType;\n }",
"abstract protected function getSupportedCommandType(): string;",
"protected abstract function getCommandClass();",
"public function getType(){\n return $this->getParameter('type');\n }",
"public function getCommandClass(): string\n {\n return $this->commandClass;\n }",
"public function getType() {\n\t\treturn $this->messageTypes[$this->type];\n\t}",
"public function getType() {\n return message_type_load($this->type);\n }",
"public function getCommand()\n {\n return pack('C', $this->command);\n }",
"public function getTypeOperation()\n {\n return $this->typeOperation;\n }",
"public function getClosingCommand() : ?Mailcode_Commands_Command_Type_Closing;",
"public function getCmd()\n {\n return $this->get(self::CMD);\n }",
"public function getCommand()\n {\n return $this->cmd;\n }",
"public function get_id_command(){\r\n \t\treturn $this->id_command;\r\n \t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.