query
stringlengths
9
43.3k
document
stringlengths
17
1.17M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
/ Returns a repository instance by id.
public function getRepository($id) { foreach ($this->repositories as $repository) { if ($repository->id == $id) { return $repository; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function byId($id)\n\t{\n\t\treturn $this->getMyRepository()->find($id);\n\t}", "public function get($id) {\r\n\treturn $this->getRepository()->find($id);\r\n }", "public function show($id)\n {\n return Repository::find($id);\n }", "public function find($id)\n {\n return $this->repo->find($id);\n }", "public function find($id)\n {\n return $this->repo->find($id);\n }", "public static function find($id) { return new static($id); }", "public function getOne($id)\n {\n return $this->repository->find($id);\n }", "public function find($id)\r\n {\r\n return $this->repository->find($id);\r\n }", "public function getById($id)\n {\n return $this->repository->getById($id);\n }", "public function findById($id)\n {\n return $this->findOneBy(['id' => $id]);\n }", "public function find($id)\n {\n return $this->getRepository()->find($id);\n }", "public function find($id)\n {\n return $this->getRepository()->find($id);\n }", "public function find($id)\n {\n return $this->getRepository()->find($id);\n }", "public function find($id)\n {\n return $this->mainRepository->find($id);\n }", "protected function findEntity($id, $repositoryName=\"\")\n {\n return $this->getRepository($repositoryName)->find($id);\n }", "public static function findById($id);", "public function find($id)\n {\n return $this->findOneBy(['id' => $id]);\n }", "public function find($id)\n {\n return $this->repository->find($id);\n }", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);" ]
[ "0.725769", "0.7173772", "0.71196014", "0.7075042", "0.7075042", "0.70541096", "0.69994557", "0.6977102", "0.69726616", "0.6947673", "0.6920996", "0.6920996", "0.6920996", "0.6916889", "0.6892027", "0.6853716", "0.6827931", "0.6827027", "0.6824176", "0.6824176", "0.6824176", "0.6824176", "0.6824176", "0.6824176", "0.6824176", "0.6824176", "0.6824176", "0.6824176", "0.6824176", "0.6824176" ]
0.7418153
0
/ Returns a unique list of available search fields in all datasets.
public function getSearchFields() { //return $this->searchFields; return ['_all']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSearchFields();", "public function getAllFields();", "public function getFullSearchFields()\r\n\t{\r\n\t\t$file = AKHelper::_('path.get', null, $this->option) . '/models/forms/' . $this->list_name . '/search.xml';\r\n\t\t$file = JFile::exists($file) ? $file : AKHelper::_('path.get', null, $this->option) . '/models/forms/' . $this->list_name . '_search.xml';\r\n\r\n\t\t$xml = simplexml_load_file($file);\r\n\t\t$field = $xml->xpath('//field[@name=\"field\"]');\r\n\t\t$options = $field[0]->option;\r\n\r\n\t\t$fields = array();\r\n\r\n\t\tforeach ($options as $option):\r\n\t\t\t$attr = $option->attributes();\r\n\t\t\t$fields[] = $attr['value'];\r\n\t\tendforeach;\r\n\r\n\t\treturn $fields;\r\n\t}", "public function getSearchFields()\n\t{\n\t\treturn $this->possible_fields;\n\t}", "function GetFieldsList()\n\t{\n\t\tglobal $dal_info;\n\t\treturn array_keys( $dal_info[ $this->infoKey ] );\n\t}", "public function genericSearchFields()\n {\n return ['url', 'content', 'title', 'arguments_json', 'language_info'];\n }", "public function getListFields();", "final public function getAllFields()\r\n {\r\n return array($this->_field);\r\n }", "abstract public function getFieldsSearchable();", "abstract public function searchFields(): array;", "protected function getAvailableFields() \n {\n return array_merge(\n Fields::$spot,\n Fields::$mass,\n Fields::$location\n );\n }", "public function getAllFields() {\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db_q'];\n\t\t\t// Initialize variables\n\t\t\t$return\t\t\t= false;\n\t\t\t// Query set up\t\n\t\t\t$table\t\t\t= 'tb_field';\n\t\t\t$select_what\t= 'id, vc_field AS vc_name';\n\t\t\t$conditions\t\t= \"1 ORDER BY vc_field ASC\";\n\t\t\t$return\t\t\t= $db->getAllRows_Arr($table, $select_what, $conditions);\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}", "public function getSearchFields(): array {\n # TODO move this to database\n $ignoreValues = ['SortNum' => '', 'Accession Numerical' => '', 'Imaged' => '', 'IIFRNo' => '',\n 'Photographs::photoFileName' => '', 'Event::eventDate' => '', 'card01' => '', 'Has Image' => '', 'imaged' => ''];\n return array_diff_key($this->search_layout->getFields(), $ignoreValues);\n }", "public function getSelectDataFields();", "public function getAllFields() {\n return $this->allFieldsAlias;\n }", "public function getQueryFields()\n {\n return array();\n }", "function getMyFezSearchList()\r\n {\r\n $log = FezLog::get();\r\n $db = DB_API::get();\r\n\r\n // AM: disable depsitor search key. with ~80000 authors it slows considerably\r\n // need to look at a better way to search for depositor\r\n $stmt = \"SELECT\r\n *\r\n FROM\r\n \" . APP_TABLE_PREFIX . \"search_key\r\n\t\t\t\t WHERE sek_myfez_visible = TRUE\r\n ORDER BY\r\n sek_order ASC\";\r\n try {\r\n $res = $db->fetchAll($stmt, array(), Zend_Db::FETCH_ASSOC);\r\n }\r\n catch (Exception $ex) {\r\n $log->err($ex);\r\n return '';\r\n }\r\n\r\n if (empty($res)) {\r\n return array();\r\n } else {\r\n for ($i = 0; $i < count($res); $i++) {\r\n $res[$i][\"field_options\"] = Search_Key::getOptions($res[$i][\"sek_smarty_variable\"]);\r\n }\r\n return $res;\r\n }\r\n }", "public function all_fields() {\n\t\t$general_fields = $this->general_fields();\n\t\t$promo_fields = $this->promotional_fields();\n\t\t$script_fields = $this->scripts_fields();\n\t\t$all_fields = array_merge( $general_fields, $promo_fields, $script_fields );\n\t\treturn $all_fields;\n\t}", "public static function getAllFields(): array\n {\n $className = get_called_class();\n $table = with(new $className)->getTable();\n $cache_key = self::$cache_prefix.'.ALLFIELDS.' . strtoupper($table);\n\n return self::$use_cache ? Cache::remember($cache_key, 5 * 60, function () use ($table) {\n return \\Schema::getColumnListing($table);\n }) : \\Schema::getColumnListing($table);\n }", "function getSearchFields() { return $this->_search_fields; }", "public static function available_fields()\n {\n return self::$available_fields;\n }", "function list_fields()\n\t{\n\t\t$field_names = array();\n\t\twhile ($field = mysqli_fetch_field($this->result_id))\n\t\t{\n\t\t\t$field_names[] = $field->name;\n\t\t}\n\n\t\treturn $field_names;\n\t}", "public function getFieldsList(){\n return $this->_get(1);\n }", "public function fetchFields();", "public function getAllFields()\n {\n return $this->fields;\n }", "public function getAllSearchableFields()\n {\n $fields = \\Config::inst()->get(get_class($this->owner), 'searchable_fields');\n $labels = $this->owner->fieldLabels();\n\n // fallback to default method\n if(!$fields) {\n return $this->owner->searchableFields();\n }\n\n // Copied from DataObject::searchableFields() as there is no separate accessible method\n\n // rewrite array, if it is using shorthand syntax\n $rewrite = array();\n foreach($fields as $name => $specOrName) {\n $identifer = (is_int($name)) ? $specOrName : $name;\n\n if(is_int($name)) {\n // Format: array('MyFieldName')\n $rewrite[$identifer] = array();\n } elseif(is_array($specOrName)) {\n // Format: array('MyFieldName' => array(\n // 'filter => 'ExactMatchFilter',\n // 'field' => 'NumericField', // optional\n // 'title' => 'My Title', // optiona.\n // ))\n $rewrite[$identifer] = array_merge(\n array('filter' => $this->owner->relObject($identifer)->stat('default_search_filter_class')),\n (array)$specOrName\n );\n } else {\n // Format: array('MyFieldName' => 'ExactMatchFilter')\n $rewrite[$identifer] = array(\n 'filter' => $specOrName,\n );\n }\n if(!isset($rewrite[$identifer]['title'])) {\n $rewrite[$identifer]['title'] = (isset($labels[$identifer]))\n ? $labels[$identifer] : \\FormField::name_to_label($identifer);\n }\n if(!isset($rewrite[$identifer]['filter'])) {\n $rewrite[$identifer]['filter'] = 'PartialMatchFilter';\n }\n }\n\n return $rewrite;\n }", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();" ]
[ "0.73796004", "0.70285296", "0.70238507", "0.6854407", "0.680406", "0.6762993", "0.6738278", "0.66606236", "0.6647226", "0.6607291", "0.6501437", "0.64789635", "0.64746374", "0.64666265", "0.64614743", "0.6434207", "0.641082", "0.64079624", "0.63799804", "0.6353853", "0.6338154", "0.63334954", "0.6324373", "0.6314935", "0.6304224", "0.62789196", "0.6278505", "0.6278505", "0.6278505", "0.6278505" ]
0.72154
1
Returns the time a given `$id` was last modified.
public function getModifiedSince($id) { return $this->_engine->read($id . '.time'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLastChangeTime($id)\n\t{\n\t\t$info = apc_cache_info('user');\n\n\t\tforeach ($info['cache_list'] as $cache) {\n\t\t\tif ($cache['info'] == $id) {\n\t\t\t\treturn $cache['mtime'];\n\t\t\t}\n\t\t}\n\t}", "public function get_post_last_modified_date( $post_id ) {\n\t\t// sanitize the data\n\t\t$post_id = intval( sanitize_text_field( $post_id ));\n\n\t\t// get post details\n\t\t$post = get_post( $post_id ) ;\n\n\t\t$last_modified = date('d-m-Y h:i:s', strtotime($post->post_modified));\n\n\t\treturn $last_modified;\n\t}", "public function getLastModifiedTime();", "public function getTimestampById($id)\n {\n try\n {\n $stmt = 'SELECT time FROM editor_comments WHERE ec_id=:id';\n $statement = $this->_database_connection->get_connection()->prepare($stmt);\n $statement->execute(array(\n ':id' => $id,\n ));\n $result = $statement->fetch(PDO::FETCH_ASSOC);\n return $result['time'];\n\n } catch (PDOException $e) {\n $this->_database_connection->close_connection();\n echo 'ERROR: ' . $e->getMessage();\n }\n }", "public function last_modified() {\n\t\treturn $this->timestamp;\n\t}", "public function getModifiedStamp();", "public function getModifiedTime()\n\t{\n\t\treturn $this->modifiedTime; \n\n\t}", "public function getLastModifiedAt();", "public function getLastModifiedAt();", "public function getLastModified();", "public function getLastModified();", "public function getLastModified();", "public function getLastModified();", "public function getLastModified()\n {\n return ($this->item['mtime'] ? $this->item['mtime'] : ($this->item['ctime'] ? $this->item['ctime'] : time()));\n }", "public function get_date_modified();", "function get_timemodified() {\n return $this->timemodified;\n }", "public function lastModifiedTime(): int\n {\n if (isset($this->lastModifiedTime)) {\n return $this->lastModifiedTime;\n }\n return FileSystem::lastModifiedTime($this->path);\n }", "public function getModificationTime()\n {\n return ( $this->mtime ? $this->mtime : self::dosFormatToTimestamp( array( $this->lastModFileTime, $this->lastModFileDate ) ) );\n }", "public function getModifiedAt()\n {\n return $this->getProperty(self::MODIFIED_AT);\n }", "public function getLastModified(): int;", "function getLastModified()\n {\n $this->loadStats();\n return $this->stat['mtime'];\n }", "public function getDateModified() {\n\t\t\treturn $this->date_modified;\n\t\t}", "public function getModifiedAt()\n {\n return $this->modifiedAt;\n }", "public function getLastModifiedAudit();", "public static function getLastModified() {}", "public function getModificationTime();", "public function getModifiedAt();", "public function getModifiedAt();", "public function getModifiedById()\n\t{\n\t\treturn $this->modifiedById;\n\t}", "public function getLastModified()\n {\n return filemtime($this->getFileName());\n }" ]
[ "0.8193143", "0.6926606", "0.691852", "0.67683536", "0.6714139", "0.67109764", "0.669233", "0.6622947", "0.6622947", "0.66020375", "0.66020375", "0.66020375", "0.66020375", "0.6586152", "0.6571084", "0.6562785", "0.6516184", "0.6492995", "0.6491303", "0.6474048", "0.64586145", "0.6424584", "0.6399033", "0.63944143", "0.6382965", "0.63735497", "0.6363524", "0.6363524", "0.635956", "0.6351734" ]
0.84267336
0
Add a new result.
public function add(ResultInterface $result): void { $this->results[] = $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function addResult($result) {\n //Adds a result to the results array\n $this->results[] = $result;\n }", "public function add_result(array $request, $result) {\n $this->__results[] = array('action' => $request['action'],\n 'method' => $request['method'],\n 'tid' => $request['tid'],\n 'type' => $request['type'],\n 'result' => $result);\n return (true);\n }", "function add_activity_result($result) {\n\t\t$this->_activity_result[] = $result;\n\t}", "public function addResult(Result $result): self\n {\n $handler = $result->getHandlerName();\n $this->results[$handler][] = $result;\n\n return $this;\n }", "public function addResult(SearchResult $result)\n {\n $this->results[] = $result;\n return $this;\n }", "public function addResult($file, Blerby_TestRunner_Result $result)\r\n {\r\n $this->aResults[$file][] = $result;\r\n }", "public function addResult(string $string) : void;", "public function testAddResult(): void\n {\n $this->collection->setResult($this->timeResult);\n $this->assertEquals(\n $this->timeResult,\n $this->collection->getResult(TimeResult::class)\n );\n }", "public function append_result($result_append) {\n\t\t$this->_result .= $result_append;\n\t}", "protected function addResults($newValues)\n {\n $this->results[] = $newValues;\n }", "public function addResult($command, $status, $message)\n {\n $this->results[] = array('command' => $command, 'status' => $status, 'message' => $message);\n return $this;\n }", "function addResult($result_title, $result_description, $result_picture, $memberID){\n\t\trequire('quizrooDB.php');\n\t\t\n\t\t// check if is member\n\t\tif($this->isOwner($memberID)){\n\t\t\t// Insert the result\n\t\t\t$insertSQL = sprintf(\"INSERT INTO q_results(`result_title`, `result_description`, `result_picture`, `fk_quiz_id`) VALUES (%s, %s, %s, %d)\",\n\t\t\t\t\t\t\t htmlentities(GetSQLValueString($result_title, \"text\")),\n\t\t\t\t\t\t\t htmlentities(GetSQLValueString($result_description, \"text\")),\n\t\t\t\t\t\t\t GetSQLValueString($result_picture, \"text\"),\n\t\t\t\t\t\t\t GetSQLValueString($this->quiz_id, \"int\"));\n\t\t\tmysql_query($insertSQL, $quizroo) or die(mysql_error());\n\t\t\t\n\t\t\t// find the result id\n\t\t\t$querySQL = \"SELECT LAST_INSERT_ID() AS insertID\";\n\t\t\t$resultID = mysql_query($querySQL, $quizroo) or die(mysql_error());\n\t\t\t$row_resultID = mysql_fetch_assoc($resultID);\n\t\t\tmysql_free_result($resultID);\n\t\t\t\n\t\t\treturn $row_resultID['insertID'];\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function pushResult($item)\n {\n $this->results[] = $item;\n return $this;\n }", "private function pushResult($element) {\n array_push($this->records, $element);\n\t}", "public function store_result() {}", "public function addTestResult(Streamwide_PHPUnit_Runner_TestCaseResult $testCaseResult)\n {\n $this->_results[] = $testCaseResult;\n \n $status = $testCaseResult->getStatus();\n $class = $testCaseResult->getTestCase()->getClass();\n $index = count($this->_results) - 1;\n \n $this->_statusIndex[$status][$class][] = $testCaseResult;\n $this->_classIndex[$class][$status][] = $testCaseResult;\n }", "public function addToItemResults(\\StructType\\ItemResult $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\StructType\\ItemResult) {\n throw new \\InvalidArgumentException(sprintf('The ItemResults property can only contain items of \\StructType\\ItemResult, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->ItemResults[] = $item;\n return $this;\n }", "public function addResult(RaceResultItem $result)\n {\n if ($result->getParticipation()->getId() != $this->participation->getId()) {\n throw new \\Exception('Invalid player');\n }\n\n $this->pos_abs[] = $result->getPosAbs();\n $this->pos_rel[] = $result->getPosRel();\n $this->pts_abs[] = $result->getPtsAbs();\n $this->pts_rel[] = $result->getPtsRel();\n }", "public function addAlterResult(AlterResultInterface $resultAlterer, $name = '*')\n {\n $this->hooks[$name][self::ALTER_RESULT][] = $resultAlterer;\n return $this;\n }", "private function addResultMessage() {\n $result = $this->importer->getResult();\n $array_column = array_column($result, 'status');\n $count = array_count_values($array_column);\n\n $this->messenger->addMessage($this->t('Created: @count', [\n '@count' => isset($count['create']) ? $count['create'] : 0,\n ]));\n\n $this->messenger->addMessage($this->t('Updated: @count', [\n '@count' => isset($count['update']) ? $count['update'] : 0,\n ]));\n\n $this->messenger->addMessage($this->t('Skipped: @count', [\n '@count' => isset($count['skip']) ? $count['skip'] : 0,\n ]));\n\n return $this;\n }", "public function add($description, $id)\n {\n array_push($this->results, new Result($description, $id));\n $this->count++;\n }", "public function canAddToResult();", "public function set_result($result) {\n\t\t$this->_result = \"$result\";\n\t}", "public function addResult(){\n return view('admin.pages.exam.add_result');\n }", "public function addResults(ResourceInterface ...$resources) {\n\t\t$this->results = array_merge($this->results, $resources);\n\t}", "function setResult($function, $result)\n {\n $this->m_results[$function] = $result;\n }", "private function add($value, &$result) {\r\n\r\n // Get variable type\r\n $type = gettype($value);\r\n\r\n switch ($type) {\r\n case \"boolean\";\r\n $result .= $value ? \"true\" : \"false\";\r\n $result .= self::NEWLINE;\r\n break;\r\n case \"integer\":\r\n $result .= $value . self::NEWLINE;\r\n break;\r\n case \"double\":\r\n $result .= $value . self::NEWLINE;\r\n break;\r\n case \"string\":\r\n $result .= $value . self::NEWLINE;\r\n break;\r\n case \"array\":\r\n if ($this->remove_empty_elements && count($value) == 0)\r\n return;\r\n foreach ($value as $arr_key => $arr_val) {\r\n $this->add($arr_key . '::' . $arr_val, $result);\r\n }\r\n break;\r\n case \"object\":\r\n $properties = get_object_vars($value);\r\n foreach ($properties as $obj_key => $obj_val) {\r\n $this->add($obj_key . '::' . $obj_val . self::NEWLINE, $result);\r\n }\r\n break;\r\n default:\r\n\r\n break;\r\n }\r\n }", "function setResults ($result) {\n\t\t$this->_results = $result;\n\t}", "protected function set_result($result) {\r\n\t\t$this->result = $result;\r\n\t}", "public function setResult($result = null) {\r\n $this->_result = $result;\r\n }" ]
[ "0.8433294", "0.7562231", "0.7281013", "0.72187537", "0.7063853", "0.6958396", "0.6875612", "0.67568964", "0.6689229", "0.6564261", "0.63921607", "0.62920845", "0.62433165", "0.6230348", "0.6208291", "0.61159396", "0.6111356", "0.6082091", "0.6045154", "0.6043392", "0.6039806", "0.6017347", "0.60087013", "0.5976224", "0.5962266", "0.5951411", "0.58925134", "0.58874255", "0.5877864", "0.5877309" ]
0.7675816
1
Get the name of the check that this result was produced from, most likely the CGI Runner.
public function getCheckName(): string { return $this->name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCheckName()\n {\n return $this->checkName;\n }", "public function getCheckName()\n {\n return $this->checkName;\n }", "public function getCheck()\n {\n return $this->check;\n }", "public function getCheckType()\n {\n return $this->check_type;\n }", "public function getCheckType()\n {\n return $this->checkType;\n }", "public function getRuleName(): string;", "public function getRuleName(): string;", "public static function getToolName();", "public function getCheckValue()\n {\n return $this->check !== null ? (string) $this->check : null;\n }", "public function getName()\n {\n return 'simplethings_formextra_validation';\n }", "public function getCheckNames() {\n $commands = drush_get_commands();\n\n // Guess the name of the Drush command.\n $command_name_pieces = preg_split('/(?=[A-Z])/', get_called_class());\n unset($command_name_pieces[0], $command_name_pieces[1], $command_name_pieces[3]);\n $command_name = strtolower(implode('-', $command_name_pieces));\n $command = $commands[$command_name];\n\n drush_command_invoke_all_ref('drush_command_alter', $command);\n\n $checks = array();\n foreach ($command['checks'] as $check) {\n if (is_array($check)) {\n $checks[] = $check['name'];\n require_once $check['location'];\n }\n else {\n $checks[] = $check;\n $base_class_name = 'SiteAuditCheck' . $this->getReportName();\n $class_name = $base_class_name . $check;\n if (!class_exists($class_name)) {\n require_once SITE_AUDIT_BASE_PATH . \"/Check/{$this->getReportName()}/$check.php\";\n }\n }\n }\n\n return $checks;\n }", "public function getCheckInfo()\n {\n return $this->check_info;\n }", "public function getCheckid()\n {\n return $this->get(self::_CHECKID);\n }", "public function getCheckid()\n {\n return $this->get(self::_CHECKID);\n }", "public function getInspectTemplateName()\n {\n return $this->inspect_template_name;\n }", "public function getName()\n\t{\n\t\treturn $this->process;\n\t}", "protected function getName()\n {\n return $this->arguments['name'];\n }", "public function getCheck(): string\n {\n try {\n return $this->getRenderer()->renderTemplate($this->template, $this->templateValues);\n } catch (PHPMicroTemplateException $exception) {\n throw new RenderException(\"Can't render property validation template {$this->template}\", 0, $exception);\n }\n }", "protected function getSetupName()\n {\n return strtolower($this->argument('name'));\n }", "public function getName()\n {\n \treturn \"payfort Check Status\";\n }", "public function name() {\n\t\treturn \"Статус направления\";\n\t}", "public function getFraudCheckType(): string\n {\n return $this->getData(self::FRAUD_CHECK_TYPE);\n }", "public function getTestName()\n {\n return $this->getField(5)[1];\n }", "public function get_name() {\n return get_string('circleci', 'assignsubmission_circleci');\n }", "public function getUserCheck()\n {\n return $this->get(self::_USER_CHECK);\n }", "function get_report_shortname() {\n $classname = get_class($this);\n $reportname = substr($classname, 0, strlen($classname) - strlen('_report'));\n\n return $reportname;\n }", "public function getName(): string\n {\n return $this->requireString('name');\n }", "public static function GetCallingStepName()\n {\n $sCallingStepName = null;\n if (array_key_exists(self::SESSION_KEY_NAME, $_SESSION)) {\n $sCallingStepName = $_SESSION[self::SESSION_KEY_NAME];\n }\n\n return $sCallingStepName;\n }", "function\tgetFlowName() {\n\t\treturn $this->flowName ;\n\t}", "public function getWorkflowName();" ]
[ "0.76915026", "0.76915026", "0.6293923", "0.60093373", "0.59813935", "0.5929647", "0.5929647", "0.5919084", "0.5889784", "0.5855926", "0.5843865", "0.5832248", "0.5827538", "0.5827416", "0.5809944", "0.57702", "0.5727341", "0.56978935", "0.5687933", "0.56351775", "0.56310296", "0.56276995", "0.5615155", "0.56073064", "0.55787337", "0.5562802", "0.5545126", "0.5515829", "0.5512812", "0.5495633" ]
0.77728397
0
get the database dialect by the $name
public final static function getDialect($options = null) { try { if (!$options instanceof DatabaseConfiguration) { $options = new DatabaseConfiguration('', $options); } if (defined('ARTISAN_TASK_PID')) { $pid = @posix_getpid(); } else { $pid = 0; } $name = $options->__toString(); if (!isset(self::$INSTANCE[ $pid ]) || !array_key_exists($name, self::$INSTANCE[ $pid ])) { self::$INSTANCE [ $pid ][ $name ] = null; $driver = isset ($options ['driver']) && !empty ($options ['driver']) ? $options ['driver'] : 'MySQL'; $driverClz = 'wulaphp\db\dialect\\' . $driver . 'Dialect'; if (!is_subclass_of($driverClz, 'wulaphp\db\dialect\DatabaseDialect')) { self::$INSTANCE [ $pid ][ $name ] = new DialectException('the dialect ' . $driverClz . ' is not found!'); self::$lastErrorMassge = self::$INSTANCE [ $pid ][ $name ]->getMessage(); throw self::$INSTANCE [ $pid ][ $name ]; } /**@var \wulaphp\db\dialect\DatabaseDialect $dr */ $dr = new $driverClz ($options); $dr->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); $dr->onConnected(); $dr->cfGname = $name; self::$cfgOptions[ $name ] = $options; self::$lastErrorMassge = false; self::$INSTANCE[ $pid ][ $name ] = &$dr;//此处要使用引用,不然close将不启作用。 } if (self::$INSTANCE [ $pid ][ $name ] instanceof \Exception) { self::$lastErrorMassge = self::$INSTANCE [ $pid ][ $name ]->getMessage(); throw self::$INSTANCE [ $pid ][ $name ]; } return self::$INSTANCE [ $pid ][ $name ]; } catch (\PDOException $e) { self::$lastErrorMassge = $e->getMessage(); self::$INSTANCE [ $pid ][ $name ] = new DialectException($e->getMessage(), 0, $e); throw self::$INSTANCE [ $pid ][ $name ]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDatabaseDialect()\n {\n return $this->database_dialect;\n }", "protected function _getDatabaseAdapter($name)\n {\n if (class_exists($name)) {\n $adapter = $name;\n } else {\n $adapter = '\\Engine\\Db\\Adapter\\\\' . ucfirst($name);\n if (!class_exists($adapter)) {\n $adapter = '\\Phalcon\\Db\\Adapter\\\\' . ucfirst($name);\n if (!class_exists($adapter)) {\n return false;\n }\n }\n }\n\n return $adapter;\n }", "abstract public function selectDatabase($name);", "public static function getTableDbType($name)\n {\n if (static::isTableInScheme($name)) {\n $scheme = static::getTableScheme($name);\n return isset($scheme['dbtype']) ? $scheme['dbtype'] : 'mysql';\n }\n }", "public function getDriverName()\n {\n return $this->db->get_dbfamily();\n }", "public function get_dbfamily() {\n return 'oracle';\n }", "public static function getDialects(): array\n {\n return self::$dialects;\n }", "public function getDbOptions($name = 'default')\n {\n if (isset($this->_dbOptions->$name)) {\n return $this->_dbOptions->$name;\n }\n return null;\n }", "final public function db($name = null)\n {\n is_null($name) && $name = $this->_db;\n\n if (is_array($name) && ($config = $name)) {\n return self::factory('Db', $name);\n }\n\n $regName = \"_\". APP_NAME .\"_db_{$name}\";\n if (!$db = Yaf_Registry::get($regName)) {\n $config = Handle_Config::load('database');\n if (!$config || !isset($config[$name])) {\n exit('Error: ' . $name . ' database config not exists.');\n }\n\n $config = $config[$name];\n $adapter = $config['adapter'];\n if (isset($config['masterslave']) && $config['masterslave']) {\n $config = array('adapter' => 'masterslave') + $config;\n } else {\n $config += array('adapter' => 'Pdo_Mysql');\n }\n\n $db = self::factory('Db', $config);\n $db->setAdapter($adapter);\n \n if (isset($this->debug)) {\n $db->debug = !!$this->debug;\n } else if (defined(\"SWITCH_SQL_LOG\")) {\n $db->debug = !!SWITCH_SQL_LOG;\n }\n\n Yaf_Registry::set($regName, $db);\n }\n\n return $db;\n }", "private function getConnectionClass($dialect = null) {\r\n\t\t$dialect = $dialect = null ? \"MySQL\" : $dialect;\r\n\t\t\r\n\t\treturn \"PhpBURN_Connection_$dialect\";\r\n\t}", "public function resolveDatabase(string $name): string\n {\n return $this->resolveConnection('database', $name);\n }", "public function __get($name): Database\n {\n return $this->mongoConnection->$name;\n }", "public function getAdapterName()\n {\n return 'Db';\n }", "public function getDatabaseName(): string;", "public static function getDatabasePlatform(): string;", "public function getActualDatabaseName():string;", "public function getDatabaseName():string;", "public function getDatabaseType();", "public function getDatabaseType();", "function Sql_DBs_Get_Query()\n {\n $type=$this->DB_Dialect();\n\n $query=\"\";\n if ($type==\"mysql\")\n {\n $query=\n \"SHOW DATABASES\";\n }\n elseif ($type==\"pgsql\")\n {\n $query=\n \"SELECT datname FROM pg_database WHERE datistemplate = false;\";\n }\n\n return $query;\n }", "final public function getDBname() {\n \t\treturn $this->dbase;\n }", "public static function getDatabaseName()\n {\n }", "public function getEngine()\n {\n $adapter = $this->getAdapter();\n\n if ($adapter) {\n return $adapter;\n }\n\n return ucfirst($this->dsn->scheme);\n }", "public static function get($name){\n\t\tif($name instanceof dbDriver) return $name;\n $name = trim(strtolower($name));\n\n return isset(self::$connections[$name])\n ? self::$connections[$name]\n : NULL;\n }", "public function getDbAdapter($name = 'default')\n {\n if (!isset($this->_dbadapters[$name])) {\n try {\n $this->_dbadapters[$name] = Wacow_Application_Resource::getDbAdapter($this->_dbOptions->$name);\n } catch (Exception $e) {\n throw $e;\n }\n\n if ('default' === $name) {\n Zend_Db_Table::setDefaultAdapter($this->_dbadapters[$name]);\n }\n\n if (!$this->_app->debugMode) {\n $metacacheStorage = 'File';\n $metacacheLifetime = null;\n $metacacheOptions = array('cache_dir' => ':cachePath/tablemeta');\n if (isset($this->_dbOptions->$name->metacache)) {\n $metacacheSettings = $this->_dbOptions->$name->metacache;\n $metacacheStorage = isset($metacacheSettings->storage) ? $metacacheSettings->storage : 'File';\n $metacacheLifetime = isset($metacacheSettings->lifetime) ? (int) $metacacheSettings->lifetime : null;\n if (isset($metacacheSettings->options)) {\n $metacacheOptions = $metacacheSettings->options;\n }\n }\n\n $setting = array(\n 'frontendName' => 'Core',\n 'backendName' => $metacacheStorage,\n 'frontendOptions' => array('lifetime' => $metacacheLifetime, 'automatic_serialization' => true,),\n 'backendOptions' => Wacow_Application::translatePath($metacacheOptions)->toArray(),\n );\n $cache = Wacow_Application_Resource::getCache($setting);\n\n Zend_Db_Table::setDefaultMetadataCache($cache);\n }\n }\n return $this->_dbadapters[$name];\n }", "protected function getSelectedDbalDriver() {}", "public function getDBName():? string;", "public function getColumnType($name);", "public function getColumnType($name);", "function dbName()\n{\n\treturn $this->drv->dbName();\n}" ]
[ "0.699315", "0.6350169", "0.61974466", "0.6127134", "0.58990234", "0.586633", "0.579573", "0.5760412", "0.5720488", "0.5708397", "0.57035124", "0.56710124", "0.56692743", "0.5644595", "0.56394386", "0.55909723", "0.55571747", "0.55052096", "0.55052096", "0.55003923", "0.5481642", "0.5456229", "0.5442293", "0.54321986", "0.5431757", "0.5429937", "0.53970593", "0.5380423", "0.5380423", "0.53679854" ]
0.6639775
1
get tables from sql.
public function getTablesFromSQL($sql) { $p = '/CREATE\s+TABLE\s+(IF\s+NOT\s+EXISTS\s+)?([^\(]+)/mi'; $tables = []; $views = []; if (preg_match_all($p, $sql, $ms, PREG_SET_ORDER)) { foreach ($ms as $m) { if (count($m) == 3) { $table = $m [2]; } else { $table = $m [1]; } if ($table) { $table = trim(trim($table, '` ')); $tables [] = str_replace('{prefix}', $this->tablePrefix, $table); } } } $p = '/CREATE\s+VIEW\s+(IF\s+NOT\s+EXISTS\s+)?(.+?)\s+AS/mi'; if (preg_match_all($p, $sql, $ms, PREG_SET_ORDER)) { foreach ($ms as $m) { if (count($m) == 3) { $table = $m [2]; } else { $table = $m [1]; } if ($table) { $table = trim(trim($table, '` ')); $views [] = str_replace('{prefix}', $this->tablePrefix, $table); } } } return ['tables' => $tables, 'views' => $views]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function extractTableFromSQL($sql)\n {\n $exp = '/FROM `([^ \\(]*)`/ms';\n $returnArray = array();\n preg_match_all($exp, $sql, $matches);\n \n if(sizeof($matches) > 0 && sizeof($matches[0]) > 0)\n {\n foreach($matches[0] as $index => $value)\n {\n $returnArray = preg_replace($exp,'$1', $matches[0][$index]);\n }\n }\n else\n {\n $exp = '/UPDATE `([^ \\(]*)`/ms';\n $returnUpdateArray = array();\n preg_match_all($exp, $sql, $matches);\n\n if(sizeof($matches) > 0 && sizeof($matches[0]) > 0)\n {\n foreach($matches[0] as $index => $value)\n {\n $returnArray = preg_replace($exp,'$1', $matches[0][$index]);\n }\n }\n else\n {\n return '';\n }\n }\n \n return $returnArray;\n }", "public function getTables()\n {\n\treturn $this->query('select [name] from [tables]');\n }", "abstract public function getTables();", "public function getTables()\n {\n $sqlStm = \"SELECT TABLE_NAME as tableName,\n CASE TABLE_TYPE WHEN 'VIEW' THEN 'true'\n ELSE 'false'\n END as isView\n FROM information_schema.tables\n WHERE TABLE_SCHEMA = ?\";\n \n $query = new DataQuery($sqlStm);\n $param = new DataParameter('schema', DataParameter::TYPE_VARCHAR , $this->schema);\n return $this->query($query, array($param));\n }", "abstract protected function fetchTableNamesDb();", "public function getTables();", "public function getTables();", "public function getTables();", "function serendipity_parse_sql_tables($filename) {\n $in_table = 0;\n $queries = array();\n\n $fp = fopen($filename, 'r', 1);\n if ($fp) {\n while (!@feof($fp)) {\n $line = trim(fgets($fp, 4096));\n if ($in_table) {\n $def .= $line;\n if (preg_match('/^\\)\\s*(type\\=\\S+|\\{UTF_8\\})?\\s*\\;$/i', $line)) {\n $in_table = 0;\n array_push($queries, $def);\n }\n } else {\n if (preg_match('#^create table \\{PREFIX\\}\\S+\\s*\\(#i', $line)) {\n $in_table = 1;\n $def = $line;\n }\n\n if (preg_match('#^create\\s*(\\{fulltext\\}|unique|\\{fulltext_mysql\\})?\\s*index#i', $line)) {\n array_push($queries, $line);\n }\n }\n }\n fclose($fp);\n }\n\n return $queries;\n}", "function FindTables($strSQL, $bwlStripDatabase=true)\n{\n\t$strSQL=$strSQL . \" \";\n\t$strSQL=deMultiple($strSQL, \" \");\n\t$arrOut=Array();\n\tif(contains(strtolower($strSQL), \"insert into\"))\n\t{\n\t\t$strBeingSought=\"insert into\";\n\t\t$strSelectStatementKeywords=\"(\";\n\t\t$strEndKeywords=\"values (\";\n\t}\n\telse if(contains(strtolower($strSQL), \"create table\"))\n\t{\n\t\treturn Array(); //cop out on this case\n\t}\n\telse if(contains(strtolower($strSQL), \"drop table\"))\n\t{\n\t\treturn Array(); //cop out on this case\n\t}\n\telse if(contains(strtolower($strSQL), \"truncate table\"))\n\t{\n\t\treturn Array(); //cop out on this case\n\t}\n\telse\n\t{\n\t\t$strBeingSought=\"from\";\n\t\t$strSelectStatementKeywords=\"join\";\n\t\t$strEndKeywords=\"where group having order limit procedure into for\";\n\t}\n\t\n\t$strSelectStatementNixFollow=\"on\";\n\t$strSelectStatementNixPre=\"on join\";\n\t\n\t$bwlNixfollow=false;\n\t$out= FindSQLClause($strSQL, $strBeingSought, $strEndKeywords);\n\t//echo $strBeingSought . \" \" . $strEndKeywords . \"<br>\";\n\t//echo $out . \"==initialwhere<br>\";\n\t$out=trim($out);\n\t$tablecount=0;\n\t$intFromFromCounter=0; //counts how many terms are between the from statement and the on, join, or where\n\t//echo $out . \"==initialwhere<br>\";\n\t$out=AllWhiteSpaceToSpace($out);\n\t//echo $out . \"==initialwhere<br>\";\n\tif(contains($out, \"(\") && strpos($out, \"(\")>0)//seems to fix not-working for insert sql\n\t{\n\t\t$arrOut[0]=substr( $out, 0, strpos($out, \"(\"));\n\t}\n\telse if(contains($out, \" \"))\n\t{\n\t\t$out=deMultiple($out, \" \");//might want to leave whitespace in quoted areas alone in a future version\n\t\t$arrTable=explode(\" \", $out);\n\t\t\n\t\tforeach($arrTable as $thispart)\n\t\t{\n\t\t\t//echo $thispart . \"==thispart<br>\";\n\t\t\tif(PosInList($strSelectStatementNixPre, $thispart, \" \", true, $quotechar=\"'\")>-1)\n\t\t\t{ \n\t\t\t\t//echo \"prenix<br>\";\n\t\t\t\t//echo $intFromFromCounter . \"==fromfrom<br>\";\n\t\t\t\tif($intFromFromCounter==2) //in other words, if there is, due to the count of terms since the from, clearly a synonymn after the table name\n\t\t\t\t{\n\t\t\t\t\t//these sql terms mean what preceded was not a table\n\t\t\t\t\t//this code once assumed that join-containing sql will always have a synonym for the table after it \n\t\t\t\t\t//but it no longer has this liability\n\t\t\t\t\t$tablecount--;\n\t\t\t\t\tarray_pop($arrOut);\n\t\t\t\t\t//time to process $intFromFromCounter;\n\t\t\t\t}\n\t\t\t\t$intFromFromCounter=0;\n\t\t\t}\n\t\t\tif(PosInList($strSelectStatementKeywords, $thispart, \" \", true, $quotechar=\"'\")>-1)\n\t\t\t{\n\t\t\t\t$bwlNixfollow=false;\n\t\t\t\t//echo \"nixfollowfalse1<br>\";\n\t\t\t}\n\t\t\telse if(PosInList($strSelectStatementNixFollow, $thispart, \" \", true, $quotechar=\"'\")>-1)\n\t\t\t{\n\t\t\t\t//echo \"nixfollowtrue1<br>\";\n\t\t\t\t$bwlNixfollow=true;\n\t\t\t}\n\t\t\telse if(!$bwlNixfollow)\n\t\t\t{\n\t\t\t\t$intFromFromCounter++;\n\t\t\t\t$bwlNixfollow=false;\n\t\t\t\t$arrOut[$tablecount]=StripDBfromTableSpecIfThere($thispart, $bwlStripDatabase);\n\t\t\t\t$tablecount++;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//echo \"else<br>\";\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\t$arrOut[$tablecount]=StripDBfromTableSpecIfThere($out, $bwlStripDatabase);\n\t}\n\t//echo join(\"<br>\", $arrOut) . \"==tables<p>\";\n\treturn $arrOut;\n}", "public function getAllTables()\n {\n return $this->connection->select(\n $this->grammar->compileGetAllTables(\n $this->parseSearchPath(\n $this->connection->getConfig('search_path') ?: $this->connection->getConfig('schema')\n )\n )\n );\n }", "public function getAllTables()\n {\n return $this->connection->select(\n $this->grammar->compileGetAllTables((array) $this->connection->getConfig('schema'))\n );\n }", "protected function getAllTables()\n {\n return $this->getConnection()->select(\n $this->grammar->compileGetAllTables()\n );\n }", "function load_tables() {\n return $this->_load_tables('/oblyon/sql/');\n }", "protected function getDatabaseTables() {}", "abstract public function table_sql($tableName);", "function load_tables()\n\t{\n\t\treturn $this->_load_tables('/mydoliboard/sql/');\n\t}", "public function getTables() {\n $stmt = $this->pdo->query(\"SELECT table_name \n FROM information_schema.tables \n WHERE table_schema= 'public' \n AND table_type='BASE TABLE'\n ORDER BY table_name\");\n $tableList = [];\n while ($row = $stmt->fetch(\\PDO::FETCH_ASSOC)) {\n $tableList[] = $row['table_name'];\n }\n \n return $tableList;\n }", "abstract protected function _listTables();", "public static function getTables() {\n }", "protected function getTables() {\n \n $sm = $this->db->getSchemaManager();\n\n $tables = array(); \n \n foreach ($sm->listTables() as $table) {\n if ( strpos($table->getName(), $this->prefix) == 0 ) {\n foreach ($table->getColumns() as $column) {\n $tables[ $table->getName() ][ $column->getName() ] = $column->getType(); \n }\n // $output[] = \"Found table <tt>\" . $table->getName() . \"</tt>.\";\n }\n }\n \n return $tables;\n \n }", "function get_db_tables(){\n\t\tglobal $GonxAdmin;\n\t\t\n\t\t$result = @$this->list_tables($this->dbName);\n\t\tif (!$result) {\n\t\t print \"Erreur : impossible de lister les tables\\n\";\n\t\t print 'Erreur '.$GonxAdmin[\"dbtype\"].' : ' . $this->error();\n\t\t exit;\n\t\t}\n\t while ($row = $this->fetch_row($result)) {\n\t\t\t$Tables[] = $row[0];\n\t }\n\t\treturn $Tables;\t\t\n\t}", "public function getTables(){\n $pdo = $this->pdo;\n $statement = $pdo->prepare(\"SHOW TABLES FROM $this->name;\");\n $statement->execute();\n $tables = $statement->fetchAll($pdo::FETCH_NUM);\n foreach($tables as &$table)\n $table = $table[0];\n return $tables;\n }", "public function qsGetDbTables()\n {\n $sql = 'show tables';\n $d = $this->qExecPluck($sql);\n\n return $d;\n }", "function get_tables_from_db( ){\n\t\t\t$db_connect = mysql_connect($this->host,$this->username, $this->password);\n\t\t\t$tables = mysql_list_tables($this->db); \n\t\t\twhile($row = mysql_fetch_assoc($tables)){\n\t\t\t\tforeach($row as $k=>$v){\n\t\t \t\t\t$a_tables[]=$v;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $a_tables;\n\t\t}", "public function get_tables()\n\t{\n\t\treturn $this->driver_query('table_list');\n\t}", "public function getTableList()\n\t{\n\t\t$this->connect();\n\n\t\t$type = 'table';\n\n\t\t$query = $this->getQuery(true)\n\t\t\t->select('name')\n\t\t\t->from('sqlite_master')\n\t\t\t->where('type = :type')\n\t\t\t->bind(':type', $type)\n\t\t\t->order('name');\n\n\t\t$this->setQuery($query);\n\n\t\t$tables = $this->loadColumn();\n\n\t\treturn $tables;\n\t}", "public function &getTables();", "function create_table_list(){\n $tables = \"{$this->table_name}\";\n if(isset($this->joined_tables) && count($this->joined_tables)){\n foreach($this->joined_tables as $t){\n if(array_key_exists('TABLE', $t) && array_key_exists('ON', $t)){\n $type = (array_key_exists('TYPE', $t)? $t['TYPE']: \"INNER JOIN\");\n $tables .= \" $type {$t['TABLE']} ON {$t['ON']}\";\n }\n }\n }\n return $tables;\n }", "public function getTables()\n {\n return $this->callSql(\"\n SELECT\n *\n FROM\n SYSOBJECTS\n WHERE\n xtype = 'U';\n \");\n\n // Appears that DP has disabled the permissions required for the following query\n // prior to 2021-07-15\n // return $this->callSql(\"\n // SELECT\n // *\n // FROM\n // INFORMATION_SCHEMA.TABLES;\n // \");\n }" ]
[ "0.725672", "0.71201646", "0.70468926", "0.6941071", "0.6924225", "0.6909306", "0.6909306", "0.6909306", "0.68523043", "0.6825294", "0.6823202", "0.67989224", "0.6797344", "0.67838955", "0.677448", "0.6745986", "0.6706683", "0.6692747", "0.66828156", "0.6672765", "0.6665319", "0.66647846", "0.6660746", "0.66161984", "0.6615136", "0.65971035", "0.65942013", "0.6589249", "0.6586205", "0.65729755" ]
0.78507185
0
prepare the construct option, the return must be an array, detail listed following: 1. dsn 2. username 3. password 4. attributes
protected abstract function prepareConstructOption($options);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __prepare()\n {\n $config = $this->objectManager->get(\\Magento\\Mtf\\Config\\DataInterface::class);\n // Prepare config data\n $configData['dbHost'] = $config->get('install/0/host/0');\n $configData['dbUser'] = $config->get('install/0/user/0');\n $configData['dbPassword'] = $config->get('install/0/password/0');\n $configData['dbName'] = $config->get('install/0/dbName/0');\n $configData['baseUrl'] = $config->get('install/0/baseUrl/0');\n $configData['admin'] = $config->get('install/0/backendName/0');\n\n return ['configData' => $configData];\n }", "public function __construct($userData = array()){\n if(isset($userData['name'])) $this->userName = $userData['name'];\n if(isset($userData['email'])) $this->userEmail = $userData['email'];\n if(isset($userData['pass'])) $this->userPass = $userData['pass'];\n if(isset($userData['confirmPass'])) $this->confirmPass = $userData['confirmPass'];\n\n // try \n // {\n // $con = new PDO(DB_DSN, DB_USERNAME, DB_PASSWORD);\n // $con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n \n // } \n // catch (PDOException $e) {\n // echo \"Error : \" . $e->getMessage() . \"<br/>\";\n // die();\n // }\n }", "private function getCrendentials()\n {\n $db = parse_ini_file('db.ini');\n $this->username = $db['user'];\n $this->password = $db['password'];\n $this->host = $db['host'];\n $this->dbname = $db['dbname'];\n }", "function buildOptionsCreate()\n {\n if (empty($this->uid))\n throw new \\Exception(\"A uid is required.\");\n \n $options = [\n BuildRequestOptions::VERB => \\Validic\\RequestVerbs::POST,\n BuildRequestOptions::BODY => [\n 'user' => [\n UserOptions::UID => (string) $this->uid,\n 'profile' => [\n UserOptions::BIRTH_YEAR => $this->birth_year,\n UserOptions::LOCATION => $this->location,\n UserOptions::COUNTRY => $this->country,\n UserOptions::WEIGHT => $this->weight,\n UserOptions::HEIGHT => $this->height,\n UserOptions::GENDER => $this->gender\n ]\n ]\n ]\n ];\n \n return [\n new Endpoint\\UsersEndpoint(),\n $options\n ];\n }", "function __construct($form) {\n if (sizeof($form) > 2) {\n $this->fname = $form[0];\n $this->lname = $form[1];\n $this->email = $form[2];\n $this->password = $form[3];\n $this->passwordConf = $form[4];\n } else {\n $this->email = $form[0];\n $this->password = $form[1];\n }\n }", "abstract protected function _createDsn(array $params);", "private function constructArguments()\r\n\t{\r\n\t\t$arguments = \"-q on \";\r\n\r\n\t\tif ($this->title)\r\n\t\t{\r\n\t\t\t$arguments.= \"-ti \\\"\" . $this->title . \"\\\" \";\r\n\t\t}\r\n\r\n\t\tif ($this->destdir)\r\n\t\t{\r\n\t\t\t$arguments.= \"-t \\\"\" . $this->destdir . \"\\\" \";\r\n\t\t}\r\n\r\n\t\tif ($this->sourcepath !== NULL)\r\n\t\t{\r\n\t\t\t$arguments.= \"-d \\\"\" . $this->sourcepath->__toString() . \"\\\" \";\r\n\t\t}\r\n\r\n\t\tif ($this->output)\r\n\t\t{\r\n\t\t\t$arguments.= \"-o \" . $this->output . \" \";\r\n\t\t}\r\n\r\n\t\tif ($this->linksource)\r\n\t\t{\r\n\t\t\t$arguments.= \"-s on \";\r\n\t\t}\r\n\r\n\t\tif ($this->parseprivate)\r\n\t\t{\r\n\t\t\t$arguments.= \"-pp on \";\r\n\t\t}\r\n\r\n\t\treturn $arguments;\r\n\t}", "public function __construct()\n {\n if (13 == func_num_args()) {\n $this->name = func_get_arg(0);\n $this->mvaNumber = func_get_arg(1);\n $this->companyPhone = func_get_arg(2);\n $this->companyEmail = func_get_arg(3);\n $this->id = func_get_arg(4);\n $this->customerNumber = func_get_arg(5);\n $this->resources = func_get_arg(6);\n $this->companyUrl = func_get_arg(7);\n $this->contact = func_get_arg(8);\n $this->address = func_get_arg(9);\n $this->dealer = func_get_arg(10);\n $this->settings = func_get_arg(11);\n $this->country = func_get_arg(12);\n }\n }", "public function construct(\n $P_customer_Id = \"\",//setting the values of customerid in the private field\n $P_first_Name = \"\",//setting the values of first name in the private field\n $P_last_Name = \"\",//setting the values of lastname in the private field\n $P_City = \"\",//setting the values of city in the private field\n $P_Province = \"\",//setting the values of province in the private field\n $P_postal_Code = \"\",//setting the values of postal codein the private field\n $P_user_Name = \"\",//setting the values of username in the private field\n $P_Password = \"\"//setting the values of password in the private field\n ) {\n\n // ####################################### setting the values of constructor in the parameters ###################################### // \n\n if ($P_customer_Id != \"\") {\n $this->customer_Id = $P_customer_Id;//setting the values of constructor in the parameters\n $this->first_Name = $P_first_Name;//setting the values of constructor in the parameters\n $this->last_Name = $P_last_Name;\n $this->City = $P_City; \n $this->Province = $P_Province;\n $this->postal_Code = $P_postal_Code;\n $this->user_Name = $P_user_Name;\n $this->user_Password = $P_Password;//setting the values of constructor in the parameters\n }\n }", "public static function provideValidConfigurationForConstructor()\n {\n $conf = new stdClass();\n $conf->zadgcjmt = 'wntQeayy41';\n return [\n [$conf],\n [json_encode($conf)],\n [json_decode(json_encode($conf), true)]\n ];\n }", "private function normalizeCredential($raw)\n {\n $credential = array();\n $credential['id'] = strval($raw->Name);\n foreach($raw->Attribute as $item)\n {\n $name = (string)$item->Name;\n $value = (string)$item->Value;\n if($name == 'permissions')\n $credential[$name] = (array)explode(',', $value);\n else\n $credential[$name] = $value;\n }\n return $credential;\n }", "public function __construct() {\n// $this->db['server'] = $args['server'];\n// $this->db['username'] = $args['username'];\n// $this->db['password'] = $args['password'];\n// $this->db['database'] = $args['database'];\n $this->open_connection();\n }", "public function __construct()\n {\n if (11 == func_num_args()) {\n $this->valid = func_get_arg(0);\n $this->country = func_get_arg(1);\n $this->providerType = func_get_arg(2);\n $this->countryCode = func_get_arg(3);\n $this->hostname = func_get_arg(4);\n $this->providerDomain = func_get_arg(5);\n $this->city = func_get_arg(6);\n $this->providerWebsite = func_get_arg(7);\n $this->ip = func_get_arg(8);\n $this->region = func_get_arg(9);\n $this->providerDescription = func_get_arg(10);\n }\n }", "protected function _constructDsn(array $params)\n {\n return $this->getEasyConnectString($params);\n }", "private function __construct(){\n\n $conf= parse_ini_file(MODEL_PATH.\"db.ini\");\n $this->_user=$conf['user'];\n $this->_pass=$conf['password'];\n $this->_host=$conf['host'];\n $this->_db=$conf['db'];\n $this->_port=$conf['port'];\n\n }", "function user_create($attributes){\n //check for compulsory fields\n if (!array_key_exists(\"username\",$attributes)){ return (\"Missing compulsory field [username]\"); }\n if (!array_key_exists(\"firstname\",$attributes)){ return (\"Missing compulsory field [firstname]\"); }\n if (!array_key_exists(\"surname\",$attributes)){ return (\"Missing compulsory field [surname]\"); }\n if (!array_key_exists(\"email\",$attributes)){ return (\"Missing compulsory field [email]\"); }\n if (!array_key_exists(\"container\",$attributes)){ return (\"Missing compulsory field [container]\"); }\n if (!is_array($attributes[\"container\"])){ return (\"Container attribute must be an array.\"); }\n\n if (array_key_exists(\"password\",$attributes) && !$this->_use_ssl){ \n // Modified by SysCo/al\n $this->_error = TRUE;\n $this->_error_message = 'FATAL: SSL must be configured on your webserver and enabled in the class to set passwords.';\n exit();\n }\n\n if (!array_key_exists(\"display_name\",$attributes)){ $attributes[\"display_name\"]=$attributes[\"firstname\"].\" \".$attributes[\"surname\"]; }\n\n //translate the schema\n $add=$this->adldap_schema($attributes);\n \n //additional stuff only used for adding accounts\n $add[\"cn\"][0]=$attributes[\"display_name\"];\n $add[$this->_cn_identifier][0]=$attributes[\"username\"];\n $add[\"objectclass\"][0]=\"top\";\n $add[\"objectclass\"][1]=\"person\";\n $add[\"objectclass\"][2]=\"organizationalPerson\";\n $add[\"objectclass\"][3]=\"user\"; //person?\n //$add[\"name\"][0]=$attributes[\"firstname\"].\" \".$attributes[\"surname\"];\n\n //set the account control attribute\n $control_options=array(\"NORMAL_ACCOUNT\");\n if (!$attributes[\"enabled\"]){ $control_options[]=\"ACCOUNTDISABLE\"; }\n $add[\"userAccountControl\"][0]=$this->account_control($control_options);\n //echo (\"<pre>\"); print_r($add);\n\n //determine the container\n $attributes[\"container\"]=array_reverse($attributes[\"container\"]);\n $container=\"OU=\".implode(\",OU=\",$attributes[\"container\"]);\n\n //add the entry\n $result=@ldap_add($this->_conn, \"CN=\".$add[\"cn\"][0].\", \".$container.\",\".$this->_base_dn, $add);\n if ($result!=true){ return (false); }\n \n return (true);\n }", "function get_object_credentials() {\n\t\treturn array(\n\t\t\t'host' => $this->host,\n\t\t\t'port' => $this->port,\n\t\t\t'dbname' => $this->dbName,\n\t\t\t'user' => $this->user,\n\t\t\t'password' => $this->passwd\n\t\t);\n\t}", "protected abstract function initializeAttributes(): array;", "public function __construct($args){\r\n\t\t\t$this->userName= $args[0];\r\n\t\t\t$this->password= $args[1];\r\n\t\t\t$this->level= $args[2];\r\n\t\t\t$this->name= $args[3];\r\n\t\t\t$this->lastName= $args[4];\r\n\t\t\t$this->email= $args[5];\r\n\t\t\t$this->image= $args[6];\r\n\t\t\t$this->active= $args[7];\r\n\t\t\t$this->idUser= $args[8];\r\n\t\t\t//Variable de conexión\r\n\t\t\t$this->con= new csConexion();\r\n\t\t}", "function __construct($access,$user,$pass) {\n\t$this->AccessLicenseNumber = $access;\n\t$this->UserID = $user;\n\t$this->Password = $pass;\t\n\t$this->credentials = 1;\n }", "private function get_options() {\r\n\t\ttry {\r\n\t\t\t$options = array(\r\n\t\t\t\t'auth' => new Basic( array( $this->consumer_key, $this->consumer_secret ) )\r\n\t\t\t);\r\n\t\t} catch ( \\Exception $e ) {\r\n\t\t\t$options = array();\r\n\t\t}\r\n\r\n\t\treturn $options;\r\n\t}", "function __construct($para1,$para2){\n $this->connection=connect_db();\n $this->user=$para1;\n $this->pass=$para2;\n }", "function prepareOptionsForWriting()\n {\n $content = $this->bindFields();\n $filename = $this->prepareFile();\n return (object)compact('content','filename');\n }", "public function __construct($dsn, $user = null, $password = null, array $options = array()) {\r\n\t\tif (is_array($dsn)) {\r\n\t\t\t//extract params\r\n\t\t\textract($dsn);\r\n\t\t\t$params = array('name', 'user', 'password', 'options', 'dbtype', 'driver', 'database', 'username');\r\n\t\t\tforeach ($params as $param) {\r\n\t\t\t\tif (isset($dsn[$param])) {\r\n\t\t\t\t\t$$param = $dsn[$param];\r\n\t\t\t\t\tunset($dsn[$param]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//alias\r\n\t\t\tif (isset($database)) {\r\n\t\t\t\t$dbname = $database;\r\n\t\t\t\t$dsn['dbname'] = $database;\r\n\t\t\t}\r\n\t\t\tif (isset($driver)) {\r\n\t\t\t\t$dbtype = $driver;\r\n\t\t\t}\r\n\t\t\tif (isset($username)) {\r\n\t\t\t\t$user = $username;\r\n\t\t\t}\r\n\r\n\t\t\t//default host\r\n\t\t\tif (isset($dbtype) && in_array($dbtype, array('mysql'))) {\r\n\t\t\t\tif (!isset($dsn['host'])) {\r\n\t\t\t\t\t$dsn['host'] = 'localhost';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//flatten array, except for sqlite which pass just a string without keys\r\n\t\t\tforeach ($dsn as $k => $v) {\r\n\t\t\t\tif (!is_int($k)) {\r\n\t\t\t\t\t$dsn[$k] = $k . '=' . $v;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (isset($name)) {\r\n\t\t\t\t$this->setName($name);\r\n\t\t\t}\r\n\r\n\t\t\t//{dbtype}:dbname={dbname};host={host};port={port}\r\n\t\t\t$dsn = $dbtype . ':' . implode(';', array_values($dsn));\r\n\t\t} else {\r\n\t\t\t$params = self::parseDsn($dsn);\r\n\t\t\textract($params);\r\n\t\t}\r\n\r\n\t\t$this->setDsn($dsn);\r\n\t\t$this->setDbtype($dbtype);\r\n\t\tif (isset($dbname)) {\r\n\t\t\t$this->setDbname($dbname);\r\n\t\t}\r\n\t\t$this->setUser($user);\r\n\t\t$this->setPassword($password);\r\n\t\t$this->setOptions($options);\r\n\r\n\t\t//store in registry\r\n\t\tif (empty(self::$instances)) {\r\n\t\t\tself::$instances['default'] = $this;\r\n\t\t}\r\n\t\tself::$instances[$this->getName()] = $this;\r\n\t}", "public function __construct($_loginId = NULL,$_password = NULL,$_licenseKey = NULL,$_accountNumber = NULL)\n {\n parent::__construct(array('loginId'=>$_loginId,'password'=>$_password,'licenseKey'=>$_licenseKey,'accountNumber'=>$_accountNumber),false);\n }", "function _prepare(){\t\r\r\n\t\t// init array\r\r\n\t\t$this->options = array();\t\r\r\n\t\t// to be saved vars\r\r\n\t\t$vars = array('active_modules','active_plugins','setting');\r\r\n\t\t// set\r\r\n\t\tforeach($vars as $var){\r\r\n\t\t\t// var\r\r\n\t\t\t$this->options[$var] = $this->{$var};\r\r\n\t\t}\t\r\r\n\t}", "function __construct() {\n $this->schema = new Arcanum_LdapSchema();\n \n $this->attributes = &$this->schema->attributes;\n $this->pwAttributes = &$this->schema->pwAttributes;\n $this->policyAttributes = &$this->schema->policyAttributes;\n }", "protected function prepareGetOptions(): array\n {\n return [\n 'http' => [\n 'header' => \"Content-Type: application/x-www-form-urlencoded\\r\\n\" .\n \"User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0\\r\\n\" .\n ($this->sessionId !== '' ? \"Cgi-Authorization: Basic \" . $this->sessionId . \"\\r\\n\" : '') .\n ($this->headers !== null ? implode(\"\\r\\n\", $this->headers) . \"\\r\\n\" : ''),\n 'method' => 'GET'\n ]\n ];\n }", "public function __construct()\n {\n # no args = no further setup\n if (func_num_args() == 0) return;\n\n # use this to work out whether an arg refers to an Orm name\n $name_specified = 0;\n\n if (is_array($input = func_get_arg(0))) { # array = new object with initial values\n if (func_num_args() == 2)\n $name_specified = 1;\n\n foreach($input as $key => $val)\n $this->$key = $val;\n\n }\n\n if ($name_specified > 0) {\n $this->setup_name = func_get_arg($name_specified);\n }\n }", "public function user_create($attributes){\n // Check for compulsory fields\n if (!array_key_exists(\"username\",$attributes)){ return (\"Missing compulsory field [username]\"); }\n if (!array_key_exists(\"firstname\",$attributes)){ return (\"Missing compulsory field [firstname]\"); }\n if (!array_key_exists(\"surname\",$attributes)){ return (\"Missing compulsory field [surname]\"); }\n if (!array_key_exists(\"email\",$attributes)){ return (\"Missing compulsory field [email]\"); }\n if (!array_key_exists(\"container\",$attributes)){ return (\"Missing compulsory field [container]\"); }\n if (!is_array($attributes[\"container\"])){ return (\"Container attribute must be an array.\"); }\n\n if (array_key_exists(\"password\",$attributes) && (!$this->_use_ssl && !$this->_use_tls)){ \n throw new adLDAPException('SSL must be configured on your webserver and enabled in the class to set passwords.');\n }\n\n if (!array_key_exists(\"display_name\",$attributes)){ $attributes[\"display_name\"]=$attributes[\"firstname\"].\" \".$attributes[\"surname\"]; }\n\n // Translate the schema\n $add=$this->adldap_schema($attributes);\n \n // Additional stuff only used for adding accounts\n if (isset($attributes['cn'])) {\n \t$add['cn'][0]=$attributes['cn']; // EXTENDED by CST\n } else {\n \t$add[\"cn\"][0]=$attributes[\"display_name\"];\n }\n $add[\"samaccountname\"][0]=$attributes[\"username\"];\n $add[\"objectclass\"][0]=\"top\";\n $add[\"objectclass\"][1]=\"person\";\n $add[\"objectclass\"][2]=\"organizationalPerson\";\n $add[\"objectclass\"][3]=\"user\"; //person?\n //$add[\"name\"][0]=$attributes[\"firstname\"].\" \".$attributes[\"surname\"];\n\n // Set the account control attribute\n $control_options=array(\"NORMAL_ACCOUNT\");\n if (!$attributes['enabled']){ $control_options[]=\"ACCOUNTDISABLE\"; }\n $add[\"userAccountControl\"][0]=$this->account_control($control_options);\n //echo (\"<pre>\"); print_r($add);\n\n // Determine the container\n $attributes[\"container\"]=array_reverse($attributes[\"container\"]);\n $container=\"OU=\".implode(\",OU=\",$attributes[\"container\"]);\t\t\n\t\t\n\t\t// Add the entry\n\t\t$result=@ldap_add($this->_conn, \"CN=\".$add[\"cn\"][0].\", \".$container.\",\".$this->_base_dn, $add); \n if ($result!=true){ return (false); }\n\t\t\n return (true);\n }" ]
[ "0.5693056", "0.5667948", "0.56362", "0.54007214", "0.5344699", "0.52967834", "0.5296761", "0.52924156", "0.52923363", "0.5269157", "0.5186274", "0.517668", "0.5152879", "0.5145119", "0.5135245", "0.5105635", "0.50924253", "0.50898397", "0.5080261", "0.50792956", "0.5071352", "0.5069995", "0.50680405", "0.5054335", "0.50513077", "0.5046217", "0.50422364", "0.5041514", "0.50404644", "0.5040268" ]
0.6144704
0
Load fixtures of these bundles.
protected static function loadFixturesBundles() { return [ 'ElcodiCartBundle', 'ElcodiCouponBundle', 'ElcodiProductBundle', 'ElcodiCurrencyBundle', ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function myLoadFixtures()\n {\n $em = $this->getDatabaseManager();\n\n // load fixtures\n $client = static::createClient();\n $classes = array(\n // classes implementing Doctrine\\Common\\DataFixtures\\FixtureInterface\n 'Demofony2\\AppBundle\\DataFixtures\\ORM\\FixturesLoader',\n );\n\n $this->loadFixtures($classes);\n }", "protected static function loadFixturesBundles()\n {\n return [\n 'ProductBundle',\n ];\n }", "protected function loadFixturesBundles()\n {\n return [\n 'ElcodiUserBundle',\n 'ElcodiCurrencyBundle',\n 'ElcodiAttributeBundle',\n 'ElcodiProductBundle',\n 'ElcodiCurrencyBundle',\n 'ElcodiCartBundle',\n 'ElcodiCouponBundle',\n 'ElcodiRuleBundle',\n ];\n }", "public function testFixtureLoadOnDemand(): void\n {\n $this->loadFixtures('Categories');\n }", "protected function loadFixturesBundles()\n {\n return false;\n }", "public function load(ObjectManager $manager)\n {\n // Fixtures are split into separate files\n }", "public function testLoadAllFixtures(): void\n {\n $this->loadFixtures();\n $article = $this->getTableLocator()->get('Articles')->get(1);\n $this->assertSame(1, $article->id);\n $category = $this->getTableLocator()->get('Categories')->get(1);\n $this->assertSame(1, $category->id);\n }", "protected function loadBundles()\n {\n /**\n * @var $bundle BundleInterface\n */\n foreach (static::$bundles as $bundle) {\n $bundle->init($this);\n }\n }", "public static function loadProductFixtures(): void\n {\n include __DIR__ . '/../../../_files/productFixtures.php';\n }", "public static function loadStockFixtures(): void\n {\n include __DIR__ . '/../../../_files/stockFixtures.php';\n }", "public function setupFixtures()\n {\n if ($this->_fixtures === null) {\n $loadedFixtures = [];\n foreach ($this->fixtures() as $fixtureClass) {\n $loadedFixtures[$fixtureClass] = Yii::createObject($fixtureClass);\n }\n\n $this->_fixtures = $loadedFixtures;\n }\n }", "protected function createFixtures()\n {\n // Due to a dubious bug(?) in doctrine - product types need to be loaded first.\n $typeFixtures = new LoadProductTypes();\n $typeFixtures->load($this->entityManager);\n $this->productType = $this->getProductTypeRepository()->find(self::PRODUCT_TYPE_ID);\n $this->addonProductType = $this->getProductTypeRepository()->find(self::PRODUCT_TYPE_ADDON_ID);\n\n $countries = new LoadCountries();\n $countries->load($this->entityManager);\n\n $this->contactTestData = new ContactTestData($this->container);\n\n $loadCurrencies = new LoadCurrencies();\n $loadCurrencies->load($this->entityManager);\n\n $this->currency = $this->getCurrencyRepository()->findByCode($this->defaultCurrencyCode);\n\n $unitFixtures = new LoadUnits();\n $unitFixtures->load($this->entityManager);\n $this->orderUnit = $this->getProductUnitRepository()->find(self::ORDER_UNIT_ID);\n\n $this->contentUnit = $this->getProductUnitRepository()->find(self::CONTENT_UNIT_ID);\n\n $taxClasses = new LoadTaxClasses();\n $taxClasses->load($this->entityManager);\n $this->taxClass = $this->getTaxClassRepository()->find(self::TAX_CLASS_ID);\n\n $countryTaxes = new LoadCountryTaxes();\n $countryTaxes->load($this->entityManager);\n\n $collectionTypes = new LoadCollectionTypes();\n $collectionTypes->load($this->entityManager);\n\n $mediaTypes = new LoadMediaTypes();\n $mediaTypes->load($this->entityManager);\n\n $attributeTypes = new LoadAttributeTypes();\n $attributeTypes->load($this->entityManager);\n $this->attributeType = $this->getAttributeTypeRepository()->find(self::ATTRIBUTE_TYPE_ID);\n\n $statusFixtures = new LoadProductStatuses();\n $statusFixtures->load($this->entityManager);\n $this->productStatus = $this->getProductStatusRepository()->find(Status::ACTIVE);\n $this->productStatusChanged = $this->getProductStatusRepository()->find(Status::CHANGED);\n $this->productStatusImported = $this->getProductStatusRepository()->find(Status::IMPORTED);\n $this->productStatusSubmitted = $this->getProductStatusRepository()->find(Status::SUBMITTED);\n\n $deliveryStatusFixtures = new LoadDeliveryStatuses();\n $deliveryStatusFixtures->load($this->entityManager);\n }", "protected function getFixtures()\n {\n return array(\n // __DIR__ . '/../../Resources/fixtures/majora_entitys.yml',\n );\n }", "protected function getFixtures()\n {\n return array(\n __DIR__ . '/../../Resources/fixtures/BlogArticle.yml',\n );\n }", "public static function loadFixture()\n {\n //include __DIR__ .'/../_files/customer.php';\n include __DIR__ .'/../_files/order_fee_variation.php';\n\n }", "public static function loadInventoryFixtures(): void\n {\n include __DIR__ . '/../../../_files/source_items_on_default_source.php';\n }", "public static function loadWebsiteFixtures(): void\n {\n include __DIR__ . '/../../../_files/websiteFixtures.php';\n }", "public static function loadWebsiteFixtures(): void\n {\n include __DIR__ . '/../../../_files/websiteFixtures.php';\n }", "protected function getFixtures()\n {\n return array(\n __DIR__ . '/card.yml',\n );\n }", "public function load(ObjectManager $manager)\n {\n /**\n * Ingredients fixtures\n */\n\n // Ingredients List\n// $ingredientsList = array(\n// 'Cereals' => ['シリアル', 'cereals.jpg', 0],\n// 'Dairy' => ['乳製品', 'dairy.jpg', 0],\n// 'Fruits' => ['果物', 'fruits.jpg', 0],\n// 'Meat' => ['肉', 'meat.jpg', 0],\n// 'Nuts, seeds & oils' => ['ナツ、油', 'nuts-seeds-oils.jpg', 0],\n// 'Other ingredients' => ['その他', 'other-ingredients.jpg', 0],\n// 'Seafood' => ['シーフード', 'seafood.jpg', 0],\n// 'Spices & herbs' => ['スパイス&ハーブ', 'spices-and-herbs.jpg', 0],\n// 'Sugar products' => ['砂糖', 'sugar-products.jpg', 0],\n// 'Vegetables' => ['野菜', 'vegetables.jpg', 0]\n// );\n//\n// foreach ($ingredientsList as $key => $ingredient) {\n// $ingredientDb = new Ingredient();\n// $ingredientDb->setName($key);\n// $ingredientDb->setNameJa($ingredient[0]);\n// $ingredientDb->setImage($ingredient[1]);\n// $ingredientDb->setParent($ingredient[2]);\n//\n// $manager->persist($ingredientDb);\n// $manager->flush();\n// }\n\n// $parentPath = \"web/images/ingredients\";\n// $parentDir = new DirectoryIterator(dirname($parentPath.\"/*\"));\n// $filetypes = array(\"jpg\", \"png\");\n//\n// foreach ($parentDir as $fileParentInfo) {\n// if (!$fileParentInfo->isDot() && $fileParentInfo->isFile()) {\n//\n// $fullName = str_replace('-',' ', ucfirst(substr($fileParentInfo->getFilename(), 0, -4)));\n// $ingredientDb = new Ingredient();\n// $ingredientDb->setName($fullName);\n//\n// $ingredientDb->setImage($fileParentInfo->getFilename());\n// $ingredientDb->setParent(0);\n// $manager->persist($ingredientDb);\n// $manager->flush();\n//\n// $childPath = $parentPath.'/'.$fullName.'/*';\n// $currentId = $ingredientDb->getId();\n// $childDir = new DirectoryIterator(dirname($childPath));\n//\n// foreach ($childDir as $fileinfo) {\n// if (!$fileinfo->isDot() && $fileinfo->isFile() && in_array(strtolower($fileinfo->getExtension()), $filetypes)) {\n// var_dump($fileinfo->getFilename());\n//\n// $childFullName = str_replace('-',' ', ucfirst(substr($fileinfo->getFilename(), 0, -4)));\n// $ingredientDb = new Ingredient();\n// $ingredientDb->setName($childFullName);\n// $ingredientDb->setImage($fullName.'/'.$fileinfo->getFilename());\n// $ingredientDb->setParent($currentId);\n//\n// $manager->persist($ingredientDb);\n// $manager->flush();\n//\n// }\n// }\n// }\n// }\n\n\n// $dir = new DirectoryIterator(dirname(\"web/images/ingredients/vegetables/*\"));\n//\n//\n//\n// foreach ($dir as $fileinfo) {\n// if (!$fileinfo->isDot() && $fileinfo->isFile() && in_array(strtolower($fileinfo->getExtension()), $filetypes)) {\n//\n// $fullName = str_replace('-',' ', ucfirst(substr($fileinfo->getFilename(), 0, -4)));\n// $ingredientDb = new Ingredient();\n// $ingredientDb->setName($fullName);\n//// $ingredientDb->setNameJa($ingredient[0]);\n// $ingredientDb->setImage($fileinfo->getFilename());\n// $ingredientDb->setParent(10);\n////\n// $manager->persist($ingredientDb);\n// $manager->flush();\n//\n// }\n// }\n\n }", "public static function loadWebsiteFixtures()\n {\n include __DIR__ . '/../../../_files/websiteFixtures.php';\n }", "public static function loadWebsiteFixtures()\n {\n include __DIR__ . '/../../../_files/websiteFixtures.php';\n }", "protected function loadFixtures()\n {\n if (!$this->hasFixturesBundles()) {\n return $this;\n }\n\n $bundles = static::$kernel->getBundles();\n $formattedBundles = array_map(function ($bundle) use ($bundles) {\n return $bundles[$bundle]->getPath() . '/DataFixtures/ORM/';\n }, $this->loadFixturesBundles());\n\n self::$application->run(new ArrayInput([\n 'command' => 'doctrine:fixtures:load',\n '--no-interaction' => true,\n '--fixtures' => $formattedBundles,\n '--quiet' => true,\n ]));\n\n return $this;\n }", "public static function loadUserFixtures()\n {\n include __DIR__ . '/../../../_files/adminUserFixtures.php';\n }", "protected function reloadDataFixtures()\n {\n $em = $this->getEntityManager();\n $loader = new Loader;\n foreach ($this->dataFixturePaths as $path) {\n $loader->loadFromDirectory($path);\n }\n $purger = new ORMPurger($em);\n $executor = new ORMExecutor($em, $purger);\n $executor->execute($loader->getFixtures());\n $this->fixturesReloaded = true;\n }", "public function load()\n {\n $this\n ->objectManager\n ->createQuery('DELETE FROM ' . Member::class)\n ->execute()\n ;\n Fixtures::load(\n __DIR__ . '/../../fixtures/members.yml',\n $this->objectManager\n );\n }", "public function load(ObjectManager $manager)\n {\n// $band->setName('Obituary' . rand(1, 100));\n// $band->setSubGenre('Death Metal');\n//\n// $manager->persist($band);\n// $manager->flush();\n \n Fixtures::load(__DIR__.'/fixtures.yml', $manager, [ 'providers' => [$this] ]);\n \n }", "public function setUp()\n {\n $this->loadFixtures([]);\n }", "public function loadFixtures($path) : void\n {\n /** @var EntityManager $em */\n $em = $this->getApplicationServiceLocator()->get(EntityManager::class);\n $em->getConnection()->exec('SET foreign_key_checks = 0');\n $loader = new Loader();\n $loader->loadFromDirectory($path);\n $purger = new ORMPurger($em);\n $purger->setPurgeMode(ORMPurger::PURGE_MODE_TRUNCATE);\n $executor = new ORMExecutor($em, $purger);\n $executor->execute($loader->getFixtures());\n $em->getConnection()->exec('SET foreign_key_checks = 1');\n }", "public static function loadProductFixturesRollback(): void\n {\n include __DIR__ . '/../../../_files/productFixtures_rollback.php';\n }" ]
[ "0.78945607", "0.77032495", "0.7677805", "0.72640926", "0.71303284", "0.712486", "0.7074356", "0.70469743", "0.7042796", "0.7001662", "0.69973683", "0.6990141", "0.6967831", "0.6829711", "0.679635", "0.6784148", "0.6706207", "0.6706207", "0.6699147", "0.6697859", "0.66949654", "0.66949654", "0.6687988", "0.66671914", "0.6657413", "0.658522", "0.6469617", "0.64427745", "0.63866645", "0.6273663" ]
0.78686774
1
Ensures that the passed value is a PdfStream instance.
public static function ensure($stream) { return PdfType::ensureType(self::class, $stream, 'Stream value expected.'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function ConvertToPdfStreamRequest(Requests\\ConvertToPdfStreamRequest $request)\n {\n\n $resourcePath = '/conversion/pdf/stream';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = \"\";\n $multipart = false;\n \n\n \n \n $resourcePath = $this->_parseURL($resourcePath, $queryParams);\n\n // body params\n $_tempBody = null;\n if (isset($request->settings)) {\n if (is_string($request->settings)) {\n $_tempBody = \"\\\"\" . $request->settings . \"\\\"\"; \n } else {\n $_tempBody = $request->settings;\n }\n }\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'application/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/xml'],\n ['application/json', 'application/xml']\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 = $formParams[\"data\"];\n }\n }\n \n $this->_requestToken();\n\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['x-groupdocs-client'] = $this->config->getUserAgent();\n }\n \n $defaultHeaders['x-groupdocs-client-version'] = $this->config->getClientVersion();\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n \n $req = new Request(\n 'POST',\n $this->config->getHost() . $resourcePath,\n $headers,\n $httpBody\n );\n if ($this->config->getDebug()) {\n $this->_writeRequestLog('POST', $this->config->getHost() . $resourcePath, $headers, $httpBody);\n }\n \n return $req;\n }", "abstract protected function doesSupportStreamWrapper();", "public function getContent(): ?StreamInterface {\n $val = $this->getBackingStore()->get('content');\n if (is_null($val) || $val instanceof StreamInterface) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'content'\");\n }", "public function testGetStreamTypeFailure()\n {\n $this->expectException(\\RuntimeException::class);\n $this->expectExceptionMessage(\n sprintf(\n 'The \"%s::getStream\" expect the file array key to be an instance of \"SplFileInfo\". \"stdClass\" given',\n FileInfoStreamFactory::class\n )\n );\n\n $object = new \\stdClass();\n $instance = new FileInfoStreamFactory();\n $instance->getStream([FileInfoStreamFactory::getArrayKey() => $object]);\n }", "function convertStringToStream($text, $out_stream) {\n if (!($text != null && $text !== ''))\n throw new Error(create_invalid_value_message($text, \"text\", \"html-to-pdf\", \"The string must not be empty.\", \"convert_string_to_stream\"), 470);\n \n $this->fields['text'] = $text;\n $this->helper->post($this->fields, $this->files, $this->raw_data, $out_stream);\n }", "public function getExtractedTextContent(): ?StreamInterface {\n $val = $this->getBackingStore()->get('extractedTextContent');\n if (is_null($val) || $val instanceof StreamInterface) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'extractedTextContent'\");\n }", "public function getStreamObject() {}", "public function serialize($value, $stream) {\n throw new FormatUnsupported('Cannot serialize '.($this->mime ? 'to '.$this->mime : 'without mime type'));\n }", "public static function castFrom($value): InputStream\n {\n if ($value instanceof InputStream) {\n return $value;\n }\n\n if (is_string($value)) {\n return new self($value);\n }\n\n throw new \\InvalidArgumentException(\n 'Given value is neither an instance of' . InputStream::class\n . ' nor a string denoting a file'\n );\n }", "public function pdf($value) {\n return $this->setProperty('pdf', $value);\n }", "protected function doesSupportStreamWrapper()\n {\n return false;\n }", "public static function ensureObject($value)\n\t{\n\t\treturn (object)$value;\n\t}", "public function getDetectionScriptContent(): ?StreamInterface {\n $val = $this->getBackingStore()->get('detectionScriptContent');\n if (is_null($val) || $val instanceof StreamInterface) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'detectionScriptContent'\");\n }", "public function setStream($stream) {}", "public function getFile(): ?StreamInterface {\n $val = $this->getBackingStore()->get('file');\n if (is_null($val) || $val instanceof StreamInterface) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'file'\");\n }", "function is_stream(mixed $var): bool\n{\n return $var && is_resource($var) && get_resource_type($var) === 'stream';\n}", "function PdfType(&$value) {\n $this->setValue($value);\n }", "protected function extractStream()\n {\n while (true) {\n $buffer = $this->reader->getBuffer(false);\n $length = \\strpos($buffer, 'endstream');\n if ($length === false) {\n if (!$this->reader->increaseLength(100000)) {\n throw new PdfTypeException('Cannot extract stream.');\n }\n continue;\n }\n break;\n }\n\n $buffer = \\substr($buffer, 0, $length);\n $lastByte = \\substr($buffer, -1);\n\n /* Check for EOL marker =\n * CARRIAGE RETURN (\\r) and a LINE FEED (\\n) or just a LINE FEED (\\n},\n * and not by a CARRIAGE RETURN (\\r) alone\n */\n if ($lastByte === \"\\n\") {\n $buffer = \\substr($buffer, 0, -1);\n\n $lastByte = \\substr($buffer, -1);\n if ($lastByte === \"\\r\") {\n $buffer = \\substr($buffer, 0, -1);\n }\n }\n\n // There are streams in the wild, which have only white signs in them but need to be parsed manually due\n // to a problem encountered before (e.g. Length === 0). We should set them to empty streams to avoid problems\n // in further processing (e.g. applying of filters).\n if (trim($buffer) === '') {\n $buffer = '';\n }\n\n return $buffer;\n }", "public static function setStream($stream) {}", "public function setStream(&$value)\n {\n $this->_stream = $value;\n }", "public function getStream(): mixed;", "public function setStreamTo($stream);", "function test_streams($instream, &$format)\n{\n\tif ($instream === false)\n\t{\n\t\treturn false;\n\t}\n\n\tif ($format === false)\n\t{\n\t\t$format = \"\";\n\t}\n\treturn true;\n}", "public function getPayload(): ?StreamInterface {\n $val = $this->getBackingStore()->get('payload');\n if (is_null($val) || $val instanceof StreamInterface) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'payload'\");\n }", "public function setContent(?StreamInterface $value): void {\n $this->getBackingStore()->set('content', $value);\n }", "protected function checkPDF(): void\n {\n if ('application/pdf' === $this->mimeType ||\n 'pdf' === $this->fileExtension\n ) {\n $this->iconClass = self::ICON_PDF;\n }\n }", "protected function _applyFilter($stream, $encode = false, ?\\SetaPDF_Core_Document $pdfDocument = null) {}", "function _wp_kses_allow_pdf_objects($url)\n {\n }", "public function checkObject($value)\n {\n return $this->checkHasType($value, 'object');\n }", "public function hasStreamBlobImpl();" ]
[ "0.574167", "0.5731236", "0.56550896", "0.56354856", "0.55255866", "0.5467348", "0.5439911", "0.5428058", "0.53896797", "0.53867954", "0.5348402", "0.53067696", "0.52987117", "0.52778244", "0.5272244", "0.52694595", "0.5248058", "0.5229675", "0.5211279", "0.51727045", "0.51064014", "0.50960606", "0.5062807", "0.5049597", "0.5029506", "0.49985874", "0.4988799", "0.49739182", "0.49494404", "0.4890242" ]
0.78312606
0
Extract the stream "manually".
protected function extractStream() { while (true) { $buffer = $this->reader->getBuffer(false); $length = \strpos($buffer, 'endstream'); if ($length === false) { if (!$this->reader->increaseLength(100000)) { throw new PdfTypeException('Cannot extract stream.'); } continue; } break; } $buffer = \substr($buffer, 0, $length); $lastByte = \substr($buffer, -1); /* Check for EOL marker = * CARRIAGE RETURN (\r) and a LINE FEED (\n) or just a LINE FEED (\n}, * and not by a CARRIAGE RETURN (\r) alone */ if ($lastByte === "\n") { $buffer = \substr($buffer, 0, -1); $lastByte = \substr($buffer, -1); if ($lastByte === "\r") { $buffer = \substr($buffer, 0, -1); } } // There are streams in the wild, which have only white signs in them but need to be parsed manually due // to a problem encountered before (e.g. Length === 0). We should set them to empty streams to avoid problems // in further processing (e.g. applying of filters). if (trim($buffer) === '') { $buffer = ''; } return $buffer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStream() {}", "public function getStream() {}", "public function getStream() {}", "public function getStream() {}", "public function getStream() {}", "public static function getStream() {}", "public function getStream();", "public function getStream();", "public function getStream();", "public function getStream();", "public function getStream();", "public function getStream();", "public function stream();", "public function getStream($filtered = false) {}", "public function getStreamObject() {}", "public function getStream(): mixed;", "public function readStream();", "public function getStreams();", "public function getStreamParser() {}", "public function getStreamParser() {}", "public function getEntryStream();", "public function getEntryStream();", "public function getEntryStream();", "public function getContents()\n {\n return stream_get_contents($this->stream);\n }", "public function returnStream() {\n return $this->stream;\n }", "public function &getStream()\n {\n return $this->_stream;\n }", "function read() {\n\t\t$_this =& AmfStream::getInstance();\n\t\treturn $_this->__stream;\n\t}", "private function _readStream(&$stream, &$transparencyMask, &$transparencyPixelCount) {}", "function readStream( string $_stream_path, IEntitySet $_transform ): IStreamProperties;", "public function extract();" ]
[ "0.6637838", "0.66358644", "0.66358644", "0.66358644", "0.66358644", "0.6632713", "0.6563895", "0.6563895", "0.6563895", "0.6563895", "0.6563895", "0.6563895", "0.6485578", "0.6364316", "0.63069314", "0.6299597", "0.6127743", "0.6107107", "0.6068736", "0.6068736", "0.5807375", "0.5807375", "0.5807375", "0.5707852", "0.56150717", "0.55881554", "0.5543605", "0.5534811", "0.55309075", "0.5504289" ]
0.6804684
0
/ Function is to get all the contents from ics and explode all the datas according to the events and its sections
function getIcsEventsAsArray($file) { $icalString = file_get_contents ( $file ); $icsDates = array (); /* Explode the ICs Data to get datas as array according to string ‘BEGIN:’ */ $icsData = explode ( "BEGIN:", $icalString ); /* Iterating the icsData value to make all the start end dates as sub array */ foreach ( $icsData as $key => $value ) { $icsDatesMeta [$key] = explode ( "\n", $value ); } /* Itearting the Ics Meta Value */ foreach ( $icsDatesMeta as $key => $value ) { foreach ( $value as $subKey => $subValue ) { /* to get ics events in proper order */ $icsDates = $this->getICSDates ( $key, $subKey, $subValue, $icsDates ); } } return $icsDates; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function icsAJson($temp){\n\t$original = array(\"BEGIN:VCALENDAR\", \"END:VCALENDAR\", \"PRODID:\", \"BEGIN:VEVENT\", \"END:VEVENT\", \"VERSION:\", \"CALSCALE:\",\n\t\"METHOD:\", \"X-WR-CALNAME:\", \"X-WR-TIMEZONE:\", \"X-WR-CALDESC:\", \"DTSTART:\", \"DTEND:\", \"DTSTAMP:\", \"UID:\", \"CREATED:\", \"DESCRIPTION:\",\n\t\"LAST-MODIFIED:\", \"LOCATION:\", \"SEQUENCE:\", \"STATUS:\", \"SUMMARY:\", \"TRANSP:TRANSPARENT\", \"TRANSP:OPAQUE\", \"X-GOOGLE-HANGOUT:\" , \"DTSTART;VALUE=DATE:\", \"DTEND;VALUE=DATE:\",\n\t'\\n', '\\r', '<br />', '<br \\/>', '\\/', '\"{\"VCALENDAR');\n\t$cambiadas = array('{\"VCALENDAR\":[{', '}]}', '\"PRODID\":\"', ', \"VEVENT\":[', ']', '\", \"VERSION\": \"', '\", \"CALSCALE\": \"', '\", \"METHOD\":\"',\n\t'\", \"X-WR-CALNAME\":\"', '\", \"X-WR-TIMEZONE\":\"' , '\", \"X-WR-CALDESC\":\"\"', '{\"DTSTART\":\"', '\", \"DTEND\":\"', '\", \"DTSTAMP\":\"', '\", \"UID\":\"',\n\t'\", \"CREATED\":\"', '\", \"DESCRIPTION\":\"', '\", \"LAST-MODIFIED\":\"', '\", \"LOCATION\":\"', '\", \"SEQUENCE\":\"', '\", \"STATUS\":\"', '\", \"SUMMARY\":\"',\n\t'\", \"TRANSP\":\"TRANSPARENT\"}', '\", \"TRANSP\":\"OPAQUE\"}', '\", \"X-GOOGLE-HANGOUT\":\"' , '{\"DTSTART\":\"', '\", \"DTEND\":\"',\n\t'', '', '', '', '/', '{\"VCALENDAR');\n\t$newphrase = trim(str_replace($original, $cambiadas, $temp));\n\t//Busco los Eventos del calendario\n\t$busco = '\"VEVENT\"';\n\t$pos = strpos($newphrase, $busco);\n\t$primerParte = \"\";\n\t$segundaParte = \"\";\n\t$terceraParte = \"]}]}\";\n\t$salida = \"\";\n\tif ($pos !== false) {\n\t\t//Al encontrar al primer Evento separo el texto en 2 partes, la primera con lo anterior a este\n\t\t$primerParte = (substr($newphrase, 0, $pos)) . '\"VEVENT\":[';\n\t\t//La segunda parte contendra los Eventos a medio camino de estar en formato JSON\n\t\t$temp = substr($newphrase, $pos, ((strlen($newphrase)-5) - $pos));\n\t\t//Cambio esta segunda parte para darle el formato que corresponde\n\t\t$original = array('\"VEVENT\":[', \"]\");\n\t\t$cambiadas = array('', '');\n\t\t$segundaParte = trim(str_replace($original, $cambiadas, $temp));\n\t\t//Uno las 3, Inicio, Eventos y el Final que contiene los cierres de llaves necesarios\n\t\t$salida = $primerParte . $segundaParte . $terceraParte;\t\t\n\t}\n\treturn ($salida);\n}", "function get_event_xml(){\n// $xml = simplexml_load_file($_SERVER[\"DOCUMENT_ROOT\"] . \"/_shared-content/xml/calendar-categories.xml\");\n $xml = autoCache(\"simplexml_load_file\", array($_SERVER[\"DOCUMENT_ROOT\"] . \"/_shared-content/xml/calendar-categories.xml\"));\n $categories = array();\n $xml = $xml->{'system-page'};\n foreach ($xml->children() as $child) {\n if($child->getName() == \"dynamic-metadata\"){\n foreach($child->children() as $metadata){\n if($metadata->getName() == \"value\"){\n array_push($categories, (string)$metadata);\n }\n }\n }\n }\n// $xml = simplexml_load_file($_SERVER[\"DOCUMENT_ROOT\"] . \"/_shared-content/xml/events.xml\");\n $xml = autoCache(\"simplexml_load_file\", array($_SERVER[\"DOCUMENT_ROOT\"] . \"/_shared-content/xml/events.xml\"));\n $event_pages = $xml->xpath(\"//system-page[system-data-structure[@definition-path='Event']]\");\n $dates = array();\n $datePaths = array();\n foreach($event_pages as $child ){\n $page_data = inspect_page($child, $categories);\n if (!$page_data[\"hide-from-calendar\"]){\n $dates = add_event_to_array($dates, $page_data, $datePaths);\n }\n }\n return $dates;\n}", "public static function icalendar() {\r\n $ical = \"BEGIN:VCALENDAR\".PHP_EOL;\r\n $ical .= \"VERSION:2.0\".PHP_EOL;\r\n\r\n $show_personal_bak = Calendar_Events::$calsettings->show_personal;\r\n $show_course_bak = Calendar_Events::$calsettings->show_course;\r\n $show_deadline_bak = Calendar_Events::$calsettings->show_deadline;\r\n $show_admin_bak = Calendar_Events::$calsettings->show_admin;\r\n Calendar_Events::set_calendar_settings(1,1,1,1);\r\n Calendar_Events::get_calendar_settings();\r\n $eventlist = Calendar_Events::get_calendar_events();\r\n Calendar_Events::set_calendar_settings($show_personal_bak,$show_course_bak,$show_deadline_bak,$show_admin_bak);\r\n Calendar_Events::get_calendar_settings();\r\n\r\n $events = array();\r\n foreach ($eventlist as $event) {\r\n $ical .= \"BEGIN:VEVENT\".PHP_EOL;\r\n $startdatetime = new DateTime($event->start);\r\n $ical .= \"DTSTART:\".$startdatetime->format(\"Ymd\\THis\").PHP_EOL;\r\n $duration = new DateTime($event->duration);\r\n $ical .= \"DURATION:\".$duration->format(\"\\P\\TH\\Hi\\Ms\\S\").PHP_EOL;\r\n $ical .= \"SUMMARY:[\".strtoupper($event->event_group).\"] \".$event->title.PHP_EOL;\r\n $ical .= \"DESCRIPTION:\".canonicalize_whitespace(strip_tags($event->content)).PHP_EOL;\r\n if ($event->event_group == 'deadline')\r\n {\r\n $ical .= \"BEGIN:VALARM\".PHP_EOL;\r\n $ical .= \"TRIGGER:-PT24H\".PHP_EOL;\r\n $ical .= \"DURATION:PT10H\".PHP_EOL;\r\n $ical .= \"ACTION:DISPLAY\".PHP_EOL;\r\n $ical .= \"DESCRIPTION:DEADLINE REMINDER for \".canonicalize_whitespace(strip_tags($event->title)).PHP_EOL;\r\n $ical .= \"END:VALARM\".PHP_EOL;\r\n }\r\n $ical .= \"END:VEVENT\".PHP_EOL;\r\n }\r\n $ical .= \"END:VCALENDAR\".PHP_EOL;\r\n return $ical;\r\n }", "function fichier_ical($liste_evenements)\r\n{\r\n\t////\tINIT\r\n\tglobal $tab_timezones, $AGENDAS_AFFECTATIONS;\r\n\r\n\t////\tDEBUT DU ICAL\r\n\t$sortie = \"BEGIN:VCALENDAR\\n\";\r\n\t$sortie .= \"PRODID:-//Agora-Project//\".$_SESSION[\"agora\"][\"nom\"].\"//EN\\n\";\r\n\t$sortie .= \"VERSION:2.0\\n\";\r\n\t$sortie .= \"CALSCALE:GREGORIAN\\n\";\r\n\t$sortie .= \"METHOD:PUBLISH\\n\";\r\n\r\n\t////\tTIMEZONE\r\n\t$current_timezone = current_timezone();\r\n\t$heure_time_zone = $tab_timezones[$current_timezone];\r\n\t$sortie .= \"BEGIN:VTIMEZONE\\n\";\r\n\t$sortie .= \"TZID:\".$current_timezone.\"\\n\";\r\n\t$sortie .= \"X-LIC-LOCATION:\".$current_timezone.\"\\n\";\r\n\t//Daylight\r\n\t$sortie .= \"BEGIN:DAYLIGHT\\n\";\r\n\t$sortie .= \"TZOFFSETFROM:\".heure_ical($heure_time_zone).\"\\n\";\r\n\t$sortie .= \"TZOFFSETTO:\".heure_ical($heure_time_zone,1).\"\\n\";\r\n\t$sortie .= \"TZNAME:CEST\\n\";\r\n\t$sortie .= \"DTSTART:19700329T020000\\n\";\r\n\t$sortie .= \"RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3\\n\";\r\n\t$sortie .= \"END:DAYLIGHT\\n\";\r\n\t//Standard\r\n\t$sortie .= \"BEGIN:STANDARD\\n\";\r\n\t$sortie .= \"TZOFFSETFROM:\".heure_ical($heure_time_zone,1).\"\\n\";\r\n\t$sortie .= \"TZOFFSETTO:\".heure_ical($heure_time_zone).\"\\n\";\r\n\t$sortie .= \"TZNAME:CET\\n\";\r\n\t$sortie .= \"DTSTART:19701025T030000\\n\";\r\n\t$sortie .= \"RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10\\n\";\r\n\t$sortie .= \"END:STANDARD\\n\";\r\n\t$sortie .= \"END:VTIMEZONE\\n\";\r\n\r\n\t////\tAJOUT DE CHAQUE EVENEMENT\r\n\tforeach($liste_evenements as $evt)\r\n\t{\r\n\t\t////\tDescription & agendas où est affecté l'événement\r\n\t\t$evt[\"description\"] = strip_tags(str_replace(\"<br />\",\" \",$evt[\"description\"]));\r\n\t\t$agendas = agendas_evts($evt[\"id_evenement\"],\"1\");\r\n\t\tif(count($agendas)>1){\r\n\t\t\t$agendas_txt = \"\";\r\n\t\t\tforeach($agendas as $id_agenda) { $agendas_txt .= $AGENDAS_AFFECTATIONS[$id_agenda][\"titre\"].\", \"; }\r\n\t\t\t$evt[\"description\"] .= \" [\".substr(text_reduit($agendas_txt),0,-2).\"]\";\r\n\t\t}\r\n\t\t////\tAffichage\r\n\t\t$sortie .= \"BEGIN:VEVENT\\n\";\r\n\t\t$sortie .= \"CREATED:\".date_ical($evt[\"date_crea\"],false).\"\\n\";\r\n\t\t$sortie .= \"LAST-MODIFIED:\".date_ical($evt[\"date_crea\"],false).\"\\n\";\r\n\t\t$sortie .= \"DTSTAMP:\".date_ical(db_insert_date(),false).\"\\n\";\r\n\t\t$sortie .= \"UID:\".ical_uid_evt($evt).\"\\n\";\r\n\t\t$sortie .= \"SUMMARY:\".$evt[\"titre\"].\"\\n\";\r\n\t\t$sortie .= \"DTSTART;TZID=\".date_ical($evt[\"date_debut\"]).\"\\n\"; //exple : \"19970714T170000Z\" pour 14 juillet 1997 à 17h00\r\n\t\t$sortie .= \"DTEND;TZID=\".date_ical($evt[\"date_fin\"]).\"\\n\";\r\n\t\tif($evt[\"id_categorie\"]>0)\t\t$sortie .= \"CATEGORIES:\".db_valeur(\"SELECT titre FROM gt_agenda_categorie WHERE id_categorie='\".$evt[\"id_categorie\"].\"'\").\"\\n\";\r\n\t\tif($evt[\"description\"]!=\"\")\t\t$sortie .= \"DESCRIPTION:\".preg_replace(\"/\\r\\n/\",\" \",html_entity_decode(strip_tags($evt[\"description\"]))).\"\\n\";\r\n\t\t// Périodicité\r\n\t\t$period_date_fin = ($evt[\"period_date_fin\"]) ? \";UNTIL=\".date_ical($evt[\"period_date_fin\"],false) : \"\";\r\n\t\tif($evt[\"periodicite_type\"]==\"annee\")\t\t\t\t$sortie .= \"RRULE:FREQ=YEARLY;INTERVAL=1\".$period_date_fin.\"\\n\";\r\n\t\telseif($evt[\"periodicite_type\"]==\"mois\")\t\t\t$sortie .= \"RRULE:FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=\".trim(strftime(\"%e\",strtotime($evt[\"date_debut\"]))).$period_date_fin.\"\\n\";\r\n\t\telseif($evt[\"periodicite_type\"]==\"jour_mois\")\t\t$sortie .= \"RRULE:FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=\".implode(\",\",array_map(\"abs\",explode(\",\",$evt[\"periodicite_valeurs\"]))).$period_date_fin.\"\\n\";\r\n\t\telseif($evt[\"periodicite_type\"]==\"jour_semaine\")\t$sortie .= \"RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=\".implode(\",\",array_map(\"jour_ical\",explode(\",\",$evt[\"periodicite_valeurs\"]))).$period_date_fin.\"\\n\";\r\n\t\t$sortie .= \"END:VEVENT\\n\";\r\n\t}\r\n\r\n\t////\tFIN DU ICAL\r\n\t$sortie .= \"END:VCALENDAR\\n\";\r\n\treturn $sortie;\r\n}", "function toICS() {\r\n require_once BPSP_PLUGIN_DIR . '/schedules/iCalcreator.class.php';\r\n global $bp;\r\n define( 'ICAL_LANG', get_bloginfo( 'language' ) );\r\n \r\n $cal = new vcalendar();\r\n $cal->setConfig( 'unique_id', str_replace( 'http://', '', get_bloginfo( 'siteurl' ) ) );\r\n $cal->setConfig( 'filename', $bp->groups->current_group->slug );\r\n $cal->setProperty( 'X-WR-CALNAME', __( 'Calendar for: ', 'bpsp' ) . $bp->groups->current_group->name );\r\n $cal->setProperty( 'X-WR-CALDESC', $bp->groups->current_group->description );\r\n $cal->setProperty( 'X-WR-TIMEZONE', get_option('timezone_string') );\r\n \r\n $schedules = $this->has_schedules();\r\n $assignments = BPSP_Assignments::has_assignments();\r\n $entries = array_merge( $assignments, $schedules );\r\n foreach ( $entries as $entry ) {\r\n setup_postdata( $entry );\r\n \r\n $e = new vevent();\r\n \r\n if( $entry->post_type == \"schedule\" )\r\n $date = getdate( strtotime( $entry->start_date ) );\r\n elseif( $entry->post_type == \"assignment\" )\r\n $date = getdate( strtotime( $entry->post_date ) );\r\n $dtstart['year'] = $date['year'];\r\n $dtstart['month'] = $date['mon'];\r\n $dtstart['day'] = $date['mday'];\r\n $dtstart['hour'] = $date['hours'];\r\n $dtstart['min'] = $date['minutes'];\r\n $dtstart['sec'] = $date['seconds'];\r\n $e->setProperty( 'dtstart', $dtstart );\r\n \r\n $e->setProperty( 'description', get_the_content() . \"\\n\\n\" . $entry->permalink );\r\n \r\n if( !empty( $entry->location ) )\r\n $e->setProperty( 'location', $entry->location );\r\n \r\n if( $entry->post_type == \"assignment\" )\r\n $entry->end_date = $entry->due_date; // make assignments compatible with schedule parser\r\n \r\n if( !empty( $entry->end_date ) ) {\r\n $date = getdate( strtotime( $entry->end_date ) );\r\n $dtend['year'] = $date['year'];\r\n $dtend['month'] = $date['mon'];\r\n $dtend['day'] = $date['mday'];\r\n $dtend['hour'] = $date['hours'];\r\n $dtend['min'] = $date['minutes'];\r\n $dtend['sec'] = $date['seconds'];\r\n $e->setProperty( 'dtend', $dtend );\r\n } else\r\n $e->setProperty( 'duration', 0, 1, 0 ); // Assume it's an one day event\r\n \r\n $e->setProperty( 'summary', get_the_title( $entry->ID ) );\r\n $e->setProperty( 'status', 'CONFIRMED' );\r\n \r\n $cal->setComponent( $e );\r\n }\r\n \r\n header(\"HTTP/1.1 200 OK\");\r\n die( $cal->returnCalendar() );\r\n }", "function convert($id) {\n global $i, $events, $before, $after;\n \n $contents = file_get_contents(get_attached_file($id));\n \n// echo \"<p>convert</p>\";\n// \n// echo \"<p>count: \" . count($events) . \"</p>\";\n \n //echo \"<h1>contents:</h1><br><p>\" . $contents . \"</p>\"; //_wp_get_attachment_relative_path(\n\n \n $ics_events = explode(\"BEGIN:VEVENT\", $contents);\n array_shift($ics_events);\n\n for ($i = 0; $i < count($ics_events); $i++) {\n //global $events, $before, $after;\n\n $events[$i] = array();\n\n $events[$i][\"TEST\"] = \"fooey \" . $i;\n \n preg_replace_callback_array(\n [\n $before . \"CREATED:\" . $after => function($match) {\n global $i, $events;\n\n $events[$i][\"CREATED\"] = strtotime($match[0]);\n },\n $before . \"ORGANIZER;\" . $after => function($match) {\n global $i, $events;\n\n $events[$i][\"ORGANIZER\"] = preg_replace(\"/:MAILTO:.*|CN=/\", \"\", $match[0]);\n },\n $before . \"DTSTART:\" . $after => function($match) {\n global $i, $events;\n\n $events[$i][\"DTSTART\"] = date(\"m/d/y g:i\", strtotime($match[0]));\n },\n $before . \"DTEND:\" . $after => function($match) {\n global $i, $events;\n\n $events[$i][\"DTEND\"] = date(\"m/d/y g:i\", strtotime($match[0]));\n },\n $before . \"SUMMARY:\" . $after => function($match) {\n global $i, $events;\n\n $events[$i][\"SUMMARY\"] = $match[0];\n },\n $before . \"LOCATION:\" . $after => function($match) {\n global $i, $events;\n\n $events[$i][\"LOCATION\"] = $match[0];\n },\n $before . \"URL:\" . $after => function($match) {\n global $i, $events;\n\n $events[$i][\"URL\"] = $match[0];\n },\n $before . \"DESCRIPTION:\" . $after => function($match) {\n global $i, $events;\n\n $events[$i][\"DESCRIPTION\"] = $match[0];\n }\n ],\n $ics_events[$i]\n );\n }\n \n for ($i = 0; $i < count($events); $i++) {\n $stuff = $events[$i];\n foreach ($stuff as $thing => $thing_value) {\n echo \"<p>$thing: $thing_value</p>\";\n }\n //echo \"<p>\" . $events[$i] .\"</p>\";\n echo \"<br>\";\n }\n}", "public function getBookingsAsICAL($username, $password, $start_date, $end_date, $groups=false, $buildings=false, $statuses=false, $event_types=false, $group_types=false, $group_id=false) {\nglobal $_LW;\n$feed=$_LW->getNew('feed'); // get a feed object\n$ical=$feed->createFeed(['title'=>'EMS Events'], 'ical'); // create new feed\n$hostname=@parse_url((!empty($_LW->REGISTERED_APPS['ems']['custom']['wsdl']) ? $_LW->REGISTERED_APPS['ems']['custom']['wsdl'] : (!empty($_LW->REGISTERED_APPS['ems']['custom']['rest']) ? $_LW->REGISTERED_APPS['ems']['custom']['rest'] : '')), PHP_URL_HOST);\nif ($bookings=$this->getBookings($username, $password, $start_date, $end_date, $groups, $buildings, $statuses, $event_types, $group_types, $group_id)) { // if bookings obtained\n\tforeach($bookings as $booking) { // for each booking\n\t\t$arr=[ // format the event\n\t\t\t'summary'=>$booking['title'],\n\t\t\t'dtstart'=>$booking['date_ts'],\n\t\t\t'dtend'=>(!empty($booking['date2_ts']) ? $booking['date2_ts'] : ''),\n\t\t\t'description'=>'',\n\t\t\t'uid'=>$booking['booking_id'].'@'.$hostname,\n\t\t\t'categories'=>$booking['event_type'],\n\t\t\t'location'=>$booking['location'],\n\t\t\t'X-LIVEWHALE-TYPE'=>'event',\n\t\t\t'X-LIVEWHALE-TIMEZONE'=>@$booking['timezone'],\n\t\t\t'X-LIVEWHALE-CANCELED'=>@$booking['canceled'],\n\t\t\t'X-LIVEWHALE-CONTACT-INFO'=>@$booking['contact_info'],\n\t\t\t'X-EMS-STATUS-ID'=>@$booking['status_id'],\n\t\t\t'X-EMS-EVENT-TYPE-ID'=>@$booking['event_type_id']\n\t\t];\n\t\tif (@$booking['status_id']==5 || @$booking['status_id']==17) { // if this is a pending event, skip syncing (creation of events and updating if already existing)\n\t\t\t$arr['X-LIVEWHALE-SKIP-SYNC']=1;\n\t\t};\n\t\tif (!empty($_LW->REGISTERED_APPS['ems']['custom']['hidden_by_default'])) { // if importing hidden events, flag them\n\t\t\t$arr['X-LIVEWHALE-HIDDEN']=1;\n\t\t};\n\t\tif (!empty($booking['udfs']) && !empty($_LW->REGISTERED_APPS['ems']['custom']['udf_tags']) && !empty($booking['udfs'][$_LW->REGISTERED_APPS['ems']['custom']['udf_tags']])) { // if assigning UDF values as event tags\n\t\t\t$arr['X-LIVEWHALE-TAGS']=implode('|', $booking['udfs'][$_LW->REGISTERED_APPS['ems']['custom']['udf_tags']]); // add them to output\n\t\t};\n\t\tif (!empty($booking['udfs']) && !empty($_LW->REGISTERED_APPS['ems']['custom']['udf_categories']) && !empty($booking['udfs'][$_LW->REGISTERED_APPS['ems']['custom']['udf_categories']])) { // if assigning UDF values as event categories, implode array\n\t\t\t$arr['categories']=implode('|', $booking['udfs'][$_LW->REGISTERED_APPS['ems']['custom']['udf_categories']]); // add them to output\n\t\t};\n\t\tif (!empty($booking['udfs']) && !empty($_LW->REGISTERED_APPS['ems']['custom']['udf_description']) && !empty($booking['udfs'][$_LW->REGISTERED_APPS['ems']['custom']['udf_description']])) { // if assigning UDF value as event description\n\t\t\t$arr['description']=$booking['udfs'][$_LW->REGISTERED_APPS['ems']['custom']['udf_description']];\n\t\t};\n\t\tif (!empty($booking['contact_info'])) { // add contact info if available\n\t\t\t$arr['X-EMS-CONTACT-INFO']=$booking['contact_info'];\n\t\t};\n\t\tif (!empty($booking['contact_name'])) { // add contact name if available\n\t\t\t$arr['X-EMS-CONTACT-NAME']=$booking['contact_name'];\n\t\t};\n\t\t$arr=$_LW->callHandlersByType('application', 'onBeforeEMSFeed', ['buffer'=>$arr, 'booking'=>$booking]); // call handlers\n\t\tforeach($arr as $key=>$val) { // clear empty entries\n\t\t\tif (empty($val)) {\n\t\t\t\tunset($arr[$key]);\n\t\t\t};\n\t\t};\n\t\t$feed->addFeedItem($ical, $arr, 'ical'); // add event to feed\n\t};\n};\n$feed->disable_content_length=true;\nreturn $feed->showFeed($ical, 'ical'); // show the feed\n}", "public function get_timeline_events() {\r\n\t\t$contents[] = $this->get_content_posts();\r\n\t\t$contents[] = $this->get_content_tweets();\r\n\t\t$contents[] = $this->get_content_stories();\r\n\t\t\r\n\t\t$events = array();\r\n\t\t\r\n\t\t// Process each of the contents we have attempted to grab and combine them as events by year.\r\n\t\tforeach( $contents as $content ) {\r\n\t\t\tif( is_array ( $content ) ) {\r\n\t\t\t\tforeach ( $content as $date_group => $values ) {\r\n\t\t\t\t\tif( empty( $events[$date_group] ) || !isset( $events[$date_group] ) ) {\r\n\t\t\t\t\t\t$events[$date_group] = $values;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$events[$date_group] = array_merge( $events[$date_group], $values);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tforeach( $events as $year=>&$event ) {\r\n\t\t\tusort( $event, array( &$this, 'sort_events_by_date' ) );\r\n\t\t}\r\n\t\t\r\n\t\tuksort( &$events, array( &$this, 'sort_date_groups' ) );\r\n\r\n\t\treturn $events;\r\n\t}", "private function _get_calendar_array()\n\t{\n\t $this->all_events = $this->result->xpath(\".//event\");\n\t \n\t foreach($this->all_events as $an_event):\n\t $start_at = $an_event->xpath(\"./start-at\");\n \t $start_at = $start_at[0];\n \t $end_at = $an_event->xpath(\"./end-at\");\n \t $end_at = $end_at[0];\n \t \n \t $start_at = new DateTime($start_at);\n \t $start_at->setTimezone(new DateTimeZone('America/Chicago'));\n \t $start_at->setTime(0, 0, 0);\n \t $end_at = new DateTime($end_at);\n \t $end_at->setTimezone(new DateTimeZone('America/Chicago'));\n \t $end_at->setTime(0, 0, 0);\n \t \n \t $start_timestamp = strtotime($start_at->format('Y-m-d'));\n $end_timestamp = strtotime($end_at->format('Y-m-d'));\n \n $start_year = date(\"Y\", $start_timestamp);\n $end_year = date(\"Y\", $end_timestamp);\n $start_month = date(\"m\", $start_timestamp);\n $end_month = date(\"m\", $end_timestamp);\n $start_day = date(\"d\", $start_timestamp);\n $start_day = $start_day + 1;\n $end_day = date(\"d\", $end_timestamp);\n $end_day = $end_day + 1;\n \n if(($start_year == $this->year && $start_month == $this->month) || ($end_year == $this->year && $end_month == $this->month)):\n if($start_year == $end_year):\n if($start_month == $end_month):\n $this->_calendar_array_one($start_day, $end_day);\n else:\n if($end_month != $this->month):\n $this->_calendar_array_two($start_day);\n else:\n $this->_calendar_array_three($end_day);\n endif;\n endif;\n endif;\n endif;\n endforeach;\n \n\t foreach($this->callinks as $callinks):\n\t foreach($callinks as $key => $value):\n\t $this->combined_callinks[\"$key\"] = $value;\n\t endforeach;\n\t endforeach;\n\t}", "private function makeDayEventListArray()\n\t{\n\t\t$outevents = array();\n\t\t$n = 0;\n\t\tforeach($this->eventItems as $item) {\n\t\t\tif($item['date'] == $this->curYear.'-'.$this->curMonth.'-'.$this->dayOfMonth) {\t\t\n\t\t\t\t$outevents[$n]['category'] = $item['cat'];\n\t\t\t\t\n\t\t\t\tif($item['stdurl']) {\n\t\t\t\t\t$outevents[$n]['url'] = $item['url'].'?id='.$item['id'];\n\t\t\t\t} else {\n\t\t\t\t\t$outevents[$n]['url'] = $item['url'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$outevents[$n]['summary'] = $item['text'];\n\t\t\t\t$outevents[$n]['description'] = $item['desc'];\n\t\t\t\t$outevents[$n]['categorycolor'] = (strlen($item['catcolor']) > 0 ? str_replace('#','',$item['catcolor']) : '#eeeeee');\n\t\t\t}\n\t\t\t$n++;\n\t\t}\n\t\t\n\t\tif(count($outevents)) {\n\t\t\treturn $outevents;\n\t\t}\n\t\treturn false;\n\t}", "function ReadEvents()\n {\n $this->ApplicationObj()->Events=\n $this->Sql_Select_Hashes\n (\n $this->ApplicationObj()->HtmlEventsWhere(),\n array(),\n array(\"StartDate\",\"ID\")\n );\n \n $this->ApplicationObj()->Events=array_reverse($this->ApplicationObj()->Events);\n }", "private function add_events()\r\n {\r\n $events = $this->events;\r\n foreach ($events as $time => $items)\r\n {\r\n $column = date('H', $time) / $this->hour_step + 1;\r\n foreach ($items as $item)\r\n {\r\n $content = $item['content'];\r\n $row = $item['index'] + 1;\r\n \r\n $cell_content = $this->getCellContents($row, $column);\r\n $cell_content .= $content;\r\n $this->setCellContents($row, $column, $cell_content);\r\n }\r\n }\r\n \r\n }", "function fetchEventDetails($TMeventDetailsResult){\n $eventDetailsResult = array();\n $eventDetailsArray = $TMeventDetailsResult;\n //extract information\n $eventDetailsResult[\"name\"] = array_key_exists('name',$eventDetailsArray)?$eventDetailsArray[\"name\"]:\"\";\n\n //extract dates information\n $eventDetailsResult[\"date\"] = array();\n if(array_key_exists('dates',$eventDetailsArray)){\n if(array_key_exists('start',$eventDetailsArray['dates'])){\n if(array_key_exists('localDate',$eventDetailsArray[\"dates\"][\"start\"])){\n $eventDetailsResult[\"date\"][\"localDate\"] = $eventDetailsArray[\"dates\"][\"start\"][\"localDate\"];\n }\n if(array_key_exists('localDate',$eventDetailsArray[\"dates\"][\"start\"])){\n $eventDetailsResult[\"date\"][\"localTime\"] = $eventDetailsArray[\"dates\"][\"start\"][\"localTime\"];\n }\n }\n }\n\n //extract genre information\n $eventDetailsResult[\"genre\"] = array();\n if(array_key_exists('classification',$eventDetailsArray)){\n foreach($eventDetailsArray[\"classification\"] as $i => $ele){\n if(array_key_exists('segment',$ele)){\n $eventDetailsResult[\"genre\"][$i][\"segment\"] = $ele[\"segemnt\"];\n }\n if(array_key_exists('genre',$ele)){\n $eventDetailsResult[\"genre\"][$i][\"genre\"] = $ele[\"genre\"];\n }\n if(array_key_exists('subGenre',$ele)){\n $eventDetailsResult[\"genre\"][$i][\"subGenre\"] = $ele[\"subGenre\"];\n }\n if(array_key_exists('type',$ele)){\n $eventDetailsResult[\"genre\"][$i][\"type\"] = $ele[\"type\"];\n }\n if(array_key_exists('segment',$ele)) {\n $eventDetailsResult[\"genre\"][$i][\"subType\"] = $ele[\"subType\"];\n }\n }\n }\n\n //extract artist information\n $eventDetailsResult[\"artists\"] = array();\n if(array_key_exists('_embedded',$eventDetailsArray)){\n if(array_key_exists('attractions',$eventDetailsArray[\"_embedded\"])) {\n foreach ($eventDetailsArray[\"_embedded\"][\"attractions\"] as $i => $ele) {\n if(array_key_exists('name',$ele)){\n $eventDetailsResult[\"artists\"][$i][\"name\"] = $ele[\"name\"];\n }\n if(array_key_exists('url',$ele)){\n $eventDetailsResult[\"artists\"][$i][\"url\"] = $ele[\"url\"];\n }\n }\n }\n }\n\n //extract venue information\n $eventDetailsResult[\"venues\"] = array();\n if(array_key_exists(\"_embedded\",$eventDetailsArray)){\n if(array_key_exists(\"venues\",$eventDetailsArray[\"_embedded\"])){\n foreach($eventDetailsArray[\"_embedded\"][\"venues\"] as $i => $ele){\n if(array_key_exists('name',$ele)){\n $eventDetailsResult[\"venues\"][$i][\"name\"] = $ele[\"name\"];\n }\n }\n }\n }\n\n //extract price range\n $eventDetailsResult['priceRange'] = array();\n if(array_key_exists('priceRange',$eventDetailsArray)){\n foreach($eventDetailsArray[\"priceRange\"] as $i => $ele){\n if(array_key_exists('min',$ele)){\n $eventDetailsResult['priceRange'][$i][\"min\"] = $ele[\"min\"];\n }\n if(array_key_exists('max',$ele)){\n $eventDetailsResult['priceRange'][$i][\"max\"] = $ele[\"max\"];\n }\n\n }\n }\n //extract ticketStatus information\n if(array_key_exists('dates',$eventDetailsArray)){\n if(array_key_exists('status',$eventDetailsArray[\"dates\"])){\n if(array_key_exists('code',$eventDetailsArray[\"dates\"][\"status\"])){\n $eventDetailsResult[\"ticketStatus\"] = $eventDetailsArray[\"dates\"][\"status\"][\"code\"];\n }\n }\n }\n //extract seatmap\n if(array_key_exists('seatmap',$eventDetailsArray)){\n if(array_key_exists('staticUrl',$eventDetailsArray[\"seatmap\"])){\n $eventDetailsResult[\"seatmap\"] = $eventDetailsArray[\"seatmap\"][\"staticUrl\"];\n }\n\n }\n //extract buy ticket at url\n if(array_key_exists('url',$eventDetailsArray)){\n $eventDetailsResult[\"buyTicketAt\"] = $eventDetailsArray[\"url\"];\n\n }\n\n return $eventDetailsResult;\n}", "function calendar()\n{\n /*\n $groups = getAllEvents();\n $fieldsToConvert = [\"name\", \"description\", \"context\", \"status\"];\n $groups = specialCharsConvertFromAnArray($groups, $fieldsToConvert);\n displaydebug($groups);\n */\n require_once \"view/calendar.php\";\n}", "protected function importData()\n\t{\n\t\t// get events\n\t\tinclude_once \"Services/ADN/EP/classes/class.adnExaminationEvent.php\";\n\t\t$events = adnExaminationEvent::getAllEvents($this->filter, $this->archived);\n\t\t\n\t\t// value mapping (to have correct sorting)\n\t\tif(sizeof($events))\n\t\t{\n\t\t\tinclude_once \"Services/ADN/EP/classes/class.adnAssignment.php\";\n\t\t\tinclude_once \"Services/ADN/ED/classes/class.adnSubjectArea.php\";\n\t\t\tforeach($events as $idx => $item)\n\t\t\t{\n\t\t\t\t$date = new ilDate($item[\"date_from\"]->get(IL_CAL_DATE), IL_CAL_DATE);\n\t\t\t\t$events[$idx][\"date_display\"] = ilDatePresentation::formatDate($date);\n\t\t\t\t$events[$idx][\"date\"] = $item[\"date_from\"]->get(IL_CAL_FKT_DATE, 'Y-m-d');\n\t\t\t\t$events[$idx][\"time_from\"] = $item[\"date_from\"]->get(IL_CAL_FKT_DATE, 'H:i');\n\t\t\t\t$events[$idx][\"time_to\"] = $item[\"date_to\"]->get(IL_CAL_FKT_DATE, 'H:i');\n\t\t\t\t$events[$idx][\"type\"] = $this->filter_options[\"type\"][$item[\"subject_area\"]];\n\t\t\t\t$events[$idx][\"type_color\"] = adnSubjectArea::getColorForArea($item[\"subject_area\"]);\n\n\t\t\t\t// we cannot use filter options because of archived values\n\t\t\t\t$events[$idx][\"facility\"] = adnExamFacility::lookupCity($item[\"md_exam_facility_id\"]);\n\n\t\t\t\tswitch($this->mode)\n\t\t\t\t{\n\t\t\t\t\tcase self::MODE_ASSIGNMENT:\n\t\t\t\t\t\t$users = adnAssignment::getAllAssignments(array(\"event_id\"=>$item[\"id\"]));\n\t\t\t\t\t\t$events[$idx][\"assigned\"] = sizeof($users);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\tcase self::MODE_INVITATION:\n\t\t\t\t\t\t$users = adnAssignment::getAllInvitations($item[\"id\"]);\n\t\t\t\t\t\t$events[$idx][\"invitations\"] = sizeof($users);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase self::MODE_ATTENDANCE:\n\t\t\t\t\t\tinclude_once './Services/ADN/Report/classes/class.adnReportAttendanceList.php';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$events[$idx]['attendance'] = '';\n\t\t\t\t\t\tif(adnReportAttendanceList::lookupLastFile($item['id']) instanceof ilDateTime)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$events[$idx][\"attendance\"] = \n\t\t\t\t\t\t\t\tilDatePresentation::formatDate(\n\t\t\t\t\t\t\t\t\tadnReportAttendanceList::lookupLastFile($item['id']));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->setData($events);\n\t\t$this->setMaxCount(sizeof($events));\n\t}", "public function icalendar()\n\t{\n\t\t$s = 'EJURI3ia8aj#912IKa';\n\t\t$r = '#';\n\t\t$e = 'aAEah38a;a33';\n\n\t\t// -------------------------------------\n\t\t// Some dummy tagdata we'll hand off to events()\n\t\t// -------------------------------------\n\n\t\t$vars = array(\n\t\t\t'event_title'\t\t\t\t\t=> 'title',\n\t\t\t'event_id'\t\t\t\t\t\t=> 'id',\n\t\t\t'event_summary'\t\t\t\t\t=> 'summary',\n\t\t\t'event_location'\t\t\t\t=> 'location',\n\t\t\t'event_start_date format=\"%Y\"'\t=> 'start_year',\n\t\t\t'event_start_date format=\"%m\"'\t=> 'start_month',\n\t\t\t'event_start_date format=\"%d\"'\t=> 'start_day',\n\t\t\t'event_start_date format=\"%H\"'\t=> 'start_hour',\n\t\t\t'event_start_date format=\"%i\"'\t=> 'start_minute',\n\t\t\t'event_end_date format=\"%Y\"'\t=> 'end_year',\n\t\t\t'event_end_date format=\"%m\"'\t=> 'end_month',\n\t\t\t'event_end_date format=\"%d\"'\t=> 'end_day',\n\t\t\t'event_end_date format=\"%H\"'\t=> 'end_hour',\n\t\t\t'event_end_date format=\"%i\"'\t=> 'end_minute',\n\t\t\t'event_calendar_tz_offset'\t\t=> 'tz_offset',\n\t\t\t'event_calendar_timezone'\t\t=> 'timezone'\n\t\t);\n\n\t\t$rvars = array(\n\t\t\t'rule_type',\n\t\t\t'rule_start_date',\n\t\t\t'rule_repeat_years',\n\t\t\t'rule_repeat_months',\n\t\t\t'rule_repeat_days',\n\t\t\t'rule_repeat_weeks',\n\t\t\t'rule_days_of_week',\n\t\t\t'rule_relative_dow',\n\t\t\t'rule_days_of_month',\n\t\t\t'rule_months_of_year',\n\t\t\t'rule_stop_by',\n\t\t\t'rule_stop_after'\n\t\t);\n\n\t\t$evars = array(\n\t\t\t'exception_start_date format=\"%Y%m%dT%H%i00\"'\n\t\t);\n\n\t\t$ovars = array(\n\t\t\t'occurrence_start_date format=\"%Y%m%dT%H%i00\"',\n\t\t\t'occurrence_end_date format=\"%Y%m%dT%H%i00\"'\n\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Preparing tagdata');\n\n\t\t$summary_field = ee()->TMPL->fetch_param('summary_field', 'event_title');\n\n\t\tee()->TMPL->tagdata =\timplode($s, array(\n\t\t\tLD . $summary_field . RD,\n\t\t\tLD . 'event_id' . RD,\n\t\t\tLD . 'if event_summary' . RD .\n\t\t\t\tLD . 'event_summary' . RD .\n\t\t\t\tLD . '/if' . RD,\n\t\t\tLD . 'if event_location' . RD .\n\t\t\t\tLD . 'event_location' . RD .\n\t\t\t\tLD . '/if' . RD,\n\t\t\tLD . 'event_start_date format=\"%Y\"' . RD,\n\t\t\tLD . 'event_start_date format=\"%m\"' . RD,\n\t\t\tLD . 'event_start_date format=\"%d\"' . RD,\n\t\t\tLD . 'event_start_date format=\"%H\"' . RD,\n\t\t\tLD . 'event_start_date format=\"%i\"' . RD,\n\t\t\tLD . 'event_end_date format=\"%Y\"' . RD,\n\t\t\tLD . 'event_end_date format=\"%m\"' . RD,\n\t\t\tLD . 'event_end_date format=\"%d\"' . RD,\n\t\t\tLD . 'event_end_date format=\"%H\"' . RD,\n\t\t\tLD . 'event_end_date format=\"%i\"' . RD,\n\t\t\tLD . 'event_calendar_tz_offset' . RD,\n\t\t\tLD . 'event_calendar_timezone' . RD,\n\t\t\t'RULES' .\n\t\t\t\tLD . 'if event_has_rules' . RD .\n\t\t\t\tLD . 'rules' . RD .\n\t\t\t\tLD . implode(RD . $r . LD, $rvars) . RD . '|' .\n\t\t\t\tLD . T_SLASH . 'rules' . RD .\n\t\t\t\tLD . '/if' . RD,\n\t\t\t'OCCURRENCES'.\n\t\t\t\tLD . 'if event_has_occurrences' . RD .\n\t\t\t\tLD . 'occurrences' . RD .\n\t\t\t\tLD . implode(RD . $r . LD, $ovars) . RD . '|' .\n\t\t\t\tLD . T_SLASH . 'occurrences' . RD .\n\t\t\t\tLD . '/if' . RD,\n\t\t\t'EXCEPTIONS'.\n\t\t\t\tLD . 'if event_has_exceptions' . RD .\n\t\t\t\tLD . 'exceptions' . RD .\n\t\t\t\tLD . implode(RD . $r . LD, $evars) . RD . '|' .\n\t\t\t\tLD . T_SLASH . 'exceptions' . RD .\n\t\t\t\tLD . '/if' . RD,\n\t\t\t$e\n\t\t));\n\n\t\t$tvars \t\t\t\t\t= ee()->functions->assign_variables(\n\t\t\tee()->TMPL->tagdata\n\t\t);\n\t\tee()->TMPL->var_single \t= $tvars['var_single'];\n\t\tee()->TMPL->var_pair \t= $tvars['var_pair'];\n\t\tee()->TMPL->tagdata \t= ee()->functions->prep_conditionals(\n\t\t\tee()->TMPL->tagdata,\n\t\t\tarray_keys($vars)\n\t\t);\n\n\t\t// -------------------------------------\n\t\t// Fire up events()\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Firing up Events()');\n\n\t\t$tagdata = ee()->TMPL->advanced_conditionals($this->events());\n\n\t\t// -------------------------------------\n\t\t// Collect the events\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Collecting events');\n\n\t\t$events = explode($e, $tagdata);\n\n\t\t// -------------------------------------\n\t\t// Fire up iCalCreator\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Starting iCalCreator');\n\n\t\tif ( ! class_exists('vcalendar'))\n\t\t{\n\t\t\trequire_once 'libraries/icalcreator/iCalcreator.class.php';\n\t\t}\n\n\t\t$ICAL = new vcalendar();\n\n\t\t//we are setting this manually because we need individual ones for each event for this to work\n\t\t//$ICAL->setConfig('unique_id', parse_url(ee()->config->item('site_url'), PHP_URL_HOST));\n\t\t$host = parse_url(ee()->config->item('site_url'), PHP_URL_HOST);\n\n\n\t\t$vars = array_values($vars);\n\n\t\t//ee()->TMPL->log_item('Calendar: Iterating through the events');\n\n\t\tforeach ($events as $key => $event)\n\t\t{\n\t\t\tif (trim($event) == '') continue;\n\n\t\t\t$E \t\t\t\t= new vevent();\n\n\t\t\t$event \t\t\t= explode($s, $event);\n\t\t\t$rules \t\t\t= '';\n\t\t\t$occurrences \t= '';\n\t\t\t$exceptions \t= '';\n\n\t\t\tforeach ($event as $k => $v)\n\t\t\t{\n\t\t\t\tif (isset($vars[$k]))\n\t\t\t\t{\n\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t//\tMakes the local vars from above, if available:\n\t\t\t\t\t// \t$title, $summary, $location,\n\t\t\t\t\t// $start_year, $start_month, $start_day,\n\t\t\t\t\t// $start_hour, $start_minute, $end_year,\n\t\t\t\t\t// $end_month, $end_day, $end_hour,\n\t\t\t\t\t// \t$end_minute, $tz_offset, $timezone\n\t\t\t\t\t//--------------------------------------------\n\n\t\t\t\t\t$$vars[$k] = $v;\n\t\t\t\t}\n\t\t\t\telseif (substr($v, 0, 5) == 'RULES')\n\t\t\t\t{\n\t\t\t\t\t$rules = substr($v, 5);\n\t\t\t\t}\n\t\t\t\telseif (substr($v, 0, 11) == 'OCCURRENCES')\n\t\t\t\t{\n\t\t\t\t\t$occurrences = substr($v, 11);\n\t\t\t\t}\n\t\t\t\telseif (substr($v, 0, 10) == 'EXCEPTIONS')\n\t\t\t\t{\n\t\t\t\t\t$exceptions = substr($v, 10);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Set the timezone for this calendar based on the first event's info\n\t\t\t// -------------------------------------\n\n\t\t\tif ($key == 0)\n\t\t\t{\n\t\t\t\t// -------------------------------------\n\t\t\t\t// Convert calendar_name to calendar_id\n\t\t\t\t// -------------------------------------\n\n\t\t\t\tif ($this->P->value('calendar_id') == '' AND\n\t\t\t\t\t$this->P->value('calendar_name') != '')\n\t\t\t\t{\n\t\t\t\t\t$ids = $this->data->get_calendar_id_from_name(\n\t\t\t\t\t\t$this->P->value('calendar_name'),\n\t\t\t\t\t\tNULL,\n\t\t\t\t\t\t$this->P->params['calendar_name']['details']['not']\n\t\t\t\t\t);\n\n\t\t\t\t\t$this->P->set('calendar_id', implode('|', $ids));\n\t\t\t\t}\n\n\t\t\t\t//--------------------------------------------\n\t\t\t\t//\tlets try to get the timezone from the\n\t\t\t\t//\tpassed calendar ID if there is one\n\t\t\t\t//--------------------------------------------\n\n\t\t\t\t$cal_timezone \t= FALSE;\n\t\t\t\t$cal_tz_offset \t= FALSE;\n\n\t\t\t\tif ($this->P->value('calendar_id') != '')\n\t\t\t\t{\n\t\t\t\t\t$sql = \"SELECT \ttz_offset, timezone\n\t\t\t\t\t\t\tFROM\texp_calendar_calendars\n\t\t\t\t\t\t\tWHERE \tcalendar_id\n\t\t\t\t\t\t\tIN \t\t(\" . ee()->db->escape_str(\n\t\t\t\t\t\t\t\t\t\t\timplode(',',\n\t\t\t\t\t\t\t\t\t\t\t\texplode('|',\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->P->value('calendar_id')\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t) .\n\t\t\t\t\t\t\t\t\t\")\n\t\t\t\t\t\t\tLIMIT\t1\";\n\n\t\t\t\t\t$cal_tz_query = ee()->db->query($sql);\n\n\t\t\t\t\tif ($cal_tz_query->num_rows() > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$cal_timezone \t= $cal_tz_query->row('timezone');\n\t\t\t\t\t\t$cal_tz_offset \t= $cal_tz_query->row('tz_offset');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//last resort, we get it from the current event\n\n\t\t\t\t$T = new vtimezone();\n\t\t\t\t$T->setProperty('tzid', ($cal_timezone ? $cal_timezone : $timezone));\n\t\t\t\t$T->setProperty('tzoffsetfrom', '+0000');\n\n\t\t\t\t$tzoffsetto = ($cal_tz_offset ? $cal_tz_offset : $tz_offset);\n\n\t\t\t\tif ($tzoffsetto === '0000')\n\t\t\t\t{\n\t\t\t\t\t$tzoffsetto = '+0000';\n\t\t\t\t}\n\n\t\t\t\t$T->setProperty('tzoffsetto', $tzoffsetto);\n\t\t\t\t$ICAL->setComponent($T);\n\t\t\t}\n\n\t\t\t$title\t\t\t= strip_tags($title);\n\t\t\t$description\t= strip_tags(trim($summary));\n\t\t\t$location\t\t= strip_tags(trim($location));\n\n\t\t\t// -------------------------------------\n\t\t\t// Occurrences?\n\t\t\t// -------------------------------------\n\n\t\t\t$occurrences\t= explode('|', rtrim($occurrences, '|'));\n\t\t\t$odata\t\t\t= array();\n\n\t\t\tforeach ($occurrences as $k => $occ)\n\t\t\t{\n\t\t\t\t$occ = trim($occ);\n\t\t\t\tif ($occ == '') continue;\n\n\t\t\t\t$occ = explode($r, $occ);\n\t\t\t\t$odata[$k][] = $occ[0];\n\t\t\t\t$odata[$k][] = $occ[1];\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Exceptions?\n\t\t\t// -------------------------------------\n\n\t\t\t$exceptions\t= explode('|', rtrim($exceptions, '|'));\n\t\t\t$exdata\t\t= array();\n\n\t\t\tforeach ($exceptions as $k => $exc)\n\t\t\t{\n\t\t\t\t$exc = trim($exc);\n\n\t\t\t\tif ($exc == '') continue;\n\n\t\t\t\t$exdata[] = $exc;\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Rules?\n\t\t\t// -------------------------------------\n\n\t\t\t$add_rules \t= FALSE;\n\t\t\t$erules \t= array();\n\t\t\t$rules \t\t= explode('|', rtrim($rules, '|'));\n\n\t\t\tforeach ($rules as $rule)\n\t\t\t{\n\t\t\t\t$temp = explode($r, $rule);\n\t\t\t\t$rule = array();\n\n\t\t\t\tforeach ($temp as $k => $v)\n\t\t\t\t{\n\t\t\t\t\tif ($v != FALSE) $add_rules = TRUE;\n\t\t\t\t\t$rule[substr($rvars[$k], 5)] = $v;\n\t\t\t\t}\n\n\t\t\t\tif ($add_rules === TRUE)\n\t\t\t\t{\n\t\t\t\t\t$temp = array();\n\n\t\t\t\t\tif ($rule['repeat_years'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp['FREQ'] = 'YEARLY';\n\n\t\t\t\t\t\tif ($rule['repeat_years'] > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['INTERVAL'] = $rule['repeat_years'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telseif ($rule['repeat_months'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp['FREQ'] = 'MONTHLY';\n\n\t\t\t\t\t\tif ($rule['repeat_months'] > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['INTERVAL'] = $rule['repeat_months'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telseif ($rule['repeat_weeks'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp['FREQ'] = 'WEEKLY';\n\n\t\t\t\t\t\tif ($rule['repeat_weeks'] > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['INTERVAL'] = $rule['repeat_weeks'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telseif ($rule['repeat_days'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp['FREQ'] = 'DAILY';\n\n\t\t\t\t\t\tif ($rule['repeat_days'] > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['INTERVAL'] = $rule['repeat_days'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($rule['months_of_year'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//this flips keys to make 'c' => 12, etc\n\t\t\t\t\t\t$m = array_flip(array(\n\t\t\t\t\t\t\t1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C'\n\t\t\t\t\t\t));\n\n\t\t\t\t\t\tif (strlen($rule['months_of_year'] > 1))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$months = str_split($rule['months_of_year']);\n\t\t\t\t\t\t\tforeach ($months as $month)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$temp['BYMONTH'][] = $m[$month] + 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['BYMONTH'] = $m[$month] + 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($rule['days_of_month'] > '')\n\t\t\t\t\t{\n\t\t\t\t\t\t//this flips keys to make 'v' => 30, etc\n\t\t\t\t\t\t$d = array_flip(array(\n\t\t\t\t\t\t\t1, 2, 3, 4, 5, 6, 7, 8, 9,\n\t\t\t\t\t\t\t'A', 'B', 'C', 'D', 'E', 'F',\n\t\t\t\t\t\t\t'G', 'H', 'I', 'J', 'K', 'L',\n\t\t\t\t\t\t\t'M', 'N', 'O', 'P', 'Q', 'R',\n\t\t\t\t\t\t\t'S', 'T', 'U', 'V'\n\t\t\t\t\t\t));\n\n\t\t\t\t\t\tif (strlen($rule['days_of_month']) > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$days = str_split($rule['days_of_month']);\n\t\t\t\t\t\t\tforeach ($days as $day)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$temp['BYMONTHDAY'][] = $d[$day] + 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['BYMONTHDAY'] = $d[$rule['days_of_month']] + 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($rule['days_of_week'] != '' OR $rule['days_of_week'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$d \t\t\t= array('SU','MO','TU','WE','TH','FR','SA');\n\t\t\t\t\t\t$d_letter \t= array('U','M','T','W','R','F','S');\n\n\t\t\t\t\t\t$dows \t\t= str_split($rule['days_of_week']);\n\n\t\t\t\t\t\tif ($rule['relative_dow'] > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$rels = str_split($rule['relative_dow']);\n\t\t\t\t\t\t\tforeach ($dows as $dow)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($rels as $rel)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($rel == 6) $rel = -1;\n\t\t\t\t\t\t\t\t\t$temp['BYDAY'][] = $rel.$d[array_search($dow, $d_letter)];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ($dows as $dow)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$temp['BYDAY'][] = $d[array_search($dow, $d_letter)];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($rule['stop_after'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp['COUNT'] = $rule['stop_after'];\n\t\t\t\t\t}\n\t\t\t\t\telseif ($rule['stop_by'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t// TODO: Add time\n\t\t\t\t\t\t// TODO: The \"+1\" below is because the ical standard treats\n\t\t\t\t\t\t// \tUNTIL as \"less than\", not \"less than or equal to\" (which\n\t\t\t\t\t\t// \tis how Calendar treats stop_by). Double check that a simple\n\t\t\t\t\t\t// \t\"+1\" accurately addresses this difference.\n\t\t\t\t\t\t$temp['UNTIL'] = $rule['stop_by'] + 1;\n\t\t\t\t\t}\n\n\t\t\t\t\t$erules[] = $temp;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Put it together\n\t\t\t// -------------------------------------\n\n\t\t\t//if this is all day we need to add the dates as params to the dstart and end items\n\t\t\tif ($this->_is_all_day($start_hour, $start_minute, $end_hour, $end_minute))\n\t\t\t{\n\t\t\t\t$E->setProperty(\n\t\t\t\t\t\"dtstart\" ,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'year' \t=> $start_year,\n\t\t\t\t\t\t'month' => $start_month,\n\t\t\t\t\t\t'day'\t=> $start_day\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'VALUE' => 'DATE'\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t//--------------------------------------------\n\t\t\t\t//\twe need CDT so we can add a day\n\t\t\t\t//\tgcal, and ical are ok with this being the same day\n\t\t\t\t//\tstupid damned outlook barfs, hence the +1\n\t\t\t\t//\tthe +1 doesnt affect g/ical\n\t\t\t\t//--------------------------------------------\n\n\t\t\t\tif ( ! isset($this->CDT) OR ! is_object($this->CDT) )\n\t\t\t\t{\n\t\t\t\t\t$this->load_calendar_datetime();\n\t\t\t\t}\n\n\t\t\t\t$this->CDT->change_date(\n\t\t\t\t\t$end_year,\n\t\t\t\t\t$end_month,\n\t\t\t\t\t$end_day\n\t\t\t\t);\n\n\t\t\t\t$this->CDT->add_day();\n\n\t\t\t\t$E->setProperty(\n\t\t\t\t\t\"dtend\" ,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'year' \t=> $this->CDT->year,\n\t\t\t\t\t\t'month' => $this->CDT->month,\n\t\t\t\t\t\t'day'\t=> $this->CDT->day\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'VALUE' => 'DATE'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$E->setProperty('dtstart', $start_year, $start_month, $start_day, $start_hour, $start_minute, 00);\n\t\t\t\t$E->setProperty('dtend', $end_year, $end_month, $end_day, $end_hour, $end_minute, 00);\n\t\t\t}\n\n\t\t\t$E->setProperty('summary', $title);\n\n\t\t\tif ( ! empty($erules))\n\t\t\t{\n\t\t\t\tforeach ($erules as $rule)\n\t\t\t\t{\n\t\t\t\t\t$E->setProperty('rrule', $rule);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$extras = array();\n\t\t\t$edits\t= array();\n\n\t\t\tif ( ! empty($odata))\n\t\t\t{\n\t\t\t\t$query = ee()->db->query(\n\t\t\t\t\t\"SELECT *\n\t\t\t\t\t FROM\texp_calendar_events_occurrences\n\t\t\t\t\t WHERE\tevent_id = \" . ee()->db->escape_str($id)\n\t\t\t\t);\n\n\t\t\t\tforeach ($query->result_array() as $row)\n\t\t\t\t{\n\t\t\t\t\t//fix blank times\n\t\t\t\t\t$row['start_time'] \t= ($row['start_time'] == 0) ? '0000' \t: $row['start_time'];\n\t\t\t\t\t$row['end_time'] \t= ($row['end_time'] == 0) ? '2400' \t\t: $row['end_time'];\n\n\t\t\t\t\t//looks like an edited occurrence\n\t\t\t\t\t//edits without rules arent really edits.\n\t\t\t\t\tif ($row['event_id'] != $row['entry_id'] AND empty($rules))\n\t\t\t\t\t{\n\t\t\t\t\t\t$edits[] = $row;\n\t\t\t\t\t}\n\t\t\t\t\t//probably entered with the date picker or something\n\t\t\t\t\t//these loose occurences\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$extras[] = $row;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! empty($exdata))\n\t\t\t{\n\t\t\t\t$E->setProperty('exdate', $exdata);\n\t\t\t}\n\n\t\t\tif ($description != '') $E->setProperty('description', $description);\n\t\t\tif ($location != '') $E->setProperty('location', $location);\n\n\n\t\t\t$E->setProperty( \"uid\", $this->make_uid() . '@' . $host);\n\t\t\t$ICAL->setComponent($E);\n\n\t\t\t//--------------------------------------------\n\t\t\t//\tremove rules for subsequent items\n\t\t\t//--------------------------------------------\n\n\t\t\twhile( $E->deleteProperty( \"RRULE\" )) continue;\n\n\t\t\t//edits must come right after\n\t\t\tif ( ! empty($edits))\n\t\t\t{\n\t\t\t\tforeach ($edits as $edit)\n\t\t\t\t{\n\t\t\t\t\t$edit_date = array(\n\t\t\t\t\t\t\"year\" \t=> $edit['start_year'],\n\t\t\t\t\t\t\"month\" => $edit['start_month'],\n\t\t\t\t\t\t\"day\" \t=> $edit['start_day'] ,\n\t\t\t\t\t\t\"hour\" \t=> substr($edit['start_time'], 0, 2) ,\n\t\t\t\t\t\t\"min\" \t=> substr($edit['start_time'], 2, 2)\n\t\t\t\t\t);\n\n\t\t\t\t\t//if this is all day we need to add the dates as params to the dstart and end items\n\t\t\t\t\tif ($this->_is_all_day(\n\t\t\t\t\t\tsubstr($edit['start_time'], 0, 2),\n\t\t\t\t\t\tsubstr($edit['start_time'], 2, 2),\n\t\t\t\t\t\tsubstr($edit['end_time'], 0, 2),\n\t\t\t\t\t\tsubstr($edit['end_time'], 2, 2)\n\t\t\t\t\t ))\n\t\t\t\t\t{\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t\"dtstart\" ,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'year' \t=> $edit['start_year'],\n\t\t\t\t\t\t\t\t'month' => $edit['start_month'],\n\t\t\t\t\t\t\t\t'day'\t=> $edit['start_day']\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'VALUE' => 'DATE'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t\t//\twe need CDT so we can add a day\n\t\t\t\t\t\t//\tgcal, and ical are ok with this being the same day\n\t\t\t\t\t\t//\tstupid damned outlook barfs, hence the +1\n\t\t\t\t\t\t//\tthe +1 doesnt affect g/ical\n\t\t\t\t\t\t//--------------------------------------------\n\n\t\t\t\t\t\tif ( ! isset($this->CDT) OR ! is_object($this->CDT) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->load_calendar_datetime();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->CDT->change_date(\n\t\t\t\t\t\t\t$edit['end_year'],\n\t\t\t\t\t\t\t$edit['end_month'],\n\t\t\t\t\t\t\t$edit['end_day']\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$this->CDT->add_day();\n\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t\"dtend\" ,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'year' \t=> $this->CDT->year,\n\t\t\t\t\t\t\t\t'month' => $this->CDT->month,\n\t\t\t\t\t\t\t\t'day'\t=> $this->CDT->day\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'VALUE' => 'DATE'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t'dtstart',\n\t\t\t\t\t\t\t$edit_date['year'],\n\t\t\t\t\t\t\t$edit_date['month'],\n\t\t\t\t\t\t\t$edit_date['day'],\n\t\t\t\t\t\t\t$edit_date['hour'],\n\t\t\t\t\t\t\t$edit_date['min'],\n\t\t\t\t\t\t\t00\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t'dtend',\n\t\t\t\t\t\t\t$edit['end_year'],\n\t\t\t\t\t\t\t$edit['end_month'],\n\t\t\t\t\t\t\t$edit['end_day'] ,\n\t\t\t\t\t\t\tsubstr($edit['end_time'], 0, 2),\n\t\t\t\t\t\t\tsubstr($edit['end_time'], 2, 2),\n\t\t\t\t\t\t\t00\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t$E->setProperty( \"RECURRENCE-ID\", $edit_date);\n\t\t\t\t\t$E->setProperty( \"uid\", $this->make_uid() . '@' . $host);\n\n\t\t\t\t\t$ICAL->setComponent($E);\n\t\t\t\t}\n\n\t\t\t\t//cleanup\n\t\t\t\t$E->deleteProperty(\"RECURRENCE-ID\");\n\n\t\t\t\t$E->setProperty('dtstart', $start_year, $start_month, $start_day, $start_hour, $start_minute, 00);\n\t\t\t\t$E->setProperty('dtend', $end_year, $end_month, $end_day, $end_hour, $end_minute, 00);\n\t\t\t}\n\n\t\t\t// these random ass add-in dates are non-standard to most cal creation\n\t\t\t// and need to be treated seperately as lumping don't work, dog\n\t\t\tif ( ! empty($extras))\n\t\t\t{\n\t\t\t\tforeach ($extras as $extra)\n\t\t\t\t{\n\n\t\t\t\t\t//if this is all day we need to add the dates as params to the dstart and end items\n\t\t\t\t\tif ($this->_is_all_day(\n\t\t\t\t\t\tsubstr($extra['start_time'], 0, 2),\n\t\t\t\t\t\tsubstr($extra['start_time'], 2, 2),\n\t\t\t\t\t\tsubstr($extra['end_time'], 0, 2),\n\t\t\t\t\t\tsubstr($extra['end_time'], 2, 2)\n\t\t\t\t\t ))\n\t\t\t\t\t{\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t\"dtstart\" ,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'year' \t=> $extra['start_year'],\n\t\t\t\t\t\t\t\t'month' => $extra['start_month'],\n\t\t\t\t\t\t\t\t'day'\t=> $extra['start_day']\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'VALUE' => 'DATE'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t\t//\twe need CDT so we can add a day\n\t\t\t\t\t\t//\tgcal, and ical are ok with this being the same day\n\t\t\t\t\t\t//\tstupid damned outlook barfs, hence the +1\n\t\t\t\t\t\t//\tthe +1 doesnt affect g/ical\n\t\t\t\t\t\t//--------------------------------------------\n\n\t\t\t\t\t\tif ( ! isset($this->CDT) OR ! is_object($this->CDT) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->load_calendar_datetime();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->CDT->change_date(\n\t\t\t\t\t\t\t$extra['end_year'],\n\t\t\t\t\t\t\t$extra['end_month'],\n\t\t\t\t\t\t\t$extra['end_day']\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$this->CDT->add_day();\n\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t\"dtend\" ,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'year' \t=> $this->CDT->year,\n\t\t\t\t\t\t\t\t'month' => $this->CDT->month,\n\t\t\t\t\t\t\t\t'day'\t=> $this->CDT->day\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'VALUE' => 'DATE'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t'dtstart',\n\t\t\t\t\t\t\t$extra['start_year'],\n\t\t\t\t\t\t\t$extra['start_month'],\n\t\t\t\t\t\t\t$extra['start_day'] ,\n\t\t\t\t\t\t\tsubstr($extra['start_time'], 0, 2),\n\t\t\t\t\t\t\tsubstr($extra['start_time'], 2, 2),\n\t\t\t\t\t\t\t00\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t'dtend',\n\t\t\t\t\t\t\t$extra['end_year'],\n\t\t\t\t\t\t\t$extra['end_month'],\n\t\t\t\t\t\t\t$extra['end_day'] ,\n\t\t\t\t\t\t\tsubstr($extra['end_time'], 0, 2),\n\t\t\t\t\t\t\tsubstr($extra['end_time'], 2, 2),\n\t\t\t\t\t\t\t00\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t$E->setProperty( \"uid\", $this->make_uid() . '@' . $host);\n\t\t\t\t\t$ICAL->setComponent($E);\n\t\t\t\t}\n\n\t\t\t\t//clean in case we need to add more later\n\t\t\t\t$E->setProperty('dtstart', $start_year, $start_month, $start_day, $start_hour, $start_minute, 00);\n\t\t\t\t$E->setProperty('dtend', $end_year, $end_month, $end_day, $end_hour, $end_minute, 00);\n\t\t\t}\n\t\t}\n\t\t//return $ICAL->createCalendar();\n\t\treturn $ICAL->returnCalendar();\n\t}", "public function mapSections() {\n\t\t$request = new FetchAdXmlRequest(self::ENG_URL);\n\t\t$this->enArray = $request->send()->getResponseArray();\n\t\tforeach($this->responseArray['section'] as $index => $section) {\n\t\t\t$enName = $this->validateElement($this->enArray['section'][$index]['name']);\n\t\t\t$enDescription = $this->validateElement($this->enArray['section'][$index]['description']);\n\t\t\t$estName = $this->validateElement($section['name']);\n\t\t\t$estDescription = $this->validateElement($section['description']);\n\n\t\t\t$section['eventival_id'] = $this->validateElement($section['id']);\n\n\t\t\t$section['Translation'] = array('et' => array('name' => $estName,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'description' => $estDescription),\n\t\t\t\t\t\t\t\t\t\t 'en' => array('name' => $enName,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'description' => $enDescription)\n\t\t\t\t\t\t\t\t\t );\n\t\t\t$section['title'] = $estName;\n\t\t\tunset($section['id']);\n\t\t\tunset($section['name']);\n\t\t\tunset($section['description']);\n\n\t\t\t$id = $this->checkData($this->tableType, $section['eventival_id']);\n\t\t\tif (!$id) {\n\t\t\t\t$this->createData($this->tableType, $section);\n\t\t\t} else {\n\t\t\t\t$this->updateData($this->tableType, $section, $id);\n\t\t\t}\n\t\t}\n\t}", "function getExceptionEventsArray($from,$to){\n\t\t$select_fields = \t'tx_tdcalendar_exc_events.*';\n\t\t$select_fields .= \t', tx_tdcalendar_exc_categories.uid as category';\n\t\t$select_fields .= \t', tx_tdcalendar_exc_categories.title as cattitle';\n\t\t$select_fields .= \t', tx_tdcalendar_exc_categories.color as color';\n\t\t$select_fields .= \t', tx_tdcalendar_exc_categories.bgcolor as bgcolor';\n\t\t$from_table =\t\t'tx_tdcalendar_exc_events INNER JOIN tx_tdcalendar_exc_categories';\n\t\t$from_table .= \t\t' ON tx_tdcalendar_exc_events.exc_categories = tx_tdcalendar_exc_categories.uid';\n\t\t$where_clause = \t\"(tx_tdcalendar_exc_events.begin < '\".$from.\"' AND tx_tdcalendar_exc_events.end >= '\".$from.\"')\";\n\t\t$where_clause .= \t\" OR (tx_tdcalendar_exc_events.begin >= '\".$from.\"' AND tx_tdcalendar_exc_events.begin < '\".$to.\"')\";\n\t\t$where_clause .=\t$this->enableFieldsExcEvents;\n\t\t$where_clause .=\t$this->enableFieldsExcCategories;\n\t\t$where_clause .=\t$this->getPagesQuery(' tx_tdcalendar_exc_events');\n\t\t$orderBy =\t\t\t'tx_tdcalendar_exc_events.begin, tx_tdcalendar_exc_events.uid';\n\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t$select_fields,\n\t\t\t$from_table,\n\t\t\t$where_clause,\n\t\t\t$groupBy='',\n\t\t\t$orderBy,\n\t\t\t$limit=''\n\t\t);\n\n\t\t$exc_events = array();\n\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t\t\t$exc_events['category'][$row['category']][$row['uid']] = $row['title'];\n\t\t\t$row = $this->setExcItems($row, $from, $to);\n foreach($row as $item){\n $d = strftime('%d', $item['begin']);\n $m = strftime('%m', $item['begin']);\n\n $exc_events[$m][$d][] = $item;\n }\n\t\t}\n\t\treturn $exc_events;\n\t}", "public function getEventInfos() {\n // today will be useful \n $today = new \\DateTime(\"today midnight\");\n \n // get all events\n $events = $this->_machine->plugin(\"DB\")->getEventsFromDB(\"AND events.active = 1\");\n \n // retrieve dates with events\n $dates = [];\n foreach ($events as $ev) {\n $from = new \\DateTimeImmutable($ev[\"time_from\"]);\n $to = new \\DateTimeImmutable($ev[\"time_to\"]);\n $date = $from;\n while ($date <= $to) {\n $dates = $this->_insertDate($dates, $date);\n $date = $date->modify(\"+1 day\");\n }\n }\n \n // retrieve events for today\n $today_events = $this->getEventsForRange(\n $today, $today\n );\n \n // retrieve events for next weekend\n $next_weekend_events = $this->getNextWeekendEvents();\n\n $result = [\n \"tot\" => count($events),\n \"dates\" => $dates,\n \"today\" => $today_events,\n \"next_weekend\" => $next_weekend_events,\n \"events\" => $events\n ];\n \n return $result;\n }", "private function getData()\n {\n $data = array();\n\n $data = array_merge($data,\n $this->services->CalendarData->currentUserData(),\n $this->services->Common->subPageName( $this->timber->translator->trans('Calendar') . \" | \" ),\n $this->services->Common->runtimeScripts( 'calendar' ),\n $this->services->Common->injectScripts(array(\n 'projectsEvents' => $this->services->CalendarData->projectsEvents(),\n 'tasksEvents' => $this->services->CalendarData->tasksEvents(),\n 'projectsEventsColor' => '#ecf0f1',\n 'projectsEventsTextColor' => '#2c3e50',\n 'tasksEventsColor' => '#bdc3c7',\n 'tasksEventsTextColor' => '#2980b9',\n 'calEvent_id' => $this->timber->translator->trans('ID'),\n 'calEvent_iden' => $this->timber->translator->trans('Identifier'),\n 'calEvent_type' => $this->timber->translator->trans('Type'),\n 'calEvent_mi_id' => $this->timber->translator->trans('Milestone ID'),\n 'calEvent_mi_title' => $this->timber->translator->trans('Milestone Title'),\n 'calEvent_pr_id' => $this->timber->translator->trans('Project ID'),\n 'calEvent_owner_id' => $this->timber->translator->trans('Owner ID'),\n 'calEvent_assign_to' => $this->timber->translator->trans('Assignee ID'),\n 'calEvent_assign_to_name' => $this->timber->translator->trans('Assignee Name'),\n 'calEvent_assign_to_email' => $this->timber->translator->trans('Assignee Email'),\n 'calEvent_title' => $this->timber->translator->trans('Title'),\n 'calEvent_description' => $this->timber->translator->trans('Description'),\n 'calEvent_status' => $this->timber->translator->trans('Status'),\n 'calEvent_progress' => $this->timber->translator->trans('Progress'),\n 'calEvent_priority' => $this->timber->translator->trans('Priority'),\n 'calEvent_start_at' => $this->timber->translator->trans('Start at'),\n 'calEvent_end_at' => $this->timber->translator->trans('End at'),\n 'calEvent_created_at' => $this->timber->translator->trans('Created at'),\n 'calEvent_updated_at' => $this->timber->translator->trans('Updated at'),\n 'calEvent_currency' => $this->timber->translator->trans('Currency'),\n 'calEvent_reference' => $this->timber->translator->trans('Reference'),\n 'calEvent_ref_id' => $this->timber->translator->trans('Reference ID'),\n 'calEvent_version' => $this->timber->translator->trans('Version'),\n 'calEvent_budget' => $this->timber->translator->trans('Budget'),\n 'calEvent_tax_value' => $this->timber->translator->trans('Tax Value'),\n 'calEvent_tax_type' => $this->timber->translator->trans('Tax Type'),\n 'calEvent_discount_value' => $this->timber->translator->trans('Discount Value'),\n 'calEvent_discount_type' => $this->timber->translator->trans('Discount Type'),\n 'calEvent_attach' => $this->timber->translator->trans('Attachments'),\n 'calEvent_owners' => $this->timber->translator->trans('Owners'),\n 'calEvent_staff' => $this->timber->translator->trans('Staff'),\n 'calEvent_clients' => $this->timber->translator->trans('Clients'),\n 'calEvent_staff_ids' => $this->timber->translator->trans('Staff IDs'),\n 'calEvent_clients_ids' => $this->timber->translator->trans('Clients IDs'),\n ))\n );\n\n return $data;\n }", "function getEventsArray($from,$to,$exc_entries){\n\t\t$select_fields = \t'tx_tdcalendar_events.*';\n\t\t$select_fields .=\t', tx_tdcalendar_categories.title as category';\n\t\t$select_fields .= \t', tx_tdcalendar_categories.color as catcolor';\n\t\t$select_fields .= \t', tx_tdcalendar_locations.location as location_name';\n\t\t$select_fields .= \t', tx_tdcalendar_organizer.name as organizer_name';\n\n\t\t$from_table =\t\t'((tx_tdcalendar_events'; \n\t\t$from_table .= \t\t' INNER JOIN tx_tdcalendar_categories';\n $from_table .= \t\t' ON tx_tdcalendar_events.category = tx_tdcalendar_categories.uid)';\n\t\t$from_table .= \t\t' LEFT JOIN tx_tdcalendar_locations';\n\t\t$from_table .= \t\t' ON tx_tdcalendar_events.location_id = tx_tdcalendar_locations.uid)';\n\t\t$from_table .= \t\t' LEFT JOIN tx_tdcalendar_organizer';\n\t\t$from_table .= \t\t' ON tx_tdcalendar_events.organizer_id = tx_tdcalendar_organizer.uid';\n\n\t\t$where_clause = \t\"((tx_tdcalendar_events.begin < '\".$from.\"' AND tx_tdcalendar_events.end >= '\".$from.\"')\";\n\t\t$where_clause .= \t\" OR (tx_tdcalendar_events.begin >= '\".$from.\"' AND tx_tdcalendar_events.begin < '\".$to.\"')\";\n\n\t\t$where_clause.= \t\" OR(event_type > 0 AND event_type < 5 AND ((begin < '\".$from.\"' AND rec_end_date = 0) OR (begin < '\".$from.\"' AND rec_end_date >= '\".$from.\"') )))\";\n\n\t\t$where_clause .= \t$this->enableFieldsCategories;\n\t\t$where_clause .=\t$this->enableFieldsEvents;\n\n\t\tif ($this->conf['currCat'] AND !$this->conf['hideCategorySelection'])\n\t\t\t$where_clause .= ' AND tx_tdcalendar_events.category = '.$this->conf['currCat'];\n\t\telse\n\t\t\t$where_clause .= \t$this->getCategoryQuery('tx_tdcalendar_events.category');\n\n\t\t$where_clause .=\t$this->getPagesQuery();\n\n\t\t$orderBy =\t\t\t'tx_tdcalendar_events.begin, tx_tdcalendar_events.uid';\n\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t$select_fields,\n\t\t\t$from_table,\n\t\t\t$where_clause,\n\t\t\t$groupBy='',\n\t\t\t$orderBy,\n\t\t\t$limit=''\n\t\t);\n\n\t\treturn $this->makeArray($res, $from, $to, $exc_entries);\n\t}", "function getICSDates($key, $subKey, $subValue, $icsDates) {\n if ($key != 0 && $subKey == 0) {\n $icsDates [$key] [\"BEGIN\"] = $subValue;\n } else {\n // echo $subValue.'<hr>';\n $subValueArr = explode ( \":\", $subValue, 2 );\n if (isset ( $subValueArr [1] )) {\n $icsDates [$key] [$subValueArr [0]] = $subValueArr [1];\n } \n } \n return $icsDates;\n }", "private function getEvents () \n\n\t\t{\n\t\t\t $dbs = new DB ( $this->config['database'] );\n $c = $dbs->query (\"SELECT * FROM tbl_events_record WHERE org_id = '\" . $this->c . \"'\");\n\t\t\t if ( count ( $c ) ) {\n\t\t\t\t$this->result['data']['id'] = trim ( $this->c );\n\t\t\t\t$this->result['data']['events'] = $c[0]['events'];\n\t\t\t\t$this->result['data']['date'] = $c[0]['date_rec'];\n\t\t\t } else \n\t\t\t\t$this->result['data']['result'] = \"Not found [error code:100:101]\";\n\n\t\t\t $dbs->CloseConnection ();\n\t\t\t\n\t\t \treturn;\n\t\t}", "function formatEventICal($event, $time)\n{\n\t/*\n\t$firststart = \"Z\";\n\tif($event->has(\"event:time\"))\n\t{\n\t\tforeach($event->all(\"event:time\") as $time)\n\t\t{\n\t\t\tif($time->has(\"tl:at\"))\n\t\t\t{\n\t\t\t\t//$eventstr .= fold(\"RDATE;VALUE=DATE;TZID=Europe/London:\".formatDateICal($time->getString(\"tl:at\")));\n\t\t\t\t$date = formatDateICal($time->getString(\"tl:at\")).\"/P1D\";\n\t\t\t\t$eventstr .= fold(\"RDATE;VALUE=PERIOD;TZID=Europe/London:\".$date);\n\t\t\t\t$firststart = min($firststart, $date);\n\t\t\t}\n\t\t\tif($time->has(\"tl:start\"))\n\t\t\t{\n\t\t\t\tif($time->has(\"tl:end\"))\n\t\t\t\t{\n\t\t\t\t\t$date = formatDateICal($time->getString(\"tl:start\")).\"/\".formatDateICal($time->getString(\"tl:end\"));\n\t\t\t\t\t$eventstr .= fold(\"RDATE;VALUE=PERIOD;TZID=Europe/London:\".$date);\n\t\t\t\t\t$firststart = min($firststart, $date);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//$eventstr .= fold(\"RDATE;VALUE=DATE-TIME;TZID=Europe/London:\".formatDateICal($time->getString(\"tl:start\")));\n\t\t\t\t\t$date = formatDateICal($time->getString(\"tl:start\")).\"/PT1H\";\n\t\t\t\t\t$eventstr .= fold(\"RDATE;VALUE=PERIOD;TZID=Europe/London:\".$date);\n\t\t\t\t\t$firststart = min($firststart, $date);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\treturn \"\";\n\t}\n\t*/\n\n\tif($time->has(\"tl:at\"))\n\t{\n\t\t$date = formatDateICal($time->getString(\"tl:at\")).\"/P1D\";\n\t}\n\tif($time->has(\"tl:start\"))\n\t{\n\t\tif($time->has(\"tl:end\"))\n\t\t{\n\t\t\t$date = formatDateICal($time->getString(\"tl:start\")).\"/\".formatDateICal($time->getString(\"tl:end\"));\n\t\t\tif(strlen($date) == 31 && substr($date, 9, 6) == \"000000\" && substr($date, 25, 6) == \"000000\")\n\t\t\t{\n\t\t\t\t$date = substr($date, 0, 8).\"/\".substr($date, 16, 8);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$date = formatDateICal($time->getString(\"tl:start\")).\"/PT1H\";\n\t\t}\n\t}\n\n\t$str = \"BEGIN:VEVENT\\n\";\n\t$str .= fold(\"UID:\".(string)($time));\n\t$str .= fold(\"SUMMARY:\".$event->label());\n\tif( $event->has( \"dct:description\" ) )\n\t{\n\t\t$str .= fold(\"DESCRIPTION:\".$event->getString( \"dct:description\" ));\n\t}\n\t//$str .= \"GEO:\".$event->label().\"\\n\";\n\tif( $event->has( \"event:place\" ) )\n\t{\n\t\tforeach( $event->all( \"event:place\" ) as $place )\n\t\t{\n\t\t\t//echo $place->dump();\n\t\t\t$str .= fold(\"LOCATION:\".$place->label());\n\t\t}\n\t}\n\tif( $event->has( \"foaf:homepage\" ) )\n\t{\n\t\t$str .= fold(\"URL:\".$event->get( \"foaf:homepage\" ));\n\t}\n\t//$str .= \"ORGANIZER:\".$event->label().\"\\n\";\n\t$date = explode(\"/\", $date);\n\t$str .= fold(\"DTSTART;TZID=Europe/London:\".$date[0]);\n\tif($date[1][0] == 'P')\n\t{\n\t\t$str .= fold(\"DURATION:\".$date[1]);\n\t}\n\telse\n\t{\n\t\tif(strlen($date[1]) == 8)\n\t\t{\n\t\t\t$t = new DateTime(substr($date[1], 0, 4).'/'.substr($date[1], 4, 2).'/'.substr($date[1], 6, 2));\n\t\t\t$t->add('P1D');\n\t\t\t$date[1] = $t->format('Ymd');\n\t\t\techo \"____\";\n\t\t}\n\t\t$str .= fold(\"DTEND;TZID=Europe/London:\".$date[1]);\n\t}\n\t//$str .= $eventstr;\n\t$str .= \"END:VEVENT\\n\";\n\treturn $str;\n}", "public function eventsSchema($rows,$userid)\n\t{\n\t\t$lang = JFactory::getLanguage();\n\t\t$lang->load('com_easysocial', JPATH_ADMINISTRATOR, '', true);\n\t\t$result = array();\t\t\n\t\tforeach($rows as $ky=>$row)\n\t\t{\n\t\t\tif(isset($row->id))\n\t\t\t{\t\n\t\t\t\t$item = new EventsSimpleSchema();\n\t\t\t\t\n\t\t\t\t/*Get Cover POsition */\n\t\t\t\t$grpobj = FD::event( $row->id );\n\t\t\t\t$x = $grpobj->cover->x;\n\t\t\t\t$y = $grpobj->cover->y;\n\t\t\t\t$item->cover_position = $x.'% '.$y.'%';\n\t\t\t\t\n\t\t\t\t$item->id=$row->id;\n\t\t\t\t$item->title=$row->title;\n\t\t\t\t$item->description=$row->description;\n\t\t\t\t//getting all event images\n\t\t\t\tforeach($row->avatars As $ky=>$avt)\n\t\t\t\t{\n\t\t\t\t\t$avt_key = 'avatar_'.$ky;\n\t\t\t\t\t$item->$avt_key = JURI::root().'media/com_easysocial/avatars/event/'.$row->id.'/'.$avt;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$fst = JFile::exists('media/com_easysocial/avatars/event/'.$row->id.'/'.$avt);\n\t\t\t\t\t//set default image\n\t\t\t\t\tif(!$fst)\n\t\t\t\t\t{\n\t\t\t\t\t\t$item->$avt_key = JURI::root().'media/com_easysocial/defaults/avatars/event/'.$ky.'.png';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//end\n\t\t\t\n\t\t\t\t$item->params=json_decode($row->params);\n\t\t\t\t$item->details=$row->meta;\n\t\t\t\t//ios format date\n\t\t\t\tif(!empty($item->details->start))\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$item->details->ios_start = $this->listDate($item->details->start);\n\t\t\t\t\t$item->start_date = date('D M j Y h:i a',strtotime($row->meta->start));\t\t\t\t\t\n\t\t\t\t\t$item->start_date_unix = strtotime($row->meta->start);\n\t\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t\t\n\n\t\t\t\tif( $item->details->end == \"0000-00-00 00:00:00\")\n\t\t\t\t{\n\t\t\t\t\t$item->details->ios_end = null;\n\t\t\t\t\t$item->end_date = null;\n\t\t\t\t\t$item->end_date_unix = null;\n\t\t\t\t}\n\t\t\t\telse\t\t\t\t\n\t\t\t\t{\n\t\t\t\t\t$item->details->ios_end = $this->listDate($item->details->end);\n\t\t\t\t\t$item->end_date = date('D M j Y h:i a ',strtotime($row->meta->end));\n\t\t\t\t\t$item->end_date_unix = strtotime($row->meta->end);\n\t\t\t\t}\n\n\t\t\t\t$item->start_date_unix = strtotime($row->meta->start);\n\t\t\t\t$item->end_date_unix = strtotime($row->meta->end);\n\t\t\t\t\n\t\t\t\t$event = FD::model( 'events' );\n\t\t\t\t$item->guests= $event->getTotalAttendees($row->id);\n\t\t\t\t\n\t\t\t\t$item->featured=$row->featured;\n\t\t\t\t$item->created=$row->created;\n\t\t\t\t$item->categoryId=$row->category_id;\n\t\t\t\t$item->type=$row->type;\n\t\t\t\n\t\t\t\t//get category name\n\t\t\t\t$category \t= FD::table('EventCategory');\n\t\t\t\t$category->load($row->category_id);\t\t\t\t\n\t\t\t\t$item->category_name = $category->get('title');\n\t\t\t\t\n\t\t\t\t//event guest status\n\t\t\t\t$eventobj=FD::event($row->id);\t\n\t\t\t\t$item->isAttending=$eventobj->isAttending($userid);\n\t\t\t\t$item->isNotAttending=$eventobj->isNotAttending($userid);\n\t\t\t\t$item->isOwner=$eventobj->isOwner($userid);\n\t\t\t\t$item->isPendingMember = $eventobj->isPendingMember($userid);\n\t\t\t\t$item->isMember=$eventobj->isMember($userid);\t\n\t\t\t\t$item->isRecurring=$eventobj->isRecurringEvent(); \n\t\t\t\t$item->hasRecurring=$eventobj->hasRecurringEvents();\t\t\t\t\n\t\t\t\t\n\t\t\t\t$event_owner = reset($row->admins);\n\t\t\t\tif($event_owner)\n\t\t\t\t{\n\t\t\t\t$item->owner = $this->createUserObj($event_owner)->username;\n\t\t\t\t$item->owner_id = $event_owner;\n\t\t\t\t} \t\t\n\t\t\t\t//$item->owner=$user->username;\n\t\t\t\t\n\t\t\t\t$item->isMaybe=in_array($userid,$row->maybe);\n\t\t\t\t$item->total_guest=$eventobj->getTotalGuests();\n\t\t\t\t// this node is for past events\n\t\t\t\t$item->isoverevent=$eventobj->isOver();\n\t\t\t\tif($item->end_date == null){\n\t\t\t\t\t$item->isoverevent = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$item->location=$row->address;\n\t\t\t\t$item->longitude=$row->longitude;\n\t\t\t\t$item->latitude=$row->latitude;\n\t\t\t\t$NameLocationLabel = $item->location;\n\t\t\t\t$item->event_map_url_andr = \"geo:\".$item->latitude.\",\".$item->longitude.\"?q=\".$NameLocationLabel;\n\t\t\t\t$item->event_map_url_ios = \"http://maps.apple.com/?q=\".$NameLocationLabel.\"&sll=\".$item->latitude.\",\".$item->longitude;\t\t\t\t\n\t\t\t\t$item->share_url = JURI::root().$eventobj->getPermalink(true, false, 'item', false);\n\t\t\t\t//getting cover image of event\n\t\t\t\t$eve = FD::table( 'Cover' );\n\t\t\t\t$eve->type='event';\n\t\t\t\t$eve->photo_id=$row->cover->photo_id;\n\t\t\t\t$item->cover_image=$eve->getSource();\n\t\t\t\t//end\n\t\t\t\t$item->isInvited = false;\n\t\t\t\t$event = FD::event($row->id);\n\t\t\t\t$guest = $event->getGuest($userid);\n\t\t\t\tif ($guest->invited_by) {\t\n\t\t\t\t\t$item->isInvited = true;\n\t\t\t\t}\n\t\t\t\t$result[] = $item;\n\t\t\t}\n\t\t}\n\t\treturn($result);\t\n\t}", "function calendarioJson() {\n \t$fp = fopen(\"ics/basic5.ics\", \"r\"); \n\t$temp = fread($fp, filesize(\"ics/basic5.ics\"));\n\t//Ver si se necesita nl2br\n\t$salida = icsAJson(json_encode(nl2br($temp)));\n\t//Este es el Json Final\n\treturn ('[' . $salida . ']');\n}", "public function getEventClassSections();", "public function getSections(): iterable;", "function getEventsFeed($args = array()) {\n\t \t$events = $this->getEventsExternal($args);\n\n\t \t$esc_chars = \",;\\\\\";\n\n\t \t// Get Page url if any\n\t \t$page_id = intval(get_option('fse_page'));\n\t \tif (!empty($page_id)) {\n\t \t\t$page_url = get_permalink($page_id);\n\t \t\tif (!empty($page_url)) {\n\t \t\t\tif (strpos($page_url, '?') === false)\n\t \t\t\t$page_url .= '?event=';\n\t \t\t\telse\n\t \t\t\t$page_url .= '&event=';\n\t \t\t}\n\t \t}\n\n\t \t$feed = array();\n\t \t$feed[] = 'BEGIN:VCALENDAR';\n\t \t$feed[] = 'METHOD:PUBLISH';\n\t \t$feed[] = 'PRODID:http://www.faebusoft.ch/webentwicklung/wpcalendar/';\n\t \t$feed[] = 'VERSION:2.0';\n\t \t$feed[] = 'X-WR-TIMEZONE:'.get_option('timezone_string');\n\n\t \t//print_r($events);\n\n\t \tforeach($events as $e) {\n\n\t \t\t$feed[] = 'BEGIN:VEVENT';\n\n\t \t\t$feed[] = 'UID:'.get_bloginfo('url').'/feed/ical/'.$e->eventid;\n\t \t\t//$feed[] = 'UID:'.md5(uniqid());\n\n\t \t\t// Add description\n\t \t\t$feed[] = 'DESCRIPTION:'.str_replace(array(\"\\r\",\"\\n\"), array('','\\n'),addcslashes(trim(strip_tags($e->getDescription())), $esc_chars));\n\n\t \t\t// Categories\n\t \t\tforeach($e->categories_t as $k => $c) {\n\t \t\t\t$e->categories_t[$k] = addcslashes($c, $esc_chars);\n\t \t\t}\n\t \t\t$feed[] = 'CATEGORIES:'.implode(',',$e->categories_t);\n\n\t \t\t// Location\n\t \t\t$feed[] = 'LOCATION:'.addcslashes($e->location, $esc_chars);\n\n\t \t\t// Summary\n\t \t\t$feed[] = 'SUMMARY:'.addcslashes($e->subject, $esc_chars);\n\n\t \t\t// Times\n\t \t\tif ($e->allday == true) {\n\t \t\t\t$feed[] = 'DTSTART;TZID='.get_option('timezone_string').';VALUE=DATE:'.mysql2date('Ymd', $e->from);\n\n\t \t\t\t// End has to be + 1!\n\t \t\t\t$end = strtotime($e->to)+(60*60*24);\n\t \t\t\t$feed[] = 'DTEND;TZID='.get_option('timezone_string').';VALUE=DATE:'.date('Ymd', $end);\n\t \t\t} else {\n\t \t\t\t$feed[] = 'DTSTART;TZID='.get_option('timezone_string').':'.mysql2date('Ymd\\THis', $e->from);\n\t \t\t\t$feed[] = 'DTEND;TZID='.get_option('timezone_string').':'.mysql2date('Ymd\\THis', $e->to);\n\t \t\t}\n\n\t \t\t// Classification\n\t \t\t$feed[] = 'CLASS:PUBLIC';\n\n\t \t\t// Publish Date of event\n\t \t\t$feed[] = 'DTSTAMP;TZID='.get_option('timezone_string').':'.mysql2date('Ymd\\THis', $e->publishdate);\n\n\t \t\t// URL of event\n\t \t\tif (!empty($e->postid)) {\n\t \t\t\t$feed[] = 'URL:'.get_permalink($e->postid);\n\t \t\t} elseif (!empty($page_url)) {\n\t \t\t\t$feed[] = 'URL:'.$page_url.$e->eventid;\n\t \t\t}\n\n\t \t\t$feed[] = 'END:VEVENT';\n\t \t}\n\n\t \t$feed[] = 'END:VCALENDAR';\n\n\t \t// Now trim all date to maxium 75chars\n\t \t$output = '';\n\t \tforeach ($feed as $f) {\n\t \t\t$new_line = true;\n\t \t\twhile(strlen($f) > 0) {\n\t \t\t\tif (!$new_line) {\n\t \t\t\t\t$output .= \"\\r\\n \"; // Add CRLF + Space!\n\t \t\t\t}\n\t \t\t\t$output .= substr($f, 0, 72);\n\t \t\t\t// String kürzen\n\t \t\t\tif (strlen($f) > 72) {\n\t \t\t\t\t$f = substr($f, 72);\n\t \t\t\t\t$new_line = false;\n\t \t\t\t} else {\n\t \t\t\t\t$f = '';\n\t \t\t\t}\n\t \t\t}\n\t \t\t$output .= \"\\r\\n\";\n\t \t}\n\n\t \treturn $output;\n\t }", "function build_events($files, $categories, $BOX) {\n $events = array();\n foreach ($files as $cat => $catarray) {\n $events[$cat] = array();\n $counter = 1;\n foreach ($catarray as $event => $earray) {\n $cevent = explode('.', $event);\n if (count($cevent) > 1) {\n $cevent = $cevent[1];\n } else {\n $cevent = $cevent[0];\n }\n $events[$cat][$counter] = array('name' => $cevent, 'box' => array());\n $fcounter = 0;\n foreach ($earray as $fn => $fndata) {\n if ($fndata['category'] != '' && !isset($events[$cat][$counter]['box'][$fndata['category']])) {\n $events[$cat][$counter]['box'][$fndata['category']] = $fndata;\n $events[$cat][$counter]['box'][$fndata['category']]['filename'] = $fn;\n $events[$cat][$counter]['box'][$fndata['category']]['ftype'] = $cat;\n $events[$cat][$counter]['box'][$fndata['category']]['fclass'] = $counter;\n $events[$cat][$counter]['box'][$fndata['category']]['fid'] = $fcounter;\n }\n $fcounter++;\n }\n $counter++;\n }\n }\n return $events;\n }" ]
[ "0.63526076", "0.6227122", "0.6186385", "0.61553735", "0.6102202", "0.5995124", "0.5919167", "0.5910871", "0.58831584", "0.5865572", "0.57936907", "0.57644707", "0.5659106", "0.56334555", "0.56261796", "0.5602987", "0.5496541", "0.5482768", "0.54577166", "0.5422822", "0.53998554", "0.5391964", "0.5355273", "0.53542995", "0.5350778", "0.53324085", "0.5298391", "0.52816904", "0.5250781", "0.520068" ]
0.64416
0
Sets and resolves a new connection to redis. It accepts a previously instatiated Predis\Client or anything that the Predis\Client constructor deals with: A parameters array or a connection string.
public function setConnection($client) { if ( is_string($client) || is_array($client) ) { $this->redis = null; $this->parameters = $client; } else { $this->redis = $client; } return $this->resolveConnection(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function resolveConnection() {\n if ( !is_null($this->redis) ) return $this->redis;\n\n $parameters = $this->parameters ?: getenv('REDIS_URL') ?: 'tcp://127.0.0.1/6379?database=0';\n\n $this->redis = new Client($parameters);\n\n return $this->redis;\n }", "public function connect() : \\Redis\n {\n $redis = new \\Redis();\n\n $redis->pconnect(\n $this->getIp(),\n $this->getPort(),\n self::TIMEOUT,\n $this->getPersistantId()\n );\n \n if ($this->getPassword() !== null) {\n $redis->auth($this->getPassword());\n }\n\n $redis->setOption(\\Redis::OPT_READ_TIMEOUT, 60);\n $redis->config('SET', 'timeout', '10');\n\n return $redis;\n }", "public function connect(array $config, array $options)\n {\n return new PhpRedisConnection($this->createClient(array_merge(\n $config, $options, Arr::pull($config, 'options', [])\n )));\n }", "function connectToRedis()\n {\n\n Predis\\Autoloader::register();\n try {\n $redis = new Predis\\Client(array(\n \"host\" => \"\",\n \"port\" => \"6379\"\n ));\n } catch (Exception $e) {\n echo (\"Could not connected to Redis \" . $e->getMessage());\n }\n return $redis;\n }", "function conn_redis() {\n\tglobal $REDIS_HOSTS, $REDIS_PORTS;\n\n\tif (false) {\n\t\t// nrk/Predis, deprecated at 2013.07.25 by performance issue\n\t\t$redis_config = array(\n\t\t\t\t'host' => 'ew_tb_was_3p',\n\t\t\t\t'read_write_timeout' => 60,\n\t\t\t\t'connection_persistent' => true,\n\t\t);\n\n\t\trequire_once 'Predis/Autoloader.php';\n\t\tPredis\\Autoloader::register();\n\n\t\t$redis = new Predis\\Client($redis_config);\n\t} else {\n\t\tglobal $global_redis;\n\n\t\t$host = $REDIS_HOSTS[0];\n\t\t$port = $REDIS_PORTS[0];\n\n\t\ttry {\n\t\t\tif ( $global_redis ) {\n\t\t\t\t# $global_redis->ping();\n\t\t\t\treturn $global_redis;\n\t\t\t}\n\t\t} catch (RedisException $e) {\n\t\t\t$global_redis = null;\n\t\t}\n\n\t\tif ( !$global_redis ) {\n\t\t\t$redis = new Redis();\n\t\t\t$redis->connect($host, $port);\n\t\t\t#$redis->pconnect($host, $port);\n\t\t\t#$redis->setOption(Redis::OPT_READ_TIMEOUT, \"60.0\");\n\t\t\t$global_redis = $redis;\n\t\t}\n\t}\n\n\treturn $redis;\n}", "public function getConnection() {\n return $this->redis;\n }", "public function connect( $db_params = null )\n\t{\n\t\tself::$connection_params = sha1( serialize( $db_params ) );\n\n\t\tif ( !isset( self::$connected_client[self::$connection_params] ) )\n\t\t{\n\t\t\tinclude_once ROOT_PATH . '/libs/'.Config::getInstance()->getLibrary( 'predis' ).'/lib/Predis.php';\n\n\t\t\tif ( empty( $db_params ) )\n\t\t\t{\n\t\t\t\t$db_params = Domains::getInstance()->getParam( 'redis' );\n\t\t\t}\n\t\t\tself::$connected_client[self::$connection_params] = new Predis_Client( $db_params );\n\t\t}\n\n\t\treturn self::$connected_client[self::$connection_params];\n\t\t//return Predis_Client::create( Config::getInstance()->getConfig( 'redis' ) );\n\t}", "function set_client($db=0) {\n\t\ttry {\n\t\t\t$CI =& get_instance();\n\t\t\t$conf = array(\n\t\t\t\t\"scheme\" => \"tcp\",\n\t\t\t\t\"host\" => '127.0.0.1',\n\t\t\t\t\"port\" => 6379\n\t\t\t);\n\t\t\tif(is_numeric($db)) if($db > 0) $conf['database'] = $db;\n\n\t\t\t$redis = new Predis\\Client($conf);\n\t\t\t\n\t\t\treturn $redis;\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\techo $e->getMessage();\n\t\t}\n\t}", "public static function getConnection($config = null) {\n if (null == $config || is_string($config)) {\n $c = ConfigHandler::get('redis');\n if (null == $config || !isset($c[$config])) {\n $config = $c['__default__'];\n }\n\n if (!isset($c[$config])) {\n throw new \\RedisException(\"Connection config not found with '{$config}'\");\n }\n\n $config = $c[$config];\n }\n\n return Connection::getInstance($config['dsn'], (isset($config['option']) && $config['option'])? $config['option'] : array());\n }", "public static function createConnection($dsn, array $options = array())\n {\n if (0 !== strpos($dsn, 'redis://')) {\n throw new InvalidArgumentException(sprintf('Invalid Redis DSN: %s does not start with \"redis://\"', $dsn));\n }\n $params = preg_replace_callback('#^redis://(?:([^@]*)@)?#', function ($m) use (&$auth) {\n if (isset($m[1])) {\n $auth = $m[1];\n }\n\n return 'file://';\n }, $dsn);\n if (false === $params = parse_url($params)) {\n throw new InvalidArgumentException(sprintf('Invalid Redis DSN: %s', $dsn));\n }\n if (!isset($params['host']) && !isset($params['path'])) {\n throw new InvalidArgumentException(sprintf('Invalid Redis DSN: %s', $dsn));\n }\n if (isset($params['path']) && preg_match('#/(\\d+)$#', $params['path'], $m)) {\n $params['dbindex'] = $m[1];\n $params['path'] = substr($params['path'], 0, -strlen($m[0]));\n }\n $params += array(\n 'host' => isset($params['host']) ? $params['host'] : $params['path'],\n 'port' => isset($params['host']) ? 6379 : null,\n 'dbindex' => 0,\n );\n if (isset($params['query'])) {\n parse_str($params['query'], $query);\n $params += $query;\n }\n $params += $options + self::$defaultConnectionOptions;\n $class = null === $params['class'] ? (extension_loaded('redis') ? \\Redis::class : \\Predis\\Client::class) : $params['class'];\n\n if (is_a($class, \\Redis::class, true)) {\n $connect = empty($params['persistent']) ? 'connect' : 'pconnect';\n $redis = new $class();\n @$redis->{$connect}($params['host'], $params['port'], $params['timeout'], null, $params['retry_interval']);\n\n if (@!$redis->isConnected()) {\n $e = ($e = error_get_last()) && preg_match('/^Redis::p?connect\\(\\): (.*)/', $e['message'], $e) ? sprintf(' (%s)', $e[1]) : '';\n throw new InvalidArgumentException(sprintf('Redis connection failed%s: %s', $e, $dsn));\n }\n\n if ((null !== $auth && !$redis->auth($auth))\n || ($params['dbindex'] && !$redis->select($params['dbindex']))\n || ($params['read_timeout'] && !$redis->setOption(\\Redis::OPT_READ_TIMEOUT, $params['read_timeout']))\n ) {\n $e = preg_replace('/^ERR /', '', $redis->getLastError());\n throw new InvalidArgumentException(sprintf('Redis connection failed (%s): %s', $e, $dsn));\n }\n } elseif (is_a($class, \\Predis\\Client::class, true)) {\n $params['scheme'] = isset($params['host']) ? 'tcp' : 'unix';\n $params['database'] = $params['dbindex'] ?: null;\n $params['password'] = $auth;\n $redis = new $class((new Factory())->create($params));\n } elseif (class_exists($class, false)) {\n throw new InvalidArgumentException(sprintf('\"%s\" is not a subclass of \"Redis\" or \"Predis\\Client\"', $class));\n } else {\n throw new InvalidArgumentException(sprintf('Class \"%s\" does not exist', $class));\n }\n\n return $redis;\n }", "protected function connectClient()\n {\n $host = isset($this->clientOptions['host']) ? $this->clientOptions['host'] : '127.0.0.1';\n $port = isset($this->clientOptions['port']) ? $this->clientOptions['port'] : 6379;\n $password = isset($this->clientOptions['password']) ? $this->clientOptions['password'] : '';\n $database = isset($this->clientOptions['database']) ? $this->clientOptions['database'] : 0;\n // The connection read timeout should be higher than the timeout for blocking operations!\n $timeout = isset($this->clientOptions['timeout']) ? $this->clientOptions['timeout'] : round($this->defaultTimeout * 1.5);\n\n $connected = $this->client->connect($host, $port, $timeout);\n if ($connected) {\n if ($password !== '') {\n $authSuccess = $this->client->auth($password);\n if ($authSuccess !== true) {\n throw new JobQueueException('Redis authentication failed.', 1536735535);\n }\n }\n $connected = $this->client->select($database);\n }\n\n // Break the cycle that could cause a high CPU load\n if (!$connected) {\n usleep($this->reconnectDelay * 1e6);\n $this->reconnectDelay = min($this->reconnectDelay * $this->reconnectDecay, $this->maxReconnectDelay);\n } else {\n $this->reconnectDelay = 1.0;\n }\n return $connected;\n }", "function __construct()\n {\n try \n { \n \n $this->database = new Predis\\Client( [ \n \"scheme\" => \"tcp\", \n \"host\" => \"localhost\", \n \"port\" => 6379] );\n \n }\n catch (Exception $e)\n { \n error_log('error with Redis '. $e->getMessage() ); \n exit; \n \n } \n }", "public function initializeSingle($host = '127.0.0.1', $port = 6379, $options = null) {\n $redisOptions = [\n 'scheme' => 'tcp',\n 'host' => $host,\n 'port' => $port,\n ];\n\n if ($options != null) {\n $redisOptions = array_merge($redisOptions, $options);\n }\n $this->client = new Client($redisOptions);\n }", "protected function connect(array & $resource) {\r\n\t\t$server = $resource ['server'];\r\n\t\t$redis = $resource ['resource'];\r\n\t\tif ($resource ['persistent_id'] !== '') {\r\n\t\t\t// connect or reuse persistent connection\r\n\t\t\t$success = $redis->pconnect ( $server ['host'], $server ['port'], $server ['timeout'], $server ['persistend_id'] );\r\n\t\t} elseif ($server ['port']) {\r\n\t\t\t$success = $redis->connect ( $server ['host'], $server ['port'], $server ['timeout'] );\r\n\t\t} elseif ($server ['timeout']) {\r\n\t\t\t// connect through unix domain socket\r\n\t\t\t$success = $redis->connect ( $server ['host'], $server ['timeout'] );\r\n\t\t} else {\r\n\t\t\t$success = $redis->connect ( $server ['host'] );\r\n\t\t}\r\n\t\t\r\n\t\tif (! $success) {\r\n\t\t\tthrow new Exception\\RuntimeException ( 'Could not estabilish connection with Redis instance' );\r\n\t\t}\r\n\t\t\r\n\t\t$resource ['initialized'] = true;\r\n\t\tif ($resource ['password']) {\r\n\t\t\t$redis->auth ( $resource ['password'] );\r\n\t\t}\r\n\t\t$redis->select ( $resource ['database'] );\r\n\t}", "public static function getClient(){\n $redis=new \\Redis();\n $redis->connect(self::CLIENT_CONF['host'], self::CLIENT_CONF['port']);\n $redis->auth(self::CLIENT_CONF['password']);\n return $redis;\n }", "public function getRedisClient( ){\n if( empty( $this->redisHandler ) ){\n $this->redisHandler = new RedisHandler();\n }\n return $this->redisHandler->getConnection();\n }", "protected function connect()\n {\n $return = false;\n try {\n $this->connection = new Redis();\n if (empty($this->settings['persistent'])) {\n $return = $this->connection->connect(\n $this->settings['server'],\n $this->settings['port'],\n $this->settings['timeout']\n );\n } else {\n $return = $this->connection->pconnect(\n $this->settings['server'],\n $this->settings['port'],\n $this->settings['timeout']\n );\n }\n } catch (RedisException $e) {\n return false;\n }\n if ($return && $this->settings['password']) {\n $return = $this->connection->auth($this->settings['password']);\n }\n return $return;\n }", "public function getConnection()\n\t{\n\t\tif ($this->_connection === null) {\n\t\t\t$this->_connection = Yii::createComponent(\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\"class\" => \"packages.redis.ARedisConnection\",\n\t\t\t\t\t\t\t\t\t\t\"hostname\" => REDIS_HOSTNAME,\n\t\t\t\t\t\t\t\t\t\t\"port\" => REDIS_PORT,\n\t\t\t\t\t\t\t\t\t\t\"database\" => REDIS_DATABASE\n\t\t\t\t\t\t\t\t\t));\n\t\t}\n\t\treturn $this->_connection;\n\t}", "public function getConnection()\n\t{\n\t\tif ($this->_connection === null) {\n\t\t\t$this->_connection = Yii::createComponent(\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\"class\" => \"packages.redis.ARedisConnection\",\n\t\t\t\t\t\t\t\t\t\t\"hostname\" => REDIS_HOSTNAME,\n\t\t\t\t\t\t\t\t\t\t\"port\" => REDIS_PORT,\n\t\t\t\t\t\t\t\t\t\t\"database\" => REDIS_DATABASE\n\t\t\t\t\t\t\t\t\t));\n\t\t}\n\t\treturn $this->_connection;\n\t}", "public function GetRedisConn() {\n\t\treturn $this->redis_conn;\n\t}", "public function open() {\n $host = Configure::read('RedisSession.hostname');\n $port = Configure::read('RedisSession.port');\n $password = Configure::read('RedisSession.password');\n $database = Configure::read('RedisSession.database');\n\n if ($host !== null && $port !== null) {\n $redis = new iRedisForRedisSession(array('hostname' => $host, 'port' => $port));\n }\n else {\n $redis = new iRedisForRedisSession();\n }\n if (!empty($password)) {\n $redis->auth($password);\n }\n if (!empty($database)) {\n $redis->select($database);\n }\n\n self::$store = $redis;\n }", "public function initializeCluster($servers = [\n 'scheme' => 'tcp',\n 'host' => '127.0.0.1',\n 'port' => 6379,\n ], $options = null) {\n\n $clusterOptions = array(\n 'cluster' => 'redis'\n );\n\n if ($options != null) {\n $clusterOptions = array_merge($clusterOptions, $options);\n }\n\n // Initialize redis client\n $this->client = new Client($servers, $clusterOptions);\n }", "public function getRedisClient()\n {\n if (empty($this->redisClient)) {\n $this->redisClient = new Client($this->redisParams, $this->redisOptions);\n }\n return $this->redisClient;\n }", "protected function connect() \n {\n $this->socket = @stream_socket_client(\n $this->host.':'.$this->port,\n $errorNumber,\n $errorDescription,\n $this->timeout ? $this->timeout : ini_get('default_socket_timeout')\n );\n if ($this->socket) {\n if ($this->password!==null) {\n $this->executeCommand('AUTH', array($this->password)); \n }\n $this->executeCommand('SELECT', array($this->db));\n } else {\n throw new Exception(\n 'Failed to connect to redis: '.$errorDescription,\n (int)$errorNumber\n );\n }\n }", "public function factory()\n {\n $redis = new \\Redis();\n $host = $this->getConfig()->getValue(self::CONFIG_HOST);\n $port = $this->getConfig()->getValue(self::CONFIG_PORT);\n $timeout = $this->getConfig()->getValue(self::CONFIG_TIMEOUT);\n\n if ($this->getConfig()->getValueFlag(self::CONFIG_PERSISTENT)) {\n $redis->pconnect($host, $port, $timeout);\n } else {\n $redis->connect($host, $port, $timeout);\n }\n\n if ($this->getConfig()->hasValue(self::CONFIG_DATABASE)) {\n $redis->select($this->getConfig()->getValue(self::CONFIG_DATABASE));\n }\n\n return $redis;\n }", "private function __construct()\n {\n $this->cache = new \\Redis();\n if ($this->cache->connect('redis')) {\n echo 'Connected to Redis' . PHP_EOL;\n $this->cache->delete(self::CLIENTS_KEY);\n }\n }", "static public function connect($index = 'user', $host = null, $port = null)\n\t{\n\n\t\t//----------------------------octopus update 2014-01-03----------------------------------\n\t\t//根据业务,把redis拆分成两部分,user 和 card\n\t//\t\tif (!isset(self::$_dbIndex[$index])) {\n\t//\t\t\tthrow new Exception('DB index not found.');\n\t//\t\t}\n\t\t//$db = self::$_dbIndex[$index];\n\t\tif (!extension_loaded('redis'))\n\t\t\tthrow new Exception('Redis extension not found.');\n\t\t$redisConfig = TZ_Loader::config('redis');\n\t\tif (empty($redisConfig))\t\n\t\t\tthrow new Exception('Reids Configuration error.');\n\t\t$redis = new Redis();\n\t\t$host = (null === $host) ? $redisConfig[$index]['host'] : $host;\n\t\t$port = (null === $port) ? $redisConfig[$index]['port'] : $port;\n\t\t$connection = $redis->pconnect($host, $port);\n if(!empty($redisConfig[$index]['auth'])){\n $redis->auth($redisConfig[$index]['auth']); //设置密码\n }\n\t\tif (!$connection)\n {\n\t\t\tthrow new Exception('Can\\'t connect to Redis server.');\n }\n\t\t//$redis->select($db);\n\t\t//-----------------------------------end ---------------------------------------------------\t\n\t\treturn $redis;\n\t}", "public function __construct(array $config)\n {\n // We need the redis extension in order to work further so we check this first\n if (!extension_loaded('redis'))\n {\n throw new Exception('Redis PHP extension not loaded but required to use Redis cache class!');\n }\n\n parent::__construct($config);\n\n // Get Configured Servers\n $servers = Arr::get($this->_config, 'servers', NULL);\n if (empty($servers))\n {\n throw new Exception('No Redis servers defined in configuration. Please define at least one.');\n }\n\n // Now instance the redis server and configure it\n $this->_redis = new \\Redis();\n\n // Global cache prefix so the keys in redis is organized\n $cache_prefix = Arr::get($this->_config, 'cache_prefix', NULL);\n $this->_tag_prefix = Arr::get($this->_config, 'tag_prefix', $this->_tag_prefix). ':';\n\n\n foreach($servers as $server)\n {\n // Determine Connection method and connect\n $method = Arr::get($server, 'persistent', FALSE) ? 'pconnect': 'connect';\n $this->_redis->{$method}($server['host'], $server['port'], 1);\n\n // See if there is a password\n $password = Arr::get($server, 'password', NULL);\n if (!empty($password))\n {\n $this->_redis->auth($password);\n }\n\n // Prefix a name space\n $prefix = Arr::get($server, 'prefix', NULL);\n if (!empty($prefix))\n {\n if (!empty($cache_prefix))\n {\n $prefix .= ':'.$cache_prefix;\n }\n\n $prefix .= ':';\n $this->_redis->setOption(\\Redis::OPT_PREFIX, $prefix);\n }\n }\n\n // Tell redis to serialize using php serializer\n $this->_redis->setOption(\\Redis::OPT_SERIALIZER, \\Redis::SERIALIZER_PHP);\n\n }", "public function connect(array $config)\n {\n return new RedisQueue(\n $this->redis, $config['queue'],\n $config['connection'] ?? $this->connection,\n $config['retry_after'] ?? 60,\n $config['block_for'] ?? null,\n $config['after_commit'] ?? null\n );\n }", "private function getRedis()\r\n {\r\n if ($this->redis === null) {\r\n $this->redis = new PredisClient($this->redis_options);\r\n }\r\n\r\n return $this->redis;\r\n }" ]
[ "0.78445566", "0.68931377", "0.67441773", "0.6663515", "0.66229135", "0.65599686", "0.65450484", "0.64992803", "0.6485804", "0.64519453", "0.64311147", "0.6430254", "0.6411408", "0.63116777", "0.6186056", "0.61276877", "0.6113228", "0.60947824", "0.60947824", "0.6061913", "0.6037227", "0.59624374", "0.5955953", "0.59425217", "0.5939105", "0.58802253", "0.5866432", "0.58527523", "0.58405405", "0.5838798" ]
0.7552729
1
Adds a class to the links associated with the default navigation. This class is required for the autoScrolling. 1 will effect all links.
function add_menu_link_class( $ulclass ){ return preg_replace('/<a/', '<a class="autoScroll"', $ulclass, -1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function montheme_link_class($attr)\n{\n $attr['class'] = 'nav-link';\n\n return $attr;\n}", "function set_active_nav_class ($classes, $item) {\n if (in_array('current-menu-item', $classes) ){\n $classes[] = 'activemenu ';\n }\n return $classes;\n}", "function launchpad_modify_nav_class($classes, $item) {\n\t$slug = sanitize_title($item->title);\n\t$classes = preg_replace('/^((menu|page)[-_\\w+]+)+/', '', $classes);\n\t\n\t$classes[] = 'menu-' . $slug;\n\t\n\t$link_url = preg_replace('|^https?://' . $_SERVER['HTTP_HOST'] . '/|', '/', $item->url);\n\t$current_url = $_SERVER['REQUEST_URI'];\n\t\n\tif($link_url != '/' && $current_url !== $link_url && stristr($current_url, $link_url) !== false) {\n\t\t$classes[] = 'current-hierarchy-ancestor';\n\t} else if($current_url === $link_url) {\n\t\t$classes[] = 'current-hierarchy-page';\t\t\n\t}\n\t\n\t$classes = array_unique($classes);\n\t\n\t// Apply filters to allow the developer to change it.\n\t$classes = apply_filters('launchpad_nav_class', $classes);\n\t\n\treturn array_filter(\n\t\t$classes, \n\t\tfunction($el) {\n\t\t\t$el = trim($el);\n\t\t\treturn empty($el) ? false : true;\n\t\t}\n\t);\n}", "function add_current_nav_class($classes, $item) {\n\t\tglobal $post;\n\t\t\n\t\t// Getting the post type of the current post\n\t\t$current_post_type = get_post_type_object(get_post_type($post->ID));\n\t\t$current_post_type_slug = $current_post_type->rewrite[slug];\n\t\t\t\n\t\t// Getting the URL of the menu item\n\t\t$menu_slug = strtolower(trim($item->url));\n\t\t\n\t\t// If the menu item URL contains the current post types slug add the current-menu-item class\n\t\tif (strpos($menu_slug,$current_post_type_slug) !== false) {\n\t\t\n\t\t $classes[] = 'current-menu-item';\n\t\t\n\t\t}\n\t\t\n\t\t// Return the corrected set of classes to be added to the menu item\n\t\treturn $classes;\n\t\n\t}", "function add_current_nav_class($classes, $item) {\n\t\tglobal $post;\n\t\t\n\t\t// Getting the post type of the current post\n\t\t$current_post_type = get_post_type_object(get_post_type($post->ID));\n\t\t$current_post_type_slug = $current_post_type->rewrite['slug'];\n\t\t\t\n\t\t// Getting the URL of the menu item\n\t\t$menu_slug = strtolower(trim($item->url));\n\t\t\n\t\t// If the menu item URL contains the current post types slug add the current-menu-item class\n\t\tif (strpos($menu_slug,$current_post_type_slug) !== false) {\n\t\t\n\t\t $classes[] = 'current-menu-item';\n\t\t\n\t\t}\n\t\t\n\t\t// Return the corrected set of classes to be added to the menu item\n\t\treturn $classes;\n\t\n\t}", "function add_classes_on_li($classes, $item, $args) {\n $classes[] = 'nav-item';\n return $classes;\n}", "public function activateMenuClassFix()\n {\n add_filter('nav_menu_css_class', array($this, 'fixMenuClasses'), 10, 2);\n }", "function nav_menu_add_classes($items, $args) {\n //Add first item class\n $items[1]->classes[] = 'first';\n\n //Add last item class\n $i = count($items);\n while($items[$i]->menu_item_parent != 0 && $i > 0) {\n $i--;\n }\n $items[$i]->classes[] = 'last';\n\n return $items;\n}", "function add_current_nav_class($classes, $item) {\n\tglobal $post;\n\t// Getting the post type of the current post\n\t$current_post_type = get_post_type_object(get_post_type($post->ID));\n\t$current_post_type_slug = $current_post_type->rewrite['slug'];\n\t// Getting the URL of the menu item\n\t$menu_slug = strtolower(trim($item->url));\n\t// If the menu item URL contains the current post types slug add the current-menu-item class\n\tif (strpos($menu_slug,$current_post_type_slug) !== false) {\n\t\t$classes[] = 'current-menu-item';\n\t}\n\t// Return the corrected set of classes to be added to the menu item\n\treturn $classes;\n}", "public function setLiActiveClass(string $liActiveClass);", "function gymfitness_li_class($classes,$item,$args) {\n \n $classes[] = 'nav-item';\n \n return $classes;\n\n}", "function nav_menu_css_class($classes, $item) {\n\t$slug = sanitize_title($item->title);\n\t$post_type = get_query_var('post_type');\n\t$blog_id = get_option('page_for_posts');\n\t$is_404 = is_404();\n\n\t$classes = preg_replace('/(current(-menu-|[-_]page[-_])(item|parent|ancestor))/', 'is-active', $classes);\n\t$classes = preg_replace('/^((menu|page)[-_\\w+]+)+/', '', $classes);\n\t$classes[] = 'nav__item';\n\t$classes[] = 'nav__item--' . $slug;\n\t$classes = array_unique($classes);\n\n\t// Add active class if item has \"cases-cpt\" class\n\tif ( $post_type === 'cases') {\n\t\tif ( in_array('cases-cpt', $classes) ) {\n\t\t\t$classes[] = 'is-active';\n\t\t}\n\t}\n\n\t// Add active class if item has \"job-cpt\" class\n\tif ( $post_type === 'job') {\n\t\tif ( in_array('job-cpt', $classes) ) {\n\t\t\t$classes[] = 'is-active';\n\t\t}\n\t}\n\n\t// If \"blog\" has active class, and current page is either tax or cpt, remove active class\n\tif ( $item->object_id === $blog_id && in_array('is-active', $classes)) {\n\t\tif ( $post_type === 'cases' || $post_type === 'job' || $is_404 ) {\n\t\t\t$key = array_search('is-active', $classes); \n\t\t\tif ($key !== false) unset($classes[$key]);\n\t\t}\n\t}\n\n\treturn array_filter($classes, 'is_element_empty');\n}", "public static function navigation_class( $class = '' ) {\n $classes = array( 'navigation page-navigation' );\n\n if ( ! empty( $class ) ) {\n if ( ! is_array( $class ) ) {\n $class = preg_split( '#\\s+#', $class );\n }\n $classes = array_merge( $classes, $class );\n } else {\n // Ensure that we always coerce class to being an array.\n $class = array();\n }\n $classes = apply_filters( 'insight_navigation_class', $classes, $class );\n\n echo 'class=\"' . esc_attr( join( ' ', $classes ) ) . '\"';\n }", "function rwbs_add_active_class_to_nav_menu($classes) {\n if (in_array('current-menu-item', $classes, true) || in_array('current_page_item', $classes, true)) {\n $classes = array_diff($classes, array('current-menu-item', 'current_page_item', 'active'));\n $classes[] = 'active';\n }\n return $classes;\n}", "public function setLiClass(string $liClass);", "function atg_menu_classes($classes, $item, $args) {\n if($args->theme_location == 'header') {\n $classes[] = 'nav-item';\n }\n return $classes;\n}", "function gymfitness_a_class($atts,$item,$args) {\n \n $atts['class'] = 'nav-link pl-3 pr-3';\n \n return $atts;\n}", "function menu_item_classes( $classes, $item, $args, $depth ) {\n $classes[] = 'nav-item';\n return $classes;\n}", "function montheme_li_class($classes)\n{\n $classes = [];\n $classes[] = 'nav-item';\n\n return $classes;\n}", "function special_nav_class($classes, $item){\n if( in_array('current-menu-item', $classes) ){\n $classes[] = 'active ';\n }\n return $classes;\n}", "function active_nav_class($classes, $item){\n\tif (in_array('current-menu-item', $classes)) {\n\t\t$classes[] = 'active';\n\t}\n\treturn $classes;\n}", "function add_nav_menu_classes($classes, $item){\n if( is_post_type_archive('program') && ($item->title == \"Programs\") ){\n $classes[] = 'current-menu-item';\n }\n\n return $classes;\n }", "public static function nav_menu_css_class( $classes, $item, $args = array() ) {\n\t\tif(strpos($item->url, '#') !== false && ($key = array_search('current-menu-item', $classes)) !== false) {\n\t\t\tunset($classes[$key]);\n\t\t\t$classes[] = 'maybe-current-menu-item';\n\t\t}\n\n\t\treturn $classes;\n\t}", "function set_current_menu_class($classes) {\n\tglobal $post;\n\t\n\t/*\n\tif( _s_is_page_template_name( 'find-an-agent' ) || is_post_type_archive( 'agent' ) || is_singular( 'agent' ) ) {\n\t\t\n\t\t$classes = array_filter($classes, \"remove_parent_classes\");\n\t\t\n\t\tif ( in_array('menu-item-206', $classes ) )\n\t\t\t$classes[] = 'current-menu-item';\n\t}\n\t*/\n\t\t\t\n\treturn $classes;\n}", "function uk_active_nav_class( $class, $item ) {\n if (in_array( 'current-menu-item', $class )) {\n $class[] = 'uk-active';\n }\n return $class;\n}", "public function set_browse_sites_link_class( array $menu ) {\n\t\tforeach ( $menu as $key => $menu_item ) {\n\t\t\tif ( 'site-switcher' !== $menu_item[3] ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$menu[ $key ][4] = add_cssclass( 'site-switcher', $menu_item[4] );\n\t\t\tbreak;\n\t\t}\n\n\t\treturn $menu;\n\t}", "function revo_nav_menu_css_class( $classes, $item ) {\n\t$slug = sanitize_title($item->title);\n\t$classes = preg_replace('/(current(-menu-|[-_]page[-_])(item|parent|ancestor))/', 'active', $classes);\n\t$classes = preg_replace('/^((menu|page)[-_\\w+]+)+/', '', $classes);\n\n\t$classes[] = 'menu-' . $slug;\n\n\t$classes = array_unique($classes);\n\n\treturn array_filter($classes, 'revo_element_empty');\n}", "public function setUlClass(string $ulClass);", "function greenfields_add_active_class($classes, $item)\n{\n if (in_array('current-menu-item', $classes)) {\n $classes[] = \"active\";\n }\n\n return $classes;\n}", "function cmdeals_nav_menu_item_classes( $menu_items, $args ) {\n\t\n\tif (!is_cmdeals()) return $menu_items;\n\t\n\t$store_page \t\t= (int) get_option('cmdeals_store_page_id');\n\t$page_for_posts = (int) get_option( 'page_for_posts' );\n\n\tforeach ( (array) $menu_items as $key => $menu_item ) :\n\n\t\t$classes = (array) $menu_item->classes;\n\n\t\t// Unset active class for blog page\n\t\tif ( $page_for_posts == $menu_item->object_id ) :\n\t\t\t$menu_items[$key]->current = false;\n\t\t\tunset( $classes[ array_search('current_page_parent', $classes) ] );\n\t\t\tunset( $classes[ array_search('current-menu-item', $classes) ] );\n\n\t\t// Set active state if this is the store page link\n\t\telseif ( is_store() && $store_page == $menu_item->object_id ) :\n\t\t\t$menu_items[$key]->current = true;\n\t\t\t$classes[] = 'current-menu-item';\n\t\t\t$classes[] = 'current_page_item';\n\t\t\n\t\tendif;\n\n\t\t$menu_items[$key]->classes = array_unique( $classes );\n\t\n\tendforeach;\n\n\treturn $menu_items;\n}" ]
[ "0.63640565", "0.63200337", "0.63129985", "0.6191554", "0.6190871", "0.61583066", "0.61058754", "0.6093881", "0.60742766", "0.60561705", "0.60428977", "0.5960877", "0.5957633", "0.59575397", "0.5897958", "0.58969945", "0.5893277", "0.5849162", "0.5840612", "0.5840043", "0.58322", "0.5813623", "0.57814485", "0.5758646", "0.57466274", "0.57112277", "0.57091665", "0.5655127", "0.56432253", "0.5635919" ]
0.70158476
0
Run the query as a "select" statement against the connection.
protected function runSelect() { return $this->connection->select( $this->toSql(), $this->getBindings(), $this->option->setUseWrite($this->useWritePdo) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function runSelect()\n {\n return $this->connection->select($this->toCypher(), $this->getBindings());\n }", "protected function runSelectWithMeta()\n {\n return $this->connection->selectWithMeta(\n $this->toSql(),\n $this->getBindings(),\n ! $this->useWritePdo\n );\n }", "function select($query)\n\t{\n\t\t\n\t\tglobal $connection;\n\t\t$resuts = $connection->query($query);\n\t\treturn $resuts;\n\t}", "public function select($query){\n return pg_fetch_all($this -> query($query));\n }", "public function PgSelect($sql){\n $this->StartBD();\n $this->SQuery = $this->PgQuery($sql);\n if (!$this->SQuery){\n die(\"SELECT Erroneo!\");\n }\n $this->EndBD();\n }", "public function select() \n {\n $this->select->execute();\n\n if ($this->select->errorCode() != 0) \n {\n print_r($this->select->errorInfo());\n }\n\n return $this->select->fetchAll();\n }", "public function select();", "public function select();", "public function select();", "protected abstract function getSelectStatement();", "protected abstract function getSelectStatement();", "private function query() {\n return ApplicationSql::query($this->_select, $this->_table, $this->_join, $this->_where, $this->_order, $this->_group, $this->_limit, $this->_offset);\n }", "protected static function select()\n {\n }", "function selectQuery($query) \t{\n\t\tif($query != '')\t\t{\n\t $res = $this->execute($query);\n\t\t\treturn $this->fetchAll($res);\n\t\t}\n\t}", "private function RunBasicQuery() {\n // Prepare the Query\n $this->stmt = $this->db->prepare($this->sql);\n \n // Run the Query in the Database\n $this->stmt->execute();\n \n // Store the Number Of Rows Returned\n $this->num_rows = $this->stmt->rowCount();\n \n // Work with the results (as an array of objects)\n $this->rs = $this->stmt->fetchAll();\n \n // Free the statement\n $this->stmt->closeCursor(); \n }", "protected function prepareSelectStatement() {}", "private function __select() {\n $from_str = $this->getFromStr();\n $field = $this->field_str;\n if (empty($field)) {\n $field = '*';\n }\n $sql = \"SELECT {$field} FROM {$from_str}\";\n if (!empty($this->join_str_list)) {\n $temp = implode(' ', $this->join_str_list);\n $sql .= \" {$temp}\";\n }\n if (!empty($this->where_str)) {\n $sql .= \" WHERE {$this->where_str}\";\n }\n if (!empty($this->group_str)) {\n $sql .= \" GROUP BY {$this->group_str}\";\n }\n if (!empty($this->order_str)) {\n $sql .= \" ORDER BY {$this->order_str}\";\n }\n if (!empty($this->limit_str)) {\n $sql .= \" LIMIT {$this->limit_str}\";\n }\n $list = $this->query($sql);\n return $list;\n }", "public function select()\n {\n $cols = $this->getColsAsFields();\n return $this->gateway->select($cols);\n }", "function querySelect($query) {\r\n\t\t\r\n\t\tif (strlen(trim($query)) < 0 ) {\r\n\t\t\ttrigger_error(\"Database encountered empty query string in querySelect function\",E_USER_ERROR);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif( !$this->connected ) \r\n\t\t\t$this->connect();\r\n\t\t\t\r\n\t\tif ($result = $this->socket->query($query)) {\r\n\t\t\t$this->recordsSelected = $result->num_rows;\r\n\t\t\t$this->databaseResults = $this->getData($result);\r\n\t\t\t$result->close();\t\t\t\r\n\t\t}\r\n\t\telseif($this->socket->errno!='')\r\n\t\t{\r\n\t\t\r\n\t\t\t$this->error( $sql.\"Error querying database: \". $this->socket->error,false);\r\n\t\t\treturn false;\r\n\r\n\t\t\t}\r\n\t\t\r\n\t\treturn $this->databaseResults;\r\n\t}", "protected function ejecutarSelect($sql){ \n $conf = $_SESSION['config']['base'];\n $pass = \\Core\\Encriptador::desencriptar($conf['dbclaveAll']);\n $obd = new \\Core\\DataBase($conf['dbhost'], $conf['dbport'], $conf['dbuserAll'], $pass, $conf['dbdatabase']);\n $datos = $obd->select($sql);\n if(!empty($datos)){\n return $datos;\n }\n return 0;\n }", "public function createSelect()\n {\n return $this->getConnection()->select();\n }", "public function executeSelect(DBConnection $conn, Peer $peer, $jp= null, $buffered= true);", "function querySelect( $query, &$resultContainer )\r\n\t{\r\n\t\t$resultStm = $this->link->query( $query.\";\", PDO::FETCH_CLASS, \"stdclass\" );\r\n\t\treturn $this->_processSelectResult($resultStm, $resultContainer, $query);\r\n\t}", "public function select()\n {\n return new QueryProxy('select', $this);\n }", "public function select()\n\t{\n\t\treturn call_user_func_array([$this->queryFactory->__invoke('select'), 'select'], func_get_args());\n\t}", "public function select($fields=null) { if ($fields) $this->fields($fields); return $this->execute($this->get_select()); }", "public function executeSelect(DBConnection $conn, Peer $peer, $jp= NULL, $buffered= TRUE) {\n return $conn->query('%c', $this->getSelectQueryString($conn, $peer, $jp), $buffered);\n }", "public function executeSelect($sql) {\r\n\r\n $res = mysql_query($sql);\r\n $this->response = $res;\r\n\r\n return $this->resultToArray($res);\r\n\r\n }", "protected function _sql_select ( /* void */ )\n {\n /*\n Start SQL query.\n */\n $sql = ($this->bDistinct) ? 'SELECT DISTINCT ' : 'SELECT ';\n /*\n Select which fields ?\n */\n $sql .= (empty($this->aFields)) ? '*' : implode(', ', $this->aFields);\n /*\n From which tables ?\n */\n $sql .= (empty($this->aTables)) ? '' : \"\\nFROM \" . implode(', ', $this->aTables);\n /*\n Join something ?\n */\n if (!empty($this->aJoin))\n {\n foreach ($this->aJoin as $j)\n {\n $sql .= \"\\n{$j[0]} JOIN {$j[1]} ON {$j[2]}\";\n }\n }\n /*\n Where ?\n */\n if (!empty($this->aWhere))\n {\n $sql .= \"\\nWHERE \" . implode(\"\\n\", $this->aWhere);\n $sql .= (!empty($this->aLike)) ? implode(\"\\n\", $this->aLike) : '';\n }\n elseif (!empty($this->aLike))\n {\n $sql .= \"\\nWHERE \" . implode(\"\\n\", $this->aLike);\n }\n /*\n Group by ?\n */\n if (!empty($this->aGroupBy))\n {\n $sql .= \"\\nGROUP BY \" . implode(', ', $this->aGroupBy);\n }\n /*\n Having ?\n */\n if (!empty($this->aHaving))\n {\n $sql .= \"\\nHAVING \";\n foreach ($this->aHaving as $i)\n {\n $sql .= \"\\n{$i[0]}{$i[1]} {$i[2]}\";\n }\n }\n /*\n Order by ?\n */\n if (!empty($this->aOrderBy))\n {\n $sql .= \"\\nORDER BY \";\n foreach ($this->aOrderBy as $i)\n {\n $sql .= \"{$i[0]} {$i[1]}, \";\n }\n $sql = trim($sql, ', ');\n }\n /*\n Query limit ?\n */\n if ($this->nLimit !== false)\n {\n if ($this->nOffset !== false)\n {\n $sql .= \"\\nLIMIT \" . $this->nOffset . ', ' . $this->nLimit;\n }\n else\n {\n $sql .= \"\\nLIMIT 0, \" . $this->nLimit;\n }\n }\n /*\n Return SQL.\n */\n return $sql;\n }", "function select($sql) {\n global $conn;\n\n if($result = $conn->query($sql)) {\n while($row = mysqli_fetch_assoc($result))\n $result_rows[] = $row;\n\n if($result_rows != null)\n DB::return_json($result_rows);\n\n else\n throw new Exception(\"no results\");\n } else\n throw new Exception(\"query failed\");\n }" ]
[ "0.785141", "0.70949924", "0.69674146", "0.6802477", "0.6745786", "0.6729542", "0.6724782", "0.6724782", "0.6724782", "0.6654362", "0.6654362", "0.6625513", "0.6491586", "0.64693105", "0.6467199", "0.64576", "0.64336884", "0.640334", "0.63469887", "0.6339372", "0.63146037", "0.62815994", "0.62702864", "0.6264582", "0.62329406", "0.6220284", "0.6211458", "0.620777", "0.6193934", "0.61512655" ]
0.78912383
0
Check whether the user is followed by the authenticated user.
public function getFollowedByAuthUserAttribute(): bool { return $this->isFollowedBy(auth()->user()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function followedBy() {\n return $this->following()\n ->where('followed_user_id', $user->id)\n ->exists();\n }", "public function isFollowBy($user)\n {\n if(!$user->dramas->first()){\n return false;\n }\n\n if ($user->dramas->contains('id',$this['id'])){\n return true;\n }\n\n return false;\n }", "public function checkFollow(User $currentUser, User $user) {\n return ($currentUser->isFollowing($user) || $currentUser->is($user));\n }", "public function isFollowedBy(User $otherUser)\n\t{\n\t\t$idsWhoOtherUserFollows = $otherUser->following()->pluck('followed_id')->toArray();\n\n\t\treturn in_array($this->id, $idsWhoOtherUserFollows);\n\t}", "function is_following($user_id, $follow_id)\n {\n $query_string = \"SELECT * FROM friend_relationships WHERE user_id = ? AND follow_id = ?\";\n $query = $this->db->query($query_string, array($user_id, $follow_id));\n return $query->num_rows() > 0;\n }", "public function isFollowing(User $user) {\n /* This works, but it will return an ENTIRE collection, this can work for smaller datasets\n But this would become highly inefficient when we are dealing with MANY users. */\n // return $this->follows->containers($user);\n // -------------------------------------------------------------------------------------------\n // Below is more efficient as we utilize a 'where' clause to target the specific user to check.\n return $this->follows() // Return who this user follows\n ->where('following_user_id', $user->id) // Where the ID's match\n ->exists(); // And it exists\n }", "public function isFollowing(): bool\n {\n return $this->pluck('following');\n }", "public function isFollowing(): bool\n {\n return $this->pluck('following');\n }", "public function follows($model): bool\n {\n return $this->isFollowing($model);\n }", "public function isFollowing($userId=null) {\n if ($this->isSelf() || !$this->isLogin()) {\n return false;\n }\n\n $data = $this->data;\n if (sizeof($data['followers']) == 0) \n return false;\n foreach($data['followers'] as $follower) {\n if ($this->request->session['userInfo']['id'] == $follower['follower_id']) \n return true;\n }\n \n return false;\n }", "public function following ($user, $following_id)\n\t{\n\t\t$Statement = $this->Database->prepare(\"SELECT id FROM following WHERE user = ? AND follower = ?\");\n\t\t$Statement->execute(array($user, $following_id));\n\t\t$count = $Statement->rowCount();\n\t\t\n\t\treturn ($count == 0) ? false : true;\n\t}", "public function isFollow($userId)\n {\n if (Yii::$app->user->isGuest) {\n return -1;\n }\n $isFollowing = $this->getFollowings()->where(['id' => $userId])->count();\n if ($isFollowing > 0) {\n return 1;\n }\n return 0;\n }", "public function hasFollower(){\n return $this->_has(6);\n }", "function check_follow($matches)\r\r\n {\r\r\n if (!$this->options['dont_mask_admin_follow'])\r\r\n return false;\r\r\n $id = array(get_comment_ID(), get_the_ID());//it is either page or post\r\r\n if ($id[0])\r\r\n $this->debug_info('It is a comment. id ' . $id[0]);\r\r\n elseif ($id[1])\r\r\n $this->debug_info('It is a page. id ' . $id[1]);\r\r\n $author = false;\r\r\n if ($id[0])\r\r\n $author = get_comment_author($id[0]);\r\r\n else if ($id[1])\r\r\n $author = get_the_author_meta('ID');\r\r\n if (!$author)\r\r\n $this->debug_info('it is neither post or page, applying usual rules');\r\r\n elseif (user_can($author, 'manage_options') && (stripos($matches[0], 'rel=\"follow\"') !== FALSE || stripos($matches[0], \"rel='follow'\") !== FALSE)) {\r\r\n $this->debug_info('This link has a follow atribute and is posted by admin, not masking it.');\r\r\n #wordpress adds rel=\"nofollow\" by itself when posting new link in comments. get rid of it! Also, remove our follow attibute - it is unneccesary.\r\r\n return str_ireplace(array('rel=\"follow\"', \"rel='follow'\", 'rel=\"nofollow\"'), '', $matches[0]);\r\r\n } else\r\r\n $this->debug_info('it does not have rel follow or is not posted by admin, masking it');\r\r\n return false;\r\r\n }", "public function hasFollowUser(User $user): bool\n {\n return $this->favorites()->where([\n 'favorited_id'=> $user->id,\n 'favorited_type'=> 'user',\n ])->exists();\n }", "public function following(User $user)\n {\n return $user->following;\n }", "public function hasFollowUpInfo() {\n return $this->_has(3);\n }", "public function isFollowing($userRelationshipId)\n {\n $owner = $this->hasLoggedInUser();\n if (!$owner) {\n return false;\n }\n\n $userRelationships = $this->userRelationshipProvider->getUserRelationships($owner);\n if ($userRelationships->isFollowing($userRelationshipId)) {\n return true;\n }\n\n return false;\n }", "public function hasPostAuthentication()\n {\n return isset($this->sessionStorage->user['twofactor_activated']) && $this->sessionStorage->user['twofactor_activated'] === true;\n }", "function isUserfollowing($userA, $userB)\n{\n global $conn;\n\n $sql = \"SELECT * FROM `user_follows` WHERE userA=$userA AND userB=$userB\";\n $result = mysqli_query($conn, $sql);\n\n if (mysqli_num_rows($result) == 0) {\n\n # userA is not following\n return false;\n } else {\n\n # userA is following\n return true;\n }\n}", "public static function isFollowing(UserInterface $user, ModelInterface $entity): bool\n {\n return (bool) UsersFollows::count([\n 'conditions' => 'users_id = :userId: AND entity_id = :entityId: AND entity_namespace = :entityName: AND is_deleted = 0',\n 'bind' => [\n 'userId' => $user->getId(),\n 'entityId' => $entity->getId(),\n 'entityName' => get_class($entity),\n ],\n ]);\n }", "public function isFollowing($competition_id)\n\t{\n\t\treturn null !== $this->followings()->get()->find($competition_id);\n\t}", "public static function follow($id, $following_id){\n if(!(Auth::check() && Auth::user()->id == $id)) return 1;\n if($id == $following_id) return 2;\n return 0;\n }", "public function followedby(User $user, Request $request)\n\t {\n\t\t $followers = $request->user()->followers()->get();\n\t\t \t return response()->json([\n\t \t'followers'=> $followers,\n\t\t\n\t ]);\n\t }", "public function isFollower(int $with) : int\n {\n // Following from this user\n $user = DB::table('followers')\n ->where('user_id', $this->id)\n ->where('follower_id', $with)\n ->count();\n\n // And the other user\n $follower = DB::table('followers')\n ->where('user_id', $with)\n ->where('follower_id', $this->id)\n ->count();\n\n if ($user && $follower) {\n return 2; // Mutual followers\n } elseif ($user) {\n return 1; // Following\n }\n\n // Else return 0\n return 0;\n }", "public function isFollowing($model): bool\n {\n if (! $model instanceof Followable && ! $model instanceof Following) {\n return false;\n }\n\n return (bool) ! is_null($this->following($model->getMorphClass())->find($model->getKey()));\n }", "function isFollowing($userID, $followerID){\n\t\t\t$query = $this->db->query(\"SELECT * FROM follows WHERE userID='$userID' AND following='$followerID' LIMIT 1\");\n\t\t\t$result = $query->result_array();\n\t\t\tif(empty($result)){\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function isFollowing($follower, $followed) {\n return count($this->db->select('*')\n ->from('User_Follows')\n ->where('follower_username', $follower)\n ->where('followed_username', $followed)\n ->get()\n ->result()) > 0;\n }", "public function checkForFollowUp()\n {\n $now = Carbon::now();\n $preceding = $this->previousEvent;\n\n if (is_null($preceding)) {\n return;\n }\n\n // if already followed\n if ($preceding->triggersToFollowUp->isEmpty()) {\n return;\n }\n\n // One event may be triggered multiple times\n // For example: triggerd by birthday --> make sure to follow all these triggers\n foreach($preceding->triggersToFollowUp as $trigger) {\n if ($now->gte($trigger->start_at->copy()->modify($this->getDelayInterval()))) {\n // for follow-up type of auto-event, need to pass a preceding trigger\n // empty $trigger->subscriber indicates ALL\n MailLog::info(sprintf('Trigger sending follow-up email for automation %s, preceding event ID: %s, event ID: %s', $this->automation->name, $preceding->id, $this->id));\n if ($trigger->subscriber()->exists()) {\n // follow up individual subscriber\n $this->fire([$trigger->subscriber], $trigger);\n } else {\n // follow up the entire list (for the FollowUpSend event)\n $this->fire(null, $trigger);\n }\n }\n }\n }", "public function followed()\n {\n return $this->belongsTo(User::class);\n }" ]
[ "0.7508894", "0.68471485", "0.6741216", "0.6659052", "0.663927", "0.6607084", "0.65804416", "0.65804416", "0.6522664", "0.65069395", "0.6406571", "0.6374567", "0.633452", "0.6301231", "0.62850225", "0.6263426", "0.62478536", "0.62437886", "0.61110777", "0.61099374", "0.60973185", "0.60787433", "0.6045805", "0.6000179", "0.59805375", "0.59786767", "0.59600663", "0.5921545", "0.59150326", "0.59138983" ]
0.7348296
1
Display a listing of the ipcontaip_10.
public function index(ipcontaip_10DataTable $ipcontaip10DataTable) { return $ipcontaip10DataTable->render('ipcontaip_10s.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n {\n $data = $this->Invoice_model->where(array('piutang >'=>0))->order_by('no_invoice','DESC')->find_all();\n $cabang = $this->Cabang_model->order_by('kdcab','ASC')->find_all();\n $this->template->title('Report Piutang');\n $this->template->set('cabang', $cabang);\n $this->template->set('results', $data);\n $this->template->render('list');\n }", "public function actionIndex()\n {\n \t$session = Yii::$app->session;\n \t$vipNum = $session['vip_iden'];\n \tif (null == $vipNum)\n \t{\n \t\texit(\"<hr>Ꭿ!此乃火星地带,勿再探索!Ꭿ !(*+﹏+*)~<hr>\");\n \t}\n \t$this->layout = 'conlist'; \t\n\n $dataProvider = new ActiveDataProvider([\n 'query' => Conlist::find()->where(['KH'=>$vipNum])->orderBy('id desc'),\n \t'pagination' => [\n \t'pageSize' \t => 8,\n \t],\n \n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n\n }", "public function listing();", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $ips = Ip::withCount('dnsrecords')->get();\n return view('ip.index', compact('ips'));\n }", "public function allIpAction() {\n\n $url = \"156.17.231.34\";\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_NOBODY, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_exec($ch);\n $retcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n if ($retcode >= 100 && $retcode <= 505) {\n //echo \"work \" . $retcode . \"<br/>\";\n } else {\n // echo \"nie dziala \" . $retcode . \"<br/>\";\n }\n }", "public function index()\n {\n $crud_ikans = crud_ikan::latest() -> paginate(10);\n\n return view('crud_ikans.index', compact('crud_ikans')) -> with('i', (request() -> input('page', 1) - 1) * 10);\n }", "function index() {\n\t\t$this->show_list();\n\t}", "public function index()\n {\n $iglesias=Iglesia::_getIglesias1()->paginate(10);\n return view('iglesia.lista',compact('iglesias'));\n }", "public function liste()\n {\n $discs = $this->LoadModel('Disc');\n $discDetail = $discs->info_record();\n $this->render('liste', [\n 'discs' => $discDetail\n ]);\n }", "function item_listing()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n // get top10 datas\n // id: 1-top1, 2-top2, 3-top3, 4-top4, 5-top5\n $ret = array(\n 'content' => '',\n 'status' => 'fail'\n );\n if (!empty($_POST)) {\n $id = $_POST['id'];\n // get top list data in homepage\n switch ($id) {\n case 1:\n $header = array(\"序号\", \"轮播图片\", \"类型\", \"单品活动/餐装活动/区域总代理\", \"排序\", \"新增日期\", \"操作\",);\n $cols = 7;\n $contentList = $this->carousel_model->getItems();\n $footer = (count($contentList) == 0||$contentList=='') ? $footer = \"没有轮播图项目.\" : '';\n break; // get top1\n }\n\n // end get\n $ret['header'] = $this->output_header($header);\n $ret['content'] = $this->output_content($contentList, $id);\n $ret['footer'] = $this->output_footer($footer, $cols);\n $ret['status'] = 'success';\n }\n echo json_encode($ret);\n }\n }", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function show($id)\n {\n $ipcontaip10 = $this->ipcontaip10Repository->find($id);\n\n if (empty($ipcontaip10)) {\n Flash::error(__('models/ipcontaip10s.singular').' '.__('messages.not_found'));\n\n return redirect(route('ipcontaip10s.index'));\n }\n\n return view('ipcontaip_10s.show')->with('ipcontaip10', $ipcontaip10);\n }", "public function actionPrintList()\n\t{\n\t\tif (ctype_digit(@$_GET['page'])) $this->page = $_GET['page'];\n\t\t$this->renderPartial('_printList',array('operations' => $this->getTransportList($_GET, true)));\n\t}", "public function index()\n {\n $pensionSystem = PensionSystem::pagination(15);\n }", "public function index()\n {\n //\n\n $data = Inventory::paginate(10);\n return view('cores.index', ['datas' => $data]);\n }", "public function index(Request $request)\n { \n $ipsrs = Ipsrs::orderBy('created_at', 'desc')->paginate(20);\n return view('ipsrs.index', compact('ipsrs'))->with('i', ($request->input('page', 1) -1) *20);\n }", "public function actionIndex()\n {\n $searchModel = new EstudiosIpsSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'lista_est' => ArrayHelper::map(Estudios::find()->all(), 'cod_cups', 'descripcion'),\n 'lista_tipos' => ArrayHelper::map(TiposServicio::find()->where(['idips'=>UsuariosIps::find()->select(['idips'])->where(['idusuario'=>Yii::$app->user->id])])->all(), 'id', 'nombre'),\n ]);\n }", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('MccASMemberBundle:Ip')->findAll();\n\n return $this->render('MccASMemberBundle:Ip:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function indexAction() {\n\t\t$this->_model->where_clause(NULL);\n\n\t\tif(!isset($this->params['page'])) {\n\t\t\tself::$params['page'] = 1;\n\t\t} \n\n\t\t$this->_view->data['info'] = $this->_model->getPage($this->params['page'], $this->config->pagination_limit);\n\t\t$this->_view->data['total_items'] = $this->_model->getCount();\n\t\t$this->addModuleTemplate($this->module, 'index');\n\n\t}", "public function index()\n {\n $icmss = DB::table('icmss')\n ->orderBy('id', 'desc')\n ->paginate(6);\n\n return view('admin.icmss.index', compact('icmss'));\n }", "public function actionList() {\n $criteria = new CDbCriteria();\n //$criteria->index = \"id\";\n $criteria->order = \"id desc\";\n $count = EpcModelTemp::model()->count($criteria);\n $pages = new CPagination($count);\n $pages->pageSize = $_GET['rows'];\n $pages->applyLimit($criteria);\n //EpcModelTemp::model()->scenario='list';\n $models = EpcModelTemp::model()->findAll($criteria);\n // 转换成数组\n $rows = array();\n foreach ($models as $model) {\n $rows[] = $model->attributes;\n }\n $rs = array('total' => $count, 'rows' => $rows);\n echo CJSON::encode($rs);\n }", "public function listdataPrncAction() {\n $this->view->dataList = $this->adm_listdata_serv->getDataList('PERENCANAAN');\n }", "public function index()\n {\n $impostos = Conta::where('tipo_conta', '=', 'I')\n ->orderBy('dt_vencimento', 'asc')\n ->orderBy('status', 'asc')\n ->paginate(7);\n return view('contas.impostos.index', compact('impostos'));\n }", "public function indexAction()\r\n {\r\n // Model\r\n $tourismOperDb = new Model_DbTable_TourismOperator;\r\n\r\n // Data\r\n // Tipe 6 = vito / overseas representatives\r\n $tourismOperQuery = \r\n $tourismOperDb->getAllWithDescById('6', $this->_languageId);\r\n\r\n // View\r\n $this->view->tourism = parent::setPaginator($tourismOperQuery);\r\n\r\n // id_page_overseas = 'representative(s)'\r\n $this->view->customName = $this->view->translate('id_page_overseas');\r\n }", "public function index()\n {\n $portInfo = SwitchportInformation::with('networkdevice')->paginate(25);\n\n return view('switchport_informations.index', compact('portInfo'));\n }" ]
[ "0.6453778", "0.6272244", "0.6235956", "0.6228116", "0.6204705", "0.6165885", "0.613378", "0.6047454", "0.60380894", "0.6033592", "0.60208666", "0.60185206", "0.6018047", "0.6007438", "0.5995448", "0.5984139", "0.5935739", "0.5930786", "0.59306246", "0.59065384", "0.58912516", "0.5887189", "0.58867496", "0.58850205", "0.5869416", "0.58604234", "0.58478254", "0.5841846", "0.5841617", "0.5834981" ]
0.65415996
0
Show the form for creating a new ipcontaip_10.
public function create() { return view('ipcontaip_10s.create'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function newAction() {\n $entity = new Ip();\n $form = $this->createForm(new IpType(), $entity);\n\n return $this->render('MccASMemberBundle:Ip:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function store(Createipcontaip_10Request $request)\n {\n $input = $request->all();\n\n $ipcontaip10 = $this->ipcontaip10Repository->create($input);\n\n Flash::success(__('messages.saved', ['model' => __('models/ipcontaip10s.singular')]));\n\n return redirect(route('ipcontaip10s.index'));\n }", "public function create()\n {\n return view('ipsrs.create');\n }", "public function actionCreate()\n {\n $model = new Capil();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->capil_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n if (Yii::$app->user->can('criarPi')) {\n\n $model = new Estiloconstrucao();\n\n if ($model->load(Yii::$app->request->post())) {\n $verificaEC = $this->verificaEstiloConstrucao($model);\n if ($verificaEC == true) {\n return $this->redirect(['index']);\n } else {\n Yii::$app->session->setFlash('error', 'Estilo de Construção já registado!');\n return $this->redirect(['index']);\n }\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n } else {\n return $this->redirect(['index']);\n }\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n return view('radippool.create');\n }", "public function create()\n {\n return view('forms.cps.create');\n }", "public function create()\n {\n return view('xyk_intros.create');\n }", "public function newAction()\n {\n if (!$this->get('security.context')->isGranted('ROLE_ADMIN') ) {\n return $this->redirect($this->generateUrl('error'), 302); \n } \n\n $entity = new Intervalosips();\n $form = $this->createCreateForm($entity);\n\n return $this->render('SytemSGBundle:Intervalosips:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Capacitador();\n $form = $this->createForm(new CapacitadorType(), $entity);\n\n /*** -Institucion ***/\n $institucion = new Institucioncapacitadora();\n $forminst = $this->createForm(new InstitucioncapacitadoraType(), $institucion);\n /** ---- **/\n \n // Incluimos camino de migas\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem(\"Inicio\", $this->get(\"router\")->generate(\"hello_page\"));\n $breadcrumbs->addItem(\"Capacitaciones\", $this->get(\"router\")->generate(\"pantalla_modulo\",array('id'=>3)));\n $breadcrumbs->addItem(\"Facilitadores\", $this->get(\"router\")->generate(\"pantalla_facilitadores\"));\n $breadcrumbs->addItem(\"Registrar facilitador\", $this->get(\"router\")->generate(\"hello_page\"));\n\n return $this->render('CapacitacionBundle:Capacitador:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'forminst'=>$forminst->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Airoport();\n $form = $this->createForm(new AiroportType(), $entity);\n\n return $this->render('BackendAdminBundle:Airoport:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "public function actionCreate()\n {\n $model = new Bilancio();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n\t{\n\t\t$model=new Residencebaseinfo;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Residencebaseinfo']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Residencebaseinfo'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->rbi_id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new ProvCompras();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n $this->layout=\"main\";\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n\t{\n\t\t$model=new Imparte;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Imparte']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Imparte'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->imp_id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new Peticiones();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n return view('admin.complaint.add');\n }", "public function create()\n {\n return view('admin.provinsi.create');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n return view('ciclos.create');\n }", "public function actionCreate()\n {\n $model = new EstudiosIps();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Nomina();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n return view('backend.pages.ban_ip.create');\n }", "public function create()\n {\n\t\treturn view('divisi.add');\n }", "public function actionCreate()\n {\n $model = new InmueblePorcentajePropietario();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index' ,'id' => $model->inmueble_id]);\n } else {\n $model->inmueble_id=Yii::$app->request->get('id');\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "function newPoi(){\n\t\t$this->load->view('pois/form_new');\n\t}", "public function create()\n {\n //\n return View::make('admin.form_int_mun');\n }", "public function create()\n {\n //新增页面\n return view('admin.nine_patch.create');\n }" ]
[ "0.69500047", "0.69191283", "0.6855608", "0.6819723", "0.6764854", "0.6723429", "0.6625553", "0.66110075", "0.6605991", "0.6575237", "0.6574707", "0.65532243", "0.65441114", "0.6486382", "0.6480184", "0.6448292", "0.6428608", "0.6418632", "0.6399656", "0.63943464", "0.63827175", "0.6381048", "0.63716114", "0.6370721", "0.636281", "0.6355815", "0.6337438", "0.6336826", "0.6335369", "0.6331428" ]
0.7701765
0
Store a newly created ipcontaip_10 in storage.
public function store(Createipcontaip_10Request $request) { $input = $request->all(); $ipcontaip10 = $this->ipcontaip10Repository->create($input); Flash::success(__('messages.saved', ['model' => __('models/ipcontaip10s.singular')])); return redirect(route('ipcontaip10s.index')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _addIpToStorage($ip)\n {\n if(isset($this->_ipStorage[$ip]))\n {\n $this->_ipStorage[$ip]++;\n }\n else\n {\n $this->_ipStorage[$ip] = 1;\n } \n }", "public function store()\n\t {\n\t //\n\t }", "public function store();", "public function store();", "public function store();", "public function store($cid, $data);", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store() {\n\t\t//\n\t}", "public function store() {\n\t\t//\n\t}", "public function store() {\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.6211142", "0.55435055", "0.55076563", "0.55076563", "0.55076563", "0.5473274", "0.5470236", "0.54609966", "0.54609966", "0.54609966", "0.54285103", "0.54285103", "0.54285103", "0.54034954", "0.54034954", "0.54034954", "0.54034954", "0.54034954", "0.54034954", "0.54034954", "0.54034954", "0.54034954", "0.54034954", "0.54034954", "0.54034954", "0.54034954", "0.54034954", "0.54034954", "0.54034954", "0.54034954" ]
0.73190695
0
Display the specified ipcontaip_10.
public function show($id) { $ipcontaip10 = $this->ipcontaip10Repository->find($id); if (empty($ipcontaip10)) { Flash::error(__('models/ipcontaip10s.singular').' '.__('messages.not_found')); return redirect(route('ipcontaip10s.index')); } return view('ipcontaip_10s.show')->with('ipcontaip10', $ipcontaip10); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show($ps_ci)\n {\n \n }", "public function show(NetworkIPSEC $networkIPSEC)\n {\n //\n }", "public function index(ipcontaip_10DataTable $ipcontaip10DataTable)\n {\n return $ipcontaip10DataTable->render('ipcontaip_10s.index');\n }", "public function edit($id)\n {\n $ipcontaip10 = $this->ipcontaip10Repository->find($id);\n\n if (empty($ipcontaip10)) {\n Flash::error(__('messages.not_found', ['model' => __('models/ipcontaip10s.singular')]));\n\n return redirect(route('ipcontaip10s.index'));\n }\n\n return view('ipcontaip_10s.edit')->with('ipcontaip10', $ipcontaip10);\n }", "public function show(Ciclo $ciclo)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "function display($template, $cache_id=null, $compile_id=null)\n {\n echo $this->fetch($template, $cache_id, $compile_id);\n }", "public function show($if)\n {\n //\n }", "public function show(Testi $testi)\n {\n //\n }", "public function show_detail($i_id=0)\r\n {}", "public function show_detail($i_id=0)\r\n {}", "abstract function display();", "abstract function display();", "public function show(IP $iP, Request $request)\n {\n // Save client's IP address to the database\n $clientIP = new IP;\n $clientIP->IPAddress = $request->ip();\n $clientIP->save();\n // Return the client's IP address\n echo json_encode([\"IPAddress\"=> $request->ip()]);\n }", "function infoScreen()\n\t{\n\t\t$this->ctrl->setCmd(\"showSummary\");\n\t\t$this->ctrl->setCmdClass(\"ilinfoscreengui\");\n\t\t$this->infoScreenForward();\n\t}", "public function show($i)\n {\n \n }", "public function show(Ip $ip)\n {\n return view('ip.show', compact('ip'));\n }", "public function showAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MccASMemberBundle:Ip')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Ip entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MccASMemberBundle:Ip:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),));\n }", "public function show(Microciclo $microciclo)\n {\n //\n }", "public function show($id)\n\t{\n\t\t//\n\t\techo'thanh cong';\n\t}", "public function show(geoip $geoip)\n {\n //\n }", "public function show(Interview $interview)\n {\n //\n }", "public abstract function display();", "function infoScreenObject()\n\t{\n\t\t$this->checkPermission(\"visible\");\n\t\t$this->ctrl->setCmd(\"showSummary\");\n\t\t$this->ctrl->setCmdClass(\"ilinfoscreengui\");\n\t\t$this->infoScreen();\n\t}", "public abstract function showInfo();", "function infoScreenObject()\n\t{\n\t\t$this->ctrl->setCmd(\"showSummary\");\n\t\t$this->ctrl->setCmdClass(\"ilinfoscreengui\");\n\t\t$this->infoScreen();\n\t}", "function show () {\n if ($this->checkAccess() == false) return \"\";\n\n if (!$this->userid) {\n trigger_error(\"Module 'ISIC' requires an authorized user. Configure the site to be password protected.\", E_USER_ERROR);\n }\n\n if ($this->user_type == 2 && !$this->user_code) {\n trigger_error(\"Module 'ISIC' user must have ID-code to be assigned. Contact administrator.\", E_USER_ERROR);\n }\n if ($this->vars[\"getlist\"]) {\n $this->getCardList();\n } elseif ($this->vars[\"getdetail\"]) {\n $this->getCardDetail();\n } elseif ($this->vars[\"submitform\"]) {\n $this->saveCard();\n } else {\n $result = $this->showCardContainer();\n }\n return $result;\n }", "public function display(){}", "public function display($cachable = false, $urlparams = false) \n\t{\n\t\t$input = JFactory::getApplication()->input;\n\t\t//set establece y get toma\n\t\t$input->set('view', $input->getCmd('view', 'callcenter'));\n\t\t\n\t\t\n\t\n\t\tparent::display();\n\t}", "public function show(InterviewStatistic $interviewStatistic)\n {\n //\n }" ]
[ "0.60037", "0.591071", "0.5817472", "0.5710497", "0.5707042", "0.545898", "0.5425319", "0.5417554", "0.53952837", "0.5389458", "0.5389458", "0.52330476", "0.52330476", "0.5230244", "0.5210714", "0.5191354", "0.5185829", "0.5182802", "0.5152306", "0.5147821", "0.51308334", "0.5100617", "0.50914466", "0.50840116", "0.5082694", "0.5057911", "0.50465494", "0.5046497", "0.50419843", "0.50326854" ]
0.66541517
0
Show the form for editing the specified ipcontaip_10.
public function edit($id) { $ipcontaip10 = $this->ipcontaip10Repository->find($id); if (empty($ipcontaip10)) { Flash::error(__('messages.not_found', ['model' => __('models/ipcontaip10s.singular')])); return redirect(route('ipcontaip10s.index')); } return view('ipcontaip_10s.edit')->with('ipcontaip10', $ipcontaip10); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit()\n {\n $where = array('id_isi_paket');\n $data['isi_paket'] = $this->M_isipaket->getEdit($where, 'isi_paket')->result();\n $this->load->view('templates/header');\n $this->load->view('templates/sidebar');\n $this->load->view('admin/isipaket/v_edit_ip', $data);\n $this->load->view('templates/footer');\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit(IP $iP)\n {\n //\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit(Ip $ip)\n {\n //\n }", "function edit($id) {\n parent::edit($id);\n \n // If we're rendering a form, we won't have the Authenticator ID or CO Person ID\n // until after parent::edit() runs, so we have to do similar work to beforeFilter(), here.\n \n $modelpl = strtolower($this->name);\n $authmodel = $this->modelClass . 'Authenticator';\n \n $this->setViewVars(!empty($this->viewVars[$modelpl][0][$authmodel]['authenticator_id'])\n ? $this->viewVars[$modelpl][0][$authmodel]['authenticator_id']\n : null,\n !empty($this->viewVars[$modelpl][0][$this->modelClass]['co_person_id'])\n ? $this->viewVars[$modelpl][0][$this->modelClass]['co_person_id']\n : null);\n }", "function pa_edit() {\n\t\t\t\t$edit_pid = (int)UTIL::get_post('edit_pid');\n\t\t\t\t\n\t\t\t\t//-- haben wir keine edit-id, gibts eine seiten-tabelle zur auswahl\n\t\t\t\tif (!$edit_pid) {\n\t\t\t\t\techo 'error: no pid';\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$form = MC::create('form');\n\t\t\t\t$form->init('page', 'mod_page');\n\t\t\t\t$form->add_hidden('edit_pid', $edit_pid);\n\t\t\t\t\n\t\t\t\t// hatten wir fehler\n\t\t\t\tif ($this->get_var('error')) {\n\t\t\t\t\t$form->set_values($this->get_var('data'));\n\t\t\t\t\t$form->set_error_fields($this->get_var('error'));\n\t\t\t\t}\t\n\t\t\t\telse {\n\t\t\t\t\t// frisch aus db lesen\n\t\t\t\t\t$sql = 'SELECT * FROM '.$this->mod_tbl.' WHERE id='.$edit_pid;\n\t\t\t\t\t$res = $this->DB->query($sql);\n\t\t\t\t\t$data = $res->r();\n\t\t\t\t\t$form->set_values($data);\n\t\t\t\t}\n\n\t\t\t\t$this->set_var('path', $this->_get_path_print($edit_pid));\n\t\t\t\t$this->set_var('form', $form);\n\t\t\t\t\n\t\t\t\t$this->OPC->generate_view($this->tpl_dir.'pa_edit.php');\n\n\t\t\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MccASMemberBundle:Ip')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Ip entity.');\n }\n\n $editForm = $this->createForm(new IpType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MccASMemberBundle:Ip:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editAction() {\n $model = new Application_Model_Compromisso();\n //busco no banco o quem eu quero editar\n $comp = $model->find($this->_getParam('id'));\n // renderiso uma view com os dados\n $this->view->assign(\"compromisso\", $comp);\n }", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$this->is_allowed('amuco_details_request_office_update');\n\n\n\t\t$this->data['amuco_details_request_office'] = $this->model_amuco_details_request_office->find($id);\n\n\t\t$this->template->title('Amuco Details Request Office Update');\n\t\t$this->render('backend/standart/administrator/amuco_details_request_office/amuco_details_request_office_update', $this->data);\n\t}", "public function edit()\n {\n $this->model->load('TacGia');\n $tacgia = $this->model->TacGia->findById($_GET['id']);\n $data = array(\n 'title' => 'edit',\n 'tacgia' => $tacgia\n );\n\n // Load view\n $this->view->load('tacgias/edit', $data);\n }", "public function editAction() {\n $id = $this->getInput('id');\n $info = Client_Service_Ad::getAd(intval($id));\n \n $this->assign('ad_type', self::AD_TYPE);\n $this->assign('ad_ptypes', $this->ad_ptypes);\n $this->assign('info', $info);\n }", "public function edit($id)\n {\n $pilih = Pilih::find($id);\n return view ('pilih.edit',compact('pilih')); //\n }", "public function edit($id)\n {\n //$nguoiChoi =NguoiChoi::find($id);\n //return view('NguoiChoi/update-nguoi-choi', compact('nguoiChoi'));\n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Browser_Service_Recsite::getRecsite(intval($id));\t\t\n\t\t$this->assign('info', $info);\n\t\t$this->assign('models', $this->models);\n\t\t$this->assign('types', $this->types);\n\t}", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "public function _editAction() {\n\t\t\n\t\t$args = $this->getAllArguments ();\n\t\t\n\t\tif (array_key_exists ( 'cid', $args )) {\n\t\t\t$action_id = $args ['cid'] [0];\n\t\t} else {\n\t\t\t$action_id = @$args [3] ? @$args [3] : $args [1];\n\t\t}\n\t\t\n\t\t$field = $this->getModel ( 'field' );\n\t\t$field->getAllWhere ( 'form_id = \"' . ( int ) $this->_getFormId () . '\"' );\n\t\t\n\t\t$action = $this->getModel ( 'action' );\n\t\t$action->get ( ( int ) $action_id );\n\t\t\n\t\t$this->loadPluginModel ( 'actions' );\n\t\t\n\t\t$this->setView ( 'edit_action' );\n\t\n\t}", "public function edit($input_NIM)\n \t{\n \t\t$data['data_NIM'] = $this->m_mahasiswa->getWhere($input_NIM);\n \t\treturn $this->load->view('mahasiswa/v_edit', $data);\n \t}", "public function edit($id)\n\t{\n\t\t$pns = PNS::find($id);\n\t\t$this->layout->content = View::make('pns.edit')->with('pns', $pns);\n\t}", "public function editInvoiceProForma($id){\n $invoice = WlgCorporationInvoice::find($id);\n\n $invoiceForms = WlgCorporationInvoice::where('if_id', $id)->get()->toArray();\n return view('edit-wlg-corportaion-invoice', compact('invoice', 'invoiceForms'));\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_historico_atleta_cameponato\n\t\t$fbf_historico_atleta_cameponato = FbfHistoricoAtletaCameponato::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_historico_atleta_cameponato\n\t\t$this->layout->content = View::make('fbf_historico_atleta_cameponato.edit')\n->with('fbf_historico_atleta_cameponato', $fbf_historico_atleta_cameponato);\n\t}", "public function edit($id)\n { \n $control=CE_Control::findOrFail($id);\n $convenio=DB::table('convenio')->get();\n $responsable=DB::table('responsable')->get();\n $usuario=DB::table('usuario')->get();\n return view('control.edit', compact('control','convenio','usuario','responsable'));\n }", "public function actionEdit($id) { }", "public function edit($id)\n\t{\n\t\t$edit_data = CosPcwork::find($id);\n\n\t\treturn view('commission.pcwork_edit')->with('pcwork',$edit_data);\n\t}", "public function actionEditField(){\n $model = CylFields::model()->findByAttributes(['field_id' => $_POST['id']]);\n $this->renderPartial('edit-field',array('model' => $model));\n }", "public function actionEdit(){\n\t\t$form = $_POST;\n\t\t$id = $form['id'];\n\t\tunset($form['id']);\n\t\tunset($form['submit_']);\n\t\tif($form['active'] == 'on'){\n\t\t\t$form['active'] = 1;\n\t\t}\n\t\t$db = $this->context->getService('database');\n\t\t$db->exec('UPDATE core_pages SET ? WHERE id = ?', $form, $id);\n\t\t$this->redirect('pages:');\n\t}" ]
[ "0.7207165", "0.69560516", "0.6881389", "0.68636143", "0.68000615", "0.6777425", "0.66797626", "0.6657619", "0.66482484", "0.66438645", "0.66328996", "0.66157955", "0.660714", "0.6590863", "0.65492976", "0.6547698", "0.65195334", "0.65179294", "0.64886796", "0.6480509", "0.6473405", "0.64662135", "0.6458921", "0.64462686", "0.6440917", "0.64199156", "0.64179766", "0.6411748", "0.6410334", "0.640437" ]
0.74368215
0
Update the specified ipcontaip_10 in storage.
public function update($id, Updateipcontaip_10Request $request) { $ipcontaip10 = $this->ipcontaip10Repository->find($id); if (empty($ipcontaip10)) { Flash::error(__('messages.not_found', ['model' => __('models/ipcontaip10s.singular')])); return redirect(route('ipcontaip10s.index')); } $ipcontaip10 = $this->ipcontaip10Repository->update($request->all(), $id); Flash::success(__('messages.updated', ['model' => __('models/ipcontaip10s.singular')])); return redirect(route('ipcontaip10s.index')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _updateIpData()\n {\n if (!empty($this->_extraData['ipAddress']))\n {\n $ipAddress = $this->_extraData['ipAddress'];\n }\n else\n {\n $ipAddress = null;\n }\n\n $ipId = XenForo_Model_Ip::log(\n $this->get('user_id'), $this->getContentType(), $this->getContestId(), 'insert', $ipAddress\n );\n $this->set('ip_id', $ipId, '', array('setAfterPreSave' => true));\n\n $this->_db->update($this->getContestTableName(), array(\n 'ip_id' => $ipId\n ), 'photo_contest_id = ' . $this->_db->quote($this->getContestId()));\n }", "public function update(Request $request, IP $iP)\n {\n //\n }", "private function _addIpToStorage($ip)\n {\n if(isset($this->_ipStorage[$ip]))\n {\n $this->_ipStorage[$ip]++;\n }\n else\n {\n $this->_ipStorage[$ip] = 1;\n } \n }", "public function update()\n {\n $ipodates = $this->fetchList();\n foreach ($ipodates as $key => $ipo) {\n $this->updateIPO($ipo[0], $ipo[1]);\n }\n }", "public function update($app_ip_id, $data)\n {\n $this->db->where('app_ip_id', $app_ip_id);\n $this->db->set($data);\n $this->db->update('app_ip');\n return $this->db->affected_rows();\n }", "public function update($cbtRekapNilai);", "public function update(Request $request, Ip $ip)\n {\n //\n }", "public function updateClinicInfo($p_clinic){ \n\n $stmt = $this->adapter->conn->prepare(\"UPDATE CLINIC SET \".\n \"clinic_name = ?, \" . \n \"clinic_addr = ?, \" .\n \"post_code = ?, \" .\n \"latitude = ?, \" .\n \"longtitude = ?, \" .\n \"province = ?, \" .\n \"city = ?, \" .\n \"email = ?, \" .\n \"website = ?, \" .\n \"contact_person = ?, \".\n \"active = ?, \" .\n \"expiration = ?, \" .\n \"WHERE clinic_id = ?;\");\n\n $stmt->bindParam(1,$p_clinic->getClinicName());\n $stmt->bindParam(2,$p_clinic->getClinicAddress());\n $stmt->bindParam(3,$p_clinic->getPostCode());\n $stmt->bindParam(4,$p_clinic->getLatitude());\n $stmt->bindParam(5,$p_clinic->getLongtitude());\n $stmt->bindParam(6,$p_clinic->getProvince());\n $stmt->bindParam(7,$p_clinic->getCity());\n $stmt->bindParam(8,$p_clinic->getEmail());\n $stmt->bindParam(9,$p_clinic->getWebsite());\n $stmt->bindParam(10,$p_clinic->getContactPerson());\n $stmt->bindParam(11,$p_clinic->getActiveStatus());\n $stmt->bindParam(12,$p_clinic->getExpirationDate());\n $stmt->bindParam(13,$p_clinic->getClinicId());\n $result=null;\n try{\n $result = $this->adapter->executeUpdatePrepared($stmt);\n }catch(PDOException $e){\n return false;\n }\n if($result > 0) {\n return true;\n }\n\n return false;\n\n }", "public function updateICRR(Request $request, $id)\n {\n //\n $data = rider::where('Rider_ID', $id)->get();\n $ic = $request->Rider_IC;\n $checkIC = is_numeric($ic);\n if ( $checkIC) {\n \n $validatedData = $request->validate([\n 'Rider_IC' => 'required|int',\n\n ]);\n rider::where('Rider_ID', $id)->update($validatedData);\n $message = \"Identification Card (IC) Number is successful updated.\";\n echo \"<script type='text/javascript'>alert('$message');</script>\";\n return view('ManageAccount.RiderInformationInterface', compact(\"data\"));\n } \n else {\n $data = rider::where('Rider_ID', $id)->get();\n $message = \"Identification Card (IC) Number only allow numerical input.\";\n echo \"<script type='text/javascript'>alert('$message');</script>\";\n return view('ManageAccount.RiderInformationInterface', compact(\"data\"));\n }\n }", "public function update(Request $request, $id)\n {\n /*update consultation module*/\n $consultationUpdate = Consultation::find($id);\n Consultation::find($id)->update(['consultation'=>$request->consultation]);\n\n /*---------- This code of line is for CIDS only ---------*/\n\n /*get all consultation icd for */\n $getConsultationICD = ConsultationsICD::where('consultations_id', '=', $id)->pluck('id');\n if ($request->has('icd')) { /*check if a name=\"cid\" is incoming*/\n $updateICD = array(); /*this is the array where we store cid to be updated*/\n $insertICD = array(); /*this id the array where we store new selected icds*/\n foreach($request->icd as $icdCode){\n $explodedICD = explode('_', $icdCode); /*explode icd along with (_) underscore*/\n if (isset($explodedICD[1])) {\n array_push($updateICD, $explodedICD[0]);\n }else{\n array_push($insertICD, $explodedICD[0]);\n }\n }\n if (count($updateICD) > 0) {\n foreach ($getConsultationICD as $upICD) {\n if (!in_array($upICD, $updateICD)) {\n ConsultationsICD::find($upICD)->delete(); /*delete all census icds that is not found on the request*/\n }\n }\n }else{\n if ($getConsultationICD) {\n foreach ($getConsultationICD as $cidID) {\n ConsultationsICD::destroy($cidID); /*destroy all icds if the user removes all icd that has to be updated*/\n }\n }\n }\n if (count($insertICD) > 0) { /*now insert all selected icds*/\n foreach ($insertICD as $storeICD) {\n $newICD = new ConsultationsICD();\n $newICD->patients_id = $consultationUpdate->patients_id;\n $newICD->users_id = $consultationUpdate->users_id;\n $newICD->consultations_id = $id;\n $newICD->icd = $storeICD;\n $newICD->save();\n }\n }\n }else{\n if ($getConsultationICD) {/* delete all icds*/\n foreach ($getConsultationICD as $cidID) {\n ConsultationsICD::destroy($cidID);\n }\n }\n }\n\n /*-------- end of cids code of line ------------*/\n\n\n\n\n /*----- start of img update code -----------*/\n $getAllFiles = FileManager::where('consultations_id', '=', $id)->pluck('filename');\n if ($request->has('img')) {\n $filesChecking = $getAllFiles->toArray();\n for ($i=0; $i < count($request->img); $i++) { \n if (in_array($request->input(\"img.$i\"), $filesChecking)) {\n $insertFile = FileManager::where('filename', '=', $request->input(\"img.$i\"))\n ->update([\n 'title' => $request->input(\"title.$i\"),\n 'description' => $request->input(\"description.$i\")\n ]);\n $keyOFarray = array_search($request->input(\"img.$i\"), $filesChecking);\n array_splice($filesChecking,$keyOFarray,1);\n }else{\n $insertNewFile = new FileManager();\n $insertNewFile->consultations_id = $id;\n $insertNewFile->patients_id = $consultationUpdate->patients_id;\n $insertNewFile->filename = strtolower($request->input(\"img.$i\"));\n $insertNewFile->title = $request->input(\"title.$i\");\n $insertNewFile->description = $request->input(\"description.$i\");\n $insertNewFile->save();\n }\n }\n if (count($filesChecking) > 0) {\n foreach ($filesChecking as $deleteFile) {\n FileManager::where('filename', '=', $deleteFile)->delete();\n }\n }\n }else{\n if ($getAllFiles) {\n foreach ($getAllFiles as $deleteFilename) {\n FileManager::where('filename', '=', $deleteFilename)->delete();\n }\n }\n }\n\n /*----- end of img update code -----------*/\n\n\n return redirect('consultation/'.$id.'/edit')->with('toaster', array('success', 'Consultation updated.'));\n\n }", "public function store(Createipcontaip_10Request $request)\n {\n $input = $request->all();\n\n $ipcontaip10 = $this->ipcontaip10Repository->create($input);\n\n Flash::success(__('messages.saved', ['model' => __('models/ipcontaip10s.singular')]));\n\n return redirect(route('ipcontaip10s.index'));\n }", "public function update(){\n\t//\tprint_r($this->country);\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",description=\\\"$this->description\\\",tags=\\\"$this->tags\\\",area_id=\".$this->area_id.\",image=\\\"$this->image\\\",created_at=$this->created_at,is_public=$this->is_public,price=$this->price where id=\".$this->id;\n\t\tExecutor::doit($sql);\n\t}", "public function updateICC(Request $request, $id)\n {\n //\n $data = customer::where('Customer_ID', $id)->get();\n $ic = $request->Customer_IC;\n $checkIC = is_numeric($ic);\n if ( $checkIC) {\n \n $validatedData = $request->validate([\n 'Customer_IC' => 'required|int',\n\n ]);\n customer::where('Customer_ID', $id)->update($validatedData);\n $message = \"Identification Card (IC) Number is successful updated.\";\n echo \"<script type='text/javascript'>alert('$message');</script>\";\n return view('ManageAccount.CustomerInformationInterface', compact(\"data\"));\n } \n else {\n $data = customer::where('Customer_ID', $id)->get();\n $message = \"Identification Card (IC) Number only allow numerical input. \";\n echo \"<script type='text/javascript'>alert('$message');</script>\";\n return view('ManageAccount.CustomerInformationInterface', compact(\"data\"));\n }\n }", "public function update(Request $request, NetworkIPSEC $networkIPSEC)\n {\n //\n }", "public function update(Request $request, Cinta $cinta)\n {\n\n $this->authorize(\"update\", $cinta);\n\n $data = $request->validate([\n 'titulo' => 'required',\n 'categoria' => 'required',\n 'sinopsis' => 'required',\n 'Protagonistas' => 'required',\n 'Analisis' => 'required',\n \n ]);\n\n $cinta->titulo = $data[\"titulo\"];\n $cinta->categoria_id = $data[\"categoria\"];\n $cinta->sinopsis = $data[\"sinopsis\"];\n $cinta->Protagonistas = $data[\"Protagonistas\"];\n $cinta->Analisis = $data[\"Analisis\"];\n\n if(request(\"imagen\")){\n\n $ruta_imagen = $request['imagen']->store(\"imagenesCintas\",\"public\"); \n $image = Image::make(public_path(\"storage/{$ruta_imagen}\"))->fit(1200,550);\n $image->save();\n \n $cinta->imagen = $ruta_imagen;\n } \n\n\n $cinta->save();\n\n return redirect()->action([CintasController::class, 'index']);\n }", "public function edit($id)\n {\n $ipcontaip10 = $this->ipcontaip10Repository->find($id);\n\n if (empty($ipcontaip10)) {\n Flash::error(__('messages.not_found', ['model' => __('models/ipcontaip10s.singular')]));\n\n return redirect(route('ipcontaip10s.index'));\n }\n\n return view('ipcontaip_10s.edit')->with('ipcontaip10', $ipcontaip10);\n }", "private function TrafficUpdate() {\n $this->getTraffic(); //Chamando o metodo getTraffic\n $ArrSiteViews = ['siteviews_pages' => $this->Traffic['siteviews_pages'] + 1]; //Atualizando a pages\n $updatePageViews = new Update; //instanciando a classe Update\n $updatePageViews->ExeUpdate('siteviews', $ArrSiteViews, \"WHERE siteviews_date = :date\", \"date={$this->Date}\"); //Executando o metodo ExeUpdate, neste informando tabela e quais dados atualizar\n\n $this->Traffic = null; //Liberado espaço da memoria\n }", "public function ressetIp($ip) {\n\n $this->db->query('UPDATE Ip SET Atempts=:ressettedAtempts WHERE Id=:id');\n\n //Bind values\n $this->db->bind(':id', $ip);\n $this->db->bind(':ressettedAtempts', $data['ressettedAtempts']);\n\n //Execute\n if ($this->db->execute()) {\n return true;\n } else {\n return false;\n }\n }", "function update() {\r\n\r\n\t\t$this->connection = new Connection();\r\n\t\t$conn = $this->connection->openConnection();\r\n\r\n\t\t$insert = $conn->prepare(\"UPDATE `panier` SET `quantite`=:quantite WHERE id_internaute=:id_internaute AND id_nourriture=:id_nourriture AND datep=:datep\");\r\n\t\ttry {\r\n\t\t\t$result = $insert->execute(array('quantite' => $this->getQuantite(),'id_internaute' => $this->getId_internaute(),'id_nourriture' => $this->getId_nourriture(),'datep' => $this->getDate()));\r\n\t\t\t\r\n\t\t} catch (PDOExecption $e) {\r\n\t\t\tprint \"Error!: \" . $e->getMessage() . \"</br>\";\r\n\t\t}\r\n\t\t$this->connection->closeConnection();\r\n\t}", "public function edit(IP $iP)\n {\n //\n }", "public function update(){\n $db = Database::getInstance() ;\n $db->query(\"UPDATE canciones SET ncancion=:nca, idGen=:idGen, album=:alb WHERE idcancion=:idc ;\",\n [\":nca\"=>$this->ncancion,\n \":idGen\"=>$this->idGen,\n \":alb\"=>$this->album,\n \":idc\"=>$this->idcancion]) ;\n \n }", "public function update(Request $request, $id)\n {\n $articulo = \\App\\Models\\Articulo::find($id);\n $articulo->nombre = $request->get('nombre1');\n $articulo->descripcion = $request->get('descripcion1');\n $articulo->id_marca = $request->get('id_marca1');\n $articulo->categoria = $request->get('categoria1');\n $articulo->talla = $request->get('talla1');\n //$articulo->IDlocal = $request->get('IDlocal1');\n $temporal = $request->get('descuento1');\n $temporal2 = $articulo->precioOriginal;\n\n // en caso de que modifiquen el precio ya con descuento\n //restablecer el precio original\n //modificar el descuento\n if ($temporal != 0 || $temporal > 0) {\n $descuento = ($temporal * $temporal2) / 100;\n $articulo->precio = $temporal2 - $descuento;\n $articulo->descuento = $temporal;\n // $articulo->precioOriginal = $request->get('precio1');\n } else if ($temporal == 0) { //en caso de que descuento este en 0 restablece precio\n // no modificar nada\n $articulo->descuento = 0;\n $articulo->precio = $temporal2;\n }\n $articulo->imagena = $request->imagena;\n\n $articulo->imagenb = $request->imagenb;\n\n $articulo->imagenc = $request->imagenc;\n\n $articulo->imagend = $request->imagend;\n\n\n\n $articulo->existencia = $request->get('existencia1');\n $articulo->save();\n return back()->with('success', 'Articulo editado : ' . $articulo->nombre);\n }", "public function update($data) {}", "public function update($data) {}", "public function update(Request $request, $id)\n {\n $servicio =Servicio::where('f_tac',$id)->first();\n $servicio->precio=$request->precio;\n $servicio->save();\n $tac = Tac::find($id);\n $tac->fill($request->all());\n $tac->save();\n Bitacora::bitacora('update','tacs','tacs',$id);\n\n if($tac->estado)\n {\n return redirect('/tacs')->with('mensaje', '¡Editado!');\n }\n else{\n return redirect('/tacs?estado=0')->with('mensaje', '¡Editado!');\n }\n }", "abstract public function updateData();", "public function updateIC($id)\n {\n //\n $data = customer::where('Customer_ID', $id)->get();\n return view('ManageAccount.ICUpdateInterface', compact(\"data\"));\n }", "public function update(Request $request, Ciclo $ciclo)\n {\n //\n }", "public function updateStock($idc,$idp, Request $request)\n {\n\n $cp = CatalogProduct::where('catalog_id','=',$idc)\n ->where('product_id','=',$idp)->first();\n\n $cs = $cp->current_stock;\n $ms = $cp->max_stock;\n $quantity = (int)$request->quantity;\n $newStock = $cs + $quantity;\n\n if($quantity<0 and $newStock<0){\n $message = \"ALERTA: NO HAY STOCK SUFICIENTE, SOLO \" . $cs . \" UNIDADES\";\n return $message;\n }elseif ($quantity>0 and $newStock > $ms){\n $message = \"ALERTA: PARA NO SOBREPASAR EL STOCK MAXIMO, SE PUEDE PEDIR A LO MAS \" . ($ms - $cs) . \" UNIDADES\";\n return $message;\n }elseif ($quantity==0){\n $message = \"ALERTA: EL VALOR INGRESADO NO ES VÁLIDO\";\n return $message;\n }\n\n\n DB::table('catalog_product')\n ->where('catalog_id',$idc)\n ->where('product_id',$idp)->limit(1)\n ->update(['current_stock' => $newStock]);\n\n \n $message = (true)?\"INFO: STOCK ACTUALIZADO CORRECTAMENTE\":\"NOK\";\n\n if($cs==0) $message .= \"<br/>NOTIFICACIÓN: YA HAY STOCK DEL PRODUCTO NUEVAMENTE\";\n return $message;\n }", "public function update(Request $request, $id)\n {\n $this->validate($request,[\n 'id' => 'required',\n 'pool_name' => 'required',\n 'framedipaddress' => 'required',\n 'nasipaddress' => 'required',\n 'calledstationid' => 'required',\n 'callingstationid' => 'required',\n 'expiry_time' => 'required',\n 'username' => 'required',\n 'pool_key' => 'required',\n ]);\n\n // Insert into database\n $radData = RadIpPoolProvider::find($id);\n\n $id = $request->input('id');\n $pool_name = $request->input('pool_name');\n $framedipaddress = $request->input('framedipaddress');\n $nasipaddress = $request->input('nasipaddress');\n $calledstationid = $request->input('calledstationid');\n $callingstationid = $request->input('callingstationid');\n $expiry_time = $request->input('expiry_time');\n $username = $request->input('username');\n $pool_key = $request->input('pool_key');\n $radData = DB::update('UPDATE radippool set pool_name = ? where id = ?', [$pool_name,$id]);\n $radData = DB::update('UPDATE radippool set framedipaddress = ? where id = ?', [$framedipaddress,$id]);\n $radData = DB::update('UPDATE radippool set nasipaddress = ? where id = ?', [$nasipaddress,$id]);\n $radData = DB::update('UPDATE radippool set calledstationid = ? where id = ?', [$calledstationid,$id]);\n $radData = DB::update('UPDATE radippool set callingstationid = ? where id = ?', [$callingstationid,$id]);\n $radData = DB::update('UPDATE radippool set expiry_time = ? where id = ?', [$expiry_time,$id]);\n $radData = DB::update('UPDATE radippool set username = ? where id = ?', [$username,$id]);\n $radData = DB::update('UPDATE radippool set pool_key = ? where id = ?', [$pool_key,$id]);\n return redirect('../public/radippool')->with('success', 'Data Updated');\n }" ]
[ "0.56585145", "0.55934894", "0.5465601", "0.5390992", "0.52245176", "0.51806957", "0.51559347", "0.50720054", "0.5063425", "0.50242263", "0.4973996", "0.4965717", "0.4965543", "0.49450564", "0.49179304", "0.48972663", "0.48869327", "0.4872794", "0.48703733", "0.48591843", "0.48495796", "0.48077402", "0.48069683", "0.48069683", "0.4794465", "0.47805536", "0.47681504", "0.47573346", "0.47566563", "0.47438705" ]
0.66027254
0
Gets the key from default environment.
public function getEnvironmentKey(string $key) { return self::$defaultEnv[$key] ?? null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function env($key, $default = NULL)\n\t{\n\t\treturn Env::get($key, $default);\n\t}", "protected static function getDefaultKey()\n {\n $aliases = self::getAliases();\n return reset($aliases);\n }", "function env(string $key, $default = null)\n{\n return Env::get($key, $default);\n}", "function env($key, $default = null)\n {\n if(isset($_ENV[$key]))\n return $_ENV[$key];\n\n return $default;\n }", "function env($key, $default = null)\n {\n if (class_exists(IlluminateEnv::class)) {\n return IlluminateEnv::get($key, $default);\n }\n\n return Env::get($key, $default);\n }", "public function get($key, $default = '')\n {\n if (!is_null($this->_env)) {\n $env = ($this->has($key)) ? getenv($key) : var_export($default, true);\n\n switch ($env) {\n case 'true':\n return true;\n case 'false':\n return false;\n default:\n return $env;\n }\n }\n\n return var_export($default, true);\n }", "function env(?string $key = null, $default = null)\n{\n return array_get($_SERVER, $key, $default);\n}", "public function env($key, $default = false)\n {\n if (isset($_ENV[$key])) {\n return $_ENV[$key];\n }\n return $default;\n }", "function env($key, $default = '')\n {\n static $variables;\n\n //TODO: Changes flag in env to reload its value.\n\n if ($variables === null) {\n $variables = Dotenv::createImmutable(base_directory());\n $variables->safeLoad();\n }\n\n return (!empty(getenv($key)) && getenv($key) != '') ? getenv($key) : $default;\n }", "public static function getApiKey()\n {\n if (static::$key) {\n return static::$key;\n }\n\n if ($key = getenv('FIRST_PROMOTER_KEY')) {\n return $key;\n }\n\n return config('services.first_promoter.key');\n }", "function environment($key = null, $default = null)\n {\n /** @var \\Phanda\\Environment\\Repository $environment */\n $environment = phanda('environment');\n\n if (is_null($key)) {\n return $environment;\n }\n\n if (is_array($key)) {\n $environment->set($key);\n return null;\n }\n\n $value = $environment->get($key, $default);\n\n switch (strtolower($value)) {\n case 'true':\n case '(true)':\n return true;\n case 'false':\n case '(false)':\n return false;\n case 'empty':\n case '(empty)':\n return '';\n case 'null':\n case '(null)':\n return null;\n }\n\n if (($valueLength = strlen($value)) > 1 && $value[0] === '\"' && $value[$valueLength - 1] === '\"') {\n return substr($value, 1, -1);\n }\n\n return $value;\n }", "public static function getEnvironmentVariable($key, $default)\n\t{\n\t\tif (false !== ($val = getenv('env.' . $key))) {\n\t\t\treturn $val;\n\t\t}\n\n\t\tif (false !== ($val = getenv($key))) {\n\t\t\treturn $val;\n\t\t}\n\n\t\t// none defined\n\t\treturn $default;\n\t}", "public function getConfigKey(): string;", "private static function getEnvKey($string)\n {\n preg_match('~%env\\((.*?)\\)%~', $string, $matches);\n\n return (count($matches) > 0) ? $matches[1] : null;\n }", "protected static function key()\n {\n return env('APP_KEY');\n }", "public function getLocalKey(): string\n {\n return $this->localKey;\n }", "function env(string $key, $default = null)\n {\n switch (true) {\n case isset($_SERVER[$key]):\n $value = $_SERVER[$key];\n break;\n case isset($_ENV[$key]):\n $value = $_ENV[$key];\n break;\n case (function_exists('apache_getenv') && apache_getenv($key) !== false):\n $value = apache_getenv($key);\n break;\n default:\n $value = getenv($key);\n break;\n }\n if ($value === false) {\n return $default;\n }\n return value($value);\n }", "function env($key = null)\n{\n if (!isset($GLOBALS['configs']))\n $GLOBALS['configs'] = json_decode(file_get_contents($GLOBALS['config_path'] . DIRECTORY_SEPARATOR . 'env.json'));\n\n if (!is_null($key) && isset($GLOBALS['configs']->$key))\n return $GLOBALS['configs']->$key;\n elseif (is_null($key) && isset($GLOBALS['configs']))\n return $GLOBALS['configs'];\n else\n Throw new \\Atom\\Environment\\EnvironmentException(\"Environment variable \" . $key . \" not found.\");\n}", "function gocardless_env($key = '')\n {\n $config = config('gocardless');\n $env = config('gocardless.environment');\n if (empty($env) && empty($config['environments'][$env])) {\n return null;\n }\n if (empty($key) && ! empty($config['environments'][$env])) {\n return $config['environments'][$env];\n }\n if (array_key_exists($env, $config['environments'])) {\n return $config['environments'][$env][$key];\n }\n return null;\n }", "function get_key() {\n\t\t// get_cert() also fetches key\n\t\tif (!isset($_SESSION['user_key']))\n\t\t\t$this->get_cert();\n\t\treturn $_SESSION['user_key'];\n\t}", "public function env($key = null);", "function env( string $key, $default = '' ) { // phpcs:ignore NeutronStandard.Functions.TypeHint.NoArgumentType, NeutronStandard.Functions.TypeHint.NoReturnType, Universal.NamingConventions.NoReservedKeywordParameterNames.defaultFound\n\t$value = $_ENV[ $key ] ?? $default;\n\n\t// Return bool value for 'true' or 'false'.\n\tswitch ( $value ) {\n\t\tcase 'true':\n\t\t\treturn true;\n\t\tcase 'false':\n\t\t\treturn false;\n\t}\n\n\treturn $value;\n}", "public function getSystemKey()\n {\n return isset($this->encryptedKeys[self::SYSTEM_IDENTIFIER])\n ? $this->encryptedKeys[self::SYSTEM_IDENTIFIER]\n : null;\n }", "public static function getActiveKey(): ?string\n {\n if (static::keyExits(static::getKeyFromUrl())) {\n return $p2;\n } else {\n return null;\n }\n }", "private function getKey()\n {\n if (!empty($this->options['api-key'])) {\n return $this->options['api-key'];\n }\n if (!empty(getenv('EWWW_API_KEY'))) {\n return getenv('EWWW_API_KEY');\n }\n return false;\n }", "public function getKey()\n {\n return $this->getInternalKey();\n }", "public function getKey()\n {\n return $this->get(self::KEY);\n }", "public function getKey()\n {\n return $this->get(self::KEY);\n }", "public function getPackageKey() {}", "public function getPackageKey() {}" ]
[ "0.7443136", "0.7277933", "0.72032195", "0.715204", "0.69998187", "0.67167616", "0.66829705", "0.66418755", "0.65839034", "0.65781677", "0.65497625", "0.6549127", "0.65316975", "0.6514181", "0.6506154", "0.6480379", "0.6421464", "0.64208657", "0.64068097", "0.64052266", "0.6379898", "0.63662267", "0.63138986", "0.6309135", "0.6305673", "0.6288311", "0.62769026", "0.62769026", "0.6271736", "0.6270271" ]
0.74464834
0
Replace an environment variable with another one and back up the old one in a _RAW key.
public static function replaceEnv(array &$env, string $key, $value) { $key = strtoupper($key); $result = null; if (isset($env[$key])) { $result = $env[$key]; $env[$key . '_RAW'] = $result; } $env[$key] = $value; return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testRestoreEnv()\n {\n Environment::putEnv('_ENVTEST_RESTORED=initial');\n $vars = Environment::getVariables();\n $this->assertEquals('initial', Environment::getEnv('_ENVTEST_RESTORED'));\n\n // Modify environment\n Environment::putEnv('_ENVTEST_RESTORED=new');\n $this->assertEquals('initial', $vars['env']['_ENVTEST_RESTORED']);\n $this->assertEquals('new', Environment::getEnv('_ENVTEST_RESTORED'));\n\n // Restore\n Environment::setVariables($vars);\n $this->assertEquals('initial', Environment::getEnv('_ENVTEST_RESTORED'));\n }", "protected function replaceWithEnvironmentVariables($string) {\n\t\t$matches = array();\n\t\tpreg_match_all('/###ENV:([^#]*)###/', $string, $matches, PREG_PATTERN_ORDER);\n\t\tif (!is_array($matches) || !is_array($matches[0])) {\n\t\t\treturn $string;\n\t\t}\n\t\tforeach ($matches[0] as $index => $completeMatch) {\n\t\t\tif (getenv($matches[1][$index]) == FALSE) {\n\t\t\t\tthrow new \\Exception('Expect an environment variable ' . $matches[1][$index]);\n\t\t\t}\n\t\t\t$string = str_replace($completeMatch, getenv($matches[1][$index]), $string);\n\t\t}\n\t\treturn $string;\n\t}", "private function _modEnvironment($VAR) {\n $keys = array_keys($VAR);\n $sKeys = array_keys($_SESSION['_ENV']);\n for($sCount = 0; $sCount < count($sKeys); $sCount++) {\n for($count = 0; $count < count($keys); $count++) {#\n if($sKeys[$sCount] == $keys[$count]) {\n $_SESSION['_ENV'][$sKeys[$sCount]] = $VAR[$keys[$count]];\n }\n }\n }\n $target = _BASEDIR_.DS.\"environment.ini.\" . date('Ymd');\n if(file_exists(_BASEDIR_.DS.\"environment.ini.\" . date('Ymd'))) {\n $fileCount=1;\n while(file_exists(_BASEDIR_.DS.\"environment.ini.\" . date('Ymd') . \"_\" . $fileCount)) {\n $fileCount++;\n }\n $target .= \"_\".$fileCount;\n }\n rename(_BASEDIR_.DS.\"environment.ini\", $target);\n $fp = fopen(_BASEDIR_.DS.\"environment.ini\", \"w+\");\n if($fp != null) {\n $keys = array_keys($_SESSION['_ENV']);\n for($count = 0; $count < count($keys); $count++) {\n if(strlen(trim($keys[$count])) > 0) {\n fwrite($fp, $keys[$count].\"=\".$_SESSION['_ENV'][$keys[$count]].\"\\n\");\n }\n }\n fclose($fp);\n }\n }", "public static function env($key,$raw=false)\n\t{\n\t\tif(!empty($_ENV[$key]))\n\t\t\t$value = $_ENV[$key];\n\t\telse\n\t\t\t$value = @getenv($key);\n\t\treturn ($raw) ? $value : self::clear_value($value);\n\t}", "public function testImmutableLoaderCannotClearEnvironmentVars()\n {\n $this->_immutableLoader->setEnvironmentVariable(\n $this->key(),\n $this->value()\n );\n\n $this->_immutableLoader->clearEnvironmentVariable($this->key());\n\n $this->assertSame(\n $this->value(),\n $this->_immutableLoader->getEnvironmentVariable($this->key())\n );\n\n $this->assertSame($this->value(), getenv($this->key()));\n $this->assertSame(true, isset($_ENV[$this->key()]));\n $this->assertSame(true, isset($_SERVER[$this->key()]));\n\n $this->assertTrue(is_array($this->_immutableLoader->variableNames));\n $this->assertFalse(empty($this->_immutableLoader->variableNames));\n }", "public function testMutableLoaderClearsEnvironmentVars()\n {\n $this->_mutableLoader->setEnvironmentVariable($this->key(), $this->value());\n $this->_mutableLoader->clearEnvironmentVariable($this->key());\n\n $this->assertSame(\n null,\n $this->_mutableLoader->getEnvironmentVariable($this->key())\n );\n\n $this->assertSame(false, getenv($this->key()));\n $this->assertSame(false, isset($_ENV[$this->key()]));\n $this->assertSame(false, isset($_SERVER[$this->key()]));\n\n $this->assertTrue(is_array($this->_mutableLoader->variableNames));\n $this->assertFalse(empty($this->_mutableLoader->variableNames));\n\n }", "function setEnvironmentValue(array $values)\n {\n $envFile = app()->environmentFilePath();\n $str = file_get_contents($envFile);\n\n if (count($values) > 0) {\n $str .= \"\\n\"; // In case the searched variable is in the last line without \\n\n foreach ($values as $envKey => $envValue) {\n if ($envValue === true) {\n $value = 'true';\n } elseif ($envValue === false) {\n $value = 'false';\n } else {\n $value = $envValue;\n }\n\n $envKey = strtoupper($envKey);\n $keyPosition = strpos($str, \"{$envKey}=\");\n $endOfLinePosition = strpos($str, \"\\n\", $keyPosition);\n $oldLine = substr($str, $keyPosition, $endOfLinePosition - $keyPosition);\n $space = strpos($value, ' ');\n $envValue = ($space === false) ? $value : '\"' . $value . '\"';\n\n // If key does not exist, add it\n if (!$keyPosition || !$endOfLinePosition || !$oldLine) {\n $str .= \"{$envKey}={$envValue}\\n\";\n } else {\n $str = str_replace($oldLine, \"{$envKey}={$envValue}\", $str);\n }\n }\n }\n\n $str = substr($str, 0, -1);\n\n if (! file_put_contents($envFile, $str)) {\n return false;\n }\n\n return true;\n }", "public static function saveEnvironmentValue(string $key, string $value)\n {\n $env_file = app()->environmentFilePath();\n $str = file_get_contents($env_file);\n\n $str .= \"\\n\"; // In case the key is the last line without \\n\n $key_position = strpos($str, \"{$key}=\");\n $end_of_line_position = strpos($str, PHP_EOL, $key_position);\n $old_line = substr($str, $key_position, $end_of_line_position - $key_position);\n $str = str_replace($old_line, \"{$key}={$value}\", $str);\n $str = substr($str, 0, -1);\n\n $handle = fopen($env_file, 'w');\n fwrite($handle, $str);\n fclose($handle);\n }", "public static function setValue($envKey, $envValue, $addKeyIfMissing = false)\n {\n $envFile = app()->environmentFilePath();\n $str = file_get_contents($envFile);\n\n $envHasKey = strpos($str, \"{$envKey}=\") !== false;\n $oldValue = env($envKey);\n $possibleOldValues = ['\"'.$oldValue.'\"', $oldValue];\n if ($oldValue === null || !strlen($oldValue)) {\n array_unshift($possibleOldValues, \"null\");\n }\n $envValue = (string)$envValue;\n\n if (!strlen($envValue)) {\n $envValue = 'null';\n }\n\n // wrap the new value in quotes if it contains space character(s)\n if (strpos($envValue, ' ') !== false) {\n $envValue = '\"' . $envValue . '\"';\n }\n if ($envHasKey) {\n // perform a replacement for each possible permutation of the old value\n foreach ($possibleOldValues as $val) {\n if (strpos($str, \"{$envKey}={$val}\") !== false) {\n $str = str_replace(\"{$envKey}={$val}\", \"{$envKey}={$envValue}\", $str);\n break;\n }\n }\n } elseif ($addKeyIfMissing) {\n // add the key:value pair to the end of the .env file\n $str .= \"\\n\" . \"{$envKey}={$envValue}\";\n }\n\n $fp = fopen($envFile, 'w');\n fwrite($fp, $str);\n fclose($fp);\n }", "public function patch()\n\t{\n\t\t$env_override_file = __DIR__ . '/../../.env';\n\n\t\tif ( file_exists($env_override_file) ) {\n\t\t\t$env_override_vars = parse_ini_file($env_override_file);\n\n\t\t\tforeach ( $env_override_vars as $var_name => $var_value ) {\n\t\t\t\t$_SERVER[$var_name] = $var_value;\n\t\t\t}\n\t\t}\n\t}", "public function setEnvironmentValue(array $values)\n {\n $envFile = app()->environmentFilePath();\n $str = file_get_contents($envFile);\n $str .= \"\\r\\n\";\n if (count($values) > 0) {\n foreach ($values as $envKey => $envValue) {\n \n $keyPosition = strpos($str, \"$envKey=\");\n $endOfLinePosition = strpos($str, \"\\n\", $keyPosition);\n $oldLine = substr($str, $keyPosition, $endOfLinePosition - $keyPosition);\n \n if (is_bool($keyPosition) && $keyPosition === false) {\n // variable doesnot exist\n $str .= \"$envKey=$envValue\";\n $str .= \"\\r\\n\";\n } else {\n // variable exist \n $str = str_replace($oldLine, \"$envKey=$envValue\", $str);\n } \n }\n }\n \n $str = substr($str, 0, -1);\n if (!file_put_contents($envFile, $str)) {\n return false;\n }\n \n app()->loadEnvironmentFrom($envFile); \n \n return true;\n }", "private function expandUnderscores(Environment $environment = null, string $name, $value) : Environment\n {\n if (!isset($environment)) {\n $environment = new Environment($this->path, []);\n }\n $environment->setVariable($name, $value);\n return $environment;\n }", "private function loadReleaseFromEnv()\n {\n $this->release['version'] = getenv('SHOPWARE_VERSION') === false ? self::VERSION : getenv('SHOPWARE_VERSION');\n $this->release['revision'] = getenv('SHOPWARE_REVISION') === false ? self::REVISION : getenv('SHOPWARE_REVISION');\n $this->release['version_text'] = getenv('SHOPWARE_VERSION_TEXT') === false ? self::VERSION_TEXT : getenv('SHOPWARE_VERSION_TEXT');\n }", "public static function saveValueToEnv($envKey, $value)\n {\n file_put_contents(\n '.env',\n str_replace($envKey . '=', $envKey . '=' . $value, file_get_contents('.env'))\n );\n }", "function setEnvironment($value){ $_ENV['CURRENT_ENVIRONMENT'] = $value; }", "function replace_in_config($name_var, $value)\n{\n\t\n\t$source = file_get_contents('includes/config.php');\n\t$value_formatted = var_export($value, true);\n\t$replace = \"\\n\\$\" . $name_var . \" = \" . $value_formatted . \";\";\n\t\n\t$new_source = preg_replace('#\\n\\$' . $name_var . '(.*?)\\;#s', \n\t\t\t\t \"$replace\", $source);\n\n\tif ($handle = @fopen('includes/config.php', 'w')) {\n\t\tfwrite($handle, $new_source);\n\t\tfclose($handle);\n\t\treturn TRUE;\n\t}\n\telse\n\t\treturn FALSE;\n}", "function apache_setenv($variable, $value, $walk_to_top = false)\n{\n}", "function switchToBeta(){ $_ENV['CURRENT_ENVIRONMENT'] = ENVIRONMENT_BETA; }", "protected function change_variable($value, $escaped)\n {\n return file_put_contents($this->path(), preg_replace(\n \n \"/^{$this->key()}{$escaped}/m\",\n \n \"{$this->key()}={$value}\",\n \n file_get_contents($this->path())\n )\n );\n }", "public static function setEnv($key, $value)\n {\n $file_path = base_path('.env');\n $data = file($file_path);\n $data = array_map(function($data) use ($key, $value) {\n if (stristr($value, \" \")) {\n return stristr($data, $key) ? \"$key='$value'\\n\" : $data;\n } else {\n return stristr($data, $key) ? \"$key=$value\\n\" : $data;\n }\n }, $data);\n\n // Write file\n $env_file = fopen($file_path, 'w') or die('Unable to open file!');\n fwrite($env_file, implode($data, \"\"));\n fclose($env_file);\n }", "public function updateVaribles(){\n foreach( $this->globalVars as $key=>$val ){\n $this->template = str_replace( '%'. $key .'%', $val, $this->template );\n }\n }", "public function testEnvVar() {\n putenv('LING_ENV=dev');\n $this->assertSame(env('env.LING_ENV'), 'dev');\n }", "public static function setEnvironmentValue(array $values)\n {\n $envFile = app()->environmentFilePath();\n $str = file_get_contents($envFile);\n if(count($values) > 0)\n {\n foreach($values as $envKey => $envValue)\n {\n $keyPosition = strpos($str, \"{$envKey}=\");\n $endOfLinePosition = strpos($str, \"\\n\", $keyPosition);\n $oldLine = substr($str, $keyPosition, $endOfLinePosition - $keyPosition);\n // If key does not exist, add it\n if(!$keyPosition || !$endOfLinePosition || !$oldLine)\n {\n $str .= \"{$envKey}='{$envValue}'\\n\";\n }\n else\n {\n $str = str_replace($oldLine, \"{$envKey}='{$envValue}'\", $str);\n }\n }\n }\n $str = substr($str, 0, -1);\n $str .= \"\\n\";\n if(!file_put_contents($envFile, $str))\n {\n return false;\n }\n\n return true;\n }", "public function setEnvironment($environmentVars);", "public function setEnv($variables);", "public static function copyEnv()\n {\n // Get VCAP_APPLICATION\n $vcapsApplication = json_decode(getenv('VCAP_APPLICATION'), true);\n // Copy env of the appropriate space\n if (isset($vcapsApplication['space_name'])) {\n copy(\n '.env.' . strtolower($vcapsApplication['space_name']),\n '.env'\n );\n }\n }", "public function change_one_global() {\n $var_name = $GLOBALS['test_var'];\n $GLOBALS[ $var_name ] = rand_str();\n }", "function GlobalReplace($template){\n\tglobal $globalVars;\n\n\tforeach ($globalVars as $key => $value) {\r\n\t\t$template = str_replace('{'.$key.'}', $value, $template);\r\n\t}\n\n\treturn $template;\r}", "protected function remebmer_variable( $name, $value ){\n\t\tstatic::$instance->variables[$name] = $value;\n\t}", "private function fixLocaleEnvironment( array &$env ) {\n\t\tif ( PHP_OS_FAMILY === 'Windows' ) {\n\t\t\t// Probably OK?\n\t\t\treturn;\n\t\t}\n\t\tforeach ( [ 'LC_CTYPE', 'LC_ALL', 'LANG' ] as $name ) {\n\t\t\tif ( isset( $env[$name] )\n\t\t\t\t&& preg_match( '/\\.(gb\\w*)/i', $env[$name] )\n\t\t\t) {\n\t\t\t\t$this->logger->warning( \"Filtering out unsafe environment variable \" .\n\t\t\t\t\t\"$name={$env[$name]}\" );\n\t\t\t\tunset( $env[$name] );\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.57573974", "0.5708454", "0.5595096", "0.5567201", "0.55278265", "0.5423341", "0.5407494", "0.5331302", "0.5234381", "0.5131525", "0.51203233", "0.5099546", "0.5090296", "0.50473326", "0.50176555", "0.50026345", "0.5000905", "0.49660188", "0.49413422", "0.48957887", "0.48916394", "0.48757982", "0.48249617", "0.48240453", "0.48078638", "0.479822", "0.4783775", "0.47405517", "0.4739757", "0.4716818" ]
0.6294289
0
Get the host and port, but only if the port is not the standard port for the request scheme.
public function getHostAndPort(): string { $host = $this->getHost(); $port = $this->getPort(); // Only append the port if it is non-standard. if (($port === 80 && $this->getScheme() === 'http') || ($port === 443 && $this->getScheme() === 'https')) { $port = ''; } else { $port = ':' . $port; } return $host . $port; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getRequestUrl()\n {\n $url = get_request_url_schema() . '://' . app()->request()->getHost();\n if ((app()->request()->getScheme() === 'https' && app()->request()->getPort() !== 443) || (app()->request()->getScheme() === 'http' && app()->request()->getPort() !== 80)) {\n $url .= sprintf(':%s', app()->request()->getPort());\n }\n\n return $url;\n }", "public function getSchemeAndHttpHost()\n {\n return parent::getSchemeAndHttpHost();\n }", "private function usesNonStandardHttpPort(): bool\n {\n return 'http' === $this->getScheme() && '80' != $this->router->getContext()->getHttpPort();\n }", "public static function getRequestHost() {\n\t\tif (isset($_SERVER['HTTP_X_FORWARDED_HOST']) && !empty($_SERVER['HTTP_X_FORWARDED_HOST'])) {\n\t\t\t$host = $_SERVER['HTTP_X_FORWARDED_HOST'];\n\t\t\t$elements = explode(',', $host);\n\t\t\t$host = trim(end($elements));\n\t\t}\n\t\telse {\n\t\t\tif (isset($_SERVER['HTTP_HOST']) && !empty($_SERVER['HTTP_HOST'])) {\n\t\t\t\t$host = $_SERVER['HTTP_HOST'];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (isset($_SERVER['SERVER_NAME']) && !empty($_SERVER['SERVER_NAME'])) {\n\t\t\t\t\t$host = $_SERVER['SERVER_NAME'];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (isset($_SERVER['SERVER_ADDR']) && !empty($_SERVER['SERVER_ADDR'])) {\n\t\t\t\t\t\t$host = $_SERVER['SERVER_ADDR'];\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$host = '';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Remove port number from host\n\t\t$host = preg_replace('/:\\d+$/', '', $host);\n\t\n\t\treturn trim($host);\n\t}", "public function getPort()\n {\n return isset($this->urlParts['port']) ? $this->urlParts['port'] : NULL;\n }", "public function getHttpHost()\n {\n $scheme = $this->getScheme();\n $port = $this->getPort();\n\n if (('http' == $scheme && $port == 80) || ('https' == $scheme && $port == 443)) {\n return $this->getHost();\n }\n\n return $this->getHost() . ($port != '' ? ':' . $port : '');\n }", "public function getHostUrl()\n {\n $uri = $this->request->getUri();\n $host = $uri->getHost();\n $port = $uri->getPort();\n $result = $this->isSecure() ? 'https://' : 'http://';\n $result .= (empty($port)) ? $host : $host . \":\" . $port;\n return $result;\n }", "public function getSchemeAndHttpHost()\n {\n return $this->getProtocol().'://'.$this->getHost();\n }", "public static function getHost() {\n $port = $_SERVER['SERVER_PORT'];\n $s = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] ? 's' : '';\n $p = (($s && $port == \"443\") || (!$s && $port == \"80\")) ? '' : \":$port\";\n $host = \"http$s://\" . $_SERVER['HTTP_HOST'] . $p;\n OpenM_Log::debug(\"host: $host\", __CLASS__, __METHOD__, __LINE__);\n return $host;\n }", "public function getSchemeAndHttpHost()\n {\n return $this->getScheme() . '://' . $this->getHttpHost();\n }", "public function getPort() {\n\n if (empty($this->uriParts['port'])) {\n return NULL;\n }\n else {\n if ($this->getScheme()) {\n if ($this->uriParts['port'] == Constants::STANDARD_PORTS[$this->getScheme()]) {\n return null;\n }\n }\n return (int) $this->uriParts['port'];\n }\n }", "public function defaultPort()\n {\n return getservbyname($this->scheme ? $this->scheme : 'http', 'tcp');\n }", "public function getHostInfo()\n {\n if ($this->_hostInfo === null) {\n $secure = $this->getIsSecureConnection();\n $http = $secure ? 'https' : 'http';\n if (isset($_SERVER['HTTP_HOST'])) {\n $this->_hostInfo = $http . '://' . $_SERVER['HTTP_HOST'];\n } else {\n $this->_hostInfo = $http . '://' . $_SERVER['SERVER_NAME'];\n $port = $secure ? $this->getSecurePort() : $this->getPort();\n if (($port !== 80 && !$secure) || ($port !== 443 && $secure)) {\n $this->_hostInfo .= ':' . $port;\n }\n }\n }\n\n return $this->_hostInfo;\n }", "function wmfGetProtocolAndHost() {\n\tif ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' ) {\n\t\t$protocol = 'https';\n\t} else {\n\t\t$protocol = 'http';\n\t}\n\tif ( defined( 'MISSING_PHP_TEST' ) && isset( $_GET['host'] ) ) {\n\t\t$host = $_GET['host'];\n\t} else {\n\t\t$host = $_SERVER['HTTP_HOST'];\n\t}\n\t$host = strtolower( $host );\n\treturn [ $protocol, $host ];\n}", "protected function getHostFromUri() {}", "protected function getConfiguredOrDefaultPort() {}", "final public function getHost(): string {}", "public function getHttpHost()\n {\n $host = $this->getServer('HTTP_HOST');\n if (!empty($host)) {\n return $host;\n }\n\n $scheme = $this->getScheme();\n $name = $this->getServer('SERVER_NAME');\n $port = $this->getServer('SERVER_PORT');\n\n if (null === $name) {\n return '';\n } elseif (($scheme == static::SCHEME_HTTP && $port == 80)\n || ($scheme == static::SCHEME_HTTPS && $port == 443)\n ) {\n return $name;\n } else {\n return $name . ':' . $port;\n }\n }", "function get_host_port( $host, $default = false )\n\t\t{\n\t\t\t$port = $default;\n\t\t\tif ( false !== strpos( $host, ':' ) ) {\n\t\t\t\tlist( $host, $port ) = explode( ':', $host );\n\t\t\t\t$port = (int) $port;\n\t\t\t}\n\t\t\treturn array( $host, $port );\n\t\t}", "function get_host_port( $host, $default = false )\n\t\t{\n\t\t\t$port = $default;\n\t\t\tif ( false !== strpos( $host, ':' ) ) {\n\t\t\t\tlist( $host, $port ) = explode( ':', $host );\n\t\t\t\t$port = (int) $port;\n\t\t\t}\n\t\t\treturn array( $host, $port );\n\t\t}", "public static function getScheme(): ?string {\r\n return $_SERVER['HTTP_X_FORWARDED_PROTO'] ?? $_SERVER['REQUEST_SCHEME'] ?? null;\r\n }", "public function port()\n\t{\n\t\treturn $this->header('X-Forwarded-Port') ? (int)$this->header('X-Forwarded-Port') : (int)$this->server('SERVER_PORT');\n\t}", "public function GetPort() {\n\n return intval($this->GetRequestContext()->SERVER['SERVER_PORT']);\n }", "function atkHost()\n{\n\t$atkHost = $_SERVER[\"HTTP_HOST\"]!=\"\"?$_SERVER[\"HTTP_HOST\"]:$_SERVER[\"SERVER_NAME\"];\n\n\t// if we're running on our cluster environment\n\t// we seem to have a specific portid within the HTTP_HOST\n\t// If so, remove it from the hostname\n\n\t$dummy = explode(\":\", $atkHost);\n\treturn $dummy[0];\n}", "protected function port()\n {\n return env( 'APP_HTTP_PORT' ) != \"\" ? env( 'APP_HTTP_PORT' ) : $this->input->getOption('port');\n }", "protected function getHttpHost()\r\n {\r\n return isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'cli';\r\n }", "public function testGetSelfHostWithPort()\n {\n $original = $_SERVER;\n\n Configuration::loadFromArray([\n 'baseurlpath' => '',\n ], '[ARRAY]', 'simplesaml');\n\n // standard port for HTTP\n $_SERVER['SERVER_PORT'] = '80';\n $this->assertEquals('localhost', HTTP::getSelfHostWithNonStandardPort());\n\n // non-standard port\n $_SERVER['SERVER_PORT'] = '3030';\n $this->assertEquals('localhost:3030', HTTP::getSelfHostWithNonStandardPort());\n\n // standard port for HTTPS\n $_SERVER['HTTPS'] = 'on';\n $_SERVER['SERVER_PORT'] = '443';\n $this->assertEquals('localhost', HTTP::getSelfHostWithNonStandardPort());\n\n $_SERVER = $original;\n }", "protected function getScheme()\n {\n if (isset($_SERVER['REQUEST_SCHEME'])) {\n $scheme = $_SERVER['REQUEST_SCHEME'];\n } else if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']) {\n $scheme = 'https';\n } else {\n if ($_SERVER['SERVER_PORT'] == 443) {\n $scheme = 'https';\n } else {\n $scheme = 'http';\n }\n }\n \n return $scheme;\n }", "public function getHost()\n\t{\n\t\t$host = null;\n\n\t\tif ($this->isUsingTrustedProxy() && $this->hasHeader(self::$trustedHeaderNames['client-host'])) {\n\t\t\t$hosts = explode(',', $this->getHeaderLine(self::$trustedHeaderNames['client-host']));\n\t\t\t$host = trim(end($hosts));\n\t\t}\n\n\t\tif (!$host) {\n\t\t\t$host = $this->getHeaderLine('HOST');\n\t\t}\n\n\t\tif (!$host) {\n\t\t\t$host = $this->getServerParam('SERVER_NAME');\n\t\t}\n\n\t\tif (!$host) {\n\t\t\t$host = $this->getServerParam('SERVER_ADDR');\n\t\t}\n\n\t\t// Remove the port number\n\t\t$host = strtolower(preg_replace(\"/:\\d+$/\", '', trim($host)));\n\t\t\n\t\t// Check for forbidden characters\n\t\t// Credit: Symfony HTTPFoundation\n\t\tif (!empty($host) && !empty(preg_replace(\"/(?:^\\[)?[a-zA-Z0-9-:\\]_]+\\.?/\", '', $host))) {\n\t\t\tthrow new InvalidArgumentException(\"Invalid host \\\"$host\\\"\");\n\t\t}\n\n\t\treturn $host;\n\t}", "public static function getHost() {\n\t\tif(!isset(self::$host)) {\n\t\t\tif(self::$trust && isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {\n \tself::$host = $_SERVER['HTTP_X_FORWARDED_HOST'];\n \t} else if(isset($_SERVER['HTTP_HOST'])) {\n \tself::$host = $_SERVER['HTTP_HOST'];\n \t} else if(isset($_SERVER['SERVER_NAME'])) {\n \tself::$host = $_SERVER['SERVER_NAME'];\n \t}\n\t }\n\t return self::$host;\n\t}" ]
[ "0.6940787", "0.6725435", "0.66645265", "0.6634024", "0.6617154", "0.6539841", "0.65330136", "0.6501285", "0.64626354", "0.63896424", "0.6353074", "0.6286236", "0.6281017", "0.62698424", "0.6262509", "0.62529975", "0.6243503", "0.6242657", "0.6171807", "0.6171807", "0.6135079", "0.6128505", "0.6122631", "0.61209303", "0.61167103", "0.6090186", "0.60895944", "0.6087304", "0.6086064", "0.6085462" ]
0.70863867
0
Get the path and file extenstion.
public function getPathExt(): string { return $this->env['PATH_INFO'] . $this->env['EXT']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getExt()\n {\n $filename = $this->getPath(); \n return pathinfo($filename, PATHINFO_EXTENSION);\n }", "public function getExtension()\n {\n return $this->_path['extension'];\n }", "function cmfcFile_getFileExtension($path) {\n\t\t$path_parts = pathinfo($path);\n\t//\techo $path_parts['dirname'], \"\\n\";\n\t//\techo $path_parts['basename'], \"\\n\";\n\t\treturn strtolower($path_parts['extension']);\n\t}", "private function getExtensionPath() {\n\t\treturn t3lib_extMgm::extRelPath($this->extKey);\n\t}", "public function getFileExtension();", "public function getExtension(): string\n {\n return pathinfo($this->getRelativePath(), PATHINFO_EXTENSION);\n }", "public function getExtension()\n\t{\n\t\treturn pathinfo($this->path, PATHINFO_EXTENSION);\n\t}", "public function getExt()\n {\n $type = $this->getType();\n if ($type === 'style') {\n return 'css';\n } elseif ($type === 'script') {\n return 'js';\n } elseif ($type === 'image') {\n return pathinfo($this->getSourcePath(), PATHINFO_EXTENSION);\n }\n }", "public function getExt(): string\n {\n return (string)$this->env['EXT'];\n }", "function getExtension() ;", "abstract protected function getFileExtension();", "private function getExt($file) {\n\n\t\t$info = pathinfo($file);\n\t\treturn $info['extension'];\n\t}", "public function extension()\n {\n return pathinfo($this->path_filename, PATHINFO_EXTENSION);\n }", "public function getExtension() : string\n {\n return pathinfo($this->name, PATHINFO_EXTENSION);\n }", "public function getFileExtension() {\n\t\t$pathInfo = pathinfo($this->filename);\n\t\tif (!isset($pathInfo['extension'])) {\n\t\t\treturn '???';\n\t\t} else {\n\t\t\treturn $pathInfo['extension'];\n\t\t}\n\t}", "public function getExtension()\n {\n return $this->file['extension'];\n }", "public function getFileExtension(): string\n {\n return $this->fileExtension;\n }", "public function getExtension()\n {\n return pathinfo($this->name, PATHINFO_EXTENSION);\n }", "function get_file_extension($file_path)\n {\n if (!@is_file($file_path))\n return NULL;\n return substr($file_path, -3);\n }", "public function getExtension(): string\n {\n return pathinfo($this->getFilename(), PATHINFO_EXTENSION);\n }", "public function getExtension()\n {\n return $this->file->getExtensionName();\n }", "public function getExtension()\n {\n return $this->fileExtension;\n }", "public function get_extension()\n {\n }", "public function getFileExtension(){\n\n if($this->isPhoto()){\n return \"jpg\";\n }\n\n if($this->isVideo()){\n return \"mp4\";\n }\n\n return \"bin\";\n\n }", "public function getExtension() {}", "public function getExtension() {}", "public function getFilepath() {\n\t\treturn $this->directory.$this->fileprefix.'-'.$this->filename.'.'.static::EXTENSION;\n\t}", "public function get_file_extension () {\r\n\t\treturn $this->_file_extension;\r\n\t}", "public function getFileExtension()\n {\n return $this->fileExtension;\n }", "public function getFileExtension()\n {\n return $this->fileExtension;\n }" ]
[ "0.75995404", "0.7561805", "0.74853176", "0.7477782", "0.74633014", "0.73658264", "0.73412746", "0.7324947", "0.7301123", "0.7259444", "0.71589845", "0.7151792", "0.71419865", "0.71225935", "0.710253", "0.7084196", "0.7074991", "0.7073601", "0.70526123", "0.7050882", "0.70506996", "0.7048091", "0.70331264", "0.7029525", "0.70254135", "0.7025118", "0.70203614", "0.70114136", "0.6992515", "0.6992515" ]
0.768989
0
Set the path with file extension.
public function setPathExt($path) { // Strip the extension from the path. if (substr($path, -1) !== '/' && ($pos = strrpos($path, '.')) !== false) { $ext = substr($path, $pos); $path = substr($path, 0, $pos); $this->env['EXT'] = $ext; } else { $this->env['EXT'] = ''; } $this->env['PATH_INFO'] = $path; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setExtensionsPath($value)\r\n\t\t{\r\n\t\t\t$this->_extensionsPath = $value;\r\n\t\t}", "function setFilenameExtension()\n\t{\n\t\t$sOldFilenameExtension = substr($this->filename, strlen($this->filename) - 4, 4);\n\t\tif (($sOldFilenameExtension != '.gif') &&\n\t\t\t\t($sOldFilenameExtension != '.jpg') &&\n\t\t\t\t($sOldFilenameExtension != '.png')) {\n\t\t\t$this->printError('invalid filename extension');\n\t\t}\n\n\t\tswitch ($this->type) {\n\t\t\tcase 1:\n\t\t\t\t$this->filename = substr($this->filename, 0, strlen($this->filename) - 4) . '.gif';\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$this->filename = substr($this->filename, 0, strlen($this->filename) - 4) . '.jpg';\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$this->filename = substr($this->filename, 0, strlen($this->filename) - 4) . '.png';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->printError('invalid imagetype');\n\t\t}\n\t}", "public function setExtension($ext);", "public function setPath($file);", "public function setPath( $path );", "public function setPath($path = '');", "public function setPath( $path )\n {\n $this->path = us($path);\n }", "public function setPath($path);", "public function setPath($path);", "public function setPath($path);", "public function setPath($path);", "public function setPath($path){ }", "protected function setPath( string $path ) : void\n {\n $this->path = DIGITAL_BASE_PATH.$path;\n }", "function set_path($dot_path)\n\t{\n\t\t$this->path = explode('.', $dot_path);\n\t\treturn $this;\n\t}", "public static function setPath($path)\n {\n }", "private function setFile($file)\n {\n $format = $this->format; // fallback\n $extension = '.'.$format;\n\n // don't use strrpos, because files could have dots in their name\n foreach($this->config['valid_formats'] as $ext)\n {\n $ext_pos = strpos($file, '.'.$ext);\n if ($ext_pos !== false)\n {\n $format = strtolower(substr($file, $ext_pos+1));\n $extension = '';\n continue;\n }\n }\n\n $file .= $extension;\n $this->file = $file;\n $this->format = $format;\n }", "public function setExtension($extension)\n\t{\n\t\t$this->extension = ltrim($extension, '.');\n\t}", "public function setPath( $val ) { $this->__set('path', $val); }", "public function setPath($path)\n\t{\n\t\t/* This must be created here to prevent the directory from\n\t\t * becoming automatically converted to an absolute path. */\n\t\t$this->path = new PhingFile($path);\n\t}", "public function setFilepath(string $path)\n {\n $this->filepath = $path;\n }", "public function setPath($path)\n\t{\n\t\t\n\t\t$this->__path = (string)$path;\n\n\t}", "public function setFileNameAsPath($value)\n {\n $this->setProperty(\"FileNameAsPath\", $value, true);\n }", "public function setPath( $path )\n\t{\n\t\t$this->path = $path;\n\t\t$this->modified = true;\n\t}", "public function setPath(string $path): void\n {\n $this->path = (string) $path;\n }", "public function setPath(string $path)\n {\n $this->path = $path;\n\t}", "public function setExtension(?string $value): void {\n $this->getBackingStore()->set('extension', $value);\n }", "public function setPath($path)\n {\n if ($path == self::AUTO_DETECT) $path = $this->findSendmail();\n $this->path = $path;\n }", "public function setExtension($ext)\n {\n if (!empty($ext)){\n $this->extension = $ext;\n }\n }", "public static function setPath($path)\n\t{\n\t\tself::$path = $path;\n\t}", "public function setPath($path)\n\t{\n\t\t$this->path = $path;\n\t}" ]
[ "0.7662134", "0.6956954", "0.6884025", "0.6865424", "0.68201274", "0.68159586", "0.68116343", "0.67807174", "0.67807174", "0.67807174", "0.67807174", "0.6763521", "0.6748533", "0.6747188", "0.6700717", "0.6686993", "0.6649607", "0.6637435", "0.6561455", "0.65526015", "0.6538176", "0.653616", "0.6516518", "0.6512974", "0.65025085", "0.6498003", "0.6497148", "0.64884245", "0.6481801", "0.6442921" ]
0.7047946
1
Sets the port. Setting the port to 80 or 443 will also set the scheme to http or https respectively.
public function setPort($port) { $this->env['SERVER_PORT'] = $port; // Override the scheme for standard ports. if ($port === 80) { $this->setScheme('http'); } elseif ($port === 443) { $this->setScheme('https'); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setPort($port = 80) {\n $this->_port = $port;\n }", "public function setPort($port) {\n\n $this->port = $port;\n }", "function resetPort() {\n\t\t$this->port = 80;\n\t}", "public function setPort($port);", "public function setPort($port);", "protected function _setPort($uri){\n if (!$this->_uri->getPort()) {\n $port = (parse_url($uri, PHP_URL_SCHEME) == 'https') ? 443 : 80;\n $this->_uri->setPort($port);\n }\n }", "protected function set_port($port)\n {\n }", "public function setPort($port)\n {\n $this->port = $port;\n }", "public function set_port($port)\n {\n }", "public function setPort($port)\n\t{\n\t\t$this->port = $port;\n\t}", "public function setPort($port)\n {\n $this->_port = $port;\n }", "public function setPort($port)\n {\n $this->_port = $port;\n }", "public function setPort( $port )\r\n {\r\n $this->_port = $port;\r\n }", "public function setPort($port = null)\n {\n $this->port = $port;\n }", "public function setPort(int $port): void\n {\n }", "public function setPort( $port )\n\t{\n\t\t$this->port = $port;\n\t\t$this->modified = true;\n\t}", "public function setPort(int $port): self;", "public static function setDefaultPort($port)\n\t\t{\n\t\t\tself::$port = $port;\n\t\t}", "public function setPort($port)\n {\n $this->urlParts['port'] = $port;\n $this->urlPartsModified = TRUE;\n\n return $this;\n }", "function setPort($portNumber) {\n\t\t$this->port = $portNumber;\n\t}", "public function setProxyPort($port);", "public function setPort($port)\r\n\t{\r\n\t\tif (!empty($port))\r\n\t\t{\r\n\t\t\t$this->port = $port;\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function port($port);", "public function setLocalPort(int $port): void {}", "public function testGetPortWithSchemeAndDefaultPort()\n {\n $uriHttp = new Uri('http', 'www.example.com', 80);\n $uriHttps = new Uri('https', 'www.example.com', 443);\n\n $this->assertNull($uriHttp->getPort());\n $this->assertNull($uriHttps->getPort());\n }", "protected function port()\n {\n return env( 'APP_HTTP_PORT' ) != \"\" ? env( 'APP_HTTP_PORT' ) : $this->input->getOption('port');\n }", "public function setPort($port)\n {\n $this->port = $port;\n return $this;\n }", "public function setPort($port)\n {\n $this->port = $port;\n return $this;\n }", "public function getPort()\n {\n if (is_null($this->_port)) {\n $this->_port = !self::getIsSecureConnection() && isset($_SERVER['SERVER_PORT']) ? (int) $_SERVER['SERVER_PORT'] : 80;\n }\n\n return $this->_port;\n }", "public function setPort($port)\n {\n $this->port = (int) $port;\n return $this;\n }" ]
[ "0.79374236", "0.7243715", "0.7236918", "0.7216893", "0.7216893", "0.71609414", "0.70623255", "0.7055828", "0.7017118", "0.6958305", "0.6948222", "0.6948222", "0.68859076", "0.68381274", "0.681002", "0.67549926", "0.66723573", "0.65731156", "0.6547785", "0.64400315", "0.63999146", "0.6362216", "0.6242405", "0.62071687", "0.61889106", "0.61128956", "0.6096726", "0.6096726", "0.6089312", "0.6049684" ]
0.7482284
1
Get the root directory (SCRIPT_NAME) of the request.
public function getRoot(): string { return (string)$this->env['SCRIPT_NAME']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function root()\n {\n if ($this['environment']->has('SCRIPT_FILENAME') === false) {\n throw new \\RuntimeException(\n 'The \"`\"SCRIPT_FILENAME\" server variable could not be found.\n It is required by \"Workbench::root()\".'\n );\n }\n\n return dirname($this['environment']->get('SCRIPT_FILENAME'));\n }", "public function getRootDir()\n {\n return $this->server['DOCUMENT_ROOT'];\n }", "function rootSite() {\n // $dirname = preg_replace('/\\\\\\+/', '/', dirname(realpath($uri)));\n $dirname = preg_replace('/\\\\\\+/', '/', dirname($_SERVER['PHP_SELF']));\n if (substr($dirname, -1) == \"/\")\n $dirname = substr($dirname, 0, strlen($dirname) - 1); // remove / if it is there to be consistent for URL\n return $dirname;\n }", "function getRootURI() {\n\t\treturn (implode('/', array_splice(explode('/', $_SERVER['SCRIPT_NAME']), 0, -1)) . '/');\n\t}", "public static function currentUrlRoot()\n {\n $url = url(app()->request->server()['REQUEST_URI']);\n $pos = strpos($url, '?');\n return $pos ? substr($url, 0, $pos) : $url;\n }", "static function getCurrentScriptDir(){\n \n return Strings::ditchLastPiece($_SERVER['SCRIPT_NAME']);\n \n }", "function getDocumentRoot(){\n\t\t$document_root = isset($_SERVER[\"DOCUMENT_ROOT\"]) ? $_SERVER[\"DOCUMENT_ROOT\"] : \"\";\n\t\t#get env variables under IIS\n\t\tif( !$document_root ){\n\t\t $sf = str_replace(\"\\\\\",\"/\",$_SERVER[\"SCRIPT_FILENAME\"]);\n\t\t $sn = $_SERVER[\"SCRIPT_NAME\"];\n\t\t $document_root = str_replace( $sn, \"\", $sf );\n\t\t}\n\t\treturn $document_root;\n}", "public function determineBaseUrl()\n {\n // why this works at all :)\n return dirname($_SERVER['SCRIPT_NAME']);\n }", "public static function getDocumentRoot()\r\n\t{\r\n\t\tstatic $documentRoot = null;\r\n\t\tif ($documentRoot != null)\r\n\t\t\treturn $documentRoot;\r\n\r\n\t\t$context = Application::getInstance()->getContext();\r\n\t\tif ($context != null)\r\n\t\t{\r\n\t\t\t$server = $context->getServer();\r\n\t\t\tif ($server != null)\r\n\t\t\t\treturn $documentRoot = $server->getDocumentRoot();\r\n\t\t}\r\n\r\n\t\treturn rtrim($_SERVER[\"DOCUMENT_ROOT\"], \"\\\\/\");\r\n\t}", "protected function detectBasePath()\n {\n $filename = basename(\n $this->request->getServerParams()['SCRIPT_FILENAME']\n );\n $baseUrl = $this->getBaseUrl();\n $basePath = $baseUrl;\n\n // basename() matches the script filename; return the directory\n if (basename($baseUrl) === $filename) {\n $basePath = str_replace('\\\\', '/', dirname($baseUrl));\n }\n return $basePath;\n }", "static public function getRootPath() {\n\t\treturn Page::$base_path;\n\t}", "private function buildRootPath()\n {\n // In Windows script path uses backslash, convert it:\n $scriptPath = str_replace('\\\\', '/', $_SERVER['PHP_SELF']);\n $rootPath = str_replace(' ', '%20', rtrim(substr($scriptPath, 0, strpos($scriptPath, 'index.php')), '/'));\n\n return $rootPath;\n }", "function base_path() {\n return (new Server)->get('DOCUMENT_ROOT');\n }", "function current_dir() {\r\n\r\n if ( !empty($_SERVER['PHP_SELF']) || !empty($_SERVER['SCRIPT_NAME']) ) {\r\n\r\n $server_root = \"\";\r\n\r\n if ( !empty($_SERVER['PHP_SELF']) ) {\r\n $script = $_SERVER['PHP_SELF'];\r\n }\r\n else {\r\n $script = $_SERVER['SCRIPT_NAME'];\r\n }\r\n\r\n $subDirList = explode(\"/\", $script);\r\n array_pop($subDirList);\r\n\r\n $server_root = implode(\"/\", $subDirList) . \"/\";\r\n }\r\n else {\r\n $server_root = \"\";\r\n }\r\n\r\n return $server_root;\r\n}", "protected static function getDocumentRoot() {\n\t\treturn BootstrapConfig::getParam(\"document_root\", $_SERVER['DOCUMENT_ROOT']);\n\t}", "public static function getRoot(): string {\n if (! self::$_root) {\n self::$_root = dirname(dirname(dirname(__FILE__)));\n }\n \n return self::$_root;\n }", "public function basePath() {\n return $this\n ->getRequest()\n ->getBasePath();\n }", "public function get_base_root()\r\n {\r\n return realpath(ROOT_DIR_NAME);\r\n }", "public function getDocumentRoot()\n {\n $documentRoot = '';\n $normalized = $this->getNormalized();\n if (empty($normalized['web']['locations'])) {\n return $documentRoot;\n }\n foreach ($this->getNormalized()['web']['locations'] as $path => $location) {\n if (isset($location['root'])) {\n $documentRoot = $location['root'];\n }\n if ($path === '/') {\n break;\n }\n }\n\n return ltrim($documentRoot, '/');\n }", "public static function getBasePath()\n {\n $base_path = substr(trim(\\ROOT, '/'), strlen(trim($_SERVER['DOCUMENT_ROOT'], '/')));\n if (DS !== '/') {\n $base_path = str_replace(DS, '/', $base_path);\n }\n return $base_path;\n }", "public static function getBaseUrl() {\n return substr($_SERVER[\"REQUEST_URI\"], 0, strrpos($_SERVER[\"REQUEST_URI\"], \"/\") + 1);\n }", "public static function getApplicationBaseURL()\n {\n if (self::$applicationBaseURL == null) {\n $dir = dirname($_SERVER[\"SCRIPT_NAME\"]);\n if ($dir == \"/\") $dir = \"\";\n self::$applicationBaseURL = $dir.\"/\";\n }\n return self::$applicationBaseURL;\n }", "public static function getBaseUrl ()\r\n\t{\r\n\t\t# Obtain the value\r\n\t\t$baseUrl = dirname (substr ($_SERVER['SCRIPT_FILENAME'], strlen ($_SERVER['DOCUMENT_ROOT'])));\r\n\t\t\r\n\t\t# Convert backslashes to forwarded slashes if necessary\r\n\t\t$baseUrl = str_replace ('\\\\', '/', $baseUrl);\r\n\t\t\r\n\t\t# Deal with the special case of an application at top-level\r\n\t\tif ($baseUrl == '/') {$baseUrl = '';}\r\n\t\t\r\n\t\t# Return the value\r\n\t\treturn $baseUrl;\r\n\t}", "function this_dir_url() {\n $url = isset($_SERVER['HTTPS']) ? 'https://' : 'http://';\n $url .= $_SERVER['SERVER_NAME'];\n $url .= $_SERVER['REQUEST_URI'];\n\n return dirname($url);\n}", "private function getRequestPath() {\n\t\t// only parse $path once in a request lifetime\n\t\tstatic $path;\n\n\t\tif (isset($path)) {\n\t\t\treturn $path;\n\t\t}\n\n\t\tif (isset($_SERVER['REQUEST_URI'])) {\n\t\t\t// extract the path from REQUEST_URI\n\t\t\t$request_path = strtok($_SERVER['REQUEST_URI'], '?');\n\t\t\t$base_path_len = strlen(rtrim(dirname($_SERVER['SCRIPT_NAME']), '\\/'));\n\n\t\t\t// unescape and strip $base_path prefix, leaving $path without a leading slash\n\t\t\t$path = substr(urldecode($request_path), $base_path_len + 1);\n\n\t\t\t// $request_path is \"/\" on root page and $path is FALSE in this case\n\t\t\tif ($path === FALSE) {\n\t\t\t\t$path = '';\n\t\t\t}\n\n\t\t\t// if the path equals the script filename, either because 'index.php' was\n\t\t\t// explicitly provided in the URL, or because the server added it to\n\t\t\t// $_SERVER['REQUEST_URI'] even when it wasn't provided in the URL (some\n\t\t\t// versions of Microsoft IIS do this), the front page should be served\n\t\t\tif ($path == basename($_SERVER['PHP_SELF'])) {\n\t\t\t\t$path = '';\n\t\t\t}\n\t\t}\n\n\t\treturn $path;\n\t}", "function getWebsiteRootPath()\n {\n // Check that the absolute path to the current directory is accessible\n // (some webhosts denies access this way)\n if ( file_exists (FCPATH) ) {\n return FCPATH;\n } else {\n // Fake relative path by using subdirectory\n return 'js/../';\n }\n }", "function serendipity_httpCoreDir() {\n if (!empty($_SERVER['SCRIPT_FILENAME']) && substr(php_sapi_name(), 0, 3) != 'cgi') {\n return dirname($_SERVER['SCRIPT_FILENAME']) . '/';\n }\n\n if (!empty($_SERVER['ORIG_PATH_TRANSLATED'])) {\n return dirname(realpath($_SERVER['ORIG_PATH_TRANSLATED'])) . '/';\n }\n\n return $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['PHP_SELF']) . '/';\n}", "public function getRootPath() {\r\n\t\treturn $this->getFramework()->getPath(Core::PATH_ROOT);\r\n\t}", "public static function getApplicationRoot(){\r\n $path = __DIR__;\r\n return $path;\r\n }", "public function getBaseURL() {\n $url = $_SERVER['SERVER_PORT'] == '443' ? 'https://' : 'http://';\n \n $url .= $_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']);\n \n return $url;\n }" ]
[ "0.7580802", "0.7493933", "0.7452792", "0.7403596", "0.72699195", "0.7243799", "0.72409457", "0.7224431", "0.7128864", "0.7122279", "0.69957715", "0.6993056", "0.69245964", "0.6921302", "0.6858084", "0.6807156", "0.6761991", "0.6761525", "0.6759399", "0.67573005", "0.6745137", "0.67244744", "0.67080206", "0.66965854", "0.6658999", "0.66518974", "0.6648253", "0.6637991", "0.6633101", "0.66301566" ]
0.7821537
0
Set the root directory (SCRIPT_NAME) of the request. This method will modify the set root to include a leading slash if it does not have one. A root of just "/" will be coerced to an empty string.
public function setRoot($root) { $value = trim($root, '/'); if ($value) { $value = '/' . $value; } $this->env['SCRIPT_NAME'] = $value; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function setDocRoot($docRoot = '')\n {\n self::$isDocRootSet = true;\n if ($docRoot) {\n $_SERVER['DOCUMENT_ROOT'] = $docRoot;\n } elseif (isset($_SERVER['SERVER_SOFTWARE'])\n && 0 === strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS/')) {\n $_SERVER['DOCUMENT_ROOT'] = substr(\n $_SERVER['SCRIPT_FILENAME']\n ,0\n ,strlen($_SERVER['SCRIPT_FILENAME']) - strlen($_SERVER['SCRIPT_NAME']));\n $_SERVER['DOCUMENT_ROOT'] = rtrim($_SERVER['DOCUMENT_ROOT'], '\\\\');\n }\n }", "function set_root ($root)\n {\n $this->mPath = realpath($root) . '/';\n }", "protected function setInitialRootPath() {}", "public static function fix_document_root()\n {\n if (!serverv('PATH_INFO') || serverv('DOCUMENT_ROOT')) {\n return;\n }\n $_SERVER['DOCUMENT_ROOT'] = str_replace(\n $_SERVER['PATH_INFO']\n , ''\n , str_replace(\n '\\\\'\n , '/'\n , serverv('PATH_TRANSLATED'))\n ) . '/';\n }", "function rootSite() {\n // $dirname = preg_replace('/\\\\\\+/', '/', dirname(realpath($uri)));\n $dirname = preg_replace('/\\\\\\+/', '/', dirname($_SERVER['PHP_SELF']));\n if (substr($dirname, -1) == \"/\")\n $dirname = substr($dirname, 0, strlen($dirname) - 1); // remove / if it is there to be consistent for URL\n return $dirname;\n }", "function getRootURI() {\n\t\treturn (implode('/', array_splice(explode('/', $_SERVER['SCRIPT_NAME']), 0, -1)) . '/');\n\t}", "private function buildRootPath()\n {\n // In Windows script path uses backslash, convert it:\n $scriptPath = str_replace('\\\\', '/', $_SERVER['PHP_SELF']);\n $rootPath = str_replace(' ', '%20', rtrim(substr($scriptPath, 0, strpos($scriptPath, 'index.php')), '/'));\n\n return $rootPath;\n }", "static public function getRootPath() {\n\t\treturn Page::$base_path;\n\t}", "public function getRoot(): string\n {\n return (string)$this->env['SCRIPT_NAME'];\n }", "public function setRoot(string $rootDir): void\n {\n $this->rootDir = $rootDir;\n }", "private function figureOutRootPath()\n {\n $this->setRootPath(storage_path($this->getDiffsRequestFolder()));\n }", "public function getRootDir()\n {\n return $this->server['DOCUMENT_ROOT'];\n }", "public function root(): string\n {\n return rtrim($this->getSchemeAndHttpHost() . $this->getBaseUrl(), '/');\n }", "public function root()\n {\n if ($this['environment']->has('SCRIPT_FILENAME') === false) {\n throw new \\RuntimeException(\n 'The \"`\"SCRIPT_FILENAME\" server variable could not be found.\n It is required by \"Workbench::root()\".'\n );\n }\n\n return dirname($this['environment']->get('SCRIPT_FILENAME'));\n }", "public static function setRoot($prm_isroot=false)\n\t{\n global $application_is_root;\n $application_is_root = $prm_isroot;\n\t}", "function get_root_url() {\n return \"http://\" . $_SERVER['HTTP_HOST'] . '/' . ROOT_PATH;\n }", "public function setAppBasePath($appRootPath=null){\n\n $this->appRootPath = $appRootPath;\n $_SERVER['APP_ROOT_PATH']= $this->appRootPath;\n\n }", "protected function setRootControllerNamespace()\n {\n if (is_null($this->namespace)) return;\n $this->app['Illuminate\\Contracts\\Routing\\UrlGenerator']\n ->setRootControllerNamespace($this->namespace);\n }", "public function requestRoot()\n {\n $url = $this->request->root();\n\n return $this->make($url);\n }", "protected static function getDocumentRoot() {\n\t\treturn BootstrapConfig::getParam(\"document_root\", $_SERVER['DOCUMENT_ROOT']);\n\t}", "public function getRootPath()\n {\n if(null === $this->_rootPath) {\n $url = parse_url(str_replace('/index.php/', '/', $this->storeManager->getStore()->getUrl($this->getRouteName(), ['_type' => \\Magento\\Framework\\UrlInterface::URL_TYPE_LINK])));\n $this->_rootPath = isset($url['path']) ? $url['path'] : '';\n }\n\n return $this->_rootPath;\n }", "public static function setFullUrl(): void\n\t{\n\t\t$requestUri = urldecode(Server::get('REQUEST_URI'));\n\t\tstatic::$fullUrl = rtrim(preg_replace('#^' . static::$scriptDirectory . '#', '', $requestUri), '/');\n\t}", "public static function getDocumentRoot()\r\n\t{\r\n\t\tstatic $documentRoot = null;\r\n\t\tif ($documentRoot != null)\r\n\t\t\treturn $documentRoot;\r\n\r\n\t\t$context = Application::getInstance()->getContext();\r\n\t\tif ($context != null)\r\n\t\t{\r\n\t\t\t$server = $context->getServer();\r\n\t\t\tif ($server != null)\r\n\t\t\t\treturn $documentRoot = $server->getDocumentRoot();\r\n\t\t}\r\n\r\n\t\treturn rtrim($_SERVER[\"DOCUMENT_ROOT\"], \"\\\\/\");\r\n\t}", "function getDocumentRoot(){\n\t\t$document_root = isset($_SERVER[\"DOCUMENT_ROOT\"]) ? $_SERVER[\"DOCUMENT_ROOT\"] : \"\";\n\t\t#get env variables under IIS\n\t\tif( !$document_root ){\n\t\t $sf = str_replace(\"\\\\\",\"/\",$_SERVER[\"SCRIPT_FILENAME\"]);\n\t\t $sn = $_SERVER[\"SCRIPT_NAME\"];\n\t\t $document_root = str_replace( $sn, \"\", $sf );\n\t\t}\n\t\treturn $document_root;\n}", "public function setRoot($rootUrl)\n {\n $safeUrl = self::isValidUrl($rootUrl);\n \n if ($safeUrl) {\n $this->root = $rootUrl;\n }\n \n return $safeUrl;\n }", "public static function root()\n\t{\n\t\t$route = new \\CCRoute;\n\t\t$route->uri = '#root';\n\t\treturn \\CCRequest::create( reset( \\Earth\\Pages\\Router::resolve( array( $route ) ) ) )\n\t\t\t->perform()\n\t\t\t->response();\n\t}", "public static function setBaseUrl(): void\n\t{\n\t\tstatic::$scriptDirectory = str_replace('\\\\', '/', dirname(Server::get('SCRIPT_NAME')));\n\t\t$protocol = Server::get('REQUEST_SCHEME') . '://';\n\t\t$hostname = Server::get('HTTP_HOST');\n\t\tstatic::$baseUrl = $protocol . $hostname . static::$scriptDirectory;\n\t}", "public static function rootUrl() {\n\t\treturn self::$_scheme . self::$_host;\n\t}", "function set_root($root)\r\n\t{\r\n\t\tif (empty($root)) return;\r\n\t\tif (!is_dir($root))\r\n\t\t{\r\n\t\t\t$this->error(\"phemplate::set_root(): $root is not a directory.\", 'warning');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$this->root = $root;\r\n\t\treturn true;\r\n\t}", "public function rootPath()\n {\n return public_path() . $this->helper->ds();\n }" ]
[ "0.6698858", "0.6652532", "0.6652271", "0.6464929", "0.639666", "0.6332436", "0.6206512", "0.61203665", "0.60930043", "0.60909283", "0.605667", "0.6043896", "0.60407007", "0.60255295", "0.6020014", "0.60084206", "0.6006866", "0.5964469", "0.5919261", "0.58934736", "0.5877117", "0.5873987", "0.5861455", "0.5860354", "0.58530897", "0.58297366", "0.58056605", "0.5804826", "0.57937044", "0.57856834" ]
0.7184873
0
Split the file extension off a path.
protected static function splitPathExt(string $path): array { if (substr($path, -1) !== '/' && ($pos = strrpos($path, '.')) !== false) { $ext = substr($path, $pos); $path = substr($path, 0, $pos); return [$path, $ext]; } return [$path, '']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getextension($path){\n return strtolower(pathinfo($path, PATHINFO_EXTENSION)); // extension only, no period\n}", "protected function getFileExtension($path)\n\t{\n\t\t$exp = explode('.', $path);\n\t\treturn end($exp);\n\t}", "public static function getExtension($path)\r\n\t{\r\n\t\t$filename=self::getFilename($path);\r\n\t\t$posDot=strrpos($filename, \".\");\r\n\t\tif ($posDot===false) return \"\";\r\n\t\telse return substr($filename, $posDot+1);\r\n\t}", "function gttn_tpps_get_path_extension($path) {\n preg_match('/\\.([a-zA-Z0-9]*)$/', $path, $matches);\n return $matches[1];\n}", "function getextension($path)\n{\n\t$extension = null;\n if (preg_match('/\\.([a-z0-9]+)$/', $path, $found)){\n\t\t$extension = $found[1];\n\t}\n\treturn $extension;\n}", "function get_file_extension($path, $leading_dot = false) {\n $filename = basename($path);\n $dot_offset = (boolean) $leading_dot ? 0 : 1;\n \n if( ($pos = strrpos($filename, '.')) !== false ) {\n return substr($filename, $pos + $dot_offset, strlen($filename));\n } // if\n \n return '';\n }", "public static function extension($path)\n\t{\n\t\treturn array_get(pathinfo($path),'extension');\n\t}", "public static function extension($path)\n\t{\n\t\treturn pathinfo($path, PATHINFO_EXTENSION);\n\t}", "public static function extension($path)\n\t{\n\t\treturn pathinfo($path, PATHINFO_EXTENSION);\n\t}", "public static function extension($path)\n\t{\n\t\treturn pathinfo($path, PATHINFO_EXTENSION);\n\t}", "#[Pure] public function extension(string $path): string\n {\n\n return pathinfo($this->getRealPath($path), PATHINFO_EXTENSION);\n\n }", "public static function extension($path)\n {\n return pathinfo($path, PATHINFO_EXTENSION);\n }", "public static function extension($_path)\r\n {\r\n return pathinfo($_path, PATHINFO_EXTENSION);\r\n }", "public static function stripExt($path) {\n if (mb_strpos($path, '.') !== false) {\n $path = mb_substr($path, 0, mb_strrpos($path, '.'));\n }\n\n return $path;\n }", "function cmfcFile_getFileExtension($path) {\n\t\t$path_parts = pathinfo($path);\n\t//\techo $path_parts['dirname'], \"\\n\";\n\t//\techo $path_parts['basename'], \"\\n\";\n\t\treturn strtolower($path_parts['extension']);\n\t}", "public function resolveExtension()\n {\n if (($pos = strrpos($this->path, '.')) !== false) {\n return substr($this->path, $pos + 1);\n }\n\n return '';\n }", "function getExtension(string $path): string\n{\n return pathinfo($path, PATHINFO_EXTENSION);\n}", "public static function getExtension(string $path) : string\n {\n return (new File($path))->getExtension();\n }", "public function getFileExtension();", "public function extension(string $path): string\n {\n return pathinfo($path, PATHINFO_EXTENSION);\n }", "private function getExt(string $filepath): string\n {\n $explodeUrl = explode('.', $filepath);\n return strtolower($explodeUrl[count($explodeUrl) - 1]);\n }", "private function removeFileExtensionFromPath($path)\n {\n if (strrpos($path, '.') !== false) {\n $path = substr($path, 0, strrpos($path, '.'));\n }\n\n return $path;\n }", "private function removeFileExtensionFromPath($path)\n {\n if (strrpos($path, '.') !== false) {\n $path = substr($path, 0, strrpos($path, '.'));\n }\n\n return $path;\n }", "private function splitPath(string $path): array\n {\n return explode('.', $path);\n }", "public static function getExtension($path)\n\t{\n\t\treturn pathinfo($path,PATHINFO_EXTENSION);\n\t}", "public function extension($filePath);", "protected function _extractExtension( $filename )\n {\n $ret = '';\n $dotPosition = strrpos( $filename, '.' );\n if ( false === $dotPosition ) {\n return $ret;\n }\n \n $ret = substr( $filename, ++$dotPosition );\n return $ret;\n }", "function get_file_extension($file_path)\n {\n if (!@is_file($file_path))\n return NULL;\n return substr($file_path, -3);\n }", "function file_ext($filename) {\n\t if( !preg_match('/./', $filename) ) return '';\n\t return preg_replace('/^.*./', '', $filename);\n\t}", "function GetExt($file){\n return substr($file, strrpos($file,'.') + 1);\n}" ]
[ "0.71330637", "0.71044135", "0.69933677", "0.69915026", "0.68960947", "0.6814501", "0.6808447", "0.67423433", "0.67423433", "0.67423433", "0.6727039", "0.67166877", "0.67149675", "0.67112654", "0.6706149", "0.66866744", "0.6652338", "0.66074353", "0.6601057", "0.6589914", "0.6589094", "0.6561092", "0.6561092", "0.6556472", "0.6546342", "0.6537677", "0.6498695", "0.6480131", "0.6417595", "0.6393789" ]
0.7546478
0
Get current render type
public function renderType(): string { $type = strtolower(Arr::get($_REQUEST, 'renderType', 'all')); if ($type === self::RENDER_VIEW) { return self::RENDER_VIEW; } if ($type === self::RENDER_JSON && $this->allowRenderJson) { return self::RENDER_JSON; } return self::RENDER_ALL; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getCurrentRenderingType() {}", "public function getContentType()\n {\n return self::RENDERER_CONTENT_TYPE;\n }", "function _get_type() {\n\t\treturn $this->type();\n\n\t}", "function get_type() {\n\t\treturn $this->get_data( 'type' );\n\t}", "public function type() {\n\t\t\treturn $this->_type;\n\t\t}", "public function getViewType(): string\n {\n return $this->viewType;\n }", "public function type()\n {\n return $this->type;\n }", "public function type()\n {\n return $this->type;\n }", "public function type()\n {\n return $this->type;\n }", "public function type()\n {\n return $this->_type;\n }", "public function getRenderClass() {\n\t\treturn $this->getBehavior()->renderClass;\n\t}", "function get_form_type()\n {\n return is_array($this->object->context) ? $this->object->context[0] : $this->object->context;\n }", "public function getViewType()\r\n {\r\n return $this->viewType;\r\n }", "protected function GetRenderViewType()\n {\n return $this->fieldRenderViewType;\n }", "public function get_type() { return substr( strrchr( get_called_class(), '\\\\' ), 1 ); }", "public function get_type() {\n\t\treturn $this->type;\n\t}", "function getType () {\n\t\treturn $this->type;\n\t}", "public function get_type();", "public function get_current_page_type() {\n\n\t\tglobal $pagenow;\n\n\t\t$type = '';\n\n\t\tswitch ( $pagenow ) {\n\n\t\t\tcase 'post-new.php':\n\t\t\tcase 'post.php':\n\n\t\t\t\tif ( isset( $_GET['action'] ) && $_GET['action'] === 'elementor' ) {\n\n\t\t\t\t\t$type = 'widgets';\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$type = 'metabox';\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'term.php':\n\t\t\tcase 'edit-tags.php':\n\t\t\t\t$type = 'taxonomy';\n\t\t\t\tbreak;\n\n\t\t\tcase 'widgets.php':\n\t\t\t\t$type = 'widgets';\n\t\t\t\tbreak;\n\n\t\t\tcase 'nav-menus.php':\n\t\t\t\t$type = 'menus';\n\t\t\t\tbreak;\n\n\t\t\tcase 'profile.php':\n\t\t\tcase 'user-new.php':\n\t\t\tcase 'user-edit.php':\n\t\t\t\t$type = 'users';\n\t\t\t\tbreak;\n\n\t\t\tcase 'index.php':\n\t\t\t\t$type = 'dashboard';\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tif ( isset( $_GET['page'] ) && ( preg_match( '/^better-studio-/', $_GET['page'] ) || preg_match( '/^better-studio\\//', $_GET['page'] ) ) ) {\n\t\t\t\t\t$type = 'panel';\n\t\t\t\t}\n\n\t\t}\n\n\t\treturn $type;\n\t}", "public function get_type() {\n return $this->type;\n }", "public function getType()\n\t{\n\t\treturn $this->get('type');\n\t}", "public function getRenderMode ()\n {\n return $this->renderMode;\n }", "public function get_type(): string {\n\t\treturn $this->type;\n\t}", "function type () {\r\n return $this->_type;\r\n }", "final protected function get_type() {\n return $this->type;\n }", "public function GetType()\n {\n return ( $this->type );\n }", "function getType() {\n\t\treturn $this->type;\n\t}", "public function getType()\n {\n return $this->_glue;\n }", "public function getType() {\n\t\treturn $this->type;\n\t}", "public function getType() {\n\t\treturn $this->type;\n\t}" ]
[ "0.8919033", "0.7194314", "0.7146243", "0.7075005", "0.69706655", "0.69677234", "0.694036", "0.694036", "0.694036", "0.6928109", "0.6900995", "0.6891592", "0.6890317", "0.68089515", "0.6806838", "0.6805817", "0.68015575", "0.6798868", "0.6796989", "0.6776739", "0.6775236", "0.67643064", "0.67620313", "0.67615056", "0.67600566", "0.6752365", "0.6749281", "0.673694", "0.6717184", "0.6717184" ]
0.7848222
1
Set current render type
public function setRenderType($type) { if ($type === self::RENDER_JSON) { $this->allowRenderJson = true; } $_REQUEST['renderType'] = $type; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getCurrentRenderingType() {}", "protected function set_type() {\n\n\t\t\t$this->type = 'kirki-editor';\n\n\t\t}", "protected function set_type() {\n\t\t$this->type = 'kirki-color';\n\t}", "public function renderType(): string\n {\n $type = strtolower(Arr::get($_REQUEST, 'renderType', 'all'));\n\n if ($type === self::RENDER_VIEW) {\n return self::RENDER_VIEW;\n }\n\n if ($type === self::RENDER_JSON && $this->allowRenderJson) {\n return self::RENDER_JSON;\n }\n\n return self::RENDER_ALL;\n }", "public function setType($type)\n {\n parent::setAttr(\"type\", $type);\n }", "public function setType($type) {}", "public function setType($type) {\n\t\tif($type == self::TYPE_TEXT){\n\t\t\t$this->type = self::TYPE_TEXT;\n\t\t} else {\n\t\t\t$this->type = self::TYPE_HTML;\n\t\t}\n\t}", "function setType($type) {\n\t\t$this->_type = $type;\n\t}", "function setType($type) {\n\t\t$this->_type = $type;\n\t}", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type){ }", "function setType($type) {\n $this->type = $type;\n }", "protected function setContentType()\n {\n $this->content_type = 'Page';\n }", "public function setType($type) {\n\t\t$this->data['type'] = $type;\n\t}", "function set_viewtype($viewtype = \"default\") {\n global $CURRENT_SYSTEM_VIEWTYPE;\n\n $CURRENT_SYSTEM_VIEWTYPE = $viewtype;\n\n return true;\n}", "public function set_type( $type ) {\n\t\t$this->set_prop( 'type', sanitize_title( $type ) ) ;\n\t}", "public function setPageType($type = 'form'){\n\t\t\t$this->setBodyClass($type == 'form' || $type == 'single' ? 'single' : 'index');\n\t\t}", "public function setTyp( $type );", "public function SetType($type){\r\r\n\t\t$this->type = (string) $type;\r\r\n\t}", "public function setType( $type )\n {\n }", "public function setType($type) {\n $this->type = $type;\n }", "public function setType($type) {\n $this->type = $type;\n }", "public function setType($type) {\n $this->type = $type;\n }" ]
[ "0.7719655", "0.72059864", "0.70931506", "0.6578186", "0.6428203", "0.6336688", "0.630064", "0.62827736", "0.62827736", "0.6229062", "0.6229062", "0.6229062", "0.6229062", "0.6229062", "0.6229062", "0.6229062", "0.6229062", "0.6225332", "0.62018394", "0.6165206", "0.6154448", "0.61427337", "0.6134774", "0.6128551", "0.6079074", "0.6068186", "0.60680014", "0.6038616", "0.6038616", "0.6038616" ]
0.75706804
1
Constructor method for EstabelecimentoCNESCNPJType
public function __construct($idIdentificacao = null, $coCNES = null, $nuCNPJ = null) { $this ->setIdIdentificacao($idIdentificacao) ->setCoCNES($coCNES) ->setNuCNPJ($nuCNPJ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __construct($nome, $cpfCnpj, $tipoDocumento = self::FISICA)\n {\n $this->nome = $nome;\n $this->cpfCnpj = $cpfCnpj;\n $this->tipoDocumento = $tipoDocumento;\n }", "public function setCNPJ($cnpj) {\n\t\t//CPF passado ao invés de CNPJ\n\t\tif (strlen($cnpj) == 11) return $this->setCPF($cnpj);\n\n\t\t$this->checkoutTransparente['cliente']['senderCNPJ'] = $cnpj;\n\t\treturn $this;\n\t}", "function __construct($iCgcCpf, $iTipo = 1) {\n\n $this->iTipo = 1;\n $this->iCgcCpf = (string)$iCgcCpf;\n \n }", "public function setCNPJ($CNPJ)\n {\n $this->CNPJ = $CNPJ;\n\n return $this;\n }", "public function getCNPJ()\n {\n return $this->CNPJ;\n }", "public function __construct(LicitacaoCN $licitacao)\n {\n $this->licitacao = $licitacao;\n }", "public function __construct(LicitacaoCN $licitacao)\n {\n $this->licitacao = $licitacao;\n }", "public function __construct(NcType $ncType)\n {\n $this->model = $ncType;\n }", "public function setNuCNPJ($nuCNPJ = null)\n {\n // validation for constraint: string\n if (!is_null($nuCNPJ) && !is_string($nuCNPJ)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($nuCNPJ, true), gettype($nuCNPJ)), __LINE__);\n }\n // validation for constraint: pattern\n if (is_scalar($nuCNPJ) && !preg_match('/\\\\d{14}/', $nuCNPJ)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value %s, please provide a scalar value that matches \"\\d{14}\"', var_export($nuCNPJ, true)), __LINE__);\n }\n if (is_null($nuCNPJ) || (is_array($nuCNPJ) && empty($nuCNPJ))) {\n unset($this->nuCNPJ);\n } else {\n $this->nuCNPJ = $nuCNPJ;\n }\n return $this;\n }", "public function __construct($_cognome, $_nome, $_matricola)\n {\n // matricola è un attributo della classe padre 'Dipendente'\n // richiamo il costruttore della classe padre con i suoi parametri\n parent::__construct($_cognome, $_nome, $_matricola);\n\n $this -> data_nascita = \"non presente\";\n $this -> email = \"[email protected]\";\n $this -> telefono = \"0000000000\";\n\n echo 'Creo un Dipendente di classe: <strong>'. __CLASS__ . '</strong><br />';\n\n\n }", "public function __construct(){\n $this->codigo = null;\n $this->fields = array('entidad' => '');\n }", "public function setCoCNES($coCNES = null)\n {\n // validation for constraint: string\n if (!is_null($coCNES) && !is_string($coCNES)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($coCNES, true), gettype($coCNES)), __LINE__);\n }\n // validation for constraint: maxLength\n if ((is_scalar($coCNES) && strlen($coCNES) > 7) || (is_array($coCNES) && count($coCNES) > 7)) {\n throw new \\InvalidArgumentException(sprintf('Invalid length for %s, please provide an array with 7 element(s) or a scalar of 7 character(s) at most', var_export($coCNES, true), is_scalar($coCNES) ? strlen($coCNES) : count($coCNES)), __LINE__);\n }\n // validation for constraint: minLength\n if ((is_scalar($coCNES) && strlen($coCNES) < 7) || (is_array($coCNES) && count($coCNES) < 7)) {\n throw new \\InvalidArgumentException(sprintf('Invalid length for %s, please provide an array with 7 element(s) or a scalar of 7 character(s) at least', var_export($coCNES, true), is_scalar($coCNES) ? strlen($coCNES) : count($coCNES)), __LINE__);\n }\n if (is_null($coCNES) || (is_array($coCNES) && empty($coCNES))) {\n unset($this->coCNES);\n } else {\n $this->coCNES = $coCNES;\n }\n return $this;\n }", "public function __construct()\n\t{\n\t $this->entity = new TiposContacto;\n\t}", "function __construct($pnome, $pcognome, $psesso, $pdata_nascita, $pemail, $ptelefono, $pcodice_fiscale) {\r\n $this->nome=$pnome;\r\n $this->cognome=$pcognome;\r\n $this->sesso=$psesso;\r\n $this->data_nascita=$pdata_nascita;\r\n $this->email=$pemail;\r\n $this->telefono=$ptelefono;\r\n $this->codice_fiscale=$pcodice_fiscale;\r\n }", "public function __construct(InscricaoExpedicao $inscricao)\n {\n $this->inscricao = $inscricao;\n }", "public function setCNES($cNES)\n {\n $this->cNES = $cNES;\n return $this;\n }", "public function __construct()\n\t{\n\t\t// default from encoding\n\t\t$this->from = 'CP1252';\n\n\t\t// default to encoding\n\t\t$this->to = 'UTF-8';\n\t}", "public function getNuCNPJ()\n {\n return isset($this->nuCNPJ) ? $this->nuCNPJ : null;\n }", "public function __construct($n, $a, $c, $t, $em, $dir, $sx, $fn, $sc){\n\t\t$this->nombre = $n;\n\t\t$this->apellido = $a;\n\t\t$this->cedula = $c;\n\t\t$this->telefono = $t;\n\t\t$this->email = $em;\n\t\t$this->direccion = $dir;\n\t\t$this->sexo = $sx;\n\t\t$this->fecnacper = $fn;\n\t\t$this->staciv =\t$sc;\n\t\t$this->fechoy = date('Y-m-d');\n\t\t$this->dia = date('d');\n\t\t$this->mes = date('m');\n\t\t$this->ano = date('Y');\n\t\t$this->edad = 0;\n\t}", "public function processarCNPJ(Request $request)\n {\n\n if (Auth::check()) {\n\n $cnpj = $request->input('cnpj');\n\n $retorno = $this->api($cnpj);\n\n $this->validate($request, [\n 'cnpj' => 'required'\n ]);\n\n if ($retorno == false) {\n return redirect('consultarCNPJ')->with('message', 'Ocorreu um erro!');\n }\n\n $sintegra = new Sintegra();\n $sintegra->id_usuario = Auth::user()->id;\n $sintegra->cnpj = $cnpj;\n $sintegra->json = $retorno;\n $sintegra->save();\n return redirect('home')->with('message', 'Cadastrado realizado com sucesso!');\n\n } else {\n return redirect('home');\n }\n }", "public function __construct($_cardType = NULL,$_cardNumber = NULL,$_bankName = NULL,$_bankCode = NULL)\n {\n parent::__construct(array('CardType'=>$_cardType,'CardNumber'=>$_cardNumber,'BankName'=>$_bankName,'BankCode'=>$_bankCode),false);\n }", "function __construct($_caja, $_codigoEstanteria, $_leja) {\r\n if($_caja instanceof CajaSorpresa){\r\n parent::__construct($_caja->getCodigo(), $_caja->getAnchura(),$_caja->getAltura(), $_caja->getProfundidad(), $_caja->getColor(), $_caja->getContenido(), $_caja->getDevolucion());\r\n $this->sorpresa=$_caja;\r\n $this->estanteria=$_codigoEstanteria;\r\n $this->leja=$_leja;\r\n }\r\n }", "public function setCN22Type($cN22Type)\n {\n $this->cN22Type = $cN22Type;\n return $this;\n }", "public function __construct($iCodigo = null) {\n \t\n if (!empty($iCodigo)) {\n \t\n $oDaoAjuda = new cl_tfd_ajudacusto();\n $sSqlAjuda = $oDaoAjuda->sql_query_file($iCodigo);\n $rsAjuda = $oDaoAjuda->sql_record($sSqlAjuda);\n \n if ($oDaoAjuda->numrows == 0) {\n throw new BusinessException(_M(URL_MENSAGEM_AJUDACUSTO.\"ajuda_custo_nao_encontrado\"));\n }\n\n $oDados = db_utils::fieldsMemory($rsAjuda, 0);\n\n $this->iCodigo = $oDados->tf12_i_codigo; \n $this->oProcedimento = new ProcedimentoSaude($oDados->tf12_i_procedimento); \n $this->sDescricao = $oDados->tf12_descricao;\n $this->lFaturaAutomatico = $oDados->tf12_faturabpa == 't';\n $this->lAcompanhate = $oDados->tf12_acompanhente == 't';\n }\n }", "function __construct($Id_Utilizador,$Nome,$Email,$Password,$Tipo,$Data_Inscricao,$estado){\n parent::__construct($Id_Utilizador,$Nome,$Email,$Password,$Tipo,$Data_Inscricao);\n $this->Estado=$estado;\n }", "public function __construct($envio)\n {\n $this->to('[email protected]');\n // $this->to('[email protected]');\n $this->subject($envio->assunto);\n $this->from($envio->email,$envio->nome);\n // $this->attach($envio->anexo);\n // $this->replyTo($envio->reply, $envio->name);\n\n $this->nome = $envio->nome;\n $this->mensagem = $envio->mensagem;\n $this->telefone = $envio->telefone;\n $this->email = $envio->email;\n }", "function __construct(Cliente $persona, $email='', $contrasenia='', $rutaFoto=''){\r\n\t\t$this->id=null;\r\n\t\t$this->persona= $persona;\r\n\t\t$this->email= $email;\r\n\t\t$this->contrasenia= $contrasenia;\r\n\t\t$this->foto= $rutaFoto; //foto se guarda como un string ahora\r\n\t\t$this->tipoUsuario= 'Cliente';\r\n\t}", "function __construct($persona = false, $tipo = false){\n\t\t$this->mPersona\t\t\t\t= setNoMenorQueCero($persona);\n\t\t$this->mTipo\t\t\t\t= $tipo;\n\t\t$this->mLoc\t\t\t\t\t= new cLocal();\n\t\t$this->mClaveDeEstado\t\t= $this->mLoc->DomicilioEstadoClaveNum();\n\t\t$this->mClaveDeMunicipio\t= $this->mLoc->DomicilioMunicipioClave();\n\t\t$this->mClaveDeLocalidad\t= $this->mLoc->DomicilioLocalidadClave();\n\t\t\t\n\t\t$this->mNombreDeLocalidad\t= $this->mLoc->DomicilioLocalidad();\n\t\t$this->mNombreDeMunicipio\t= $this->mLoc->DomicilioMunicipio();\n\t\t$this->mNombreDeEstado\t\t= $this->mLoc->DomicilioEstado();\n\t\t$this->mCodigoPostal\t\t= $this->mLoc->DomicilioCodigoPostal();\n\t\t$this->mAntiguedad\t\t\t= DEFAULT_TIEMPO;\n\t\t$this->mClaveEmpresa\t\t= FALLBACK_CLAVE_EMPRESA;\n\t\t$this->mClaveDePais\t\t\t= EACP_CLAVE_DE_PAIS;\n\t}", "function __construct($sabor, $tipo, $cliente, $importe, $cantidad)\n {\n $this->sabor = $sabor;\n $this->tipo = $tipo;\n $this->cliente = $cliente;\n $this->importe = $importe;\n $this->cantidad = $cantidad;\n }", "public function testDebtorSaveCpfCnpjEmpty()\n {\n $aDados = [\n 'name' => 'Carlos Vinicius',\n 'email' => '[email protected]',\n 'cpf_cnpj' => '',\n 'birthdate' => '15/01/1996',\n 'phone_number' => '(79) 9 9999-9999',\n 'zipcode' => '99999-999',\n 'address' => 'Rua Teste',\n 'number' => '25',\n 'complement' => 'Conjunto Teste 2',\n 'neighborhood' => 'Bairro Teste 2',\n 'city' => 'Aracaju',\n 'state' => 'SE'\n ];\n\n $this->expectException(InvalidAttributeException::class);\n $oDebtor = Debtor::createFromRequest($aDados);\n }" ]
[ "0.6133924", "0.6133133", "0.60485125", "0.60412997", "0.5641067", "0.550127", "0.550127", "0.5463589", "0.54180413", "0.5394633", "0.5394009", "0.528201", "0.52130604", "0.5203717", "0.5203695", "0.5186522", "0.51823366", "0.51777816", "0.51773524", "0.51518667", "0.51476455", "0.5143912", "0.5129105", "0.50963116", "0.5091947", "0.50714964", "0.5070726", "0.50591505", "0.5032852", "0.5019879" ]
0.62132496
0
Get coCNES value An additional test has been added (isset) before returning the property value as this property may have been unset before, due to the fact that this property is removable from the request (nillable=true+minOccurs=0)
public function getCoCNES() { return isset($this->coCNES) ? $this->coCNES : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasCO()\n {\n return $this->CO !== null;\n }", "public function getCoNegocio()\n\t{\n\t\treturn $this->co_negocio;\n\t}", "public function getCoCentroDato()\n\t{\n\t\treturn $this->co_centro_dato;\n\t}", "public function getCoCustodio()\n\t{\n\t\treturn $this->co_custodio;\n\t}", "public function getPropertyValue() {\n\t\t$propertyValue = parent::getPropertyValue();\n\t\tif ($propertyValue === NULL)\n\t\t\treturn FALSE;\n\t\treturn $propertyValue;\n\t}", "public function getValorCofins()\n {\n return $this->valorCofins;\n }", "public function getNuCNPJ()\n {\n return isset($this->nuCNPJ) ? $this->nuCNPJ : null;\n }", "public function getCni()\n {\n return $this->cni;\n }", "protected function getPropertyValue() {}", "public function getNao_Circulante(){\n\t\t$this->setNao_Circulante();\n\t\t\n\t\treturn $this->Nao_Circulante;\t\n\t}", "public function getCouleur()\n {\n return $this->couleur;\n }", "public function getNoCotisant(): ?string {\n return $this->noCotisant;\n }", "public function getCnational()\n {\n return $this->cnational;\n }", "public function getCoEdificio()\n\t{\n\t\treturn $this->co_edificio;\n\t}", "public function getCNPJ()\n {\n return $this->CNPJ;\n }", "public function getCodope(){\n\t\treturn $this->codope;\n\t}", "public function getCodcaj(){\n\t\treturn $this->codcaj;\n\t}", "public function getCoDivision()\n\t{\n\t\treturn $this->co_division;\n\t}", "public function getClaseCampo() {\n\t\treturn $this->claseCampo;\n\t}", "public function getCasKonec()\n {\n return $this->cas_konec;\n }", "public function getC()\n {\n return $this->C;\n }", "public function getNuCpf()\n\t{\n\t\treturn $this->nu_cpf;\n\t}", "public function getCoNivelCriticidad()\n\t{\n\t\treturn $this->co_nivel_criticidad;\n\t}", "public function shouldGetNullIfNoCO(): void\n {\n $this->assertNoPollutantReading('getCO');\n }", "private function getCc(): ?array {\n\t\treturn $this->cc;\n\t}", "public function getCoForense()\n\t{\n\t\treturn $this->co_forense;\n\t}", "public function getCodiCasa($value) {\n\t\treturn $this->codi_casa;\n\t}", "public function getTotalCotisCcs(): ?float {\n return $this->totalCotisCcs;\n }", "public function getIsCaValue()\n {\n return $this->readWrapperValue(\"is_ca\");\n }", "public function getNIVELSOCIOECONOMICO()\r\n {\r\n return $this->NIVEL_SOCIOECONOMICO;\r\n }" ]
[ "0.631181", "0.6079042", "0.5971806", "0.59432065", "0.5903892", "0.5899524", "0.57391095", "0.57228625", "0.57219416", "0.56861645", "0.5645492", "0.5636789", "0.56046885", "0.55980515", "0.5587401", "0.55760723", "0.55554587", "0.55500454", "0.5542976", "0.5542143", "0.5534301", "0.55316406", "0.55268985", "0.5525981", "0.5506155", "0.54737866", "0.5471567", "0.5461768", "0.5455193", "0.5442356" ]
0.6694134
0
Set coCNES value This property is removable from request (nillable=true+minOccurs=0), therefore if the value assigned to this property is null, it is removed from this object
public function setCoCNES($coCNES = null) { // validation for constraint: string if (!is_null($coCNES) && !is_string($coCNES)) { throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($coCNES, true), gettype($coCNES)), __LINE__); } // validation for constraint: maxLength if ((is_scalar($coCNES) && strlen($coCNES) > 7) || (is_array($coCNES) && count($coCNES) > 7)) { throw new \InvalidArgumentException(sprintf('Invalid length for %s, please provide an array with 7 element(s) or a scalar of 7 character(s) at most', var_export($coCNES, true), is_scalar($coCNES) ? strlen($coCNES) : count($coCNES)), __LINE__); } // validation for constraint: minLength if ((is_scalar($coCNES) && strlen($coCNES) < 7) || (is_array($coCNES) && count($coCNES) < 7)) { throw new \InvalidArgumentException(sprintf('Invalid length for %s, please provide an array with 7 element(s) or a scalar of 7 character(s) at least', var_export($coCNES, true), is_scalar($coCNES) ? strlen($coCNES) : count($coCNES)), __LINE__); } if (is_null($coCNES) || (is_array($coCNES) && empty($coCNES))) { unset($this->coCNES); } else { $this->coCNES = $coCNES; } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setCNES($cNES)\n {\n $this->cNES = $cNES;\n return $this;\n }", "public function getCoCNES()\n {\n return isset($this->coCNES) ? $this->coCNES : null;\n }", "public function setCpfAttribute($value) {\n $this->attributes['cpf'] = str_replace('.', '', $value);\n }", "public function setCC()\n {\n }", "public function setC($x) { $this->c = $x; }", "public function setCoNegocio($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->co_negocio !== $v) {\n\t\t\t$this->co_negocio = $v;\n\t\t\t$this->modifiedColumns[] = C060InventarioPeer::CO_NEGOCIO;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function setCodiCasa($value) {\n\t\t//validando de que el valor sea un id\n\t\tif ($this->validateId($value)) {\n\t\t\t//seteando valor a la variable codigo\n\t\t\t$this->codi_casa = $value;\n\t\t\t//retornar true\n\t\t\treturn true;\n\t\t} else {\n\t\t\t//retornar respuesta falso\n\t\t\treturn false;\n\t\t}\n\t}", "public function setCoCentroDato($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->co_centro_dato !== $v) {\n\t\t\t$this->co_centro_dato = $v;\n\t\t\t$this->modifiedColumns[] = C060InventarioPeer::CO_CENTRO_DATO;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function setValue($value)\n {\n $value = arr::get($value, 'value', NULL);\n\n if ($value !== NULL)\n {\n //pokud prisla prazdna hodnota, tak do modelu ukladam NULL\n if (empty($value))\n {\n $value = NULL;\n }\n\n parent::setValue($value);\n }\n }", "public function setCoCustodio($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->co_custodio !== $v) {\n\t\t\t$this->co_custodio = $v;\n\t\t\t$this->modifiedColumns[] = C060InventarioPeer::CO_CUSTODIO;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function setEmailCCAddress($value) { $this->_emailCCAddress = $value; }", "function setRemoved( $value )\n {\n $this->Removed = $value;\n }", "protected function setCc() {}", "public function clearColetaPesquisas()\n\t{\n\t\t$this->collColetaPesquisas = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function setCoSo($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->co_so !== $v) {\n\t\t\t$this->co_so = $v;\n\t\t\t$this->modifiedColumns[] = C060InventarioPeer::CO_SO;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function setCemail($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->cemail !== $v) {\n $this->cemail = $v;\n $this->modifiedColumns[AliMemberTableMap::COL_CEMAIL] = true;\n }\n\n return $this;\n }", "public function testSetDestinatairesCc() {\n\n $obj = new AppelsEnCours();\n\n $obj->setDestinatairesCc(\"destinatairesCc\");\n $this->assertEquals(\"destinatairesCc\", $obj->getDestinatairesCc());\n }", "public function unset(): void\n\t{\n\t\t$this->_value = $this->_allowNull ? null : self::setType('', gettype($this->_value));\n\t}", "public function getCoCentroDato()\n\t{\n\t\treturn $this->co_centro_dato;\n\t}", "public function setNuCpf($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->nu_cpf !== $v) {\n\t\t\t$this->nu_cpf = $v;\n\t\t\t$this->modifiedColumns[] = UsuarioPeer::NU_CPF;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function setCoUsuario($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (int) $v;\n\t\t}\n\n\t\tif ($this->co_usuario !== $v) {\n\t\t\t$this->co_usuario = $v;\n\t\t\t$this->modifiedColumns[] = UsuarioPeer::CO_USUARIO;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function setBillingSubscriptionDiscountsAttribute($value)\n {\n $this->attributes['billing_subscription_discounts'] = empty($value) ? null : json_encode($value);\n }", "function __construct($value) {\n if ($value != self::ADDR_NOMEN_FULL && $value != self::ADDR_NOMEN_PARTIAL ) {\n $this->_value = self::ADDR_NOMEN_NO;\n } else {\n $this->_value = $value;\n }\n }", "private function setCustomerGroupValue()\n {\n $value = $this->getData(self::$groupAttributeCode);\n try {\n $group = $this->groupRepository->getById($value);\n $this->setCustomAttribute(self::$groupAttributeCode, $group->getCode());\n } catch (NoSuchEntityException $e) {\n $this->setCustomAttribute(self::$groupAttributeCode, 'N/A');\n }\n }", "public function setCC($value)\n {\n return $this->set('CC', $value);\n }", "public function setNerve($value)\n {\n $this->nerve = $value;\n }", "public function setIdClienteCon($value,$options=array('required'=>true)){ \n $this->_data['id_cliente_con'] = new ZendT_Type_Number($value,array('numDecimal'=>null));\n if ($options['db'])\n $this->_data['id_cliente_con']->setValueFromDb($value);\n \n if (!$options['db']){\n \n }\n return $this;\n }", "public function setCoForense($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->co_forense !== $v) {\n\t\t\t$this->co_forense = $v;\n\t\t\t$this->modifiedColumns[] = J019tParticipantesPeer::CO_FORENSE;\n\t\t}\n\n\t\tif ($this->aJ016tForense !== null && $this->aJ016tForense->getCoForense() !== $v) {\n\t\t\t$this->aJ016tForense = null;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function clearVpoRequestCargos()\n\t{\n\t\t$this->collVpoRequestCargos = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function setCodope($codope){\n\t\t$this->codope = $codope;\n\t}" ]
[ "0.54714954", "0.54606396", "0.5292915", "0.5220413", "0.52042407", "0.5203908", "0.51417917", "0.5138206", "0.51166564", "0.5112842", "0.5100127", "0.505252", "0.50509554", "0.50266653", "0.49481708", "0.4945997", "0.49249607", "0.49115583", "0.48963767", "0.48885208", "0.48865294", "0.48823142", "0.48804668", "0.48800126", "0.486706", "0.48417163", "0.4839783", "0.4837344", "0.48196483", "0.48138255" ]
0.5789962
0
Get nuCNPJ value An additional test has been added (isset) before returning the property value as this property may have been unset before, due to the fact that this property is removable from the request (nillable=true+minOccurs=0)
public function getNuCNPJ() { return isset($this->nuCNPJ) ? $this->nuCNPJ : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCNPJ()\n {\n return $this->CNPJ;\n }", "public function setNuCNPJ($nuCNPJ = null)\n {\n // validation for constraint: string\n if (!is_null($nuCNPJ) && !is_string($nuCNPJ)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($nuCNPJ, true), gettype($nuCNPJ)), __LINE__);\n }\n // validation for constraint: pattern\n if (is_scalar($nuCNPJ) && !preg_match('/\\\\d{14}/', $nuCNPJ)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value %s, please provide a scalar value that matches \"\\d{14}\"', var_export($nuCNPJ, true)), __LINE__);\n }\n if (is_null($nuCNPJ) || (is_array($nuCNPJ) && empty($nuCNPJ))) {\n unset($this->nuCNPJ);\n } else {\n $this->nuCNPJ = $nuCNPJ;\n }\n return $this;\n }", "public function getNuCpf()\n\t{\n\t\treturn $this->nu_cpf;\n\t}", "public static function unmaskCPF_CNPJ($_input = NULL) {\n\n return self::getNumbers($_input);\n }", "public function consultaCNPJ($cnpj = ''){\n\t\t\t$CNPJ_WS = 'http://receitaws.com.br/v1/cnpj/';\n\t\t\t$URL = $CNPJ_WS.$cnpj;\n\t\t\treturn json_decode( file_get_contents($URL) );\n\t\t}", "public function setCNPJ($CNPJ)\n {\n $this->CNPJ = $CNPJ;\n\n return $this;\n }", "public function getCni()\n {\n return $this->cni;\n }", "public function getNoCotisant(): ?string {\n return $this->noCotisant;\n }", "public function getNuCedula()\n {\n return $this->nu_cedula;\n }", "public function getNcm()\n {\n return $this->ncm;\n }", "public function getCodiNoti($value) {\n\t\treturn $this->codi_noti;\n\t}", "public function setNuCpf($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->nu_cpf !== $v) {\n\t\t\t$this->nu_cpf = $v;\n\t\t\t$this->modifiedColumns[] = UsuarioPeer::NU_CPF;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function getNational(): ?string\n {\n return $this->national;\n }", "public function setCNPJ($cnpj) {\n\t\t//CPF passado ao invés de CNPJ\n\t\tif (strlen($cnpj) == 11) return $this->setCPF($cnpj);\n\n\t\t$this->checkoutTransparente['cliente']['senderCNPJ'] = $cnpj;\n\t\treturn $this;\n\t}", "public function getNationality():?string\n {\n return $this->nationality;\n }", "public static function maskCPF_CNPJ($_input = NULL) {\n\n $number = self::getNumbers($_input);\n $length = strlen($number);\n\n if ($length != 11 && $length != 14) {\n return $_input;\n }\n\n $return = ($length == 11) ? '###.###.###-##' : '##.###.###/####-##';\n $key = -1;\n\n for ($i = 0, $size = strlen($return); $i < $size; $i++) {\n\n if ($return[$i] == '#') {\n $return[$i] = $number[++$key];\n }\n }\n\n return $return;\n }", "public function isCnpj($value = '')\n {\n return strlen($value) > 11;\n }", "public function getNprcifecha()\n {\n return $this->nprcifecha;\n }", "public function getCountryCode(): ?string;", "public function getNprciOculto()\n {\n return $this->nprciOculto;\n }", "function getCN($dn)\n{\n preg_match('/[^,]*/', $dn, $matchs, PREG_OFFSET_CAPTURE, 3);\n return $matchs[0][0];\n}", "public function getNational()\n {\n return $this->national;\n }", "public function getCdNfservico()\n {\n return $this->cd_nfservico;\n }", "public function valida_CUI_Nacimiento($cui){\n\n $objeto = new ServNacimientoController;\n $total_sumas = $objeto->FormarCUISumatoria($cui);\n $ultimodigit = $objeto->ObtenerUltimoDigito($cui);\n $valor_bool = $objeto->ValidarUltimoValor($total_sumas,$ultimodigit);\n\n return $valor_bool;\n }", "public function getNoPenetapanPnf()\n {\n return $this->no_penetapan_pnf;\n }", "public function getCodcaj(){\n\t\treturn $this->codcaj;\n\t}", "public function getIndemniteCp(): ?float {\n return $this->indemniteCp;\n }", "public function getCedenteCidadeUF();", "public function getCleanValue()\n {\n return null;\n }", "public function getCountryCode(): ?string\n {\n return $this->countryCode;\n }" ]
[ "0.7387478", "0.6545874", "0.6433879", "0.60878026", "0.57857925", "0.5743779", "0.5743077", "0.5651185", "0.5620619", "0.5589523", "0.5582703", "0.55487883", "0.5537565", "0.54640776", "0.5449707", "0.5344199", "0.5342418", "0.5286678", "0.52621996", "0.5240857", "0.5155952", "0.5119466", "0.511593", "0.5062176", "0.5058693", "0.50390434", "0.50235444", "0.50044715", "0.4995507", "0.49887657" ]
0.81627965
0
Set nuCNPJ value This property is removable from request (nillable=true+minOccurs=0), therefore if the value assigned to this property is null, it is removed from this object
public function setNuCNPJ($nuCNPJ = null) { // validation for constraint: string if (!is_null($nuCNPJ) && !is_string($nuCNPJ)) { throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($nuCNPJ, true), gettype($nuCNPJ)), __LINE__); } // validation for constraint: pattern if (is_scalar($nuCNPJ) && !preg_match('/\\d{14}/', $nuCNPJ)) { throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a scalar value that matches "\d{14}"', var_export($nuCNPJ, true)), __LINE__); } if (is_null($nuCNPJ) || (is_array($nuCNPJ) && empty($nuCNPJ))) { unset($this->nuCNPJ); } else { $this->nuCNPJ = $nuCNPJ; } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNuCNPJ()\n {\n return isset($this->nuCNPJ) ? $this->nuCNPJ : null;\n }", "public function setNuCpf($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->nu_cpf !== $v) {\n\t\t\t$this->nu_cpf = $v;\n\t\t\t$this->modifiedColumns[] = UsuarioPeer::NU_CPF;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function setCNPJ($CNPJ)\n {\n $this->CNPJ = $CNPJ;\n\n return $this;\n }", "public function setCNPJ($cnpj) {\n\t\t//CPF passado ao invés de CNPJ\n\t\tif (strlen($cnpj) == 11) return $this->setCPF($cnpj);\n\n\t\t$this->checkoutTransparente['cliente']['senderCNPJ'] = $cnpj;\n\t\treturn $this;\n\t}", "public function getCNPJ()\n {\n return $this->CNPJ;\n }", "public function setNuCelular($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->nu_celular !== $v) {\n\t\t\t$this->nu_celular = $v;\n\t\t\t$this->modifiedColumns[] = UsuarioPeer::NU_CELULAR;\n\t\t}\n\n\t\treturn $this;\n\t}", "public static function unmaskCPF_CNPJ($_input = NULL) {\n\n return self::getNumbers($_input);\n }", "public function setNuTelefone($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->nu_telefone !== $v) {\n\t\t\t$this->nu_telefone = $v;\n\t\t\t$this->modifiedColumns[] = UsuarioPeer::NU_TELEFONE;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function getNuCpf()\n\t{\n\t\treturn $this->nu_cpf;\n\t}", "public function setNuCedula($nu_cedula)\n {\n $this->nu_cedula = $nu_cedula;\n\n return $this;\n }", "public function setNValue($nVal) {}", "public function setCCNumber($number = '') {\n $cc = array(\n 'x_card_num'=>$this->cleanCCNumber($number),\n );\n $this->NVP = array_merge($this->NVP, $cc); \n }", "public function setNoPenetapanPnf($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (string) $v;\n }\n\n if ($this->no_penetapan_pnf !== $v) {\n $this->no_penetapan_pnf = $v;\n $this->modifiedColumns[] = SekolahPaudPeer::NO_PENETAPAN_PNF;\n }\n\n\n return $this;\n }", "public function setCni($cni)\n {\n $this->cni = $cni;\n\n return $this;\n }", "public static function maskCPF_CNPJ($_input = NULL) {\n\n $number = self::getNumbers($_input);\n $length = strlen($number);\n\n if ($length != 11 && $length != 14) {\n return $_input;\n }\n\n $return = ($length == 11) ? '###.###.###-##' : '##.###.###/####-##';\n $key = -1;\n\n for ($i = 0, $size = strlen($return); $i < $size; $i++) {\n\n if ($return[$i] == '#') {\n $return[$i] = $number[++$key];\n }\n }\n\n return $return;\n }", "public function processarCNPJ(Request $request)\n {\n\n if (Auth::check()) {\n\n $cnpj = $request->input('cnpj');\n\n $retorno = $this->api($cnpj);\n\n $this->validate($request, [\n 'cnpj' => 'required'\n ]);\n\n if ($retorno == false) {\n return redirect('consultarCNPJ')->with('message', 'Ocorreu um erro!');\n }\n\n $sintegra = new Sintegra();\n $sintegra->id_usuario = Auth::user()->id;\n $sintegra->cnpj = $cnpj;\n $sintegra->json = $retorno;\n $sintegra->save();\n return redirect('home')->with('message', 'Cadastrado realizado com sucesso!');\n\n } else {\n return redirect('home');\n }\n }", "public function setCpfAttribute($value) {\n $this->attributes['cpf'] = str_replace('.', '', $value);\n }", "public function setNmfcCode($nmfcCode)\n {\n $this->values['NmfcCode'] = $nmfcCode;\n return $this;\n }", "function setValorNota($nValorNota) {\n \n $this->nValorNota = $nValorNota;\n }", "public function setCodiNoti($value) {\n\t\t//validando de que el valor sea un id\n\t\tif ($this->validateId($value)) {\n\t\t\t//seteando valor a la variable codigo\n\t\t\t$this->codi_noti = $value;\n\t\t\t//retornar true\n\t\t\treturn true;\n\t\t} else {\n\t\t\t//retornar respuesta falso\n\t\t\treturn false;\n\t\t}\n\t}", "public function setNci($nci)\n {\n $this->nci = $nci;\n }", "protected function setCUITNumber($value)\n\t{\n\t\t$this->setTextFont(10);\n\t\tpreg_match(\"/(\\d{2})(\\d{8})(\\d{1})/\", $value, $matches);\n\t\n\t\tif (count($matches) == 4)\n\t\t{\n\t\t\t$cuit = $matches[1] . \"-\" . $matches[2] . \"-\" . $matches[3];\n\t\n\t\t\tif (strlen($cuit) == 13){\n\t\t\t\tfor($i=0;$i<$this->copies;$i++){\n\t\t\t\t\t$this->_getPdf()->pages[$i]->drawText($cuit, 298, 623, 'UTF-8');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function setNota_num($inota_num = '')\n {\n $this->inota_num = $inota_num;\n }", "public function setNluSettings($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Dialogflow\\Cx\\V3beta1\\NluSettings::class);\n $this->nlu_settings = $var;\n\n return $this;\n }", "public function setNup($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (int) $v;\n }\n\n if ($this->nup !== $v) {\n $this->nup = $v;\n $this->modifiedColumns[] = BangunanPeer::NUP;\n }\n\n\n return $this;\n }", "public function getNuCedula()\n {\n return $this->nu_cedula;\n }", "public function testSetNumeroNoeudLocal() {\n\n $obj = new FichesControlesEntetes();\n\n $obj->setNumeroNoeudLocal(10);\n $this->assertEquals(10, $obj->getNumeroNoeudLocal());\n }", "public function setNtry($value,$options=array('required'=>true)){ \n $this->_data['ntry'] = new ZendT_Type_Number($value,array('numDecimal'=>0));\n if ($options['db'])\n $this->_data['ntry']->setValueFromDb($value);\n \n if (!$options['db']){\n \n }\n return $this;\n }", "public function testDebtorSaveCpfCnpjEmpty()\n {\n $aDados = [\n 'name' => 'Carlos Vinicius',\n 'email' => '[email protected]',\n 'cpf_cnpj' => '',\n 'birthdate' => '15/01/1996',\n 'phone_number' => '(79) 9 9999-9999',\n 'zipcode' => '99999-999',\n 'address' => 'Rua Teste',\n 'number' => '25',\n 'complement' => 'Conjunto Teste 2',\n 'neighborhood' => 'Bairro Teste 2',\n 'city' => 'Aracaju',\n 'state' => 'SE'\n ];\n\n $this->expectException(InvalidAttributeException::class);\n $oDebtor = Debtor::createFromRequest($aDados);\n }", "public function getCodiNoti($value) {\n\t\treturn $this->codi_noti;\n\t}" ]
[ "0.70318806", "0.6352188", "0.63390356", "0.6264461", "0.605475", "0.5691088", "0.56090206", "0.54547113", "0.5376895", "0.53452873", "0.5060438", "0.5053082", "0.50386286", "0.4998144", "0.49142256", "0.48971048", "0.48848438", "0.48531184", "0.48383355", "0.4787304", "0.47469443", "0.47136518", "0.4711306", "0.4710493", "0.46950763", "0.46873382", "0.46771187", "0.46027666", "0.4560835", "0.45566893" ]
0.77720994
0
Devuelve el valor del campo servicio_id
public function getServicioId() { return $this->servicio_id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIdSolicitudServicio()\n {\n return $this->idSolicitudServicio;\n }", "public function getIdproducto()\n {\n return $this->idproducto;\n }", "public function getserviceId()\n {\n return $this->service_id;\n }", "public function getId_producto()\n {\n return $this->id_producto;\n }", "public function getIdproducto()\n {\n return $this->idproducto;\n }", "function servicioID($id){\n\t\t\n\t\t$query = $this->db->from('servicio')->where('id',$id)->get();\n\t\tif($query-> num_rows() > 0)\n\t\t\t{\n\t\t\treturn $query;\n\t\t\t// SI SE MANDA A RETORNAR SOLO $QUERY , SE PUEDE UTILIZAR LOS ELEMENTOS DEL QUERY \n\t\t\t// COMO usuarioID($data['sesion']->result()[0]->id_usuario POR EJEMPLO. \n\t\t\t}\n\t\n\t}", "function obtenerServicioID($descripcion){\n\n\t $query = $this->db->get('servicio');\n\t \n\t if($query-> num_rows() > 0){\n\t $row = $query->row($descripcion);\n\t\tif (isset($row))\n\t\t\t{\n \treturn $row->id;\n\t\t\t} \n\t }\n\t else return false ;\n\t}", "public function getServiceId()\n {\n return $this->service_id;\n }", "public function getIdProducto()\n {\n return $this->id_producto;\n }", "public function getIdProducto()\n {\n return $this->id_producto;\n }", "public function getServiceId()\r\n {\r\n return $this->serviceId;\r\n }", "public function getServiceId() {\n return $this->serviceId;\n }", "public function getServiceId()\n {\n if (array_key_exists(\"serviceId\", $this->_propDict)) {\n return $this->_propDict[\"serviceId\"];\n } else {\n return null;\n }\n }", "public function getIdService() {\n return $this->idService;\n }", "public function getServicioID(Request $request)\n {\n if (!$request->ajax()) return redirect('/');\n\n $id = $request->id;\n\n $infoService = \\App\\Servicio::where('id', $id)->get();\n\n return $infoService;\n }", "public function getIdcliente() {\n\t\t\t\treturn $this->id_cliente ?? \"Id do Cliente não solicitado !!\";\n\t\t\t}", "public function getCodServico()\n {\n return $this->cod_servico;\n }", "public function getIdProduto()\n\t\t{\n\t\t\treturn $this -> idproduto;\n\t\t}", "public function getIdCalendario(){\n return $this->idCalendario;\n }", "public function getId_produto()\n {\n return $this->id_produto;\n }", "public function getidcliente(){\n\t\treturn $this->_idcliente;\n\t}", "public function getContrato_id() {\n return $this->contrato_id;\n }", "public function getId(){\n if(!$this->id){\n return $this->getShippingOptionId().'_'.md5($this->getShippingServiceName());\n }\n return $this->id;\n }", "abstract protected function _getIdentityServiceId();", "public function getIdCliente(){\r\n return $this->idCliente;\r\n }", "public function getCargoDirectivoId()\n\t{\n\t\treturn $this->cargoDirectivoId;\n\t}", "public function getIdProducto()\n {\n return $this->idProducto;\n }", "public function txtIdServicio_Create($strControlId = null) {\n\t\t\t$this->txtIdServicio = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtIdServicio->Name = QApplication::Translate('Id Servicio');\n\t\t\t$this->txtIdServicio->Text = $this->objFichas->IdServicio;\n\t\t\t$this->txtIdServicio->MaxLength = Fichas::IdServicioMaxLength;\n\t\t\treturn $this->txtIdServicio;\n\t\t}", "public function getIdProducto()\n {\n return $this->idProducto;\n }", "function getIdCliente()\r\n\t {\r\n\t\t return $this->id_cliente;\r\n\t }" ]
[ "0.68689317", "0.6775176", "0.6761141", "0.67437375", "0.6721266", "0.6643114", "0.6622726", "0.65125185", "0.6310367", "0.6310367", "0.63039243", "0.6297251", "0.6289365", "0.6287069", "0.6240191", "0.6200611", "0.6130357", "0.61295295", "0.6125777", "0.6054084", "0.600361", "0.5942347", "0.5910506", "0.59014887", "0.58766305", "0.58071315", "0.5804305", "0.58023685", "0.5802192", "0.5801212" ]
0.781281
0
Devuelve el valor del campo fecha_emision
public function getFechaEmision() { return $this->fecha_emision; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDateEmbauche() \n {\n return $this->dateEmbauche;\n }", "public function getDateEmbauche() {\n return $this->dateEmbauche;\n }", "public function getDataEmissao()\n {\n if ($this->data_emissao) {\n return $this->data_emissao->format('d/m/Y');\n }\n return null;\n }", "public function getEncuestaFechacreacion()\r\n {\r\n return $this->encuesta_fechaCreacion;\r\n }", "public function getfecha()\r\n {\r\n return $this->fecha;\r\n }", "public function getFechaConversionEnergetica(){\n return $this->fechaConversionEnergetica;\n }", "function getFecha(){\n\t\treturn $this->fecha;\n\t}", "function getFecha() {\r\n return $this->fecha;\r\n }", "public function getfechaentrega()\r\n {\r\n return $this->fechaentrega;\r\n }", "public function getDateEmprunt()\n {\n return $this->dateEmprunt;\n }", "public function getFechaVencimientoEstudianteDocumento( ){\n\t\t\treturn $this->fechaVencimientoEstudianteDocumento;\n\t\t}", "public function getFechaComentario()\n {\n return $this->fecha_comentario;\n }", "public function getFechaModificacion()\n {\n return $this->fechaModificacion;\n }", "public function getFecha()\n {\n return $this->fecha;\n }", "public function getFecha()\n {\n return $this->fecha;\n }", "public function getFecha() {\n return $this->fecha;\n }", "public function getFecha() {\n return $this->fecha;\n }", "public function getFechaModificacion()\n {\n return $this->fecha_modificacion;\n }", "public function getFechaModificacion()\n {\n return $this->fecha_modificacion;\n }", "public function getDateFecha()\n {\n return $this->dateFecha;\n }", "public function getFechaUltimaModificacion( ){\n\t\t\treturn $this->fechaUltimaModificacion;\n\t\t}", "public function getFecha()\n {\n return $this->c_fecha;\n }", "public function getrep_fecha()\r\n {\r\n return $this->rep_fecha;\r\n }", "public function getExpdate()\n {\n return $this->expdate;\n }", "public function getDateEcheance(): ?string {\n return $this->dateEcheance;\n }", "public function testDirecteurValeurDateEmbauche() {\n $directeurATester = new Directeur();\n $dateTemoin = DateTime::createFromFormat(\"d/m/Y\",$this->dateTemoin);\n $directeurATester->setDateEmbauche($this->dateTemoin);\n $this->assertEquals($dateTemoin,$directeurATester->getDateEmbauche());\n }", "public function getDateEn() {\n return $this->date;\n }", "public function getAtualizadoEm()\n {\n return $this->atualizadoEm;\n }", "public function getFecha_inicio_joven() {\n return $this->fecha_inicio_joven;\n }", "public function getExpDate()\n {\n return $this->ExpDate;\n }" ]
[ "0.7006998", "0.6980797", "0.6960361", "0.6689627", "0.6555423", "0.6460024", "0.64390945", "0.6432203", "0.64205927", "0.6409014", "0.64067", "0.6393756", "0.63772196", "0.6345658", "0.6345658", "0.6340427", "0.6340427", "0.6334763", "0.6334763", "0.62975705", "0.62692297", "0.6163939", "0.6147243", "0.61183923", "0.6109344", "0.6098611", "0.60872406", "0.60793734", "0.60379887", "0.6019765" ]
0.8239672
0
Devuelve el valor del campo hora_emision
public function getHoraEmision() { return $this->hora_emision; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFechaEmision() {\n return $this->fecha_emision;\n }", "public function getHora () {\n return $this->sHora;\n }", "public function getHora() {\n\t\treturn $this->Hora;\n\t}", "public function vr_hora()\n {\n\n $valor=$this->vr_hora;\n\n if ($this->id_tipotitulo == 3)\n {\n $valor='10208';\n } elseif ($this->id_tipotitulo == 4) {\n $valor='15122';\n } elseif ($this->id_tipotitulo == 5) {\n $valor='19096';\n } elseif ($this->id_tipotitulo == 7) {\n $valor='23252';\n } elseif ($this->id_tipotitulo == 10) {\n $valor='27014';\n } elseif ($this->id_tipotitulo == 9) {\n $valor='10208';\n } elseif ($this->id_tipotitulo == 11) {\n $valor='10208'; }\n elseif ($this->id_tipotitulo == 12) {\n $valor='0';\n }\n\n\n return $valor;\n\n }", "function Hora_prog($valor){\t\n\n return date(\"H:i\", strtotime($valor));\n\n}", "function convertir_hora_militar($seg_ini) {\n\n\t\t\t$horas = floor($seg_ini/3600);\n\t\t\t$minutos = floor(($seg_ini-($horas*3600))/60);\n\t\t\t\t\t\t\t\n\t\t\treturn $horas.\":\".$minutos;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}", "function getHour()\r\n {\r\n return $this->hora;\r\n }", "function formatear_hora($parametro){\n\n\t\t/* Declaro variables personalizadas para que queden claros los datos */\n\t\t$hora = substr($parametro, 11, 2);\n\t\t$minuto = substr($parametro, 14, 2);\n\t\t$dia = substr($parametro, 8, 2);\n\t\t$mes = substr($parametro, 5, 2);\n\t\t\n\t\t/* Generamos el formato */\n\t\t$temp = $hora.\":\".$minuto;\n\t\t\n\t\treturn $temp;\n\t}", "public function getServerHour(){\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT DATE_FORMAT(NOW(), '%k:%i:%s') AS hora\");\n\t\t$stmt->execute();\n\t\treturn $stmt->fetch()[0]; //respuesta\n\t}", "function horas_em_mintutos($hora)\n{\n\n if ($hora == '') {\n $hora = '00:00';\n }\n\n $h1 = explode(\":\", $hora);\n\n\n $minuto = $h1[1];\n $horas = $h1[0];\n\n\n if ($horas > 0) {\n\n if (substr($horas, 0, 1) == 0) {\n $horas = substr($horas, 1, 1);\n }\n\n $horas = $horas * 60;\n\n $minuto = $minuto + $horas;\n }\n\n\n\n\n return $minuto;\n}", "public function getHoraInicioAtencion() {\n return $this->hora_inicio_atencion;\n }", "public static function hora ($archivo)\n {\n /**\n * Valido la estructura de horas\n */\n //hora por la cual inicia el archivo\n $actual=$archivo->excel->sheets[0]['cells'][5][1];\n// $actual=0;\n $contador=0;\n //Cuantos segundos\n $regAprox=1500*$archivo->excel->sheets[0]['cells']['numRows'][1];\n\n $segundos=$regAprox/2.8;\n $segundos=substr($segundos,0,4);\n //Aumento el tiempo de ejecucion\n ini_set('memory_limit', -1);\n ini_set('max_execution_time', $segundos);\n for ($i=5; $i<$archivo->excel->sheets[0]['numRows']; $i++)\n { \n if($archivo->excel->sheets[0]['cells'][$i][1]!=\"Total\" && $archivo->excel->sheets[0]['cells'][$i][1]!=\"Date\" && $archivo->excel->sheets[0]['cells'][$i][1]!=\"Hour\")\n {\n //Verifico que sean secuenciales las horas\n if($actual <= $archivo->excel->sheets[0]['cells'][$i][1])\n {\n if($actual==$archivo->excel->sheets[0]['cells'][$i][1])\n {\n $contador=$contador+1;\n }\n elseif($actual==$archivo->excel->sheets[0]['cells'][$i][1]-1)\n {\n if($contador<=1)\n {\n self::$error=ValidationsArchCapt::ERROR_ESTRUC;\n return false;\n }\n else\n {\n $contador=0;\n $actual=$archivo->excel->sheets[0]['cells'][$i][1];\n }\n }\n else\n {\n self::$error=ValidationsArchCapt::ERROR_ESTRUC;\n return false; \n }\n }\n }\n }\n \n //Cuantos segundos\n $regAprox=1500*$archivo->excel->sheets[0]['cells']['numRows'][1];\n $segundos=$regAprox/2.8;\n $segundos=substr($segundos,0,4);\n //Aumento el tiempo de ejecucion\n ini_set('max_execution_time', $segundos);\n// ini_set(\"memory_limit\",\"128M\");\n\n \n /**\n * Verifico que la fecha del archivo sea correcta\n */\n $date_balance_time=Utility::formatDate($data->sheets[0]['cells'][1][5]);\n \n /**\n * Comienzo a leer el archivo\n */\n $valuesNew='';\n $var=array();\n for($i=5;$i<=$archivo->excel->sheets[0]['numRows'];$i++)\n {\n for($j=1;$j<=$archivo->excel->sheets[0]['numCols'];$j++)\n {\n switch($j)\n {\n case 1:\n //Obtengo la hora del registro\n if($archivo->excel->sheets[0]['cells'][$i][$j]=='Total')\n {\n //si es total es que se termino el archivo\n break 3;\n }\n else\n {\n $time=$archivo->excel->sheets[0]['cells'][$i][$j];\n }\n break;\n case 2:\n //Obtengo el nombre del destino\n if($archivo->excel->sheets[0]['cells'][$i][$j]=='Total')\n {\n //si es total no lo voy a guardar en base de datos\n break 2;\n }\n else\n {\n // $name_destination=utf8_encode($archivo->excel->sheets[0]['cells'][$i][$j]);\n $name_destination=Destination::getId(utf8_encode($archivo->excel->sheets[0]['cells'][$i][$j]));\n }\n break;\n case 3:\n //Obtengo el nombre del customer\n if($archivo->excel->sheets[0]['cells'][$i][$j]=='Total')\n {\n //si es total no lo voy a guardar en base de datos\n break 2;\n }\n else\n {\n //Aqui encodeo el nombre del carrier a utf-8\n // $name_customer=utf8_encode($archivo->excel->sheets[0]['cells'][$i][$j]);\n $name_customer=Carrier::getId(utf8_encode($archivo->excel->sheets[0]['cells'][$i][$j]));\n\n }\n break;\n case 4:\n if($archivo->excel->sheets[0]['cells'][$i][$j]=='Total')\n {\n //si es total no lo voy guardar en base de datos\n break 2;\n }\n else\n {\n // $name_supplier=utf8_encode($archivo->excel->sheets[0]['cells'][$i][$j]);\n $name_supplier=Carrier::getId(utf8_encode($archivo->excel->sheets[0]['cells'][$i][$j]));\n }\n break;\n case 5;\n //minutos\n $minutes=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n case 6;\n //ACD \n $acd=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 7;\n //ASR\n $asr=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 8;\n //Margin %\n $margin_percentage=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 9;\n //Margin per Min\n $margin_per_minute=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 10;\n //Cost per Min\n $cost_per_minute=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 11;\n //Revenue per Min\n $revenue_per_minute=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 12;\n //PDD\n $pdd=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 13;\n //Imcomplete Calls\n $incomplete_calls=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 14;\n //Imcomplete Calls Ner\n $incomplete_calls_ner=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 15;\n //Complete Calls Ner\n $complete_calls_ner=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 16;\n //Complete Calls\n $complete_calls=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 17;\n //Calls Attempts\n $calls_attempts=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 18;\n //Duration Real\n $duration_real=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 19;\n //Duration Cost\n $duration_cost=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 20;\n //NER02 Efficient\n $ner02_efficient=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 21;\n //NER02 Seizure\n $ner02_seizure=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 22;\n //PDDCalls\n $pdd_calls=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 23;\n //Revenue\n $revenue=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 24;\n //Cost\n $cost=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 25;\n //Margin\n $margin=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 26;\n $valuesNew.=\"(\";\n $valuesNew.=\"'\".$date_balance_time.\"',\";\n $valuesNew.=$time.\",\";\n $valuesNew.=$minutes.\",\";\n $valuesNew.=$acd.\",\";\n $valuesNew.=$asr.\",\";\n $valuesNew.=$margin_percentage.\",\";\n $valuesNew.=$margin_per_minute.\",\";\n $valuesNew.=$cost_per_minute.\",\";\n $valuesNew.=$revenue_per_minute.\",\";\n $valuesNew.=$pdd.\",\";\n $valuesNew.=$incomplete_calls.\",\";\n $valuesNew.=$incomplete_calls_ner.\",\";\n $valuesNew.=$complete_calls_ner.\",\";\n $valuesNew.=$complete_calls.\",\";\n $valuesNew.=$calls_attempts.\",\";\n $valuesNew.=$duration_real.\",\";\n $valuesNew.=$duration_cost.\",\";\n $valuesNew.=$ner02_efficient.\",\";\n $valuesNew.=$ner02_seizure.\",\";\n $valuesNew.=$pdd_calls.\",\";\n $valuesNew.=$revenue.\",\";\n $valuesNew.=$cost.\",\";\n $valuesNew.=$margin.\",\";\n $valuesNew.=\"'\".date(\"Y-m-d\").\"',\";\n $valuesNew.=\"'\".date(\"H:i:s\").\"',\";\n $valuesNew.=\"'\".$name_supplier.\"',\";\n $valuesNew.=\"'\".$name_customer.\"',\";\n $valuesNew.=\"'\".$name_destination.\"')\";\n break; \n }\n }\n if($i<=$archivo->excel->sheets[0]['numRows']-1)\n {\n $valuesNew.=\",\";\n }\n }\n $barra = substr($valuesNew, -1, 1);\n if($barra==\",\") \n {\n $valuesNew=substr($valuesNew, 0, - 1); \n }\n if($valuesNew!=\"\")\n {\n $var['regHora']=$valuesNew;\n $var['hora']=$time;\n }\n else\n {\n $var=\"\";\n }\n return $var;\n }", "public static function hoursToMinutes($hora) {\n $hr = explode(':', $hora);\n return ($hr[0] * 60) + $hr[1] + ($hr[2] / 60);\n }", "public function getHoraFinAtencion() {\n return $this->hora_fin_atencion;\n }", "function obtener_hora($fecha) {\r\nreturn(substr($fecha,11,2));\r\n}", "function get_hora_meridiano($hora){\n\t$hora = explode(\":\",$hora);\n\t$h = $hora[0];\n\t$m = $hora[1];\n\tif($h > 12){\n\t\t$h = $h - 12;\n\t\tif($h < 10){\n\t\t\t$h = '0'.$h;\n\t\t}\n\t\t$h = $h.':'.$m.' pm';\t\t\n\t}else{\n\t\tif($h == 12){\n\t\t\t$h = $h.':'.$m.' m';\n\t\t}else{\n\t\t\t$h = $h.':'.$m.' am';\n\t\t}\t\t\n\t}\n\treturn $h;\n}", "public function gethoraentrega()\r\n {\r\n return $this->horaentrega;\r\n }", "public function getEmTime()\n {\n return $this->em_time;\n }", "private function GetTimeHHMM() : string {\n\t\t\t$dt = new DateTime();\n\t\t\t$dtz = new DateTimeZone(\"EUROPE/Berlin\");\n\t\t\t$dt->setTimezone($dtz);\n\t\t\treturn $dt->format(\"H:i\");\n\t\t}", "public function getTimeInicioHora()\n {\n return $this->timeInicioHora;\n }", "public function setHora($Hora) {\n\t\t$this->Hora=$Hora;\n\t}", "public function aMinutos($horario){\n $horas = (int)substr($horario,0,2);\n $mins = (int)substr($horario,3,2);\n $enMinutos = $horas*60+$mins;\n\n return $enMinutos;\n }", "public function getTimeFinHora()\n {\n return $this->timeFinHora;\n }", "function divHoras($hora,$registros) {\n\t$h1=substr($hora,0,-3);\n $m1=substr($hora,3,2);\n $minutos=(($h1*60)*60)+($m1*60);\n $dif=$minutos/$registros;\n $difm=floor($dif/60);\n\treturn $difm;\n\t \n}", "public function getHoraAttribute($value)\n {\n return \\DateTime::createFromFormat($this->getDateFormat(), $value)->format('j/n/Y g:i A');\n }", "function hour()\r\n {\r\n $value = $this->SecondsElapsed;\r\n\r\n $second = $value % 60;\r\n $value = ( $value - $second ) / 60;\r\n\r\n $minute = $value % 60;\r\n $value = ( $value - $minute ) / 60;\r\n\r\n $hour = $value % 24;\r\n\r\n return $hour;\r\n }", "function hoje() {\n $data_hoje = date(\"Y-m-d H:i:s\");\n return $data_hoje;\n }", "function DiferencaHoras($hora_inicial,$hora_final,$duracao,&$atendimentos)\r\n{\r\n $difhora = 0;\r\n $vi = explode(':',$hora_inicial);\r\n $vf = explode(':',$hora_final);\r\n $im = ($vi[0] * 60) + $vi[1];\r\n $fm = ($vf[0] * 60) + $vf[1];\r\n \r\n $dm = $fm - $im;\r\n\r\n $dh = $dm / 60;\r\n \r\n $difhora = $dh;\r\n \r\n\r\n $atendimentos = ($dm / $duracao);\r\n\r\n return $difhora;\r\n}", "function setHour($h)\r\n {\r\n if($h > 23 || $h < 0) {\r\n $this->hora = 0;\r\n } else {\r\n $this->hora = $h;\r\n }\r\n }", "public function get_time_hour() {\n return sprintf( '%02d', (int) edd_get_option( 'edd_commissions_payout_schedule_time_hr', '' ) );\n }" ]
[ "0.65435153", "0.6455479", "0.6292575", "0.62881976", "0.6161635", "0.61513877", "0.6105583", "0.6012341", "0.5978272", "0.59748137", "0.59319216", "0.5927506", "0.58448136", "0.5804721", "0.579182", "0.5748508", "0.5707179", "0.56610614", "0.560726", "0.55873615", "0.5587092", "0.5557006", "0.5548388", "0.5537857", "0.55229574", "0.5522326", "0.5513483", "0.54676056", "0.5460166", "0.5452008" ]
0.7202685
0
Devuelve el valor del campo caja_id
public function getCajaId() { return $this->caja_id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function CajaPorId()\n{\n\tself::SetNames();\n\t$sql = \" select * from cajas LEFT JOIN usuarios ON cajas.codigo = usuarios.codigo WHERE cajas.codcaja = ?\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codcaja\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function getIdCadeira()\n {\n return $this->idCadeira;\n }", "function getId_carrera(){\n\t\treturn $this->id_carrera;\n\t}", "public function getCidadeId() {\r\n return $this->cidadeId;\r\n }", "public function CajerosPorId()\n\t{\n\t\tself::SetNames();\n\t\t$sql = \" select * from cajas INNER JOIN usuarios ON cajas.codigo = usuarios.codigo WHERE cajas.codcaja = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET[\"codcaja\"]) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n\t\t\techo \"\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t}", "protected function cargaIdUbicacion() {\n $dao = new PGDAO();\n $strSql = $this->COLECCIONMAPEOUBICA . $this->propiedad->getId_ubica();\n $arrayDatos = $this->leeDBArray($dao->execSql($strSql));\n $id = $arrayDatos[0]['zpubica'];\n return $id;\n }", "public function getChaine_id()\n {\n return $this->chaine_id;\n }", "public function getId()\n {\n return $this->c_id;\n }", "public function ArqueoCajaPorId()\n{\n\tself::SetNames();\n\t$sql = \" select * FROM arqueocaja INNER JOIN cajas ON arqueocaja.codcaja = cajas.codcaja LEFT JOIN usuarios ON cajas.codigo = usuarios.codigo where arqueocaja.codarqueo = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codarqueo\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function getCodcaj(){\n\t\treturn $this->codcaj;\n\t}", "public function getCidade(){\n return $this->cidade;\n }", "public function getAvaliacaoId()\n {\n return $this->avaliacao_id;\n }", "public function get_cidade() : ?int\n {\n return $this->cidade;\n }", "public function getContrato_id() {\n return $this->contrato_id;\n }", "public function setCodiCasa($value) {\n\t\t//validando de que el valor sea un id\n\t\tif ($this->validateId($value)) {\n\t\t\t//seteando valor a la variable codigo\n\t\t\t$this->codi_casa = $value;\n\t\t\t//retornar true\n\t\t\treturn true;\n\t\t} else {\n\t\t\t//retornar respuesta falso\n\t\t\treturn false;\n\t\t}\n\t}", "public function getIdcliente() {\n\t\t\t\treturn $this->id_cliente ?? \"Id do Cliente não solicitado !!\";\n\t\t\t}", "public function conseguirId (){\n $query = $this->db->query (\"SELECT * FROM acceso WHERE id_acceso = '{$this->id_acceso}'\");\n if ($query->num_rows === 1)\n {\n $this->datos= $query->fetch_assoc();\n \n }\n return $this->datos;\n }", "public function getIdComentario()\n {\n return $this->id_comentario;\n }", "public function buscarID()\n {\n $sentencia = \"SELECT id, cl FROM tsreportebocadetubo ORDER BY id DESC LIMIT 1\";\n try {\n $stm = $this->db->prepare($sentencia);\n $stm->execute();\n $registros = $stm->fetchAll(PDO::FETCH_OBJ);\n foreach ($registros as $r) {\n $id = $r->id;\n }\n return $id;\n } catch (Exception $e) {\n echo $e->getMessage();\n }\n }", "function obtenerClienteID($cedula){\n\n $query = $this->db->get('cliente');\n if($query-> num_rows() > 0){\n\t \t\n $row = $query->row($cedula);\n\n\t\tif (isset($row))\n\t\t{\n \treturn $row->id;\n\t\t}\n \n\t }else return false ;\n\t \n\t}", "public static function cogeCajaChica($id){\n if(is_null(self::model()->find(\"hidcaja=:vhidcaja\",array(\":vhidcaja\"=>$id)))){\n $dcaja= Dcajachica::model()->findByPk($id);\n if(!is_null($dcaja)){\n $regcompra=New Registrocompras('ins_compralocal'); \n $regcompra->setAttributes(\n array(\n 'socio'=>$dcaja->cabecera->fondo->socio,\n 'femision'=>$dcaja->fecha,\n 'numerocomprobante'=>$dcaja->referencia,\n 'razpronombre'=>$dcaja->razon,\n 'hidperiodo'=>yii::app()->periodo->getperiodo(),\n 'tipodocid'=>$dcaja->tipodocid,\n 'numerodocid'=>$dcaja->numdocid,\n 'glosa'=>$dcaja->glosa,\n 'codmon'=>$dcaja->monedahaber,\n 'importe'=>$dcaja->haber,\n 'serie'=>$dcaja->serie,\n 'esservicio'=>$dcaja->esservicio,\n 'tipo'=>$dcaja->codocu,\n 'tipgrabado'=>'1',\n 'hidcaja'=>$dcaja->id,\n )\n );\n $grabo=$regcompra->save();\n //if(!$grabo)\n //print_r(yii::app()->mensajes->getErroresItem($regcompra->geterrors()));\n //die();\n return ($grabo)?$regcompra:null;\n }else{\n return null;\n }\n } \n }", "public function getId_ciudad()\n {\n return $this->id_ciudad;\n }", "public function getId_empresa()\n {\n return $this->id_empresa;\n }", "public function getidcliente(){\n\t\treturn $this->_idcliente;\n\t}", "public function getEncuestaAlojamientoid()\r\n {\r\n return $this->encuesta_alojamientoId;\r\n }", "public function getIdCommentaire()\n {\n return $this->Id_commentaire;\n }", "public function getIdEdificio()\n {\n return $this->c_id_edificio;\n }", "public function obtenerEmpresaPorId($empresa_id=0){ \t\n return self::find() \n ->select('candidato_id,ruc,razon_social,correo_electronico,estado,contrasena')\n ->where('empresa_id='.$empresa_id)\n ->one(); \n }", "public function getId() {\n return $this->datosprop->getId_prop_carac();\n }", "public static function ConsultarTemporalCid() {\r\n $db = new Conexion();\r\n\t\t$sql = $db->query(\"select MAX(idcompra) as id from compra;\");\r\n\t\t$dato3 = $db->recorrer($sql);\r\n return $dato3[0];\r\n }" ]
[ "0.6852763", "0.6831697", "0.67713815", "0.6664029", "0.6540013", "0.63944626", "0.6358018", "0.62957287", "0.6293707", "0.62210506", "0.6147427", "0.6134091", "0.6108021", "0.60921806", "0.6081169", "0.607114", "0.6070595", "0.60423636", "0.604104", "0.60222363", "0.59539795", "0.5953906", "0.5947558", "0.5920953", "0.5915131", "0.59136784", "0.59052294", "0.58497703", "0.58453006", "0.5831143" ]
0.78930396
0
Devuelve el valor del campo por_atender
public function getPorAtender() { return $this->por_atender; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAtendido() {\n return $this->atendido;\n }", "public function getAtualizadoEm()\n {\n return $this->atualizadoEm;\n }", "public function getValor($atributo){//retornar algún valor\n \treturn $this->$atributo;\n }", "public function getPeriodeAu() {\n return $this->periodeAu;\n }", "public function getValorInventario()\n {\n return $this->valorInventario;\n }", "public function getAnulacao(){\n return $this->oAnulacao;\n }", "public function getPorcImpuesto()\r\n {\r\n return strval($this->porc_impuesto);\r\n }", "function get_aut_idautor(){return $this->aut_idautor;}", "public function getAtivo()\n {\n return $this->ativo;\n }", "public function getAtivo()\n {\n return $this->ativo;\n }", "public function getAtivo()\n {\n return $this->ativo;\n }", "public function getAtivo()\n\t{\n\t\treturn $this->ativo;\n\t}", "public function getAPELLIDOPATERNO()\r\n {\r\n return $this->APELLIDO_PATERNO;\r\n }", "public function getFullCalendarioAttribute()\n {\n return \"{$this->cal_idanio} {$this->cal_idmes} {$this->cal_idfase}\"; \n //return $this->cal_idanio . \" \" . $this->cal_idmes . \"\" . $this->cal_idfase;\n }", "public function getIngresoAttribute()\n {\n return strftime(\"%d/%b/%Y\", strtotime(date_format(date_create($this->fecha_ingreso), 'd-m-Y')));\n }", "public function getDureeAnnuelle() {\n return $this->dureeAnnuelle;\n }", "public function getAno()\n {\n return $this->ano;\n }", "public function getIngresaAttribute()\n {\n return strftime(\"%d de %B de %Y\", strtotime(date_format(date_create($this->fecha_ingreso), 'd-m-Y')));\n }", "public function getEmenta()\n {\n return $this->ementa;\n }", "public function getIngAttribute()\n {\n return date(\"d/m/Y\", strtotime($this->fecha_ingreso));\n }", "public function getempleado()\r\n {\r\n return $this->empleado;\r\n }", "public function getempleado()\r\n {\r\n return $this->empleado;\r\n }", "public function getValorAnulado() {\n return $this->nValorAnulado;\n }", "public function getEmpleado_idemp(){\n return $this->empleado_idemp;\n }", "public function getModificado()\n {\n return $this->modificado;\n }", "public function getModificado()\n {\n return $this->modificado;\n }", "public function getNumeroAttestation() {\n return $this->numeroAttestation;\n }", "public function getNumeroAttestation() {\n return $this->numeroAttestation;\n }", "public function getAno() {\n return $this->iAno;\n }", "public function getAno() {\n return $this->iAno;\n }" ]
[ "0.59466577", "0.5935895", "0.5692869", "0.5691022", "0.56848425", "0.56571907", "0.55415165", "0.5536568", "0.5531506", "0.5531506", "0.5531506", "0.54861516", "0.5406041", "0.5402657", "0.5389934", "0.5374603", "0.5351827", "0.5346965", "0.5331697", "0.5328608", "0.5327942", "0.5327942", "0.5315447", "0.52954817", "0.5286152", "0.5286152", "0.527793", "0.527793", "0.5270002", "0.5270002" ]
0.72013026
0
Devuelve el valor del campo fecha_inicio_atencion
public function getFechaInicioAtencion() { return $this->fecha_inicio_atencion; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHoraInicioAtencion() {\n return $this->hora_inicio_atencion;\n }", "public function getFecha_inicio_joven() {\n return $this->fecha_inicio_joven;\n }", "public function getFechaInicio()\n {\n $fechaInicio = null;\n if (count($this->objetivos)==0) return $fechaInicio;\n foreach ($this->objetivos as $objetivo)\n {\n if (count($objetivo->getActividades())!=0)\n {\n foreach($objetivo->getActividades() as $actividad)\n {\n $fechaActividad = $actividad->getFechaIni(); \n $fechaInicio = (($fechaActividad < $fechaInicio)||\n $fechaInicio==null)? $fechaActividad:$fechaInicio;\n }\n }\n }\n return $fechaInicio;\n }", "public function getAnoInicioIntegracao() {\n return $this->iAnoInicioIntegracao;\n }", "public function getTimeInicioHora()\n {\n return $this->timeInicioHora;\n }", "public function getInicio()\n {\n return $this->inicio;\n }", "public function getInicio()\n\t{\n\t\treturn $this->inicio;\n\t}", "public function getFkFiscalizacaoInicioFiscalizacao()\n {\n return $this->fkFiscalizacaoInicioFiscalizacao;\n }", "public function getIngAttribute()\n {\n return date(\"d/m/Y\", strtotime($this->fecha_ingreso));\n }", "public function setFechaInicialAttribute($value)\n {\n return $this->attributes['fecha_inicial'] = date($this->setDateFormatTarifasVehiculo,strtotime(Carbon::createFromFormat('d/m/Y', $value)->toDateTimeString()));\n }", "public function setFecha_inicio_joven($fecha_inicio_joven) {\n $this->fecha_inicio_joven = $fecha_inicio_joven;\n }", "public function getEncuestaFechacreacion()\r\n {\r\n return $this->encuesta_fechaCreacion;\r\n }", "function primer_dia_periodo_anio($anio) {\n\n $sql=\"select fecha_inicio from mocovi_periodo_presupuestario where anio=\".$anio;\n $resul=toba::db('designa')->consultar($sql);\n return $resul[0]['fecha_inicio'];\n }", "public function getFechaInicialAttribute($value) \n {\n return $value ? Carbon::parse($value)->format($this->getDateFormatTarifasVehiculo) : null;\n }", "function primer_dia_periodo() {\n\n $sql=\"select fecha_inicio from mocovi_periodo_presupuestario where actual=true\";\n $resul=toba::db('designa')->consultar($sql);\n return $resul[0]['fecha_inicio'];\n \n }", "public function fechaInicioPublicacion($fechainicio){\r\n\t\t$año = substr($fechainicio, 0, 4);\r\n\t\t$mes = substr($fechainicio, 5, 2);\r\n\t\t$dia = substr($fechainicio, 8, 2);\r\n\t\t$fecha = date_create();\r\n\t\tdate_date_set($fecha, $año, $mes, $dia);\r\n\t\treturn $fecha;\r\n\t}", "public function getFechaConversionEnergetica(){\n return $this->fechaConversionEnergetica;\n }", "public function getValorInventario()\n {\n return $this->valorInventario;\n }", "public function getfecha()\r\n {\r\n return $this->fecha;\r\n }", "public function getFechaEmision() {\n return $this->fecha_emision;\n }", "public function getIngresoAttribute()\n {\n return strftime(\"%d/%b/%Y\", strtotime(date_format(date_create($this->fecha_ingreso), 'd-m-Y')));\n }", "public function getDataInicioBeneficio() {\n return $this->oDataInicioBeneficio;\n }", "public function setFechaIngresoAttribute($value)\n {\n if(!empty($value))\n {\n $this->attributes['fecha_ingreso'] = date_format(date_create(substr($value, 3, 2) . '/' . substr($value, 0, 2) . '/' . substr($value, 6, 4)), 'Y-m-d');\n }\n }", "function comprobar_fecha_inicio($fecha_entrada,$fecha_salida){\r\n // echo $fecha_salida;\r\n //echo $fecha_actual = strtotime(date(\"d-m-Y H:i:00\",time()));\r\n if( (empty($fecha_entrada))){\r\n return 'Las fechas no pueden estar vacias';\r\n }\r\n}", "function getFecha() {\r\n return $this->fecha;\r\n }", "public function getfechaentrega()\r\n {\r\n return $this->fechaentrega;\r\n }", "public function getAtualizadoEm()\n {\n return $this->atualizadoEm;\n }", "function getFecha(){\n\t\treturn $this->fecha;\n\t}", "public function getIngresaAttribute()\n {\n return strftime(\"%d de %B de %Y\", strtotime(date_format(date_create($this->fecha_ingreso), 'd-m-Y')));\n }", "public function getDateFinContratInitiale() {\n return $this->dateFinContratInitiale;\n }" ]
[ "0.73275936", "0.73154277", "0.73121965", "0.6783579", "0.6724466", "0.6679665", "0.66117424", "0.65899104", "0.65748334", "0.6535769", "0.6510804", "0.6471809", "0.63673246", "0.63495433", "0.6236124", "0.623261", "0.62192476", "0.6170988", "0.61702806", "0.6131831", "0.61207896", "0.61111706", "0.61001414", "0.60776824", "0.607704", "0.6076658", "0.60761744", "0.6075336", "0.60614985", "0.6051675" ]
0.8193018
0
Devuelve el valor del campo hora_inicio_atencion
public function getHoraInicioAtencion() { return $this->hora_inicio_atencion; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTimeInicioHora()\n {\n return $this->timeInicioHora;\n }", "public function getFechaInicioAtencion() {\n return $this->fecha_inicio_atencion;\n }", "function convertir_hora_militar($seg_ini) {\n\n\t\t\t$horas = floor($seg_ini/3600);\n\t\t\t$minutos = floor(($seg_ini-($horas*3600))/60);\n\t\t\t\t\t\t\t\n\t\t\treturn $horas.\":\".$minutos;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}", "public function getHora () {\n return $this->sHora;\n }", "function Hora_prog($valor){\t\n\n return date(\"H:i\", strtotime($valor));\n\n}", "public function getHoraFinAtencion() {\n return $this->hora_fin_atencion;\n }", "public function getAnoInicioIntegracao() {\n return $this->iAnoInicioIntegracao;\n }", "public function getHora() {\n\t\treturn $this->Hora;\n\t}", "function getHour()\r\n {\r\n return $this->hora;\r\n }", "public function getTimeFinHora()\n {\n return $this->timeFinHora;\n }", "public function getFecha_inicio_joven() {\n return $this->fecha_inicio_joven;\n }", "public function getFechaInicio()\n {\n $fechaInicio = null;\n if (count($this->objetivos)==0) return $fechaInicio;\n foreach ($this->objetivos as $objetivo)\n {\n if (count($objetivo->getActividades())!=0)\n {\n foreach($objetivo->getActividades() as $actividad)\n {\n $fechaActividad = $actividad->getFechaIni(); \n $fechaInicio = (($fechaActividad < $fechaInicio)||\n $fechaInicio==null)? $fechaActividad:$fechaInicio;\n }\n }\n }\n return $fechaInicio;\n }", "public static function timeToInt($hora) {\n $hr = explode(':', $hora);\n return ($hr[0] * 3600) + ($hr[1] * 60) + $hr[2];\n }", "public function getHoraEmision() {\n return $this->hora_emision;\n }", "public function getServerHour(){\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT DATE_FORMAT(NOW(), '%k:%i:%s') AS hora\");\n\t\t$stmt->execute();\n\t\treturn $stmt->fetch()[0]; //respuesta\n\t}", "function DataHoraAtual(){\n\t$datetime = new DateTime();\n\treturn $datetime->format(\"Y-m-d H:i:s\");\n}", "public function getInicio()\n {\n return $this->inicio;\n }", "public function getInicio()\n\t{\n\t\treturn $this->inicio;\n\t}", "public function tiempo_pasado($fecha, $hora_inicio) {\n $mensajeAlerta = '';\n date_default_timezone_set('America/La_Paz');\n $fecha_actual = date('d/m/Y');\n $hora_actual = date('H:i:s');\n $fecha_actual = DateTime::createFromFormat(\"d/m/Y\", $fecha_actual);\n $fecha = DateTime::createFromFormat(\"d/m/Y\", $fecha);\n if ($fecha < $fecha_actual) {\n $mensajeAlerta = '- La fecha ya paso.';\n } else {\n if ($fecha == $fecha_actual && $hora_inicio < $hora_actual) {\n $mensajeAlerta = '- La fecha y hora ya pasaron.';\n }\n }\n return $mensajeAlerta;\n }", "function horas_em_mintutos($hora)\n{\n\n if ($hora == '') {\n $hora = '00:00';\n }\n\n $h1 = explode(\":\", $hora);\n\n\n $minuto = $h1[1];\n $horas = $h1[0];\n\n\n if ($horas > 0) {\n\n if (substr($horas, 0, 1) == 0) {\n $horas = substr($horas, 1, 1);\n }\n\n $horas = $horas * 60;\n\n $minuto = $minuto + $horas;\n }\n\n\n\n\n return $minuto;\n}", "public function getStartHour(){\n\t\treturn $this->start_hour;\n\t}", "public static function hora ($archivo)\n {\n /**\n * Valido la estructura de horas\n */\n //hora por la cual inicia el archivo\n $actual=$archivo->excel->sheets[0]['cells'][5][1];\n// $actual=0;\n $contador=0;\n //Cuantos segundos\n $regAprox=1500*$archivo->excel->sheets[0]['cells']['numRows'][1];\n\n $segundos=$regAprox/2.8;\n $segundos=substr($segundos,0,4);\n //Aumento el tiempo de ejecucion\n ini_set('memory_limit', -1);\n ini_set('max_execution_time', $segundos);\n for ($i=5; $i<$archivo->excel->sheets[0]['numRows']; $i++)\n { \n if($archivo->excel->sheets[0]['cells'][$i][1]!=\"Total\" && $archivo->excel->sheets[0]['cells'][$i][1]!=\"Date\" && $archivo->excel->sheets[0]['cells'][$i][1]!=\"Hour\")\n {\n //Verifico que sean secuenciales las horas\n if($actual <= $archivo->excel->sheets[0]['cells'][$i][1])\n {\n if($actual==$archivo->excel->sheets[0]['cells'][$i][1])\n {\n $contador=$contador+1;\n }\n elseif($actual==$archivo->excel->sheets[0]['cells'][$i][1]-1)\n {\n if($contador<=1)\n {\n self::$error=ValidationsArchCapt::ERROR_ESTRUC;\n return false;\n }\n else\n {\n $contador=0;\n $actual=$archivo->excel->sheets[0]['cells'][$i][1];\n }\n }\n else\n {\n self::$error=ValidationsArchCapt::ERROR_ESTRUC;\n return false; \n }\n }\n }\n }\n \n //Cuantos segundos\n $regAprox=1500*$archivo->excel->sheets[0]['cells']['numRows'][1];\n $segundos=$regAprox/2.8;\n $segundos=substr($segundos,0,4);\n //Aumento el tiempo de ejecucion\n ini_set('max_execution_time', $segundos);\n// ini_set(\"memory_limit\",\"128M\");\n\n \n /**\n * Verifico que la fecha del archivo sea correcta\n */\n $date_balance_time=Utility::formatDate($data->sheets[0]['cells'][1][5]);\n \n /**\n * Comienzo a leer el archivo\n */\n $valuesNew='';\n $var=array();\n for($i=5;$i<=$archivo->excel->sheets[0]['numRows'];$i++)\n {\n for($j=1;$j<=$archivo->excel->sheets[0]['numCols'];$j++)\n {\n switch($j)\n {\n case 1:\n //Obtengo la hora del registro\n if($archivo->excel->sheets[0]['cells'][$i][$j]=='Total')\n {\n //si es total es que se termino el archivo\n break 3;\n }\n else\n {\n $time=$archivo->excel->sheets[0]['cells'][$i][$j];\n }\n break;\n case 2:\n //Obtengo el nombre del destino\n if($archivo->excel->sheets[0]['cells'][$i][$j]=='Total')\n {\n //si es total no lo voy a guardar en base de datos\n break 2;\n }\n else\n {\n // $name_destination=utf8_encode($archivo->excel->sheets[0]['cells'][$i][$j]);\n $name_destination=Destination::getId(utf8_encode($archivo->excel->sheets[0]['cells'][$i][$j]));\n }\n break;\n case 3:\n //Obtengo el nombre del customer\n if($archivo->excel->sheets[0]['cells'][$i][$j]=='Total')\n {\n //si es total no lo voy a guardar en base de datos\n break 2;\n }\n else\n {\n //Aqui encodeo el nombre del carrier a utf-8\n // $name_customer=utf8_encode($archivo->excel->sheets[0]['cells'][$i][$j]);\n $name_customer=Carrier::getId(utf8_encode($archivo->excel->sheets[0]['cells'][$i][$j]));\n\n }\n break;\n case 4:\n if($archivo->excel->sheets[0]['cells'][$i][$j]=='Total')\n {\n //si es total no lo voy guardar en base de datos\n break 2;\n }\n else\n {\n // $name_supplier=utf8_encode($archivo->excel->sheets[0]['cells'][$i][$j]);\n $name_supplier=Carrier::getId(utf8_encode($archivo->excel->sheets[0]['cells'][$i][$j]));\n }\n break;\n case 5;\n //minutos\n $minutes=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n case 6;\n //ACD \n $acd=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 7;\n //ASR\n $asr=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 8;\n //Margin %\n $margin_percentage=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 9;\n //Margin per Min\n $margin_per_minute=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 10;\n //Cost per Min\n $cost_per_minute=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 11;\n //Revenue per Min\n $revenue_per_minute=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 12;\n //PDD\n $pdd=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 13;\n //Imcomplete Calls\n $incomplete_calls=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 14;\n //Imcomplete Calls Ner\n $incomplete_calls_ner=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 15;\n //Complete Calls Ner\n $complete_calls_ner=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 16;\n //Complete Calls\n $complete_calls=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 17;\n //Calls Attempts\n $calls_attempts=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 18;\n //Duration Real\n $duration_real=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 19;\n //Duration Cost\n $duration_cost=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 20;\n //NER02 Efficient\n $ner02_efficient=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 21;\n //NER02 Seizure\n $ner02_seizure=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 22;\n //PDDCalls\n $pdd_calls=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 23;\n //Revenue\n $revenue=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 24;\n //Cost\n $cost=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 25;\n //Margin\n $margin=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 26;\n $valuesNew.=\"(\";\n $valuesNew.=\"'\".$date_balance_time.\"',\";\n $valuesNew.=$time.\",\";\n $valuesNew.=$minutes.\",\";\n $valuesNew.=$acd.\",\";\n $valuesNew.=$asr.\",\";\n $valuesNew.=$margin_percentage.\",\";\n $valuesNew.=$margin_per_minute.\",\";\n $valuesNew.=$cost_per_minute.\",\";\n $valuesNew.=$revenue_per_minute.\",\";\n $valuesNew.=$pdd.\",\";\n $valuesNew.=$incomplete_calls.\",\";\n $valuesNew.=$incomplete_calls_ner.\",\";\n $valuesNew.=$complete_calls_ner.\",\";\n $valuesNew.=$complete_calls.\",\";\n $valuesNew.=$calls_attempts.\",\";\n $valuesNew.=$duration_real.\",\";\n $valuesNew.=$duration_cost.\",\";\n $valuesNew.=$ner02_efficient.\",\";\n $valuesNew.=$ner02_seizure.\",\";\n $valuesNew.=$pdd_calls.\",\";\n $valuesNew.=$revenue.\",\";\n $valuesNew.=$cost.\",\";\n $valuesNew.=$margin.\",\";\n $valuesNew.=\"'\".date(\"Y-m-d\").\"',\";\n $valuesNew.=\"'\".date(\"H:i:s\").\"',\";\n $valuesNew.=\"'\".$name_supplier.\"',\";\n $valuesNew.=\"'\".$name_customer.\"',\";\n $valuesNew.=\"'\".$name_destination.\"')\";\n break; \n }\n }\n if($i<=$archivo->excel->sheets[0]['numRows']-1)\n {\n $valuesNew.=\",\";\n }\n }\n $barra = substr($valuesNew, -1, 1);\n if($barra==\",\") \n {\n $valuesNew=substr($valuesNew, 0, - 1); \n }\n if($valuesNew!=\"\")\n {\n $var['regHora']=$valuesNew;\n $var['hora']=$time;\n }\n else\n {\n $var=\"\";\n }\n return $var;\n }", "function formatear_hora($parametro){\n\n\t\t/* Declaro variables personalizadas para que queden claros los datos */\n\t\t$hora = substr($parametro, 11, 2);\n\t\t$minuto = substr($parametro, 14, 2);\n\t\t$dia = substr($parametro, 8, 2);\n\t\t$mes = substr($parametro, 5, 2);\n\t\t\n\t\t/* Generamos el formato */\n\t\t$temp = $hora.\":\".$minuto;\n\t\t\n\t\treturn $temp;\n\t}", "public function setTimeInicioHora($timeInicioHora)\n {\n $this->timeInicioHora = $timeInicioHora;\n\n return $this;\n }", "public function vr_hora()\n {\n\n $valor=$this->vr_hora;\n\n if ($this->id_tipotitulo == 3)\n {\n $valor='10208';\n } elseif ($this->id_tipotitulo == 4) {\n $valor='15122';\n } elseif ($this->id_tipotitulo == 5) {\n $valor='19096';\n } elseif ($this->id_tipotitulo == 7) {\n $valor='23252';\n } elseif ($this->id_tipotitulo == 10) {\n $valor='27014';\n } elseif ($this->id_tipotitulo == 9) {\n $valor='10208';\n } elseif ($this->id_tipotitulo == 11) {\n $valor='10208'; }\n elseif ($this->id_tipotitulo == 12) {\n $valor='0';\n }\n\n\n return $valor;\n\n }", "function verificar_inclusion_de_horario ($hora_inicio, $hora_fin){\n \n $longitud=count($this->s__horarios_disponibles);\n $i=0;\n $fin=FALSE;\n while (($i < $longitud) && !$fin){\n $asignacion=$this->s__horarios_disponibles[$i];\n \n $hora_inicio=\"$hora_inicio:00\";\n $hora_fin=\"$hora_fin:00\";\n $hora_inicio_asig=$asignacion['hora_inicio'];\n $hora_fin_asig=$asignacion['hora_fin'];\n if((($hora_inicio >= $hora_inicio_asig)) && (($hora_fin <= $hora_fin_asig))){\n $fin=TRUE;\n }\n \n $i += 1;\n }\n \n return $fin;\n }", "public function daEntrada(){\n\t\t$this->hora_entrada = date('d/m/y - H:i:s');\n\t\t$this->numero_visitas = $this->numero_visitas + 1;\n\t}", "function obtener_hora($fecha) {\r\nreturn(substr($fecha,11,2));\r\n}", "public function setHora($Hora) {\n\t\t$this->Hora=$Hora;\n\t}", "function setHour($h)\r\n {\r\n if($h > 23 || $h < 0) {\r\n $this->hora = 0;\r\n } else {\r\n $this->hora = $h;\r\n }\r\n }" ]
[ "0.7474662", "0.6772698", "0.63502955", "0.61945087", "0.6184931", "0.6107615", "0.6102455", "0.60586506", "0.60097235", "0.5968521", "0.5827638", "0.5734476", "0.5650245", "0.55953014", "0.55205995", "0.551672", "0.54624814", "0.54545605", "0.54406494", "0.54281694", "0.5422295", "0.5406265", "0.5384475", "0.5373983", "0.5366707", "0.53630364", "0.53528255", "0.5349028", "0.52886283", "0.5280456" ]
0.80287415
0
Devuelve el valor del campo fecha_fin_atencion
public function getFechaFinAtencion() { return $this->fecha_fin_atencion; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDateFinContrat() {\n return $this->dateFinContrat;\n }", "public function getDateFin();", "public function getDtValiditeFin() {\n return $this->dtValiditeFin;\n }", "public function getDateFin(): ?DateTime {\n return $this->dateFin;\n }", "public function getDateFin(): ?DateTime {\n return $this->dateFin;\n }", "public function getHoraFinAtencion() {\n return $this->hora_fin_atencion;\n }", "public function getDateFinContratInitiale() {\n return $this->dateFinContratInitiale;\n }", "public function getTimeFinHora()\n {\n return $this->timeFinHora;\n }", "function ultimo_dia_periodo() { \n\n $sql=\"select fecha_fin from mocovi_periodo_presupuestario where actual=true\";\n $resul=toba::db('designa')->consultar($sql); \n return $resul[0]['fecha_fin'];\n }", "public function getFechaFinalAttribute($value) \n {\n return $value ? Carbon::parse($value)->format($this->getDateFormatTarifasVehiculo) : null;\n }", "public function getDateF(){\n return $this->dateF;\n }", "public function setFechaFinalAttribute($value)\n {\n return $this->attributes['fecha_final'] = date($this->setDateFormatTarifasVehiculo,strtotime(Carbon::createFromFormat('d/m/Y', $value)->toDateTimeString()));\n }", "public function getFinishesOn(): ?DateTime {\n return $this->finishesOn;\n }", "public function getHeureFin(): ?DateTime {\n return $this->heureFin;\n }", "public function getHeureFin(): ?DateTime {\n return $this->heureFin;\n }", "public function getFin():string\n {\n return $this->fin;\n }", "public function getEncuestaFechacreacion()\r\n {\r\n return $this->encuesta_fechaCreacion;\r\n }", "public function setFin(string $fin)\n {\n //preparation with regex for format date\n $regex = preg_grep(\"/^(\\d{4})-(\\d{2})-([\\d]{2})$/\",[$fin]);\n //checking is not empty\n if(empty($regex)){\n trigger_error(\"Invalid date format\",E_USER_NOTICE);\n }\n else{\n $this->fin = $fin;\n }\n }", "public function getFechaEmision() {\n return $this->fecha_emision;\n }", "public function getFechaInicio()\n {\n $fechaInicio = null;\n if (count($this->objetivos)==0) return $fechaInicio;\n foreach ($this->objetivos as $objetivo)\n {\n if (count($objetivo->getActividades())!=0)\n {\n foreach($objetivo->getActividades() as $actividad)\n {\n $fechaActividad = $actividad->getFechaIni(); \n $fechaInicio = (($fechaActividad < $fechaInicio)||\n $fechaInicio==null)? $fechaActividad:$fechaInicio;\n }\n }\n }\n return $fechaInicio;\n }", "public function fechaFinPublicacion($fechainicio){\r\n\t\t$año = substr($fechainicio, 0, 4);\r\n\t\t$mes = substr($fechainicio, 5, 2);\r\n\t\t$dia = substr($fechainicio, 8, 2);\r\n\t\t$fecha = date_create();\r\n\t\tdate_date_set($fecha, $año, $mes, $dia);\r\n\t\t$fecha->add(new DateInterval(\"P6M\"));\r\n\t\treturn $fecha;\r\n\t}", "public function getfecha()\r\n {\r\n return $this->fecha;\r\n }", "public function GetFechaActualCFDI()\n {\n $dt = new DateTime();\n $dt->setTimeZone(new DateTimeZone('America/Mexico_City'));\n return $dt->format('Y-m-d\\TH:i:s');\n }", "public function getInInfActualizada()\n\t{\n\t\treturn $this->in_inf_actualizada;\n\t}", "function getFecha(){\n\t\treturn $this->fecha;\n\t}", "function getFecha() {\r\n return $this->fecha;\r\n }", "public function getEnd()\n {\n return Carbon::createFromFormat('d/m/Y', $this->data_saida);\n }", "function comprobar_fecha_inicio($fecha_entrada,$fecha_salida){\r\n // echo $fecha_salida;\r\n //echo $fecha_actual = strtotime(date(\"d-m-Y H:i:00\",time()));\r\n if( (empty($fecha_entrada))){\r\n return 'Las fechas no pueden estar vacias';\r\n }\r\n}", "public function getFecha()\n {\n return $this->c_fecha;\n }", "public function getFecha()\n {\n return $this->fecha;\n }" ]
[ "0.7289195", "0.72578466", "0.71816194", "0.705166", "0.705166", "0.69279367", "0.68171304", "0.6730832", "0.6528511", "0.64464116", "0.6348788", "0.6329321", "0.62511325", "0.6233209", "0.6233209", "0.6204804", "0.61754537", "0.6101448", "0.60763043", "0.6026181", "0.6009044", "0.60023993", "0.60001487", "0.5981825", "0.59657913", "0.5963852", "0.5960203", "0.5938971", "0.5936535", "0.59226537" ]
0.78170794
0
Devuelve el valor del campo hora_fin_atencion
public function getHoraFinAtencion() { return $this->hora_fin_atencion; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTimeFinHora()\n {\n return $this->timeFinHora;\n }", "public function getHeureFin(): ?DateTime {\n return $this->heureFin;\n }", "public function getHeureFin(): ?DateTime {\n return $this->heureFin;\n }", "function Hora_prog($valor){\t\n\n return date(\"H:i\", strtotime($valor));\n\n}", "public function getHora () {\n return $this->sHora;\n }", "public function getFechaFinAtencion() {\n return $this->fecha_fin_atencion;\n }", "public function getTimeInicioHora()\n {\n return $this->timeInicioHora;\n }", "public function getHora() {\n\t\treturn $this->Hora;\n\t}", "public function vr_hora()\n {\n\n $valor=$this->vr_hora;\n\n if ($this->id_tipotitulo == 3)\n {\n $valor='10208';\n } elseif ($this->id_tipotitulo == 4) {\n $valor='15122';\n } elseif ($this->id_tipotitulo == 5) {\n $valor='19096';\n } elseif ($this->id_tipotitulo == 7) {\n $valor='23252';\n } elseif ($this->id_tipotitulo == 10) {\n $valor='27014';\n } elseif ($this->id_tipotitulo == 9) {\n $valor='10208';\n } elseif ($this->id_tipotitulo == 11) {\n $valor='10208'; }\n elseif ($this->id_tipotitulo == 12) {\n $valor='0';\n }\n\n\n return $valor;\n\n }", "public function getHoraInicioAtencion() {\n return $this->hora_inicio_atencion;\n }", "public static function hora ($archivo)\n {\n /**\n * Valido la estructura de horas\n */\n //hora por la cual inicia el archivo\n $actual=$archivo->excel->sheets[0]['cells'][5][1];\n// $actual=0;\n $contador=0;\n //Cuantos segundos\n $regAprox=1500*$archivo->excel->sheets[0]['cells']['numRows'][1];\n\n $segundos=$regAprox/2.8;\n $segundos=substr($segundos,0,4);\n //Aumento el tiempo de ejecucion\n ini_set('memory_limit', -1);\n ini_set('max_execution_time', $segundos);\n for ($i=5; $i<$archivo->excel->sheets[0]['numRows']; $i++)\n { \n if($archivo->excel->sheets[0]['cells'][$i][1]!=\"Total\" && $archivo->excel->sheets[0]['cells'][$i][1]!=\"Date\" && $archivo->excel->sheets[0]['cells'][$i][1]!=\"Hour\")\n {\n //Verifico que sean secuenciales las horas\n if($actual <= $archivo->excel->sheets[0]['cells'][$i][1])\n {\n if($actual==$archivo->excel->sheets[0]['cells'][$i][1])\n {\n $contador=$contador+1;\n }\n elseif($actual==$archivo->excel->sheets[0]['cells'][$i][1]-1)\n {\n if($contador<=1)\n {\n self::$error=ValidationsArchCapt::ERROR_ESTRUC;\n return false;\n }\n else\n {\n $contador=0;\n $actual=$archivo->excel->sheets[0]['cells'][$i][1];\n }\n }\n else\n {\n self::$error=ValidationsArchCapt::ERROR_ESTRUC;\n return false; \n }\n }\n }\n }\n \n //Cuantos segundos\n $regAprox=1500*$archivo->excel->sheets[0]['cells']['numRows'][1];\n $segundos=$regAprox/2.8;\n $segundos=substr($segundos,0,4);\n //Aumento el tiempo de ejecucion\n ini_set('max_execution_time', $segundos);\n// ini_set(\"memory_limit\",\"128M\");\n\n \n /**\n * Verifico que la fecha del archivo sea correcta\n */\n $date_balance_time=Utility::formatDate($data->sheets[0]['cells'][1][5]);\n \n /**\n * Comienzo a leer el archivo\n */\n $valuesNew='';\n $var=array();\n for($i=5;$i<=$archivo->excel->sheets[0]['numRows'];$i++)\n {\n for($j=1;$j<=$archivo->excel->sheets[0]['numCols'];$j++)\n {\n switch($j)\n {\n case 1:\n //Obtengo la hora del registro\n if($archivo->excel->sheets[0]['cells'][$i][$j]=='Total')\n {\n //si es total es que se termino el archivo\n break 3;\n }\n else\n {\n $time=$archivo->excel->sheets[0]['cells'][$i][$j];\n }\n break;\n case 2:\n //Obtengo el nombre del destino\n if($archivo->excel->sheets[0]['cells'][$i][$j]=='Total')\n {\n //si es total no lo voy a guardar en base de datos\n break 2;\n }\n else\n {\n // $name_destination=utf8_encode($archivo->excel->sheets[0]['cells'][$i][$j]);\n $name_destination=Destination::getId(utf8_encode($archivo->excel->sheets[0]['cells'][$i][$j]));\n }\n break;\n case 3:\n //Obtengo el nombre del customer\n if($archivo->excel->sheets[0]['cells'][$i][$j]=='Total')\n {\n //si es total no lo voy a guardar en base de datos\n break 2;\n }\n else\n {\n //Aqui encodeo el nombre del carrier a utf-8\n // $name_customer=utf8_encode($archivo->excel->sheets[0]['cells'][$i][$j]);\n $name_customer=Carrier::getId(utf8_encode($archivo->excel->sheets[0]['cells'][$i][$j]));\n\n }\n break;\n case 4:\n if($archivo->excel->sheets[0]['cells'][$i][$j]=='Total')\n {\n //si es total no lo voy guardar en base de datos\n break 2;\n }\n else\n {\n // $name_supplier=utf8_encode($archivo->excel->sheets[0]['cells'][$i][$j]);\n $name_supplier=Carrier::getId(utf8_encode($archivo->excel->sheets[0]['cells'][$i][$j]));\n }\n break;\n case 5;\n //minutos\n $minutes=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n case 6;\n //ACD \n $acd=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 7;\n //ASR\n $asr=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 8;\n //Margin %\n $margin_percentage=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 9;\n //Margin per Min\n $margin_per_minute=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 10;\n //Cost per Min\n $cost_per_minute=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 11;\n //Revenue per Min\n $revenue_per_minute=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 12;\n //PDD\n $pdd=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 13;\n //Imcomplete Calls\n $incomplete_calls=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 14;\n //Imcomplete Calls Ner\n $incomplete_calls_ner=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 15;\n //Complete Calls Ner\n $complete_calls_ner=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 16;\n //Complete Calls\n $complete_calls=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 17;\n //Calls Attempts\n $calls_attempts=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 18;\n //Duration Real\n $duration_real=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 19;\n //Duration Cost\n $duration_cost=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 20;\n //NER02 Efficient\n $ner02_efficient=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 21;\n //NER02 Seizure\n $ner02_seizure=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 22;\n //PDDCalls\n $pdd_calls=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 23;\n //Revenue\n $revenue=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 24;\n //Cost\n $cost=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 25;\n //Margin\n $margin=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 26;\n $valuesNew.=\"(\";\n $valuesNew.=\"'\".$date_balance_time.\"',\";\n $valuesNew.=$time.\",\";\n $valuesNew.=$minutes.\",\";\n $valuesNew.=$acd.\",\";\n $valuesNew.=$asr.\",\";\n $valuesNew.=$margin_percentage.\",\";\n $valuesNew.=$margin_per_minute.\",\";\n $valuesNew.=$cost_per_minute.\",\";\n $valuesNew.=$revenue_per_minute.\",\";\n $valuesNew.=$pdd.\",\";\n $valuesNew.=$incomplete_calls.\",\";\n $valuesNew.=$incomplete_calls_ner.\",\";\n $valuesNew.=$complete_calls_ner.\",\";\n $valuesNew.=$complete_calls.\",\";\n $valuesNew.=$calls_attempts.\",\";\n $valuesNew.=$duration_real.\",\";\n $valuesNew.=$duration_cost.\",\";\n $valuesNew.=$ner02_efficient.\",\";\n $valuesNew.=$ner02_seizure.\",\";\n $valuesNew.=$pdd_calls.\",\";\n $valuesNew.=$revenue.\",\";\n $valuesNew.=$cost.\",\";\n $valuesNew.=$margin.\",\";\n $valuesNew.=\"'\".date(\"Y-m-d\").\"',\";\n $valuesNew.=\"'\".date(\"H:i:s\").\"',\";\n $valuesNew.=\"'\".$name_supplier.\"',\";\n $valuesNew.=\"'\".$name_customer.\"',\";\n $valuesNew.=\"'\".$name_destination.\"')\";\n break; \n }\n }\n if($i<=$archivo->excel->sheets[0]['numRows']-1)\n {\n $valuesNew.=\",\";\n }\n }\n $barra = substr($valuesNew, -1, 1);\n if($barra==\",\") \n {\n $valuesNew=substr($valuesNew, 0, - 1); \n }\n if($valuesNew!=\"\")\n {\n $var['regHora']=$valuesNew;\n $var['hora']=$time;\n }\n else\n {\n $var=\"\";\n }\n return $var;\n }", "public function getServerHour(){\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT DATE_FORMAT(NOW(), '%k:%i:%s') AS hora\");\n\t\t$stmt->execute();\n\t\treturn $stmt->fetch()[0]; //respuesta\n\t}", "function DataHoraAtual(){\n\t$datetime = new DateTime();\n\treturn $datetime->format(\"Y-m-d H:i:s\");\n}", "function getHour()\r\n {\r\n return $this->hora;\r\n }", "function obtener_hora($fecha) {\r\nreturn(substr($fecha,11,2));\r\n}", "function convertir_hora_militar($seg_ini) {\n\n\t\t\t$horas = floor($seg_ini/3600);\n\t\t\t$minutos = floor(($seg_ini-($horas*3600))/60);\n\t\t\t\t\t\t\t\n\t\t\treturn $horas.\":\".$minutos;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}", "public function getDateFin();", "function get_hora_bd($hora){\n\t$h = substr($hora,0,2);\n\t$m = substr($hora,3,2);\n\t$meridiano = substr($hora,-2,2);\n\tif($meridiano == 'pm'){\n\t\t$h = $h + 12;\n\t\t$h = $h.':'.$m.':00';\n\t}else{\n\t\t$h = $h.':'.$m.':00';\n\t}\n\treturn $h;\n}", "function resta($inicio, $fin){\n $dif=date(\"H:i:s\", strtotime(\"00:00:00\") + strtotime($fin) - strtotime($inicio) );\n return $dif;\n }", "function DiferencaHoras($hora_inicial,$hora_final,$duracao,&$atendimentos)\r\n{\r\n $difhora = 0;\r\n $vi = explode(':',$hora_inicial);\r\n $vf = explode(':',$hora_final);\r\n $im = ($vi[0] * 60) + $vi[1];\r\n $fm = ($vf[0] * 60) + $vf[1];\r\n \r\n $dm = $fm - $im;\r\n\r\n $dh = $dm / 60;\r\n \r\n $difhora = $dh;\r\n \r\n\r\n $atendimentos = ($dm / $duracao);\r\n\r\n return $difhora;\r\n}", "function formatear_hora($parametro){\n\n\t\t/* Declaro variables personalizadas para que queden claros los datos */\n\t\t$hora = substr($parametro, 11, 2);\n\t\t$minuto = substr($parametro, 14, 2);\n\t\t$dia = substr($parametro, 8, 2);\n\t\t$mes = substr($parametro, 5, 2);\n\t\t\n\t\t/* Generamos el formato */\n\t\t$temp = $hora.\":\".$minuto;\n\t\t\n\t\treturn $temp;\n\t}", "function get_now_hour(){\n if($this->nowHour == \"nc\");\n $this->nowHour = $this->_getNowValues( \"1 hours\");\n return round($this->nowHour * 0.001,3);\n }", "function quita_segundos($hora)\n{\n\t$sin_sec=explode(\":\",$hora);\n\t$final = $sin_sec[0].\":\".$sin_sec[1];\n\treturn $final;\n}", "public function getHeureFin()\n {\n return $this->heureFin;\n }", "public function getHeuresNuit(): ?DateTime {\n return $this->heuresNuit;\n }", "public function getEndTimestamp() {}", "function comprobar_fecha_inicio($fecha_entrada,$fecha_salida){\r\n // echo $fecha_salida;\r\n //echo $fecha_actual = strtotime(date(\"d-m-Y H:i:00\",time()));\r\n if( (empty($fecha_entrada))){\r\n return 'Las fechas no pueden estar vacias';\r\n }\r\n}", "function ultimo_dia_periodo() { \n\n $sql=\"select fecha_fin from mocovi_periodo_presupuestario where actual=true\";\n $resul=toba::db('designa')->consultar($sql); \n return $resul[0]['fecha_fin'];\n }", "public function hora_fecha_validas($fecha, $hora_inicio, $hora_fin) {\n $mensaje = '';\n $mensaje_horas = $this->horas_validas($hora_inicio, $hora_fin);\n if ($mensaje_horas == '') {\n $mensaje .= $this->tiempo_pasado($fecha, $hora_inicio);\n } else {\n $mensaje .= $mensaje_horas;\n }\n if ($hora_fin - $hora_inicio <= 0) {\n $mensaje .= \"- La reserva debe ser minimamente de una hora.\";\n }\n return $mensaje;\n }", "public function horas_validas($hora_inicio, $hora_fin) {\n $mensajeAlerta = '- La hora de inicio es mayor o igual que la hora '\n . 'final.';\n return $hora_inicio >= $hora_fin ? $mensajeAlerta : \"\";\n }" ]
[ "0.7428927", "0.59811115", "0.59811115", "0.59632075", "0.5957478", "0.5921583", "0.57658756", "0.57178104", "0.5706551", "0.5645556", "0.5608898", "0.56039476", "0.56012124", "0.5557647", "0.5543145", "0.5500118", "0.54797", "0.5477522", "0.54439497", "0.5356652", "0.5313261", "0.5305662", "0.529096", "0.52771086", "0.52749115", "0.52209836", "0.5218466", "0.52138865", "0.5133442", "0.51320845" ]
0.71295345
1
Devuelve el valor del campo duracion
public function getDuracion() { return $this->duracion; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDur() {\n\t\treturn $this->dur;\n\t}", "public function get_field_resolver_duration()\n {\n }", "public function getDuration() {}", "public function getDuration(): float;", "public function getValue()\n {\n return $this->date->getValue() . 'T' . $this->time->getValue();\n }", "public function getDuration(): string|null;", "public function get_duration();", "function ultimo_dia_periodo() { \n\n $sql=\"select fecha_fin from mocovi_periodo_presupuestario where actual=true\";\n $resul=toba::db('designa')->consultar($sql); \n return $resul[0]['fecha_fin'];\n }", "public function getValueDateTime()\n {\n\n return $this->valueDateTime;\n }", "public function getDuration()\n {\n return $this->_getData(self::DURATION);\n }", "public function test_exportValue() {\n /** @var MoodleQuickForm_duration $el */\n $el = $this->mform->addElement('duration', 'testel');\n $values = array('testel' => array('number' => 10, 'timeunit' => 1));\n $this->assertEquals(array('testel' => 10), $el->exportValue($values, true));\n $this->assertEquals(10, $el->exportValue($values));\n $values = array('testel' => array('number' => 3, 'timeunit' => 60));\n $this->assertEquals(array('testel' => 180), $el->exportValue($values, true));\n $this->assertEquals(180, $el->exportValue($values));\n $values = array('testel' => array('number' => 1.5, 'timeunit' => 60));\n $this->assertEquals(array('testel' => 90), $el->exportValue($values, true));\n $this->assertEquals(90, $el->exportValue($values));\n $values = array('testel' => array('number' => 2, 'timeunit' => 3600));\n $this->assertEquals(array('testel' => 7200), $el->exportValue($values, true));\n $this->assertEquals(7200, $el->exportValue($values));\n $values = array('testel' => array('number' => 1, 'timeunit' => 86400));\n $this->assertEquals(array('testel' => 86400), $el->exportValue($values, true));\n $this->assertEquals(86400, $el->exportValue($values));\n $values = array('testel' => array('number' => 0, 'timeunit' => 3600));\n $this->assertEquals(array('testel' => 0), $el->exportValue($values, true));\n $this->assertEquals(0, $el->exportValue($values));\n\n $el = $this->mform->addElement('duration', 'testel', null, array('optional' => true));\n $values = array('testel' => array('number' => 10, 'timeunit' => 1));\n $this->assertEquals(array('testel' => 0), $el->exportValue($values, true));\n $this->assertEquals(0, $el->exportValue($values));\n $values = array('testel' => array('number' => 20, 'timeunit' => 1, 'enabled' => 1));\n $this->assertEquals(array('testel' => 20), $el->exportValue($values, true));\n $this->assertEquals(20, $el->exportValue($values));\n\n // Optional element.\n $el2 = $this->mform->addElement('duration', 'testel', '', ['optional' => true]);\n $values = array('testel' => array('number' => 10, 'timeunit' => 1, 'enabled' => 1));\n $this->assertEquals(array('testel' => 10), $el2->exportValue($values, true));\n $this->assertEquals(10, $el2->exportValue($values));\n $values = array('testel' => array('number' => 10, 'timeunit' => 1, 'enabled' => 0));\n $this->assertEquals(array('testel' => 0), $el2->exportValue($values, true));\n $this->assertEquals(null, $el2->exportValue($values));\n }", "public function getTime()\n {\n return $this->values[\"time\"];\n }", "function metabox_duracion( $post ){\n\n\t$duracion = get_post_meta($post->ID, '_duracion_meta', true);\n\n\twp_nonce_field(__FILE__, '_duracion_meta_nonce');\n\n\techo \"<input type='text' class='[ widefat ]' name='_duracion_meta' value='$duracion'>\";\n\n}", "public function getDuration();", "public function sql(): string {\n\t\treturn strval($this->duration);\n\t}", "public function getDuration(): ?string {\n $val = $this->getBackingStore()->get('duration');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'duration'\");\n }", "public function getDurationAttribute($value)\n {\n // if ($value) {\n if (array_key_exists($value, self::$duration)) {\n return self::$duration[$value];\n }\n // }\n // return self::$duration[0];\n\n }", "public function getTime()\n {\n if ( $this->value != null ) {\n $time = strtotime( $this->value );\n $time = date( 'g:i a', $time );\n return $time;\n }\n return null;\n }", "public function getTime()\n {\n return $this->data['fields']['time'];\n }", "public function getTime()\n {\n $value = $this->get(self::TIME);\n return $value === null ? (double)$value : $value;\n }", "public function getQtdAtendida()\n {\n return $this->qtdAtendida;\n }", "public static function invalidDurationValue()\n {\n return new static('The duration value must be a numeric value.');\n }", "function setDuration( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->Duration = $value;\n }", "public function getValor(){\n return $this->_data['valor'];\n }", "public function getDuration() {\n\t\treturn $this->duration;\n\t}", "public function getDateDebut();", "public function getDuration()\n {\n return $this->duration;\n }", "public function getDuration()\n {\n return $this->duration;\n }", "public function getDuration()\n {\n return $this->duration;\n }", "public function getDuration()\n {\n return $this->duration;\n }" ]
[ "0.60901654", "0.60294217", "0.58850163", "0.58574206", "0.5798596", "0.57887095", "0.57851887", "0.578123", "0.57240564", "0.5719243", "0.56727225", "0.5661173", "0.56362903", "0.56329644", "0.56234336", "0.55961347", "0.55798143", "0.55731225", "0.55723476", "0.5532876", "0.55041987", "0.5497172", "0.5492729", "0.54920006", "0.54782134", "0.54737324", "0.5472901", "0.5472901", "0.5472901", "0.5472901" ]
0.68491346
0
Devuelve el valor del campo calificacion
public function getCalificacion() { return $this->calificacion; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getValor(){\n return $this->_data['valor'];\n }", "public function getValor()\n {\n return $this->valor;\n }", "public function getValor()\n {\n return $this->valor;\n }", "public function getValoracion() {\n return $this->valoracion;\n }", "public function getDataCalculo() {\n return $this->dtDataCalculo;\n }", "public function getValorInventario()\n {\n return $this->valorInventario;\n }", "public function calcularValorLlamada();", "public function obtenerValor() {\n return $this->valor;\n }", "public function getValor($atributo){//retornar algún valor\n \treturn $this->$atributo;\n }", "public function getValorAtual() {\n return $this->nValorAtual;\n }", "public function getFechaInicialAttribute($value) \n {\n return $value ? Carbon::parse($value)->format($this->getDateFormatTarifasVehiculo) : null;\n }", "public function getValueAttribute()\n\t{\n\t\treturn $this->attributes['valor_total'];\n\t}", "public function getFechaFinalAttribute($value) \n {\n return $value ? Carbon::parse($value)->format($this->getDateFormatTarifasVehiculo) : null;\n }", "public function getValor_moeda()\n {\n return $this->valor_moeda;\n }", "public function getValorAnulado() {\n return $this->nValorAnulado;\n }", "public function getCalle()\n {\n return $this->calle;\n }", "public function getFullCalendarioAttribute()\n {\n return \"{$this->cal_idanio} {$this->cal_idmes} {$this->cal_idfase}\"; \n //return $this->cal_idanio . \" \" . $this->cal_idmes . \"\" . $this->cal_idfase;\n }", "public function get_value()\n {\n }", "public function get_value()\n {\n }", "public function getValorAttribute($valor){\n return number_format($valor / 100, 2, '.', '');\n }", "public function calcula13o()\n {\n }", "public function calcula13o()\n {\n }", "public function getPrecioConMonedaAttribute()\r\n {\r\n // capturar la moneda que ha configurado el usuario\r\n $simbolo = \"$\";\r\n $tipo_cambio = 1;\r\n return $simbolo . $this->precio * $tipo_cambio;\r\n }", "public function getCustomValueQuestion()\n {\n return \"Enter custom value for month [1-12]: \";\n }", "protected function mapeoValorProp(){\n\t $strPrecio='';\n\t if($this->propiedad->getPublicaprecio()==1){\n\t\t\tif(trim($this->propiedad->getOperacion())=='Venta'){\n\t\t\t\t$mon=$this->CAR_MONVTA;\n\t\t\t\t$val=$this->CAR_VALVTA;\n\t\t\t}else{\n\t\t\t\t$mon=$this->CAR_MONALQ;\n\t\t\t\t$val=$this->CAR_VALALQ;\n\t\t\t}\n\t\t\t$valor=\tintval($this->arrayCaracteristicas[$this->arrayClavesCarac[$val]]['contenido']);\n\t\t\t$moneda=$this->arrayCaracteristicas[$this->arrayClavesCarac[$mon]]['contenido'];\n\t\t\tif($valor!=0 && $valor!=''){\n\t\t\t\tif($moneda=='U$S'){\n\t\t\t\t\t$moneda='USD';\n\t\t\t\t}else{\n\t\t\t\t\t$moneda='ARS';\n\t\t\t\t}\n\t\t\t\t$strPrecio=\"<precio>\".$valor.\"</precio><tipoMoneda>\".$moneda.\"</tipoMoneda>\";\n\t\t\t}else{\n\t\t\t\t$strPrecio=\"<tipoMoneda></tipoMoneda>\";\n\t\t\t}\n\n\t }else{\n\t\t\t$strPrecio=\"<tipoMoneda></tipoMoneda>\";\n\t }\n\t return $strPrecio;\n\t}", "function value()\r\n {\r\n return number_format( $this->Value, 4, \".\", \"\" );\r\n }", "function get_value_edit()\n\t{\n\t\treturn $this->value;\n\t}", "function _fechaInput($fecha = ''){\n return \\Carbon\\Carbon::parse($fecha)->format('d/m/Y');\n // return \"{$d}/{$m}/{$y}\";\n\n\n\n\n }", "function ultimo_dia_periodo() { \n\n $sql=\"select fecha_fin from mocovi_periodo_presupuestario where actual=true\";\n $resul=toba::db('designa')->consultar($sql); \n return $resul[0]['fecha_fin'];\n }", "public function getValorInicial() {\n return $this->nValorInicial;\n }" ]
[ "0.65988225", "0.6438962", "0.6438962", "0.6422627", "0.640101", "0.63876647", "0.6379117", "0.6234446", "0.62236255", "0.6215338", "0.6202235", "0.614352", "0.60803187", "0.606398", "0.6029217", "0.60286874", "0.5988611", "0.5981816", "0.5981816", "0.59641486", "0.5945484", "0.5945484", "0.59383386", "0.5932508", "0.59315443", "0.58365977", "0.5834162", "0.5804151", "0.5800835", "0.57992095" ]
0.66516024
0
Verifies setting a bad mode will result in a false return
public function testBadMode() { $client = new Client($this->options); $this->assertFalse($client->setMode('mittens')); $this->assertTrue($client->getMode() === 'testing'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function failNoisily() :bool{\n\t\treturn !$this->failSilently;\n\t}", "public function testUnsupportedMode()\n {\n $request = new Request('', '');\n $request->setMode('invalid-mode');\n }", "public function errorMode(){}", "public function isRisky()\r\n {\r\n $this->caseClosedOrFail();\r\n\r\n return true;\r\n }", "public function isSafeModeDisabled()\n {\n $checking_result = (Bootstrap::getIniParam('safe_mode') == true) ? false : true;\n\n if (!$checking_result) {\n App::instance()->setNotification('E', App::instance()->t('error'), App::instance()->t('text_safe_mode_notice'), true, 'validator');\n }\n\n return $checking_result;\n }", "public function isInvalid(): bool;", "public function isRisky(): bool;", "public function test()\n\t{\t\t\n\t\treturn (!PHPFOX_SAFE_MODE ? true : false);\n\t}", "private function _validate_settings()\n\t{\n\n\t\treturn TRUE;\n\t}", "function broken() { return TRUE; }", "public /*bool*/ function valid()\n\t{\n\t\treturn false;\n\t}", "private function setErrorMode()\n\t{\n\t\t// get PDO object and enable exception error mode\n\t\t$pdo = $this->getPdo();\n\t\t$this->_errMode = $pdo->getAttribute(PDO::ATTR_ERRMODE);\n\t\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t}", "function test_checkMode_newArgs()\n {\n $result = $this->bax->_checkMode($this->bax->_newArgs());\n $this->assertTrue($result === true);\n }", "public function isQualityDetectionRequiredButFailing()\n {\n $this->processQualityOptionIfNotAlready();\n return $this->qualityCouldNotBeDetected;\n }", "public function setBad($bad = true)\n\t{\n\t\t$this->bad = !!$bad;\n\t}", "public function testModeThrowsInvalidType(): void\n {\n $this->expectException(InvalidModeTypeException::class);\n\n new RequestBodyObject(['mode' => 'invalid-mode']);\n }", "public static function validateMode(string $mode): void\n {\n $invalid = $mode != self::MIGRATION_MODE_UNSPECIFIED\n && $mode != self::NEW_SURFACE_ONLY\n && $mode != self::PRE_MIGRATION_SURFACE_ONLY\n && $mode != self::MIGRATING;\n if ($invalid) {\n throw new \\Exception(\"Invalid migration mode '{$mode}', allowed values are: 'MIGRATION_MODE_UNSPECIFIED', 'PRE_MIGRATION_SURFACE_ONLY', 'NEW_SURFACE_ONLY', 'MIGRATING'\");\n }\n }", "function isValid()\r\n\t{\t\t\r\n\t\treturn false;\r\n\t}", "protected function checkInvalidSqlModes() {}", "public function isMode($mode);", "public function isTestMode() {\n\t\treturn (bool) $this->app->store->get()->params->get('anet.test_mode');\n\t}", "public function testToFail()\n {\n $this->assertTrue(false, 'He sido creada para fallar');\n }", "private static function checkFormatModeValidity($mode) {\n $validMode = array(\n self::FORMAT_MODE_WITH_PLUS_AND_DOT_SEPARATOR,\n self::FORMAT_MODE_WITHOUT_PLUS,\n self::FORMAT_MODE_WITHOUT_DOT_SEPARATOR,\n );\n \n if (in_array($mode, $validMode) === false) {\n throw new \\Exception('The format mode asked is not valid !');\n }\n \n }", "public function isTestMode(): bool;", "public function isButtonValidBrokenSetupInvalidButtonAsSecondParametersGivenExpectFalse() {}", "public function isButtonValidInvalidButtonGivenExpectFalse() {}", "public function setInvalid();", "public function runningInFallbackMode(): void\n {\n self::assertEquals(false, $this->subject->runningInFallbackMode());\n }", "private function validate() {\n\t\n\t\t\treturn false;\n\t}", "public function testDisabled() {\n Data::setOption('safe', 'MarkSafe() > value');\n\n $listener = new PatternLabListener();\n $listener->processSafeData();\n\n $safe = Data::getOption('safe');\n $this->assertSame('MarkSafe() > value', $safe);\n }" ]
[ "0.6583825", "0.64780194", "0.6459585", "0.63105553", "0.61969745", "0.6155871", "0.6149566", "0.6125784", "0.61187524", "0.6003309", "0.5939525", "0.5938211", "0.59324205", "0.591493", "0.5914624", "0.5910613", "0.5905663", "0.5898466", "0.5876846", "0.5858442", "0.58456284", "0.58035254", "0.5800231", "0.57936716", "0.5709675", "0.56939316", "0.5686093", "0.5681316", "0.5677975", "0.567179" ]
0.72837514
0
Let's try to make a call to the sendwithus API We'll call for a list of emails and verify they're an array from their api
public function testMagicCall() { $client = new Client($this->options); $emails = $client->emails(); $this->assertTrue(is_array($emails)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateEmails($apiPublicKey, $emailAddressArray) {\n\n $emailsAddresses = implode(\",\", $emailAddressArray);\n\n $fields = array(\n 'addresses' => $emailsAddresses,\n 'api_key' => $apiPublicKey,\n );\n\n\n $getFields = http_build_query($fields);\n $url = \"https://api.mailgun.net/v3/address/parse?\" . $getFields;\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set to 1 to verify SSL connection\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\n $jsonResponse = curl_exec($ch);\n $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n\n if ($status === 200) {\n\n return $jsonResponse;\n } else {\n\n //API error, setup error handling\n }\n}", "public function test_all_email_endpoint()\n {\n $response = $this->json('GET', route('emails.index'));\n $response->assertStatus(200);\n }", "private function email(){\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\t\t\t$email = $this->_request['email'];\n\t\t\t$sql = mysql_query(\"SELECT email FROM accounts WHERE email = '\".$email.\"'\", $this->db);\n\t\t\tif(mysql_num_rows($sql) > 0){\n\t\t\t\t$result = array();\n\t\t\t\twhile($rlt = mysql_fetch_array($sql,MYSQL_ASSOC)){\n\t\t\t\t\t$result[] = $rlt;\n\t\t\t\t}\n\t\t\t\t// If success everythig is good send header as \"OK\" and return list of users in JSON format\n\t\t\t\techo json_encode(array('valid' =>FALSE));\n\t\t\t} else {\n\t\t\t\techo json_encode(array('valid' =>TRUE));\n\t\t\t}\n\t\t\t//$this->response('',204);\t// If no records \"No Content\" status\n\t\t}", "public function test_search_emails_endpoint()\n {\n $response = $this->json('GET',\n route('emails.search', '[email protected]')\n );\n $response->assertStatus(200);\n }", "function sendEmails($dictEmails) {\n $appConfig = new AppConfig();\n $conn = $appConfig->connect( \"populetic_form\", \"replica\" );\n $daoClient = new DaoClient();\n $daoClientBankAccount = new DaoClientBankAccount();\n\n foreach ($dictEmails as $email => $arrayClaimInfo) {\n $listClaimRefs = array();\n\n if (count($arrayClaimInfo) == 1) {\n //send email unic\n $name = $arrayClaimInfo[0][\"name\"];\n $clientId = $arrayClaimInfo[0][\"idClient\"];\n $amount = $arrayClaimInfo[0][\"clientAmount\"];\n $ref = $arrayClaimInfo[0][\"referencia\"];\n $lang = $arrayClaimInfo[0][\"lang\"];\n $idReclamacio = $arrayClaimInfo[0][\"id_reclamacion\"];\n $codigo_vuelo = $arrayClaimInfo[0][\"codigo\"];\n\n $daoClient->changeToSolicitarDatosPago($conn, $idReclamacio);\n $daoClient->insertLogChange($conn, $clientId, $idReclamacio, '36');\n \n } else {\n //send email with list of $clientInfo\n $name = $arrayClaimInfo[0][\"name\"];\n $clientId = $arrayClaimInfo[0][\"idClient\"];\n $amount = $arrayClaimInfo[0][\"clientAmount\"];\n $ref = $arrayClaimInfo[0][\"referencia\"];\n $lang = $arrayClaimInfo[0][\"lang\"];\n $idReclamacio = $arrayClaimInfo[0][\"id_reclamacion\"];\n $codigo_vuelo = $arrayClaimInfo[0][\"codigo\"];\n\n foreach ($arrayClaimInfo as $claimInfo) {\n $listClaimRefs[] = $claimInfo[\"referencia\"];\n\n //if it is set it means is the principal claim.\n if (isset($claimInfo[\"listAssociates\"])) {\n $name = $claimInfo[\"name\"];\n $clientId = $claimInfo[\"idClient\"];\n $amount = $claimInfo[\"clientAmount\"];\n $ref = $claimInfo[\"referencia\"];\n $lang = $claimInfo[\"lang\"];\n $idReclamacio = $claimInfo[\"id_reclamacion\"];\n $codigo_vuelo = $claimInfo[\"codigo\"];\n }\n\n $daoClient->changeToSolicitarDatosPago($conn, $idReclamacio);\n $daoClient->insertLogChange($conn, $clientId, $idReclamacio, '36');\n }\n }\n\n $date = date('Y-m-d H:i:s');\n $hash = Controller::getInstance()->generateHash($date, $idReclamacio);\n $result = Controller::getInstance()->sendEmailValidation($name, $email, $hash, $date, $amount,\n $ref, $lang, \n $codigo_vuelo, $listClaimRefs);\n \n $daoClientBankAccount->updatePendingBankAccount($conn, $email, $idReclamacio);\n\n $appConfig->closeConnection($conn);\n } \n}", "public function check_email($emails, $projectId){\n $email_list = array();\n $email_list_error = array();\n $emails = preg_split(\"/[;,]+/\", $emails);\n foreach ($emails as $email){\n if(!empty(trim($email))){\n if(filter_var(trim($email), FILTER_VALIDATE_EMAIL)) {\n //VALID\n array_push($email_list,trim($email));\n }else{\n array_push($email_list_error,$email);\n }\n }\n }\n if(!empty($email_list_error)){\n $this->sendFailedEmailRecipient($this->getProjectSetting(\"emailFailed_var\", $projectId),\"Error: Email Address Validation\" ,\"The email \".print_r($email_list_error, true).\" in the project \".$projectId.\", may be invalid format\");\n }\n return $email_list;\n }", "public function listOfCodesByEmail($email)\n {\n\n $recipient = Recipient::where('email', $email)->first();\n\n if ($recipient) {\n\n $codes = $recipient->codes()\n ->join('offers', 'offers.id', '=', 'codes.offer_id')\n ->whereNull('codes.used_on')\n ->where('offers.expiry', '>=', Carbon::today())->get();\n\n foreach ($codes as $code) {\n $vcodes[] = [\n 'offer_name' => $code->Offer->name,\n 'code' => $code->code,\n 'discount' => number_format($code->Offer->discount),\n 'expiry' => $code->Offer->expiry->format('d-m-Y'),\n ];\n }\n\n if (isset($vcodes)) {\n\n return response()->json\n (\n [\n 'code' => 200,\n 'message' => 'Successful',\n 'vouchers' => $vcodes\n ], 200\n );\n } else {\n return response()->json\n (\n [\n 'code' => 200,\n 'message' => 'No More Offers left for : ' . $recipient->email . '',\n ], 200\n );\n }\n\n\n } else {\n return response()->json(\n [\n 'code' => 400,\n 'message' => 'Invalid email address.'\n ], 400);\n }\n }", "protected function getListOfAdditionalEmailsUsingGETRequest()\n {\n\n $resourcePath = '/account/additional-emails/';\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/vnd.allegro.public.v1+json', '*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/vnd.allegro.public.v1+json', '*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires 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 }", "public function call_email_api($email)\n {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, 'https://emailverifierapi.com/v2/?apiKey='.config('app.EMAIL_VERIFIER').'&email='.urlencode($email));\n\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_TIMEOUT, '50');\n\n $content = curl_exec($ch);\n curl_close($ch);\n\n return json_decode($content, TRUE);\n }", "public function check_email_view_page($email) {\n \n if (!empty($email)) {\n $output = array();\n if (preg_match(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$^\", $email)) {\n\n $modules = Yii::$app->db->createCommand(\"SELECT * FROM assist_users WHERE email='$email'\")->queryAll();\n \n // Get cURL resource\n $curl = curl_init();\n // Set some options - we are passing in a useragent too here\n curl_setopt_array($curl, [\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_URL => 'http://dev.digitalvidya.com/training/wp-json/check_ta_email/v1/ld/',\n CURLOPT_USERAGENT => 'Get course data',\n CURLOPT_POST => 1,\n CURLOPT_POSTFIELDS => [\n 'ta_email' => $email,\n ]\n ]);\n // Send the request & save response to $resp\n $resp = curl_exec($curl);\n // Close request to clear up some resources\n $resulst = json_decode($resp,true);\n if(!empty($resulst)){\n $output['status'] = '0';\n $output['result'] = $resulst;\n }else{\n $output['status'] = '-1';\n \n }\n curl_close($curl);\n \n }\n\n return json_encode($output);\n } else {\n return json_encode(array());\n }\n }", "private function emailList()\n {\n return array(\n '[email protected]',\n '[email protected]',\n '[email protected]',\n );\n }", "public function index(EmailRequestList $request)\n {\n return response()->json(['success' => true, 'messages' => [__('pages.email.send.success')], 'data' => ['email' => $this->emailService->index($request->paginate, 200)]], 200);\n }", "public function selectedMails(Request $request)\n {\n $user = Auth::user();\n $emails = EmailRandomizer::randomizedEmails($request);\n $randomizedEmail = EmailRandomizer::create([\n \"user_id\" => $user->id,\n \"user_name\" => $user->name,\n \"emails\" => json_encode($emails)\n ]);\n\n $randomizedEmail->emails = json_decode($randomizedEmail->emails);\n foreach ($randomizedEmail->emails as $email) {\n $user = User::where('email',$email)->first();\n $user->notify(new EmailNotif($user->name));\n }\n\n return response()->json($randomizedEmail);\n }", "public function getOrderEmailList(){\n // Set method and action\n $method = 'email';\n $action = 'getOrderEmailList';\n\n // Set data\n $data = array('params' => true);\n\n // Send request and retrieve response\n $result = Dispatcher::send($method, $action, $data);\n\n return $result;\n }", "public function testSendMailToUsersWithValidData() {\n //generate 4 users\n $users = factory(\\App\\User::class, 4)->make();\n\n $users = $this->mapEloquentUsers($users);\n\n //create a mail object\n $mail = [\n 'subject' => 'Testing',\n 'message' => 'Message Testing',\n 'users' => $users\n ];\n\n $response = $this->post($this->apiPath . '/mails', $mail, $this->createAuthHeaderToAdminUser());\n\n $response->assertStatus(200);\n }", "public function fetchEmails(): void\n {\n $this->fetchedEmails = [];\n\n try {\n $response = $this->mailhog->request('GET', '/api/v1/messages');\n $this->fetchedEmails = json_decode($response->getBody(), false);\n } catch (Exception $e) {\n $this->fail('Exception: ' . $e->getMessage());\n }\n $this->sortEmails($this->fetchedEmails);\n\n // by default, work on all emails\n $this->setCurrentInbox($this->fetchedEmails);\n }", "public function testMailingList() {\n\t}", "public function getAllMails()\n {\n $user = Auth::user();\n $emails = DB::table('users')->select('id','email')->get();\n return response()->json($emails);\n }", "function getFaultIdListLinkedToEmail()\n{\n $searchParam=null;\n $startRecord=0;\n $recordsPerPage=5;\n $url='./getFaultIdListLinkedToEmail';\n $faultReportEmail=null;\n\n if(isset($_GET['faultReportEmail']))\n {\n $faultReportEmail=filter_input(INPUT_GET,'faultReportEmail',FILTER_SANITIZE_STRING);\n }\n\n # retrive list of fault ID's\n $faultReportArr = retrieveFaultLocationsByEmail($faultReportEmail,'idList',$startRecord,$recordsPerPage);\n\n # encode the Site Object Array into JSON\n header(\"Cache-Control: no-cache, must-revalidate\");\n header(\"Expires: 0\");\n header('Content-Type: application/json');\n\n # encode the array as JSON\n $jsonOutput=json_encode($faultReportArr);\n\n echo $jsonOutput;\n}", "function validateEmail($apiPublicKey, $emailAddress) {\n\n $fields = array(\n 'address' => $emailAddress,\n 'api_key' => $apiPublicKey,\n );\n\n $getFields = http_build_query($fields);\n $url = \"https://api.mailgun.net/v3/address/validate?\" . $getFields;\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set to 1 to verify SSL connection\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\n $jsonResponse = curl_exec($ch);\n $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n\n if ($status === 200) {\n\n return $jsonResponse;\n } else {\n\n //API error, setup error handling\n }\n}", "function get_all_mailings(){\n \n #api return count 25 as default.\n #set max count in rowCount as 500\n $params = array(\n 'version' => 3,\n 'sequential' => 1,\n 'rowCount' => 500 \n );\n \n /*$sql = \"Select count(*) as count From civicrm_mailing\";\n $mailingCount = CRM_Core_DAO::singleValueQuery($sql);\n if($mailingCount > 25){\n $params['rowCount'] = $mailingCount;\n }*/\n $aMailings = civicrm_api('Mailing', 'get', $params);\n if( $aMailings['is_error'] == 1 ){\n watchdog( WATCHDOG_DEBUG\n , \"Calling get_all_mailings():\\n\" .\n '$aMailings:' . print_r( $aMailings, true ) . \"\\n\"\n );\n return;\n }\n foreach ( $aMailings['values'] as $key => $mailing ){\n $pMailingJob = array(\n 'version' => 3,\n 'sequential' => 1,\n 'mailing_id' => $mailing['id']\n );\n $aMailingJob = civicrm_api('MailingJob', 'get', $pMailingJob);\n if( $aMailingJob['is_error'] != 1 && $aMailingJob['count']!= 0 ){\n $status = $aMailingJob['values'][0]['status'];\n $stDate = array_search('start_date', $aMailingJob['values'][0]);\n $endDate = array_search('end_date', $aMailingJob['values'][0]);\n $not_scheduled = false;\n if($stDate){\n $start_date = CRM_Utils_Date::customFormat($stDate);\n }else{\n $start_date = 'NULL';\n }\n if($endDate){\n $end_date = CRM_Utils_Date::customFormat($endDate);\n }else{\n $end_date = 'NULL';\n }\n }else{\n $status = \"Draft\";\n $start_date = $end_date = 'NULL';\n $not_scheduled = true;\n }\n \n //get change the action link based on the status\n if($not_scheduled){\n $actionUrl = CRM_Utils_System::url( 'civicrm/quickbulkemail', 'mid='.$mailing['id'].'&continue=true&reset=1');\n $actionName = 'Edit';\n }else{\n $actionUrl = CRM_Utils_System::url( 'civicrm/quickbulkemail', 'mid='.$mailing['id'].'&reset=1');\n $actionName = 'Re-Use';\n }\n \n //get scheduled_id and contact name\n if(!empty( $mailing['scheduled_id'] )){\n $scheduled_id = $mailing['scheduled_id'];\n $scheduled_name = self::get_contact_name( $mailing['scheduled_id'] );\n }else{\n $scheduled_id = 'NULL';\n $scheduled_name = 'NULL';\n }\n \n if(empty($mailing['scheduled_date'])) {\n $mailing['scheduled_date'] = NULL;\n }\n \n $action = \"<span><a href='\".$actionUrl.\"'>\".$actionName.\"</a></span>\" ;\n $rows[] = array( 'id' => $mailing['id']\n ,'name' => $mailing['name']\n ,'status' => $status\n ,'created_date' => CRM_Utils_Date::customFormat($mailing['created_date'])\n ,'scheduled' => CRM_Utils_Date::customFormat($mailing['scheduled_date'])\n ,'start' => $start_date\n ,'end' => $end_date\n ,'created_by' => self::get_contact_name( $mailing['created_id'] )\n ,'scheduled_by' => $scheduled_name\n ,'created_id' => $mailing['created_id']\n ,'scheduled_id' => $scheduled_id\n ,'action' => $action\n ); \n }\n return $rows;\n }", "public function getSubscribers(Request $request)\n {\n $url = \"https://api.mailerlite.com/api/v2/subscribers/\";\n\n $columns = [ \n 0 => 'email', \n 1 => 'name',\n 2 => 'country',\n 3 => 'datetime',\n 4 => 'datetime'\n ];\n\n $params = [\n 'offset' => $request->input('start'),\n // 'limit' => $request->input('length')\n ];\n\n $url = $url . '?' . http_build_query($params);\n\n $key = Session::get('apiKeySession');\n $search = $request->input('search.value'); \n \n if(!empty($search)){\n $url = \"https://api.mailerlite.com/api/v2/subscribers/search?query=$search\";\n }\n\n \n\n $curl = curl_init($url);\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\n $headers = [\n \"X-MailerLite-ApiKey: $key\",\n ];\n curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n\n $resp = curl_exec($curl);\n curl_close($curl);\n $result = json_decode($resp);\n\n $totalData = count((array) $result);\n $totalFiltered = $totalData; \n\n\n $data = [];\n\n if(!empty($result))\n {\n if(gettype($result) == \"array\"){\n\n foreach ($result as $res)\n {\n $fields = $res->fields;\n $country = \"\";\n $datetime = empty($res->date_subscribe) ? $res->date_created : $res->date_subscribe; //check if date_subscribe has value \n\n for ($i=0; $i < count($fields); $i++) { \n if($fields[$i]->key == \"country\"){\n $country = $fields[$i]->value;\n }\n }\n \n $nestedData= [\n 'email' => \"<a href='/subscriber/$res->id'>$res->email</a>\",\n 'name' => $res->name,\n 'country' => $country,\n 'date' => date('d/M/Y',strtotime($datetime)),\n 'time' => date(' H:i:s',strtotime($datetime)),\n 'delete' => \"<button class='btn btn-danger delete' data-id='$res->id'>Delete</button>\",\n 'datetime' => strtotime($datetime)\n ];\n \n $data[] = $nestedData;\n\n $order = $columns[$request->input('order.0.column')];\n $dir = $request->input('order.0.dir');\n\n usort($data, function ($item1, $item2) use ($order,$dir) {\n if($dir == \"asc\"){\n return $item1[$order] <=> $item2[$order];\n }else{\n return $item2[$order] <=> $item1[$order];\n }\n });\n }\n }else{\n \n $fields = $result->fields;\n $country = \"\";\n for ($i=0; $i < count($fields); $i++) { \n if($fields[$i]->key == \"country\"){\n $country = $fields[$i]->value;\n }\n }\n \n //check if date_subscribe has value \n $datetime = empty($result->date_subscribe) ? $result->date_created : $result->date_subscribe;\n\n $nestedData= [\n 'email' => \"<a href='/subscriber/$result->id'>$result->email</a>\",\n 'name' => $result->name,\n 'country' => $country,\n 'date' => date('d/M/Y',strtotime($datetime)),\n 'time' => date(' H:i:s',strtotime($datetime)),\n 'delete' => \"<button class='btn btn-danger delete' data-id='$result->id'>Delete</button>\"\n ];\n\n $data[] = $nestedData;\n\n }\n \n }\n \n return Datatables::of($data)\n ->addIndexColumn()\n ->rawColumns(['delete','email'])\n ->make(true);\n }", "function doApiRequest($email, $name, $location, $phone, $category){\n try{\n #!important!\n $eamil = get_value($email);\n $final = 0;\n #get api data from hosted server\n $request = file_get_contents(\"http://34.212.19.150:8000/request/users\");\n #parse api data to json_decoder \n $json_response = json_decode($request);\n #create array to hold api data \n $response_array = array();\n #split fetched data from api for array\n foreach ($json_response->data as $response ) {\n #add email addresses to response_array \n array_push($response_array, $response->email);\n }\n #check if value exist in fetched api array\n if(in_array($email, $response_array)){\n #add free_lancer to database\n $addFreeLancer = doAddFreeLancer($name, $email, $location, $phone, $category);\n #fetch inserted data from parameters \n $insertedData = array('email' => $email ,'name' => $name,'location' => $location,'phone' => $phone,\n 'category' => $category);\n #send reponses \n $final = api_response(true, $insertedData, $addFreeLancer);\n }else{\n $final = api_response(false, null, \"not found in api\");\n }\n #returned data to user\n return $final;\n \n }catch(Exception $ex){\n return $ex->getMessage();\n }\n}", "private function verify_email() {\n $array = array();\n $errors = array();\n //Check if email already exists in users table\n try {\n $stmt = $this->conn->prepare(\"SELECT * FROM users WHERE email = :email\");\n\n $stmt->bindParam(':email', $this->email);\n\n $stmt->execute();\n\n $results = array();\n\n while($result = $stmt->fetch(\\PDO::FETCH_ASSOC)) {\n $results[] = $result;\n }\n\n //check result count, if 0 that means email doesnt exist so user can be registered\n if(count($results) == 0) {\n return $array['status'] = \"Success\";\n }\n\n //if count is not 0 that means the email address already exists so user cannot be registered\n $array['status'] = \"Error\";\n $errors[] = \"-Email address already exists\";\n $array['errors'] = $errors;\n return $array;\n\n } catch(\\Exception $e) {\n $array['status'] = \"Error\";\n $errors[] = \"Server Error\";\n $array['errors'] = $errors;\n return $array;\n }\n\n }", "public function getValidate(WP_REST_Request $request)\r\n {\r\n global $wpdb;\r\n $code = $request['code'];\r\n $redirectURI = get_option('ohs_newsletter_redirect');\r\n\r\n $sendgridHeader = \"Bearer \" . get_option('ohs_newsletter_sendgrid_api');\r\n $sendgridRecepientAPI = \"https://api.sendgrid.com/v3/contactdb/recipients\";\r\n $sendgridListAPI = \"https://api.sendgrid.com/v3/contactdb/lists/\".get_option('ohs_newsletter_sendgrid_list').\"/recipients/\";\r\n\r\n\r\n $c = $wpdb->get_results($wpdb->prepare(\r\n \"\r\n SELECT * FROM \" . $wpdb->prefix . self::$tableName . \"\r\n WHERE `validation_code` = %s\r\n ORDER BY id DESC\r\n LIMIT 1\r\n \", $code\r\n ));\r\n\r\n if (count($c) == 0) {\r\n return $this->OHSAPIError();\r\n }\r\n\r\n unset($c[0]->validation_code);\r\n unset($c[0]->id);\r\n $body = json_encode($c);\r\n //send API request to Sendgrid\r\n $response = wp_remote_post($sendgridRecepientAPI, [\r\n 'method' => 'POST',\r\n 'headers' => [\"Authorization\" => $sendgridHeader, 'Content-Type' => 'application/json'],\r\n 'body' => $body\r\n ]\r\n );\r\n\r\n if ( is_wp_error( $response ) ) {\r\n //$error_message = $response->get_error_message();\r\n return $this->OHSAPIError();\r\n } else {\r\n if (!isset(json_decode($response['body'])->persisted_recipients[0])) {\r\n return $this->OHSAPIError();\r\n }\r\n $recipientID = json_decode($response['body'])->persisted_recipients[0];\r\n }\r\n\r\n $response = wp_remote_post($sendgridListAPI . $recipientID, [\r\n 'method' => 'POST',\r\n 'headers' => [\"Authorization\" => $sendgridHeader, 'Content-Type' => 'application/json'],\r\n 'body' => \"\"\r\n ]);\r\n\r\n if ( is_wp_error( $response ) || $response['response']['code'] != '201' ) {\r\n //$error_message = $response->get_error_message();\r\n return $this->OHSAPIError();\r\n }\r\n\r\n $wpdb->delete($wpdb->prefix . self::$tableName, ['validation_code' => $code], ['%s']);\r\n $response = new WP_REST_Response();\r\n $response->set_status(302);\r\n $response->header('Location', $redirectURI);\r\n return $response;\r\n }", "public function test_single_recipient_endpoint()\n {\n $response = $this->json('GET',\n route('emails.recipient', '[email protected]')\n );\n $response->assertStatus(200);\n }", "public function getEmails(){\r\n \r\n $dbConfig = array(\r\n \"DB_DNS\" => 'mysql:host=localhost;port=3306;dbname=PHPadvClassSpring2015',\r\n \"DB_USER\" => 'root', \r\n \"DB_PASSWORD\" => '');\r\n $pdo = new DB($dbConfig);\r\n $db = $pdo->getDB();\r\n $stmt = $db->prepare(\"SELECT * FROM emailtype where active = 1\");\r\n if ($stmt->execute() && $stmt->rowCount() > 0) {\r\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n echo '<h3>Types of E-mails</h3>';\r\n foreach ($results as $value) {\r\n echo '<p>- <strong>', $value['emailtype'], '</strong></p>';\r\n }\r\n } else {\r\n echo '<p>No data found!</p>';\r\n } \r\n \r\n }", "public function check_mail()\n\t{\n\t\tif (! ee()->config->item('courier_mandrill_key')) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Include the Google API\n\t\tset_include_path(\n\t\t\tget_include_path() .\n\t\t\tPATH_SEPARATOR .\n\t\t\tCOURIER_PATH .\n\t\t\t'/lib/google-api/src'\n\t\t);\n\n\t\t// Get lists\n\t\t$lists = ee()->courier_model->getLists();\n\n\t\t// Loop through each of the lists\n\t\tforeach ($lists as $list) {\n\t\t\t// Get the list members\n\t\t\t$list->members = ee()->courier_model->getMembers(array(\n\t\t\t\t'list_id' => $list->id\n\t\t\t));\n\n\t\t\t// End this iteration if list has no members\n\t\t\tif (! $list->members) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Get the gmail client\n\t\t\t$client = ee()->courier_google_lib->getClient(\n\t\t\t\t$list->id,\n\t\t\t\t$list->list_auth_token\n\t\t\t);\n\n\t\t\t// Get the service\n\t\t\t$service = new Google_Service_Gmail($client);\n\n\t\t\t// Get all messages in the inbox\n\t\t\t$messages = $service->users_messages->listUsersMessages('me', array(\n\t\t\t\t'labelIds' => 'INBOX'\n\t\t\t));\n\n\t\t\t// Get the messages array\n\t\t\t$messagesArray = $messages->getMessages();\n\n\t\t\t// If there are no messages we can go to the next list\n\t\t\tif (! count($messagesArray)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Load the Mandrill API handler\n\t\t\tee()->load->library('mandrill_handler_lib');\n\n\t\t\t// Set list as default from name and email\n\t\t\t$fromEmail = $list->list_email_address;\n\t\t\t$fromName = $list->list_name;\n\n\t\t\t// Build array of members to send the message to\n\t\t\t$members = array();\n\n\t\t\tforeach ($list->members as $member) {\n\t\t\t\t$members[] = $member->member_email;\n\t\t\t}\n\n\t\t\t// Loop through the messages\n\t\t\tforeach($messagesArray as $messageInfo) {\n\t\t\t\t// Get the email metadata\n\t\t\t\t$messageMeta = $service->users_messages->get(\n\t\t\t\t\t'me',\n\t\t\t\t\t$messageInfo->getId(),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'format' => 'metadata'\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t// Set from variables\n\t\t\t\tforeach ($messageMeta->getPayload()->getHeaders() as $header) {\n\t\t\t\t\t$name = $header->name;\n\n\t\t\t\t\tif ($name == 'From' || $name == 'from' || $name == 'FROM') {\n\t\t\t\t\t\tpreg_match_all(\n\t\t\t\t\t\t\t'/\\s*\"?([^><,\"]+)\"?\\s*((?:<[^><,]+>)?)\\s*/',\n\t\t\t\t\t\t\t$header->value,\n\t\t\t\t\t\t\t$matches,\n\t\t\t\t\t\t\tPREG_SET_ORDER\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tforeach($matches as $m) {\n\t\t\t\t\t\t\tif(! empty($m[2])) {\n\t\t\t\t\t\t\t\t$fromEmail = trim($m[2], '<>');\n\t\t\t\t\t\t\t\t$fromName = trim($m[1]);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$fromEmail = $m[1];\n\t\t\t\t\t\t\t\t$fromName = $m[1];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Set the recipients of this message (remove sender)\n\t\t\t\t$recipients = $members;\n\t\t\t\t$fromEmailKey = array_search($fromEmail, $recipients);\n\n\t\t\t\tif ($fromEmailKey) {\n\t\t\t\t\tunset($recipients[$fromEmailKey]);\n\n\t\t\t\t\t$recipients = array_values($recipients);\n\t\t\t\t}\n\n\t\t\t\t// Get the raw message\n\t\t\t\t$rawMessage = $service->users_messages->get(\n\t\t\t\t\t'me',\n\t\t\t\t\t$messageInfo->getId(),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'format' => 'raw'\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t// Decode the raw message\n\t\t\t\t$rawMessage = base64_decode(\n\t\t\t\t\tstrtr($rawMessage->getRaw(), '-_,', '+/=')\n\t\t\t\t);\n\n\t\t\t\t// Remove Reply-To headers from raw message\n\t\t\t\t$rawMessage = preg_replace(\n\t\t\t\t\t'/(?:\\r|\\n)?Reply-To: (?:.*)/im',\n\t\t\t\t\t'',\n\t\t\t\t\t$rawMessage\n\t\t\t\t);\n\n\t\t\t\t// Set list Reply-To header\n\t\t\t\t$rawMessage = 'Reply-To: ' . $list->list_name .\n\t\t\t\t\t' <' . $list->list_email_address . '>' . PHP_EOL .\n\t\t\t\t\t$rawMessage;\n\n\t\t\t\t// Send the message\n\t\t\t\tee()->mandrill_handler_lib->sendRawMessage(\n\t\t\t\t\t$rawMessage,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'fromEmail' => $fromEmail,\n\t\t\t\t\t\t'fromName' => $fromName,\n\t\t\t\t\t\t'to' => $recipients\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t// Remove INBOX label\n\t\t\t\t$mods = new Google_Service_Gmail_ModifyMessageRequest();\n\t\t\t\t$mods->setRemoveLabelIds(array(\n\t\t\t\t\t'INBOX'\n\t\t\t\t));\n\n\t\t\t\t$service->users_messages->modify(\n\t\t\t\t\t'me',\n\t\t\t\t\t$messageInfo->getId(),\n\t\t\t\t\t$mods\n\t\t\t\t);\n\t\t\t}\n\n\t\t\texit();\n\t\t}\n\t}", "public function actionCheck_email() { //var_dump($_POST['email']); die();\n if (isset($_POST['email']) != 0) {\n $output = array();\n $email = $_POST['email'];\n if (preg_match(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$^\", $email)) {\n\n $modules = Yii::$app->db->createCommand(\"SELECT * FROM assist_users WHERE email='$email'\")->queryAll();\n if (!empty($modules)) {\n $output['status'] = '1';\n } else {\n /*$post = [ 'ta_email' => $email];\n $ch = curl_init('http://dev.digitalvidya.com/training/wp-json/check_ta_email/v1/ld/');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n // execute!\n $response = curl_exec($ch);\n\n // close the connection, release resources used\n curl_close($ch);*/\n\n $post = [ 'ta_email' => $_POST['email']]; \n $ch = curl_init('http://dev.digitalvidya.com/training/wp-json/check_ta_email/v1/ld/');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n // execute!\n $response = curl_exec($ch);\n\n // close the connection, release resources used\n curl_close($ch);\n\n\n\t\t\t\t\t$resulst = json_decode($response); \n\t\t\t\t\t//print_r($ourput);\n\t\t\t\t\t//print_r(json_decode($ourput)); \n\t\t\t\t\t//echo \"<pre>\";\n\t\t\t\t\t//print_r($resulst); //var_dump($email); die();\n\t\t\t\t\tif(!empty($resulst)){\n\t\t\t\t\t\t$output['status'] = '0';\n\t\t\t\t\t\t$output['result'] = $resulst;\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo \"test\";\n\t\t\t\t\t\tdie;\n\t\t\t\t\t}\n // curl_close($ch);\n }\n }\n\n return json_encode($output);\n } else {\n return $this->redirect(['dv-users/index']);\n }\n }", "public static function data()\n {\n $model = new \\app\\modules\\systems\\models\\Email;\n\n $data = $model->getList();\n $emailData = [];\n\n foreach ($data as $key => $value) {\n $emailAddress = strtolower(trim($value['emailaddress']));\n $emailData[$emailAddress] = $value;\n// if($value['is_encrypt']){\n// $emailData[$emailAddress]['tls'] = true;\n// }else{\n// $emailData[$emailAddress]['tls'] = false;\n// }\n//\t\t\tif($value['ssl'] == 1)\n//\t\t\t{\n//\t\t\t\t$emailData[$emailAddress]['ssl'] = true;\n//\t\t\t}\n//\t\t\telse\n//\t\t\t{\n//\t\t\t\t$emailData[$emailAddress]['ssl'] = false;\n//\t\t\t}\n }\n return $emailData;\n /*\t\treturn [\n '[email protected]' => [\n 'imap_server' => 'imap.163.com',\n 'smtp_server' => 'smtp.163.com',\n 'imap_protocol' => 'imap',\n 'smtp_protocol' => 'smtp',\n 'imap_port' => '993',\n 'smtp_port' => '25',\n 'ssl' => true,\n 'emailaddress' => '[email protected]',\n 'accesskey' => 'comeon666',\n ],\n '[email protected]' => [\n 'imap_server' => 'imap.163.com',\n 'smtp_server' => 'smtp.163.com',\n 'imap_protocol' => 'imap',\n 'smtp_protocol' => 'smtp',\n 'imap_port' => '993',\n 'smtp_port' => '25',\n 'ssl' => true,\n 'emailaddress' => '[email protected]',\n 'accesskey' => 'comeon888',\n ],\n '[email protected]' => [\n 'imap_server' => 'imap.163.com',\n 'smtp_server' => 'smtp.163.com',\n 'imap_protocol' => 'imap',\n 'smtp_protocol' => 'smtp',\n 'imap_port' => '993',\n 'smtp_port' => '25',\n 'ssl' => true,\n 'emailaddress' => '[email protected]',\n 'accesskey' => 'comeon777',\n ],\n ];\t\t\t*/\n }" ]
[ "0.70612866", "0.6870888", "0.66912246", "0.6623433", "0.64342874", "0.6317842", "0.62271696", "0.62232995", "0.6178734", "0.6142892", "0.6132692", "0.60715073", "0.6045889", "0.6017472", "0.6014816", "0.6012517", "0.59815806", "0.5980452", "0.59439987", "0.592657", "0.5917955", "0.591374", "0.591161", "0.58983105", "0.58756524", "0.587563", "0.5868354", "0.58542204", "0.58459926", "0.58443767" ]
0.7185807
0
A test that timeouts
#[@test, @limit(time= 0.010)] public function timeouts() { $start= gettimeofday(); $end= (1000000 * $start['sec']) + $start['usec'] + 1000 * 50; // 0.05 seconds do { $now= gettimeofday(); } while ((1000000 * $now['sec']) + $now['usec'] < $end); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_refreshMessageTimeout() {\n\n }", "public function timeout();", "#[@test, @limit(time= 1.0)]\n public function noTimeout() {\n }", "private function skipTimeoutTest()\n {\n static::fail('API timeouts detected. We will probably not be able to complete this test suite.');\n }", "public function isInTimeout();", "public function testTimeoutOption()\n {\n $container = [];\n $handler = $this->getMockHandler([new Response(200), new Response(200)], $container);\n\n $client = new Client(\n [\n 'base_uri' => 'http://example.org',\n 'handler' => $handler,\n 'timeout' => 2\n ]\n );\n\n $this->assertArrayHasKey('timeout', $client->getConfig());\n $this->assertEquals(2, $client->getConfig('timeout'));\n\n $client->setAuth('test', 'test', 'test');\n\n $client->get('/test');\n $this->assertEquals(2, end($container)['options']['timeout']);\n \n $client->get('/test', ['timeout' => 5]);\n $this->assertEquals(5, end($container)['options']['timeout']);\n }", "public function testElapsed() {\n // Stop the timer\n $this->timer->stop();\n\n // Get the elapsed time\n $elapsed_time = $this->timer->get_elapsed();\n\n // It should be less than a second\n $this->assertTrue( $elapsed_time > 0 && $elapsed_time < 1 );\n }", "public function testTimeoutDuringRun()\n\t{\n\t\t$config = $this->freshConfigWithEventBus();\n\t\t$collection = $this->freshCollectionWithConfig($config);\n\t\t\n\t\t// first test that we complete an isValid run with just 2 dummy rules\n\t\t$this->addDummyRulesToCollection(2, $collection, $config);\n\t\t\n\t\t$is_valid = $collection->isValid(new OLPBlackbox_Data(), new OLPBlackbox_StateData());\n\t\t\n\t\t$this->assertTrue($is_valid, \"Rule collection with 2 dummy rules failed!\");\n\t\tforeach ($collection as $rule)\n\t\t{\n\t\t\t$this->assertTrue($rule->wasRun(), \"Rule ($rule) wasn't run!\");\n\t\t}\n\t\t$config->event_bus->unsubscribe($collection);\n\t\t\n\t\t\n\t\t// NOW test that if a timeout happens during the first rule, the second \n\t\t// one isn't run and the collection fails.\n\t\t$collection = $this->freshCollectionWithConfig($config);\n\t\t$this->addDummyRulesToCollection(2, $collection, $config);\n\t\t$collection->getRuleAtIndex(0)->send_timeout = TRUE;\n\t\t$config->event_bus->subscribeTo(OLPBlackbox_Event::EVENT_BLACKBOX_TIMEOUT, $collection);\n\t\t\n\t\t// actual method we're testing\n\t\t$is_valid = $collection->isValid(new OLPBlackbox_Data(), new OLPBlackbox_StateData());\n\t\t\n\t\t// assertations\n\t\t$this->assertFalse(\n\t\t\t$is_valid,\n\t\t\t\"Rule collection timed out but still returned valid.\"\n\t\t);\n\t\t$this->assertTrue(\n\t\t\t$collection->getRuleAtIndex(0)->wasRun(), \n\t\t\t\"First rule wasn't run, but was expected to be.\"\n\t\t);\n\t\t$this->assertFalse(\n\t\t\t$collection->getRuleAtIndex(1)->wasRun(), \n\t\t\t\"Second rule was run but shouldn't have been.\"\n\t\t);\n\t}", "public function timeout($timeout);", "public function testStop() {\n // It should return the elapse timed (not testing yet)\n $this->assertGreaterThan( 0, $this->timer->stop() );\n }", "private function _stepTimeout():void\n\t{\n\t\tif( $this->_timeout_queue[0]['call_at'] <= microtime( true ) )\n\t\t{\n\t\t\t[ 'task'=>$task, ]= array_shift( $this->_timeout_queue );\n\t\t\t\n\t\t\t$this->_runTask( $task );\n\t\t}\n\t\telse\n\t\t\tusleep( 1000 );\n\t}", "public function testWaitTimeout()\n {\n if (!$this->_getConnection() instanceof \\Magento\\Framework\\DB\\Adapter\\Pdo\\Mysql) {\n $this->markTestSkipped('This test is for \\Magento\\Framework\\DB\\Adapter\\Pdo\\Mysql');\n }\n try {\n $defaultWaitTimeout = $this->_getWaitTimeout();\n $minWaitTimeout = 1;\n $this->_setWaitTimeout($minWaitTimeout);\n $this->assertEquals($minWaitTimeout, $this->_getWaitTimeout(), 'Wait timeout was not changed');\n\n // Sleep for time greater than wait_timeout and try to perform query\n sleep($minWaitTimeout + 1);\n $result = $this->_executeQuery('SELECT 1');\n $this->assertInstanceOf('Magento\\Framework\\DB\\Statement\\Pdo\\Mysql', $result);\n // Restore wait_timeout\n $this->_setWaitTimeout($defaultWaitTimeout);\n $this->assertEquals(\n $defaultWaitTimeout,\n $this->_getWaitTimeout(),\n 'Default wait timeout was not restored'\n );\n } catch (\\Exception $e) {\n // Reset connection on failure to restore global variables\n $this->_getConnection()->closeConnection();\n throw $e;\n }\n }", "public function getTimeout();", "public function getTimeout();", "public function getTimeout();", "public function getTimeout();", "public function getTimeout();", "public function getTimeout();", "public function testGetTimelogsForTask()\n {\n\n }", "public function setTimeout($timeout);", "public function testSetTimeout()\n {\n $container = [];\n $handler = $this->getMockHandler([new Response(200), new Response(200), new Response(200)], $container);\n $client = new Client(\n [\n 'base_uri' => 'http://example.org',\n 'handler' => $handler,\n ]\n );\n\n $this->assertArrayHasKey('timeout', $client->getConfig());\n $this->assertEquals(Client::DEFAULT_REQUEST_TIMEOUT, $client->getConfig('timeout'));\n\n $client->setAuth('test', 'test', 'test');\n\n $client->get('/test', ['timeout' => 2]);\n $this->assertEquals(2, end($container)['options']['timeout']);\n\n $this->assertEquals(Client::DEFAULT_REQUEST_TIMEOUT, $client->getConfig('timeout'));\n \n $client->setTimeout(5);\n $client->get('/test');\n \n $this->assertEquals(Client::DEFAULT_REQUEST_TIMEOUT, $client->getConfig('timeout'));\n $this->assertEquals(5, end($container)['options']['timeout']);\n\n $client->get('/test', ['timeout' => 2]);\n $this->assertEquals(2, end($container)['options']['timeout']);\n }", "public function timeout($timesecs);", "public function testGetElapsed() {\n // Stop the timer\n $this->timer->stop();\n\n // It should return an int\n $this->assertEquals( $this->timer->get_elapsed(), $this->timer->get_stop() - $this->timer->get_start() );\n }", "public function setTimeout(int $timeout): void {}", "public function test_admin_end_match()\n {\n $this->assertTrue($this->btwServer->adminEndMatch());\n\n sleep(30);\n }", "public function timeout($ms);", "public function timeOut()\n\t{\n\t\techo 'time out!';\n\t}", "public function testGetTimelogs()\n {\n\n }", "public function test_temporary_data_with_timeout() {\n\t\t$key = rand_str();\n\t\t$value = rand_str();\n\n\t\t$this->assertFalse( get_site_option( '_site_temporary_timeout_' . $key ) );\n\n\t\t$now = time();\n\n\t\t$this->assertTrue( WP_Temporary::set_site( $key, $value, 100 ) );\n\n\t\t// Ensure the temporary timeout is set for 100-101 seconds in the future.\n\t\t$this->assertGreaterThanOrEqual( $now + 100, get_site_option( '_site_temporary_timeout_' . $key ) );\n\t\t$this->assertLessThanOrEqual( $now + 101, get_site_option( '_site_temporary_timeout_' . $key ) );\n\n\t\t// Update the timeout to a second in the past and watch the temporary be invalidated.\n\t\t$this->assertEquals( $value, WP_Temporary::get_site( $key ) );\n\t\tupdate_site_option( '_site_temporary_timeout_' . $key, $now - 1 );\n\t\t$this->assertFalse( WP_Temporary::get_site( $key ) );\n\t}", "public function setTimeout(int $timeout): void;" ]
[ "0.7561078", "0.7497891", "0.72912186", "0.72688377", "0.66882604", "0.6644517", "0.6635606", "0.6625729", "0.65839547", "0.6556796", "0.6513962", "0.6467422", "0.6376875", "0.6376875", "0.6376875", "0.6376875", "0.6376875", "0.6376875", "0.6361043", "0.6285883", "0.6273379", "0.6244437", "0.62280935", "0.62223923", "0.6152196", "0.6136659", "0.6108725", "0.60903805", "0.6090218", "0.60896164" ]
0.77514756
0
A test that does not timeout
#[@test, @limit(time= 1.0)] public function noTimeout() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function skipTimeoutTest()\n {\n static::fail('API timeouts detected. We will probably not be able to complete this test suite.');\n }", "public function test_refreshMessageTimeout() {\n\n }", "#[@test, @limit(time= 0.010)]\n public function timeouts() {\n $start= gettimeofday();\n $end= (1000000 * $start['sec']) + $start['usec'] + 1000 * 50; // 0.05 seconds\n do {\n $now= gettimeofday();\n } while ((1000000 * $now['sec']) + $now['usec'] < $end);\n }", "public function isInTimeout();", "public function timeout();", "public function testElapsed() {\n // Stop the timer\n $this->timer->stop();\n\n // Get the elapsed time\n $elapsed_time = $this->timer->get_elapsed();\n\n // It should be less than a second\n $this->assertTrue( $elapsed_time > 0 && $elapsed_time < 1 );\n }", "public function testTimeoutDuringRun()\n\t{\n\t\t$config = $this->freshConfigWithEventBus();\n\t\t$collection = $this->freshCollectionWithConfig($config);\n\t\t\n\t\t// first test that we complete an isValid run with just 2 dummy rules\n\t\t$this->addDummyRulesToCollection(2, $collection, $config);\n\t\t\n\t\t$is_valid = $collection->isValid(new OLPBlackbox_Data(), new OLPBlackbox_StateData());\n\t\t\n\t\t$this->assertTrue($is_valid, \"Rule collection with 2 dummy rules failed!\");\n\t\tforeach ($collection as $rule)\n\t\t{\n\t\t\t$this->assertTrue($rule->wasRun(), \"Rule ($rule) wasn't run!\");\n\t\t}\n\t\t$config->event_bus->unsubscribe($collection);\n\t\t\n\t\t\n\t\t// NOW test that if a timeout happens during the first rule, the second \n\t\t// one isn't run and the collection fails.\n\t\t$collection = $this->freshCollectionWithConfig($config);\n\t\t$this->addDummyRulesToCollection(2, $collection, $config);\n\t\t$collection->getRuleAtIndex(0)->send_timeout = TRUE;\n\t\t$config->event_bus->subscribeTo(OLPBlackbox_Event::EVENT_BLACKBOX_TIMEOUT, $collection);\n\t\t\n\t\t// actual method we're testing\n\t\t$is_valid = $collection->isValid(new OLPBlackbox_Data(), new OLPBlackbox_StateData());\n\t\t\n\t\t// assertations\n\t\t$this->assertFalse(\n\t\t\t$is_valid,\n\t\t\t\"Rule collection timed out but still returned valid.\"\n\t\t);\n\t\t$this->assertTrue(\n\t\t\t$collection->getRuleAtIndex(0)->wasRun(), \n\t\t\t\"First rule wasn't run, but was expected to be.\"\n\t\t);\n\t\t$this->assertFalse(\n\t\t\t$collection->getRuleAtIndex(1)->wasRun(), \n\t\t\t\"Second rule was run but shouldn't have been.\"\n\t\t);\n\t}", "public function testStop() {\n // It should return the elapse timed (not testing yet)\n $this->assertGreaterThan( 0, $this->timer->stop() );\n }", "public function testCheckIfAccountExpired()\n {\n }", "public function testSleep(): void\n {\n $process = $this->phpbench(\n 'run benchmarks/set4/NothingBench.php --sleep=5000'\n );\n\n $this->assertExitCode(0, $process);\n }", "public function testPerformActionForExpiredBuilds()\n {\n }", "private function __sleep() {}", "private function __sleep() {}", "private function __sleep() {}", "private function __sleep() {}", "public function testMain()\n {\n $thread = new MockThread(new \\stdClass());\n $thread->run();\n $this->assertTrue($thread->hasExcecuted());\n }", "public function wait(int $timeout = 0) : bool{}", "public function testWaitTimeout()\n {\n if (!$this->_getConnection() instanceof \\Magento\\Framework\\DB\\Adapter\\Pdo\\Mysql) {\n $this->markTestSkipped('This test is for \\Magento\\Framework\\DB\\Adapter\\Pdo\\Mysql');\n }\n try {\n $defaultWaitTimeout = $this->_getWaitTimeout();\n $minWaitTimeout = 1;\n $this->_setWaitTimeout($minWaitTimeout);\n $this->assertEquals($minWaitTimeout, $this->_getWaitTimeout(), 'Wait timeout was not changed');\n\n // Sleep for time greater than wait_timeout and try to perform query\n sleep($minWaitTimeout + 1);\n $result = $this->_executeQuery('SELECT 1');\n $this->assertInstanceOf('Magento\\Framework\\DB\\Statement\\Pdo\\Mysql', $result);\n // Restore wait_timeout\n $this->_setWaitTimeout($defaultWaitTimeout);\n $this->assertEquals(\n $defaultWaitTimeout,\n $this->_getWaitTimeout(),\n 'Default wait timeout was not restored'\n );\n } catch (\\Exception $e) {\n // Reset connection on failure to restore global variables\n $this->_getConnection()->closeConnection();\n throw $e;\n }\n }", "public function test_admin_end_match()\n {\n $this->assertTrue($this->btwServer->adminEndMatch());\n\n sleep(30);\n }", "public function testHandle0()\n{\n\n $actual = $this->retryCommand->handle();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function test_false_timeout_dont_delete() {\n\t\t// Create a bogus a temporary.\n\t\t$key = rand_str();\n\t\t$value = rand_str();\n\n\t\tWP_Temporary::set_site( $key, $value, 60 * 10 );\n\t\t$this->assertEquals( $value, WP_Temporary::get_site( $key ) );\n\n\t\t// Useful variables for tracking.\n\t\t$temporary_timeout = '_site_temporary_timeout_' . $key;\n\n\t\t// Mock an action for tracking action calls.\n\t\t$a = new MockAction();\n\n\t\t// Make sure the timeout option returns false.\n\t\tadd_filter( 'site_option_' . $temporary_timeout, '__return_false' );\n\n\t\t// Add some actions to make sure options are _not_ deleted.\n\t\tadd_action( 'delete_site_option', array( $a, 'action' ) );\n\n\t\t// Act.\n\t\t$status = WP_Temporary::get_site( $key );\n\t\t$this->assertEquals( $value, $status );\n\n\t\t// Make sure delete option was not called for both the temporary and the timeout.\n\t\t$this->assertEquals( 0, $a->get_call_count() );\n\t}", "public function testPollTimeOut() {\n $c = new _MockProviderCronRunner(50, 0.0001);\n $provider = $this->createMock(ProviderInterface::class);\n $polling = $this->createMock(PollingInterface::class);\n $provider->method('polling')->willReturn($polling);\n $polling->expects($this->once())->method('poll')->will($this->returnCallback(function () {\n usleep(101);\n return TRUE;\n }));\n $c->providers = [$provider];\n $start = microtime(TRUE);\n $c->poll();\n $this->assertLessThan(1, microtime(TRUE) - $start);\n }", "public function testGetStart() {\n // It should return an int\n $this->assertGreaterThan( 0, $this->timer->get_start() );\n }", "public function testGetTimelogsForTask()\n {\n\n }", "public function testAssertTTL() {\n\n\t\t\t$lockName = uniqid();\n\n\t\t\tSharedLock::lock($lockName, 0, 10);\n\n\t\t\tSharedLock::assertTTL($lockName, 5);\n\t\t}", "public function testUnlimitedExecutionTime()\n {\n $response = $this->http->send(\n new Request('GET', '/visit-counter.php?with_no_time_limit')\n );\n\n $this->assertSame('1', (string) $response->getBody());\n $this->assertCreatedNewSession($response);\n $this->assertSame(1, $this->redis->dbSize());\n }", "public function testStart() {\n $timer = new timer( false );\n\n // It should return a starting number\n $this->assertGreaterThan( 0, $timer->start() );\n\t}", "public function testGetElapsed() {\n // Stop the timer\n $this->timer->stop();\n\n // It should return an int\n $this->assertEquals( $this->timer->get_elapsed(), $this->timer->get_stop() - $this->timer->get_start() );\n }", "private function _stepTimeout():void\n\t{\n\t\tif( $this->_timeout_queue[0]['call_at'] <= microtime( true ) )\n\t\t{\n\t\t\t[ 'task'=>$task, ]= array_shift( $this->_timeout_queue );\n\t\t\t\n\t\t\t$this->_runTask( $task );\n\t\t}\n\t\telse\n\t\t\tusleep( 1000 );\n\t}", "public function testCanExecuteSqlQueryRepeatedlyUntilItSucceeds()\n\t {\n\t\t$this->assertInstanceOf(\"\\Logics\\Foundation\\SQL\\MySQLresult\", $this->object->execUntilSuccessful(\"SELECT * FROM MySQLdatabase\"));\n\n\t\tset_error_handler(array($this, \"errorHandler\"));\n\t\tpcntl_signal(SIGALRM, array($this, \"timeoutCallback\"), true);\n\n\t\tpcntl_alarm(540);\n\n\t\ttry\n\t\t {\n\t\t\t$this->object->execUntilSuccessful(\"SELECT * FROM nonexistenttable\");\n\t\t }\n\t\tcatch (Exception $e)\n\t\t {\n\t\t\t$this->assertEquals(true, (($e->getMessage() === \"Timeout\") && strpos($GLOBALS[\"errstr\"], \"Stuck executing SQL\") !== false));\n\t\t }\n\n\t\tpcntl_alarm(5);\n\n\t\ttry\n\t\t {\n\t\t\t$this->assertFalse($this->object->execUntilSuccessful(\"SELECT * FROM nonexistenttable\", array(1146)));\n\t\t\tpcntl_alarm(0);\n\t\t }\n\t\tcatch (Exception $e)\n\t\t {\n\t\t\t$this->assertEquals(false, ($e->getMessage() === \"Timeout\"));\n\t\t }\n\n\t\trestore_error_handler();\n\n\t\t$blob = \"blob\";\n\t\t$this->assertEquals(true, $this->object->execBinaryBlobUntilSuccessful(\"INSERT INTO MySQLdatabase SET testblob = ?\", $blob));\n\t }" ]
[ "0.71282625", "0.71238416", "0.69717467", "0.68601376", "0.67325175", "0.64936215", "0.64759433", "0.6422904", "0.63027275", "0.6194057", "0.61938256", "0.6117025", "0.6117025", "0.6117025", "0.6117025", "0.610324", "0.6085429", "0.60808164", "0.60482436", "0.6030745", "0.60302824", "0.60302085", "0.6006642", "0.5987867", "0.5977999", "0.5952587", "0.5927613", "0.59237057", "0.5919526", "0.58729225" ]
0.73165244
0
Returns template for operator.
public function getOperatorTemplateName(string $operator = '') { return 'ConditionBuilder/Picklist.tpl'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOperatorTemplateName(string $operator = '')\n\t{\n\t\tif ('bw' === $operator) {\n\t\t\treturn 'ConditionBuilder/DateTimeRange.tpl';\n\t\t}\n\t\treturn 'ConditionBuilder/Date.tpl';\n\t}", "abstract public function get_operator();", "public function __toString()\n {\n return 'operator('\n . (null === $this->p_catalog ? '' : (string)$this->p_catalog . '.')\n . (null === $this->p_schema ? '' : (string)$this->p_schema . '.')\n . (string)$this->p_operator . ')';\n }", "public function getOperator();", "public function getOperator();", "protected abstract function getOperator();", "public function getOperator(): string;", "public function getOperator(): string;", "public function getOperator(): string\n {\n return $this->operator;\n }", "public function getOperators()\n\t{\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\t'!' => array('precedence' => 50, 'class' => 'Twig_Node_Expression_Unary_Not'),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t// precedence settings are copied from similar operators in Twig core extension\n\t\t\t\t'||' => array('precedence' => 10, 'class' => 'Twig_Node_Expression_Binary_Or', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\t\t\t\t'&&' => array('precedence' => 15, 'class' => 'Twig_Node_Expression_Binary_And', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\n\t\t\t\t'eq' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Equal', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\n\t\t\t\t'ne' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\t\t\t\t'neq' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\t\t\t\t'<>' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\n\t\t\t\t'===' => array('precedence' => 20, 'class' => '\\phpbb\\template\\twig\\node\\expression\\binary\\equalequal', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\t\t\t\t'!==' => array('precedence' => 20, 'class' => '\\phpbb\\template\\twig\\node\\expression\\binary\\notequalequal', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\n\t\t\t\t'gt' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Greater', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\t\t\t\t'gte' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_GreaterEqual', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\t\t\t\t'ge' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_GreaterEqual', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\t\t\t\t'lt' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Less', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\t\t\t\t'lte' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_LessEqual', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\t\t\t\t'le' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_LessEqual', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\n\t\t\t\t'mod' => array('precedence' => 60, 'class' => 'Twig_Node_Expression_Binary_Mod', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\t\t\t),\n\t\t);\n\t}", "function operators() {\n $operators = array(\n '<' => array(\n 'title' => t('Is less than'),\n 'method' => 'op_simple',\n 'short' => t('<'),\n 'values' => 1,\n ),\n '<=' => array(\n 'title' => t('Is less than or equal to'),\n 'method' => 'op_simple',\n 'short' => t('<='),\n 'values' => 1,\n ),\n '=' => array(\n 'title' => t('Is equal to'),\n 'method' => 'op_simple',\n 'short' => t('='),\n 'values' => 1,\n ),\n '!=' => array(\n 'title' => t('Is not equal to'),\n 'method' => 'op_simple',\n 'short' => t('!='),\n 'values' => 1,\n ),\n '>=' => array(\n 'title' => t('Is greater than or equal to'),\n 'method' => 'op_simple',\n 'short' => t('>='),\n 'values' => 1,\n ),\n '>' => array(\n 'title' => t('Is greater than'),\n 'method' => 'op_simple',\n 'short' => t('>'),\n 'values' => 1,\n ),\n 'between' => array(\n 'title' => t('Is between'),\n 'method' => 'op_between',\n 'short' => t('between'),\n 'values' => 2,\n ),\n 'contains' => array(\n 'title' => t('Contains'),\n 'short' => t('contains'),\n 'method' => 'op_contains',\n 'values' => 1,\n ),\n 'starts' => array(\n 'title' => t('Starts with'),\n 'short' => t('begins'),\n 'method' => 'op_starts',\n 'values' => 1,\n ),\n );\n\n return $operators;\n }", "abstract function getOperator() : string ;", "public function getOperator()\n {\n return $this->operator;\n }", "public function getOperator()\n {\n return $this->operator;\n }", "public function getOperator()\n {\n return $this->operator;\n }", "public function getOperator()\n {\n return $this->operator;\n }", "public function getOperator()\n {\n return $this->operator;\n }", "public function getOperator()\n {\n return $this->operator;\n }", "function corrConditionOperatorToString($operator) {\n\t$operators = [\n\t\tCONDITION_OPERATOR_EQUAL => '=',\n\t\tCONDITION_OPERATOR_NOT_EQUAL => '<>',\n\t\tCONDITION_OPERATOR_LIKE => _('like'),\n\t\tCONDITION_OPERATOR_NOT_LIKE => _('not like')\n\t];\n\n\treturn $operators[$operator];\n}", "public function getOperator()\n {//-------------------->> getOperator()\n return $this->_operator;\n }", "private function _get_operator($arg) {\n\t\tif (isset($this->operators[$arg])) {\n\t\t\treturn $this->operators[$arg];\n\t\t}\n\t\t// Override due to conceede to WP habit\n\t\tif ('post_mime_type' == $arg) {\n\t\t\treturn 'starts_with';\n\t\t}\n\t\telse {\n\t\t\treturn '=';\n\t\t}\n\t}", "public function getOperatorValue();", "public function getOperators()\n {\n return array(\n array(\n 'not' => array('precedence' => 50, 'class' => 'Twig_Node_Expression_Unary_Not'),\n '-' => array('precedence' => 500, 'class' => 'Twig_Node_Expression_Unary_Neg'),\n '+' => array('precedence' => 500, 'class' => 'Twig_Node_Expression_Unary_Pos'),\n ),\n array(\n 'or' => array('precedence' => 10, 'class' => 'Twig_Node_Expression_Binary_Or', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n 'and' => array('precedence' => 15, 'class' => 'Twig_Node_Expression_Binary_And', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n 'b-or' => array('precedence' => 16, 'class' => 'Twig_Node_Expression_Binary_BitwiseOr', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n 'b-xor' => array('precedence' => 17, 'class' => 'Twig_Node_Expression_Binary_BitwiseXor', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n 'b-and' => array('precedence' => 18, 'class' => 'Twig_Node_Expression_Binary_BitwiseAnd', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '==' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Equal', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '!=' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '<' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Less', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '>' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Greater', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '>=' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_GreaterEqual', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '<=' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_LessEqual', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n 'not in' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotIn', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n 'in' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_In', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '..' => array('precedence' => 25, 'class' => 'Twig_Node_Expression_Binary_Range', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '+' => array('precedence' => 30, 'class' => 'Twig_Node_Expression_Binary_Add', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '-' => array('precedence' => 30, 'class' => 'Twig_Node_Expression_Binary_Sub', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '~' => array('precedence' => 40, 'class' => 'Twig_Node_Expression_Binary_Concat', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '*' => array('precedence' => 60, 'class' => 'Twig_Node_Expression_Binary_Mul', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '/' => array('precedence' => 60, 'class' => 'Twig_Node_Expression_Binary_Div', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '//' => array('precedence' => 60, 'class' => 'Twig_Node_Expression_Binary_FloorDiv', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '%' => array('precedence' => 60, 'class' => 'Twig_Node_Expression_Binary_Mod', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n 'is' => array('precedence' => 100, 'callable' => array($this, 'parseTestExpression'), 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n 'is not' => array('precedence' => 100, 'callable' => array($this, 'parseNotTestExpression'), 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '**' => array('precedence' => 200, 'class' => 'Twig_Node_Expression_Binary_Power', 'associativity' => Twig_ExpressionParser::OPERATOR_RIGHT),\n ),\n );\n }", "public function getOperator()\n\t{\n\t\treturn $this->operator;\n\t}", "function getOperator(): string\n {\n return \"w\";\n }", "public function operators();", "public function getSqlOperator($operator)\n {\n switch ($operator) {\n case '==':\n return '=';\n case '!=':\n return '<>';\n case '{}':\n return 'LIKE';\n case '!{}':\n return 'NOT LIKE';\n case 'between':\n return 'BETWEEN %s AND %s';\n case '>':\n case '<':\n case '>=':\n case '<=':\n return $operator;\n default:\n throw new \\Magento\\Framework\\Exception\\LocalizedException(__('Unknown operator specified.'));\n break;\n }\n }", "public function getOperator(): string {\n\t\tswitch($this->rndOperator) {\n\t\t\tcase self::PLUS:\n\t\t\t\treturn Config::ANTI_SPAM_USE_MATH_SYMBOLS ? '+' : Language::out()->getPlusName();\n\t\t\tcase self::MINUS:\n\t\t\t\treturn Config::ANTI_SPAM_USE_MATH_SYMBOLS ? '-' : Language::out()->getMinusName();\n\t\t\tcase self::MULTIPLE:\n\t\t\tdefault:\n\t\t\t\treturn Config::ANTI_SPAM_USE_MATH_SYMBOLS ? '*' : Language::out()->getMultiplyWithName();\n\t\t}\n\t}", "function getOperator(): string\n {\n return \"Tw\";\n }", "public function getOperator($operator)\n {\n if ($operator === 'LIKE' || $operator === 'ILIKE') {\n return 'LIKE';\n }\n\n return '';\n }" ]
[ "0.7345979", "0.64844066", "0.63174295", "0.6312468", "0.6312468", "0.63075596", "0.62559026", "0.62559026", "0.621824", "0.6126225", "0.61262196", "0.6104961", "0.60226893", "0.60226893", "0.60226893", "0.60226893", "0.60226893", "0.60226893", "0.6015157", "0.60029745", "0.5980182", "0.59635967", "0.5938251", "0.5925055", "0.5863306", "0.58477277", "0.5826059", "0.57982296", "0.57281655", "0.5713171" ]
0.7124945
1
Return json array containing auth URL.
public function authUrlJson(Request $request) { return response()->json(['status' => 'success', 'url' => $this->generateAuthUrl($request)]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAuthUrl();", "abstract public function getAuthUrlComponents();", "public function get_auth_url()\r\n\t{\r\n\t\treturn PicasaAPI::$QUERY_URLS['auth'];\r\n\t}", "public function getAuthUrl()\n {\n return $this->authUrl;\n }", "public function getAuthUrl()\n {\n return $this->authUrl;\n }", "public function getAuthUrl()\n {\n return $this->client->createAuthUrl();\n }", "public function get_auth_url()\n\t{\n\t\treturn $this->auth_url.'?oauth_token='.$this->get_request_token();\n\t}", "public function getAuthUrl()\n\t{\n\t\treturn $this->createAuthUrl();\n\t}", "public function getAuthInfoArray() {}", "private function getAuthURL() : string {\n $payload = [\n \"client_id\" => $this->client_data->getClientId(),\n \"scope\" => $this->scope->toString(),\n ];\n\n if ($this->with_redirect) {\n $redirect = $this->client_data->getRedirectUri(1);\n $payload['response_type'] = self::RESPONSE_TYPE_TOKEN;\n } else {\n $redirect = $this->client_data->getRedirectUri(0);\n $payload['response_type'] = self::RESPONSE_TYPE_CODE;\n }\n\n $payload[\"redirect_uri\"] = (empty($this->redirect_params)) ?\n $redirect : $redirect.'?'.http_build_query($this->redirect_params);\n return $this->client_data->getAuthURI(). '?'. http_build_query($payload);\n }", "public function getAuthURL() {\n\t\treturn $this->authorization_url.\"?response_type=code&client_id=\".$this->clientID.\"&state=\".$this->state.\"&scope=\".$this->scope;\n\t}", "public function getAuthUrl()\n\t{\n\t\t$tokenData = $this->getRequestToken();\n\t\treturn rtrim($this->_authoriseUrl,'/').'?'.$tokenData;\n\t}", "public function getAuthUrl()\n {\n $return = $this->baseUrl .\n '/' . $this->authNamespace .\n '/' . $this->authVersion .\n '/token?url=' . $this->baseUrl . '/' . $this->apiNamespace;\n\n return $return;\n }", "abstract protected function auth_url();", "abstract public function getAuthUri(): string;", "protected function _getAuthUrl()\n {\n\t\t$url = CS_REST_General::authorize_url(\n\t\t\t$this->_getClientId(),\n\t\t\t$this->_getAuthRedirectUri(),\n\t\t\t'ImportSubscribers,ManageLists'\n\t\t);\n\t\t\n return $url;\n }", "public function getAuthDataFromResponse(): array;", "public function getAuthInfo() {\n return [\n 'host' => [\n 'account_num' => 9999999999,\n ],\n ];\n }", "public function getAuthAsString();", "public function getAuth();", "public function getAuth();", "public function urlAuthorize() {\n return $this->host . '/oauth/authorize';\n }", "public function getLoginUrl() {\n return $this->client->createAuthUrl();\n }", "public function prepareAuthParams()\n {\n return [\n 'auth_url' => 'https://accounts.google.com/o/oauth2/v2/auth',\n 'auth_params' => [\n 'client_id' => $this->appId,\n 'redirect_uri' => $this->redirectUri,\n 'response_type' => 'code',\n 'scope' => 'https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile'\n ]\n ];\n }", "function echoURL($dest,$authV){\n\t\techo json_encode($arr = array('url'=>$dest, 'auth' => $authV));\n\t}", "public function authorize()\n {\n return $this->json();\n }", "public function getUserAuthorizationUrl()\n {\n return $this->getAuthorizeUrl();\n }", "public function authenticationURL()\n {\n $clientId = config('twitch-api.client_id');\n $scopes = implode('+', config('twitch-api.scopes'));\n $redirectURL = config('twitch-api.redirect_url');\n return config('twitch-api.api_url') . '/kraken/oauth2/authorize?api_version=5&response_type=code&client_id=' . $clientId . '&redirect_uri=' . $redirectURL . '&scope=' . $scopes;\n }", "public function getAuthorizationURL()\n {\n return $this->get('AuthorizationURL');\n }", "public function checkAuth()\n\t{\t\t\n\t\t$url = \"http://{$this->wnServer}/webnative/portalDI\";\n\t\t$authinfo = json_decode($this->curlObj->fetch_url($url),true);\n\t\treturn $authinfo;\n\t}" ]
[ "0.7433394", "0.70290685", "0.69467485", "0.688772", "0.688772", "0.68653536", "0.68499607", "0.6722567", "0.66622895", "0.6520634", "0.64875394", "0.6457607", "0.6405803", "0.64028656", "0.6402268", "0.63674796", "0.63165677", "0.63046795", "0.6274431", "0.6237892", "0.6237892", "0.62333983", "0.6210919", "0.6135131", "0.61111647", "0.61097884", "0.6070969", "0.60634047", "0.60434437", "0.60289425" ]
0.7116237
1
Description: Create input text tag
public static function inputText($model,$attribute,$properties=array()) { // $attr = self::getNameValueID($model, $attribute); // $input_attributes = self::getInputAttributes($attr,$properties); // return '<input type="text" ' . $input_attributes . ' />'; return self::inputTag('text', $model, $attribute,$properties); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function text_field_tag($name, $value, array $attributes = array())\r\n{\r\n array_add($attributes, array(\r\n 'id' => $name,\r\n 'name' => $name,\r\n 'type' => 'text',\r\n 'value' => $value\r\n ));\r\n return tag('input', $attributes);\r\n}", "public function input($text,$name,$type){\r\n\t\treturn $this->surround('<input type=\"text\" name=\"'.$name.'\" > ');\r\n\r\n\t}", "public function render() : string\r\n {\r\n return '<input type=\"text\" />';\r\n }", "function acf_text_input($attrs = array())\n{\n}", "function text( \n\t $name, $title = null, $value = null, \n\t $required = false, \n\t $attributes = null\n\t){\n return $this->input(\n\t $name,\n\t Form::TYPE_TEXT,\n\t $title, \n\t $value, \n\t $required, \n\t $attributes,\n\t null,\n\t Form::DATA_STRING\n );\n\t}", "public static function textField($name,$value='',$option=array()) {\n\t\t$option['name']=$name;\n\t\t$option['type']='text';\n\t\t$option['value']=$value;\n\t\treturn self::htmltag('input',$option);\n\t}", "public function input(){\n\t\treturn '<input '.\n\t\t\t\t\t'type=\"'. $this->tipo .'\" '.\n\t\t\t\t\t'id=\"'. $this->name .'\" '.\n\t\t\t\t\t'name=\"'. $this->name .'\" '.\n\t\t\t\t\t'class=\"form-control\" '.\n\t\t\t\t\t'value=\"'.( isset($_POST[$this->name]) ? $_POST[$this->name] : '').'\"'.\n\t\t\t\t'/>';\n\t}", "public function create_textfield( $args=array() ) {\n $settings = get_option( 'bii_instagram' );\n $classes = ( isset( $args['code'] ) && $args['code'] ? 'regular-text code' : '' );\n $type = ( isset( $args['type'] ) && $args['type'] ? $args['type'] : 'text' );\n $default = ( isset( $args['default'] ) ? $args['default'] : '' );\n printf( '<input name=\"bii_instagram[%s]\" type=\"%s\" value=\"%s\" class=\"%s\" />', $args['name'], $type, ( isset( $settings[ $args['name'] ] ) ? $settings[ $args['name'] ] : $default ), $classes );\n }", "public static function input($type='text', $name='', $value='', $attributes='') {\n\t\t\t$output = '<input';\n\t\t\t$output .= HtmlHelper::_attributes_to_string(array(\n\t\t\t\t'type' => $type,\n\t\t\t\t'name' => $name,\n\t\t\t\t'value' => $value\n\t\t\t));\n\t\t\t$output .= HtmlHelper::_attributes_to_string($attributes);\n\t\t\t$output .= ' />';\n\t\t\treturn $output;\n\t\t}", "function acf_get_text_input($attrs = array())\n{\n}", "static public function input($name, $value = \"\", $attrib = \"\")\n {\n return \"<input type='text' name='$name' id='$name' value='$value' $attrib />\\n\";\n }", "function input_text($element_name, $values) {\r\n print '<input type=\"text\" name=\"'.$element_name.'\"id=\"'.$element_name.'\" value=\"';\r\n print html_entity_decode($values, ENT_NOQUOTES) . '\" style=\"width:600px\">';\r\n}", "public function inputTag($name = NULL, $value = NULL, $options = NULL)\n {\n return '<input type=\"text\" name=\"' . $name . '\" value=\"' . $value . '\" ' . $this->options2str($options) . '/>';\n }", "function textField($label, $name, $value){\n\n $field = '<input type=\"text\"'; \n $field .= 'name=\"';\n $field .= $name;\n $field .= '\" value=\"';\n $field .= $value;\n $field .= '\">';\n \n echo ucwords($label) . \"&nbsp\" . $field .\"<br>\"; \n\n}", "protected function input()\n {\n return '<input type=\"' . $this->property->input_type . '\" placeholder=\"Значение\" ' .\n 'name=\"property[' . $this->property->id . ']\" class=\"form-control\">';\n }", "protected function getInput()\n { \n $file = $this->get(\"file\", false);\n $text = $this->get(\"text\", false);\n $label = $this->get(\"label\", false);\n\n if (!$label)\n {\n $html[] = '</div><div class=\"freetext '.$this->get(\"class\").'\">';\n }\n\n if ($file)\n {\n $html[] = $this->renderContent($this->get(\"file\"), $this->get(\"path\"), $this); \n }\n\n if ($text)\n {\n $html[] = $this->prepareText($text);\n }\n\n return implode(\" \", $html);\n }", "public function testCreateInput()\n {\n $input = Tag::create('input');\n $this->assertEquals(trim((string) $input), '<input/>');\n $this->assertEquals(trim($input->__toString()), '<input/>');\n $this->assertEquals(trim($input->getHtml()), '<input/>');\n\n $input = Tag::create('input', ['value' => 'test']);\n $this->assertEquals(trim((string) $input), '<input value=\"test\"/>');\n\n $input->set('value', 'test1');\n $this->assertEquals(trim((string) $input), '<input value=\"test1\"/>');\n\n $input = Tag::input();\n $this->assertEquals(trim((string) $input), '<input/>');\n $this->assertEquals(trim($input->__toString()), '<input/>');\n $this->assertEquals(trim($input->getHtml()), '<input/>');\n\n $input = Tag::input(['value' => 'test']);\n $this->assertEquals(trim((string) $input), '<input value=\"test\"/>');\n\n $input = Tag::input(['class' => 'input'], 'test');\n $this->assertEquals(trim((string) $input), '<input class=\"input\"/>');\n }", "function text($args) {\r\n\t\t\t$args = $this->apply_name_fix($this->apply_default_args($args)) ;\r\n\t\t\techo \"<input type='text' size='57' style='\" . $this->width($args['width']) . \"' \" . $this->placeholder($args['placeholder']) . \" name='\" . $args['formname'] . \"' value='\" . $args['value'] . \"'/>\";\t\t\t\t\t\r\n\t\t\t$this->description($args['description']);\r\n\t\t}", "private static function inputTag($type,$model,$attribute,$properties=array()) {\n $attr = self::getNameValueID($model, $attribute);\n $input_attributes = self::getInputAttributes($attr,$properties);\n return '<input type=\"'.$type.'\" ' . $input_attributes . ' />';\n }", "function render_text() {\n\t\t?><input type=\"text\" id=\"<?php echo $this->slug ?>\" name=\"<?php echo $this->settings_page ?>[<?php echo $this->slug ?>]\" value=\"<?php echo $this->value ?>\" ><?php\n\t}", "public static function text($input=array()){\n $html = null; \n $input_res = null; \n \n $end_length = end(self::$length);\n \n if( is_array($input)){\n if( count( $input)>=1){\n\n foreach($input as $input_key => $input_var ){\n $key_value = $input[$input_key]; \n if( !empty($input[$input_key])) $input_res .= $input_key.\"='\".($key_value) . \"' \";\n }\n\n $html .= \"<input type='text' \".__( $input_res ). \" />\";\n \n }\n }\n \n return $html;\n \n }", "static function createInput($input, $name) {\n include $_SERVER[\"DOCUMENT_ROOT\"] . \"/mvdv/core/view/templates/general/form/formelements/input.php\";\n }", "function draw_input($s_type, $s_name_prefix, $s_name, $wt_default_value) {\n\tif ($s_type == 'textbox') {\n\t\t\treturn '<input type=\\'textbox\\' size=\\'20\\' name=\\''.$s_name_prefix.$s_name.'\\' value=\\''.$wt_default_value.'\\' />';\n\t} else if ($s_type == 'checkbox') {\n\t\t\treturn '<input type=\\'checkbox\\' name=\\''.$s_name_prefix.$s_name.'\\' '.($wt_default_value ? 'CHECKED' : '').'/>';\n\t}\n}", "public function ov_text($name, $value = ''){\n $args = func_get_args(); array_shift($args); array_shift($args);\n return $this->generate_input('text', $name, $value, true, $args);\n }", "function text()\n {\n ?>\n <input type=\"text\" <?php $this->name_tag(); ?> value=\"<?php echo esc_attr( $this->setting_value ); ?>\" class=\"inferno-setting\" <?php $this->id_tag(\"inferno-concrete-setting-\"); ?> />\n <?php \n if($this->setting['type'] == 'range') {\n $this->range();\n }\n }", "protected function createInputText($config)\n {\n $tmpl = $this->getOptionalTemplate(\n $config,\n ARCH_PATH.'/theme/form/input/text.php'\n );\n \n $config['name'] = $this->getDefaultName($config);\n \n if (!isset($config['value'])) {\n $config['value'] = '';\n if (\n isset($config['property']) \n && isset($this->record[$config['property']])\n ) {\n $config['value'] = $this->record[$config['property']];\n }\n }\n return new \\Arch\\Registry\\View($tmpl, $config);\n }", "function create_input_text($name,$value,$option = array())\n{\n $name = func_get_arg(0);\n $value = func_get_arg(1);\n $option = func_get_arg(2);\n if(!empty($option)){\n $id = $option['id'];\n $class = $option['class'];\n }\n\n $input_html = \"<input type='text' name='{$name}' value = '{$value}' id='{$id}' class='{$class}'>\";\n echo $input_html;\n}", "public function element( ) : \\DOMElement\n {\n $item = $this->createElement( 'textInput' );\n\n $this->addTitleElement( $item );\n\n $this->addDescriptionElement( $item );\n\n $this->addLinkElement( $item );\n\n if ( $this->name ) {\n $item->appendChild( $this->createElement( 'name', $this->name ) );\n }\n\n $this->addDublinCoreTags( $item );\n\n return $item;\n }", "function formInput2($width, $name, $size = 25, $type = 'txt', $attribs = '', $text = ''){\n\t\t$text = $text === '' ? $name : $text;\n\t\treturn $this->formInputField($type, $name, (g_l('weClass', '[' . $text . ']', true) != false ? g_l('weClass', '[' . $text . ']') : $text), $size, $width, '', $attribs);\n\t}", "public function __construct($_inputType = self::TEXT)\r\n\t{\r\n\t\tif(is_string($_inputType) && defined(HtmlTagInput::__className() . '::' . strtoupper($_inputType)))\r\n\t\t{\r\n\t\t\tparent::__construct(HtmlTagInput::__tagName());\r\n\t\t\t$this->setType($_inputType);\r\n\t\t}\r\n\t}" ]
[ "0.7588824", "0.7252613", "0.6989172", "0.6860051", "0.6799675", "0.67990595", "0.6778485", "0.6730297", "0.67080694", "0.6706332", "0.66784775", "0.6614974", "0.6590897", "0.6585585", "0.6561726", "0.65484965", "0.65215015", "0.65103036", "0.650378", "0.6492591", "0.64729834", "0.6453913", "0.64454377", "0.64254963", "0.6413184", "0.63973814", "0.63926166", "0.6381782", "0.63777757", "0.6345927" ]
0.74408895
1
Description: Create input password tag
public static function inputPassword($model,$attribute,$properties=array()) { // $attr = self::getNameValueID($model, $attribute); // $input_attributes = self::getInputAttributes($attr,$properties); // return '<input type="password" ' . $input_attributes . ' />'; return self::inputTag('password', $model, $attribute,$properties); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function password( \n\t $name, $title = null, $value = null, \n\t $required = false, \n\t $attributes = null\n\t){\n return $this->input(\n\t $name, \n\t Form::TYPE_PASSWORD,\n\t $title, \n\t $value, \n\t $required, \n\t $attributes,\n\t null,\n\t Form::DATA_STRING\n );\n\t}", "static public function password($name, $value = \"\", $attrib = \"\")\n {\n return \"<input type='password' name='$name' id='$name' value='$value' $attrib />\\n\";\n }", "function zen_draw_password_field($name, $value = '', $parameters = 'maxlength=\"40\"') {\n return zen_draw_input_field($name, $value, $parameters, 'password', true);\n }", "public static function Password($attr,$content)\n {\n return '<?php MyForms::password(\"'.$content.'\"); ?>';\n }", "function format_password($p_id, $p_name, $p_class = 'input-xs', $p_style = '', $p_prop = ''){\n\treturn '<input type=\"password\" id=\"' . $p_id . '\" name=\"' . $p_name . '\" class=\"' . $p_class . '\" style=\"' . $p_style . '\" ' . $p_prop . '/>';\n}", "function initialize () {\n $this->set_openingtag ( \"<LABEL>\" );\n\t$this->set_closingtag ( \"</LABEL><INPUT TYPE=\\\"password\\\"[attributes]>\" );\n\t$this->set_type (\"password\");\n }", "private function password()\n {\n $element = new Password('password');\n $element->setLabel('Password');\n $element->setAttribute('class', 'form-control');\n $element->setAttribute('placeholder', 'Password');\n $element->addValidators(array(\n new PresenceOf(array('message' => 'Password is required'))\n ));\n $this->add($element);\n }", "public function password($text){\n\t\t$text['label'] = isset($text['label']) ? $text['label'] : 'Enter Text Here: ';\n\t\t$text['value'] = isset($text['value']) ? $text['value'] : '';\n\t\t$text['name'] = isset($text['name']) ? $text['name'] : '';\n\t\t$text['class'] = isset($text['class']) ? 'input_text '.trim($text['class']) : 'input_text';\n $text['onlyField'] = isset($text['onlyField']) ? $text['onlyField'] : false;\n $text['extraAtt'] = isset($text['extraAtt']) ? $text['extraAtt'] : '';\n\t\tif($text[\"onlyField\"]==true){\n return '<input type=\"password\" class=\"'.$text['class'].'\" name=\"'.$text['name'].'\" id=\"'.$text['name'].'\" value=\"'.$text['value'].'\" '.$text['extraAtt'].' />';\n }\n else{\n return '<div class=\"flclear clearfix\"></div>\n\t\t\t\t<label for=\"'.$text['name'].'\">'.$text['label'].'&nbsp;</label>\n \t<input type=\"password\" class=\"'.$text['class'].'\" name=\"'.$text['name'].'\" id=\"'.$text['name'].'\" value=\"'.$text['value'].'\" '.$text['extraAtt'].' />';\n }\n\n\t}", "function form_password($name, $value=\"\", $size=\"30\", $array='', $override = NULL, $extra = '') {\n\n\t$value = html_form_escape($value, $override);\n\n\tif ($array) {\n\t\t$name = $array . \"[\" . $name . \"]\";\n\t}\n\treturn \"<input $extra onfocus=\\\"this.select()\\\" type=\\\"password\\\" id=\\\"$name\\\" name=\\\"$name\\\" value=\\\"$value\\\" size=\\\"$size\\\" />\";\n}", "public static function renderPassword();", "function INPUTpasse($champs,$valeur,$style,$taille)\n{\n html('<input type=\"password\" name=\"'.$champs.'\" size=\"'.$taille.'\"'\n .' maxlenght=\"40\" class=\"'.$style.'\" value=\"'.$valeur.'\">');\n}", "static function renderPasswordField($name, $value = null, $label = null, $attributes = null)\n {\n echo '<li>';\n\n if ($label) echo '<label>'.textH8($label).'</label>';\n\n if (!is_array($attributes)) $attributes = array();\n $attributes['type'] = 'password';\n $attributes['name'] = $name;\n $attributes['value'] = $value;\n\n self::renderSingleTag('input', $attributes);\n\n echo '</li>';\n }", "public static function password_field_tag($name, $value = null, $html_attributes = array())\n {\n return self::text_field_tag($name, $value, array_merge(array('type' => 'password'), $html_attributes));\n }", "function password_field($object, $field, $options = array()) {\n $form = new FormHelper($object, $field);\n return $form->to_input_field_tag(\"password\", $options);\n}", "public function callback_password( $args ) {\n\n $name_id = $args['name_id'];\n if ($args['parent']) {\n $value = $this->get_option( $args['parent']['id'], $args['section'], $args['std'], $args['global'] );\n $value = isset($value[$args['id']]) ? $value[$args['id']] : $args['std'];\n }else {\n $value = $this->get_option( $args['id'], $args['section'], $args['std'], $args['global'] );\n }\n $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';\n\n $html = sprintf( '<input type=\"password\" class=\"%1$s-text\" id=\"%2$s\" name=\"%2$s\" value=\"%3$s\"/>', $size, $name_id, $value );\n $html .= $this->get_field_description( $args );\n\n echo $html;\n }", "function input_password($errors, $name, $label, $pattern, $title) {\n //create div belonging to the class 'required_field'\n echo '<div class=\"required_field\">';\n //create the label for the input\n label($name, $label);\n //create the password field with attributes matching the parameters (value from previous post is filled in)\n echo \"<input type=\\\"password\\\" name=\\\"$name\\\" pattern=\\\"$pattern\\\"\".\n \" title=\\\"$title\\\" onkeypress=\\\"hide_error_message('$name')\\\" required>\";\n //create error message span\n error_label($errors, $name);\n //close the div\n echo '</div>';\n}", "public function password($name, $value = NULL, $attr = array())\n\t{\n\t\t$attr['type'] = 'password';\n\t\t\n\t\treturn $this->input($name, $value, $attr);\n\t}", "function jabHtmlPassword($label, $id, $value, $class=\"\", $name=\"\")\n{\n\tif ($name==\"\")\n\t\t$name=$id;\n\tif ($class!=\"\")\n\t\t$class=\" class=\\\"\".$class.\"\\\"\";\n\t$value=htmlspecialchars($value);\n\techo \"<label for=\\\"$name\\\">$label</label><input$class type=\\\"password\\\" id=\\\"$id\\\" name=\\\"$name\\\" value=\\\"$value\\\">\\n\";\n}", "public function smtp_password_field( $args ) {\n $field_id = $args['label_for'];\n $value = get_option( $field_id );\n\n printf( \"<input type='password' name=%s id=%s value=%s />\", $field_id, $field_id, $value );\n }", "protected function _password()\n {\n $element = new Zend_Form_Element_Text('password');\n $element->setLabel('Password')\n ->addDecorators($this->_inputDecorators)\n ->setRequired(true)\n ->addValidator(\n 'StringLength',\n false,\n array('min' => Users_Model_User::MIN_PASSWORD_LENGTH)\n );\n\n return $element;\n }", "public function password($name, $value = NULL, array $attributes = NULL) {\n $attributes = Appform::add_class($attributes, 'password');\n $this->load_values($name, $value, $attributes);\n $result = '<li>'.Kohana_Form::password($name, $value, $attributes);\n // add error span\n if (isset($this->errors[$name])) {\n $result .= '<span class=\"error\">'.ucfirst($this->errors[$name]).'</span>';\n } else if (isset($attributes['info'])) {\n // else add info span\n $result .= '<span class=\"info\">'.$attributes['info'].'</span>';\n }\n $result .= '</li>';\n return $result;\n\t}", "function _field_password($fval) \n {\n return sprintf(\"<input type=\\\"password\\\" name=\\\"%s\\\" id=\\\"%s\\\" value=\\\"%s\\\" size=\\\"%d\\\" maxlength=\\\"%d\\\" class=\\\"%s\\\" />\\n\",\n $this->fname,\n $this->fname,\n $this->_htmlentities($fval),\n $this->_get_field_size(),\n $this->attribs['maxlength'],\n (isset($this->attribs['class']))? $this->attribs['class'] : $this->element_class);\n }", "public function password($element) {\n $element['#type'] = 'password';\n $element = $this->_setRender($element);\n $element['_render']['element'] = '<input type=\"password\" id=\"'\n . $element['#id'] . '\" name=\"' . $element['#name'] . '\" value=\"';\n $element['_render']['element'] .= isset($element['#value']) ? $element['#value'] : '';\n $element['_render']['element'] .= '\"' . $element['_attributes_string'];\n if (isset($element['#disable']) && $element['#disable']) {\n $element['_render']['element'] .= ' disabled=\"disabled\"';\n }\n /**\n * type and data_id\n */\n $element['_render']['element'] .= sprintf(' data-wpt-type=\"%s\"', __FUNCTION__);\n $element['_render']['element'] .= $this->_getDataWptId($element);\n\n $element['_render']['element'] .= ' />';\n $pattern = $this->_getStatndardPatern($element);\n $output = $this->_pattern($pattern, $element);\n $output = $this->_wrapElement($element, $output);\n return $output . \"\\r\\n\";\n }", "function form_password($field, $options) {\n $defaults = array(\n 'wrap' => true,\n 'label' => true,\n 'class' => array('input', 'password')\n );\n\n $options = array_merge($defaults, $options);\n\n $field = strtolower($field);\n\n $output = '<input type=\"password\" name=\"' . $field . '\" id=\"' . form__field_id($field) . '\"';\n\n $output .= ' />';\n\n if($options['wrap']) {\n $options['field'] = $field;\n $output = form__wrap($output, $options);\n }\n\n $error = form_error_message($field);\n if(!empty($error)) {\n $output .= $error;\n }\n\n return html__output($output);\n}", "public static function option_neopress_password() {\n printf(\n '<input type=\"password\" id=\"neopress_password\" name=\"neopress_password\" value=\"%s\" />',\n get_option('neopress_password')\n );\n }", "public function olvidoPassword(){\n\t}", "protected function password($options) {\n $element = new Password('passwordTxt');\n $element->setLabel('Password');\n $element->setAttribute('class', 'form-control');\n if($options['action'] == 'create' || ($options['action'] != 'create' && $this->request->getPost('passwordTxt')))\n {\n $validators = array( new PresenceOf(array('message' => 'Password is required')) );\n if($this->request->isPost() && $this->request->getPost('passwordTxt')){\n $validators[] = new StringLength(array(\n \"min\" => 8,\n \"max\" => 16,\n \"messageMaximum\" => \"Password must not be greater than 16 characters\",\n \"messageMinimum\" => \"Password must be between 8-16 characters\",\n ));\n }\n $element->addValidators($validators);\n $element->setUserOption('lblRequired', true);\n }\n $this->add($element); \n }", "public function input2($champs){\n echo \"<div class='col-xs-12 col-sm-12 col-md-12 col-lg-12 form-row'>\n <input type='password' name='$champs' placeholder='$champs' class='form-control normal'>\n \n </div>\";\n }", "public static function createPassword($data = '', $value = '', $extra = '')\n {\n if (!is_array($data)) {\n $data = array('name' => $data);\n }\n\n $data['type'] = 'password';\n return self::createInput($data, $value, $extra);\n }", "protected function createInputPassword($config)\n {\n $view = '';\n if (!empty($config['property'])) {\n $tmpl = $this->getOptionalTemplate(\n $config,\n ARCH_PATH.'/theme/form/input/password.php'\n );\n \n $config['name'] = $this->getDefaultName($config);\n \n $view = new \\Arch\\Registry\\View($tmpl, $config);\n }\n return $view;\n }" ]
[ "0.7842511", "0.7687786", "0.7304307", "0.7254869", "0.723186", "0.72289205", "0.7223784", "0.7212298", "0.71788365", "0.7164544", "0.7159341", "0.7137082", "0.70442927", "0.70377576", "0.70061755", "0.6991065", "0.69774824", "0.69477814", "0.69361615", "0.69281596", "0.6899216", "0.68788356", "0.68268144", "0.6786872", "0.6714486", "0.66964144", "0.65744436", "0.6562119", "0.6546946", "0.65312093" ]
0.78613406
0
Returns user's dashboard ids
public static function getAllDashboards($user_id) { //get all dashboard objects $dashboards = Dashboard::select('id')->where('user_id', '=', $user_id)->get(); //get only the ids and return them $ids = false; if( !empty( $dashboards ) ) { $ids = array(); foreach ($dashboards as $dashboard) { $ids[] = $dashboard->id; } } return $ids; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function findAdministratorsIds($exclude_user = null) {\n $users_table = TABLE_PREFIX . 'users';\n if($exclude_user instanceof User) {\n return DB::executeFirstColumn(\"SELECT id FROM $users_table WHERE type = ? AND id != ? AND state = ?\", 'Administrator', $exclude_user->getId(), STATE_VISIBLE);\n } else {\n return DB::executeFirstColumn(\"SELECT id FROM $users_table WHERE type = ? AND state = ?\", 'Administrator', STATE_VISIBLE);\n } //if\n }", "protected function dashboards()\n {\n return [];\n }", "protected function dashboards()\n {\n return [];\n }", "public function getUserTenantIds()\n {\n if ( $this->user)\n {\n return $this->user->{$this->config->get('tenantable.tenant.plural', 'tenants')}->lists('id');\n }\n\n return null;\n }", "public function getAdminGuids(){\n\t\t$ia = elgg_get_ignore_access();\n\t\telgg_set_ignore_access(true);\n\n\t\t$user_guids = $this->getPrivateSetting(\"admin_guids\");\n\t\tif ($user_guids) {\n\t\t\t$user_guids = explode(\",\", $user_guids);\n\t\t\tif(!is_array($user_guids)){\n\t\t\t\t$user_guids = array($user_guids);\n\t\t\t}\n\t\t} else {\n\t\t\t$user_guids = array();\n\t\t}\n\n\t\t// restore security\n\t\telgg_set_ignore_access($ia);\n\n\t\treturn $user_guids;\n\t}", "private function _extractUserIds(): array {\n $userIds = [];\n\n $queryUserIds = 'SELECT userSettings.id, userSettings.mineVisibilityWorldMap FROM `userOverview` LEFT JOIN `userSettings` ON userOverview.id = userSettings.id WHERE userSettings.mineVisibilityWorldMap = 1';\n $getUserIds = $this->_conn->query($queryUserIds);\n\n if($getUserIds->num_rows > 0) {\n while($id = $getUserIds->fetch_assoc()) {\n $userIds[] = $id['id'];\n }\n }\n\n return $userIds;\n }", "public function getAccessibleUserIDs()\n {\n if (!WCF::getSession()->getPermission('user.profile.canViewUsersOnlineList')) {\n // user must have the permission to view the user online list\n return array();\n }\n\n $userIDs = array();\n\n foreach ($this->userIDs as $userID => $canViewOnlineStatus) {\n if ($canViewOnlineStatus === '0' ||\n $userID === WCF::getUser()->userID ||\n WCF::getSession()->getPermission('admin.user.canViewInvisible')\n ) {\n $userIDs[] = $userID;\n } elseif (WCF::getUser()->userID) {\n if ($canViewOnlineStatus === '1') {\n $userIDs[] = $userID;\n } elseif (UserProfileHandler::getInstance()->isFollowing($userID)) {\n $userIDs[] = $userID;\n }\n }\n }\n\n return $userIDs;\n }", "function getIds($user = null) {\n return DB::executeFirstColumn('SELECT user_id FROM ' . TABLE_PREFIX . 'project_users WHERE project_id = ?', $this->object->getId());\n }", "public function getDashboardGroups(): array;", "public static function getAdministrators()\n\t{\n\t\t$users = [];\n\t\tif (Main\\Loader::includeModule('bitrix24'))\n\t\t{\n\t\t\t$users = \\CBitrix24::getAllAdminId();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$res = \\CAllGroup::GetGroupUserEx(1);\n\t\t\twhile ($row = $res->fetch())\n\t\t\t{\n\t\t\t\t$users[] = (int)$row[\"USER_ID\"];\n\t\t\t}\n\t\t}\n\n\t\treturn $users;\n\t}", "private function get_siteadmins() {\n global $DB;\n $sql = \"SELECT rgt.userid, rgt.gmail\n FROM mdl_repository_gdrive_tokens rgt\n JOIN mdl_config cfg\n ON cfg.name = 'siteadmins'\n WHERE find_in_set(rgt.userid, cfg.value) > 0;\";\n $siteadmins = $DB->get_records_sql($sql);\n return $siteadmins;\n }", "public function getUserServisesIds() {\n\t\t$userid = $_SESSION[ 'uid' ];\n\n\t\tif( ! isset( $userid ) || ! is_numeric( $userid ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$sql = \"SELECT\n\t\t\t\t\th.id\n\t\t\t\tFROM\n\t\t\t\t\ttblhosting AS h\n\t\t\t\tLEFT JOIN\n\t\t\t\t\ttblproducts AS p ON h.packageid = p.id\n\t\t\t\tWHERE\n\t\t\t\t\th.userid = $userid AND\n\t\t\t\t\tp.servertype = 'onappcdn'\";\n\n\t\t$result = full_query( $sql );\n\n\t\tif( ! $result && mysql_num_rows( $result ) < 1 ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$servicesIds = array();\n\t\twhile( $row = mysql_fetch_assoc( $result ) ) {\n\t\t\t$servicesIds[ ] = $row[ 'id' ];\n\t\t}\n\n\t\treturn $servicesIds;\n\t}", "public function getIdsForUser($user_id, $client_id);", "function visibleUserIds() {\n if($this->visible_user_ids === false) {\n $this->visible_user_ids = Users::findVisibleUserIds($this);\n } // if\n return $this->visible_user_ids;\n }", "function scheduledreporting_component_get_reports($userid = 0)\n{\n $scheduled_reports = array();\n $temp = get_user_meta($userid, 'scheduled_reports');\n if ($temp != null)\n $scheduled_reports = mb_unserialize($temp);\n\n // Add user_id to reports\n if (empty($userid)) {\n $userid = $_SESSION['user_id'];\n }\n foreach ($scheduled_reports as $id => $report) {\n $scheduled_reports[$id]['user_id'] = $userid;\n }\n\n return $scheduled_reports;\n}", "public function dashboard()\n {\n $users = User::where('role_id', 1)->get();\n $admins = User::where('role_id', 2)->get();\n return view('pages.dashboard')->with(compact('users', 'admins'));\n }", "public static function getDashboardToDisplay()\n {\n $getData = Doctrine_Query::create()->from('Dashboard')->fetchOne(null, Doctrine::HYDRATE_ARRAY);\n return $getData;\n\n }", "function set_dashboard_columns() {\n\t// how many panels in dashboard\n\t$num = 2;\n\t$user_id = get_current_user_id();\n\tupdate_user_meta( $user_id, 'screen_layout_dashboard', $num );\n}", "function monitor_list_users() {\n $query = \"select distinct(`wf_user`) from `\".GALAXIA_TABLE_PREFIX.\"instance_activities`\";\n $result = $this->query($query);\n $ret = Array();\n while($res = $result->fetchRow()) {\n $ret[] = $res['wf_user'];\n }\n return $ret;\n }", "function getUserIds() {\n\t\t$charIds = $this->getCharIds();\n\t\t$idsToReturn = array();\n\t\tforeach ($charIds as $id) {\n\t\t\n\t\t\t$idsToReturn[] = getOneThing(\"playedby\", \"gamestate_characters\", \"id=$id and gameid=$this->gameId\");\n\t\t\n\t\t}\n\t\tdbug(\"getUserIds is about to return \".implode(\", \", $idsToReturn));\n\t\treturn $idsToReturn;\n\t}", "public function memberIdList()\n {\n return User::where('status', 1)->where('role_id', 2)->get();\n }", "public function loadDashboards($params)\r\n {\r\n $dbh = $this->ant->dbh;\r\n $ret = array();\r\n $numRecords = 500;\r\n $offset = 0;\r\n \r\n // Instantiate Dashboard Object\r\n $dashboardList = new CAntObjectList($dbh, \"dashboard\", $this->user);\r\n \r\n // Additional fields to query\r\n $dashboardList->addMinField(\"name\"); \r\n $dashboardList->addMinField(\"scope\"); \r\n \r\n // Add to get either system or user\r\n $dashboardList->addCondition(\"and\", \"app_dash\", \"is_equal\", \"\");\r\n $dashboardList->addCondition(\"and\", \"scope\", \"is_equal\", \"system\");\r\n $dashboardList->addCondition(\"or\", \"owner_id\", \"is_equal\", $this->user->id);\r\n \r\n $dashboardList->getObjects($offset, $numRecords);\r\n $num = $dashboardList->getNumObjects();\r\n $total = $dashboardList->getTotalNumObjects();\r\n \r\n for ($i = 0; $i < $num; $i++)\r\n { \r\n $obj = $dashboardList->getObject($i);\r\n \r\n // Gather Data\r\n\t\t\tif ($obj->dacl->checkAccess($this->user, \"View\", ($this->user->id==$obj->owner_id)?true:false))\r\n\t\t\t{\r\n\t\t\t\t$ret[] = array(\r\n\t\t\t\t\t\"id\" => $obj->id, \r\n\t\t\t\t\t\"name\" => $obj->getValue(\"name\"), \r\n\t\t\t\t\t\"scope\" => $obj->getValue(\"scope\"),\r\n\t\t\t\t\t\"uname\" => $obj->getValue(\"uname\"),\r\n\t\t\t\t);\r\n\t\t\t}\r\n \r\n $offset++; \r\n // If result set is larger than $numRecords\r\n if ($i == ($num-1) && $offset < $total)\r\n { \r\n $dashboardList->getObjects($offset, $numRecords); // Get next batch\r\n $num = $dashboardList->getNumObjects();\r\n $i = -1;\r\n }\r\n }\r\n \r\n $this->sendOutput($ret);\r\n return $ret;\r\n }", "function Let_the_admin_see_the_user_dashboard() {\n global $link;\n if (empty($_SESSION['is_admin']) || strtolower($_SESSION['is_admin']) != \"yes\" || empty($_REQUEST['id']) || $_REQUEST['id'] < 1) {\n return FALSE;\n }\n $user_id = mysqli_real_escape_string($link, $_REQUEST['id']);\n $db = new DBClass(db_host, db_username, db_passward, db_name);\n $result = $db->db_select_as_array('tbl_users', \"id = '$user_id'\");\n if (empty($result[0])) {\n return FALSE;\n }\n $user_details = $result[0];\n if ($user_details['type'] == 0) {\n $_SESSION['user_id'] = $user_id;\n } else if ($user_details['type'] == 1) {\n $_SESSION['talent_id'] = $user_id;\n } else {\n return FALSE;\n }\n return $user_id;\n}", "function scheduledreporting_component_get_all_reports()\n{\n $scheduled_reports = array();\n\n // Get all the users and grab their reports\n $users = get_users();\n foreach ($users as $user) {\n $tmp = scheduledreporting_component_get_reports($user['user_id']);\n foreach ($tmp as $i => $t) {\n $tmp[$i]['user_id'] = $user['user_id'];\n }\n $scheduled_reports = array_merge($scheduled_reports, $tmp);\n }\n\n return $scheduled_reports;\n}", "function fed_get_all_dashboard_display_menus() {\n\t$profile_menu = fed_process_dashboard_display_menu();\n\n\t$settings = get_option( 'fed_admin_settings_upl' );\n\tif ( isset( $settings['settings']['fed_upl_disable_logout'] ) && 'yes' === $settings['settings']['fed_upl_disable_logout']\n\t) {\n\t\t$logout = array();\n\t} else {\n\t\t$logout = fed_get_logout_menu();\n\t}\n\n\t$all_menus = apply_filters( 'fed_frontend_main_menu', array_merge( $profile_menu, $logout ) );\n\tuasort( $all_menus, 'fed_sort_by_order' );\n\n\treturn $all_menus;\n}", "function _getAllexcutivesIds($userId) {\n\n $this->db->select('id');\n $this->db->from(TBL_USER);\n $this->db->where('approver_user_id', $userId);\n $query = $this->db->get();\n // echo $this->db->last_query(); die;\n $users = $query->result();\n $usersIDs = array();\n if($users) {\n foreach($users as $user) {\n $usersIDs[] = $user->id;\n }\n }\n return $usersIDs;\n }", "private function getAloneUsers()\n {\n $groupUser_ids = array_unique(array_pluck(GroupUser::all()->toArray(), 'user_id'));\n\n //Descartamos estos usuarios del total\n $users_ids = array_pluck(User::all()->whereNotIn('id', $groupUser_ids)->toArray(), 'id');\n\n return $users_ids;\n }", "protected function get_site_ids()\n {\n }", "function FetchAdminIDs()\r\n{\r\n\tglobal $connect;\r\n $crud = new Crud($connect);\r\n $row = $crud->select(\"users\", \"GROUP_CONCAT(ID separator ', ') as AdminIDs\", \"AccessLevel ='1'\" );\r\n return $row[0][\"AdminIDs\"];\r\n}", "private function listUsers()\n {\n $users = get_users();\n $user_ids = array();\n\n foreach ($users as $u) {\n $user_ids[] = $u['id'];\n }\n\n if (count($this->ids) != 0) {\n return array_intersect($this->ids, $user_ids);\n } else {\n return $user_ids;\n }\n }" ]
[ "0.663758", "0.6559532", "0.6559532", "0.6171663", "0.61053985", "0.6103157", "0.60959584", "0.6067641", "0.6035614", "0.5969647", "0.59340096", "0.5927605", "0.58585197", "0.5847864", "0.5739323", "0.5735419", "0.5724981", "0.5695688", "0.56863546", "0.56621534", "0.56577367", "0.5651125", "0.5646233", "0.561196", "0.5596162", "0.55854446", "0.5577073", "0.5573193", "0.5551281", "0.55467075" ]
0.73541325
0
Add people form creator.
private function createAddPeopleForm($people) { $form = $this->createForm(PeopleType::class, $people, array( 'action' => $this->generateUrl('product_people_save'), )); $form->add('save', SubmitType::class, array( 'label' => 'Save', 'attr' => array('class' => 'btn btn-sm btn-success'), )); return $form; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function firstentity_addperson($form , &$form_state , $personality) {\n $form['name'] = array(\n '#type' => 'textfield',\n '#title' => 'name'\n );\n\n $person = new stdClass();\n $person->personality = $personality;\n $person->id = 0;\n\n $form['person'] = array(\n '#type' => 'value',\n '#value' => $person\n );\n // validations requires is element\n $form['personality'] = array(\n '#type' => 'value',\n '#value' => $personality\n );\n // attach form elements for attached fields\n field_attach_form( 'person' , $person , $form , $form_state );\n \n $form['actions'] = array('#type' => 'actions');\n $form['actions']['add'] = array(\n '#type' => 'submit',\n '#value' => 'add'\n );\n return $form;\n}", "public function add() {\n\t\t$user_id = $this->UserAuth->getUserId();\n\t\t\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->request->data[\"Contact\"][\"user_id\"] = $user_id;\n\t\t\t$this->Contact->saveAssociated($this->request->data, array(\"deep\" => true));\n\t\t}\n\t\t\n\t\t$this->render('form');\n\t}", "public function actionCreate() {\n\t\t$request = Yii::app()->request;\n $form = new PersonaForm(\"new\");\n if($request->isPostRequest) {\n $form->attributes = $request->getPost('PersonaForm');\n if($form->validate()) {\n PersonaManager::savePersona($form);\n Yii::app()->user->setFlash('general-success', \"$form->nombre $form->apellido ha sido creado.\");\n $this->redirect('admin');\n }\n }\n $this->render('create', array('model'=>$form));\n }", "public function create()\n {\n \n return view(\n 'components/forms/form-personne',\n [\n 'redirect' => 'ajouterPersonne',\n 'employe' => null\n ]\n );\n }", "public function createUserPeopleAction()\n {\n $data = $this->getRequestData();\n if (isset($data['name'])) {\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n $folder = Object_Folder::getByPath('/peoples/' . $user->getKey() . \"-people\");\n if (!$folder) {\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-people\");\n $folder->setParentId(52);\n $folder->save();\n }\n $people = new Object_People();\n $people->setCreator($user);\n $people->setName($data['name']);\n $people->setCompany(isset($data['company']) ? $data['company'] : \"\");\n $people->setPhone(isset($data['phone']) ? $data['phone'] : \"\");\n $people->setEmail(isset($data['email']) ? $data['email'] : \"\");\n $people->setImage(isset($data['image']) ? Asset_Image::getById($data['image']) : \"\");\n $people->setKey(Pimcore_File::getValidFilename($user->getKey() . \"-\" . $data['name'] . \"-\" . time()));\n $people->setPublished(true);\n $people->setParentId($folder->getId());\n if (!$people->save()) {\n $this->setErrorResponse('cannot save People object');\n }\n } else {\n $this->setErrorResponse('name is mandatory field for this request!');\n }\n\n $this->_helper->json($people);\n }", "public function create()\n {\n return view('people.create');\n }", "public function create()\n {\n return view (\"runner.personas.create\");\n }", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function create()\n {\n return view('people.create');\n }", "public function create()\n {\n return view('people.create');\n }", "public function create()\n {\n return view('collaborators.create');\n }", "public function create()\n {\n return view('people/create');\n }", "public function add_person() {\n\t \t\n\t \tvc_map( \n\t \t\tarray(\n\t\t \t \"name\" => __(\"Person\", \"CURLYTHEME\"),\n\t\t \t \"base\" => \"person\",\n\t\t \t \"content_element\" => true,\n\t\t \t \"icon\" => \"curly_icon\",\n\t\t \t \"class\" => '',\n\t\t \t \"category\" => __('Curly Themes Extension', \"CURLYTHEME\"), \n\t\t \t \"params\" => array(\n\t\t \t array(\n\t\t \t \"type\" => \"textfield\",\n\t\t \t \"heading\" => __(\"Person Name\", \"CURLYTHEME\"),\n\t\t \t 'edit_field_class' => 'vc_col-sm-6',\n\t\t \t \"holder\" => \"div\",\n\t\t \t \"param_name\" => \"name\"\n\t\t \t ),\n\t\t \t array(\n\t\t \t \"type\" => \"textfield\",\n\t\t \t \"heading\" => __(\"Position\", \"CURLYTHEME\"),\n\t\t \t 'edit_field_class' => 'vc_col-sm-6 vc_column',\n\t\t \t \"param_name\" => \"position\"\n\t\t \t ),\n\t\t \t array(\n\t\t \t \"type\" => \"textfield\",\n\t\t \t \"heading\" => __(\"E-mail\", \"CURLYTHEME\"),\n\t\t \t 'edit_field_class' => 'vc_col-sm-3 vc_column',\n\t\t \t \"param_name\" => \"email\"\n\t\t \t ),\n\t\t \t array(\n\t\t \t \"type\" => \"textfield\",\n\t\t \t \"heading\" => __(\"Facebook\", \"CURLYTHEME\"),\n\t\t \t 'edit_field_class' => 'vc_col-sm-3 vc_column',\n\t\t \t \"param_name\" => \"facebook\"\n\t\t \t ),\n\t\t \t array(\n\t\t \t \"type\" => \"textfield\",\n\t\t \t \"heading\" => __(\"Twitter\", \"CURLYTHEME\"),\n\t\t \t 'edit_field_class' => 'vc_col-sm-3 vc_column',\n\t\t \t \"param_name\" => \"twitter\"\n\t\t \t ),\n\t\t \t array(\n\t\t \t \"type\" => \"textfield\",\n\t\t \t \"heading\" => __(\"LinkedIn\", \"CURLYTHEME\"),\n\t\t \t 'edit_field_class' => 'vc_col-sm-3 vc_column',\n\t\t \t \"param_name\" => \"linkedin\"\n\t\t \t ),\n\t\t \t array(\n\t\t \t \"type\" => \"attach_image\",\n\t\t \t \"heading\" => __(\"Image\", \"CURLYTHEME\"),\n\t\t \t 'edit_field_class' => 'vc_col-sm-6 vc_column',\n\t\t \t \"param_name\" => \"picture\"\n\t\t \t ),\n\t\t \t array(\n\t\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t\t'heading' => __(\"Small Pictures?\", \"CURLYTHEME\"),\n\t\t\t\t\t\t\t'edit_field_class' => 'vc_col-sm-6 vc_column',\n\t\t\t\t\t\t\t'param_name' => 'style',\n\t\t\t\t\t\t\t'value' => array( __( 'Yes', 'CURLYTHEME' ) => 'mini' )\n\t\t\t\t\t\t),\n\t\t \t array(\n\t\t \t \"type\" => \"textarea_html\",\n\t\t \t \"heading\" => __(\"Extra Description\", \"CURLYTHEME\"),\n\t\t \t \"param_name\" => \"content\"\n\t\t \t )\n\t \t \t)\n\t \t\t) \n\t \t);\n\t }", "private function register_person_fields() {\n\n // Name fields\n $name_children = [\n 'prefix' => new \\Fieldmanager_Textfield( esc_html__( 'Prefix', 'pedestal' ), [\n 'name' => 'prefix',\n ] ),\n 'first' => new \\Fieldmanager_Textfield( esc_html__( 'First Name', 'pedestal' ), [\n 'name' => 'first',\n 'required' => true,\n 'validation_rules' => 'required',\n 'validation_messages' => esc_html__( 'Required', 'pedestal' ),\n ] ),\n 'middle' => new \\Fieldmanager_Textfield( esc_html__( 'Middle Name', 'pedestal' ), [\n 'name' => 'middle',\n ] ),\n 'nickname' => new \\Fieldmanager_Textfield( esc_html__( 'Nickname', 'pedestal' ), [\n 'name' => 'nickname',\n ] ),\n 'last' => new \\Fieldmanager_Textfield( esc_html__( 'Last Name', 'pedestal' ), [\n 'name' => 'last',\n 'required' => true,\n 'validation_rules' => 'required',\n 'validation_messages' => esc_html__( 'Required', 'pedestal' ),\n ] ),\n 'suffix' => new \\Fieldmanager_Textfield( esc_html__( 'Suffix', 'pedestal' ), [\n 'name' => 'suffix',\n ] ),\n ];\n $name = new \\Fieldmanager_Group( false, [\n 'name' => 'person_name',\n 'children' => $name_children,\n 'serialize_data' => false,\n ] );\n\n // Biographical Details fields\n $details_children = [\n 'known_for' => new \\Fieldmanager_Textfield( esc_html__( 'Known For', 'pedestal' ), [\n 'name' => 'known_for',\n ] ),\n 'url' => new \\Fieldmanager_Link( esc_html__( 'Website URL', 'pedestal' ), [\n 'name' => 'url',\n 'required' => false,\n ] ),\n 'dob' => new \\Fieldmanager_Datepicker( esc_html__( 'Birthdate', 'pedestal' ), [\n 'js_opts' => [\n 'changeMonth' => true,\n 'changeYear' => true,\n 'firstDay' => 0,\n // Last 100 years\n // https://api.jqueryui.com/datepicker/#option-yearRange\n 'yearRange' => '-100:+0',\n ],\n ] ),\n ];\n $details = new \\Fieldmanager_Group( false, [\n 'name' => 'person_details',\n 'children' => $details_children,\n 'serialize_data' => false,\n ] );\n\n // Social media fields\n $social_children = [\n 'twitter' => new \\Fieldmanager_Link( esc_html__( 'Twitter URL', 'pedestal' ), [\n 'name' => 'twitter',\n 'attributes' => [\n 'placeholder' => 'https://twitter.com/someone',\n 'size' => 50,\n ],\n ] ),\n 'instagram' => new \\Fieldmanager_Link( esc_html__( 'Instagram URL', 'pedestal' ), [\n 'name' => 'instagram',\n 'attributes' => [\n 'placeholder' => 'https://www.instagram.com/someone/',\n 'size' => 50,\n ],\n ] ),\n 'linkedin' => new \\Fieldmanager_Link( esc_html__( 'LinkedIn URL', 'pedestal' ), [\n 'attributes' => [\n 'placeholder' => 'https://www.linkedin.com/in/someone',\n 'size' => 50,\n ],\n ] ),\n ];\n $social = new \\Fieldmanager_Group( false, [\n 'name' => 'person_social',\n 'children' => $social_children,\n 'serialize_data' => false,\n ] );\n\n $name->add_meta_box( esc_html__( 'Name', 'pedestal' ), [ 'pedestal_person' ], 'normal', 'high' );\n $details->add_meta_box( esc_html__( 'Biographical Details', 'pedestal' ), [ 'pedestal_person' ], 'normal', 'high' );\n $social->add_meta_box( esc_html__( 'Social Media URLs', 'pedestal' ), [ 'pedestal_person' ], 'normal', 'high' );\n\n }", "function _add_user()\n {\n if (!$this->has_arg('PROJECTID'))\n $this->_error('No project id specified');\n if (!$this->has_arg('PERSONID'))\n $this->_error('No user specified');\n\n $proj = $this->db->pq(\"SELECT p.projectid FROM project p WHERE p.personid LIKE :1 AND p.projectid=:2\", array($this->user->personId, $this->arg('PROJECTID')));\n\n if (!sizeof($proj))\n $this->_error('No such project');\n $proj = $proj[0];\n\n $person = $this->db->pq(\"SELECT CONCAT(CONCAT(givenname, ' '), familyname) as fullname FROM person WHERE personid=:1\", array($this->arg('PERSONID')));\n if (!sizeof($person))\n $this->_error('No such person');\n $person = $person[0];\n\n $this->db->pq(\"INSERT INTO project_has_person (projectid, personid) VALUES (:1, :2)\", array($this->arg('PROJECTID'), $this->arg('PERSONID')));\n\n $this->_output(array('FULLNAME' => $person['FULLNAME']));\n }", "public function create()\n {\n $person = new Person();\n $data = [\n 'page_title' => $this->page_title,\n 'page_subtitle' => 'Tambah Pengelola TIK',\n 'item' => $person,\n ];\n return view('people.edit', $data);\n }", "public function add() {\n\n\t\t//Initializing variables\n\t\t$titles = ''; $farmerGroups = '';\n\n\t\tif ($this->request->is('post')) {\n\n\t\t\t//i am manually setting the 'users.user_category_id' field to a value equivalent to farmers in the 'user_category' table\n\t\t\t$this->request->data['User']['user_category_id'] = 3;\n\n\t\t\t//i am setting the entry person of this record to the currently logged in user.\n\t\t\t$this->request->data['User']['entered_by'] = $this->Auth->user('id');\n\n\t\t\t//i am setting the buying station of the farmer to that of the currently logged in Field-Officer\n\t\t\t$this->request->data['User']['buying_station_id'] = $this->Auth->user('buying_station_id');\n\n\t\t\t$this->User->create();\n\t\t\tif ($this->User->save($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('Information has been saved'));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('The info about the farmer could not be saved. Please, review your entry & try again!'));\n\t\t\t}\n\t\t}\n\n\t\t$titles = $this->User->Title->find('list');\n\t\t$farmerGroups = $this->User->FarmerGroup->find('list', array(\n\t\t\t'conditions' => array('FarmerGroup.buying_station_id' => $this->Auth->user('buying_station_id')),\n\t\t));\n\t\t$this->set(compact('titles', 'genders', 'farmerGroups'));\n\n\t}", "public function create()\n {\n return view('pages.person.createperson');\n }", "public function create()\n {\n return view('comprador_persona.create');\n }", "public function create()\n {\n //\n return view('personas.formulario');\n\n }", "public function createForm();", "public function createForm();", "public function create()\n {\n return view('personas.create');\n }", "public function create()\n {\n return view('personas.create');\n }", "public function create()\n {\n $communities_auth = Community::communities(Auth::id());\n \n if($communities_auth->count() > 0){\n\n $q_people_register = CommunityPeople::qCommunityPeople(Auth::id());\n $user = User::findOrfail(Auth::id()); \n \n if(is_null($user->parent_id))\n {\n $q_people_plan = User::infoPlan(Auth::id())->first();\n }else{\n $q_people_plan = User::infoPlan($user->parent_id)->first();\n }\n\n if($q_people_register >= $q_people_plan->q_users){\n abort(401);\n }else{\n $communities = $communities_auth->pluck('name','id');\n\n $sexes = GenList::where('group_id','1')->get(['id', 'item_description'])->pluck('item_description','id');\n\n $features = Feature::featuresByUser(Auth::id())->pluck('name', 'id');\n\n $groups = Group::groupsByUser(Auth::id())->pluck('name', 'id');\n\n $profiles = Profile::profilesByUser(Auth::id())->pluck('name', 'id');\n\n $countries = Country::all()->pluck('name', 'id');\n\n return view('people.create', compact('communities','sexes', 'features', 'groups', 'profiles', 'countries'));\n } \n }else{\n Flash::error(trans('flash.error_no_person_community'));\n return redirect(route('communities.index'));\n } \n \n }", "public function create()\n {\n return view('person.create');\n }", "public function addEmpFormOwner($added)\n {\n if ( !$this->ownerLoggedIn() )\n {\n $this->restricted();\n return;\n }\n \n $error = array();\n if (!empty($_GET['error']))\n {\n $error_string = urldecode($_GET['error']);\n $error = explode(',', $error_string);\n }\n\n require_once('views/AddEmpOwner.class.php');\n require_once('views/FormError.class.php');\n require_once('models/AppType.class.php');\n \n $site = new SiteContainer($this->db);\n $page = new AddEmpOwner();\n $error_page = new FormError();\n\n $site->printHeader();\n $site->printNav(\"owner\");\n $error_page->printHtml($error);\n if($added) {\n $page->printSuccessHtml();\n }\n else {\n $page->printHtml(AppType::get_all_types($this->db));\n }\n $site->printFooter(); \n\n }", "public function create()\n\t{\n\t\t// rendering Case creation form --> by shrouk\n\t\t$donate_types = DonationType::all();\n\t\t$interval_types = IntervalType::all();\n\t\t$governorates = Governorate::all();\n\t\t$cities = City::all();\n\t\t\n\t\treturn view('people.create',compact('donate_types','interval_types','governorates','cities'));\n\t}", "public function create()\n {\n $teacher_types = \\App\\Teacher_type::pluck('name','id');\n $matter = \\App\\Matter::pluck('name','id');\n\n return view('professors.create',compact('professor','teacher_types','matter'));\n }", "public function create()\n\t{\n\t\t$person = new Person;\n\t\t// $expertise_areas = $this->transformForSelect(ExpertiseArea::all());\t\t\n\t\t$expertise_areas = ExpertiseArea::select(['id','name'])->get()->toArray();\n\t\t// dd(array_chunk($expertise_areas,3));\n\t\treturn View::make('doctors.create',compact('person','expertise_areas'));\n\t}" ]
[ "0.6946541", "0.6343106", "0.6318721", "0.62964433", "0.6273601", "0.6223717", "0.6184965", "0.6179786", "0.61243737", "0.61243737", "0.61242294", "0.6113446", "0.61123276", "0.6101034", "0.6098504", "0.6094216", "0.6045402", "0.60404265", "0.60391814", "0.603287", "0.6001425", "0.6001425", "0.5972412", "0.5972412", "0.59345907", "0.5917894", "0.5915887", "0.5914644", "0.5881052", "0.5870053" ]
0.7013418
0
Replace TYPE with static::TYPE in a string.
protected function replaceType(string $str) { return str_replace('#TYPE#', static::TYPE, $str); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getTypeString($type){\n\t\tswitch($type){\n\t\t\tcase Logger::DEBUG:\n\t\t\t\t$type = 'DEBUG';\n\t\t\t\tbreak;\n\t\t\tcase Logger::ERROR:\n\t\t\t\t$type = 'ERROR';\n\t\t\t\tbreak;\n\t\t\tcase Logger::WARNING:\n\t\t\t\t$type = 'WARNING';\n\t\t\t\tbreak;\n\t\t\tcase Logger::CUSTOM :\n\t\t\t\t$type = 'CUSTOM';\n\t\t\t\tbreak;\n\t\t\tcase Logger::CRITICAL:\n\t\t\t\t$type = 'CRITICAL';\n\t\t\t\tbreak;\n\t\t\tcase Logger::ALERT:\n\t\t\t\t$type = 'ALERT';\n\t\t\t\tbreak;\n\t\t\tcase Logger::NOTICE:\n\t\t\t\t$type = 'NOTICE';\n\t\t\t\tbreak;\n\t\t\tcase Logger::EMERGENCE:\n\t\t\t\t$type = 'EMERGENCE';\n\t\t\t\tbreak;\n\t\t\tcase Logger::INFO:\n\t\t\t\t$type = 'INFO';\n\t\t\t\tbreak;\n\t\t\tcase Logger::SPECIAL :\n\t\t\t\t$type = 'SPECIAL';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$type = 'CUSTOM';\n\t\t}\n\t\treturn $type;\n\t}", "public function __toString(): string\n {\n $type = static::class;\n $position = strrpos($type, '\\\\');\n\n if ($position !== false) {\n $type = substr($type, $position);\n }\n\n return str_replace('Type', '', $type);\n }", "public static function class(string $type): string\n {\n return 'type type-' . $type;\n }", "protected function getTypeString($type)\n {\n switch ($type) {\n case Logger::EMERGENCY:\n case Logger::EMERGENCE:\n case Logger::CRITICAL:\n // emergence, critical\n return 'critical';\n case Logger::ALERT:\n case Logger::ERROR:\n // error, alert\n return 'error';\n case Logger::WARNING:\n // warning\n return 'warning';\n case Logger::NOTICE:\n case Logger::INFO:\n // info, notice\n return 'info';\n case Logger::DEBUG:\n case Logger::CUSTOM:\n case Logger::SPECIAL:\n default:\n // debug, log, custom, special\n return 'debug';\n }\n }", "public static function getType(): string\n {\n return self::TYPE;\n }", "protected function GenCustom($type) {\n\n return \"\";\n }", "public static function getTypeName($type = ''): string\n {\n switch ($type) {\n case '':\n $type = 'app_id';\n break;\n case 'app':\n $type = 'appid';\n break;\n default:\n $type = $type.'_id';\n }\n\n return $type;\n }", "public static function format_type_name($type_name)\n {\n }", "public static function typeToString(int $type): string {\n return self::$_names[$type];\n }", "public static function type_string($context, $type_string = null)\n {\n // repeat a TypeNameDefault translation string\n $type_string = $type_string == 'TypeNameDefault' ? 'TypeName' : $type_string;\n\n return Translation::get($type_string ? $type_string : 'TypeName', null, $context);\n }", "static public function type_to_class($type)\n\n {\n return self::get_content_object_type_namespace($type) . '\\\\' .\n (string) StringUtilities::getInstance()->createString($type)->upperCamelize();\n }", "abstract function typeAsString();", "protected function getType($type) {\n switch ($type) {\n case \"::\" :\n return \"static\";\n case \"->\" :\n return \"method\";\n default :\n return $type;\n }\n }", "abstract protected function get_typestring();", "private function getNormalizedType(string $type): string\n {\n switch ($type) {\n case 'string':\n return self::STRING;\n case 'int':\n case 'integer':\n return self::INTEGER;\n case 'double':\n case 'float':\n return self::FLOAT;\n case 'bool':\n case 'boolean':\n return self::BOOLEAN;\n case 'array':\n return self::HASH;\n case 'null':\n case 'NULL':\n return self::NULL;\n case 'resource':\n return self::RESOURCE;\n case '?':\n return self::WILDCARD;\n default:\n return self::OBJECT;\n }\n }", "function graphql_format_type_name($type_name)\n {\n }", "public function getTypeString(){\n\t\t$typeStr=\"\";\n\t\tswitch($this->type){\n\t\t\tcase \"fixed\": $typeStr=_(\"Montant fixe\");break;\n\t\t\tcase \"percentage\": $typeStr=_(\"Pourcentage\");break;\n\t\t\tcase \"percentage_no_transport\": $typeStr=_(\"Pourcentage sans transport\");break;\n\t\t\tcase \"transport\": $typeStr=_(\"Frais de port\");break;\n\t\t\tcase \"grid\": $typeStr=_(\"Variable\");break;\n\t\t}\n\t\treturn $typeStr;\n\t}", "private function convertTypeToMethod($type)\n {\n $parts = explode('.', str_replace(['-', '_'], '.', $type));\n $parts = array_map('ucfirst', $parts);\n\n return implode('', $parts);\n }", "public static function typeToString($type)\n\t{\n\t\tswitch($type)\n\t\t{\n\t\t\tcase self::EOF:\n\t\t\t\treturn 'EOF';\n\t\t\t\tbreak;\n\n\t\t\tcase self::TEXT:\n\t\t\t\treturn 'TEXT';\n\t\t\t\tbreak;\n\n\t\t\tcase self::BLOCK_START:\n\t\t\t\treturn 'BLOCK_START';\n\t\t\t\tbreak;\n\n\t\t\tcase self::BLOCK_END:\n\t\t\t\treturn 'BLOCK_END';\n\t\t\t\tbreak;\n\n\t\t\tcase self::VAR_START:\n\t\t\t\treturn 'VAR_START';\n\t\t\t\tbreak;\n\n\t\t\tcase self::VAR_END:\n\t\t\t\treturn 'VAR_END';\n\t\t\t\tbreak;\n\n\t\t\tcase self::NAME:\n\t\t\t\treturn 'NAME';\n\t\t\t\tbreak;\n\n\t\t\tcase self::NUMBER:\n\t\t\t\treturn 'NUMBER';\n\t\t\t\tbreak;\n\n\t\t\tcase self::STRING:\n\t\t\t\treturn 'STRING';\n\t\t\t\tbreak;\n\n\t\t\tcase self::OPERATOR:\n\t\t\t\treturn 'OPERATOR';\n\t\t\t\tbreak;\n\n\t\t\tcase self::PUNCTUATION:\n\t\t\t\treturn 'PUNCTUATION';\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Exception(sprintf('There is no token type \"%s\"', $type));\n\t\t}\n\t}", "public static function prefixed(string $type): string\n {\n return self::PREFIX.$type;\n }", "private function _getTypeName( $type )\n\t{\n\t\t$type_name = \"\";\n\t\tif ( $type == - 1 ) {\n\t\t\t$type_name = 'sight';\n\t\t} elseif ( $type == - 2 ) {\n\t\t\t$type_name = 'design';\n\t\t} elseif ( $type ) {\n\t\t\t$type_name = \"utilities{$type}\";\n\t\t}\n\n\t\treturn $type_name;\n\t}", "private function returnClassNameType($type, $table) {\n return $this->returnClassName($table) . $type;\n }", "protected static function classByType($type)\n {\n $type = preg_replace('/^icinga_/', '', $type);\n\n if (strpos($type, 'data') === false) {\n $prefix = 'Icinga';\n } else {\n $prefix = 'Director';\n }\n\n // TODO: Provide a more sophisticated solution\n if ($type === 'hostgroup') {\n $type = 'hostGroup';\n } elseif ($type === 'usergroup') {\n $type = 'userGroup';\n } elseif ($type === 'timeperiod') {\n $type = 'timePeriod';\n } elseif ($type === 'servicegroup') {\n $type = 'serviceGroup';\n } elseif ($type === 'apiuser') {\n $type = 'apiUser';\n }\n\n return 'Icinga\\\\Module\\\\Director\\\\Objects\\\\' . $prefix . ucfirst($type);\n }", "public static function nameByType($type)\n {\n switch ($type) {\n case self::TOKEN_BOOLEAN_FALSE: return 'BOOLEAN_FALSE';\n case self::TOKEN_BOOLEAN_TRUE: return 'BOOLEAN_TRUE';\n case self::TOKEN_BRACE_CLOSE: return 'BRACE_CLOSE';\n case self::TOKEN_BRACE_OPEN: return 'BRACE_OPEN';\n case self::TOKEN_COLON: return 'COLON';\n case self::TOKEN_COMMA: return 'COMMA';\n case self::TOKEN_FLOAT: return 'FLOAT';\n case self::TOKEN_GREATER_THAN: return 'GREATER_THAN';\n case self::TOKEN_INTEGER: return 'INTEGER';\n case self::TOKEN_LESS_THAN: return 'LESS_THAN';\n case self::TOKEN_NULL: return 'NULL';\n case self::TOKEN_PIPE: return 'PIPE';\n case self::TOKEN_PLUS: return 'PLUS';\n case self::TOKEN_SQUARE_BRACKET_CLOSE:\n return 'SQUARE_BRACKET_CLOSE';\n case self::TOKEN_SQUARE_BRACKET_OPEN: return 'SQUARE_BRACKET_OPEN';\n case self::TOKEN_STRING: return 'STRING';\n case self::TOKEN_STRING_QUOTED: return 'STRING_QUOTED';\n case self::TOKEN_TYPE_NAME: return 'TYPE_NAME';\n case self::TOKEN_WHITESPACE: return 'WHITESPACE';\n }\n\n return null;\n }", "function transform_name( $name = '', $type = '' ) {\n\t$word = array( ' ' => $type, '&' => '' );\n\t$new = strtr( $name, $word );\n $new = strtolower( $new );\n return $new;\n}", "private function make_class_name( $name, $type ) {\n\n\t\tif ( 'field' == $type ) {\n\t\t\t$namespace = '\\\\' . __NAMESPACE__ . '\\Admin\\Fields\\\\';\n\t\t} elseif ( 'page' == $type ) {\n\t\t\t$namespace = '\\\\' . __NAMESPACE__ . '\\Admin\\Pages\\\\';\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\n\t\t$class_name = implode( '_', array_map( 'ucfirst', explode( '-', $name ) ) );\n\n\t\treturn $namespace . $class_name;\n\t}", "function transform_name( $name = '', $type = '' ) {\n $word = array( ' ' => $type, '&' => '' );\n $new = strtr( $name, $word );\n $new = strtolower( $new );\n\n return $new;\n}", "public static function typeToString(Int $type){\n return ucfirst(array_search($type, self::userTypes()));\n }", "public function setTypeAttribute($type)\n {\n $this->attributes['type'] = str_replace(array(' '),'_',$type);\n }", "public function typeAsString()\n {\n switch ($this->_type) {\n case self::TYPE_INTEGER:\n $str = 'INTEGER';\n break;\n\n case self::TYPE_FLOAT:\n $str = 'FLOAT';\n break;\n\n case self::TYPE_VARCHAR:\n $str = 'VARCHAR';\n break;\n\n case self::TYPE_BLOB:\n $str = 'BLOB';\n break;\n\n case self::TYPE_BOOLEAN:\n $str = 'BOOLEAN';\n break;\n\n case self::TYPE_DATETIME:\n $str = 'DATETIME';\n break;\n\n case self::TYPE_TEXT:\n default:\n $str = 'TEXT';\n }\n return $str;\n }" ]
[ "0.66219646", "0.64941984", "0.6398968", "0.6311845", "0.6298164", "0.62447864", "0.60726404", "0.6043541", "0.6039109", "0.59945977", "0.59703547", "0.595879", "0.59538585", "0.593437", "0.5910185", "0.5907619", "0.59055203", "0.5890375", "0.5880865", "0.5855747", "0.5824795", "0.5794171", "0.5764227", "0.5722425", "0.5708438", "0.56987524", "0.5697203", "0.5670111", "0.5666107", "0.5654282" ]
0.6946772
0
Common posting stuff for post/reply/edit
private function common_post($mode, $post_object, $message_object) { titania::add_lang('posting'); phpbb::$user->add_lang('posting'); // Submit check...handles running $post->post_data() if required $submit = $message_object->submit_check(); if ($submit) { $error = $post_object->validate(); if (($validate_form_key = $message_object->validate_form_key()) !== false) { $error[] = $validate_form_key; } // @todo use permissions for captcha if (!phpbb::$user->data['is_registered'] && ($validate_captcha = $message_object->validate_captcha()) !== false) { $error[] = $validate_captcha; } $error = array_merge($error, $message_object->error); if (sizeof($error)) { phpbb::$template->assign_var('ERROR', implode('<br />', $error)); } else { // Force Queue Discussion topics to always be stickies if ($post_object->post_type == TITANIA_QUEUE_DISCUSSION) { $post_object->topic->topic_sticky = true; } // Does the post need approval? Never for the Queue Discussion or Queue. Do not set again in edit mode, otherwise this causes problems when the post has been approved. if (!phpbb::$auth->acl_get('u_titania_post_approved') && $post_object->post_type != TITANIA_QUEUE_DISCUSSION && $post_object->post_type != TITANIA_QUEUE && $mode != 'edit') { $post_object->post_approved = false; } $post_object->parent_contrib_type = $this->parent_type; $post_object->submit(); $message_object->submit($post_object->post_access); // Did they want to subscribe? if (isset($_POST['notify']) && phpbb::$user->data['is_registered']) { titania_subscriptions::subscribe(TITANIA_TOPIC, $post_object->topic->topic_id); } // Unapproved posts will get a notice if (!$post_object->topic->get_postcount()) { phpbb::$user->add_lang('posting'); trigger_error(phpbb::$user->lang['POST_STORED_MOD'] . '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_INDEX'], '<a href="' . $post_object->topic->get_parent_url() . '">', '</a>')); } else if (!$post_object->post_approved) { phpbb::$user->add_lang('posting'); trigger_error(phpbb::$user->lang['POST_STORED_MOD'] . '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_TOPIC'], '<a href="' . $post_object->topic->get_url() . '">', '</a>')); } else { // Subscriptions if ($mode == 'reply') { if ($post_object->post_type == TITANIA_SUPPORT && is_object(titania::$contrib) && titania::$contrib->contrib_id == $post_object->topic->parent_id && titania::$contrib->contrib_name) { // Support topic reply $email_vars = array( 'NAME' => htmlspecialchars_decode($post_object->topic->topic_subject), 'U_VIEW' => titania_url::append_url($post_object->topic->get_url(), array('view' => 'unread', '#' => 'unread')), 'CONTRIB_NAME' => titania::$contrib->contrib_name, ); titania_subscriptions::send_notifications(array(TITANIA_TOPIC, TITANIA_SUPPORT), array($post_object->topic_id, $post_object->topic->parent_id), 'subscribe_notify_contrib.txt', $email_vars, $post_object->post_user_id); } else { $email_vars = array( 'NAME' => htmlspecialchars_decode($post_object->topic->topic_subject), 'U_VIEW' => titania_url::append_url($post_object->topic->get_url(), array('view' => 'unread', '#' => 'unread')), ); titania_subscriptions::send_notifications(TITANIA_TOPIC, $post_object->topic_id, 'subscribe_notify.txt', $email_vars, $post_object->post_user_id); } } else if ($mode == 'post') { if ($post_object->post_type == TITANIA_SUPPORT && is_object(titania::$contrib) && titania::$contrib->contrib_id == $post_object->topic->parent_id && titania::$contrib->contrib_name) { // New support topic $email_vars = array( 'NAME' => htmlspecialchars_decode($post_object->topic->topic_subject), 'U_VIEW' => $post_object->topic->get_url(), 'CONTRIB_NAME' => titania::$contrib->contrib_name, ); titania_subscriptions::send_notifications($post_object->post_type, $post_object->topic->parent_id, 'subscribe_notify_forum_contrib.txt', $email_vars, $post_object->post_user_id); } else { $email_vars = array( 'NAME' => htmlspecialchars_decode($post_object->topic->topic_subject), 'U_VIEW' => $post_object->topic->get_url(), ); titania_subscriptions::send_notifications($post_object->post_type, $post_object->topic->parent_id, 'subscribe_notify_forum.txt', $email_vars, $post_object->post_user_id); } } } redirect($post_object->get_url()); } } else if (sizeof($message_object->error)) { phpbb::$template->assign_var('ERROR', implode('<br />', $message_object->error)); } // Do we subscribe to actual topic? $is_subscribed = (($mode == 'edit' || $mode == 'reply') && titania_subscriptions::is_subscribed(TITANIA_TOPIC, $post_object->topic->topic_id)) ? true : false; phpbb::$template->assign_vars(array( 'S_NOTIFY_ALLOWED' => (phpbb::$user->data['is_registered'] && !$is_subscribed) ? true : false, 'S_NOTIFY_CHECKED' => (phpbb::$user->data['is_registered'] && !$is_subscribed && phpbb::$user->data['user_notify'] && $post_object->post_type == TITANIA_SUPPORT) ? ' checked=checked' : '', )); $topic_access_level = TITANIA_ACCESS_PUBLIC; if ($mode == 'edit' || $mode == 'reply') { // If this is the first post, we'll allow lowering the access level, otherwise the topic access level is the minimum that can be set $topic_access_level = ($post_object->post_id == $post_object->topic->topic_first_post_id) ? TITANIA_ACCESS_PUBLIC : $post_object->topic->topic_access; } $message_object->display($topic_access_level); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function post();", "function _post()\r\n\t\t{\r\n\t\t}", "function post();", "public function post($post);", "private function managePost()\n {\n // Do only react on POST requests\n if ($_SERVER['REQUEST_METHOD'] != 'POST' || empty($_POST)) {\n return;\n }\n\n /* @var $post \\Core\\Http\\Post\\Post */\n $this->di->mapService('core.http.post', '\\Core\\Http\\Post\\Post');\n\n $post = $this->di->get('core.http.post');\n\n // Setting the name of the session token that has to/gets sent with a form\n $post->setTokenName($this->config->get('Core', 'security.form.token'));\n\n // Validate posted token with session token\n if (!$post->validateCompareWithPostToken($this->di->get('core.security.form.token'))) {\n return;\n }\n\n // Some data cleanup\n $post->trimData();\n\n // Assingn app related post data to the corresponding app\n $post_data = $post->get();\n\n foreach ($post_data as $name => $data) {\n $app = $this->getAppInstance($name);\n $app->post->set($data);\n }\n }", "public function post( array $postFields );", "private function _handleFormPost()\n {\n // see submit.php\n // 'FILE_OBJECTS' => 'handle_file_post',\n // 'BASE64_ENCODED_FILE_OBJECTS' => 'handle_base64_encoded_file_post',\n // 'TRANSFER_IDS' => 'handle_transfer_ids_post'\n }", "public function post_edit_submit() {\n\n $slug = in('slug'); // forum id ( slug ). It is only available on creating a new post.\n $post_ID = in('post_ID'); // post id. it is only available on updating a post.\n $title = in('title');\n $content = in('content');\n\n if ( empty( $slug ) && empty( $post_ID ) ) ferror(-50044, 'slug ( category_slug ) or post_ID are not provided');\n if ( ! $title ) ferror(-50045, 'post title is not provided');\n if ( ! $content ) ferror(-50046,'post content is not provided');\n $user_ID = $this->get_post_author();\n if ( empty($user_ID) ) ferror( -50047, \"login first\");\n\n if ( $post_ID ) { // update\n forum()->endIfNotMyPost( $post_ID );\n $this->setCategoryByPostID( $post_ID );\n }\n else { // new\n $this->setCategory( $slug );\n }\n $post = post()\n ->set('post_category', [ forum()->getCategory()->term_id ])\n ->set('post_title', $title)\n ->set('post_content', $content)\n ->set('post_status', 'publish');\n\n if ( $post_ID ) { // update\n $post_ID = $post\n ->set('ID', $post_ID)\n ->update();\n }\n else { // new\n $post_ID = $post\n ->set('post_author', $user_ID)\n ->create();\n }\n if ( ! is_integer($post_ID) ) ferror( -50048, \"Failed on post_create() : $post_ID\");\n\n\n // file upload\n preg_match_all(\"/http.*\\/data\\/upload\\/[^\\/]*\\/[^\\/]\\/[^'\\\"]*/\", $content, $ms);\n $files = $ms[0];\n // save uploaded files\n post()->meta( $post_ID, 'files', $files );\n\n\n // Save All extra input into post meta.\n post()->saveAllMeta( $post_ID );\n\n $this->response( [ 'slug' => forum()->getCategory()->slug, 'post_ID' => $post_ID ] );\n }", "function PostActions()\n {\n }", "public function post();", "public function post();", "public function post();", "function post()\n {\n $post = $this->postManager->getPost($_GET['id']);\n if ($post == true) {\n $comments = $this->commentManager->getComments($_GET['id']);\n require('view/frontend/postView.php');\n } else {\n require('view/backend/sbadmin2/404.php');\n }\n }", "function WoopPost( $post ) { $this->post = $post; }", "public function p_add() {\n\t\t\t#print_r($_POST);\n\t\t\t\n\t\t\t\n\t\t\t$_POST['created'] = Time::now();\n \t\t\t$_POST['modified'] = Time::now();\n\t\t\t$_POST['poster'] = $this->user->user_id;\n\t\t\t\n\t\t\t#Write Post to the Database\n\t\t $post_id= DB::instance(DB_NAME)->insert('posts', $_POST);\n\t\t\t#Call the parser to look for hashtags: \n\t\t\t$_POST['post'] = $this->parse(\"#\",$_POST['post'],$post_id);\n\t\t\t#Call the parser to look for mentions, and the 'reply_to' for the post\n\t\t\t$_POST['post'] = $this->parse(\"@\",$_POST['post'],$post_id);\n\t\t\t#Update the Post record with new post, updated in the parser:\n\t\t\tDB::instance (DB_NAME)->update('posts',$_POST,\"where post_id = '\".$post_id.\"'\");\t\n\t\t\t\n\t\t Router::redirect('/users/');\n\t\t\t\n\t\t\t\t\t\t\n\t\t}", "function post() \n {\n \n }", "public function isPost();", "protected function registerPostActions() {\n $this->registerPostAction(\"create\", isset($_POST[\"submit-btn\"]) && $_POST[\"submit-btn\"] == \"save\" && !isset($_GET[\"edit\"]));\n $this->registerPostAction(\"update\", isset($_POST[\"submit-btn\"]) && $_POST[\"submit-btn\"] == \"save\" && isset($_GET[\"edit\"]));\n $this->registerPostAction(\"delete\", isset($_POST[\"delete-btn\"]) && $_POST[\"delete-btn\"] == \"delete\", false);\n }", "public function postAction() {}", "public function sendPost(){\n\t\t\t// record the post in the database\n\t\t\t\n\t\t}", "function index_post() {\n $this->crud_post($this->post());\n }", "function do_store_post_reply($post_id) {\r\n // echo '<pre>'; print_r($_POST); die();\r\n foreach(array(\"description\",\"replied_by\") as $i)\r\n\t\t\t$$i=$this->input->post($i);\r\n $replied_on = time();$status=1;\r\n $this->db->query(\"insert into m_stream_post_reply(description,post_id,replied_by,replied_on,status) values(?,?,?,?,?)\",array($this->prep($description),$post_id,$replied_by,$replied_on,$status));\r\n }", "function post_action_handler($post_id) {\n\t\tif ( current_filter() == 'delete_post' )\n\t\t\treturn $this->add_ping( 'db', array( 'post' => $post_id ), 'delete_post' );\n\t\treturn $this->add_ping( 'db', array( 'post' => $post_id ), 'edit_post' );\n\t}", "public function p_share() {\n $_POST['user_id'] = $this->user->user_id;\n\n # Unix timestamp of when this post was created / modified\n $_POST['created'] = Time::now();\n $_POST['modified'] = Time::now();\n\n # Insert\n # Note we didn't have to sanitize any of the $_POST data because we're using the insert method which does it for us\n DB::instance(DB_NAME)->insert('requests', $_POST);\n\n # send them to view list of active posts\n\n Router::redirect(\"/requests/index\");\n\n }", "public function reply_post() {\n\t\t$data['uid'] = $this->input->get('uid');\n\t\t$data['_id'] = $this->input->get('_id');\n\t\t$data['text'] = $this->input->get('text');\n\t\t$data['ts'] = now();\n\t\t\n\t\t$this->Messages_model->reply($data);\n\t}", "abstract public function post($data);", "function content_form($post_type,$post_id = '',$action='',$thankyou = array()){\n\t$app = \\Jolt\\Jolt::getInstance();\n\t//\tgrab blueprint based on content type..\n\t$blueprint = $app->store('blueprints');\n\t$blueprint = $blueprint[ $post_type ];\n//\tprint_r( $blueprint );\n\t$nonce = generate_nonce();\n\n\tif( isset($_POST['title']) ){\n//\t\tprint_r($_POST);\n\t\t$c_url = site_url().$_SERVER['REQUEST_URI'];\n\t\t$post \t\t\t\t= array();\n\t\t$post['title'] \t\t= $_POST['title'];\n\t\t$post['name'] \t\t= new_slug( slugify( $_POST['title'] ) );\n\t\t$post['type'] \t\t= $post_type;\n\t\t$post['user_id'] \t= '';\n\t\t$post['date'] \t\t= date('Y-m-d H:i:s');\n\t\t$post['modified']\t= date('Y-m-d H:i:s');\n\t\t$post['password'] \t= '';\n\t\t$post['status'] \t= 'draft';\t//\tregardless of post type, we never want a post actually published from here..\n\t\t$post['parent'] \t= 0;\n\t\t$post['guid'] \t\t= generate_uuid();\n\t\t$post['category'] \t= '';\n\t\t$restricted = array('_id','title','name','user_id','date','modified','guid','type','status','parent','password');\n\t\tforeach($blueprint['fields'] as $fname=>$field ){\n\t\t\tif( isset($post[$k]) )\tcontinue;\n\t\t\t//\tThere are fields we don't want to change... This makes sure we don't...\n\t\t\tif( in_array($restricted,$fname) )\tcontinue;\n\t\t\tif( !isset($_POST[ $fname ]) ){\n\t\t\t\tif( $field['type'] == 'related' ){\n\t\t\t\t\t$_POST[ $fname ] = array();\n\t\t\t\t}else{\n\t\t\t\t\t$_POST[ $fname ] = '';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tforeach($_POST as $k=>$v){\n\t\t\tif( isset($post[$k]) )\tcontinue;\n\t\t\tif( in_array($restricted,$k) )\tcontinue;\n\t\t\t$post[$k] = $v;\n\t\t}\n\t\tif( isset($_FILES) ){\n\t\t\tforeach($_FILES as $k=>$file){\n\t\t\t\tif( in_array($restricted,$k) )\tcontinue;\n\t\t\t\t$uploaddir = $this->app->store('upload_path');\n\t\t\t\t$uploadfile = $uploaddir . basename($file['name']);\n\t\t\t\t$uploadurl = $this->app->store('upload_url') . basename($file['name']);\n\t\t\t\tif( file_exists($uploadfile) ){\n\t\t\t\t\t$post[$k] = $uploadurl;\n\t\t\t\t}else{\n\t\t\t\t\tif ( move_uploaded_file($file['tmp_name'], $uploadfile) ) {\n\t\t\t\t\t\t$post[$k] = $uploadurl;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$app->db->insert('post', $post );\n\t\tunset($_POST);\n\t\tif( isset($thankyou['url']) ){\n\t\t\techo '<script>top.location.href=\"'.$thankyou['url'].'\";</script>';\n\t\t}else if( isset($thankyou['msg']) ){\n\t\t\techo '<p>'.$thankyou['msg'].'</p>';\n\t\t}else{\n\t\t\techo '<p><strong>Thank you, your post has been saved.</strong></p>';\n\t\t}\n\t}\n?>\n\t<form role=\"form\" method=\"POST\" action=\"<?php echo $action?>\" enctype=\"multipart/form-data\">\n\t<input type=\"hidden\" name=\"nonce\" value=\"<?php echo $nonce?>\" />\n\t<fieldset>\n\t\t<div class=\"form-group\">\n\t\t\t<label for=\"title\"><?=( isset($blueprint['titlelabel']) ? $blueprint['titlelabel'] : \"Title\")?></label>\n\t\t\t<input type=\"text\" class=\"form-control\" id=\"title\" name=\"title\" placeholder=\"<?=( isset($blueprint['titlelabel']) ? $blueprint['titlelabel'] : \"Enter Title\")?>\" value=\"<?php echo ( isset($post) ? $post['title'] : '');?>\" required>\n\t\t</div>\n<?php\n\t\tforeach($blueprint['fields'] as $fname=>$field ){\n\t\t\tif( $field['adminonly'] )\tcontinue;\n\t\t\tform_field($fname,$field,$post);\n\t\t}\n?>\n\t\t<button type=\"submit\" class=\"btn btn-primary\">Save</button>\n\t</fieldset>\n\t</form>\n<?php\n}", "function post()\n{\n $postManager = new PostManager();\n $commentManager = new CommentManager();\n\n $post = $postManager->getPost($_GET['id']);\n $comments = $commentManager->pseudoAuthor($_GET['id']);\n\n require('view/postView.php');\n}", "function process_post()\n \t{\n \t\treturn $this->class_post->process_post();\n \t}", "function send_post()\n { \n $send = new send();\n\n $send->date_created = date('Y-m-d H:i:s');\n $send->createdbypk = $this->get_user()->user_id;\n $send->date_modified = date('Y-m-d H:i:s');\n $send->modifiedbypk = $this->get_user()->user_id;\n\n $this->response($this->_send_save($send, 'post'));\n }" ]
[ "0.7297101", "0.6807101", "0.678782", "0.6769131", "0.66231066", "0.657409", "0.65622663", "0.6536133", "0.65277004", "0.6500373", "0.6500373", "0.6500373", "0.64989525", "0.6489278", "0.64878494", "0.6448549", "0.63906026", "0.63863814", "0.6357086", "0.6350547", "0.6338848", "0.63148123", "0.6283888", "0.62737274", "0.62733287", "0.6264727", "0.62460715", "0.6183336", "0.61811596", "0.61480105" ]
0.6844602
1
Quick load a post
public function load_post($post_id) { $post = new titania_post(); $post->post_id = $post_id; if ($post->load() === false) { trigger_error('NO_POST'); } $post->topic = $this->load_topic($post->topic_id); return $post; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function load($post);", "public function loadPostAction()\n {\n $id = $this->params()->fromRoute(\"id\");\n $posts = $this->getServiceLocator()->get(\"Application\\Service\\BlogPost\")->fetchAll(null, 'date DESC');\n $model = $posts[$id];\n $view = new \\Zend\\View\\Model\\ViewModel();\n $view->setTerminal(true);\n $view->setVariables(array('body' => $model->getBody(),\n 'nextId' => ($id+1),\n 'id' => $model->getId(),\n 'title' => $model->getTitle()));\n return $view;\n }", "public function load($model, $post) {\n // empty implementation. \n }", "public function onSinglePostLoad($event){\n $post = $event->getResult();\n\n //If we are displaying a repository item?\n if (preg_match(\"/^repo:\\/\\/(\\\\d+[a-zA-Z0-9]{9})/\", $post['object_type'], $matches)) {\n\n $repo = $this->application->createInstance(Model\\Data::class);\n\n $post['media_data'] = $repo->getData( $post['object_uri'] );\n\n $post['media_template'] = \"posts/post-single-repo\";\n $post['media_title'] = \"Host\";\n\n }\n\n $event->setResult( $post );\n\n }", "protected function loadPosts() {\r\n $this->posts = new \\App\\Table\\PostTable(App::getInstance()->getDb());\r\n \r\n }", "function load_post($posts, $index) {\n\n\tglobal $post;\n\n\tif ( ! isset($posts[$index]) ) {\n\t\treturn FALSE;\n\t}\n\n\tsetup_postdata($post = $posts[$index]);\n\n\treturn TRUE;\n\n}", "public static function loadPost() {\n if($GLOBALS[\"CONFIG\"][\"basic\"][\"APP_MULTI_LANGUAGE_POSTS\"] == \"1\") {\n if(Route::getValue('LANGUAGE') === false) {\n $lang = $GLOBALS[\"request\"]->getMostPreferredLanguage();\n if($lang === null) {\n $lang = \"en\";\n }\n if(file_exists($_SERVER['DOCUMENT_ROOT'].\"/../template/posts/$lang/\".Route::getValue(\"ID\").\".php\")) {\n redirect('/post/'.$lang.'/'.Route::getValue('ID'));\n } else if (file_exists($_SERVER['DOCUMENT_ROOT'].\"/../template/posts/\".$GLOBALS[\"CONFIG\"][\"basic\"][\"APP_PRIMARY_POST_LANGUAGE\"].\"/\".Route::getValue(\"ID\").\".php\")) {\n redirect('/post/'.$GLOBALS[\"CONFIG\"][\"basic\"][\"APP_PRIMARY_POST_LANGUAGE\"].'/'.Route::getValue('ID'));\n }\n }\n }\n if(!file_exists($_SERVER['DOCUMENT_ROOT'].\"/../template/posts/\" . (Route::getValue('LANGUAGE') === false ? '' : Route::getValue('LANGUAGE').'/') . Route::getValue(\"ID\").\".php\")) {\n require $_SERVER['DOCUMENT_ROOT'].\"/../template/\" . Route::searchError(Route::ERROR_NOT_FOUND);\n return;\n }\n foreach (self::$HEADERS as $header) {\n require $_SERVER['DOCUMENT_ROOT']. \"/../template/\" . $header;\n }\n\n require $_SERVER['DOCUMENT_ROOT'].\"/../template/posts/\" . (Route::getValue('LANGUAGE') === false ? '' : Route::getValue('LANGUAGE').'/') . Route::getValue(\"ID\").\".php\";\n\n foreach (self::$FOOTERS as $footer) {\n require $_SERVER['DOCUMENT_ROOT']. \"/../template/\" . $footer;\n }\n }", "public function load($idPost, $idCategoria, $idUsuario);", "public function load_post(string $filename) {\n\t\t$filename .= $this->post_extension;\n\n\t\t// Get from posts if already loaded.\n\t\tif (isset($this->posts)) {\n\t\t\tif (isset($this->posts[$filename])) {\n\t\t\t\treturn $this->posts[$filename];\n\t\t\t}\n\t\t}\n\n\t\t// Get from cache file\n\t\tif ($this->get_posts_from_cache()) {\n\t\t\t// Fetch from cache\n\t\t\tif (isset($this->posts[$filename])) {\n\t\t\t\treturn $this->posts[$filename];\n\t\t\t}\n\t\t}\n\n\t\t// Fetch from filesystem.\n\t\t$filename = str_replace(['..', '~', '|', '*', '$', '\"', '?', \"'\"], '', $filename);\n\t\tif (!file_exists($this->posts_dir . '/' . $filename)) {\n\t\t\t// File not found.\n\t\t\tthrow new Exception('Post not found.');\n\t\t}\n\n\t\treturn $this->prepare_post($this->posts_dir . '/' . $filename);\n\t}", "public function load_posts() : void {\n\t\t// Get from cache.\n\t\tif ($this->get_posts_from_cache()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!$this->posts_dir) {\n\t\t\tthrow new Exception('Posts_dir must be set before calling load_posts()');\n\t\t}\n\n\t\t$this->posts = [];\n\t\tforeach (glob($this->posts_dir . '/*' . $this->post_extension) as $key => $path) {\n\t\t\t$object = $this->prepare_post($path);\n\t\t\tif (!$object) {\n\t\t\t\t// Not published.\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$this->posts[basename($path)] = $object;\n\t\t}\n\n\t\t$this->count_posts = count($this->posts);\n\n\t\t// Save to cache.\n\t\t$this->save_cache();\n\t}", "public function loadPost($id=null)\n {\n if($this->_post===null)\n {\n if($id!==null || isset($_GET['id']))\n $this->_post=Post::model()->findbyPk($id!==null ? $id : $_GET['id']);\n if($this->_post===null ||\n\t\t\tYii::app()->user->status!=User::STATUS_ADMIN\n\t\t\t&& Yii::app()->user->status!=User::STATUS_WRITER\n\t\t\t&& $this->_post->status!=Post::STATUS_PUBLISHED\n\t\t\t&& $this->_post->publishTime<time() )\n throw new CHttpException(404,'The requested page does not exist.');\n }\n return $this->_post;\n }", "protected function set_post() {\n $this->post = $this->safe_find_from_id('Post');\n }", "public function load( $id )\n\t{\n\t\t$posttype_class = get_called_class();\n\t\t\n\t\t$post = get_post( $id );\n\t\tif ( $post && get_post_type( $post ) == $posttype_class::$post_type ) {\n\t\t\t$this->id = $post->ID;\n\t\t\t$this->title = $post->post_title;\n\t\t\t$this->content = $post->post_content;\n\t\t}\n\t\treturn $this;\n\t}", "public function load_source_object()\n\t{\n\t\tif (!is_object($this->post))\n\t\t{\n\t\t\t$this->post = new titania_post();\n\t\t\t$this->post->load($this->attention_object_id);\n\t\t}\n\n\t\treturn (is_object($this->post)) ? true : false;\n\t}", "public function getPostContent();", "public function load(){\n // Return null/error text\n\n $this->_data=[\n 'id'=>$this->id,\n 'photo'=>'test'.$this->id.'.png',\n 'descr'=>'The description of '.$this->id.' post.'\n ];\n return null;\n// return 'Data loading error';\n }", "function get_post_data() {\n\t\tif (empty($this->post)) :\n\t\t\t$this->post = get_post( $this->id );\n\t\tendif;\n\t\t\n\t\treturn $this->post;\n\t}", "public function get()\n {\n return $this->object = get_post($this->id);\n }", "function getPost($pid)\n {\n $post= $this->db->getPost($pid);\n if ($post)\n {\n //show a quick reference url, poster and posted datetime\n $post['posttitle'] = \"Posted by {$post['poster']} on {$post['postdate']}\";\n \n $post['downloadurl'] = $this->conf['this_script'] . \"?dl=$pid\";\n $post['deleteurl'] = $this->conf['this_script'] . \"?erase=$pid\";\n $post['pid'] = $pid;\n }\n else\n {\n $post['code'] = '<b>Unknown post id, it may have been deleted</b><br />';\n $this->errors[] = 'Unknown post id, it may have expired or been deleted';\n } \n \n return $post;\n }", "public function wpcd_app_load_post() {\n\n\t\t$screen = get_current_screen();\n\n\t\tif ( 'wpcd_app' === $screen->post_type && isset( $_GET['action'] ) && 'edit' === $_GET['action'] && ! wpcd_is_admin() ) {\n\t\t\t$post_id = filter_input( INPUT_GET, 'post', FILTER_SANITIZE_NUMBER_INT );\n\t\t\t$user_id = (int) get_current_user_id();\n\t\t\t$post_author = (int) get_post( $post_id )->post_author;\n\n\t\t\tif ( ! wpcd_user_can( $user_id, 'view_app', $post_id ) && (int) $post_author !== $user_id ) {\n\t\t\t\twp_die( esc_html( __( 'You don\\'t have permission to edit this post.', 'wpcd' ) ) );\n\t\t\t}\n\t\t}\n\t}", "public function load_topic_object()\n\t{\n\t\tif (!$this->post->topic->topic_id)\n\t\t{\n\t\t\t$this->post->topic->topic_id = $this->post->topic_id;\n\t\t\t$this->post->topic->load();\n\t\t}\n\t}", "private function prepare_post(string $path) {\n\t\t$file_content = file_get_contents($path);\n\n\t\t// Get yaml settings of the top\n\t\t$yaml_start = strpos($file_content, '---') + 3;\n\t\t$yaml_end = strpos($file_content, '---', $yaml_start);\n\t\t$yaml = substr($file_content, $yaml_start, $yaml_end - 3);\n\n\t\t// Set post object.\n\t\t$object = (object) Yaml::parse($yaml);\n\n\t\tif (isset($object->{$this->published_key}) && !$object->{$this->published_key}) {\n\t\t\t// Not published.\n\t\t\treturn false;\n\t\t}\n\n\t\t$object->body = substr($file_content, $yaml_end + 3);\n\t\t$object->url = str_replace($this->post_extension, '', basename($path));\n\n\t\treturn $object;\n\t}", "public function show(post $post)\n {\n //\n }", "public function show(post $post)\n {\n //\n }", "function WoopPost( $post ) { $this->post = $post; }", "function pre_load_post_id($null, $post_id)\n {\n }", "public function show(Post $post)\n {\n //\n }", "public function show(Post $post)\n {\n //\n }", "public function show(Post $post)\n {\n //\n }", "public function show(Post $post)\n {\n //\n }" ]
[ "0.82430947", "0.659057", "0.6574012", "0.65224725", "0.6446955", "0.64136934", "0.6398996", "0.6298996", "0.6190127", "0.6155047", "0.6147701", "0.61204314", "0.6089961", "0.60859454", "0.5997868", "0.58936036", "0.5884143", "0.5883978", "0.587809", "0.5862912", "0.5843065", "0.5774293", "0.5758273", "0.5758273", "0.57544225", "0.57279783", "0.5718207", "0.5718207", "0.5718207", "0.5718207" ]
0.6937206
1
Quick load a topic
public function load_topic($topic_id) { topics_overlord::load_topic($topic_id); $topic = topics_overlord::get_topic_object($topic_id); if ($topic === false) { trigger_error('NO_TOPIC'); } return $topic; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function load_topic_object()\n\t{\n\t\tif (!$this->post->topic->topic_id)\n\t\t{\n\t\t\t$this->post->topic->topic_id = $this->post->topic_id;\n\t\t\t$this->post->topic->load();\n\t\t}\n\t}", "private function getOneTopic() {\n $this->topic->findOne();\n }", "function loadTopics() {\r\n $dbh = DBHandlerClass::getInstance();\r\n $table = \"topics\";\r\n $colums = array(\"tID\", \"tName\", \"tDT\", \"users.uName\");\r\n $additionalTerm = \"INNER JOIN users on topics.uID = users.uID\";\r\n\r\n $topics = $dbh->readFromDB($table, $colums, $additionalTerm, NULL);\r\n printTopics($topics);\r\n}", "public function getTopic() {}", "public function getTopic();", "public function getTopic();", "public function setTopic($topic);", "public function show(Topic $topic)\n {\n //\n }", "public function show(Topic $topic)\n {\n //\n }", "public function show(Topic $topic)\n {\n //\n }", "public function __construct(Topic $topic)\n {\n $this->topic = $topic;\n }", "public function load_topics() {\n\n\t\t// Get our current master list of topics.\n\t\t$master_list = $this->get_cahnrs_topics();\n\n\t\t// Get our current list of top level parents.\n\t\t$level1_exist = get_terms( $this->cahnrs_topics, array( 'hide_empty' => false, 'parent' => '0' ) );\n\t\t$level1_assign = array();\n\t\tforeach( $level1_exist as $level1 ) {\n\t\t\t$level1_assign[ $level1->name ] = array( 'term_id' => $level1->term_id );\n\t\t}\n\n\t\t$level1_names = array_keys( $master_list );\n\t\t/**\n\t\t * Look for mismatches between the master list and the existing parent terms list.\n\t\t *\n\t\t * In this loop:\n\t\t *\n\t\t * * $level1_names array of top level parent names.\n\t\t * * $level1_name string containing a top level category.\n\t\t * * $level1_children array containing all of the current parent's child arrays.\n\t\t * * $level1_assign array of top level parents that exist in the database with term ids.\n\t\t */\n\t\tforeach( $level1_names as $level1_name ) {\n\t\t\tif ( ! array_key_exists( $level1_name, $level1_assign ) ) {\n\t\t\t\t$new_term = wp_insert_term( $level1_name, $this->cahnrs_topics, array( 'parent' => '0' ) );\n\t\t\t\tif ( ! is_wp_error( $new_term ) ) {\n\t\t\t\t\t$level1_assign[ $level1_name ] = array( 'term_id' => $new_term['term_id'] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Process the children of each top level parent.\n\t\t *\n\t\t * In this loop:\n\t\t *\n\t\t * * $level1_names array of top level parent names.\n\t\t * * $level1_name string containing a top level category.\n\t\t * * $level1_children array containing all of the current parent's child arrays.\n\t\t * * $level2_assign array of this parent's second level categories that exist in the database with term ids.\n\t\t */\n\t\tforeach( $level1_names as $level1_name ) {\n\n\t\t\t$level2_exists = get_terms( $this->cahnrs_topics, array( 'hide_empty' => false, 'parent' => $level1_assign[ $level1_name ]['term_id'] ) );\n\t\t\t$level2_assign = array();\n\n\t\t\tforeach( $level2_exists as $level2 ) {\n\t\t\t\t$level2_assign[ $level2->name ] = array( 'term_id' => $level2->term_id );\n\t\t\t}\n\n\t\t\t$level2_names = array_keys( $master_list[ $level1_name ] );\n\t\t\t/**\n\t\t\t * Look for mismatches between the expected and real children of the current parent.\n\t\t\t *\n\t\t\t * In this loop:\n\t\t\t *\n\t\t\t * * $level2_names array of the current parent's child level names.\n\t\t\t * * $level2_name string containing a second level category.\n\t\t\t * * $level2_children array containing the current second level category's children. Unused in this context.\n\t\t\t * * $level2_assign array of this parent's second level categories that exist in the database with term ids.\n\t\t\t */\n\t\t\tforeach( $level2_names as $level2_name ) {\n\t\t\t\tif ( ! array_key_exists( $level2_name, $level2_assign ) ) {\n\t\t\t\t\t$new_term = wp_insert_term( $level2_name, $this->cahnrs_topics, array( 'parent' => $level1_assign[ $level1_name ]['term_id'] ) );\n\t\t\t\t\tif ( ! is_wp_error( $new_term ) ) {\n\t\t\t\t\t\t$level2_assign[ $level2_name ] = array( 'term_id' => $new_term['term_id'] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Look for mismatches between second and third level category relationships.\n\t\t\t */\n\t\t\tforeach( $level2_names as $level2_name ) {\n\t\t\t\t$level3_exists = get_terms( $this->cahnrs_topics, array( 'hide_empty' => false, 'parent' => $level2_assign[ $level2_name ]['term_id'] ) );\n\t\t\t\t$level3_exists = wp_list_pluck( $level3_exists, 'name' );\n\n\t\t\t\t$level3_names = $master_list[ $level1_name ][ $level2_name ];\n\t\t\t\tforeach( $level3_names as $level3_name ) {\n\t\t\t\t\tif ( ! in_array( $level3_name, $level3_exists ) ) {\n\t\t\t\t\t\twp_insert_term( $level3_name, $this->cahnrs_topics, array( 'parent' => $level2_assign[ $level2_name ]['term_id'] ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t}", "public function __construct(Topic $topic)\n {\n $this->topic=$topic;\n $this->class=Classes::find($topic->class_id);\n }", "public function declareTopic(string $topic): void;", "public function show($id)\n {\n return Topic::find($id);\n }", "public function show(Topic $topic)\n {\n return $topic;\n }", "public function initTopics()\n {\n $collectionClassName = BiblioTopicTableMap::getTableMap()->getCollectionClassName();\n\n $this->collTopics = new $collectionClassName;\n $this->collTopicsPartial = true;\n $this->collTopics->setModel('\\Slims\\Models\\Masterfile\\Topic\\Topic');\n }", "public static function fetch($id, $asObject = true)\n {\n $cond = array( 'id' => $id );\n $topic = eZPersistentObject::fetchObject( self::definition(), null, $cond, $asObject );\n return $topic;\n }", "public function setTopic($topic)\n {\n $this->_topic = $topic;\n }", "public function getTopic()\n {\n \treturn TopicModel::findById($this->getTopicId());\n }", "public function setTopic(TopicInterface $topic);", "function addTopic(&$topic) {\n\t\t$this->topics[] = $topic;\n\t}", "public function register(Topic $topic);", "function target_add_topic($topic)\n{\n\t// if ($GLOBALS['VERBOSE']) pf('...'. $topic['id']);\n\n\tif (!isset($topic['orderexpiry'])) {\n\t\t$topic['orderexpiry'] = 0;\n\t}\n\n\t// Set orderexpiry for announcement and sticky topics.\n\tif (($topic['thread_opt'] & 2) || ($topic['thread_opt'] & 4)) {\n\t\t$topic['orderexpiry'] = 1000000000;\n\t}\n\n\t// Skip topics that doesn't belong to a forum.\n\tif (!isset($GLOBALS['forum_map'][ (int)$topic['forum_id'] ])) {\n\t\tpf('WARNING: Skip topic #'. $topic['id'] .'. Probably an announcement or orphaned message!');\n\t\treturn;\n\t}\n\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'thread (\n\t\tid, forum_id, root_msg_id, views, replies, thread_opt, orderexpiry\n\t\t) VALUES(\n\t\t\t'. (int)$topic['id'] .',\n\t\t\t'. $GLOBALS['forum_map'][ (int)$topic['forum_id'] ] .',\n\t\t\t'. (int)$topic['root_msg_id'] .',\n\t\t\t'. (int)$topic['views'] .',\n\t\t\t'. (int)$topic['replies'] .',\n\t\t\t'. (int)$topic['thread_opt'] .',\n\t\t\t'. (int)$topic['orderexpiry'] .')\n\t');\n}", "public function topics(Topics $topics = null);", "public function get_topic($topic_id) {\n $topic = Topic::find($topic_id);\n\n return response()->json($topic, 200);\n }", "public function BooksLS($topic){\n\t\t$url = 'http://192.168.1.5:8000/query/booktopic/' . $topic;\n\t\t$page = file_get_contents($url);\n\t\treturn response()->json(json_decode($page));\n\t}", "public function testTopic() {\n\n $this->installEntitySchema('ebms_board');\n $this->installEntitySchema('taxonomy_term');\n $this->installEntitySchema('ebms_topic');\n $this->installEntitySchema('user');\n $this->installSchema('system', ['sequences']);\n $entity_type_manager = $this->container->get('entity_type.manager');\n $topics = $entity_type_manager->getStorage('ebms_topic')->loadMultiple();\n $this->assertEmpty($topics);\n $name = 'Toenail Cancer';\n $board = Board::create(['name' => 'Test Board']);\n $board->save();\n $group_id = 135;\n $group_name = 'Lower Extremities';\n $topic_group = Term::create([\n 'tid' => $group_id,\n 'vid' => 'topic_groups',\n 'name' => $group_name,\n ]);\n $topic_group->save();\n $nci_reviewer = $this->createUser();\n $topic = Topic::create([\n 'name' => $name,\n 'board' => $board->id(),\n 'nci_reviewer' => $nci_reviewer,\n 'topic_group' => $topic_group->id(),\n 'active' => TRUE,\n ]);\n $topic->save();\n $topics = $entity_type_manager->getStorage('ebms_topic')->loadMultiple();\n $this->assertNotEmpty($topics);\n $this->assertCount(1, $topics);\n foreach ($topics as $topic) {\n $this->assertEquals($topic->getName(), $name);\n $this->assertEquals(TRUE, $topic->get('active')->value);\n $this->assertEquals($board->id(), $topic->get('board')->target_id);\n $this->assertEquals($nci_reviewer->id(), $topic->get('nci_reviewer')->target_id);\n $this->assertEquals($group_id, $topic->get('topic_group')->target_id);\n }\n }", "function cns_read_in_topic($topic_id, $start, $max, $view_poll_results = false, $check_perms = true)\n{\n if (!is_null($topic_id)) {\n $table = 'f_topics t LEFT JOIN ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_forums f ON f.id=t.t_forum_id';\n $select = array('t.*', 'f.f_is_threaded');\n if (multi_lang_content()) {\n $select[] = 't_cache_first_post AS p_post';\n } else {\n $table .= ' LEFT JOIN ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_posts p ON p.id=t.t_cache_first_post_id';\n $select[] = 'p_post,p_post__text_parsed,p_post__source_user';\n }\n $_topic_info = $GLOBALS['FORUM_DB']->query_select($table, $select, array('t.id' => $topic_id), '', 1);\n if (!array_key_exists(0, $_topic_info)) {\n warn_exit(do_lang_tempcode('MISSING_RESOURCE', 'topic'));\n }\n $topic_info = $_topic_info[0];\n\n // Are we allowed into here?\n // Check forum\n $forum_id = $topic_info['t_forum_id'];\n if (!is_null($forum_id)) {\n if ($check_perms) {\n if (!has_category_access(get_member(), 'forums', strval($forum_id))) {\n access_denied('CATEGORY_ACCESS_LEVEL');\n }\n }\n } else {\n // It must be a private topic. Do we have access?\n $from = $topic_info['t_pt_from'];\n $to = $topic_info['t_pt_to'];\n\n if (($from != get_member()) && ($to != get_member()) && (!cns_has_special_pt_access($topic_id)) && (!has_privilege(get_member(), 'view_other_pt'))) {\n access_denied('PRIVILEGE', 'view_other_pt');\n }\n\n decache(array(\n array('side_cns_private_topics', array(get_member())),\n array('_new_pp', array(get_member())),\n ));\n }\n // Check validated\n if (($topic_info['t_validated'] == 0) && (addon_installed('unvalidated'))) {\n if ((!has_privilege(get_member(), 'jump_to_unvalidated')) && ($check_perms) && ((is_guest()) || ($topic_info['t_cache_first_member_id'] != get_member()))) {\n access_denied('PRIVILEGE', 'jump_to_unvalidated');\n }\n }\n\n if (is_null(get_param_integer('threaded', null))) {\n if ($start > 0) {\n if ($topic_info['f_is_threaded'] == 1) {\n $_GET['threaded'] = '0';\n }\n }\n }\n $is_threaded = get_param_integer('threaded', (is_null($topic_info['f_is_threaded']) ? 0 : $topic_info['f_is_threaded']));\n if ($is_threaded != 1) {\n $is_threaded = 0; // In case of invalid URLs causing inconsistent handling\n }\n\n // Some general info\n require_code('seo2');\n list(, $meta_description) = _seo_meta_find_data(array(), get_translated_text($topic_info['p_post'], $GLOBALS['FORUM_DB']));\n $out = array(\n 'num_views' => $topic_info['t_num_views'],\n 'num_posts' => $topic_info['t_cache_num_posts'],\n 'validated' => $topic_info['t_validated'],\n 'title' => $topic_info['t_cache_first_title'],\n 'description' => $topic_info['t_description'],\n 'description_link' => $topic_info['t_description_link'],\n 'emoticon' => $topic_info['t_emoticon'],\n 'forum_id' => $topic_info['t_forum_id'],\n 'first_post' => $topic_info['p_post'],\n 'first_poster' => $topic_info['t_cache_first_member_id'],\n 'first_post_id' => $topic_info['t_cache_first_post_id'],\n 'pt_from' => $topic_info['t_pt_from'],\n 'pt_to' => $topic_info['t_pt_to'],\n 'is_open' => $topic_info['t_is_open'],\n 'is_threaded' => $is_threaded,\n 'is_really_threaded' => is_null($topic_info['f_is_threaded']) ? 0 : $topic_info['f_is_threaded'],\n 'last_time' => $topic_info['t_cache_last_time'],\n 'metadata' => array(\n 'identifier' => '_SEARCH:topicview:browse:' . strval($topic_id),\n 'numcomments' => strval($topic_info['t_cache_num_posts']),\n 'description' => $meta_description, // There's no meta description, so we'll take this as a description, which will feed through\n ),\n 'row' => $topic_info,\n );\n\n // Poll?\n if (!is_null($topic_info['t_poll_id'])) {\n require_code('cns_polls');\n if (is_guest()) {\n $voted_already_map = array('pv_poll_id' => $topic_info['t_poll_id'], 'pv_ip' => get_ip_address());\n } else {\n $voted_already_map = array('pv_poll_id' => $topic_info['t_poll_id'], 'pv_member_id' => get_member());\n }\n $voted_already = $GLOBALS['FORUM_DB']->query_select_value_if_there('f_poll_votes', 'pv_member_id', $voted_already_map);\n $test = cns_poll_get_results($topic_info['t_poll_id'], $view_poll_results || (!is_null($voted_already)));\n if ($test !== null) {\n $out['poll'] = $test;\n $out['poll']['voted_already'] = $voted_already;\n $out['poll_id'] = $topic_info['t_poll_id'];\n }\n }\n\n // Post query\n $where = cns_get_topic_where($topic_id);\n $query = 'SELECT p.* FROM ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_posts p WHERE ' . $where . ' ORDER BY p_time,p.id';\n } else {\n $out = array(\n 'num_views' => 0,\n 'num_posts' => 0,\n 'validated' => 1,\n 'title' => do_lang('INLINE_PERSONAL_POSTS'),\n 'description' => '',\n 'description_link' => '',\n 'emoticon' => '',\n 'forum_id' => null,\n 'first_post' => null,\n 'first_poster' => null,\n 'first_post_id' => null,\n 'pt_from' => null,\n 'pt_to' => null,\n 'is_open' => 1,\n 'is_threaded' => 0,\n 'last_time' => time(),\n 'metadata' => array(),\n 'row' => array(),\n );\n\n // Post query\n $where = 'p_intended_solely_for=' . strval(get_member());\n $query = 'SELECT p.* FROM ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_posts p WHERE ' . $where . ' ORDER BY p_time,p.id';\n\n $topic_info = array(\n 't_is_open' => 1,\n );\n }\n\n // Posts\n if ($out['is_threaded'] == 0) {\n if ($start < 200) {\n $_postdetailss = list_to_map('id', $GLOBALS['FORUM_DB']->query($query, $max, $start, false, false, array('p_post' => 'LONG_TRANS__COMCODE')));\n } else { // deep search, so we need to make offset more efficient, trade-off is more queries\n $_postdetailss = list_to_map('id', $GLOBALS['FORUM_DB']->query($query, $max, $start));\n }\n if (($start == 0) && (count($_postdetailss) < $max)) {\n $out['max_rows'] = $max; // We know that they're all on this screen\n } else {\n $out['max_rows'] = (is_null($topic_id) || $topic_info['t_cache_num_posts'] < 500) ? $GLOBALS['FORUM_DB']->query_value_if_there('SELECT COUNT(*) FROM ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_posts WHERE ' . $where) : $topic_info['t_cache_num_posts']/*for performance reasons*/;\n }\n $posts = array();\n // Precache member/group details in one fell swoop\n $members = array();\n foreach ($_postdetailss as $_postdetails) {\n $members[$_postdetails['p_poster']] = 1;\n if ($out['title'] == '') {\n $out['title'] = $_postdetails['p_title'];\n }\n }\n cns_cache_member_details(array_keys($members));\n\n $i = 0;\n foreach ($_postdetailss as $_postdetails) {\n $_postdetails['message_comcode'] = get_translated_text($_postdetails['p_post'], $GLOBALS['FORUM_DB']);\n\n $linked_type = '';\n $linked_id = '';\n $linked_url = '';\n\n // If it's a spacer post, see if we can detect it better\n list($is_spacer_post, $spacer_post_lang) = is_spacer_post($_postdetails['message_comcode']);\n if ($is_spacer_post) {\n $c_prefix = do_lang('COMMENT', null, null, null, $spacer_post_lang) . ': #';\n if ((substr($out['description'], 0, strlen($c_prefix)) == $c_prefix) && ($out['description_link'] != '')) {\n list($linked_type, $linked_id) = explode('_', substr($out['description'], strlen($c_prefix)), 2);\n $linked_url = $out['description_link'];\n $out['description'] = '';\n }\n }\n\n // Load post\n $post_row = db_map_restrict($_postdetails, array('id', 'p_post'));\n $_postdetails['message'] = get_translated_tempcode('f_posts', $post_row, 'p_post', $GLOBALS['FORUM_DB']);\n\n // Fake a quoted post? (kind of a nice 'tidy up' feature if a forum's threading has been turned off, leaving things for flat display)\n if ((!is_null($_postdetails['p_parent_id'])) && (strpos($_postdetails['message_comcode'], '[quote') === false)) {\n $p = mixed(); // null\n if (array_key_exists($_postdetails['p_parent_id'], $_postdetailss)) { // Ah, we're already loading it on this page\n $p = $_postdetailss[$_postdetails['p_parent_id']];\n\n // Load post\n $_p = db_map_restrict($p, array('id', 'p_post'));\n $p['message'] = get_translated_tempcode('f_posts', $_p, 'p_post', $GLOBALS['FORUM_DB']);\n } else { // Drat, we need to load it\n $_p = $GLOBALS['FORUM_DB']->query_select('f_posts', array('*'), array('id' => $_postdetails['p_parent_id']), '', 1);\n if (array_key_exists(0, $_p)) {\n $p = db_map_restrict($_p[0], array('id', 'p_post'));\n $p['message'] = get_translated_tempcode('f_posts', $p, 'p_post', $GLOBALS['FORUM_DB']);\n }\n }\n $temp = $_postdetails['message'];\n $_postdetails['message'] = new Tempcode();\n $_postdetails['message'] = do_template('COMCODE_QUOTE_BY', array('_GUID' => '4521bfe295b1834460f498df488ee7cb', 'SAIDLESS' => false, 'BY' => $p['p_poster_name_if_guest'], 'CONTENT' => $p['message']));\n $_postdetails['message']->attach($temp);\n }\n\n // Spacer posts may have a better first post put in place\n if ($is_spacer_post) {\n require_code('cns_posts');\n list($new_description, $new_post) = cns_display_spacer_post($linked_type, $linked_id);\n //if (!is_null($new_description)) $out['description']=$new_description; Actually, it's a bit redundant\n if (!is_null($new_post)) {\n $_postdetails['message'] = $new_post;\n }\n\n $is_ticket = false;\n if (addon_installed('tickets')) {\n require_code('tickets');\n if (is_ticket_forum($forum_id)) {\n $is_ticket = true;\n }\n }\n if ($is_ticket) {\n require_lang('tickets');\n require_code('feedback');\n $ticket_id = extract_topic_identifier($out['description']);\n $ticket_type_id = $GLOBALS['SITE_DB']->query_select_value_if_there('tickets', 'ticket_type', array('ticket_id' => $ticket_id));\n $ticket_type_name = mixed();\n if (!is_null($ticket_type_id)) {\n $ticket_type_name = $GLOBALS['SITE_DB']->query_select_value_if_there('ticket_types', 'ticket_type_name', array('id' => $ticket_id));\n }\n $out['title'] = do_lang_tempcode('_VIEW_SUPPORT_TICKET', escape_html($out['title']), is_null($ticket_type_name) ? do_lang('UNKNOWN') : escape_html(get_translated_text($ticket_type_name)));\n $_postdetails['p_title'] = '';\n } else {\n $out['title'] = protect_from_escaping(do_lang('SPACER_TOPIC_TITLE_WRAP', escape_html($out['title']), '', '', $spacer_post_lang));\n $_postdetails['p_title'] = do_lang('SPACER_TOPIC_TITLE_WRAP', $_postdetails['p_title'], '', '', $spacer_post_lang);\n }\n }\n\n // Put together\n $collated_post_details = cns_get_details_to_show_post($_postdetails, $topic_info, ($start == 0) && (count($_postdetailss) == 1));\n $collated_post_details['is_spacer_post'] = $is_spacer_post;\n $posts[] = $collated_post_details;\n\n $i++;\n }\n\n $out['posts'] = $posts;\n }\n\n // Any special topic/for-any-post-in-topic controls?\n if (!is_null($topic_id)) {\n $out['last_poster'] = $topic_info['t_cache_last_member_id'];\n $out['last_post_id'] = $topic_info['t_cache_last_post_id'];\n if (cns_may_post_in_topic($forum_id, $topic_id, $topic_info['t_cache_last_member_id'], $topic_info['t_is_open'] == 0)) {\n $out['may_reply'] = true;\n }\n if (cns_may_post_in_topic($forum_id, $topic_id, $topic_info['t_cache_last_member_id'], $topic_info['t_is_open'] == 0, null, true)) {\n $out['may_reply_private_post'] = true;\n }\n if (cns_may_report_post()) {\n $out['may_report_posts'] = true;\n }\n if (cns_may_make_private_topic()) {\n $out['may_pt_members'] = true;\n }\n if (cns_may_edit_topics_by($forum_id, get_member(), $topic_info['t_cache_first_member_id'])) {\n $out['may_edit_topic'] = true;\n }\n require_code('cns_moderation');\n require_code('cns_forums');\n if (cns_may_warn_members()) {\n $out['may_warn_members'] = true;\n }\n if (cns_may_delete_topics_by($forum_id, get_member(), $topic_info['t_cache_first_member_id'])) {\n $out['may_delete_topic'] = true;\n }\n if (cns_may_perform_multi_moderation($forum_id)) {\n $out['may_multi_moderate'] = true;\n }\n if (has_privilege(get_member(), 'use_quick_reply')) {\n $out['may_use_quick_reply'] = true;\n }\n $may_moderate_forum = cns_may_moderate_forum($forum_id);\n if ($may_moderate_forum) {\n if ($topic_info['t_is_open'] == 0) {\n $out['may_open_topic'] = true;\n } else {\n $out['may_close_topic'] = true;\n }\n if ($topic_info['t_pinned'] == 0) {\n $out['may_pin_topic'] = true;\n } else {\n $out['may_unpin_topic'] = true;\n }\n if ($topic_info['t_sunk'] == 0) {\n $out['may_sink_topic'] = true;\n } else {\n $out['may_unsink_topic'] = true;\n }\n if ($topic_info['t_cascading'] == 0) {\n $out['may_cascade_topic'] = true;\n } else {\n $out['may_uncascade_topic'] = true;\n }\n $out['may_move_topic'] = true;\n $out['may_move_posts'] = true;\n $out['may_delete_posts'] = true;\n $out['may_validate_posts'] = true;\n $out['may_make_private'] = true;\n $out['may_change_max'] = true;\n } else {\n if (($topic_info['t_cache_first_member_id'] == get_member()) && (has_privilege(get_member(), 'close_own_topics')) && ($topic_info['t_is_open'] == 1)) {\n $out['may_close_topic'] = true;\n }\n }\n if (!is_null($topic_info['t_poll_id'])) {\n require_code('cns_polls');\n\n if (cns_may_edit_poll_by($forum_id, $topic_info['t_cache_first_member_id'])) {\n $out['may_edit_poll'] = true;\n }\n if (cns_may_delete_poll_by($forum_id, $topic_info['t_cache_first_member_id'])) {\n $out['may_delete_poll'] = true;\n }\n } else {\n require_code('cns_polls');\n\n if (cns_may_attach_poll($topic_id, $topic_info['t_cache_first_member_id'], !is_null($topic_info['t_poll_id']), $forum_id)) {\n $out['may_attach_poll'] = true;\n }\n }\n } else {\n $out['last_poster'] = null;\n $out['last_post_id'] = null;\n }\n\n return $out;\n}", "function _show_topic() {\n\n\t\t$_posts_per_page = !empty(module('forum')->USER_SETTINGS['POSTS_PER_PAGE']) ? module('forum')->USER_SETTINGS['POSTS_PER_PAGE'] : module('forum')->SETTINGS['NUM_POSTS_ON_PAGE'];\n\n\t\tif (!module('forum')->SETTINGS['ALLOW_PRINT_TOPIC']) {\n\t\t\treturn module('forum')->_show_error('Print topic is disabled');\n\t\t}\n\n\t\tmain()->NO_GRAPHICS = true;\n\n\t\t$topic_id = intval($_GET['id']);\n\n\t\t// Get topic info\n\t\t$topic_info = db()->query_fetch('SELECT * FROM '.db('forum_topics').' WHERE id='.intval($topic_id).' LIMIT 1');\n\t\tif (empty($topic_info)) {\n\t\t\treturn '';\n\t\t}\n\t\t?>\n<html>\n<head>\n<title><?php echo $topic_info['name']?></title>\n<style type=\"text/css\">\n<!--\ntd, p, div\n{\n\tfont: 10pt verdana;\n}\n.smallfont\n{\n\tfont-size: 11px;\n}\n.tborder\n{\n\tborder: 1px solid #808080;\n}\n.thead\n{\n\tbackground-color: #EEEEEE;\n}\n.page\n{\n\tbackground-color: #FFFFFF;\n\tcolor: #000000;\n}\n-->\n</style>\n</head>\n<body class=\"page\">\n\t\t<?php\n\n\t\techo \"<a href='\".process_url(\"./?object=forum&action=view_topic&id=\".$topic_id).\"'><b>\".$topic_info[\"name\"].\"</b></a><br/>\".PHP_EOL;\n\t\t// Prepare SQL query\n\t\t$sql = 'SELECT * FROM '.db('forum_posts').' WHERE topic='.$topic_id;\n\t\t$order_by = ' ORDER BY created ASC ';\n\t\tlist($add_sql, $pages, $topic_num_posts) = common()->divide_pages($sql, null, null, $_posts_per_page);\n\n\t\tif (!empty($pages))\n\t\t {\n\t\t\techo '<br /><small>Pages: '.$pages.'</small>'.PHP_EOL;\n\t\t }\n\n\t\techo '<BR>';\n\t\t// Init bb codes module\n\t\t$BB_OBJ = _class('bb_codes');\n\t\t// Process posts\n\t\t$Q = db()->query($sql. $order_by. $add_sql);\n\t\twhile ($post_info = db()->fetch_assoc($Q))\n\t\t {\n\t\t ?>\n<table class=\"tborder\" cellpadding=\"6\" cellspacing=\"1\" border=\"0\" width=\"100%\">\n <tr>\n\t<td class=\"page\">\n\t\t<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\">\n\t\t <tr valign=\"bottom\">\n\t\t\t<td style=\"font-size:14pt\"><?php echo _prepare_html($post_info['user_name'])?></td>\n\t\t\t<td class=\"smallfont\" align=\"right\"><?php echo _format_date($post_info['created'], 'long')?></td>\n\t\t </tr>\n\t\t</table>\n\t\t<hr/>\n\t\t<div><?php echo $BB_OBJ->_process_text($post_info['text'])?></div>\n\t</td>\n </tr>\n</table>\n<br/>\n\t\t <?php\n\t\t }\n\t\techo '</body></html>';\n\t}" ]
[ "0.749478", "0.6596551", "0.6348433", "0.6081289", "0.6074142", "0.6074142", "0.60705966", "0.6006119", "0.6006119", "0.6006119", "0.59554875", "0.58588475", "0.58417475", "0.5726479", "0.5675289", "0.5650179", "0.56272954", "0.5625256", "0.5554063", "0.55215055", "0.54951787", "0.5459627", "0.54386806", "0.542601", "0.5388194", "0.5387122", "0.53671765", "0.53504187", "0.5326983", "0.5326317" ]
0.6622552
1
/ $recipient_email can be an array
public function to($recipient_email){ if (is_array($recipient_email)){ $this->_to = array_merge($this->_to, $recipient_email); }else{ $this->_to[] = $recipient_email; } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addRecipient($recipient)\n\t{\n\t\t// If the recipient is an aray, add each recipient... otherwise just add the one\n\t\tif (is_array($recipient))\n\t\t{\n\t\t\tforeach ($recipient as $to) {\n\t\t\t\t$to = JMailHelper::cleanLine( $to );\n\t\t\t\t$this->AddAddress($to);\n\t\t\t}\n\t\t} else {\n\t\t\t$recipient = JMailHelper::cleanLine( $recipient );\n\t\t\t$this->AddAddress($recipient);\n\t\t}\n\t}", "public function withRecipients(array $recipients);", "function get_recipients_from_text($recipients)\n {\n $result = [];\n if($recipients)\n {\n $text = trim($recipients);\n $textAr = explode(\"\\n\", $text);\n \n foreach($textAr as $line)\n {\n $str = trim($line);\n $subArr = explode(',', $str);\n $temp = [];\n \n if (filter_var($subArr[0], FILTER_VALIDATE_EMAIL)) {\n $temp['email'] = $subArr[0];\n if($subArr[1])\n {\n $nameArr = split_name($subArr[1]);\n if($nameArr)\n {\n $temp['first_name'] = $nameArr['first_name']; \n $temp['last_name'] = $nameArr['middle_name'].' '.$nameArr['last_name']; \n }\n }\n $temp['custom'] = $subArr;\n array_push($result, $temp);\n } \n }\n }\n return $result;\n }", "public function setGiftcardRecipientEmail($value);", "public function getRecipients();", "public function setToEmailAddress($toEmailAddress, $recipientName);", "function my_custom_recipient( $email ) {\n\n\treturn '[email protected]';\n}", "public function getNewsletterRecipientIDs();", "protected function getRecipientEmails()\n {\n return $this->recipients\n ->map(function($user) {\n return $user->{User::COLUMN_EMAIL};\n })\n ->toArray();\n }", "protected function _prepareRecipients(\n array $recipients)\n {\n $result = [];\n // users\n if (isset($recipients['users'])) {\n if (!is_array($recipients['users'])) {\n throw new \\InvalidArgumentException('\"users\" must be an array.');\n }\n foreach ($recipients['users'] as $userId) {\n if (!is_scalar($userId)) {\n throw new \\InvalidArgumentException('User identifier must be scalar.');\n } elseif (!ctype_digit($userId) && (!is_int($userId) || $userId < 0)) {\n throw new \\InvalidArgumentException(sprintf('\"%s\" is not a valid user identifier.', $userId));\n }\n }\n // Although this is an array of groups, you will get \"Only one group is supported.\" error\n // if you will try to use more than one group here.\n // And we can't user json_encode() here, because each user id must be a number.\n $result['users'] = '[['.implode(',', $recipients['users']).']]';\n }\n // thread\n if (isset($recipients['thread'])) {\n if (!is_scalar($recipients['thread'])) {\n throw new \\InvalidArgumentException('Thread identifier must be scalar.');\n } elseif (!ctype_digit($recipients['thread']) && (!is_int($recipients['thread']) || $recipients['thread'] < 0)) {\n throw new \\InvalidArgumentException(sprintf('\"%s\" is not a valid thread identifier.', $recipients['thread']));\n }\n // Although this is an array, you will get \"Need to specify thread ID or recipient users.\" error\n // if you will try to use more than one thread identifier here.\n // And we can't user json_encode() here, because thread id must be a number.\n $result['thread'] = '['.$recipients['thread'].']';\n }\n if (!count($result)) {\n throw new \\InvalidArgumentException('Please provide at least one recipient.');\n } elseif (isset($result['thread']) && isset($result['users'])) {\n throw new \\InvalidArgumentException('You can not mix \"users\" with \"thread\".');\n }\n\n return $result;\n }", "public function getRecipients($data)\n\t{\t\n\t\t// First of all check for test address in configuration\n\t\tif ($test_address[] = ComponentHelper::getParams('com_tkdclub')->get('email_test'))\n\t\t{\n\t\t\treturn $test_address;\n\t\t}\n\t\t\n\t\t$app = Factory::getApplication();\n\n\t\t// array for member recipients\n\t\t$member_recipients = array();\n\t\tarray_key_exists('active', $data) ? $member_recipients[] = 'active' : null;\n\t\tarray_key_exists('inactive', $data) ? $member_recipients[] = 'inactive' : null;\n\t\tarray_key_exists('supporter', $data) ? $member_recipients[] = 'support' : null;\n\n\t\t// Check for existing recipients\n\t\tif (empty($member_recipients) && !array_key_exists('newsletter', $data) && !is_numeric($data['event']))\n\t\t{\n\t\t\t$app->enqueueMessage(Text::_('COM_TKDCLUB_NO_RECIPIENTS_SELECTED'), 'error');\n\t\t\t$app->setUserState('com_tkdclub.email.data', $data);\n\t\t\t\n\t\t\treturn false;\n\t\t}\n\n\t\t// Go to database and fetch email addresses\n\t\t$db = $this->getDbo();\n\t\t$email_adresses = array();\n\n\t\t// query recipients from memberstable\n\t\tif (!empty($member_recipients))\n\t\t{\n\t\t\t$q_members = $db->getQuery(true);\n\t\t\t$q_members->select('DISTINCT ' . $db->quoteName('email'))->from('#__tkdclub_members');\n\t\t\t$query_string = '';\n\t\t\t$or = '';\n\t\t\tforeach ($member_recipients as $value) \n\t\t\t{\n\t\t\t\t$query_string .= $or . $db->quoteName('member_state') . ' = ' . $db->quote($value);\n\t\t\t\t$or = ' OR ';\n\t\t\t}\n\t\t\t$q_members->where('(' . $query_string . ')');\n\t\t\t$q_members->where('NOT ' . $db->quoteName('email') . ' = ' . $db->quote(''));\n\n\t\t\t$email_adresses = array_merge($email_adresses, $db->setQuery($q_members)->loadColumn());\n\t\t}\n\n\t\t// query recipients from newsletter table\n\t\tif (array_key_exists('newsletter', $data))\n\t\t{\n\t\t\t$q_subscribers = $db->getQuery(true);\n\t\t\t$q_subscribers->select('DISTINCT' . $db->quoteName('email'))->from($db->quoteName('#__tkdclub_newsletter_subscribers'));\n\t\t\t$q_subscribers->where('NOT ' . $db->quoteName('email') . ' = ' . $db->quote(''));\n\n\t\t\t$email_adresses = array_merge($email_adresses, $db->setQuery($q_subscribers)->loadColumn());\n\t\t}\n\n\t\t// query recipients of event\n\t\tif (is_numeric($data['event']))\n\t\t{\n\t\t\t$q_event_participants = $db->getQuery(true);\n\t\t\t$q_event_participants->select('DISTINCT' . $db->quoteName('email'))->from($db->quoteName('#__tkdclub_event_participants'));\n\t\t\t$q_event_participants->where($db->quoteName('event_id') . ' = ' . (int) $data['event']);\n\t\t\t$q_event_participants->where('NOT ' . $db->quoteName('email') . ' = ' . $db->quote(''));\n\t\t\t$q_event_participants->where($db->quoteName('published') . ' = ' . 1);\n\n\t\t\t$email_adresses = array_merge($email_adresses, $db->setQuery($q_event_participants)->loadColumn());\n\t\t}\n\n\t\treturn array_unique($email_adresses);\n\t}", "public function get_user_email_recipients( $data, $custom_form, $entry ) {\n\t\t$email = array();\n\t\t$setting = $custom_form->settings;\n\t\tif ( ! isset( $setting['user-email-recipients'] ) || ! is_array( $setting['user-email-recipients'] ) || empty( $setting['user-email-recipients'] ) ) {\n\t\t\t$default_email = $this->get_user_email( $data, $custom_form );\n\t\t\t$email = array( $default_email );\n\n\t\t} else {\n\n\t\t\t$setting_recipients = $setting['user-email-recipients'];\n\n\t\t\tforeach ( $setting_recipients as $key => $setting_recipient ) {\n\t\t\t\t$setting_recipient = forminator_replace_form_data( $setting_recipient, $data );\n\t\t\t\t$setting_recipient = forminator_replace_variables( $setting_recipient, $custom_form->id, $data['current_url'] );\n\t\t\t\t$setting_recipient = forminator_replace_custom_form_data( $setting_recipient, $custom_form, $data, $entry, $this->skip_custom_form_data['user'] );\n\t\t\t\tif ( is_email( $setting_recipient ) ) {\n\t\t\t\t\t$email[] = $setting_recipient;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t$email = apply_filters_deprecated( 'forminator_get_admin_email_recipients', array( $email, $setting, $custom_form, $entry ), '1.6.2', 'forminator_get_user_email_recipients' );\n\n\t\treturn apply_filters( 'forminator_get_user_email_recipients', $email, $setting, $data, $custom_form, $entry );\n\t}", "public function email(string|array $email) : string|array\n\t{\n\t\treturn $this->handlers->map($email, function ($email) {\n\t\t\treturn $this->handlers->get('email')->filter($email);\n\t\t});\n\t}", "public function withRecipient($email, $name = null);", "public function getFailedRecipients() {}", "function validateEmails($apiPublicKey, $emailAddressArray) {\n\n $emailsAddresses = implode(\",\", $emailAddressArray);\n\n $fields = array(\n 'addresses' => $emailsAddresses,\n 'api_key' => $apiPublicKey,\n );\n\n\n $getFields = http_build_query($fields);\n $url = \"https://api.mailgun.net/v3/address/parse?\" . $getFields;\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set to 1 to verify SSL connection\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\n $jsonResponse = curl_exec($ch);\n $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n\n if ($status === 200) {\n\n return $jsonResponse;\n } else {\n\n //API error, setup error handling\n }\n}", "public function get_emails() {\n\n\t\t$emails = array();\n\n\t\tforeach ( $this->settings['recipients'] as $item ) {\n\t\t\t$emails[] = $item['value'];\n\t\t}\n\n\t\treturn $emails;\n\t}", "private function filterEmailNotificationsRecipients()\n {\n return collect($this->getEmailNotificationsRecipients())\n ->filter(function (array $recipient) {\n return isset($recipient['address'])\n && is_email($recipient['address']);\n })\n ->toArray();\n }", "public function recipient($recipient)\n {\n return $this->setProperty('recipient', $recipient);\n }", "function get_recipients($address_list, $num_recipients = 1)\n{\n\t$recipient = array();\n\n\t$count = 0;\n\tforeach ($address_list as $field => $adr_ary)\n\t{\n\t\tforeach ($adr_ary as $id => $type)\n\t\t{\n\t\t\tif ($count >= $num_recipients)\n\t\t\t{\n\t\t\t\tbreak 2;\n\t\t\t}\n\t\t\t$recipient[$field][$id] = $type;\n\t\t\t$count++;\n\t\t}\n\t}\n\n\treturn $recipient;\n}", "abstract function getEmailsArray() : array;", "public function validate(array $data)\n\t{\n\t\tif (!isset($data['email'])) {\n\t\t\tthrow new AvisotaRecipientException($data, 'The recipient has no email!');\n\t\t}\n\t\tif (!$this->isValidEmailAddress($data['email'])) {\n\t\t\tthrow new AvisotaRecipientException($data, 'The email \"' . $data['email'] . '\" is not valid!');\n\t\t}\n\t}", "function get_emails($return_email = '')\n\t{\n\t\t$xml = $this->load_url(\"settings/emailaddresses\");\n\n\t\tif(!$xml):\n\t\t\treturn false;\n\t\tendif;\n\n\t\t// parse into nicer array\n\t\t$emails = array();\n\t\t$_emails = (isset($xml['feed']['entry'])) ? $xml['feed']['entry'] : false;\n\n\t\tif(is_array($_emails)):\n\t\t\tif(isset($_emails[0]['link_attr']['href'])):\n\t\t\t\tforeach($_emails as $k => $v):\n\t\t\t\t\t$id = $this->get_id_from_link($v['link_attr']['href']);\n\t\t\t\t\t$email = $v['content']['Email'];\n\t\t\t\t\t$email['id'] = $id;\n\n\t\t\t\t\tif($return_email && $return_email == $v['content']['Email']['EmailAddress']):\n\t\t\t\t\t\t// return single email\n\t\t\t\t\t\treturn $email;\n\t\t\t\t\tendif;\n\n\t\t\t\t\t$emails[] = $email;\n\t\t\t\tendforeach;\n\t\t\telse:\n\t\t\t\t$id = $this->get_id_from_link($_emails['link_attr']['href']);\n\t\t\t\t$email = $_emails['content']['Email'];\n\t\t\t\t$email['id'] = $id;\n\t\t\t\t$emails[] = $email;\n\n\t\t\t\tif($return_email && $return_email == $_emails['content']['Email']['EmailAddress']):\n\t\t\t\t\t// return single email\n\t\t\t\t\treturn $email;\n\t\t\t\tendif;\n\t\t\tendif;\n\n\t\tendif;\n\n\t\treturn $emails;\n\t}", "public function getSimpleEmails($recipients)\n {\n $simpleEmails = [];\n if (array_key_exists('emails_input', $recipients)) {\n foreach ($recipients['emails_input'] as $email) {\n if (!in_array($email, $simpleEmails) && strlen(trim($email)) != 0) {\n array_push($simpleEmails, $email);\n }\n }\n }\n return $simpleEmails;\n }", "function get_recipients($string){\n\t\t$addresses = explode(', ', $string);\n\t\tforeach($addresses as $value){\n\t\t\t$element = count($this->to);\n\t\t\t$this->to[$element] = $value;\n\t\t}\n\t}", "public function set( $recipient ) {\n\t\tswitch ( gettype( $recipient ) ) {\n\t\t\tcase 'string':\n\t\t\t\t$this->parse( $recipient );\n\t\t\t\tbreak;\n\t\t\tcase 'object':\n\t\t\t\t$recipient = (array) $recipient; // Convert and continue to 'array' case\n\t\t\tcase 'array':\n\t\t\t\tif ( isset( $recipient['name'] ) ) {\n\t\t\t\t\t$this->name = $recipient['name'];\n\t\t\t\t}\n\t\t\t\tif ( isset( $recipient['email'] ) ) {\n\t\t\t\t\t$this->email = $recipient['email'];\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}", "function convert_email($src_email_addr) {\n\n\t$final_emails_array=array();\n\t$src_email_addr=trim($src_email_addr,',');\t// Clean up email IDS\n\n\n\t$email_addr_arr=preg_split(\"/,/\",$src_email_addr);\n\t//echo \"<pre>convert_email(): ============================================ </pre>\";\n\t//echo \"<pre>convert_email(): SRC EMAIL [$src_email_addr]</pre>\";\n\t//echo \"<pre>convert_email(): SPLIT SRC EMAIL\".print_r($email_addr_arr,true).\"</pre>\";\n\n\tforeach ($email_addr_arr as $email_addr) {\n\t\t//echo \"<pre> convert_email(): EACH EMAIL=[$email_addr]</pre>\";\n\t\t// Split it by '<' to seperate the email id from the name\n\t\t$email_addr=preg_split(\"/</\",$email_addr);\n\t\tswitch (count($email_addr)) {\n\t\t\tcase 1:\t// Only email ID is present\n\t\t\t\t\t$email_id=trim(str_replace(\">\",\"\",$email_addr[0]));\n\t\t\t\t\t$name=$email_id;\n\t\t\t\t\tbreak;\n\t\t\tcase 2:\t// Both name & email ID is present\n\t\t\t\t\t$name=trim($email_addr[0]);\n\t\t\t\t\t$email_id=trim(str_replace(\">\",\"\",$email_addr[1]));\n\t\t\t\t\tbreak;\n\t\t}\n\t\t$final_emails_array[$email_id]=$name;\n\t\t//echo \"<pre> convert_email(): FINAL EMAILS ARRAY=[\".print_r($final_emails_array,true).\"]</pre>\";\n\t}\n\n\t//$a=array(\"asdsad\",\"adsdsa\"=>\"asdsad\",\"bbbb\");\n\t//echo \"<pre>convert_email(): EXPECTED FORMAT=[\".print_r($a,true).\"]</pre>\";\n\n\t//echo \"<pre>convert_email(): RETURNING FINAL EMAILS ARRAY=[\".print_r($final_emails_array,true).\"]</pre>\";\n\treturn $final_emails_array;\n}", "function getFeuserMail($Arr,&$conf) {\n\t\t\t$recipient='';\n\t\t\t// handle user mail !!!!\n\t\t\tif ($conf['fe_cruser_id']) {\n\t\t\t\t$feuserid=$Arr[$conf['fe_cruser_id']];\n\t\t\t\t$DBrows = $GLOBALS['TSFE']->sys_page->getRecordsByField('fe_users','uid',$feuserid,'','','1');\n\t\t\t\t$recipient=$DBrows[0]['email'];\n\t\t\t\t\n\t\t\t} elseif ($GLOBALS['TSFE']->fe_user->user[email]) {\n\t\t\t\t// Are we conencted, if so we take conencted user's email ???\n\t\t\t\t$recipient=$GLOBALS['TSFE']->fe_user->user[email];\n\t\t\t} else {\n\t\t\t\tif (!$conf['email.']['field']) echo 'Record Email field is not defined';\n\t\t\t\t$emailfields=t3lib_div::trimexplode(',',$conf['email.']['field']);\t\t\t\t\n\t\t\t\tforeach($emailfields as $ef) {\n\t\t\t\t\t$recipient.=$recipient?$Arr[$conf['email.']['field']].';'.$recipient:$Arr[$conf['email.']['field']];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $recipient;\n\t}", "function email_validation($toemail) \n\t{ \n\t\t$param_array = func_get_args();\n\t\t\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD email::email_validation() - PARAMETER LIST : ', $param_array);\n\t\t\t\n\t\tif($_SERVER['REMOTE_ADDR'] != \"127.0.0.1\")\n\t\t{\n\t\t\n\t\tglobal $HTTP_HOST; \n\t\t\n\t\t$result = array(); \n\t\t\n\t\t$result[0]=true; \n\t\t\n\t\t$result[1]=\"$toemail appears to be valid.\"; \n\t\t/* this regular expression is not allowing some of the domain names like .name etc., so we check for one @ symbol and \n\t\tatleast 1 \".\" symbol in email id.\n\t\tif (!eregi(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$\", $toemail)) \n\t\t{ \t\t\n\t\t\t$result[0]=false; \n\t\t\t\n\t\t\t$result[1]=\"$toemail is not properly formatted\"; \n\t\t\t\n\t\t}\n\t\t*/\n\t\t\n\t\t//remove the name from the email\n\t\t\n\t\t$earr = explode(\"<\", $toemail);\n\t\t\n\t\tif(count($earr) == 2 && strlen(trim($earr[1])) > 0)\n\t\t\t$email = substr(trim($earr[1]),0,-1);\n\t\telse\n\t\t\t$email = trim($earr[0]);\n\t\t\n\t\t$eml_arr = explode(\"@\",$email);\n\t\t$result[0]=false; \n\t\t\n\t\t$result[1]=\"$toemail is not properly formatted\"; \n\t\tif(count($eml_arr) == 2 && strlen(trim($eml_arr[0])) > 0 && strlen(trim($eml_arr[1])) > 0)\n\t\t{\n\t\t\t$domain_arr = explode(\".\",$eml_arr[1]);\n\t\t\tif(count($domain_arr) > 1 && strlen(trim($domain_arr[0])) > 0 && strlen(trim($domain_arr[1])) > 0)\n\t\t\t{\n\t\t\t\t$result[0]=true; \n\t\t\t\t$result[1]=\"$toemail appears to be valid.\"; \n\t\t\t}\n\t\t}\n\t\t\n\t\tif(1==2)\n\t\t{//need not check by communicating to email server...\n\t\t\n\t\tlist ( $username, $domain ) = split (\"@\",$toemail); \n\t\t\n\t\tif (getmxrr($domain, $MXHost)) \n\t\t{\t\t\n\t\t\t$connectaddress = $MXHost[0];\n\t\t}\n\t\telse \n\t\t{\t\t\n\t\t\t$connectaddress = $domain;\n\t\t} \n\t\t//echo \"Connect address : \" . $connectaddress . \"<br>\";\n\t\t//echo \"Domain Name : \" . $domain . \"<br>\";\n\t\t$connect = fsockopen ( $connectaddress, 25 ); \n\t\t\n\t\tif ($connect) \n\t\t{\t\t\n\t\t\tif (ereg(\"^220\", $Out = fgets($connect, 1024))) \n\t\t\t{ \n\t\t\t\n\t\t\t fputs ($connect, \"HELO $HTTP_HOST\\r\\n\"); \n\t\t\t \n\t\t\t $out = fgets ( $connect, 1024 ); \n\t\t\t \n\t\t\t $this->from_email = $GLOBALS['site_config']['admin_email'];\n\t\t\t \n\t\t\t $from = $this->from_email;\n\t\t\t \n\t\t\t fputs ($connect, \"MAIL FROM: <{$from}>\\r\\n\"); \n\t\t\t \n\t\t\t $from = fgets ( $connect, 1024 ); \n\t\t\t \n\t\t\t fputs ($connect, \"RCPT TO: <{$toemail}>\\r\\n\"); \n\t\t\t \n\t\t\t $to = fgets ($connect, 1024); \n\t\t\t \n\t\t\t fputs ($connect, \"QUIT\\r\\n\"); \n\t\t\t \n\t\t\t fclose($connect); \n\t\t\t \n\t\t\t if (!ereg (\"^250\", $from) || !ereg ( \"^250\", $to )) \n\t\t\t { \n\t\t\t \n\t\t\t\t $result[0]=false; \n\t\t\t\t \n\t\t\t\t $result[1]=\"Server rejected address\"; \n\t\t\t\t \n\t\t\t\t} \n\t\t\t} \n\t\t\t\n\t\t\telse\n\t\t\t{\t\t\t\t\n\t\t\t\t$result[0] = false; \n\t\t\t\t\n\t\t\t\t$result[1] = \"No response from server\"; \n\t\t\t\t\n\t\t\t } \n\t\t\t \n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$result[0]=false; \n\t\t\t\n\t\t\t$result[1]=\"Can not connect E-Mail server.\"; \n\t\t\t\n\t\t\t//return $result; \n\t\t} \n\t\t\n\t\t}\n\t\t\n\t\tif(!$result[0])\n\t\t{\n\n\t\t\t$ttext = \"\";\n\t\t\t$ttext .= \"<table border=0 cellpadding=3 cellspacing=1 align=center width=90%>\";\n\t\t\t$ttext .= \"<tr align=left><td><strong>Error Message</strong></td><td>\" . $result[1] . \" (\" . $toemail . \")\" . \"</td></tr>\";\n\t\t\t$ttext .= \"</table>\";\n\n\t\t\t$GLOBALS['logger_obj']->error('<br>METHOD email::email_validation() - Return Value : ', $ttext,'email');\n\n\t\t}\n\t}\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD email::email_validation() - Return Value : ', $result);\n\t\treturn $result; \n\t\t\n\t}", "public function _check_emails($field) {\n\t\t$emails = $this->{$field};\n\t\t$err = '';\n\t\tif ($emails) {\n\t\t\t$arr = explode(\",\", $emails);\n\t\t\tforeach($arr as $email) {\n\t\t\t\t$email = trim($email);\n\t\t\t\tif (!$this->form_validation->valid_email($email)) {\n\t\t\t\t\t$err .= \"Recipient email \" . $email . \" is not valid.<br />\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $err;\n\t}" ]
[ "0.66487527", "0.63839006", "0.62196976", "0.6194456", "0.6158166", "0.6129677", "0.6121412", "0.6102572", "0.6071816", "0.6024543", "0.60007596", "0.5993693", "0.59632194", "0.59590435", "0.59304976", "0.59201545", "0.5919289", "0.59009945", "0.5894222", "0.5879901", "0.58770794", "0.5867726", "0.58581156", "0.5851177", "0.5833059", "0.58252853", "0.57875544", "0.57836807", "0.57737714", "0.5770169" ]
0.6746485
0
Add a like action to a message
function like_message($userId, $messages, $action) { log_message('debug', '_message/like_message'); log_message('debug', '_message/like_message:: [1] userId='.$userId.' message='.json_encode($messages).' action='.$action); $result = $this->_query_reader->run('record_like_messages', array( 'user_id'=>$userId, 'messages'=>implode("','",$messages), 'like'=>($action == 'like'? 'Y': 'N'), 'dislike'=>($action == 'dislike'? 'Y': 'N') )); log_message('debug', '_message/like_message:: [1] result='.$result); return array('result'=>($result? 'SUCCESS': 'FAIL')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function likePostAction() {\n\n }", "function action_like () {\n\t\t\t$this->module->indexLike($_POST['id']);\n\t\n\t\t}", "public function like()\n\t{\n\t\tFoundry::checkToken();\n\n\t\t// Only registered users are allowed here.\n\t\tFoundry::requireLogin();\n\n\t\t// Check permission\n\t\t$access = Foundry::access();\n\n\t\t$id = JRequest::getInt( 'id', 0 );\n\n\t\t$table = Foundry::table( 'comments' );\n\t\t$table->load( $id );\n\n\t\t$likes = $table->like();\n\n\t\t$view = Foundry::view( 'comments', false );\n\n\t\tif( $likes === false )\n\t\t{\n\t\t\t$view->setMessage( JText::_( 'COM_EASYSOCIAL_COMMENTS_NOT_ABLE_TO_LIKE' ) , SOCIAL_MSG_ERROR );\n\t\t}\n\n\t\t$view->call( __FUNCTION__, $likes );\n\t}", "public function like() {\n if (isset($_POST) && !empty($_POST) && isset($_POST['like']) && !empty($_POST['like'])) {\n if (isset($_POST['token']) && $this->_model->compareTokens($_POST['token'])) {\n if (!$this->_model->like(explode(\"/\", $this->_url)[1])) {\n echo \"error\";\n }\n }\n }\n }", "public function like()\n {\n self::post(\"/photos/{$this->id}/like\");\n return true;\n }", "public function togglelikeAction()\n\t{\n\t\t$resource_id = (int) $this->getRequest()->getParam('resource_id');\n\t\t$resource_type = $this->getRequest()->getParam('resource_type');\n\t\t\n\t\t$Likes = new Application_Model_Likes();\n\t\t\n\t\t$ret = $Likes->toggleLike($resource_id, $resource_type);\n\t\t\n\t\tif ($ret['state'] == 1)\n\t\t\t$ret['text'] = $this->view->translate('Unlike');\n\t\telse\n\t\t\t$ret['text'] = $this->view->translate('Like');\n\t\t\n\t\t$this->getHelper('json')->sendJson($ret);\n\t}", "public function like()\n {\n $like = new Like(['user_id' => auth()->id()]);\n\n $this->likes()->save($like);\n }", "function messageReactionAdd(MessageReaction $reaction, User $user);", "public function likeItem($user_id, $item_id) {\n $this->itemAction($user_id, $item_id, 'like');\n }", "function like($idevent) {\n\n\t\t\t$method = WALL . \"/feeds/$idevent/like\";\n\n\t\t\t$verbmethod = \"POST\";\n\n\t\t\t$params = array();\n\n\t\t\t$params = array_filter($params, function($item) { return !is_null($item); });\n\n\t\t\t$response = $this->zyncroApi->callApi($method, $params, $verbmethod);\n\n\t\t\treturn $response;\n\t\t}", "function doLikeButton($p_dir){\n\t\techo '<div class=\"fb-like\" data-href=\"'. $p_dir .'\" data-width=\"300\" data-layout=\"standard\" data-action=\"like\" data-show-faces=\"true\" data-share=\"false\"></div>';\n\t}", "public function like()\n {\n $this->likes += 1;\n $this->save();\n }", "public function globallikesAction() {\n\t$viewer = Engine_Api::_()->user()->getViewer();\n\t// GET THE CURRENT UESRID\n\t$loggedin_user_id = $viewer->getIdentity();\n\tif (empty($loggedin_user_id)) {\n\t return;\n\t}\n\t$ad_id = $this->_getParam('ad_id');\n\t$core_like = $this->_getParam('core_like');\n\t$ad_id = Engine_Api::_()->communityad()->getEncodeToDecode($ad_id);\n\t$resource_type = $this->_getParam('resource_type');\n\t// Make an 'Item Type' acording to the resource type.\n\t$resource_info = Engine_Api::_()->getDbtable('modules', 'communityad')->getModuleInfo($resource_type);\n\tif (!empty($resource_info)) {\n\t $resource_type = $resource_info['table_name'];\n\t}\n\t$resource_id = $this->_getParam('resource_id');\n\t$owner_id = $this->_getParam('owner_id');\n\t$like_id = $this->_getParam('like_id');\n\t$resource_obj = Engine_Api::_()->getItem($resource_type, $resource_id); // Resource Object.\n\t$is_like = Engine_Api::_()->getDbtable('likes', 'core')->getLike($resource_obj, $viewer); // Check from 'core_likes'.\n\t//Conditioon: If advertisment is not liked before.\n\tif (empty($like_id)) {\n\t //CHECKING IF USER HAS MAKING DUPLICATE ENTRY OF LIKING AN APPLICATION.\n\t $userads = Engine_Api::_()->getItem('userads', $ad_id);\n\t $like_id_temp = Engine_Api::_()->communityad()->check_availability($ad_id);\n\t if (empty($like_id_temp[0]['like_id']) || !empty($userads->story_type)) {\n\n\t\t// Condition : Only for 'Group' & 'Event' for the 'Activity Like'.\n\t\tif ($resource_type == 'group' || $resource_type == 'event') {\n\t\t $activityTable = Engine_Api::_()->getDbtable('actions', 'activity');\n\t\t $activityTableName = $activityTable->info('name');\n\t\t // Queary: Check that entry are already in data base or not.\n\t\t $selectContainer = $activityTable->select()\n\t\t\t\t\t\t ->from($activityTableName, array('action_id', 'like_count'))\n\t\t\t\t\t\t ->where('object_type =?', $resource_type)\n\t\t\t\t\t\t ->where('object_id =?', $resource_id)\n\t\t\t\t\t\t ->where('type =?', $resource_type . '_create')\n\t\t\t\t\t\t ->limit(1);\n\t\t $fetchPagesettings = $selectContainer->query()->fetchAll();\n\t\t if (!empty($fetchPagesettings)) {\n\t\t\t$activityTable->update(array('like_count' => $fetchPagesettings[0]['like_count'] + 1), array('action_id =?' => $fetchPagesettings[0]['action_id']));\n\t\t\t$activityTable = Engine_Api::_()->getDbtable('likes', 'activity');\n\t\t\t$likeActivity = $activityTable->createRow();\n\t\t\t$likeActivity->resource_id = $fetchPagesettings[0]['action_id'];\n\t\t\t$likeActivity->poster_type = $viewer->getType();\n\t\t\t$likeActivity->poster_id = $viewer->getIdentity();\n\t\t\t$likeActivity->save();\n\t\t }\n\t\t}\n\n\t\t$likesTable = Engine_Api::_()->getDbTable('likes', 'communityad');\n\t\t$isExist = $likesTable->isExist($ad_id, $viewer->getIdentity());\n\n\n\t\t// Increase the \"Click Count of the Sponsored story\"\n\t\tif( !empty($userads->story_type) ) {\n\t\t Engine_Api::_()->communityad()->ad_clickcount($ad_id, 0);\n\t\t}\n\n\n\t\tif (empty($userads->story_type) && empty($isExist)) {\n\t\t $likeTableData = $likesTable->createRow();\n\t\t $likeTableData->poster_id = $viewer->getIdentity();\n\t\t $likeTableData->ad_id = $ad_id;\n\t\t //DATA CAN SAVE IN THE TABLE\n\t\t $like_id = $likeTableData->save();\n\t\t}\n\n\t\t// Condition: If content is not 'Like' then insert row in 'like' table and from 'Notification' table.\n\t\tif (empty($is_like)) {\n\t\t if ( !empty($resource_obj) && !empty($viewer) && Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitelike')) {\n\t\t Engine_Api::_()->sitelike()->setLikeFeed($viewer, $resource_obj);\n\t\t }\n\n\t\t $likeTable = Engine_Api::_()->getItemTable('core_like');\n\t\t $likeData = $likeTable->createRow();\n\t\t $likeData->resource_type = $resource_type;\n\t\t $likeData->resource_id = $resource_id;\n\t\t $likeData->poster_type = $viewer->getType();\n\t\t $likeData->poster_id = $viewer->getIdentity();\n\t\t $likeData->save();\n\t\t //DATA CAN SAVE IN THE TABLE\n\t\t // Queary: For insert data in 'notification' table for display notifications of the advertisment owner.\n\t\t if (!empty($owner_id) && $owner_id != $viewer->getIdentity()) {\n\t\t\t$notify_table = Engine_Api::_()->getDbtable('notifications', 'activity');\n\t\t\t$label = '{\"label\":\"' . $resource_type . '\"}';\n\n\t\t\t$notifyData = $notify_table->createRow();\n\t\t\t$notifyData->user_id = $owner_id;\n\t\t\t$notifyData->subject_type = $viewer->getType();\n\t\t\t$notifyData->subject_id = $viewer->getIdentity();\n\t\t\t$notifyData->object_type = $resource_type;\n\t\t\t$notifyData->object_id = $resource_id;\n\t\t\t$notifyData->type = 'liked';\n\t\t\t$notifyData->params = $label;\n\t\t\t$notifyData->date = date('Y-m-d h:i:s', time());\n\t\t\t$notifyData->save();\n\t\t }\n\t\t}\n\n\t\t// Increase 'Count' in userad table.\n\t\t$userads->count_like = $userads->count_like + 1;\n\t\t$userads->save();\n\n\t\t//PASS THE VALUE TO .TPL FILE\n\t\t$sendLikeResponced = $like_id;\n\t\tif (!empty($userads->story_type)) {\n\t\t $sendLikeResponced = 1;\n\t\t}\n\t\t$this->view->like_id = $sendLikeResponced;\n\t\t$like_msg = 'Successfully Liked.';\n\t } else {\n\t\t$this->view->like_id = $like_id_temp[0]['like_id'];\n\t }\n\t} else { // Condition: If 'Like' before then delete from tables.\n\t // Condition: Only in the case of group and event delete from activity like.\n\t if ($resource_type == 'group' || $resource_type == 'event') {\n\t\t$activityTable = Engine_Api::_()->getDbtable('actions', 'activity');\n\t\t$activityTableName = $activityTable->info('name');\n\t\t// Queary: Check that entry are already in data base or not.\n\t\t$selectContainer = $activityTable->select()\n\t\t\t\t\t\t->from($activityTableName, array('action_id', 'like_count'))\n\t\t\t\t\t\t->where('object_type =?', $resource_type)\n\t\t\t\t\t\t->where('object_id =?', $resource_id)\n\t\t\t\t\t\t->where('type =?', $resource_type . '_create')\n\t\t\t\t\t\t->limit(1);\n\t\t$fetchPagesettings = $selectContainer->query()->fetchAll();\n\t\tif (!empty($fetchPagesettings) && empty($core_like)) {\n\t\t $activityPosterType = $fetchPagesettings[0]['action_id'];\n\t\t Engine_Api::_()->getDbtable('likes', 'activity')->delete(array('resource_id =?' => $activityPosterType, 'poster_type =?' => $viewer->getType(), 'poster_id =?' => $viewer->getIdentity()));\n\t\t $activityTable->update(array('like_count' => $fetchPagesettings[0]['like_count'] - 1), array('action_id =?' => $fetchPagesettings[0]['action_id']));\n\t\t}\n\t }\n\n\t // Increase 'Count' in userad table.\n\t $userads = Engine_Api::_()->getItem('userads', $ad_id);\n\t $userads->count_like = $userads->count_like - 1;\n\t $userads->save();\n\n\t // Delete from 'communityad_like' table.\n\t if (empty($userads->story_type)) {\n\t\tEngine_Api::_()->getDbTable('likes', 'communityad')->delete(array('poster_id =?' => $viewer->getIdentity(), 'ad_id =?' => $ad_id));\n\t }\n\t if (!empty($is_like) && empty($core_like)) {\n\t\tif ( !empty($resource_obj) && !empty($viewer) && Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitelike')) {\n\t\t Engine_Api::_()->sitelike()->removeLikeFeed($viewer, $resource_obj);\n\t\t}\n\t\tEngine_Api::_()->getDbTable('likes', 'core')->delete(array('like_id =?' => $is_like->like_id));\n\t }\n\t $like_msg = 'Successfully Unliked.';\n\t}\n }", "abstract public function act($message);", "function userActionSay( $actionRequest ) {\n\t$actionKeyword = strtok( $actionRequest, \" \" );\n\t$message = trim( strtok('') );\n\t\n\tif( insertLog(\"user\", $_SESSION['userID'], $_SESSION['location'], $_SESSION['username'] .\" says \\\"<span class='speech'>\".$message.\"</span>\\\"\") ) {\n\t\taddNarrativeToXML(\"Said.\");\n\t} else {\n\t\taddNarrativeToXML(\"Said failed.\");\n\t}\n\treturn;\n}", "static function like_post($id_post,$id_liker){\n if(!(($id_user = PDOQueries::get_publisher_id($id_post)) > 0))\n throw new \\PersonalizeException(2001);\n $marker = '{like_post}{id_user/'.$id_liker.'}';\n $link = 'index.php?'.Navigation::$navigation_marker.'='.Timeline::$post_id_page.'#'.$id_post;\n return PDOQueries::add_notification($id_user,$marker,$link);\n }", "public function likecommentAction ()\r\n\t{\r\n\t\t$idcomment = $this->getRequest()->getParam('idcomment');\r\n\t\t$idnews = $this->getRequest()->getParam('idnews');\r\n\t\t$mTinTuc = new Default_Model_Mtintuc();\r\n\t\t\r\n\t\t$mTinTuc->likeComment($idcomment);\r\n\t\t$this->view->comment = $mTinTuc->getInfoComment($idcomment);\r\n\t}", "function DoLikeComment($action)\n {\n global $DB, $mainsettings, $sdlanguage, $userinfo;\n\n require_once(SD_INCLUDE_PATH.'class_sd_likes.php');\n\n //SD370: allow likes by Guests (not logged in)\n if(!CheckFormToken('securitytoken') || empty($this->plugin_id) ||\n !$this->hasPostAccess || #empty($userinfo['loggedin']) ||\n empty($userinfo['usergroupids']) || !@array_intersect($userinfo['usergroupids'], $this->like_groups) ||\n !in_array($action,array(SD_LIKED_TYPE_COMMENT_REMOVE,SD_LIKED_TYPE_COMMENT,SD_LIKED_TYPE_COMMENT_NO)) )\n {\n if(Is_Ajax_Request()) return false;\n echo '<strong>'.$sdlanguage['error_invalid_token'].'</strong><br />';\n return false;\n }\n\n if($comment_id = Is_Valid_Number(GetVar('cid', 0, 'whole_number'),0,1,99999999))\n {\n $DB->result_type = MYSQL_ASSOC;\n $comment_arr = $DB->query_first('SELECT commentid, pluginid, objectid, userid FROM {comments}'.\n ' WHERE commentid = %d AND pluginid = %d',\n $comment_id, $this->plugin_id);\n }\n if(!isset($comment_arr) || empty($comment_arr['commentid']))\n {\n $DB->result_type = MYSQL_BOTH;\n return false;\n }\n $this->object_id = $comment_arr['objectid'];\n\n $entries = SD_Likes::DoLikeElement($this->plugin_id, $comment_id,\n ($action===SD_LIKED_TYPE_COMMENT_REMOVE?SD_LIKED_TYPE_COMMENT_REMOVE:($action==SD_LIKED_TYPE_COMMENT?SD_LIKED_TYPE_COMMENT:SD_LIKED_TYPE_COMMENT_NO)),\n $userinfo['userid'], $userinfo['username'],\n $comment_arr['userid']);\n if(!empty($entries) && is_array($entries))\n {\n $c_likes = (empty($entries['total'])?0:$entries['total']) +\n (empty($entries['guests'])?0:$entries['guests']);\n $c_dislikes = (empty($entries['total_no'])?0:$entries['total_no']) +\n (empty($entries['guests_no'])?0:$entries['guests_no']);\n $DB->query(\"UPDATE {comments} SET user_likes = '%s', likes_count = %d , dislikes_count = %d WHERE commentid = %d\",\n $DB->escape_string(serialize($entries)),\n $c_likes, $c_dislikes, $comment_id);\n\n if(Is_Ajax_Request())\n {\n if($action==SD_LIKED_TYPE_COMMENT_REMOVE)\n {\n echo $sdlanguage['message_comment_like_removed'];\n }\n return true;\n }\n $msg = '';\n switch($action)\n {\n case SD_LIKED_TYPE_COMMENT: $msg = $sdlanguage['message_comment_liked']; break;\n case SD_LIKED_TYPE_COMMENT_NO: $msg = $sdlanguage['message_comment_disliked']; break;\n case SD_LIKED_TYPE_COMMENT_REMOVE: $msg = $sdlanguage['message_comment_like_removed']; break;\n }\n RedirectFrontPage($this->isArticle ? $this->url : RewriteLink($this->url), $msg);\n return true;\n }\n return false;\n\n }", "public function like($user = null)\n {\n if (null === $user) {\n $user = auth()->user();\n }\n\n $like = $this->likes()->where('user_id', '=', $user->id)->first();\n\n if ($like) {\n return;\n }\n\n $like = $this->likes()->create(['user_id' => $user->id]);\n\n // Send event if it's not our item\n if (! $this->mine()) {\n event(new NotificationEvent($like, $this->user));\n }\n\n $this->increment('likes_count');\n }", "function wyz_bus_like_ajax() {\n\t$nonce = filter_input( INPUT_POST, 'nonce' );\n\n\tif ( ! wp_verify_nonce( $nonce, 'wyz_ajax_custom_nonce' ) ) {\n\t\twp_die( 'busted' );\n\t}\n\n\t$_post_id = intval( $_POST['post-id'] );\n\t$_act = $_POST['act'];\n\t$_user_id = get_current_user_id();\n\t\n\tif ( ! $_post_id || ! $_user_id || ! $_act || 0 === $_post_id || '' === $_user_id ) {\n\t\twp_die( false );\n\t}\n\n\t$_likes = get_post_meta( $_post_id, 'wyz_business_post_likes', true );\n\n\tif ( empty( $_likes ) ) {\n\t\t$_likes = array();\n\t}\n\t$likes_count = intval( get_post_meta( $_post_id, 'wyz_business_post_likes_count', true ) );\n\tif ( ! $likes_count ) {\n\t\t$likes_count = 0;\n\t}\n\tif ( $_act == 'like' ) {\n\t\tforeach ( $_likes as $like ) {\n\t\t\tif ( $like == $_user_id ) {\n\t\t\t\twp_die( -1 );\n\t\t\t}\n\t\t}\n\t\tarray_push( $_likes, $_user_id );\t\n\t\t$likes_count++;\n\t\t\n\t} elseif ( $_act == 'dislike' ) {\n\t\t$liked = false;\n\t\tforeach ( $_likes as $like ) {\n\t\t\tif ( $like == $_user_id ) {\n\t\t\t\t$liked = true;\n\t\t\t}\n\t\t}\n\t\tif ( ! $liked )\n\t\t\twp_die(-1);\n\t\t$_likes = array_diff( $_likes, [ $_user_id ] );\n\t\t$likes_count--;\n\t}\n\tupdate_post_meta( $_post_id, 'wyz_business_post_likes', $_likes );\n\tupdate_post_meta( $_post_id, 'wyz_business_post_likes_count', $likes_count );\n\n\twp_die( $likes_count );\n}", "public function adfriendlikeAction() {\n\t$like_user_str = 0;\n\t$resource_type = $this->_getParam('resource_type'); // Resource type.\n\t$communityad_id = $this->_getParam('communityad_id', 0);\n\tif (empty($communityad_id)) {\n\t $ad_id = $this->_getParam('ad_id');\n\t $this->view->communityad_id = $ad_id = Engine_Api::_()->communityad()->getEncodeToDecode($ad_id);\n\t} else {\n\t $this->view->communityad_id = $ad_id = $communityad_id;\n\t}\n\t$resource_title = $resource_type;\n\t$resource_info = Engine_Api::_()->getDbtable('modules', 'communityad')->getModuleInfo($resource_type);\n\tif (!empty($resource_info)) {\n\t $resource_type = $resource_info['table_name'];\n\t $resource_title = $resource_info['module_title'];\n\t}\n\t$ajax_title = $this->_getParam('resource_title');\n\tif (!empty($ajax_title)) {\n\t $resource_title = $ajax_title;\n\t}\n\t$this->view->resource_type = $resource_type;\n\t$this->view->resource_title = $resource_title;\n\n\t$this->view->resource_id = $resource_id = $this->_getParam('resource_id'); // Resource id.\n $this->view->getStoryStatus = Engine_Api::_()->getItemTable('communityad_adtype')->getStatus('sponsored_stories');\n $this->view->getCommunityadTitle = Engine_Api::_()->communityad()->getCommunityadTitle();\n\t$this->view->call_status = $call_status = $this->_getParam('call_status');\n\t$this->view->page = $page = $this->_getParam('page', 1); // Current page number for the 'ajax pagination'.\n\t$search = $this->_getParam('search', ''); // Searching value which set by 'ajax searching' in tpl.\n\t$is_ajax = $this->_getParam('is_ajax', 0);\n\t$user_id = Engine_Api::_()->user()->getViewer()->getIdentity();\n\t$this->view->is_ajax = $is_ajax;\n\tif (empty($search)) {\n\t $this->view->search = $this->view->translate('Search Members');\n\t} else {\n\t $this->view->search = $search;\n\t}\n\n\tif ($call_status == 'friend') {\n\n\t $sub_status_table = Engine_Api::_()->getItemTable('communityad_like');\n\t $sub_status_name = $sub_status_table->info('name');\n\n\t $membership_table = Engine_Api::_()->getDbtable('membership', 'user');\n\t $member_name = $membership_table->info('name');\n\n\t $user_table = Engine_Api::_()->getItemTable('user');\n\t $user_Name = $user_table->info('name');\n\n\t $sub_status_select = $user_table->select()\n\t\t\t\t\t ->setIntegrityCheck(false)\n\t\t\t\t\t ->from($sub_status_name, array('poster_id'))\n\t\t\t\t\t ->joinInner($member_name, \"$member_name . user_id = $sub_status_name . poster_id\", NULL)\n\t\t\t\t\t ->joinInner($user_Name, \"$user_Name . user_id = $member_name . user_id\")\n\t\t\t\t\t ->where($member_name . '.resource_id = ?', $user_id)\n\t\t\t\t\t ->where($member_name . '.active = ?', 1)\n\t\t\t\t\t ->where($sub_status_name . '.ad_id = ?', $ad_id)\n\t\t\t\t\t ->where($sub_status_name . '.poster_id != ?', $user_id)\n\t\t\t\t\t ->where($sub_status_name . '.poster_id != ?', 0)\n\t\t\t\t\t ->where($user_Name . '.displayname LIKE ?', '%' . $search . '%')\n\t\t\t\t\t ->order('\tlike_id DESC');\n\t} else if ($call_status == 'public') {\n\n\t // Fetch user which liked this content, in decending order.\n\t $sub_status_table = Engine_Api::_()->getItemTable('communityad_like');\n\t $sub_status_name = $sub_status_table->info('name');\n\n\t $user_table = Engine_Api::_()->getItemTable('user');\n\t $user_Name = $user_table->info('name');\n\n\t $sub_status_select = $user_table->select()\n\t\t\t\t\t ->setIntegrityCheck(false)\n\t\t\t\t\t ->from($sub_status_name, array('poster_id'))\n\t\t\t\t\t ->joinInner($user_Name, \"$user_Name . user_id = $sub_status_name . poster_id\")\n\t\t\t\t\t ->where($sub_status_name . '.ad_id = ?', $ad_id)\n\t\t\t\t\t ->where($sub_status_name . '.poster_id != ?', 0)\n\t\t\t\t\t ->where($user_Name . '.displayname LIKE ?', '%' . $search . '%')\n\t\t\t\t\t ->order($sub_status_name . '.like_id DESC');\n\t}\n\n\t$fetch_sub = Zend_Paginator::factory($sub_status_select);\n\t$check_object_result = count($fetch_sub);\n\n\tif (!empty($check_object_result)) {\n\t $this->view->user_obj = $fetch_sub;\n\t} else {\n\t $this->view->no_result_msg = $this->view->translate('No results were found.');\n\t}\n\n\t$fetch_sub->setCurrentPageNumber($page);\n\t$fetch_sub->setItemCountPerPage(20);\n\n\t// 'Number of friend' which liked this content,\n\t$resource_object = Engine_Api::_()->getItem($resource_type, $resource_id);\n\t$public_count = Engine_Api::_()->getDbtable('likes', 'communityad')->getLikeCount($ad_id);\n\t$this->view->public_count = $public_count; // public count;\n\t// 'Number of my friend' which liked this content,\n\t$friend_count = Engine_Api::_()->communityad()->friend_number_of_like($ad_id);\n\t$this->view->friend_count = $friend_count; //friend count;\n\t// Find out the title of like.\n\tif ($resource_type == 'member') {\n\t $this->view->like_title = Engine_Api::_()->getItem('user', $resource_id)->displayname;\n\t} else {\n\t $this->view->like_title = Engine_Api::_()->getItem($resource_type, $resource_id)->getTitle();\n\t}\n }", "public function actionLikedCreate(){\n\t\t$id_user = F3::get('POST.user');\n\t\t$id_movie = F3::get('POST.movie');\n\t\t$token = F3::get('GET.token');\n\n\t\t$getToken = $this->model_users->getToken($token);\n\n\t\tif (!empty($getToken)):\n\n\t\t\tif (!empty($id_user) && !empty($id_movie)):\n\t\t\t\t$check_like = $this->model_likes->checkLike($id_user, $id_movie);\n\n\t\t\t\tif (empty($check_like)):\n\t\t\t\t\t$this->model_likes->createLike($id_user, $id_movie);\n\t\t\t\t\tApi::response(200, 'Movie added as liked');\n\t\t\t\telse:\n\t\t\t\t\t$this->model_likes->updateLike($id_user, $id_movie, $statut = '');\n\t\t\t\t\tApi::response(200, 'Movie updated as liked');\n\t\t\t\tendif;\n\n\t\t\telse:\n\t\t\t\tApi::response(400, 'Bad Request');\n\t\t\tendif;\n\n\t\telseif (empty($token)):\n\t\t\tApi::response(401, 'Hum... you need a token');\n\t\telse:\n\t\t\tApi::response(403, 'Invalid token');\n\t\tendif;\n\t}", "public function likes(){\n }", "public function like_text() {\n\t\trequire HS_DOCS_API_DIR_PATH . 'admin/views/like-box.php';\n\t}", "public function like() {\n\n $review = Input::get('review');\n $check = $this->likeCheck($review);\n\n if (!$check) {\n if (!$review == \"\") {\n // inserting the review like\n DB::table('review_likes')->insert(\n array(\n 'review_id' => $review,\n 'user_id' => Auth::user()->id\n )\n );\n $user = DB::table('film_review')->where('fr_id', $review)->first();\n // creating a notification\n $noti = new Notification; // notification instance\n $noti->user_id = $user->fr_usr_id; // the user who will get this notification\n $noti->subject_type = 'user'; // user\n $noti->subject_id = Auth::user()->id; // the uset who liked the review\n $noti->object_type = 'review'; // object is review \n $noti->object_id = $review; // id of the review in picture\n $noti->type = 'liked'; // liked - notification type\n $noti->read = '0'; // default '0' as it is unread\n $noti->time = time(); // default '0' as it is unread\n $noti->save(); // saves notification\n\n $mail = $this->newLikeMail($user->fr_usr_id, $user->fr_fl_id, $user);\n }\n }\n }", "public function like()\n {\n if (isLoggedIn() == false) {\n flash('login_to_post', 'Please, login to like post');\n redirect('/users/login');\n }\n\n if ($_SERVER['REQUEST_METHOD'] == 'GET') {\n\n // Sanitize array\n $_GET = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING);\n\n $data = [\n 'user_id' => $_SESSION['user_id'],\n 'post_id' => trim($_GET['id'])\n ];\n\n // Check if get request is correct\n if (!empty($data['post_id']) && !empty($data['user_id'])) {\n\n $post = $this->postModel->getPostById($data['post_id']);\n $user = $this->userModel->getUserById($data['user_id']);\n\n if ($post && $user) {\n $likes = $this->postModel->getLikesByUserId($data['user_id']);\n\n foreach ($likes as $like) {\n if ($like->post_id === $data['post_id']) {\n // Delete like if user pressed button twice\n $this->postModel->deleteLikeById($like->id);\n $this->postModel->postUpdateLikesCount($data['post_id']);\n redirect('/posts');\n exit;\n }\n }\n\n $this->postModel->like($data);\n $this->postModel->postUpdateLikesCount($data['post_id']);\n }\n }\n redirect('/posts');\n }\n }", "function postLike($media_id) {\n \n \t/*\n \t// *** NEED TO LOOK INTO THIS FURTHER ***\n \t//Documentation states it is a POST to /media/{media-id}/likes\n \t// The example provided is:\n\n\t//\tcurl -F 'access_token=$this->access_token' \\\n\t//\t\thttps://api.instagram.com/v1/media/$media_id/likes\n \n $post_media_like_request_url = sprintf($this->api_urls['post_like'], $media_id, $this->access_token);\n \t\n \treturn $this->__apiCall($post_media_like_request_url);\n\t\t*/\n \n }", "public function like(LikeableContract $likeable)\n {\n app(LikeableServiceContract::class)->addLikeTo($likeable, LikeType::LIKE, $this);\n }", "function zp_post_like( $atts, $content = null ) {\n\textract( shortcode_atts( array(\n\t\t'text' => __( 'Like this post', 'novo' ),\n\t ), $atts ) );\n\t global $post;\n\t$likes = get_post_meta($post->ID,'zp_like',true);\n\t$like = ( $likes ) ? $likes: '0';\t\n\t\n\t$output = '<span class=\"post_like\"><span class=\"likes text-right '.$post->ID.'\"><span class=\"icon-heart '.$post->ID.'\">R</span><span class= \"textLike\">'.$text.'</span><span class=\"likes_value\"><em>( '.$like.')</em></span></span></span>';\t\n\treturn $output;\n}", "function mentionMePostbit(&$post)\n{\n\tglobal $mybb, $theme, $lang, $templates, $forumpermissions,\n\t$fid, $post_type, $thread, $forum;\n\n\tif ($mybb->settings['quickreply'] == 0 ||\n\t\t$mybb->user['suspendposting'] == 1 ||\n\t\t$forumpermissions['canpostreplys'] == 0 ||\n\t\t($thread['closed'] == 1 && !is_moderator($fid)) ||\n\t\t$forum['open'] == 0 ||\n\t\t$post_type ||\n\t\t$mybb->user['uid'] == $post['uid']) {\n\t\treturn;\n\t}\n\n\t// tailor JS to postbit setting\n\t$js = \"javascript:MentionMe.insert('{$post['username']}');\";\n\tif ($mybb->settings['mention_multiple']) {\n\t\t$js = \"javascript:MentionMe.multi.mention({$post['pid']});\";\n\t}\n\n\teval(\"\\$post['button_mention'] = \\\"\" . $templates->get('mentionme_postbit_button') . \"\\\";\");\n}" ]
[ "0.6353923", "0.6351229", "0.60445964", "0.59779394", "0.5911701", "0.5832411", "0.5829591", "0.58229434", "0.5737164", "0.5731947", "0.5723647", "0.5718696", "0.5704554", "0.5701344", "0.5689527", "0.56562626", "0.56498635", "0.5639372", "0.5617229", "0.56112", "0.5547009", "0.5541213", "0.5537075", "0.5533102", "0.55283874", "0.5481072", "0.5474698", "0.54695886", "0.5442938", "0.5437812" ]
0.70177615
0
get users for the given filter code
function get_users_by_filter($filterCode,$users_id = '') { log_message('debug', '_message/get_users_by_filter'); log_message('debug', '_message/get_users_by_filter:: [1] filterCode='.$filterCode); switch($filterCode){ case "all_users": return $this->get_types(array('invited_shopper','random_shopper','clout_merchant')); break; case "all_admins": return $this->get_types(array('clout_owner','clout_admin_user')); break; case "all_store_owners": return $this->get_types(array('store_owner_owner')); break; case "all_shoppers": return $this->get_types(array('invited_shopper','random_shopper')); break; case "shoppers_without_bank_account": return server_curl(CRON_SERVER_URL, array('__action'=>'get_single_column_as_array', 'query'=>'get_users_without_bank_account', 'column'=>'user_id', 'variables'=>array() )); break; case "shoppers_without_network": return server_curl(CRON_SERVER_URL, array('__action'=>'get_single_column_as_array', 'query'=>'get_users_without_network', 'column'=>'user_id', 'variables'=>array() )); break; case "select_user": return $this->get_select_user($users_id); break; default: return array(); break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getUserIds($filter_name, $filter_values)\n {\n switch ($filter_name) {\n case 'common':\n $list = user_auth_peer::instance()->get_list(['del' => 0], [], ['id ASC']);\n break;\n\n case 'group':\n\n $list = db::get_cols(\n 'SELECT user_id FROM '.groups_members_peer::instance()->get_table_name(\n ).' WHERE group_id IN ('.implode(',', $filter_values).')'\n );\n break;\n\n case 'ppo':\n\n\n $ppo = ppo_peer::instance()->get_item($filter_values[0]);\n $list = ppo_members_peer::instance()->get_members($ppo['id'], false, $ppo);\n break;\n\n case 'status':\n $list = db::get_cols(\n 'SELECT id as user_id FROM '.user_auth_peer::instance()->get_table_name(\n ).' WHERE status IN ('.implode(',', $filter_values).')'\n );\n break;\n\n case 'func':\n\n foreach ($filter_values as $id => $a) {\n $where[] = \"functions && '{\".$a.\"}'\";\n }\n $list = db::get_cols(\n 'SELECT user_id FROM '.user_desktop_peer::instance()->get_table_name().' WHERE '.implode(\n ' OR ',\n $where\n )\n );\n break;\n\n case 'region':\n $list = db::get_cols(\n 'SELECT user_id FROM '.user_data_peer::instance()->get_table_name().' WHERE region_id IN ('.implode(\n ',',\n $filter_values\n ).')'\n );\n break;\n\n case 'lists':\n\n $list = db::get_cols(\n 'SELECT user_id FROM '.lists_users_peer::instance()->get_table_name().' WHERE list_id IN ('.implode(\n ',',\n $filter_values\n ).') AND type = 0'\n );\n break;\n\n case 'district':\n $list = db::get_cols(\n 'SELECT user_id FROM '.user_data_peer::instance()->get_table_name().' WHERE city_id IN ('.implode(\n ',',\n $filter_values\n ).')'\n );\n break;\n\n case 'sferas':\n $list = db::get_cols(\n 'SELECT user_id FROM '.user_data_peer::instance()->get_table_name().' WHERE segment IN ('.implode(\n ',',\n $filter_values\n ).')'\n );\n break;\n\n case 'political_views':\n\n $list = db::get_cols(\n 'SELECT user_id FROM '.user_data_peer::instance()->get_table_name(\n ).' WHERE political_views = '.$filter_values\n );\n break;\n\n case 'targets':\n $i = 0;\n foreach ($filter_values as $fv) {\n $sqladd .= 'admin_target && \\'{'.$fv.'}\\' ';\n if ($i < count($filter_values) - 1) {\n $sqladd .= ' OR ';\n }\n $i++;\n }\n $list = db::get_cols(\n 'SELECT user_id\n FROM user_data WHERE '.$sqladd\n );\n break;\n\n case 'visit':\n $name = 'visit_ts';\n $value = $filter_values;\n $time = time() - abs($value * 24 * 60 * 60);\n if ($value > 0) {\n $where = \"user_id in (SELECT user_id FROM user_sessions WHERE $name > $time)\";\n } elseif ($value < 0) {\n $where = \"user_id in (SELECT user_id FROM user_sessions WHERE $name < $time)\";\n }\n $list = db::get_cols(\n 'SELECT user_id FROM '.user_sessions_peer::instance()->get_table_name().' WHERE '.$where\n );\n break;\n }\n\n\n foreach ($list as $key => $value) {\n $usr = user_auth_peer::instance()->get_item($value);\n if (1 === $usr['del'] || 0 === (int)$usr['active'] || 1 === (int)$usr['offline']) {\n unset($list[$key]);\n }\n }\n\n internal_mailing_peer::instance()->update(\n [\n 'id' => $this->mailing_id,\n 'count' => count($list),\n ]\n );\n\n return $list;\n }", "public function ldap_get_users($extrafilter = '') {\n global $CFG;\n\n $ret = array();\n $ldapconnection = $this->ldap_connect();\n if (!$ldapconnection) {\n return $ret;\n }\n\n $filter = \"(\" . $this->config['user_attribute'] . \"=*)\";\n if (!empty($this->config['objectclass'])) {\n $filter .= \"&(\" . $this->config['objectclass'] . \"))\";\n }\n if ($extrafilter) {\n $filter = \"(&$filter($extrafilter))\";\n }\n\n // get all contexts and look for first matching user\n $ldap_contexts = explode(\";\", $this->config['contexts']);\n\n foreach ($ldap_contexts as $context) {\n $context = trim($context);\n if (empty($context)) {\n continue;\n }\n\n if ($this->config['search_sub'] == 'yes') {\n // use ldap_search to find first user from subtree\n $ldap_result = ldap_search($ldapconnection, $context, $filter, array($this->config['user_attribute']));\n\n }\n else {\n // search only in this context\n $ldap_result = ldap_list($ldapconnection, $context, $filter, array($this->config['user_attribute']));\n }\n\n if ($entry = ldap_first_entry($ldapconnection, $ldap_result)) {\n do {\n $value = ldap_get_values_len($ldapconnection, $entry, $this->config['user_attribute']);\n $value = $value[0];\n array_push($ret, $value);\n\n } while ($entry = ldap_next_entry($ldapconnection, $entry));\n }\n ldap_free_result($ldap_result); // free mem\n\n }\n $this->ldap_close($ldapconnection);\n return $ret;\n }", "public function getPresidentUsers($filter = array())\n {\n //$vp_ops_dept = 54;\n $vp_ops_dept = $this->em->getRepository(\"HrisAdminBundle:JobTitle\")->findBy(array('name'=> 'President/CEO'));\n \n $query = 'select d from HrisWorkforceBundle:Employee d where d.job_title = :code';\n $opts = $this->em ->createQuery($query)\n ->setParameter('code', $vp_ops_dept) \n ->getResult();\n\n $list_opts = array();\n foreach ($opts as $item)\n $list_opts[$item->getID()] = $item->getFirstName().' '.$item->getLastName();\n\n return $list_opts;\n }", "public function getVPOperationUsers($filter = array())\n {\n //$vp_ops_dept = 54;\n $vp_ops_dept = $this->em->getRepository(\"HrisAdminBundle:JobTitle\")->findBy(array('name'=> 'VP Operations'));\n \n $query = 'select d from HrisWorkforceBundle:Employee d where d.job_title = :code';\n $opts = $this->em ->createQuery($query)\n ->setParameter('code', $vp_ops_dept) \n ->getResult();\n\n $list_opts = array();\n foreach ($opts as $item)\n $list_opts[$item->getID()] = $item->getFirstName().' '.$item->getLastName();\n\n return $list_opts;\n }", "function getUsers(){\n }", "function getUsers(){\n }", "function getUsers() {\n\n\tglobal $db;\n\treturn $db->getUsersByGroup ( $GLOBALS [\"targetId\"] );\n\n}", "public function getUserList($data)\n {\n $return = [];\n foreach(UserModel::where(\"first_name\",\"like\", \"%{$data->value}%\")->get() as $q)\n {\n $return[][\"username\"] = $q->first_name;\n }\n if(!empty($return))\n {\n return $return;\n }\n return false;\n }", "function getAllUserIds($filter) {\n\t//SELECT id FROM students\n\t$sql = \"SELECT id FROM users WHERE $filter = 1\";\n\t$userIds = queryColumn($sql);\n\n\treturn $userIds;\n}", "public function getUsers();", "public function getUsers();", "public function getUsers();", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "static function findOnlyUsersFromUserListingTable($external_table, $field_prefix, $filter, $min_state = STATE_ARCHIVED) {\n $users_table = TABLE_PREFIX . 'users';\n $user_id_field = \"{$field_prefix}_id\";\n\n $where_part = DB::prepare(\"($users_table.id = $external_table.$user_id_field AND $users_table.state >= ?)\", $min_state);\n\n if($filter) {\n $where_part .= \" AND ($filter)\";\n } // if\n\n return Users::findBySQL(\"SELECT DISTINCT $users_table.* FROM $users_table, $external_table WHERE $where_part ORDER BY CONCAT($users_table.first_name, $users_table.last_name, $users_table.email)\");\n }", "protected function get_users() {\n\t\t\t$users = wp_cache_get( 'mycred_users' );\n\n\t\t\tif ( false === $users ) {\n\t\t\t\t$users = array();\n\t\t\t\t$blog_users = get_users( array( 'orderby' => 'display_name' ) );\n\t\t\t\tforeach ( $blog_users as $user ) {\n\t\t\t\t\tif ( false === $this->core->exclude_user( $user->ID ) )\n\t\t\t\t\t\t$users[ $user->ID ] = $user->display_name;\n\t\t\t\t}\n\t\t\t\twp_cache_set( 'mycred_users', $users );\n\t\t\t}\n\n\t\t\treturn apply_filters( 'mycred_log_get_users', $users );\n\t\t}", "public function filterUsers()\n {\n if ($this->hasRole('admin')) {\n $users = User::all();\n } elseif ($this->hasRole('manager')) {\n $users = $this->employees()->get();\n } elseif ($this->hasRole('employee')) {\n $users = $this->managers()->get();\n } else {\n return (new User)->newCollection();\n }\n\n if ($users->count() === 0) {\n $users = (new User)->newCollection();\n }\n\n return $users;\n\n }", "public function get_users($organization_id, $user_type);", "private function getUsers()\n {\n $url = $this->base_uri.'user/assignable/multiProjectSearch?projectKeys='.$this->project;\n $users = $this->request($url);\n if (!$this->infos['errorBoolean']) {\n return json_decode($users);\n }\n }", "public function getUsersByFilters($aFilters, $bFullSet = false, $sOrderBy = 'login', $sSort = 'ASC',$pageName='page') {\n /* ===============================check admin or user================ */\n\n $oResult = new Mt4User();\n\n if ($user = current_user()->getUser()) {\n if (!$user->InRole('admin')) {\n $account_id = $user->id;\n $oResult = Mt4User::with('accounts')->whereHas('accounts', function($query) use($account_id) {\n $query->where(DB::raw('mt4_users_users.server_id'),'=',DB::raw(' mt4_users.server_id'));\n\n $query->where('users_id', $account_id);\n });\n }\n }\n\n\n /* =============== active Filters =============== */\n if (isset($aFilters['assigned']) && $aFilters['assigned']!=0) {\n\n\n if ($aFilters['assigned'] == 1) {\n $oResult = $oResult->with('account')->whereHas('account',function ($query){\n\n $query->whereRaw('mt4_users_users.server_id = mt4_users.server_id');\n $query->whereNotNull('mt4_users_id');\n\n });\n } else {\n\n $oResult = $oResult->whereNotIn('login', function ($query) {\n\n $query->select(DB::raw('mt4_users_users.mt4_users_id'))\n ->from('mt4_users_users')\n ->whereRaw('mt4_users_users.mt4_users_id = mt4_users.login')\n ->whereRaw('mt4_users_users.server_id = mt4_users.server_id');\n\n });\n\n\n }\n }\n\n /* =============== Login Filters =============== */\n if (isset($aFilters['exactLogin']) && $aFilters['exactLogin']) {\n $oResult = $oResult->where('LOGIN', $aFilters['login']);\n } else if ((isset($aFilters['from_login']) && !empty($aFilters['from_login'])) ||\n (isset($aFilters['to_login']) && !empty($aFilters['to_login']))) {\n\n if (!empty($aFilters['from_login'])) {\n $oResult = $oResult->where('LOGIN', '>=', $aFilters['from_login']);\n }\n\n if (!empty($aFilters['to_login'])) {\n $oResult = $oResult->where('LOGIN', '<=', $aFilters['to_login']);\n }\n }\n\n if (isset($aFilters['server_id']) &&in_array($aFilters['server_id'],[0,1])) {\n\n $oResult = $oResult->where('server_id',$aFilters['server_id']);\n }\n /* =============== Nmae Filter =============== */\n if (isset($aFilters['name']) && !empty($aFilters['name'])) {\n $oResult = $oResult->where('name', 'like', '%' . $aFilters['name'] . '%');\n }\n\n /* =============== Groups Filter =============== */\n if (!isset($aFilters['all_groups']) || !$aFilters['all_groups']) {\n $aUsers = $this->getLoginsInGroup($aFilters['group']);\n $oResult = $oResult->whereIn('LOGIN', $aUsers);\n }\n\n\n $oResult = $oResult->orderBy($sOrderBy, $sSort);\n\n if (!$bFullSet) {\n $oResult = $oResult->paginate(Config::get('fxweb.pagination_size'),['*'],$pageName);\n } else {\n $oResult = $oResult->get();\n }\n /* =============== Preparing Output =============== */\n foreach ($oResult as $dKey => $oValue) {\n $oResult[$dKey]->BALANCE = round($oResult[$dKey]->BALANCE, 2);\n $oResult[$dKey]->EQUITY = round($oResult[$dKey]->EQUITY, 2);\n $oResult[$dKey]->AGENT_ACCOUNT = round($oResult[$dKey]->AGENT_ACCOUNT, 2);\n $oResult[$dKey]->MARGIN = round($oResult[$dKey]->MARGIN, 2);\n $oResult[$dKey]->MARGIN_FREE = round($oResult[$dKey]->MARGIN_FREE, 2);\n $oResult[$dKey]->LEVERAGE = round($oResult[$dKey]->LEVERAGE, 2);\n }\n /* =============== Preparing Output =============== */\n\n return $oResult;\n }", "public function get_user_friends($filters)\n {\n $active_login_userid = $filters['active_login_userid'];\n $owner_profile_userid = $filters['owner_profile_userid'];\n $filter = $filters['filter'];\n \n //Most Recent\n $active_filter = \" ORDER BY created_at DESC, u.first_name, u.last_name\";\n if($filter == 1) {\n //Alphabetical\n $active_filter = \" ORDER BY u.first_name, u.last_name\";\n } else if($filter == 2) {\n //By number of followers\n $active_filter = \" ORDER BY followers DESC, u.first_name, u.last_name\";\n } else if($filter == 3) {\n //By number of mutual friends\n $active_filter = \" ORDER BY mutual_friends DESC, u.first_name, u.last_name\";\n } else if($filter == 4) {\n //By number of similar interests\n $active_filter = \" ORDER BY similar_interest DESC, u.first_name, u.last_name\";\n }\n \n $limit = 20;\n \n $sql = \"SELECT u.id as user_id,\n u.profile_code,\n u.first_name,\n u.last_name,\n ub.profilephoto,\n ub.coverphoto,\n coalesce(a.total,0) as followers,\n coalesce(b.total,0) as following,\n round((coalesce(c.yaycount,0) + coalesce(d.yaycount,0) + (coalesce(e.yaycount,0) / 10)) / 3) as avg_rating,\n us.credential_type,\n us.credential_refid,\n (case us.credential_type\n when 1 then ugen.general_info\n when 2 then \n (case WHEN ucol.course IS NOT NULL THEN\n CONCAT(ucol.course, ', ', ucol.schoolname)\n ELSE ucol.schoolname\n end)\n when 3 then CONCAT(uwork.position, ', ', uwork.companyname,', ',uwork.location)\n end) 'credential',\n (case \n when uf2.status=1 then '1'\n when uf2.status=0 then '2'\n when uf3.status=0 then '3' \n else '4'\n end) 'friend_status',\n (case\n when ua.status=1 then \n case ua2.status\n when 1 then '6'\n else '1'\n end\n when ua.status=0 then '2'\n when ua2.status=1 then '3'\n when ua2.status=0 then '4' \n else '5'\n end) 'following_status',\n coalesce(mf.mutualfriends,0) as mutual_friends,\n coalesce(ms.mutualstrings,0) as similar_interest,\n uf.created_at\t \n FROM userfriends uf\n JOIN users u ON u.id = uf.user_two_id\n LEFT JOIN userbasicinfo ub on u.id = ub.user_id\n LEFT JOIN usersettings us on u.id = us.user_id\n LEFT JOIN usergeneralinfo ugen ON ugen.user_id = us.user_id AND ugen.id = us.credential_refid\n LEFT JOIN usereduccollege ucol ON ucol.user_id = us.user_id AND ucol.id = us.credential_refid\n LEFT JOIN userworkhistory uwork ON uwork.user_id = us.user_id AND uwork.id = us.credential_refid\n LEFT OUTER JOIN (select useracquiantances.user_two_id,\n COUNT(*) total\n FROM useracquiantances\n WHERE status=1\n GROUP BY useracquiantances.user_two_id) as a ON a.user_two_id = u.id\n LEFT OUTER JOIN (select useracquiantances.user_one_id,\n COUNT(*) total\n FROM useracquiantances\n WHERE status=1\n GROUP BY useracquiantances.user_one_id) as b ON b.user_one_id = u.id\n LEFT OUTER JOIN (select postcontentapprovalrate.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycount\n FROM postcontentapprovalrate\n LEFT JOIN postcontent ON postcontent.id = postcontentapprovalrate.postcontent_id\n WHERE postcontent.deleted_at IS NULL AND postcontentapprovalrate.mask = 0\n GROUP BY postcontentapprovalrate.user_id) as c ON c.user_id = u.id\n LEFT OUTER JOIN (select topicapprovalrate.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycount\n FROM topicapprovalrate\n LEFT JOIN topic ON topic.id = topicapprovalrate.string_id\n WHERE topic.deleted_at IS NULL AND topicapprovalrate.mask=0\n GROUP BY topicapprovalrate.user_id) as d ON d.user_id = u.id\n LEFT OUTER JOIN (select postopinionapprovalrate.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycount\n FROM postopinionapprovalrate\n LEFT JOIN postopinion ON postopinion.id = postopinionapprovalrate.postopinion_id\n LEFT JOIN postcontent ON postcontent.id = postopinion.postcontent_id\n WHERE postcontent.deleted_at IS NULL AND postopinion.deleted_at IS NULL\n AND postopinionapprovalrate.mask=0\n GROUP BY postopinionapprovalrate.user_id) as e ON e.user_id = u.id\n LEFT JOIN useracquiantances ua on ua.user_one_id = uf.user_two_id \n AND ua.user_two_id = {$active_login_userid}\n LEFT JOIN useracquiantances ua2 on ua2.user_one_id = {$active_login_userid} \n AND ua2.user_two_id = uf.user_two_id\n LEFT JOIN userfriends uf2 on uf2.user_one_id = uf.user_two_id \n AND uf2.user_two_id = {$active_login_userid}\n LEFT JOIN userfriends uf3 ON uf3.user_one_id={$active_login_userid} \n AND uf3.user_two_id=uf.user_two_id\n LEFT OUTER JOIN (select uf5.user_one_id,\n COUNT(*) mutualfriends\n FROM userfriends uf5\n WHERE uf5.status=1 AND\n uf5.user_two_id IN (SELECT uf6.user_two_id\n FROM userfriends uf6\n WHERE uf6.user_one_id={$active_login_userid} AND status=1)\n GROUP BY uf5.user_one_id) as mf ON mf.user_one_id = u.id\n LEFT OUTER JOIN (select tr.user_id,\n COUNT(*) mutualstrings\n FROM topictrack tr\n LEFT JOIN topic t ON t.id = tr.topic_id\n WHERE t.deleted_at IS NULL AND tr.mask=0 AND\n tr.topic_id IN (SELECT tr2.topic_id \n FROM topictrack tr2\n LEFT JOIN topic t2 ON tr2.topic_id = t2.id\n WHERE tr2.user_id={$active_login_userid} \n AND t.deleted_at IS NULL \n AND tr.mask=0)\n GROUP BY tr.user_id) as ms ON ms.user_id = u.id\n WHERE (uf.user_one_id={$owner_profile_userid} AND uf.status=1)\n {$active_filter}\n LIMIT {$limit}\";\n\n return collect($this->_helper->convert_sql_to_array( DB::select(DB::raw($sql)) )); \n }", "public function get_user_request($filters)\n {\n $active_login_userid = $filters['active_login_userid'];\n $owner_profile_userid = $filters['owner_profile_userid'];\n \n $limit = 20;\n \n $sql = \"SELECT u.id as user_id,\n u.profile_code,\n u.first_name,\n u.last_name,\n ub.profilephoto,\n ub.coverphoto,\n coalesce(a.total,0) as followers,\n coalesce(b.total,0) as following,\n round((coalesce(c.yaycount,0) + coalesce(d.yaycount,0) + (coalesce(e.yaycount,0) / 10)) / 3) as avg_rating,\n us.credential_type,\n us.credential_refid,\n (case us.credential_type\n when 1 then ugen.general_info\n when 2 then \n (case WHEN ucol.course IS NULL THEN\n CONCAT(ucol.course, ', ', ucol.schoolname)\n ELSE ucol.schoolname\n end)\n when 3 then CONCAT(uwork.position, ', ', uwork.companyname,', ',uwork.location)\n end) 'credential',\n (case \n when uf2.status=1 then '1'\n when uf2.status=0 then '2'\n when uf3.status=0 then '3' \n else '4'\n end) 'friend_status',\n (case\n when ua.status=1 then \n case ua2.status\n when 1 then '6'\n else '1'\n end\n when ua.status=0 then '2'\n when ua2.status=1 then '3'\n when ua2.status=0 then '4' \n else '5'\n end) 'following_status', \n 'friends' as requesttype\n FROM userfriends uf\n JOIN users u ON u.id = uf.user_one_id\n LEFT JOIN userbasicinfo ub on u.id = ub.user_id\n LEFT JOIN usersettings us on u.id = us.user_id\n LEFT JOIN usergeneralinfo ugen ON ugen.user_id = us.user_id AND ugen.id = us.credential_refid\n LEFT JOIN usereduccollege ucol ON ucol.user_id = us.user_id AND ucol.id = us.credential_refid\n LEFT JOIN userworkhistory uwork ON uwork.user_id = us.user_id AND uwork.id = us.credential_refid\n LEFT OUTER JOIN (select useracquiantances.user_two_id,\n COUNT(*) total\n FROM useracquiantances\n WHERE status=1\n GROUP BY useracquiantances.user_two_id) as a ON a.user_two_id = u.id\n LEFT OUTER JOIN (select useracquiantances.user_one_id,\n COUNT(*) total\n FROM useracquiantances\n WHERE status=1\n GROUP BY useracquiantances.user_one_id) as b ON b.user_one_id = u.id\n LEFT OUTER JOIN (select postcontentapprovalrate.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycount\n FROM postcontentapprovalrate\n LEFT JOIN postcontent ON postcontent.id = postcontentapprovalrate.postcontent_id\n WHERE postcontent.deleted_at IS NULL AND postcontentapprovalrate.mask = 0\n GROUP BY postcontentapprovalrate.user_id) as c ON c.user_id = u.id\n LEFT OUTER JOIN (select topicapprovalrate.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycount\n FROM topicapprovalrate\n LEFT JOIN topic ON topic.id = topicapprovalrate.string_id\n WHERE topic.deleted_at IS NULL AND topicapprovalrate.mask=0\n GROUP BY topicapprovalrate.user_id) as d ON d.user_id = u.id\n LEFT OUTER JOIN (select postopinionapprovalrate.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycount\n FROM postopinionapprovalrate\n LEFT JOIN postopinion ON postopinion.id = postopinionapprovalrate.postopinion_id\n LEFT JOIN postcontent ON postcontent.id = postopinion.postcontent_id\n WHERE postcontent.deleted_at IS NULL AND postopinion.deleted_at IS NULL\n AND postopinionapprovalrate.mask=0\n GROUP BY postopinionapprovalrate.user_id) as e ON e.user_id = u.id\n LEFT JOIN useracquiantances ua on ua.user_one_id = uf.user_two_id \n AND ua.user_two_id = {$active_login_userid}\n LEFT JOIN useracquiantances ua2 on ua2.user_one_id = {$active_login_userid} \n AND ua2.user_two_id = uf.user_two_id\n LEFT JOIN userfriends uf2 on uf2.user_one_id = uf.user_two_id \n AND uf2.user_two_id = {$active_login_userid}\n LEFT JOIN userfriends uf3 ON uf3.user_one_id={$active_login_userid} \n AND uf3.user_two_id=uf.user_two_id\n WHERE (uf.user_two_id={$owner_profile_userid} AND uf.status=0)\n UNION\n SELECT u.id as user_id,\n u.profile_code,\n u.first_name,\n u.last_name,\n ub.profilephoto,\n ub.coverphoto,\n coalesce(a.total,0) as followers,\n coalesce(b.total,0) as following,\n round((coalesce(c.yaycount,0) + coalesce(d.yaycount,0) + (coalesce(e.yaycount,0) / 10)) / 3) as avg_rating,\n us.credential_type,\n us.credential_refid,\n (case us.credential_type\n when 1 then ugen.general_info\n when 2 then CONCAT(ucol.course, ', ', ucol.schoolname)\n when 3 then uhigh.schoolname\n when 4 then CONCAT(uwork.position, ', ', uwork.companyname,', ',uwork.location)\n end) 'credential',\n (case \n when uf2.status=1 then '1'\n when uf2.status=0 then '2'\n when uf3.status=0 then '3' \n else '4'\n end) 'friend_status',\n (case\n when ua.status=1 then \n case ua2.status\n when 1 then '6'\n else '1'\n end\n when ua.status=0 then '2'\n when ua2.status=1 then '3'\n when ua2.status=0 then '4' \n else '5'\n end) 'following_status',\n 'follow' as requesttype\n FROM useracquiantances uq\n JOIN users u ON u.id = uq.user_one_id\n LEFT JOIN userbasicinfo ub on u.id = ub.user_id\n LEFT JOIN usersettings us on u.id = us.user_id\n LEFT JOIN usergeneralinfo ugen ON ugen.user_id = us.user_id AND ugen.id = us.credential_refid\n LEFT JOIN usereduccollege ucol ON ucol.user_id = us.user_id AND ucol.id = us.credential_refid\n LEFT JOIN usereduchighschool uhigh ON uhigh.user_id = us.user_id AND uhigh.id = us.credential_refid\n LEFT JOIN userworkhistory uwork ON uwork.user_id = us.user_id AND uwork.id = us.credential_refid\n LEFT OUTER JOIN (select useracquiantances.user_two_id,\n COUNT(*) total\n FROM useracquiantances\n WHERE status=1\n GROUP BY useracquiantances.user_two_id) as a ON a.user_two_id = u.id\n LEFT OUTER JOIN (select useracquiantances.user_one_id,\n COUNT(*) total\n FROM useracquiantances\n WHERE status=1\n GROUP BY useracquiantances.user_one_id) as b ON b.user_one_id = u.id\n LEFT OUTER JOIN (select postcontentapprovalrate.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycount\n FROM postcontentapprovalrate\n LEFT JOIN postcontent ON postcontent.id = postcontentapprovalrate.postcontent_id\n WHERE postcontent.deleted_at IS NULL AND postcontentapprovalrate.mask = 0\n GROUP BY postcontentapprovalrate.user_id) as c ON c.user_id = u.id\n LEFT OUTER JOIN (select topicapprovalrate.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycount\n FROM topicapprovalrate\n LEFT JOIN topic ON topic.id = topicapprovalrate.string_id\n WHERE topic.deleted_at IS NULL AND topicapprovalrate.mask=0\n GROUP BY topicapprovalrate.user_id) as d ON d.user_id = u.id\n LEFT OUTER JOIN (select postopinionapprovalrate.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycount\n FROM postopinionapprovalrate\n LEFT JOIN postopinion ON postopinion.id = postopinionapprovalrate.postopinion_id\n LEFT JOIN postcontent ON postcontent.id = postopinion.postcontent_id\n WHERE postcontent.deleted_at IS NULL AND postopinion.deleted_at IS NULL\n AND postopinionapprovalrate.mask=0\n GROUP BY postopinionapprovalrate.user_id) as e ON e.user_id = u.id\n LEFT JOIN useracquiantances ua on ua.user_one_id = uq.user_two_id \n AND ua.user_two_id = {$active_login_userid}\n LEFT JOIN useracquiantances ua2 on ua2.user_one_id = {$active_login_userid} \n AND ua2.user_two_id = uq.user_two_id\n LEFT JOIN userfriends uf2 on uf2.user_one_id = uq.user_two_id \n AND uf2.user_two_id = {$active_login_userid}\n LEFT JOIN userfriends uf3 ON uf3.user_one_id={$active_login_userid} \n AND uf3.user_two_id=uq.user_two_id\n WHERE (uq.user_two_id={$owner_profile_userid} AND uq.status=0)\n ORDER BY first_name, last_name\n LIMIT {$limit}\";\n \n return collect($this->_helper->convert_sql_to_array( DB::select(DB::raw($sql)) )); \n }", "public function findUsers();", "public function findUsers();", "public function UserFilterData($value)\n {\n $em = $this->getEntityManager();\n if ($value == 'Display All') {\n $qb1 = $em->createQueryBuilder();\n $qb1->select('u.id,up.name,up.photo,up.employeeId,up.email,\n up.mobile,uw.extensionNumber,\n uw.workStation,uw.systemId,uw.systemIp,t.tname');\n $qb1->from('Vlreleases\\UserBundle\\Entity\\User', 'u');\n $qb1->innerJoin('u.personalProfile', 'up');\n $qb1->innerJoin('u.workProfile', 'uw');\n $qb1->innerJoin('uw.team', 't');\n $result1 = $qb1->getQuery()->getResult();\n return $result1;\n } \n else {\n $qb = $em->createQueryBuilder();\n $qb->select('DISTINCT ur.id');\n $qb->from('Vlreleases\\UserBundle\\Entity\\User', 'u');\n $qb->innerJoin('u.reportingPersons', 'ur');\n if ($value == 'Non Jyo')\n $qb->where(\"u.id !='14'\");\n elseif ($value == 'Jyo')\n $qb->where(\"u.id = '14'\");\n $result = $qb->getQuery()->getResult();\n\n for ($i = '0'; $i < sizeof($result); $i++) {\n $id = $result[$i]['id'];\n $q = $em->createQueryBuilder();\n $q->select('u.id,up.name,up.photo,up.employeeId,up.email,\n up.mobile,uw.extensionNumber,\n uw.workStation,uw.systemId,uw.systemIp,t.tname');\n $q->from('Vlreleases\\UserBundle\\Entity\\User', 'u');\n $q->leftJoin('u.personalProfile', 'up');\n $q->leftJoin('u.workProfile', 'uw');\n $q->leftJoin('uw.team', 't');\n $q->where(\"u.id='$id'\");\n $finalResult[$i] = $q->getQuery()->getResult();\n }\n \n return $finalResult;\n }\n }" ]
[ "0.67593807", "0.63555264", "0.6229423", "0.6163246", "0.61575973", "0.61575973", "0.61357063", "0.612442", "0.60883826", "0.60717213", "0.60717213", "0.60717213", "0.6055616", "0.6055616", "0.6055616", "0.6055616", "0.6055616", "0.6055616", "0.6055616", "0.6053451", "0.6002157", "0.5974733", "0.59739333", "0.5971994", "0.5966487", "0.59638155", "0.5957083", "0.5948997", "0.5948997", "0.59427965" ]
0.80877525
0
Can transform array to response
public function canTransformArrayToResponse() { $resourceTransformer = new DummyResourceTransformer(); $dummyArray = [ [ 'id' => 'test' ], [ 'id' => 'super' ] ]; $transformed = $resourceTransformer->transformToResponse($dummyArray); $decoded = json_decode($transformed->getContent()); $this->assertEquals(2, count($decoded->data)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function toArray() {\r\n \treturn array(\"response\"=>$this->_response);\r\n }", "public function transform($array) {\n//\t\t\tld(\"transform\");\n//\t\t\tld(json_encode($array));\n\t\t\treturn json_encode($array);\n\t\t}", "public function getResponse(): array;", "public function transformAll(){\n $genres = $this->entityManager->getRepository(Genre::class)->findAll();\n $genreArray = [];\n\n foreach ($genres as $genre){\n $genreArray[$genre->getId()]= $this->transformSingleGenre($genre);\n }\n\n return new JsonResponse($genreArray);\n\n }", "public function toArray() {\n\t\treturn $this->response;\n\t}", "public function toArray()\n {\n return $this->response;\n }", "public function toArray()\n {\n return $this->response;\n }", "public function toArray()\n {\n return $this->response;\n }", "public function toArray()\n {\n return $this->response;\n }", "public function toArray()\n {\n return $this->response;\n }", "public function toArray()\n {\n return $this->response;\n }", "public function toArray()\n {\n return $this->response;\n }", "public function convertResponse($values)\n {\n\t}", "public function toResponse()\n\t{\n\t\treturn $this->toArray();\n\t}", "public function convertResponse($values)\n {\n\n\t}", "public function getResponse() : array;", "public function convertItemArray() {}", "public function prepareResponse();", "public function getArrayResp()\n {\n return json_decode(Yii::$app->request->post(), false);\n }", "public function toArray(): array\n {\n $correspondences = [\n 'Accept-Patch' => 'acceptPatch',\n 'Accept-Ranges' => 'acceptRanges',\n 'Access-Control-Allow-Credentials' => 'allowCredentials',\n 'Access-Control-Allow-Headers' => 'allowHeaders',\n 'Access-Control-Allow-Methods' => 'allowMethods',\n 'Access-Control-Allow-Origin' => 'allowOrigin',\n 'Access-Control-Expose-Headers' => 'exposeHeaders',\n 'Access-Control-Max-Age' => 'maxAge',\n 'Allow' => 'allow',\n 'Cache-Control' => 'cacheControl',\n 'Clear-Site-Data' => 'clearSiteData',\n 'Content-Disposition' => 'contentDisposition',\n 'Content-Encoding' => 'contentEncoding',\n 'Content-Language' => 'contentLanguage',\n 'Content-Length' => 'contentLength',\n 'Content-Location' => 'contentLocation',\n 'Content-Range' => 'contentRange',\n 'Content-Type' => 'contentType',\n 'Cross-Origin-Resource-Policy' => 'crossOriginResourcePolicy',\n 'Digest' => 'digest',\n 'ETag' => 'etag',\n 'Expires' => 'expires',\n 'Last-Modified' => 'lastModified',\n 'Location' => 'location',\n 'Referrer-Policy' => 'referrerPolicy',\n 'Rentry-After' => 'rentryAfter',\n 'Source-Map' => 'sourceMap',\n 'Strict-Transport-Security' => 'strictTransportSecurity',\n 'Timing-Allow-Origin' => 'timingAllowOrigin',\n 'Tk' => 'tk',\n 'Trailer' => 'trailer',\n 'Transfer-Encoding' => 'transferEncoding',\n 'Vary' => 'vary',\n 'WWW-Authenticate' => 'wwwAuthenticate',\n 'X-Content-Type-Options' => 'xContentTypeOptions',\n 'X-DNS-Prefetch-Control' => 'xDNSPrefetchControl',\n 'X-Frame-Options' => 'xFrameOptions'\n ];\n\n $response = [];\n foreach ($correspondences as $header=>$field) {\n $value = $this->$field;\n if ($value) {\n if (is_object($value)) {\n $response[$header] = $value->toString();\n } elseif (is_array($value)) {\n if ($header == \"Clear-Site-Data\") {\n $response[$header] = \"\\\"\".implode(\"\\\", \\\"\", $value).\"\\\"\";\n } else {\n $response[$header] = implode(\", \", $value);\n }\n } else {\n $response[$header] = $value;\n }\n }\n }\n if ($this->customHeaders) {\n $response = array_merge($response, $this->customHeaders);\n }\n return $response;\n }", "protected function asArray()\n\t{\n\t\treturn \\json_decode($this->response, true);\n\t}", "public function mapResponse(array $data = [])\n {\n return array_map(function ($item) {\n return [\n 'id' => $item['orderId'],\n 'symbol' => $item['symbol'],\n 'side' => strtolower($item['side']),\n 'type' => strtolower($item['type']),\n 'status' => strtolower($item['status']),\n 'price' => $item['price'],\n 'amount' => $item['origQty'],\n 'timestamp' => $item['time'],\n ];\n }, $data);\n }", "public function response($as_assoc = false);", "public function getTransformedCollection( ) {\n $response[\"data\"] = [];\n foreach ( (new static)->get() as $industry_object) {\n $response['data'][] = $industry_object->getBeforeStandard();\n }//foreach ( (new static)->get() as $industry_object)\n return $response;\n }", "public function toArray()\n {\n $this->messages($this->messages);\n $this->userAttributes($this->user_attributes);\n\n $response = [\n 'messages' => $this->messages\n ];\n\n if( $this->user_attributes != null && \n count($this->user_attributes) > 0 ) {\n $response['set_attributes'] = $this->user_attributes;\n }\n\n return $response;\n }", "function returnArrayWithContentType(\n $data,\n $content_type,\n $status, $forward = '',\n $exitafter = true,\n $no_conversion = false,\n $method = 'POST',\n $rootSpan = null,\n $rfhprefix = 'rfh-',\n $mqmdprefix = 'mqmd-'\n )\n {\n\n //$injectSpan = $this->tracer->startSpan('Http Call Lib for Arrays', ['child_of' => $rootSpan]);\n $injectSpan = $rootSpan;\n $injectSpan->log(['message'=>'Http Call Lib for Arrays']);\n\n if ($no_conversion === FALSE) {\n $this->common->mlog('Forced conversion', 'DEBUG');\n }\n $this->setHttpReturnCode($status);\n\n if (is_null($forward)) {\n $forward = '';\n }\n\n if ($forward !== '') {\n $headers = array('Content-type' => $content_type, 'Accept' => 'application/json', 'Expect' => '', 'X-Business-Id' => $this->business_id);\n $queries = array();\n foreach ($data as $content) {\n $ct = $this->convertOutData($content, $content_type, $no_conversion);\n $query = array('url' => $forward, 'method' => $method, 'headers' => $headers, 'data' => $ct);\n $queries[] = $query;\n }\n\n $result = $this->forwardHttpQueries($queries, $injectSpan, $rfhprefix, $mqmdprefix);\n $responses = array();\n $json = false;\n\n foreach ($result as $content) {\n if (stripos($content['response_headers']['content-Type'], 'json') > 0) {\n $json = true;\n $responses[] = json_decode($content['response_data'], true);\n } else {\n $responses[] = $content['response_data'];\n }\n }\n\n if ($json) {\n echo json_encode($responses);\n } else {\n echo implode(\"\\n\", $responses);\n }\n $injectSpan->finish();\n } else {\n header('Content-type: ' . $content_type);\n $ret = '';\n foreach ($data as $content) {\n $ret .= $this->convertOutData($content, $content_type, $no_conversion) . \"\\n\";\n }\n $injectSpan->finish();\n return $ret;\n }\n\n if ($exitafter === true) {\n exit;\n }\n }", "public function cargarArrayResponse(bool $res,string $msg)\n {\n $this->response['res'] = $res;\n $this->response['msg'] = $msg;\n }", "public function getResponseArray() {\n return [\n 'error' => $this->error,\n 'code' => $this->code,\n 'msg' => $this->msg\n ];\n }", "public function respond() : array;", "public function response(): array\n {\n return [\n 'error' => $this->hasError(),\n 'exists' => $this->exists(),\n 'code' => $this->code,\n 'data' => $this->data,\n 'awb' => $this->awb,\n 'status' => $this->status,\n 'updateOn' => $this->updateOn,\n 'message' => $this->message,\n ];\n }" ]
[ "0.6672796", "0.66207254", "0.6417293", "0.6384337", "0.63603145", "0.63163173", "0.63163173", "0.63163173", "0.63163173", "0.63163173", "0.63163173", "0.63163173", "0.6299522", "0.6271621", "0.6265876", "0.6207633", "0.6140015", "0.6112922", "0.6095773", "0.60913336", "0.6018439", "0.60167396", "0.60144746", "0.5974114", "0.5937439", "0.5930852", "0.5930734", "0.5913144", "0.5887748", "0.5860123" ]
0.7291185
0
function webform2html_edit_form() / webform2html_edit_form_validate: Implements validate hook
function webform2html_edit_form_validate($form, &$form_state) { if ($form_state['values']['op'] == t('Save')) { /* if (!empty($form_state['values']['h_txt'])) { $header = explode('<br />', nl2br( str_replace('<br>', '<br />', $form_state['values']['h_txt']) ) ); if ( count($header) > 5) { form_set_error('h_txt', t('Up to 5 rows can be set!')); } } if (!empty($form_state['values']['f_txt'])) { $footer = explode('<br />', nl2br( str_replace('<br>', '<br />', $form_state['values']['f_txt']) ) ); if ( count($footer) > 2) { form_set_error('f_txt', t('Up to 2 rows can be set!')); } } if (!(is_numeric($form_state['values']['h_font_size']) && ($form_state['values']['h_font_size'] > 0))) { form_set_error('h_font_size', t('Header font size must be numeric.')); } if (!(is_numeric($form_state['values']['p_font_size']) && ($form_state['values']['p_font_size'] > 0))) { form_set_error('p_font_size', t('Content font size must be numeric.')); } if (!(is_numeric($form_state['values']['f_font_size']) && ($form_state['values']['f_font_size'] > 0))) { form_set_error('f_font_size', t('Footer font size must be numeric.')); } */ } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cps_changeset_edit_form_validate($form, &$form_state) {\n}", "function pdfbulletin_settings_form_validate(&$form, &$form_state) {\n // @todo SERIOUSLY\n}", "function inscription_jesa_manage_validate($form, &$form_state) {\n \n}", "function openlayers_component_form_start_validate($form, &$form_state) {\n $class = new Drupal\\openlayers\\UI\\OpenlayersComponents();\n $class->init($form_state['plugin']);\n $class->edit_form_validate($form, $form_state);\n}", "function ValidateEdit()\n\t{\n\t}", "function form_validate($form, &$form_state) {\n }", "function validate() {\n//print \"Calling validate()\";\n\t\t// clear flags\n\t\t$this->fail_validate = 0;\n\t\t$this->fail_require = 0;\n\t\t\n\t\t$msgengine = new ooFormMessages;\n\t\t \n\t// for each of the fields by name, examine values\n\t// of params that exist for that name, if any\n\t\n\t// IMPORTANT change, what we really need to do now that we have a data structure representing the vlaues of form fields, is when a form is submitted, update the field values with the values from the CGI parameters.\n/*\n\nDEFAULTS --> form fields --> CGI PARAMS --> FIELD VALUES --> so that at this point, after submission, the params and field values are in sync, so that if you say $form->field() to the value, it is the same as the param just submitted.\n\nThis may be why FB uses two passes, one to redistribute the parameter values over the corresponding form fields. CGI PARAM -> FIELD VALUE\n\nThen it uses the field values to check against the regular expressions. I think I am still checking against the param and not updating the fields.\n\nWhere do I set the field value to the cgi value?\n\n*/\n\t\n\t// debug\n\t//print \"Fields to validate: \";\n\t//print_r( $this->fields_list );\n\t\n\t foreach ( $this->fields_list as $field_name ) {\n\t\t\n\t \t// debug\n\t\t//if( $this->debug == DEBUG_VERBOSE ) {\n\t\t//print '<pre style=\"border: 1px solid #ccc; background: #eee\">';\n\t\t//print \"Processing Field\\n\";\n\t\t//print \"Field: \" . $field_name .\"<BR>\";\n\t\t//print \"Value: \" . $this->value($field_name) .\"<BR><br>\";\n\t\t//print \"Fields<br>\";\n\t\t//print_r( $this->fields );\n \t\t//print \"</pre>\";\n\t\t//}\n\t\t\n\t\t/* My first way of thinking is to validate the values of CGI parameters. I'm thinking of a firewall, that I want to get the values first and check them. But ooForm is the firewall. So it would not make any difference if all parameters were redistributed to field values now that we keep a data structure of field properties, one of which is the value.\n\t\tThe regexes could be run against the field values instead of the cgi parameter values.\n\t\t*/\n\t\t\n\t\t// get the generic dynamic value for this field\n\t\t// which is either the default stored in props or from cgi\n\t\t//$val = $this->value($fieldname);\n\t\t// look down to validate section for where this really gets used\n\t\t\n\t\t//if( $val == '' ) {\n\t\t// Note, required validation fails unless you check against cgi params, can't use value function becuase it may be sticky or default value, for required, we must check params to see what is being submitted and what is not, because value may be giving us the default value or the cgi value depending on sticky status.\n\n/**\n * If this field is empty, test for required status,\n * otheriwse check for validity.\n *\n * FIXME: I think this should use empty()\n */\n\n\t\tif( $this->params_list[$field_name] == '' ) {\n//\t\tif( empty( $this->params_list[$field_name] ) ) {\n\t\t\n\t\t\t\t//if( $this->debug == DEBUG_VERBOSE ) {\n\t\t\t\t//print \"Param: \" . $field_name .\" is empty<BR>\";\n\t\t\t\t//}\n\t\t\t\t\n\t\t\t// we know the field is empty, check if required\n\t\t\tif(\tin_array($field_name, $this->required_list) ) {\n\t\t\t\n\t\t\t\n\t\t\t\t// set flag\n\t\t\t\t$this->fail_require = 1;\n\t\t\t\n\t\t\t\t// if empty and on required list, field is invalid\n\t\t\t\t$this->fields[$field_name][invalid] = 1;\n\t\t\t\n\t\t\t\t// IMPORTANT: if the intention is to render the form again with fields filled in for correction and error messages beside the fields, then we must store the required errors, not just stop at the first one.\n\t\t\t\t// to prepare for that I will try setting the invalid flag in the stored fields array for this field\n\n\t\t\t\t$this->fields[$field_name][required] = 1;\n\t\t\t\n\t\t\t\t// set the error message for this field\n\t\t\t\n\t\t\t\t// move to messages config\n\t\t\t\t//$temp = \"<span>Please enter a value for the '$field_name' field.</span>\";\n\t\t\t\t//$this->fields[$field_name][error] = $temp\n\n\t\t\t\t//print \"Setting Error Message:\";\n\t\t\t\t//print $msgengine->message('field_required', $this->fields[$field_name][label]);\n\t\t\t\t\n\t\t\t\t$this->fields[$field_name][error] = $msgengine->message('field_required', $this->fields[$field_name][label]);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t// moreover, I suppose you don't need to use this as a flag, you don't need to store failed required status, if you know the field is required, then after validation, you can then check that each required field has a value and compute the intersection with falied validate fields. No flag needs to be set, so what am I doing here?\n\n\t\t\t\t// debug\n\t\t\t\tif( $this->debug == DEBUG_VERBOSE ) {\n\t\t\t\t\tprint \"Parameter \" . $field_name .\" failed required.<BR>\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\n\t\t/*\n\t\t * Validate Fields\n\t\t *\n\t\t */\n\t\t \n\t\t // Note: if a field is empty, we don't check it for validity, we only check non-empty fields for validity, we check empty fields to see if they are required, once that check is done, we don't have to check if valid.\n\t\t\n\t\t/* LOOK HERE! This is where we get the value to validate from the PAREMETER LIST instead of from the field value. This is legacy practice. It should get it from the field value and field values all \"redistributed\" prior to validation.\n\n\t\tStill does not answer where the value is being set.\n\t\t*/\n\t\t\n\t\t// now we get value at top before conditional\n\t\t//$val = $this->params_list[$field_name];\n\t\t\n\t\tif( $this->debug == DEBUG_VERBOSE ) {\n\t\tprint \"Validating \" . $field_name .\"<BR>\";\n\t\tprint \"With Value: \" . $this->value($field_name) .\"<BR>\";\n\t\t}\n\t\t\n\t\t// get regex\n\t\tif( array_key_exists($this->validate_list[$field_name], $this->rules_list) \n\t\t\t&& preg_match('/_[a-zA-Z]+$/', $this->validate_list[$field_name])\n\t\t\t) {\n\t\t\tif( $this->debug == DEBUG_VERBOSE ) {\n\t\t\tprint \"Using rule\";\n\t\t\t}\n\t\t $regex = $this->rules_list[$this->validate_list[$field_name]];\n\t\t } else {\n\t\t\tif( $this->debug == DEBUG_VERBOSE ) {\n\t\t\tprint \"Using user defined rule\";\n\t\t\t}\n\t\t $regex = $this->validate_list[$field_name];\n\t\t }\n\t\t\tif( $regex != '' && (! preg_match( $regex, $this->value($field_name))) )\n\t\t\t{\n\t\t\t// error validation\n\t\t\t$this->fail_validate = 1;\n\t\t\t\t\t\t\n\t\t\t// experimental code to set invalid flag for this field\n\t\t\t$this->fields[$field_name][invalid] = 1;\n\t\t\t// and error message\n\t\t\t//$this->fields[$field_name][error] = $this->messages_list[$field_name];\n// set through class\n\n/**\n * Validate message trumps required message.\n */\n \n// TEMP DISABLED\n$this->fields[$field_name][error] = $msgengine->message('field_invalid', $this->fields[$field_name][label]);\n\t\t\t\n\t\t\t}\n\t\t}\n\t\n\t} // end foreach\n\t\n\t// debug\t\n\t//print \"Fail Validate: \". $this->fail_validate .\"<br>\";;\n\t//print \"Fail Require: \". $this->fail_require .\"<BR><br>\";;\n\t\t\n\t\t\n\tif( $this->fail_validate\n\t|| $this->fail_require ) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n\t\n\t\n}", "function validate_forms()\r\n{\r\n\tglobal $alert,$db;\r\n\tif($_REQUEST['dont_save']!=1)\r\n\t{\r\n\t\t//Validations\r\n\t\t$alert = '';\r\n\t\t$fieldRequired \t\t= array($_REQUEST['review_author']);\r\n\t\t$fieldDescription \t= array('Review Author');\r\n\t\t$fieldEmail \t\t= array();\r\n\t\t$fieldConfirm \t\t= array();\r\n\t\t$fieldConfirmDesc \t= array();\r\n\t\t$fieldNumeric \t\t= array();\r\n\t\t$fieldNumericDesc \t= array();\r\n\t\t\r\n\t\t\r\n\t\tserverside_validation($fieldRequired, $fieldDescription, $fieldEmail, $fieldConfirm, $fieldConfirmDesc, $fieldNumeric, $fieldNumericDesc);\r\n\t}\r\n}", "function thumbwhere_contentcollection_edit_form_validate(&$form, &$form_state) {\n \n //if (twCanDebug()) debug($form); \n //if (twCanDebug()) debug($form_state);\n\n\n // No validation for pk\n\n\n // Convert fk autocomplete for fk_actor\n $value = $form['fk_actor']['#value'];\n // If we have something, escape the auto-completion encoding.\n if (!empty($value)) { \n $value = entity_autocomplete_get_id($value);\n form_set_value($form['fk_actor'], $value,$form_state);\n }\n //if (twCanDebug()) debug($form['fk_actor']);\n if (twCanDebug()) debug('fk_actor = ' . $value);\n // Validate fk fk_actor\n if (empty($value)) {\n form_set_error('fk_actor', t('Validation error, \\'fk_actor\\' is mandatory1.'));\n // throw new Exception('Field \\'fk_actor\\' in is mandatory');\n }\n\n // Validate normaltitle\n $value = $form['title']['#value'];\n // If we have no default value then we don't care much for checking for emptyness.\n\n\n \n\n //form_set_value( array('#parents' => array('array_key_parent', 'array_key_to_replace')) , $value, $form_state);\n\n \n \n $thumbwhere_contentcollection = $form_state['thumbwhere_contentcollection'];\n\n // Notify field widgets to validate their data.\n field_attach_form_validate('thumbwhere_contentcollection', $thumbwhere_contentcollection, $form, $form_state);\n \n \n \n}", "function validate_user_form()\n {\n }", "function validate_blog_form()\n {\n }", "protected function ValidateForm()\n {\n return true;\n }", "public function options_form_validate($form, &$form_state) {\n // Context module doesn't allow for validation of reaction fields.\n // @todo: Raise bug for context module.\n }", "static function validation(){\r\n jresearchimport('helpers.charsets', 'jresearch.admin');\r\n jresearchimport('tables.activity', 'jresearch.admin');\r\n $extra = implode('', JResearchCharsetsHelper::getLatinWordSpecialChars());\r\n $doc = JFactory::getDocument();\r\n $token = JSession::getFormToken();\r\n JHTML::_('behavior.tooltip');\r\n JHTML::_('behavior.formvalidation');\r\n $message = JText::_('JRESEARCH_FORM_NOT_VALID');\r\n\r\n $doc->addScriptDeclaration(\"Joomla.submitbutton = function(task){\r\n if (task == ''){\r\n return false;\r\n }else{\r\n var isValid=true;\r\n if (task != 'cancel' && task != 'close'){\r\n var forms = $$('form.form-validate');\r\n for (var i=0;i<forms.length;i++)\r\n {\r\n if (!document.formvalidator.isValid(forms[i]))\r\n {\r\n isValid = false;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (isValid) {\r\n Joomla.submitform(task);\r\n return true;\r\n } else {\r\n alert(Joomla.JText._('COM_JRESEARCH_FORM_ERROR_UNACCEPTABLE','Some values are unacceptable'));\r\n return false;\r\n }\r\n }\r\n };\");\r\n\r\n $doc->addScriptDeclaration('window.addEvent(\\'domready\\', function() {\r\n document.formvalidator.setHandler(\\'date\\', function(value) {\r\n regex=/^\\d{4}(-\\d{2}){2}$/;\r\n return regex.test(value); })\r\n });');\r\n\r\n $doc->addScriptDeclaration('window.addEvent(\\'domready\\', function() {\r\n document.formvalidator.setHandler(\\'url\\', function(value) {\r\n regex=/^(ftp|http|https|ftps):\\/\\/([a-z0-9]+([\\-\\.]{1}[a-z0-9]+)*\\.[a-z]{2,5}|localhost|\\d{1,3}(\\.\\d{1,3}){3})(:\\d{2,5})?(([0-9]{1,5})?\\/.*)?$/i;\r\n return regex.test(value); })\r\n });');\r\n\r\n $doc->addScriptDeclaration('window.addEvent(\\'domready\\', function() {\r\n document.formvalidator.setHandler(\\'year\\', function(value) {\r\n regex=/^([1-9]\\d{3}|0)$/i;\r\n return regex.test(value); })\r\n });');\r\n\r\n $doc->addScriptDeclaration('window.addEvent(\\'domready\\', function() {\r\n document.formvalidator.setHandler(\\'number\\', function(value) {\r\n regex=/^([\\+\\-]{0,1}\\d+\\.?\\d*)$/i;\r\n return regex.test(value); })\r\n });');\r\n \r\n $delimiter = JResearchActivity::$_keywordsDelimiter;\r\n $doc->addScriptDeclaration(\"window.addEvent('domready', function() {\r\n document.formvalidator.setHandler('keywords', function(value) {\r\n regex=/^[-_'\\w$extra\\s\\d]+(\".$delimiter.\"[-_'\\w$extra\\s\\d]+)*\".$delimiter.\"*$/i;\r\n return regex.test(value); })\r\n });\");\r\n\r\n $doc->addScriptDeclaration(\"window.addEvent('domready', function() {\r\n document.formvalidator.setHandler('issn', function(value) {\r\n regex=/^\\d{4}-?\\d{4}$/i;\r\n return regex.test(value); })\r\n });\");\r\n\r\n $doc->addScriptDeclaration(\"window.addEvent('domready', function() {\r\n document.formvalidator.setHandler('isbn', function(value) {\r\n regex=/^(\\d{10}|\\d{13}|\\d{9}x)$/i;\r\n return regex.test(value); })\r\n });\");\r\n }", "private function validateForm()\n {\n if ($this->frm->isSubmitted()) {\n $this->frm->cleanupFields();\n\n $txtFestivalYear = $this->frm->getField('year');\n $chkCoverImageEnabled = $this->frm->getField('cover_image_enabled');\n $chkCoverImageRequiredd = $this->frm->getField('cover_image_required');\n $chkMultiImagesEnabled = $this->frm->getField('multi_images_enabled');\n $ddmOverviewNumItems = $this->frm->getField('overview_num_items');\n $ddmRecentFestivalListNumitems = $this->frm->getField('recent_festival_list_num_items');\n\n // validate god user settings\n if ($this->godUser) {\n $txtImageSizeLimit = $this->frm->getField('image_size_limit');\n\n if ($txtImageSizeLimit->isFilled(Language::err('FieldIsRequired'))) {\n $txtImageSizeLimit->isFloat(Language::err('ImageSizeIsInvalid'));\n }\n }\n\n // validation\n $txtFestivalYear->isFilled(Language::err('FieldIsRequired'));\n\n if ($this->frm->isCorrect()) {\n // set settings\n Model::setModuleSetting($this->module, 'year', (string) ($txtFestivalYear->getValue()));\n Model::setModuleSetting($this->module, 'cover_image_enabled', (bool) ($chkCoverImageEnabled->isChecked()));\n Model::setModuleSetting($this->module, 'cover_image_required', (bool) ($chkCoverImageRequiredd->isChecked()));\n Model::setModuleSetting($this->module, 'multi_images_enabled', (bool) ($chkMultiImagesEnabled->isChecked()));\n Model::setModuleSetting($this->module, 'overview_num_items', (int) $ddmOverviewNumItems->getValue());\n Model::setModuleSetting($this->module, 'recent_festival_list_num_items', (int) $ddmRecentFestivalListNumitems->getValue());\n\n // set god user settings\n if ($this->godUser) {\n Model::setModuleSetting($this->module, 'image_size_limit', (float) $txtImageSizeLimit->getValue());\n }\n\n // trigger event\n Model::triggerEvent($this->getModule(), 'after_saved_settings');\n\n // redirect to the settings page\n $this->redirect(Model::createURLForAction('Settings') . '&report=saved');\n }\n }\n }", "public static function enable_validation($form_id) {\n self::$validated_form_id = $form_id;\n self::$javascript .= \"indiciaData.validatedFormId = '\" . self::$validated_form_id . \"';\\n\";\n // Prevent double submission of the form.\n self::$javascript .= \"$('#$form_id').submit(function(e) {\n if (typeof $('#$form_id').valid === 'undefined' || $('#$form_id').valid()) {\n if (typeof indiciaData.formSubmitted==='undefined' || !indiciaData.formSubmitted) {\n indiciaData.formSubmitted = true;\n } else {\n e.preventDefault();\n return false;\n }\n }\n});\\n\";\n self::add_resource('validation');\n // Allow i18n on validation messages.\n if (lang::get('validation_required') != 'validation_required') {\n self::$late_javascript .= \"$.validator.messages.required = \\\"\" . lang::get('validation_required') . \"\\\";\\n\";\n }\n if (lang::get('validation_max') != 'validation_max') {\n self::$late_javascript .= \"$.validator.messages.max = $.validator.format(\\\"\" . lang::get('validation_max') . \"\\\");\\n\";\n }\n if (lang::get('validation_min') != 'validation_min') {\n self::$late_javascript .= \"$.validator.messages.min = $.validator.format(\\\"\" . lang::get('validation_min') . \"\\\");\\n\";\n }\n if (lang::get('validation_number') != 'validation_number') {\n self::$late_javascript .= \"$.validator.messages.number = $.validator.format(\\\"\" . lang::get('validation_number') . \"\\\");\\n\";\n }\n if (lang::get('validation_digits') != 'validation_digits') {\n self::$late_javascript .= \"$.validator.messages.digits = $.validator.format(\\\"\" . lang::get('validation_digits') . \"\\\");\\n\";\n }\n if (lang::get('validation_integer') != 'validation_integer') {\n self::$late_javascript .= \"$.validator.messages.integer = $.validator.format(\\\"\" . lang::get('validation_integer') . \"\\\");\\n\";\n }\n }", "protected function validateForm()\n {\n if (!$this->user->hasPermission('modify', 'domain/domain')) {\n $this->error['warning'] = $this->language->get('error_permission');\n }\n\n if (empty($this->request->post['domain']) || !isset($this->request->post['domain'])) {\n $this->error['domain'] = $this->language->get('error_domain');\n } else {\n if (!preg_match('~^https?://(?:[a-z0-9](?:[-a-z0-9]*[a-z0-9])?\\.)+[a-z](?:[-a-z0-9]*[a-z0-9])?\\.?(?:$|/)~', $this->request->post['domain'])) {\n $this->error['domain'] = $this->language->get('error_domain');\n }\n }\n\n if (empty($this->request->post['currency_id'] || !isset($this->request->post['currency_id']))) {\n $this->error['currency'] = $this->language->get('error_currency');\n }\n\n if (empty($this->request->post['currency_title'] || !isset($this->request->post['currency_title']))) {\n $this->error['currency'] = $this->language->get('error_currency');\n }\n\n if ($this->error && !isset($this->error['warning'])) {\n $this->error['warning'] = $this->language->get('error_warning');\n }\n\n return !$this->error;\n }", "private function validateForm(): void\n { if ($this->form->isSubmitted()) {\n // get the status\n $status = $this->getRequest()->request->has('saveAsDraft') ? 'draft' : 'active';\n\n // cleanup the submitted fields, ignore fields that were added by hackers\n $this->form->cleanupFields();\n\n // validate fields\n $this->form->getField('title')->isFilled(BL::err('TitleIsRequired'));\n $this->form->getField('text')->isFilled(BL::err('FieldIsRequired'));\n $this->form->getField('publish_on_date')->isValid(BL::err('DateIsInvalid'));\n $this->form->getField('publish_on_time')->isValid(BL::err('TimeIsInvalid'));\n $this->form->getField('category_id')->isFilled(BL::err('FieldIsRequired'));\n if ($this->form->getField('category_id')->getValue() == 'new_category') {\n $this->form->getField('category_id')->addError(BL::err('FieldIsRequired'));\n }\n\n // validate meta\n $this->meta->validate();\n\n if ($this->form->isCorrect()) {\n // build item\n $item = [\n 'id' => (int) BackendBlogModel::getMaximumId() + 1,\n 'meta_id' => $this->meta->save(),\n 'category_id' => (int) $this->form->getField('category_id')->getValue(),\n 'user_id' => $this->form->getField('user_id')->getValue(),\n 'language' => BL::getWorkingLanguage(),\n 'title' => $this->form->getField('title')->getValue(),\n 'introduction' => $this->form->getField('introduction')->getValue(),\n 'text' => $this->form->getField('text')->getValue(),\n 'publish_on' => BackendModel::getUTCDate(\n null,\n BackendModel::getUTCTimestamp(\n $this->form->getField('publish_on_date'),\n $this->form->getField('publish_on_time')\n )\n ),\n 'created_on' => BackendModel::getUTCDate(),\n 'hidden' => $this->form->getField('hidden')->getValue(),\n 'allow_comments' => $this->form->getField('allow_comments')->getChecked(),\n 'num_comments' => 0,\n 'status' => $status,\n ];\n $item['edited_on'] = $item['created_on'];\n\n // insert the item\n $item['revision_id'] = BackendBlogModel::insert($item);\n\n if ($this->imageIsAllowed) {\n // the image path\n $imagePath = FRONTEND_FILES_PATH . '/Blog/images';\n\n // create folders if needed\n $filesystem = new Filesystem();\n $filesystem->mkdir([$imagePath . '/source', $imagePath . '/128x128']);\n\n // image provided?\n if ($this->form->getField('image')->isFilled()) {\n // build the image name\n $item['image'] = $this->meta->getUrl()\n . '-' . BL::getWorkingLanguage()\n . '-' . $item['revision_id']\n . '.' . $this->form->getField('image')->getExtension();\n\n // upload the image & generate thumbnails\n $this->form->getField('image')->generateThumbnails($imagePath, $item['image']);\n\n // add the image to the database without changing the revision id\n BackendBlogModel::updateRevision($item['revision_id'], ['image' => $item['image']]);\n }\n }\n\n // save the tags\n BackendTagsModel::saveTags($item['id'], $this->form->getField('tags')->getValue(), $this->url->getModule());\n\n // active\n if ($item['status'] == 'active') {\n // add search index\n BackendSearchModel::saveIndex($this->getModule(), $item['id'], ['title' => $item['title'], 'text' => $item['text']]);\n\n // everything is saved, so redirect to the overview\n $this->redirect(BackendModel::createUrlForAction('Index') . '&report=added&var=' . rawurlencode($item['title']) . '&highlight=row-' . $item['revision_id']);\n } elseif ($item['status'] == 'draft') {\n // draft: everything is saved, so redirect to the edit action\n $this->redirect(BackendModel::createUrlForAction('Edit') . '&report=saved-as-draft&var=' . rawurlencode($item['title']) . '&id=' . $item['id'] . '&draft=' . $item['revision_id'] . '&highlight=row-' . $item['revision_id']);\n }\n }\n }\n }", "public function onAfterValidate() {\nglobal $_LW;\nif ($_LW->page=='events_edit' || $_LW->page=='events_sub_edit') { // if saving from the events editor page\n\t/*\n\tif (!empty($_LW->_POST['sample_textarea']) && stripos($_LW->_POST['sample_textarea'], 'supercalifragilisticexpialidocious') !== false) { // optionally disallow the word \"supercalifragilisticexpialidocious\" from this custom field\n\t\t$_LW->REGISTERED_MESSAGES['failure'][] = 'Custom Field (Textarea) cannot contain the word supercalifragilisticexpialidocious.'; // register error\n\t};\n\t*/\n};\n}", "function jsformvalid() {\n\t\t$validpath = INC_FOLDER .'mg2_jsformvalid.php';\n\t\tif (($this->commentsets & 128) && is_readable($validpath)) {\n\t\t\tinclude($validpath);\n\t\t} else {\n\t\t\techo '<script language=\"JavaScript\" type=\"text/javascript\">\n\t\t\t\t\t<!--\n\t\t\t\t\t\tfunction validateCompleteForm(a,b) { return true; }\n\t\t\t\t\t-->\n\t\t\t\t\t</script>';\n\t\t}\n\t}", "function validate()\n\t{\n\t}", "abstract protected function fieldValidation($submittedData);", "function validateForm( &$process )\n {\n $errors[] = 'You must override this method: ezauthorizegateway::validateForm';\n if ( $errors )\n return $this->loadForm( $process, $errors );\n else\n return false;\n }", "function validate() {\n\t\t// If it's not required, there's nothing to validate\n\t\tif ( !$this->get_attribute( 'required' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$field_id = $this->get_attribute( 'id' );\n\t\t$field_type = $this->get_attribute( 'type' );\n\t\t$field_label = $this->get_attribute( 'label' );\n\n\t\t$field_value = isset( $_POST[$field_id] ) ? stripslashes( $_POST[$field_id] ) : '';\n\n\t\tswitch ( $field_type ) {\n\t\tcase 'email' :\n\t\t\t// Make sure the email address is valid\n\t\t\tif ( !is_email( $field_value ) ) {\n\t\t\t\t$this->add_error( sprintf( __( '%s requires a valid email address', 'jetpack' ), $field_label ) );\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault :\n\t\t\t// Just check for presence of any text\n\t\t\tif ( !strlen( trim( $field_value ) ) ) {\n\t\t\t\t$this->add_error( sprintf( __( '%s is required', 'jetpack' ), $field_label ) );\n\t\t\t}\n\t\t}\n\t}", "function thumbwhere_contentcollectionitem_edit_form_validate(&$form, &$form_state) {\n \n //if (twCanDebug()) debug($form); \n //if (twCanDebug()) debug($form_state);\n\n\n // No validation for pk\n\n\n // Convert fk autocomplete for fk_contentcollection\n $value = $form['fk_contentcollection']['#value'];\n // If we have something, escape the auto-completion encoding.\n if (!empty($value)) { \n $value = entity_autocomplete_get_id($value);\n form_set_value($form['fk_contentcollection'], $value,$form_state);\n }\n //if (twCanDebug()) debug($form['fk_contentcollection']);\n if (twCanDebug()) debug('fk_contentcollection = ' . $value);\n // Validate fk fk_contentcollection\n if (empty($value)) {\n form_set_error('fk_contentcollection', t('Validation error, \\'fk_contentcollection\\' is mandatory1.'));\n // throw new Exception('Field \\'fk_contentcollection\\' in is mandatory');\n }\n\n // Convert fk autocomplete for fk_content\n $value = $form['fk_content']['#value'];\n // If we have something, escape the auto-completion encoding.\n if (!empty($value)) { \n $value = entity_autocomplete_get_id($value);\n form_set_value($form['fk_content'], $value,$form_state);\n }\n //if (twCanDebug()) debug($form['fk_content']);\n if (twCanDebug()) debug('fk_content = ' . $value);\n // Validate fk fk_content\n if (empty($value)) {\n form_set_error('fk_content', t('Validation error, \\'fk_content\\' is mandatory1.'));\n // throw new Exception('Field \\'fk_content\\' in is mandatory');\n }\n\n // Validate normalweight\n $value = $form['weight']['#value'];\n // If we have no default value then we don't care much for checking for emptyness.\n\n\n \n\n //form_set_value( array('#parents' => array('array_key_parent', 'array_key_to_replace')) , $value, $form_state);\n\n \n \n $thumbwhere_contentcollectionitem = $form_state['thumbwhere_contentcollectionitem'];\n\n // Notify field widgets to validate their data.\n field_attach_form_validate('thumbwhere_contentcollectionitem', $thumbwhere_contentcollectionitem, $form, $form_state);\n \n \n \n}", "function signage_panes_video_edit_form_validate($form, &$form_state) {\n $video_provider = $form_state['values']['video_provider'];\n $video_playlist = $form_state['values']['video_playlist'];\n $video_embed_code = $form_state['values']['video_embed_code'];\n\n // Verify that a valid video ID is found.\n switch ($form_state['values']['video_provider']) {\n case 0:\n if ($form_state['values']['video_playlist']) {\n preg_match(YOUTUBE_PLAYLIST_REGEX_PATTERN, $form_state['values']['video_embed_code'], $matches);\n if (empty($matches[1])) {\n form_set_error('video_embed_code', t('The Video Embed Code does not contain a valid YouTube playlist ID.'));\n }\n } else {\n preg_match(YOUTUBE_REGEX_PATTERN, $form_state['values']['video_embed_code'], $matches);\n if (empty($matches[1])) {\n form_set_error('video_embed_code', t('The Video Embed Code does not contain a valid YouTube video ID.'));\n }\n }\n break;\n\n case 1:\n preg_match(VIMEO_REGEX_PATTERN, $form_state['values']['video_embed_code'], $matches);\n if (empty($matches[1])) {\n form_set_error('video_embed_code', t('The Video Embed Code does not contain a valid Vimeo video ID.'));\n }\n break;\n\n }\n\n // Verify that the embed code contains valid HTML tags.\n if (strip_tags($form_state['values']['video_embed_code']) != '') {\n form_set_error('video_embed_code', t('The Video Embed Code does not appear to be valid.'));\n }\n}", "function validate() {\n // @todo Remove module_load_include() call when moving to Drupal core.\n module_load_include('inc', 'fapitng', '/includes/fapitng.validate');\n foreach ($this->validate_callbacks as $callback => $info) {\n if (!call_user_func_array($callback, array_merge(array($this->value), $info['arguments']))) {\n $this->errors[] = $info['message'];\n }\n }\n if ($this->errors) {\n $this->request['invalid_elements'][$this->id] = $this;\n }\n $this->validateInputElements($this->children);\n\n if (!empty($this->request['invalid_elements'])) {\n $this->request['rebuild'] = TRUE;\n return FALSE;\n }\n return TRUE;\n }", "function form_backend_validation()\r\n {\r\n return true ;\r\n }", "function process_form()\n {\n }", "function thumbwhere_host_edit_form_validate(&$form, &$form_state) {\n \n //if (twCanDebug()) debug($form); \n //if (twCanDebug()) debug($form_state);\n\n\n // No validation for pk\n\n\n // Convert fk autocomplete for fk_hosttype\n $value = $form['fk_hosttype']['#value'];\n // If we have something, escape the auto-completion encoding.\n if (!empty($value)) { \n $value = entity_autocomplete_get_id($value);\n form_set_value($form['fk_hosttype'], $value,$form_state);\n }\n //if (twCanDebug()) debug($form['fk_hosttype']);\n if (twCanDebug()) debug('fk_hosttype = ' . $value);\n // Validate fk fk_hosttype\n if (empty($value)) {\n form_set_error('fk_hosttype', t('Validation error, \\'fk_hosttype\\' is mandatory1.'));\n // throw new Exception('Field \\'fk_hosttype\\' in is mandatory');\n }\n\n // Convert fk autocomplete for fk_hostcredential\n $value = $form['fk_hostcredential']['#value'];\n // If we have something, escape the auto-completion encoding.\n if (!empty($value)) { \n $value = entity_autocomplete_get_id($value);\n form_set_value($form['fk_hostcredential'], $value,$form_state);\n }\n //if (twCanDebug()) debug($form['fk_hostcredential']);\n if (twCanDebug()) debug('fk_hostcredential = ' . $value);\n // Validate fk fk_hostcredential\n if (empty($value)) {\n form_set_error('fk_hostcredential', t('Validation error, \\'fk_hostcredential\\' is mandatory1.'));\n // throw new Exception('Field \\'fk_hostcredential\\' in is mandatory');\n }\n\n // Validate normaladdress\n $value = $form['address']['#value'];\n // If we have no default value then we don't care much for checking for emptyness.\n if (empty($value)) {\n form_set_error('address', t('Validation error, \\'address\\' is mandatory2.'));\n //throw new Exception('Field \\'address\\' in is mandatory.');\n }\n\n // Validate normalonline\n $value = $form['online']['#value'];\n // If we have no default value then we don't care much for checking for emptyness.\n\n\n \n\n //form_set_value( array('#parents' => array('array_key_parent', 'array_key_to_replace')) , $value, $form_state);\n\n \n \n $thumbwhere_host = $form_state['thumbwhere_host'];\n\n // Notify field widgets to validate their data.\n field_attach_form_validate('thumbwhere_host', $thumbwhere_host, $form, $form_state);\n \n \n \n}" ]
[ "0.7394334", "0.7088699", "0.7042319", "0.7015811", "0.6985426", "0.6826592", "0.672792", "0.67194927", "0.6664427", "0.6565724", "0.6508049", "0.64651674", "0.64040256", "0.6382086", "0.6364699", "0.6315669", "0.62987787", "0.62357616", "0.6213225", "0.61988646", "0.61932755", "0.6182788", "0.6179501", "0.6178248", "0.6176538", "0.61674577", "0.6149445", "0.6140402", "0.61380285", "0.61159676" ]
0.7531355
0
This hook method handles all tasks that should be performed at the end of the execution flow. In practise this means pushing new commits to a remote repository, which needs to be done as a batch job, not repeatedly after each commit.
public function afterCallActionHandler() { $committer = AssetCommitterFactory::getCommitter(); // Check if there are any pushable commits if ($committer->isPushingEnabled() && $committer->hasCreatedNewCommits()) { $committer->PushToRemoteRepository(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function commitAndPush()\n {\n try {\n // Add files to git index, commit and push to client remote\n $this->git->add()->all()->execute();\n $this->git->commit()->message($this->commit_msg)->execute();\n $this->git->push()->execute($this->client_remote, $this->branch);\n } catch (GitException $e) {\n $this->logger->error('Failed to commit to Git repository. Error: '\n . $e->getMessage());\n }\n }", "private function do_commit_post()\n {\n // so will re-run 'porcelain' to get a list of files. We'll only 'git add'\n // any files supplied by the user that are in the list we get from porcelain\n // we'll then go ahead and commit them with the message supplied\n require_once 'Git-php-lib';\n $repo = Git::open('.');\n $status = $repo->porcelain();\n $git_files = array();\n foreach($status as $item) {\n $git_files[$item['file']] = $item['y'];\n }\n\n $to_add = array();\n $to_rm = array();\n foreach($_REQUEST['file'] as $requested_file) {\n if(array_key_exists($requested_file, $git_files)) {\n if($git_files[$requested_file] == 'D') {\n $to_rm[] = $requested_file;\n } else {\n $to_add[] = $requested_file;\n }\n }\n }\n\n $add_output = '';\n if(count($to_add) > 0) {\n try {\n $add_output = $repo->add($to_add);\n }\n catch(Exception $e) {\n $add_output = 'Failed to run git-add: ' . $e->getMessage();\n }\n }\n #$add_output = preg_replace('/\\r?\\n\\r?/', \"<br>\\n\", $add_output);\n if(count($to_rm) > 0) {\n $rm_output = '';\n try {\n $rm_output = $repo->rm($to_rm);\n }\n catch(Exception $e) {\n $rm_output = 'Failed to run git-rm: ' . $e->getMessage();\n }\n }\n\n $commit_output = '';\n try {\n $commit_output = $repo->commit($_REQUEST['message'], false);\n }\n catch(Exception $e) {\n $commit_output = 'Failed to run git-commit: ' . $e->getMessage();\n }\n #$commit_output = preg_replace('/\\r?\\n\\r?/', \"<br>\\n\", $add_output);\n\n if(file_exists('./plugins/pico_edit/commitresponse.html')) {\n $loader = new Twig_Loader_Filesystem('./plugins/pico_edit');\n $twig = new Twig_Environment($loader, array('cache' => null));\n $twig->addExtension(new Twig_Extension_Debug());\n $twig_vars = array(\n 'add' => $add_output,\n 'rm' => $rm_output,\n 'commit' => $commit_output,\n );\n $content = $twig->render('commitresponse.html', $twig_vars);\n die($content);\n } else {\n die('Sorry, commitresponse.html was not found in the backend plugin. This is an installation problem.');\n }\n }", "public function commit() {}", "public function afterBatch();", "public abstract function afterExec();", "protected function _postExec()\n {\n }", "public function commit()\n {\n }", "public function commit()\n {\n }", "public function afterSaveCommit(): void\n {\n }", "public function postExec()\n {\n }", "public static function commit()\n {\n }", "function drush_postflight() {\n drush_set_context(\"DRUSH_EXECUTION_COMPLETED\", TRUE);\n}", "public function postCommitHook($status, $table, $id, $record, $oldRecord, $pObj);", "private function githubSyncProcess()\n\t{\n\n\t\t// Delete any existing file.\n\t\tif(file_exists(e_TEMP.\"e107-master.zip\"))\n\t\t{\n\t\t\tunlink(e_TEMP.\"e107-master.zip\");\n\t\t}\n\n\t\t$result = e107::getFile()->getRemoteFile('https://codeload.github.com/e107inc/e107/zip/master', 'e107-master.zip', 'temp');\n\n\t\tif($result == false)\n\t\t{\n\t\t\te107::getMessage()->addError( DBLAN_118 );\n\t\t}\n\n\n\t\t$localfile = 'e107-master.zip';\n\n\t\tchmod(e_TEMP.$localfile, 0755);\n\t\trequire_once(e_HANDLER.\"pclzip.lib.php\");\n\n//\t$base = realpath(dirname(__FILE__));\n\n\n\t\t$newFolders = array(\n\t\t\t'e107-master/e107_admin/' => e_BASE.e107::getFolder('ADMIN'),\n\t\t\t'e107-master/e107_core/' => e_BASE.e107::getFolder('CORE'),\n\t\t\t'e107-master/e107_docs/' => e_BASE.e107::getFolder('DOCS'),\n\t\t\t'e107-master/e107_handlers/' => e_BASE.e107::getFolder('HANDLERS'),\n\t\t\t'e107-master/e107_images/' => e_BASE.e107::getFolder('IMAGES'),\n\t\t\t'e107-master/e107_languages/' => e_BASE.e107::getFolder('LANGUAGES'),\n\t\t\t'e107-master/e107_media/' => e_BASE.e107::getFolder('MEDIA'),\n\t\t\t'e107-master/e107_plugins/' => e_BASE.e107::getFolder('PLUGINS'),\n\t\t\t'e107-master/e107_system/' => e_BASE.e107::getFolder('SYSTEM'),\n\t\t\t'e107-master/e107_themes/' => e_BASE.e107::getFolder('THEMES'),\n\t\t\t'e107-master/e107_web/' => e_BASE.e107::getFolder('WEB'),\n\t\t\t'e107-master/' => e_BASE\n\t\t);\n\n\t\t$srch = array_keys($newFolders);\n\t\t$repl = array_values($newFolders);\n\n\t\t$archive \t= new PclZip(e_TEMP.$localfile);\n\t\t$unarc \t\t= ($fileList = $archive -> extract(PCLZIP_OPT_PATH, e_TEMP, PCLZIP_OPT_SET_CHMOD, 0755)); // Store in TEMP first.\n\n\t\t$error = array();\n\t\t$success = array();\n\t\t$skipped = array();\n//\tprint_a($unarc);\n\n\n\t\t$excludes = array('e107-master/','e107-master/install.php','e107-master/favicon.ico');\n\n\t\tforeach($unarc as $k=>$v)\n\t\t{\n\t\t\tif(in_array($v['stored_filename'],$excludes))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$oldPath = $v['filename'];\n\t\t\t$newPath = str_replace($srch,$repl, $v['stored_filename']);\n\n\t\t\t$message = e107::getParser()->lanVars(DBLAN_121, array('x'=>$oldPath, 'y'=>$newPath));\n\n\t\t\tif($v['folder'] ==1 && is_dir($newPath))\n\t\t\t{\n\t\t\t\t// $skipped[] = $newPath. \" (already exists)\";\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif(!rename($oldPath,$newPath))\n\t\t\t{\n\t\t\t\t$error[] = $message;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$success[] = $message;\n\t\t\t}\n\n\n\t\t\t//\techo $message.\"<br />\";\n\n\t\t}\n\n\t\tif(!empty($success))\n\t\t{\n\t\t\te107::getMessage()->addSuccess(print_a($success,true));\n\t\t}\n\n\t\tif(!empty($skipped))\n\t\t{\n\t\t\te107::getMessage()->setTitle(\"Skipped\",E_MESSAGE_INFO)->addInfo(print_a($skipped,true));\n\t\t}\n\n\t\tif(!empty($error))\n\t\t{\n\t\t\te107::getMessage()->addError(print_a($error,true));\n\t\t}\n\n\n\n\n\t\te107::getRender()->tablerender(DBLAN_10.SEP.DBLAN_112, e107::getMessage()->render());\n\n\t}", "function commit() ;", "public function committed();", "public function beforeFinishingDeploy()\n {\n // $this->runRemote('{{ console_bin }} app:my-task-name');\n // $this->runLocal('say \"The deployment has finished.\"');\n }", "public function commitEvents();", "public function updateGitHooks()\n {\n $tasks = [];\n $hooks = ['pre-commit'];\n \n foreach($hooks as $hook) {\n $tasks += $this->getAppendingTasks($hook);\n }\n\n return $this->collectionBuilder()->addTaskList($tasks);\n }", "function github($key) {\n //the commit message should be ending with #task_id. ex: Added webhook #233\n $payloads = json_decode(file_get_contents('php://input'));\n if (!$this->_is_valid_payloads_of_github($payloads, $key)) {\n app_redirect(\"forbidden\");\n }\n\n $final_commits_array = $this->_get_final_commits_of_github($payloads);\n\n if ($final_commits_array) {\n foreach ($final_commits_array as $commit) {\n $task_id = get_array_value($commit, \"task_id\");\n $task_info = $this->Tasks_model->get_one($task_id);\n if ($task_info->id) {\n $log_data = array(\n \"action\" => \"github_notification_received\",\n \"log_type\" => \"task\",\n \"log_type_title\" => $task_info->title,\n \"log_type_id\" => $task_id,\n \"changes\" => serialize(array(\"github\" => array(\"from\" => \"\", \"to\" => $commit))),\n \"log_for\" => \"project\",\n \"log_for_id\" => $task_info->project_id,\n );\n\n $save_id = $this->Activity_logs_model->ci_save($log_data, true);\n\n if ($save_id) {\n //send notification\n $notification_options = array(\"project_id\" => $task_info->project_id, \"task_id\" => $task_id, \"activity_log_id\" => $save_id, \"user_id\" => \"999999997\");\n log_notification(\"github_push_received\", $notification_options);\n }\n }\n }\n }\n }", "public function executePull(){\r\n\t\t// set return array\r\n\t\t$return = array('pull_result' => '');\r\n\r\n\t\t// fetch data\r\n\t\t$jsonData = $this->getJsonData();\r\n\r\n\t\t//try executing\r\n\t\ttry {\r\n\t\t\t// check if git is still processing anything\r\n\t\t\tif ($this->isProcessing() === FALSE) {\r\n\t\t\t\t// set the process to active\r\n\t\t\t\t$this->setProcess();\r\n\r\n\t\t\t\t// execute pull command\r\n\t\t\t\t$return['pull_result'] = $this->executeCommand('cd ' . MAIN_DIR . ' && git reset --hard ' . GIT_BRANCH_REF . ' 2>&1');\r\n\r\n\t\t\t\t// handle the git result\r\n\t\t\t\t$this->handleGitResult($return);\r\n\r\n\t\t\t\t// refetch data\r\n\t\t\t\t$jsonData = $this->getJsonData();\r\n\r\n\t\t\t\t// decrement process\r\n\t\t\t\t$jsonData->status = 0;\r\n\t\t\t} else {\r\n\t\t\t\t$jsonData->status = isset($jsonData->status) ? 1 : 0;\r\n\t\t\t\t$return['pull_result'] = \"Max attempts (\" . MAX_ATTEMPTS . \") reached!\\n\";\r\n\t\t\t}\r\n\r\n\t\t\t// echo for hook window\r\n\t\t\techo \"PULL RETURN (\" . $this->attempts . \")\\n\";\r\n\t\t\techo $return['pull_result'];\r\n\r\n\t\t\t// overwrite file\r\n\t\t\t$this->overWriteFile($this->jsonFile, json_encode($jsonData));\r\n\r\n\t\t\t// renew json data from json file\r\n\t\t\t$jsonData = $this->getJsonData();\r\n\r\n\t\t\t// check jsondata\r\n\t\t\tif ($jsonData->status > 0 && $this->attempts < MAX_ATTEMPTS) {\r\n\t\t\t\t// execute again after 1 scond\r\n\t\t\t\tsleep(1);\r\n\t\t\t\t$this->attempts++;\r\n\t\t\t\t$this->executePull();\r\n\t\t\t\techo \"\\n\";\r\n\t\t\t} else if ($this->attempts >= MAX_ATTEMPTS) {\r\n\t\t\t\t$this->handleGitResult($return);\r\n\t\t\t} else {}\r\n\t\t} catch (Exception $e) {\r\n\t\t\t$jsonData->status = 0;\r\n\t\t\t$this->overWriteFile($this->jsonFile, json_encode($jsonData));\r\n\t\t}\r\n\t}", "public function beforeExecute($remoteExecutor) \n {\n $args = $this->_getArgs();\n $remoteExecutor->addPostVariable('last_commit_file', $args['last-commit-file']);\n }", "public function after_run() {}", "abstract protected function commit_changes($changes);", "public function commit();", "public function commit();", "public function commit();", "public function commit();", "public function commit();", "private function syncRepository()\n {\n $cwd = '/tmp/'.$this->migrationId;\n (new ProcessBuilder(['mkdir']))->add('-p')->add($cwd)->getProcess()->mustRun();\n\n $cloneSourceCommandBuilder = new ProcessBuilder(['git', 'clone', $this->sourceProject->getSshUrlToRepo(), '.']);\n $cloneSourceCommandBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $addNewRemoteBuilder = new ProcessBuilder(['git', 'remote', 'add', 'new']);\n $addNewRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->add($this->targetProject->getSshUrlToRepo())\n ->getProcess()\n ->mustRun();\n\n $pushToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--all']);\n $pushToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $pushTagsToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--tags']);\n $pushTagsToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n }" ]
[ "0.61120784", "0.6105573", "0.5965105", "0.58929", "0.5852995", "0.57792735", "0.5765373", "0.5765373", "0.57640105", "0.571736", "0.5713891", "0.56913763", "0.56624764", "0.5599825", "0.5597397", "0.558323", "0.5551112", "0.55437493", "0.55187833", "0.55156", "0.55105436", "0.54850006", "0.5481167", "0.54704076", "0.5424296", "0.5424296", "0.5424296", "0.5424296", "0.5424296", "0.5421212" ]
0.7177815
0
command Session handling functions
protected function setCommandSession($sessionName){ $obj = new \stdClass; $obj->commandName = get_class($this); $obj->sessionName = $sessionName; if(!apcu_exists($this->getChatId())){ apcu_add($this->getChatId(),json_encode($obj)); } else{ apcu_store($this->getChatId(),json_encode($obj)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract function command();", "private function get_command(){\n if (!isset($_POST['command'])) {\n die(\"No command received, no result\");\n }\n $this->command = $_POST['command'];\n }", "public function nextCommand();", "function msg_processing_commands($context) {\n if($context->is_callback()) {\n if(isset($context->memory[MYGAMES_SWITCH_KEY])) {\n if(!$context->verify_callback()) {\n return false;\n }\n\n if(preg_match_all('/^switch (\\d*) (0|1)$/', $context->callback->data, $matches, PREG_PATTERN_ORDER) >= 1) {\n $target_id = intval($matches[1][0]);\n $target_admin = (bool)$matches[2][0];\n\n Logger::info(\"Switching to game #{$target_id} as admin \" . b2s($target_admin), __FILE__, $context);\n\n $context->set_active_game($target_id, $target_admin);\n\n $context->comm->reply(\"Done!\");\n }\n\n $context->memory[MYGAMES_SWITCH_KEY] = null;\n\n return true;\n }\n }\n\n else if($context->is_message()) {\n $text = $context->message->text;\n\n // HELP\n if($text === '/help') {\n $context->comm->reply(__('cmd_help'));\n\n return true;\n }\n // START\n else if(starts_with($text, '/start')) {\n $payload = extract_command_payload($text);\n\n Logger::debug(\"Start command with payload '{$payload}'\", __FILE__, $context);\n\n if($payload === '') {\n // Naked /start message\n if($context->game && $context->game->group_state) {\n $context->comm->reply(__('cmd_start_registered'));\n\n msg_processing_handle_group_state($context);\n }\n else {\n $context->comm->reply(__('cmd_start_new'));\n }\n }\n else if($payload === 'test') {\n // Test message from docs website\n $context->comm->reply(__('cmd_test'));\n }\n else {\n $code_info = db_row_query(sprintf(\n \"SELECT `type`, `event_id`, `game_id`, `location_id`, `is_disabled` FROM `code_lookup` WHERE `code` = '%s'\",\n db_escape($payload)\n ));\n\n if($code_info === false) {\n $context->comm->reply(__('failure_general'));\n return true;\n }\n if($code_info == null) {\n Logger::warning(\"Unknown /start payload received: '{$payload}'\", __FILE__, $context);\n $context->comm->reply(__('cmd_start_wrong_payload'));\n return true;\n }\n else if($code_info[4] == 1) {\n // Code has been disabled\n $context->comm->reply(__('cmd_start_wrong_payload'));\n return true;\n }\n\n Logger::debug(\"Code '{$payload}' for {$code_info[0]} scanned\", __FILE__, $context);\n\n $event_id = intval($code_info[1]);\n $game_id = intval($code_info[2]);\n $location_id = intval($code_info[3]);\n\n switch($code_info[0]) {\n case 'creation':\n Logger::debug(\"Creation code scanned for event #{$event_id}\", __FILE__, $context);\n\n msg_processing_init_game_creation($context, $event_id);\n\n break;\n\n case 'registration':\n Logger::debug(\"Registration code scanned for game #{$game_id}\", __FILE__, $context);\n\n $result = bot_register($context, $game_id);\n if($result === true) {\n $context->comm->reply(__('cmd_register_confirm'));\n msg_processing_handle_group_state($context);\n }\n else if($result === 'already_registered') {\n $context->comm->reply(__('cmd_register_registered'));\n msg_processing_handle_group_state($context);\n }\n else if($result === 'unallowed_event_not_ready') {\n $context->comm->reply(__('cmd_register_game_unallowed_event_not_ready'));\n }\n else if($result === 'unallowed_event_over') {\n $context->comm->reply(__('cmd_register_game_unallowed_event'));\n }\n else if($result === 'unallowed_game_over') {\n $context->comm->reply(__('cmd_register_game_unallowed'));\n }\n else if($result === 'unallowed_game_not_ready') {\n $context->comm->reply(__('cmd_register_game_unallowed_not_ready'));\n }\n else {\n $context->comm->reply(__('failure_general'));\n }\n break;\n\n case 'location':\n Logger::debug(\"Location code scanned for location #{$location_id}, game #{$game_id}\", __FILE__, $context);\n\n $result = bot_reach_location($context, $location_id, $game_id);\n if($result === false) {\n $context->comm->reply(__('failure_general'));\n }\n else if($result === 'unexpected') {\n $context->comm->reply(__('cmd_start_location_unexpected'));\n }\n else if($result === 'wrong') {\n $context->comm->reply(__('cmd_start_location_wrong'));\n }\n else if($result === 'unallowed_event_not_ready') {\n $context->comm->reply(__('failure_event_not_ready'));\n }\n else if($result === 'unallowed_event_over') {\n $context->comm->reply(__('failure_event_over'));\n }\n else if($result === 'unallowed_game_not_ready') {\n $context->comm->reply(__('failure_game_not_ready'));\n }\n else if($result === 'unallowed_game_over') {\n $context->comm->reply(__('failure_game_dead'));\n }\n else {\n if($result === 'first') {\n $context->comm->reply(__('cmd_start_location_reached_first'));\n }\n else if($result === 'last') {\n $context->comm->reply(__('cmd_start_location_reached_last'));\n }\n else {\n $context->comm->reply(__('cmd_start_location_reached'));\n }\n\n msg_processing_handle_group_state($context);\n }\n break;\n\n case 'victory':\n Logger::debug(\"Victory code scanned for game #{$game_id}, event #{$event_id}\", __FILE__, $context);\n\n msg_process_victory($context, $event_id, $game_id);\n\n break;\n\n default:\n Logger::error(\"Code '{$payload}' matches unknown type {$code_info[0]}\", __FILE__, $context);\n\n $context->comm->reply(__('cmd_start_wrong_payload'));\n\n break;\n }\n }\n\n return true;\n }\n // STATUS\n else if($text === '/status') {\n if(!$context->game) {\n $context->comm->reply(\"You are new to me. Hello! 🙂\");\n return true;\n }\n\n $status = \"%FIRST_NAME%, you are \" . (($context->game->is_admin) ? '<b>administering</b>' : 'playing') . \" game <code>#%GAME_ID%</code> “%GAME_NAME%”, in the event <code>#%EVENT_ID%</code> “%EVENT_NAME%”.\\n\";\n\n if($context->game->is_admin) {\n $status .= 'The game is <code>' . map_state_to_string(GAME_STATE_READABLE_MAP, $context->game->game_state) . '</code>.';\n }\n else {\n $status .= 'Your team “%GROUP_NAME%” is in state: <code>' . map_state_to_string(STATE_READABLE_MAP, $context->game->group_state) . '</code>.';\n }\n\n $context->comm->reply($status);\n\n return true;\n }\n // MY GAMES\n else if($text === '/mygames') {\n $games = bot_get_associated_games($context);\n\n $text = '';\n $game_keyboard = array();\n $seen_admin = false;\n $seen_player = false;\n $i = 0;\n foreach($games as $game) {\n if($game[3] && !$seen_admin) {\n $seen_admin = true;\n $text .= \"👑 <b>Administered games:</b>\\n\";\n }\n if(!$game[3] && !$seen_player) {\n $seen_player = true;\n $text .= \"👤 <b>Played games:</b>\\n\";\n }\n\n $text .= \"<code>#{$game[0]}</code> \" . (($game[1]) ? \"“{$game[1]}”\" : \"No name\") . \" (\" . map_state_to_string(GAME_STATE_READABLE_MAP, $game[2]) . \")\";\n if($context->game->game_id == $game[0] && $context->game->is_admin == $game[3]) {\n $text .= \" ✅\";\n }\n\n $text .= \"\\n\";\n\n if($i % 3 == 0) {\n $game_keyboard[] = array();\n }\n $game_keyboard[sizeof($game_keyboard) - 1][] = array(\n 'text' => (($game[3]) ? '👑 Admin #' : '👤 Play #') . $game[0],\n 'callback_data' => \"switch {$game[0]} \" . (int)$game[3]\n );\n $i++;\n }\n\n $text .= \"\\nTo which game do you want to switch?\";\n\n $context->memorize_callback($context->comm->reply($text, null, array(\n 'reply_markup' => array(\n 'inline_keyboard' => $game_keyboard\n )\n )));\n\n $context->memory[MYGAMES_SWITCH_KEY] = true;\n\n return true;\n }\n }\n\n return false;\n}", "function run()\n {\n $cmd = $this->param[1];\n \n $userId = $_SESSION['LOGIN_USER']['userId'];\n \n //$this->sendEmail(5);\n //$this->getTicketPriority(5);\n //echo \"<PRE>\";\n //print_r($_SESSION);\n \n if($cmd != 'upload')\n {\n // Redirects to Login controller if user is not logged in\n if($userId == null)\n {\n header('location: ' . SUPER_CONTROLLER_URL_PREFIX . 'Login');\n exit;\n }\n }\n\n \n switch($cmd)\n {\n case 'attachment' : $screen = $this->downloadAttachment(); break;\n case 'upload' : $screen = $this->uploadFile(); break;\n case 'rm_upload' : $screen = $this->removeUploadedFile(); break;\n case 'add_detail' : $screen = $this->addDetail(); break;\n case 'details' : $screen = $this->showTicketDetails(); break;\n case 'search_tag' : $screen = $this->searchTag(); break;\n case 'add_tag' : $screen = $this->addTag(); break;\n case 'assign_self' : $screen = $this->assignSelf(); break;\n case 'mark_executive' : $screen = $this->markExecutive(); break;\n case 'delete_ticket' : $screen = $this->deleteTicket(); break;\n case 'close_ticket' : $screen = $this->closeTicket(); break;\n case 'list' : $screen = $this->showTicketList(); break;\n case 'ajax_list' : $screen = $this->getTicketListForAjax(); break; \n case 'priority' : $screen = $this->getTicketListByPriority(); break; \n case 'print' : $screen = $this->printTicketDetails(); break;\n case 'piority_ajax_list' : $screen = $this->getTicketListForPriorityAjax(); break; \n case 'gen_dialog_form' : $screen = $this->isResolverByTicket(); break;\n case 'merge_ticket' : $screen = $this->mergeTicket(); break;\n case 'rate_ticket' : $screen = $this->saveTicketRating(); break;\n case 'log' : $screen = $this->activityLogReport(); break;\n case 'correct' : $screen = $this->correctDB(); break;\n default : $screen = $this->showTicketList(); \n }\n \n $data = array();\n $data['topnav'] = 'home';\n $data['tagList'] = Utils::getAllTagList($this->db);\n $userList = new UserList($this->db);\n $data['sourceUser'] = $userList->getUsersFromMySources();\n $data['source_id'] = $_SESSION['source_id'];\n $data['source_name'] = Utils::getSourceName($this->db , $_SESSION['source_id']);\n //echo \"<pre>\";\n //print_r($_SESSION);\n echo $this->template->createScreen($screen, $data);\n exit;\n }", "abstract protected function executeCommand();", "public function __construct() {\n $this->id = 'command-session-'.uniqid('', true);\n $this->commands = [];\n $this->created = time();\n $this->session = self::SESSION_ACTIVE;\n $this->state = new State();\n $this->store = new Store();\n $this->handler = null;\n\n // Hook to handle played events\n $this->hook('output_played', [$this, 'played']);\n }", "private function command_loop(){\n ///system(\"stty -icanon\");\n $this->command_pipe = self::LOOP_RUN;\n\n while($this->command_pipe != self::LOOP_QUIT){\n\n try {\n $command_split = array();\n $this->mandatory_arg_index = null;\n cli::text_prompt('$'.$this->className, null, $command_split);\n if($command_split == self::$REPLAY_COMMAND)\n $command_split = $this->last_command;\n else\n $this->last_command = $command_split;\n\n $command_prompt = array_shift($command_split);\n list($command_callback, $command_args) = $this->command_parse($command_prompt, $command_split);\n } catch(Exception $e){ continue; }\n\n try {\n $res = call_user_func_array($command_callback, $command_args);\n if($res !== null) {\n if($this->output == self::OUTPUT_RAW)\n echo $res;\n elseif($this->output == self::OUTPUT_JSON)\n echo json_encode($res);\n else cli::box('Response', $res);\n }\n\n } catch(Exception $e){\n echo CRLF;\n $msg = $e->getMessage() ? $e->getMessage() : $e;\n $trace = $e->getTraceAsString();\n $trace = strtr($trace, array(YKS_PATH=>'yks', getcwd().DIRECTORY_SEPARATOR => ''));\n cli::box(\"!! Uncatched exception !!\", $msg , \"trace\", $trace, array('trim'));\n continue;\n }\n\n }\n\n }", "function set_prompt() {\n return $_SESSION['astcmd']['host'] . \"*CLI> \";\n}", "function cmdClient()\n\t{\n\t\t$cmd = $this->cmd;\n\t\tswitch ($this->cmd)\n\t\t{\n\t\t\tcase NULL:\n\t\t\tcase \"view\":\n\t\t\t\tif ($this->setup->getClient()->db_installed)\n\t\t\t\t{\n\t\t\t\t\t$this->setDisplayMode(\"view\");\n\t\t\t\t\t$this->displayClientOverview();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->cmd = \"db\";\n\t\t\t\t\t$this->displayDatabase();\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase \"ini\":\n\t\t\t\t// only allow access to ini if db does not exist yet\n\t\t\t\t//if ($this->setup->getClient()->db_installed)\n\t\t\t\t//{\n\t\t\t\t//\t$this->cmd = \"db\";\n\t\t\t\t//\t$this->displayDatabase();\n\t\t\t\t//}\n\t\t\t\t//else\n\t\t\t\t//{\n\t\t\t\t\t$this->displayIni();\n\t\t\t\t//}\n\t\t\t\tbreak;\n\n\t\t\tcase \"db\":\n\t\t\t\t$this->displayDatabase();\n\t\t\t\tbreak;\n\n\t\t\tcase \"dbslave\":\n\t\t\t\t$this->displayDatabaseSlave();\n\t\t\t\tbreak;\n\n\t\t\tcase \"sess\":\n\t\t\t\tif (!isset($_GET[\"lang\"]) and !$this->setup->getClient()->status[\"finish\"][\"status\"] and $_GET[\"cmd\"] == \"sess\" and $this->setup->error === true)\n\t\t\t\t{\n\t\t\t\t\t$this->jumpToFirstUnfinishedSetupStep();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->displaySessions();\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase \"lang\":\n\t\t\t\tif (!isset($_GET[\"lang\"]) and !$this->setup->getClient()->status[\"finish\"][\"status\"] and $_GET[\"cmd\"] == \"lang\" and $this->setup->error === true)\n\t\t\t\t{\n\t\t\t\t\t$this->jumpToFirstUnfinishedSetupStep();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->displayLanguages();\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase \"contact\":\n\t\t\t\tif (!isset($_GET[\"lang\"]) and !$this->setup->getClient()->status[\"finish\"][\"status\"] and $_GET[\"cmd\"] == \"contact\")\n\t\t\t\t{\n\t\t\t\t\t$this->jumpToFirstUnfinishedSetupStep();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->displayContactData();\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase \"proxy\":\n\t\t\t\tif (!isset($_GET[\"lang\"]) and !$this->setup->getClient()->status[\"finish\"][\"status\"] and $_GET[\"cmd\"] == \"proxy\")\n\t\t\t\t{\n\t\t\t\t\t$this->jumpToFirstUnfinishedSetupStep();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->displayProxy();\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase \"cache\":\n\t\t\t\t$this->displayCache();\n\t\t\t\tbreak;\n\n\n\t\t\tcase \"nic\":\n\t\t\t\tif (!isset($_GET[\"lang\"]) and !$this->setup->getClient()->status[\"finish\"][\"status\"] and $_GET[\"cmd\"] == \"nic\")\n\t\t\t\t{\n\t\t\t\t\t$this->jumpToFirstUnfinishedSetupStep();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->displayNIC();\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase \"finish\":\n\t\t\t\tif (!isset($_GET[\"lang\"]) and !$this->setup->getClient()->status[\"finish\"][\"status\"] and $_GET[\"cmd\"] == \"finish\")\n\t\t\t\t{\n\t\t\t\t\t$this->jumpToFirstUnfinishedSetupStep();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->displayFinishSetup();\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase \"changeaccess\":\n\t\t\t\t$this->changeAccessMode($_GET[\"back\"]);\n\t\t\t\tbreak;\n\n\t\t\tcase \"logout\":\n\t\t\t\t$this->displayLogout();\n\t\t\t\tbreak;\n\n\t\t\tcase \"login\":\n\t\t\t\tsession_destroy();\n\t\t\t\tilUtil::redirect(ILIAS_HTTP_PATH.\"/login.php?client_id=\".$this->setup->getClient()->getId());\n\t\t\t\tbreak;\n\n\t\t\tcase \"login_new\":\n\t\t\t\tif ($this->setup->getClient()->ini->readVariable(\"client\",\"access\") != \"1\")\n\t\t\t\t{\n\t\t\t\t\t$this->setup->getClient()->ini->setVariable(\"client\",\"access\",\"1\");\n\t\t\t\t\t$this->setup->getClient()->ini->write();\n\t\t\t\t}\n\n\t\t\t\tsession_destroy();\n\t\t\t\tilUtil::redirect(ILIAS_HTTP_PATH.\"/login.php?client_id=\".$this->setup->getClient()->getId());\n\t\t\t\tbreak;\n\n\t\t\tcase \"tools\":\n\t\t\t\t$this->displayTools();\n\t\t\t\tbreak;\n\n\t\t\tcase \"reloadStructure\":\n\t\t\t\t$this->reloadControlStructure();\n\t\t\t\tbreak;\n\n\t\t\tcase 'switchTree':\n\t\t\t\t$this->switchTree();\n\t\t\t\tbreak;\n\n\t\t\tcase \"saveClientIni\":\n\t\t\tcase \"installDatabase\":\n\t\t\tcase \"displayDatabase\":\n\t\t\tcase \"updateDatabase\":\n\t\t\tcase \"showUpdateSteps\":\n\t\t\tcase \"saveLanguages\":\n\t\t\tcase \"saveContact\":\n\t\t\tcase \"displayContactData\":\n\t\t\tcase \"displayNIC\":\n\t\t\tcase \"saveRegistration\":\n\t\t\tcase \"applyHotfix\":\n\t\t\tcase \"showHotfixSteps\":\n\t\t\tcase \"applyCustomUpdates\":\n\t\t\tcase \"changeSettingsType\":\n\t\t\tcase \"showLongerSettings\":\n\t\t\tcase \"cloneSelectSource\":\n\t\t\tcase \"cloneSaveSource\":\n\t\t\tcase \"saveProxy\":\n\t\t\tcase \"displayPassword\":\n\t\t\tcase \"savePassword\":\n\t\t\tcase \"saveDbSlave\":\n\t\t\tcase \"saveCache\":\n\t\t\t\t$this->$cmd();\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$this->displayError($this->lng->txt(\"unknown_command\"));\n\t\t\t\tbreak;\n\t\t}\n\t}", "protected function callCommandMethod() {}", "public function sessionCommand(BallotBox $ballotBox) {\n\t\t$protocolHandler = new UrneFrontendProtocol($ballotBox, $this->streamHandler);\n\t\t$protocolHandler->run();\n\t}", "abstract protected function getCommand();", "function cmdAdmin()\n\t{\n\t\t$cmd = $this->cmd;\n\n\t\tswitch ($this->cmd)\n\t\t{\n\t\t\tcase NULL:\n\t\t\tcase \"clientlist\":\n\t\t\t\t$this->setDisplayMode(\"view\");\n\t\t\t\t$this->displayClientList();\n\t\t\t\t$this->active_tab = \"clientlist\";\n\t\t\t\tbreak;\n\n\t\t\tcase \"changepassword\":\n\t\t\t\t$this->setDisplayMode(\"view\");\n\t\t\t\t$this->changeMasterPassword();\n\t\t\t\t$this->active_tab = \"password\";\n\t\t\t\tbreak;\n\n\t\t\tcase \"mastersettings\":\n\t\t\t\t$this->setDisplayMode(\"view\");\n\t\t\t\t$this->changeMasterSettings();\n\t\t\t\t$this->active_tab = \"basicsettings\";\n\t\t\t\tbreak;\n\n\t\t\tcase \"determineToolsPath\":\n\t\t\t\t$this->setDisplayMode(\"view\");\n\t\t\t\t$this->determineToolsPath();\n\t\t\t\tbreak;\n\n\t\t\tcase \"changedefault\":\n\t\t\t\t$this->changeDefaultClient();\n\t\t\t\tbreak;\n\n\t\t\tcase \"newclient\":\n\t\t\t\t$this->cmd = \"selectdb\";\n\t\t\t\t$this->setDisplayMode(\"setup\");\n\t\t\t\t$this->setup->ini_client_exists = $this->setup->newClient();\n\t\t\t\t$this->selectDBType();\n\t\t\t\tbreak;\n\n\t\t\tcase \"selectdbtype\":\n\t\t\tcase \"displayIni\":\n\t\t\t\t$this->cmd = \"ini\";\n\t\t\t\t$this->setDisplayMode(\"setup\");\n\t\t\t\t//$this->setup->ini_client_exists = $this->setup->newClient($this->client_id);\n\t\t\t\t$this->displayIni();\n\t\t\t\tbreak;\n\n\t\t\tcase \"startup\":\n\t\t\t\t$this->setDisplayMode(\"setup\");\n\t\t\t\t$this->setup->ini_client_exists = $this->setup->newClient();\n\t\t\t\t$this->displayStartup();\n\t\t\t\tbreak;\n\n\t\t\tcase \"delete\":\n\t\t\t\t$this->setDisplayMode(\"view\");\n\t\t\t\t$this->displayDeleteConfirmation();\n\t\t\t\tbreak;\n\n\t\t\tcase \"togglelist\":\n\t\t\t\t$this->setDisplayMode(\"view\");\n\t\t\t\t$this->toggleClientList();\n\t\t\t\tbreak;\n\n\t\t\tcase \"preliminaries\":\n\t\t\t\t$this->setup->checkPreliminaries();\n\t\t\t\t$this->displayPreliminaries();\n\t\t\t\t$this->active_tab = \"preliminaries\";\n\t\t\t\tbreak;\n\n\t\t\tcase \"updateBasicSettings\":\n\t\t\tcase \"performLogin\":\n\t\t\tcase \"performMLogin\":\n\t\t\t\t$this->$cmd();\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$this->cmdClient();\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function aim_parse_command($cmd, $args)\r\n\t{\r\n\t\tswitch ($cmd) {\r\n\t\t\tcase 'SIGN_ON':\r\n\t\t\t\tif ($args == $this->core->conn['protocol']) $this->core->aim_debug('Protocol versions match ('.$this->core->conn['protocol'].'), continuing login..');\r\n\t\t\t\tbreak;\r\n\r\n case 'NEW_BUDDY_REPLY2':\r\n case 'INSERTED2':\r\n case 'UPDATED2':\r\n case 'DELETED2':\r\n\t\t\tcase 'CONFIG2':\r\n if ($this->core->user['debug']) {\r\n \t\t\t\tprint $cmd.' ';\r\n var_dump($args);\r\n }\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'ERROR':\r\n if (strstr($args, ':')) {\r\n @list($errno, $errtxt) = explode(':', $args, 2);\r\n } else {\r\n $errno = $args; $errtxt = null;\r\n }\r\n $this->core->errorhandler->handleError((int)$errno, $errtxt);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'NICK':\r\n\t\t\t\t$this->core->aim_debug('You have successfully identified as ' . $args);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'ADMIN_NICK_STATUS':\r\n\t\t\t\tif ($args == 0) $this->core->aim_debug('You have successfully reformatted your nick');\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'ADMIN_PASSWD_STATUS':\r\n\t\t\t\tif ($args == 0) $this->core->aim_debug('You have successfully changed your password');\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'GOTO_URL': \r\n\t\t\t\t// only supported in graphical clients (PHP isn't one of them ;)\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'UPDATE_BUDDY2':\r\n $data = array();\r\n @list($data['screenname'], $data['online'], $data['evil'],\r\n $data['signon'], $data['idle'], $data['class'],\r\n $data['unknown']) = explode(':', $args, 7);\r\n $data['screenname'] = $this->core->aim_normalize($data['screenname']);\r\n $data['online'] = ($data['online'] == 'T') ? true : false;\r\n $data['class'] = $this->core->buddy->aim_get_user_class($data['class']);\r\n\r\n if ($this->core->user['debug']) {\r\n \t\t\t\tprint $cmd.' ';\r\n var_dump($data);\r\n }\r\n\r\n // don't post our own information... duh?\r\n if ($data['screenname'] != $this->core->user['screenname']) {\r\n if (!in_array($data['screenname'], $this->core->pounce['buddies'])) {\r\n $this->core->pounce['buddies'][$data['screenname']] = false;\r\n }\r\n $this->aim_parse_buddy_update($data);\r\n }\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'EVILED':\r\n\t\t\t\tpreg_match('/^(.+)\\:(.*)$/', $args, $matches);\r\n\t\t\t\t$who = (empty($matches[2])) ? 'an anonymous user' : $matches[2];\r\n\t\t\t\t$this->core->aim_debug('You have just been warned (' . $matches[1] . '%) by ' . $who, AIM_RECV);\r\n\t\t\t\tif ($this->core->user['defensive'] === true && !empty($matches[2])) {\r\n\t\t\t\t\t$this->core->utilities->aim_send_im($matches[2], 'Fine, have it your way...', true);\r\n\t\t\t\t\tsleep(1);\r\n\t\t\t\t\t$this->core->utilities->aim_warn($matches[2]);\r\n\t\t\t\t} \r\n\t\t\t\tbreak;\r\n \r\n case 'IM_IN_ENC2':\r\n // utf8_decode the data\r\n if ($this->core->user['debug']) {\r\n \t\t\t\tprint $cmd.' ';\r\n var_dump($args);\r\n }\r\n break;\r\n\r\n\t\t\tcase 'IM_IN2':\r\n\t\t\t\t$data = array();\r\n\t\t\t\tpreg_match(\"/^([A-Za-z0-9\\s]{3,16})\\:(T|F)\\:(T|F)\\:(.*)$/\", $args, $matches);\r\n\t\t\t\t$this->core->aim_debug('You have just recieved an IM from ' . $matches[1] . '' . (($matches[2] == 'T') ? ' (autoresponse)' : ''), AIM_RECV);\r\n\t\t\t\t$data['screenname'] = $this->core->aim_normalize($matches[1]);\r\n\t\t\t\t$data['autoresponse'] = ($matches[2] == 'T') ? true : false;\r\n $data['unknown'] = $matches[3];\r\n\t\t\t\t$data['message'] = trim(strip_tags($matches[4]));\r\n\t\t\t\t$data['message_type'] = AIM_MSG_IM;\r\n\r\n // Search for the away message callback\r\n // --------------------------------------------------------\r\n // If none is found, the bot dies... We should include this\r\n // into the constructor somehow, and issue the error from\r\n // there, letting the user know it's a required callback\r\n foreach ($this->core->handlers as $h) {\r\n if ($h['type'] == CLIENT_AWAY) {\r\n $message = '!'.$h['name']; break;\r\n } else {\r\n $this->core->aim_debug('No client away callback specified!', AIM_ERR);\r\n }\r\n }\r\n\r\n // Issue the command\r\n\t\t\t\tif ($this->core->away['isaway'] === true && $data['message'] != $message) {\r\n\t\t\t\t\t$this->core->utilities->aim_send_im($matches[1], $this->core->away['message'], true, true);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->aim_parse_im($data);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'CHAT_JOIN':\r\n\t\t\t\tpreg_match('/^(.+)\\:(.*)$/', $args, $matches);\r\n\t\t\t\t$this->core->aim_debug('You have successfully joined \"' . $matches[2] . '\"');\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'CHAT_LEFT':\r\n\t\t\t\t$this->core->aim_debug('You have successfully left the chat');\r\n\t\t\t\tbreak;\r\n\r\n case 'CHAT_INVITE_ENC':\r\n // utf8_decode the data\r\n if ($this->core->user['debug']) {\r\n \t\t\t\tprint $cmd.' ';\r\n var_dump($args);\r\n }\r\n break;\r\n\r\n\t\t\tcase 'CHAT_INVITE':\r\n\t\t\t\tpreg_match('/^(.+)\\:(.+)\\:(.+)\\:(.*)$/', $args, $matches);\r\n\t\t\t\t$this->core->aim_debug('You have been invited to join \"' . $matches[1] . '\"');\r\n\t\t\t\t$this->core->user['chats'][$matches[2]] = $matches[1];\r\n\t\t\t\t$this->core->chat->aim_chat_join_invite($matches[2]);\r\n\t\t\t\tbreak;\r\n\r\n case 'CHAT_IN_ENC':\r\n // utf8_decode the data\r\n if ($this->core->user['debug']) {\r\n \t\t\t\tprint $cmd.' ';\r\n var_dump($args);\r\n }\r\n break;\r\n\r\n\t\t\tcase 'CHAT_IN':\r\n\t\t\t\t$data = array();\r\n\t\t\t\tpreg_match('/^(.+)\\:(.+)\\:(T|F)\\:(.*)$/', $args, $matches);\r\n\t\t\t\t$this->core->aim_debug($matches[2] . \" has spoken in \\\"\" . $this->core->user['chats'][$matches[1]] . \"\\\"\" . (($matches[3] == 'T')?' (whisper)':''), AIM_RECV);\r\n\t\t\t\t$data['screenname'] = $this->core->aim_normalize($matches[2]);\r\n\t\t\t\t$data['message'] = trim(strip_tags($matches[4]));\r\n\t\t\t\t$data['whisper'] = ($matches[3] == 'T') ? true : false;\r\n\t\t\t\t$data['cid'] = $matches[1];\r\n\t\t\t\t$data['message_type'] = AIM_MSG_CHAT;\r\n\t\t\t\t$this->aim_parse_im($data);\r\n\t\t\t\tbreak;\r\n\r\n case 'CHAT_UPDATE_BUDDY':\r\n if ($this->core->user['debug']) {\r\n \t\t\t\tprint $cmd.' ';\r\n var_dump($args);\r\n }\r\n break;\r\n\r\n\t\t\tcase 'PAUSE':\r\n $this->core->aim_debug('TAC has recieved a PAUSE command from the TOC server. Any messages sent to this client will not be recieved until the PAUSE period is completed');\r\n\t\t\t\tbreak;\r\n\r\n\t\t} \r\n\t}", "private function _sess_run() {\n\t\t// session\n\t\tini_set('session.save_handler', $this->sess_save_handler);\n\t\t$path = array();\n\t\tforeach ($this->sess_server as $server) {\n\t\t\tif (isset($server['host']) && isset($server['port'])) {\n\t\t\t\t$path[] = \"tcp://{$server['host']}:{$server['port']}?\" . http_build_query(isset($server['params']) ? $server['params'] : array());\n\t\t\t}\n\t\t}\n\t\tif (empty($path)) {\n\t\t\tshow_error('Session save_path is empty');\n\t\t}\n\t\tini_set('session.save_path', implode(',', $path));\n\n\t\tini_set('session.gc_maxlifetime', $this->sess_expiration);\t// 过期时间\n\t\t// cookie\n\t\tini_set('session.cookie_secure', 0);\t\t// 0 http:// 1 https://\n\t\tini_set('session.cookie_httponly', 1);\t\t// 不让JS读取session的cookie\n\t\tsession_name($this->sess_cookie_name);\n\n\t\tsession_start();\n\t\t// delete old flashdata (from last request)\n\t\t$this->_flashdata_sweep();\n\t\t// mark all new flashdata as old (data will be deleted before next request)\n\t\t$this->_flashdata_mark();\n\t}", "public function startSession() {}", "public function SessionStart ();", "static function getSubCommands();", "function control($command){\n\t\tglobal $jbArr;\n\t\t\n\t\tswitch ($command){\n\t\t case \"addwhere\":\n\t\t $_SESSION['jb-addtype'] = $_POST['addplat'];\n\t\t break;\n\t\t}\n\t}", "function _read_user_session()\n {\t\t\n\t\tif($this->sh_Options['keeping_logic'] == 'db'){\n\t\t\t$this->is_present = $this->_read_user_session_db();\n\t\t} else {\n\t\t\t$this->is_present = $this->_read_user_session_ss();\n\t\t}\n\t}", "function requestSessionInfo()\n {\n //para pasarselo al aside;\n\n $sessionLevel = $this->loginController->GetSessionAuthLevel();\n $this->view->setSessionLevel($sessionLevel);\n\n $sessionName = $this->loginController->GetSessionUsername();\n $this->view->setSessionName($sessionName);\n }", "function playerStatus()\n\t\t{\n\t\t\t$request = $_SESSION['mac'].\" status 0 100 \\n \";\n\t\t\t$mySqueezeCLI = new SqueezeCLI($request);\n\t\t\t$response = $mySqueezeCLI->receiveCLI();\n\t\t\t//echo \"la réponse non traité : $response \\n\";\n\t\t\t//parfois le retour CLI change attention\n\t\t\t//$response = get_string_between($response,\" mode:\",\"rate:\");\n\t\t\t$response = substr($response, strpos($response, \"mode:\"));\n\t\t\t$response = substr($response, 0, strpos($response, \" \"));\n\t\t\t$response = substr($response, 5);\n\n\t\t\treturn $response;\n\t\t}", "public static function startSession();", "public static function sessionReadHandler();", "function performCommand($cmd){\n switch ($cmd){\n // list all commands that need write permission here\n case \"editProperties\":\t\t\n case \"editQuiz\":\n case \"getPropertiesValues\":\n case \"updateProperties\":\n case \"initPropertiesForm\":\n case \"addQuestion\":\n case \"initAddQuestionForm\":\n case \"showQuestions\":\n case \"initQuestionTable\":\n case \"createQuestion\":\n case \"deleteQuestion\":\n case \"editQuestion\":\n case \"initQuestionEditForm\":\n case \"changeQuestion\":\n case \"addChoice\":\n case \"initAddChoiceForm\":\n case \"createChoice\":\n case \"deleteChoice\":\n case \"showChoices\":\n case \"initChoicesTable\":\n case \"editChoice\":\n case \"initChoiceForm\":\n case \"changeChoice\":\n case \"endCurrentRound\":\n case \"beginCurrentRound\":\n case \"info\":\n\n case \"addQuestionAndAnswers\":\n case \"initAddQuestionAndAnswersForm\":\n case \"createQuestionAndAnswers\":\n case \"showQuestionAndAnswers\":\n case \"initQuestionAndAnswersTable\":\n case \"deleteQuestionAndAnswers\":\n case \"editQuestionAndAnswers\":\n case \"initQuestionAndAnswersEditForm\":\n case \"changeQuestionAndAnswers\":\n case \"switchUp\":\n case \"switchDown\":\t\t\n\n case \"showResults\":\n case \"initResultsTable\":\n case \"showRoundResults\":\n case \"deleteRound\":\n case \"changeRoundStatus\":\n case \"exportResultData\":\n\n $this->checkPermission(\"write\");\n $this->$cmd();\n break;\n\n case \"showCurrentRound\":\t\t\t\n // list all commands that need read permission here\n \n //no commands so far\n \n $this->checkPermission(\"read\");\n $this->$cmd();\n break;\n }\n }", "function ResetCmd()\r\n{\r\n\r\n\t// Get Reset Cmd\r\n\tif (strlen(@$_GET[\"cmd\"]) > 0) {\r\n\t\t$sCmd = @$_GET[\"cmd\"];\r\n\r\n\t\t// Reset Search Criteria\r\n\t\tif (strtoupper($sCmd) == \"RESET\") {\r\n\t\t\t$sSrchWhere = \"\";\r\n\t\t\t$_SESSION[\"sucursal_searchwhere\"] = $sSrchWhere;\r\n\r\n\t\t// Reset Search Criteria & Session Keys\r\n\t\t}\r\n\t\telseif (strtoupper($sCmd) == \"RESETALL\") {\r\n\t\t\t$sSrchWhere = \"\";\r\n\t\t\t$_SESSION[\"sucursal_searchwhere\"] = $sSrchWhere;\r\n\r\n\t\t// Reset Sort Criteria\r\n\t\t}\r\n\t\telseif (strtoupper($sCmd) == \"RESETSORT\") {\r\n\t\t\t$sOrderBy = \"\";\r\n\t\t\t$_SESSION[\"sucursal_OrderBy\"] = $sOrderBy;\r\n\t\t\tif (@$_SESSION[\"sucursal_x_sucursal_id_Sort\"] <> \"\") { $_SESSION[\"sucursal_x_sucursal_id_Sort\"] = \"\"; }\r\n\t\t\tif (@$_SESSION[\"sucursal_x_nombre_Sort\"] <> \"\") { $_SESSION[\"sucursal_x_nombre_Sort\"] = \"\"; }\r\n\t\t\tif (@$_SESSION[\"sucursal_x_entidad_id_Sort\"] <> \"\") { $_SESSION[\"sucursal_x_entidad_id_Sort\"] = \"\"; }\r\n\t\t\tif (@$_SESSION[\"sucursal_x_calle_Sort\"] <> \"\") { $_SESSION[\"sucursal_x_calle_Sort\"] = \"\"; }\r\n\t\t\tif (@$_SESSION[\"sucursal_x_colonia_Sort\"] <> \"\") { $_SESSION[\"sucursal_x_colonia_Sort\"] = \"\"; }\r\n\t\t\tif (@$_SESSION[\"sucursal_x_ciudad_Sort\"] <> \"\") { $_SESSION[\"sucursal_x_ciudad_Sort\"] = \"\"; }\r\n\t\t\tif (@$_SESSION[\"sucursal_x_codigo_postal_Sort\"] <> \"\") { $_SESSION[\"sucursal_x_codigo_postal_Sort\"] = \"\"; }\r\n\t\t\tif (@$_SESSION[\"sucursal_x_lada_Sort\"] <> \"\") { $_SESSION[\"sucursal_x_lada_Sort\"] = \"\"; }\r\n\t\t\tif (@$_SESSION[\"sucursal_x_telefono_Sort\"] <> \"\") { $_SESSION[\"sucursal_x_telefono_Sort\"] = \"\"; }\r\n\t\t\tif (@$_SESSION[\"sucursal_x_fax_Sort\"] <> \"\") { $_SESSION[\"sucursal_x_fax_Sort\"] = \"\"; }\r\n\t\t\tif (@$_SESSION[\"sucursal_x_contacto_Sort\"] <> \"\") { $_SESSION[\"sucursal_x_contacto_Sort\"] = \"\"; }\r\n\t\t\tif (@$_SESSION[\"sucursal_x_contacto_email_Sort\"] <> \"\") { $_SESSION[\"sucursal_x_contacto_email_Sort\"] = \"\"; }\r\n\t\t\tif (@$_SESSION[\"sucursal_x_sucursal_dependiente_id_Sort\"] <> \"\") { $_SESSION[\"sucursal_x_sucursal_dependiente_id_Sort\"] = \"\"; }\r\n\t\t}\r\n\r\n\t\t// Reset Start Position (Reset Command)\r\n\t\t$nStartRec = 1;\r\n\t\t$_SESSION[\"sucursal_REC\"] = $nStartRec;\r\n\t}\r\n}", "protected abstract function _commandHandler(string $command, $data_array);", "function loadSession() {}", "function OnProcess() {\n\n $this->login = $this->Request->ToString(\"login\", \"\", 1, 32);\n $this->password = $this->Request->ToString(\"password\", \"\", 1, 32);\n $this->packagefrom = $this->Request->ToString(\"frompackage\", \"\");\n $this->former_query = $this->Request->ToString(\"query\", \"\");\n\n $UsersTable = new UsersTable($this->Kernel->Connection, $this->Kernel->Settings->GetItem(\"Authorization\", \"AuthorizeTable\"));\n //die(pr($UsersTable));\n $data = $UsersTable->GetByFields(array($this->Kernel->Settings->GetItem(\"Authorization\", \"FLD_login\") => $this->login));\n\n if (!count($data) || $data[\"active\"]==0) {\n $this->AddErrorMessage(\"UserLogonPage\", \"INVALID_LOGIN\");\n return;\n }\n\n $_pass = $data[$this->Kernel->Settings->GetItem(\"Authorization\", \"FLD_password\")];\n if($this->Kernel->Settings->GetItem(\"Authorization\", \"FLG_MD5_PASSWORD\")) {\n $this->password = md5($this->password);\n }\n\n if($_pass != $this->password){\n $this->AddErrorMessage(\"UserLogonPage\", \"INVALID_PASSWORD\");\n return;\n }\n\n if(!$this->Kernel->Settings->GetItem(\"Authorization\", \"FLG_MD5_PASSWORD\")) {\n $this->password = md5($this->password);\n }\n\n $this->Session = new ControlSession($this, $CookieName);\n session_start();\n $login_var = $this->Kernel->Settings->GetItem(\"Authorization\", \"SESSION_Var_Login\");\n $password_var = $this->Kernel->Settings->GetItem(\"Authorization\", \"SESSION_Var_Password\");\n\n $GLOBALS[$login_var] = $this->login;\n $GLOBALS[$password_var] = $this->password;\n\n $this->Session->Set($this->Kernel->Settings->GetItem(\"Authorization\", \"SESSION_Var_Login\"), $this->login);\n $this->Session->Set($this->Kernel->Settings->GetItem(\"Authorization\", \"SESSION_Var_Password\"), $this->password);\n $this->Session->Set($this->Kernel->Settings->GetItem(\"Authorization\", \"SESSION_Var_UserId\"), $data[$this->Kernel->Settings->GetItem(\"Authorization\", \"FLD_user_id\")]);\n\n if (strlen($this->camefrom)) {\n $this->Response->Redirect($this->Kernel->Settings->GetItem(\"MODULE\",\"SiteURL\").$this->camefrom);\n } else {\n $this->Auth->DefaultRedirect(\"Frontend\");\n }\n }" ]
[ "0.6386326", "0.61527026", "0.61512244", "0.60876507", "0.60246426", "0.5988331", "0.5907998", "0.5896377", "0.58940345", "0.5878112", "0.5797574", "0.57550377", "0.5738122", "0.57034343", "0.56466395", "0.5636945", "0.5603287", "0.5567639", "0.5553394", "0.5548859", "0.5528577", "0.5521643", "0.5487508", "0.5460337", "0.54492724", "0.5419444", "0.5415771", "0.5415079", "0.5414291", "0.54004" ]
0.6236386
1
STI 84189 Retorna o maior nflno_numero
public function getMaxNotaFiscalNumero() { $sql = "SELECT MAX(nflno_numero) + 1 as nflno_numero FROM nota_fiscal WHERE nflserie = 'A'"; $result = $this->_fetchAssoc(pg_query($this->_adapter, $sql)); return $result['nflno_numero']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNossoNumero();", "public function f_LetraNIF ($dni) \n\t{\n\t\t$valor= (int) ($dni / 23);\n\t\t$valor *= 23;\n\t\t$valor= $dni - $valor;\n\t\t$letras= \"TRWAGMYFPDXBNJZSQVHLCKEO\";\n\t\t$letraNif= substr ($letras, $valor, 1);\n\t\t\n\t\treturn $letraNif;\n\t}", "function getNumero() {\n return $this->numero;\n }", "function getDatosNota_num()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new core\\DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'nota_num'));\n $oDatosCampo->setEtiqueta(_(\"nota num\"));\n return $oDatosCampo;\n }", "function getDatosNota_num()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new core\\DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'nota_num'));\n $oDatosCampo->setEtiqueta(_(\"nota num\"));\n return $oDatosCampo;\n }", "function getNota_num()\n {\n if (!isset($this->inota_num) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->inota_num;\n }", "function getNota_num()\n {\n if (!isset($this->inota_num) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->inota_num;\n }", "public function getNumero()\n {\n return $this->numero;\n }", "function getNum_teleco()\n {\n if (!isset($this->snum_teleco) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->snum_teleco;\n }", "public function getNumero() {\n return $this->numero;\n }", "public function getFaxnbr()\n {\n return $this->faxnbr;\n }", "function chnodesp($numero){\n\t\t$dbnumero = $this->db->escape($numero);\n\t\t$fdespacha= $this->datasis->dameval(\"SELECT fdespacha FROM sfac WHERE numero=${dbnumero}\");\n\t\tif(empty($fdespacha)){\n\t\t\treturn true;\n\t\t}\n\t\t$this->validation->set_message('chnodesp', \"La factura ${numero} ya esta marcada como despachada el día \".dbdate_to_human($fdespacha).\".\");\n\t\treturn false;\n\t}", "public function getNumero() {\n return $this->sNumero;\n }", "function trovaNuovoNumero($gTables) {\n\t// https://sourceforge.net/p/gazie/discussion/468173/thread/572dcb76/\n\t//\n\t$orderBy = \"datemi desc, numdoc desc\";\n\tparse_str(parse_url($_POST['ritorno'],PHP_URL_QUERY),$output);\n\t$rs_ultimo_documento = gaz_dbi_dyn_query(\"numdoc\", $gTables['tesbro'], $gTables['tesbro'].\".tipdoc=\".\"'\".$output['auxil'].\"'\", $orderBy, 0, 1);\n\t$ultimo_documento = gaz_dbi_fetch_array($rs_ultimo_documento);\n\t// se e' il primo documento dell'anno, resetto il contatore\n\tif ($ultimo_documento) {\n\t/*$orderBy = \"datemi desc, numdoc desc\";\n\t$rs_ultimo_documento = gaz_dbi_dyn_query(\"numdoc\", $gTables['tesbro'], 1, $orderBy, 0, 1);\n\t$ultimo_documento = gaz_dbi_fetch_array($rs_ultimo_documento);\n\tse e' il primo documento dell'anno, resetto il contatore\n\tif ($ultimo_documento) {\n\t*/\n $numdoc = $ultimo_documento['numdoc'] + 1;\n } else {\n $numdoc = 1;\n }\n return $numdoc;\n}", "function setValorNota($nValorNota) {\n \n $this->nValorNota = $nValorNota;\n }", "function _field_number($fval) \n {\n return $this->_field_text($fval);\n }", "public function getNUMEROINT()\r\n {\r\n return $this->NUMERO_INT;\r\n }", "function arreglar_numero($numero)\n\t\t{\n\t\t\t// \t$numero = str_replace(\".\", \"\",$numero);\n\t\t\t$inicio_coma = strpos($numero, '.');\n\t\t\t//var_dump($inicio_coma);die();\n\t\t\t// if ( is_float($numero) && ($inicio_coma != false))\n\t\t\t// \t$numero .= \"00\";\n\t\t\t// else $numero .= \",00\";\n\t\t\tif( is_numeric( $inicio_coma) && ($inicio_coma >= 1) && ($inicio_coma < strlen($numero) ) )\n\t\t\t\t$numero = substr($numero, 0, ($inicio_coma+3)); \n\t\t\t//return str_replace(\".\", \",\",$numero);\n\t\t\treturn $numero;\n\t\t}", "public function marcarNumero( $numero ) {\n $this->addNumeroIP($numero);\n }", "function setNumero($numero){\n if(empty($numero)){\n header(\"Location:../vu/formulaire_inscription.php\");\n return;\n\n }\n //on declare de la variable numero puis on appelle la varibale prive numero\n $this->_numero = $numero;\n }", "function validate_docnumber($doctype, $docnumber) {\n //Returns: 1 = NIF ok, 2 = CIF ok, 3 = NIE ok, -1 = NIF bad, -2 = CIF bad, -3 = NIE bad, 0 = ??? bad\n\n $docnumber = strtoupper($docnumber);\n for ($i = 0; $i < 9; $i ++) {\n $num[$i] = substr($docnumber, $i, 1);\n }\n\n //si no tiene un formato valido devuelve error\n if (!preg_match('/((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)/', $docnumber)) {\n $nifcifnie = 0;\n }\n\n //algoritmo para comprobacion de codigos tipo CIF\n $digit = 10;\n $suma = $num[2] + $num[4] + $num[6];\n for ($i = 1; $i < 8; $i = $i + 2) {\n $suma = $suma + substr((2 * $num[$i]), 0, 1) + substr((2 * $num[$i]), 1, 1);\n }\n $len = strlen($suma) - 1;\n $control = substr($suma, $len, 1);\n $n = $digit - $control;\n\n if ($doctype == \"NIF\") {\n //comprobacion de NIFs estandar\n $ctrlNIF = substr($docnumber, 0, 8); \n if (preg_match('/(^[0-9]{8}[A-Z]{1}$)/', $docnumber)) {\n if ($num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', $ctrlNIF % 23, 1)) {\n $nifcifnie = 1;\n } else {\n $nifcifnie = -1;\n }\n }\n\n //comprobacion de NIFs especiales (se calculan como CIFs o como NIFs)\n if (preg_match('/^[KLM]{1}/', $docnumber)) {\n $ctrlNIF = substr($docnumber, 1, 8); \n if (($num[8] == chr(64 + $n)) || ($num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', $ctrlNIF % 23, 1))) {\n $nifcifnie = 1;\n } else {\n $nifcifnie = -1;\n }\n }\n }\n \n if ($doctype == \"CIF\") {\n //comprobacion de CIFs\n if (preg_match('/^[ABCDEFGHJNPQRSUVW]{1}/', $docnumber)) {\n $len = strlen($n) - 1;\n $ctrlCIF = substr($n, $len, 1); \n if (($num[8] == chr(64 + $n)) || ($num[8] == $ctrlCIF)) {\n $nifcifnie = 2;\n } else {\n $nifcifnie = -2;\n }\n }\n }\n \n if ($doctype == \"NIE\") {\n //comprobacion de NIEs\n if (preg_match('/^[XYZ]{1}/', $docnumber)) {\n if ($num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr(str_replace(array('X','Y','Z'), array('0','1','2'), $docnumber), 0, 8) % 23, 1)) {\n $nifcifnie = 3;\n } else {\n $nifcifnie = -3;\n }\n }\n }\n \n //si todavia no se ha verificado devuelve error\n return $nifcifnie;\n }", "public function getFECHA_NACIMIENTO()\r\n {\r\n return $this->FECHA_NACIMIENTO;\r\n }", "public function getNumeroFiche(): ?int {\n return $this->numeroFiche;\n }", "function NUMERO_DE_HIJOS_MENORES14($_ARGS) {\r\n\t$_PARAMETROS = PARAMETROS();\r\n\t\r\n\tlist($a, $m) = split(\"[/.-]\", $_ARGS[\"PERIODO\"]); $anio = $a - 15;\r\n\t$mes = intval($m) + 1;\r\n\tif ($mes > 12) { $mes = 1; $anio++; }\r\n\tif ($mes < 10) $mes = \"0$mes\";\t\r\n\t$fecha = \"$anio-$mes-01\";\r\n\r\n\t$sql = \"SELECT *\r\n\t\t\tFROM rh_cargafamiliar\r\n\t\t\tWHERE\r\n\t\t\t\tCodPersona = '\".$_ARGS['TRABAJADOR'].\"' AND\r\n\t\t\t\tParentesco = 'HI' AND\r\n\t\t\t\tFechaNacimiento >= '\".$fecha.\"'\";\techo \"$sql\";\r\n\t$query = mysql_query($sql) or die ($sql.mysql_error());\r\n\treturn intval(mysql_num_rows($query));\r\n}", "public function getNit_empresa(){\n return $this->nit_empresa;\n }", "function setNota_num($inota_num = '')\n {\n $this->inota_num = $inota_num;\n }", "public function numero($numero) {\n\n $formatado = $numero / 1000;\n if ($formatado < 10) {\n $formatado = '0' . $formatado;\n }\n return $formatado;\n }", "public function CekNoForm(){\n\t\t$limit = '1';\n\t\t$offset = '0';\n\t\t$aturan = array(\n\t\t\t'jenis' => 'fk',\n\t\t\t'site' => 'mkk',\n\t\t\t'status' => '0'\n\t\t\t);\n $query = $this->db->order_by('id','DESC')->get_where('no_inv', array('jenis' => $aturan['jenis'],'site' => $aturan['site'],'status' => $aturan['status']), $limit, $offset);\n // $query = $this->db->order_by('birth_date', 'ASC')->get_where($this->tbl_name, $where);\n return $query->result_array();\n\n // $no_urut = $query[0]['nomor']+1;\n // return $no_urut;\n\t}", "public function getCdNfservico()\n {\n return $this->cd_nfservico;\n }", "public function obtenerLetraNIF($nif)\n\t{\n\t\t$nif = substr($nif, 0, 8);\n\t\treturn substr(\"TRWAGMYFPDXBNJZSQVHLCKE\",strtr($nif,\"XYZ\",\"012\")%23,1);\n\t}" ]
[ "0.68572146", "0.62667733", "0.620654", "0.6129006", "0.6129006", "0.61156553", "0.61156553", "0.60984504", "0.60618234", "0.60605675", "0.59380305", "0.59233046", "0.5849484", "0.5834023", "0.5785137", "0.57694435", "0.57535434", "0.5741985", "0.57297474", "0.5725624", "0.5709161", "0.5680314", "0.56786674", "0.56469405", "0.56412965", "0.5637054", "0.5626471", "0.5623573", "0.5608518", "0.56065315" ]
0.6568866
1
Tests customer login form GET /cliente/login HTTP/1.1 200 OK
public function testLogin() { $crawler = $this->client->request('GET', '/cliente/'); $crawler = $this->client->followRedirect(); $this->assertTrue($this->client->getContainer()->get('security.context')->isGranted('IS_AUTHENTICATED_ANONYMOUSLY')); $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); $this->assertGreaterThan(0, $crawler->filter('html:contains("Acesse sua conta")')->count()); // validate form $form = $crawler->selectButton('Continuar')->form(array( 'marcoshoya_marquejogobundle_customer[username]' => '', 'marcoshoya_marquejogobundle_customer[password]' => '', )); $crawler = $this->client->submit($form); $this->assertGreaterThan(0, $crawler->filter('span:contains("Campo obrigatório")')->count()); $customer = $this->em ->getRepository("MarcoshoyaMarquejogoBundle:Customer") ->findOneBy(array(), array( 'id' => 'DESC' )); $form = $crawler->selectButton('Continuar')->form(array( 'marcoshoya_marquejogobundle_customer[username]' => $customer->getUsername(), 'marcoshoya_marquejogobundle_customer[password]' => $customer->getPassword() )); $this->client->submit($form); $crawler = $this->client->followRedirect(); // Check data in the show view $this->assertGreaterThan(0, $crawler->filter('html:contains("Bem vindo")')->count()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testLogin()\n {\n $response = $this->call('GET', '/api/v1/[email protected]&password=123456');\n \n $this->assertEquals(200, $response->status());\n }", "public function testUsuarioPodeVerTelaDeLogin()\n {\n $response = $this->get('/login');\n $response->assertSuccessful();\n $response->assertViewIs('auth.login');\n }", "public function testLoginCustomer1()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit(route('login'))\n ->type('email','')\n ->type('password','')\n ->press('Login');\n });\n }", "public function test_login()\n {\n $response = $this->json('POST', 'api/v1/login',\n [\n 'email' => '[email protected]',\n 'password' => '123456'\n ]\n );\n $response->assertStatus(200);\n }", "public function testLogin(){\n $client00 = static::createClient();\n $client00->request('POST', '/booking/calendar');\n \n $this->assertEquals(\n 405, //METHOD NOT ALLOWED\n $client00->getResponse()->getStatusCode()\n );\t\t\n \n $client01 = $this->createAuthorizedClient();\n $client01->request('POST','/booking/calendar');\n $this->assertEquals(\n 405, //METHOD NOT ALLOWED\n $client01->getResponse()->getStatusCode()\n );\t\n //Requests con GET\n $client02 = $this->createAuthorizedClient();\n $client02->request('GET','/booking/calendar');\n $this->assertEquals(\n 200, //OK\n $client02->getResponse()->getStatusCode()\n ); \n //Usuario no autorizado\n $client03 = static::createClient();\n $client03->request('GET', '/booking/calendar');\n \n //redireccionado porque no tiene los permisos necesarios\n $this->assertTrue($client03->getResponse()->isRedirect()); \n }", "public function testLoginForm()\n {\n $this->get('/login');\n\n $this->assertResponseSuccess();\n $this->assertNoRedirect();\n\n $this->assertResponseContains('<input type=\"email\" name=\"email\" id=\"email\">');\n $this->assertResponseContains('<input type=\"password\" name=\"password\" id=\"password\" value=\"\">');\n\n $this->assertSession(null, 'Auth.User.id');\n }", "public function test_login()\n {\n // GET non valide\n $response = $this->get('api/login');\n $response->assertStatus(405);\n\n // Pas de donnée envoyé\n $response = $this->post('api/login');\n $response->assertStatus(422);\n\n // User non trouvé\n $response = $this->post('api/login', ['email' => '[email protected]', 'password' => 'password']);\n $response->assertStatus(400);\n\n // Creation User et Verif du login\n $user = User::factory()->make();\n $mail = $user->email;\n $user->save();\n $response = $this->post('api/login', ['email' => $mail, 'password' => 'password']);\n $response->assertStatus(200);\n // Vérification que le token est bien présent\n $this->assertTrue(!!json_decode($response->content(), true)['accessToken']);\n }", "public function loginClientTest()\r\n {\r\n return view('omi.launch_sandbox.login');\r\n }", "public function test_valid_user_login()\n {\n Session::start();\n $response = $this->call('POST', '/login', [\n 'email' => '[email protected]',\n 'password' => 'password',\n '_token' => csrf_token()\n ]);\n $response->assertStatus(302);\n $response->assertRedirect('/home');\n }", "public function testCanShowLogin()\n {\n $response = $this->get('/login');\n\n $response->assertStatus(200);\n }", "public function testLogin()\n {\n $data= [\n 'email' => '[email protected]',\n 'password' => '12345678',\n ];\n\n /* @var $responce \\Illuminate\\Foundation\\Testing\\TestResponse */\n $responce = $this->json('post', '/api/auth/login', $data);\n\n $content = $responce->getContent();\n print \"\\n\" . $content . \"\\n\";\n $this->assertNotTrue(boolval(strstr($content, 'errors')));\n //$responce->assertOk();\n }", "public function testSubmitCorrectAuthentication()\n\t{\n\t\t$crawler = $this->client->request('GET', '/login');\n\t\t$loginForm = $crawler->selectButton(\"Connexion\")->form();\n\n\t\t$this->assertNotEquals(null, $loginForm);\n\n\t\t$loginForm['username'] = 'michel';\n\t\t$loginForm['password'] = 'michel';\n\n\n\t\t$this->assertEquals(200, $this->client->getResponse()->getStatusCode());\n\t}", "public function testViewLogin() {\n $this->visit('http://londonce.lan/login')\n ->see('Login');\n }", "public function testloginSuccess(){\n $param = ['username' => 'vinhpd5', 'password' => 'Vinh12345'];\n $response = $this->json(\"post\",'/api/v1/login',$param)\n ->assertStatus(200);\n\n $response->dump();\n }", "public function testUserLogin()\n {\n $response = $this->get('/login')\n ->assertStatus(200)\n ->assertSee('Login');\n }", "public function testLogin()\n {\n $user = User::factory()->create();\n\n $baseUrl = Config::get('app.url') . '/api/auth/login';\n\n $response = $this->json('POST', $baseUrl . '/', [\n 'email' => $user->email,\n 'password' => 'password'\n ]);\n\n $response\n ->assertStatus(200)\n ->assertJsonStructure([\n 'access_token', 'token_type', 'expires_in'\n ]);\n }", "public function testLogin()\n {\n $response = $this->json('post', '/api/login',\n ['email' => '[email protected]', 'password' => 'password']);\n $response->assertStatus(200)\n ->assertJsonStructure(['access_token']);\n }", "public function test_user_can_view_a_login_form()\n {\n //\n $response = $this->get('/login');\n $response->assertSuccessful();\n $response->assertViewIs('auth.login');\n }", "public function testLoginRoute()\n {\n $response = $this->get('/login');\n $response->assertStatus(200);\n }", "public function test_login()\n\t{\n\t\t$response = $this->call('POST', 'v1/login', array('remember' => 'true', 'email' => '[email protected]', 'password' => 'guzi'));\n\t\t// $response = $this->action('POST', 'AuthController@login', array('remember' => 'true', 'email' => '[email protected]', 'password' => 'password'));\n\t\t// difference of two lines above?\n\t\t$result = json_decode($response->getContent());\n\t\techo \"login is : \";\n\t\tvar_dump($result->status);\n\t\t$this->assertEquals(\"success\", $result\n\t\t\t\t->status, 'We expected the post login to have a success status !');\n\t\t$this->assertResponseStatus(200);\n\t}", "public function testLoginScreen()\n {\n $response = $this->get('admin');\n $response->assertStatus(200);\n }", "public function testLoginView()\n {\n $response = $this->get('/login');\n\n $response->assertStatus(200);\n $response->assertSee('Log in to play');\n }", "public function testLoginAs(): void\n {\n // setup\n $this->testValidConnect();\n\n $data = [\n 'login' => '[email protected]'\n ];\n $url = self::$serverPath . '/login-as/';\n $this->postHttpRequest($data, $url);\n\n // test body\n $url = self::$serverPath . '/self/login/';\n $result = $this->getHttpRequest($url);\n\n // assertions\n $this->assertEquals('[email protected]', Fetcher::getField($result, 'login'));\n }", "public function testAdminLoginPageIsSuccessful()\n {\n $client = $this->createClient(); // anonymous user\n $client->request('GET', '/admin/login');\n\n $this->assertStatusCode(200, $client);\n }", "public function testAdminLoginPageIsSuccessful()\n {\n $client = $this->createClient(); // anonymous user\n\n $client->request('GET', '/admin/login');\n $this->assertStatusCode(200, $client);\n }", "public function testLoginExample()\n {\n $this->visit('/login')\n ->type('[email protected]', 'email')\n ->type('1234567', 'password')\n ->press('Login')\n ->seePageIs('/admin');\n }", "public function test_admin_login()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/Home', 'index']);\n $this->assertResponseCode(404);\n }", "public function testSeeLoginPage()\n {\n $response = $this->get('/login');\n $response->assertSee('LOGIN');\n $response->assertStatus(200);\n }", "public function testLoginValidation() {\n $this->visit('http://londonce.lan/login')\n ->submitForm('Login', ['log' => '', 'password' => ''])\n ->see('Please enter a valid username.')\n ->see('Please enter a valid password.');\n }", "public function testProcessLogin(){\n\n $credentials = [\n 'email' => '[email protected]',\n 'password' => 'password',\n ];\n\n $response = $this->post(route('login.action', $credentials));\n $response->assertSessionHas('success');\n $response->assertRedirect(route('dashboard'));\n }" ]
[ "0.75735", "0.7496215", "0.74310035", "0.7314078", "0.73102194", "0.7284351", "0.7261862", "0.7260719", "0.72391355", "0.72175056", "0.71188223", "0.71145046", "0.70925707", "0.70635307", "0.7059661", "0.7031271", "0.7013647", "0.69956774", "0.6995267", "0.69913834", "0.6980066", "0.69741774", "0.697278", "0.6964087", "0.6962925", "0.6956689", "0.6935383", "0.6934982", "0.6926881", "0.69231135" ]
0.8084083
0
Tests customer register form POST /cliente/doRegister HTTP/1.1 200 OK
public function testRegister() { $crawler = $this->client->request('GET', '/cliente/'); $crawler = $this->client->followRedirect(); $this->assertTrue($this->client->getContainer()->get('security.context')->isGranted('IS_AUTHENTICATED_ANONYMOUSLY')); $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); $this->assertGreaterThan(0, $crawler->filter('html:contains("Acesse sua conta")')->count()); // validate form $form = $crawler->selectButton('Cadastrar')->form(array( 'marcoshoya_marquejogobundle_customer[username]' => '', )); $crawler = $this->client->submit($form); $this->assertGreaterThan(0, $crawler->filter('span:contains("Campo obrigatório")')->count()); $form = $crawler->selectButton('Cadastrar')->form(array( 'marcoshoya_marquejogobundle_customer[username]' => '[email protected]', )); $this->client->submit($form); $crawler = $this->client->followRedirect(); // Check data in the show view $this->assertGreaterThan(0, $crawler->filter('html:contains("Novo cadastro")')->count()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testRegisterForm()\n {\n \\Cake\\Core\\Configure::write('CM.Register', true);\n\n $this->get('/register');\n\n $this->assertResponseSuccess();\n\n $this->assertNoRedirect();\n\n $this->assertResponseContains('<input type=\"email\" name=\"email\" required=\"required\" maxlength=\"255\" id=\"email\">');\n $this->assertResponseContains('<input type=\"password\" name=\"new_password\" required=\"required\" id=\"new-password\" value=\"\">');\n $this->assertResponseContains('<input type=\"password\" name=\"confirm_password\" required=\"required\" id=\"confirm-password\" value=\"\">');\n }", "public function test_register()\n {\n $faker = Factory::create();\n // User's data\n $user = [\n 'email' => $faker->email,\n 'name' => $faker->name,\n 'password' => 'password',\n ];\n // Send post request\n $response = $this->json('POST', route('api.register'), $user);\n // Assert it was successful\n $response->assertStatus(200)->json(['successfully register test user!']);\n }", "public function testRegisterSucessful() {\n\t\t$data = $this->getUserData(\n\t\t\t$this->username,\n\t\t\t$this->first_name,\n\t\t\t$this->surname,\n\t\t\t$this->email\n\t\t);\n\t\t\n\t\t$response = $this->call('POST','v1/users', $data);\n\t\t$resp_data = $response->getData();\n\t\tvar_dump($resp_data);\n\t\t$this->assertResponseStatus(201);\n\t\t$this->assertEquals($resp_data->user->username, $this->username);\n\t\t$this->assertEquals($resp_data->user->first_name, $this->first_name);\n\t\t$this->assertEquals($resp_data->user->surname, $this->surname);\n\t\t$this->assertEquals($resp_data->user->email, $this->email);\n\t}", "public function testFieldRegisterRecruiterForm()\n {\n $client = static::createClient();\n\n //Crawler object which can be used to select elements in the response,\n //click on links and submit forms.\n $crawler = $client->request('GET', '/recruiter/register');\n\n //Select the button with ID name\n $buttonCrawlerNode = $crawler->selectButton('submit');\n\n //Get form for override some form values and submit the corresponding form\n $form = $buttonCrawlerNode->form([\n 'recruiter[firstName]' => 'Azerty',\n\n ]);\n\n //Submit form\n $crawler = $client->submit($form);\n\n //Get errors \n $error = $crawler->filter(\"#identityErrorsContainer ul > li\");\n \n //Get string\n $error = $error->getNode(0)->textContent;\n $msgError = 'Veuillez renseigner votre nom';\n $this->assertEquals($error,$msgError);\n\n }", "public function testMemberRegistrationForm()\n {\n $response = $this\n ->get('/register-member')\n ->assertStatus(200);\n }", "public function testRegisterUser()\n {\n $this->withoutExceptionHandling();\n $user = [\n 'email' => '[email protected]',\n 'password' => 'test1234',\n ];\n $response = $this->postJson('/api/register', $user);\n $response->assertStatus(201)->assertJsonFragment([\n 'email' => '[email protected]',\n ]);\n }", "public function testUserRegister()\n {\n $response = $this->get('/register')\n ->assertStatus(200)\n ->assertSee('Register');\n }", "public function sellerCanRegister()\n {\n $input = [\n 'username' => 'iniusername' . Str::random(3),\n 'fullname' => 'ini nama ' . Str::random(4),\n 'email' => 'ini_email' . Str::random(4) . '@gmail.com',\n 'password' => 'P@sswr0d!',\n 'sex' => 0\n ];\n $response = $this->post('/api/seller/register', $input);\n $response->assertStatus(200);\n }", "public function testForm()\n {\n $response = $this->get('/register');\n\n $response->assertStatus(200)\n ->assertSee('Register');\n }", "public function testRegisterRecruiterForm()\n {\n $client = static::createClient();\n\n //Crawler object which can be used to select elements in the response,\n //click on links and submit forms.\n $crawler = $client->request('GET', '/recruiter/register');\n\n //Select the button with ID name\n $buttonCrawlerNode = $crawler->selectButton('submit');\n \n //Get form for override some form values and submit the corresponding form\n $form = $buttonCrawlerNode->form();\n $form = $buttonCrawlerNode->form([\n 'recruiter[firstName]' => 'Azerty',\n 'recruiter[lastName]' => 'Uiopqsd',\n 'recruiter[email]' => '[email protected]',\n 'recruiter[birthDay][year]' => 1984,\n 'recruiter[birthDay][month]'=> 2,\n 'recruiter[birthDay][day]'=> 1,\n 'recruiter[password][first]' => 'Azerty123',\n 'recruiter[password][second]' => 'Azerty123',\n 'recruiter[business]' => '01234567891011',\n 'recruiter[legalConditions]' => 1,\n ]);\n \n $client->submit($form);\n $this->assertResponseIsSuccessful();\n }", "public function test_passed_registration()\n {\n\n $user = $this->user();\n\n $response = $this->post('api/v1/register', $user);\n $response->assertStatus(200);\n $response->assertJsonMissing([\n \"status\"=>'Failed'\n ]);\n\n }", "public function testRegister()\n {\n $this->visit('/register')\n ->type('Test User', 'name')\n ->type('081233548738', 'phone')\n ->type('Tester', 'occupation')\n ->type('[email protected]', 'email')\n ->type(bcrypt('testing123'), 'password')\n ->press('Register')\n ->seeInDatabase('users', ['email' => '[email protected]']);\n }", "public function testRegisterSuccess()\n {\n $mock = new MockHandler([\n new Response(200, [], '{\"token\": \"QpwL5tke4Pnpja7X4\"}'),\n ]);\n\n $handler = HandlerStack::create($mock);\n $this->app->instance(Client::class, new Client(['handler' => $handler]));\n\n //login\n $this->post('api/user/create-user', ['email' => '[email protected]', 'password' => 'password'], $this->headers)\n ->assertStatus(200)\n ->assertJson(['token' => 'QpwL5tke4Pnpja7X4']);\n\n }", "public function registerPost()\n {\n $this->response->getHeaders()->setStatusCode(302);\n\n $regForm = $this->_getRegisterForm();\n $request = $this->getRequest();\n\n $failRedirect = $this->_router->assemble(\n array('controller' => 'user', 'action' => 'register'), \n array('name' => 'default')\n );\n\n if (!$this->getRequest()->isPost() || !$regForm->isValid($request->post()->toArray())) {\n $this->_flashMessenger->addMessage($regForm);\n $this->response->getHeaders()->addHeader('Location', $failRedirect);\n return $this->response;\n }\n $user = self::$di->get('userService')->createFromForm($regForm);\n var_dump($user);\n die('success!');\n }", "public function testPostRegistroCorrecto(){\r\n\t\t$usuario=new User;\r\n\t\t$usuario->user='Pepito123';\r\n\t\t$usuario->password='pepito123';\r\n\t\t$usuario->email='[email protected]';\r\n\t\t$usuario->nombre='Pepe';\r\n\t\t$usuario->apellidos='Juarez Perez';\r\n\t\t$usuario->telefono='666999887';\r\n\r\n\r\n\t\t$usuario->save();\r\n\t\t$this->call('POST', 'formulario');\r\n \r\n\t\t$this->assertRedirectedToRoute('formulario');\r\n\t}", "public function postRegister()\n {\n if ($this->request->is('post')) {\n $input = $this->request->getData();\n $validate = $this->Client->newEntity($input);\n\n if ($validate->errors()) {\n $this->set($validate->errors());\n } else {\n $this->Client->insert($input);\n $this->Flash->success('Sign up success');\n }\n $this->register();\n }\n }", "public function registerAction()\n {\n Lb_Points_Helper_Data::debug_log(\"Registration request sent to LB\", true);\n $txtName = $_POST['txtName'];\n $txtEmail = $_POST['txtEmail'];\n $txtPhoneNumber = $_POST['txtPhoneNumber'];\n $result = Lb_Points_Helper_Data::registerUser($txtName,$txtEmail,$txtPhoneNumber);\n echo json_encode($result);\n }", "public function testFieldRegisterCandidatForm()\n {\n $client = static::createClient();\n\n //Crawler object which can be used to select elements in the response,\n //click on links and submit forms.\n $crawler = $client->request('GET', '/candidate/register');\n\n //Select the button with ID name\n $buttonCrawlerNode = $crawler->selectButton('submit');\n\n //Get form for override some form values and submit the corresponding form\n $form = $buttonCrawlerNode->form([\n 'candidat[firstName]' => 'Azerty',\n ]);\n\n //Submit form\n $crawler = $client->submit($form);\n \n //Get errors \n $error = $crawler->filter(\"#identityErrorsContainer ul > li\");\n \n //Get string\n $error = $error->getNode(0)->textContent;\n $msgError = 'Veuillez renseigner votre nom';\n $this->assertEquals($error,$msgError);\n }", "public function test_customer() {\n $_POST = array('name' => \"customer2\", 'password' => \"p455w0rd:\");\n $expected = json_encode(array(\"status\" => 1, \"message\" => \"customer\"));\n $this->expectOutputString($expected);\n $this->object->main();\n }", "public function registerPost()\n {\n if ($_SERVER['REQUEST_METHOD'] === \"POST\") {\n if (!empty($_POST['firstname']) && !empty($_POST['lastname']) && !empty($_POST['email']) && !empty($_POST['password']) && !empty($_POST['confirmpassword'])) {\n\n $firstname = $this->secureHTML(($_POST['firstname']));\n $lastname = $this->secureHTML(($_POST['lastname']));\n $email = $this->secureHTML(($_POST['email']));\n $password = $this->secureHTML(($_POST['password']));\n $confirmpassword = $this->secureHTML(($_POST['confirmpassword']));\n\n if ($confirmpassword !== $password) {\n $this->addFlash(\"danger\", \"Le mot de passe de confirmation est différent\");\n $this->redirectReponse(\"register\");\n }\n\n if (!$this->usersManager->getByUserFromEmail($email)) {\n $hashedPassword = password_hash($confirmpassword, PASSWORD_DEFAULT);\n if ($this->usersManager->registerUser($firstname, $lastname, $email, $hashedPassword)) {\n $this->addFlash(\"success\", \"Le compte a été créer, vous pouvez vous connecté\");\n $this->redirectReponse(\"login\");\n }\n } else {\n $this->addFlash(\"danger\", \"L'adresse email existe déjà\");\n $this->redirectReponse(\"register\");\n }\n } else {\n $this->addFlash(\"danger\", \"Veuillez compléter tous les champs...\");\n $this->redirectReponse(\"register\");\n }\n }\n }", "public function testRegisterCompany()\n {\n $this->browse(function (Browser $browser){\n $browser->visit('/register')\n ->type('name', env('DUSK_NEW_NAME'))\n ->type('email', env('DUSK_NEW_USER'))\n ->type('verificateEmail', env('DUSK_NEW_USER'))\n ->type('password', env('DUSK_NEW_PASSWORD'))\n ->press('.button')\n ->assertPathIs('/');\n });\n }", "public function registerAction()\n {\n if (empty($_POST) === false) {\n if (isset($_POST['register'])) {\n //Function Checking if customer with entered \n // user name or emalil exists in Data Base.\n $message = $this->checkIfExists($_POST['userName'], $_POST['email']);\n //Message that user Already exist. \n if ($message != \"\")\n $this->regMassage($message);\n //Registrating a new Customer and Adding him to Data Base.\n else {\n $cst = $this->customerCreate();\n $this->register($cst);\n }\n }\n }\n $this->view->render('Register');\n }", "public function test_new_user_can_register()\n {\n $this->RegisterRolesAndPermissions();\n// $this->withExceptionHandling();\n $response = $this->postJson(route('auth.register'), [\n 'name' => \"ehsan dastras\",\n 'email' => \"[email protected]\",\n 'password' => \"12345678\",\n ]);\n\n $response->assertStatus(Response::HTTP_CREATED);\n }", "public function testSuccess()\n {\n $this->userGhost();\n \n # Config for easy registration\n $module = Module_Register::instance();\n $module->saveConfigValue('signup_password_retype', false);\n $module->saveConfigValue('email_activation', false);\n $module->saveConfigValue('admin_activation', false);\n $module->saveConfigValue('activation_login', false);\n $module->saveConfigValue('force_tos', false);\n $method = Form::make();\n $parameters = [\n 'user_name' => 'Peter1',\n 'user_password' => '11111111',\n ];\n $response = MethodTest::make()->method($method)->parameters($parameters)->execute();\n assertEquals(200, $response->code, \"Check if registration works\");\n }", "public function registerAction()\n {\n // specify required fields\n $requirements = array(\n 'userName',\n 'password',\n 'email'\n );\n\n // fech post json data\n $post = $this->fetchRequestData($requirements);\n\n //we need to match what's in the database\n $fields = array(\n 'yourEmail' => 'email',\n 'yourUserName' => 'userName',\n 'yourPassword' => 'password',\n 'fname' => 'fname',\n 'lname' => 'lname',\n 'yourIP' => 'ip',\n 'yourCountry' => 'countryAbbreviation',\n 'yourBday' => 'birthdate',\n 'accountId' => 'accountId',\n 'gender' => 'gender',\n 'cmsUserGroupId' => 'userRole',\n 'isChannel' => 'isChannel',\n );\n\n $params = array();\n $params['userId'] = 0;\n\n foreach ($fields as $key => $val) {\n if (isset($post[$val]) && $post[$val]) $params[$key] = $post[$val];\n }\n\n if (isset($params['yourEmail']) && $params['yourEmail']) {\n if ($this->get('UserServices')->checkDuplicateUserEmail($params['userId'], $params['yourEmail'])) {\n throw new HttpException(422, $this->translator->trans('This email address belongs to an existing Tourist Tuber.'));\n }\n }\n\n if (isset($params['yourUserName']) && $params['yourUserName']) {\n if ($this->get('UserServices')->checkDuplicateUserName($params['userId'], $params['yourUserName'])) {\n $suggestedNewUserNames = $this->get('UserServices')->suggestUserNameNew($params['yourUserName']);\n throw new HttpException(422, $this->translator->trans('Your username is already taken. try:') . ' ' . implode(' or ', $suggestedNewUserNames));\n }\n }\n\n if (isset($params['yourPassword']) && $params['yourPassword']) {\n //validate first for invalid password\n $validatePass = $this->get('UserServices')->validateUserLengthPassword($params['yourPassword']);\n if (isset($validatePass['success']) && $validatePass['success'] == false) {\n throw new HttpException(422, $validatePass['message']);\n }\n }\n\n if ((isset($params['fname']) && $params['fname']) || (isset($params['lname']) && $params['lname'])) {\n $fullname = '';\n if ($params['fname']) {\n $fullname .= $params['fname'];\n }\n if ($params['lname']) {\n $fullname .= $params['lname'];\n }\n } else {\n $fullname = $params['fname'] = $params['yourUserName'];\n }\n\n $params['fullName'] = $fullname;\n $params['defaultPublished'] = 0;\n $result = array();\n\n\n\n $insert = $this->get('UserServices')->generateUser($params);\n\n if (is_array($insert) && isset($insert['error']) && !empty($insert['error'])) {\n throw new HttpException(422, $insert['error']);\n } else {\n $this->get('UserServices')->sendRegisterActivationEmail(array('userId' => $insert->getId(), 'activationLink' => '/api/users/activate/'));\n $result['status'] = \"success\";\n $result['message'] = $this->translator->trans('An email is sent to you to activate your account.');\n }\n\n $response = new Response(json_encode($result));\n $response->setStatusCode(200);\n return $response;\n }", "public function testPost_formularioFalla(){\r\n\t\t$destino = Enhance::getCodeCoverageWrapper('RegistroControllerClass');\r\n\t\t$destino->postRegistro();\r\n\t\t$validator->fails();\r\n\t\t$this->call('POST', '/registro');\r\n\t\t$this->assertSessionHasErrors();\r\n\t}", "public function doRegister()\n {\n\n //check if all the fields are filled\n if (!Request::checkVars(Request::postData(), array('username', 'password'))) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"Complete all the fields!\", \"type\" => \"error\")));\n exit;\n }\n\n //create the user entity based on filled data\n $userEntity = new User(Request::postData());\n\n //check if the user exists and get it as entity if exists\n if ($this->repository->findUser($userEntity)) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"The username/email already exists!\", \"type\" => \"error\")));\n exit;\n }\n\n //add the user into DB\n $this->repository->addUser($userEntity);\n\n echo json_encode(\n array(\n \"swal\" => array(\"title\" => \"Success!\", \"text\" => \"Your account has been created!\", \"type\" => \"success\", \"hideConfirmButton\" => true),\n \"redirect\" => array(\"url\" => BASE_URL . '/index.php?page=home', 'time' => 1)\n )\n );\n }", "public function test_user_can_register()\n {\n $this->withoutExceptionHandling();\n\n $user = [\n 'name' => 'John Doe',\n 'email' => '[email protected]',\n 'password' => 'password',\n 'password_confirmation' => 'password',\n ];\n\n $response = $this->post('/api/register/', $user);\n\n $response->assertStatus(200);\n $response->assertStatus(Response::HTTP_OK);\n $this->assertDatabaseHas('users', ['email' => '[email protected]']);\n }", "public function testLoginRegister(){\n $user = User::find(1);\n $this->be($user);\n\n $response =$this->get(route('administracion'));\n $response->assertStatus(200);\n }", "public function testRegisterUser()\n {\n\n $data = factory(User::class)->raw([\n 'password' => $this->faker->password,\n ]);\n\n $response = $this->postJson(\"$this->baseurl/signup\", $data);\n $response->assertStatus(201);\n $response->assertJsonStructure([\n \"data\" => [\n \"token\",\n \"user\",\n ],\n \"status\",\n \"message\",\n ]);\n }" ]
[ "0.72371894", "0.71953756", "0.7173842", "0.71236277", "0.6941527", "0.6939168", "0.6908118", "0.6877238", "0.6853614", "0.6837729", "0.67928225", "0.67910266", "0.6778927", "0.6754044", "0.6739729", "0.67344344", "0.67146415", "0.67098325", "0.6708874", "0.6692196", "0.6685735", "0.6633224", "0.6627675", "0.6619355", "0.6610479", "0.65935254", "0.65905404", "0.6578944", "0.65729225", "0.65509325" ]
0.83245426
0
Get temporary Transferwise quotation
public function getTransferwiseQuote(Request $request){ $source = $request->get('source'); $target = $request->get('target'); $amount = $request->get('amount'); // Call Transferwise API to get temporary quotes $result = Transferwise::temporaryQuotes($source, $target, $amount); // Return response if($result){ // Success if(empty($result['errors'])){ $response = [ 'status' => [ 'code' => 0, 'message' => 'OK' ], 'data' =>[ 'fee' => $result['fee'], 'targetAmount' => $result['targetAmount'], 'sourceAmount' => $result['sourceAmount'], ] ]; // Get error result from Transferwise API }else{ $response = [ 'status' => [ 'code' => 1, 'message' => $result['errors'][0]['message'] ] ]; } // Cant get result from Transferwise }else{ $response = [ 'status' => [ 'code' => 2, 'message' => "Can't get result from Transferwise" ] ]; } return response()->json($response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getQuote();", "public function getActualQuote()\n {\n return $this->_quote->getQuote();\n }", "public function get_quote(){ return $this->_quote;}", "function tideways_transaction_name()\n{\n}", "public function getQuote()\n\t{\n\t\treturn $this->quote;\n\t}", "public function getTxtoption()\n {\n return $this->txtoption;\n }", "public function getQuote() {\n return $this->quote;\n }", "public function getQuote() {\n return $this->quote;\n }", "protected function _getQuote()\n {\n return $this->_getCart()->getQuote();\n }", "public function getTransmission(): string\n {\n }", "public function getQuotationQuote()\n {\n return $this->traitGetQuotationQuote();\n }", "public function getTransactionId(): string;", "public function getTempName() {}", "public function getQuote()\n {\n if(Mage::app()->getStore()->isAdmin()){\n return Mage::getSingleton('adminhtml/session_quote')->getQuote();\n }\n else {\n return Mage::getSingleton('checkout/session')->getQuote();\n }\n }", "public function getRandomQuote(): string\n {\n return (string)$this->getAllQuotes()->random();\n }", "private function getSendTransferRequest(): string\n {\n // may be changed by linters and other tools, and because it contains line breaks, which are different depending\n // the platform where this test runs.\n return 'HKCCS:3:1+DExxABCDEFGH1234567890:BYLADEM1001:1234567890::280:12030000+urn?:iso?:std?:iso?:20022?:tech?:xsd?:pain.001.003.03+@'\n . strlen(self::PAIN_MESSAGE) . '@' . self::PAIN_MESSAGE . \"'HKTAN:4:6+4+HKCCS+++++++++SomePhone1'\";\n }", "public function getUsage()\n\t{\n\t\treturn sprintf('%s checkout transaction', $this->config->get('config_name'));\n\t}", "public function getTransfer()\n {\n return $this->metaRefreshValues['transfer'];\n }", "public function getQuoting() {\n return $this->quoting;\n }", "public function getQuote(): ?string\n {\n try {\n $request = $this->api->get(env('QUOTE_URL'));\n $response = $request->getBody()->getContents();\n\n return $response;\n } catch (ClientException $e) {\n $response = $e->getResponse();\n Log::error('Error getting quotes.'.$response->getBody->getContents());\n }\n }", "public function getQuote()\n {\n return $this->_checkoutSession->getQuote();\n }", "public function getQuote()\n {\n return Mage::getSingleton('checkout/session')->getQuote();\n }", "public function getQuote()\n {\n return Mage::getSingleton('checkout/session')->getQuote();\n }", "private function getTX()\n {\n return $this->getRemote($this->RemoteQuery['ip'], \".1.3.6.1.2.1.10.127.1.2.2.1.3.2\", $this->RemoteQuery['community']);\n }", "protected function getStatusQuote()\n {\n //based on the status of the user return a quote\n switch ($this->status) {\n case 'Junior Evangelist':\n return \"Junior Evangelist: Real knowledge is to know the extent of one's ignorance\";\n case 'Associate Evangelist':\n return 'Associate Evangelist: You have come far, but your journey is not yet near end, fight harder';\n case 'Senior Evangelist':\n return 'Senior Evangelist: Coffee price increased because of you, mighty and powerful :(';\n default:\n return 'You have no place yet on the aisle where Legends of debugging stand, fight brave and harder';\n }\n }", "public function getTransaction();", "public function getTransactionValue() {\n return $this->mutation_amount * $this->mutation_price;\n }", "function _erpal_contract_helper_get_billable_text() {\n\n $default_text = t('Payment for !service_category_token contract \"!contract_title_token\"', array('!service_category_token' => '[erpal_contract_billable_subject:service_category]', '!contract_title_token' => '[erpal_contract_billable_subject:contract_title]'));\n return variable_get('erpal_billable_text_erpal_contract', $default_text);\n}", "public function getGTemp(){\r\n\t\treturn Yii::app()->TempRep->GetById($this->tmp);\r\n\t}", "public function getTransferJob()\n {\n return $this->transfer_job;\n }" ]
[ "0.60675347", "0.6030527", "0.595383", "0.5913892", "0.567307", "0.5647799", "0.5647737", "0.5645235", "0.5603724", "0.5567703", "0.5541198", "0.5520312", "0.54829764", "0.5465593", "0.54429203", "0.53888327", "0.53156364", "0.5296663", "0.5296589", "0.52462155", "0.5227049", "0.5219162", "0.5219162", "0.52093375", "0.5178341", "0.5175187", "0.51652765", "0.5162008", "0.51279765", "0.51239806" ]
0.60393614
1
Contains information about the class (ReflectionClass) __construct() Constructor for the Thinker\Framework\Model Class
public function __construct() { // Initialize reflectionClass with information about the target class $this->reflectionClass = new \ReflectionClass($this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct(Model $model)\n {\n $this->reflection = new ReflectionClass($model);\n }", "public function fn_construct_class() {\n\t}", "protected function initializeReflection() {}", "public function __construct () {\n $this->model = 'App\\\\' . $this->model;\n $this->model = new $this->model();\n\n // Get the column listing for a given table\n $this->table_columns = Schema::getColumnListing( $this->table );\n }", "private function __construct() {\n \n trace('***** Creating new '.__CLASS__.' object. *****');\n \n }", "public function getConstructor() {}", "public function __construct()\n {\n $fullClassName = explode('\\\\', get_class($this));\n $this->type = (string)array_pop($fullClassName);\n }", "protected function getClassInfoFactory() {}", "public function __construct() { //this is not called from concrete class...\n\t\t\t$this->modelName = 'aaaaaaaaaabstract';\n\t\t\techo 'constructing a ' . static::class . '<br>';\n\t\t}", "public function __construct() {\n\t\t$this->m_dbconn = DatabaseConnection::getInstance();\n\t\t$this->_vo_obj_name = 'SkillVO';\n\t\t$this->_vo_fields = array();\n\t\t$vo = new ReflectionClass(new SkillVO());\n\t\t$vo = $vo->getProperties();\n\n\t\tforeach ($vo AS $reflectionProperty)\n\t\t{\n\t\t\t$this->_vo_fields[] = $reflectionProperty->name;\n\t\t}\n\n\t\t$this->_id_field = 'skill_id';\n\t\t$this->_table = 'skill';\n\t}", "function __construct()\n {\n // 呼叫模型(Model)的建構函數\n parent::__construct();\n \n }", "public function __construct (){\n\t\t\techo '<pre>';\n\t\t\tprint_r(get_class_methods($this));\n\t\t\techo '</pre>';\n\t\t}", "public function __construct()\n {\n foreach (GeneralUtility::makeInstance(\\ReflectionClass::class, static::class)->getProperties() ?? [] as $reflection) {\n if (!$reflection->isProtected()) {\n $name = $reflection->getName();\n $value = $this->{$name};\n\n // Define parameter name of property\n $this->parameterMapping[$name] = GeneralUtility::camelCaseToLowerCaseUnderscored($name);\n\n // Map the type of properties\n $this->typeMapping[$name] = is_int($value) ? 'int' : (is_array($value) ? 'array' : (is_bool($value) ? 'bool' : (is_string($value) ? 'string' : null)));\n }\n }\n }", "public function getReflectionClass();", "public function __construct()\n {\n $classname = $this->getBankName();\n\n $info = ExchangeRateGrabberInfo::find()->where(['name' => $classname])->one();\n\n if (empty($info)) {\n throw new \\Exception(\"broken class: metadata for $classname not found\");\n }\n\n $this->info = $info->attributes;\n }", "function getReflectionClass();", "public function __construct()\n\t{\n\t\t// \\ladybug_dump($model);\n\t}", "protected function typicalSetup()\n {\n $class = $this->class;\n $static = new $class;\n\n if ($static instanceof Model) {\n $this->_id (\"ID\", FieldBlueprint::PRIMARY, null);\n $this->_uid (\"UID\", FieldBlueprint::UID, null);\n }\n }", "function __construct() {\n if($this->Fields) {\n foreach($this->Fields as $key => $value) {\n $this->$key = null;\n if($value['extra'] === \"auto_increment\") $this->Id = $key;\n if($value['extra'] === \"ref\") $this->Ref = $key;\n }\n }\n }", "function __construct() {\n $this->get_info();\n }", "function __constructor(){}", "public function __construct()\n {\n $this ->model = $this ->makeModel($this ->model());\n }", "public function __construct()\n {\n // All of my models are like this\n parent::__construct(get_class($this));\n // Calling methods to get the relevant data\n $this->generateNewsData();\n $this->generateAnalyticsData();\n $this->generatePostsData();\n }", "public function construct() {\n\n }", "function __construct()\n\t{\n\t\tparent :: __construct();\n\t\t$this -> load -> model('getinfo','m');\n\t}", "public function __construct()\n {\n $this->properties = [];\n $this->methods = [];\n $this->comment = null;\n $this->interfaces = [];\n $this->name = null;\n $this->shortName = null;\n $this->signature = null;\n $this->reflectionClass = null;\n }", "public function getReflectionClass()\n {\n return new \\ReflectionClass($this->getName());\n }", "public function __construct($reflectionClass) {\r\n $this->setReflectionClass($reflectionClass);\r\n }", "function __construct()\n {\n if (empty($this->table)) {\n $this->table = get_called_class();\n }\n }", "protected function __construct() {\n\t\t//Generated by ManagerGenerator::generateConstruct()\n\t}" ]
[ "0.6688221", "0.6279127", "0.6272721", "0.62653387", "0.6220538", "0.61571056", "0.6123033", "0.6097967", "0.6042751", "0.60249895", "0.5972794", "0.5963368", "0.5950452", "0.59328705", "0.5903757", "0.58918005", "0.584971", "0.58056587", "0.57954186", "0.5773509", "0.5733084", "0.5713983", "0.57081014", "0.57051057", "0.56848085", "0.5682331", "0.56812465", "0.5673433", "0.5645324", "0.5640499" ]
0.67710197
0
disables the automatic SetupFabric when using a consumer or producer
public function disableAutoSetupFabric() { $this->autoSetupFabric = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function disable() {}", "function disableConfigurableSwatches()\n\t {\n\t \t $configModel = new Mage_Core_Model_Config();\n\t \t $configModel->saveConfig('configswatches/general/enabled', \"0\", 'default', 0);\n\t \t $configModel->saveConfig('configswatches/general/swatch_attributes', \"\", 'default', 0);\n\t }", "public static function phpunit_disable() {\n parent::disable();\n }", "public function disable();", "function disable()\n{\n\t$args = func_get_args();\n\tif (is_array($args[0])) $args = $args[0];\n\t$this->enable($args, false);\n}", "public function onDisable() {\n\t}", "public static function disable() {\n\t\tself::$enabled = false;\n\t}", "public static function disable()\n {\n self::$_enabled = FALSE;\n }", "public function disable()\n {\n $this->enabled = false;\n }", "public static function disable(): void\n {\n static::$_enabled = false;\n }", "public function noSecret()\n {\n ScaleEngineClient::factory();\n }", "function disableclient()\n {\n\n exec('ifconfig ' . escapeshellarg($this->interface) . ' down');\n }", "function maybe_disable_automattic_widgets()\n {\n }", "public function disable_powered_by() {\n\t\tupdate_option( 'algolia_powered_by_enabled', 'no' );\n\t}", "function econsole_uninstall() {\r\n return true;\r\n}", "public static function removeInstallToolEnableFile() {}", "public function disable(): void\n {\n $this->disabled = true;\n }", "private function _unsetSetup()\n\t{\n\t\tforeach ( $this->_setup as $setup )\n\t\t{\n\t\t\t$setup->disconnect();\n\t\t}\n\n\t\t$this->_setup = null;\n\t\t$this->_setup = array();\n\t}", "function widget_setup(){\n\n\t\treturn false;\n\t}", "public static function disable(){\n self::$disabled = true; \n self::$enabled = false;\n }", "function disableReceiver($uid, $bounce_type) {\n\t\treturn false;\n\t}", "public static function disable(): void\n {\n self::$isEnabled = false;\n }", "function freeze() {\r\n\r\n\t\t$this->configured = True;\r\n\r\n\t}", "function freeze() {\r\n\r\n\t\t$this->configured = True;\r\n\r\n\t}", "public function disable(): bool {}", "protected function configure()\n {\n $this->setName('scaytrase:sms_delivery:flush');\n $this->setDescription('Flush the delivery service message spool');\n }", "public function disable(ContextInterface $ctx): void;", "public function disable(ContextInterface $ctx): void;", "public function disable(ContextInterface $ctx): void;", "public function noDev()\n {\n $this->dev = '--no-dev';\n return $this;\n }" ]
[ "0.54350936", "0.53870934", "0.5374653", "0.5257682", "0.5127038", "0.5113087", "0.5095935", "0.5083433", "0.5071188", "0.50430644", "0.49940437", "0.4992287", "0.49482974", "0.49126008", "0.49083713", "0.49054193", "0.4874082", "0.48616084", "0.4857427", "0.48466808", "0.48440272", "0.4828099", "0.48254243", "0.48254243", "0.48047382", "0.48038122", "0.47485843", "0.47485843", "0.47485843", "0.4745704" ]
0.8226719
0
Get Active Category Id
public function getActiveCategoryId() { if ($this->request->hasArgument(LinkUtility::CATEGORY)) { $categoryId = $this->request->getArgument(LinkUtility::CATEGORY); if (ctype_digit($categoryId)) { return $categoryId; } } return FALSE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getActiveCategory()\n {\n return $this->_activeCategory;\n }", "public function getCurrentCat()\n {\n if (empty($this->multifilterSession->getTopCategory()) && empty($this->multifilterSession->getCategories())) {\n $currentCat = $this->coreRegistry->registry('current_category');\n return $currentCat->getId();\n } else {\n return $this->multifilterSession->getTopCategory();\n }\n }", "public function getCatId()\n {\n return $this->getParamCatId();\n }", "public function getCategory_id()\n {\n return $this->category_id;\n }", "public function getCategory_id()\n {\n return $this->category_id;\n }", "public function getCategory_id()\n {\n return $this->category_id;\n }", "public function get_category_id(){\n\t\treturn $this->_categoryid;\n\t}", "public function getIdCat()\n {\n return $this->id_cat;\n }", "public function getId_cat()\n {\n return $this->id_cat;\n }", "public function getCategoryId()\n {\n if ($category = Mage::registry('current_category')) {\n return $category->getId();\n }\n return false;\n }", "public function getCategory() {\r\n return $this->catList->find('id', $this->categoryId)[0];\r\n }", "public function getActCategory()\n {\n // if active category is not set yet - trying to load it from request params\n // this may be usefull when category component was unable to load active category\n // and we still need some object to mount navigation info\n if ($this->_oClickCat === null) {\n\n $this->_oClickCat = false;\n $oCategory = oxNew('oxcategory');\n if ($oCategory->load($this->getCategoryId())) {\n $this->_oClickCat = $oCategory;\n }\n }\n\n return $this->_oClickCat;\n }", "public function get_category_id() {\n return (int)get_config('block_homework_diary', 'course_category');\n }", "private function getCategoryID() {\n return 0;\n }", "public function getCat_id() {\n return $this->cat_id;\n }", "public function getIdCategory(){\n return $this->idCategory;\n }", "public function retrieveLastCategoryId() {\n return $this->categoriesDB->retrieveLastCategoryId();\n }", "public function getCurrentCategory()\n {\n return $this->category;\n }", "public function getCurrentCategory()\n {\n return $this->registry->registry('current_category');\n }", "public function getId(){\n return $this->_sub_cat_id;\n }", "public function getCategoryId(): string\n {\n return $this->categoryId;\n }", "public function getCategory(){\r\n return Mage::registry('current_category');\r\n }", "public function returnUpdateCat() {\n return $this->category_id;\n }", "private function _storeCreatedCategoryId() {\r\n $I = $this->BackendTester;\r\n\r\n $I->click('.row-title');\r\n\r\n $tagId = null;\r\n\r\n $url = $I->grabFromCurrentUrl();\r\n\r\n $url = substr($url, strpos($url, '?') + 1);\r\n\r\n parse_str($url, $array);\r\n\r\n if (isset($array['tag_ID']))\r\n $tagId = $array['tag_ID'];\r\n\r\n $I->setVar('category_id', $tagId);\r\n\r\n return $tagId;\r\n }", "public function getCategoryId()\n {\n return $this->categoryId;\n }", "private function __getCategoryIdFromUrl() {\n return $this->uri->segment( 3, 0 );\n }", "public function get_categorieId()\n {\n return $this->_categorieId;\n }", "public function getIdCategoria()\n {\n return $this->id_categoria;\n }", "public function getIdCategoria()\n {\n return $this->id_categoria;\n }", "function getCategory() {\n // Load categories.\n $categories = userpoints_get_categories();\n return isset($categories[$this->getTid()]) ? $categories[$this->getTid()] : $categories[userpoints_get_default_tid()];\n }" ]
[ "0.76170135", "0.7539002", "0.7396292", "0.7381508", "0.7381508", "0.7381508", "0.7256224", "0.7245214", "0.7189422", "0.7168311", "0.70960677", "0.7087487", "0.6968868", "0.69606626", "0.6885493", "0.6856896", "0.68035865", "0.6799263", "0.6789495", "0.67311895", "0.67112714", "0.67087424", "0.67025983", "0.6692982", "0.6664153", "0.66551936", "0.66513914", "0.66427743", "0.66427743", "0.6624847" ]
0.77514625
0
Returns class path based upon object action's name (excluding Actionsuffix)
protected function getClassPath() { $directories = array(); $components = preg_split('~(?<=[a-z])(?=[A-Z])~', $this->actionClass); foreach ($components as $part) { $directories[] = StringUtil::toLowerCase($part); } $path = WCF_DIR . 'lib/data/' . implode('/', $directories); return FileUtil::addTrailingSlash($path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getActionClassName()\n {\n return $this->getClassName();\n }", "public function get_action_class() {\n if (!empty($this->action)) {\n $parts = explode('/', $this->action);\n \n if (count($parts) > 1) {\n $className = $parts[count($parts) - 1];\n } else {\n $className = $this->action;\n }\n \n $className = str_replace('-', ' ', $className);\n $className = ucwords($className);\n $className = str_replace(' ', '', $className);\n \n if (class_exists($className)) {\n return $className;\n }\n }\n return false;\n }", "public function getActionClass()\n {\n return $this->getData('action_class');\n }", "public function action_name() {\n\t\t\n\t\treturn get_class($this);\n\t\t\n\t}", "private function get_path($action)\n\t{\n\t\treturn APP_ROOT . 'views/' . $this->name . '/' . $action . '.php';\n\t}", "protected function getActionClass($action, $ns, $id)\n {\n if (!$action) {\n $parts = explode('/', $id);\n \n foreach ($parts as &$part) {\n $part = implode('', array_map('ucfirst', explode('-', $part)));\n }\n \n $action = implode('\\\\', $parts);\n }\n \n return $ns . $action;\n }", "public static function path()\n {\n return class_basename(get_called_class());\n }", "function _get_action()\n {\n $retval = preg_quote($this->object->param('action'), '/');\n $retval = strtolower(preg_replace(\"/[^\\\\w]/\", '_', $retval));\n return preg_replace(\"/_{2,}/\", \"_\", $retval) . '_action';\n }", "protected function _handlerClassName($action, $className) {\n\t\tif (empty($className)) {\n\t\t\tif (strstr($action, '_') !== false) {\n\t\t\t\tlist($prefix, $className) = explode('_', $action, 2);\n\t\t\t\t$className = 'Crud.' . ucfirst($className);\n\t\t\t} else {\n\t\t\t\t$className = 'Crud.' . ucfirst($action);\n\t\t\t}\n\t\t} elseif (strpos($className, '.') === false) {\n\t\t\t$className = 'Crud.' . ucfirst($className);\n\t\t}\n\n\t\treturn ucfirst($className);\n\t}", "public function getClassPath()\n {\n return $this->controllerPath;\n }", "public function getActionName()\n {\n return isset($this->action['controller']) ? $this->action['controller'] : 'Closure';\n }", "public function getControllerActionName() {}", "protected function getActionNameForClass($strAction, $objInstance) {\r\n if (isset(self::$arrActionNameMapping[$strAction])) {\r\n $strAnnotationPrefix = self::$arrActionNameMapping[$strAction];\r\n \r\n if ($strAction == \"new\") {\r\n return $strAction . $this->getStrCurObjectTypeName();\r\n }\r\n else {\r\n $objReflection = new class_reflection($this);\r\n $arrAnnotations = $objReflection->getAnnotationsWithValueFromClass(get_class($objInstance));\r\n \r\n foreach ($arrAnnotations as $strProperty) {\r\n if (uniStrpos($strProperty, $strAnnotationPrefix) === 0) {\r\n return $strAction . uniSubstr($strProperty, uniStrlen($strAnnotationPrefix));\r\n }\r\n }\r\n }\r\n }\r\n \r\n return parent::getActionNameForClass($strAction, $objInstance);\r\n }", "public function getRouteName($action);", "public function getActionNm()\r\n {\r\n\t\t$tabInfo = $this->getPathInfo();\r\n\t\treturn $tabInfo[2];\r\n }", "public function getAction()\n\t{\n\t\t\n\t\t$parsed = (array)$this->getAsArray();\n\t\t\n\t\tforeach(array('getPrefix', 'getController') as $method)\n\t\t{\n\t\t\tif( $this->{$method}() )\n\t\t\t{\n\t\t\t\tarray_shift($parsed);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( empty($parsed) )\n\t\t{\n\t\t\t$action = $this->default_action;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$action = $parsed[0];\n\t\t}\n\t\t\n\t\t$prefix = $this->getPrefix();\n\t\t\n\t\tif( $prefix )\n\t\t{\n\t\t\t$action = $prefix . '_' . $action;\n\t\t}\n\t\t\n\t\treturn $action;\n\t\t\n\t}", "public static function getActionName()\r\n\t{\r\n\t\treturn TRequest::getCmd('controller');\r\n\t}", "protected function getActionPath($action)\n {\n return array_key_exists($action, $this->actionPaths) ? $this->actionPaths[$action] : 'sparql';\n }", "public static function qualifyAction($name)\n {\n $class = config('beluga.internal.action_namespace').'\\\\'.$name;\n\n if (class_exists($class)) {\n return $class;\n }\n\n return $name;\n }", "abstract public function getClassPath();", "public function getClassName() : string {\n if ($this->getType() != Router::CLOSURE_ROUTE) {\n $path = $this->getRouteTo();\n $pathExplode = explode(DS, $path);\n\n if (count($pathExplode) >= 1) {\n $fileNameExplode = explode('.', $pathExplode[count($pathExplode) - 1]);\n\n if (count($fileNameExplode) == 2 && $fileNameExplode[1] == 'php') {\n return $fileNameExplode[0];\n }\n }\n }\n\n return '';\n }", "public function GetControllerAction () {\n\t\treturn $this->controller . ':' . $this->action;\n\t}", "public function get_usable_full_class_path() {\n\n\t\t$full_path = $this->get_called_class();\n\n\t\treturn strtolower( str_replace( '\\\\', '_', str_replace( '\\\\\\\\', '_', $full_path ) ) );\n\n\t}", "public function getActionMethod()\n {\n return array_last(explode('@', $this->getActionName()));\n }", "public function get_action_file()\n {\n if (!empty($this->action_map[$this->action])) {\n return $this->action_map[$this->action];\n }\n\n return strtr($this->action, '-', '_') . '.inc';\n }", "public static function getAction() {\n\t return self::getPathParams()['action'];\n\t}", "protected function getControllerClassName()\n {\n $className = $this->classPath;\n\n if (false !== strpos($className, '.')) {\n \\Yii::import($className);\n $className = explode('.', $className);\n $className = array_pop($className);\n }\n\n return $className;\n }", "public function getActionName() {\n\t\treturn $this->action;\n\t}", "protected function getActionMethod($action)\n {\n// $method = implode('', $action_arr);\n $method = 'handle_' . $action;\n return $method;\n }", "public function getControllerAction()\n\t{\n\t\tif (file_exists('Controller/' . $this->class_Name . 'Controller.php')) {\n\t\t\tinclude_once 'Controller/' . $this->class_Name . 'Controller.php';\n\t\t\t$executeClass = new $this->class_Name;\n\t\t\t$executeAction = $this->action_Name;\n\t\t} else {\n\t\t\t$this->pageDontExist();\n\t\t}\n\t\tif (method_exists($executeClass, $executeAction)) {\n\t\t\t$executeClass->$executeAction();\n\t\t\t}\n\t}" ]
[ "0.7080436", "0.6896423", "0.6777962", "0.6636762", "0.64828813", "0.6458296", "0.64253247", "0.6401943", "0.6344859", "0.6313592", "0.63070774", "0.6244272", "0.6236256", "0.62324256", "0.62281317", "0.6133641", "0.61243546", "0.61206824", "0.61049145", "0.6065467", "0.6057972", "0.60557103", "0.6027559", "0.6025297", "0.6022641", "0.6008819", "0.59810215", "0.593367", "0.59278697", "0.5925046" ]
0.69172156
1
Handles action result, derived classes must implement this but leave it empty.
abstract protected function handleResult();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function process() {\n\t\t$action = $this->get_action();\n\n\t\t$result = $this->$action();\n\n\t\t$this->set_processed_item( $result );\n\n\t\treturn $result;\n\t}", "protected function executeAction() {}", "protected function executeAction() {}", "protected function executeAction() {}", "protected function executeAction() {}", "protected function executeAction() {\r\n\t\t$this->objectAction->validateAction();\r\n\t\t$this->objectAction->executeAction();\r\n\t\t\r\n\t\t$this->handleResult();\r\n\t}", "protected function executeAction() {\n \n }", "public function executeAction() {\n return $this->{$this->action}();\n }", "public function didInvokeAction(string $action, ControllerResultInterface $result): void;", "function getResponseAction () {\n return $this->responseAction();\n }", "public function process()\n\t{\n\t\t$action = $this->getAction();\n\t\tswitch (strtolower($action))\n\t\t{\n\t\t\tcase 'get':\n\t\t\tcase 'put':\n\t\t\tcase 'post':\n\t\t\tcase 'delete':\n\t\t}\t\n\t}", "public function afterAction($action, $result)\n {\n \\Yii::trace($action->id, __CLASS__ . \"::\" . __FUNCTION__);\n parent::afterAction($action, $result);\n return $result;\n }", "protected function manageExecutedAction()\n {\n $action = $this->flowEvaluator->getActionInFlow();\n $this->triggerEvent(__FUNCTION__ . '.executed');\n if ($action->hasFinalResults()) {\n $params = array('results' => $action->spit());\n $this->triggerEvent(__FUNCTION__ . '.hasFinalResults', $params);\n }\n }", "public function processAction($action)\r\n\t{\r\n\t\t$this->result = Array();\r\n\t\t$this->result[\"debug\"] = Array();\r\n\r\n\t\tif ($action == \"ready\")\r\n\t\t\t$this->actionCheckReady();\r\n\t\telse\r\n\t\t{\r\n\t\t\t//nothing\r\n\t\t\t$this->result[\"status\"] = 0;\r\n\t\t\t$this->result[\"msg\"] = 'no action performed';\r\n\t\t}\r\n\r\n\t\t$this->result[\"debug\"] = getDebugLog();\r\n\r\n\t\t//the response is encoded in JSON on AJAX calls\r\n\t\tprint json_encode( $this->result );\r\n\t}", "protected function runBeforeResponseSet(&$actionResult) {\n\t\t// Empty default implementation. Should be implemented by descendant classes if needed\n\t}", "protected function getAction() {}", "public function process() {\r\n if(!in_array($this->getRouter()->getAction(), $this->getAllowActions()) || $this->getRouter()->getAction() == null) {\r\n $this->defaultAction();\r\n } else {\r\n $customAction = $this->getRouter()->getAction().Globals::getConfig()->action->suffix;\r\n $this->$customAction();\r\n }\r\n }", "protected function handleResultRequest() {\n\t\t//no longer letting people in without these things. If this is\n\t\t//preventing you from doing something, you almost certainly want to be\n\t\t//somewhere else.\n\t\t$deadSession = false;\n\t\tif ( !$this->adapter->session_hasDonorData() ) {\n\t\t\t$deadSession = true;\n\t\t}\n\t\t$oid = $this->adapter->getData_Unstaged_Escaped( 'order_id' );\n\n\t\t$request = $this->getRequest();\n\t\t$referrer = $request->getHeader( 'referer' );\n\t\t$liberated = false;\n\t\tif ( $this->adapter->session_getData( 'order_status', $oid ) === 'liberated' ) {\n\t\t\t$liberated = true;\n\t\t}\n\n\t\t// XXX need to know whether we were in an iframe or not.\n\t\tglobal $wgServer;\n\t\tif ( $this->isReturnFramed() && ( strpos( $referrer, $wgServer ) === false ) && !$liberated ) {\n\t\t\t$sessionOrderStatus = $request->getSessionData( 'order_status' );\n\t\t\t$sessionOrderStatus[$oid] = 'liberated';\n\t\t\t$request->setSessionData( 'order_status', $sessionOrderStatus );\n\t\t\t$this->logger->info( \"Resultswitcher: Popping out of iframe for Order ID \" . $oid );\n\t\t\t$this->getOutput()->allowClickjacking();\n\t\t\t$this->getOutput()->addModules( 'iframe.liberator' );\n\t\t\treturn;\n\t\t}\n\n\t\t$this->setHeaders();\n\n\t\tif ( $deadSession ){\n\t\t\tif ( $this->adapter->isReturnProcessingRequired() ) {\n\t\t\t\twfHttpError( 403, 'Forbidden', wfMessage( 'donate_interface-error-http-403' )->text() );\n\t\t\t\tthrow new RuntimeException(\n\t\t\t\t\t'Resultswitcher: Request forbidden. No active donation in the session. ' .\n\t\t\t\t\t\"Adapter Order ID: $oid\"\n\t\t\t\t);\n\t\t\t}\n\t\t\t// If it's possible for a donation to go through without our\n\t\t\t// having to do additional processing in the result switcher,\n\t\t\t// we don't want to falsely claim it failed just because we\n\t\t\t// lost the session data. We also don't want to give any\n\t\t\t// information to scammers hitting this page with no session,\n\t\t\t// so we always show the thank you page. We don't want to do\n\t\t\t// any post-processing if we're not sure whether we actually\n\t\t\t// originated this attempt, so we return right after.\n\t\t\t$this->logger->warning(\n\t\t\t\t'Resultswitcher: session is dead, but the ' .\n\t\t\t\t'donor may have made a successful payment.'\n\t\t\t);\n\t\t\t$this->displayThankYouPage( 'dead session' );\n\t\t\treturn;\n\t\t}\n\t\t$this->logger->info( \"Resultswitcher: OK to process Order ID: \" . $oid );\n\n\t\tif ( $this->adapter->checkTokens() ) {\n\t\t\t$this->getOutput()->allowClickjacking();\n\t\t\t// FIXME: do we really need this again?\n\t\t\t$this->getOutput()->addModules( 'iframe.liberator' );\n\t\t\t// processResponse expects some data, so let's feed it all the\n\t\t\t// GET and POST vars\n\t\t\t$response = $this->getRequest()->getValues();\n\t\t\t// TODO: run the whole set of getResponseStatus, getResponseErrors\n\t\t\t// and getResponseData first. Maybe do_transaction with a\n\t\t\t// communication_type of 'incoming' and a way to provide the\n\t\t\t// adapter the GET/POST params harvested here.\n\t\t\t$this->adapter->processResponse( $response );\n\t\t\t$status = $this->adapter->getFinalStatus();\n\t\t\tswitch ( $status ) {\n\t\t\tcase FinalStatus::COMPLETE:\n\t\t\tcase FinalStatus::PENDING:\n\t\t\t\t$this->displayThankYouPage( $status );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$this->logger->info( \"Displaying fail page for final status $status\" );\n\t\t} else {\n\t\t\t$this->logger->error( \"Resultswitcher: Token Check Failed. Order ID: $oid\" );\n\t\t}\n\t\t$this->displayFailPage();\n\t}", "public function process() {\n // on va lui passer le contexte en premier paramètre\n // puis on va lui passer les paramètres du path comme\n // paramètres supplémentaires\n $args = array_merge(\n array($this->_context),\n $this->_context->route->params\n );\n\n $this->_context->require_part('controller', $this->controller);\n $controller = new $this->controller;\n\n // CALL STAGES BEFORE ACTION\n\n $stages = array(\n '_before_action'\n );\n\n $_response = null;\n $responses_stack = array();\n\n foreach($stages as $stage) {\n $_response = $this->call_stage($controller,$stage,$this->action, $responses_stack);\n\n // Si on obtient un objet de type Response, on stoppe\n\n if($_response instanceof Response) {\n return $this->output($_response); // ! RETURN\n }\n else {\n $responses_stack[$stage] = $_response;\n }\n }\n\n\n // CALL ACTION\n if(! method_exists($controller, $this->action)) {\n throw new \\InvalidArgumentException('Action '.$this->action.' does not exists in controller '. get_class($controller));\n }\n $action_response = call_user_func_array(array($controller, $this->action), $args);\n\n if($action_response instanceof Response) {\n return $this->output($action_response); // ! RETURN\n }\n\n\n if(is_null($action_response)) {\n // si la réponse est nulle, on ne fait rien tout simplement\n //@todo : faire autre chose, envoyer un 204 ?\n $class = get_class($controller);\n r(\"@todo : empty $class return\");\n return; // ! RETURN\n }\n elseif(is_string($action_response)) {\n $response = new Response($action_response, $headers=array());\n return self::output($response); // ! RETURN\n }\n\n\n }", "public final function dispatch() {\n\t\t$request = PhpBB::getInstance()->getRequest();\n\n\t\tif ($this->controller != NULL) {\n\t\t\treturn $this->handleResponse(\n\t\t\t\t$this->controller->executeAction(\n\t\t\t\t\tself::getAction($request),\n\t\t\t\t\tself::getParameters($request)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\treturn $this->handleResponse(new Error404());\n\t}", "public function execute() {\n if ( $this->mInternalMode ) {\n $this->executeAction();\n } else {\n $this->executeActionWithErrorHandling();\n }\n }", "public function execute()\n {\n $action = $this->action ?: '__index';\n $params = (array) $this->params;\n\n $response = $this->__preAction($action, $params);\n if ($response !== false) {\n $response = call_user_func_array(array($this, $action), $params);\n }\n\n $response = $this->__postAction($action, $params, $response) ?: $response;\n\n return $response ?: new \\Gini\\CGI\\Response\\Nothing();\n }", "public function executeAction() {\r\n\t\t\r\n\t}", "protected function callActionMethod() {}", "public static function returnActions() {\n }", "public function store_result() {}", "private function processResult($result, $data){\n\t\t\tswitch(strtolower($result['action'])){\n\t\t\t\tcase 'display':\n\t\t\t\t\t$this->processDisplayAction($result, $data);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'result':\n\t\t\t\t\t$this->addToResultSet($result, $data);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t//Nothing happens here.\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn (bool) true;\n\t\t}", "public function attemptAction($result, $item = 'year', $action = 'update', $custom_message = null)\n {\n if ($result) {\n return $result;\n }\n\n if ($custom_message) {\n $this->errors[] = $custom_message;\n\n return;\n }\n\n $this->errors[] = \"Could not $action this $item. Please try again.\";\n }", "public function resultAction()\n {\n // Get the current request\n $request = $this->_board->getRequest($this->getRequest()->getParam('request_id', false));\n if (!$request) {\n return $this->_forward('noroute');\n }\n Mage::register('current_board_request', $request);\n\n // Validate (to be sure)\n $data = $this->getRequest()->getQuery();\n $errors = $request->init(new Varien_Object($data))->validate();\n if (count($errors)) {\n foreach ($errors as $error) {\n $this->_getSession()->addError($error);\n }\n return $this->_redirectReferer();\n }\n\n /*\n * Export as CSV\n */\n if ((bool) $data['export_flag']) {\n\n // Denied?\n if (!$request->canExport()) {\n return $this->_forward('denied');\n }\n\n $this->getResponse()\n ->setHttpResponseCode(200)\n ->setHeader('Pragma', 'public', true)\n ->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true)\n ->setHeader('Content-type', $request->getExportMimeType(), true)\n //->setHeader('Content-Length', null, true)\n ->setHeader('Content-Disposition', 'attachment; filename=\"' . $request->getExportFilename() . '\"', true)\n ->setHeader('Last-Modified', date('r'), true)\n ->sendHeaders()\n ;\n\n try {\n $request->processExportAndDisplay();\n } catch (Exception $e) {\n Mage::getSingleton('core/session')->addError($e->getMessage());\n return $this->_redirectReferer();\n }\n exit;\n }\n\n /*\n * Display grid\n */\n // Denied?\n if (!$request->canViewResults()) {\n return $this->_forward('denied');\n }\n\n $this->loadLayout();\n $this->renderLayout();\n }", "protected function handleActionResult($result, $controllerName, $actionName, Customweb_Core_Http_IRequest $request) {\n\t\tif ($result === null) {\n\t\t\tthrow new Exception(Customweb_Core_String::_(\"Action '@action' on controller '@controller' does not return any result.\")\n\t\t\t\t\t->format(array('@controller' => $controllerName, '@action' => $actionName)));\n\t\t}\n\t\tif (is_array($result)) {\n\t\t\tif (isset($result['controller'])) {\n\t\t\t\t$controllerName = $result['controller'];\n\t\t\t}\n\t\t\tif (!isset($result['action'])) {\n\t\t\t\tthrow new Exception(\"If you provide a array as response of a action, you have to provde a 'action' key, which indicates the action to which the request is forwarded to.\");\n\t\t\t}\n\n\t\t\t$actionName = $result['action'];\n\t\t\treturn $this->invokeControllerAction($request, $controllerName, $actionName);\n\t\t}\n\t\telse if (is_string($result) && strpos($result, 'redirect:') === 0) {\n\t\t\t$result = $result;\n\t\t\t$url = substr($result, strlen('redirect:'));\n\t\t\t$response = new Customweb_Core_Http_Response();\n\t\t\t$response->appendHeader('Location: '. $url);\n\t\t\treturn $response;\n\t\t}\n\t\telse if (is_string($result)) {\n\t\t\t$response = new Customweb_Core_Http_Response();\n\t\t\t$response->setBody($result);\n\t\t\treturn $response;\n\t\t}\n\t\telse if ($result instanceof Customweb_Core_Http_IResponse) {\n\t\t\treturn $result;\n\t\t}\n\t\telse {\n\t\t\tthrow new Exception(Customweb_Core_String::_(\"Action '@action' on controller '@controller' does not return a valid result.\")\n\t\t\t\t\t->format(array('@controller' => $controllerName, '@action' => $actionName)));\n\t\t}\n\t}" ]
[ "0.70870996", "0.6901446", "0.69000465", "0.69000465", "0.69000465", "0.66870224", "0.6610696", "0.6464078", "0.64616317", "0.6386998", "0.63827604", "0.6343364", "0.63338304", "0.6299468", "0.62936884", "0.62524915", "0.6231566", "0.617491", "0.6158104", "0.6156485", "0.6143193", "0.6116445", "0.6116183", "0.6112343", "0.60932153", "0.60569125", "0.6035246", "0.59951806", "0.59757286", "0.59679985" ]
0.7359595
0
/ The idea was that stylesheetpatches was for MSIE
protected function getStylesheetPatches() { $stylesheet_patches = parent::getStylesheetPatches(); $stylesheet_patches[] = 'styles/css/minimal/patches/iehacks_3col_vlines.css'; return $stylesheet_patches; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _style_fix()\n {\n }", "abstract public function register_style();", "protected function generateCSS() {}", "function hook_style() {\n\t\treturn null;\n\t}", "function get_broken_themes()\n {\n }", "function phptemplate_get_ie_styles() {\n global $language;\n\n $iecss = '<link type=\"text/css\" rel=\"stylesheet\" media=\"all\" href=\"'. base_path() . path_to_theme() .'/fix-ie.css\" />';\n\n return $iecss;\n}", "function get_stylesheet()\n {\n }", "function phptemplate_get_ie_styles() {\n global $language;\n\n $iecss = '<link type=\"text/css\" rel=\"stylesheet\" media=\"all\" href=\"'. base_path() . path_to_theme() .'/css/fix-ie.css\" />';\n\n return $iecss;\n}", "function register_style() {\n}", "protected function getIEStyles() { return ''; }", "protected function getIEStyles() { return ''; }", "function phptemplate_get_ie_styles() {\n global $language;\n\n $iecss = '<link type=\"text/css\" rel=\"stylesheet\" media=\"all\" href=\"'. base_path() . path_to_theme() .'/fix-ie.css\" />';\n if ($language->direction == LANGUAGE_RTL) {\n $iecss .= '<style type=\"text/css\" media=\"all\">@import \"'. base_path() . path_to_theme() .'/fix-ie-rtl.css\";</style>';\n }\n\n return $iecss;\n}", "function phptemplate_get_ie_styles() {\n global $language;\n $iecss = '<link type=\"text/css\" rel=\"stylesheet\" media=\"all\" href=\"' . base_path() . path_to_theme() . '/fix-ie.css\" />';\n if ($language->direction == LANGUAGE_RTL) {\n $iecss .= '<style type=\"text/css\" media=\"all\">@import \"' . base_path() . path_to_theme() . '/fix-ie-rtl.css\";</style>';\n }\n return $iecss;\n}", "function child_add_ie8_style_sheet() {\n\tglobal $wp_styles;\n\twp_enqueue_style( 'child-ie8', get_stylesheet_directory_uri() . '/barjeel-old-ie.css', array(), '1.0' );\n\t$wp_styles->add_data( 'child-ie8', 'conditional', 'lte IE 8' );\n}", "public function get_sitemap_stylesheet()\n {\n }", "public function get_stylesheet()\n {\n }", "public function get_stylesheet()\n {\n }", "public function get_sitemap_index_stylesheet()\n {\n }", "function test_stylesheet() {\n\t\t\tif ($this->is_readable_and_not_empty($this->get_stylesheet())) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// so try to generate stylesheet...\n\t\t\t$this->write_stylesheet(false);\n\n\t\t\t// retest\n\t\t\tif ($this->is_readable_and_not_empty($this->get_stylesheet())) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "function locale_stylesheet()\n {\n }", "function _preview_theme_stylesheet_filter()\n {\n }", "public function get_app_stylesheet()\n {\n }", "protected function separateStyle()\n\t{\n\t\t$items = array();\n\t\tif ($this instanceof Layout) {\n\t\t\t$nodes = @$this->xpath->query(\"//body//link\");\n\t\t\tforeach ($nodes as $node) {\n\t\t\t\t$this->styles[] = $node;\n\t\t\t\t$items[] = $node;\n\t\t\t}\n\n\t\t\tforeach ($items as $node) {\n\t\t\t\t$parent = $node->parentNode;\n\t\t\t\t$parent->removeChild($node);\n\t\t\t}\n\t\t} else {\n\t\t\t$nodes = @$this->xpath->query(\"//head//link\");\n\t\t\tforeach ($nodes as $node) {\n\t\t\t\t$this->styles[] = $node;\n\t\t\t\t$items[] = $node;\n\t\t\t}\n\n\t\t\tforeach ($items as $node) {\n\t\t\t\t$parent = $node->parentNode;\n\t\t\t\t$parent->removeChild($node);\n\t\t\t}\n\n\t\t\t$items = array();\n\t\t\t$nodes = @$this->xpath->query(\"//body//link\");\n\t\t\tforeach ($nodes as $node) {\n\t\t\t\t$this->styles[] = $node;\n\t\t\t\t$items[] = $node;\n\t\t\t}\n\n\t\t\tforeach ($items as $node) {\n\t\t\t\t$parent = $node->parentNode;\n\t\t\t\t$parent->removeChild($node);\n\t\t\t}\n\t\t}\n\n\t\t$items = array();\n\t\t$nodes = @$this->xpath->query(\"//head//style\");\n\t\tforeach ($nodes as $node) {\n\t\t\t$this->styles[] = $node;\n\t\t\t$items[] = $node;\n\t\t}\n\n\t\tforeach ($items as $node) {\n\t\t\t$parent = $node->parentNode;\n\t\t\t$parent->removeChild($node);\n\t\t}\n\n\t\t$items = array();\n\t\t$nodes = @$this->xpath->query(\"//body//style\");\n\t\tforeach ($nodes as $node) {\n\t\t\t$this->styles[] = $node;\n\t\t\t$items[] = $node;\n\t\t}\n\n\t\tforeach ($items as $node) {\n\t\t\t$parent = $node->parentNode;\n\t\t\t$parent->removeChild($node);\n\t\t}\n\t}", "function add_my_stylesheet() {\n}", "protected function getIEStyles() {\n return <<<CSSRULES\n.tab-box-content { display: block; }\n.tab-box-contents { overflow: hidden;position: relative; }\nb { position: absolute; top: 0px; right: 0px; width:1px; height: 251px; overflow: hidden; text-indent: -9999px; }\nCSSRULES;\n\n }", "function ft_hook_add_css() {}", "protected function doCompressCss() {}", "function v2_mumm_css_alter(&$css) {\n $path = drupal_get_path('theme', 'v2_mumm');\n if ($_GET['q'] === 'outdated-browser') {\n unset($css[$path . '/css/style.css']);\n }\n else {\n unset($css[$path . '/css/unsupported-browsers.css']);\n }\n}", "function make_css( $args, $assoc_args ) {\n if ( class_exists( 'TF_Styling_Control' ) ) {\n if ( TF_Model::create_stylesheets() ) {\n WP_CLI::success( \"Stylesheet succesfully created.\" );\n } else {\n WP_CLI::error( \"Could not create stylesheet.\" );\n }\n }\n }", "public function generateStylesheet(){\n\n $file= fopen($this->stylesheet_url, 'w');\n\n $stylesheet_attributes= collect($this->getAttributes())->except($this->excluded);\n\n $success=true;\n $stylesheet_attributes->each(function($item, $key) use ($file){\n if( fwrite($file, \"\\$\".$key.\": \".$item.\";\\n\") ===false){\n throw new Exception(\"Error writing 'assets/sass/_custom_variables.scss' stylesheet\", 1);\n }\n //echo '$'.$key.': '.$item.'\\n';\n });\n\n fclose($file);\n\n return true;\n }" ]
[ "0.5948786", "0.5860504", "0.5857611", "0.57618153", "0.5704183", "0.5700602", "0.5682991", "0.56780714", "0.5671236", "0.566183", "0.566183", "0.5652806", "0.56193966", "0.55962306", "0.55726796", "0.5537618", "0.5537618", "0.55137926", "0.55134934", "0.55088764", "0.54861903", "0.5455233", "0.5432729", "0.5388974", "0.5363869", "0.53344494", "0.53270084", "0.5318231", "0.5303982", "0.52981776" ]
0.6606795
0
/ Override this method to define which of the top menu items is active, e.g. return 'forums';
protected function getTopmenuActiveItem() { return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function menu_get_active_title()\n {\n return menu_get_active_title();\n }", "function mro_menu_top_item_classes( $classes, $item, $args ) {\n\n\tif( 'primary' !== $args->theme_location )\n\t\treturn $classes;\n\n\tif( is_front_page() && ( 'Clases de Yoga' == $item->title || 'Clases de yoga' == $item->title || 'Clases' == $item->title ) )\n\t\t$classes[] = 'active';\n\n\tif( is_singular( 'mro-team' ) && ( 'Clases de Yoga' == $item->title || 'Clases de yoga' == $item->title || 'Clases' == $item->title ) )\n\t\t$classes[] = 'current-menu-item active';\n\n\tif( is_singular( 'mro-event' ) && 'Actividades' == $item->title )\n\t\t$classes[] = 'current-menu-item active';\n\n\tif( is_page_template( 'page-templates/template-thai.php' ) && 'Masaje tai' == $item->title )\n\t\t$classes[] = 'current-menu-item active';\n\n\t// if( ( is_singular( 'code' ) || is_tax( 'code-tag' ) ) && 'Talleres' == $item->title )\n\t\t// $classes[] = 'current-menu-item';\n\n\t// if( is_singular( 'projects' ) && 'Entrenamiento' == $item->title )\n\t// \t$classes[] = 'current-menu-item';\n\n\t// if( is_singular( 'projects' ) && 'Masaje Tai' == $item->title )\n\t// \t$classes[] = 'current-menu-item';\n\n\t// if( is_singular( 'projects' ) && 'Yoga' == $item->title )\n\t// \t$classes[] = 'current-menu-item';\n\n\t// if( is_singular( 'projects' ) && 'Nosotros' == $item->title )\n\t// \t$classes[] = 'current-menu-item';\n\n\tif( mandir_is_tree(18) && 'Tienda' == $item->title )\n\t\t$classes[] = 'current-menu-item';\n\n\t// if( is_singular( 'projects' ) && 'Contáctenos' == $item->title )\n\t// \t$classes[] = 'current-menu-item';\n\n\treturn array_unique( $classes );\n}", "function active_menu()\n{\n $CI =& get_instance();\n\n $class = '';\n if($CI->router->fetch_class() == 'blog') {\n $class = 'class=\"navbar-item-active\"';\n }\n return $class;\n}", "function get_active_menu (string $page, string $page_active, string $class_active = \"active\") {\n return $page == $page_active ? $class_active : \"\";\n }", "function get_active_menu (string $page, string $page_active, string $class_active = \"active\") {\n return $page == $page_active ? $class_active : \"\";\n }", "protected function getActiveMenu() {\n return $this->activeMenu;\n }", "public function getActive() {\n\t\tif ($this->_active === null) {\n\t\t\tif ($menu = $this->app->system->application->getMenu('site') and $menu instanceof JMenu) {\n\t\t\t\t$this->_active = $menu->getActive();\n\t\t\t}\n\t\t}\n\t\treturn $this->_active;\n\t}", "function foundation_active_class($classes, $item){\n if( in_array('current-menu-item', $classes) ){\n $classes[] = 'active ';\n }\n return $classes;\n}", "function special_nav_class($classes, $item){\n if( in_array('current-menu-item', $classes) ){\n $classes[] = 'active ';\n }\n return $classes;\n}", "function uk_active_nav_class( $class, $item ) {\n if (in_array( 'current-menu-item', $class )) {\n $class[] = 'uk-active';\n }\n return $class;\n}", "function set_active_nav_class ($classes, $item) {\n if (in_array('current-menu-item', $classes) ){\n $classes[] = 'activemenu ';\n }\n return $classes;\n}", "function activate_menu($controller) {\n $CI = get_instance();\n // Getting router class to active.\n $class = $CI->router->fetch_class();\n return ($class == $controller) ? 'active' : '';\n }", "function trucking_filter_active_class_menu( $classes){\n if(in_array('current-menu-item', $classes)) {\n $classes[] = 'active';\n }\n return $classes;\n}", "public function getHeaderMenu($active='') {\n return htcms_get_header_menu($active);\n }", "function active_nav_class($classes, $item){\n\tif (in_array('current-menu-item', $classes)) {\n\t\t$classes[] = 'active';\n\t}\n\treturn $classes;\n}", "public function menu_main_menu()\n {\n return menu_main_menu();\n }", "public function menu_get_active_help()\n {\n return menu_get_active_help();\n }", "public function getDefaultMenu()\n\t{\n\t\treturn 'base';\n\t}", "function topbar($menuItem, $navItems)\n{\n\n // Contains the nav bar items\n $navItems = array(\n 'Group Target Setter' => '/blocks/group_targets/view2.php',\n 'Change Target Status' => '/blocks/group_targets/set2.php',\n 'Group Profile' => '/blocks/group_targets/group2.php',\n 'Unit Tracker' => '/blocks/group_targets/tracker2.php',\n// 'Import Feeds' => $siteUrl . '/jobshop/feeds/process_feeds.php',\n// 'View Applications' => $siteUrl . '/jobshop/processing/index.php',\n// 'Featured Jobs' => $siteUrl . '/jobshop/slider/index.php',\n );\n\n echo '<div class=\"noprint\">';\n echo '<div class=\"topbar\">';\n echo '<div class=\"topbar-inner\">';\n echo '<div class=\"container-fluid\">';\n echo '<a class=\"brand\" href=\"#\">Group Target Setter v2.0</a>';\n echo '<ul class=\"nav\">';\n //print_r($navItems);\n foreach ($navItems as $key => $item) {\n\n // echo $key . ' ' . $item;\n\n if ($menuItem != $key) {\n $active = '';\n } elseif ($menuItem == $key) {\n $active = ' class=\"active\"';\n }\n\n echo '<li ', $active, '><a href=\"', $item, '\">', $key, '</a></li>';\n }\n\n echo '</ul>';\n // echo '<p class=\"pull-right\">Logged in as <a href=\"#\">username</a></p>';';\n echo '</div>';\n echo '</div>';\n echo '</div>';\n echo '</div>';\n\n}", "function is_sidebar_menu_active($current)\n{\n $CI =& get_instance();\n if ($CI->uri->segment(1) == $current) {\n return 'active';\n }\n return '';\n}", "function ActiveMenu($requestUri)\n{\n $current_file_name = basename($_SERVER['REQUEST_URI'], \".php\");\n\n if ($current_file_name == $requestUri)\n echo 'class=\"active\"';\n}", "public function topMenuNavigation() {\n\t\t$out = '';\n\t\tif($modules = DataObject::get('WorkflowCategory', '', 'priority ASC')) {\n\t\t\tforeach ($modules as $module) {\n\t\t\t\tif (Permission::check(strtoupper(str_replace(\" \", \"_\", $module->name)))) {\n\t\t\t\t\t$icon = '';\n\t\t\t\t\tif($image = DataObject::get_by_id('Image', $module->imageID)) {\n\t\t\t\t\t\tif($smImage = $image->setSize(16,16)) {\n\t\t\t\t\t\t\t$icon = $smImage->URL;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$out .= \"\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: '{$module->name}', \n\t\t\t\t\t\ticon: '{$icon}',\n\t\t\t\t\t\tmenu: {$this->moduleItems($module->ID)}\n\t\t\t\t\t},\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $out;\n\t}", "function get_menu_items($title) {\n\t$items['home.php'] = \"Home\";\n\t$items['play_trivia.php'] = \"Play Trivia\";\n\t$items['view_leaders.php'] = \"View Leader Board\";\n\t$items['rank_question.php'] = \"Rank Questions\";\n\t$items['insert_question.php'] = \"Insert Question\";\n\t\n\tif ($_SESSION['admin']) {\t\n\t\t$items['insert_user.php'] = \"Delete User\";\n\t\t$items['delete_question.php'] = \"Delete Question\";\n\t}\t\t\n\t$items['logout.php'] = \"Logout\";\n\t\t\n\tforeach ($items as $key=>$value) {\n\t\t$active = '';\n\t\tif ($value==$title) $active = \"active\";\n\t\t$menu_items .= '\n\t\t <li class=\"nav-item\">\n\t\t <a class=\"nav-link '.$active.'\" href=\"'.$key.'\">'.$value.'</a>\n\t\t </li>\n\t\t';\n\t}\n\treturn $menu_items;\n}", "function rwbs_add_active_class_to_nav_menu($classes) {\n if (in_array('current-menu-item', $classes, true) || in_array('current_page_item', $classes, true)) {\n $classes = array_diff($classes, array('current-menu-item', 'current_page_item', 'active'));\n $classes[] = 'active';\n }\n return $classes;\n}", "public function getMenu();", "public function getLiActiveClass(): string;", "function getMenuTitle();", "protected function getCurrentDashbaordItem() {\n\t\t\n\t\treturn \"home\";\n\t}", "function greenfields_add_active_class($classes, $item)\n{\n if (in_array('current-menu-item', $classes)) {\n $classes[] = \"active\";\n }\n\n return $classes;\n}", "function roots_cpt_active_menu($menu) {\n if ('base_service' === get_post_type()) {\n $menu = str_replace('active', '', $menu);\n $menu = str_replace('menu-services', 'menu-services active', $menu);\n }\n if ('base_portfolio' === get_post_type()) {\n $menu = str_replace('active', '', $menu);\n $menu = str_replace('menu-portfolio', 'menu-portfolio active', $menu);\n }\n return $menu;\n}" ]
[ "0.68455106", "0.6730559", "0.67231405", "0.667018", "0.667018", "0.6603555", "0.6572901", "0.6485088", "0.64622724", "0.64617693", "0.64487076", "0.6418444", "0.6402113", "0.63590837", "0.6340342", "0.6332925", "0.62898004", "0.6249991", "0.624612", "0.6211232", "0.6153692", "0.61376", "0.61247236", "0.6092668", "0.6090826", "0.6087745", "0.60793394", "0.60770863", "0.6076362", "0.6036344" ]
0.73892033
0
A tiny wee quicksearch box
protected function quicksearch() { $words = $this->getWords(); $logged_in = APP_User::isBWLoggedIn('NeedMore,Pending'); if (!$logged_in) { $request = PRequest::get()->request; if (!isset($request[0])) { $login_url = 'login'; } else switch ($request[0]) { case 'login': case 'main': case 'start': $login_url = 'login'; break; default: $login_url = 'login/'.htmlspecialchars(implode('/', $request), ENT_QUOTES); } } else { $username = isset($_SESSION['Username']) ? $_SESSION['Username'] : ''; } if (class_exists('MOD_online')) { $who_is_online_count = MOD_online::get()->howManyMembersOnline(); } else { // echo 'MOD_online not active'; if (isset($_SESSION['WhoIsOnlineCount'])) { $who_is_online_count = $_SESSION['WhoIsOnlineCount']; // MOD_whoisonline::get()->whoIsOnlineCount(); } else { $who_is_online_count = 0; } } PPostHandler::setCallback('quicksearch_callbackId', 'SearchmembersController', 'index'); require TEMPLATE_DIR . 'shared/roxpage/quicksearch.php'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchBox() {\n\t\tglobal $wgUseTwoButtonsSearchForm; ?>\n\t\t<form action=\"<?php $this->text('wgScript'); ?>\" class=\"searchform\">\n\t\t\t<div class=\"form-group\"><?php\n\t\t\t\techo $this->makeSearchInput(array('id' => 'searchInput', 'class' => 'form-control')); ?>\n\t\t\t</div>\n\t\t\t<div class=\"form-group\"><?php\n\t\t\t\techo $this->makeSearchButton('go', array( 'class' => 'btn btn-primary' )); ?>\n\t\t\t</div>\n\t\t</form><?php\n\t}", "private function search_bar()\n\t{\n\n\t\t# code...\n\t}", "function display_search_box(){\r\n\t\r\n\t$random_number = rand(0, 99);\r\n\t$search_div_id = \"cse-search-form\".$random_number;\r\n\t\r\n\t$useGoogleCSE = of_get_option('opt_google_cse');\r\n\t$googleCSEID = of_get_option('opt_google_cse_id');\r\n\t\r\n\t$formHtml = '<div id=\"' . $search_div_id . '\" style=\"width: 100%;\">Loading</div>\r\n\t\t\t\t<script type=\"text/javascript\">\r\n\t\t\t\t\tgoogle.load(\\'search\\', \\'1\\');\r\n\t\t\t\t\tgoogle.setOnLoadCallback(function() {\r\n\t\t\t\t\tvar customSearchOptions = {};';\r\n\t\r\n\tif (function_exists('domain_mapping_siteurl')) \r\n\t\t$domain = domain_mapping_siteurl(null);\r\n\telse\r\n\t\t$domain = get_bloginfo('url');\r\n\t\r\n\tif ($useGoogleCSE) { \r\n\t\t$formHtml .= 'var customSearchControl = new google.search.CustomSearchControl(\\'' . $googleCSEID . '\\', customSearchOptions);';\r\n\t} else {\r\n\t\t$formHtml .= 'var customSearchControl = new google.search.CustomSearchControl({crefUrl:\\'' . $domain . '/wp-content/themes/UFandShands/cref_xml.php\\'});';\r\n\t}\r\n\t\r\n\t$formHtml .= 'customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);\r\n\t\t\t\t var options = new google.search.DrawOptions();\r\n\t\t\t\t options.setAutoComplete(true);';\r\n\t\r\n\tif ($useGoogleCSE) { \r\n\t\t$formHtml .= 'customSearchControl.setAutoCompletionId(\\'' . $googleCSEID . '+qptype:1\\');';\r\n\t} \r\n\t\r\n\t$formHtml .= 'options.enableSearchboxOnly(\"' . $domain . '/\", \"s\");\r\n\t\t\t\t\tcustomSearchControl.draw(\\''. $search_div_id . '\\', options);\r\n\t\t\t\t\t}, true);\r\n\t\t\t\t\t</script>';\r\n\t\r\n\treturn $formHtml;\r\n}", "function showquery() {\r\n #~ echo '<td align=right>'; // see nav.inc.php for reason\r\n echo '<form name=\"search\" method=POST action=\"'.$_SERVER['PHP_SELF'].'\">';\r\n #~ echo '<img src=\"images/b_search.png\" border=\"0\">';\r\n echo lang('Search').' ';\r\n echo '<input type=hidden name=m value=\"'.$this->module.'\">';\r\n echo '<input type=hidden name=act value=\"browse\">';\r\n echo '<input type=text name=query value=\"'.$this->_query.'\" size=10>';\r\n echo ' '.lang('in').' ';\r\n echo '<select name=\"qf\">';\r\n #~ echo '<option value=\"\">With selected:</option>';\r\n echo '<option value=\"*\">'.lang('All fields').'</option>';\r\n echo \"<option value=''>______________</option>\";\r\n foreach ($this->properties as $key=>$col) {\r\n if (!$col->queryable or $col->colname=='') continue;\r\n $key == $_REQUEST['qf']? $ischecked = 'selected': $ischecked = '';\r\n echo \"<option value='$key' $ischecked>{$col->label}</option>\";\r\n }\r\n echo '</select>';\r\n #~ echo '<input type=submit value=\"Query\">';\r\n echo '</form>';\r\n #~ echo '</td>'; // see nav.inc.php for reason\r\n\r\n #~ echo '</td></tr></table>';\r\n }", "function showSearch () {\n\t\t$template['list'] = $this->cObj->getSubpart($this->templateCode,'###TEMPLATE_SEARCH###');\n\t\t$subpartArray = array();\n\t\t$markerArray = $this->helperGetLLMarkers(array(), $this->conf['search.']['LL'], 'search');\n\n\t\t// hide the radisus search by using a subpart\n\t\tif ($this->config['search']['radiusSearch'] != 1) {\n\t\t\t$subpartArray['###HIDE_RADIUSSEARCH###'] = '';\n\t\t}\n\n\t\t$markerArray['###DEFAULT_COUNTRY###'] = $this->config['defaultCountry']; // set the default country\n\t\t$markerArray['###DEFAULT_ZIP###'] = htmlspecialchars($this->piVars['zip']);\n\t\t$markerArray['###AUTOSUBMIT###'] = ($this->piVars['zip'] == '') ? '//' : '';\n\n\t\t// fetch the allowed categories as option list\n\t\t$markerArray['###CATEGORY###'] = $this->helperGetRecursiveCat($this->config['categories']);\n\n\t\t$content = $this->cObj->substituteMarkerArrayCached($template['list'], $markerArray, $subpartArray);\n\t\treturn $content;\n\t}", "function pi_list_searchBox($divParams='',$header=false) {\n\t\t// the $sBox search-form gets displayed on the result-page of the search accomplished by $this->do_search\n\t\t// searchword is run against white list (here and in do_search) by $this->check_searchword\n\n\n\t\t// Search box design:\n\t\tif ($this->piVars['sword'] <= '') {\n\t\t\t $this->piVars['sword'] = $this->pi_getLL('pi_list_searchBox_defaultValue','search item');\n\t\t}\n\t\t// changed action tag according to instructions from security review:\n\t\t// dropped:\t\t<form method=\"post\" action=\"'.htmlspecialchars(t3lib_div::getIndpEnv('REQUEST_URI')).'\" style=\"margin: 0 0 0 0;\" >\n\t\t// introduced:\t<form method=\"post\" action=\"'.htmlspecialchars($this->pi_linkTP_keepPIvars_url(array(mode => 'search_result'),0,1)).'\" style=\"margin: 0 0 0 0;\" >\n\n\n\n\t\t// $this->pi_classParam('searchbox-sword') contains the markup for css: 'class=\"tx-civserv-pi1-searchbox-sword\"'\n\t\t$search_word=$this->check_searchword(strip_tags($this->piVars['sword'])); //strip and check to avoid xss-exploits\n\n\t\tif(\t\t$GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] == 'utf-8' ||\n\t\t\t\t$GLOBALS['TSFE']->metaCharset == 'utf-8' ||\n\t\t\t\t$GLOBALS['TSFE']->renderCharset == 'utf-8' ){\n\t\t\t$search_word = htmlentities($search_word, ENT_COMPAT, 'UTF-8');\n\t\t}else{\n\t\t\t$search_word = htmlentities($search_word);\n\t\t}\n\n\n\t\t$sBox = '\n\n\t\t<!--\n\t\t\tList search box:\n\t\t-->\n\n\t\t<div' . $this->pi_classParam('searchbox') . '>\n\t\t\t<form method=\"post\" action=\"'.htmlspecialchars($this->pi_linkTP_keepPIvars_url(array(mode => 'search_result'),0,1)).'\" style=\"margin: 0 0 0 0;\" >\n\t\t\t\t<fieldset>\n \t\t\t\t<legend>' . $this->pi_getLL('pi_list_searchBox_searchform','Search form') . '</legend>\n \t\t\t\t<div class=\"searchform\" ' . trim($divParams) . '>\n \t\t\t\t<p><label for=\"query\" title=\"' . $this->pi_getLL('pi_list_searchBox_searchkey','Please enter here your search key') . '\">' .\n \t\t\t\t\t($header?'<strong>' . $this->pi_getLL('pi_list_searchBox_header','Keyword search') . ':</strong><br />':'') .\n \t\t\t\t'</label></p>\n \t\t\t\t\t<input type=\"text\" name=\"' . $this->prefixId . '[sword]\" id=\"query\" class=\"searchkey\" size=\"16\" maxlength=\"60\" value=\"' . $search_word . '\"' . $this->pi_classParam('searchbox-sword') . ' onblur=\"if(this.value==\\'\\') this.value=\\'' . $search_word . '\\';\" onfocus=\"if(this.value==\\'' . $this->pi_getLL('pi_list_searchBox_defaultValue','search item') . '\\') this.value=\\'\\';\" />\n \t\t\t\t<input type=\"submit\" value=\"' . $this->pi_getLL('pi_list_searchBox_search','Search',TRUE) . '\"' . $this->pi_classParam('searchbox-button') . ' accesskey=\"S\" title=\"' . $this->pi_getLL('pi_list_searchBox_submit','Klick here, to submit the search query') . '\"/>\n \t\t\t\t<input type=\"hidden\" name=\"no_cache\" value=\"1\" />\n \t\t\t\t<input type=\"hidden\" name=\"'.$this->prefixId.'[pointer]\" value=\"\" />\n \t\t\t\t</div>\n \t\t\t</fieldset>\n \t\t </form>\n\t\t</div>';\n\t\treturn $sBox;\n\t}", "function search() {}", "function searchResults($string, $type, $power_search = false) {\n\t\t\tglobal $cms_type,$jzSERVICES; \n\t\t\t\n\t\t\t$display = &new jzDisplay();\n\t\t\t$blocks = &new jzBlocks();\n\t\t\t$tracks = array();\n\t\t\t$nodes = array();\n\t\t\t\n\t\t\t// remember, $this is a frontend.\n\t\t\t// This has to go before SQL querries.\n\t\t\t// If our keywords say to play the results\n\t\t\t// we cannot print any HTML.\n\t\t\tif ($power_search === false) {\n\t\t\t $check = splitKeywords($string);\n\t\t\t if (!muteOutput($check['keywords'])) {\n\t\t\t $display->preheader('Search Results',$this->width,$this->align);\n\t\t\t $this->pageTop('Search Results');\n\t\t\t }\n\t\t\t \n\t\t\t $results = handleSearch($string, $type);\n\t\t\t if (sizeof($results) == 0 && muteOutput($check['keywords'])) {\n\t\t\t $display->preheader('Search Results',$this->width,$this->align);\n\t\t\t $this->pageTop('Search Results');\n\t\t\t }\n\t\t\t} else {\n\t\t\t // Power search:\n\t\t\t $display->preheader('Search Results',$this->width,$this->align);\n\t\t\t $this->pageTop('Search Results');\n\t\t\t $root = new jzMediaNode();\n\t\t\t $results = $root->powerSearch();\n\t\t\t}\n\t\t\t\n\t\t\techo '<table width=\"100%\" cellpadding=\"3\"><tr><td>';\n\n\t\t\tforeach ($results as $val) {\n\t\t\t\tif ($val->isLeaf()) {\n\t\t\t\t\t$tracks[] = $val;\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$nodes[] = $val;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// show the page\n\t\t\tif (sizeof($tracks) > 0) {\n\t\t\t\t$blocks->blockHeader(sizeof($tracks). \" \". word(\"Matching Tracks\"). \" \". word(\"for search\"). ' \"'. $_POST['search_query']. '\"');\n\t\t\t\t$blocks->blockBodyOpen();\n\t\t\t\t$blocks->trackTable($tracks, \"search\");\n\t\t\t\t$blocks->blockBodyClose();\n\t\t\t\t$blocks->blockSpacer();\n\t\t\t}\n\t\t\tif (sizeof($nodes) > 0) {\n\t\t\t\t$blocks->blockHeader(sizeof($nodes). \" \". word(\"Other Matches\"). \" \". word(\"for search\"). ' \"'. $_POST['search_query']. '\"');\n\t\t\t\t$blocks->blockBodyOpen();\n\t\t\t\t$blocks->nodeTable($nodes,\"search\");\n\t\t\t\t$blocks->blockBodyClose();\n\t\t\t\t$blocks->blockSpacer();\n\t\t\t}\n\t\t\tif (sizeof($nodes) == 0 && sizeof($tracks) == 0) {\n\t\t\t\t$blocks->blockHeader(word(\"No matches found\"));\n\t\t\t}\n\t\t\t$this->footer();\n\t\t\t$jzSERVICES->cmsClose();\n\t\t}", "function quicksearch($search) {\n\n $count = 1;\n $search = trim($search);\n $search = mb_strtolower($search);\n $search = str_replace(\",\",\" \", $search);\n\n // remove repetative spaces\n $search = preg_replace('/(\\S ) +/', '$1', $search);\n $searchArray = mb_split(\" \", $search);\n \n // search and write results to temporary table\n IdaDb::searchByName($this, $searchArray);\n\n // search and write results to temporary table\n if(count($searchArray) > 1) { \n for($count=0; $count < count($searchArray); $count++) {\n $term = trim($searchArray[$count+1]);\n IdaDb::searchByNameRecursive($count+1, $term);\n \n }\n }\n\n \n \n // create xml\n return XML::makeQuickSearchXML($count-1); \n }", "function begin_ibio_search_page_div(){\n\techo \"<div class='ibio-search'>\";\t\n}", "public function search();", "public function search();", "public function search_box( $text, $input_id ) {\n\t\t\t$input_id = $input_id . '-search-input';\n\n\t\t\t// Allow external user to add search actions (like icons) to the search box\n\t\t\tdo_action( 'wpda_add_search_actions', $this->schema_name, $this->table_name, $this->wpda_table_settings, $this->wpda_list_columns );\n\t\t\t?>\n\n\t\t\t<p class=\"search-box\" <?php echo ! $this->has_items() ? 'style=\"padding-bottom:10px;\"' : ''; ?>>\n\t\t\t\t<input type=\"search\" id=\"<?php echo esc_attr( $input_id ); ?>\"\n\t\t\t\t\t name=\"<?php echo esc_attr( $this->search_item_name ); ?>\"\n\t\t\t\t\t value=\"<?php echo esc_attr( $this->search_value ); ?>\"/>\n\t\t\t\t<?php submit_button( $text, '', '', false, array( 'id' => 'search-submit' ) ); ?>\n\t\t\t\t<input type=\"hidden\" name=\"<?php echo esc_attr( $this->search_item_name ); ?>_old_value\"\n\t\t\t\t\t value=\"<?php echo esc_attr( $this->search_value ); ?>\"/>\n\t\t\t</p>\n\n\t\t\t<?php\n\t\t\t// Allow external user to add search html (like extra items) below the search box\n\t\t\tdo_action( 'wpda_add_search_filter', $this->schema_name, $this->table_name, $this->wpda_table_settings, $this->wpda_list_columns );\n\t\t}", "function search()\n\t{}", "function search()\n\t{}", "function draw_search(){\r\n\t\t$out='';\r\n\r\n\t\tif($this->search_init)\r\n\t\t\t$out.='<input type=\"text\" id=\"'.$this->id.'_search\" name=\"'.$this->id.'_search\" value=\"'.$this->search.'\" onfocus=\"ctSearchFocus(\\''.$this->id.'\\');\" onblur=\"ctSearchBlur(\\''.$this->id.'\\');\" onkeypress=\"ctSearchKeypress(\\''.$this->id.'\\');\" onkeyup=\"ctSearch(\\''.$this->id.'\\');\" />'.$this->change_tags($this->search_html);\r\n\r\n\t\treturn $out;\r\n\t}", "function print_search_form(){\n global $cfg, $db, $libhtml;\n\n $html = $libhtml->form_start();\n $html .= open_table();\n $html .= $libhtml->render_form_table_row(\"keyword\", my_request(\"keyword\"), \"Keyword\", \"keyword\");\n $html .= close_table();\n $html .= $libhtml->render_form_table_row_hidden(\"search\", \"Search\");\n $html .= $libhtml->render_form_table_row_hidden(\"move_to_get\", true);\n\n $html .= $libhtml->render_actions(\n array(\n $libhtml->render_button(\"search_button\", \"Search\"),\n ),\n array(\n \"show_prompt\"=>false,\n \"show_cancel\"=>false,\n \"pause\"=>false,\n )\n );\n\n $html .= $libhtml->form_end();\n $html .= '<div class=\"clear\"></div><br/>';\n return $html;\n }", "public static function SearchOffer(){\n\n\n\n\t\t}", "function displaySearch(){\n \n echo '<form class=\"form-inline searchArea\">\n <div class=\"form-group\">\n <input type=\"hidden\" name=\"page\" value=\"search\">\n <input type=\"text\" name=\"query\" class=\"form-control inputStyle\" id=\"searchBox\" placeholder=\"Search\">\n </div>\n <button type=\"submit\" class=\"btn btn-primary\">Search</button>\n </form>';\n \n }", "public function search_box( $text, $input_id ) {\n\n\t\t$input_id = $input_id . '-search-input';\n\n\t\tif ( ! empty( $_REQUEST['orderby'] ) ) {\n\t\t\techo '<input type=\"hidden\" name=\"orderby\" value=\"' . esc_attr( $_REQUEST['orderby'] ) . '\" />';\n\t\t}\n\t\tif ( ! empty( $_REQUEST['order'] ) ) {\n\t\t\techo '<input type=\"hidden\" name=\"order\" value=\"' . esc_attr( $_REQUEST['order'] ) . '\" />';\n\t\t}\n\t\t?>\n\t\t<div id=\"bdpp-style-search-wrp\" class=\"bdpp-style-search-wrp bdpp-clearfix\">\n\t\t\t<p class=\"search-box\">\n\t\t\t\t<label class=\"screen-reader-text\" for=\"<?php echo $input_id ?>\"><?php echo $text; ?>:</label>\n\t\t\t\t<input type=\"search\" id=\"<?php echo $input_id ?>\" name=\"s\" value=\"<?php _admin_search_query(); ?>\" />\n\t\t\t\t<?php submit_button( $text, 'button', false, false, array('ID' => 'search-submit') ); ?>\n\t\t\t</p>\n\t\t</div><!-- end .bdpp-style-search-wrp -->\n\t\t<?php\n\t}", "function search() {\n // ...\n }", "public function show_quickSearch($output_method = 'echo')\n {\n return $this->call_method(\"show/quickSearch\",\n array('output_method' => $output_method,\n )\n );\n }", "public function quicktags()\n\t{\n\t\t/* Output */\n\t\t\\IPS\\Output::i()->title\t\t= \\IPS\\Member::loggedIn()->language()->addToStack( 'quick_tags' );\n\t\t\\IPS\\Output::i()->output \t= \\IPS\\Theme::i()->getTemplate( 'forms' )->quicktagsList();\n\t}", "public function display() {\n\t\tif (self::$cssadded == false) {\n\t\t\t$this->document->addStyleSheet ( JURI::root (true) . '/modules/mod_kunenasearch/tmpl/css/kunenasearch.css' );\n\t\t\tself::$cssadded = true;\n\t\t}\n\n\t\t$this->ksearch_button\t\t\t= $this->params->get('ksearch_button', '');\n\t\t$this->ksearch_button_pos\t\t= $this->params->get('ksearch_button_pos', 'right');\n\t\t$this->ksearch_button_txt\t\t= $this->params->get('ksearch_button_txt', JText::_('Search'));\n\t\t$this->ksearch_width\t\t\t= intval($this->params->get('ksearch_width', 20));\n\t\t$this->ksearch_maxlength\t\t= $this->ksearch_width > 20 ? $this->ksearch_width : 20;\n\t\t$this->ksearch_txt\t\t\t\t= $this->params->get('ksearch_txt', JText::_('Search...'));\n\t\t$this->ksearch_moduleclass_sfx\t= $this->params->get('moduleclass_sfx', '');\n\t\t$this->url\t\t\t\t\t\t= KunenaRoute::_('index.php?option=com_kunena');\n\n\t\trequire(JModuleHelper::getLayoutPath('mod_kunenasearch'));\n\t}", "function dentalimplants_search_widget() {\n\tgenesis_widget_area ( 'search', array( \n\t'before' => '<div id=\"search-form-container\">',\n\t'after' => '</div>',));\n}", "function widget_sandbox_search($args) {\n\textract($args);\n\t$options = get_option('widget_sandbox_search');\n\t$title = empty($options['title']) ? __( 'Search', 'sandbox' ) : $options['title'];\n\t$button = empty($options['button']) ? __( 'Find', 'sandbox' ) : $options['button'];\n?>\n\t\t\t<?php echo $before_widget ?>\n\t\t\t\t<?php echo $before_title ?><label for=\"s\"><?php echo $title ?></label><?php echo $after_title ?>\n\t\t\t\t<form id=\"searchform\" method=\"get\" action=\"<?php bloginfo('home') ?>\">\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<input id=\"s\" class=\"text-input\" name=\"s\" type=\"text\" value=\"<?php the_search_query() ?>\" size=\"10\" tabindex=\"1\" accesskey=\"S\" />\n\t\t\t\t\t\t<input id=\"searchsubmit\" class=\"submit-button\" name=\"searchsubmit\" type=\"submit\" value=\"<?php echo $button ?>\" tabindex=\"2\" />\n\t\t\t\t\t</div>\n\t\t\t\t</form>\n\t\t\t<?php echo $after_widget ?>\n<?php\n}", "public function search_box($text, $input_id)\n {\n }", "public function search_box($text, $input_id)\n {\n }", "function Search()\n{\n\tglobal $txt, $settings, $context;\n\n\t// Search may be disabled if they're softly banned.\n\tsoft_ban('search');\n\n\t// Is the load average too high to allow searching just now?\n\tif (!empty($context['load_average']) && !empty($settings['loadavg_search']) && $context['load_average'] >= $settings['loadavg_search'])\n\t\tfatal_lang_error('loadavg_search_disabled', false);\n\n\tloadLanguage('Search');\n\tloadTemplate('Search');\n\n\t// Popup mode?\n\tif (AJAX)\n\t{\n\t\twetem::load('search_ajax');\n\t\treturn;\n\t}\n\n\t// Check the user's permissions.\n\tisAllowedTo('search_posts');\n\n\t// Link tree....\n\t// !!! If we've come back here because of an error, we're going to have: Site > Search > Search Results > Search in the linktree. Is this what we want?\n\tadd_linktree($txt['search'], '<URL>?action=search');\n\n\t// This is hard coded maximum string length.\n\t$context['search_string_limit'] = 100;\n\n\t$context['require_verification'] = we::$is_guest && !empty($settings['search_enable_captcha']) && empty($_SESSION['ss_vv_passed']);\n\tif ($context['require_verification'])\n\t{\n\t\tloadSource('Subs-Editor');\n\t\t$verificationOptions = array(\n\t\t\t'id' => 'search',\n\t\t);\n\t\t$context['require_verification'] = create_control_verification($verificationOptions);\n\t\t$context['visual_verification_id'] = $verificationOptions['id'];\n\t}\n\n\t// If you got back from search2 by using the linktree, you get your original search parameters back.\n\tif (isset($_REQUEST['params']))\n\t{\n\t\t// Due to IE's 2083 character limit, we have to compress long search strings\n\t\t$temp_params = base64_decode(str_replace(array('-', '_', '.'), array('+', '/', '='), $_REQUEST['params']));\n\t\t// Test for gzuncompress failing\n\t\t$temp_params2 = @gzuncompress($temp_params);\n\t\t$temp_params = explode('|\"|', !empty($temp_params2) ? $temp_params2 : $temp_params);\n\n\t\t$context['search_params'] = array();\n\t\tforeach ($temp_params as $i => $data)\n\t\t{\n\t\t\t@list ($k, $v) = explode('|\\'|', $data);\n\t\t\t$context['search_params'][$k] = $v;\n\t\t}\n\t\tif (!empty($context['search_params']['brd']))\n\t\t\tloadSource('Search2');\n\t\t$context['search_params']['brd'] = empty($context['search_params']['brd']) ? array() : wedge_ranged_explode(',', $context['search_params']['brd']);\n\t}\n\n\tif (isset($_REQUEST['search']))\n\t\t$context['search_params']['search'] = un_htmlspecialchars($_REQUEST['search']);\n\n\tif (isset($context['search_params']['search']))\n\t\t$context['search_params']['search'] = westr::htmlspecialchars($context['search_params']['search']);\n\tif (isset($context['search_params']['userspec']))\n\t\t$context['search_params']['userspec'] = htmlspecialchars($context['search_params']['userspec']);\n\tif (!empty($context['search_params']['searchtype']))\n\t\t$context['search_params']['searchtype'] = 2;\n\tif (!empty($context['search_params']['minage']))\n\t\t$context['search_params']['minage'] = (int) $context['search_params']['minage'];\n\tif (!empty($context['search_params']['maxage']))\n\t\t$context['search_params']['maxage'] = (int) $context['search_params']['maxage'];\n\n\t$context['search_params']['show_complete'] = !empty($context['search_params']['show_complete']);\n\t$context['search_params']['subject_only'] = !empty($context['search_params']['subject_only']);\n\n\t// Load the error text strings if there were errors in the search.\n\tif (!empty($context['search_errors']))\n\t{\n\t\tloadLanguage('Errors');\n\t\t$context['search_errors']['messages'] = array();\n\t\tforeach ($context['search_errors'] as $search_error => $dummy)\n\t\t{\n\t\t\tif ($search_error === 'messages')\n\t\t\t\tcontinue;\n\n\t\t\t$context['search_errors']['messages'][] = $txt['error_' . $search_error];\n\t\t}\n\t}\n\n\t// Find all the boards this user is allowed to see.\n\t$request = wesql::query('\n\t\tSELECT b.id_cat, c.name AS cat_name, b.id_board, b.name, b.child_level\n\t\tFROM {db_prefix}boards AS b\n\t\t\tLEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)\n\t\tWHERE {query_see_board}\n\t\t\tAND redirect = {string:empty_string}\n\t\tORDER BY b.board_order',\n\t\tarray(\n\t\t\t'empty_string' => '',\n\t\t)\n\t);\n\t$context['num_boards'] = wesql::num_rows($request);\n\t$context['boards_check_all'] = true;\n\t$context['categories'] = array();\n\twhile ($row = wesql::fetch_assoc($request))\n\t{\n\t\t// This category hasn't been set up yet...\n\t\tif (!isset($context['categories'][$row['id_cat']]))\n\t\t\t$context['categories'][$row['id_cat']] = array(\n\t\t\t\t'id' => $row['id_cat'],\n\t\t\t\t'name' => $row['cat_name'],\n\t\t\t\t'boards' => array()\n\t\t\t);\n\n\t\t// Set this board up, and let the template know when it's a child, so it can indent them.\n\t\t$context['categories'][$row['id_cat']]['boards'][$row['id_board']] = array(\n\t\t\t'id' => $row['id_board'],\n\t\t\t'name' => $row['name'],\n\t\t\t'child_level' => $row['child_level'],\n\t\t\t'selected' => (empty($context['search_params']['brd']) && (empty($settings['recycle_enable']) || $row['id_board'] != $settings['recycle_board']) && !in_array($row['id_board'], we::$user['ignoreboards'])) || (!empty($context['search_params']['brd']) && in_array($row['id_board'], $context['search_params']['brd']))\n\t\t);\n\n\t\t// If a board wasn't checked that probably should have been, ensure the board selection is selected!\n\t\tif (!$context['categories'][$row['id_cat']]['boards'][$row['id_board']]['selected'] && (empty($settings['recycle_enable']) || $row['id_board'] != $settings['recycle_board']))\n\t\t\t$context['boards_check_all'] = false;\n\t}\n\twesql::free_result($request);\n\n\t// Now, let's sort the list of categories into the boards for templates that like that.\n\t$temp_boards = array();\n\tforeach ($context['categories'] as $category)\n\t{\n\t\t$temp_boards[] = array(\n\t\t\t'name' => $category['name'],\n\t\t\t'child_ids' => array_keys($category['boards'])\n\t\t);\n\t\t$temp_boards = array_merge($temp_boards, array_values($category['boards']));\n\n\t\t// Include a list of boards per category for easy toggling.\n\t\t$context['categories'][$category['id']]['child_ids'] = array_keys($category['boards']);\n\t}\n\n\t$max_boards = ceil(count($temp_boards) / 2);\n\tif ($max_boards == 1)\n\t\t$max_boards = 2;\n\n\t// Now, alternate them so they can be shown left and right ;).\n\t$context['board_columns'] = array();\n\tfor ($i = 0; $i < $max_boards; $i++)\n\t{\n\t\t$context['board_columns'][] = $temp_boards[$i];\n\t\tif (isset($temp_boards[$i + $max_boards]))\n\t\t\t$context['board_columns'][] = $temp_boards[$i + $max_boards];\n\t\telse\n\t\t\t$context['board_columns'][] = array();\n\t}\n\n\tif (!empty($_REQUEST['topic']))\n\t{\n\t\t$context['search_params']['topic'] = (int) $_REQUEST['topic'];\n\t\t$context['search_params']['show_complete'] = true;\n\t}\n\tif (!empty($context['search_params']['topic']))\n\t{\n\t\t$context['search_params']['topic'] = (int) $context['search_params']['topic'];\n\n\t\t$context['search_topic'] = array(\n\t\t\t'id' => $context['search_params']['topic'],\n\t\t\t'href' => '<URL>?topic=' . $context['search_params']['topic'] . '.0',\n\t\t);\n\n\t\t$request = wesql::query('\n\t\t\tSELECT ms.subject\n\t\t\tFROM {db_prefix}topics AS t\n\t\t\t\tINNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)\n\t\t\t\tINNER JOIN {db_prefix}messages AS ms ON (ms.id_msg = t.id_first_msg)\n\t\t\tWHERE t.id_topic = {int:search_topic_id}\n\t\t\t\tAND {query_see_board}\n\t\t\t\tAND {query_see_topic}\n\t\t\tLIMIT 1',\n\t\t\tarray(\n\t\t\t\t'search_topic_id' => $context['search_params']['topic'],\n\t\t\t)\n\t\t);\n\n\t\tif (wesql::num_rows($request) == 0)\n\t\t\tfatal_lang_error('topic_gone', false);\n\n\t\tlist ($context['search_topic']['subject']) = wesql::fetch_row($request);\n\t\twesql::free_result($request);\n\n\t\t$context['search_topic']['link'] = '<a href=\"' . $context['search_topic']['href'] . '\">' . $context['search_topic']['subject'] . '</a>';\n\t}\n\n\t$context['page_title'] = $txt['search'];\n}", "private function _renderSearchBox() {\n if(!isset($this->searchBoxOptions['class'])) {\n $this->searchBoxOptions['class'] = 'coordinates-picker searchbox';\n }\n \n if(!isset($this->searchBoxOptions['id'])) {\n $this->searchBoxOptions['id'] = $this->getId() . '-searchbox';\n }\n\n // render SearchBox\n echo Html::tag('input' , '' , $this->searchBoxOptions);\n \n $this->clientOptions['enableAutocomplete'] = true;\n\n \n if(!isset($this->clientOptions['inputBinding'])) {\n $this->clientOptions['inputBinding'] = [];\n }\n \n if(!isset($this->clientOptions['inputBinding']['locationNameInput'])) {\n // binding search box\n $this->clientOptions['inputBinding']['locationNameInput'] = new JsExpression(\"jQuery('#\" .$this->searchBoxOptions['id']. \"')\");\n }\n }" ]
[ "0.6884975", "0.6812517", "0.6444305", "0.6370338", "0.63665456", "0.6303977", "0.6266363", "0.6253978", "0.62274384", "0.61589426", "0.61561567", "0.61561567", "0.61306787", "0.61222196", "0.61222196", "0.611716", "0.6053571", "0.6040829", "0.6019069", "0.6013799", "0.6011609", "0.6010053", "0.60015357", "0.6001224", "0.6000882", "0.59918195", "0.59878564", "0.59878564", "0.5969753", "0.59696984" ]
0.6817529
1
Renders the page buttons with nextprev style.
protected function renderPageNextPrev() { $pageCount = $this->pagination->getPageCount(); if ($pageCount < 2 && $this->hideOnSinglePage) { return ''; } $buttons = []; $currentPage = $this->pagination->getPage(); // first page $firstPageLabel = $this->firstPageLabel === true ? '1' : $this->firstPageLabel; if ($firstPageLabel !== false) { $buttons[] = $this->renderPageButton($firstPageLabel, 0, $this->firstPageCssClass, $currentPage <= 0, false); } // prev page if ($this->prevPageLabel !== false) { if (($page = $currentPage - 1) < 0) { $page = 0; } $buttons[] = $this->renderPageButton($this->prevPageLabel, $page, $this->prevPageCssClass, $currentPage <= 0, false); } // next page if ($this->nextPageLabel !== false) { if (($page = $currentPage + 1) >= $pageCount - 1) { $page = $pageCount - 1; } $buttons[] = $this->renderPageButton($this->nextPageLabel, $page, $this->nextPageCssClass, $currentPage >= $pageCount - 1, false); } // last page $lastPageLabel = $this->lastPageLabel === true ? $pageCount : $this->lastPageLabel; if ($lastPageLabel !== false) { $buttons[] = $this->renderPageButton($lastPageLabel, $pageCount - 1, $this->lastPageCssClass, $currentPage >= $pageCount - 1, false); } return Html::tag('ul', implode("\n", $buttons), $this->options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function prepareNextPrevButtons() \n\t{\n\t}", "function pb_single_next_prev() {\n\t// Only show on single post pages (not plants)\n\tif( !is_singular('post') ) {\n\t\treturn;\n\t}\n\n\t$previouspost_text = __( 'Older Posts', 'lean-kickstart' );\n\t$nextpost_text = __( 'Newer Posts', 'lean-kickstart' );\n\n\techo '<div class=\"archive-pagination pagination\">';\n\t\tprevious_post_link( '<div class=\"pagination-previous alignleft\">%link</div>', $previouspost_text );\n\t\tnext_post_link( '<div class=\"pagination-next alignright\">%link</div>', $nextpost_text );\n\techo '</div>';\n}", "protected function renderPageNextPrevInput()\n {\n $pageCount = $this->pagination->getPageCount();\n if ($pageCount < 2 && $this->hideOnSinglePage) {\n return '';\n }\n $currentPage = $this->pagination->getPage();\n\n $buttonLeft = [];\n // first page\n $firstPageLabel = $this->firstPageLabel === true ? '1' : $this->firstPageLabel;\n if ($firstPageLabel !== false) {\n $buttonLeft[] = $this->renderButton($firstPageLabel, 0, $this->firstPageCssClass, $currentPage <= 0, false);\n }\n\n // prev page\n if ($this->prevPageLabel !== false) {\n if (($page = $currentPage - 1) < 0) {\n $page = 0;\n }\n $buttonLeft[] = $this->renderButton($this->prevPageLabel, $page, $this->prevPageCssClass, $currentPage <= 0, false);\n }\n $buttonLeft = Html::tag('div', implode('', $buttonLeft), ['class' => 'input-group-btn']);\n \n $content = Html::textInput($this->pagination->pageParam, $currentPage + 1, [\n 'class' => 'form-control',\n 'autocomplete' => 'off'\n ]);\n $content .= Html::submitButton('Submit', $options = ['style' => 'display: none']);\n\n $buttonRight = [];\n // next page\n if ($this->nextPageLabel !== false) {\n if (($page = $currentPage + 1) >= $pageCount - 1) {\n $page = $pageCount - 1;\n }\n $buttonRight[] = $this->renderButton($this->nextPageLabel, $page, $this->nextPageCssClass, $currentPage >= $pageCount - 1, false);\n }\n\n // last page\n $lastPageLabel = $this->lastPageLabel === true ? $pageCount : $this->lastPageLabel;\n if ($lastPageLabel !== false) {\n $buttonRight[] = $this->renderButton($lastPageLabel, $pageCount - 1, $this->lastPageCssClass, $currentPage >= $pageCount - 1, false);\n }\n $buttonRight = Html::tag('div', implode('', $buttonRight), ['class' => 'input-group-btn']);\n\n Html::addCssClass($this->options, 'input-group');\n Html::removeCssClass($this->options, 'pagination');\n Html::addCssClass($this->options, 'margin-t-sm margin-b-sm');\n\n $currentUrl = $this->pagination->getLinks();\n if (isset($currentUrl['self'])) {\n $currentUrl = $currentUrl['self'];\n } else {\n $currentUrl = Yii::$app->request->url;\n }\n\n $html = [];\n $html[] = Html::beginForm($currentUrl, 'get', ['class' => 'pagination-input']);\n $html[] = Html::tag('div', $buttonLeft.$content.$buttonRight, $this->options);\n $html[] = Html::endForm();\n return implode(\"\\n\", $html);\n }", "public function shouldRenderNextButton() {}", "private function prev() {\n if ($this->currentPage > 1) {\n print '<li><a href=\"' . $this->url . '&page=' . ($this->currentPage - 1) . '\">&lt;</a></li>';\n }\n }", "function makeButtons($page){\n\t\tif ($page!= 1){\n\t\techo \"<button><a href='national_parks.php?page=\".($page-1).\"'>Previous</a></button>\";\n\n\t\t}\n\t\t//make a button for all pages matching the different page numbers\n\t\t//the page number should not be hard coded\n\t\tfor($i=1; $i<28; $i+=1){\n\n\t\t\techo \"<button><a href='national_parks.php?page=\".$i.\"'>\".$i.\"</a></button>\";\n\t\t}\n\t\t//if the page number is not equal to 15, then include a \"next\" button\n\t\t//page number should not be hard coded\n\t\tif ($page!=28){\n\t\techo \"<button><a href='national_parks.php?page=\".($page+1).\"'>Next</a></button>\";\n\t\t}\n\t}", "public function generatePagination()\n {\n $this->buffer = [];\n\n if ($this->currentPage != 1) {\n $this->generateLeftButton($this->currentPage);\n } else {\n $this->generateLeftButton($this->currentPage, true);\n }\n\n $this->generatePages();\n\n if ($this->currentPage != self::getPages($this->records, $this->recordsInPage)) {\n $this->generateRightButton($this->currentPage);\n } else {\n $this->generateLeftButton($this->currentPage, true);\n }\n }", "function thb_single_prev_custom_pagination() {\n\t\t$post = get_previous_post();\n\n\t\tif ( $post == '' ) {\n\t\t\treturn;\n\t\t}\n\n\t\techo \"<div class='thb-single-previous-nav-wrapper'>\";\n\t\t\techo \"<a href='\" . get_permalink( $post->ID ) . \"'>\";\n\t\t\t\techo \"<span>\" . __( 'Previous post', 'thb_text_domain' ) . \"</span>\";\n\t\t\t\techo \"<p class='thb-single-nav-title'>\" . thb_text_format( esc_html( $post->post_title ) ) . \"</p>\";\n\t\t\techo \"</a>\";\n\t\techo \"</div>\";\n\t}", "private function next() {\n if ($this->currentPage < $this->totalPage) {\n print '<li><a href=\"' . $this->url . '&page=' . ($this->currentPage + 1) . '\">&gt;</a></li>';\n }\n }", "function generatePrevNextButtonMarkup($buttonType, $buttonText, $buttonJavascriptAndExtraCode, $usersCanSave, $nextPage, $previousPage, $thanksPage) {\n $buttonMarkup = \"\";\n if($buttonType == \"next\") {\n if(!$usersCanSave AND $nextPage==$thanksPage) {\n $buttonJavascriptAndExtraCode = \"disabled=true\";\n }\n $buttonMarkup = \"<input type=button name=next id=next value='\" . $buttonText . \"' $buttonJavascriptAndExtraCode>\\n\";\n } elseif($buttonType == \"prev\") {\n if($previousPage == \"none\") {\n $buttonJavascriptAndExtraCode = \"disabled=true\";\n }\n $buttonMarkup = \"<input type=button name=prev id=prev value='\" . $buttonText . \"' $buttonJavascriptAndExtraCode>\\n\";\n }\n return $buttonMarkup;\n}", "public static function next_prev_item() {\n\t\t\t$cpt = self::get_post_type();\n\t\t\t$tax = ( $cpt === 'post' ) ? 'category' : $cpt . '_cat';\n\t\t\t$prevPost = get_previous_post( true, '', $tax ) ? get_previous_post( true, '', $tax ) : get_previous_post();\n\t\t\t$nextPost = get_next_post( true, '', $tax ) ? get_next_post( true, '', $tax ) : get_next_post();\n\n\t\t\tob_start();\n\t\t\tif ( $prevPost || $nextPost ) { ?>\n\t\t\t\t<ul class=\"next_prev clr\">\n\t\t\t\t\t<?php if( $prevPost ) { ?>\n\t\t\t\t\t\t<li class=\"previous\">\n\t\t\t\t\t\t\t<?php $prevthumbnail = get_the_post_thumbnail( $prevPost->ID, 'thumbnail' ); ?>\n\t\t\t\t\t\t\t<?php previous_post_link( '%link', '<i class=\"fa fa-angle-' . ( self::$is_rtl ? 'right' : 'left' ) . '\"></i><h4><small>' . esc_html( do_shortcode( self::option( 'prev_' . $cpt, self::option( 'prev_post' ) ) ) ) . '</small>%title</h4>' ); ?>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t<?php } if( $nextPost ) { ?>\n\t\t\t\t\t\t<li class=\"next\">\n\t\t\t\t\t\t\t<?php $nextthumbnail = get_the_post_thumbnail( $nextPost->ID, 'thumbnail' ); ?>\n\t\t\t\t\t\t\t<?php next_post_link( '%link', '<h4><small>' . esc_html( do_shortcode( self::option( 'next_' . $cpt, self::option( 'next_post' ) ) ) ) . '</small>%title</h4><i class=\"fa fa-angle-' . ( self::$is_rtl ? 'left' : 'right' ) . '\"></i>' ); ?>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t<?php } \n\n\t\t\t\t\t\t$archive_icon = false; //self::option( 'next_prev_archive_icon' );\n\t\t\t\t\t\tif ( $archive_icon ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<li class=\"cz-next-prev-archive\">\n\t\t\t\t\t\t<a href=\"<?php echo esc_url( get_post_type_archive_link( $cpt ) ); ?>\" title=\"<?php echo ucwords( $cpt ); ?>\"><i class=\"<?php echo esc_attr( $archive_icon ); ?>\"></i></a>\n\t\t\t\t\t</li>\n\t\t\t\t\t<?php \n\t\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</ul>\n\t\t\t<?php \n\t\t\t}\n\n\t\t\treturn ob_get_clean();\n\t\t}", "abstract protected function setPreviousPage();", "function posts_next() \n\t{\n\t return 'class=\"red darken-2 btn z-depth-1\"';\n\t}", "public function genPrevLink()\n\t{\n\t\t$this->pagination['prevLink'] = \"\";\t\n\t\tif($this->page > 1)\n\t\t{\n\t\t\t$page = $this->page-1;\n\t\t\t$item = $this->itemTpl;\n\t\t\t$item = str_replace(array('{pageclass}','{pagelink}', '{pagetext}'),\n\t\t\t\t\t\t\t\tarray('page page_prev',$this->prepend.$page.$this->append, '&lt;'),\n\t\t\t\t\t\t\t\t$item);\n\t\t\t$this->pagination['prevLink'] = $item;\n\t\t}\n\t}", "protected function getNextButton()\n {\n if ( ! $this->paginator->hasMorePages()) {\n return $this->getDisabledLink($this->nextButtonText);\n }\n\n $url = $this->paginator->url($this->paginator->currentPage() + 1);\n\n return $this->getPrevNextPageLinkWrapper($url, $this->nextButtonText, 'next');\n }", "function nextPrev($curpage, $pages) \n { \n $next_prev = \"\"; \n\n if (($curpage-1) <= 0) \n { \n $next_prev .= \"Previous\"; \n } \n else \n { \n $next_prev .= \"<a href=\\\"\".$_SERVER['PHP_SELF'].\"?page=\".($curpage-1).\"\\\" alt=\\\"Halaman sebelumnya ...\\\">Previous</a>\"; \n } \n\n $next_prev .= \" | \"; \n\n if (($curpage+1) > $pages) \n { \n $next_prev .= \"Next\"; \n } \n else \n { \n $next_prev .= \"<a href=\\\"\".$_SERVER['PHP_SELF'].\"?page=\".($curpage+1).\"\\\" alt=\\\"Halaman berikut ...\\\">Next</a>\"; \n } \n\n return $next_prev; \n }", "private function print_previous_page_link() {\n\n\t\t$this->print_anchor(\n\t\t\t$this->get_paged_url( max( 1, $this->current_page - 1 ) ),\n\t\t\t__( 'Go to the previous page', 'multilingual-press' ),\n\t\t\t'prev-page' . $this->disable_first,\n\t\t\t'&lsaquo;'\n\t\t);\n\t}", "protected function getPreviousButton()\n {\n if ($this->paginator->currentPage() <= 1) {\n return $this->getDisabledLink($this->previousButtonText);\n }\n\n $url = $this->paginator->url(\n $this->paginator->currentPage() - 1\n );\n\n return $this->getPrevNextPageLinkWrapper($url, $this->previousButtonText, 'prev');\n }", "protected function createPageButtons() {\n $pageCount = $this->getPageCount();\n if($pageCount>1)\n echo \"<div style='float:left;display:inline-block;margin-right:8px;height:30px;line-height:30px;'>共\".$this->itemCount.\"条</div>\";\n if ($pageCount <= 1)\n return array();\n\n $currentPage = $this->getCurrentPage(false); // currentPage is calculated in getPageRange()\n $buttons = array();\n\n // internal pages\n for ($i = $beginPage; $i <= ($pageCount - 1); ++$i) {\n $class = ($i == $currentPage ? 'active' : 'disabled');\n $pages[] = array('label' => ($i + 1) . \"/\" . $pageCount, 'url' => $this->createPageUrl($i), 'linkOptions' => array('class' => $class));\n };\n\n $this->widget('bootstrap.widgets.TbButtonGroup', array(\n 'size' => 'small',\n 'buttons' => array(\n array('label' => ($currentPage + 1) . \"/\" . $pageCount, 'items' => $pages)\n )));\n // first page\n if ($this->displayFirstAndLast)\n $buttons[] = $this->createPageButton($this->firstPageLabel, 0, 'first', $currentPage <= 0, false);\n\n // prev page\n if (($page = $currentPage - 1) < 0)\n $page = 0;\n\n $buttons[] = $this->createPageButton($this->prevPageLabel, $page, 'previous', $currentPage <= 0, false);\n\n\n\n\n // next page\n if (($page = $currentPage + 1) >= $pageCount - 1)\n $page = $pageCount - 1;\n\n $buttons[] = $this->createPageButton($this->nextPageLabel, $page, 'next', $currentPage >= ($pageCount - 1), false);\n\n // last page\n if ($this->displayFirstAndLast)\n $buttons[] = $this->createPageButton($this->lastPageLabel, $pageCount - 1, 'last', $currentPage >= ($pageCount - 1), false);\n\n\n return $buttons;\n }", "function be_make_prev_next( $output, $id, $size, $permalink, $icon, $text ) {\n\tif( '&laquo; Previous Photo' == $text )\n\t\t$output = '<span class=\"prev\">' . $output . '</span>';\n\t\n\tif( 'Next Photo &raquo;' == $text )\n\t\t$output = '<span class=\"next\">' . $output . '</span>';\n\t\t\n\treturn $output;\n}", "public function render()\n {\n if ($this->hasPages()) {\n return sprintf(\n '<ul class=\"pagination\">%s %s</ul>',\n $this->getPreviousButton(),\n $this->getNextButton()\n );\n }\n\n return '';\n }", "function tinymce_nextpage( $mce_buttons ) {\n\t\t $pos = array_search( 'wp_more', $mce_buttons, true );\n\t\t if ( $pos !== false ) {\n\t\t\t $tmp_buttons = array_slice( $mce_buttons, 0, $pos + 1 );\n\t\t\t $tmp_buttons[] = 'wp_page';\n\t\t\t $mce_buttons = array_merge( $tmp_buttons, array_slice( $mce_buttons, $pos + 1 ) );\n\t\t }\n\t\t return $mce_buttons;\n\t }", "public function list_pages() {\n\t\t$this->print_prev();\n\n\t\tif ($this->current_page+2 >= $this->total_pages-1) {\n\t\t\t$this->pages_right();\n\t\t} else {\n\t\t\t$this->pages_left();\n\t\t}\n\n\t\t$this->print_next();\n\t}", "function renderPrev($tag = '&lt;&lt;') {\r\n\t\tif ($this->total_rows == 0)\r\n\t\t\treturn FALSE;\r\n\t\t\r\n\t\tif ($this->page > 1) {\r\n\t\t\treturn ' <a style=\" float:none;\" href=\"' . $this->php_self . '?page=' . ($this->page - 1) . '' . $this->append . '\">' . $tag . '</a>';\r\n\t\t} else {\r\n\t\t\treturn \" $tag\";\r\n\t\t}\r\n\t}", "protected function renderBackButton() {}", "function honeycomb_paging_nav() {\n\t\tglobal $wp_query;\n\n\t\t$args = array(\n\t\t\t'type' \t => 'list',\n\t\t\t'next_text' => _x( 'Next', 'Next post', 'honeycomb' ),\n\t\t\t'prev_text' => _x( 'Previous', 'Previous post', 'honeycomb' ),\n\t\t\t);\n\n\t\tthe_posts_pagination( $args );\n\t}", "function alith_add_next_page_button( $buttons, $id ){\r\n\t \r\n\t\t/* only add this for content editor */\r\n\t\tif ( 'content' != $id )\r\n\t\t\treturn $buttons;\r\n\t \r\n\t\t/* add next page after more tag button */\r\n\t\tarray_splice( $buttons, 13, 0, 'wp_page' );\r\n\t \r\n\t\treturn $buttons;\r\n\t}", "public function render($previousLabel = '&lt;', $nextLabel = '&gt;', \n $itemClass = 'page-item', $linkClass = 'page-link', $activeClass = 'active')\n {\n \n $html = $this->previousLink($previousLabel, $itemClass, $linkClass, $activeClass);\n \n $useClipping = false;\n \n if ($this->totalPages > $this->renderedItemsMax) {\n \n $useClipping = true;\n }\n \n if ($useClipping === false) {\n \n for ($i = 1; $i <= $this->totalPages; $i++) {\n \n $html.= $this->renderItem($i, $itemClass, $activeClass, $linkClass);\n }\n }\n else {\n \n $html.= $this->renderWithClipping($itemClass, $activeClass, $linkClass);\n }\n \n $html.= $this->nextLink($nextLabel, $itemClass, $linkClass, $activeClass);\n \n echo $html;\n }", "function renderNext($tag = '&gt;&gt;') {\r\n\t\tif ($this->total_rows == 0)\r\n\t\t\treturn FALSE;\r\n\t\t\r\n\t\tif ($this->page < $this->max_pages) {\r\n\t\t\treturn '<a style=\" float:none;\" href=\"' . $this->php_self . '?page=' . ($this->page + 1) . '' . $this->append . '\">' . $tag . '</a>';\r\n\t\t} else {\r\n\t\t\treturn $tag;\r\n\t\t}\r\n\t}", "protected function compileButtons($data)\n {\n $btnPrev = $btnNext = '';\n $prev = isset($data['prev_btn']) ? $data['prev_btn'] : null;\n $next = isset($data['next_btn']) ? $data['next_btn'] : null;\n\n if ($prev) {\n if ($prev['type'] == 'default') {\n\n $tabIndex = \\FluentForm\\App\\Helpers\\Helper::getNextTabIndex();\n $tabIndexHtml = '';\n if($tabIndex) {\n $tabIndexHtml = \"tabindex='\".$tabIndex.\"' \";\n }\n $btnPrev = \"<button \".$tabIndexHtml.\" type='button' data-action='prev' class='ff-btn ff-btn-prev ff-btn-secondary'>\" . $prev['text'] . \"</button>\";\n } else {\n $btnPrev = \"<img data-action='prev' class='prev ff-btn-prev ff_pointer' src={$prev['img_url']}>\";\n }\n }\n\n if ($next) {\n\n if ($next['type'] == 'default') {\n $tabIndex = \\FluentForm\\App\\Helpers\\Helper::getNextTabIndex();\n $tabIndexHtml = '';\n if($tabIndex) {\n $tabIndexHtml = \"tabindex='\".$tabIndex.\"' \";\n }\n $btnNext = \"<button \".$tabIndexHtml.\" type='button' data-action='next' class='ff-float-right ff-btn ff-btn-next ff-btn-secondary'>\" . $next['text'] . \"</button>\";\n } else {\n $btnNext = \"<img data-action='next' class='next ff-btn-next ff_pointer' src={$next['img_url']}>\";\n }\n }\n\n return \"<div class='step-nav ff_step_nav_last'>{$btnPrev}{$btnNext}</div>\";\n }" ]
[ "0.7283419", "0.70098835", "0.6921343", "0.6905851", "0.6883602", "0.6816182", "0.66607475", "0.6646632", "0.6599387", "0.6591417", "0.6534241", "0.65254474", "0.6484229", "0.6475509", "0.6452173", "0.64464504", "0.6406807", "0.6354285", "0.6316321", "0.63096076", "0.62908316", "0.62746155", "0.62534565", "0.62085336", "0.62055707", "0.61971134", "0.6195922", "0.61817545", "0.61630076", "0.6145125" ]
0.771509
0
Renders the page buttons with nextinputprev style.
protected function renderPageNextPrevInput() { $pageCount = $this->pagination->getPageCount(); if ($pageCount < 2 && $this->hideOnSinglePage) { return ''; } $currentPage = $this->pagination->getPage(); $buttonLeft = []; // first page $firstPageLabel = $this->firstPageLabel === true ? '1' : $this->firstPageLabel; if ($firstPageLabel !== false) { $buttonLeft[] = $this->renderButton($firstPageLabel, 0, $this->firstPageCssClass, $currentPage <= 0, false); } // prev page if ($this->prevPageLabel !== false) { if (($page = $currentPage - 1) < 0) { $page = 0; } $buttonLeft[] = $this->renderButton($this->prevPageLabel, $page, $this->prevPageCssClass, $currentPage <= 0, false); } $buttonLeft = Html::tag('div', implode('', $buttonLeft), ['class' => 'input-group-btn']); $content = Html::textInput($this->pagination->pageParam, $currentPage + 1, [ 'class' => 'form-control', 'autocomplete' => 'off' ]); $content .= Html::submitButton('Submit', $options = ['style' => 'display: none']); $buttonRight = []; // next page if ($this->nextPageLabel !== false) { if (($page = $currentPage + 1) >= $pageCount - 1) { $page = $pageCount - 1; } $buttonRight[] = $this->renderButton($this->nextPageLabel, $page, $this->nextPageCssClass, $currentPage >= $pageCount - 1, false); } // last page $lastPageLabel = $this->lastPageLabel === true ? $pageCount : $this->lastPageLabel; if ($lastPageLabel !== false) { $buttonRight[] = $this->renderButton($lastPageLabel, $pageCount - 1, $this->lastPageCssClass, $currentPage >= $pageCount - 1, false); } $buttonRight = Html::tag('div', implode('', $buttonRight), ['class' => 'input-group-btn']); Html::addCssClass($this->options, 'input-group'); Html::removeCssClass($this->options, 'pagination'); Html::addCssClass($this->options, 'margin-t-sm margin-b-sm'); $currentUrl = $this->pagination->getLinks(); if (isset($currentUrl['self'])) { $currentUrl = $currentUrl['self']; } else { $currentUrl = Yii::$app->request->url; } $html = []; $html[] = Html::beginForm($currentUrl, 'get', ['class' => 'pagination-input']); $html[] = Html::tag('div', $buttonLeft.$content.$buttonRight, $this->options); $html[] = Html::endForm(); return implode("\n", $html); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function renderPageNextPrev()\n {\n $pageCount = $this->pagination->getPageCount();\n if ($pageCount < 2 && $this->hideOnSinglePage) {\n return '';\n }\n\n $buttons = [];\n $currentPage = $this->pagination->getPage();\n\n // first page\n $firstPageLabel = $this->firstPageLabel === true ? '1' : $this->firstPageLabel;\n if ($firstPageLabel !== false) {\n $buttons[] = $this->renderPageButton($firstPageLabel, 0, $this->firstPageCssClass, $currentPage <= 0, false);\n }\n\n // prev page\n if ($this->prevPageLabel !== false) {\n if (($page = $currentPage - 1) < 0) {\n $page = 0;\n }\n $buttons[] = $this->renderPageButton($this->prevPageLabel, $page, $this->prevPageCssClass, $currentPage <= 0, false);\n }\n\n // next page\n if ($this->nextPageLabel !== false) {\n if (($page = $currentPage + 1) >= $pageCount - 1) {\n $page = $pageCount - 1;\n }\n $buttons[] = $this->renderPageButton($this->nextPageLabel, $page, $this->nextPageCssClass, $currentPage >= $pageCount - 1, false);\n }\n\n // last page\n $lastPageLabel = $this->lastPageLabel === true ? $pageCount : $this->lastPageLabel;\n if ($lastPageLabel !== false) {\n $buttons[] = $this->renderPageButton($lastPageLabel, $pageCount - 1, $this->lastPageCssClass, $currentPage >= $pageCount - 1, false);\n }\n\n return Html::tag('ul', implode(\"\\n\", $buttons), $this->options);\n }", "protected function prepareNextPrevButtons() \n\t{\n\t}", "public function shouldRenderNextButton() {}", "function generatePrevNextButtonMarkup($buttonType, $buttonText, $buttonJavascriptAndExtraCode, $usersCanSave, $nextPage, $previousPage, $thanksPage) {\n $buttonMarkup = \"\";\n if($buttonType == \"next\") {\n if(!$usersCanSave AND $nextPage==$thanksPage) {\n $buttonJavascriptAndExtraCode = \"disabled=true\";\n }\n $buttonMarkup = \"<input type=button name=next id=next value='\" . $buttonText . \"' $buttonJavascriptAndExtraCode>\\n\";\n } elseif($buttonType == \"prev\") {\n if($previousPage == \"none\") {\n $buttonJavascriptAndExtraCode = \"disabled=true\";\n }\n $buttonMarkup = \"<input type=button name=prev id=prev value='\" . $buttonText . \"' $buttonJavascriptAndExtraCode>\\n\";\n }\n return $buttonMarkup;\n}", "function pb_single_next_prev() {\n\t// Only show on single post pages (not plants)\n\tif( !is_singular('post') ) {\n\t\treturn;\n\t}\n\n\t$previouspost_text = __( 'Older Posts', 'lean-kickstart' );\n\t$nextpost_text = __( 'Newer Posts', 'lean-kickstart' );\n\n\techo '<div class=\"archive-pagination pagination\">';\n\t\tprevious_post_link( '<div class=\"pagination-previous alignleft\">%link</div>', $previouspost_text );\n\t\tnext_post_link( '<div class=\"pagination-next alignright\">%link</div>', $nextpost_text );\n\techo '</div>';\n}", "public function generatePagination()\n {\n $this->buffer = [];\n\n if ($this->currentPage != 1) {\n $this->generateLeftButton($this->currentPage);\n } else {\n $this->generateLeftButton($this->currentPage, true);\n }\n\n $this->generatePages();\n\n if ($this->currentPage != self::getPages($this->records, $this->recordsInPage)) {\n $this->generateRightButton($this->currentPage);\n } else {\n $this->generateLeftButton($this->currentPage, true);\n }\n }", "private function next() {\n if ($this->currentPage < $this->totalPage) {\n print '<li><a href=\"' . $this->url . '&page=' . ($this->currentPage + 1) . '\">&gt;</a></li>';\n }\n }", "private function prev() {\n if ($this->currentPage > 1) {\n print '<li><a href=\"' . $this->url . '&page=' . ($this->currentPage - 1) . '\">&lt;</a></li>';\n }\n }", "protected function getNextButton()\n {\n if ( ! $this->paginator->hasMorePages()) {\n return $this->getDisabledLink($this->nextButtonText);\n }\n\n $url = $this->paginator->url($this->paginator->currentPage() + 1);\n\n return $this->getPrevNextPageLinkWrapper($url, $this->nextButtonText, 'next');\n }", "function makeButtons($page){\n\t\tif ($page!= 1){\n\t\techo \"<button><a href='national_parks.php?page=\".($page-1).\"'>Previous</a></button>\";\n\n\t\t}\n\t\t//make a button for all pages matching the different page numbers\n\t\t//the page number should not be hard coded\n\t\tfor($i=1; $i<28; $i+=1){\n\n\t\t\techo \"<button><a href='national_parks.php?page=\".$i.\"'>\".$i.\"</a></button>\";\n\t\t}\n\t\t//if the page number is not equal to 15, then include a \"next\" button\n\t\t//page number should not be hard coded\n\t\tif ($page!=28){\n\t\techo \"<button><a href='national_parks.php?page=\".($page+1).\"'>Next</a></button>\";\n\t\t}\n\t}", "abstract protected function setPreviousPage();", "function be_make_prev_next( $output, $id, $size, $permalink, $icon, $text ) {\n\tif( '&laquo; Previous Photo' == $text )\n\t\t$output = '<span class=\"prev\">' . $output . '</span>';\n\t\n\tif( 'Next Photo &raquo;' == $text )\n\t\t$output = '<span class=\"next\">' . $output . '</span>';\n\t\t\n\treturn $output;\n}", "function posts_next() \n\t{\n\t return 'class=\"red darken-2 btn z-depth-1\"';\n\t}", "public function add_two_step_next_btn() {\n\n\t\t\t$button_title = astra_get_option( 'two-step-checkout-modern-button-text' );\n\t\t\t$button_sub_title = astra_get_option( 'two-step-checkout-modern-button-sub-text' );\n\n\t\t\t$two_step_next_btn_html = '';\n\n\t\t\t$two_step_next_btn_html .= '<div class=\"ast-embed-checkout-form-nav-btns\">';\n\n\t\t\t\t$two_step_next_btn_html .= '<a href=\"#ast-order-wrap\" class=\"button ast-next-button\" >';\n\t\t\t\t\t$two_step_next_btn_html .= '<span class=\"ast-next-button-content\">';\n\n\t\t\tif ( '' != $button_title ) {\n\t\t\t\t\t\t$two_step_next_btn_html .= '<span class=\"ast-next-button-icon-wrap\">';\n\t\t\t\t\t\t\t$two_step_next_btn_html .= '<span class=\"dashicons dashicons-arrow-right-alt\"></span>';\n\t\t\t\t\t\t\t$two_step_next_btn_html .= '<span class=\"ast-button-text\">' . esc_html( $button_title ) . '</span>';\n\t\t\t\t\t\t$two_step_next_btn_html .= '</span>';\n\t\t\t}\n\n\t\t\tif ( '' != $button_sub_title ) {\n\t\t\t\t\t\t$two_step_next_btn_html .= '<span class=\"ast-button-sub-text\">' . esc_html( $button_sub_title ) . '</span>';\n\t\t\t}\n\t\t\t\t\t$two_step_next_btn_html .= '</span>';\n\t\t\t\t$two_step_next_btn_html .= '</a>';\n\n\t\t\t$two_step_next_btn_html .= '</div>';\n\n\t\t\techo $two_step_next_btn_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t}", "function thb_single_prev_custom_pagination() {\n\t\t$post = get_previous_post();\n\n\t\tif ( $post == '' ) {\n\t\t\treturn;\n\t\t}\n\n\t\techo \"<div class='thb-single-previous-nav-wrapper'>\";\n\t\t\techo \"<a href='\" . get_permalink( $post->ID ) . \"'>\";\n\t\t\t\techo \"<span>\" . __( 'Previous post', 'thb_text_domain' ) . \"</span>\";\n\t\t\t\techo \"<p class='thb-single-nav-title'>\" . thb_text_format( esc_html( $post->post_title ) ) . \"</p>\";\n\t\t\techo \"</a>\";\n\t\techo \"</div>\";\n\t}", "function alith_add_next_page_button( $buttons, $id ){\r\n\t \r\n\t\t/* only add this for content editor */\r\n\t\tif ( 'content' != $id )\r\n\t\t\treturn $buttons;\r\n\t \r\n\t\t/* add next page after more tag button */\r\n\t\tarray_splice( $buttons, 13, 0, 'wp_page' );\r\n\t \r\n\t\treturn $buttons;\r\n\t}", "function tinymce_nextpage( $mce_buttons ) {\n\t\t $pos = array_search( 'wp_more', $mce_buttons, true );\n\t\t if ( $pos !== false ) {\n\t\t\t $tmp_buttons = array_slice( $mce_buttons, 0, $pos + 1 );\n\t\t\t $tmp_buttons[] = 'wp_page';\n\t\t\t $mce_buttons = array_merge( $tmp_buttons, array_slice( $mce_buttons, $pos + 1 ) );\n\t\t }\n\t\t return $mce_buttons;\n\t }", "public function genPrevLink()\n\t{\n\t\t$this->pagination['prevLink'] = \"\";\t\n\t\tif($this->page > 1)\n\t\t{\n\t\t\t$page = $this->page-1;\n\t\t\t$item = $this->itemTpl;\n\t\t\t$item = str_replace(array('{pageclass}','{pagelink}', '{pagetext}'),\n\t\t\t\t\t\t\t\tarray('page page_prev',$this->prepend.$page.$this->append, '&lt;'),\n\t\t\t\t\t\t\t\t$item);\n\t\t\t$this->pagination['prevLink'] = $item;\n\t\t}\n\t}", "public static function next_prev_item() {\n\t\t\t$cpt = self::get_post_type();\n\t\t\t$tax = ( $cpt === 'post' ) ? 'category' : $cpt . '_cat';\n\t\t\t$prevPost = get_previous_post( true, '', $tax ) ? get_previous_post( true, '', $tax ) : get_previous_post();\n\t\t\t$nextPost = get_next_post( true, '', $tax ) ? get_next_post( true, '', $tax ) : get_next_post();\n\n\t\t\tob_start();\n\t\t\tif ( $prevPost || $nextPost ) { ?>\n\t\t\t\t<ul class=\"next_prev clr\">\n\t\t\t\t\t<?php if( $prevPost ) { ?>\n\t\t\t\t\t\t<li class=\"previous\">\n\t\t\t\t\t\t\t<?php $prevthumbnail = get_the_post_thumbnail( $prevPost->ID, 'thumbnail' ); ?>\n\t\t\t\t\t\t\t<?php previous_post_link( '%link', '<i class=\"fa fa-angle-' . ( self::$is_rtl ? 'right' : 'left' ) . '\"></i><h4><small>' . esc_html( do_shortcode( self::option( 'prev_' . $cpt, self::option( 'prev_post' ) ) ) ) . '</small>%title</h4>' ); ?>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t<?php } if( $nextPost ) { ?>\n\t\t\t\t\t\t<li class=\"next\">\n\t\t\t\t\t\t\t<?php $nextthumbnail = get_the_post_thumbnail( $nextPost->ID, 'thumbnail' ); ?>\n\t\t\t\t\t\t\t<?php next_post_link( '%link', '<h4><small>' . esc_html( do_shortcode( self::option( 'next_' . $cpt, self::option( 'next_post' ) ) ) ) . '</small>%title</h4><i class=\"fa fa-angle-' . ( self::$is_rtl ? 'left' : 'right' ) . '\"></i>' ); ?>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t<?php } \n\n\t\t\t\t\t\t$archive_icon = false; //self::option( 'next_prev_archive_icon' );\n\t\t\t\t\t\tif ( $archive_icon ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<li class=\"cz-next-prev-archive\">\n\t\t\t\t\t\t<a href=\"<?php echo esc_url( get_post_type_archive_link( $cpt ) ); ?>\" title=\"<?php echo ucwords( $cpt ); ?>\"><i class=\"<?php echo esc_attr( $archive_icon ); ?>\"></i></a>\n\t\t\t\t\t</li>\n\t\t\t\t\t<?php \n\t\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</ul>\n\t\t\t<?php \n\t\t\t}\n\n\t\t\treturn ob_get_clean();\n\t\t}", "function nextPrev($curpage, $pages) \n { \n $next_prev = \"\"; \n\n if (($curpage-1) <= 0) \n { \n $next_prev .= \"Previous\"; \n } \n else \n { \n $next_prev .= \"<a href=\\\"\".$_SERVER['PHP_SELF'].\"?page=\".($curpage-1).\"\\\" alt=\\\"Halaman sebelumnya ...\\\">Previous</a>\"; \n } \n\n $next_prev .= \" | \"; \n\n if (($curpage+1) > $pages) \n { \n $next_prev .= \"Next\"; \n } \n else \n { \n $next_prev .= \"<a href=\\\"\".$_SERVER['PHP_SELF'].\"?page=\".($curpage+1).\"\\\" alt=\\\"Halaman berikut ...\\\">Next</a>\"; \n } \n\n return $next_prev; \n }", "function renderNext($tag = '&gt;&gt;') {\r\n\t\tif ($this->total_rows == 0)\r\n\t\t\treturn FALSE;\r\n\t\t\r\n\t\tif ($this->page < $this->max_pages) {\r\n\t\t\treturn '<a style=\" float:none;\" href=\"' . $this->php_self . '?page=' . ($this->page + 1) . '' . $this->append . '\">' . $tag . '</a>';\r\n\t\t} else {\r\n\t\t\treturn $tag;\r\n\t\t}\r\n\t}", "protected function createPageButtons() {\n $pageCount = $this->getPageCount();\n if($pageCount>1)\n echo \"<div style='float:left;display:inline-block;margin-right:8px;height:30px;line-height:30px;'>共\".$this->itemCount.\"条</div>\";\n if ($pageCount <= 1)\n return array();\n\n $currentPage = $this->getCurrentPage(false); // currentPage is calculated in getPageRange()\n $buttons = array();\n\n // internal pages\n for ($i = $beginPage; $i <= ($pageCount - 1); ++$i) {\n $class = ($i == $currentPage ? 'active' : 'disabled');\n $pages[] = array('label' => ($i + 1) . \"/\" . $pageCount, 'url' => $this->createPageUrl($i), 'linkOptions' => array('class' => $class));\n };\n\n $this->widget('bootstrap.widgets.TbButtonGroup', array(\n 'size' => 'small',\n 'buttons' => array(\n array('label' => ($currentPage + 1) . \"/\" . $pageCount, 'items' => $pages)\n )));\n // first page\n if ($this->displayFirstAndLast)\n $buttons[] = $this->createPageButton($this->firstPageLabel, 0, 'first', $currentPage <= 0, false);\n\n // prev page\n if (($page = $currentPage - 1) < 0)\n $page = 0;\n\n $buttons[] = $this->createPageButton($this->prevPageLabel, $page, 'previous', $currentPage <= 0, false);\n\n\n\n\n // next page\n if (($page = $currentPage + 1) >= $pageCount - 1)\n $page = $pageCount - 1;\n\n $buttons[] = $this->createPageButton($this->nextPageLabel, $page, 'next', $currentPage >= ($pageCount - 1), false);\n\n // last page\n if ($this->displayFirstAndLast)\n $buttons[] = $this->createPageButton($this->lastPageLabel, $pageCount - 1, 'last', $currentPage >= ($pageCount - 1), false);\n\n\n return $buttons;\n }", "protected function getPreviousButton()\n {\n if ($this->paginator->currentPage() <= 1) {\n return $this->getDisabledLink($this->previousButtonText);\n }\n\n $url = $this->paginator->url(\n $this->paginator->currentPage() - 1\n );\n\n return $this->getPrevNextPageLinkWrapper($url, $this->previousButtonText, 'prev');\n }", "protected function compileButtons($data)\n {\n $btnPrev = $btnNext = '';\n $prev = isset($data['prev_btn']) ? $data['prev_btn'] : null;\n $next = isset($data['next_btn']) ? $data['next_btn'] : null;\n\n if ($prev) {\n if ($prev['type'] == 'default') {\n\n $tabIndex = \\FluentForm\\App\\Helpers\\Helper::getNextTabIndex();\n $tabIndexHtml = '';\n if($tabIndex) {\n $tabIndexHtml = \"tabindex='\".$tabIndex.\"' \";\n }\n $btnPrev = \"<button \".$tabIndexHtml.\" type='button' data-action='prev' class='ff-btn ff-btn-prev ff-btn-secondary'>\" . $prev['text'] . \"</button>\";\n } else {\n $btnPrev = \"<img data-action='prev' class='prev ff-btn-prev ff_pointer' src={$prev['img_url']}>\";\n }\n }\n\n if ($next) {\n\n if ($next['type'] == 'default') {\n $tabIndex = \\FluentForm\\App\\Helpers\\Helper::getNextTabIndex();\n $tabIndexHtml = '';\n if($tabIndex) {\n $tabIndexHtml = \"tabindex='\".$tabIndex.\"' \";\n }\n $btnNext = \"<button \".$tabIndexHtml.\" type='button' data-action='next' class='ff-float-right ff-btn ff-btn-next ff-btn-secondary'>\" . $next['text'] . \"</button>\";\n } else {\n $btnNext = \"<img data-action='next' class='next ff-btn-next ff_pointer' src={$next['img_url']}>\";\n }\n }\n\n return \"<div class='step-nav ff_step_nav_last'>{$btnPrev}{$btnNext}</div>\";\n }", "private function print_previous_page_link() {\n\n\t\t$this->print_anchor(\n\t\t\t$this->get_paged_url( max( 1, $this->current_page - 1 ) ),\n\t\t\t__( 'Go to the previous page', 'multilingual-press' ),\n\t\t\t'prev-page' . $this->disable_first,\n\t\t\t'&lsaquo;'\n\t\t);\n\t}", "function renderSubmitButtons() {\n\t\t$output = '';\n\n\t\tif ($this->currentStep < count($this->steps) && count($this->steps) > 1 && $this->showNextButton) {\n\t\t\t$output .= '<input style=\"display:none;\" type=\"submit\" name=\"'.$this->prefixId.'[submitproceed]\" value=\"'.htmlspecialchars($this->LANG->sL($this->localLangLabels['renderSubmitButtons_proceed'])).'\" tabindex=\"1000\" />';\n\t\t\t$output .= '<input type=\"hidden\" name=\"'.$this->prefixId.'[currentstep]\" value=\"'.$this->currentStep.'\" />';\n\t\t}\n\t\tif ($this->showCancelButton) {\n\t\t\t$output .= '<input style=\"float:left;\" type=\"submit\" name=\"'.$this->prefixId.'[submitcancel]\" value=\"'.htmlspecialchars($this->LANG->sL($this->localLangLabels['renderSubmitButtons_cancel'])).'\" tabindex=\"1030\" />';\n\t\t}\n\t\tif ($this->currentStep > 1 && $this->showPreviousButton) {\n\t\t\t$output .= '<input style=\"float:left;\" type=\"submit\" name=\"'.$this->prefixId.'[submitback]\" value=\"'.htmlspecialchars($this->LANG->sL($this->localLangLabels['renderSubmitButtons_back'])).'\" tabindex=\"1020\" />';\n\t\t\t$output .= '<input type=\"hidden\" name=\"'.$this->prefixId.'[currentstep]\" value=\"'.$this->currentStep.'\" />';\n\t\t}\n\t\tif ($this->currentStep == count($this->steps) && $this->showNextButton) {\n\t\t\t$output .= '<input style=\"float:left;\" type=\"submit\" name=\"'.$this->prefixId.'[submitsubmit]\" value=\"'.htmlspecialchars($this->LANG->sL($this->localLangLabels['renderSubmitButtons_submit'])).'\" tabindex=\"1000\" />';\n\t\t}\n\t\tif ($this->currentStep < count($this->steps) && count($this->steps) > 1 && $this->showNextButton) {\n\t\t\t$output .= '<input style=\"float:left;\" type=\"submit\" name=\"'.$this->prefixId.'[submitproceed]\" value=\"'.htmlspecialchars($this->LANG->sL($this->localLangLabels['renderSubmitButtons_proceed'])).'\" tabindex=\"1010\" />';\n\t\t}\n\t\treturn '<div class=\"tx-frontendformslib-submitbuttons\">'.$output.'</div>';\n\t}", "private function add_arrowkeys_code($prev_url, $next_url) {\n global $page;\n\n $page->add_html_header(\"<script type=\\\"text/javascript\\\">\n document.onkeyup=checkKeycode;\n function checkKeycode(e)\n {\n var keycode;\n if(window.event) keycode=window.event.keyCode;\n else if(e) keycode=e.which;\n\n if (e.srcElement.tagName != \\\"INPUT\\\")\n {\n if(keycode==\\\"37\\\") window.location.href='$prev_url' + window.location.hash;\n else if(keycode==\\\"39\\\") window.location.href='$next_url' + window.location.hash;\n }\n }\n </script>\");\n }", "public function render()\n {\n if ($this->hasPages()) {\n return sprintf(\n '<ul class=\"pagination\">%s %s</ul>',\n $this->getPreviousButton(),\n $this->getNextButton()\n );\n }\n\n return '';\n }", "function fc_pagination_prevpage($paged, $max_page, $prevpage) {\n if( $max_page > 1 && $paged > 1 )\n $pagingString = '<li class=\"prev\"><a href=\"'.get_pagenum_link($paged-1). '\">'.$prevpage.'</a></li>';\n return $pagingString;\n}", "protected function renderBackButton() {}" ]
[ "0.73163915", "0.7226982", "0.7066613", "0.6775199", "0.65942085", "0.6593413", "0.65222245", "0.6504612", "0.6480686", "0.64095324", "0.6366717", "0.6280605", "0.62725717", "0.62343156", "0.6203624", "0.6190953", "0.6168313", "0.6167485", "0.6162554", "0.61526114", "0.6082588", "0.6076609", "0.607153", "0.59667796", "0.5949838", "0.5941558", "0.59295905", "0.59221673", "0.59074104", "0.58928186" ]
0.7583145
0
get child order acceptance id(child order id)
public function getChildOrderAcceptanceId() : string { return $this->child_order_acceptance_id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getChildId(): int {\n return $this->child_id;\n }", "public function getRelationChildId();", "public function getOrderid() {\n\t\treturn $this->orderid;\n\t}", "public function getParentPaymentId()\n {\n return $this->getParameter('parentPaymentId');\n }", "public function getOrderID()\n {\n return $this->orderID;\n }", "public function getOrderID()\n {\n return $this->orderID;\n }", "public function getOrderID()\n {\n return $this->orderID;\n }", "public function getOrderID()\n {\n return $this->orderID;\n }", "public function getParentInvoiceId()\n {\n return $this->getParameter('parentInvoiceId');\n }", "public function get_order_id() {\n $order_id = $this->order_id;\n return !!$order_id ? $order_id : 0;\n }", "protected function GetOrderID() {\n\treturn $this->Value('ID_Order');\n }", "public function getOrderId()\n {\n return $this->order_id;\n }", "public function getOrderId()\n {\n return $this->order_id;\n }", "public function getOrderId()\n {\n return $this->order_id;\n }", "public function getOrderId()\n {\n return $this->order_id;\n }", "final protected function parentId() {return $this->r('originalId');}", "public function orderId(): int\n {\n return $this->order->id();\n }", "public function getOrderId()\n {\n return $this->source['order_id'];\n }", "public function getOrderId();", "public function getRelationChildRealId();", "protected function OrderID() {\n\treturn $this->Value('ID_Order');\n }", "public function getParentId(): string;", "public function getTreeId() {}", "function ss_get_parent_id( $child_id ) {\r\n\t$child = get_post( $child_id );\r\n\t$parentId = $child->post_parent;\r\n\treturn $parentId;\r\n}", "public function getParentId()\n {\n return $this->parent_id;\n }", "public function getParentId()\n {\n return $this->parent_id;\n }", "public function getOrderId()\n {\n return $this->getParam('order-id', 'order');\n }", "public function getParent_id() {\n\t\treturn $this->parent_id;\n\t}", "FUNCTION get_parent_id($db) {\n if (strlen(trim($this->customer_id))==0) {\n return \"\";\n }\n $s = \"select a.parent_id from addressbook a where a.customerid='\". $this->customer_id. \"'\";\n $s.= \" and exists (select customerid from addressbook b where b.customerid=a.parent_id and b.active='Y')\";\n\n $db->query($s);\n if ($db->resultCount()>0) {\n $db->fetchRow();\n if ( ! is_null( $db->record['parent_id'] ) ) {\n if ( strlen( trim( $db->record['parent_id'] ) )>0 ) {\n $this->parent_id=trim($db->record['parent_id']);\n }\n }\n }\n $db->clear();\n\t \n }", "public function getConsOrderId()\n {\n return $this->cons_order_id;\n }" ]
[ "0.6455013", "0.62401676", "0.61677635", "0.58969563", "0.58585125", "0.58585125", "0.58585125", "0.58585125", "0.58582723", "0.58426857", "0.5784988", "0.5762883", "0.5762883", "0.5762883", "0.5762883", "0.5720755", "0.56511235", "0.5643895", "0.56437266", "0.56425214", "0.5614447", "0.5595219", "0.558751", "0.5585075", "0.5580029", "0.5580029", "0.55681735", "0.55294365", "0.552775", "0.55196977" ]
0.7808404
0
/ Generator that prints a value from a buffer and then defers to nested_printer
function printer(Buffer $buffer) { while( true ) { // Yield a promise task and wait for the result - this is non-blocking $value = ( yield Util::async($buffer->read()) ); echo "Printer: ", $value, PHP_EOL; // Yield a generator task for nested_printer and wait for it to complete // This is also non-blocking // Since a generator task has no result, we don't need to put it into a variable yield Util::async(nested_printer($buffer)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nested_printer(Buffer $buffer) {\n for( $i = 0; $i < 5; $i++ ) {\n // Yield a promise task and wait for the result - this is non-blocking\n $value = ( yield Util::async($buffer->read()) );\n\n echo \"Nested printer: \", $value, PHP_EOL;\n }\n}", "function tf_print($value, $die = false) {\r\n static $first_time = true;\r\n\r\n if ($first_time) {\r\n ob_start();\r\n ?><style type=\"text/css\">\r\n div.tf_print_r {\r\n max-height: 500px;\r\n overflow-y: scroll;\r\n background: #111;\r\n margin: 10px 30px;\r\n padding: 0;\r\n border: 1px solid #F5F5F5;\r\n position: relative;\r\n z-index: 10;\r\n }\r\n\r\n div.tf_print_r pre {\r\n color: #47EE47;\r\n text-shadow: 1px 1px 0 #000;\r\n font-family: Consolas, monospace;\r\n font-size: 12px;\r\n margin: 0;\r\n padding: 5px;\r\n display: block;\r\n line-height: 16px;\r\n text-align: left;\r\n }\r\n </style><?php\r\n echo str_replace(array(' ', \"\\n\"), '', ob_get_clean());\r\n }\r\n\r\n ?><div class=\"tf_print_r\"><pre><?php print htmlspecialchars(tf_print_r($value, true), null, 'UTF-8'); ?></pre></div><?php\r\n\r\n $first_time = false;\r\n\r\n if ($die) die();\r\n }", "public abstract function printValue($value);", "function print_entry($iterator){\n print($iterator->current());\n return true;\n}", "public function dumpBuffer()\n {/*{{{*/\n $data = $this->_putbackBuffer;\n $colLimit = 15;\n $col = 0;\n $length = count($data);\n for ($i=0; $i < $length; $i++) {\n printf('%02X ', $data[1]);\n if ($col==$colLimit) {\n $col=0;\n print PHP_EOL;\n } else {\n $col++;\n }\n }\n print PHP_EOL;\n }", "function tf_print_r($var, $return = false, $depth = 10) {\r\n if ($return)\r\n return TF_Dumper::dump($var, $depth);\r\n else\r\n echo TF_Dumper::dump($var, $depth);\r\n }", "function yy_r10(){ $this->_retvalue = $this->compiler->compileTag('print_expression',array_merge(array('value'=>$this->yystack[$this->yyidx + -2]->minor),$this->yystack[$this->yyidx + -1]->minor)); }", "function printobj($a, $descr = '') \r\n{\r\n\tob_start();\r\n\tprint '<pre>';\r\n\tif (!empty($descr))\r\n\t{\r\n\t\tprint('<b>' . $descr . '</b>' . \"\\n\");\r\n\t}\r\n\tprint_r($a);\r\n\tprint '</pre>';\r\n\t$str = ob_get_clean();\r\n\tprintNicely($str);\r\n}", "final public function traverseObject(): Generator\n {\n yield from $this->data;\n }", "function print_r2($val){\n echo '<pre>';\n print_r($val);\n echo '</pre>';\n}", "function __toString(){\n\t\tif( $this->is_terminal() ){\n\t\t\treturn parent::__toString();\n\t\t}\n\t\t$src = '';\n\t\tforeach( $this->children as $i => $Child ){\n\t\t\tif( $Child->is_terminal() ){\n\t\t\t\t$s = (string) $Child->value;\n\t\t\t\tswitch( $Child->t ){\n\t\t\t\t// these terminals will may or may not be followed by an identifier\n\t\t\t\t// but always by the next terminal in this node.\n\t\t\t\tcase J_FUNCTION:\n\t\t\t\tcase J_CONTINUE:\n\t\t\t\tcase J_BREAK;\n\t\t\t\t\t$identFollows = isset($this->children[$i+1]) && $this->children[$i+1]->is_symbol(J_IDENTIFIER);\n\t\t\t\t\t$identFollows and $s .= ' ';\n\t\t\t\t\tbreak;\n\t\t\t\t// these terminals will always be followed by an idenfifer\n\t\t\t\tcase J_VAR:\n\t\t\t\t// these terminals are followed by a non terminal;\n\t\t\t\t// adding a space to be on the safe side.\n\t\t\t\tcase J_DO:\n\t\t\t\tcase J_ELSE:\n\t\t\t\tcase J_RETURN:\n\t\t\t\tcase J_CASE:\n\t\t\t\tcase J_THROW:\n\t\t\t\tcase J_NEW:\n\t\t\t\tcase J_DELETE:\n\t\t\t\tcase J_VOID:\n\t\t\t\tcase J_TYPEOF:\n\t\t\t\t\t$s .= ' ';\n\t\t\t\t\tbreak;\n\t\t\t\t// these terminals require a space on either side\n\t\t\t\tcase J_IN:\n\t\t\t\tcase J_INSTANCEOF:\n\t\t\t\t\t$s = ' '.$s.' ';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// recursion into non-terminal\n\t\t\t\t$s = $Child->__toString();\n\t\t\t}\n\t\t\t$src .= $s;\n\t\t}\n\t\treturn $src;\n\t}", "public function yield()\n {\n echo $this;\n $this->text = '';\n $this->length = 0;\n $this->flush();\n\n return $this;\n }", "function print_a($object, $html_format=true)\n{\n print(get_a($object, $html_format));\n}", "function print_r2($val) {\n echo '<pre>';\n print_r($val);\n echo '</pre>';\n}", "static function dump($val) {\n\t\techo '<pre style=\"background-color:#ccc;padding:5px;font-size:14px;line-height:18px;\">';\n\t\t$caller = Debug::caller();\n\t\techo \"<span style=\\\"font-size: 12px;color:#666;\\\">Line $caller[line] of \" . basename($caller['file']) . \":</span>\\n\";\n\t\tif (is_string($val)) print_r(wordwrap($val, 100));\n\t\telse print_r($val);\n\t\techo '</pre>';\n\t}", "function _dumpNode($key,$value,$indent) {\n\t// do some folding here, for blocks\n\tif (strpos($value,\"\\n\") !== false || strpos($value,\": \") !== false || strpos($value,\"- \") !== false) {\n\t\t$value = $this->_doLiteralBlock($value,$indent);\n\t} else {\n\t\t$value = $this->_doFolding($value,$indent);\n\t}\n\n\tif (is_bool($value)) {\n\t\t$value = ($value) ? \"true\" : \"false\";\n\t}\n\n\t$spaces = str_repeat(' ',$indent);\n\n\tif (is_int($key)) {\n\t\t// It's a sequence\n\t\t$string = $spaces.'- '.$value.\"\\n\";\n\t} else {\n\t\t// It's mapped\n\t\t$string = $spaces.$key.': '.$value.\"\\n\";\n\t}\n\treturn $string;\n\t}", "public function glitchDump(): iterable\n {\n $output = [];\n\n foreach (array_merge($this->_values, $this->_changes) as $key => $value) {\n if ($value instanceof IValueContainer) {\n $value = $value->getDumpValue();\n }\n\n if (array_key_exists($key, $this->_changes)) {\n if (!array_key_exists($key, $this->_values)) {\n $key = '+ ' . $key;\n } elseif ($this->_changes[$key] === null) {\n if (isset($this->_values[$key])) {\n $value = $this->_values[$key];\n }\n\n if ($value !== null) {\n $key = '- ' . $key;\n }\n } else {\n $key .= ' *';\n }\n }\n\n yield 'value:' . $key => $value;\n }\n }", "function _doLiteralBlock($value,$indent) {\n\t$exploded = explode(\"\\n\",$value);\n\t$newValue = '|';\n\t$indent += $this->_dumpIndent;\n\t$spaces = str_repeat(' ',$indent);\n\tforeach ($exploded as $line) {\n\t\t$newValue .= \"\\n\" . $spaces . trim($line);\n\t}\n\treturn $newValue;\n\t}", "abstract public function print_item();", "function smarty_modifier_debug_print_var( $var, $depth = 0, $length = 40 )\r\n{\r\n $_replace = array( \"\\n\" => \"<i>\\\\n</i>\", \"\\r\" => \"<i>\\\\r</i>\", \"\\t\" => \"<i>\\\\t</i>\" );\r\n switch ( gettype( $var ) )\r\n {\r\n case \"array\" :\r\n $results = \"<b>Array (\".count( $var ).\")</b>\";\r\n foreach ( $var as $curr_key => $curr_val )\r\n {\r\n $results .= \"<br>\".str_repeat( \"&nbsp;\", $depth * 2 ).\"<b>\".strtr( $curr_key, $_replace ).\"</b> =&gt; \".smarty_modifier_debug_print_var( $curr_val, ++$depth, $length );\r\n $depth--;\r\n }\r\n break;\r\n case \"object\" :\r\n $object_vars = get_object_vars( $var );\r\n $results = \"<b>\".get_class( $var ).\" Object (\".count( $object_vars ).\")</b>\";\r\n foreach ( $object_vars as $curr_key => $curr_val )\r\n {\r\n $results .= \"<br>\".str_repeat( \"&nbsp;\", $depth * 2 ).\"<b> -&gt;\".strtr( $curr_key, $_replace ).\"</b> = \".smarty_modifier_debug_print_var( $curr_val, ++$depth, $length );\r\n $depth--;\r\n }\r\n break;\r\n case \"boolean\" :\r\n case \"NULL\" :\r\n case \"resource\" :\r\n if ( TRUE === $var )\r\n {\r\n $results = \"true\";\r\n }\r\n else if ( FALSE === $var )\r\n {\r\n $results = \"false\";\r\n }\r\n else if ( NULL === $var )\r\n {\r\n $results = \"null\";\r\n }\r\n else\r\n {\r\n $results = htmlspecialchars( ( boolean )$var );\r\n }\r\n $results = \"<i>\".$results.\"</i>\";\r\n break;\r\n case \"integer\" :\r\n case \"float\" :\r\n $results = htmlspecialchars( ( boolean )$var );\r\n break;\r\n case \"string\" :\r\n $results = strtr( $var, $_replace );\r\n if ( $length < strlen( $var ) )\r\n {\r\n $results = substr( $var, 0, $length - 3 ).\"...\";\r\n }\r\n $results = htmlspecialchars( \"\\\"\".$results.\"\\\"\" );\r\n break;\r\n case \"unknown type\" :\r\n default :\r\n do\r\n {\r\n $results = strtr( ( boolean )$var, $_replace );\r\n if ( $length < strlen( $results ) )\r\n {\r\n $results = substr( $results, 0, $length - 3 ).\"...\";\r\n }\r\n $results = htmlspecialchars( $results );\r\n break;\r\n } while ( 1 );\r\n }\r\n return $results;\r\n}", "function printt($node, $i){\n\tif($node == NULL)\n\t\treturn NULL;\n\n\tprintt($node->right, $i+1);\n\n\tfor($x = 0; $x < $i; $x++)\n\t\techo \" \";\n\techo \"[ \".$node->type.\" | \".$node->value.\" ]\\n\";\n\n\tprintt($node->left, $i+1);\n}", "public function glitchDump(): iterable\n {\n if ($this->_parent) {\n yield 'property:*parent' => $this->_parent;\n }\n\n foreach ($this->_sources as $alias => $source) {\n yield 'value:' . $alias => $source->getAdapter();\n }\n }", "public function print();", "public function getPrinter();", "public static function doPrint($ast)\n {\n }", "function smarty_function_randgen_generator_tree($params, &$smarty)\n{\n $tree = $params['tree'];\n $htmltag = '<div class=\"well\"><em class=\"title\">%s</em> : %s';\n $depth = 0;\n $html = '';\n foreach(array_keys($tree['description']) as $key){\n $currentDepth = $tree['depth'][$key];\n $description = nl2br(htmlspecialchars($tree['description'][$key], ENT_QUOTES, 'UTF-8'));\n if($depth == $currentDepth){\n $html .= \"</div>\";\n $html .= sprintf($htmltag, $tree['title'][$key], $description);\n }\n elseif($depth > $currentDepth){\n for($i=0;$i<$depth-$currentDepth;$i++){\n $html .= \"</div>\";\n }\n $html .= sprintf($htmltag, $tree['title'][$key], $description);\n $depth = $currentDepth;\n }\n elseif($depth < $currentDepth){\n $html .= sprintf($htmltag, $tree['title'][$key], $description);\n $depth = $currentDepth;\n }\n }\n for($i=0;$i<$currentDepth;$i++){\n $html .= \"</div>\";\n }\n\n return $html;\n}", "function __pr($o, $depth, $max){\n\n\tif (!is_null($max) && ($depth > $max)) return '-=[limit reached]=-';\n\n\tif (is_a($o, 'Logger'))\n\t\treturn \"[Logger]\";\n\tif (is_bool($o))\n\t\treturn $o ? '[TRUE]' : '[FALSE]';\n\tif (is_a($o, 'Closure'))\n\t\treturn '[Closure]';\n\n\n\t$c = \"array\";\n\tif (is_object($o)){\n\t\t$c = get_class($o);\n\t\t$o = (array)($o);\n\t}\n\n\tif (is_array($o)){\n\t\t$depth++;\n\t\t$indent = '';\n\t\tfor($i=0; $i<$depth; $i++)\n\t\t\t$indent .= \" \";\n\t\t$r = array();\n\t\t$r[] = \"{$c}\\n\";\n\t\tforeach ($o as $k => $v){\n\t\t\t$k = ltrim($k, chr(0)); //casting from array prepends class name and NULL chars to property name. This looks a little better\n\t\t\t$k = str_replace(chr(0), '.', $k);\n\t\t\t$r[] = \"{$indent}[$k] => \" . __pr($v, $depth, $max) . \"\\n\";\n\t\t}\n\t\treturn implode('', $r);\n\t}else\n\t\treturn print_r($o, true);\n}", "function pr($var) {\n\t\t\t\n\t\t\tob_start();\n\t\t\tprint_r($var);\n\t\t\t$content = ob_get_contents();\n\t\t\tob_clean();\n\t\t\t\n\t\t\techo \"<pre>\";\n\t\t\techo htmlentities($content);\n\t\t\techo \"</pre>\";\n\t}", "public function printValue($value)\n {\n print $value;\n }", "function debug_capture_print_r($data)\r\r\n{\r\r\n\tob_start();\r\r\n\tprint_r($data);\r\r\n\t$result = ob_get_contents();\r\r\n\r\r\n\tob_end_clean();\r\r\n\treturn $result;\r\r\n}" ]
[ "0.7435115", "0.5702408", "0.51392883", "0.5002499", "0.4982329", "0.49692708", "0.4891196", "0.4801701", "0.4762736", "0.4757814", "0.4742541", "0.4741078", "0.4727132", "0.47193176", "0.47047517", "0.47045335", "0.47033015", "0.4697297", "0.46915802", "0.46589178", "0.46533397", "0.46397343", "0.46361306", "0.46359524", "0.46359167", "0.46199742", "0.46198493", "0.46189907", "0.4573259", "0.45710778" ]
0.75174695
0
/ Generator that prints 5 values from a buffer
function nested_printer(Buffer $buffer) { for( $i = 0; $i < 5; $i++ ) { // Yield a promise task and wait for the result - this is non-blocking $value = ( yield Util::async($buffer->read()) ); echo "Nested printer: ", $value, PHP_EOL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function printer(Buffer $buffer) {\n while( true ) {\n // Yield a promise task and wait for the result - this is non-blocking\n $value = ( yield Util::async($buffer->read()) );\n\n echo \"Printer: \", $value, PHP_EOL;\n\n // Yield a generator task for nested_printer and wait for it to complete\n // This is also non-blocking\n // Since a generator task has no result, we don't need to put it into a variable\n yield Util::async(nested_printer($buffer));\n }\n}", "public function dumpBuffer()\n {/*{{{*/\n $data = $this->_putbackBuffer;\n $colLimit = 15;\n $col = 0;\n $length = count($data);\n for ($i=0; $i < $length; $i++) {\n printf('%02X ', $data[1]);\n if ($col==$colLimit) {\n $col=0;\n print PHP_EOL;\n } else {\n $col++;\n }\n }\n print PHP_EOL;\n }", "public function generator() {}", "public function generator();", "public function getOutputBuffer()\n {\n }", "public function getBuffer($atOffset = true) {}", "public function testBufferPartial(): void\n {\n $items = new ArrayObject([1, 2, 3]);\n $iterator = new BufferedIterator($items);\n foreach ($iterator as $key => $value) {\n if ($key == 1) {\n break;\n }\n }\n $result = [];\n foreach ($iterator as $value) {\n $result[] = $value;\n }\n $this->assertEquals([1, 2, 3], $result);\n }", "protected function queueMessages()\n {\n $pages = $users = $files = $sites = 0;\n\n foreach ($this->pagesToQueue() as $id) {\n yield \"P{$id}\";\n $pages++;\n }\n foreach ($this->pagesToRemove() as $id) {\n yield \"RP{$id}\";\n $pages++;\n }\n foreach ($this->usersToRemove() as $id) {\n yield \"RU{$id}\";\n $users++;\n }\n foreach ($this->filesToRemove() as $id) {\n yield \"RF{$id}\";\n $files++;\n }\n foreach ($this->sitesToRemove() as $id) {\n yield \"RS{$id}\";\n $sites++;\n }\n\n yield 'R' . json_encode([$pages, $users, $files, $sites]);\n }", "public function getBuffer($atOffset = true);", "function take($n, $stream) {\n foreach ($stream as $x) {\n if ($n-- === 0) {\n break;\n }\n yield $x;\n }\n}", "public function next() {}", "public function next() {}", "public function next() {}", "public function next() {}", "public function next() {}", "public function next() {}", "public function next() {}", "public function next() {}", "public function buffered();", "public function next();", "public function next();", "public function next();", "public function next();", "function src_tarpit() {\n\t$h = fopen('/dev/random', 'rb');\n\n\t$len = 8192;\n\t$sleep = 5;\n\t$max_time = 60 * 5;\n\n\t$wait = 0;\n\n\twhile ($wait < $max_time) {\n\t\t$contents = fread($h, $len);\n\t\techo $contents;\n\t\tflush();\n\t\tsleep($sleep);\n\t\t$wait += $sleep;\n\t}\n}", "public function getBuffer() {}", "public function pluckNext();", "function gen() {\n yield from $i => $a;\n}", "function openal_buffer_data($buffer, $format, $data, $freq)\n{\n}", "function randombytes_buf($length)\n {\n return '';\n }", "function generate($array) {\n $result = \"\";\n ob_start();\n if(sizeof($array)) {\n $i = 0;\n foreach($array as $string) {\n $i++;\n echo \"<span style='background-color: \".$this->colors[\"seq\"].\"; border-right: 1px solid #949494;'>\".$i.\".&nbsp;</span>&nbsp;\";\n echo $string.\"<br/>\\r\\n\";\n }\n }\n $result = ob_get_contents();\n ob_end_clean();\n return $result;\n }" ]
[ "0.6155572", "0.5930691", "0.53503", "0.5265339", "0.52239656", "0.52038974", "0.51488817", "0.51417655", "0.5141173", "0.5111745", "0.500188", "0.500188", "0.500188", "0.500188", "0.500188", "0.500188", "0.500188", "0.500188", "0.5000217", "0.49935898", "0.49935898", "0.49935898", "0.49935898", "0.49877915", "0.49868718", "0.49837193", "0.4971288", "0.4963081", "0.49554956", "0.49441904" ]
0.65283096
0
The name of the reference associated with this reference bound. string reference_name = 1;
public function getReferenceName() { return $this->reference_name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getReference():string\n {\n return $reference;\n }", "public function setReferenceName($var)\n {\n GPBUtil::checkString($var, True);\n $this->reference_name = $var;\n }", "public function getReference()\r\n {\r\n return $this->reference;\r\n }", "public function getReference() {\n return $this->reference;\n }", "public function get_reference() {\n return $this->reference;\n }", "public static function verify_reference_name($reference)\n {\n }", "public function getReference()\n {\n return $this->reference;\n }", "public function getReference()\n {\n return $this->reference;\n }", "public function getReference()\n {\n return $this->reference;\n }", "public function getReference()\n {\n return $this->reference;\n }", "public function getReference(){\n return $this->reference;\n }", "function getReference() {\n return $this->reference;\n }", "public function getReference() {\n\t\treturn $this->ref;\n\t}", "function &name( )\n {\n return $this->Name;\n }", "public function getRouteKeyName() {\n\t\t\t\n\t\t\treturn 'reference';\n\t\t}", "public function getReferenceTitle()\n {\n return $this->referenceTitle;\n }", "public function getOurReference(): string;", "public function getReferenceNumber()\n\t{\n\t return $this->referenceNumber;\n\t}", "public function getReferenceNum()\n {\n return $this->referenceNum;\n }", "public function getReferenceKey()\n\t{\n\t\treturn $this->reference_id;\n\t}", "public function getReferenceIdentifier();", "public function getReferenceNumber()\n {\n return $this->referenceNumber;\n }", "public function getReferenceType()\n\t{\n\t\treturn $this->reference_type;\n\t}", "public function getReferenceUuid()\n\t{\n\t\treturn $this->reference_uuid;\n\t}", "public function getRef()\n {\n return $this->ref;\n }", "public function getRef()\n {\n return $this->_ref;\n }", "protected function _getReferenceField($name) {\r\n \treturn $this->_referenceMap[$name]['field'];\r\n }", "public function getReferenceType()\n {\n return $this->referenceType;\n }", "public function getRef() {\n return $ref;\n }", "public function getReferenceFor($module_name)\n {\n return $this->getAttribute(sprintf(self::$reference_key,$module_name));\n }" ]
[ "0.70987874", "0.70718575", "0.66805595", "0.6676242", "0.66630894", "0.66611767", "0.66226333", "0.66226333", "0.66226333", "0.66226333", "0.6580578", "0.6572369", "0.6526229", "0.6472721", "0.63961315", "0.63623583", "0.63171136", "0.62633324", "0.62441814", "0.6238631", "0.6225651", "0.6175029", "0.6124159", "0.61041445", "0.60966754", "0.6091432", "0.6090264", "0.6076542", "0.607482", "0.6046505" ]
0.8294203
0
An upper bound (inclusive) on the starting coordinate of any variant in the reference sequence. int64 upper_bound = 2;
public function getUpperBound() { return $this->upper_bound; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setUpperBound($var)\n {\n GPBUtil::checkInt64($var);\n $this->upper_bound = $var;\n }", "public function forceIntegerInRangeForcesIntegerIntoDefaultBoundariesDataProvider() {}", "public function range($start = NULL, $length = NULL);", "static function getRange()\n {\n return static::$range;\n }", "public function getRange() {\n\n }", "public static function invalidRectangleBoundCoordinates()\n {\n return new static('A rectangle bound must have a south west & a north east coordinate.');\n }", "public function getRange(): string;", "public function getRangeUnit(): string;", "public function getRange()\n {\n return $this->range;\n }", "public function getRange()\n {\n return $this->range;\n }", "public function getRange() \n {\n \n return $this->_range;\n \n }", "public function getBounds();", "protected function _getRanges() {}", "function exibeAtualMax(){\n $nmin= (($this->atual * $this->numpage) - $this->numpage)+1;\n return $nmax= ($this->numpage + $nmin)-1;\n }", "public function getLowerBounds()\n {\n return $this->lower_bounds;\n }", "function getLastEdgeMaxRange($side1, $side2)\r\n{\r\n \r\n if ((!is_int($side1) || !is_int($side2)) || ($side1 <= 0 || $side2 <= 0)) {\r\n return \"Invalid sides, sides must be integer greater than 0, Try Again\";\r\n }\r\n\r\n // Get max length of triangle egd\r\n $result = $side1 + $side2 - 1;\r\n\r\n return $result;\r\n}", "function fiftyone_degrees_get_range($target) {\n $ranges = array(10000, 1000, 100, 10, 0);\n $upper = 32768;\n foreach ($ranges as $lower) {\n if ($target >= $lower && $target < $upper)\n return array('lower' => $lower, 'upper' => $upper);\n $upper = $lower;\n }\n // this should never happen\n die('numerical target out of range.');\n}", "public function getRangeEnd()\n {\n return $this->range_end;\n }", "public function getBound()\n {\n return $this->bound;\n }", "public function getBound()\n {\n return $this->bound;\n }", "function binary_search_helper($a,$lowerBound,$upperBound){\n\tif(($lowerBound +1) >= $upperBound){\n\t\t$h = array();\n\t\tforeach($a as $v){\n\t\t\tif(isset($h[$v])){\n\t\t\t\treturn $v;\n\t\t\t} else {\n\t\t\t\t$h[$v] = 0;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t} else {\n\t\t$lowerHalfCount = 0;\n\t\t// Scan and count up numbers within the range\n\t\t$lowerHalfUpperBound = floor($upperBound/2);\n\t\tforeach($a as $v){\n\t\t\tif( $lowerBound <= $v && $v <= $lowerHalfUpperBound){\n\t\t\t\t$lowerHalfCount++;\n\t\t\t}\n\t\t}\n\n\t\tif($lowerHalfCount > ($lowerHalfUpperBound-$lowerBound+1)) {\n\t\t\t$lower = binary_search_helper($a, $lowerBound, floor(($lowerHalfUpperBound/2)-1));\t\n\t\t\t$upper = binary_search_helper($a, floor($lowerHalfUpperBound/2), $lowerHalfUpperBound);\t\n\t\t\tif(is_int($lower)){\n\t\t\t\treturn $lower;\n\t\t\t}\n\t\t\treturn $upper;\n\t\t} else {\n\t\t\t$lower = binary_search_helper($a, $lowerHalfUpperBound+1, floor(($upperBound+$lowerHalfUpperBound)/2));\t\n\t\t\t$upper = binary_search_helper($a, floor(($upperBound+$lowerHalfUpperBound)/2)+1, $upperBound);\t\t\n\t\t\tif(is_int($lower)){\n\t\t\t\treturn $lower;\n\t\t\t}\n\t\t\treturn $upper;\n\t\t}\n\t}\n}", "public function getBoundaries()\n {\n }", "abstract public function file_bounds($inputfile);", "protected function array_range($lbound, $ubound) {\n\t\t$ret = array();\n\t\tfor ($i = $lbound; $i <= $ubound; $i++) {\n\t\t\t$ret[] = $i;\n\t\t}\n\t\treturn $ret;\n\t}", "function wp_tinycolor_bound01($n, $max)\n {\n }", "public function getRanges(): UnitRangesCollection;", "public function getSearchRange() {}", "function getIntervalLimitsExprs($table, $field, $idx, $isLowerBound)\n{\n\n\n}", "public function getSearchRange() {}", "public function getBounds()\n {\n return $this->bounds;\n }" ]
[ "0.5502518", "0.52890176", "0.5261931", "0.5153627", "0.51217633", "0.5105256", "0.50729406", "0.5048499", "0.5021447", "0.5021447", "0.5015854", "0.49905807", "0.49867767", "0.49745366", "0.49706298", "0.4934414", "0.4927787", "0.49273157", "0.4883369", "0.4883369", "0.48428097", "0.48390254", "0.48336077", "0.4830016", "0.48162857", "0.48023885", "0.48009923", "0.48001754", "0.4797079", "0.4772125" ]
0.58270794
0
An upper bound (inclusive) on the starting coordinate of any variant in the reference sequence. int64 upper_bound = 2;
public function setUpperBound($var) { GPBUtil::checkInt64($var); $this->upper_bound = $var; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUpperBound()\n {\n return $this->upper_bound;\n }", "public function forceIntegerInRangeForcesIntegerIntoDefaultBoundariesDataProvider() {}", "public function range($start = NULL, $length = NULL);", "static function getRange()\n {\n return static::$range;\n }", "public function getRange() {\n\n }", "public static function invalidRectangleBoundCoordinates()\n {\n return new static('A rectangle bound must have a south west & a north east coordinate.');\n }", "public function getRange(): string;", "public function getRangeUnit(): string;", "public function getRange()\n {\n return $this->range;\n }", "public function getRange()\n {\n return $this->range;\n }", "public function getRange() \n {\n \n return $this->_range;\n \n }", "public function getBounds();", "protected function _getRanges() {}", "function exibeAtualMax(){\n $nmin= (($this->atual * $this->numpage) - $this->numpage)+1;\n return $nmax= ($this->numpage + $nmin)-1;\n }", "public function getLowerBounds()\n {\n return $this->lower_bounds;\n }", "function getLastEdgeMaxRange($side1, $side2)\r\n{\r\n \r\n if ((!is_int($side1) || !is_int($side2)) || ($side1 <= 0 || $side2 <= 0)) {\r\n return \"Invalid sides, sides must be integer greater than 0, Try Again\";\r\n }\r\n\r\n // Get max length of triangle egd\r\n $result = $side1 + $side2 - 1;\r\n\r\n return $result;\r\n}", "function fiftyone_degrees_get_range($target) {\n $ranges = array(10000, 1000, 100, 10, 0);\n $upper = 32768;\n foreach ($ranges as $lower) {\n if ($target >= $lower && $target < $upper)\n return array('lower' => $lower, 'upper' => $upper);\n $upper = $lower;\n }\n // this should never happen\n die('numerical target out of range.');\n}", "public function getRangeEnd()\n {\n return $this->range_end;\n }", "public function getBound()\n {\n return $this->bound;\n }", "public function getBound()\n {\n return $this->bound;\n }", "function binary_search_helper($a,$lowerBound,$upperBound){\n\tif(($lowerBound +1) >= $upperBound){\n\t\t$h = array();\n\t\tforeach($a as $v){\n\t\t\tif(isset($h[$v])){\n\t\t\t\treturn $v;\n\t\t\t} else {\n\t\t\t\t$h[$v] = 0;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t} else {\n\t\t$lowerHalfCount = 0;\n\t\t// Scan and count up numbers within the range\n\t\t$lowerHalfUpperBound = floor($upperBound/2);\n\t\tforeach($a as $v){\n\t\t\tif( $lowerBound <= $v && $v <= $lowerHalfUpperBound){\n\t\t\t\t$lowerHalfCount++;\n\t\t\t}\n\t\t}\n\n\t\tif($lowerHalfCount > ($lowerHalfUpperBound-$lowerBound+1)) {\n\t\t\t$lower = binary_search_helper($a, $lowerBound, floor(($lowerHalfUpperBound/2)-1));\t\n\t\t\t$upper = binary_search_helper($a, floor($lowerHalfUpperBound/2), $lowerHalfUpperBound);\t\n\t\t\tif(is_int($lower)){\n\t\t\t\treturn $lower;\n\t\t\t}\n\t\t\treturn $upper;\n\t\t} else {\n\t\t\t$lower = binary_search_helper($a, $lowerHalfUpperBound+1, floor(($upperBound+$lowerHalfUpperBound)/2));\t\n\t\t\t$upper = binary_search_helper($a, floor(($upperBound+$lowerHalfUpperBound)/2)+1, $upperBound);\t\t\n\t\t\tif(is_int($lower)){\n\t\t\t\treturn $lower;\n\t\t\t}\n\t\t\treturn $upper;\n\t\t}\n\t}\n}", "public function getBoundaries()\n {\n }", "abstract public function file_bounds($inputfile);", "protected function array_range($lbound, $ubound) {\n\t\t$ret = array();\n\t\tfor ($i = $lbound; $i <= $ubound; $i++) {\n\t\t\t$ret[] = $i;\n\t\t}\n\t\treturn $ret;\n\t}", "function wp_tinycolor_bound01($n, $max)\n {\n }", "function getIntervalLimitsExprs($table, $field, $idx, $isLowerBound)\n{\n\n\n}", "public function getRanges(): UnitRangesCollection;", "public function getSearchRange() {}", "public function getSearchRange() {}", "public function getBounds()\n {\n return $this->bounds;\n }" ]
[ "0.5822308", "0.52887607", "0.52619773", "0.5153122", "0.51207584", "0.51050055", "0.50722575", "0.50477165", "0.50198513", "0.50198513", "0.5014547", "0.49892938", "0.49864468", "0.49717274", "0.49690765", "0.49324086", "0.4926902", "0.49244407", "0.4881335", "0.4881335", "0.48429167", "0.48377723", "0.48336416", "0.48292485", "0.48150364", "0.48019347", "0.48013848", "0.4800613", "0.4796704", "0.4769953" ]
0.54985106
1
Set a customer for this invoice
public function setCustomer(\Fastbill\Customer\Customer $customer) { $this->customer = $customer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setCustomerId(?string $customerId): void\n {\n $this->customerId['value'] = $customerId;\n }", "public function setCustomerName($customerName);", "public static function set_customer_data( $customer ) {\n\t\t$customer->update_meta_data( 'vat_number', self::$data['vat_number'] );\n\t}", "public function setCustomer( $customer ) {\r\n\t\t$this->_customer = $customer;\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "public function setCustomerName($customer_name){\n $this->customer_name = $customer_name;\n }", "public function setCliente(Customer $cliente)\n {\n $this->customer = $cliente;\n $this->id_cliente = $cliente->id_cliente;\n }", "public function setCustomer(Customer $customer)\n {\n $this->data->customer = $customer;\n\n return $this;\n }", "function setCustomeruuid($customer_uuid)\n {\n $this->customer_uuid = $customer_uuid;\n }", "public function setCustomerID($customer_id)\n {\n $this->_customer_id = $customer_id;\n }", "public function setCustomerID($customer_id)\n {\n $this->_customer_id = $customer_id;\n }", "public function setCustomer($name, $identity, $email = '', $phone = '') {\n\n $this->jsonData['Customer'] = array(\n 'Identity' => $this->validateNumber($identity, 14),\n 'FullName' => $this->validateString($name, 288),\n 'Email' => $this->validateEmail($email),\n 'Phone' => $this->validateNumber($phone, 11)\n );\n }", "function setSpecificCustomers($specificCustomers) {\n\t\t$this->_specificCustomers = $specificCustomers;\n\t}", "public function setCustomer(Customer $customer)\n {\n $this->customer = $customer;\n\n return $this;\n }", "public function setCustomerID($customer_id)\n {\n $this->customer_id = $customer_id;\n }", "public function setCustomer($customer)\n {\n $this->customer = $customer;\n\n return $this;\n }", "public function setCustomerId($customerId)\n {\n $this->_customer = $this->customerRepository->getById($customerId);\n return $this;\n }", "public function setCustomerId($val)\n {\n $this->_propDict[\"customerId\"] = $val;\n return $this;\n }", "public function setCustomerPhone($customer_phone){\n $this->customer_phone = $customer_phone;\n }", "public function __construct(Customers $customer)\n {\n $this->customer = $customer;\n }", "function select_customer() {\n $data = array();\n $customer_id = $this->input->post(\"customer\");\n\n if ($this->Customer->account_number_exists($customer_id)) {\n $customer_id = $this->Customer->customer_id_from_account_number($customer_id);\n }\n\n if ($this->Customer->exists($customer_id)) {\n $this->sale_lib->set_customer($customer_id);\n if ($this->config->item('automatically_email_receipt')) {\n $this->sale_lib->set_email_receipt(1);\n }\n } else {\n $data['error'] = lang('sales_unable_to_add_customer');\n }\n $this->_reload($data);\n }", "public function setCustomerId($id);", "public function setCustomers($val)\n {\n $this->_propDict[\"customers\"] = $val;\n return $this;\n }", "private function setCustomer($customer_id)\n {\n session(['customer_id' => $customer_id]);\n }", "public function setCustomersIdAttribute($value)\n {\n $value = ($value) ? : null;\n $this->attributes['customers_id'] = $value;\n }", "public function setCustomerId($value)\n {\n return $this->set(self::customer_id, $value);\n }", "public function setCustomerEmail($customer_email){\n $this->customer_email = $customer_email;\n }", "public function setCustomerEmail($customerEmail);", "public function setCustomerEmail($customerEmail);", "public function setCustomer(\n \\tabs\\api\\core\\Customer $customer,\n $saveCustomer = true\n ) {\n // Add customer object\n $this->customer = $customer;\n\n if ($saveCustomer && $this->getBookingId() != '') {\n // Add customer via an api request\n $conf = \\tabs\\api\\client\\ApiClient::getApi()->put(\n \"/booking/{$this->getBookingId()}/customer\",\n array('data' => $customer->toJson())\n );\n\n // Throw exception if status or response not valid\n if ($conf && $conf->status != 204) {\n $this->customer = null;\n throw new \\tabs\\api\\client\\ApiException(\n $conf,\n 'Error saving customer onto booking: ' . $conf->body\n );\n }\n }\n \n return $this;\n }", "public function __construct(Customer $customer)\n {\n $this->customer = $customer;\n }" ]
[ "0.7674036", "0.723333", "0.72134084", "0.7084824", "0.7074182", "0.7048333", "0.697668", "0.69535804", "0.6920322", "0.6920322", "0.69131637", "0.6911894", "0.68999577", "0.68772143", "0.6850639", "0.6811967", "0.678991", "0.67788076", "0.67709863", "0.67534626", "0.67436236", "0.672778", "0.6725678", "0.67125", "0.67004204", "0.6655773", "0.6635301", "0.6635301", "0.66102886", "0.660168" ]
0.7861933
0
Get the customer associated with this invoice
public function getCustomer() { if (null === $customer && isset($this['CUSTOMER_ID'])) { $this->customer = \Fastbill\Customer\Finder::findOneById($this['CUSTOMER_ID']); } return $this->customer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function customer()\n {\n return Customer::retrieve($this->customer);\n }", "public function getCustomer()\n {\n $customer = $this->ticketData->getCustomer();\n return $customer;\n }", "public function getCustomer()\n {\n return $this->customer;\n }", "public function getCustomer()\n {\n return $this->customer;\n }", "public function getCustomer()\n {\n return $this->customer;\n }", "public function getCustomer() {\n return $this->customer;\n }", "public function getCustomer()\n {\n return $this->data->customer;\n }", "public function customer(){\n\t\treturn Customers::find($this->customers_id);\n\t}", "public function getCustomer()\n {\n return $this->hasOne(Customer::class, ['id' => 'customer_id'])->inverseOf('orders');\n }", "public function getCustomer()\n {\n return $this->customer instanceof CustomerReferenceBuilder ? $this->customer->build() : $this->customer;\n }", "public function getCustomer()\n {\n return $this->customer instanceof CustomerReferenceBuilder ? $this->customer->build() : $this->customer;\n }", "public function getCustomer()\n {\n return \\tabs\\api\\core\\Customer::create($this->getCusref());\n }", "public function getCustomer() {\r\n return $this->session->getCustomer();\r\n }", "public function getCustomer()\n {\n return $this->hasOne(User::class, ['id' => 'customer_id']);\n }", "public function getCustomer()\n {\n return $this->hasOne(Customer::className(), ['customerId' => 'customerId']);\n }", "public function getCustomer()\n {\n try {\n return $this->currentCustomer->getCustomer();\n } catch (NoSuchEntityException $e) {\n return null;\n }\n }", "protected function getCustomer()\n {\n if($this->isAdmin()) {\n return Mage::getModel('customer/customer')->load(Mage::getSingleton('adminhtml/session_quote')->getCustomerId()); // Get customer from admin panel quote\n } else {\n return Mage::getModel('customer/session')->getCustomer(); // Get customer from frontend quote\n }\n }", "public function getCustomerIdentity()\n {\n return $this->customerIdentity;\n }", "public function getCustomer()\n {\n return $this->hasOne(User::className(), ['id' => 'customer_id']);\n }", "public function getCustomer()\n {\n $customer = new Customer($this->getEmail(),\n $this->getFirstname(),\n $this->getLastname());\n $customer->setId($this->getCustomerId())\n ->setStreet($this->getStreet())\n ->setPostCode($this->getPostcode())\n ->setCity($this->getCity())\n ->setCountry($this->getCountry())\n ->setPhone($this->getPhone())\n ->setLanguage($this->getLanguage());\n\n\n return $customer;\n }", "public function getCustomer();", "public function getCustomerIdentifier()\n {\n return $this->customer_identifier;\n }", "public function customer()\n {\n return $this->hasOne(Customer::class);\n }", "public function customer()\n {\n return $this->hasOne(Customer::class);\n }", "public function getCustomer() {\r\n\t\tif( isset( $this->_customer ) ) {\r\n\t\t\t$customer = $this->_customer;\r\n\t\t}\r\n\t\telseif( $this->_admin ) {\r\n\t\t\t$customer = Mage::getModel('customer/customer')->load( Mage::getSingleton('adminhtml/session_quote')->getCustomerId() );\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$customer = Mage::getSingleton('customer/session')->getCustomer();\r\n\t\t}\r\n\t\t\r\n\t\t$this->setCustomer( $customer );\r\n\t\t\r\n\t\treturn $customer;\r\n\t}", "public function customer()\n {\n return $this->hasOne('App\\Customer', 'customer_id', 'user_id');\n }", "public function getCustomerId() {\n return $this->customerID;\n }", "public function getCustomerId()\n {\n return $this->customer_id;\n }", "public function getCustomerId()\n {\n return $this->customer_id;\n }", "public function findCustomer()\n {\n try {\n return $this->gateway->findCustomer($this->user->paymentProfile)->send()->getData();\n } catch (NotFound $exception) {\n return $this->gateway->findCustomer($this->user->refreshPaymentProfile($this->name))->send()->getData();\n }\n }" ]
[ "0.8141197", "0.81406474", "0.8123528", "0.8123528", "0.8123528", "0.8081658", "0.8063164", "0.79026496", "0.78899884", "0.78215957", "0.78215957", "0.77836555", "0.77378434", "0.764688", "0.7611097", "0.7610246", "0.75516194", "0.75254023", "0.74972785", "0.7411231", "0.7346331", "0.7333908", "0.72565067", "0.72565067", "0.72369397", "0.7232208", "0.71955", "0.71860653", "0.71860653", "0.7171346" ]
0.8325363
0
Returns the total number of documents available for the most recently call to execute_query.
public function get_query_total_count() { // Return the total engine count minus the docs we have determined are bad. return $this->totalenginedocs - $this->skippeddocs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function count()\n {\n return $this->queryResult->getSize();\n }", "function NumQueries() {\n\t\t\treturn $this->querycount;\n\t\t}", "public function getCount()\n {\n if ($this->_queryResult === null) {\n return 0;\n }\n\n return $this->_queryResult->count();\n }", "protected function _queryCount() {\n\t\treturn count($this->_queries());\n\t}", "public function count() {\n\t\t$results = $this->execute();\n\t\treturn $results ? count($results) : 0;\n\t}", "public function queryCount()\n {\n return $this->_QUERYCOUNT;\n }", "public function getNumFound()\n {\n return $this->numberOfFoundDocuments;\n }", "public function getNumTotalQueryResults() : int{\n return $this->numTotalQueryResults;\n }", "public function countAll()\n {\n $totalDocuments = 0;\n\n $result = $this->conn->query($this->builderCache);\n\n if ($result->count()) {\n $totalDocuments = $result->count();\n }\n\n return $totalDocuments;\n }", "public function count()\n\t{\n\t\t$content = $this->resource->get($this->name)->getContent();\n\t\t\n\t\treturn $content['doc_count'];\n\t}", "public function getCount()\n {\n return $this->doQuery(null, false, false)->count();\n }", "public function count() {\n $this->_active_query->fields($this->func()->count());\n $query = $this->query( $this->_active_query->getQuery(), $this->_active_query->getParams() );\n return (int)$query->rowCount();\n }", "public function queryCount() {\n return $this->queryCount;\n }", "public function count()\n {\n $result = new QueryResult($this);\n return $result->count();\n }", "public function count() {\n\t\t$this->checkResultSet();\n\t\treturn $this->indexMax;\n\t}", "public function getNumResultsStored() : int{\n return $this->numResults;\n }", "public function countquery(){ \n\t\treturn $this->query_total; \n\t}", "public static function getTotalDocuments()\n {\n $db = JFactory::getDbo();\n\n $query = $db->getQuery(true);\n\n $query = \"SELECT COUNT(id) FROM #__papiersdefamilles_documents WHERE num_id != ''\";\n\n $result = $db->setQuery($query)->loadResult();\n\n return $result;\n }", "function get_num_queries()\n {\n }", "public function count(): int\n {\n if ($this->numberOfResults === null) {\n $this->initialize();\n if ($this->queryResult !== null) {\n $this->numberOfResults = count($this->queryResult ?? []);\n } else {\n parent::count();\n }\n }\n\n return $this->numberOfResults;\n }", "public function count()\n\t{\n\t\t// Execute query and return count\n\t\t$result = $this->execute();\n\t\treturn ($result !== false) ? count($result) : 0;\n\t}", "final public function getTotalQueryCount() {\n return $this->ticker;\n }", "function get_num_records()\n\t{\n\t\t$this->sql = 'SELECT COUNT(*) FROM ' . $this->table;\n\t\t$this->apply_filters();\n\t\treturn db_getOne($this->sql, $this->use_db);\n\t}", "function getCount()\n{\n if( $this->_count == -1 ){\n global $dbh;\n $SQL = $this->getCountSQL();\n $result = $dbh->getOne($SQL);\n dbErrorCheck($result);\n $this->_count = $result;\n return $result;\n }else{\n return $this->_count;\n }\n}", "public function getNbResults()\n {\n $this->sphinxQL->execute();\n\n $helper = Helper::create($this->sphinxQL->getConnection());\n $meta = $helper->showMeta()->execute()->fetchAllAssoc();\n\n foreach ($meta as $item) {\n if ('total_found' === $item['Variable_name']) {\n return (int) $item['Value'];\n }\n }\n\n return 0;\n }", "public function count(): int\n {\n if ($this->clause('action') !== self::ACTION_READ) {\n return 0;\n }\n\n if (!$this->_result) {\n $this->_execute();\n }\n\n if ($this->_result) {\n /** @psalm-suppress PossiblyInvalidMethodCall, PossiblyUndefinedMethod */\n return (int)$this->_result->total();\n }\n\n return 0;\n }", "public function numDocs()\n {\n return $this->index->numDocs();\n }", "public function getNumQueries()\n {\n return $this->numQueries;\n }", "public function getCount()\n {\n if ($this->currentCount) {\n return $this->currentCount;\n }\n return $this->performOperation(null);\n }", "public function getQueryCount()\n\t{\n\t\treturn $this->query_count;\n\t}" ]
[ "0.72431463", "0.7209811", "0.7175309", "0.7146407", "0.71182436", "0.71078455", "0.707367", "0.7057797", "0.70520294", "0.7045663", "0.7040103", "0.70289415", "0.70262754", "0.7023645", "0.701058", "0.6989436", "0.69712555", "0.696854", "0.687157", "0.68709016", "0.68695116", "0.6855956", "0.6851628", "0.68313473", "0.6792334", "0.67739624", "0.67546934", "0.67518115", "0.6746091", "0.6741808" ]
0.74868333
0
Returns count information for a provided response. Will return 0, 0 for invalid or empty responses.
protected function get_response_counts($response) { $found = 0; $included = 0; if (isset($response->grouped->solr_filegroupingid->ngroups)) { // Get the number of results for file grouped queries. $found = $response->grouped->solr_filegroupingid->ngroups; $included = count($response->grouped->solr_filegroupingid->groups); } else if (isset($response->response->numFound)) { // Get the number of results for standard queries. $found = $response->response->numFound; if ($found > 0 && is_array($response->response->docs)) { $included = count($response->response->docs); } } return array($included, $found); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function yummly_count_callback($response) {\n if($this->has_http_error($response)) {\n return false;\n }\n $body = json_decode($response['body'], true);\n return isset($body['count']) ? intval($body['count']) : false;\n }", "public function getResponseCount()\n\t{\n\t\t$responses = $this->getResponses();\n\n\t\tif ($responses) {\n\t\t\treturn count($responses);\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "public function count(): int\n {\n return count($this->_responses);\n }", "public function odnoklassniki_count_callback($response) {\n if($this->has_http_error($response)) {\n return false;\n }\n\n // Another weird API. Similar to vk, extract the 2nd param from the response:\n // 'ODKL.updateCount('odklcnt0','14198');'\n $matches = array();\n preg_match('/^ODKL\\.updateCount\\(\\'odklcnt0\\',\\'(\\d+)\\'\\);$/i', $response['body'], $matches);\n return isset($matches[1]) ? intval($matches[1]) : false;\n }", "public function google_plus_count_callback($response) {\n if($this->has_http_error($response)) {\n return false;\n }\n $body = json_decode($response['body'], true);\n // special case: do not return false if the count is not set because the api can return without counts\n return isset($body[0]['result']['metadata']['globalCounts']['count']) ? intval($body[0]['result']['metadata']['globalCounts']['count']) : 0;\n }", "public function vk_count_callback($response) {\n if($this->has_http_error($response)) {\n return false;\n }\n\n // This API does not return JSON. Just plain text JS. Example:\n // 'VK.Share.count(0, 3779);'\n // From documentation, need to just grab the 2nd param: http://vk.com/developers.php?oid=-17680044&p=Share\n $matches = array();\n preg_match('/^VK\\.Share\\.count\\(\\d, (\\d+)\\);$/i', $response['body'], $matches);\n return isset($matches[1]) ? intval($matches[1]) : false;\n }", "public function twitter_count_callback($response) {\n if($this->has_http_error($response)) {\n return false;\n }\n $body = json_decode($response['body'], true);\n return isset($body['count']) ? intval($body['count']) : false;\n }", "public function delicious_count_callback($response) {\n if($this->has_http_error($response)) {\n return false;\n }\n $body = json_decode($response['body'], true);\n // special case: do not return false if the count is set because the api can return without total posts\n return isset($body[0]['total_posts']) ? intval($body[0]['total_posts']) : 0;\n }", "public function linkedin_count_callback($response) {\n if($this->has_http_error($response)) {\n return false;\n }\n $body = json_decode($response['body'], true);\n return isset($body['count']) ? intval($body['count']) : false;\n }", "public function stumbleupon_count_callback($response) {\n if($this->has_http_error($response)) {\n return false;\n }\n $body = json_decode($response['body'], true);\n // special case: do not return false if views is not set because the api can return it not set\n return isset($body['result']['views']) ? intval($body['result']['views']) : 0;\n }", "public function getCountForBit($response = array()) {\n if ($response['code'] == 200 && !empty($response['body'])) {\n foreach ($response['body']['values'] as $commit) {\n if (isset($commit['user']) && !empty($commit['user']) && $commit['user']['username'] === $this->contributer) {\n ++self::$finalCount;\n } else if (!isset($commit['user'])) {\n ++self::$finalCount;\n }\n }\n if (isset($response['body']['next']) && $response['body']['next'] != '') {\n $this->getCountForBit($this->makeCurlRequest($response['body']['next'], 'get'));\n }\n return \"Total Number Of Commits by $this->contributer : \" . self::$finalCount . \" \\n\";\n }\n if (self::$finalCount > 0) {\n return \"Total Number Of Commits by $this->contributer: \" . self::$finalCount . \" \\n\";\n }\n if (isset($response['body']['error']['message']) && $response['body']['error']['message'] != '') {\n return $response['body']['error']['message'] . \"\\n\";\n }\n return \"Unable to Find Count !\\n\";\n }", "public function fancy_count_callback($response) {\n if($this->has_http_error($response)) {\n return false;\n }\n\n // Fancy always provides a JS callback like this in the response:\n // '__FIB.collectCount({\"url\": \"http://www.google.com\", \"count\": 26, \"thing_url\": \"http://fancy.com/things/263001623/Google%27s-Jim-Henson-75th-Anniversary-logo\", \"showcount\": 1});'\n // strip out the callback and parse the JSON from there\n $response['body'] = str_replace('__FIB.collectCount(', '', $response['body']);\n $response['body'] = substr($response['body'], 0, strlen($response['body']) - 2);\n\n $body = json_decode($response['body'], true);\n return isset($body['count']) ? intval($body['count']) : false;\n }", "public function reddit_count_callback($response) {\n if($this->has_http_error($response)) {\n return false;\n }\n $body = json_decode($response['body'], true);\n // special case: do not return false if the ups is not set because the api can return it not set\n return isset($body['data']['children'][0]['data']['ups']) ? intval($body['data']['children'][0]['data']['ups']) : 0;\n }", "public function pinterest_count_callback($response) {\n if($this->has_http_error($response)) {\n return false;\n }\n $response['body'] = substr($response['body'], 2, strlen($response['body']) - 3);\n $body = json_decode($response['body'], true);\n return isset($body['count']) ? intval($body['count']) : false;\n }", "public function countResponses() {\n\t\t\n\t\ttry {\n\t\t\t$select = $this->pdo->select(['id'])->count('*', 'num_ids')->from('posts_'.$this->board)->where('thread', '=', $this->tId);\n\t\t\t$stmt = $select->execute();\n\t\t\t$num_responses = $stmt->fetchColumn(1);\n\t\t\t\n\t\t} catch(\\Exception $e) {\n\t\t\t$this->app->error($e);\n\t\t}\n\t\t\n\t\treturn $num_responses;\n\t}", "public function computeCount() {\n if ($str = elis_consumer_http_request($this->url_pattern . '&rows=0', array('Accept' => 'application/json'))) {\n if ($json = json_decode($str)) {\n $this->totalCount = $json->response->numFound;\n }\n }\n return $this->totalCount;\n }", "public function count(): Response\n {\n $count = $this->repository->count();\n return new Response(['count' => $count]);\n }", "public function count()\n {\n return $this->client->count($this->compile())['count'];\n }", "public function count() {\n // response without using iterator_count (which actually consumes \n // our iterator to calculate the size, and we cannot perform a rewind)\n return $this->_replySize;\n }", "public function getCount()\n\t{\n\t\t$res = $this->pdo->queryOneRow('SELECT COUNT(id) AS num FROM xxxinfo');\n\t\treturn ($res === false ? 0 : $res['num']);\n\t}", "public function getStatus($response)\n {\n return (int) $response->getStatusCode();\n }", "public function getCount()\n {\n return $this->data['count'];\n }", "public function getCountForGit($response = array()) {\n if ($response['code'] == 200 && !empty($response['body'])) {\n foreach ($response['body'] as $key => $val) {\n if ($val['author']['login'] === $this->contributer) {\n self::$finalCount += $val['total'];\n }\n }\n return \"Total Number Of Commits by $this->contributer: \" . self::$finalCount . \" \\n\";\n } else if ($response['code'] == 202) {\n return \"GIT is building the result for request . Try after few seconds.\\n\";\n } else {\n if (isset($response['body']['message']) && $response['body']['message'] != '') {\n return $response['body']['message'] . \"\\n\";\n }\n return \"Unable to Find Count !\\n\";\n }\n }", "public function facebook_count_callback($response) {\n if($this->has_http_error($response)) {\n return false;\n }\n $body = json_decode($response['body'], true);\n return isset($body['share']['share_count']) ? intval($body['share']['share_count']) : false;\n }", "public static function getCount(){\n \t$sql = \"SELECT COUNT(*) as count FROM yy_hospital\";\n \t$res = self::getDb()->query($sql)->fetchAll();\n \t$count = $res[0]['count'];\n \treturn $count;\n }", "public function computeCount() {\n $count = 0;\n if (empty($this->httpOptions)) {\n $json = file_get_contents($this->listUrl);\n }\n else {\n $response = drupal_http_request($this->listUrl, $this->httpOptions);\n $json = $response->data;\n }\n if ($json) {\n $data = drupal_json_decode($json);\n if ($data) {\n $count = count($data);\n }\n }\n return $count;\n }", "public function getCount() {\n return $this->get(self::COUNT);\n }", "public function fetchCount()\n {\n $this->prepareCount();\n\n $url = $this->urlbase.$this->urlbranch;\n\n $query = $this->genQuery();\n\n $path = $this->options['Action'].'Result';\n if ($this->mockMode) {\n $xml = $this->fetchMockFile()->$path;\n } else {\n $response = $this->sendRequest($url, ['Post' => $query]);\n\n if (! $this->checkResponse($response)) {\n return false;\n }\n\n $xml = simplexml_load_string($response['body'])->$path;\n }\n\n $this->count = (string) $xml->Count;\n }", "function getCount() {\n $this->putCount();\n //opens countlog.data to read the number of hits\n $datei = fopen(dirname(__FILE__) . DIRECTORY_SEPARATOR .\"countlog.data\", \"r\");\n $count = fgets($datei, 1000);\n fclose($datei);\n return $count;\n }", "public function buffer_count_callback($response) {\n if($this->has_http_error($response)) {\n return false;\n }\n $body = json_decode($response['body'], true);\n return isset($body['shares']) ? intval($body['shares']) : false;\n }" ]
[ "0.77404964", "0.73059255", "0.71634954", "0.71056175", "0.7097843", "0.7087203", "0.7076966", "0.70715576", "0.6980638", "0.6936526", "0.6893497", "0.68162316", "0.6814357", "0.67987025", "0.67770797", "0.6702731", "0.6609876", "0.6567173", "0.65531707", "0.64891845", "0.646726", "0.64573544", "0.64542294", "0.6437075", "0.6402496", "0.6335917", "0.6293235", "0.62313604", "0.6229443", "0.62255144" ]
0.7337817
1
Processes grouped file results into documents, with attached matching files.
protected function grouped_files_process_response($response, $limit = 0) { // If we can't find the grouping, or there are no matches in the grouping, return empty. if (!isset($response->grouped->solr_filegroupingid) || empty($response->grouped->solr_filegroupingid->matches)) { return array(); } $numgranted = 0; $orderedids = array(); $completedocs = array(); $incompletedocs = array(); $highlightingobj = $response->highlighting; // Each group represents a "master document". $groups = $response->grouped->solr_filegroupingid->groups; foreach ($groups as $group) { $groupid = $group->groupValue; $groupdocs = $group->doclist->docs; $firstdoc = reset($groupdocs); if (!$searcharea = $this->get_search_area($firstdoc->areaid)) { // Well, this is a problem. continue; } // Check for access. $access = $searcharea->check_access($firstdoc->itemid); switch ($access) { case \core_search\manager::ACCESS_DELETED: // If deleted from Moodle, delete from index and then continue. $this->delete_by_id($firstdoc->id); // Remove one from our processed and total counters, since we promptly deleted. $this->processeddocs--; $this->totalenginedocs--; continue 2; break; case \core_search\manager::ACCESS_DENIED: // This means we should just skip for the current user. $this->skippeddocs++; continue 2; break; } $numgranted++; $maindoc = false; $fileids = array(); // Seperate the main document and any files returned. foreach ($groupdocs as $groupdoc) { if ($groupdoc->id == $groupid) { $maindoc = $groupdoc; } else if (isset($groupdoc->solr_fileid)) { $fileids[] = $groupdoc->solr_fileid; } } // Store the id of this group, in order, for later merging. $orderedids[] = $groupid; if (!$maindoc) { // We don't have the main doc, store what we know for later building. $incompletedocs[$groupid] = $fileids; } else { if (isset($highlightingobj->$groupid)) { // Merge the highlighting for this doc. $this->merge_highlight_field_values($maindoc, $highlightingobj->$groupid); } $docdata = $this->standarize_solr_obj($maindoc); $doc = $this->to_document($searcharea, $docdata); // Now we need to attach the result files to the doc. foreach ($fileids as $fileid) { $doc->add_stored_file($fileid); } $completedocs[$groupid] = $doc; } if (!empty($limit) && $numgranted >= $limit) { // We have hit the max results, we will just ignore the rest. break; } } $incompletedocs = $this->get_missing_docs($incompletedocs); $out = array(); // Now merge the complete and incomplete documents, in results order. foreach ($orderedids as $docid) { if (isset($completedocs[$docid])) { $out[] = $completedocs[$docid]; } else if (isset($incompletedocs[$docid])) { $out[] = $incompletedocs[$docid]; } } return $out; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getGroupFilesFromDatabase() {\n $db = \\Helper::getDB();\n $db->where('g.groupId', $db->escape($this->getId()));\n $db->join('documents d', 'd.id = g.documentId', 'LEFT');\n $db->join('users u', 'u.id = d.ownerId', 'LEFT');\n $results = $db->get('group_documents g', NULL, 'd.*, u.*, d.id AS fileId, u.id AS userId');\n // Process all files and their owners\n foreach($results as $result) {\n $user = new \\Models\\User($result['userId'], $result['username'], $result['email'], $result['firstName'], $result['lastName'], $result['lastLogin']);\n $file = new \\Models\\File($result['fileId'], $result['type'], $result['title'], $user, $result['creationDate'], $result['modificationDate'], $result['file']);\n $this->addFile($file);\n }\n }", "public function parseFiles()\n {\n $this->files->each(function ($file) {\n $this->store[] = $this->getTree($this->parseFile($file), $file);\n });\n }", "public function perform()\n {\n $docToHtmlPlugin = new DocToHtmlPlugin;\n $fileTable = $this->_db->getTable('File');\n\n $select = $this->_db->select()\n ->from($this->_db->File)\n ->where('mime_type IN (?)', $docToHtmlPlugin->getPdfMimeTypes());\n\n // Iterate all docx file records.\n $pageNumber = 1; $spleen = '';\n while ($files = $fileTable->fetchObjects($select->limitPage($pageNumber, 50)))\n {\n foreach ($files as $file)\n {\n $source_file = FILES_DIR. '/'. $file->getStoragePath();\n \n file_put_contents('/tmp/bleent16', $source_file);\n \n $html = $docToHtmlPlugin->pandoc2Html5($source_file);\n $fragment_filename = $file['original_filename']. '.shtml';\n file_put_contents(DOCTOHTML_FILES_DIR. '/'. $fragment_filename, $html);\n\n/*\n $spleen .= print_r($file, true). PHP_EOL.PHP_EOL.PHP_EOL;\n // Delete any existing PDF text element texts from the file.\n $textElement = $file->getElement(\n PdfTextPlugin::ELEMENT_SET_NAME,\n PdfTextPlugin::ELEMENT_NAME\n );\n $file->deleteElementTextsByElementId(array($textElement->id));\n\n // Extract the PDF text and add it to the file.\n $file->addTextForElement(\n $textElement,\n $pdfTextPlugin->pdfToText(FILES_DIR . '/original/' . $file->filename)\n );\n $file->save();\n*/\n // Prevent memory leaks.\n release_object($file);\n }\n $pageNumber++;\n }\n// file_put_contents('/tmp/bleent10', $spleen);\n }", "protected function processFileTree () {\n\t\t$files = $this->populateFileTree();\n\t\tforeach ($files as $file) {\n\t\t\t$this->processFile($file);\n\t\t}\n\t}", "function processFiles($itemnumber, $aOCRData, $aDirectories, $sLogFile)\r\n{\r\n\t$aResults = array();\r\n\t$htmdirectory = $aDirectories['htm'];\r\n\t//$tifdirectory = $aDirectories['tif'];\r\n\t$ocrdonedirectory = $aDirectories['postocr'];\r\n\t$skippeddirectory = $aDirectories['skipped'];\r\n\t$readydirectory = $aDirectories['ready'];\r\n\r\n\t$tifdirectory = $ocrdonedirectory;\r\n\r\n\t//check if a directory for this itemnumber exists; if not, create it\r\n\t$itemdirectory = $readydirectory . '\\\\' . $itemnumber . '\\\\';\r\n\techo \"itemdir is $itemdirectory <br><br>\\n\";\r\n\r\n\tif (!(@opendir($itemdirectory))) {\r\n\t\ttry {\r\n\t\t\tmkdir($itemdirectory, 0755);\r\n\t\t}\r\n\t\tcatch (Exception $e) {\r\n\t\t\techo 'could not create a directory for this item ' . \"\\n\";\r\n\t\t\t$warning = 'Het systeem kon geen directory maken om de bestanden te plaatsen ' . \"\\n\";\r\n\t\t\t$lfh = fopen($sLogFile, 'a');\r\n\t\t\t$errorline = date(\"Y m d H:m\") . $warning;\r\n\t\t\tfwrite($lfh, $errorline);\r\n\t\t\tfclose($lfh);\r\n\r\n\t\t\t$aResults['error'] = $warning;\r\n\t\t\treturn $aResults;\r\n\t\t}\r\n\t}\r\n\r\n\t//for each page in the item: process htm and tif file\r\n\tforeach ($aOCRData as $sScannumber=>$bOcr) {\r\n\t\t$filenamebase = $itemnumber . sprintf(\"%04d\", $sScannumber);\r\n\r\n //process htm and tif file\r\n\t\tif ($bOcr == '1') {\r\n\t\t\t//update htm and write updated file to Ready\r\n\r\n $htmfile = $htmdirectory . '\\\\' . $filenamebase . '.htm';\r\n\t\t\t$contents = file_get_contents($htmfile);\r\n\t\t\t$markedup = '';\r\n \t\t$endhead = '/<\\/head>/i';\r\n \t\t$newmeta = '<meta name=\"bookid\" content=\"' . $itemnumber . '\">' . \"\\n\" . '</head>';\r\n \t\t$markedup = preg_replace($endhead, $newmeta, $contents);\r\n\r\n\t\t\t$newfile = $itemdirectory. sprintf(\"%04d\", $sScannumber) . '.htm';\r\n\t\t\t//echo 'updating text to ' . $newfile . \"\\n\";\r\n\t\t\t$updateresult = file_put_contents($newfile, $markedup);\r\n\t\t\t//some checking on result?\r\n\r\n\r\n\t\t\t//remove old htm file\r\n\t\t\t//drastic way of removing file, as simple unlink will not always work\r\n\t\t\twhile (is_file($htmfile) == TRUE) {\r\n\t\t\t\tchmod($htmfile, 0666);\r\n\t\t\t\tunlink($htmfile);\r\n\t\t\t}\r\n\r\n\t\t\t//move tif file to Ready\r\n\t\t\t$tiffile = $tifdirectory . '\\\\' . $filenamebase . '.tif';\r\n\t\t\t$destination = $itemdirectory . '\\\\' . $filenamebase . '.tif';\r\n\t\t\t//echo 'move ocred from ' . $tiffile . 'to ' . $destination . \"<br>\\n\";\r\n\t\t\t$result = @rename($tiffile, $destination);\r\n\t\t\t//check on result\r\n\t\t\tif ($result != 1) {\r\n\t\t\t\t$lfh = fopen($sLogFile, 'a');\r\n\t\t\t\t$errorline = date(\"Y m d H:m \") . \" kon niet schrijven naar $destination <br>\\n\";\r\n\t\t\t\tfwrite($lfh, $errorline);\r\n\t\t\t\tfclose($lfh);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse { //no htm, so just move tif file\r\n $tiffile = $skippeddirectory . '\\\\' . $filenamebase . '.tif';\r\n $destination = $itemdirectory . '\\\\' . $filenamebase . '.tif';\r\n $result = 'b';\r\n\r\n //make sure the tif file exists\r\n if (!(file_exists($tiffile))) {\r\n $aResults['message'] = 'Het boek is niet compleet ik mis ' . $filenamebase . '.tif';\r\n\t\t\t$aResults['result'] = '0';\r\n }\r\n else {\r\n\t\t\t$result = @rename($tiffile, $destination);\r\n\t\t\t//echo 'move from ' . $tiffile . ' to ' . $destination . ' - ' . $result . \"<br>\\n\";\r\n\r\n\t\t\t//check on result\r\n\t\t\tif ($result != 1) {\r\n $lfh = fopen($sLogFile, 'a');\r\n $errorline = date(\"Y m d H:m \") . \" kon niet schrijven naar $destination <br> \\n\";\r\n fwrite($lfh, $errorline);\r\n fclose($lfh);\r\n\t\t\t}\r\n }\r\n\t\t}\r\n\t}\r\n\r\n\treturn $aResults;\r\n}", "private function convertFiles(){\n\n\t\t//Create folder in tmp for files\n\t\tmkdir('./tmp/course_files');\n\t\t$sectionCounter = 0;\n\t\n\t\t//Add section to manifest\n\t\tHelper::addIMSSection($this->manifest, $this->currentSectionCounter, $this->identifierCounter, 'Documents');\n\n\t\t$section = $this->manifest->organizations->organization->item->item[$this->currentSectionCounter];\n\t\t\n\t\t//Find all folders and documents\n\t\t$query = \"SELECT document.`path`,document.`filename`,document.`format`,document.`title` FROM document WHERE document.`course_id`=\".$this->course_id.\" ORDER BY path;\";\n\t\t$result = mysqli_query($this->link,$query);\n\t\t\n\t\twhile($data = $result->fetch_assoc())\n\t\t{\n\t\t\t//Find item level\n\t\t\t$level = substr_count($data['path'], '/') - 1;\n\n\t\t\t//If it is a file\n\t\t\tif($data['format']!='.dir')\n\t\t\t{\n\t\t\t\t$s_filename = Helper::sanitizeFilename($data['filename']);\n\t file_put_contents('./tmp/course_files/'.$s_filename, fopen($this->host.'/courses/'.$this->course['code'].'/document'.$data['path'], 'r'));\n\t\t\t\tHelper::addIMSItem($section, $this->manifest, $sectionCounter, $this->identifierCounter, $this->resourceCounter, 'file', $data, $level); \n\t\t\t}\n\t\t\t//If it is a directory\n\t\t\telse if($data['format']=='.dir')\n\t\t\t{\n\t\t\t\tHelper::addIMSLabel($section, $sectionCounter, $this->identifierCounter, $data['filename'], $level);\n\t\t\t}\n\t\t}\n\n\t\t//Proceed to next section\n\t\t$this->currentSectionCounter++;\n\t}", "public function indexCrawledDocuments() {\n\t\tforeach ( $this->aFiles as $sFile ) {\n\t\t\t$oRepoFile = new SplFileInfo( $sFile );\n\t\t\tif ( !$oRepoFile->isFile() ) continue;\n\n\t\t\t$sFileName = $oRepoFile->getFilename();\n\t\t\t$sDocType = $this->mimeDecoding( $oRepoFile->getExtension() );\n\t\t\tif ( !$this->checkDocType( $sDocType, $sFileName ) ) continue;\n\n\t\t\tif ( !$this->oMainControl->bCommandLineMode ) set_time_limit( $this->iTimeLimit );\n\n\t\t\tif ( $this->sizeExceedsMaxDocSize( $oRepoFile->getSize(), $sFileName ) ) continue;\n\n\t\t\t//Insert URL to Filename\n\t\t\t$rURL = BsConfig::get( 'MW::ExtendedSearch::ExternalRepo' );\n\t\t\t$sURL = BsConfig::get( 'MW::ExtendedSearch::ExternalRepoUrl' );\n\t\t\t//Replace realpath with webserver url only if $sUrl is set, otherwise work as before\n\t\t\tif($sURL == \"\"){\n\t\t\t $sRepoFileRealPath = \"file:///\" . $oRepoFile->getRealPath();\n\t\t\t}else{\n\t\t\t $sRepoFileRealPath = $this->getFilePath( $rURL, $sURL, $oRepoFile );\n\t\t\t}\n\n\t\t\t$timestampImage = wfTimestamp( TS_ISO_8601, $oRepoFile->getMTime() );\n\n\t\t\tif ( $this->checkExistence( $oRepoFile->getRealPath(), 'external', $timestampImage, $sFileName ) ) continue;\n\n\t\t\t$text = $this->getFileText( $oRepoFile->getRealPath(), $sFileName );\n\n\t\t\t$doc = $this->makeRepoDocument( $sDocType, utf8_encode( $sFileName ), $text, utf8_encode( $sRepoFileRealPath ), $timestampImage );\n\t\t\t$this->writeLog( $sFileName );\n\n\t\t\twfRunHooks( 'BSExtendedSearchBeforeAddExternalFile', array( $this, $oRepoFile, &$doc ) );\n\n\t\t\tif ( $doc ) {\n\t\t\t\t// mode and ERROR_MSG_KEY are only passed for the case when addsFile fails\n\t\t\t\t$this->oMainControl->addDocument( $doc, $this->mode, self::S_ERROR_MSG_KEY );\n\t\t\t}\n\t\t}\n\t}", "public function indexCrawledDocuments() {\n\t\twhile ( $document = $this->oDbr->fetchObject( $this->documentsDb ) ) {\n\t\t\t$this->count++;\n\t\t\tif ( !$this->oMainControl->bCommandLineMode ) set_time_limit( $this->iTimeLimit );\n\n\t\t\tif ( $this->doesLinkedPathFilterMatch( $document->el_to ) ) continue;\n\n\t\t\t$path = urldecode( $document->el_to );\n\t\t\t$path = str_replace( \"file:///\", \"\", $path );\n\t\t\t$fileInfo = new SplFileInfo( $path );\n\t\t\tif ( !$fileInfo->isFile() ) continue;\n\n\t\t\t$filename = explode( '/', $path );\n\t\t\t$filename = array_pop( $filename );\n\n\t\t\tif ( $this->sizeExceedsMaxDocSize( $fileInfo->getSize(), $filename ) ) continue;\n\n\t\t\t$ext = preg_split( '#[/\\\\.]+#', $path );\n\t\t\t$ext = strtolower( array_pop( $ext ) );\n\t\t\t$docType = $this->mimeDecoding( $ext ); // really needed for file extensions? or is it a relict from mw images (repo)\n\t\t\tif ( !$this->checkDocType( $docType, $filename ) ) continue;\n\n\t\t\t$time = @filemtime( urldecode( $path ) );\n\t\t\t$date = date( \"YmdHis\", $time );\n\n\t\t\tif ( $this->checkExistence( $path, 'external', $date, $filename ) ) continue;\n\n\t\t\t$fileRealPath = $fileInfo->getRealPath();\n\t\t\t$fileText = $this->getFileText( $fileRealPath, $filename );\n\t\t\t$doc = $this->makeLinkedDocument( $docType, $filename, $fileText, $path, $date );\n\t\t\t$this->writeLog( $path );\n\t\t\tif ( $doc ) {\n\t\t\t\t// mode and ERROR_MSG_KEY are only passed for the case when addDocument fails\n\t\t\t\t$this->oMainControl->addDocument( $doc, $this->mode, self::S_ERROR_MSG_KEY );\n\t\t\t}\n\t\t}\n\t}", "private function parseResult()\n {\n $group = $this->getSingleGroup();\n $result = [];\n foreach ($group->getValueGroups() as $valueGroup) {\n $documents = $valueGroup->getDocuments();\n $primary = reset($documents);\n $fields = iterator_to_array($primary);\n $fields['groups'] = $documents;\n $result[] = new Document($fields);\n }\n\n return $result;\n }", "protected function convert_file_results($responsedoc) {\n if (!$docs = $responsedoc->response->docs) {\n return array();\n }\n\n $out = array();\n\n foreach ($docs as $doc) {\n // Copy the bare minimim needed info.\n $result = new \\stdClass();\n $result->id = $doc->id;\n $result->modified = document::import_time_from_engine($doc->modified);\n $result->title = $doc->title;\n $result->solr_fileid = $doc->solr_fileid;\n $result->solr_filecontenthash = $doc->solr_filecontenthash;\n $result->solr_fileindexstatus = $doc->solr_fileindexstatus;\n $out[] = $result;\n }\n\n return $out;\n }", "protected function process_document_files($document) {\n if (!$this->file_indexing_enabled()) {\n return;\n }\n\n // Maximum rows to process at a time.\n $rows = 500;\n\n // Get the attached files.\n $files = $document->get_files();\n\n // If this isn't a new document, we need to check the exiting indexed files.\n if (!$document->get_is_new()) {\n // We do this progressively, so we can handle lots of files cleanly.\n list($numfound, $indexedfiles) = $this->get_indexed_files($document, 0, $rows);\n $count = 0;\n $idstodelete = array();\n\n do {\n // Go through each indexed file. We want to not index any stored and unchanged ones, delete any missing ones.\n foreach ($indexedfiles as $indexedfile) {\n $fileid = $indexedfile->solr_fileid;\n\n if (isset($files[$fileid])) {\n // Check for changes that would mean we need to re-index the file. If so, just leave in $files.\n // Filelib does not guarantee time modified is updated, so we will check important values.\n if ($indexedfile->modified != $files[$fileid]->get_timemodified()) {\n continue;\n }\n if (strcmp($indexedfile->title, $files[$fileid]->get_filename()) !== 0) {\n continue;\n }\n if ($indexedfile->solr_filecontenthash != $files[$fileid]->get_contenthash()) {\n continue;\n }\n if ($indexedfile->solr_fileindexstatus == document::INDEXED_FILE_FALSE &&\n $this->file_is_indexable($files[$fileid])) {\n // This means that the last time we indexed this file, filtering blocked it.\n // Current settings say it is indexable, so we will allow it to be indexed.\n continue;\n }\n\n // If the file is already indexed, we can just remove it from the files array and skip it.\n unset($files[$fileid]);\n } else {\n // This means we have found a file that is no longer attached, so we need to delete from the index.\n // We do it later, since this is progressive, and it could reorder results.\n $idstodelete[] = $indexedfile->id;\n }\n }\n $count += $rows;\n\n if ($count < $numfound) {\n // If we haven't hit the total count yet, fetch the next batch.\n list($numfound, $indexedfiles) = $this->get_indexed_files($document, $count, $rows);\n }\n\n } while ($count < $numfound);\n\n // Delete files that are no longer attached.\n foreach ($idstodelete as $id) {\n // We directly delete the item using the client, as the engine delete_by_id won't work on file docs.\n $this->get_search_client()->deleteById($id);\n }\n }\n\n // Now we can actually index all the remaining files.\n foreach ($files as $file) {\n $this->add_stored_file($document, $file);\n }\n }", "public function gatherFileMetricsFromGroup($group)\n {\n foreach ($group as $file) {\n $name = (string) $file['name'];\n\n // Use simple regex to filter out unwanted filenames\n if (!empty($this->_ignorePaths)) {\n $ignoreRegex = implode('|', $this->_ignorePaths);\n if (preg_match(\"#\" . $ignoreRegex . \"#\", $name)) {\n continue;\n }\n }\n\n // We will pull out covered statements and total statements for\n // each file\n $coveredStatements = (int) $file->metrics['coveredstatements'];\n\n $fileMetric = array(\n 'coveredstatements' => $coveredStatements,\n 'statements' => (int) $file->metrics['statements'],\n );\n\n // Save metrics by filename\n $this->_files[$name] = $fileMetric;\n }\n }", "public function collectInfoFiles()\r\n {\r\n $files_found = $this->findFiles($this->destination_dir, array('md', '1st', 'txt'));\r\n\r\n if($files_found)\r\n $this->file_list = array_merge($this->file_list, $files_found);\r\n }", "private function generateSearchResult()\n {\n $this->outFiles['search_results_interface'] = [\n 'file' => $this->classes['search_results_interface']['file'],\n 'code' => $this->template->getCodeFromTemplate('ddd-cqrs/Api/SearchResultInterface', [\n 'namespace' => $this->classes['search_results_interface']['info']['namespace'],\n 'class' => $this->classes['search_results_interface']['info']['class_name'],\n 'data_interface' => $this->classes['data_interface']['class'],\n ]),\n ];\n\n $this->outFiles['search_results'] = [\n 'file' => $this->classes['search_results']['file'],\n 'code' => $this->template->getCodeFromTemplate('ddd-cqrs/Model/SearchResult', [\n 'namespace' => $this->classes['search_results']['info']['namespace'],\n 'class' => $this->classes['search_results']['info']['class_name'],\n 'interface' => $this->classes['search_results_interface']['class'],\n ]),\n ];\n }", "function filecabinet_document_finished_scan($success, $results, $operations) {\n if ($success) {\n drupal_set_message(t('Successfully scanned @num embedded files', array('@num' => $results['count'])));\n }\n else {\n // an error occurred during batch processing\n $errorop = reset($operations);\n $errfunc = array_shift($errorop);\n $errargs = array_shift($errorop);\n $strargs = implode(', ', $errargs);\n watchdog('filecabinet', \"Error when calling operation '%s'('%s')\", array($errfunc, $strargs));\n drupal_set_message(t('An error occured, which has been recorded in the system log.'));\n }\n}", "private function _extractFiles() \n\t{\n\t\t$entries = $this->getAllTags('entry');\n\t\t$author = null;\n\t\tforeach($entries as $entry) {\n\t\t\t$file = new SBTFile();\n\t\t\t\n\t\t\tforeach ($entry as $item) {\n\t\t\t\tif ($item['tag'] == 'td:uuid') {\n\t\t\t\t\t$file->setFileId($item['value']);\n\t\t\t\t} else if ($item['tag'] == 'td:label') {\n\t\t\t\t\t$file->setLabel($item['value']);\n\t\t\t\t} else if ($item['tag'] == 'td:selfUrl') {\n\t\t\t\t\t$file->setSelfUrl($item['value']);\n\t\t\t\t} else if ($item['tag'] == 'content') {\n\t\t\t\t\t$file->setDownloadUrl($item['attributes']['src']);\n\t\t\t\t} else if ($item['tag'] == 'td:objectTypeName') {\n\t\t\t\t\t$file->setType($item);\n\t\t\t\t} else if ($item['tag'] == 'category') {\n\t\t\t\t\t$file->setCategory($item);\n\t\t\t\t} else if ($item['tag'] == 'td:totalMediaSize') {\n\t\t\t\t\t$file->setSize($item);\n\t\t\t\t} else if ($item['tag'] == 'link') {\n\t\t\t\t\tif (isset($item['attributes']['rel']) && $item['attributes']['rel'] == 'edit-media') {\n\t\t\t\t\t\t$file->setEditMediaLink($item['attributes']['href']);\n\t\t\t\t\t} else if (isset($item['attributes']['href']) && $item['attributes']['rel'] == 'edit') {\n\t\t\t\t\t\t$file->setEditLink($item['attributes']['href']);\n\t\t\t\t\t} else if (isset($item['attributes']['href']) && $item['attributes']['rel'] == 'thumbnail') {\n\t\t\t\t\t\t$file->setThumbnailUrl($item['attributes']['href']);\n\t\t\t\t\t}\n\t\t\t\t} else if ($item['tag'] == 'author') {\n\t\t\t\t\tif ($item['type'] == 'open') {\n\t\t\t\t\t\t$author = array('tag' => 'author');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$file->setAuthor($author);\n\t\t\t\t\t\t$author = null;\n\t\t\t\t\t}\n\t\t\t\t} else if ($author != null) {\n\t\t\t\t\tif ($item['tag'] == 'name') {\n\t\t\t\t\t\t$author['name'] = $item['value'];\n\t\t\t\t\t} else if ($item['tag'] == 'snx:userid') {\n\t\t\t\t\t\t$author['userid'] = $item['value'];\n\t\t\t\t\t} else if ($item['tag'] == 'snx:orgId') {\n\t\t\t\t\t\t$author['orgId'] = $item['value'];\n\t\t\t\t\t} else if ($item['tag'] == 'snx:orgName') {\n\t\t\t\t\t\t$author['orgName'] = $item['value'];\n\t\t\t\t\t} else if ($item['tag'] == 'snx:userState') {\n\t\t\t\t\t\t$author['userState'] = $item['value'];\n\t\t\t\t\t}\n\t\t\t\t} else if ($item['tag'] == 'title') {\n\t\t\t\t\t$file->setTitle($item['value']);\n\t\t\t\t} \n\t\t\t}\n\t\t\tarray_push($this->files, $file);\n\t\t}\n\t}", "public function postImportresults()\n\t{\n\t\t$files = Input::file('file');\n\t\t\n\t\t$settings = [];\n\t\t$inputClass = explode('__', Input::get('inputClass'));\n\t\t$outputClass = explode('__', Input::get('outputClass'));\n\t\t$settings['filename'] = basename($files->getClientOriginalName(), '.csv');\n\t\t\n\t\t// input project\n\t\tif(Input::get('input-project') != \"\") {\n\t\t\t$settings['project'] = Input::get('input-project');\n\t\t} else {\n\t\t\t$settings['project'] = $inputClass[0];\t\t\t\n\t\t}\n\t\t\n\t\t// input type\n\t\tif(Input::get('input-type') != \"\") {\n\t\t\t$settings['documentType'] = Input::get('input-type');\n\t\t} else {\n\t\t\t$settings['documentType'] = $inputClass[1];\n\t\t}\n\t\t\n\t\t// output type\n\t\tif(Input::get('output-type') != \"\") {\n\t\t\t$settings['resultType'] = Input::get('output-type');\n\t\t} else {\n\t\t\t$settings['resultType'] = $outputClass[1];\n\t\t}\n\t\t\n\t\t$settings['domain'] = 'opendomain';\n\t\t$settings['format'] = 'text';\n\n\t\t// process file\n\t\t$importer = new ResultImporter();\n\t\t$status = $importer->process($files, $settings);\n\t\t\n\t\t// flash appropriate message\n\t\tif(!$status['error']) {\n\t\t\tSession::flash('flashSuccess', $status['success']);\n\t\t\tif($status['notice']) {\n\t\t\t\tSession::flash('flashNotice', $status['notice']);\n\t\t\t}\n\t\t} else {\n\t\t\tSession::flash('flashError', $status['error']);\n\t\t}\n\n\t\t$mainSearchFilters = Temp::getMainSearchFiltersCache()['filters'];\n\t\t$projects = ProjectHandler::getUserProjects(Auth::user());\n\t\t$projects = array_column($projects, 'name');\n\t\t\n\t\t$types = $this->userDocTypes();\n\n\t\treturn View::make('media.search.pages.importresults')->with('types', $types[0]);\n\t}", "private function parseContent()\n {\n $results = [];\n $jsonFiles = $this->parseInputFolders();\n \n $finalManifest = $this->getJobManifestTemplate();\n $this->output->writeln(\"<info>\" . static::INFO_OUTPUT_PREFIX . \"Processing JSON directory: {$this->inputPath} </info>\");\n\n foreach ($jsonFiles as $file) {\n if (file_exists($file)) {\n $results[] = $this->convertLearnosityInDirectory($file);\n } else {\n $this->output->writeln(\"<info>\" . static::INFO_OUTPUT_PREFIX . \"Learnosity JSON file \".basename($file). \" Not found in: {$this->inputPath}/items </info>\");\n }\n }\n $resourceInfo = $this->updateJobManifest($finalManifest, $results);\n $finalManifest->setResources($resourceInfo);\n $this->persistResultsFile($results, realpath($this->outputPath) . '/' . $this->rawPath . '/');\n $this->flushJobManifest($finalManifest, $results);\n CopyDirectoreyHelper::copyFiles(realpath($this->inputPath) . '/assets', realpath($this->outputPath) . '/' . $this->rawPath . '/assets');\n $this->createIMSContntPackage(realpath($this->outputPath) . '/' . $this->rawPath . '/');\n }", "public abstract function parse($resultFile);", "public static function organizeFiles(): void\n\t{\n\t\t$files = [];\n\n\t\t// named file set\n\t\tforeach ($_FILES as $name => $info) {\n\t\t\t$files_count = count($info['name']);\n\t\t\t$files[$name] = array_fill(0, $files_count, []);\n\n\t\t\t// file in an info field\n\t\t\tfor ($i = 0; $i < $files_count; $i++) {\n\t\t\t\t// info field\n\t\t\t\tforeach ($info as $key => $values)\n\t\t\t\t\t$files[$name][$i][$key] = $values[$i];\n\t\t\t}\n\t\t}\n\n\t\t// update files\n\t\t$_FILES = $files;\n\t}", "private function _process_files()\n\t{\n\t\t// Tar files are written in 512 byte chunks\n\t\t$blocks = strlen($this->data) / 512 - 1;\n\t\t$this->_offset = 0;\n\n\t\t// While we have blocks to process\n\t\twhile ($this->_offset < $blocks)\n\t\t{\n\t\t\t$this->_read_current_header();\n\n\t\t\t// Blank record? This is probably at the end of the file.\n\t\t\tif (empty($this->_current['filename']))\n\t\t\t{\n\t\t\t\t$this->_offset += 512;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If its a directory, lets make sure it ends in a /\n\t\t\tif ($this->_current['type'] == 5 && substr($this->_current['filename'], -1) !== '/')\n\t\t\t{\n\t\t\t\t$this->_current['filename'] .= '/';\n\t\t\t}\n\n\t\t\t// Figure out what we will do with the data once we have it\n\t\t\t$this->_determine_write_this();\n\n\t\t\t// Read the files data, move the offset to the start of the following 512 block\n\t\t\t$size = ceil($this->_current['size'] / 512);\n\t\t\t$this->_current['data'] = substr($this->data, ++$this->_offset << 9, $this->_current['size']);\n\t\t\t$this->_offset += $size;\n\n\t\t\t// We can write this file or return its data or ...\n\t\t\tif ($this->_write_this && $this->destination !== null)\n\t\t\t{\n\t\t\t\t$this->_write_this_file();\n\n\t\t\t\tif ($this->_skip)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ($this->_found)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (substr($this->_current['filename'], -1) !== '/')\n\t\t\t{\n\t\t\t\t$this->return[] = array(\n\t\t\t\t\t'filename' => $this->_current['filename'],\n\t\t\t\t\t'md5' => md5($this->_current['data']),\n\t\t\t\t\t'preview' => substr($this->_current['data'], 0, 100),\n\t\t\t\t\t'size' => $this->_current['size'],\n\t\t\t\t\t'formatted_size' => byte_format($this->_current['size']),\n\t\t\t\t\t'skipped' => false,\n\t\t\t\t\t'crc' => $this->_crc_check,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "function splitFile($fileLocation){\n// $xmlHeader = array();\n// $dataSetEndTag = \"\";\n //find XML header -> store to header variable\n outputString(\"Grabbing XML schema data.....\\n\");\n if(!empty($xmlHeader=grabXMLHeader($fileLocation))){\n outputString(\"XML schema header found.\\n\");\n }else{\n outputString(\"Could not locate XML schema header, quitting....\\n\");\n }\n //identify XML data set opening tag -> store to variable\n outputString(\"Dataset tag is:\" .$xmlHeader[1].\"\\n\");\n $dataSetTag = $xmlHeader[1];\n $dataSetEndTag = createClosingTag($dataSetTag);\n outputString(\"Dataset closing tag set to: \".$dataSetEndTag.\"\\n\");\n //identify XML item entry tag -> store to variable\n outputString(\"Capturing object entry tag.....\\n\");\n $objectStartTag = grabDataEntryTag($fileLocation,$xmlHeader[sizeof($xmlHeader)-1]);\n outputString(\"Captured object start tag as: \".$objectStartTag.\"\\n\");\n $objectEndTag = createClosingTag($objectStartTag);\n outputString(\"Object closing tag set to: \".$objectEndTag.\"\\n\");\n //count number of items in catalog -> store to variable\n outputString(\"Determining number of target objects.....\\n\");\n $objectsCount = getTagCountInFile($fileLocation,$objectStartTag);\n outputString(\"There are \".$objectsCount.\" objects in the target file\\n\");\n //split file in to X number of files\n outputString(\"Starting file splitting operation.......\\n\");\n buildSubFiles($fileLocation,['objectStartTag'=>$objectStartTag,'objectEndTag'=>$objectEndTag,\n 'objectsPerFile'=>2,'DataSetClosingTag'=>$dataSetEndTag,'XMLHeader'=>$xmlHeader,'numTargetObjects'=>$objectsCount]);\n //copy XML header information to beginning of each file\n //build data set from original (large) file -> place in new file\n //close new file with XML data set closing tag at bottom of file\n //repeat operations until large file is split\n //close original file\n //output error or done message\n}", "public function extract_documents(&$output, $testmode = false) {\n global $CFG, $SITE, $DB;\n\n include_once($CFG->dirroot.'/search/lib.php');\n ini_set('include_path', $CFG->dirroot.DIRECTORY_SEPARATOR.'search'.PATH_SEPARATOR.ini_get('include_path'));\n include_once($CFG->dirroot.'/search/Zend/Search/Lucene.php');\n\n // Set extraction boundaries.\n $toclause = '';\n if (!empty($this->parms->to)) {\n $toclause = \" AND docdate <= {$this->parms->to} \";\n }\n\n $fromclause = '';\n if (!empty($this->parms->from)) {\n $fromclause = \" AND docdate > {$this->parms->from} \";\n }\n\n // Get standard log.\n\n $testclause = '';\n if ($testmode == 'test') {\n $testclause = ' LIMIT 0,30 ';\n }\n\n $sql = \"\n SELECT\n docid,\n doctype,\n itemtype,\n courseid,\n title,\n docdate as time\n FROM\n {\".SEARCH_DATABASE_TABLE.\"}\n WHERE\n doctype NOT LIKE '%label'\n $testclause\n \";\n\n // Put some cache structures.\n\n $COURSECACHE = array();\n\n // Start producing.\n\n if ($testmode == 'test') {\n $output .= htmlentities(\"<documentrecords>\\n\", ENT_QUOTES, 'UTF-8');\n } else {\n $output .= \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" ?>\\n<documentrecords>\\n\";\n }\n\n $rs = $DB->get_recordset_sql($sql);\n if ($rs) {\n $i = 0;\n foreach ($rs as $u) {\n\n // QUALIFIERS.\n\n // Current site.\n $u->host = $SITE->shortname;\n $u->from = $this->parms->from;\n $u->to = $this->parms->to;\n\n // Get module name.\n // WE NEED CMID FROM SOMEWHERE... CHECK !!\n $searchables = search_collect_searchables(false, false);\n $searchable_instance = $searchables[$u->doctype];\n if ($searchable_instance->location == 'internal') {\n include_once(\"{$CFG->dirroot}/search/documents/{$u->doctype}_document.php\");\n } else {\n include_once(\"{$CFG->dirroot}/{$searchable_instance->location}/{$u->doctype}/search_document.php\");\n }\n\n $document_function = \"{$u->doctype}_search_get_objectinfo\";\n\n if (function_exists($document_function)) {\n $moduleinfo = $document_function($u->itemtype, $u->docid);\n }\n\n // Avoid polluting records with missing implementations.\n if (empty($moduleinfo)) {\n if ($testmode == 'test') echo \"skipping $u->itemtype, $u->docid <br/>\";\n continue;\n }\n\n // Get course information.\n if ($u->courseid) {\n if (!array_key_exists($u->courseid, $COURSECACHE)) {\n if (!$course = $DB->get_record('course', array('id' => $u->courseid))) {\n $course->idnumber = '---';\n $course->shortname = get_string('nc', 'localetl_boardz');\n }\n $COURSECACHE[$u->courseid] = $course;\n } else {\n $course = $COURSECACHE[$u->courseid];\n }\n $u->idnumber = ($course->idnumber == '') ? '---' : $course->idnumber;\n $u->shortname = $course->shortname;\n $u->course = $u->idnumber.' :: '.$u->shortname;\n $u->visible = $course->visible;\n } else {\n $u->course = get_string('nc', 'localetl_boardz');\n $u->visible = true;\n }\n\n $u->instance = htmlentities($u->docid.' :: '.format_string($u->title));\n\n boardz_get_upper_categories($u, $course);\n\n boardz_reshape_visible($u);\n\n // Get media and document tech type.\n $u->mediatype = $moduleinfo->mediatype;\n $u->contenttype = $moduleinfo->contenttype;\n\n // INDICATORS.\n\n $itemid = $moduleinfo->instance->id;\n\n // Search count view logs.\n $fetchbacksql = \"\n SELECT\n COUNT(*)\n FROM\n {log}\n WHERE\n `time` > {$u->from} AND\n `time` < {$u->to} AND\n module = '{$u->doctype}' AND\n info = {$itemid} AND\n action LIKE '%view%'\n \";\n\n $u->viewhits = $DB->count_records_sql($fetchbacksql);\n\n // Search count write logs.\n $fetchbacksql = \"\n SELECT\n COUNT(*)\n FROM\n {log}\n WHERE\n `time` > {$u->from} AND\n `time` < {$u->to} AND\n module = '{$u->doctype}' AND\n info = {$itemid} AND\n (action LIKE 'add' OR\n action LIKE 'doadd%' OR\n action LIKE '%update%' OR\n action LIKE '%write%')\n \";\n\n $u->writehits = count_records_sql($fetchbacksql);\n\n // Search count view logs.\n $fetchbacksql = \"\n SELECT\n COUNT(*)\n FROM\n {log}\n WHERE\n `time` > {$u->from} AND\n `time` < {$u->to} AND\n module = '{$u->doctype}' AND\n info = {$itemid}\n \";\n\n $u->totalhits = $DB->count_records_sql($fetchbacksql);\n\n // Final cleanup.\n unset($u->idnumber);\n unset($u->shortname);\n unset($u->docid);\n unset($u->courseid);\n unset($u->title);\n\n if ($testmode == 'test') {\n $output .= htmlentities(recordtoxml($u, $i, 'documentrecord', ''), ENT_QUOTES, 'UTF-8');\n } else {\n $output .= recordtoxml($u, $i, 'documentrecord', '');\n }\n $i++;\n }\n $rs->close();\n\n // Don't forget last record !!\n if ($i > 0) {\n if ($testmode == 'test') {\n $output .= htmlentities(recordtoxml($u, $i, 'documentrecord', ''), ENT_QUOTES, 'UTF-8');\n } else {\n $output .= recordtoxml($u, $i, 'documentrecord', '');\n }\n }\n }\n\n if ($testmode == 'test') {\n $output .= htmlentities(\"\\n</documentrecords>\");\n } else {\n $output .= \"\\n</documentrecords>\";\n }\n\n // Prepare the \"till when\" temporary marker.\n if (!empty($u->time)) {\n $this->lastextract = $u->time;\n } else { // empty extraction\n $this->lastextract = time();\n }\n $this->save_config();\n }", "public function view_results()\n {\n $obj = new CombinedAnalysis();\n $this->final_results = $obj->fetchResultsFromFiles($this->id);\n\n // show everthing in template\n $this->show_template();\n }", "function scan_files( ){\n\n // List of all the audio files found in the directory and sub-directories\n $audioFileArray = array();\n\n // List of filenames already handled during the scan. To detect dupe filenames.\n $alreadyhandledFileArray = array();\n\n // Make list of all files in db to remove non existent files\n $DBaudioFileArray = array();\n foreach ( $this->get_list_of_files()->fetchAll() as $row ) {\n $DBaudioFileArray[] = $row['filename'];\n }\n\n // Prepare variables for file urls\n //$base_dir = dirname(dirname(realpath($this->filedirectorypath))); // Absolute path to your installation, ex: /var/www/mywebsite\n $doc_root = preg_replace(\"!{$_SERVER['SCRIPT_NAME']}$!\", '', $_SERVER['SCRIPT_FILENAME']); # ex: /var/www\n $protocol = empty($_SERVER['HTTPS']) ? 'http' : 'https';\n $port = $_SERVER['SERVER_PORT'];\n $disp_port = ($protocol == 'http' && $port == 80 || $protocol == 'https' && $port == 443) ? '' : \":$port\";\n $domain = $_SERVER['SERVER_NAME'];\n // variables for file urls\n\n // Create recursive dir iterator which skips dot folders\n $dir = new RecursiveDirectoryIterator( $this->filedirectorypath , FilesystemIterator::SKIP_DOTS);\n\n // Flatten the recursive iterator, consider only files, no directories\n $it = new RecursiveIteratorIterator($dir);\n\n // Find all the mp3 files\n foreach ($it as $fileinfo) {\n if ($fileinfo->isFile() && !strcmp($fileinfo->getExtension(), \"mp3\")) {\n $audioFileArray[] = $fileinfo;\n\n //Warning: files with same md5key in different folders will not be inserted into the db.\n //print md5_file($fileinfo) . \"<br />\\n\";\n }\n }\n\n foreach ($audioFileArray as $key => $fileinfo) {\n\n $filename = $fileinfo->getFilename();\n\n //For each file found on disk remove entry from list from DB\n // if any left at the end, they are files that no longer are present on the drive.\n //print \"unsetting: \" . $filename . \"<br>\";\n unset($DBaudioFileArray[array_search($filename,$DBaudioFileArray,true)]);\n\n // check file not in db\n if( !$this->is_file_in_db( $filename ) ) {\n\n //decode filename date if named according to our naming scheme\n $date = $this->decode_filename($filename);\n\n // Build file url based on server path\n $filepath = realpath($fileinfo->getRealPath());\n $base_url = preg_replace(\"!^{$doc_root}!\", '', $filepath); # ex: '' or '/mywebsite'\n $full_url = \"$protocol://{$domain}{$disp_port}{$base_url}\"; # Ex: 'http://example.com', 'https://example.com/mywebsite', etc.\n\n //print $filename . \" - \" . $full_url . \"<br />\\n\";\n\n //insert audiofile in db for first time\n $this->insert_new_file_into_db( $filename, $full_url, $fileinfo->getRealPath(), $fileinfo->getSize(), $date );\n\n $alreadyhandledFileArray[$key] = $filename;\n\n } else {\n // if file in alreadyhandled array, then duplicate named files have been found\n // how to check for duplicate file names?\n // if we're here then the name has already ben added to the db (but maybe during a previous run)\n //we still need to look for the file in the alreadyhandledFileArray\n if( in_array($filename, $alreadyhandledFileArray) ){\n // flag file\n $this->flag_file($filename, \"Il y a 2 ou plusieurs fichiers audio avec le même nom dans le dossier audio du serveur ftp. Veuillez changer les noms ou supprimer les doublons.\");\n }\n }\n\n\n }\n\n // If there are files from the database that weren't found in the audio folder,\n // flag them and add a comment stating that the file can no longer be found.\n if( count($DBaudioFileArray) ){\n //print_r($DBaudioFileArray);\n foreach($DBaudioFileArray as $key => $fn){\n $this->flag_file($fn, \"Le fichier en question n'est plus présent dans le dossier audio du serveur ftp. Il faut le supprimer de la base de données.\");\n $this->set_file_not_new($fn);\n }\n }\n\n return true;\n }", "public function collectAllDocuments($check_deprecated = true)\n\t{\n\t\tinclude_once './Services/ADN/MD/classes/class.adnCountry.php';\n\t\tinclude_once \"Services/ADN/ES/classes/class.adnCertifiedProfessional.php\";\n\t\tinclude_once './Services/ADN/EP/classes/class.adnAnswerSheetAssignment.php';\n\t\tinclude_once './Services/ADN/EP/classes/class.adnAnswerSheet.php';\n\t\tinclude_once './Services/ADN/ED/classes/class.adnLicense.php';\n\n\n\t\t$this->initOutfile();\n\n\t\t$outfiles = array();\n\t\t$all_sheets = array();\n\t\t\n\t\t$cand_out_files = array();\n\t\t\n\t\tforeach($this->getCandidates() as $cand)\n\t\t{\n\t\t\t$sheets = adnAnswerSheetAssignment::getAllSheets(\n\t\t\t\t$cand,\n\t\t\t\t$this->getEvent()->getId()\n\t\t\t);\n\n\t\t\tif(count((array) $sheets) < ($this->hasCasePart() ? 2 : 1))\n\t\t\t{\n\t\t\t\tthrow new adnReportException(\n\t\t\t\t\t\t$GLOBALS['lng']->txt('adn_report_err_not_generated')\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Lookup generated\n\t\t\tforeach((array) $sheets as $sheet_data)\n\t\t\t{\n\t\t\t\tif(!self::lookupCandidateSheetGenerated($cand, $sheet_data['ep_answer_sheet_id']))\n\t\t\t\t{\n\t\t\t\t\tthrow new adnReportException(\n\t\t\t\t\t\t\t$GLOBALS['lng']->txt('adn_report_err_not_generated'));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach($sheets as $sheet_data)\n\t\t\t{\n\t\t\t\t$sheet_id = $sheet_data['ep_answer_sheet_id'];\n\t\t\t\t$all_sheets[] = $sheet_id;\n\n\t\t\t\tif($check_deprecated && $this->isSheetDeprecated($cand,$sheet_id))\n\t\t\t\t{\n\t\t\t\t\tthrow new adnReportException(\n\t\t\t\t\t\t$GLOBALS['lng']->txt('adn_report_err_sheet_deprecated'));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$sheet = new adnAnswerSheet($sheet_id);\n\t\t\t\tif($this->getEvent()->getType() != 'chem' and $this->getEvent()->getType() != 'gas')\n\t\t\t\t{\n\t\t\t\t\t$cand_out_files[$cand][] =\n\t\t\t\t\t\t$this->getDataDir().'/'.$sheet_id.'_'.$cand.'_cover_base.pdf';\n\t\t\t\t}\n\t\t\t\telseif($sheet->getType() == adnAnswerSheet::TYPE_CASE)\n\t\t\t\t{\n\t\t\t\t\t// Cover\n\t\t\t\t\t$cand_out_files[$cand][] = \n\t\t\t\t\t\t$this->getDataDir().'/'.$sheet_id.'_'.$cand.'_cover_case.pdf';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$cand_out_files[$cand][] = \n\t\t\t\t\t\t$this->getDataDir().'/'.$sheet_id.'_'.$cand.'_cover_mc.pdf';\n\t\t\t\t}\n\n\t\t\t\t// Add situation description\n\t\t\t\tif($sheet->getType() == adnAnswerSheet::TYPE_CASE)\n\t\t\t\t{\n\t\t\t\t\tforeach($this->getSituation($sheet) as $file)\n\t\t\t\t\t{\n\t\t\t\t\t\t$cand_out_files[$cand][] = $file;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Add question sheet\n\t\t\t\t$cand_out_files[$cand][] = \n\t\t\t\t\t$this->getDataDir().'/'.$this->getEvent()->getId().'_'.$sheet_id.'_sheet.pdf';\n\t\t\t\t\t\n\t\t\t\t// Add license\n\t\t\t\tif($sheet->getType() == adnAnswerSheet::TYPE_CASE)\n\t\t\t\t{\n\t\t\t\t\tforeach($this->createLicense($sheet) as $lic)\n\t\t\t\t\t{\n\t\t\t\t\t\t$cand_out_files[$cand][] = $lic;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Add goods\n\t\t\t\tif($sheet->getType() == adnAnswerSheet::TYPE_CASE)\n\t\t\t\t{\n\t\t\t\t\tforeach($this->createGoods($sheet) as $good)\n\t\t\t\t\t{\n\t\t\t\t\t\t$cand_out_files[$cand][] = $good;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Write on task (merge them in one PDF)\n\t\tinclude_once './Services/ADN/Report/classes/class.adnTaskScheduleWriter.php';\n\t\t$writer = new adnTaskScheduleWriter();\n\t\t$writer->xmlStartTag('tasks');\n\n\t\tforeach($cand_out_files as $candidate_id => $candoutfiles)\n\t\t{\n\t\t\t$writer->xmlStartTag('action',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'method' => 'mergePdf'\n\t\t\t\t\t)\n\t\t\t);\n\t\t\t$writer->addParameter('vector',(array) $candoutfiles);\n\t\t\t$this->initOutfile();\n\t\t\t$writer->addParameter('string',$this->getOutfile());\n\t\t\t$writer->xmlEndTag('action');\n\t\t\t\n\t\t\t// Number this pdf\n\t\t\t$writer->xmlStartTag('action',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'method' => 'adnNumberPdf'\n\t\t\t\t\t)\n\t\t\t);\n\t\t\t$writer->addParameter('string', $this->getOutfile());\n\t\t\t$this->initOutfile();\n\t\t\t$writer->addParameter('string', $this->getOutfile());\n\t\t\t$writer->xmlEndTag('action');\n\t\t\t\n\t\t\t$outfiles[] = $this->getOutfile();\n\t\t}\n\n\n\t\t// Add solution sheet\n\t\tforeach($all_sheets as $sheet_id)\n\t\t{\n\t\t\t$outfiles[] = \n\t\t\t\t$this->getDataDir().'/'.$this->getEvent()->getId().'_'.$sheet_id.'_solution.pdf';\n\t\t}\n\n\t\t\n\t\t$writer->xmlStartTag('action',\n\t\t\tarray(\n\t\t\t\t'method'\t=> 'mergePdf'\n\t\t\t)\n\t\t);\n\t\t$writer->addParameter('vector',$outfiles);\n\t\t$this->initOutfile();\n\t\t$writer->addParameter('string',$this->getOutfile());\n\t\t$writer->xmlEndTag('action');\n\t\t\n\t\t\n\t\t$writer->xmlEndTag('tasks');\n\t\t\n\t\t//$GLOBALS['ilLog']->write('XML '.$writer->xmlDumpMem(true));\n\t\t\n\t\ttry\n\t\t{\n\t\t\tinclude_once './Services/ADN/Base/classes/class.adnRpcAdapter.php';\n\t\t\t$adapter = new adnRpcAdapter();\n\t\t\t$adapter->transformationTaskScheduler(\n\t\t\t\t$writer->xmlDumpMem()\n\t\t\t);\n\t\t}\n\t\tcatch(adnReportException $e)\n\t\t{\n\t\t\tthrow $e;\n\t\t}\n\t}", "abstract public function getDocuments();", "public function gatherFileData()\n {\n $files = get_included_files();\n\n $fileList = array();\n\n $fileTotals = array(\n \"count\" => count($files),\n \"size\" => 0,\n \"largest\" => 0,\n );\n\n foreach($files as $key => $file) {\n $size = filesize($file);\n\n $fileList[] = array(\n 'name' => str_replace(BASEPATH, '/', $file),\n 'size' => $this->getReadableFileSize($size)\n );\n\n $fileTotals['size'] += $size;\n\n if($size > $fileTotals['largest']) $fileTotals['largest'] = $size;\n }\n\n $fileTotals['size'] = $this->getReadableFileSize($fileTotals['size']);\n $fileTotals['largest'] = $this->getReadableFileSize($fileTotals['largest']);\n\n $this->output['files'] = $fileList;\n $this->output['fileTotals'] = $fileTotals;\n }", "public function convertData()\n {\n foreach ($this->dataToConvert as $node) {\n $title = $node->xpath('title');\n $fileMeta = $this->retrieveFileInfo($title);\n if (empty($fileMeta) || 201 == ($fileMeta['type']) || ($fileMeta['type']) <= 0) {\n $this->message(\"ignore slash: \" . $title . \": \" . json_encode($fileMeta));\n continue;\n }\n \n $text = $node->xpath('revision/text')[0];\n if (empty($text)) {\n continue;\n }\n\n if ($fileMeta['type'] == 3 || $fileMeta['type'] == 4 || $fileMeta['type'] == 7) {\n if (strlen($text) > 1024) {\n $this->saveFile($fileMeta, $text, \".wikitext\");\n } else {\n $this->message(\"Template: \" . json_encode($fileMeta) . \" -> \" . $text);\n }\n continue;\n } else if ($fileMeta['type'] == 200) {\n $draftpath = $this->output . \"Draft/\" . $fileMeta['filename'] . \".md\";\n @unlink($draftpath);\n }\n \n $text = $this->cleanText($text, $fileMeta);\n if (empty($text)) {\n $this->message(\"cleanText empty: \" . json_encode($fileMeta));\n continue;\n }\n\n if ($this->format === \"mediawiki\") {\n $this->saveFile($fileMeta, $text, \".wikitext\");\n continue;\n }\n\n try {\n $lang = getenv(\"WIKILANG\");\n $this->message(\"pandoc: {$fileMeta['filename']}: \");\n $errpath=$this->output . \"Errors/\" . $fileMeta['filename'];\n $procOpt = [];\n $procOpt[\"stdout\"] = $errpath . \".log\";\n $procOpt[\"stderr\"] = $errpath . \".err.log\";\n $procOpt[\"timeout\"] = 3;\n if ($lang == \"en\" || mb_strlen($text) > 16*1024) {\n $procOpt[\"timeout\"] = 6;\n }\n $this->pandocOptions[\"variable\"] = [\n \"\\\"cfmtitle={$fileMeta['title']}\\\"\",\n \"\\\"cfmurl={$fileMeta['url']}\\\"\",\n \"\\\"WIKILANG={$lang}\\\"\",\n \"\\\"stdout={$errpath}.log\\\"\"\n ];\n \n file_put_contents($errpath . \".wikitext\", $text);\n $this->runPandoc($text, $procOpt);\n $text = file_get_contents($procOpt[\"stdout\"]);\n @unlink($procOpt[\"stdout\"]);\n $stderr = file_get_contents($procOpt[\"stderr\"]);\n if (mb_strlen($stderr) > 0) {\n $this->message(\"Caught stderr {$fileMeta['filename']}: \", $stderr);\n } else {\n @unlink($procOpt[\"stderr\"]);\n }\n if (empty($text)) {\n continue;\n }\n @unlink($errpath . \".wikitext\");\n } catch (\\Throwable $e) {\n $errmsg=$e->getMessage();\n $this->message(\"Caught exception {$fileMeta['filename']}: \", $errmsg);\n continue;\n }\n $text .= $this->getMetaData($fileMeta);\n $this->saveFile($fileMeta, $text);\n $this->counter++;\n }\n }", "protected function processChangedAndNewFiles() {}" ]
[ "0.6256281", "0.5830227", "0.57210153", "0.5716924", "0.5702994", "0.56822574", "0.56734025", "0.5666245", "0.56120074", "0.5555392", "0.5361512", "0.53523606", "0.5334717", "0.52971756", "0.5238281", "0.5226814", "0.5207748", "0.5183845", "0.51333624", "0.51109636", "0.510517", "0.5084715", "0.50771385", "0.5052451", "0.5026923", "0.50121146", "0.49932575", "0.49836278", "0.49813354", "0.4978161" ]
0.66974
0
Retreive any missing main documents and attach provided files. The missingdocs array should be an array, indexed by document id, of main documents we need to retrieve. The value associated to the key should be an array of stored_files or stored file ids to attach to the result document. Return array also indexed by document id.
protected function get_missing_docs($missingdocs) { if (empty($missingdocs)) { return array(); } $docids = array_keys($missingdocs); // Build a custom query that will get all the missing documents. $query = new \SolrQuery(); $this->set_query($query, '*'); $this->add_fields($query); $query->setRows(count($docids)); $query->addFilterQuery('{!cache=false}id:(' . implode(' OR ', $docids) . ')'); $response = $this->get_query_response($query); // We know the missing docs have already been checked for access, so don't recheck. $results = $this->process_response($response, 0, true); $out = array(); foreach ($results as $result) { $resultid = $result->get('id'); if (!isset($missingdocs[$resultid])) { // We got a result we didn't expect. Skip it. continue; } // Attach the files. foreach ($missingdocs[$resultid] as $filedoc) { $result->add_stored_file($filedoc); } $out[$resultid] = $result; } return $out; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function display_tripartite_docs($id){\n\n $id = decrypt($id);\n $society = SocietyOfferLetter::where('user_id', auth()->user()->id)->first();\n $society_details = SocietyOfferLetter::find($society->id);\n $ol_applications = OlApplication::where('id', $id)->with(['request_form', 'applicationMasterLayout', 'olApplicationStatus' => function($q){\n $q->where('society_flag', '1')->orderBy('id', 'desc')->first();\n }])->first();\n $documents = OlSocietyDocumentsMaster::where('application_id', $ol_applications->application_master_id)->where('is_admin', 0)->with(['documents_uploaded' => function($q) use ($society,$id){\n $q->where('society_id', $society->id)\n ->where('application_id',$id)->get();\n }])->get();\n\n// dd($ol_applications);\n $document_ids = array_pluck($documents, 'id');\n $documents_uploaded = OlSocietyDocumentsStatus::with('document_name')->where('society_id', $society->id)\n ->where('application_id',$id)\n ->whereIn('document_id', $document_ids)->get();\n\n// dd($documents_uploaded);\n $documents_comment = OlSocietyDocumentsComment::where('society_id', $society->id)->where('application_id', $ol_applications->id)->first();\n $documents_complusory = [];\n foreach ($documents as $key => $value) {\n if($value->is_optional == 0){\n $documents_complusory[] = $value;\n }\n }\n\n $documents_uploaded_complusory = [];\n foreach ($documents_uploaded as $key => $value) {\n if($value->document_name->is_optional == 0){\n $documents_uploaded_complusory[] = $value;\n }\n }\n\n if(count($documents_complusory) == count($documents_uploaded_complusory) || count($documents_complusory) < count($documents_uploaded)){\n $docs_comment = OlSocietyDocumentsComment::where('society_id', $society->id)->where('application_id', $ol_applications->id)->first();\n $input = array(\n 'society_id' => $society->id,\n 'application_id' => $ol_applications->id\n );\n if($docs_comment){\n $input['society_documents_comment'] = $docs_comment->society_documents_comment;\n OlSocietyDocumentsComment::where('id', $docs_comment->id)->update($input);\n }else{\n $input['society_documents_comment'] = 'N.A.';\n OlSocietyDocumentsComment::create($input);\n }\n $show_comment_tab = 1;\n }else{\n $show_comment_tab = 0;\n }\n if($documents_comment && $documents_comment->society_documents_comment == 'N.A.'){\n $documents_comment->society_documents_comment = '';\n }\n \n $documents_complusory = 0;\n $documents_uploaded_complusory = 0;\n\n// dd($documents);\n foreach($documents as $document){\n\n if($document->is_optional == '0'){\n $documents_complusory++;\n// dd(!empty($document->documents_uploaded));\n if(count($document->documents_uploaded) > 0 ){\n $documents_uploaded_complusory++;\n }\n }\n }\n// dd($documents);\n return view('frontend.society.tripatite.show_society_documents', compact('ol_applications', 'documents', 'documents_uploaded', 'documents_comment', 'id', 'society', 'society_details', 'show_comment_tab', 'documents_uploaded_complusory', 'documents_complusory'));\n\n }", "private function addMissing($clientDocuments, Closure $fileDetailCallback)\n {\n// $upstreamDocuments = $this->clientContext->getDocuments(array(\n// 'referencingApplicationUuId' => $this->application->getReferencingApplicationUuId(),\n// ));\n\n // Look for documents in the upload that aren't in IRIS\n // These should be added to IRIS.\n /** @var FormInterface $clientDocument */\n foreach ($clientDocuments as $clientDocument) {\n // Get the uploaded file\n /** @var UploadedFile $uploadedFile */\n $uploadedFileData = $clientDocument->getData();\n\n $uploadedFile = $uploadedFileData['fileItem'];\n\n if ($uploadedFile) {\n// if (!$this->matchUpstreamDocument($uploadedFile->getClientOriginalName(), $upstreamDocuments)) {\n // File not found in IRIS, add the file\n $fileDetail = array();\n\n if (null !== $fileDetailCallback) {\n $fileDetailResponse = $fileDetailCallback(array(\n 'uploadedFile' => $uploadedFile,\n 'application' => $this->application,\n ));\n\n if (null !== $fileDetailResponse && !is_array($fileDetailResponse)) {\n // Invalid response\n throw new InvalidDetailType(sprintf('Response of type %s is invalid. Expected null or array.',\n get_class($fileDetailResponse)));\n }\n\n $fileDetail = $fileDetailResponse;\n }\n\n $fileName = (!empty($fileDetail['uploadedFile']) && is_string($fileDetail['uploadedFile'])) ?\n $fileDetail['uploadedFile'] : $uploadedFile->getClientOriginalName();\n\n $fileName = rtrim($fileName, $uploadedFile->getClientOriginalExtension());\n\n $fileName = $this->getSlugifier()->slugify($fileName, '_') . '.' .\n strtolower($uploadedFile->getClientOriginalExtension());\n\n $description = (!empty($fileDetail['description']) && is_string($fileDetail['description']))\n ? $fileDetail['description'] : '';\n\n $this->clientContext->uploadDocument(array(\n 'referencingApplicationUuId' => $this->application->getReferencingApplicationUuId(),\n\n 'fileName' => $fileName,\n\n 'description' => $description,\n\n 'file' => $uploadedFile->getPathname(),\n\n // todo: maybe forward this from details builder closure?\n 'categoryId' => DocumentCategoryOptions::MISCELLANEOUS,\n ));\n// }\n }\n }\n }", "protected function detectMissingFiles() {}", "public static function doc_list_documents($contact_ids, $inner_directory = NULL, $show_contact_id_column = FALSE, $show_share_link = FALSE, $show_shared_only = FALSE)\n\t{\n\t\t// $contact_id can be entered as a single ID or an array of IDs\n\t\t// Normalise this to an array\n\t\tif (is_numeric($contact_ids))\n\t\t{\n\t\t\t$contact_ids = array($contact_ids);\n\t\t}\n\n\t\t$doc_array = NULL;\n\t\t$question_data = array();\n\n\t\tif (is_array($contact_ids) AND count($contact_ids) > 0)\n\t\t{\n\t\t\t// Gets all the documents from KT for a given user\n\t\t\tforeach ($contact_ids as $contact_id)\n\t\t\t{\n\t\t\t\t$question_data[$contact_id] = self::doc_acquire_documents($contact_id, $inner_directory);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn \"We did not receive any ID to search for documents.\";\n\t\t}\n\n\t\t$doc_array = array(\n\t\t\t'document' => array(),\n\t\t\t'counter' => 0\n\t\t);\n\n\t\t// Get the documents for each contact. Merge the results into one array\n\t\tforeach ($question_data as $contact_id => $contact_question_data)\n\t\t{\n\t\t\tif (!is_null($contact_question_data))\n\t\t\t{\n\t\t\t\t$new_doc_array = self::document_table_builder($contact_question_data, NULL, 0, NULL, $contact_id, $show_share_link, $show_shared_only);\n\t\t\t\tif ($new_doc_array['document']) {\n\t\t\t\t\t$doc_array['document'] = array_merge($doc_array['document'], $new_doc_array['document']);\n\t\t\t\t\t$doc_array['counter'] += (int) $new_doc_array['counter'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check to see if there are any documents\n\t\tif ($doc_array['counter'] <= 0)\n\t\t{\n $html = \"There are no documents yet.\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$doc_array = Model_Document::order_documents_by_last_updated($doc_array);\n $list_documents = Model_Plugin::is_enabled_for_role('Administrator', 'contacts3') ? '/documents/documents/list_documents' : 'list_documents';\n\t\t\t$html = View::factory($list_documents)\n\t\t\t\t->set('show_contact_id_column', $show_contact_id_column)\n ->set('show_share_link', $show_share_link)\n\t\t\t\t->set('doc_array', $doc_array)\n\t\t\t\t->set('pathinfo_extension', PATHINFO_EXTENSION);\n\n\t\t}\n\t\treturn $html;\n\t}", "function getMissing() {\n\t\t$articleDao =& \\DAORegistry::getDAO('ArticleDAO');\n\t\t$sql = \"SELECT * FROM articles WHERE pages like '%#DFM'\";\n\t\t$blub = $articleDao->retrieve($sql);\n\t\t$result = new \\DAOResultFactory($blub, $this, '_dummy');\n\t\t$result = $result->toArray();\n\t\tforeach ($result as $record) {\n\t\t\t$this->getArticleGalleys($record['article_id']);\n\t\t}\n\t}", "public function get_and_clear_added_documents() {\n $added = $this->added;\n $this->added = [];\n return $added;\n }", "public function collectAllDocuments($check_deprecated = true)\n\t{\n\t\tinclude_once './Services/ADN/MD/classes/class.adnCountry.php';\n\t\tinclude_once \"Services/ADN/ES/classes/class.adnCertifiedProfessional.php\";\n\t\tinclude_once './Services/ADN/EP/classes/class.adnAnswerSheetAssignment.php';\n\t\tinclude_once './Services/ADN/EP/classes/class.adnAnswerSheet.php';\n\t\tinclude_once './Services/ADN/ED/classes/class.adnLicense.php';\n\n\n\t\t$this->initOutfile();\n\n\t\t$outfiles = array();\n\t\t$all_sheets = array();\n\t\t\n\t\t$cand_out_files = array();\n\t\t\n\t\tforeach($this->getCandidates() as $cand)\n\t\t{\n\t\t\t$sheets = adnAnswerSheetAssignment::getAllSheets(\n\t\t\t\t$cand,\n\t\t\t\t$this->getEvent()->getId()\n\t\t\t);\n\n\t\t\tif(count((array) $sheets) < ($this->hasCasePart() ? 2 : 1))\n\t\t\t{\n\t\t\t\tthrow new adnReportException(\n\t\t\t\t\t\t$GLOBALS['lng']->txt('adn_report_err_not_generated')\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Lookup generated\n\t\t\tforeach((array) $sheets as $sheet_data)\n\t\t\t{\n\t\t\t\tif(!self::lookupCandidateSheetGenerated($cand, $sheet_data['ep_answer_sheet_id']))\n\t\t\t\t{\n\t\t\t\t\tthrow new adnReportException(\n\t\t\t\t\t\t\t$GLOBALS['lng']->txt('adn_report_err_not_generated'));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach($sheets as $sheet_data)\n\t\t\t{\n\t\t\t\t$sheet_id = $sheet_data['ep_answer_sheet_id'];\n\t\t\t\t$all_sheets[] = $sheet_id;\n\n\t\t\t\tif($check_deprecated && $this->isSheetDeprecated($cand,$sheet_id))\n\t\t\t\t{\n\t\t\t\t\tthrow new adnReportException(\n\t\t\t\t\t\t$GLOBALS['lng']->txt('adn_report_err_sheet_deprecated'));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$sheet = new adnAnswerSheet($sheet_id);\n\t\t\t\tif($this->getEvent()->getType() != 'chem' and $this->getEvent()->getType() != 'gas')\n\t\t\t\t{\n\t\t\t\t\t$cand_out_files[$cand][] =\n\t\t\t\t\t\t$this->getDataDir().'/'.$sheet_id.'_'.$cand.'_cover_base.pdf';\n\t\t\t\t}\n\t\t\t\telseif($sheet->getType() == adnAnswerSheet::TYPE_CASE)\n\t\t\t\t{\n\t\t\t\t\t// Cover\n\t\t\t\t\t$cand_out_files[$cand][] = \n\t\t\t\t\t\t$this->getDataDir().'/'.$sheet_id.'_'.$cand.'_cover_case.pdf';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$cand_out_files[$cand][] = \n\t\t\t\t\t\t$this->getDataDir().'/'.$sheet_id.'_'.$cand.'_cover_mc.pdf';\n\t\t\t\t}\n\n\t\t\t\t// Add situation description\n\t\t\t\tif($sheet->getType() == adnAnswerSheet::TYPE_CASE)\n\t\t\t\t{\n\t\t\t\t\tforeach($this->getSituation($sheet) as $file)\n\t\t\t\t\t{\n\t\t\t\t\t\t$cand_out_files[$cand][] = $file;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Add question sheet\n\t\t\t\t$cand_out_files[$cand][] = \n\t\t\t\t\t$this->getDataDir().'/'.$this->getEvent()->getId().'_'.$sheet_id.'_sheet.pdf';\n\t\t\t\t\t\n\t\t\t\t// Add license\n\t\t\t\tif($sheet->getType() == adnAnswerSheet::TYPE_CASE)\n\t\t\t\t{\n\t\t\t\t\tforeach($this->createLicense($sheet) as $lic)\n\t\t\t\t\t{\n\t\t\t\t\t\t$cand_out_files[$cand][] = $lic;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Add goods\n\t\t\t\tif($sheet->getType() == adnAnswerSheet::TYPE_CASE)\n\t\t\t\t{\n\t\t\t\t\tforeach($this->createGoods($sheet) as $good)\n\t\t\t\t\t{\n\t\t\t\t\t\t$cand_out_files[$cand][] = $good;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Write on task (merge them in one PDF)\n\t\tinclude_once './Services/ADN/Report/classes/class.adnTaskScheduleWriter.php';\n\t\t$writer = new adnTaskScheduleWriter();\n\t\t$writer->xmlStartTag('tasks');\n\n\t\tforeach($cand_out_files as $candidate_id => $candoutfiles)\n\t\t{\n\t\t\t$writer->xmlStartTag('action',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'method' => 'mergePdf'\n\t\t\t\t\t)\n\t\t\t);\n\t\t\t$writer->addParameter('vector',(array) $candoutfiles);\n\t\t\t$this->initOutfile();\n\t\t\t$writer->addParameter('string',$this->getOutfile());\n\t\t\t$writer->xmlEndTag('action');\n\t\t\t\n\t\t\t// Number this pdf\n\t\t\t$writer->xmlStartTag('action',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'method' => 'adnNumberPdf'\n\t\t\t\t\t)\n\t\t\t);\n\t\t\t$writer->addParameter('string', $this->getOutfile());\n\t\t\t$this->initOutfile();\n\t\t\t$writer->addParameter('string', $this->getOutfile());\n\t\t\t$writer->xmlEndTag('action');\n\t\t\t\n\t\t\t$outfiles[] = $this->getOutfile();\n\t\t}\n\n\n\t\t// Add solution sheet\n\t\tforeach($all_sheets as $sheet_id)\n\t\t{\n\t\t\t$outfiles[] = \n\t\t\t\t$this->getDataDir().'/'.$this->getEvent()->getId().'_'.$sheet_id.'_solution.pdf';\n\t\t}\n\n\t\t\n\t\t$writer->xmlStartTag('action',\n\t\t\tarray(\n\t\t\t\t'method'\t=> 'mergePdf'\n\t\t\t)\n\t\t);\n\t\t$writer->addParameter('vector',$outfiles);\n\t\t$this->initOutfile();\n\t\t$writer->addParameter('string',$this->getOutfile());\n\t\t$writer->xmlEndTag('action');\n\t\t\n\t\t\n\t\t$writer->xmlEndTag('tasks');\n\t\t\n\t\t//$GLOBALS['ilLog']->write('XML '.$writer->xmlDumpMem(true));\n\t\t\n\t\ttry\n\t\t{\n\t\t\tinclude_once './Services/ADN/Base/classes/class.adnRpcAdapter.php';\n\t\t\t$adapter = new adnRpcAdapter();\n\t\t\t$adapter->transformationTaskScheduler(\n\t\t\t\t$writer->xmlDumpMem()\n\t\t\t);\n\t\t}\n\t\tcatch(adnReportException $e)\n\t\t{\n\t\t\tthrow $e;\n\t\t}\n\t}", "public function getOptionalDocument($masterId){\n\n $optional_docs = NocSocietyDocumentsMaster::where('application_id', $masterId)\n ->where('is_optional',1)->pluck('id')->toArray();\n return $optional_docs;\n }", "public function getMissingRecords()\n {\n $missing = [];\n\n foreach ($this->records as $record) {\n $repo = $this->storage->getRepository($record->getContentType());\n $fields = $record->getRequiredFieldsArray();\n\n if (count($fields)) {\n $results = $repo->findBy($fields);\n if (!$results) {\n $missing[] = $record;\n }\n }\n }\n\n return $missing;\n }", "public function mergeDocsFromArray($files)\n {\n\n $path_arr = [];\n\n $dir_path = explode('\\\\', $files[0]);\n foreach ($dir_path as $key => $str) {\n\n if ($key != count($dir_path) - 1) {\n $path_arr[] = $str;\n }\n\n }\n\n $path = implode('\\\\', $path_arr) . '\\\\';\n\n $random_name = 'mergedfile-' . $this->myId();\n $filepath = $path.$random_name;\n\n $dm = new DocxMerge();\n\n $dm->merge($files, $filepath, true);\n\n return [\n 'filepath' => $filepath,\n 'random_name' => $random_name\n ];\n }", "public function addDocuments(array $documents, array $additionalArguments = []): array\n {\n $texts = array_column($documents, 'pageContent');\n $metadatas = array_column($documents, 'metadata');\n\n return $this->addTexts($texts, $metadatas, $additionalArguments);\n }", "protected function getDocuments() {\n return array(\n 'tika.pdf' => array(\n 'path' => __DIR__ . DIRECTORY_SEPARATOR . 'Tika' . DIRECTORY_SEPARATOR,\n 'type' => 'PDF',\n 'keywords' => array('hostingcheck', 'pdf'),\n ),\n 'tika.doc' => array(\n 'path' => __DIR__ . DIRECTORY_SEPARATOR . 'Tika' . DIRECTORY_SEPARATOR,\n 'type' => 'Microsoft Word Document (DOC)',\n 'keywords' => array('hostingcheck', 'doc'),\n ),\n 'tika.docx' => array(\n 'path' => __DIR__ . DIRECTORY_SEPARATOR . 'Tika' . DIRECTORY_SEPARATOR,\n 'type' => 'Microsoft Word Document (DOCX)',\n 'keywords' => array('hostingcheck', 'docx'),\n ),\n 'tika.xls' => array(\n 'path' => __DIR__ . DIRECTORY_SEPARATOR . 'Tika' . DIRECTORY_SEPARATOR,\n 'type' => 'Microsoft Excel Spreadsheet (XLS)',\n 'keywords' => array('hostingcheck', 'xls'),\n ),\n 'tika.xlsx' => array(\n 'path' => __DIR__ . DIRECTORY_SEPARATOR . 'Tika' . DIRECTORY_SEPARATOR,\n 'type' => 'Microsoft Excel Spreadsheet (XLSX)',\n 'keywords' => array('hostingcheck', 'xlsx'),\n ),\n 'tika.ppt' => array(\n 'path' => __DIR__ . DIRECTORY_SEPARATOR . 'Tika' . DIRECTORY_SEPARATOR,\n 'type' => 'Microsoft Powerpoint Presentation (PPT)',\n 'keywords' => array('hostingcheck', 'ppt'),\n ),\n 'tika.pptx' => array(\n 'path' => __DIR__ . DIRECTORY_SEPARATOR . 'Tika' . DIRECTORY_SEPARATOR,\n 'type' => 'Microsoft Powerpoint Presentation (PPTX)',\n 'keywords' => array('hostingcheck', 'pptx'),\n ),\n );\n }", "public function getOfficialDocuments() {}", "public function validDocumentDataProvider()\n {\n return [\n [\n 'customer_document',\n 'some/path/to/bucket/document1.pdf',\n [\n 'customerId' => 123,\n 'documentReference' => 'F 1010101',\n 'customerDocumentType' => 'customer_invoice',\n 'originalFilename' => 'F 1010101.pdf',\n ],\n ],\n [\n 'supplier_document',\n 'some/path/to/bucket/document2.pdf',\n [\n 'supplierId' => 234,\n 'documentReference' => 'G 55555',\n 'supplierDocumentType' => 'supplier_purchase_order',\n 'originalFilename' => 'G 55555.pdf',\n ],\n ],\n ];\n }", "static function retrysendUnsentDataboxDocuments($referenznummer = \"\")\n\t{\n\t\t$validationResult\t=\tarray();\n\t\t$initialize = UIDvalidationAustria::initialize($referenznummer, $validationResult);\n\t\t$arr_FilesInLogfilePath = /*array_diff(*/ scandir( $GLOBALS[\"UIDvalidationATglobalvars\"][\"validationLogfilePath\"] ) /*, array('..', '.'))*/;\n\t\t\n\t\t$arr_anhang_filepfad = array();\n\t\t\t\t\t\n\t\tforeach ($arr_FilesInLogfilePath as $filebez)\n\t\t{\n\t\t\t// MIUID_ATU57966222_20140302.xml\n\t\t\tif ( substr($filebez,0,5) == 'MIUID' && substr($filebez,6,11) == $GLOBALS[\"UIDvalidationATglobalvars\"][\"firmaUID\"] && substr($filebez,-4,4) == '.xml' )\n\t\t\t{\n\t\t\t\t$arr_anhang_filepfad[] = $GLOBALS[\"UIDvalidationATglobalvars\"][\"validationLogfilePath\"].DIRECTORY_SEPARATOR.$filebez;\n\t\t\t}\n\t\t}\n\n\t\t$emailSendResult = UIDvalidationAustriaExtendedServices::sendEmail($arr_anhang_filepfad, $validationResult);\n\t\t\n\t\tif ($emailSendResult === FALSE)\n\t\t{\n\t\t\t$validationResult[\"EmailSendErfolgreich\"] = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$validationResult[\"EmailSendErfolgreich\"] = 1;\n\t\t\t// Databox File löschen\t\t\t\t\t\n\t\t\tforeach ($arr_anhang_filepfad as $file2unlink) {unlink($file2unlink);}\n\t\t}\n\t\tif ($GLOBALS[\"UIDvalidationATglobalvars\"][\"DataBoxAbfrageLogging\"])\n\t\t{\n\t\t\t$validationResult[\"writeLogfile\"]\t= UIDvalidationAustria::writeLogfile($validationResult);\n\t\t}\n\t\treturn $validationResult;\n\t}", "public function invalidDocumentDataProvider()\n {\n return [\n [\n 'customer_document',\n 'some/path/to/bucket/document1.pdf',\n [\n 'customerId' => '234324',\n 'documentReference' => 213,\n ],\n [\n 'Object(EavBundle\\Entity\\EavDocument).type',\n 'Object(EavBundle\\Entity\\EavValue).customerId',\n 'Object(EavBundle\\Entity\\EavValue).documentReference',\n ],\n ],\n [\n 'supplier_document',\n 'some/path/to/bucket/document2.pdf',\n [\n 'supplierId' => -1,\n 'documentReference' => '',\n 'supplierDocumentType' => 'supplier_purchase_order',\n ],\n [\n 'Object(EavBundle\\Entity\\EavValue).supplierId',\n 'Object(EavBundle\\Entity\\EavDocument).document',\n ],\n ],\n [\n 'customer_document',\n 'some/path/to/bucket/document1.pdf',\n [],\n [\n 'Object(EavBundle\\Entity\\EavDocument).customerId',\n 'Object(EavBundle\\Entity\\EavDocument).type',\n ],\n ],\n [\n 'customer_document',\n 'some/path/to/bucket/document1.pdf',\n [\n 'customerId' => 123,\n 'documentReference' => 'F 1010101',\n 'customerDocumentType' => 'customer_invoice',\n 'originalFilename' => 'F 1010101.pdf',\n ],\n [\n 'Object(EavBundle\\Entity\\EavDocument).document',\n ],\n ],\n [\n 'customer_document',\n 'some/path/to/bucket/document1.pdf',\n [\n 'customerId' => 5678,\n 'customerDocumentType' => 'customer_invoice',\n 'originalFilename' => 'F 23423423.pdf',\n ],\n [\n 'Object(EavBundle\\Entity\\EavDocument).document',\n ],\n ],\n [\n 'supplier_document',\n 'some/path/to/bucket/document2.pdf',\n [\n 'supplierId' => 234,\n 'documentReference' => 'G 55555',\n 'supplierDocumentType' => 'supplier_purchase_order',\n 'originalFilename' => 'G 55555.pdf',\n ],\n [\n 'Object(EavBundle\\Entity\\EavDocument).document',\n ],\n ],\n [\n 'supplier_document',\n 'some/path/to/bucket/document2.pdf',\n [\n 'supplierId' => 9876,\n 'supplierDocumentType' => 'supplier_invoice',\n 'originalFilename' => 'F 23423423.pdf',\n ],\n [\n 'Object(EavBundle\\Entity\\EavDocument).document',\n ],\n ],\n ];\n }", "public static function getUnassignedFromSession()\n {\n foreach ($_SESSION['unassigned_items'] as $key=>$value) {\n $ids_array[] = $key;\n }\n\n $condition = new CDbCriteria();\n $condition->join = \"LEFT OUTER JOIN library_docs ON library_docs.Document_ID=t.Document_ID\";\n $condition->condition = \"library_docs.Document_ID IS NULL\";\n $condition->addInCondition('t.Document_ID', $ids_array);\n\n $condition->order = \"t.Created ASC\";\n $documents = Documents::model()->with(array(\n 'image'=>array(\n 'select'=>'File_Name',\n ),\n ))->findAll($condition);\n\n return $documents;\n }", "public function getAttachments()\n\t{\n\t\t$app = Factory::getApplication();\n\t\t$data = $app->input->post->get('jform', array(), 'array');\n\t\t$files = $app->input->files->get('jform');\n\t\t$allowed_extensions = ComponentHelper::getParams('com_tkdclub')->get('allowed_extensions', 'pdf');\n\t\t$allowed_extensions_array = explode(',', $allowed_extensions);\n\n\t\t$attachments = array();\n\t\t$paths = array();\n\t\t$filenames = array();\n\n\t\tforeach($files as $file)\n\t\t{\n\t\t\tif($file['name'] != '' && $file['error'] == (int) 0)\n\t\t\t{\t\n\t\t\t\t// Check for right file extension\n\t\t\t\tif(!in_array(File::getExt($file['name']), $allowed_extensions_array))\n\t\t\t\t{\n\t\t\t\t\t$app->enqueueMessage(Text::_('COM_TKDCLUB_EMAIL_ATTACHMENT_NOT_ALLOWED') . $allowed_extensions, 'error');\n\t\t\t\t\t$app->setUserState('com_tkdclub.email.data', $data);\n\t\t\t\t\t\n\t\t\t\t\treturn false;\t\n\t\t\t\t}\n\n\t\t\t\t$paths[] = $file['tmp_name'];\n\t\t\t\t$filenames[] = $file['name'];\n\t\t\t}\n\t\t}\n\n\t\tif(empty($paths))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$attachments['paths'] = $paths;\n\t\t$attachments['filenames'] = $filenames;\n\n\t\treturn $attachments;\n\t}", "private function searchFiles()\n {\n $query = File::whereNull('deleted_at');\n $data = $query->get();\n\n return $data;\n }", "public static function document_table_builder($doc_array, $documents = NULL, $counter = 0, $path = NULL, $contact_id = NULL, $show_share_link = FALSE, $show_shared_only = FALSE)\n\t{\n\n\t\tforeach ($doc_array as $key => $value)\n\t\t{\n\t\t if ($show_shared_only && !Model_Contacts3_Files::is_shared($contact_id, $value['id'])) {\n continue;\n }\n if ($value['item_type'] == 'D')\n\t\t\t{\n\t\t\t\t$documents[$counter] = array(\n\t\t\t\t\t'id' => $value['id'],\n\t\t\t\t\t'name' => $value['title'],\n\t\t\t\t\t'path' => $path,\n\t\t\t\t\t'created' => $value['created_date'],\n\t\t\t\t\t'last modified' => $value['modified_date'],\n\t\t\t\t\t'size' => number_format($value['filesize'] / 1024, 2, '.', ''),\n\t\t\t\t\t'type' => $value['mime_display'],\n\t\t\t\t\t'download' => self::create_download_link($value['id'], $value['title']),\n\t\t\t\t\t'filename' => $value['filename'],\n\t\t\t\t\t'contact_id' => $contact_id\n\t\t\t\t);\n\t\t\t\tif (Settings::instance()->get('share_document') && $show_share_link) {\n $documents[$counter]['share'] = Model_Contacts3_Files::is_shared($contact_id, $value['id']) ? '' : self::create_share_link($value['id']);\n }\n\t\t\t\t$counter++;\n\t\t\t}\n\t\t\telse if ($value['item_type'] == 'F' && !empty($value['items']))\n\t\t\t{\n\t\t\t\t$path = $value['full_path'];\n\t\t\t\t$rec = self::document_table_builder($value['items'], $documents, $counter, $path);\n\t\t\t\t$documents = $rec['document'];\n\t\t\t\t$counter = $rec['counter'];\n\t\t\t}\n\t\t}\n\t\t$rec = array('document' => $documents, 'counter' => $counter);\n\t\treturn $rec;\n\t}", "public function initiateReqDocs($documents_selected) {\n\n $selectedDocument = array();\n\n $selectedDocument['reqdocs'] = $documents_selected;\n\n #Insert All Posted Value to the table \"reqdocs\" table\n $result = $this->Insert(\"reqdocs\", $selectedDocument);\n\n $query = \"select max(id) as rid from reqdocs where (username = '' or username is NULL) and reqdocs='$documents_selected'\";\n $res = $this->getDBRecords($query);\n $rid = $res[0][\"rid\"];\n\n return $rid;\n }", "public function getCheckUploadAvail($applicationId){\n\n $society = SocietyOfferLetter::where('user_id', Auth::user()->id)->first();\n $noc_application = NocApplication::where('id',$applicationId)->first();\n\n $documents = NocSocietyDocumentsMaster::where('application_id', $noc_application->application_master_id)->with(['uploadedDocuments' => function($q) use ($society,$applicationId){\n $q->where('application_id',$applicationId)->where('society_id', $society->id);\n }])->get();\n\n $docs_count = NocSocietyDocumentsMaster::where('application_id', $noc_application->application_master_id)->where('is_optional',0)->count();\n\n $docs_uploaded_count = 0;\n\n foreach($documents as $documents_key => $documents_val){\n if($documents_val->is_optional == 0 && count($documents_val->uploadedDocuments) > 0){\n $docs_uploaded_count++;\n }\n }\n $check_upload_avail = 0;\n if($docs_uploaded_count >= $docs_count)\n {\n $check_upload_avail = 1;\n }\n return $check_upload_avail;\n }", "public function import($documents, $inner_dir, $contact_id)\n\t{\n\n\t\t// Home dir\n\t\t$home = '/contacts/'.$contact_id.'/'.$inner_dir;\n\t\t// Move documents stored in $documents to $inner_dir/$contact_id\n\t\tforeach ($documents as $key => $doc)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// $this->move_document(self::createKTconnection(), $doc, $home);\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\treturn array('type' => 'error', 'message' => $e->getMessage());\n\t\t\t}\n\n\t\t}\n\t\treturn array('type' => 'success', 'message' => 'Documents imported successfully.');\n\t}", "public function getnewevents_allforadded($userid, $lastemail, $ignoreminordocuments) {\n\t\t// first get all events for subjects added after last emailing\n\t\t$this->isirdb->where('users_watches.date_add > \"'. $lastemail .'\"', '', false);\n\n\t\tif ($ignoreminordocuments == true) {\n\t\t\t$this->isirdb->where('spis_data.is_document_minor', false);\n\t\t}\n\t\t\n\t\t$this->_prepareNewEventsSelect($userid, false, false);\n\n\t\t$tempNewlyAdded = $this->isirdb->get('users_watches')->result_array();\n\n\t\t// then get changes since the last emailing for subjects added before last emailing\n\t\t$this->isirdb->where('spis_data.publishdate > \"'. $lastemail .'\"', '', false);\n\n\t\tif ($ignoreminordocuments == true) {\n\t\t\t$this->isirdb->where('spis_data.is_document_minor', false);\n\t\t}\n\n\t\t$this->isirdb->order_by('spis_data.publishdate');\n\t\t$this->_prepareNewEventsSelect($userid, false, true);\n\n\t\t$temp = $this->isirdb->get('users_watches')->result_array();\n\t\t\n\t\treturn $this->_mergeEvents($tempNewlyAdded, $temp);\n\t}", "public static function getUnassignedLibraryDocuments($clientID, $projectID, $userID, $year)\n {\n $condition = new CDbCriteria();\n $condition->join = \"LEFT OUTER JOIN library_docs ON library_docs.Document_ID=t.Document_ID\";\n $condition->condition = \"t.Client_ID='\" . $clientID . \"'\";\n $condition->addCondition(\"t.Project_ID='\" . $projectID . \"'\");\n $condition->addCondition(\"t.User_ID='\" . $userID . \"'\");\n $condition->addCondition(\"t.Created LIKE '\" . $year . \"-%'\");\n $condition->addInCondition('t.Document_Type', array(Documents::LB, Documents::GF));\n $condition->addCondition(\"library_docs.Document_ID IS NULL\");\n $condition->order = \"t.Created ASC\";\n $documents = Documents::model()->with(array(\n 'image'=>array(\n 'select'=>'File_Name',\n ),\n ))->findAll($condition);\n\n return $documents;\n }", "public function testQueryLocalFiles() {\n \n // workaround for proplem: fixed list of sucessfully added tracks: \n $this->testfileslocal = array( \n array(\"\",\"url1\" ,\"\"),\n array(\"\",\"url1-C\" ,\"C\"),\n array(\"\",\"url2\" ,\"\"),\n array(\"\",\"url2-C\" ,\"C\"),\n array(\"\",\"url3\" ,\"\"),\n array(\"\",\"url3-C\" ,\"C\"),\n array(\"\",\"url4\" ,\"\"),\n array(\"\",\"url4-C\" ,\"C\"),\n array(\"\",\"mykey2-A\" ,\"A\"),\n array(\"\",\"mykey3-A\" ,\"A\"),\n array(\"\",\"mykey4-A\" ,\"A\"),\n array(\"\",\"mykey5-A\" ,\"A\"),\n array(\"\",\"myotherotherkey1-d\" ,\"\"),\n array(\"\",\"myotherkey2-A\" ,\"A\"),\n array(\"\",\"myotherkey3-A\" ,\"A\"),\n array(\"\",\"myotherkey4-A\" ,\"A\"),\n array(\"\",\"myotherkey5-A\" ,\"A\"),\n );\n \n foreach ($this->testfileslocal as $key => $file) {\n $file_url = $file[0];\n $ext_key = $file[1];\n $collection = $file[2];\n \n if ( strlen($ext_key) > 0 ) {\n # only if an external key is available \n $this->myQueryTest(\"$ext_key\", $collection, \"200\", array(\"query\", \"result\"), array(\"collection\", \"external_key\", \"id\") );\n }\n\n }\n }", "public function getGroupFilesFromDatabase() {\n $db = \\Helper::getDB();\n $db->where('g.groupId', $db->escape($this->getId()));\n $db->join('documents d', 'd.id = g.documentId', 'LEFT');\n $db->join('users u', 'u.id = d.ownerId', 'LEFT');\n $results = $db->get('group_documents g', NULL, 'd.*, u.*, d.id AS fileId, u.id AS userId');\n // Process all files and their owners\n foreach($results as $result) {\n $user = new \\Models\\User($result['userId'], $result['username'], $result['email'], $result['firstName'], $result['lastName'], $result['lastLogin']);\n $file = new \\Models\\File($result['fileId'], $result['type'], $result['title'], $user, $result['creationDate'], $result['modificationDate'], $result['file']);\n $this->addFile($file);\n }\n }", "public function get_documents() \n {\n $endpoint_name = \"/documents/\";\n $request_arguments = [];\n $documents = $this->request(\"GET\", $endpoint_name, $request_arguments);\n if (array_key_exists(\"documents\", $documents)) {\n return $documents[\"documents\"];\n }\n return $documents;\n }", "public function getPersonalDocuments($userId){\n return $this->getData(\"SELECT d.documentId, d.statusId, CONCAT(e.LASTNAME,', ',e.FIRSTNAME) AS authorName, \n d.filePath, d.title, d.versionNo, d.timeCreated, d.lastUpdated,\n s.stepNo, s.stepName, t.type,\n pr.processName, \n (SELECT CONCAT(e.FIRSTNAME,', ',e.LASTNAME) FROM employee e2 WHERE e2.EMP_ID = d.firstAuthorId) AS firstAuthorName \n FROM facultyassocnew.documents d \n JOIN employee e ON e.EMP_ID = d.authorId\n JOIN doc_type t ON t.id = d.typeId\n JOIN steps s ON s.id = d.stepId\n JOIN process pr ON pr.id = s.processId\n WHERE t.isActive = 2 AND (d.firstAuthorId = '$userId' OR d.authorId = '$userId')\n ORDER BY d.lastUpdated DESC;\");\n }", "function getDocuments($ids = array(), $sort = 'menuindex', $dir = 'ASC', $fields = '*') {\r\n global $modx;\r\n\r\n if (count($ids) == 0) {\r\n return false;\r\n } else {\r\n $tblsc = $modx->getFullTableName('site_content');\r\n $tbldg = $modx->getFullTableName('document_groups');\r\n\r\n // add sc. to field names to refere to the table\r\n $fields = 'sc.' . implode(',sc.', preg_replace('/^\\s/i', '', explode(',', $fields)));\r\n $sort = ($sort == '') ? '' : 'sc.' . implode(',sc.', preg_replace('/^\\s/i', '', explode(',', $sort)));\r\n\r\n // get document groups for current user\r\n if ($docgrp = $modx->getUserDocGroups()) {\r\n $docgrp = implode(',', $docgrp);\r\n }\r\n\r\n // build the query to get documents\r\n $access = ($modx->isFrontend() ? 'sc.privateweb=0' : \"1='\" . $_SESSION['mgrRole'] . \"' OR sc.privatemgr=0\") .\r\n (!$docgrp ? '' : ' OR dg.document_group IN (' . $docgrp . ')');\r\n\r\n $sql = 'SELECT DISTINCT ' . $fields . ' FROM ' . $tblsc . ' sc ' .\r\n 'LEFT JOIN ' . $tbldg . ' dg on dg.document = sc.id ' .\r\n 'WHERE (sc.id IN (' . implode(',', $ids) . ')) ' .\r\n 'AND (' . $access . ') ' .\r\n 'GROUP BY sc.id' .\r\n ($sort ? ' ORDER BY ' . $sort . ' ' . $dir : '');\r\n\r\n $result = $modx->dbQuery($sql);\r\n $resource = array();\r\n\r\n // convert resources to array\r\n for ($i = 0; $i < @ $modx->recordCount($result); $i ++) {\r\n array_push($resource, @ $modx->fetchRow($result));\r\n }\r\n\r\n return $resource;\r\n }\r\n }" ]
[ "0.5158339", "0.50848234", "0.50113887", "0.49208054", "0.49134216", "0.49117202", "0.4866552", "0.48521033", "0.481928", "0.48160812", "0.47630733", "0.47216538", "0.46955582", "0.46748927", "0.46545142", "0.46534598", "0.46481547", "0.46155483", "0.45986372", "0.45928583", "0.45823705", "0.45734638", "0.45590955", "0.45470458", "0.45387754", "0.45126927", "0.45054343", "0.4493584", "0.4485794", "0.4471099" ]
0.75582355
0
Returns a standard php array from a \SolrObject instance.
public function standarize_solr_obj(\SolrObject $obj) { $properties = $obj->getPropertyNames(); $docdata = array(); foreach($properties as $name) { // http://php.net/manual/en/solrobject.getpropertynames.php#98018. $name = trim($name); $docdata[$name] = $obj->offsetGet($name); } return $docdata; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function & toArray()\n\t{\n\t\t$x = new ArrayObject($this->data);\n\t\treturn $x;\n\t}", "function toArray($object);", "public function getAsArray();", "public function toArray() : array{\n return get_object_vars( $this );\n }", "public function toArray() :array {\n return get_object_vars($this);\n }", "public function objectToArray()\n {\n return get_object_vars($this);\n }", "public function toObjects() {\n // Since the index is stored as reference => object we don't need to do anything to it\n return $this->getIndex();\n }", "public function toObjects() {\n // Since the index is stored as reference => object we don't need to do anything to it\n return $this->getIndex();\n }", "public function __toArray(): array\n {\n return call_user_func('get_object_vars', $this);\n }", "public function objectToArray($object): static;", "public function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "public function toArray() {\n return get_object_vars($this);\n }", "public function toArray() {\n return get_object_vars($this);\n }", "public function toArray() {\n return get_object_vars($this);\n }", "public function toArray()\n {\n return get_object_vars($this);\n }", "public function toArray(): array\r\n {\r\n return get_object_vars($this);\r\n }", "public function toArray() {\n return get_object_vars($this);\n }", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "public function arr() {\n\t\t\treturn \\uri\\generate::to_array($this->object);\n\t\t}", "public function toSearchableArray()\n {\n $array = $this->toArray();\n\n // Customize array...\n\n return $array;\n }", "public function toSearchableArray()\n {\n $array = $this->toArray();\n\n // Customize array...\n\n return $array;\n }", "public function asArray();" ]
[ "0.6269261", "0.6158128", "0.5996956", "0.5983622", "0.59305996", "0.5922833", "0.5908228", "0.5908228", "0.58818424", "0.5861612", "0.584851", "0.5839777", "0.5839777", "0.58378035", "0.58331996", "0.58163863", "0.5814264", "0.5813811", "0.5813811", "0.5813811", "0.5813811", "0.5813811", "0.5813811", "0.5813811", "0.5813811", "0.5813811", "0.58127904", "0.57984686", "0.57984686", "0.5797722" ]
0.6838079
0
Index files attached to the docuemnt, ensuring the index matches the current document files. For documents that aren't known to be new, we check the index for existing files. New files we will add. Existing and unchanged files we will skip. File that are in the index but not on the document will be deleted from the index. Files that have changed will be reindexed.
protected function process_document_files($document) { if (!$this->file_indexing_enabled()) { return; } // Maximum rows to process at a time. $rows = 500; // Get the attached files. $files = $document->get_files(); // If this isn't a new document, we need to check the exiting indexed files. if (!$document->get_is_new()) { // We do this progressively, so we can handle lots of files cleanly. list($numfound, $indexedfiles) = $this->get_indexed_files($document, 0, $rows); $count = 0; $idstodelete = array(); do { // Go through each indexed file. We want to not index any stored and unchanged ones, delete any missing ones. foreach ($indexedfiles as $indexedfile) { $fileid = $indexedfile->solr_fileid; if (isset($files[$fileid])) { // Check for changes that would mean we need to re-index the file. If so, just leave in $files. // Filelib does not guarantee time modified is updated, so we will check important values. if ($indexedfile->modified != $files[$fileid]->get_timemodified()) { continue; } if (strcmp($indexedfile->title, $files[$fileid]->get_filename()) !== 0) { continue; } if ($indexedfile->solr_filecontenthash != $files[$fileid]->get_contenthash()) { continue; } if ($indexedfile->solr_fileindexstatus == document::INDEXED_FILE_FALSE && $this->file_is_indexable($files[$fileid])) { // This means that the last time we indexed this file, filtering blocked it. // Current settings say it is indexable, so we will allow it to be indexed. continue; } // If the file is already indexed, we can just remove it from the files array and skip it. unset($files[$fileid]); } else { // This means we have found a file that is no longer attached, so we need to delete from the index. // We do it later, since this is progressive, and it could reorder results. $idstodelete[] = $indexedfile->id; } } $count += $rows; if ($count < $numfound) { // If we haven't hit the total count yet, fetch the next batch. list($numfound, $indexedfiles) = $this->get_indexed_files($document, $count, $rows); } } while ($count < $numfound); // Delete files that are no longer attached. foreach ($idstodelete as $id) { // We directly delete the item using the client, as the engine delete_by_id won't work on file docs. $this->get_search_client()->deleteById($id); } } // Now we can actually index all the remaining files. foreach ($files as $file) { $this->add_stored_file($document, $file); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexCrawledDocuments() {\n\t\tforeach ( $this->aFiles as $sFile ) {\n\t\t\t$oRepoFile = new SplFileInfo( $sFile );\n\t\t\tif ( !$oRepoFile->isFile() ) continue;\n\n\t\t\t$sFileName = $oRepoFile->getFilename();\n\t\t\t$sDocType = $this->mimeDecoding( $oRepoFile->getExtension() );\n\t\t\tif ( !$this->checkDocType( $sDocType, $sFileName ) ) continue;\n\n\t\t\tif ( !$this->oMainControl->bCommandLineMode ) set_time_limit( $this->iTimeLimit );\n\n\t\t\tif ( $this->sizeExceedsMaxDocSize( $oRepoFile->getSize(), $sFileName ) ) continue;\n\n\t\t\t//Insert URL to Filename\n\t\t\t$rURL = BsConfig::get( 'MW::ExtendedSearch::ExternalRepo' );\n\t\t\t$sURL = BsConfig::get( 'MW::ExtendedSearch::ExternalRepoUrl' );\n\t\t\t//Replace realpath with webserver url only if $sUrl is set, otherwise work as before\n\t\t\tif($sURL == \"\"){\n\t\t\t $sRepoFileRealPath = \"file:///\" . $oRepoFile->getRealPath();\n\t\t\t}else{\n\t\t\t $sRepoFileRealPath = $this->getFilePath( $rURL, $sURL, $oRepoFile );\n\t\t\t}\n\n\t\t\t$timestampImage = wfTimestamp( TS_ISO_8601, $oRepoFile->getMTime() );\n\n\t\t\tif ( $this->checkExistence( $oRepoFile->getRealPath(), 'external', $timestampImage, $sFileName ) ) continue;\n\n\t\t\t$text = $this->getFileText( $oRepoFile->getRealPath(), $sFileName );\n\n\t\t\t$doc = $this->makeRepoDocument( $sDocType, utf8_encode( $sFileName ), $text, utf8_encode( $sRepoFileRealPath ), $timestampImage );\n\t\t\t$this->writeLog( $sFileName );\n\n\t\t\twfRunHooks( 'BSExtendedSearchBeforeAddExternalFile', array( $this, $oRepoFile, &$doc ) );\n\n\t\t\tif ( $doc ) {\n\t\t\t\t// mode and ERROR_MSG_KEY are only passed for the case when addsFile fails\n\t\t\t\t$this->oMainControl->addDocument( $doc, $this->mode, self::S_ERROR_MSG_KEY );\n\t\t\t}\n\t\t}\n\t}", "public function uses_file_indexing() {\n return true;\n }", "public function actionIndexFiles()\n {\n $manager = new Manager(['module' => $this->module]);\n $manager->indexAll();\n }", "function readFiles($doc_files)\n{\n $inverted_index = new InvertedIndex();\n\n foreach ($doc_files as $doc_index=>$doc) {\n // open file\n $line = file_get_contents($doc);\n if ($line == \"\") {\n continue;\n }\n\n $line = preg_replace('!\\s+!', ' ', $line);\n // lowercase tokens\n $line = strtolower($line);\n $word_counter = 1;\n // remove punctuations and special characters\n $line = preg_replace('/[^A-Za-z0-9 ]/', \"\", $line);\n\n $tokens = explode(\" \", trim($line));\n foreach ($tokens as $token) {\n if ($token == \"\") {\n continue;\n } else {\n $result = PhraseParser::stemTerms($token, 'en-US');\n $token = $result[0];\n $inverted_index->addTerm($token, $doc_index, $word_counter);\n }\n $word_counter++;\n }\n }\n $inverted_index->sortPostings();\n print(\"Average doc length: \".$inverted_index->calcAvgDocLength().\"\\n\");\n return $inverted_index;\n}", "public function indexCrawledDocuments() {\n\t\twhile ( $document = $this->oDbr->fetchObject( $this->documentsDb ) ) {\n\t\t\t$this->count++;\n\t\t\tif ( !$this->oMainControl->bCommandLineMode ) set_time_limit( $this->iTimeLimit );\n\n\t\t\tif ( $this->doesLinkedPathFilterMatch( $document->el_to ) ) continue;\n\n\t\t\t$path = urldecode( $document->el_to );\n\t\t\t$path = str_replace( \"file:///\", \"\", $path );\n\t\t\t$fileInfo = new SplFileInfo( $path );\n\t\t\tif ( !$fileInfo->isFile() ) continue;\n\n\t\t\t$filename = explode( '/', $path );\n\t\t\t$filename = array_pop( $filename );\n\n\t\t\tif ( $this->sizeExceedsMaxDocSize( $fileInfo->getSize(), $filename ) ) continue;\n\n\t\t\t$ext = preg_split( '#[/\\\\.]+#', $path );\n\t\t\t$ext = strtolower( array_pop( $ext ) );\n\t\t\t$docType = $this->mimeDecoding( $ext ); // really needed for file extensions? or is it a relict from mw images (repo)\n\t\t\tif ( !$this->checkDocType( $docType, $filename ) ) continue;\n\n\t\t\t$time = @filemtime( urldecode( $path ) );\n\t\t\t$date = date( \"YmdHis\", $time );\n\n\t\t\tif ( $this->checkExistence( $path, 'external', $date, $filename ) ) continue;\n\n\t\t\t$fileRealPath = $fileInfo->getRealPath();\n\t\t\t$fileText = $this->getFileText( $fileRealPath, $filename );\n\t\t\t$doc = $this->makeLinkedDocument( $docType, $filename, $fileText, $path, $date );\n\t\t\t$this->writeLog( $path );\n\t\t\tif ( $doc ) {\n\t\t\t\t// mode and ERROR_MSG_KEY are only passed for the case when addDocument fails\n\t\t\t\t$this->oMainControl->addDocument( $doc, $this->mode, self::S_ERROR_MSG_KEY );\n\t\t\t}\n\t\t}\n\t}", "public function index(CFile $file) {\n\t\t/*\n\t\t * Workaround for indexing large files:\n\t\t * * Based on the value defined in config data,\n\t\t * * files with file_size greater than specified limit\n\t\t * * are not indexed for searching.\n\t\t * * Negative value :<=> no filesize limit\n\t\t */\n\t\t$index_max_file_size = apmgetConfig ( 'index_max_file_size', 0 );\n\t\tif ($file->file_size > 0 && ($index_max_file_size < 0 || ( int ) $file->file_size <= $index_max_file_size * 1024)) {\n\t\t\t// get the parser application\n\t\t\t$parser = apmgetConfig ( 'parser_' . $file->file_type );\n\t\t\tif (! $parser) {\n\t\t\t\t$parser = apmgetConfig ( 'parser_default' );\n\t\t\t}\n\t\t\tif (! $parser) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// buffer the file\n\t\t\t$file->_filepath = apm_BASE_DIR . '/files/' . $file->file_project . '/' . $file->file_real_filename;\n\t\t\tif (file_exists ( $file->_filepath )) {\n\t\t\t\t$fp = fopen ( $file->_filepath, 'rb' );\n\t\t\t\t$x = fread ( $fp, $file->file_size );\n\t\t\t\tfclose ( $fp );\n\t\t\t\t\n\t\t\t\t$ignore = apmgetSysVal ( 'FileIndexIgnoreWords' );\n\t\t\t\t$ignore = $ignore ['FileIndexIgnoreWords'];\n\t\t\t\t$ignore = explode ( ',', $ignore );\n\t\t\t\t\n\t\t\t\t$x = strtolower ( $x );\n\t\t\t\t$x = preg_replace ( \"/[^A-Za-z0-9 ]/\", \"\", $x );\n\t\t\t\tforeach ( $ignore as $ignoreWord ) {\n\t\t\t\t\t$x = str_replace ( \" $ignoreWord \", ' ', $x );\n\t\t\t\t}\n\t\t\t\t$x = str_replace ( ' ', ' ', $x );\n\t\t\t\t\n\t\t\t\t$words = explode ( ' ', $x );\n\t\t\t\tforeach ( $words as $index => $word ) {\n\t\t\t\t\tif ('' == trim ( $word )) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$q = $this->query;\n\t\t\t\t\t$q->addTable ( 'files_index' );\n\t\t\t\t\t$q->addInsert ( 'file_id', $file->file_id );\n\t\t\t\t\t$q->addInsert ( 'word', $word );\n\t\t\t\t\t$q->addInsert ( 'word_placement', $index );\n\t\t\t\t\t$q->exec ();\n\t\t\t\t\t$q->clear ();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// TODO: if the file doesn't exist.. should we delete the db record?\n\t\t\t}\n\t\t}\n\t\t\n\t\t$file->file_indexed = 1;\n\t\t$file->store ();\n\t\t\n\t\treturn count ( $words );\n\t}", "public function testBulkIndex(): void\n {\n $index = $this->_getClient()->getIndex('cryptocurrencies');\n\n $anonCoin = new Document('1', ['name' => 'anoncoin']);\n $ixCoin = new Document('2', ['name' => 'ixcoin']);\n\n $index->addDocuments([$anonCoin, $ixCoin]);\n\n $this->assertEquals('anoncoin', $index->getDocument(1)->get('name'));\n $this->assertEquals('ixcoin', $index->getDocument(2)->get('name'));\n\n $anonCoin->set('name', 'AnonCoin');\n $ixCoin->set('name', 'iXcoin');\n\n $index->updateDocuments([$anonCoin, $ixCoin]);\n\n $this->assertEquals('AnonCoin', $index->getDocument(1)->get('name'));\n $this->assertEquals('iXcoin', $index->getDocument(2)->get('name'));\n\n $index->deleteDocuments([$anonCoin, $ixCoin]);\n\n $this->expectException(NotFoundException::class);\n $index->getDocument(1);\n $index->getDocument(2);\n }", "protected function getFileIndexRepository() {}", "protected function getFileIndexRepository() {}", "protected function getFileIndexRepository() {}", "protected function getFileIndexRepository() {}", "protected function getFileIndexRepository() {}", "protected function doIndexDocument() {\n if ($this->showRecordInSearch())\n {\n $this->service->index($this->owner);\n }\n }", "function idx_addPage($page){\n global $conf;\n\n // load known words and documents\n $page_idx = file($conf['cachedir'].'/page.idx');\n\n // get page id (this is the linenumber in page.idx)\n $pid = array_search(\"$page\\n\",$page_idx);\n if(!is_int($pid)){\n $page_idx[] = \"$page\\n\";\n $pid = count($page_idx)-1;\n // page was new - write back\n $fh = fopen($conf['cachedir'].'/page.idx','w');\n if(!$fh) return false;\n fwrite($fh,join('',$page_idx));\n fclose($fh);\n }\n\n // get word usage in page\n $words = idx_getPageWords($page);\n if($words === false) return false;\n if(!count($words)) return true;\n\n // Open index and temp file\n $idx = fopen($conf['cachedir'].'/index.idx','r');\n $tmp = fopen($conf['cachedir'].'/index.tmp','w');\n if(!$idx || !$tmp){\n trigger_error(\"Failed to open index files\", E_USER_ERROR);\n return false;\n }\n\n // copy from index to temp file, modifying were needed\n $lno = 0;\n $line = '';\n while (!feof($idx)) {\n // read full line\n $line .= fgets($idx, 4096);\n if(substr($line,-1) != \"\\n\") continue;\n\n // write a new Line to temp file\n idx_writeIndexLine($tmp,$line,$pid,$words[$lno]);\n\n $line = ''; // reset line buffer\n $lno++; // increase linecounter\n }\n fclose($idx);\n\n // add missing lines (usually index and word should contain\n // the same number of lines, however if the page contained\n // new words the word file has some more lines which need to\n // be added here\n $word_idx = file($conf['cachedir'].'/word.idx');\n $wcnt = count($word_idx);\n for($lno; $lno<$wcnt; $lno++){\n idx_writeIndexLine($tmp,'',$pid,$words[$lno]);\n }\n\n // close the temp file and move it over to be the new one\n fclose($tmp);\n return rename($conf['cachedir'].'/index.tmp',\n $conf['cachedir'].'/index.idx');\n}", "function createIndex(&$files, &$word_map, $tokenizationMethod){\r\n /*TODO: How to free up memory of doc_vector object is the question!\r\n http://stackoverflow.com/questions/584960/whats-better-at-freeing-memory-\r\n with-php-unset-or-var-null\r\n */\r\n $doc_vector = null;\r\n for ($fil = 0;$fil<count($files);$fil++) {\r\n $content = file_get_contents($files[$fil]);\r\n $words = explode(\" \", $content);\r\n $count = count($words);\r\n for ($j=0;$j<$count;$j++) {\r\n\t\t\t\r\n\t\t\t$word = filter($words[$j]);\r\n\t\t\t$processedWord = tokenize(array($word), $tokenizationMethod);\t\r\n\t\t\t$offset = $j + 1;\r\n\t\t\t$f = $fil+1;\r\n\t\t\tfor ($index=0;$index<count($processedWord);$index++) {\t\r\n\t\t\t\tmapWord($word_map, $processedWord[$index], $offset, $f);\r\n\t\t\t}\r\n }\r\n }\r\n}", "private function createFolderIndex(){\n //Just testing the command\n //$this->info('Starting to search the folder: '.$this->file_storage);\n $this->folders = array();\n $this->invalid_files = array();\n $this->count = 0;\n\n //Tagging all files to be able to find removed files at the end\n $SQL = \"UPDATE files SET found = '0'\";\n DB::connection('mysql')->update($SQL);\n $SQL = \"UPDATE folders SET found = '0'\";\n DB::connection('mysql')->update($SQL);\n\n //Checking if cache file exist, if not just create all the index on ES\n $this->checkCacheFolder();\n //Loop through the directories to get files ad folders\n $this->listFolderFiles($this->file_storage);//$_ENV['EBT_FILE_STORAGE']);\n //Check if any folder is missing from cache and try to create on ES\n $this->compareCacheFolders();\n\n //Remove files/folders that hasn't been found\n //if ($this->confirm('Do you wish to remove missing files? [y|N]')) {\n $this->removeMissingFiles();\n //}\n }", "protected function processChangedAndNewFiles() {}", "public function commitIndex()\n {\n // either open or create the index\n $this->index = $this->openIndex(APPLICATION_PATH . '/data/search/jobs');\n $this->index->commit();\n $this->_log($this->index->count() . ' documents indexed.');\n }", "public function testAddingIndex()\n\t{\n\t\tR::nuke();\n\t\t\n\t\t$sql = 'CREATE TABLE song ( \n\t\t\tid INTEGER PRIMARY KEY AUTOINCREMENT, \n\t\t\talbum_id INTEGER,\n\t\t\tcategory TEXT\n\t\t) ';\n\t\t\n\t\tR::exec( $sql );\n\t\t\n\t\t$writer = R::getWriter();\n\t\t\n\t\t$indexes = R::getAll('PRAGMA index_list(\"song\") ');\n\t\t\n\t\tasrt( count( $indexes ), 0 );\n\t\t\n\t\t$writer->addIndex( 'song', 'index1', 'album_id' );\n\t\t\n\t\t$indexes = R::getAll('PRAGMA index_list(\"song\") ');\n\t\t\n\t\tasrt( count( $indexes ), 1 );\n\t\t\n\t\t$writer->addIndex( 'song', 'index1', 'album_id' );\n\t\t\n\t\t$indexes = R::getAll('PRAGMA index_list(\"song\") ');\n\t\t\n\t\tasrt( count( $indexes ), 1 );\n\t\t\n\t\t$writer->addIndex( 'song', 'index2', 'category' );\n\t\t\n\t\t$indexes = R::getAll('PRAGMA index_list(\"song\") ');\n\t\t\n\t\tasrt( count( $indexes ), 2 );\n\t\t\n\t\ttry {\n\t\t\t$writer->addIndex( 'song', 'index1', 'nonexistant' );\n\t\t\tpass();\n\t\t} catch ( \\Exception $ex ) {\n\t\t\tfail();\n\t\t}\n\t\t\n\t\t$indexes = R::getAll('PRAGMA index_list(\"song\") ');\n\t\tasrt( count( $indexes ), 2 );\n\t\t\n\t\ttry {\n\t\t\t$writer->addIndex( 'nonexistant', 'index1', 'nonexistant' );\n\t\t\tpass();\n\t\t} catch ( \\Exception $ex ) {\n\t\t\tfail();\n\t\t}\n\t\t\n\t\t$indexes = R::getAll('PRAGMA index_list(\"song\") ');\n\t\tasrt( count( $indexes ), 2 );\n\t}", "public function indexSolrDocs(){\n\t\t$solrDocArray = $this->solrDocArray;\n\t\tif(is_array($solrDocArray)){\n\t\t\t$solr = new Apache_Solr_Service('localhost', 8983, '/solr');\n\t\t\t\n\t\t\tif ($solr->ping()) { // if we can ping the solr server...\n\t\t\t\ttry{\n\t\t\t\t\t$updateResponse = $solr->addDocuments($solrDocArray);\n\t\t\t\t\t$solr->commit();\n\t\t\t\t}\n\t\t\t\tcatch (Exception $e) {\n\t\t\t\t\t$errors = $this->errors;\n\t\t\t\t\t$errors[] = $e->getMessage(); \n\t\t\t\t\t$this->errors = $errors;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t$errors = $this->errors;\n\t\t\t$errors[] = $this->errors = \"Solr Down: failed to respond to ping.\"; \n\t\t\t$this->errors = $errors;\n\t\t\t}\n\t\t\t\n\t\t}//yes, we do have docs to add\n\t\t\n }", "public function reindexAll()\n {\n\n //@todo: indexers should be dynamically injected. Probable via `$this->getIndeces()`\n /** @var St_SphinxSearch_Model_Fulltext $fulltextIndex */\n $fulltextIndex = Mage::getModel('st_sphinxsearch/fulltext');\n\n $fulltextIndex->rebuildIndex();\n\n return;\n /** @var Mage_Core_Model_Resource $resourceSingleton */\n $resourceSingleton = Mage::getSingleton('core/resource');\n\n /** @var Varien_Db_Adapter_Interface $writeAdapater */\n $writeAdapater = $resourceSingleton->getConnection('core_write');\n\n /** @var Varien_Db_Adapter_Interface $readAdapter */\n $readAdapter = $resourceSingleton->getConnection('core_read');\n\n /** @var string $tableName */\n $tableName = $readAdapter->getTableName('st_sphinxsearch_fulltext_tmp');\n\n /** @var Mage_CatalogSearch_Model_Resource_Indexer_Fulltext $indexerFulltext */\n $indexerFulltext = Mage::getResourceModel('catalogsearch/indexer_fulltext');\n\n $fulltextTableName = $indexerFulltext->getTable('fulltext');\n\n $sql = \"CREATE TABLE IF NOT EXISTS `$tableName` LIKE `$fulltextTableName`\";\n\n $writeAdapater->query($sql);\n $t=1;\n }", "public function addToIndex()\n\t{\n\t\tif (!$this->exists) {\n\t\t\tthrow new \\Exception('Document does not exist.');\n\t\t}\n\n\t\t$params = $this->getBasicEsParams();\n\t\t// By default all writes to index will be synchronous\n\t\t$params['custom'] = ['refresh' => true];\n\n\t\t// Get our document body data.\n\t\t$params['body'] = $indexDocumentData = $this->getIndexDocumentData();\n\n\t\t// The id for the document must always mirror the\n\t\t// key for this model, even if it is set to something\n\t\t// other than an auto-incrementing value. That way we\n\t\t// can do things like remove the document from\n\t\t// the index, or get the document from the index.\n\t\t$params['id'] = $this->getKey();\n\n\t\ttry {\n\t\t\t$result = $this->getElasticSearchClient()->index($params);\n\n\t\t\tDB::table($this->getTable())\n\t\t\t\t->where($this->getKeyName(), '=', $this->getKeyForSaveQuery())\n\t\t\t\t->update(['indexed_at' => now()]);\n\n\t\t\treturn $result;\n\t\t}\n\t\tcatch (\\Exception $e) {\n\t\t\tDB::table($this->getTable())\n\t\t\t\t->where($this->getKeyName(), '=', $this->getKeyForSaveQuery())\n\t\t\t\t->update(['indexed_at' => null]);\n\n\t\t\tthrow $e;\n\t\t}\n\t}", "public function updateIndex()\n {\n if ($this->es_index_helper) {\n call_user_func($this->es_index_helper, $this);\n }\n }", "private function checkFileExtension($filename, $name, $parent){\n $ext_arr = explode(\".\",$filename);\n $m = count($ext_arr)-1;\n $valid = false;\n $index_time = date(\"Y-m-d H:i:s\");\n $last_update = date (\"Y-m-d H:i:s\", filemtime($filename));\n\n //Checking if the file has been changed since last time\n $new_file = true;\n $file_id = 0;\n $is_different = true;\n //$f = File::where('name', '=', $name)->where('path', '=', $filename)->get();\n $SEL = \"SELECT * FROM files WHERE name='\".$name.\"' AND path='\".$filename.\"'\";\n $f = DB::connection('mysql')->select($SEL);\n //Getting the amount of clicks\n\n if(count($f) > 0){\n $file_id = $f[0]->id;\n //$this->info('File '.$name.' last update => '.$last_update.' - db last update '.$f[0]->last_file_change);\n if($f[0]->last_file_change != $last_update){\n //$this->info('Different');\n //Updating files\n $SQL = \"UPDATE files SET updated_at = '$index_time',\n last_file_change = '$last_update',\n found = '1' WHERE id = '$file_id'\";\n $update = DB::connection('mysql')->update($SQL);\n //Log::info(\"Update Query -> \".$SQL.\" with result \".$update);\n }else{\n $is_different = false;\n $new_file = false;\n $SQL = \"UPDATE files SET found = '1' WHERE id = '$file_id'\";\n $update = DB::connection('mysql')->update($SQL);\n //$this->info('Is the same');\n }\n }\n //If the date on the file has been changed, than re-index that file\n $extension = strtolower($ext_arr[$m]);\n if($is_different){\n switch ($extension) {\n case 'pdf':\n $valid = true;\n //This is to read the pdf file\n $reader = new \\Asika\\Pdf2text;\n $reader->setFilename($filename);\n $reader->decodePDF();\n $content = $reader->output();\n //Log::info('Text from file '.$fileInfo->getFilename().':'.$output);\n break;\n case 'doc':\n $valid = true;\n $content = $this->readDocFile($filename);\n break;\n case 'docx':\n $valid = true;\n $content = $this->readDocxFile($filename);\n break;\n case 'txt':\n $valid = true;\n $handle = fopen($filename, \"rb\");\n $content = fread($handle, filesize($filename));\n fclose($handle);\n break;\n case 'csv':\n $valid = true;\n $handle = fopen($filename, \"rb\");\n $content = fread($handle, filesize($filename));\n fclose($handle);\n break;\n default:\n # code...\n break;\n }\n }\n\n if($valid){\n\n $created_now = false;\n if($file_id<1){\n //Create object on mysql table\n $file = new File;\n $file->name = str_replace(\"'\",\"\\'\",$name);\n $file->path = str_replace(\"'\",\"\\'\",$filename);\n $file->extension = $extension;\n $file->updated_at = $index_time;\n $file->last_file_change = $last_update;\n $file->found = 1;\n // save the folder to the database\n $file_db = $file->save();\n $file_id = $file->id;\n $created_now = true;\n }\n\n $clicks = $this->checkClickCount($name, $filename, $file_id);\n //Creating the array for elasticsearch\n $body['name'] = $name;\n $body['parent'] = $parent;\n $body['full_path'] = $filename;\n $body['extension'] = $extension;\n $body['updated_at'] = $last_update;\n $body['index_stamp']= $index_time;\n $body['clicks'] = $clicks;\n $body['content'] = preg_replace('/[^A-Za-z0-9\\. -]/', '', $content);\n\n //$this->info('Mysql ID for file '.$body['name'].' -> '.$file_id);\n if($created_now){\n //Sending to Elasticsearch\n $this->createDocument($file_id, $body);\n }\n //Log::info(\"Indexing file \".$file_id.\" - \".$name);\n }else{\n $clicks = $this->checkClickCount($name, $filename, $file_id);\n if($file_id>0 && $clicks>0){\n //Sending to Elasticsearch\n $this->updateClicks($file_id, $clicks);\n }\n //$arr['name'] = $name;\n //$arr['path'] = $filename;\n if($name!=\"Thumbs.db\" && $name!=\".DS_Store\" && $is_different){\n $ct = count($this->invalid_files);\n $this->invalid_files[$ct]['name'] = $name;\n $this->invalid_files[$ct]['path'] \t= $filename;\n }\n }\n }", "public function optimizeIndex()\n {\n // either open or create the index\n $this->index = $this->openIndex(APPLICATION_PATH . '/data/search/jobs');\n $this->index->optimize();\n }", "public static function resetIndex(){\n\t\t$sql = \"TRUNCATE TABLE `documents`\";\n\t\t$result = mysqli_query(self::$conn, $sql) or die(mysqli_error(self::$conn));\n\t\t$sql = \"TRUNCATE TABLE `terms`\";\n\t\t$result = mysqli_query(self::$conn, $sql) or die(mysqli_error(self::$conn));\n\t\t$sql = \"TRUNCATE TABLE `term_documents`\";\n\t\t$result = mysqli_query(self::$conn, $sql) or die(mysqli_error(self::$conn));\n\t\t// delete all files from documents directory\n\t\tarray_map('unlink', glob('documents/' . '*.txt'));\n\t}", "public function rebuildIndex()\n {\n $this->elastic->deleteIndex(self::INDEX);\n $this->elastic->addIndexCompanion(self::INDEX);\n }", "private function indexFile(File $path, $name) {\n if (!isset($this->index[$name])) {\n $this->index[$name] = array();\n }\n\n $rootPath = $this->rootPath->getPath();\n $path = $path->getPath();\n\n $path = str_replace($rootPath . File::DIRECTORY_SEPARATOR, '', $path);\n\n $this->index[$name][] = $path;\n\n sort($this->index[$name]);\n }", "public function testDelete()\n {\n $sampleIndexDir = dirname(__FILE__) . '/_indexSample/_files';\n $tempIndexDir = dirname(__FILE__) . '/_files';\n if (!is_dir($tempIndexDir)) {\n mkdir($tempIndexDir);\n }\n\n $this->_clearDirectory($tempIndexDir);\n\n $indexDir = opendir($sampleIndexDir);\n while (($file = readdir($indexDir)) !== false) {\n if (!is_dir($sampleIndexDir . '/' . $file)) {\n copy($sampleIndexDir . '/' . $file, $tempIndexDir . '/' . $file);\n }\n }\n closedir($indexDir);\n\n\n $index = Zend_Search_Lucene::open($tempIndexDir);\n\n $this->assertFalse($index->isDeleted(2));\n $index->delete(2);\n $this->assertTrue($index->isDeleted(2));\n\n $index->commit();\n\n unset($index);\n\n $index1 = Zend_Search_Lucene::open($tempIndexDir);\n $this->assertTrue($index1->isDeleted(2));\n unset($index1);\n\n $this->_clearDirectory($tempIndexDir);\n }", "public function commitIndex() {\n $this->index->commit();\n $this->index->optimize();\n }" ]
[ "0.67954487", "0.65603334", "0.62800926", "0.62327063", "0.6158987", "0.59532964", "0.58117896", "0.57786435", "0.57786435", "0.5777791", "0.5777791", "0.5777791", "0.5776127", "0.5733713", "0.568778", "0.56870806", "0.56388587", "0.56255394", "0.56169635", "0.5605053", "0.55671865", "0.55652624", "0.55641675", "0.55261546", "0.54867595", "0.5459954", "0.54412776", "0.5432957", "0.5430288", "0.54286706" ]
0.68445194
0
Checks to see if a passed file is indexable.
protected function file_is_indexable($file) { if (!empty($this->config->maxindexfilekb) && ($file->get_filesize() > ($this->config->maxindexfilekb * 1024))) { // The file is too big to index. return false; } $mime = $file->get_mimetype(); if ($mime == 'application/vnd.moodle.backup') { // We don't index Moodle backup files. There is nothing usefully indexable in them. return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function uses_file_indexing() {\n return true;\n }", "function hasIndex($path, $filename)\n {\n $abs = $path.'\\\\'.$filename;\n\n if(file_exists($abs))\n {\n $info = pathinfo($abs);\n\n if (is_dir($abs)) {\n $dir = new DirectoryIterator($abs);\n foreach ($dir as $file) {\n if (!$file->isDot()) {\n $info = pathinfo($file);\n if ( strtolower($info['filename']) == 'index' && !$file->isDir()) { return true; } \n }\n }\n }\n else { if (strtolower($info['filename']) == 'index') { return true; } }\n }\n return false;\n }", "public function file_indexing_enabled() {\n return (bool)$this->config->fileindexing;\n }", "public function hasIndexDirectoryPath();", "function isIndexable()\r\n {\r\n return true;\r\n }", "function isIndexable()\n {\n return true;\n }", "public function checkForIndex( $index, $table )\n\t{\n\t\treturn false;\n\t}", "public function index(CFile $file) {\n\t\t/*\n\t\t * Workaround for indexing large files:\n\t\t * * Based on the value defined in config data,\n\t\t * * files with file_size greater than specified limit\n\t\t * * are not indexed for searching.\n\t\t * * Negative value :<=> no filesize limit\n\t\t */\n\t\t$index_max_file_size = apmgetConfig ( 'index_max_file_size', 0 );\n\t\tif ($file->file_size > 0 && ($index_max_file_size < 0 || ( int ) $file->file_size <= $index_max_file_size * 1024)) {\n\t\t\t// get the parser application\n\t\t\t$parser = apmgetConfig ( 'parser_' . $file->file_type );\n\t\t\tif (! $parser) {\n\t\t\t\t$parser = apmgetConfig ( 'parser_default' );\n\t\t\t}\n\t\t\tif (! $parser) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// buffer the file\n\t\t\t$file->_filepath = apm_BASE_DIR . '/files/' . $file->file_project . '/' . $file->file_real_filename;\n\t\t\tif (file_exists ( $file->_filepath )) {\n\t\t\t\t$fp = fopen ( $file->_filepath, 'rb' );\n\t\t\t\t$x = fread ( $fp, $file->file_size );\n\t\t\t\tfclose ( $fp );\n\t\t\t\t\n\t\t\t\t$ignore = apmgetSysVal ( 'FileIndexIgnoreWords' );\n\t\t\t\t$ignore = $ignore ['FileIndexIgnoreWords'];\n\t\t\t\t$ignore = explode ( ',', $ignore );\n\t\t\t\t\n\t\t\t\t$x = strtolower ( $x );\n\t\t\t\t$x = preg_replace ( \"/[^A-Za-z0-9 ]/\", \"\", $x );\n\t\t\t\tforeach ( $ignore as $ignoreWord ) {\n\t\t\t\t\t$x = str_replace ( \" $ignoreWord \", ' ', $x );\n\t\t\t\t}\n\t\t\t\t$x = str_replace ( ' ', ' ', $x );\n\t\t\t\t\n\t\t\t\t$words = explode ( ' ', $x );\n\t\t\t\tforeach ( $words as $index => $word ) {\n\t\t\t\t\tif ('' == trim ( $word )) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$q = $this->query;\n\t\t\t\t\t$q->addTable ( 'files_index' );\n\t\t\t\t\t$q->addInsert ( 'file_id', $file->file_id );\n\t\t\t\t\t$q->addInsert ( 'word', $word );\n\t\t\t\t\t$q->addInsert ( 'word_placement', $index );\n\t\t\t\t\t$q->exec ();\n\t\t\t\t\t$q->clear ();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// TODO: if the file doesn't exist.. should we delete the db record?\n\t\t\t}\n\t\t}\n\t\t\n\t\t$file->file_indexed = 1;\n\t\t$file->store ();\n\t\t\n\t\treturn count ( $words );\n\t}", "function isIndexable()\n {\n return true;\n }", "public function fileIndexStatusIsTrueIfUidIsSet() {}", "public function isIndex();", "public function hasIndex(): bool\n {\n return true;\n }", "public function isIndex(): bool;", "public function hasDefaultIndexDirectoryPath();", "public function checkForIndex( $index, $table );", "public function isIndexable(Page $page): bool\n {\n $templates = $this->options['templates'] ?? [];\n $pageTemplate = $page->intendedTemplate()->name();\n $excludePages = $this->options['exclude']['pages'] ?? [];\n\n if (preg_match('!^(?:' . implode('|', $excludePages) . ')$!i', $page->id())) {\n return false;\n }\n\n if ($page->isUnlisted()) {\n return false;\n }\n\n return in_array($pageTemplate, $templates, true);\n }", "public function indexExists( $tablename, $indexname );", "function isIndexed() ;", "public function hasIndex() {\n return $this->_has(14);\n }", "public function isIndexed() {}", "public function isIndexed() {}", "public function isIndexed() {}", "function isAllowedFile($file) {\n\t\t$path = pathinfo($file);\n\t\t$dir = preg_replace('#[\\./]*(.*)/*#', '$1', $path['dirname']);\n\t\t$file = $path['basename'];\n\t\tif ($dir == '' && $file == '.htaccess') return true;\n\t\tif ($dir == '' && $file == 'index.php') return true;\n\t\tif ($dir == '' && $file == 'documentation.txt') return true;\n\t\tif ($dir == 'data' && $file == 'hypha.html') return true;\n\t\tif ($dir == 'data' && $file == 'hypha.css') return true;\n\t\tif ($dir == 'system/core') return true;\n\t\tif ($dir == 'system/datatypes') return true;\n\t\tif ($dir == 'system/languages') return true;\n\t\tif ($dir == 'system/php-dom-wrapper') return true;\n\t\tif ($dir == 'system/wymeditor') return true;\n\t\treturn false;\n\t}", "public function testSupportsIndexSupported() {\n $support = NodeStatus::supportsIndex(reset($this->items)->getIndex());\n $this->assertTrue($support, 'Index containing a node datasource is supported.');\n }", "public function is_readable($file)\n {\n }", "public function is_readable($file)\n {\n }", "public function is_readable($file)\n {\n }", "public function is_readable($file)\n {\n }", "public function is_readable($file)\n {\n }", "public function accept()\n\t{\n\t\t/** @var \\SplFileInfo */\n\t\t$current = $this->current();\n\n\t\tforeach ($this->excludeMasks as $mask) {\n\t\t\tif (fnmatch($mask, $current->getPathName(), FNM_NOESCAPE)) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! is_readable($current->getPathname())) {\n\t\t\tthrow new \\InvalidArgumentException(sprintf('File/directory \"%s\" is not readable.', $current->getPathname()));\n\t\t}\n\n\t\treturn TRUE;\n\t}" ]
[ "0.69158167", "0.68911785", "0.6787629", "0.6761945", "0.66530395", "0.65841174", "0.6559269", "0.6475115", "0.64705", "0.63869315", "0.6292608", "0.60971665", "0.608276", "0.6047081", "0.6044642", "0.5890538", "0.5854208", "0.5816649", "0.5781987", "0.5745017", "0.5744816", "0.57448006", "0.5733318", "0.57239044", "0.56928813", "0.56928813", "0.56928813", "0.5691459", "0.5690974", "0.5688095" ]
0.78346115
0
Return true if file indexing is supported and enabled. False otherwise.
public function file_indexing_enabled() { return (bool)$this->config->fileindexing; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function uses_file_indexing() {\n return true;\n }", "protected function file_is_indexable($file) {\n if (!empty($this->config->maxindexfilekb) && ($file->get_filesize() > ($this->config->maxindexfilekb * 1024))) {\n // The file is too big to index.\n return false;\n }\n\n $mime = $file->get_mimetype();\n\n if ($mime == 'application/vnd.moodle.backup') {\n // We don't index Moodle backup files. There is nothing usefully indexable in them.\n return false;\n }\n\n return true;\n }", "public function hasIndexDirectoryPath();", "public function supports(string $file): bool;", "public function canSetFulltextIndexed()\n {\n return $this->canSetFulltextIndexed;\n }", "public function isFilebased() {\n\t\treturn FALSE;\n\t}", "public function isFileOperationAllowed() {}", "public function supports(\\SplFileInfo $file): bool;", "public function isSupported() {\n return $this->cacheFilePath \n && is_dir($this->cacheFilePath) \n && is_writable($this->cacheFilePath);\n }", "public function hasDefaultIndexDirectoryPath();", "public function canSetFileable()\n {\n return $this->canSetFileable;\n }", "public function fileIndexStatusIsTrueIfUidIsSet() {}", "public function isFileUploadsSupported()\n {\n $checking_result = (Bootstrap::getIniParam('file_uploads') == true) ? true : false;\n\n if (!$checking_result) {\n App::instance()->setNotification('E', App::instance()->t('error'), App::instance()->t('text_file_uploads_notice'), true, 'valiator');\n }\n\n return $checking_result;\n }", "public function supports(File $file);", "public static function isSupported()\n {\n return function_exists('finfo_open');\n }", "public function can_manage_files() {\n return true;\n }", "public function hasFiles(): bool\n {\n return $this->type != 'menu_links';\n }", "function isFile() {\n\t\treturn $this->repoObj->lobSubType == 'document';\n\t}", "public function supportsFileSize()\n\t{\n\t\treturn $this->supportsFileSize;\n\t}", "public function testSupportsIndexSupported() {\n $support = NodeStatus::supportsIndex(reset($this->items)->getIndex());\n $this->assertTrue($support, 'Index containing a node datasource is supported.');\n }", "public function isFile() : bool;", "public function hasIndex(): bool\n {\n return true;\n }", "public static function isSupported(): bool;", "public function isFile() {\n return $this->_is_file;\n }", "public function isFile()\n {\n return ( $this->fileStructure->type == self::IS_FILE );\n }", "public function is_enabled() {\n\t\treturn WPSEO_Options::get( 'ryte_indexability' );\n\t}", "public function accept(): bool\n {\n $fileinfo = $this->current();\n if (self::ONLY_DIRECTORIES === (self::ONLY_DIRECTORIES & $this->mode) && $fileinfo->isFile()) {\n return false;\n } elseif (self::ONLY_FILES === (self::ONLY_FILES & $this->mode) && $fileinfo->isDir()) {\n return false;\n }\n\n return true;\n }", "public function canSetFileable();", "public function isSupported(): bool;", "public function isFile()\n {\n return $this->isFile;\n }" ]
[ "0.7904547", "0.6738836", "0.66007125", "0.6571293", "0.6497131", "0.64631677", "0.63461316", "0.6341854", "0.6321112", "0.6318555", "0.6279617", "0.6235169", "0.6214617", "0.619657", "0.6163514", "0.610955", "0.61092067", "0.60848236", "0.6062294", "0.60011375", "0.59803236", "0.598026", "0.595702", "0.59531146", "0.5942932", "0.59121764", "0.59092903", "0.59008306", "0.589659", "0.5872292" ]
0.8639273
0