query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Get the most occurring value from array. | public static function mostOccurring(array $array, $key = ''); | [
"function array_most_common_value($array) {\n\t$values = array_count_values($array);\n\tarsort($values);\n\treturn array_slice(array_keys($values), 0, 5, true)[0];\n}",
"public static function highest($array) {\n asort($array);\n return end($array);\n }",
"function getLargestValue($array) {\n return $max = array_reduce($array, function ($a, $b) {\n return $a > $b['total'] ? $a : $b['total'];\n });\n}",
"function max_occurrence() {\n $args = func_get_args();\n if (count($args) === 1 and is_array(current($args))) {\n $args = current($args);\n }\n\n return array_reduce($args, function ($carry, $item) {\n if (is_array($item) and array_key_exists('occurrences', $item) and\n is_numeric($item['occurrences']) and $item['occurrences'] > $carry['occurrences'])\n {\n return $item;\n }\n\n return $carry;\n }, init_tracker());\n}",
"function max_key($array){\n\tforeach ($array as $k => $val) {\n\t\tif ($val == max($array)) return $k;\n\t}\n}",
"function maximum($array){\r\n $n = sizeof($array);\r\n $max = 0;\r\n foreach ($array as $array_item) {\r\n if ($array_item > $max){\r\n $max = $array_item;\r\n }\r\n }\r\n return $max;\r\n }",
"public function findHighestFrequencyValue()\n {\n return $this\n ->createQueryBuilder('f')\n ->select('MAX(f.frequency)')\n ->getQuery()\n ->getSingleScalarResult()\n ;\n }",
"function get_max_array_key($answer_array){\r\n\t\treturn max(array_keys($answer_array));\r\n\t}",
"function find_max_index($arr) \n {\n $max = $arr[0]; \n for ($i = 1, $len = count($arr); $i < $len; $i++) {\n\n $max = ($arr[$i] > $max) ? $arr[$i] : $max;\n } \n return $max;\n }",
"function array_max($array)\n{\n if (empty($array)) {\n return null;\n }\n\n if (is_array($array)) {\n $max = $array[0];\n $tail = array_slice($array, 1);\n } else {\n $max = $array->current();\n $array->next();\n $tail = $array;\n }\n\n return array_reduce(\n $tail,\n function ($max, $value) {\n if ($value > $max) {\n return $value;\n } else {\n return $max;\n }\n },\n $max\n );\n}",
"function findMaximumElementFromResultArray($resultArr){\n $maxElement = $resultArr[0];\n for($i = 1; $i < count($resultArr); $i++){\n if($resultArr[$i] > $maxElement){\n $maxElement = $resultArr[$i];\n }\n }\n return $maxElement;\n }",
"public abstract function getHighestValue();",
"protected function getMaxArrayValue(array $array, $key) {\n uasort($array, function ($a, $b) use ($key) {\n return $a[$key] > $b[$key] ? -1 : 1;\n });\n\n return reset($array);\n }",
"function getLastValue($array)\n {\n if (! is_array($array)) {\n return false;\n }\n $array = array_reverse($array);\n return reset($array);\n }",
"function find_print_max($arr) {\n $max = 0;\n foreach ($arr as $value) {\n if ($value >= $max) {\n $max = $value;\n }\n }\n print $max . \"\\n\";\n return $max;\n}",
"public function getArrayMaxValue()\n {\n $array_max_value_w1 = max($this->array);\n $processed_array = $this->array;\n $array_max_value_w2 = $processed_array[0];\n foreach ($processed_array as $key => $value) {\n if ($array_max_value_w2 < $value) {\n $array_max_value_w2 = $value;\n }\n }\n\n echo \"\\nGetting array max value: \\n\n Max Value way 1: $array_max_value_w1 \\n\n Max Value way 2: $array_max_value_w2 \\n\";\n }",
"public function getMostRecentOccurrence() {\n\t\tif(!$this->occurrences->count()) {\n\t\t\treturn NULL;\n\t\t}\n\t\t$recent = NULL;\n\t\t$now = new \\DateTime();\n\n\t\t// Loop through all occurrences saving the latest\n\t\t// occurrence that is valid and in the past\n\t\tforeach($this->occurrences as $occ) {\n\t\t\t$occFinish = $occ->getFinishTime();\n\t\t\tif(!$occFinish || $occFinish > $now) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif(!$recent) {\n\t\t\t\t$recent = $occ;\n\t\t\t\t$recentFinish = $occFinish; // cache the call\n\t\t\t} elseif($occFinish > $recentFinish) {\n\t\t\t\t$recent = $occ;\n\t\t\t}\n\t\t}\n\t\treturn $recent;\n\t}",
"function last_value($array)\n{\n $key = last_key($array);\n return $key !== null ? $array[$key] : null;\n}",
"function argmax(array $values)\n {\n return array_search(max($values), $values);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Store a view inside CouchDB if it is not yet defined. Creates the design document on the fly if it does not exist already. | public function storeView(ViewInterface $view) {
try {
$design = $this->doOperation(function($client) use ($view) {
return $client->getDocument('_design/' . $view->getDesignName());
});
if (isset($design->views->{$view->getViewName()})) {
return;
}
} catch(Client\NotFoundException $notFoundException) {
$design = new \stdClass();
$design->_id = '_design/' . $view->getDesignName();
$design->views = new \stdClass();
}
$design->views->{$view->getViewName()} = new \stdClass();
$design->views->{$view->getViewName()}->map = $view->getMapFunctionSource();
if ($view->getReduceFunctionSource() !== NULL) {
$design->views->{$view->getViewName()}->reduce = $view->getReduceFunctionSource();
}
$this->doOperation(function($client) use ($design) {
if (isset($design->_rev)) {
$client->updateDocument($design, $design->_id);
} else {
$client->createDocument($design);
}
});
} | [
"public function saveView(BrowserView $view)\n {\n $dbh = $this->dbh;\n\n $def = $this->definitionLoader->get($view->getObjType());\n\n if (!$def)\n throw new \\RuntimeException(\"Could not get entity definition for: \" . $view->getObjType());\n\n $data = $view->toArray();\n\n if ($view->getId())\n {\n $sql = \"UPDATE app_object_views SET\n name='\" . $dbh->escape($data['name']) . \"',\n description='\" . $dbh->escape($data['description']) . \"',\n team_id=\" . $dbh->escapeNumber($data['team_id']) . \",\n user_id=\" . $dbh->escapeNumber($data['user_id']) . \",\n object_type_id=\" . $dbh->escapeNumber($def->getId()) . \",\n f_default='\" . (($data['default']) ? 't' : 'f') . \"',\n owner_id=\" . $dbh->escapeNumber($data['user_id']) . \",\n conditions_data='\" . $dbh->escape(json_encode($data['conditions'])) . \"',\n order_by_data='\" . $dbh->escape(json_encode($data['order_by'])) . \"',\n table_columns_data='\" . $dbh->escape(json_encode($data['table_columns'])) . \"'\n WHERE id='\" . $view->getId() . \"'; SELECT '\" . $view->getId() . \"' as id;\";\n\n }\n else\n {\n $sql = \"INSERT INTO app_object_views(\n name,\n description,\n team_id,\n user_id,\n object_type_id,\n f_default,\n owner_id,\n conditions_data,\n order_by_data,\n table_columns_data\n ) values (\n '\" . $dbh->escape($data['name']) . \"',\n '\" . $dbh->escape($data['description']) . \"',\n \" . $dbh->escapeNumber($data['team_id']) . \",\n \" . $dbh->escapeNumber($data['user_id']) . \",\n \" . $dbh->escapeNumber($def->getId()) . \",\n '\" . (($data['default']) ? 't' : 'f') . \"',\n \" . $dbh->escapeNumber($data['user_id']) . \",\n '\" . $dbh->escape(json_encode($data['conditions'])) . \"',\n '\" . $dbh->escape(json_encode($data['order_by'])) . \"',\n '\" . $dbh->escape(json_encode($data['table_columns'])) . \"'\n ); select currval('app_object_views_id_seq') as id;\";\n }\n\n $result = $dbh->query($sql);\n if ($dbh->getNumRows($result))\n {\n $view->setId($dbh->getValue($result, 0, \"id\"));\n $this->addViewToCache($view);\n return $view->getId();\n }\n else\n {\n throw new \\RuntimeException(\"Could not save view:\" . $dbh->getLastError());\n }\n }",
"public function use_view($view) {\n\t\t$views = call_user_func ( array (\n\t\t\t\t$this->model,\n\t\t\t\t'views' \n\t\t) );\n\t\tif (! array_key_exists ( $view, $views )) {\n\t\t\tthrow new \\OutOfBoundsException ( 'Cannot use undefined database view, must be defined with Model.' );\n\t\t}\n\t\t\n\t\t$this->view = $views [$view];\n\t\t$this->view ['_name'] = $view;\n\t\treturn $this;\n\t}",
"public function setView(View $view);",
"function __construct($ddoc_name, $view_name)\n {\n $this->ddoc_name = $ddoc_name;\n $this->name = $view_name;\n $this->view_definition = new Couchbase_ViewDefinition;\n }",
"public function createView ()\n {\n }",
"protected function makeCreateView() {\n\t\t$vg = new ViewCreateGenerator($this->files, $this->command);\n\t\t$vg->generate($this->name, $this->schema);\n\t}",
"public function upsertDesignDocument($name, $data) {\n $path = '_design/' . $name;\n $res = $this->_me->http_request(1, 3, $path, json_encode($data), 2);\n return true;\n }",
"function create_view($view_name, $schema_name, $geom_type, $fields){\n\tglobal $schema_creator_conn_str;\n\t$layer_table_name = \"tng_spatial_layer\";\n\t\n\t$sql_str = \"SELECT \"\n\t\t\t\t. \"table_name, \"\n\t\t\t\t. \"pk_col_name \"\n\t\t\t. \"FROM \"\n\t\t\t\t. \"tng_spatial_data \"\n\t\t\t. \"WHERE \"\n\t\t\t\t. \"geometry_type LIKE '%\" . $geom_type . \"%'\";\n\t\n\t$dbconn =& new DBConn();\n\t$dbconn->connect();\n\t$result = pg_query($dbconn->conn, $sql_str);\n\tif(!$result){\n\t\techo \"An error occurred while executing the query \" . pg_last_error($dbconn->conn);\n\t\t$dbconn->disconnect();\n\t\treturn false;\n\t}\n\t$dbconn->disconnect();\n\t\n\t$spatial_table_name = pg_fetch_result($result, 0, 'table_name');\n\t$pk_col_name = pg_fetch_result($result, 0, 'pk_col_name');\n\t\n\t$sql_str = \"CREATE VIEW \"\n\t\t\t\t\t. $view_name . \" \"\n\t\t\t\t\t. \"AS \"\n\t\t\t\t\t\t. \"SELECT \\n\"\n\t\t\t\t\t\t\t. $spatial_table_name . \".\" . $pk_col_name . \",\\n\"\n\t\t\t\t\t\t\t. $spatial_table_name . \".the_geom,\\n\"\n\t\t\t\t\t\t\t. $spatial_table_name . \".layer_id,\\n\"\n\t\t\t\t\t\t\t. $layer_table_name . \".form_submission_id AS submission_id,\\n\";\n\t\t\t\t\t\t\t\n\t$field_names = array_keys($fields);\n\t$n_fields = count($fields);\n\tfor($i = 0; $i < $n_fields; $i++){\n\t\t$sql_str .= $schema_name . \".\" . $field_names[$i];\n\t\tif($i < $n_fields - 1)\n\t\t\t$sql_str .= \",\";\n\t\t$sql_str .= \"\\n\";\n\t}\n\t\n\t$sql_str .= \"FROM \"\n\t\t\t\t. $schema_name . \"\\n\"\n\t\t\t\t. \"INNER JOIN \" . $spatial_table_name \n\t\t\t\t\t. \" ON \" . $schema_name . \".\" . $pk_col_name . \" = \" . $spatial_table_name . \".\" . $pk_col_name . \" \"\n\t\t\t\t. \"INNER JOIN \" . $layer_table_name \n\t\t\t\t\t. \" ON \" . $spatial_table_name . \".\" . \"layer_id = \" . $layer_table_name . \".layer_id\";\n\t\n\t$dbconn->conn_str = $schema_creator_conn_str;\n\t$dbconn->connect();\n\t$result = pg_query($dbconn->conn, $sql_str);\n\tif(!$result){\n\t\techo \"An error occurred while executing the query \" . pg_last_error($dbconn->conn);\n\t\t$dbconn->disconnect();\n\t\treturn false;\n\t}\n\t$dbconn->disconnect();\n\treturn true;\n}",
"public function addPublicView(View $view)\n\t{\n\t\tif ($view->access != 'public') {\n\t\t\tthrow new \\Exception(\"View {$view->name} is not designated for 'public' access.\");\n\t\t} else if (isset($this->public_views[$view->name])) {\n\t\t\tthrow new \\Exception(\"Public View {$view->name} is already present in this representation\");\n\t\t}\n\n\t\t$this->public_views[$view->name] = $view;\n\t}",
"function _readDesignDocs()\n {\n if(!$this->couchbase->bucketExists($this->default_bucket_name)) {\n return;\n }\n\n $view = $this->getAllDocsView();\n $ddocs = $view->getResultByRange(\"_design/\", \"_design0\",\n array(\"include_docs\" => true));\n\n if(!$ddocs || !$ddocs->rows) {\n return;\n }\n\n foreach($ddocs->rows AS $ddoc_row) {\n $ddoc = $ddoc_row->doc;\n $ddoc_name = str_replace(\"_design/\", \"\", $ddoc->_id);\n if(isset($ddoc->views)) {\n foreach($ddoc->views AS $view_name => $definition) {\n $view = new Couchbase_View($ddoc_name, $view_name);\n $this->queries[$ddoc_name][$view_name] = $view;\n }\n }\n }\n }",
"function CreateFormView() {\n\t\tif(! $this->m_formView){\n\n\t\t\t$lViewMetadata = $this->m_pubdata;\n\n\t\t\t$lViewMetadata = array_merge($lViewMetadata, array(\n\t\t\t\t'name_in_viewobject' => $this->m_nameInViewObject,\n\t\t\t\t'fields_metadata' => $this->m_fieldsMetadata,\n\t\t\t\t'err_cnt' => $this->m_errCnt,\n\t\t\t\t'global_errors' => $this->m_globalErrors,\n\t\t\t\t'fields_errors' => $this->m_fieldErrors,\n\t\t\t\t'fields_values' => $this->m_fieldsValues,\n\t\t\t\t'form_name' => $this->m_formName,\n\t\t\t\t'form_method' => $this->m_formMethod,\n\t\t\t\t'use_captcha' => $this->m_useCaptcha,\n\t\t\t\t'add_back_url' => $this->AddBackUrl(),\n\t\t\t\t'js_validation' => (int)$this->m_jsValidation,\n\t\t\t\t'check_field' => $this->m_checkField,\n\t\t\t\t'fields_templ_name' => $this->m_formFieldsTemplName,\n\t\t\t));\n\n\t\t\t$this->m_formView = new evForm_View($lViewMetadata);\n\t\t}\n\t\treturn $this->m_formView;\n\t}",
"public function setViewDefinition($viewDefinition);",
"public function create( $args, $assoc_args ) {\n\n\t\t$defaults = array(\n\t\t\t'name' => \\OTGS\\Toolset\\CLI\\get_random_string(),\n\t\t\t'view_purpose' => 'all',\n\t\t\t'usage_type' => 'post_types',\n\t\t\t'usage' => 'post',\n\t\t\t'orderby' => 'post_date',\n\t\t\t'users_orderby' => 'user_login',\n\t\t\t'taxonomy_orderby' => 'name',\n\t\t\t'order' => 'DESC',\n\t\t\t'output_id' => false,\n\t\t);\n\n\t\t$create_args = wp_parse_args( $assoc_args, $defaults );\n\n\t\tif ( ! in_array( $create_args['view_purpose'], self::$allowed_purpose ) ) {\n\t\t\t\\WP_CLI::error( __( 'Using unsupported View purpose.', 'toolset-cli' ) );\n\t\t}\n\n\t\ttry {\n\n\t\t\t$usages = $this->format_usage( $create_args['usage'], $create_args['usage_type'] );\n\t\t\t$view = WPV_View::create( WPV_View::get_unique_title( $create_args['name'] ), $create_args );\n\n\t\t\t$updated_meta = $this->cleanup_meta( array_merge( $create_args, $usages ) );\n\t\t\t$updated_meta['query_type'] = $this->query_type( $create_args['usage_type'] );\n\n\t\t\t$view_meta = $view->get_postmeta( WPV_View::POSTMETA_VIEW_SETTINGS );\n\t\t\t$view_meta = array_replace( $view_meta, $updated_meta );\n\n\t\t\t$view->update_postmeta( WPV_View::POSTMETA_VIEW_SETTINGS, $view_meta );\n\n\t\t\tif ( $view->id !== null ) {\n\t\t\t\t$this->output_result( $view->id, $create_args, 'View created' );\n\t\t\t} else {\n\t\t\t\t\\WP_CLI::error( __( 'Could not create the view.', 'toolset-cli' ) );\n\t\t\t}\n\t\t} catch ( \\Exception $e ) {\n\t\t\t\\WP_CLI::error( __( 'There was an error while creating new Views instance.', 'toolset-cli' ) );\n\t\t}\n\n\t}",
"public function create($document){\n $doc = new CouchDocument($this, $document);\n $doc->create();\n return $doc;\n \n }",
"public function createNewDocument()\n {\n return view('create-new-document')->with(\n 'template', Session::pull('template', null)\n );\n }",
"public function createView()\n\t{\n\t\t$queryID = self::getRequestVar('query', self::REG_EXP_SOURCE_ID);\n\t\t\n\t\tif (!$queryID)\n\t\t\tthrow new \\Exception(\"No queryID\");\n\t\t\t\n\t\t$sql = $this->compiler->querySet->sql($queryID);\n\t\t\n\t\tif (!$sql)\n\t\t\tthrow new \\Exception(\"Could not read SQL file\");\n\t\t\t\n\t\t$this->db->execute( 'create or replace view `' . $queryID . '` as ' . $sql );\n\t\t\n\t\treturn array(\n\t\t\t'message' => 'Created / updated view \"' . $queryID . '\"'\n\t\t);\n\t}",
"public function callCreator(View $view): void;",
"public function materializedView($name);",
"public function setView(One_View $view)\n\t{\n\t\t$this->view = $view;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Note: The `:app_slug` is just the URLfriendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., ` If the GitHub App you specify is public, you can access this endpoint without authenticating. If the GitHub App you specify is private, you must authenticate with a [personal access token]( or an [installation access token]( to access this endpoint. | public function appsGetBySlug(string $appSlug, string $fetch = self::FETCH_OBJECT)
{
return $this->executeEndpoint(new \Github\Endpoint\AppsGetBySlug($appSlug), $fetch);
} | [
"public function getBossUrl($appId);",
"public function get_app_url()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n return $this->details['url'];\n }",
"function app_name() : string {\n\t\treturn get_instance()->config->item(\"app_name\");\n\t}",
"function apps_app_details_page($server_name, $app_name) {\n apps_include('manifest');\n $apps = apps_apps($server_name , array('machine_name' => $app_name)) ;\n $apps[$app_name]['#theme'] = 'apps_app_page';\n return $apps[$app_name];\n}",
"public function howtoFirstAppAction()\n {\n return $this->render('@WallabagCore/Developer/howto_app.html.twig',\n [\n 'wallabag_url' => $this->getParameter('domain_name'),\n ]);\n }",
"public function frontend_repo($slug, Request $req)\n {\n $input = request()->all();\n $input['domain'] = request()->root();\n $conf = $this->from_config();\n\n if ($conf['tracking_hits'])\n {\n //store hit and write hit_id in cookie\n $hitsQuery = [\n 'rt' => array_get($input, 'rt', null),\n 'app_id' => $conf['client_id'],\n ];\n $query = env('secret_url') . '/hits/?' . http_build_query($hitsQuery);\n $res = file_get_contents($query, false, stream_context_create(arrContextOptions()));\n $res = json_decode($res)->data;\n \\Cookie::queue('hit_id', $res->id, time()+60*60*24*30, '/');\n }\n\n $input = array_merge($input, $conf);\n if(array_key_exists('page', $input)) unset($input['page']);\n \n session(['addition' => $input]);\n if(!$this->validate_frontend_config()) return $this->error_message;\n \n $ck = $this->CK($slug);\n if ($this->should_we_cache($ck)) {\n $page = Cache::get($ck);\n return insertToken($page);\n }\n\n try {\n $front = $conf['frontend_repo_url'];\n \n if(config('api_configs.multidomain_mode_dev') || config('api_configs.multidomain_mode')) {\n $slug = !strlen($slug) ? $slug : '/';\n }\n\n $url = ($slug == '/') ? $front : $front.$slug;\n $query = [];\n $domain = $req->url();\n\n if (array_search(parse_url($domain)['host'], $conf['multilingualSites']) !== false)\n {\n //getting language from url\n $url_segments = $this->splitUrlIntoSegments($req->path());\n $main_language = $conf['main_language'] ? $conf['main_language'] : 'en';\n $language_from_url = array_get($url_segments, 0, $main_language);\n $language_from_url = gettype(array_search($language_from_url, $conf['languages'])) == 'integer' ? $language_from_url : $main_language;\n\n //if user tries to change language via switcher rewrite language_from_request cookie\n if ($req->input('change_lang'))\n {\n setcookie('language_from_request', $req->input('change_lang'), time() + 60 * 30, '/');\n $_COOKIE['language_from_request'] = $req->input('change_lang');\n if ($language_from_url !== $req->input('change_lang'))\n {\n return redirect($req->input('change_lang') == $main_language ? '/' : '/' . $req->input('change_lang') . '/ ');\n }\n }\n if ($req->get('l') == $main_language)\n {\n setcookie('language_from_request', $main_language, time() + 60 * 30, '/');\n $query = [\n 'lang' => $main_language,\n 'main_language' => $conf['main_language']\n ];\n }\n if ($slug == '/' && $req->get('l') !== $main_language)\n {\n if (!array_key_exists(\"language_from_request\", $_COOKIE))\n {\n //setting language_from_request cookie from accept-language\n $language_from_request = substr(locale_accept_from_http($req->header('accept-language')), 0, 2);\n $language_from_request = gettype(array_search($language_from_request, $conf['languages'])) == 'boolean' ? $main_language : $language_from_request;\n setcookie('language_from_request', $language_from_request, time() + 60 * 30, '/');\n if ($language_from_url !== $language_from_request)\n {\n return redirect($language_from_request == $main_language ? '/' : '/' . $language_from_request . '/ ');\n }\n }\n else\n {\n if ($language_from_url !== $_COOKIE['language_from_request'])\n {\n return redirect($_COOKIE['language_from_request'] == $main_language ? '/' : '/' . $_COOKIE['language_from_request'] . '/ ');\n }\n }\n }\n $query = [\n 'lang' => $language_from_url,\n 'main_language' => $conf['main_language']\n ];\n }\n $url = $url . '?' . http_build_query(array_merge($req->all(), $query));\n $page = file_get_contents($url, false, stream_context_create(arrContextOptions()));\n\n $http_code = array_get($http_response_header, 0, 'HTTP/1.1 200 OK');\n\n if(strpos($http_code, '238') > -1)\n {\n // code 238 is used for our internal communication between frontend repo and client site,\n // so that we do not ignore errors (410 is an error);\n if($this->redirect_mode === \"view\")\n {\n return response(view('api-client-helpers::not_found'), $this->redirect_code);\n }\n else //if($this->redirect_mode === \"http\")\n { // changed this to else, so that we use http redirect by default even if nothing is specified\n return redirect()->to('/', $this->redirect_code);\n }\n }\n\n if ($this->should_we_cache()) Cache::put($ck, $page, $conf['cache_frontend_for']);\n return insertToken($page);\n\n }\n catch (Exception $e)\n {\n // \\Log::info($e);\n return $this->error_message;\n }\n }",
"public function getTooterApplicationURL();",
"function devconnect_developer_apps_create_app($parameters) {\n\n $account = user_load($parameters['developer_uid']);\n\n $entity = entity_create('developer_app', array('uid' => $account->uid));\n $entity->name = $parameters['app_name'];\n $entity->developer = $account->mail;\n $entity->overallStatus = $parameters['status'];\n $entity->uid = $account->uid;\n\n $api_products = array();\n $products = explode('\\n\\r' , $parameters['api_products']);\n foreach ($products as $product) {\n $api_products[] = $product;\n }\n $entity->apiProducts = $api_products;\n\n $attributes = array();\n foreach ($parameters as $key => $parameter) {\n if (strpos($key, '_customattr') !== false) {\n $attributes[str_replace('_customattr', '', $key)] = $parameters[$key];\n }\n }\n $entity->attributes = $attributes;\n\n $saved = entity_save('developer_app', $entity);\n if (!$saved) {\n $e = DeveloperAppController::getLastException();\n $code = $e->getCode();\n if ($code == 409) {\n $summary = t('The App Name “@app_name” is already being used.', array('@app_name' => $account->name));\n $detail = 'Duplicate app name \"' . $account->name . '\" for user \"' . $account->name . '\"!'\n . \"\\n\" . $e->getResponse();\n\n devconnect_default_org_config()->logger->warning($detail);\n } else {\n $response = @json_decode($e->getResponse());\n $uri = $e->getUri();\n if ($response && property_exists($response, 'code') && $response->code == 'keymanagement.service.app_invalid_name') {\n $summary = $response->message;\n }\n else {\n $summary = t('There was an error trying to create the application. Please try again later.');\n }\n $message = 'Saving app @app_name for user @user_name generated @ex with a code of @status when accessing URI @uri. Details as follows: @params';\n $params = $e->getParams();\n if ($summary != $response->message) {\n $params['message'] = $response->message;\n }\n $exception_class = get_class($e);\n $exception_class = 'a' . (preg_match('!^[AEIOUaeiou]!', $exception_class) ? 'n' : '') . ' ' . $exception_class;\n $args = array(\n '@app_name' => $account->name,\n '@user_name' => $account->name,\n '@ex' => $exception_class,\n '@status' => $code,\n '@uri' => $uri,\n '@params' => print_r($params, TRUE)\n );\n $detail = t($message, $args);\n }\n devconnect_notify(ErrorHandling::CODE_APP_CREATED, $summary, $detail, ErrorHandling::SEVERITY_STATUS);\n }\n}",
"public function getAppName(): string\n {\n return $this->getConfig()->get('application.name','');\n }",
"public function getAppCode(): string\n {\n return $this->getConfig()->get('application.code','');\n }",
"public function getAppHost(): string;",
"public static function getAppID(){\n\t\treturn OptionHelper::getOption('app_id');\n\t}",
"public static function validateAppName(string $app): string\n {\n return static::parse(\"gid://{$app}/Model/1\")->app;\n }",
"function sign_application_url($appcode,$key,$url) {\n $url = add_to_url($url,\"APPCODE\",urlencode($appcode));\n return sign_query_string($key,$url);\n}",
"function app_author()\n{\n echo get_app_author();\n}",
"public function getAppDeploymentId(): string;",
"function get_app_info( $env = 'dev' ) {\n $nr_connection_info = get_nr_connection_info();\n if ( empty( $nr_connection_info ) ) {\n echo \"Unable to get New Relic connection info\\n\";\n\n return;\n }\n\n $api_key = $nr_connection_info['api_key'];\n $app_name = $nr_connection_info['app_name'];\n\n $app_id = get_app_id( $api_key, $app_name );\n\n $url = \"https://api.newrelic.com/v2/applications/$app_id.json\";\n\n $ch = curl_init();\n curl_setopt( $ch, CURLOPT_URL, $url );\n curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );\n $headers = [\n 'X-API-KEY:' . $api_key\n ];\n curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers );\n\n $response = curl_exec( $ch );\n\n if ( curl_errno( $ch ) ) {\n echo 'Error:' . curl_error( $ch );\n }\n\n curl_close( $ch );\n\n $output = json_decode( $response, true );\n\n return $output['application'];\n}",
"static public function getPixlrAppUrl($app)\n {\n return \"http://www.pixlr.com/\".sfPixlrTools::getPixlrApp($app).\"/\";\n }",
"function github_oauth_url()\n{\n $CI =& get_instance();\n $CI->config->load('github');\n $id = $CI->config->item('github_id');\n\n return 'https://github.com/login/oauth/authorize?client_id=' . $id;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function checks if the given hashtag exists in the database. | function checkIfHashtagExists($hashtag)
{
$exists = 0;
// Create connection
$con=mysqli_connect("cse.unl.edu","rcarlso","a@9VUi","rcarlso");
// Check connection
if (mysqli_connect_errno($con))
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
else
{
$query = mysqli_prepare($con,"SELECT * FROM Hashtag");
$query->execute();
$result = $query->get_result();
while($row = mysqli_fetch_array($result))
{
if(strcmp($hashtag,$row['Hashtag']) == 0)
{
$exists = 1;
}
}
}
//close connections
mysqli_close($con);
return $exists;
} | [
"public static function exists\n\t(\n\t\t$hashtag\t\t// <str> The hashtag to verify if it exists or not.\n\t)\t\t\t\t\t// RETURNS <bool>\n\t\n\t// AppHashtags::exists($hashtag);\n\t{\n\t\tif($check = Database::selectValue(\"SELECT hashtag FROM micro_hashtags WHERE hashtag=? LIMIT 1\", array($hashtag)))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"function checkIfFollowingHashtag($userID,$hashtagID)\n\t{\n\t\t$exists = 0;\n\t\t// Create connection\n\t\t$con=mysqli_connect(\"cse.unl.edu\",\"rcarlso\",\"a@9VUi\",\"rcarlso\");\n\n\t\t// Check connection\n\t\tif (mysqli_connect_errno($con))\n\t\t{\n\t\t\techo \"Failed to connect to MySQL: \" . mysqli_connect_error();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\n\t\t\t$query = mysqli_prepare($con,\"SELECT * FROM HashtagFollowing\");\n\t\t\t\n\t\t\t$query->execute();\n\t\t\t\n\t\t\t$result = $query->get_result();\n\t\t\t\t\t\t\t\n\t\t\twhile($row = mysqli_fetch_array($result))\n\t\t\t{\n\t\t\t\tif($userID == $row['UserID'] && $hashtagID == $row['HashtagID'])\n\t\t\t\t{\n\t\t\t\t\t$exists = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\t\n\t\t//close connections\n\t\tmysqli_close($con);\n\t\treturn $exists;\n\t}",
"public function hashExists($hash) \n\t{\n\t\t//check if the has exists\n\t\t$hash = $this->escapeString($hash);\n\t\t//see if we already have a hash\n\t\t$result = $this->query('SELECT id FROM urls WHERE hash=\"'. $hash .'\";');\n\t\treturn isset($result[0]);\n\t}",
"private function _does_hash_exist($hash)\n\t{\n\t\treturn file_exists(\"$this->_content_dir/urls/$hash.url\");\n\t}",
"public function isValidHashtag($hashtag = null) {\n if (is_null($hashtag)) {\n $hashtag = $this->tweet;\n }\n $length = mb_strlen($hashtag);\n if (empty($hashtag) || !$length) return false;\n $extracted = $this->extractor->extractHashtags($hashtag);\n return count($extracted) === 1 && $extracted[0] === substr($hashtag, 1);\n }",
"public static function findOneByHashtag($hashtag)\n\t{\n\t\t$result = DbHandler::getDb()->fetch_assoc(\"SELECT * FROM hashtags WHERE hashtag = ?\", array($hashtag));\n\t\tif($result === false) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\treturn new Hashtag($result);\n\t\t}\n\t}",
"private function checkHash($hash)\n {\n $sql = 'SELECT hash FROM bookshop_users WHERE hash = :hash';\n $result = $this->db->execute($sql, ['hash' => $hash]);\n \n if (!$result)\n return FALSE;\n\n return TRUE;\n }",
"private function checkHash($hash) {\r\n\r\n\t\t$sql = $this->dbh->prepare(\"SELECT COUNT(*) AS count FROM bs_cookies WHERE series = ? OR token = ?\");\r\n\t\t$sql->execute(array($hash, $hash));\r\n\t\t$row = $sql->fetch(PDO::FETCH_ASSOC);\r\n\r\n\t\tif ($row['count'] > 0) {\r\n\t\t\treturn FALSE;\r\n\t\t} else {\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\t}",
"function searchForHashtag($hashtag)\n\t{\n\t\t$i=0;\n\t\t$hashtags = array();\n\t\t// Create connection\n\t\t$con=mysqli_connect(\"cse.unl.edu\",\"rcarlso\",\"a@9VUi\",\"rcarlso\");\n\n\t\t// Check connection\n\t\tif (mysqli_connect_errno($con))\n\t\t{\n\t\t\techo \"Failed to connect to MySQL: \" . mysqli_connect_error();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\n\t\t\t//if searching with one word (by hashtag)\n\t\t\t\n\t\t\t\t//changing the string like this will allow it to match on partial entry\n\t\t\t\t$hashtag = '%' . $hashtag . '%';\n\t\t\t\t$query = mysqli_prepare($con,\"SELECT * FROM Hashtag WHERE Hashtag LIKE ?\");\n\t\t\t\n\t\t\t\t$query->bind_param(\"s\",$hashtag);\n\t\t\t\n\t\t\t\t$query->execute();\n\t\t\t\n\t\t\t\t$result = $query->get_result();\n\t\t\t\t\t\t\t\n\t\t\t\twhile($row = mysqli_fetch_array($result))\n\t\t\t\t{\n\t\t\t\t// public function Hashtag($hashtagID,$hashtag)\n\t\t\t\t\t$hashtag1 = new Hashtag($row['HashtagID'],$row['Hashtag']);\n\t\t\t\t\t\n\t\t\t\t\t$hashtags[$i] = $hashtag1;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t\n\t\t\n\t\t}\n\t\t\n\t\t\t\n\t\t//close connections\n\t\tmysqli_close($con);\n\t\t\n\t\treturn $hashtags;\n\t\t\n\t}",
"static function hashCheck($form, $hash) {\n\t\t\t$form = sqlescape($form);\n\t\t\t$hash = sqlescape($hash);\n\t\t\t$result = sqlfetch(sqlquery(\"SELECT id FROM btx_form_builder_entries \n\t\t\t\t\t\t\t\t\t\t WHERE form = '$form'\n\t\t\t\t\t\t\t\t\t\t AND hash = '$hash'\n\t\t\t\t\t\t\t\t\t\t AND created_at >= '\".date(\"Y-m-d H:i:s\", strtotime(\"-10 minutes\")).\"'\"));\n\t\t\t\n\t\t\treturn !empty($result);\n\t\t}",
"protected function checkHash($hash)\n {\n $sql = 'SELECT hash FROM rest_users WHERE hash = :hash';\n $result = $this->db->execute($sql, ['hash' => $hash]);\n \n if (!$result)\n return FALSE;\n\n return TRUE;\n }",
"public function hasHash()\n {\n return Mage::helper('buysafe')->hasHash();\n }",
"function bug_exists( $bug_id ) {\n\n\tglobal $db;\n $bug_tbl \t\t= BUG_TBL;\n\t$f_bug_id\t\t= $bug_tbl .\".\". BUG_ID;\n\n\n $q = \"\tSELECT\n\t\t\t\t$f_bug_id\n\t\t\tFROM\n\t\t\t\t$bug_tbl\n\t\t\tWHERE\n\t\t\t\t$f_bug_id = '$bug_id'\";\n\n\t$row_count = db_num_rows( $db, db_query($db, $q) );\n\n\tif( $row_count == 1 ) {\n\t\treturn true;\n\t}\n\telse {\n\t\treturn false;\n\t}\n\n}",
"function TweetExists($idtweet, $db){\n $rows = $db->query('SELECT id FROM tweets WHERE id=\"'.$idtweet.'\"')->num_rows;\n \n if($rows > 0){\n return true;\n }else{\n return false;\n }\n }",
"public function hashExists($hash)\n\t{\n\t\treturn array_key_exists($hash, $this->hashTable);\n\t}",
"function blogTitleExists($title){\n\t$conn = open_db();\n\t$title = mysqli_real_escape_string($conn, $title) or show_error($conn);\n\t$query = \"SELECT id FROM blogs WHERE title = '$title'\";\n\t$result = mysqli_query($conn, $query);\n\tif($result){\n\t\t$row = mysqli_fetch_assoc($result);\n\t}\n\tclose_db($conn);\n\tif((int)$row['id'] > 0) return true;\n\treturn false;\n}",
"function bugnote_exists( $p_bugnote_id ) {\r\n\t\t$c_bugnote_id \t= db_prepare_int( $p_bugnote_id );\r\n\t\t$t_bugnote_table\t= config_get( 'mantis_bugnote_table' );\r\n\r\n\t\t$query \t= \"SELECT COUNT(*)\r\n\t\t \tFROM $t_bugnote_table\r\n\t\t \tWHERE id='$c_bugnote_id'\";\r\n\t\t$result\t= db_query( $query );\r\n\r\n\t\tif ( 0 == db_result( $result ) ) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}",
"function hashesMatch($email, $hash){\n\n\ttry {\n\n\t\t# Throw exception if hash is not 32 characters\n\t\tif (strlen($hash) != 32){\n\t\t\tthrow new Exception(\"Hash value must be 32 character\");\n\t\t}\n\n\n\t\t# Query database to see if $email exists\n\t\t$base = Connector::getDatabase();\n\t\t$sql = \"SELECT * FROM user WHERE email = '$email';\";\n\t\t$stmt = $base->prepare($sql);\n\t\t$stmt->execute();\n\t\t$result = $stmt->fetch();\n\n\t\tif ($result['hash'] == $hash){\n\t\t\treturn True;\n\t\t} else {\n\t\t\treturn False;\n\t\t}\n\n\t} catch (Exception $e){\n\t\terror_log($e);\n\t\theader(\"Location: /src/views/error.php\");\n \texit();\n\t}\n\n\treturn True;\n}",
"public function have_block($block_hash) {\n\t\t$this->db->select('id')\n\t\t\t\t ->where('hash', \"$block_hash\");\n\t\t$query = $this->db->get('blocks');\n\t\treturn ($query->num_rows() > 0) ? TRUE : FALSE;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove um professor do banco de dados | function deleteId($professor_id)
{
$stmt = $this->conn->prepare('DELETE FROM professor WHERE id = :uprofessor_id');
if (!$stmt->execute(array(':uprofessor_id' => $professor_id)))
throw new Exception("Erro ao excluir item.", 1);
} | [
"public function deleted(Professor $professor)\n {\n //\n }",
"function delete(Professor $professor)\r\n {\r\n return $this->deleteId($professor->getId());\r\n }",
"public function delete(Professor $prof)\n {\n $prof->delete();\n }",
"public function kick_professor($class, $professor)\n {\n $c = Classe::find($class);\n $this->authorize('add_professor', $c);\n /*$data = request()->validate([\n 'class' => 'required',\n 'professor' => 'required'\n ]);*/\n $c->professors()->detach(/*$data['professor']*/$professor);\n return redirect()->back();\n }",
"public function deleteProfessor(Request $request) {\n User::where('profesor_id', $request->input('professor'))->delete();\n return view('adminHomePage');\n }",
"public function forceDeleted(Professor $professor)\n {\n //\n }",
"public function eliminaProfilo(){\n\t\t$view = USingleton::getInstance('VAmministratore');\n\t\t$session=USingleton::getInstance('USession');\n\t\t$username=$view->getUtente();\n\t\t\t\t\n\t\t//elimina tutte le preenotazioni fatte dall'utente aggiornando i posti\n\t\t//liberi nelle partite a cui era prenotato\n\t\t$FPrenotazione=new FPrenotazione();\n\t\t$prenotazioni=$FPrenotazione->loadfromuser($username);\n\t\t$FPartita = new FPartita();\n\t\tfor ($i=0; $i<count($prenotazioni) && $prenotazioni!=''; $i++) {\n\t\t\t$PartitaID=$prenotazioni[$i]->getPartitaID();\n\t\t\t$FPrenotazione->delete($prenotazioni[$i]);\n\t\t\t$partita=$FPartita->load($PartitaID);\n\t\t\t$ndisponibili=$partita->getNdisponibili();\n\t\t\t$partita->setNdisponibili($ndisponibili+1);\n\t\t\t$FPartita->update($partita);\n\t\t}\n\t\t\n\t\t//elimina tutte le partite create dell'utente con tutte le relative prenotazioni associate\n\t\t$partite=$FPartita->loadfromcreatore($username);\n\t\tfor($i=0; $i<count($partite) && $partite!=''; $i++){\n\t\t\t$array_partite[$i]=$partite[$i]->getAllArray();\n\t\t\t$session->imposta_valore('idpartita', $array_partite[$i]['IDpartita']);\n\t\t\t$this->eliminaPartita();\n\t\t}\n\t\t\n\t\t//elimina tutti gli annunci pubblicati\n\t\t$FAnnuncio=new FAnnuncio();\n\t\t$annunci=$FAnnuncio->loadfromuser($username);\n\t\tif($annunci!='')\n\t\t\t$FAnnuncio->deleterel($annunci);\n\t\t\n\t\t//elimina il profilo dell'utente\n\t\t$FUtente = new FUtente();\n\t\t$utente= $FUtente->load($username);\n\t\t$FUtente->delete($utente);\n\t\t\n\t\t$view->setLayout('amministratore_conferma_profilo_el');\n\t\treturn $view->processaTemplate();\n\t}",
"public function DeleteOrdemProducao() {\n\t\t\t$this->objOrdemProducao->Delete();\n\t\t}",
"public function action_remove()\n\t{\n\t\ttry{\n\t\t\t$beneficiaryid = $_GET['beneficiaryid'];\n\t\t\t$objBeneficiary = ORM::factory('beneficiary')->where('refuserid_c','=',Auth::instance()->get_user()->id)->where('beneficiaryid_c','=',$beneficiaryid)->mustFind();\n\t\t\t$objBeneficiary->delete();\n\t\t\tRequest::current()->redirect('cbeneficiary/list');\n\t\t}catch(Exception $e){\n\t\t\tthrow new Exception($e);\n\t\t}\n\t}",
"public function supprimerProduitCommande() {\n $idProduitCommande = $this->requete->getParametre(\"id\");\n $produitCommande = $this->produitCommandeObj->getProduitCommande($idProduitCommande);\n \n $this->produitCommandeObj->deleteProduitCommande($idProduitCommande);\n\n $this->rediriger('Adminaccueil', 'lire/' . $produitCommande['commande_id']);\n }",
"function remove_profession($profession_id = '')\n\t{\n\t\t$this->db->where('profession_id', $profession_id);\n\t\t$this->db->delete('profession');\n\n\t\t$this->session->set_flashdata('success', 'Profession has been deleted successfully.');\n\n\t\tredirect(base_url() . 'profession_settings', 'refresh');\n\t}",
"static public function ctrBorrarPropietario(){\n\t\tif (isset($_POST['idPropietario'])) {\n\t\t\tif ($_POST['fotoPropietario'] != \"\") {\n\t\t\t\tunlink($_POST[\"fotoPropietario\"]);\n\t\t\t\trmdir('Views/img/propietarios/'.$_POST['propietario']);\n\t\t\t}\n\t\t$answer=adminph\\Propietary::find($_POST['idPropietario']);\n\t\t$answer->delete();\n\t\t}\n\t}",
"public function hapusProposalSebelumnya()\n {\n $proposal = Auth::user()->mahasiswa()->proposal();\n\n // Jika pernah mengunggah proposal\n if(!is_null($proposal->direktori_final)) {\n FH::delete($this->dir, $proposal->direktori_final);\n }\n }",
"function removePrayer($prayer){\n if($this->checkpermission($prayer['userid'])) { //Check if the current user is allow to remove the prayer\n $this->removeRelation($prayer['prayid']);//Remove all field where the prayer is a foreign key\n $this->removeimg($prayer['img']);//Remove the image from the directory\n $this->remove($prayer['prayid']);//Remove prayer from prayer table\n }\n else {\n\n }\n }",
"function elimina_comprobante($idComprobante,$idPedido){\n $db = new SuperDataBase();\n $db->executeQuery(\"SET SQL_SAFE_UPDATES = 0;\");\n //Eliminamos por si es credito\n $db->executeQuery(\"Delete from creditos where id_pedido = '\".$idPedido.\"'\");\n //Eliminamos Pagos registrados\n $db->executeQuery(\"Delete from movimiento_dinero where id_origen = '\".$idPedido.\"' AND tipo_origen = 'PED'\");\n //Eliminamos Propinas registradas\n $db->executeQuery(\"Delete from pedido_propina where pkPediido = '\".$idPedido.\"'\");\n //Eliminamos los detalles2\n $db->executeQuery(\"Delete from detalle_comprobante2 where pkDetalleComprobante = '\".$idComprobante.\"'\");\n //Eliminamos los detalles\n $db->executeQuery(\"Delete from detallecomprobante where pkComprobante = '\".$idComprobante.\"'\"); \n //Eliminamos el hash \n $db->executeQuery(\"Delete from comprobante_hash where pkComprobante = '\".$idComprobante.\"'\"); \n //Eliminamos la cabecera\n $db->executeQuery(\"Delete from comprobante where pkComprobante = '\".$idComprobante.\"'\");\n //Eliminamos los detalles de impuestos\n $db->executeQuery(\"Delete from comprobante_impuestos where pkComprobante = '\".$idComprobante.\"'\");\n }",
"public function delete($proveedor);",
"public function supppostemembreassoAction()\n {\n\n $sessionutilisateur = new Zend_Session_Namespace('utilisateur');\n //$this->_helper->layout->disableLayout();\n $this->_helper->layout()->setLayout('layoutpublicesmcadmin');\n \n if (!isset($sessionutilisateur->login)) {$this->_redirect('/administration/login');}\nif($sessionutilisateur->confirmation != \"\"){$this->_redirect('/administration/confirmation');}\n\n $id = (int) $this->_request->getParam('id');\n if (isset($id) && $id != 0) {\n\n $poste = new Application_Model_EuPosteMembreasso();\n $posteM = new Application_Model_EuPosteMembreassoMapper();\n $posteM->find($id, $poste);\n \n $posteM->delete($poste->poste_id);\n\n }\n\n $this->_redirect('/administration/listposte');\n }",
"public function delete(User $user, Professor $professor)\n {\n return true;\n }",
"function eliminaPrueba($id){\n \tDB::beginTransaction ();\n \ttry {\n \t\t$prueba = $this->getPrueba($id);\n \t\t$pruebaA = clone $prueba;\n \t\t$prueba->activo = 0;\n \t\t$prueba->update();\n \t\t//Bitacora\n \t\t$this->insertaBitacora(Constantes::ACCION_ELIMINAR, $pruebaA->getAttributes(), $prueba->getAttributes(), $prueba->idprueba,$this->controller,$this->moduloId,Session::get('idUser'),array(),$this->campoBase); \t\t \n \t\tDB::commit ();\n \t} catch ( \\Exception $e ) {\n \t\tDB::rollback ();\n \t\tthrow new \\Exception('Error al actualizar Prueba: ' . $e);\n \t} \t\t\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
decode an encoded string and return an array | function array_decode($string){
return explode("|", $string);
} | [
"public function decode(string $content): array;",
"public function decode($string);",
"function decode($str)\n {\n\n global $exemptRequest;\n\n //decode using the appropriate protocol handler\n $arr = $this->M->decode($str);\n\n //sanitize all data from the request\n $arr = sanitize($arr,$exemptRequest);\n \n return $arr; \n\n }",
"public function decode($str);",
"function decodeString($string);",
"public static function decode($string) {\n\t\t// Setup\n\t\t$result = array();\n\t\t\n\t\tif(is_string($string)) {\n\t\t\t$stringArray = explode(\\Bedrock\\Common::TXT_NEWLINE, $string);\n\t\t\t$result = self::parseYamlArray($stringArray);\n\t\t}\n\t\telse {\n\t\t\tthrow new \\Bedrock\\Common\\Data\\Exception('Only strings can be decoded, please provide a valid string to decode.');\n\t\t}\n\n\t\treturn $result;\n\t}",
"private function multi_byte_string_to_array()\n {\n $this->strings = array_values(\n array_filter(\n preg_split(\"//u\",$this->string),\n \"strlen\"\n )\n );\n }",
"static function decodeArrayFromInput($value) {\n\n if ($dec = base64_decode($value)) {\n if ($ret = json_decode($dec, true)) {\n return $ret;\n }\n }\n return [];\n }",
"function case_result_array_decode($str)\n{\n\tglobal $case_result_vars;\n\t$ret = array();\n\t$cnt = count($case_result_vars);\n\t$str = gzuncompress($str);\n\tforeach (json_decode($str) as $d)\n\t{\n\t\t$tmp = new Case_result();\n\t\tfor ($idx = 0; $idx < $cnt; $idx ++)\n\t\t{\n\t\t\t$f = $case_result_vars[$idx];\n\t\t\t$tmp->$f = $d[$idx];\n\t\t}\n\t\t$ret[] = $tmp;\n\t}\n\treturn $ret;\n}",
"static public function decodeToArray($encoded)\n {\n $length = strlen($encoded);\n $index = 0;\n $points = array();\n $lat = 0;\n $lng = 0;\n \n while ($index < $length)\n {\n // Temporary variable to hold each ASCII byte.\n $b = 0;\n \n // The encoded polyline consists of a latitude value followed by a\n // longitude value. They should always come in pairs. Read the\n // latitude value first.\n $shift = 0;\n $result = 0;\n do\n {\n // The `ord(substr($encoded, $index++))` statement returns the ASCII\n // code for the character at $index. Subtract 63 to get the original\n // value. (63 was added to ensure proper ASCII characters are displayed\n // in the encoded polyline string, which is `human` readable)\n $b = ord(substr($encoded, $index++)) - 63;\n \n // AND the bits of the byte with 0x1f to get the original 5-bit `chunk.\n // Then left shift the bits by the required amount, which increases\n // by 5 bits each time.\n // OR the value into $results, which sums up the individual 5-bit chunks\n // into the original value. Since the 5-bit chunks were reversed in\n // order during encoding, reading them in this way ensures proper\n // summation.\n $result |= ($b & 0x1f) << $shift;\n $shift += 5;\n }\n // Continue while the read byte is >= 0x20 since the last `chunk`\n // was not OR'd with 0x20 during the conversion process. (Signals the end)\n while ($b >= 0x20);\n \n // Check if negative, and convert. (All negative values have the last bit\n // set)\n $dlat = (($result & 1) ? ~($result >> 1) : ($result >> 1));\n \n // Compute actual latitude since value is offset from previous value.\n $lat += $dlat;\n \n // The next values will correspond to the longitude for this point.\n $shift = 0;\n $result = 0;\n do\n {\n $b = ord(substr($encoded, $index++)) - 63;\n $result |= ($b & 0x1f) << $shift;\n $shift += 5;\n }\n while ($b >= 0x20);\n \n $dlng = (($result & 1) ? ~($result >> 1) : ($result >> 1));\n $lng += $dlng;\n \n // The actual latitude and longitude values were multiplied by\n // 1e5 before encoding so that they could be converted to a 32-bit\n // integer representation. (With a decimal accuracy of 5 places)\n // Convert back to original values.\n $points[] = array($lat * 1e-5, $lng * 1e-5);\n }\n \n return $points;\n }",
"function decodeScrobblerArray($encoded_songs) {\n if (function_exists('gzcompress')) {\n return unserialize(gzuncompress($encoded_songs));\n } else {\n return unserialize($encoded_songs);\n }\n }",
"function xf_decode($text){\n\n\tif ($text == '') return array();\n\n\t// MODERN METHOD\n\tif (substr($text,0,4) == \"SER|\") return unserialize(substr($text,4));\n\n\t// OLD METHOD. OBSOLETE but supported for reading\n\t$xfieldsdata = explode(\"||\", $text);\n\n\tforeach ($xfieldsdata as $xfielddata) {\n\t\tlist($xfielddataname, $xfielddatavalue) = explode(\"|\", $xfielddata);\n\t\t$xfielddataname = str_replace(\"|\", \"|\", $xfielddataname);\n\t\t$xfielddataname = str_replace(\"__NEWL__\", \"\\r\\n\", $xfielddataname);\n\t\t$xfielddatavalue = str_replace(\"|\", \"|\", $xfielddatavalue);\n\t\t$xfielddatavalue = str_replace(\"__NEWL__\", \"\\r\\n\", $xfielddatavalue);\n\t\t$data[$xfielddataname] = $xfielddatavalue;\n\t}\n\treturn $data;\n}",
"public function decode(string $jwt): array;",
"public function decode($data);",
"public function decode ($raw);",
"public static function decode(array $encoded) : array {\n $left = [];\n $right = [];\n foreach ($encoded as $enc_int) {\n list($left[], $right[]) = self::decodeInteger($enc_int);\n }\n return [$left, $right];\n }",
"public static function json_array_decode ($string) {\n $data = json_decode($string, true);\n // empty json creates null not emtpy array => error\n if (empty($data)) // prevent this\n $data = array();\n return array_map('utf8_decode', $data);\n }",
"public static function decode(string $value) : array\n {\n return json_decode($value, true);\n }",
"public static function toArray($string){\n \n return json_decode($string,true);\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
list all families belongs to this church | public function getFamilies(Church $church){
$families = $church->families()->get();
return view('churches.families', compact(['families','church']));
} | [
"public function getFamiliesList()\n {\n $sql = \"SELECT id, name FROM families\";\n return $this->execute($sql);\n }",
"public function getFamilies()\n {\n return $this->families;\n }",
"function getChildFamilies() {\n\t\tglobal $pgv_lang, $SHOW_LIVING_NAMES;\n\n\t\tif (is_null($this->childFamilies)) {\n\t\t\t$this->childFamilies=array();\n\t\t\tforeach ($this->getChildgFamilyIds() as $famid) {\n\t\t\t\t$family=gFamily::getInstance($famid);\n\t\t\t\tif (is_null($family)) {\n\t\t\t\t\techo '<span class=\"warning\">', $pgv_lang['unable_to_find_family'], ' ', $famid, '</span>';\n\t\t\t\t} else {\n\t\t\t\t\t// only include family if it is displayable by current user\n\t\t\t\t\tif ($SHOW_LIVING_NAMES || $family->canDisplayDetails()) {\n\t\t\t\t\t\t$this->childFamilies[$famid]=$family;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->childFamilies;\n\t}",
"public function getFamilies()\n\t{\n\t\treturn $this->families;\n\t}",
"public function families()\n {\n return $this->hasMany(Family::class, 'user_id');\n }",
"function getSpouseFamilies() {\n\t\tglobal $pgv_lang, $SHOW_LIVING_NAMES;\n\t\tif (is_null($this->spouseFamilies)) {\n\t\t\t$this->spouseFamilies=array();\n\t\t\tforeach ($this->getSpousegFamilyIds() as $famid) {\n\t\t\t\t$family=gFamily::getInstance($famid);\n\t\t\t\tif (is_null($family)) {\n\t\t\t\t\techo '<span class=\"warning\">', $pgv_lang['unable_to_find_family'], ' ', $famid, '</span>';\n\t\t\t\t} else {\n\t\t\t\t\t// only include family if it is displayable by current user\n\t\t\t\t\tif ($SHOW_LIVING_NAMES || $family->canDisplayDetails()) {\n\t\t\t\t\t\t$this->spouseFamilies[$famid] = $family;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->spouseFamilies;\n\t}",
"public function getFamily();",
"public function showArrayFamilies() {\n foreach ($this->array_unique_family as $unique_family) {\n echo \"<pre>\";\n print_r($unique_family);\n echo \"</pre>\";\n }\n }",
"public function family()\n {\n\n $res = $this->_internal_api('user_group', 'get_list', [\n 'user_id' => (int) $this->current_user->id,\n 'group_type' => 'family'\n ]);\n\n $view_data = [\n 'list_groups' => $res['items'],\n 'operator_primary_type' => $this->current_user->primary_type,\n ];\n\n $this->_render($view_data);\n }",
"public static function families()\n {\n if (! isset(static::$languages)) {\n static::$languages = json_decode(static::getFile(__DIR__.'/../resources/languages.json'), true);\n }\n\n return static::pluck(static::$languages, 'family.name', 'family.iso_639_5');\n }",
"private static function InvolvedFamilies($year) {\n $families = array();\n\n // Add more rows / cells\n foreach (FamilyTracker::RegisteredFamilies() as $item) {\n $families[$item->family] = Family::GetItemById($item->family);\n } \n foreach(Volunteers::GetAllYear($year) as $item) {\n switch ($item->MFS) {\n case MFS::Mother:\n\t$families[$item->mfsId] = Family::GetItemById($item->mfsId);\n\tbreak;\n case MFS::Father:\n\t$families[$item->mfsId] = Family::GetItemById($item->mfsId);\n\tbreak;\n case MFS::Student:\n\t$student = Student::GetItemById($item->mfsId);\n\t$families[$student->family->id] = $student->family;\n\tbreak;\n default: \n\tdie (\"unexpected type of item found in volunteers\\n\");\n }\n }\n\n usort ($families, \"Family::CompareFatherLast\");\n return $families;\n }",
"public function members()\n {\n return $this->hasMany('App\\Member\\Member','family_id');\n }",
"function getFamilyDropDown()\n\t{\n\t\t$query = \"Select username, user_id\n\t\t\t\t from users\n\t\t\t\t where role_id = 2\";\n\t\t\n\t\t$results = $this->connection->query($query) or die (\"Error getting family names\");\n\t\t\n\t\twhile($row = $results->fetch_assoc())\n\t\t{\n\t\t\techo $row[\"username\"] . ' ' . $row[\"user_id\"] .',';\n\t\t}\n\t}",
"public function listAll()\n {\n return $this->task_family->all()->pluck('name', 'id')->all();\n }",
"public function getProductFamilies()\n {\n return $this->productFamilies;\n }",
"public function getFamilies($type, FamilyQueryOptions $options);",
"public function favChurch() {\n return $this->belongsToMany(Church::class, 'favorite_churches', 'user_id', 'church_id');\n }",
"function GetFamilyMember()\r\n {\r\n $companyid = $this->companyID;\r\n $emp_seqno = $this->empSeqNO;\r\n $sql_string = <<<eof\r\n select name_cn,\r\n id_no,\r\n rel_ship,\r\n sex,\r\n foreigner,\r\n birthday,\r\n occupation,\r\n telephone\r\n from ehr_emp_family_v\r\n where company_id = '$companyid'\r\n and emp_seq_no = '$emp_seqno'\r\neof;\r\n return $this->DBConn->GetArray($sql_string);\r\n }",
"private function getFamilyGraph()\n {\n return $this->familyGraph;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get URL of page request by index | protected function getPageByIndex($index) {
return $this->aStateUrls[$index];
} | [
"public function getPageURL($number);",
"public function firstPageUrl();",
"public function getFirstPageUrl();",
"public function pageUrl();",
"public function get_url_for_page($page);",
"public function getPageUrl();",
"public function getNextPageUrl();",
"public function firstPageURL() {\n return $this->pageURL(1);\n }",
"public function getUrlElement($index, $retval = NULL) {\n $index = (int)$index;\n\n if (isset($this->url_elements[$index])) {\n $retval = $this->url_elements[$index];\n }\n\n return $retval;\n }",
"static function getUri($index=false){\n $arr = explode('/', $_SERVER['REQUEST_URI']);\n \treturn $index?$arr[$index]:$arr;\n }",
"private function getPage() {\n\t\t$url = $_SERVER['REQUEST_URI'];\n\t\t$parts = explode(\"/\", $url);\n\t\t$page = $parts[count($parts) - 1];\n\t\t$page = strpos($page, \"?\") ? substr($page, 0, strpos($page, \"?\")) : $page;\n\t\treturn $page;\n\t}",
"public function getUrl($page): string;",
"public static function firstPageUrl()\n\t{\n\t\treturn self::numberUrl( self::firstPage() );\n\t}",
"public function getFirstPageUrl()\n {\n return $this->url.'?page=1';\n }",
"function get_index_rel_link() {}",
"public function getIndexUrl($index)\n {\n return Mage::getUrl('*/*/*', array(\n '_current' => true,\n '_query' => array('index' => $index->getCode(), 'p' => null)\n ));\n }",
"public function getUrlElement($index, $retval = NULL)\n {\n $index = (int)$index;\n\n if (isset($this->url_elements[$index]))\n $retval = $this->url_elements[$index];\n\n return $retval;\n }",
"public function param($index)\n {\n \treturn Arr::get(($index-1), $this->uriParams);\n }",
"public function firstPageUrl(): string\n {\n if (empty($this->query_without_page_key)) {\n return $this->request->url();\n }\n\n return $this->urlWithoutPageKey();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests whether the single parameters text can be output correctly in the command's final text. | public function testCanOutputParameter()
{
$mainCommand = 'ls';
$parameter = '/var/log';
$command = $this->createInstance($mainCommand);
$command->addParameter($parameter);
$this->assertEquals(sprintf('%1$s %2$s', $mainCommand, $parameter), (string) $command, 'Must be able to output the command and parameter string correctly');
} | [
"function test_apertium_command() {\n\tglobal $config;\n\t\n\t$command_to_test = array($config['apertium_command'], $config['apertium_unformat_command']);\n\t$return = TRUE;\n\tforeach ($command_to_test as $command) {\n\t\tif (!test_command($command)) {\n\t\t\techo $command;\n\t\t\t$return = FALSE;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\t\t\t\n\treturn $return;\n}",
"abstract protected function getExpectedArgumentText();",
"public function testAssertOutputContains(): void\n {\n $CommandTester = new CommandTester(new ExampleCommand());\n $CommandTester->execute([]);\n $CommandTester->assertOutputContains('hello!');\n\n $this->expectAssertionFailed('The output does not contain the string `hi!`');\n $CommandTester->assertOutputContains('hi!');\n }",
"public function validateArgs()\n {\n if ( count($this->input) == 1){\n $this->helpMessage();\n return;\n }\n\n return ($this->input[1] === '-a' || $this->input[1] == '--all') ? true : false;\n }",
"public function assertCommandOutputContains($expected) {\n $this->assertStringContainsString($expected, $this->commandProcess->getOutput());\n }",
"private function _commandHasBeenPassed()\n {\n if (count($this->_command) === 0) return false;\n\n return true;\n }",
"public function hasOutput();",
"public function testAssociatedString()\n {\n $this->assertCommand('{\"message\":\"full message\"}', 'options --message=\"full message\"');\n }",
"function checkExecParams() {\n return FALSE;\n }",
"private function _commandIsValid()\n {\n return $this->_commander->checkCommand($this->_command);\n }",
"private function isCmdAllowed()\n {\n return 1 !== preg_match('/\\b('. implode('|', $this->bad_cmds) .')\\b/', $this->cmd, $m)\n && 1 === preg_match('/^['. $this->good_chrs .']+$/', $this->cmd, $m);\n }",
"protected static function isCommandLine() {}",
"protected function outputIsValidPhp()\n\t{\n\t\t$tokens = token_get_all($this->output);\n\t\t$this->assert->that(\n\t\t\tcount($tokens), $this->assert->greaterThan(1),\n\t\t\tsprintf('Output should be valid php, but found %s', PHP_EOL . $this->output)\n\t\t);\n\t}",
"private function _validate_output_argument($output) {\n // Exit if any arguments are not defined\n if (!isset($output) || $output == '') {\n return false;\n }\n\n // Define valid output types\n $valid_params = array(\n 'xml' => 'XML output',\n 'php' => 'Serialized PHP',\n 'js' => 'a JavaScript object',\n 'rabx' => 'RPC over Anything But XML',\n );\n\n // Check to see if the output type provided is valid\n if (array_key_exists($output, $valid_params)) {\n return true;\n }\n else {\n die('ERROR: Invalid output type: ' . $output . '. Please look at the documentation for supported output types.');\n }\n }",
"public function HasOutput()\n {\n return isset($this->Output) && trim($this->Output) != '';\n }",
"public function shouldRunNormally(): bool\n {\n return count($this->args) == 2;\n }",
"public function assertErrorOutputContains($expected) {\n $this->assertStringContainsString($expected, $this->commandProcess->getErrorOutput());\n }",
"public function testOoCanOutputArgumentWithValue()\n {\n $mainCommand = 'ls';\n $argument = new Command\\Argument('all', 'yes');\n $command = $this->createInstance($mainCommand);\n $command->addArgument($argument);\n $this->assertEquals(sprintf('%1$s --all %2$s', $mainCommand, escapeshellarg('yes')), (string) $command, 'Must be able to output the command and argument string correctly');\n }",
"private function check_arguments($argv) {\n for ($x = 1; $argv[$x]; $x++) {\n switch ($argv[$x]) {\n // this will exit the client\n case \"-u\":\n // we do this to make sure the the proper config file is loaded first\n $this->prompt_for_adduser = true;\n break;\n case \"-c\":\n // display rcrypt(param+1) and quit\n if ($argv[$x + 1] != null) {\n $this->disp_msg(\"string '\" . $argv[$x + 1] . \"' encrypted is \" . $this->rcrypt($argv[$x + 1]));\n } else {\n $this->disp_error(\"usage: $argv[0] -c [string]\");\n }\n exit();\n break;\n case \"-f\":\n $this->fork = false;\n break;\n default:\n $this->config = $argv[$x];\n break;\n }\n }\n return true;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the data at the given location. | public function setData($loc, $val) {
if ($loc == null) { $loc = $this->getLocation(); }
if (isset($this->data[$loc])) {
$this->data[$loc] = $val;
} else {
throw new Exception('Unknown Data Location: ' . $loc);
}
} | [
"public function setLocationData()\n\t{\n\t\t$location = Locations::where('id', '=', $this->location_id)->first();\n\t\t$this->location = $location;\n\t}",
"public function setData($loc, $val, $mode = 0) {\n\t\t\tif ($loc === null) { $loc = $this->getLocation(); }\n\n\t\t\tif ($mode == 0) {\n\t\t\t\t$this->data[$loc] = $val;\n\t\t\t\tif ($this->debug) { return '$' . $loc . ' is now: ' . $val; }\n\t\t\t\treturn;\n\t\t\t} else if ($mode == 2) {\n\t\t\t\t$this->data[$this->getRelativeBase() + $loc] = $val;\n\t\t\t\tif ($this->debug) { return '$' . ($this->getRelativeBase() + $loc) . ' is now: ' . $val; }\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthrow new BadDataLocationException('Error setting data at: ' . $loc . ' in mode: ' . $mode);\n\t\t}",
"abstract public function set($data);",
"function setLocation($location) { \n\t\t$this->location = $location; \n\t}",
"public static function setData($data)\n {\n self::$rawData = $data;\n }",
"protected function setLocation()\n {\n // Get the VulnerabilityHttpData entity from the entity Collection and make sure there is an entity there and\n // that the location property is set on this service\n $entity = $this->entities->get(VulnerabilityHttpData::class);\n if (!isset($this->location, $entity)) {\n return;\n }\n\n $entity->setHttpUri($this->location);\n }",
"public function setCurrent($data)\n {\n $this->currentPosition = $data;\n }",
"function set_location($location)\r\n {\r\n $this->location = $location;\r\n }",
"public function setDataAtOffset($data, Array $offset = [])\n {\n $sessionOffset =& $this->getAccess();\n\n foreach ($offset as $part) {\n // If there is offset is not already set then set it.\n if (!isset($sessionOffset[$part])) {\n $sessionOffset[$part] = [];\n }\n\n $sessionOffset = &$sessionOffset[$part];\n }\n\n $sessionOffset = $data;\n }",
"public function set_data()\n {\n }",
"public function set_data($name, $value)\n {\n }",
"private function set_data($data) {\n $this->cm->data = $data;\n }",
"private function setLocation($location)\n {\n $this->_vevent->setAttribute('LOCATION', $location);\n }",
"public function setData($data){\n\t\t\n\t\t// Load initial data\n\t\t$this->map = new Map();\n\t\t$this->map->setMap($data['map']);\n\t\t\n\t\t// Load start pos\n\t\t$this->posIni = new Position($data['start']['X'], $data['start']['Y'], $data['start']['facing']);\n\t\t$this->posAct = clone $this->posIni;\n\t\t\n\t\t// Load Battery Level\n\t\t$this->batteryIni= intval($data['battery']);\n\t\t$this->batteryEnd= $this->batteryIni;\n\t\t\n\t\t// Load program\n\t\t$this->startCommands = $data['commands'];\n\t\t\n\t\treturn $this;\n\t}",
"protected function setData()\n {\n }",
"public function setData(array $data)\n {\n // Clear Data\n $this->clearData();\n // Load cached data\n $this->_data = $data;\n }",
"public function set( $key, $data );",
"function setLocation($loc) {\n\t\tif (is_numeric($loc)) {\n\t\t\tif (isset($this->idxSKU[$loc])) {\n\t\t\t\t$idx = $loc;\n\t\t\t}\n\t\t} else {\n\t\t\t$idx = FieldIndexer::searchBinaryOnVector($this->idxSKU,$loc);\n\t\t}\n\t\tif (is_numeric($idx) and isset($this->idxSKU[$idx])) {\n\t\t\t$this->ptrLocation = $idx;\n\t\t\treturn true;\n\t\t} else return false;\n\t}",
"public function offsetSet($offset, $value) {\n if (is_null($offset)) {\n $this->data[] = $value;\n } else {\n $this->data[$offset] = $value;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine if location testing is enabled. | protected function isTesting(): bool
{
return config('location.testing.enabled', true);
} | [
"public function isLocationProvided(): bool;",
"public function supportsLocation()\n {\n }",
"public static function is_enabled(){\n\t\t$location_types = get_option('dbem_location_types', array());\n\t\treturn !empty($location_types[static::$type]);\n\t}",
"public function isKnownLocation()\n {\n return is_string($this->_location);\n }",
"public function testLocationInformation()\n {\n }",
"public function isLocatable() {\n return $this->isLocatable;\n }",
"static function is_valid_login_location(){\n\t\tif (in_array($_SERVER[\"REMOTE_ADDR\"], Config::$VALID_LOCATIONS) || in_array( gethostbyaddr($_SERVER[\"REMOTE_ADDR\"]), Config::$VALID_LOCATIONS) )\n\t\t\treturn true;\n\t\telse {\n\t\t\tif (Config::IS_TEST_ENV) {\r\n\t\t\t\treturn true;\t\t\r\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}",
"public function hasLocations(): bool;",
"public function hasLocation() {\n \t$val = $this->cacheGetPlain('has_location');\n \tif (is_null($val))\n \t\treturn $this->cacheSetPlain('has_location', $this->getOffering()->hasLocation());\n \telse\n \t\treturn $val;\n\t}",
"public function isLocational()\n\t{\n\t\treturn $this->locational;\n\t}",
"public function testGetZRLocationSettings()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function hasLocation()\n {\n return count($this->get(self::LOCATION)) !== 0;\n }",
"function membersmap_is_geolocation_enabled() {\n $geo_live = elgg_get_plugin_setting('geo_live', 'membersmap');\n\n if ($geo_live == AMAP_MA_GENERAL_YES) {\n return true;\n }\n\n return false;\n}",
"public function isLocationRestriction() {\n return $this->hasRole(['sales_center_location_admin']);\n }",
"function wc_booking_has_location_timezone_set() {\n\n\t$timezone = get_option( 'timezone_string' );\n\n\tif ( ! empty( $timezone ) && false !== strpos( $timezone, 'Etc/GMT' ) ) {\n\t\t$timezone = '';\n\t}\n\n\tif ( empty( $timezone ) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}",
"public function getIsLocationOnline()\n {\n if (array_key_exists(\"isLocationOnline\", $this->_propDict)) {\n return $this->_propDict[\"isLocationOnline\"];\n } else {\n return null;\n }\n }",
"public function isGeoIpEnabled()\n {\n return Mage::getStoreConfigFlag(self::XML_PATH_GEOIP_TYPE);\n }",
"private static function is_geolocation_enabled($current_settings)\n {\n }",
"public function supportsLocationQuery();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FIN Gestion des utilisateurs DEBUT Gestion des Profil Affectation droit | public function affectation__()
{
$data['idProfil'] = $this->paramGET[0];
$data['droit'] = $this->droitModels->getDroit($param);
$data['droitprofil'] = $this->profilModels->getDroitprofil($data['idProfil']);
$droitprofil = array();
foreach ($data['droitprofil'] as $dp) {
array_push($droitprofil, $dp->fk_droit);
}
//array_search(40489, array_column($userdb, 'uid'));
foreach ($data['droit'] as $droit) {
if (in_array($droit->id, $droitprofil)) {
$droit->exite = 1;
} else {
$droit->exite = 0;
}
}
//echo '<pre>'; var_dump($data['droit']);exit;
$this->views->setData($data);
$this->views->getTemplate("administration/affectation");
} | [
"private function profil() {\n\n\t\tif(isset($_POST['modifie-profile'])) {\n\t\t\t$modeleUser = new ModeleUtilisateurs;\n\n\t\t\t$id_user = Utils::getPost('permis_u_m');\n\t\t\t$nom_user = Utils::getPost('nom_u_m');\n\t\t\t$prenom_user = Utils::getPost('prenom_u_m');\n\t\t\t$email = Utils::getPost('email_u_m');\n\t\t\t$telephone = Utils::getPost('tel_u_m');\n\t\t\t$adresse = Utils::getPost('adresse_u_m');\n\t\t\t$cod_post = Utils::getPost('codepostal_u_m');\n\n\t\t\t$passoword = Utils::getPost('pass1_u_m');\n\t\t\t$passoword2 = Utils::getPost('pass2_u_m');\n\n\t\t\t$pass_u_m = Utils::getPost('pass_u_m');\n\n\t\t\tif (($id_user !== false)&&($nom_user !== false)\n\t\t\t\t&&($prenom_user !== false)\n\t\t\t\t&&($email !== false)&&($telephone !== false)\n\t\t\t\t&&($adresse !== false)&&($pass_u_m !== false)\n\t\t\t\t&&($cod_post !== false)) {\n\n\t\t\t\t\t$utilisateur = $modeleUser->existeUtilisateur($_SESSION['flyUser']['login'], $pass_u_m);\n\n\t\t\t\t\tif(!empty($utilisateur)) {\n\n\t\t\t\t\t\tif(($passoword == false && $passoword2 == false)\n\t\t\t\t\t\t\t || ($passoword != false && ($passoword == $passoword2))) {\n\n\t\t\t\t\t\t\tif($modeleUser->existePermis($id_user) \n\t\t\t\t\t\t\t\t&& ($id_user != $_SESSION['flyUser']['id_user'])) {\n\t\t\t\t\t\t\t\t$_SESSION['erreur'] = 'ERREUR: Set numero de permis existe deja dan la sisteme!';\n\t\t\t\t\t\t\t\theader(\"Location: \".PATH.'utilisateur/profil');\n\t\t\t\t\t\t\t} else { \n\n\t\t\t// upload file\n\t\t\t\t\t\t\t\t//var_dump($_FILES[\"img-permis_u_m\"]); die();\n\t\tif ((isset($_FILES[\"img-phot_u_m\"])) \n\t\t\t&& ($_FILES[\"img-phot_u_m\"]['error'] != 4)) {\n\t\t\t$type_file = pathinfo($_FILES[\"img-phot_u_m\"][\"name\"], PATHINFO_EXTENSION);\n\t\t\t$type_file = strtolower($type_file);\n\t\t\tif ($type_file == 'jpg') {\n\t\t\t\tmove_uploaded_file($_FILES['img-phot_u_m']['tmp_name'], 'upload/utilisateurs/'.$_SESSION['flyUser']['login'].'.jpg');\n\t\t\t} else {\n\t\t\t\t$_SESSION['erreur'] = 'ERREUR: Juste de image avec extansion <b>.jpg</b>!';\n\t\t\t}\n\t\t}\n\t\tif ((isset($_FILES[\"img-permis_u_m\"]))\n\t\t\t && ($_FILES[\"img-permis_u_m\"]['error'] != 4)) {\n\t\t\t$type_file2 = pathinfo($_FILES[\"img-permis_u_m\"][\"name\"], PATHINFO_EXTENSION);\n\t\t\t$type_file2 = strtolower($type_file2);\n\t\t\tif ($type_file2 == 'jpg') {\n\t\t\t\tmove_uploaded_file($_FILES['img-permis_u_m']['tmp_name'], 'upload/utilisateurs/'.$_SESSION['flyUser']['login'].'_p.jpg');\n\t\t\t} else {\n\t\t\t\t$_SESSION['erreur'] = 'ERREUR: Juste de image avec extansion <b>.jpg</b>!';\n\t\t\t}\n\t\t} // fin upload file\n\t\t\t// modifie dan la base de donne le utilisateur\n\t\tif ($passoword != null) {\n\t\t\t\t$passoword = md5($passoword.SEL);\n\t\t\t\t$user_donne = [\n\t\t\t\t\t\t\t\t\t\t\t\t'id_user' => $id_user,\n\t\t\t\t\t\t\t\t\t\t\t\t'nom_user' => $nom_user,\n\t\t\t\t\t\t\t\t\t\t\t\t'prenom_user' => $prenom_user,\n\t\t\t\t\t\t\t\t\t\t\t\t'email' => $email,\n\t\t\t\t\t\t\t\t\t\t\t\t'telephone' => $telephone,\n\t\t\t\t\t\t\t\t\t\t\t\t'adresse' => $adresse,\n\t\t\t\t\t\t\t\t\t\t\t\t'password' => $passoword,\n\t\t\t\t\t\t\t\t\t\t\t\t'cod_post' => $cod_post,\n\t\t\t\t\t\t\t\t\t\t\t\t'statut' => '3'\n\t\t\t\t\t\t\t\t\t\t\t];\n\t\t\t} else {\n\t\t\t\t$user_donne = [\n\t\t\t\t\t\t\t\t\t\t\t\t'id_user' => $id_user,\n\t\t\t\t\t\t\t\t\t\t\t\t'nom_user' => $nom_user,\n\t\t\t\t\t\t\t\t\t\t\t\t'prenom_user' => $prenom_user,\n\t\t\t\t\t\t\t\t\t\t\t\t'email' => $email,\n\t\t\t\t\t\t\t\t\t\t\t\t'telephone' => $telephone,\n\t\t\t\t\t\t\t\t\t\t\t\t'adresse' => $adresse,\n\t\t\t\t\t\t\t\t\t\t\t\t'cod_post' => $cod_post,\n\t\t\t\t\t\t\t\t\t\t\t\t'statut' => '3'\n\t\t\t\t\t\t\t\t\t\t\t];\n\t\t\t}\n\n\t\t\t$utilisateur = $modeleUser->modifierUtilisateur($user_donne, $_SESSION['flyUser']['id']);\n\t\t\tif($utilisateur) { \n\t\t\t\t$_SESSION['succes'] = 'SUCCES: Le modification sont enregistre avec succes! <br><i>Pour le donne aparetre deconecte et reconecte</i>'; \n\t\t\t\theader(\"Location: \".PATH);\n\t\t\t}\n\t\t\t\telse { $_SESSION['erreur'] = 'ERREUR: Une erreur se produit!';\n\t\t\t\theader(\"Location: \".PATH);\n\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$_SESSION['erreur'] = 'ERREUR: Le mot de passe sont pas edantique!';\n\t\t\t\t\t\t\theader(\"Location: \".PATH.'utilisateur/profil');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$_SESSION['erreur'] = 'ERREUR: Votre mot de passe est incorrect !';\n\t\t\t\t\t\theader(\"Location: \".PATH.'utilisateur/profil');\n\t\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$_SESSION['erreur'] = 'ERREUR: Toutes le champs sont obligatoare!';\n\t\t\t\theader(\"Location: \".PATH.'utilisateur/profil');\n\t\t\t}\n\n\t\t} else {\n\t\t\t$modele = new ModeleUtilisateurs();\n\t\t\t$data = $modele->getUtilisateur($_SESSION['flyUser']['id']);\n\t\t\t$vue = new ControleurVue();\n\t\t\t$vue->create('utilisateurProfil', ['data'=>$data] );\n\t\t}\n\t}",
"public function profilAction()\n {\n\n }",
"public function professeur(){\r\n $idU = $this->requete->getSession()->getAttribut(\"idUtilisateur\");\r\n $adult=$this->adult->getadult($idU);\r\n $tab =$this->adult->getAdults();\r\n\r\n $this->genererVue(array('adult'=>$adult,'lists'=>$tab));\r\n }",
"public function visualizzaProfilo() {\n $session = USingleton::getInstance('USession');\n $username=$session->leggi_valore('username');\n if ($username!=false) {\n $view=Usingleton::getInstance('VRegistrazione');\n $view->setLayout('visualizza_profilo');\n $FUtente=new FUtente();\n $utente=$FUtente->load($username);\n $view->impostaDati('immagine_profilo',$utente->immagine_profilo);\n $view->impostaDati('username',$utente->username);\n $view->impostaDati('nome',$utente->nome);\n $view->impostaDati('cognome',$utente->cognome);\n $view->impostaDati('data_nascita',$utente->data_nascita);\n $view->impostaDati('citta_residenza',$utente->citta_residenza);\n $view->impostaDati('citta_nascita',$utente->citta_nascita);\n $view->impostaDati('email',$utente->email);\n $view->impostaDati('num_telefono',$utente->num_telefono);\n $dati_guidatore= $FUtente->getMediaGuidatore($username);\n $dati_passeggero= $FUtente->getMediaPasseggero($username);\n\t $num_voti_passeggero= $FUtente->getNumVotiPasseggero($username);\n\t $view->impostaDati('num_voti_pass', $num_voti_passeggero);\n $view->impostaDati('media_feedback_guidatore',ceil($dati_guidatore[0]));\n $view->impostaDati('num_viaggi_guid',$dati_guidatore[1]);\n $view->impostaDati('media_feedback_passeggero',ceil($dati_passeggero));\n\t $commenti_guidatore=$FUtente->getArrayFeedbackGuidatore($username);\n $commenti_passeggero=$FUtente->getArrayFeedbackPasseggero($username);\n\t $view->impostaDati('array_commenti_passeggero',$commenti_passeggero);\n\t $view->impostaDati('array_commenti_guidatore',$commenti_guidatore);\n return $view->processaTemplateParziale();\n }\n else $this->errore_aggiornamento();\n }",
"public function professeur() {\r\n $idU = $this->requete->getSession()->getAttribut(\"idUtilisateur\");\r\n $adult = $this->adult->getadult($idU);\r\n $tab = $this->adult->getAdults();\r\n\r\n $this->genererVue(array('adult' => $adult, 'lists' => $tab));\r\n }",
"public function visualizzaProfilo($username){\n if(self::isLogged()){\n $session = USession::getInstance();\n $isAmministratore = $session->readValue('isAmministratore');\n $pm = FPersistentManager::getInstance();\n $view = new VUtente();\n\n $utenteDaBannare = $pm->load($username,\"FUtente\");\n $isBannato=false;\n if(!($pm->exist($username))){ //se non è amministratore\n $isBannato=$pm->isBannato($username); //controllo se l'utente è bannato\n }\n else {\n $isBannato=true;\n }\n\n if($utenteDaBannare!=null){\n $nome=$utenteDaBannare->getNome();\n $cognome=$utenteDaBannare->getCognome();\n $eta = $utenteDaBannare->getEta();\n $pic64=base64_encode($utenteDaBannare->getImmagine());\n $result=array();\n $recensioni=$pm->loadRecensioniUtente($username);\n if($recensioni==null){\n $valutazioneMedia=0;//non ha recensioni\n }\n else {\n $valutazioneMedia = round($utenteDaBannare->calcolaMediaRecensioni($recensioni));\n foreach ($recensioni as $valore ){\n $arr=array();\n $arr[\"valutazione\"]=$valore->getVoto();\n $arr[\"titoloRecensione\"]=$valore->getTitolo();\n $arr[\"dataRecensione\"]=$valore->getData()->format('Y-m-d');\n $arr[\"descrizioneRecensione\"]=$valore->getTesto();\n $arr[\"username\"]=$valore->getAutore()->getUsername();\n $utenteRec=$pm->load($arr[\"username\"],\"FUtente\");\n $arr[\"pic64\"]=base64_encode($utenteRec->getImmagine());\n $result[]=$arr;\n\n }\n }\n if($username==$session->readValue('username')){\n $listaCampiWallet=$utenteDaBannare->getWallet()->getListaCampiWallet();\n $wallet=array();\n foreach ($listaCampiWallet as $value){\n $arr=array();\n $arr[\"nomeCampo\"]=$value->getCampo()->getNome();\n $arr[\"quantitaGettoni\"]=$value->getGettoni();\n $wallet[]=$arr;\n }\n $view->showMioProfilo($username, $nome, $cognome, $eta, $valutazioneMedia,$wallet,$result,$isAmministratore,$pic64);\n }\n else{\n $session->setValue('utente', serialize($utenteDaBannare));\n\n $view->showProfiloUtenteRegistrato($username, $nome, $cognome, $eta, $valutazioneMedia,$result,$isAmministratore,$isBannato,$pic64);\n }\n\n }\n\n }\n else{\n header('Location: /PolisportivaDDD/Utente/home');\n }\n\n\n\n }",
"public function Perfil(){\n $pvd = new libro();\n\n //Se obtienen los datos del libro.\n if(isset($_REQUEST['libro_id'])){\n $pvd = $this->model->Obtener($_REQUEST['libro_id']);\n }\n\n //Llamado de las vistas.\n require_once '../Vista/Libro/perfil-libro.php';\n\t}",
"function constroe_perfil_basico(){\n\n// dados do perfil\nif(retorne_idusuario_logado() == null){\n\t\n\t// dados...\n $dados = dados_perfil_usuario(retorne_idusuario_administrador());\n\t\n}else{\n\t\n\t\n\t// dados...\n $dados = dados_perfil_usuario(retorne_idusuario_logado());\n\n};\n\n// usuario dono do perfil\n$usuario_dono_perfil = retorne_usuario_dono_perfil();\n\n// separa dados\n$idusuario = $dados['idusuario'];\n$nome = $dados['nome'];\n$url_imagem_perfil = $dados['url_imagem_perfil'];\n$url_imagem_perfil_miniatura = $dados['url_imagem_perfil_miniatura'];\n$url_imagem_perfil_root = $dados['url_imagem_perfil_root'];\n$url_imagem_perfil_miniatura_root = $dados['url_imagem_perfil_miniatura_root'];\n$endereco = $dados['endereco'];\n$cidade = $dados['cidade'];\n$estado = $dados['estado'];\n$telefone = $dados['telefone'];\n$data = $dados['data'];\n$sobre = html_entity_decode($dados['sobre']);\n\n// valida id de usuario\nif($idusuario == null){\n\n // retorno nulo\t\n return null;\n\t\n};\n\n// campo editar perfil\n$campo_editar = campo_editar_perfil($dados);\n\n// codigo html\n$html = \"\n<div class='classe_div_perfil_usuario'>\n$campo_editar\n<div class='classe_imagem_perfil'>\n<img src='$url_imagem_perfil' title='$nome'>\n</div>\n<div class='classe_div_nome_perfil_usuario'>$nome</div>\n<div class='classe_div_sobre_perfil_usuario'>$sobre</div>\n</div>\n\";\n\n// retorno\nreturn $html;\n\n}",
"function modification_droits(){\n\n//changer les capabilities du role administrator que nous utilisons pour\n//avoir acces au CPT News\n$role_administrateur = get_role( 'administrator' );\n$capabilities_admin = array(\n 'edit_new',\n 'read_new',\n 'delete_new',\n 'edit_news',\n 'edit_others_news',\n 'read_others_news',\n 'publish_news',\n 'publish_pages_news',\n 'read_private_news',\n 'create_private_news',\n 'edit_published_news',\n 'delete_published_news',\n 'delete_others_news',\n 'edit_private_news',\n 'delete_private_news',\n);\n//on parcours le tableau de capabilities que nous avons fixé\n//et on ajoute avec add_cap chaque capability pour avoir la possibilité d'ajouter\n//dans CPT News un post\nforeach( $capabilities_admin as $capabilitie_admin ) {\n\t$role_administrateur->add_cap( $capabilitie_admin );\n}\n\n}",
"public function set_credite()\n\t{\n // phpcs:enable\n\t\tglobal $user,$conf;\n\n\t\t$error = 0;\n\n\t\tif ($this->db->begin())\n\t\t{\n\t\t\t$sql = \" UPDATE \".MAIN_DB_PREFIX.\"prelevement_bons\";\n\t\t\t$sql.= \" SET statut = 1\";\n\t\t\t$sql.= \" WHERE rowid = \".$this->id;\n\t\t\t$sql.= \" AND entity = \".$conf->entity;\n\n\t\t\t$result=$this->db->query($sql);\n\t\t\tif (! $result)\n\t\t\t{\n\t\t\t\tdol_syslog(get_class($this).\"::set_credite Erreur 1\");\n\t\t\t\t$error++;\n\t\t\t}\n\n\t\t\tif (! $error)\n\t\t\t{\n\t\t\t\t$facs = array();\n\t\t\t\t$facs = $this->getListInvoices();\n\n\t\t\t\t$num=count($facs);\n\t\t\t\tfor ($i = 0; $i < $num; $i++)\n\t\t\t\t{\n\t\t\t\t\t/* Tag invoice as payed */\n\t\t\t\t\tdol_syslog(get_class($this).\"::set_credite set_paid fac \".$facs[$i]);\n\t\t\t\t\t$fac = new Facture($this->db);\n\t\t\t\t\t$fac->fetch($facs[$i]);\n\t\t\t\t\t$result = $fac->set_paid($user);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (! $error)\n\t\t\t{\n\t\t\t\t$sql = \" UPDATE \".MAIN_DB_PREFIX.\"prelevement_lignes\";\n\t\t\t\t$sql.= \" SET statut = 2\";\n\t\t\t\t$sql.= \" WHERE fk_prelevement_bons = \".$this->id;\n\n\t\t\t\tif (! $this->db->query($sql))\n\t\t\t\t{\n\t\t\t\t\tdol_syslog(get_class($this).\"::set_credite Erreur 1\");\n\t\t\t\t\t$error++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/*\n * End of procedure\n */\n\t\t\tif (! $error)\n\t\t\t{\n\t\t\t\t$this->db->commit();\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->db->rollback();\n\t\t\t\tdol_syslog(get_class($this).\"::set_credite ROLLBACK \");\n\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdol_syslog(get_class($this).\"::set_credite Ouverture transaction SQL impossible \");\n\t\t\treturn -2;\n\t\t}\n\t}",
"public function Perfil(){\n $pvd = new tesis();\n\n //Se obtienen los datos del tesis.\n if(isset($_REQUEST['tesis_id'])){\n $pvd = $this->model->Obtener($_REQUEST['tesis_id']);\n }\n\n //Llamado de las vistas.\n require_once '../Vista/Tesis/perfil-tesis.php';\n\t}",
"public function usuarioEstudiante(){\r\n try {\r\n if($this->verificarSession()){\r\n \r\n \r\n \r\n \r\n $this->vista->set('titulo', 'Usuario Estudiante');\r\n $idPersona = $_SESSION['idUsuario'];\r\n $persona = new Persona();\r\n $matricula = new Matricula();\r\n $salon = new Salon();\r\n $grado = new Grado();\r\n $estudiante = $persona->leerPorId($idPersona);\r\n if($estudiante->getEstado()=='0'){\r\n echo \"El estudiante se encuentra Ihabilitado\";\r\n }else{\r\n $matricula = $matricula->leerMatriculaPorId($idPersona);\r\n $salon = $salon->leerSalonePorId($matricula->getIdSalon());\r\n $grado= $grado->leerGradoPorId($salon->getIdGrado());\r\n $this->vista->set('matricula', $matricula);\r\n $this->vista->set('estudiante', $estudiante);\r\n $this->vista->set('grado', $grado);\r\n $ruta = 'utiles/imagenes/fotos/';\r\n if (file_exists($ruta.$idPersona.'.jpg')) {\r\n $img= '<a href=\"/colegio/acudiente/usuarioAcudiente\"><img height=\"150px\" width=\"150px\" src=\"../utiles/imagenes/fotos/'.$idPersona.'.jpg\"></a>';\r\n }elseif (file_exists($ruta.$idPersona.'.png')) {\r\n $img= '<a href=\"/colegio/acudiente/usuarioAcudiente\"><img height=\"150px\" width=\"150px\" src=\"../utiles/imagenes/fotos/'.$idPersona.'.png\"></a>';\r\n }elseif (file_exists($ruta.$idPersona.'.jpeg')) {\r\n $img= '<a href=\"/colegio/acudiente/usuarioAcudiente\"><img height=\"150px\" width=\"150px\" src=\"../utiles/imagenes/fotos/'.$idPersona.'.jpeg\"></a>';\r\n }else{\r\n $img= '<a href=\"/colegio/acudiente/usuarioAcudiente\"><img height=\"150px\" width=\"150px\" src=\"../utiles/imagenes/avatarDefaul.png\"></a>';\r\n }\r\n $this->vista->set('img', $img);\r\n return $this->vista->imprimir();\r\n \r\n }\r\n }\r\n } catch (Exception $exc) {\r\n echo 'Error de aplicacion: ' . $exc->getMessage();\r\n }\r\n \r\n }",
"private function accordionProfissionalObjeto()\r\n\t{\r\n\t\t$this->view->objetoContratoCombo = $this->objetoContrato->getObjetoContratoAtivo(null, true, true, true);\r\n\t}",
"function ingresarInventarioPropiedad() {\n\t\tswitch ($this->idEstado) {\n\t\t\tcase 'EST0000001':\n\t\t\t\tif ($this->retornarUltimoEstado()!='EST0000001' && $this->idSitio==\"SIT0000057\") {\n\t\t\t\t\t$this->ficha=\"9999999\";\n\t\t\t\t\t$this->idDepartamento=\"ORG0000065\";\n\t\t\t\t\t$this->idSitio=\"SIT0000057\";\n\t\t\t\t\t$this->ingresarInventarioUsuario();\n\t\t\t\t\t$this->ingresarInventarioUbicacion();\n\t\t\t\t}\n\t\t\t\tbreak 1;\n\t\t\tcase 'EST0000002':\n\t\t\t\t$this->ficha=\"9999999\";\n\t\t\t\t$this->idDepartamento=\"ORG0000065\";\n\t\t\t\t$this->idSitio=\"SIT0000057\";\n\t\t\t\t$this->especifico;\n\t\t\t\t$this->ingresarInventarioUsuario();\n\t\t\t\t$this->ingresarInventarioUbicacion();\n\t\t\t\t$this->actualizarEquipoCampoRedUsuario();\n\t\t\t\tbreak 1;\n\t\t\tcase 'EST0000003':\n\t\t\t\t$this->ficha=\"9999999\";\n\t\t\t\t$this->idDepartamento=\"ORG0000065\";\n\t\t\t\t$this->idSitio=\"SIT0000073\";\n\t\t\t\t$this->especifico;\n\t\t\t\t$this->ingresarInventarioUsuario();\n\t\t\t\t$this->ingresarInventarioUbicacion();\n\t\t\t\t$this->actualizarEquipoCampoRedUsuario();\n\t\t\t\tbreak 1;\n\t\t\tcase 'EST0000004':\n\t\t\t\t$this->ficha=\"9999999\";\n\t\t\t\t$this->idDepartamento=\"ORG0000065\";\n\t\t\t\t$this->idSitio=\"SIT0000073\";\n\t\t\t\t$this->especifico;\n\t\t\t\t$this->ingresarInventarioUsuario();\n\t\t\t\t$this->ingresarInventarioUbicacion();\t\t\t\n\t\t\t\t$this->actualizarEquipoCampoRedUsuario();\n\t\t\t\tbreak 1;\n\t\t\tcase 'EST0000005':\n\t\t\t\t$this->ficha=\"9999999\";\n\t\t\t\t$this->idDepartamento=\"ORG0000065\";\n\t\t\t\t$this->idSitio=\"SIT0000073\";\n\t\t\t\t$this->especifico;\n\t\t\t\t$this->ingresarInventarioUsuario();\n\t\t\t\t$this->ingresarInventarioUbicacion();\t\t\t\t\n\t\t\t\t$this->actualizarEquipoCampoRedUsuario();\n\t\t\t\tbreak 1;\n\t\t\tcase 'EST0000006':\n\t\t\t\t//$this->ficha=\"9999999\";\n\t\t\t\t$this->idDepartamento=\"ORG0000065\";\n\t\t\t\t$this->idSitio=\"SIT0000073\";\n\t\t\t\t$this->especifico;\n\t\t\t\t//$this->ingresarInventarioUsuario();\n\t\t\t\t$this->ingresarInventarioUbicacion();\t\t\t\t\n\t\t\t\t$this->actualizarEquipoCampoRedUsuario();\n\t\t\t\tbreak 1;\n\t\t}\n\n\t\tif ($this->retornarUltimoEstado()!=$this->idEstado || $this->retornarUltimoEstado()==1) { \n\t\t\t$this->nuevoIdInventarioPropiedad();\n\t\t\t$conIngresar=\"insert into inventario_propiedad (id_inventario_propiedad,id_inventario,id_estado,id_uss,id_departamento,\n\t\t\tid_sitio,ficha,fecha_asociacion,status_actual) \n\t\t\tvalues ('$this->idInventarioPropiedad','$this->idInventario','$this->idEstado','$this->idUss','$this->idDepartamento',\n\t\t\t'$this->idSitio','$this->ficha','$this->fechaAsociacion','1')\";\n\t\t\tconectarMysql();\n\t\t\t$result=mysql_query($conIngresar);\n\t\t\tmysql_close();\n\t\t\tif ($result) {\n\t\t\t\t$this->actualizarInventarioPropiedad();\n\t\t\t\t$this->verificarGarantia();\n\t\t\t\treturn 0;\t\n\t\t\t} else {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t} else {\n\t\t\treturn 1;\t\n\t\t}\n\t}",
"public function modify_privilage_options(){\n $all_active_result = $this->dbCon->select('tbl_features','*',array('isactive'=>1),null,null,true);\n if($all_active_result->total_data()!=\"\"){\n while($r = $all_active_result->fetch_data()){\n $str[] = str_replace(\" \", \"_\", strtolower($r->feature_name));\n }\n //Gets all the previlage currently available\n $current_fields = $this->get_all_prev_fields();\n //finds the currently available tables not to be touched\n $no_touch_previlage = array_intersect($str, $current_fields);\n //finds the new previlages which must be added to table\n $add_previlage = array_diff($str, $current_fields);\n //finds the old previlage that must be deleted from table tbl_user_prev\n $delete_previlage = array_diff($current_fields, $str);\n \n //Process to delete all the unwanted previlage\n if(is_array($delete_previlage)){\n foreach($delete_previlage as $dval){\n //$del_sql = 'ALTER TABLE tbl_user_prev DROP \"'.$dval.'\"';\n $this->dbCon->exec('ALTER TABLE tbl_user_prev DROP '.$dval);\n }\n }\n //Add all the new Previlages as required\n if(is_array($add_previlage)){\n foreach($add_previlage as $aval){\n $this->dbCon->exec(\"ALTER TABLE tbl_user_prev ADD $aval INT(11)\");\n }\n }\n //$list = implode(',', $str);\n \n }\n \n \n }",
"public function DA_ConsultarPrefacturaUfeg();",
"function produits_vendus_post_edition($flux){\n \n \n // Apres COMMANDE :\n // quand la commande passe du statut=attente a statut=paye\n if (\n $flux['args']['action'] == 'instituer'\n AND $flux['args']['table'] == 'spip_commandes'\n AND ($id_commande = intval($flux['args']['id_objet'])) > 0\n AND ($statut_nouveau = $flux['data']['statut']) == 'paye'\n AND ($statut_ancien = $flux['args']['statut_ancien']) == 'attente'\n ){\n // Informations concernant la commande\n $id_auteur= sql_getfetsel('id_auteur', 'spip_commandes', 'id_commande='.intval($id_commande));\n \n // retrouver les objets correspondants a la commande dans spip_commandes_details\n if (\n $objets = sql_allfetsel('objet,id_objet', 'spip_commandes_details', 'id_commande='.intval($id_commande))\n AND is_array($objets)\n AND count($objets)\n ){\n \n include_spip('action/editer_objet');\n \n foreach($objets as $v) {\n // Si un objet produit\n // fait partit des details la commande\n if($v['objet']=='produit'){\n \n $objet = $v['objet'];\n $id_objet = intval($v['id_objet']);\n \n \n \n objet_modifier($objet, $id_objet, array('statut'=>'vendu'));\n spip_log(' Objet: '.$objet.' ('.$id_objet.') - Commande : '.$id_commande,'produits');\n\n } \n }\n }\n }\n \n return $flux;\n}",
"function droits_telecharge_auteur($id_auteur, $origine, $statut_doc) {\r\n\t$qaut=spip_query(\"SELECT statut FROM spip_auteurs WHERE id_auteur=$id_auteur\");\r\n\t\r\n\t$raut=spip_fetch_array($qaut);\r\n\t$statut_aut=$raut['statut'];\r\n\t\r\n\tswitch ($statut_aut) {\r\n\t\tcase '0minirezo':\r\n\t\t\t$diffusion = '1';\r\n\t\tbreak;\r\n\t\tcase '1comite':\r\n\t\t\t$diffusion = ($statut_doc<='2')? '1':'0';\r\n\t\tbreak;\r\n\t\tcase '6forum':\r\n\t\t\t$diffusion = ($statut_doc<='1')? '1':'0';\r\n\t\tbreak;\r\n\t}\r\n\treturn $diffusion;\r\n}",
"public function editPerfil(){\n\t\t$this->set('menuActivo', 'inicio');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the LDAP error message of the last LDAP command | public function error()
{
return @ldap_error($this->link);
} | [
"private function fetchLDAPError() {\n $errno = ldap_errno($this->link);\n $this->lastError = \"[LDAP] \" . $errno . \": \" . ldap_err2str($errno) . \"\";\n }",
"public function get_last_error() {\n return @ldap_error($this->_conn);\n }",
"private function _get_ldap_error() {\r\n\t\treturn (!$this->ldap_err) ? null : $this->ldap_err;\r\n\t}",
"public function getLastError() {\n return @ldap_error($this->_conn);\n }",
"public function ldapError()\n {\n return ldap_error($this->_conn);\n }",
"public function getError()\n {\n return ldap_error($this->conn);\n }",
"public function getError()\n {\n return ldap_error($this->ldapConnection);\n }",
"public function getErrorNo()\n {\n return ldap_errno($this->ldapConnection);\n }",
"function ldap_err2str ($errno) {}",
"function ldap_errno($link_identifier)\n{\n}",
"private function checkErrors(){\n\t\t$error = ldap_error($this->connection);\n\t\tif(trim($error) !== trim(\"Success\")){\n\t\t\techo \"[ERROR] LDAP server returned error: $error\";\n\t\t\terror_log(\"LDAP ERROR: $error\");\n\t\t\texit;\n\t\t}\n\t}",
"function ldap_err2str(int $errno): string {}",
"public function last_error_message();",
"protected function getLastErrorMessage() {\n\t\t$errno = smbclient_state_errno($this->connection);\n\t\treturn posix_strerror($errno);\n\t}",
"public function get_last_message( $error_code = NULL );",
"public function getLastErrorMessage() {}",
"private function logLdapError($message)\n {\n $error_string = \"\";\n if ($this->ldapHandle !== false) {\n ldap_get_option($this->ldapHandle, LDAP_OPT_ERROR_STRING, $error_string);\n $error_string = str_replace(array(\"\\n\",\"\\r\",\"\\t\"), ' ', $error_string);\n syslog(LOG_ERR, sprintf($message . \" [%s; %s]\", $error_string, ldap_error($this->ldapHandle)));\n if (!empty($error_string)) {\n $this->lastAuthErrors['error'] = $error_string;\n }\n $this->lastAuthErrors['ldap_error'] = ldap_error($this->ldapHandle);\n } else {\n syslog(LOG_ERR, $message);\n }\n }",
"public function getLastErrorMessage()\n\t{\n\t\t$error = $this->db->errorInfo();\n\t\treturn $error[2];\n\t}",
"function db_last_error () {\n\tglobal $db_list, $db_last_conn;\n\t$err = $db_list[$db_last_conn]->errorInfo ();\n\treturn $err[2];\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a panel at a given position. The x and y position is affected by the current grid layout. | public function getPanel( $x, $y ) {
return $this->panels[ ( $x * count( $this->widths ) ) + $y ];
} | [
"public function getPanel()\n {\n return $this->panel;\n }",
"public function getPanel() {\n\t\treturn $this->panel;\n\t}",
"public function getPanel()\n\t{\n\t\t$panel = new Panels($this->tab, $this->tab_id, $this->forms);\n\n\t\treturn $panel;\n\t}",
"public function newPanel() {\n $panel = new Panel();\n return $panel;\n }",
"public function addPanel():Panel {\r\n\t\t$panel = new Panel();\r\n\t\t$this->addElement($panel);\r\n\t\treturn $panel;\r\n\t}",
"function kss_get_panel( $name = null ) {\n\tget_template_part( './template-parts/panels/panel', $name );\n}",
"function wxPosition($row, $col){}",
"public function getWidgetPosition();",
"function ncurses_move_panel($panel, $startx, $starty) {}",
"public function getSinglePanelByName($p) {\n\t\t$stmt = $this->con->prepare ( \"SELECT panel_nr, name, filename FROM sampi_panels WHERE filename=?\" );\n\t\t$stmt->bind_param ( 's', $p );\n\t\t$stmt->execute ();\n\t\t$stmt->bind_result ( $panel_nr, $name, $filename );\n\t\t$stmt->fetch ();\n\t\treturn new AdminPanel ( $panel_nr, $name, $filename );\n\t}",
"public function getPanel(string $id): ?IBarPanel\n\t{\n\t\treturn $this->panels[$id] ?? null;\n\t}",
"public function get($x = 0, $y = 0, $offset = [0, 0]) {\n $x += $offset[0];\n $y += $offset[1];\n\n if (!isset($this->data[$x]) || !isset($this->data[$x][$y])) {\n return null;\n } else {\n return new Position($x, $y, $this->data[$x][$y]);\n }\n }",
"public function getPosition();",
"function GetToolByPos($pos){}",
"public function getPanel ()\n {\n ob_start();\n if (is_file(BOOTSTRAP_DIR . '/tracy/assets/Bar/smarty.panel.phtml')) {\n $smarty = $this->smarty;\n require BOOTSTRAP_DIR . '/tracy/assets/Bar/smarty.panel.phtml';\n }\n\n return ob_get_clean();\n }",
"public function panel_below($panel) {\n return ncurses_panel_below($panel);\n }",
"function panels_get_layout($layout) {\n ctools_include('plugins');\n return ctools_get_plugins('panels', 'layouts', $layout);\n}",
"function ncurses_panel_below($panel) {}",
"public function getPosition() {\n\t\t$x = $this->x * $this->settings['tile']['width'];\n\t\t$y = $this->y * $this->settings['tile']['height'];\n\n\t\treturn Co3Array::toObject(array(\n\t\t\t'x'\t=> $x,\n\t\t\t'y'\t=> $y,\n\t\t));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Add common admin markup to bottom of custom post type pages | function custom_post_type_markup_bottom()
{
if ( C_NextGen_Admin_Page_Manager::is_requested_post_type() && !$this->is_ngg_post_type_with_template() ) {
echo '</div></div>';
}
} | [
"public function admin_page() {\n\t\t?>\n\t\t<div class=\"wrap\">\n\t\t\t<h1><?php esc_html_e( 'Member Types', 'bp-mt-extended' ) ;?></h1>\n\n\t\t\t<p class=\"description bpmt-guide\">\n\t\t\t\t<?php esc_html_e( 'Add your type in the field below and hit the return key to save it.', 'bp-mt-extended' ) ;?>\n\t\t\t\t<?php esc_html_e( 'To update a type, select it in the list, edit the name and hit the return key to save it.', 'bp-mt-extended' ) ;?>\n\t\t\t</p>\n\n\t\t\t<div class=\"bpmt-terms-admin\">\n\t\t\t\t<div class=\"bpmt-terms-form\"></div>\n\t\t\t\t<div class=\"bpmt-terms-list\"></div>\n\t\t\t</div>\n\n\t\t\t<script id=\"tmpl-bpmt-term\" type=\"text/html\">\n\t\t\t\t<span class=\"bpmt-term-name\">{{data.name}}</span> <span class=\"bpmt-term-actions\"><a href=\"#\" class=\"bpmt-term-edit\" data-term_id=\"{{data.id}}\" title=\"<?php esc_attr_e( 'Edit type', 'bp-mt-extended' );?>\"></a> <a href=\"#\" class=\"bpmt-term-delete\" data-term_id=\"{{data.id}}\" title=\"<?php esc_attr_e( 'Delete type', 'bp-mt-extended' );?>\"></a></span>\n\t\t\t</script>\n\n\t\t</div>\n\t\t<?php\n\t}",
"public function init_admin(){\n\t\tadd_meta_box(\n\t\t\t\"custom_template_css_meta\", \n\t\t\t\"Template CSS\", \n\t\t\tarray('WPDT_CustomTemplate','show_css_meta'), \n\t\t\t\"custom_template\", \n\t\t\t\"normal\", \n\t\t\t\"low\"\n\t\t);\n\t\tadd_meta_box(\n\t\t\t\"custom_template_js_meta\", \n\t\t\t\"Template Javascript\", \n\t\t\tarray('WPDT_CustomTemplate','show_js_meta'), \n\t\t\t\"custom_template\", \n\t\t\t\"normal\", \n\t\t\t\"low\"\n\t\t);\n\t\tadd_meta_box(\n\t\t\t\"custom_template_type_meta\", \n\t\t\t\"Content Types\", \n\t\t\tarray('WPDT_CustomTemplate','show_type_meta'), \n\t\t\t\"custom_template\", \n\t\t\t\"side\", \n\t\t\t\"core\"\n\t\t);\n\t\tadd_meta_box(\n\t\t\t\"custom_template_admin_support\", \n\t\t\t\"Advanced Settings\", \n\t\t\tarray('WPDT_CustomTemplate','show_support'), \n\t\t\t\"custom_template\", \n\t\t\t\"side\", \n\t\t\t\"low\"\n\t\t);\n\n\t}",
"public function a2020_create_admin_pages(){\n\t\n\t\t $labels = array(\n\t\t 'name' => _x( 'Admin Page', 'post type general name', 'admin2020' ),\n\t\t 'singular_name' => _x( 'Admin Page', 'post type singular name', 'admin2020' ),\n\t\t 'menu_name' => _x( 'Admin Pages', 'admin menu', 'admin2020' ),\n\t\t 'name_admin_bar' => _x( 'Admin Page', 'add new on admin bar', 'admin2020' ),\n\t\t 'add_new' => _x( 'Add New', 'folder', 'admin2020' ),\n\t\t 'add_new_item' => __( 'Add New Admin Page', 'admin2020' ),\n\t\t 'new_item' => __( 'New Admin Page', 'admin2020' ),\n\t\t 'edit_item' => __( 'Edit Admin Page', 'admin2020' ),\n\t\t 'view_item' => __( 'View Admin Page', 'admin2020' ),\n\t\t 'all_items' => __( 'All Admin Pages', 'admin2020' ),\n\t\t 'search_items' => __( 'Search Admin Pages', 'admin2020' ),\n\t\t 'not_found' => __( 'No Admin Pages found.', 'admin2020' ),\n\t\t 'not_found_in_trash' => __( 'No Admin Pages found in Trash.', 'admin2020' )\n\t\t);\n\t\t $args = array(\n\t\t 'labels' => $labels,\n\t\t 'description' => __( 'Description.', 'Add New Admin Page' ),\n\t\t 'public' => false,\n\t\t 'publicly_queryable' => false,\n\t\t 'show_ui' => true,\n\t\t 'show_in_menu' => true,\n\t\t 'query_var' => false,\n\t\t 'has_archive' => false,\n\t\t 'hierarchical' => false,\n\t\t 'supports' \t\t => array('editor','title'),\n\t\t 'show_in_rest' \t => true,\n\t\t 'rewrite' => [ 'slug' => 'admin-page' ],\n\t\t);\n\t\tregister_post_type( 'admin2020adminpage', $args );\n\t}",
"public static function create_admin_page() {\n\n\t\t// Delete option as we are using theme_mods instead\n\t\tdelete_option( 'wpex_portfolio_editor' ); ?>\n\n\t\t<div class=\"wrap\">\n\t\t\t<h2><?php esc_html_e( 'Post Type Editor', 'total' ); ?></h2>\n\t\t\t<form method=\"post\" action=\"options.php\">\n\t\t\t\t<?php settings_fields( 'wpex_portfolio_options' ); ?>\n\t\t\t\t<table class=\"form-table\">\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\"><?php esc_html_e( 'Main Page', 'total' ); ?></th>\n\t\t\t\t\t\t<td><?php\n\t\t\t\t\t\t// Display dropdown of pages to select from\n\t\t\t\t\t\twp_dropdown_pages( array(\n\t\t\t\t\t\t\t'echo' => true,\n\t\t\t\t\t\t\t'selected' => wpex_get_mod( 'portfolio_page' ),\n\t\t\t\t\t\t\t'name' => 'wpex_portfolio_editor[portfolio_page]',\n\t\t\t\t\t\t\t'show_option_none' => esc_html__( 'None', 'total' ),\n\t\t\t\t\t\t\t'exclude' => get_option( 'page_for_posts' ),\n\t\t\t\t\t\t) ); ?><p class=\"description\"><?php esc_html_e( 'Used for breadcrumbs.', 'total' ); ?></p></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\"><?php esc_html_e( 'Admin Icon', 'total' ); ?></th>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t// Mod\n\t\t\t\t\t\t\t$mod = wpex_get_mod( 'portfolio_admin_icon', null );\n\t\t\t\t\t\t\t$mod = 'portfolio' == $mod ? '' : $mod;\n\t\t\t\t\t\t\t// Dashicons list\n\t\t\t\t\t\t\t$dashicons = wpex_get_dashicons_array(); ?>\n\t\t\t\t\t\t\t<div id=\"wpex-dashicon-select\" class=\"wpex-clr\">\n\t\t\t\t\t\t\t\t<?php foreach ( $dashicons as $key => $val ) :\n\t\t\t\t\t\t\t\t\t$value = 'portfolio' == $key ? '' : $key;\n\t\t\t\t\t\t\t\t\t$class = $mod == $value ? 'button-primary' : 'button-secondary'; ?>\n\t\t\t\t\t\t\t\t\t<a href=\"#\" data-value=\"<?php echo esc_attr( $value ); ?>\" class=\"<?php echo esc_attr( $class ); ?>\" title=\"<?php echo esc_attr( $key ); ?>\"><span class=\"dashicons dashicons-<?php echo $key; ?>\"></span></a>\n\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"wpex_portfolio_editor[portfolio_admin_icon]\" id=\"wpex-dashicon-select-input\" value=\"<?php echo esc_attr( $mod ); ?>\"></td>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\"><?php esc_html_e( 'Enable Custom Sidebar', 'total' ); ?></th>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t// Get checkbox value\n\t\t\t\t\t\t$mod = wpex_get_mod( 'portfolio_custom_sidebar', 'on' );\n\t\t\t\t\t\t$mod = ( $mod && 'off' != $mod ) ? 'on' : 'off'; // sanitize ?>\n\t\t\t\t\t\t<td><input type=\"checkbox\" name=\"wpex_portfolio_editor[portfolio_custom_sidebar]\" value=\"<?php echo esc_attr( $mod ); ?>\" <?php checked( $mod, 'on' ); ?> /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\"><?php esc_html_e( 'Include In Search', 'total' ); ?></th>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t// Get checkbox value\n\t\t\t\t\t\t$mod = wpex_get_mod( 'portfolio_search', 'on' );\n\t\t\t\t\t\t$mod = ( $mod && 'off' != $mod ) ? 'on' : 'off'; // sanitize ?>\n\t\t\t\t\t\t<td><input type=\"checkbox\" name=\"wpex_portfolio_editor[portfolio_search]\" value=\"<?php echo esc_attr( $mod ); ?>\" <?php checked( $mod, 'on' ); ?> /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\"><?php esc_html_e( 'Post Type: Name', 'total' ); ?></th>\n\t\t\t\t\t\t<td><input type=\"text\" name=\"wpex_portfolio_editor[portfolio_labels]\" value=\"<?php echo wpex_get_mod( 'portfolio_labels' ); ?>\" /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\"><?php esc_html_e( 'Post Type: Singular Name', 'total' ); ?></th>\n\t\t\t\t\t\t<td><input type=\"text\" name=\"wpex_portfolio_editor[portfolio_singular_name]\" value=\"<?php echo wpex_get_mod( 'portfolio_singular_name' ); ?>\" /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\"><?php esc_html_e( 'Post Type: Slug', 'total' ); ?></th>\n\t\t\t\t\t\t<td><input type=\"text\" name=\"wpex_portfolio_editor[portfolio_slug]\" value=\"<?php echo wpex_get_mod( 'portfolio_slug' ); ?>\" /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr valign=\"top\" id=\"wpex-tags-enable\">\n\t\t\t\t\t\t<th scope=\"row\"><?php esc_html_e( 'Enable Tags', 'total' ); ?></th>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t// Get checkbox value\n\t\t\t\t\t\t$mod = wpex_get_mod( 'portfolio_tags', true );\n\t\t\t\t\t\t$mod = wpex_is_mod_enabled( $mod ) ? 'on' : 'off'; // sanitize ?>\n\t\t\t\t\t\t<td><input type=\"checkbox\" name=\"wpex_portfolio_editor[portfolio_tags]\" value=\"<?php echo esc_attr( $mod ); ?>\" <?php checked( $mod, 'on' ); ?> /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr valign=\"top\" id=\"wpex-tags-label\">\n\t\t\t\t\t\t<th scope=\"row\"><?php esc_html_e( 'Tags: Label', 'total' ); ?></th>\n\t\t\t\t\t\t<td><input type=\"text\" name=\"wpex_portfolio_editor[portfolio_tag_labels]\" value=\"<?php echo wpex_get_mod( 'portfolio_tag_labels' ); ?>\" /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr valign=\"top\" id=\"wpex-tags-slug\">\n\t\t\t\t\t\t<th scope=\"row\"><?php esc_html_e( 'Tags: Slug', 'total' ); ?></th>\n\t\t\t\t\t\t<td><input type=\"text\" name=\"wpex_portfolio_editor[portfolio_tag_slug]\" value=\"<?php echo wpex_get_mod( 'portfolio_tag_slug' ); ?>\" /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr valign=\"top\" id=\"wpex-categories-enable\">\n\t\t\t\t\t\t<th scope=\"row\"><?php esc_html_e( 'Enable Categories', 'total' ); ?></th>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t// Get checkbox value\n\t\t\t\t\t\t$mod = wpex_get_mod( 'portfolio_categories', true );\n\t\t\t\t\t\t$mod = wpex_is_mod_enabled( $mod ) ? 'on' : 'off'; // sanitize ?>\n\t\t\t\t\t\t<td><input type=\"checkbox\" name=\"wpex_portfolio_editor[portfolio_categories]\" value=\"<?php echo esc_attr( $mod ); ?>\" <?php checked( $mod, 'on' ); ?> /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr valign=\"top\" id=\"wpex-categories-label\">\n\t\t\t\t\t\t<th scope=\"row\"><?php esc_html_e( 'Categories: Label', 'total' ); ?></th>\n\t\t\t\t\t\t<td><input type=\"text\" name=\"wpex_portfolio_editor[portfolio_cat_labels]\" value=\"<?php echo wpex_get_mod( 'portfolio_cat_labels' ); ?>\" /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr valign=\"top\" id=\"wpex-categories-slug\">\n\t\t\t\t\t\t<th scope=\"row\"><?php esc_html_e( 'Categories: Slug', 'total' ); ?></th>\n\t\t\t\t\t\t<td><input type=\"text\" name=\"wpex_portfolio_editor[portfolio_cat_slug]\" value=\"<?php echo wpex_get_mod( 'portfolio_cat_slug' ); ?>\" /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t\t<?php submit_button(); ?>\n\t\t\t</form>\n\t\t\t<script>\n\t\t\t\t( function( $ ) {\n\t\t\t\t\t\"use strict\";\n\t\t\t\t\t$( document ).ready( function() {\n\t\t\t\t\t\t// Dashicons\n\t\t\t\t\t\tvar $buttons = $( '#wpex-dashicon-select a' ),\n\t\t\t\t\t\t\t$input = $( '#wpex-dashicon-select-input' );\n\t\t\t\t\t\t$buttons.click( function() {\n\t\t\t\t\t\t\tvar $activeButton = $( '#wpex-dashicon-select a.button-primary' );\n\t\t\t\t\t\t\t$activeButton.removeClass( 'button-primary' ).addClass( 'button-secondary' );\n\t\t\t\t\t\t\t$( this ).addClass( 'button-primary' );\n\t\t\t\t\t\t\t$input.val( $( this ).data( 'value' ) );\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t} );\n\t\t\t\t\t\t// Categories enable/disable\n\t\t\t\t\t\tvar $catsEnable = $( '#wpex-categories-enable input' ),\n\t\t\t\t\t\t\t$CatsTrToHide = $( '#wpex-categories-label, #wpex-categories-slug' );\n\t\t\t\t\t\tif ( 'off' == $catsEnable.val() ) {\n\t\t\t\t\t\t\t$CatsTrToHide.hide();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$( $catsEnable ).change(function () {\n\t\t\t\t\t\t\tif ( $( this ).is( \":checked\" ) ) {\n\t\t\t\t\t\t\t\t$CatsTrToHide.show();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$CatsTrToHide.hide();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t\t// Tags enable/disable\n\t\t\t\t\t\tvar $tagsEnable = $( '#wpex-tags-enable input' ),\n\t\t\t\t\t\t\t$tagsTrToHide = $( '#wpex-tags-label, #wpex-tags-slug' );\n\t\t\t\t\t\tif ( 'off' == $tagsEnable.val() ) {\n\t\t\t\t\t\t\t$tagsTrToHide.hide();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$( $tagsEnable ).change(function () {\n\t\t\t\t\t\t\tif ( $( this ).is( \":checked\" ) ) {\n\t\t\t\t\t\t\t\t$tagsTrToHide.show();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$tagsTrToHide.hide();\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} ) ( jQuery );\n\t\t\t</script>\n\t\t</div>\n\t<?php }",
"function custom_admin_footer() {}",
"public function do_custom_post_types_html() {\n\n\t\tif ( ! $this->valid_custom_post_types_are_present() ) {\n\t\t\treturn;\n\t\t}\n\n\t\techo '<fieldset>';\n\t\techo '<legend>' . esc_html__( 'You can enable the Post Settings for custom post types too. Use the checkboxes below to do so.', 'add-meta-tags' ) . '</legend>';\n\t\techo '<ul>';\n\n\t\t$registered_post_types = $this->get_registered_post_types();\n\t\t$supported_post_types = $this->get_supported_post_types( true );\n\t\tforeach ( $registered_post_types as $post_type ) {\n\t\t\t$checkbox_value = self::validate_checkbox( $supported_post_types, $post_type->name );\n\t\t\techo '<li><input type=\"checkbox\" id=\"post_type_' . esc_attr( $post_type->name ) . '\" name=\"' . esc_attr( $this->options_key ) . '[custom_post_types][' . esc_attr( $post_type->name ) . ']\" value=\"1\" ' . checked( '1', $checkbox_value, false ) . ' />'\n\t\t\t\t. '<label for=\"post_type_' . esc_attr( $post_type->name ) . '\">' . esc_html__( 'Apply Post Settings to ', 'add-meta-tags' ) . esc_attr( $post_type->labels->name ) . ' (<code>' . esc_attr( $post_type->name ) . '</code>)</label></li>';\n\t\t}\n\n\t\techo '</ul>';\n\t\techo '</fieldset>';\n\t}",
"function dashboard_ui( $post_type ) {\n\n\t\t}",
"function custom_post_type() {\n $labels = array(\n 'name' => _x( 'Examples', 'post type general name', 'your-plugin-textdomain' ),\n 'singular_name' => _x( 'Example', 'post type singular name', 'your-plugin-textdomain' ),\n 'menu_name' => _x( 'Examples', 'admin menu', 'your-plugin-textdomain' ),\n 'name_admin_bar' => _x( 'Example', 'add new on admin bar', 'your-plugin-textdomain' ),\n 'add_new' => _x( 'Add New', 'book', 'your-plugin-textdomain' ),\n 'add_new_item' => __( 'Add New Example', 'your-plugin-textdomain' ),\n 'new_item' => __( 'New Example', 'your-plugin-textdomain' ),\n 'edit_item' => __( 'Edit Example', 'your-plugin-textdomain' ),\n 'view_item' => __( 'View Example', 'your-plugin-textdomain' ),\n 'all_items' => __( 'All Examples', 'your-plugin-textdomain' ),\n 'search_items' => __( 'Search Examples', 'your-plugin-textdomain' ),\n 'parent_item_colon' => __( 'Parent Examples:', 'your-plugin-textdomain' ),\n 'not_found' => __( 'No examples found.', 'your-plugin-textdomain' ),\n 'not_found_in_trash' => __( 'No examples found in Trash.', 'your-plugin-textdomain' )\n );\n\n $args = array(\n 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'examples' ),\n 'capability_type' => 'post',\n 'has_archive' => true,\n 'hierarchical' => false,\n 'menu_position' => null,\n 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' )\n );\n\n register_post_type( 'example', $args );\n}",
"public function add_post_type_support() {\n\t\tadd_post_type_support( 'page', 'wsuwp-show-and-hide' );\n\t}",
"function hgr_post_type() {\n\t\t\tregister_post_type( 'hgr_megafooter',\n\t\t\t\tarray(\n\t\t\t\t\t'labels' => array(\n\t\t\t\t\t\t'name' => esc_html__( 'Mega Footers', 'hgrmegafooter' ),\n\t\t\t\t\t\t'singular_name' => esc_html__( 'MegaFooter', 'hgrmegafooter' ),\n\t\t\t\t\t\t'menu_name' => esc_html__( 'MegaFooters', 'hgrmegafooter' ),\n\t\t\t\t\t\t'name_admin_bar' => esc_html__( 'MegaFooters', 'hgrmegafooter' ),\n\t\t\t\t\t\t'add_new' => esc_html__( 'Add New', 'info bar', 'hgrmegafooter' ),\n\t\t\t\t\t\t'add_new_item' => esc_html__( 'Add New MegaFooter', 'hgrmegafooter' ),\n\t\t\t\t\t\t'new_item' => esc_html__( 'New MegaFooter', 'hgrmegafooter' ),\n\t\t\t\t\t\t'edit_item' => esc_html__( 'Edit MegaFooter', 'hgrmegafooter' ),\n\t\t\t\t\t\t'view_item' => esc_html__( 'View MegaFooter', 'hgrmegafooter' ),\n\t\t\t\t\t\t'all_items' => esc_html__( 'All MegaFooters', 'hgrmegafooter' ),\n\t\t\t\t\t\t'search_items' => esc_html__( 'Search MegaFooters', 'hgrmegafooter' ),\n\t\t\t\t\t\t'not_found' => esc_html__( 'No MegaFooter found.', 'hgrmegafooter' ),\n\t\t\t\t\t\t'not_found_in_trash' => esc_html__( 'No MegaFooter found in Trash.', 'hgrmegafooter' ),\n\t\t\t\t\t),\n\t\t\t\t'public'\t\t\t=>\ttrue,\n\t\t\t\t'menu_icon'\t\t=>\t'dashicons-editor-kitchensink',\n\t\t\t\t'has_archive'\t=>\ttrue,\n\t\t\t\t'rewrite'\t\t=>\tarray('slug' => 'mega_footer'),\n\t\t\t\t'supports'\t\t=>\tarray('title','editor')\n\t\t\t\t)\n\t\t\t);\n\t\t}",
"function custom_post_example() { \n\t// creating (registering) the custom type \n\tregister_post_type( 'custom_type', /* (http://codex.wordpress.org/Function_Reference/register_post_type) */\n\t \t// let's now add all the options for this post type\n\t\tarray('labels' => array(\n\t\t\t'name' => __('Bloggdesigner', 'bloggdesigner'), /* This is the Title of the Group */\n\t\t\t'singular_name' => __('Bloggdesign', 'bloggdesign'), /* This is the individual type */\n\t\t\t'add_new' => __('Lägg till ny', 'custom post type item'), /* The add new menu item */\n\t\t\t'add_new_item' => __('Lägg till ny bloggdesign'), /* Add New Display Title */\n\t\t\t'edit' => __( 'Redigera' ), /* Edit Dialog */\n\t\t\t'edit_item' => __('Redigera bloggdesign'), /* Edit Display Title */\n\t\t\t'new_item' => __('Ny bloggdesign'), /* New Display Title */\n\t\t\t'view_item' => __('Visa bloggdesign'), /* View Display Title */\n\t\t\t'search_items' => __('Sök bloggdesign'), /* Search Custom Type Title */ \n\t\t\t'not_found' => __('Inget hittades i databasen'), /* This displays if there are no entries yet */ \n\t\t\t'not_found_in_trash' => __('Inget hittades i papperskorgen'), /* This displays if there is nothing in the trash */\n\t\t\t'parent_item_colon' => ''\n\t\t\t), /* end of arrays */\n\t\t\t'description' => __( 'Gratis bloggdesigner till Gratis bloggdesigner-sidan.' ), /* Custom Type Description */\n\t\t\t'public' => true,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'exclude_from_search' => false,\n\t\t\t'show_ui' => true,\n\t\t\t'query_var' => true,\n\t\t\t'menu_position' => 8, /* this is what order you want it to appear in on the left hand side menu */ \n\t\t\t'menu_icon' => get_stylesheet_directory_uri() . '/library/images/custom-post-icon.png', /* the icon for the custom post type menu */\n\t\t\t'rewrite' => true,\n\t\t\t'capability_type' => 'post',\n\t\t\t'hierarchical' => false,\n\t\t\t/* the next one is important, it tells what's enabled in the post editor */\n\t\t\t'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'sticky')\n\t \t) /* end of options */\n\t); /* end of register post type */\n\t\n\t/* this ads your post categories to your custom post type */\n\tregister_taxonomy_for_object_type('category', 'custom_type');\n\t/* this ads your post tags to your custom post type */\n\tregister_taxonomy_for_object_type('post_tag', 'custom_type');\n\t\n}",
"function adminMenuHook() {\t\t\n\t\tadd_meta_box('geotag', 'Geo Tag', array('GeoTag', 'displayEditPostForm'), 'post', 'normal', 'high');\n\t\tadd_meta_box('geotag', 'Geo Tag', array('GeoTag', 'displayEditPostForm'), 'page', 'normal', 'high');\n\t\t\n\t\tadd_options_page('GeoTag Settings', 'GeoTag', 'manage_options', 'geo-tag-menu', array('GeoTag', 'adminMenuOptions'));\n\t}",
"public function custom_admin() {\n add_theme_page('Customize', 'Customizer', 'edit_theme_options', 'customize.php');\n }",
"public function render_admin_page() {\r\n\t\r\n\t\tinclude_once LITEBOX_PATH . '/views/litebox.admin.layout.php';\r\n\t\tinclude_once LITEBOX_PATH . '/views/help.php';\r\n\t\tinclude_once LITEBOX_PATH . '/views/shortcode.php';\r\n\t\t\r\n\t}",
"function configure_custom_post_types() {\n //Use this to configure each Custom Post Type\n /*\n NEVER use these words as post-type names/slugs, they are reserved in Wordpress:\n post\n page\n attachment\n revision\n nav_menu_item\n custom_css\n customize_changeset\n action\n author\n order\n theme\n */\n\n //\"type\", \"singular_label\", and \"plural_label\" are required\n //\"type\" is either \"post\" or \"page\"\n //\"icon\" is the name of dashicons icon, or 'get_template_directory_uri() . \"/images/cutom-posttype-icon-name.png\"' for custom icon\n //Dashicons can be found here: https://developer.wordpress.org/resource/dashicons/#admin-post\n\n /*$sample_cpt = array(\n 'type' => 'post',\n 'singular_label' => '',\n 'plural_label' => '',\n 'slug' => '',\n 'position' => 10,\n 'icon' => '',\n 'queryable' => true,\n 'taxonomies' => array()\n );*/\n\n //Each Custom Post Type will need its own uniquely-named settings array\n //Include each Custom Post Type settings array here\n $settings = array();\n create_custom_post_types( $settings );\n}",
"function islamic_center_add_page_builder_meta(){\n\t\t\t\tglobal $post; \n\t\t\t\tif(!empty($post)){\n\t\t\t\t\tif( in_array($post->post_type, $this->settings['post_type']) ){\n\t\t\t\t\t\t$this->islamic_center_load_admin_scripts();\n\t\t\t\t\t\t\n\t\t\t\t\t\tforeach( $this->settings['post_type'] as $post_type ){\n\t\t\t\t\t\t\tadd_meta_box(\n\t\t\t\t\t\t\t\t$this->settings['meta_slug'],\n\t\t\t\t\t\t\t\t$this->settings['meta_title'],\n\t\t\t\t\t\t\t\tarray(&$this, 'create_page_builder_elements'),\n\t\t\t\t\t\t\t\t$post_type,\n\t\t\t\t\t\t\t\t$this->settings['position'],\n\t\t\t\t\t\t\t\t$this->settings['priority']\n\t\t\t\t\t\t\t);\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}",
"public function register_admin_page()\n {\n }",
"function wpcf_module_inline_table_post_types() {\n if ( defined( 'MODMAN_PLUGIN_NAME' ) && isset( $_GET['wpcf-post-type'] ) ) {\n $_custom_types = get_option( WPCF_OPTION_NAME_CUSTOM_TYPES, array() );\n if ( isset( $_custom_types[$_GET['wpcf-post-type']] ) ) {\n $_post_type = $_custom_types[$_GET['wpcf-post-type']];\n // add module manager meta box to post type form\n $element = array('id' => '12' . _TYPES_MODULE_MANAGER_KEY_ . '21' . $_post_type['slug'], 'title' => $_post_type['labels']['singular_name'], 'section' => _TYPES_MODULE_MANAGER_KEY_);\n do_action( 'wpmodules_inline_element_gui', $element );\n }\n }\n}",
"private function define_admin_hooks() {\n\n\t\t$admin = new Single_Post_Meta_Manager_Admin( $this->get_version() );\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $admin, 'enqueue_styles' );\n\t\t$this->loader->add_action( 'add_meta_boxes', $admin, 'add_meta_box' );\n\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Index QA Manager Category Page | public function index(){
$data = new \stdClass;
$data->page_title = __('label.qamanager.category_index');
$data->user_role = auth()->user()->user_role->name;
return view( 'backend.qamanager.category.index', (array) $data );
} | [
"public function category()\n {\n echo \"<h1>PAGE CATEGORY DU CONTROLLEUR</h1>\";\n }",
"function category() {\n\t\tif ( !$this->aranax_auth->is_logged_in() || !$this->aranax_auth->has_access() ) {\n\t\t\tredirect(\"unauthorised\");\n\t\t}\n\t\telse {\n\t\t\t$data[\"role_options\"] =\t$this->aranax_auth->get_user_roles_option();\n\t\t\t$data[\"categories\"] = $this->testmodel->listTestCategory();\n\t\t}\n\t\t$data[\"page_title\"]\t= \"All Test Categories\";\n\t\t$this->load->view(\"common/header\", $data);\n\t\t$this->load->view(\"master/testcategory\", $data);\n\t}",
"public function showCategory(){\n\n \n }",
"public function categoriesAction()\n {\n $this->_initProduct();\n $this->loadLayout();\n $this->renderLayout();\n }",
"public function action_category() {\n\t\tKohana::$log->add(Kohana::DEBUG,\n\t\t\t'Executing Controller_Blog::action_category');\n\t\t$this->template->content = View::factory('blog/front/list')\n\t\t\t->bind('legend', $legend)\n\t\t\t->bind('articles', $articles)\n\t\t\t->bind('pagination', $pagination);\n\n\t\t$category = $this->request->param('name');\n\t\t$search = Sprig::factory('blog_search');\n\t\t$articles = $search->search_by_category($category);\n\t\t$pagination = $search->pagination;\n\t\t$legend = __(':name Articles', array(':name'=>ucfirst($category)));\n\t}",
"public function smartAction()\n { \t\n //setup the available categories\n \t$categories = new Categories();\n \t$this->view->categories = $categories->getAll();\n }",
"public function indexAction(){\n $categories = $this->CategoriesModel->getTopCategories();\n\t\t $i = 1;\n\t\t foreach ($categories as $category) {\n\t\t \t$category->number = $i;\n\t\t \t$i++;\n\t\t }\n $this->view->categories = $categories;\n $this->view->render('categories/index'); \n\t}",
"public function amenityCategoriesExecute()\n {\n \treturn view('admin.master.amenity_categories_list');\n }",
"public function display_category()\n {}",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $faqCategories = $em->getRepository('BrooterAdminBundle:FaqCategory')->findAll();\n\n return $this->render('faqcategory/index.html.twig', array(\n 'faqCategories' => $faqCategories,\n ));\n }",
"public function listCategory(){\n\t\t\t$category = $this->modelListCategory();\n\t\t\t//goi view\n\t\t\t$this->renderHTML(\"views/frontend/menuCategoryView.php\",array(\"category\"=>$category));\n\t\t}",
"public function indexAction()\n {\n $categoryId = (int)$this->_getParam('categoryId');\n\n if(!$categoryId) {\n\n $this->redirect('/');\n }\n\n $this->loadModel('category');\n\n $category = $this->modelCategory->findById($categoryId);\n\n if(!$category) {\n\n $this->redirect('/');\n }\n\n $this->view->category = $category;\n\n $this->view->headTitle()->prepend($category['name']);\n\n $this->view->products = $this->modelCategory->getProductsByCategoryId($categoryId);\n\n $categories = $this->modelCategory->getAll();\n\n $this->view->categories = $categories;\n\n $this->view->render('placeholder/header.phtml');\n\n }",
"public function getCategoryAction();",
"public function getFaqCategories()\n\n {\n $this->checkPermission(4);\n\n // model Data\n $FaqCategories = $this->faqCategories->getAllFaqCategories();\n\n\n $pageTitle = \"All FAQ Categories\";\n\n // view\n\n include (WEBINTY_VIEWS.'/admin/header.html');\n include (WEBINTY_VIEWS.'/admin/menu.html');\n include (WEBINTY_VIEWS.'/admin/nav.html');\n include (WEBINTY_VIEWS.'/admin/faqsCategories.html');\n include (WEBINTY_VIEWS.'/admin/footer.html');\n\n }",
"public function getCategoryIndex()\n {\n return view('admin.pages.page_categories', [\n 'categories' => SitePageCategory::orderBy('sort', 'DESC')->get()\n ]);\n }",
"public function index()\n {\n return view('SchoolAdmin::subject-category');\n }",
"public function indexAction()\n {\n $categories = $this->repository('Accountant\\Entity\\Category')->findAll();\n\n return $this->render('category.index.html.twig', array('categories' => $categories));\n }",
"public function actionIndex()\n {\n $searchModel = new QuestionsCategoriesSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function index(){\n $agendaItemCategories= $this->_AgendaItemCategoryRepository->all(array(\"id\",\"name\"));\n return view('beheer.agendaItemCategory.index', compact('agendaItemCategories'));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test the readHtml method with a Model. | public function testModelReadHtml()
{
require_once __DIR__ . '/../auxiliary/TestModel.php';
$model = new \TestModel;
$actual = $this->controller->readHtml($model);
$this->assertInstanceOf('\Backend\Base\Utilities\Renderable', $actual);
$this->assertEquals('TestModel/display', $actual->getTemplate());
$this->assertContains($model, $actual->getValues());
} | [
"public function testFormHtml()\n {\n require_once __DIR__ . '/../auxiliary/TestModel.php';\n\n $model = new \\TestModel;\n $actual = $this->controller->formHtml($model);\n $this->assertInstanceOf('\\Backend\\Base\\Utilities\\Renderable', $actual);\n $this->assertEquals('TestModel/form', $actual->getTemplate());\n $this->assertContains($model, $actual->getValues());\n }",
"public function testListHtml()\n {\n $result = array();\n $actual = $this->controller->listHtml($result);\n $this->assertInstanceOf('\\Backend\\Base\\Utilities\\Renderable', $actual);\n $this->assertEquals('Model/list', $actual->getTemplate());\n $this->assertContains($result, $actual->getValues());\n }",
"public function testLoadHTML()\n {\n self::assertInstanceOf('DOMDocument', Parser::load(self::getSimple()));\n }",
"public function testGet()\n {\n $html_content = @file_get_html(__DIR__ . \"/../cache/sainsburys-apricot-ripe---ready-320g.html\");\n $title = new \\Model\\Title($html_content);\n $this->assertEquals(\"Sainsbury's Apricot Ripe & Ready x5\", $title->get());\n }",
"public function testRetrieveHTMLDocument() {\n $data = $this->entity->body->html;\n $uuid = $this->embeddedEntity->uuid();\n $expected = <<<XML\n<ck-section class=\"page\" itemtype=\"page\">\n <ck-container class=\"page__container\" itemprop=\"sections\">\n <ck-section class=\"image\" itemtype=\"image\">\n <ck-media class=\"image__media\" data-media-type=\"entity_test:entity_test\" data-media-uuid=\"{$uuid}\" itemprop=\"content\" itemtype=\"media\"/>\n <div class=\"image__caption\" itemprop=\"caption\">image caption</div>\n </ck-section>\n <ck-section class=\"text\" itemtype=\"text\">\n <h2 itemprop=\"headline\">this is the headline</h2>\n <div class=\"text__content\" itemprop=\"content\">this is some content</div>\n </ck-section>\n </ck-container>\n</ck-section>\nXML;\n\n $this->assertXmlStringEqualsXmlString($expected, $data);\n }",
"public function loadHTML();",
"public function test_getHtml_called__correct()\n {\n $name = 'dummy name';\n $content = 'dummy content';\n $expected = '<meta name=\"'.$name.'\" content=\"'.$content.'\">';\n $actual = $this->configureSut($name, $content)->getHtml();\n $this->assertEquals($expected, $actual);\n }",
"public function testGetHtmlWithAttributes()\n {\n $textField = new TextField('foo', 'bar');\n\n self::assertSame('<input type=\"text\" name=\"foo\" value=\"bar\" required id=\"baz\" readonly>', $textField->getHtml(['id' => 'baz', 'readonly' => true]));\n }",
"public function get_title_html_returns_article_id_1_html()\n {\n $this->assertEquals((new Article)->get_title_html(), Article::where('id', 1)->first()->html);\n }",
"public function testGetHtmlWithAttributes()\n {\n $emailField = new EmailField('foo', EmailAddress::parse('foo@bar.example.com'));\n\n self::assertSame('<input type=\"email\" name=\"foo\" value=\"foo@bar.example.com\" required id=\"baz\" readonly>', $emailField->getHtml(['id' => 'baz', 'readonly' => true]));\n }",
"public function testHtmlToSafeHtml(): void\n {\n $testData = $this->getHtmlMarkupTestData();\n /** @var LoggerInterface $logger */\n $logger = $this->createMock(LoggerInterface::class);\n $sut = new WikiParserProvider($logger);\n\n foreach ($testData as $entry) {\n $output = $sut->htmlToSafeHtml($entry['input']);\n self::assertSame($entry['safeHtml'], $output);\n }\n }",
"public function testRunHtmlResultReader()\n {\n $json = json_encode([\n 'url' => 'https://example.com/',\n 'name' => 'HTML Linter',\n 'checking' => [\n [\n 'type' => 'Error',\n 'desc' => 'Test description.',\n 'line' => 1\n ],\n ]\n ]);\n $jobFaker = factory(JobInspect::class)->create([\n 'command_line' => 'nodejs --url http://example.com --destination /public/files/example/1/url-1/',\n 'scope_id' => Scope::where('id', 3)->first()->id\n ]);\n\n $decoder = Mockery::mock(JsonDecoder::class . '[decodeFile]');\n $issue = Mockery::mock(Issue::class . '[newInstance, save]');\n $reader = new ResultReader($decoder, $issue);\n\n $decoder->shouldReceive('decodeFile')->andReturn(json_decode($json));\n $issue->shouldReceive('newInstance')->once()->andReturn($issue);\n $issue->shouldReceive('save')->once()->andReturn(true);\n\n $reader->setJob($jobFaker);\n\n $this->assertFalse($reader->htmlResultReader('example.json'));\n }",
"public function testGetHtmlWithAttributes()\n {\n $fileField = new FileField('foo');\n\n self::assertSame('<input type=\"file\" name=\"foo\" required id=\"bar\" class=\"baz\">', $fileField->getHtml(['id' => 'bar', 'class' => 'baz']));\n }",
"abstract public function makeHtml();",
"public function getHtmlSource();",
"public function testSafeHtmlToNormalHtml(): void\n {\n $testData = $this->getHtmlMarkupTestData();\n /** @var LoggerInterface $logger */\n $logger = $this->createMock(LoggerInterface::class);\n $sut = new WikiParserProvider($logger);\n\n foreach ($testData as $entry) {\n $output = $sut->safeHtmlToNormalHtml($entry['safeHtml']);\n self::assertSame($entry['normalHtml'], $output);\n }\n }",
"public function assertHtml()\n {\n return new Html($this->stream, $this);\n }",
"public function load($html);",
"function html($question)\n{\n return $question->html;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation ezsigntemplateformfieldgroupGetObjectV2AsyncWithHttpInfo Retrieve an existing Ezsigntemplateformfieldgroup | public function ezsigntemplateformfieldgroupGetObjectV2AsyncWithHttpInfo($pkiEzsigntemplateformfieldgroupID, string $contentType = self::contentTypes['ezsigntemplateformfieldgroupGetObjectV2'][0])
{
$returnType = '\eZmaxAPI\Model\EzsigntemplateformfieldgroupGetObjectV2Response';
$request = $this->ezsigntemplateformfieldgroupGetObjectV2Request($pkiEzsigntemplateformfieldgroupID, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
if ($returnType === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
} else {
$content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}
);
} | [
"public function ezsigntemplateformfieldgroupCreateObjectV1AsyncWithHttpInfo($ezsigntemplateformfieldgroupCreateObjectV1Request, string $contentType = self::contentTypes['ezsigntemplateformfieldgroupCreateObjectV1'][0])\n {\n $returnType = '\\eZmaxAPI\\Model\\EzsigntemplateformfieldgroupCreateObjectV1Response';\n $request = $this->ezsigntemplateformfieldgroupCreateObjectV1Request($ezsigntemplateformfieldgroupCreateObjectV1Request, $contentType);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function ezsigntemplateformfieldgroupDeleteObjectV1Request($pkiEzsigntemplateformfieldgroupID, string $contentType = self::contentTypes['ezsigntemplateformfieldgroupDeleteObjectV1'][0])\n {\n\n // verify the required parameter 'pkiEzsigntemplateformfieldgroupID' is set\n if ($pkiEzsigntemplateformfieldgroupID === null || (is_array($pkiEzsigntemplateformfieldgroupID) && count($pkiEzsigntemplateformfieldgroupID) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pkiEzsigntemplateformfieldgroupID when calling ezsigntemplateformfieldgroupDeleteObjectV1'\n );\n }\n if ($pkiEzsigntemplateformfieldgroupID < 0) {\n throw new \\InvalidArgumentException('invalid value for \"$pkiEzsigntemplateformfieldgroupID\" when calling ObjectEzsigntemplateformfieldgroupApi.ezsigntemplateformfieldgroupDeleteObjectV1, must be bigger than or equal to 0.');\n }\n \n\n $resourcePath = '/1/object/ezsigntemplateformfieldgroup/{pkiEzsigntemplateformfieldgroupID}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pkiEzsigntemplateformfieldgroupID !== null) {\n $resourcePath = str_replace(\n '{' . 'pkiEzsigntemplateformfieldgroupID' . '}',\n ObjectSerializer::toPathValue($pkiEzsigntemplateformfieldgroupID),\n $resourcePath\n );\n }\n\n\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', ],\n $contentType,\n $multipart\n );\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHost = $this->config->getHost();\n $query = ObjectSerializer::buildQuery($queryParams);\n\n if ($apiKey !== null) {\n $secret = $this->config->getSecret();\n if ($secret !== '') {\n //Let's sign the request\n $headers = array_merge($headers, RequestSignature::getHeadersV1($apiKey, $secret, 'DELETE', $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''), $httpBody));\n }\t\t\n }\n\n return new Request(\n 'DELETE',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function groupsGetObjectScimV2AsyncWithHttpInfo($groupId, string $contentType = self::contentTypes['groupsGetObjectScimV2'][0])\n {\n $returnType = '\\eZmaxAPI\\Model\\ScimGroup';\n $request = $this->groupsGetObjectScimV2Request($groupId, $contentType);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function usergroupGetObjectV2AsyncWithHttpInfo($pkiUsergroupID, string $contentType = self::contentTypes['usergroupGetObjectV2'][0])\n {\n $returnType = '\\eZmaxAPI\\Model\\UsergroupGetObjectV2Response';\n $request = $this->usergroupGetObjectV2Request($pkiUsergroupID, $contentType);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function getGroupAsyncWithHttpInfo($group_oid)\n {\n $returnType = '';\n $request = $this->getGroupRequest($group_oid);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function ezsigntemplatedocumentEditEzsigntemplateformfieldgroupsV1AsyncWithHttpInfo($pkiEzsigntemplatedocumentID, $ezsigntemplatedocumentEditEzsigntemplateformfieldgroupsV1Request, string $contentType = self::contentTypes['ezsigntemplatedocumentEditEzsigntemplateformfieldgroupsV1'][0])\n {\n $returnType = '\\eZmaxAPI\\Model\\EzsigntemplatedocumentEditEzsigntemplateformfieldgroupsV1Response';\n $request = $this->ezsigntemplatedocumentEditEzsigntemplateformfieldgroupsV1Request($pkiEzsigntemplatedocumentID, $ezsigntemplatedocumentEditEzsigntemplateformfieldgroupsV1Request, $contentType);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function groupCreateAsyncWithHttpInfo($group_create_request)\n {\n $returnType = '';\n $request = $this->groupCreateRequest($group_create_request);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function createGroupAsyncWithHttpInfo($create_group_request = null)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Group';\n $request = $this->createGroupRequest($create_group_request);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getGroupAsyncWithHttpInfo($group_id)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Group';\n $request = $this->getGroupRequest($group_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function groupsCreateObjectScimV2WithHttpInfo($scimGroup, string $contentType = self::contentTypes['groupsCreateObjectScimV2'][0])\n {\n $request = $this->groupsCreateObjectScimV2Request($scimGroup, $contentType);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n switch($statusCode) {\n case 201:\n if ('\\eZmaxAPI\\Model\\ScimGroup' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\eZmaxAPI\\Model\\ScimGroup' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\eZmaxAPI\\Model\\ScimGroup', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\eZmaxAPI\\Model\\ScimGroup';\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 201:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\eZmaxAPI\\Model\\ScimGroup',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function imGroupAsyncWithHttpInfo($group_id)\n {\n $returnType = '\\Zoom\\Api\\Model\\ImGroup200Response';\n $request = $this->imGroupRequest($group_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function ezsigntemplateformfieldgroupCreateObjectV1WithHttpInfo($ezsigntemplateformfieldgroupCreateObjectV1Request, string $contentType = self::contentTypes['ezsigntemplateformfieldgroupCreateObjectV1'][0])\n {\n $request = $this->ezsigntemplateformfieldgroupCreateObjectV1Request($ezsigntemplateformfieldgroupCreateObjectV1Request, $contentType);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n switch($statusCode) {\n case 201:\n if ('\\eZmaxAPI\\Model\\EzsigntemplateformfieldgroupCreateObjectV1Response' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\eZmaxAPI\\Model\\EzsigntemplateformfieldgroupCreateObjectV1Response' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\eZmaxAPI\\Model\\EzsigntemplateformfieldgroupCreateObjectV1Response', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\eZmaxAPI\\Model\\EzsigntemplateformfieldgroupCreateObjectV1Response';\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 201:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\eZmaxAPI\\Model\\EzsigntemplateformfieldgroupCreateObjectV1Response',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function usergroupGetObjectV2Request($pkiUsergroupID, string $contentType = self::contentTypes['usergroupGetObjectV2'][0])\n {\n\n // verify the required parameter 'pkiUsergroupID' is set\n if ($pkiUsergroupID === null || (is_array($pkiUsergroupID) && count($pkiUsergroupID) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pkiUsergroupID when calling usergroupGetObjectV2'\n );\n }\n if ($pkiUsergroupID > 255) {\n throw new \\InvalidArgumentException('invalid value for \"$pkiUsergroupID\" when calling ObjectUsergroupApi.usergroupGetObjectV2, must be smaller than or equal to 255.');\n }\n if ($pkiUsergroupID < 0) {\n throw new \\InvalidArgumentException('invalid value for \"$pkiUsergroupID\" when calling ObjectUsergroupApi.usergroupGetObjectV2, must be bigger than or equal to 0.');\n }\n \n\n $resourcePath = '/2/object/usergroup/{pkiUsergroupID}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pkiUsergroupID !== null) {\n $resourcePath = str_replace(\n '{' . 'pkiUsergroupID' . '}',\n ObjectSerializer::toPathValue($pkiUsergroupID),\n $resourcePath\n );\n }\n\n\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', ],\n $contentType,\n $multipart\n );\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHost = $this->config->getHost();\n $query = ObjectSerializer::buildQuery($queryParams);\n\n if ($apiKey !== null) {\n $secret = $this->config->getSecret();\n if ($secret !== '') {\n //Let's sign the request\n $headers = array_merge($headers, RequestSignature::getHeadersV1($apiKey, $secret, 'GET', $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''), $httpBody));\n }\t\t\n }\n\n return new Request(\n 'GET',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createGroupAsyncWithHttpInfo($group = null)\n {\n $returnType = '';\n $request = $this->createGroupRequest($group);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getScimV2GroupsAsyncWithHttpInfo($filter, $startIndex = '1', $count = '25')\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\ScimGroupListResponse';\n $request = $this->getScimV2GroupsRequest($filter, $startIndex, $count);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function ezsigntemplatepackagesignerGetObjectV2Async($pkiEzsigntemplatepackagesignerID, string $contentType = self::contentTypes['ezsigntemplatepackagesignerGetObjectV2'][0])\n {\n return $this->ezsigntemplatepackagesignerGetObjectV2AsyncWithHttpInfo($pkiEzsigntemplatepackagesignerID, $contentType)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function editDocumentDocxGetFormFieldsAsyncWithHttpInfo($input_file)\n {\n $returnType = '\\Swagger\\Client\\Model\\GetDocxGetFormFieldsResponse';\n $request = $this->editDocumentDocxGetFormFieldsRequest($input_file);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updatePackingDetailCustomFieldsAsyncWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->updatePackingDetailCustomFieldsRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getVoicemailGroupMailboxAsyncWithHttpInfo($groupId)\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\VoicemailMailboxInfo';\n $request = $this->getVoicemailGroupMailboxRequest($groupId);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the id_file property | public function setIdFile($id_file)
{
$this->id_file = $id_file;
return $this;
} | [
"public function setIdentifier(){\n\n \t$this->fileIdentifier = $this->getIdentifier();\n }",
"protected function setFileID($id) {\n $this->fileid = $id;\n $this->prepare_isValidModID();\n }",
"public function setFileId( $file_id ) {\n\t\t$this->file_id = $file_id;\n\t\t$this->cache_key = $this->entity->getEntityType() . \"s_\" . $this->entity->getId() . \"_\" . $this->lang . \"_\" . $this->file_id . \".css\";\n\t}",
"public function setFileID($value)\n {\n return $this->set('FileID', $value);\n }",
"protected function setFileID($id)\n {\n # Set the Validator instance to a variable.\n $validator = Validator::getInstance();\n\n # Check if the passed $id is empty.\n if (!empty($id)) {\n # Check if the passed $id is an integer.\n if ($validator->isInt($id) === true) {\n # Set the data member explicitly making it an integer.\n $this->file_id = (int)$id;\n } else {\n throw new Exception('The passed file id was not an integer!', E_RECOVERABLE_ERROR);\n }\n } else {\n # Explicitly set the data member to NULL.\n $this->file_id = null;\n }\n }",
"public function setFileId(string $fileId)\n\t{\n\t\t$this->fileId=$fileId; \n\t\t$this->keyModified['file_Id'] = 1; \n\n\t}",
"public function setId($value) { $this->_id = $value; }",
"public function getIdFile() \n\t{\n\t\treturn $this->idFile;\n\t}",
"final function setFile_type_id($value) {\n\t\treturn $this->setFileTypeId($value);\n\t}",
"public function setId($value) { $this->id = $value;}",
"public function getFileId();",
"function set_id($id){\n $this->id->value = $id;\n }",
"protected function setImageId()\n {\n $this->imageId = sha1($this->imageData);\n }",
"public function setFil($id)\r\n\t{\r\n\t\t$this->fil = htmlentities($id);\r\n\t}",
"function set_file_user_by_Id($file_user_id)\n {\n $parameter_array = array();\n \n array_push($parameter_array, array(\n 'and',\n 'id',\n '=',\n $file_user_id\n ));\n \n $output = $this->result('i', $parameter_array);\n $row = mysqli_fetch_assoc($output);\n \n $this->id = $row['id'];\n $this->file_id = $row['file_id'];\n $this->user_type_id = $row['user_type_id'];\n $this->user_id = $row['user_id'];\n }",
"function eZVirtualfile( $id=\"\" )\r\n {\r\n if ( $id != \"\" )\r\n {\r\n $this->ID = $id;\r\n $this->get( $this->ID );\r\n }\r\n }",
"public function getFileId() {\n return $this->__id;\n }",
"public function setFile($file);",
"function setID($id) {\r\n $this->id = $id;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get ransack options depends on this PDO driver. | public function ransackOptions() : array; | [
"function queryOptions()\n\t{\n\t\t$options = new SapphoQueryOptions($this);\n\t\treturn $options;\n\t}",
"private static function getOption()\n {\n return [\n \\PDO::ATTR_ERRMODE => \\PDO::ERRMODE_EXCEPTION,\n \\PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES '\".self::$default_charset.\"'\",\n \\PDO::ATTR_TIMEOUT => self::$timeout,\n ];\n }",
"protected function getQueryHelperOptions()\n {\n return Input::only('filter','query','top','orderby','orderdir');\n }",
"protected function defaultOptions() {\n return [\n 'fetch' => \\PDO::FETCH_OBJ,\n 'allow_delimiter_in_query' => FALSE,\n 'allow_square_brackets' => FALSE,\n 'pdo' => [],\n ];\n }",
"protected function getOptions()\n\t{\n\t\t// Initialize variables.\n\t\t// This gets the connectors available in the platform and supported by the server.\n\t\t$available = App::get('db')->getConnectors();\n\t\t$available = array_map('strtolower', $available);\n\n\t\t// This gets the list of database types supported by the application.\n\t\t// This should be entered in the form definition as a comma separated list.\n\t\t// If no supported databases are listed, it is assumed all available databases\n\t\t// are supported.\n\t\t$supported = $this->element['supported'];\n\t\tif (!empty($supported))\n\t\t{\n\t\t\t$supported = explode(',', $supported);\n\t\t\tforeach ($supported as $support)\n\t\t\t{\n\t\t\t\tif (in_array($support, $available))\n\t\t\t\t{\n\t\t\t\t\t$options[$support] = ucfirst($support);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tforeach ($available as $support)\n\t\t\t{\n\t\t\t\t$options[$support] = ucfirst($support);\n\t\t\t}\n\t\t}\n\n\t\t// This will come into play if an application is installed that requires\n\t\t// a database that is not available on the server.\n\t\tif (empty($options))\n\t\t{\n\t\t\t$options[''] = App::get('language')->txt('JNONE');\n\t\t}\n\t\treturn $options;\n\t}",
"protected function getConnectionOptions() {\n\t\treturn isset($this->_meta) ? $this->_meta : array();\n\t}",
"function countryOptions(){\n\t\t$db_conf = array(\n\t\t\t'username'=>'webs',\n\t\t\t'password'=>'myDB4All',\n\t\t\t'database'=>'bankdata',\t\t\t\n\t\t);\n\t\t$this->dp->connect($db_conf);\n\t\n\t\t$query = \"SELECT * FROM `countrycodes` ORDER BY `country`\";\n\t\t$opt = $this->dp->getOptions($query, 'country', 'countrycode');\n\t\t$this->dp->close();\n\t\treturn $opt;\n\t}",
"public function getAdapterOptions()\n\t{\n\t\treturn $this->adapterOptions;\n\t}",
"public function getOptions()\n {\n return array(\n\n // name of the model to use for storage mapping to database\n // @var string\n // @required\n \"modelName\" => null,\n\n // the pase prefix for the id ex) Call for CallID\n // @var string\n \"idBaseName\" => null,\n\n // database table name to store the models in\n // @var string\n \"modelTableName\" => null,\n\n // database table name to store the meta data for the model\n // @var string\n \"metaModelTableName\" => null,\n\n // string database name to set as the default for all queries\n // @var string\n \"database\" => null,\n\n // pass in an existing MysqlConnection\n // @var MysqlConnection\n \"connection\" => null,\n\n // collection name used for results sets that return a collection\n // @var string\n \"collectionName\" => null,\n\n // instance factory for creating models should required\n // @var GenericInstanceFactory\n // @required\n \"modelFactory\" => null,\n\n \"username\" => null,\n \"password\" => null,\n \"host\" => null,\n \"configPath\" => null,\n \"group\" => null,\n\n // instance factory for creating collections\n // @var GenericInstanceFactory\n // @required\n \"collectionFactory\" => null,\n\n // Factory used to find the correct adapter\n \"adapterFactory\" => null\n );\n }",
"public function findOptions()\n {\n return ArrayUtils::iteratorToArray( $this->findAll() );\n }",
"protected function getScanOptions()\n {\n $options = [];\n\n if (strlen(strval($this->match)) > 0) {\n $options['MATCH'] = $this->match;\n }\n\n if ($this->count > 0) {\n $options['COUNT'] = $this->count;\n }\n\n return $options;\n }",
"protected function defaultOptions() {\r\n return array(\r\n 'fetch' => PDO::FETCH_OBJ,\r\n 'return' => self::RETURN_STATEMENT,\r\n 'throw_exception' => TRUE,\r\n );\r\n }",
"public function getConnectionOptions()\n {\n return $this->_options;\n }",
"public function getOptions()\n {\n return $this->adapter->getOptions();\n }",
"public function getDriverOptions(): array\n {\n return $this->driverOptions;\n }",
"public function get_option_search() {\n\t\treturn self::get_option( true, self::OPTION_SEARCH, [] );\n\t}",
"public function get_option_search() {\n\t\treturn self::get_option( self::OPTION_SEARCH, array() );\n\t}",
"public function getDriverOptions() {\n\t\treturn $this->driverOptions;\n\t}",
"public function getOptions()\n {\n return $this->table->getOptions();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a list of members associated to a specific job | public function getJobMembers($iJobID)
{
$oReq = new GetJobMembers();
$oReq->authKey = $this->authKey;
$oReq->jobId = $iJobID;
$oResponse = new GetJobMembersResponse();
try {
$oResponse = $this->oSOAP->getJobMembers($oReq);
} catch (SoapFault $e) {
throw isset($e->detail) ? $this->_convertSoapFault($e) : $e;
}
return $oResponse->apiJobMemberList->apiJobMemberList;
} | [
"public function getMembers()\n {\n $members = [];\n $results = $this->chatworkApi->getRoomMembersById($this->room_id);\n foreach ($results as $result) {\n $members[] = new ChatworkUser($result);\n }\n\n $this->listMembers = $members;\n\n return $members;\n }",
"public function getJobList();",
"public function getMembers()\n {\n return $this->findMembersBy([], ['id' => 'asc']);\n }",
"public function getMembers() {\n return $this -> db -> getGroupMembers($this -> id);\n }",
"public function users_with_job($job)\n\t{\n\t\t$ids = [];\n\n\t\t$db_result = $this->db->select('id', FALSE)\n\t\t\t->where('status', 1)\n\t\t\t->where('job', $job)\n\t\t\t->get('users');\n\n\t\tforeach ($db_result->result() as $user) $ids[] = $user->id;\n\n\t\treturn $ids;\n\t}",
"public function getMembers();",
"public function getMembers() {\n if(empty($this->members) || empty($this->members[0])) {\n $this->fetchMembers();\n }\n\n return $this->members;\n }",
"public function listMembers($search_params = [])\n {\n $client = Utils\\CloudClient::getClient();\n $res = $client->getList($this->url . \"/member\", $search_params);\n return new Utils\\CloudList(\n $res,\n \"\\WeeblyCloud\\Member\",\n array(\"user_id\"=>$this->user_id, \"site_id\"=>$this->site_id)\n );\n }",
"public function getAllMembers()\n\t{\n\t\treturn $this->api->getClanByTag($this->tag)->memberList;\n\t}",
"public function getAllMembers();",
"public function listJobs(): array;",
"public function members($room) {\n //TODO: DEMO CODE\n return array_map( array($this, '_member'), range(1, 10) );\n }",
"public function getStaffMembers();",
"function getMemberList()\n\t{\n\t}",
"public function getMembers()\n {\n return $this->members;\n }",
"public function do_member_search()\n\t{\n\t\tif ( ! class_exists('Member_memberlist'))\n\t\t{\n\t\t\trequire PATH_ADDONS.'member/mod.member_memberlist.php';\n\t\t}\n\n\t\t$MM = new Member_memberlist();\n\n\t\tforeach(get_object_vars($this) as $key => $value)\n\t\t{\n\t\t\t$MM->{$key} = $value;\n\t\t}\n\n\t\treturn $MM->do_member_search();\n\t}",
"function members($room) {\n $members = array();\n foreach (range(1, 10) as $id) {\n $members[] = array(\n 'id' => 'uid' . $id,\n 'uid' => 'uid' . $id,\n 'nick' => 'user'.$id\n ); \n }\n return $members;\n }",
"public static function getAllMembers()\n {\n\n $members = [];\n\n $object = self::getObject();\n\n // loop through every \"server\"?\n foreach($object->guilds as $guild){\n\n // loop through every member\n foreach($guild->members as $member){\n\n // make new member object\n $new_member = new Member($member);\n $members[] = $new_member;\n\n }\n }\n\n return $members;\n\n }",
"function get_search_members($search_id)\n {\n $data = $this->make_request('searches/'.$search_id.'/members', 'GET');\n return $data;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets a webhook for the specified MailChimp list | private function set_webhook( $list_id ) {
error_log('MCE4M_Widget::set_webhook() Called.');
// the webhook url
$url = get_site_url() . '/?_mce4m_webhook_secret=' . $this->webhook_secret;
// check to see if webhook is already set
$webhooks = $this->api->get_list_webhooks( $list_id );
foreach ( $webhooks as $hook ) {
if ( $hook->url === $url ) {
return true;
}
}
// if webhook not found, create it
$success = $this->api->set_list_webhook( $list_id, $url, array(
'subscribe' => true,
'unsubscribe' => false,
'profile' => false,
'cleaned' => false,
'upemail' => false,
'campaign' => false
) );
return $success;
} | [
"public function webhook() \n\t {\n\t \t// If webhooks is enabled and that a valid key is set.\n\t \tif ($this->config->get('mailchimp_webhooks') && $this->config->get('mailchimp_webhooks_key')) {\n\t \t\tif (isset($_GET['key']) && $_GET['key'] == $this->config->get('mailchimp_webhooks_key')) {\n\t \t\t\t$this->load->model('module/mailchimp');\n\n\t \t\t\t$inbound_data = array(\n\t\t \t\t\t'type' \t=> $_POST['type'],\n\t\t \t\t\t'email'\t=> filter_var($_POST['data']['email'], FILTER_VALIDATE_EMAIL)\n\t\t \t\t);\n\n\t \t\t\tswitch ($inbound_data['type']) {\n\t \t\t\t\tcase 'subscribe':\n\t \t\t\t\t\t$this->model_module_mailchimp->set_newsletter($inbound_data['email'], TRUE);\n\t \t\t\t\t\tbreak;\n\t \t\t\t\tcase 'unsubscribe':\n\t \t\t\t\t\t$this->model_module_mailchimp->set_newsletter($inbound_data['email'], FALSE);\n\t \t\t\t\t\tbreak;\n\t \t\t\t\tcase 'cleaned':\n\t \t\t\t\t\t$this->model_module_mailchimp->set_newsletter($inbound_data['email'], FALSE);\n\t \t\t\t\t\tbreak;\n\t \t\t\t\tdefault:\n\t \t\t\t\t\tbreak;\n\t \t\t\t}\n\t \t\t}\n\t \t}\n\t }",
"public function createWebhook($list_id, array $data = [])\n {\n return self::execute(\"POST\", \"lists/{$list_id}/webhooks\", $data);\n }",
"public function set_webhooks() {\n\n\t\t$this->generate_secret();\n\t\t$this->create_remote_webhooks();\n\t}",
"public function webhook()\n\t\t{\n\t\t}",
"private function setWebhook(){\n\t\t$phpInput = file_get_contents( 'php://input' );\n\t\t$this->webhook = json_decode( $phpInput , true );\n\t\t$this->webhook[ 'phpInput' ] = $phpInput;\n\t\t\t\t\n\t\t// Set Is Exist Commit Flg .\n\t\t$this->bootCondition[ 'existCommit' ] = ( isset( $this->webhook[ 'commits' ] ) && count( $this->webhook[ 'commits' ] ) > 0 )? true : false ;\n\t}",
"private function setWebHook()\n {\n $url = $this->tokens[0];\n $token = $this->tokens[1];\n $client = new Client();\n\n try {\n $response = $client->get(\n 'https://api.telegram.org/bot' . $token . '/setWebHook?url='.$url\n );\n } catch (ClientException $ex) {\n $this->setAnswer('wrong token or url');\n return;\n }\n\n $content = ($response->getBody()->getContents());\n $content = json_decode($content);\n $this->setAnswer($content->description\n ? $content->description\n : 'there is no web hook set');\n return;\n }",
"public function webhook() {\n \n\t\t\n \n\t \t}",
"public function registerWebhook(array $data): Webhook;",
"public function setWebhook($url);",
"protected function setWebhooks()\n {\n $webhooks = $this->config->get('flow.webhooks');\n\n // If the config sets to use Defaults Webhooks, we will just do exactly that.\n // Doing this allows the developer to use defaults routes to his app without\n // having to worry to overwrite them later by its own set custom routes.\n if ($this->config->get('flow.webhooks-defaults')) {\n /** @var \\Illuminate\\Contracts\\Routing\\UrlGenerator $url */\n $url = $this->app->make(UrlGenerator::class);\n\n $webhooks = array_merge([\n 'payment.urlConfirmation' => $url->to(Helper::WEBHOOK_PATH . '/payment'),\n 'refund.urlCallBack' => $url->to(Helper::WEBHOOK_PATH . '/refund'),\n 'plan.urlCallback' => $url->to(Helper::WEBHOOK_PATH . '/plan'),\n ], $webhooks);\n }\n\n $this->flow->setWebhookUrls(array_filter($webhooks));\n\n // Additionally, we will set the Webhook Secret if needed.\n if ($secret = $this->config->get('flow.webhook-secret')) {\n $this->flow->setWebhookSecret($secret);\n }\n }",
"public function webhook() {\n\n\n\n }",
"function create_webhook($webhook) {\n return $this->post_request($this->_lists_base_route.'webhooks.json', $webhook); \n }",
"public function ironikus_add_webhook_trigger(){\n check_ajax_referer( md5( $this->page_name ), 'ironikus_nonce' );\n\n $webhook_url = isset( $_REQUEST['webhook_url'] ) ? sanitize_text_field( $_REQUEST['webhook_url'] ) : '';\n $webhook_current_url = isset( $_REQUEST['current_url'] ) ? sanitize_text_field( $_REQUEST['current_url'] ) : '';\n $webhook_group = isset( $_REQUEST['webhook_group'] ) ? sanitize_text_field( $_REQUEST['webhook_group'] ) : '';\n $webhook_callback = isset( $_REQUEST['webhook_callback'] ) ? sanitize_text_field( $_REQUEST['webhook_callback'] ) : '';\n\t\t$webhooks = WPWHPRO()->webhook->get_hooks( 'trigger', $webhook_group );\n\t\t$response = array( 'success' => false );\n\t\t$url_parts = parse_url( $webhook_current_url );\n\t\tparse_str($url_parts['query'], $query_params);\n\t\t$clean_url = strtok( $webhook_current_url, '?' );\n\t\t$new_webhook = strtotime( date( 'Y-n-d H:i:s' ) ) . 999 . rand( 10, 9999 );\n\n if( ! isset( $webhooks[ $new_webhook ] ) ){\n WPWHPRO()->webhook->create( $new_webhook, 'trigger', array( 'group' => $webhook_group, 'webhook_url' => $webhook_url ) );\n\n\t $response['success'] = true;\n\t $response['webhook'] = $new_webhook;\n\t $response['webhook_group'] = $webhook_group;\n\t $response['webhook_url'] = $webhook_url;\n\t $response['webhook_callback'] = $webhook_callback;\n\t $response['delete_url'] = WPWHPRO()->helpers->built_url( $clean_url, array_merge( $query_params, array( 'wpwhpro_delete' => $new_webhook, ) ) );\n }\n\n\n echo json_encode( $response );\n\t\tdie();\n\t}",
"function update_webhook()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\t\n\t\tif(!empty($data['u'])) $response = $this->_webhook->update($data['u'], 'http://pro-dw-crn1.clout.com/');\n\t\t\n\t\t# record the result of the webhook update\n\t\tif(empty($respose['result'])) $response['result'] = 'FAIL';\n\t\tlog_message('debug', 'Plaid_webhook/update_webhook:: [1] '.$response['result']);\n\t}",
"public function testWebhooksList()\n {\n }",
"public function testSetWebhooksDeletesOldWebhooks() {\n $list = ['id' => 'a1234', 'name' => 'mocknewsletters'];\n $list_o = NewsletterList::fromData([\n 'identifier' => $list['id'],\n 'title' => $list['name'],\n 'source' => 'MailChimp-testname',\n 'data' => (object) ($list + ['merge_vars' => []]),\n ]);\n list($api, $provider) = $this->mockChimp(['post', 'delete', 'getPaged']);\n\n $api->expects($this->once())->method('getPaged')->with(\n $this->equalTo('/lists/a1234/webhooks')\n )->will($this->returnValue([\n ['url' => $GLOBALS['base_url'] . '/old-webhook', 'id' => 'oldhook'],\n ]));\n $api->expects($this->once())->method('post');\n $api->expects($this->once())->method('delete')->with(\n $this->equalTo('/lists/a1234/webhooks/oldhook')\n );\n\n $provider->setWebhooks([$list_o]);\n }",
"public function processWebhook(array $data);",
"function SetFeedmessageList(&$list)\n\t{\n\t\t$this->_feedmessageList = array();\n\t\t$existingFeedmessageList = $this->GetFeedmessageList();\n\t\tforeach ($existingFeedmessageList as $feedmessage)\n\t\t{\n\t\t\t$feedmessage->eventId = '';\n\t\t\t$feedmessage->Save(false);\n\t\t}\n\t\t$this->_feedmessageList = $list;\n\t}",
"public function webhook()\n {\n $this->init();\n //Check if webhook was set\n if ($this->isConsoleMode()) {\n (new Application('telebot', '1.0.0'))\n ->register('webhook')\n ->setDescription('Configure webhook of bot')\n ->addArgument('url', InputArgument::REQUIRED, 'Webhook url')\n ->setCode(function (InputInterface $input, OutputInterface $output) {\n // output arguments and options\n $url = $input->getArgument('url');\n $reply = $this->setWebhook($url);\n $output->writeln(\"<info>Webhook:</info> <comment>$url</comment> <info>was set</info> <comment>\"\n . json_encode($reply, JSON_PRETTY_PRINT) . \"</comment>\");\n })\n ->getApplication()\n ->run();\n } else {\n //Process webhook contents\n $this->processWebhook();\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
\param $sIdPev Identifiant de la partie d'Evaluation \param $oBD Objet de connexion PDO_BD | function __construct($sIdPev,$oBD){
include $this->sRessourcesFile;
$this->sSql=$aSql[$oBD->sgbd]['prof_descr'];
$this->sSql=str_replace('$sIdPev', $sIdPev, $this->sSql);
$oPDOresult=$oBD->execute($this->sSql);
if ( $oBD->enErreur()) {
$this->sStatus=1;
$this->sMessage=$oBD->getBDMessage();
}
else{
$this->aFields=$oBD->ligneSuivante ($oPDOresult);
$this->sStatus=0;
}
} | [
"public function GetPorId($pId)\r\n {\r\n \t$this->Consultar(\"SELECT * FROM evaluacion WHERE id = $pId;\", false);\r\n }",
"public function consultaPAIActual(){\n\t\t$conect= Yii::app()->db;\n\t\t$sqlConsPai=\"select * from pai where num_doc=:num_doc and pai_actual='true'\";\n\t\t$consPai=$conect->createCommand($sqlConsPai);\n\t\t$consPai->bindParam(\":num_doc\",$this->num_doc,PDO::PARAM_STR);\n\t\t$readConsPai=$consPai->query();\n\t\t$resConsPai=$readConsPai->read();\n\t\t$readConsPai->close();\n\t\t$this->id_pai=$resConsPai[\"id_pai\"];\n\t\treturn $resConsPai;\n\t}",
"function partiePresente($sonId)\r\n {\r\n $out = false;\r\n $tab = array();\r\n $sql = $GLOBALS[\"db\"]->query('SELECT * FROM j_partie ');\r\n $i=0;\r\n while($donnees = mysql_fetch_array($sql)){\r\n $tab[$i]=$donnees['id'];\r\n $i++;\r\n }\r\n foreach ( $tab as $val)\r\n {\r\n if ( $val == $sonId)\r\n $out = true;\r\n }\r\n return $out;\r\n }",
"public static function actualizarProyeccion($fec,$hor,$dis,$idS,$idP,$tip,$id) {\r\n try{\r\n $conexion = connectDB::connectBD();\r\n $actualizar = \"UPDATE `Proyeccion` SET `Fecha` = '$fec', `Hora` = '$hor', `Disponibles` = '$dis', `IdSala` = '$idS', `IdPelicula` = '$idP', `TipoEntrada` = '$tip' WHERE `Proyeccion`.`IdProyeccion` = '$id';\";\r\n $conexion->exec($actualizar);\r\n }catch(PDOException $error){\r\n echo $error->getMessage();\r\n }\r\n }",
"function findPourDefinitionPartie($definitionPartieId) {\n \n $queryTxt = 'SELECT * FROM DefinitionPartie_Pion\r\n WHERE DefinitionPartieId = :id';\r\n $query = self::$db->prepare($queryTxt);\r\n $query->bindValue(':id', $definitionPartieId);\n \r\n $query->setFetchMode(PDO::FETCH_ASSOC);\n $query->execute();\n $listeItems = array();\n // $query contient les id des pions a creer\n foreach($query as $row) {\n $unItem = $this->find(array($row['PionId']));\n if ($unItem <> null) {\n $listeItems[] = $unItem;\n }\n }\n return $listeItems;\n }",
"function findPourPartie($partieId) {\n \n $queryTxt = 'SELECT * FROM JoueurPartie\r\n WHERE partieencoursid = :partieId';\r\n $query = self::$db->prepare($queryTxt);\r\n $query->bindValue(':partieId', $partieId);\r\n return $this->findAll($query);\n }",
"public function GetPorId($pId)\r\n {\r\n \t$this->Consultar(\"SELECT * FROM evento WHERE id = $pId;\", false);\r\n }",
"function &updateCertification($id_line,$name,$valor,$desc){\n global $db;\n\n $sql = \"update lnp_line_parameters set lnp_value='$valor' where lnp_name='$name' and lnp_id_line='$id_line' and lnp_description='$desc'\";\n \n if(DEBUG==TRUE){ Basic::EventLog(\"updateCertification--->>: \".$sql);}\n $res =& $db->query($sql);\n }",
"function llenar_plan_seguimiento ($id_prueba, $id_beneficiaria, $id_seccion, $prerequisito, $logro) {\n\t$conexion_bd = conectar_bd();\n\n\t$dml = 'UPDATE valorar_seccion SET prerequisito_objetivo=(?), logro_dificultad=(?) WHERE id_prueba=(?) and\n\tid_beneficiaria=(?) and id_seccion=(?) ';\n\n\t\tif ( !($statement = $conexion_bd->prepare($dml)) ) {\n\t\t\t\tdie(\"Error: (\" . $conexion_bd->errno . \") \" . $conexion_bd->error);\n\t\t\t\treturn 0;\n\t\t}\n\n\t\t//Unir los parámetros de la función con los parámetros de la consulta\n\t\t//El primer argumento de bind_param es el formato de cada parámetro\n\t\tif (!$statement->bind_param(\"ssiii\", $prerequisito, $logro, $id_prueba, $id_beneficiaria, $id_seccion)) {\n\t\t\tdie(\"Error en vinculación: (\" . $statement->errno . \") \" . $statement->error);\n\t\t\treturn 0;\n\t\t}\n\n\t\t//Executar la consulta\n\t\tif (!$statement->execute()) {\n\t\t\tdie(\"Error en ejecución: (\" . $statement->errno . \") \" . $statement->error);\n\t\t\treturn 0;\n\t\t}\n\n\t\tdesconectar_bd($conexion_bd);\n\t\treturn 1;\n\t}",
"public function posiblesBDU($id_nom_orbix)\n {\n $oPersonaDl = new PersonaDl($id_nom_orbix);\n $oPersonaDl = new PersonaDl($id_nom_orbix);\n $oPersonaDl->DBCarregar();\n\n $apellido1 = $oPersonaDl->getApellido1();\n\n $Query = \"SELECT * FROM dbo.q_dl_Estudios_b\n WHERE Identif LIKE '$this->id_tipo%' AND ApeNom LIKE '%\" . $apellido1 . \"%'\n AND (pertenece_r='$this->region' OR compartida_con_r='$this->region') \";\n // todos los de listas\n $oGesListas = new GestorPersonaListas();\n $cPersonasListas = $oGesListas->getPersonaListasQuery($Query);\n $i = 0;\n $a_lista_bdu = [];\n foreach ($cPersonasListas as $oPersonaListas) {\n $id_nom_listas = $oPersonaListas->getIdentif();\n $oGesMatch = new GestorIdMatchPersona();\n $cIdMatch = $oGesMatch->getIdMatchPersonas(array('id_listas' => $id_nom_listas));\n if (!empty($cIdMatch[0]) and count($cIdMatch) > 0) {\n continue;\n }\n $id_nom_listas = $oPersonaListas->getIdentif();\n $ape_nom = $oPersonaListas->getApeNom();\n $nombre = $oPersonaListas->getNombre();\n $apellido1 = $oPersonaListas->getApellido1();\n $nx1 = $oPersonaListas->getNx1();\n $apellido1_sinprep = $oPersonaListas->getApellido1_sinprep();\n $nx2 = $oPersonaListas->getNx2();\n $apellido2 = $oPersonaListas->getApellido2();\n $apellido2_sinprep = $oPersonaListas->getApellido2_sinprep();\n $f_nacimiento = $oPersonaListas->getFecha_Naci();\n $dl_persona = $oPersonaListas->getDl();\n $lugar_nacimiento = $oPersonaListas->getLugar_Naci();\n $f_nacimiento = empty($f_nacimiento) ? '??' : $f_nacimiento;\n $pertenece_r = $oPersonaListas->getPertenece_r();\n $compartida_con_r = $oPersonaListas->getCompartida_con_r();\n $a_lista_bdu[$i] = [\n 'id_nom' => $id_nom_listas,\n 'ape_nom' => $ape_nom,\n 'nombre' => $nombre,\n 'dl_persona' => $dl_persona,\n 'apellido1' => $apellido1,\n 'apellido2' => $apellido2,\n 'f_nacimiento' => $f_nacimiento,\n 'pertenece_r' => $pertenece_r,\n 'compartida_con_r' => $compartida_con_r,\n ];\n $i++;\n }\n return $a_lista_bdu;\n }",
"function getIdActual($pCodCC) {\n parent::ConnectionOpen(\"pnsSeleccionaDatosCentroCostos\", \"dbweb\");\n parent::SetParameterSP(\"pOpc\", '4');\n parent::SetParameterSP(\"pCod\", $pCodCC);\n parent::SetParameterSP(\"pId\", '');\n parent::SetSelect(\"*\");\n $resultadoArray = parent::executeSPArrayX();\n parent::ConnectionClose();\n return $resultadoArray;\n }",
"function getIscrizioniStudente($db, $id_p, $id_sc) { // ATTENZIONE: POSSIBILE RIDONDANZA\n $qID_Iscrizione = \"SELECT ID_Iscrizione FROM Iscrizioni WHERE ID_SessioneCorso IN (\";\n for($i = 0, $l = sizeof($id_sc)-1; $i < $l; $i++) $qID_Iscrizione .= $id_sc[$i] . \", \";\n $qID_Iscrizione .= $id_sc[sizeof($id_sc)-1] . \") AND ID_Studente=\" . $id_p;\n\n $rID_Iscrizione = $db->queryDB($qID_Iscrizione);\n\n if(!$rID_Iscrizione) return \"errore_iscrizioni_sessioni\";\n\n for($i = 0, $l = sizeof($rID_Iscrizione); $i < $l; $i++) $id_isc[$i] = $rID_Iscrizione[$i][\"ID_Iscrizione\"];\n\n return $id_isc;\n}",
"function ColsultarTodosLosID(){///funciona\n try {\n $FKAREA=$this->objRequerimiento->getFKAREA();\n $objControlConexion = new ControlConexion();\n $objControlConexion->abrirBd();\n //$comandoSql = \"select * from Requerimiento where FKAREA = '\".$FKAREA.\"' \";\n $comandoSql = \"SELECT IDREQ ,TITULO,FKEMPLE,FKAREA,FKESTADO,OBSERVACION,FKEMPLEASIGNADO FROM Requerimiento INNER JOIN detallereq ON Requerimiento.IDREQ=detallereq.FKREQ where FKAREA = '\".$FKAREA.\"'\";\n $rs = $objControlConexion->ejecutarSelect($comandoSql);\n return $rs;\n $objControlConexion->cerrarBd();\n } catch(Exception $e) {\n echo \"Error: \" . $e->getMessage();\n }\n}",
"function verificarAprobAp($IdAp){\n\t\t$result = 0;\n\t\t//datos de la AP\n\t\t$sqlText = \"SELECT ID_APXEMP, ID_TPAP, EMPLOYEE_ID, ID_CENTER, STARTDATE_AP, ENDDATE_AP, HOURS_AP, \".\n\t\t\t\t\"STORAGEDATE_AP, ID_TPDISCIPLINARY, TYPESANCTION_AP, TYPEINCAP_AP, APPROVED_EMP, \".\n \t\t\t\"AUTOR_AP, IFNULL(AUTOR_WORK,0) AUTOR_WORK, APPROVED_WORK, IFNULL(AUTOR_AREA,0) AUTOR_AREA, \" .\n \t\t\t\"APPROVED_AREA,IFNULL(AUTOR_HR,0) AUTOR_HR, APPROVED_HR, IFNULL(AUTOR_GENERALMAN,0) \".\n \t\t\t\"AUTOR_GENERALMAN, APPROVED_GENERAL, COMMENT_AP, STATUS_AP, REJECTED_COMMENTS, APPROVED_STATUS, \".\n\t\t\t\t\"ID_PLACEXDEP_NEW, ID_PLACEXDEP_OLD, SUPERVISOR_NEW, SUPERVISOR_OLD \".\n\t\t\t\t\"FROM apxemp where ID_APXEMP = \".$IdAp;\n\t\t$dbEx = new DBX;\n\t\t$dtAp = $dbEx->selSql($sqlText);\n\t\t//Verificamos si la AP ya ha sido aprobada, sino verificamos\n\t\tif($dtAp['0']['APPROVED_STATUS']=='A'){\n\t\t\t$result = 1;\t\n\t\t}\n\t\telse{\n\t\t//datos del empleado que tiene la AP\n\t\t$sqlText = \"select name_role, ur.id_role, name_depart, nivel_place from employees e inner join plazaxemp pe on e.employee_id=pe.employee_id inner join placexdep pd on pd.id_placexdep=pe.id_placexdep inner join user_roles ur on ur.id_role=pd.id_role inner join depart_exc d on d.id_depart=pd.id_depart inner join places pl on pl.id_place=pd.id_place where e.employee_id=\".$dtAp['0']['EMPLOYEE_ID'];\n\t\t$dtEmp = $dbEx->selSql($sqlText);\n\t\t\n\t\t//datos del creador de la AP\n\t\t$sqlText = \"select name_role, ur.id_role, name_depart, d.id_depart from employees e inner join plazaxemp pe on e.employee_id=pe.employee_id inner join placexdep pd on pd.id_placexdep=pe.id_placexdep inner join user_roles ur on ur.id_role=pd.id_role inner join depart_exc d on pd.id_depart=d.id_depart where e.employee_id=\".$dtAp['0']['AUTOR_AP'];\n\t\t$dtAutor = $dbEx->selSql($sqlText);\n\t\t$departAutor = 0;\n\t\tif($dbEx->numrows>0){\n\t\t\t$departAutor = $dtAutor['0']['name_depart'];\t\n\t\t}\n\t\t\n\t\tif($dtAp['0']['ID_TPAP']!=15){\n\t\t\tif($dtEmp['0']['name_role']=='AGENTE' or $dtEmp['0']['name_role']=='SUPERVISOR'){\n\t\t\t\tif($departAutor!='CHAT'){\n\t\t\t\t\tif($dtAp['0']['ID_TPAP']==1 or $dtAp['0']['ID_TPAP']==2 or $dtAp['0']['ID_TPAP']==7){\n\t\t\t\t\t\t//Verifica si la Ap ya esta aprobada xq es tipo con goce ó sin goce ó incapacidad no necesita la aprobacion de gerencia\n\t\t\t\t\t\tif($dtAp['0']['AUTOR_WORK']!=0 and $dtAp['0']['APPROVED_WORK']=='S' and $dtAp['0']['AUTOR_AREA']!=0 and $dtAp['0']['APPROVED_AREA']=='S' and $dtAp['0']['AUTOR_HR']!=0 and $dtAp['0']['APPROVED_HR']=='S'){\n\t\t\t\t\t\t\t$sqlText = \"update apxemp set approved_status='A' where id_apxemp=\".$IdAp;\n\t\t\t\t\t\t\t$dbEx->updSql($sqlText);\n\t\t\t\t\t\t\t$result = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//AP de agente y supervisores verbales y escritas no necesitan aprobacion de Workforce y gerencia\n\t\t\t\t\telse if($dtAp['0']['TYPESANCTION_AP']==1 or $dtAp['0']['TYPESANCTION_AP']==2){\n\t\t\t\t\t\tif($dtAp['0']['AUTOR_AREA']!=0 and $dtAp['0']['APPROVED_AREA']=='S' and $dtAp['0']['AUTOR_HR']!=0 and $dtAp['0']['APPROVED_HR']=='S'){\n\t\t\t\t\t\t\t$sqlText = \"update apxemp set approved_status='A' where id_apxemp=\".$IdAp;\n\t\t\t\t\t\t\t$dbEx->updSql($sqlText);\n\t\t\t\t\t\t\t$result = 1;\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t\t//Resto de las AP necesita autorizacion por todos\n\t\t\t\t\telse{\n\t\t\t\t\t\tif($dtAp['0']['AUTOR_WORK']!=0 and $dtAp['0']['APPROVED_WORK']=='S' and $dtAp['0']['AUTOR_AREA']!=0 and $dtAp['0']['APPROVED_AREA']=='S' and $dtAp['0']['AUTOR_HR']!=0 and $dtAp['0']['APPROVED_HR']=='S' and $dtAp['0']['AUTOR_GENERALMAN']!=0 and $dtAp['0']['APPROVED_GENERAL']=='S'){\n\t\t\t\t\t\t\t$sqlText = \"update apxemp set approved_status='A' where id_apxemp=\".$IdAp;\n\t\t\t\t\t\t\t$dbEx->updSql($sqlText);\n\t\t\t\t\t\t\t$result = 1;\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Si el creador fue de CHAT solo se autoriza por HR y Gerencia\n\t\t\t\telse{\n\t\t\t\t\tif($dtAp['0']['ID_TPAP']==1 or $dtAp['0']['ID_TPAP']==2 or $dtAp['0']['ID_TPAP']==7 or $dtAp['0']['TYPESANCTION_AP']==1 or $dtAp['0']['TYPESANCTION_AP']==2){\n\t\t\t\t\t\tif($dtAp['0']['AUTOR_HR']!=0 and $dtAp['0']['APPROVED_HR']=='S'){\n\t\t\t\t\t\t\t$sqlText = \"update apxemp set approved_status='A' where id_apxemp=\".$IdAp;\n\t\t\t\t\t\t\t$dbEx->updSql($sqlText);\n\t\t\t\t\t\t\t$result = 1;\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tif($dtAp['0']['AUTOR_HR']!=0 and $dtAp['0']['APPROVED_HR']=='S' and $dtAp['0']['AUTOR_GENERALMAN']!=0 and $dtAp['0']['APPROVED_GENERAL']=='S'){\n\t\t\t\t\t\t\t$sqlText = \"update apxemp set approved_status='A' where id_apxemp=\".$IdAp;\n\t\t\t\t\t\t\t$dbEx->updSql($sqlText);\n\t\t\t\t\t\t\t$result = 1;\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t}//Termina verificacion de agentes y supervisores\n\t\t\tif($dtEmp['0']['id_role']>3 and $dtEmp['0']['id_role']<7){\n\t\t\t\tif($dtAp['0']['ID_TPAP']==1 or $dtAp['0']['ID_TPAP']==2 or $dtAp['0']['ID_TPAP']==7 or $dtAp['0']['TYPESANCTION_AP']==1 or $dtAp['0']['TYPESANCTION_AP']==2){\n\t\t\t\t\tif($dtAp['0']['AUTOR_HR']!=0 and $dtAp['0']['APPROVED_HR']=='S'){\n\t\t\t\t\t\t$sqlText = \"update apxemp set approved_status='A' where id_apxemp=\".$IdAp;\n\t\t\t\t\t\t$dbEx->updSql($sqlText);\n\t\t\t\t\t\t$result = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//aprobacion de HR y gerencia\n\t\t\t\telse{\n\t\t\t\t\tif($dtAp['0']['AUTOR_HR']!=0 and $dtAp['0']['APPROVED_HR']=='S' and $dtAp['0']['AUTOR_GENERALMAN']!=0 and $dtAp['0']['APPROVED_GENERAL']=='S'){\n\t\t\t\t\t\t$sqlText = \"update apxemp set approved_status='A' where id_apxemp=\".$IdAp;\n\t\t\t\t\t\t$dbEx->updSql($sqlText);\n\t\t\t\t\t\t$result = 1;\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Si el empleado es de HR\n\t\t\tif($dtEmp['0']['id_role']==7){\n\t\t\t\tif($dtAp['0']['ID_TPAP']==1 or $dtAp['0']['ID_TPAP']==2 or $dtAp['0']['ID_TPAP']==7 or $dtAp['0']['TYPESANCTION_AP']==1 or $dtAp['0']['TYPESANCTION_AP']==2){\n\t\t\t\t\tif($dtAp['0']['AUTOR_HR']!=0 and $dtAp['0']['APPROVED_HR']=='S'){\n\t\t\t\t\t\t$sqlText = \"update apxemp set approved_status='A' where id_apxemp=\".$IdAp;\n\t\t\t\t\t\t$dbEx->updSql($sqlText);\n\t\t\t\t\t\t$result = 1;\t\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif($dtAp['0']['AUTOR_GENERALMAN']!=0 and $dtAp['0']['APPROVED_GENERAL']=='S'){\n\t\t\t\t\t\t$sqlText = \"update apxemp set approved_status='A' where id_apxemp=\".$IdAp;\n\t\t\t\t\t\t$dbEx->updSql($sqlText);\n\t\t\t\t\t\t$result = 1;\t\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($dtEmp['0']['id_role']==8){\n\t\t\t\tif($dtAp['0']['AUTOR_GENERALMAN']!=0 and $dtAp['0']['APPROVED_GENERAL']=='S'){\n\t\t\t\t\t\t$sqlText = \"update apxemp set approved_status='A' where id_apxemp=\".$IdAp;\n\t\t\t\t\t\t$dbEx->updSql($sqlText);\n\t\t\t\t\t\t$result = 1;\t\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t}\n\t\t//Ap de ingreso solo son verificadas por HR\n\t\telse{\n\t\t\tif($dtAp['0']['AUTOR_HR']!=0 and $dtAp['0']['APPROVED_HR']=='S'){\n\t\t\t\t$sqlText = \"update apxemp set approved_status='A' where id_apxemp=\".$IdAp;\n\t\t\t\t$dbEx->updSql($sqlText);\n\t\t\t\t$result = 1;\t\n\t\t\t}\t\n\t\t}\n\t\t}\n\t\treturn $result;\n\t}",
"function puestoDatos($idPuesto){\n $pdo = new conexion();\n $query = $pdo->prepare(\"SELECT * FROM puesto WHERE idPuesto = $idPuesto;\");\n $query->execute();\n $res = $query->fetchAll();\n \n foreach ($res as $value) {\n $this->idPuesto=$value['idPuesto'];\n $this->nombrePuest=$value['nombrePuest'];\n $this->descripcion=$value['descripcion'];\n $this->salarioDia=$value['salarioDia'];\n }\n }",
"function baja_evaluacion_parcial($parametros)\n {\n\t\tkernel::log()->add_debug('baja_evaluacion_parcial', $parametros); \n\n\t\t$sql = \"EXECUTE PROCEDURE sp_del_EvalCronAul({$parametros['comision']}, {$parametros['evaluacion']}) \";\n\t\tkernel::log()->add_debug('sp_del_EvalCronAul', $sql); \n\t//\tdie;\n\t\t$result['mensaje'] = util::ejecutar_procedure($sql);\n\t\tkernel::log()->add_debug('sp_del_EvalCronAul', $result); \n \n $sql = \"UPDATE ufce_cron_eval_parc\n\t\t\t\t\tSET estado = 'P',\n\t\t\t\t\t\testado_notific = 'U'\n WHERE comision = {$parametros['comision']} \n AND evaluacion = {$parametros['evaluacion']}\" ;\n\t\tkernel::db()->ejecutar($sql);\n\t\treturn $result;\n }",
"function consultarNotasInscripcionesEstudiante($cod_estudiante,$cod_proyecto){\r\n $datos= array('cod_estudiante'=>$cod_estudiante,\r\n 'cod_proyecto'=>$cod_proyecto);\r\n $cadena_sql = $this->sql->cadena_sql(\"consultarNotasInscripcionesEstudiante\",$datos);\r\n $resultado = $this->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql, \"busqueda\");\r\n return $resultado;\r\n }",
"public function updatePeriodscheme($p_sValue){\n // @parameter $p_sValue type: string scope:local\n $this->sPdoQuery= $p_sValue;\n $bSucces = $this->PdoSqlReturnTrue();\n $_SESSION['aAllPeriodSchemes'] = $this->selectAll('tbl_periodeschemes');\n return($bSucces); \n}",
"function EvaluarIncorrecto($id,$alias,$hist,$log,$coment,$corr){\n \n //Contruimos la sentencia sql para modificar una tupla por parte del profesor\n $sql = \"UPDATE `EVALUACION` SET \n ComentIncorrectoP = '\".$coment.\"',\n CorrectoP = '\".$corr.\"'\n WHERE LoginEvaluador = '\".$log.\"' && \n (AliasEvaluado = '\".$alias.\"') && \n (IdHistoria = '\".$hist.\"') && \n (IdTrabajo = '\".$id.\"')\";\n \n // si hay un problema con la query se envia un mensaje de error en la modificacion\n if (!($resultado = $this->mysqli->query($sql))){\n return 'Unknowed Error';\n }\n else{ // si no hay problemas con la modificación se indica que se ha modificado\n return 'Success Modify';\n }\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Whether the primary key was modified | public function hasModifiedPk(): bool
{
return
!$this->renamedPkFields->isEmpty() ||
!$this->removedPkFields->isEmpty() ||
!$this->addedPkFields->isEmpty()
;
} | [
"public function isUpdate(){\n\t\treturn isset($this->{$this->getPrimaryKey()}) ? true : false;\n\t}",
"public function isPrimaryKey(): bool;",
"public function isPrimaryKey()\r\n {\r\n return $this->name == 'PRIMARY';\r\n }",
"public function hasPrimaryKey(){\n return !empty($this->primaryKeyColumn);\n }",
"protected function hasPrimaryKey() {\n return $this->primaryKey ? true : false;\n }",
"protected function _checkPrimaryKeysChanges()\n {\n $isChanged = false;\n if (is_array($this->_aPrimaryKeys) AND is_array($this->_aOldPrimaryValues)) {\n foreach ($this->_aPrimaryKeys as $primaryKey) {\n if ($this->$primaryKey != $this->_aOldPrimaryValues[$primaryKey]) {\n $isChanged = true;\n break;\n }\n }\n }\n\n return $isChanged;\n }",
"function isPrimaryKey()\n {\n return $this->getAnnotationIndex(self::AUTO) >= 0;\n }",
"public function KeyIsPrimary( ) {\n\n return $this->m_COLUMN_KEY == 'PRI';\n\n }",
"final public function hasPrimaryKey()\n\t{\n\t\treturn in_array($this->primary_field, array_keys($this->attributes));\n\t}",
"final public function isModified() { \n $dirty = (count($this->getInsertDiff()) > 0 || count($this->getDeleteDiff()) > 0); \n if ( ! $dirty) { \n foreach($this as $record) { \n if ($dirty = $record->isModified()) {\n break;\n } \n } \n } \n return $dirty; \n }",
"public function isPrimaryKeyAutoIncrement(): bool\n {\n return $this->primaryKeyAutoIncrement;\n }",
"public function isPrimaryKEY()\r\n\t{return $this->KEY == KEY::$PK;}",
"public function save()\r\n {\r\n /**\r\n * Mark primary properties as modified\r\n */\r\n $primary = (array)$this->getTable()->getPrimary();\r\n\t\tforeach ($primary as $columnName) {\n\t\t\t!$this->_modifiedFields[$columnName] \r\n\t\t\t\t&& ($this->_modifiedFields[$columnName] = true)\r\n\t\t\t;\r\n\t\t}\r\n\t\t\r\n\t\treturn parent::save();\r\n }",
"public function hasRenamedPkFields(): bool\n {\n return !$this->renamedPkFields->isEmpty();\n }",
"function needsUpdate($rec)\n {\n // no matter what, we always save a new value.\n return true;\n }",
"public function IsKeyUpdated()\n\t{\n\t\treturn $this->isKeyUpdated;\n\t}",
"public function isSequencePrimaryKey(): bool\n {\n return $this->primary['type'] === self::PK_SEQUENCE;\n }",
"public function isPrimaryKey()\n {\n if (isset($this->definition['primary']))\n {\n return $this->definition['primary'];\n }\n\n return false;\n }",
"public function isModified(): bool;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get instance includes collection | public function getIncludes() {
return $this->includes;
} | [
"public function getIncludes();",
"public function getIncluded()\n {\n $included = collect();\n\n foreach ($this->records as $record) {\n $included = $included->merge(\n (new ResourceSerializer($record, $this->fields, $this->include, $this->relationships))\n ->getIncluded()\n );\n }\n\n return $this->filterUnique($included);\n }",
"public function includes()\n {\n $includes = [];\n\n if (($include = request()->query('include')) !== '*') {\n\n $include = array_map(\n function($relation) {\n return explode('.', trim($relation));\n },\n explode(',', $include)\n );\n\n foreach ($include as $nested) {\n $key = array_shift($nested);\n $nested = $this->nestIncludes($nested);\n if (array_key_exists($key, $includes)) {\n $includes[$key] = array_merge_recursive(\n $includes[$key],\n $nested\n );\n } else {\n $includes[$key] = $nested;\n }\n }\n }\n\n else {\n\n $className = '\\App\\\\' . studly_case(str_singular($this->type()));\n\n foreach ((new $className)->relations() as $relation) {\n $includes[$relation] = [];\n }\n }\n\n return $includes;\n }",
"public function getIncludesObject()\n {\n return $this->includesObject;\n }",
"public function getIncludes()\n {\n return $this->m_includes;\n }",
"public function getIncludes() {\n return $this->apiGet('include');\n }",
"public function testIncludedRecords()\n {\n $users = factory(User::class, 3)\n ->make()\n ->map(function ($user) {\n $user->posts = factory(Post::class, 2)->make();\n\n return $user;\n });\n\n $serializer = new CollectionSerializer($users, [], ['posts']);\n $included = $serializer->getIncluded();\n\n $this->assertInstanceOf(Collection::class, $included);\n $this->assertJsonApiObjectCollection(['data' => $included->toArray()], 6);\n\n foreach ($included as $record) {\n $this->assertEquals('posts', $record['type'], 'Unexpected record type included with collection');\n }\n }",
"public function getIncludedEntities(): ?IncludedEntityCollection\n {\n return $this->includedEntities;\n }",
"public function getIncludeList()\n {\n return $this->include;\n }",
"public function getContainedIn();",
"protected function eagerLoad()\n {\n foreach ($this->with as $relation) {\n $this->query->with($relation);\n }\n return $this;\n }",
"public function eagerLoadableRelations(): array;",
"protected function getAllowedIncludes(): array\n {\n return [\n 'posts',\n ];\n }",
"protected function eagerLoad()\n\t{\n\t\tforeach($this->with as $relation)\n\t\t{\n\t\t\t$this->query->with($relation);\n\t\t}\n\t\treturn $this;\n\t}",
"public function getRelationshipsInclusionMeta();",
"public function getIncludesTypes()\n {\n return $this->includes;\n }",
"public function getIncluded()\n {\n return $this->included;\n }",
"public function getIncludes(): array\n {\n if ($this->includes === null) {\n $this->includes = TransformerHelper::normalizeIncludes(\n $this->defineIncludes()\n );\n }\n\n return $this->includes;\n }",
"protected function getIncludes(Request $request){\n return collect(array_filter(explode(',', $request->get('include', ''))))->reject(function($include){\n return !in_array($include, $this->allowedIncludes);\n })->toArray();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get landmarks by unit id | public function getLandmarksByUnitId($unit_id, $reference = null, $verified = '')
{
$and_reference = $and_verified = "";
$landmarks = array();
if ($reference === true) {
$and_reference = "AND lm.territorytype = 'reference' ";
if (! empty($verified)) {
switch ($verified) {
case 'verified':
$and_verified = "AND lm.verifydate > '0000-00-00' ";
break;
case 'no-verified':
$and_verified = "AND lm.verifydate = '0000-00-00' ";
break;
case 'all':
$and_verified = "";
break;
}
}
} else if ($reference === false) {
$and_reference = "AND lm.territorytype = 'landmark' ";
}
$sql = "SELECT
lm.territory_id,
lm.account_id,
lm.shape,
lm.territoryname,
lm.latitude,
lm.longitude,
lm.radius,
lm.streetaddress,
lm.city,
lm.state,
lm.zipcode,
lm.country,
lm.territorytype,
lm.verifydate,
lm.active,
ul.unit_id as unit_id
FROM crossbones.unit_territory AS ul
LEFT JOIN crossbones.territory AS lm ON lm.territory_id = ul.territory_id
WHERE ul.unit_id = ? {$and_reference}{$and_verified}AND lm.active = 1";
if ($landmarks = $this->db_read->fetchAll($sql, array($unit_id))) {
//print_rb($landmarks);
return $landmarks;
}
return false;
} | [
"public function landmarks()\n {\n return $this->landmarks;\n }",
"public function getLandmarks()\n {\n return $this->landmarks;\n }",
"function get_landmarks () {\n\n $query = $this->db->get('itms_landmarks', array('company_id'=>$this->session->userdata('itms_company_id')));\n\n return $query->result(); \n }",
"public function getLandmarkByIds($landmark_ids)\n {\n if (isset($landmark_ids) AND ! empty($landmark_ids)) {\n $landmarks = implode(\",\", $landmark_ids);\n\n $sql = \"SELECT \n lm.landmark_id,\n lm.account_id,\n lm.shape,\n lm.landmarkname,\n lm.latitude,\n lm.longitude,\n lm.radius,\n lm.streetaddress,\n lm.city,\n lm.state,\n lm.zipcode,\n lm.country,\n lm.reference,\n lm.verifydate,\n lm.active,\n lg.active as landmarkgroup_active,\n lg.landmarkgroupname as landmarkgroupname,\n lg.landmarkgroup_id as landmarkgroup_id,\n lm.reference as reference,\n IF(lm.reference = '1', 'Reference', 'Landmark') as landmark_type,\n asText(lm.boundingbox) as boundingbox\n FROM crossbones.landmark AS lm\n LEFT JOIN crossbones.landmarkgroup_landmark AS lgl ON lgl.landmark_id = lm.landmark_id\n LEFT JOIN crossbones.landmarkgroup AS lg ON lg.landmarkgroup_id = lgl.landmarkgroup_id\n WHERE lm.landmark_id IN ({$landmarks}) AND lm.active = 1 \n ORDER BY lm.landmarkname\";\n\n if (($landmark = $this->db_read->fetchAll($sql)) !== false) {\n //print_rb($landmark);\n return $landmark;\n }\n }\n \n return false; \n }",
"public function getBarrenLandByLandType();",
"public function getUnitsByLandmarkId($landmark_id)\n {\n $sql = \"SELECT *\n FROM crossbones.unit_landmark AS ul\n LEFT JOIN crossbones.unit AS u ON u.unit_id = ul.unit_id\n WHERE ul.landmark_id = ?\";\n \n if ($units = $this->db_read->fetchAll($sql, array($landmark_id))) {\n return $units;\n }\n \n return false;\n }",
"public function getLandmarksByGroupIds($user_id, $landmark_groups)\n {\n $landmarks = array();\n $where_in = \"\";\n if (isset($landmark_groups) AND ! empty($landmark_groups)) {\n $landmark_groups = implode(\",\", $landmark_groups);\n $where_in = \"AND crossbones.landmarkgroup.landmarkgroup_id IN ({$landmark_groups}) \";\n }\n\n $sql = \"SELECT \n crossbones.landmark.landmark_id,\n crossbones.landmark.account_id,\n crossbones.landmark.shape,\n crossbones.landmark.landmarkname,\n crossbones.landmark.latitude,\n crossbones.landmark.longitude,\n crossbones.landmark.radius,\n crossbones.landmark.streetaddress,\n crossbones.landmark.city,\n crossbones.landmark.state,\n crossbones.landmark.zipcode,\n crossbones.landmark.country,\n crossbones.landmark.reference,\n crossbones.landmark.verifydate,\n crossbones.landmark.active,\n crossbones.landmarkgroup.*,\n crossbones.landmark.landmark_id as landmark_id \n FROM crossbones.landmark \n LEFT JOIN crossbones.landmarkgroup_landmark ON crossbones.landmark.landmark_id = crossbones.landmarkgroup_landmark.landmark_id \n LEFT JOIN crossbones.landmarkgroup ON crossbones.landmarkgroup_landmark.landmarkgroup_id = crossbones.landmarkgroup.landmarkgroup_id \n WHERE crossbones.landmark.account_id = ? {$where_in} AND crossbones.landmark.active = 1\n ORDER BY crossbones.landmark.landmarkname ASC\";\n\n $landmarks = $this->db_read->fetchAll($sql, array($user_id));\n\n return $landmarks;\n }",
"public function getId_land()\n {\n return $this->id_land;\n }",
"public static function getMarkersGeoLoc($id)\r\n\t{\r\n\t\tglobal $wpdb;\r\n\t\tif($id == null)\r\n\t\t{\r\n\t\t\t$geoLoc = null;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$workingUnit = $wpdb->get_row( \"SELECT * FROM \" . TABLE_UNITE_TRAVAIL . \" WHERE id =\" . $id);\r\n\t\t\t$address = new EvaAddress($workingUnit->id_adresse);\r\n\t\t\t$address->load();\r\n\t\t\t$geoLoc = $address->getGeoLoc();\r\n\t\t\t$scoreRisque = eva_UniteDeTravail::getScoreRisque($workingUnit->id);\r\n\t\t\t$geoLoc['info'] = '<img class=\"alignleft\" style=\"margin-right:0.5em;\" src=\"' . EVA_WORKING_UNIT_ICON . '\" alt=\"Unité de travail : \"/><strong>' . $workingUnit->nom . '</strong><br /><em>' . __('Risque', 'evarisk') . ' : <span class=\"valeurInfoElement risque' . Risque::getSeuil($scoreRisque) . 'Text\">' . eva_UniteDeTravail::getNiveauRisque($scoreRisque) . '</span></em>';\r\n\t\t\t$geoLoc['type'] = \"unité de travail\";\r\n\t\t\t$geoLoc['adress'] = $workingUnit->id_adresse;\r\n\t\t\t$geoLoc['image'] = GOOGLEMAPS_UNITE;\r\n\t\t}\r\n\t\treturn $geoLoc;\r\n\t}",
"public function exportReferenceLandmarks($format, $unit_id)\n {\n $user_timezone = $this->user_session->getUserTimeZone();\n \n if (! empty($unit_id)) {\n $account_name = $this->user_session->getAccountName();\n $unit = $this->vehicle_logic->getVehicleInfo($unit_id);\n if (($unit !== false) AND ! empty($unit)) {\n $results = array();\n \n $landmarks = $this->territory_logic->getTerritoryByUnitId($unit_id, $user_timezone, true);\n if ($landmarks !== false) {\n $results = $landmarks; \n }\n \n $account_name = preg_replace('/[^A-Za-z0-9]/','_',trim($account_name));\n $unit_name = preg_replace('/[^A-Za-z0-9]/','_',trim($unit['unitname'])); \n\n $filename = $account_name . '_' . $unit_name . '_reference_addresses';\n\n $fields = array('territoryname' => 'Name','formatted_address' => 'Address','latitude' => 'Latitude', 'longitude' => 'Longitude', 'radius_in_miles' => 'Radius (miles)', 'verified' => 'Verified', 'formatted_verified_date' => 'Verified Date');\n \n if($format == 'pdf') {\n $pdf_builder = new TCPDFBuilder('L');\n $pdf_builder->createTitle('Vehicle Verification');\n $pdf_builder->createTable($results, $fields, $unit['unitname']);\n $pdf_builder->Output($filename, 'D');\n } else {\n $csv_builder = new CSVBuilder();\n $csv_builder->setSeparator(',');\n $csv_builder->setClosure('\"');\n $csv_builder->setFields($fields);\n $csv_builder->format($results)->export($filename); \n }\n }\n }\n \n exit();\n }",
"public function getLandmarkId()\n\t\t{\n\t\t\treturn $this->landmarkId;\n\t\t}",
"function get_unitofarea($id) {\r\n\r\n $this->db->select('*');\r\n $this->db->from('cs_unitofarea');\r\n $this->db->where('UOA_ID', $id);\r\n\r\n return $this->db->get()->row_array();\r\n }",
"function get_area_unit($id)\n {\n $this->db->where('id', $id);\n $this->db->from('mst_area_unit');\n $query = $this->db->get();\n return $query;\n }",
"public function getFilteredLandmarks($user_id, $params)\n {\n $landmarks = array();\n $where_in_groups = \"\";\n if (isset($params['landmarkgroup_id']) AND ! empty($params['landmarkgroup_id'])) {\n $landmark_groups = implode(\",\",$params['landmarkgroup_id']);\n $where_in_groups = \" AND crossbones.landmarkgroup.landmarkgroup_id IN ({$landmark_groups}) \";\n }\n\n $where_reference = \"\";\n if (isset($params['landmark_type']) AND $params['landmark_type'] != '') {\n $landmark_type = $params['landmark_type'];\n $where_reference = \" AND crossbones.landmark.reference = '{$landmark_type}' \";\n }\n\n $sql = \"SELECT \n crossbones.landmark.landmark_id,\n crossbones.landmark.account_id,\n crossbones.landmark.shape,\n crossbones.landmark.landmarkname,\n crossbones.landmark.latitude,\n crossbones.landmark.longitude,\n crossbones.landmark.radius,\n crossbones.landmark.streetaddress,\n crossbones.landmark.city,\n crossbones.landmark.state,\n crossbones.landmark.zipcode,\n crossbones.landmark.country,\n crossbones.landmark.reference,\n crossbones.landmark.verifydate,\n crossbones.landmark.active,\n crossbones.landmarkgroup.active AS landmarkgroup_active,\n crossbones.landmarkgroup.landmarkgroupname as landmarkgroupname,\n crossbones.landmarkgroup.landmarkgroup_id as landmarkgroup_id,\n IF(crossbones.landmark.reference = '1', 'Reference', 'Landmark') as landmark_type\n FROM crossbones.landmark \n LEFT JOIN crossbones.landmarkgroup_landmark ON crossbones.landmark.landmark_id = crossbones.landmarkgroup_landmark.landmark_id \n LEFT JOIN crossbones.landmarkgroup ON crossbones.landmarkgroup_landmark.landmarkgroup_id = crossbones.landmarkgroup.landmarkgroup_id \n WHERE crossbones.landmark.account_id = ? AND crossbones.landmark.active = 1{$where_in_groups} {$where_reference}\n ORDER BY landmark.landmarkname ASC\";\n\n $landmarks = $this->db_read->fetchAll($sql, array($user_id));\n\n return $landmarks; \n }",
"function get_map_zone($id, &$sqlm)\r\n{\r\n\t$map_zone = $sqlm->fetch_assoc($sqlm->query('\r\n\t\tSELECT area_id\r\n\t\tFROM dbc_map\r\n\t\tWHERE id='.$id.' LIMIT 1'));\r\n\treturn get_zone_name($map_zone['area_id'], $sqlm);\r\n}",
"public function getFilteredLandmarks($user_id, $params)\n {\n $total_landmarks = array();\n \n if (! is_numeric($user_id) AND $user_id <= 0) {\n $this->setErrorMessage('err_user');\n }\n\n if (! is_array($params) OR empty($params)) {\n $this->setErrorMessage('err_params');\n }\n\n if (! $this->hasError()) {\n \n switch ($params['filter_type']) {\n \n case 'string_search':\n \n $searchfields = array('landmarkname');\n $landmarks = $this->landmark_data->getFilteredLandmarksStringSearch($user_id, $params, $searchfields);\n if ($landmarks !== false) {\n $total_landmarks = $landmarks;\n }\n \n break;\n \n case 'group_filter':\n \n if (isset($params['landmarkgroup_id']) AND strtolower($params['landmarkgroup_id']) == 'all') {\n $params['landmarkgroup_id'] = array();\n } elseif (! is_array($params['landmarkgroup_id'])) {\n $params['landmarkgroup_id'] = array($params['landmarkgroup_id']);\n }\n\n if (isset($params['landmark_type']) AND strtolower($params['landmark_type']) == 'reference') {\n $params['landmark_type'] = '1';\n } elseif (isset($params['landmark_type']) AND strtolower($params['landmark_type']) == 'landmark') {\n $params['landmark_type'] = '0';\n } else {\n $params['landmark_type'] = '';\n }\n\n $landmarks = $this->landmark_data->getFilteredLandmarks($user_id, $params);\n\n//print_rb($landmarks);\n\n if ($landmarks !== false) {\n $total_landmarks = $landmarks;\n }\n \n break;\n \n default:\n \n break;\n }\n\n\n // specialized personal paging and indexing\n if ( $params['paging'] == '+' ) {\n $params['landmark_start_index'] = $params['landmark_start_index'] + $params['landmark_listing_length'];\n } elseif ($params['paging'] == '-') {\n $params['landmark_start_index'] = $params['landmark_start_index'] - $params['landmark_listing_length'];\n if ($params['landmark_start_index'] < 0) {\n $params['landmark_start_index'] = 0;\n }\n }\n\n $data['total_landmarks_count'] = count($total_landmarks);\n $total_key = intval(end(array_keys($total_landmarks)));\n $end_index = intval($params['landmark_start_index']) + intval($params['landmark_listing_length']);\n $data['landmarks'] = array_splice($total_landmarks, $params['landmark_start_index'], $params['landmark_listing_length']);\n $data['endpage'] = 0;\n\n if (intval($end_index) >= intval($total_key)) {\n $data['endpage'] = 1;\n }\n\n return $data;\n }\n\n return false;\n }",
"public function getById($id) {\n // 66000000 <= locationID <= 66999999 then staStations.stationID = locationID - 6000001\n // 67000000 <= locationID <= 67999999 then ConqStations.stationID = locationID - 6000000\n // 60014861 <= locationID <= 60014928 then ConqStations.stationID = locationID\n // 60000000 <= locationID <= 61000000 then staStations.stationID = locationID\n // 61000000 <= locationID then ConqStations.stationID = locationID\n // default mapDenormalize.itemID = locationID\n\n $id = (double) $id;\n\n if (66014940 <= $id && $id <= 66014952 || 67000000 <= $id && $id <= 67999999) {\n $id -= 6000000;\n } else if (66000000 <= $id && $id <= 66999999) {\n $id -= 6000001;\n }\n\n $this->getByIdSmt->execute(array(':id' => $id));\n return $this->getByIdSmt->fetch(PDO::FETCH_CLASS | PDO::FETCH_CLASSTYPE);\n }",
"public function area($id)\n {\n return $this->builder->where('arina_brand_id', $id);\n }",
"public function getLocations();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test removing multiple paths from a query. | public function testRemovePaths()
{
$tests = array(
array(
'label' => __LINE__ .': null',
'argument' => null,
'error' => array('InvalidArgumentException' => 'Cannot remove paths; argument must be an array.'),
'expected' => null,
),
array(
'label' => __LINE__ .': numeric',
'argument' => 1,
'error' => array('InvalidArgumentException' => 'Cannot remove paths; argument must be an array.'),
'expected' => null,
),
array(
'label' => __LINE__ .': string',
'argument' => 'string',
'error' => array('InvalidArgumentException' => 'Cannot remove paths; argument must be an array.'),
'expected' => null,
),
array(
'label' => __LINE__ .': array',
'argument' => array('string'),
'error' => null,
'expected' => array(),
),
array(
'label' => __LINE__ .': object',
'argument' => new stdClass,
'error' => array('InvalidArgumentException' => 'Cannot remove paths; argument must be an array.'),
'expected' => null,
),
);
foreach ($tests as $test) {
$label = $test['label'];
$query = new P4Cms_Record_Query;
try {
$query->removePaths($test['argument']);
if ($test['error']) {
$this->fail("$label - unexpected success");
} else {
$this->assertEquals(
$test['expected'],
$query->getPaths(),
"$label - expected value"
);
}
} catch (PHPUnit_Framework_AssertionFailedError $e) {
$this->fail($e->getMessage());
} catch (PHPUnit_Framework_ExpectationFailedError $e) {
$this->fail($e->getMessage());
} catch (Exception $e) {
if (!$test['error']) {
$this->fail("$label - Unexpected exception (". get_class($e) .') :'. $e->getMessage());
} else {
list($class, $error) = each($test['error']);
$this->assertEquals(
$class,
get_class($e),
"$label - expected exception class: ". $e->getMessage()
);
$this->assertEquals(
$error,
$e->getMessage(),
"$label - expected exception message"
);
}
}
}
$query = P4Cms_Record_Query::create()->addPaths(array('one', 'two', 'three', 'two', 'four'));
$this->assertEquals(
array('one', 'two', 'three', 'two', 'four'),
$query->getPaths(),
'Expected paths after add'
);
$query->removePaths(array('two', 'four'));
$this->assertEquals(
array('one', 'three', 'two'),
$query->getPaths(),
'Expected paths after remove #1'
);
} | [
"public function removeAllInPath($path) {\n\t\t$path = strtolower($path);\n\t\t$query = $this->entityManager->createQuery('DELETE FROM TYPO3\\TYPO3CR\\Domain\\Model\\NodeData n WHERE n.path LIKE :path');\n\t\t$query->setParameter('path', $path . '/%');\n\t\t$query->execute();\n\t}",
"abstract public function testDeleteMultiple();",
"public function testDeleteWithMultipleReferences()\n {\n $this->runRequest(new ServerRequest([], [], '/new', 'POST', 'php://input', [], [], [\n 'text' => 'First',\n 'uri' => '/path/'\n ]));\n\n $this->runRequest(new ServerRequest([], [], '/new', 'POST', 'php://input', [], [], [\n 'text' => 'Second',\n 'parent' => 1,\n 'uri' => '/path/'\n ]));\n\n $this->runRequest(new ServerRequest([], [], '/new', 'POST', 'php://input', [], [], [\n 'text' => 'Third',\n 'parent' => 1,\n 'uri' => '/path/'\n ]));\n\n $this->runRequest(new ServerRequest([], [], '/new', 'POST', 'php://input', [], [], [\n 'text' => 'Last',\n 'uri' => '/path/'\n ]));\n\n $this->runRequest(new ServerRequest([], [], '/id/1', 'DELETE'));\n $this->runRequest(new ServerRequest([], [], '/', 'GET', 'php://input', [], [], [\n 'uri' => '/path/'\n ]));\n $this->assertResponseOk();\n\n $this->runRequest(new ServerRequest([], [], '/id/2', 'DELETE'));\n $this->runRequest(new ServerRequest([], [], '/', 'GET', 'php://input', [], [], [\n 'uri' => '/path/'\n ]));\n $this->assertResponseOk();\n\n $this->runRequest(new ServerRequest([], [], '/id/3', 'DELETE'));\n $this->runRequest(new ServerRequest([], [], '/', 'GET', 'php://input', [], [], [\n 'uri' => '/path/'\n ]));\n $this->assertResponseOk();\n\n $this->runRequest(new ServerRequest([], [], '/id/4', 'DELETE'));\n $this->runRequest(new ServerRequest([], [], '/', 'GET', 'php://input', [], [], [\n 'uri' => '/path/'\n ]));\n $this->assertResponseStatusCodeEquals(404);\n }",
"public function testModifyQueryArgsRemovalOfQueryArgs(): void\n {\n $url = 'http://www.example.org/whatever.php?a=cats&b=dogs&c=goldfish';\n $removeQueryArgs = array(\n 'a',\n 'b',\n 'c'\n );\n $expected = 'http://www.example.org/whatever.php';\n $actual = \\AWonderPHP\\PluggableUnplugged\\WPCoreReplace::modifyQueryArgs($url, array(), $removeQueryArgs);\n $this->assertEquals($expected, $actual);\n }",
"public Function testdeletePath() {\n $this->assertTrue( deletePath( 'images' ) ); // Deleting a Directory\n $this->assertTrue( deletePath( 'albums.zip' ) ); //Deleting a File.\n\n }",
"public function testDeleteMatchingStatements()\n {\n /*\n check that query function gets a query which looks like:\n DELETE WHERE {\n Graph <http://saft/test/g1> {\n <http://saft/test/s1> <http://saft/test/p1> <http://saft/test/o1>.\n }\n }\n */\n $this->mock\n ->expects($this->once())\n ->method('query')\n ->with(new RegexMatchConstraint(\n '/DELETEWHERE{Graph<'.$this->regexUri.'>{'.\n '<'.$this->regexUri.'><'.$this->regexUri.'><'.$this->regexUri.'>.'.\n '}}/si'\n ));\n\n $this->mock->deleteMatchingStatements(\n $this->getTestStatement('uri', 'uri', 'uri', 'uri')\n );\n }",
"public function delete(array $path): Result\n\t{\n\t\treturn $this->callSvn('delete', false, false, $path);\n\t}",
"public function delete($path = '') {\n $path = \\arc\\path::collapse($path, $this->path);\n $parent = \\arc\\path::parent($path);\n $name = basename($path);\n $queryStr = <<<EOF\ndelete from objects where (parent like :path or (parent = :parent and name = :name ))\nEOF;\n $query = $this->db->prepare($queryStr);\n return $query->execute([\n ':path' => $path.'%',\n ':parent' => $parent,\n ':name' => $name\n ]);\n }",
"public function testUnsetMultiple(): void\n {\n $entity = new Entity(['id' => 1, 'name' => 'bar', 'thing' => 2]);\n $entity->unset(['id', 'thing']);\n $this->assertFalse($entity->has('id'));\n $this->assertTrue($entity->has('name'));\n $this->assertFalse($entity->has('thing'));\n }",
"public function testRemoveByArray()\n {\n $filter = new LeoProfanity();\n $filter->remove(['boob', 'boobs']);\n\n $this->assertNotContains('boob', $filter->getList());\n $this->assertNotContains('boobs', $filter->getList());\n }",
"protected function removeSpecOperations(array $spec, array $ops_to_remove) {\n foreach ($spec['paths'] as $path => $operations) {\n foreach ($operations as $op => $details) {\n if (in_array($op, $ops_to_remove)) {\n unset($spec['paths'][$path][$op]);\n }\n }\n if (empty($spec['paths'][$path])) {\n unset($spec['paths'][$path]);\n }\n }\n\n return $spec;\n }",
"public function testDeleteMultiple()\n {\n $items = func_get_args()[0];\n $ids = array_map(function ($item) {\n return $item;\n }, $items);\n $this->group->delete($items);\n $models = $this->group->read([['id', $ids]]);\n // test method is returning array and not Laravel class instances\n $this->assertTrue(is_array($models));\n $this->assertTrue(empty($models));\n }",
"public function testBuildDeleteWhereIn()\n\t{\n\t\t$expected = \"DELETE FROM `my_table` WHERE `field` IN (1, 2, 3)\";\n\n\t\t$query = $this->connection\n\t\t\t->delete()->from('my_table')\n\t\t\t->where('field', array(1, 2, 3))\n\t\t\t->compile();\n\n\t\t$this->assertEquals($expected, $query);\n\t}",
"public function testRemoveAll()\n {\n \t$this->object->removeAll($this->object);\n }",
"public function testDeleteSet()\n {\n $this->dispatch(\n '/test/rest/',\n [\n ['id' => 1003],\n ['id' => 1004],\n ],\n RequestMethod::DELETE\n );\n\n self::assertResponseCode(StatusCode::NOT_IMPLEMENTED);\n\n /*\n self::assertOk();\n\n $count = Db::fetchOne(\n 'SELECT count(*) FROM `test` WHERE `id` IN (3,4)'\n );\n self::assertEquals($count, 0);\n */\n }",
"public function testRemoveQueryArgArray() {\n $url = 'http://www.studio98.com/?test=true&help=needed&still=here';\n $new_url = url::remove_query_arg( array( 'test', 'help' ), $url );\n\n // Make sure they're equal\n\t\t$this->assertEquals( 'http://www.studio98.com/?still=here', $new_url );\n }",
"public function removeMultiple($keys);",
"private function removeFromArray(array &$array, array $path): void\n {\n $previous = null;\n $tmp = &$array;\n\n foreach ($path as $node) {\n $previous = &$tmp;\n $tmp = &$tmp[$node];\n }\n\n if (null !== $previous && true === isset($node)) {\n unset($previous[$node]);\n }\n }",
"public function removeMultiple($ids)\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Allows to compose message from a job using the specified template. | public function composeMessage(int $jobId, int $templateId): string; | [
"protected function buildJob(\n \\tx_mkmailer_models_Template $template = null\n ) {\n /* @var $job \\tx_mkmailer_mail_MailJob */\n $job = GeneralUtility::makeInstance('tx_mkmailer_mail_MailJob');\n if ($template instanceof \\tx_mkmailer_models_Template) {\n $job->setFrom($template->getFromAddress());\n // set from mail adress from rn_base configuration as fallback\n if (!$job->getFrom()->getAddress()) {\n $job->getFrom()->setAddress(\n \\Sys25\\RnBase\\Configuration\\Processor::getExtensionCfgValue('rn_base', 'fromEmail')\n );\n }\n $job->setCCs($template->getCcAddress());\n $job->setBCCs($template->getBccAddress());\n $job->setSubject($template->getSubject());\n $job->setContentText($template->getContentText());\n $job->setContentHtml($template->getContentHtml());\n }\n\n return $job;\n }",
"private function createFromTemplate(): string\n {\n ob_start();\n ob_implicit_flush(0);\n\n if (!empty($this->message) && is_array($this->message)) {\n extract($this->message, EXTR_OVERWRITE);\n }\n\n require $this->templatePath . '.php';\n\n return ob_get_clean();\n }",
"public function templateJobDetail( $template ) {\n $id = get_query_var( 'jobid' );\n //var_dump($id);\n $idPos = (int) strrpos($id, '-') + 1;\n $id = (int) substr($id, $idPos, 10);\n $slug = get_query_var( 'jobid' );\n\n $parameters = [\n 'id' => $id\n ];\n\n $response = $this->apiHelper->PrescreenAPI('job', 'GET', $parameters, '');\n\n //Post mit ID Startseite holen --> Startseite\n // alles soweit entfernen und das YOOTheme JSON holen\n\n $startseitenPost = get_post( 2 );\n $companyGridLength = strlen($startseitenPost->post_content);\n $companyGridStart = stripos ( $startseitenPost->post_content, '<!--more-->' );\n $companyGrid = substr( $startseitenPost->post_content, $companyGridStart + 11, $companyGridLength);\n $companyGrid = substr( $companyGrid, 5, strlen($companyGrid));\n $companyGrid = substr( $companyGrid, 0, -3);\n $companyGrid = json_decode( $companyGrid, false );\n\n //Company Grid Item\n // achtung --> 5 scheint ROW zu sein, bei Umbau der Startseite muss ggf hier angepasst werden\n\n $numOfItems = count($companyGrid->children[6]->children[0]->children[1]->children[1]->children);\n\n $companyInformations = array();\n for($i = 0; $i < $numOfItems; $i++){\n $item = $companyGrid->children[6]->children[0]->children[1]->children[1]->children[$i]->props;\n\n $company = $item->title;\n $webseiteLink = $item->webseiteLink;\n $jobLink = $item->jobLink;\n $logo = $item->image;\n $headline = $item->headline;\n $content = $item->content;\n\n $companyInformations[$company] = [\n 'company' => $company,\n 'content' => $content,\n 'webseiteLink' => $webseiteLink,\n 'jobLink' => $jobLink,\n 'logo' => $logo,\n 'headline' => $headline\n ];\n }\n\n if ( $id ) {\n $args = [\n 'id' => $id,\n 'response' => $response,\n 'slug' => $slug,\n 'company' => $companyInformations\n ];\n load_template( BMSPRE_PLUGIN_DIR . '/templates/job-detail.php', $require_once = true, $args);\n exit;\n }\n return $template;\n }",
"public function templateAction()\n {\n try {\n $jobEntity = $this->initializeJob()->get($this->params());\n $jobEntity->setTemplate($this->params('template', 'default'));\n $this->repositoryService->store($jobEntity);\n $this->notification()->success(/* @translate*/ 'Template changed');\n } catch (\\Exception $e) {\n $this->notification()->danger(/* @translate */ 'Template not changed');\n }\n\n return new JsonModel(array());\n }",
"public function formatMessage(\n /*# string */ $template,\n array $arguments = []\n )/*# : string */;",
"public function testCreateMessageTemplate()\n {\n }",
"public function getMessageTemplate()\r\n {\r\n }",
"protected function createMessageFromTemplate($messageTemplate, $value)\r\n {\r\n // AbstractValidator::translateMessage does not use first argument.\n $message = $this->translateMessage('dummyValue',\n (string) $messageTemplate);\r\n \r\n if (is_object($value) &&\r\n !in_array('__toString', get_class_methods($value))\r\n ) {\r\n $value = get_class($value) . ' object';\r\n } elseif (is_array($value)) {\r\n $value = var_export($value, 1);\r\n } else {\r\n $value = (string) $value;\r\n }\r\n \r\n if ($this->isValueObscured()) {\r\n $value = str_repeat('*', strlen($value));\r\n }\r\n \r\n $message = str_replace('%value%', (string) $value, $message);\n $message = str_replace('%count%', (string) $this->count(), $message);\n \r\n $length = self::getMessageLength();\r\n if (($length > -1) && (strlen($message) > $length)) {\r\n $message = substr($message, 0, ($length - 3)) . '...';\r\n }\r\n \r\n return $message;\r\n }",
"public function createMessageFromTemplate($identifier, array $variables = array(), array $options = array())\n {\n if (!isset($options['template_extension'])) {\n $options['template_extension'] = '.mail.twig'; //$this->config->get('template_extension', '.mail.twig');\n }\n\n if (!isset($options['add_agavi_assigns'])) {\n $options['add_agavi_assigns'] = $this->config->get('add_agavi_assigns', true);\n }\n\n if (!$options['add_agavi_assigns']) {\n $twig_template = $this->loadTemplate($identifier, $options);\n } else {\n // add all assigns from the renderer parameters to the variables\n $layer = $this->getLayer($identifier, $options);\n $renderer = $layer->getRenderer();\n $context = AgaviContext::getInstance();\n $assigns = [];\n foreach ($renderer->getParameter('assigns', []) as $item => $var) {\n $getter = 'get' . StringToolkit::asStudlyCaps($item);\n if (\\is_callable([$context, $getter])) {\n if (null === $var) {\n continue;\n }\n $assigns[$var] = \\call_user_func([$context, $getter]);\n }\n }\n $variables = \\array_merge($variables, $assigns);\n\n $twig_template = $renderer->loadTemplate($layer);\n }\n\n $message = new Message();\n if ($twig_template->hasBlock('subject', $variables)) {\n $message->setSubject($twig_template->renderBlock('subject', $variables));\n }\n\n if ($twig_template->hasBlock('body_html', $variables)) {\n $message->setBodyHtml($twig_template->renderBlock('body_html', $variables));\n }\n\n if ($twig_template->hasBlock('body_text', $variables)) {\n $message->setBodyText($twig_template->renderBlock('body_text', $variables));\n }\n\n if ($twig_template->hasBlock('from', $variables)) {\n $message->setFrom($twig_template->renderBlock('from', $variables));\n }\n\n if ($twig_template->hasBlock('to', $variables)) {\n $message->setTo($twig_template->renderBlock('to', $variables));\n }\n\n if ($twig_template->hasBlock('cc', $variables)) {\n $message->setCc($twig_template->renderBlock('cc', $variables));\n }\n\n if ($twig_template->hasBlock('bcc', $variables)) {\n $message->setBcc($twig_template->renderBlock('bcc', $variables));\n }\n\n if ($twig_template->hasBlock('return_path', $variables)) {\n $message->setReturnPath($twig_template->renderBlock('return_path', $variables));\n }\n\n if ($twig_template->hasBlock('sender', $variables)) {\n $message->setSender($twig_template->renderBlock('sender', $variables));\n }\n\n if ($twig_template->hasBlock('reply_to', $variables)) {\n $message->setReplyTo($twig_template->renderBlock('reply_to', $variables));\n }\n\n return $message;\n }",
"public function buildSms($plugin, $tpl, $templateName, $messageKey, $parameters = null);",
"public function setBodyFromTemplate($template, $args = array()) {\n\n\t\t// init vars\n\t\t$__tmpl = $this->app->path->path($template);\n\n\t\t// does the template file exists ?\n\t\tif ($__tmpl == false) {\n\t\t\tthrow new AppMailException(\"Mail Template $template not found\");\n\t\t}\n\n\t\t// render the mail template\n\t\textract($args);\n\t\tob_start();\n\t\tinclude($__tmpl);\n\t\t$output = ob_get_contents();\n\t\tob_end_clean();\n\n\t\t// set body\n\t\t$this->setBody($output);\n\t}",
"public function getMessageTemplate() {\n $message = Swift_Message::newInstance();\n $message->setFrom(array(Yii::app()->params[\"adminEmail\"] => \"admin\"));\n $message->setContentType(\"text/html\");\n $message->setCharset(\"utf-8\");\n return $message;\n }",
"public static function jobTemplateName(string $project, string $location, string $jobTemplate): string\n {\n return self::getPathTemplate('jobTemplate')->render([\n 'project' => $project,\n 'location' => $location,\n 'job_template' => $jobTemplate,\n ]);\n }",
"public function testCompileMessageTemplate()\n {\n }",
"private function fillJobContactTemplate($uid, $template) {\r\n\t\t$markerArray = $this->getTemplateMarkers();\r\n\r\n\t\t$staffUidArr = self::getJobContactStaffUid($uid);\r\n\t\t$staff = tx_cgswigmore_factory::getInstance('tx_cgswigmore_staff');\r\n\t\t$staff->setMasterTemplateMarker('###TEMPLATE_JOB_CONTACT###');\r\n\t\t$select['where'][] = 'tx_cgswigmore_staff.uid IN (' . implode(',', $staffUidArr) . ')';\r\n\r\n\t\t$subpartArray['###TEMPLATE_JOB_ROW_CONTACT_ROW###'] = $staff->init($select);\r\n\r\n\t\treturn $this->substituteMarkerArrayCached($template, $markerArray, $subpartArray);\r\n\t}",
"public function createJob(Enlight_Components_Cron_Job $job);",
"public function createJob(Job $job): object;",
"function ComposeMail()\r\n\t{\r\n\t\t$envelope = $this->mail_envelope;\r\n\t\t$body = $this->mail_body;\r\n\t\timap_mail_compose($envelope, $body) or die(\"imap_mail_compose on new mail failed: \" . imap_last_error() . \"<br />\\n\");\r\n\t}",
"private function getJobManifestTemplate()\n {\n $manifest = new Manifest();\n $manifest->setIdentifier('i'.UuidUtil::generate());\n $manifest->setImsManifestMetaData($this->createImsManifestMetaData());\n return $manifest;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build iterator to find buckets in a file hierarchy | protected function getBucketFinderIterator($dirPath) {
$iter = new RecursiveDirectoryIterator($dirPath);
$iter = new RecursiveIteratorIterator($iter, RecursiveIteratorIterator::SELF_FIRST);
$iter = new ForgeUpgrade_BucketFilter($iter);
$iter->setIncludePaths($this->includePaths);
$iter->setExcludePaths($this->excludePaths);
return $iter;
} | [
"function fileScanner()\n { # Generator that yields [fileName, filenameHash]\n // skip BigData Archive Files\n $fileCallback = function ($dir, $file) {\n if (@Packer::$EXCLUDE_FILES[$file])\n return 1;\n };\n // skip directories with BigData Archives\n $dirEntryCallback = function ($dir, $file) {\n if (file_exists(\"$dir/$file/\" . Core::INDEX))\n return 1;\n };\n foreach (Util::fileScanner($this->dir, \"\", $fileCallback, $dirEntryCallback) as $fp) {\n yield [$fp, Core::hash($fp)];\n }\n }",
"public function getIterator()\n {\n \t$it = new AppendIterator();\n \tforeach($this->getPaths() as $path){\n \t\t$directoryIt = new RecursiveDirectoryIterator($path);\n\t\t\t$recursiveIt = new RecursiveIteratorIterator(new FilterIterator($directoryIt, $this->getFilter()));\n\t\t\t$recursiveIt->setMaxDepth($this->getMaxDepth());\n\t\t\t$it->append($recursiveIt);\n \t}\n\t\t\n return $it;\n }",
"public function __construct ($it, $flags = 'RecursiveTreeIterator::BYPASS_KEY', $cit_flags = 'CachingIterator::CATCH_GET_CHILD', $mode = 'RecursiveIteratorIterator::SELF_FIRST') {}",
"public function getIterator(): Generator\n {\n foreach ($this->get() as $file) {\n yield new File($file, true);\n }\n }",
"private function loopFiles()\n {\n $limit = 100;\n $offset = 0;\n $count = 0;\n\n do {\n $count = 0;\n $files = File::get()\n ->limit($limit, $offset)\n ->sort('ID')\n ->exclude('ClassName', $this->folderClasses);\n\n $IDs = $files->getIDList();\n $this->preCacheLiveFiles($IDs);\n\n foreach ($files as $file) {\n yield $file;\n $count++;\n }\n $offset += $limit;\n } while ($count === $limit);\n }",
"public function getIterator() \n {\n return new DirectoryIterator($this->path);\n }",
"private function constructFileArray() {\n $folders = Folder::where('selected', 1)->get();\n\n foreach ($folders as $folder) {\n $this->scanDirectory($folder->path);\n }\n }",
"private function populateDirectories() {\n\t\t$this->directories = array();\n\n\t\t$header = $this->getHeader();\n\t\t$sector = $header->getSectDirStart();\n\n\t\t// NOTE: RB-tree reportedly unreliable in some implementations\n\t\t// so doing straight iterative directory traversal to be safe\n\t\t// http://www.openoffice.org/sc/compdocfileformat.pdf#page=13\n\t\tdo {\n\t\t\t$this->seekSector( $sector );\n\t\t\t$bytes = 0;\n\t\t\tdo {\n\t\t\t\t$dir = new DirectoryEntry( $this->header, $this->handle );\n\t\t\t\t$this->directories[$dir->getName()] = $dir;\n\t\t\t\tif ( $dir->getMse() == DirectoryEntry::STGTY_ROOT ) {\n\t\t\t\t\t$this->rootDir = $dir;\n\t\t\t\t}\n\n\t\t\t\t$bytes += DirectoryEntry::DIRECTORY_ENTRY_LEN;\n\t\t\t} while ( $bytes < $this->header->getSectSize() );\n\n\t\t\t$sector = array_key_exists( $sector, $this->fatChains ) ? $this->fatChains[$sector] : self::ENDOFCHAIN;\n\t\t} while( $sector != self::ENDOFCHAIN );\n\t}",
"public function iterator () {\n\t\t$ret = new \\Array_hx();\n\t\tBalancedTree::iteratorLoop($this->root, $ret);\n\t\treturn new ArrayIterator($ret);\n\t}",
"private function _discover() {\n\n $dir = new DirectoryIterator($this->dirname);\n\n foreach ($dir as $file) {\n\n if ($file->isFile() && !$file->isDot()) {\n\n $filename = $file->getFilename();\n $pathname = $file->getPathname();\n\n if (preg_match('/^(\\d+\\W*)?(\\w+)\\.php$/', $filename, $matches)) {\n require_once($pathname);\n $class = \"{$matches[2]}_{$this->suffix}\";\n $files[$filename] = new $class();\n }\n\n }\n\n }\n\n ksort($files);\n $plugins = array_values($files);\n\n return $plugins;\n\n }",
"private function buckets()\n {\n return [];\n }",
"private function paths(): \\Generator\n {\n foreach ($this->directories() as $root => $directory) {\n foreach ($directory as $file) {\n if (preg_match(self::PATTERN, $file->getFilename()) === 1) {\n yield $root => $file->getPathname();\n }\n }\n }\n }",
"private function generateEntryList(): Generator\n {\n for($i = 0; $i < $this->numFiles; $i++)\n yield $i => $this->getNameIndex($i);\n }",
"public function scan()\n {\n foreach ($this->zipFiles as $zipFile) {\n $zip = new ZipFile($zipFile);\n foreach ($zip->statAll() as $stat) {\n ['name' => $name, 'directory' => $directory] = $stat;\n\n if (!$directory && str::endsWith($name, '.php')) {\n $name = str::sub($name, 0, str::length($name) - 4);\n $name = str::replace($name, '/', '\\\\');\n\n if ($this->isComponent($name)) {\n $this->load($name);\n }\n }\n }\n }\n\n foreach ($this->classPaths as $path) {\n $path = fs::normalize(fs::abs($path));\n\n fs::scan($path, [\n 'extensions' => ['php'],\n 'callback' => function ($file) use ($path) {\n $name = fs::pathNoExt($file);\n $name = str::sub($name, str::length($path));\n $name = str::replace($name, '/', '\\\\');\n\n if ($name[0] === '\\\\') {\n $name = str::sub($name, 1);\n }\n\n if ($this->isComponent($name)) {\n $this->load($name);\n }\n }\n ]);\n }\n }",
"public function getIterator()\n {\n return new ArrayIterator($this->paths);\n }",
"private function scanClassPaths() {\n $dirsToScan = [\n '',\n '/controllers',\n '/library',\n '/src',\n '/models',\n '/modules',\n '/settings/class.hooks.php'\n ];\n\n // Get all the uppercase top level directories (likely namespaces)\n // and add them to the list.\n $rootDir = $this->path('', Addon::PATH_FULL);\n $subDirs = glob($rootDir . '/*', GLOB_ONLYDIR);\n foreach ($subDirs as $subDir) {\n $trimmedDir = basename($subDir);\n $isUppercaseDirName = strlen($trimmedDir) > 0 && ctype_upper($trimmedDir[0]);\n if ($isUppercaseDirName) {\n $dirsToScan[] = \"/\" . $trimmedDir;\n }\n }\n\n\n foreach ($dirsToScan as $dir) {\n foreach ($this->scanDirPhp($dir) as $path) {\n yield $path;\n }\n }\n }",
"function build_blocks( $items, $folder )\r\n{\r\n\tglobal $ignore_file_list, $ignore_ext_list, $sort_by, $toggle_sub_folders, $ignore_empty_folders;\r\n\t\r\n\t$objects = array();\r\n\t$objects['directories'] = array();\r\n\t$objects['files'] = array();\r\n\t\r\n\tforeach($items as $c => $item)\r\n\t{\r\n\t\tif( $item == \"..\" OR $item == \".\") continue;\r\n\t\r\n\t\t// IGNORE FILE\r\n\t\tif(in_array($item, $ignore_file_list)) { continue; }\r\n\t\r\n\t\tif( $folder && $item )\r\n\t\t{\r\n\t\t\t$item = \"$folder/$item\";\r\n\t\t}\r\n\r\n\t\t$file_ext = ext($item);\r\n\t\t\r\n\t\t// IGNORE EXT\r\n\t\tif(in_array($file_ext, $ignore_ext_list)) { continue; }\r\n\t\t\r\n\t\t// DIRECTORIES\r\n\t\tif( is_dir($item) ) \r\n\t\t{\r\n\t\t\t$objects['directories'][] = $item; \r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\t\r\n\t\t// FILE DATE\r\n\t\t$file_time = date(\"U\", filemtime($item));\r\n\t\t\r\n\t\t// FILES\r\n\t\tif( $item )\r\n\t\t{\r\n\t\t\t$objects['files'][$file_time . \"-\" . $item] = $item;\r\n\t\t}\r\n\t}\r\n\t\r\n\tforeach($objects['directories'] as $c => $file)\r\n\t{\r\n\t\t$sub_items = (array) scandir( $file );\r\n\t\t\r\n\t\tif( $ignore_empty_folders )\r\n\t\t{\r\n\t\t\t$has_sub_items = false;\r\n\t\t\tforeach( $sub_items as $sub_item )\r\n\t\t\t{\r\n\t\t\t\t$sub_fileExt = ext( $sub_item );\r\n\t\t\t\tif( $sub_item == \"..\" OR $sub_item == \".\") continue;\r\n\t\t\t\tif(in_array($sub_item, $ignore_file_list)) continue;\r\n\t\t\t\tif(in_array($sub_fileExt, $ignore_ext_list)) continue;\r\n\t\t\t\r\n\t\t\t\t$has_sub_items = true;\r\n\t\t\t\tbreak;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif( $has_sub_items ) echo display_block( $file );\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\techo display_block( $file );\r\n\t\t}\r\n\t\t\r\n\t\tif( $toggle_sub_folders )\r\n\t\t{\r\n\t\t\tif( $sub_items )\r\n\t\t\t{\r\n\t\t\t\techo \"<div class='sub' data-folder=\\\"$file\\\">\";\r\n\t\t\t\tbuild_blocks( $sub_items, $file );\r\n\t\t\t\techo \"</div>\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t// SORT BEFORE LOOP\r\n\tif( $sort_by == \"date_asc\" ) { ksort($objects['files']); }\r\n\telseif( $sort_by == \"date_desc\" ) { krsort($objects['files']); }\r\n\telseif( $sort_by == \"name_asc\" ) { natsort($objects['files']); }\r\n\telseif( $sort_by == \"name_desc\" ) { arsort($objects['files']); }\r\n\t\r\n\tforeach($objects['files'] as $t => $file)\r\n\t{\r\n\t\t$fileExt = ext($file);\r\n\t\tif(in_array($file, $ignore_file_list)) { continue; }\r\n\t\tif(in_array($fileExt, $ignore_ext_list)) { continue; }\r\n\t\techo display_block( $file );\r\n\t}\r\n}",
"function scan_blacklist_cat($curdir, $key_name, &$cat_array)\n{\n\n if (file_exists($curdir) and is_dir($curdir)) {\n $blk_entry = array();\n $files = scan_dir($curdir);\n\n foreach($files as $fls) {\n $fls_file = \"$curdir/$fls\";\n\n if (($fls != \".\") and ($fls != \"..\")) {\n if (is_file($fls_file)) {\n\n # add files path\n switch(strtolower($fls)) {\n case \"domains\":\n $blk_entry[\"domains\"] = $fls_file;\n $blk_entry[\"path\"] = $curdir;\n break;\n case \"urls\":\n $blk_entry[\"urls\"] = $fls_file;\n $blk_entry[\"path\"] = $curdir;\n break;\n case \"expressions\":\n $blk_entry[\"expressions\"] = $fls_file;\n $blk_entry[\"path\"] = $curdir;\n break;\n }\n }\n elseif (is_dir($fls_file)) {\n $fls_key = $key_name . \"_\" . $fls;\n\n # recursive call\n scan_blacklist_cat($fls_file, $fls_key, $cat_array);\n }\n }\n }\n\n if (count($blk_entry))\n $cat_array[$key_name] = $blk_entry;\n }\n}",
"public function getInnerIterator () {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Will call the /sites/menu and write it to disk. The generation of the menu can take a couple of minutes | function generate_menu() {
$msg = 'Success!';
try {
$menu = $this->Species->find_species_types_exps();
file_put_contents(CACHE . 'menu.array', serialize($menu));
} catch (Exception $ex) {
$msg = $ex;
}
$this->Session->setFlash($msg);
} | [
"function create_SitemenModmenu_CacheFile($image_path,$site_id)\n{\n\n\tglobal $db;\n\t$consolecache_path = $image_path.'/cache';\n\t$file_path = $image_path .'/settings_cache';\n\tif(!file_exists($file_path))\n\t\tmkdir($file_path);\n\t\t\n\t// Case of writing Site menu\t\n\t$file_name = $file_path.'/site_menu.php';\n\t// Open the file in write mod \n\t$fp = fopen($file_name,'w');\n\tfwrite($fp,'<?php'.\"\\n\");\n\t// get the details from general_settings_site_pricedisplay\n\t$sql_menu = \"SELECT a.feature_modulename \n\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\tfeatures a,site_menu b \n\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\tb.sites_site_id=$site_id \n\t\t\t\t\t\t\t\tAND a.feature_id = b.features_feature_id \n\t\t\t\t\t\t\t\tAND a.feature_hide = 0\";\n\t$ret_menu = $db->query($sql_menu);\n\tif($db->num_rows($ret_menu))\n\t{\n\t\twhile ($row_menu = $db->fetch_array($ret_menu))\n\t\t{\n\t\t\tif(trim($row_menu['feature_modulename'])!='')\n\t\t\t\tfwrite($fp,'$inlineSiteComponents_Arr[] = \"'. addslashes(stripslashes($row_menu['feature_modulename'])).'\";'.\"\\n\");\n\t\t}\n\t}\n\tfwrite($fp,'?>');\t\t\n\tfclose($fp);\t\n\t\n\t// Case of writing Mod menu\t\n\t$file_name = $file_path.'/mod_menu.php';\n\t// Open the file in write mod \n\t$fp = fopen($file_name,'w');\n\tfwrite($fp,'<?php'.\"\\n\");\n\t// get the details from general_settings_site_pricedisplay\n\t$sql_menu = \"SELECT a.feature_modulename \n\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\tfeatures a,mod_menu b \n\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\tb.sites_site_id=$site_id \n\t\t\t\t\t\t\t\tAND a.feature_id = b.features_feature_id \n\t\t\t\t\t\t\t\tAND a.feature_hide = 0\";\n\t$ret_menu = $db->query($sql_menu);\n\tif($db->num_rows($ret_menu))\n\t{\n\t\twhile ($row_menu = $db->fetch_array($ret_menu))\n\t\t{\n\t\t\tif(trim($row_menu['feature_modulename'])!='')\n\t\t\t\tfwrite($fp,'$consoleSiteComponents_Arr[] = \"'. addslashes(stripslashes($row_menu['feature_modulename'])).'\";'.\"\\n\");\n\t\t}\n\t}\n\tfwrite($fp,'?>');\t\t\n\tfclose($fp);\t\n\t$console_menu = $consolecache_path.'/console_menu.txt';\n\tif (file_exists($console_menu))\n\t\tunlink($console_menu);\n}",
"public function save_menu_web()\n\t{\n\t\t$do_save = $this->Msetting->save_menu();\n\n\t\techo 'Data menu sudah disimpan';\n\t}",
"public function exportMenus()\n\t{\n\t\t$menus = Menu::orderBy('cms', 'desc')->orderBy('name')->get();\n\t\t$array = [];\n\n\t\tforeach ($menus as $menu)\n\t\t{\n\t\t\t$array[str_replace(' ', '_', strtolower($menu->name))] = $menu->createArray(false, true);\n\t\t}\n\n\t\t$path = config_path('exported/menus.php');\n\n\t\tArrayFile::save($path, $array);\n\t}",
"public function ssw_menu() {\n\t\t\t/*\tAdding Menu item \"Create Site\" in Dashboard, allowing it to be displayed for all users including\n\t\t\t\tsubscribers with \"read\" capability and displaying it above the Dashboard with position \"1.7\"\n\t\t\t*/\n\t\t\tadd_menu_page('Site Setup Wizard', 'Create Site', 'read', SSW_CREATE_SITE_SLUG,\n\t\t\t\tarray( $this, 'ssw_create_site' ), plugins_url(SSW_PLUGIN_FIXED_DIR.'/images/icon.png'), '1.38');\n\t\t}",
"protected function generateMenu() {}",
"public function savemenu()\n\t{\n\t\tif (!$this->auth($_SESSION['leveluser'], 'menumanager', 'create')) {\n\t\t\techo $this->pohtml->error();\n\t\t\texit;\n\t\t}\n\t\tinclude_once '../'.DIR_CON.'/component/menumanager/modules/menu.php';\n\t\t$instance = new Menu;\n\t\t$instance->save();\n\t}",
"function addSiteLinks()\n {\n if (is_readable($this->_menufile)) {\n include $this->_menufile;\n if (isset($_menu) && is_array($_menu)) {\n foreach ($_menu as $menuitem) {\n $this->addArray($menuitem);\n }\n }\n }\n }",
"function procMenuAdminMakeXmlFile()\n\t{\n\t\t// Check input value\n\t\t$menu_srl = Context::get('menu_srl');\n\t\t// Get information of the menu\n\t\t$oMenuAdminModel = getAdminModel('menu');\n\t\t$menu_info = $oMenuAdminModel->getMenu($menu_srl);\n\t\t$menu_title = $menu_info->title;\n\t\t// Re-generate the xml file\n\t\t$xml_file = $this->makeXmlFile($menu_srl);\n\t\t// Set return value\n\t\t$this->add('menu_title',$menu_title);\n\t\t$this->add('xml_file',$xml_file);\n\t}",
"function menuSite(){\n\t\t//$this->configs = get_class_vars('MAIN_CONFIG');\n\t\t$this->themesdir = URL.'libs/themes/';\n\t\t$this->libjsurl = URL.'libs/menulibs/libjs/';\n\t\t$this->menulibs = './libs/menulibs/';\n\t\t$this->libjsdir = 'libs/menulibs/libjs/';\n\t\t$this->menuString =\"\";\n\t}",
"public function save(Menu $menu): void;",
"protected function installMenus()\n\t{\n\t\t$file = app_path('menus.php');\n\t\tif( ! file_exists($file))\n\t\t{\n\t\t\t$contents = $this->laravel['files']->get(__DIR__.'/stubs/menus.txt');\n\n\t\t\t$this->laravel['files']->put($file, $contents);\n\t\t}\t\t\n\t}",
"function create_page_menu($nid, $menu_name, $menu_title) {\n\n $menu = array(\n 'title' => $menu_title,\n 'description' => '',\n 'menu_name' => $menu_name,\n );\n\n custom_menu_save($menu);\n // Only get links from active revisios \n $result = db_query(\"SELECT field_landing_links_url url, field_landing_links_title title FROM {content_field_landing_links} l, node n WHERE l.nid=$nid AND l.vid=n.vid\");\n\n\n $weight = 0;\n while ($row = db_fetch_object($result)) {\n // Change absolute URLs on local site to relative\n if (strpos($row->url, 'eoss')) {\n $row->url = rtrim($row->url, '/');\n $path = ltrim(parse_url($row->url, PHP_URL_PATH), '/');\n //echo 'Path: ' . $path . \"\\n\";\n $link_path = db_result(db_query(\"SELECT src from {url_alias} WHERE dst='%s'\",$path));\n }\n else {\n $link_path = $row->url;\n $router_path = NULL;\n }\n //echo 'Link_path: ';\n //var_dump($link_path);\n //echo \"\\n\";\n $item = array(\n 'menu_name' => $menu_name,\n 'link_title' => $row->title,\n 'router_path' => $path,\n 'link_path' => $link_path,\n 'mlid' => 0,\n 'plid' => 0,\n 'weight' => $weight,\n );\n\n //echo 'Menu Link';\n //var_dump($item);\n menu_link_save($item);\n $weight++;\n }\n}",
"private static function _createHelpSystemsMenu()\n {\n $html = '<div class=\"Help-systemsMenu\"><ul>';\n $systemInfos = array();\n\n foreach (self::$_docsInfo as $systemName => $docsInfo) {\n $systemTitle = $systemName;\n if (empty($docsInfo['screenTitle']) === FALSE) {\n $systemTitle = $docsInfo['screenTitle'];\n }\n\n $systemInfos[$systemName] = array('title' => $systemTitle);\n\n if ($docsInfo['showInMenu'] === FALSE) {\n // Not shown in the menu so continue.\n continue;\n }\n\n // Small icon for the system.\n $iconURL = '/__web/Systems/'.$systemName.'/Web/icon_'.strtolower($systemName).'_help.png';\n\n $href = 'Help.closeMenu();Help.loadIndexPage(\\''.$systemName.'\\');';\n $html .= '<li onclick=\"'.$href.'\" id=\"Help-dialog-sysMenuItem-'.$systemName.'\" >';\n $html .= '<a href=\"javascript:'.$href.'\">'.$systemTitle.'</a>';\n $html .= '<div class=\"Help-systemsMenu-selectedIcon\"></div>';\n $html .= '</li>';\n }//end foreach\n\n $html .= '</ul></div>';\n\n // Also add script tag that will set the systemName => title array in Help.\n $html .= '<script>Help.setSystems('.json_encode($systemInfos).')</script>';\n\n $filePath = Help::getDocsDirectory().'/_systems_menu.html';\n include_once 'Libs/FileSystem/FileSystem.inc';\n FileSystem::filePutContents($filePath, $html);\n\n }",
"function setMenu() {\n\trequire('tpl/menu.php');\n}",
"private function saveMenu()\n\t\t{\n\t\t\t$id = (int)$_REQUEST['id'];\n\t\t\t$name = FN::sanitise($_REQUEST['name']);\n\t\t\t$value = NULL;\n\t\t\t$index = 0;\n\t\t\twhile (TRUE)\n\t\t\t{\n\t\t\t\tif (isset($_REQUEST[\"item$index\"]))\n\t\t\t\t{\n\t\t\t\t\tif (isset($_REQUEST['toDelete']) && $_REQUEST['toDelete'] == $index)\n\t\t\t\t\t{\n\t\t\t\t\t\t$index++;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$template = FN::sanitise($_REQUEST[\"template$index\"]);\n\t\t\t\t\t$item = FN::sanitise($_REQUEST[\"item$index\"]);\n\t\t\t\t\tif ($value) $value .= \"\\n\";\n\t\t\t\t\t$value .= \"$template,$item\";\n\t\t\t\t\t$index++;\n\t\t\t\t}\n\t\t\t\telse break;\n\t\t\t}\n\t\t\tDB::update(\"menu\", array(\n\t\t\t\t\"name\"=>$name,\n\t\t\t\t\"value\"=>$value,\n\t\t\t\t\"user\"=>0,\n\t\t\t\t\"timestamp\"=>time(),\n\t\t\t\t\"attributes\"=>NULL\n\t\t\t\t), \"WHERE id=$id\");\n\t\t}",
"function baidu_sitemap_menu() {\n /** Add a page to the options section of the website **/\n if (current_user_can('manage_options')) \t\t\t\t\n \t\tadd_options_page(\"Baidu-Sitemap\",\"Baidu-Sitemap\", 8, __FILE__, 'baidu_sitemap_optionpage');\n}",
"function generate_sitemap()\n\t{\n\t\t$result = '';\n\n\t\t$site_url = \\lib\\router::get_storage('url_site');\n\t\t$result .= \"<pre>\";\n\t\t$result .= $site_url.'<br/>';\n\t\t$sitemap = new \\lib\\utility\\sitemap($site_url , root.'public_html/', 'sitemap' );\n\t\t$counter =\n\t\t[\n\t\t\t'pages' => 0,\n\t\t\t'polls' => 0,\n\t\t\t'posts' => 0,\n\t\t\t'helps' => 0,\n\t\t\t'attachments' => 0,\n\t\t\t'otherTypes' => 0,\n\t\t\t'terms' => 0,\n\t\t\t// 'cats' => 0,\n\t\t\t// 'otherTerms' => 0,\n\t\t];\n\n\t\t// --------------------------------------------- Static pages\n\n\t\t// add list of static pages\n\t\t$sitemap->addItem('', '1', 'daily');\n\n\n\t\t$sitemap->addItem('about', '0.6', 'weekly');\n\t\t$sitemap->addItem('social-responsibility', '0.6', 'weekly');\n\t\t$sitemap->addItem('help', '0.4', 'daily');\n\t\t$sitemap->addItem('help/faq', '0.6', 'daily');\n\n\t\t$sitemap->addItem('benefits', '0.6', 'weekly');\n\t\t$sitemap->addItem('pricing', '0.6', 'weekly');\n\t\t$sitemap->addItem('terms', '0.4', 'weekly');\n\t\t$sitemap->addItem('privacy', '0.4', 'weekly');\n\t\t$sitemap->addItem('changelog', '0.5', 'daily');\n\t\t$sitemap->addItem('contact', '0.6', 'weekly');\n\t\t$sitemap->addItem('logo', '0.8', 'monthly');\n\t\t$sitemap->addItem('for/school', '0.8', 'monthly');\n\n\n\n\n\t\t// PERSIAN\n\t\t// add all language static page automatically\n\t\t// we must detect pages automatically and list static pages here\n\t\t$lang_data = \\lib\\option::$language;\n\t\tif(isset($lang_data['list']))\n\t\t{\n\t\t\tforeach ($lang_data['list'] as $key => $myLang)\n\t\t\t{\n\t\t\t\tif(isset($lang_data['default']) && $myLang === $lang_data['default'])\n\t\t\t\t{\n\t\t\t\t\t// do nothing\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$sitemap->addItem( $myLang, '1', 'daily');\n\t\t\t\t\t// add static pages of persian\n\t\t\t\t\t$sitemap->addItem( $myLang. '/about', '0.8', 'weekly');\n\t\t\t\t\t$sitemap->addItem( $myLang. '/social-responsibility', '0.8', 'weekly');\n\t\t\t\t\t$sitemap->addItem( $myLang. '/help', '0.6', 'daily');\n\t\t\t\t\t$sitemap->addItem( $myLang. '/help/faq', '0.8', 'daily');\n\n\t\t\t\t\t$sitemap->addItem( $myLang. '/benefits', '0.8', 'weekly');\n\t\t\t\t\t$sitemap->addItem( $myLang. '/pricing', '0.8', 'weekly');\n\t\t\t\t\t$sitemap->addItem( $myLang. '/terms', '0.6', 'weekly');\n\t\t\t\t\t$sitemap->addItem( $myLang. '/privacy', '0.6', 'weekly');\n\t\t\t\t\t$sitemap->addItem( $myLang. '/changelog', '0.7', 'daily');\n\t\t\t\t\t$sitemap->addItem( $myLang. '/contact', '0.8', 'weekly');\n\t\t\t\t\t$sitemap->addItem( $myLang. '/logo', '0.8', 'monthly');\n\t\t\t\t\t$sitemap->addItem( $myLang. '/for/school', '0.8', 'monthly');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t// add posts\n\t\tforeach ($this->model()->sitemap('posts', 'post') as $row)\n\t\t{\n\t\t\t$myUrl = $row['url'];\n\t\t\tif($row['language'] && $row['language'] !== 'en')\n\t\t\t{\n\t\t\t\t$myUrl = $row['language'].'/'. $myUrl;\n\t\t\t}\n\n\t\t\t$sitemap->addItem($myUrl, '0.8', 'daily', $row['publishdate']);\n\t\t\t$counter['posts'] += 1;\n\t\t}\n\n\t\t// // add poll\n\t\t// foreach ($this->model()->sitemap('posts', 'poll') as $row)\n\t\t// {\n\t\t// \t$myUrl = $row['url'];\n\t\t// \tif($row['language'] && $row['language'] !== 'en')\n\t\t// \t{\n\t\t// \t\t$myUrl = $row['language'].'/'. $myUrl;\n\t\t// \t}\n\n\t\t// \tif(isset($row['privacy']) && $row['privacy'] === 'public')\n\t\t// \t{\n\t\t// \t\t$sitemap->addItem($myUrl, '0.8', 'daily', $row['publishdate']);\n\t\t// \t\t$counter['polls'] += 1;\n\t\t// \t}\n\t\t// }\n\n\t\t// add pages\n\t\tforeach ($this->model()->sitemap('posts', 'page') as $row)\n\t\t{\n\t\t\t$myUrl = $row['url'];\n\t\t\tif($row['language'] && $row['language'] !== 'en')\n\t\t\t{\n\t\t\t\t$myUrl = $row['language'].'/'. $myUrl;\n\t\t\t}\n\n\t\t\t$sitemap->addItem($myUrl, '0.6', 'weekly', $row['publishdate']);\n\t\t\t$counter['pages'] += 1;\n\t\t}\n\n\t\t// add helps\n\t\tforeach ($this->model()->sitemap('posts', 'helps') as $row)\n\t\t{\n\t\t\t$myUrl = $row['url'];\n\t\t\tif($row['language'] && $row['language'] !== 'en')\n\t\t\t{\n\t\t\t\t$myUrl = $row['language'].'/'. $myUrl;\n\t\t\t}\n\n\t\t\t$sitemap->addItem($myUrl, '0.3', 'monthly', $row['publishdate']);\n\t\t\t$counter['helps'] += 1;\n\t\t}\n\n\t\t// // add attachments\n\t\t// foreach ($this->model()->sitemap('posts', 'attachment') as $row)\n\t\t// {\n\t\t// \t$myUrl = $row['url'];\n\t\t// \tif($row['language'] && $row['language'] !== 'en')\n\t\t// \t{\n\t\t// \t\t$myUrl = $row['language'].'/'. $myUrl;\n\t\t// \t}\n\n\t\t// \t$sitemap->addItem($myUrl, '0.2', 'weekly', $row['publishdate']);\n\t\t// \t$counter['attachments'] += 1;\n\t\t// }\n\n\t\t// add other type of post\n\t\tforeach ($this->model()->sitemap('posts', false) as $row)\n\t\t{\n\t\t\t$myUrl = $row['url'];\n\t\t\tif($row['language'] && $row['language'] !== 'en')\n\t\t\t{\n\t\t\t\t$myUrl = $row['language'].'/'. $myUrl;\n\t\t\t}\n\n\t\t\t$sitemap->addItem($myUrl, '0.5', 'weekly', $row['publishdate']);\n\t\t\t$counter['otherTypes'] += 1;\n\t\t}\n\n\t\t// add cats and tags\n\t\t// foreach ($this->model()->sitemap('terms') as $row)\n\t\t// {\n\t\t// \t$myUrl = $row['term_url'];\n\t\t// \tif($row['term_language'])\n\t\t// \t{\n\t\t// \t\t$myUrl = $row['term_language'].'/'. $myUrl;\n\t\t// \t}\n\n\n\t\t// \t$sitemap->addItem($myUrl, '0.4', 'weekly', $row['datemodified']);\n\t\t// \t$counter['terms'] += 1;\n\t\t// }\n\n\t\t$sitemap->createSitemapIndex();\n\t\t$result .= \"</pre>\";\n\t\t$result .= \"<p class='alert alert-success'>\". T_('Create sitemap Successfully!').\"</p>\";\n\n\t\tforeach ($counter as $key => $value)\n\t\t{\n\t\t\t$result .= \"<br/>\";\n\t\t\t$result .= T_($key). \" <b>\". $value.\"</b>\";\n\t\t}\n\n\t\treturn $result;\n\t}",
"function crear_menu(){\r\n add_menu_page('Descarga CSV', 'Descarga Encuesta', 'activate_plugins', 'descarga_csv', 'funcion_descarga', '\r\ndashicons-download', 7);\r\n}",
"function adminMenu() {\r\n\t\t// TODO: This does not only create the menu, it also (only?) *does* sth. with the entries.\r\n\t\t// But those actions must be done before the menu is created (due to the redirects).\r\n\t\t// !Split the function!\r\n\t\t//$page = add_submenu_page('admin.php', __('UWR Ergebnisse'), __('UWR Ergebnisse'), 'edit_posts', 'uwr1results', array('Uwr1resultsController', 'adminAction'));\r\n\t\t$page = add_submenu_page('uwr1menu', __('UWR Ergebnisse'), __('UWR Ergebnisse'), UWR1RESULTS_CAPABILITIES, 'uwr1results', array('Uwr1resultsController', 'adminAction'));\r\n\t\tadd_action( 'admin_print_scripts-' . $page, array('Uwr1resultsView', 'adminScripts') );\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Temporadas compradas por usuario [Se filtra por el ID del usuario] | public function temporadascompradas($id){
$users = Usuario::find($id);
if (is_null($users)) {
return $this->sendError('Usuario no encontrado');
}
$temporadas = Usuario::with('venta_temporadas')
->where('usuario.email',$id)->get();
$temporadas_p = compact('temporadas');
return $this->sendResponse($temporadas_p, 'Temporadas compradas devueltas con éxito');
} | [
"function perfilUsuario( $id = null ) {\r\n\t// Retorna uma array unificada com todos os campos do user data e meta, junto com status, função e campos necessários à sincronização com o SAP\r\n\t// @requer obterUsuario, funcaoDesteUsuario, usuarioEstaAtivo, mapMeta, obterItem\r\n\t$perfil = array();\r\n\t$user = obterUsuario( $id );\r\n\tif ( !$user )\r\n\t\treturn $perfil;\r\n\t$perfil += get_object_vars( $user->data );\r\n\t$user_meta = array_map( 'mapMeta', get_user_meta( $user->ID ) );\r\n\t$perfil += $user_meta;\r\n\t$perfil['funcao'] = funcaoDesteUsuario( $user );\r\n\t$user_status = usuarioEstaAtivo( $user, true );\r\n\t$perfil += $user_status;\r\n\t$perfil['endereco_completo'] = $perfil['endereco'] . ( $perfil['complemento']\r\n\t\t? ', ' . $perfil['complemento'] // formatarEndereco( $perfil, false );\r\n\t\t: ''\r\n\t);\r\n\tif ( isset( $perfil['empresa'] ) ) {\r\n\t\t$empresa = get_userdata( $perfil['empresa'] );\r\n\t\t$perfil['empresa_nome'] = $empresa->display_name;\r\n\t\t$perfil['empresa_tipo_associacao'] = get_user_meta( $perfil['empresa'], 'tipo_associacao', true );\r\n\t\t$perfil['representante1'] = get_user_meta( $perfil['empresa'], 'representante1', true );\r\n\t\t$rep1 = get_userdata( $perfil['representante1'] );\r\n\t\t$perfil['representante1_login'] = $rep1->user_login;\r\n\t\t$perfil['representante1_telefone'] = get_user_meta( $perfil['representante1'], 'telefone', true );\r\n\t}\r\n\treturn $perfil;\r\n}",
"function obenerUsuariosCompletos() {\n\t\t//Obtener todos los usuarios\n\t\t$_listaUsuarios = array();\n\t\t$_usuarios = $this->obtenerUsuarios();\n\t\tif (!is_array($_usuarios) && !property_exists($_usuarios, 'error')) {\n\t\t\t$_listaUsuarios[] = $_usuarios;\n\t\t} elseif (is_array($_usuarios)) {\n\t\t\t$_listaUsuarios = $_usuarios;\n\t\t} else {\n\t\t\treturn new Error('Error fatal: No se pudieron obtener los usuarios. Por favor contacte al administrador.', $_usuarios->obtenerError());\n\t\t}\n\t\t\n\t\t//Obtener Estados de usuario\n\t\t$_listaEstadosUsuario = array();\t\t\t\n\t\t$_estadoUsuarios = $this->obtenerEstadoUsuarios();\n\t\tforeach ($_estadoUsuarios as $llave => $valor) {\n\t\t\t$_listaEstadosUsuario[$valor->id] = $valor->nombre;\n\t\t}\n\t\t\n\t\t//Obtener Roles de usuario\n\t\t$_listaRolesUsuario = array();\n\t\t$roles = $this->obtenerRoles();\n\t\tforeach ($roles as $llave => $valor) {\n\t\t\t$_listaRolesUsuario[$valor->id] = $valor->nombre;\n\t\t}\n\t\t\n\t\t//Agregar a cada usuario su nombre de Estado y su nombre de Rol \n\t\tforeach ($_listaUsuarios as $llave => $valor) {\n\t\t\t$valor = (array)$valor;\n\t\t\t$valor['estadoUsuario'] = $_listaEstadosUsuario[$valor['estadoUsuarioId']];\n\t\t\t$valor['rol'] = $_listaRolesUsuario[$valor['rolId']];\n\t\t\t$valor = (object)$valor;\n\t\t\t$_listaUsuarios[$llave] = $valor;\n\t\t}\n\t\treturn $_listaUsuarios;\n\t}",
"function dameUsuariosFabricaToro(){\n $consultaSql = \"select * from usuarios where activo=1 and id_tipo=1 or id_almacen=2\";\n $this->setConsulta($consultaSql);\n $this->ejecutarConsulta();\n return $this->getResultados();\n }",
"public function cambia_datos_usuario() {\n\t\t$usuario = $this -> ssouva -> login();\n\t\t$datos[\"usuario\"] = $usuario;\n\n\t\t// Cosas de sesiones y si es admin o no\n\t\tif ($this -> admin_model -> es_admin($usuario)>0) {\n\t\t\t$idu = $this -> input -> post(\"idu\");\n\t\t\t$nombre = $this -> input -> post(\"nombre\");\n\t\t\t$apellidos = $this -> input -> post(\"apellidos\");\n\t\t\t$login = $this -> input -> post(\"login\");\n\t\t\t$password = $this -> input -> post(\"password\");\n\t\t\t$direccion = $this -> input -> post(\"direccion\");\n\t\t\t$tlf = $this -> input -> post(\"tlf\");\n\t\t\t$email = $this -> input -> post(\"email\");\n\t\t\t$verificado = $this -> input -> post(\"verificado\");\n\n\t\t\t$this -> usuarios_model -> updatea_user($idu, $nombre, $apellidos, $login, $password, $direccion, $tlf, $email, $verificado);\n\t\t\t// Y recargamos los datos\n\t\t\t$datos[\"denuncias\"] = $this -> comentarios_model -> hay_denuncias();\n\t\t\t$datos[\"usuarios_no\"] = $this -> usuarios_model -> usuarios_no_activados();\n\t\t\t$datos[\"pisos_no\"] = $this -> pisos_model -> mostar_pisos_no_validados();\n\t\t\t$this -> load -> view(\"doc/index\", $datos);\n\t\t}\n\t}",
"public function colecaoUsuarioTarefas()\n\t{\n\t\t$query = $this->db->prepare(\"select usuarios.id as idUsuario, tarefas.id as idTarefas, \n nome, login, perfil, usuarios.dataCadastro as usuarioDataDoCadastro,\n titulo, texto, tarefas.dataCadastro as tarefasDataDoCadastro,\n situacao, dataAcao, criadorDaTarefa, vinculoUsuario \n from usuarios join tarefas on tarefas.criadorDaTarefa = \n usuarios.id order by tarefas.id desc\");\n\t\t\n $query->execute();\n\t\treturn $query->fetchAll(PDO::FETCH_OBJ);\n\t}",
"function guardarCambios() {\n\t\t// Si el id_usuario es NULL lo toma como un nuevo usuario\n\t\tif($this->id_usuario == NULL) {\n\t\t\t// Comprueba si coinciden las contraseñas\n\t\t\tif (!$this->contraseñasDistintas())\t{\n\t\t\t\t// Comprueba si hay otro usuario con el mismo nombre\n\t\t\t\t\tif(!$this->comprobarUsuarioDuplicado()) {\n\t\t\t\t\t\t$consulta = sprintf(\"insert into usuarios (usuario,email,password,fecha_creacion,fecha_login,bloqueado,activo) value (%s,%s,%s,current_timestamp,current_timestamp,0,1)\",\n\t\t\t\t\t\t$this->makeValue($this->usuario, \"text\"),\n\t\t\t\t\t\t$this->makeValue($this->email, \"text\"),\n\t\t\t\t\t\t$this->makeValue($this->pass, \"text\"));\n\t\t\t\t\t\t$this->setConsulta($consulta);\n\t\t\t\t\t\tif($this->ejecutarSoloConsulta()) {\n\t\t\t\t\t\t\t$this->id_usuario = $this->getUltimoID();\n\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn 3;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn 2;\n\t\t\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn 5;\n\t\t\t\t}\n\t\t} else {\n\t\t\t// Comprueba si coinciden las contraseñas\n\t\t\tif (!$this->contraseñasDistintas())\t{\n\t\t\t\tif(!$this->comprobarUsuarioDuplicado()) {\n\t\t\t\t\t$consulta = sprintf(\"update usuarios set usuario=%s, email=%s,password=%s where id_usuario=%s\",\n\t\t\t\t $this->makeValue($this->usuario, \"text\"),\n\t\t\t\t $this->makeValue($this->email, \"text\"),\n\t\t\t\t $this->makeValue($this->pass, \"int\"),\n\t\t\t\t $this->makeValue($this->id_usuario, \"int\"));\n\t\t\t\t\n\t\t\t\t\t$this->setConsulta($consulta);\n\t\t\t\t\tif($this->ejecutarSoloConsulta()) {\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn 4;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn 2;\n\t\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn 5;\n\t\t\t}\n\t\t}\n\t}",
"public function cargarUsuarios(){\n\t\t$usuarios = new usuario();\n\t\t$usuarios->search_clause = '1';\n\t\t$this->usuarios = $usuarios->read('id,email,password,nombre,tipo_usuario');\n\t}",
"public function buscarId( ){\n\t\t$sql = \"SELECT DISTINCT U.idusuario, U.nombres, U.apellidos, U.usuario, R.idrol, R.nombrerol\n\t\t\t\tFROM usuario U\n\t\t\t\tINNER JOIN usuariofacultad UF ON ( UF.usuario = U.usuario )\n\t\t\t\tINNER JOIN UsuarioTipo UT ON (UT.UsuarioId = U.idusuario)\n INNER JOIN usuariorol UR ON (UR.idusuariotipo = UT.UsuarioTipoId)\n\t\t\t\tINNER JOIN rol R ON ( R.idrol = UR.idrol )\n\t\t\t\tWHERE U.idusuario = ?\n\t\t\t\tAND U.codigorol = 13\";\n\t\t\t\t\n\t\t$this->persistencia->crearSentenciaSQL( $sql );\n\t\t$this->persistencia->setParametro( 0 , $this->getId( ) , false );\n\t\t$this->persistencia->ejecutarConsulta( );\n\t\tif( $this->persistencia->getNext( ) ){\n\t\t\t$this->setId( $this->persistencia->getParametro( \"idusuario\" ) );\n\t\t\t$this->setNombres( $this->persistencia->getParametro( \"nombres\" ) );\n\t\t\t$this->setApellidos( $this->persistencia->getParametro( \"apellidos\" ) );\n\t\t\t$this->setUser( $this->persistencia->getParametro( \"usuario\" ) );\n\t\t\t\n\t\t\t$rol = new Rol( null );\n\t\t\t$rol->setId( $this->persistencia->getParametro( \"idrol\" ) );\n\t\t\t$rol->setNombre( $this->persistencia->getParametro( \"nombrerol\" ) );\n\t\t\t$this->setRol( $rol );\n\t\t}\n\t\t//echo $this->persistencia->getSQLListo( );\n\t\t$this->persistencia->freeResult( );\n\t\t\n\t}",
"public function comprobarUser(){\n $usuario = JFactory::getUser();\n \n // Comprobamos que sea administrador y creamos en User la\n // propiedad de permisoLoteria .\n if (array_search('7',$usuario->getAuthorisedGroups())>0 || array_search('8',$usuario->getAuthorisedGroups())>0 ){\n // Indicamos que tienes permiso ver loteria.\n JFactory::getUser()->set('permisoLoteria','OK');\n \n } else {\n // No deberíamos continuar, debería indicar que no tiene permisos.\n JFactory::getUser()->set('permisoLoteria','KO');\n\n }\n \n return ;\n }",
"function bajarReputacionUsuario($matricula){\n \t}",
"public function getNotasUsuario($idUsuario){\n \t//\tif(!isset($_SESSION)) session_start();\n \t\t\t\t $nota = UsuarioMapper::getNotasUsuario($idUsuario);\n\n \t\t\t\t return $nota;\n \t}",
"static function obtenerUsuarios() {\n self::abrirBD();\n $stmt = self::$conexion->prepare('SELECT usuario.correo, usuario.pwd, usuario.nombre, usuario.apellido, asignarrol.idRol, usuario.edad, usuario.foto , usuario.activo FROM usuario,asignarrol where asignarrol.usuario=usuario.correo');\n if ($stmt->execute()) {\n $result = $stmt->get_result();\n if ($result->num_rows > 0) {\n while ($fila = $result->fetch_assoc()) {\n $u = new Usuario($fila['correo'], $fila['pwd'], $fila['nombre'], $fila['apellido'], $fila['idRol'], $fila['edad'], $fila['foto'], $fila['activo']);\n $v[] = $u;\n }\n }\n } else {\n echo 'fallo';\n }\n $stmt->close();\n self::cerrarBD();\n return $v;\n }",
"public function arreglarPaqueteActivado()\n {\n $users = User::where([\n ['status', '=', 1],\n ['ID', '!=', 1]\n ])->select('ID')->get();\n\n foreach ($users as $user) {\n $this->activarUsuarios($user->ID);\n }\n }",
"private function info_anuncios_user(){\r\n\t//una destinada a anuncios a marcar no aptos, desactivados y borradores\r\n\t$anuncios['no_aptos'] \t = 0;\r\n\t$anuncios['desactivados'] = 0;\r\n\t$anuncios['borradores']\t = 0;\r\n\r\n\t$cols = array('apto','activo');\r\n\t$this->where('ussr',$this->user);\r\n\t$s = $this->get('anuncios', NULL,$cols);\r\n\tforeach ($s as $value) {\r\n\t\tif ($value['apto'] == 0) {\t $anuncios['no_aptos']++;\t\t}\r\n\t\tif ($value['activo'] == 0) { $anuncios['desactivados']++;\t}\r\n\t}\r\n\t$this->reset();\r\n\r\n\t$this->where('ussr',$this->user);\r\n\t$s = $this->get('anuncios_borradores',NULL,'id');\r\n\t$anuncios['borradores'] = count($s);\r\n\t\r\n\treturn $anuncios;\r\n\t//otro destinado a perfil no apto\r\n\r\n\t//otro destinado a paquetes\r\n}",
"public function getUsuarioCreacion( ){\n return $this->usuarioCreacion;\n }",
"public function getRetosUsuario(){ \n return Auth::user()->retos->toJson();\n }",
"public function actualizoDatosUsuario(){\n \n $con = Conne::connect();\n \n try{\n\n $idUsuViejo = $_SESSION['actualizo']->getValue(\"idUsuario\");\n \n //Comprobamos que el usuario no ha cambiado el password\n //Si lo ha cambiado tenemos que generar un hash nuevo\n \n \n if($_SESSION['error'] == ERROR_ACTUALIZAR_USUARIO){\n $password = $_SESSION['actualizo']->getValue('password');\n }else{\n $password = System::generoHash($_SESSION[\"usuRegistro\"]->getValue('password'));\n }\n \n $sqlActualiarUsuario = \" Update \".TBL_USUARIO.\" set nick = :nick, password = :password, email = :email\n where idUsuario = :idUsuario;\";\n $stmActualizarUsuario = $con->prepare($sqlActualiarUsuario); \n $stmActualizarUsuario->bindValue(\":nick\", $this->getValue('nick'), PDO::PARAM_STR);\n \n $stmActualizarUsuario->bindValue(\":password\",$password, PDO::PARAM_STR );\n \n $stmActualizarUsuario->bindValue(\":email\", $this->getValue('email'), PDO::PARAM_STR );\n $stmActualizarUsuario->bindValue(\":idUsuario\", $idUsuViejo, PDO::PARAM_INT);\n \n $sqlActualiarDatos = \"Update \".TBL_DATOS_USUARIO.\" SET \"\n . \"nombre = :nombre, apellido_1= :apellido_1, apellido_2 = :apellido_2,\"\n . \" telefono = :telefono, genero = :genero \"\n . \" where idDatosUsuario = :idDatosUsuario;\"; \n \n $stmActualizarDatos = $con->prepare($sqlActualiarDatos);\n $stmActualizarDatos->bindValue(\":nombre\", $this->getValue('nombre'), pdo::PARAM_STR);\n $stmActualizarDatos->bindValue(\":apellido_1\", $this->getValue('apellido_1'), pdo::PARAM_STR);\n $stmActualizarDatos->bindValue(\":apellido_2\", $this->getValue('apellido_2'), pdo::PARAM_STR);\n $stmActualizarDatos->bindValue(\":telefono\", $this->getValue('telefono'), pdo::PARAM_STR);\n $stmActualizarDatos->bindValue(\":genero\", $this->getValue('genero'), pdo::PARAM_STR);\n $stmActualizarDatos->bindValue(\":idDatosUsuario\", $idUsuViejo, PDO::PARAM_INT);\n \n \n $sqlActualiarDireccion = \"Update \".TBL_DIRECCION. \" SET \"\n .\" calle = :calle, numeroPortal = :numeroPortal, ptr = :ptr, \"\n . \" codigoPostal = :codigoPostal, ciudad = :ciudad, provincia = :provincia, pais = :pais \"\n . \" where idDireccion = :idDireccion;\";\n \n $stmActualizarDireccion = $con->prepare($sqlActualiarDireccion);\n $stmActualizarDireccion->bindValue(\":calle\", $this->data[\"calle\"], PDO::PARAM_STR);\n $stmActualizarDireccion->bindValue(\":numeroPortal\", $this->data[\"numeroPortal\"], PDO::PARAM_STR);\n $stmActualizarDireccion->bindValue(\":ptr\", $this->data[\"ptr\"], PDO::PARAM_STR);\n $stmActualizarDireccion->bindValue(\":codigoPostal\", $this->data[\"codigoPostal\"], PDO::PARAM_STR);\n $stmActualizarDireccion->bindValue(\":ciudad\", $this->data[\"ciudad\"], PDO::PARAM_STR);\n $stmActualizarDireccion->bindValue(\":provincia\", $this->data[\"provincia\"], PDO::PARAM_STR);\n $stmActualizarDireccion->bindValue(\":pais\", $this->data[\"pais\"], PDO::PARAM_STR);\n $stmActualizarDireccion->bindValue(\":idDireccion\", $idUsuViejo, PDO::PARAM_INT);\n \n \n \n $con->beginTransaction(); \n \n $stmActualizarUsuario->execute();\n $stmActualizarDatos->execute();\n $stmActualizarDireccion->execute(); \n \n $con->commit();\n\n Conne::disconnect($con);\n \n \n }catch (Exception $ex){\n \n $con->rollBack();\n $excepciones = new MisExcepcionesUsuario(CONST_ERROR_BBDD_ACTUALIZAR_USUARIO[1],CONST_ERROR_BBDD_ACTUALIZAR_USUARIO[0],$ex);\n $excepciones->redirigirPorErrorSistemaUsuario(\"ActualizarUsuarioBBDD\",true); \n\n \n }finally {\n Conne::disconnect($con);\n \n }\n \n \n}",
"public function buscarcarpeta() {\r\n\t\t\r\n $id2 = Auth::get('id');// este metodo me permite obtener algun dato de la tabla usuario como el nombre o cualquier otro campo\r\n return $this->find_all_by_sql (\"SELECT * FROM `carpeta` WHERE `usuario_id`=\".\"'\".$id2.\"'\");\r\n \r\n\t}",
"private function getListaUsuarioAutorizado()\r\n\t {\r\n\t \treturn [\r\n\t \t\t'adminteq',\r\n\t \t\t'pfranco',\r\n\t \t\t'kperez',\r\n\t \t];\r\n\t }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Outputs a dropdown list of days of the week | function daysList ( $name, $day="" ) {
$value = array('1','2','3','4','5','6','7');
$display = array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
echo '<select name="'.$name.'">'."\n";
echo "\t".'<option value="">select a day</option>'."\n";
for ($i=0; $i<count($value); $i++) {
if ($value[$i]==$day) $selected = ' selected="selected"'; else $selected = '';
echo "\t".'<option value="'.$value[$i].'"'.$selected.'>'.$display[$i].'</option>'."\n";
}
echo '</select>'."\n";
} | [
"function getDays($selDay=\"\"){\n\t\t$strDays = \"\";\n\t\t$strDays = \"<option value=''>00</option>\";\n\t\tfor($ind=1;$ind<=31;$ind++){\n\t\t\tif($ind == $selDay)\n\t\t\t\t$strSel = \"selected\";\n\t\t\telse\n\t\t\t\t$strSel = \"\";\n\t\t\t\t\n\t\t\t$strDays.=\"<option value=\".$ind.\" $strSel>\".(strlen($ind)==1?\"0\".$ind:$ind).\"</option>\";\n\t\t}\n\t\t\n\t\treturn $strDays;\n\t}",
"function getDayDropdown($sel='')\n{\n\t$html ='<option selected=\"selected\" value=\"0\">Day</option>';\n\tfor($d=1; $d<=31; $d++){\n\t\tif($sel == $d)\n\t\t\t$html .= '<option value=\"'.$d.'\" selected=\"selected\">'.$d.'</option>';\n\t\telse\n\t\t\t$html .= '<option value=\"'.$d.'\">'.$d.'</option>';\n\t}\n\treturn $html;\n}",
"public function render_days_settings() {\n\t\t/**\n\t\t * Fires before days settings field.\n\t\t *\n\t\t * @since 1.0\n\t\t */\n\t\tdo_action( 'ptq_admin_before_days_settings' );\n\n\t\tglobal $wp_locale;\n\n\t\t$days = $this->ptq->get_option( 'days', range( 0, 6 ) );\n\n\t\t// If no specific days, check all days\n\t\tif ( ! $days ) {\n\t\t\t$days = range( 0, 6 );\n\t\t}\n\n\t\tfor ( $day_index = 0; $day_index <= 6; $day_index++ ) :\n\t\t\t?>\n\t\t\t<label for=\"ptq-day-<?php echo esc_attr( $day_index ); ?>\"><input type=\"checkbox\" value=\"<?php echo esc_attr( $day_index ); ?>\"<?php checked( in_array( $day_index, $days ) ); ?> id=\"ptq-day-<?php echo esc_attr( $day_index ); ?>\" name=\"ptq_settings[days][]\" /><?php echo $wp_locale->get_weekday( $day_index ); ?></label>\n\t\t\t<br />\n\t\t\t<?php\n\t\tendfor;\n\t\t?>\n\t\t<br />\n\t\t<span class=\"description\"><?php _e( 'Select days of the week when you want queued posts to be published.', 'post-to-queue' ); ?></span>\n\t\t<?php\n\n\t\t/**\n\t\t * Fires after days settings field.\n\t\t *\n\t\t * @since 1.0\n\t\t */\n\t\tdo_action( 'ptq_admin_after_days_settings' );\n\t}",
"protected function renderCalendarDaysOfWeek() {\n\t\t$weekDay = array(\n\t\t\t$this->pi_getLL('sunday'),\n\t\t\t$this->pi_getLL('monday'),\n\t\t\t$this->pi_getLL('tuesday'),\n\t\t\t$this->pi_getLL('wednesday'),\n\t\t\t$this->pi_getLL('thursday'),\n\t\t\t$this->pi_getLL('friday'),\n\t\t\t$this->pi_getLL('saturday')\n\t\t);\n\t\t$week = array();\n\t\tfor ($i = 0; $i <= 6; $i++) {\n\t\t\t$week[] = $weekDay[($i + $this->weekBegins) % 7];\n\t\t}\n\n\t\t$content = '';\n\t\tforeach ($week AS $dayOfWeek) {\n\t\t\t$this->tempCObj->data = array();\n\t\t\t$this->tempCObj->data['dayOfWeek'] = $dayOfWeek;\n\t\t\t$content .= $this->tempCObj->cObjGetSingle($this->confWidget['renderCalendarDaysOfWeek'], $this->confWidget['renderCalendarDaysOfWeek.']);\n\t\t}\n\t\treturn $content;\n\t}",
"function hours_dropdown($dayofweek, $openingtime, $closingtime){\n\t\n\techo \"<select name='$dayofweek-openingtime'>\";\n\t\thours_dropdown_options($openingtime);\n\techo \"</select>\";\n\techo \" - \";\n\techo \"<select name='$dayofweek-closingtime'>\";\n\t\thours_dropdown_options($closingtime);\n\techo \"</select>\";\n\n}",
"function make_calendar_pulldowns()\r\n {\r\n // Make months array and months pull-down menu\r\n $months = array(\r\n 1 => \"January\",\r\n 2 => \"February\",\r\n 3 => \"March\",\r\n 4 => \"April\",\r\n 5 => \"May\",\r\n 6 => \"June\",\r\n 7 => \"July\",\r\n 8 => \"August\",\r\n 9 => \"September\",\r\n 10 => \"October\",\r\n 11 => \"November\",\r\n 12 => \"December\"\r\n );\r\n echo '<select name=\"month\">';\r\n foreach($months as $key => $value)\r\n echo \"<option value=\\\"$key\\\">$value</option>\\n\";\r\n echo '</select>';\r\n \r\n // Make days pull-down menu\r\n echo '<select name=\"day\">';\r\n for($day=1;$day<=31;$day++)\r\n echo \"<option value=\\\"$day\\\">$day</option>\\n\";\r\n echo '</select>';\r\n \r\n // Make years pull-down menu\r\n echo '<select name=\"year\">';\r\n for($year=2008;$year<=2018;$year++)\r\n echo \"<option value=\\\"$year\\\">$year</option>\\n\";\r\n echo '</select>';\r\n }",
"function printDays(){\n $daysOfWeek=array(\"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\", \"Sunday\");\n\n print \"<p>The days of the week in sequence are: </p>\";\n print \"<div id=\\\"days\\\"><ol>\";\n foreach($daysOfWeek as $day){\n echo \"<li>$day</li>\";\n }\n print \"</ol><br></div>\";\n }",
"public function getDropDownsDateHtml()\n {\n $fieldsSeparator = ' ';\n $fieldsOrder = Mage::getSingleton('catalog/product_option_type_date')->getConfigData('date_fields_order');\n $fieldsOrder = str_replace(',', $fieldsSeparator, $fieldsOrder);\n\n $monthsHtml = $this->_getSelectFromToHtml('month', 1, 12);\n $daysHtml = $this->_getSelectFromToHtml('day', 1, 31);\n\n $yearStart = Mage::getSingleton('catalog/product_option_type_date')->getYearStart();\n $yearEnd = Mage::getSingleton('catalog/product_option_type_date')->getYearEnd();\n $yearsHtml = $this->_getSelectFromToHtml('year', $yearStart, $yearEnd);\n\n $translations = array(\n 'd' => $daysHtml,\n 'm' => $monthsHtml,\n 'y' => $yearsHtml\n );\n return strtr($fieldsOrder, $translations);\n }",
"function funcFillWeekDays($iWeekDay) \n{\n\t$arrWeekDays[1] = \"Monday\";\n\t$arrWeekDays[2] = \"Tuesday\";\n\t$arrWeekDays[3] = \"Wednesday\";\n\t$arrWeekDays[4] = \"Thursday\";\n\t$arrWeekDays[5] = \"Friday\";\n\t$arrWeekDays[6] = \"Saturday\";\n\t$arrWeekDays[7] = \"Sunday\";\n\n\tfor ($iLoop = 1;$iLoop < 8;$iLoop++ ) \n\t\tif ( $iLoop == $iWeekDay ) \n\t\t\techo(\"<option value=\\\"$iLoop\\\" selected>$arrWeekDays[$iLoop]</option> \");\n\t\telse \n\t\t\techo(\"<option value=\\\"$iLoop\\\">$arrWeekDays[$iLoop]</option> \");\n}",
"public static function dayOfWeekSelectOptions() {\n return [\n ['value' => '1', 'text' => trans('messages.Monday')],\n ['value' => '2', 'text' => trans('messages.Tuesday')],\n ['value' => '3', 'text' => trans('messages.Wednesday')],\n ['value' => '4', 'text' => trans('messages.Thursday')],\n ['value' => '5', 'text' => trans('messages.Friday')],\n ['value' => '6', 'text' => trans('messages.Saturday')],\n ['value' => '7', 'text' => trans('messages.Sunday')],\n ];\n }",
"function getDayListSpinner($selDay) {\n $options = \"\";\n for ($i = 1; $i < 32; $i++) {\n $selected = ($i == $selDay) ? \"selected\" : \"\";\n $options .= \"<option value='{$i}' {$selected}>$i</option>\";\n }\n return $options;\n}",
"public function getDropDownsDateHtml()\r\n {\r\n $sortOrder = $this->getRequest()->getParam('sortOrder');\r\n $option = $this->getOption();\r\n $fieldsSeparator = ' ';\r\n $fieldsOrder = $this->_catalogProductOptionTypeDate->getConfigData('date_fields_order');\r\n $fieldsOrder = str_replace(',', $fieldsSeparator, $fieldsOrder);\r\n\r\n $monthsHtml = $this->_getSelectFromToHtml('month', 1, 12).'<input type=\"hidden\" name=\"bss-fastorder-options['.$sortOrder.']['.$option->getId().'][month]\" class=\"bss-customoption-select-month\" value=\"\" />';\r\n $daysHtml = $this->_getSelectFromToHtml('day', 1, 31).'<input type=\"hidden\" name=\"bss-fastorder-options['.$sortOrder.']['.$option->getId().'][day]\" class=\"bss-customoption-select-day\" value=\"\" />';\r\n\r\n $yearStart = $this->_catalogProductOptionTypeDate->getYearStart();\r\n $yearEnd = $this->_catalogProductOptionTypeDate->getYearEnd();\r\n $yearsHtml = $this->_getSelectFromToHtml('year', $yearStart, $yearEnd).'<input type=\"hidden\" name=\"bss-fastorder-options['.$sortOrder.']['.$option->getId().'][year]\" class=\"bss-customoption-select-year bss-customoption-select-last\" value=\"\" />';\r\n\r\n $translations = ['d' => $daysHtml, 'm' => $monthsHtml, 'y' => $yearsHtml];\r\n return strtr($fieldsOrder, $translations);\r\n }",
"function print_date_combo($nam,$daysago)\n{\n\t$dat = getdate( time() - ($daysago * 86400) );\n\t\n\t// Days\n\tprint(\"<select size=\\\"1\\\" name=\\\"cmb\" . $nam . \"Day\\\">\\n\");\n\tfor ( $i=1; $i <= 31; $i++ ) {\n\t\t$s = $dat[\"mday\"] == $i ? \"selected\" : \"\";\n\t\tprintf(\"\\t<option value='%d' %s>%02d</option>\\n\",$i,$s,$i);\n\t\t}\n\tprint(\"</select>\\n\");\n\n\t// Months\n\tprint(\"<select size=\\\"1\\\" name=\\\"cmb\" . $nam . \"Month\\\">\\n\");\n\tfor ( $i=1; $i <= 12; $i++ ) {\n\t\t$s = $dat[\"mon\"] == $i ? \"selected\" : \"\";\n\t\tprintf(\"\\t<option value='%d' %s>%02d</option>\\n\",$i,$s,$i);\n\t\t}\n\tprint(\"</select>\\n\");\n\n\t// Years\n\tprint(\"<select size=\\\"1\\\" name=\\\"cmb\" . $nam . \"Year\\\">\\n\");\n\tfor ( $i=2008; $i <= 2009; $i++ ) {\n\t\t$s = $dat[\"year\"] == $i ? \"selected\" : \"\";\n\t\tprintf(\"\\t<option value='%d' %s>%04d</option>\\n\",$i,$s,$i);\n\t\t}\n\tprint(\"</select>\\n\");\n\n}",
"public static function daysofWeekOptions()\r\n\t{\r\n\t\tglobal $lang;\r\n\t\treturn \tarray(''=>$lang['survey_416'], \"DAY\"=>$lang['global_96'], \"WEEKDAY\"=>$lang['global_97'], \"WEEKENDDAY\"=>$lang['global_98'], \r\n\t\t\t\t\t\"SUNDAY\"=>$lang['global_99'], \"MONDAY\"=>$lang['global_100'], \"TUESDAY\"=>$lang['global_101'], \r\n\t\t\t\t\t\"WEDNESDAY\"=>$lang['global_102'], \"THURSDAY\"=>$lang['global_103'], \"FRIDAY\"=>$lang['global_104'],\r\n\t\t\t\t\t\"SATURDAY\"=>$lang['global_105']);\r\n\t}",
"public static function getDayShortList()\n {\n return [1 => _('Mon'), 2 => _('Tue'), 3 => _('Wed'), 4 => _('Thu'), 5 => _('Fri'), 6 => _('Sat'), 7 => _('Sun')];\n }",
"function mkWeekDays()\n{\n\tif ($this->startOnSun)\n\t{\n\t\t$out=\"<tr class=\\\"\".$this->cssWeekDay.\"\\\"><td>\".\"Sem\".\"</td>\";\n\t\t$out.=\"<td>\".$this->getDayName(0).\"</td>\";\n\t\t$out.=\"<td>\".$this->getDayName(1).\"</td>\";\n\t\t$out.=\"<td>\".$this->getDayName(2).\"</td>\";\n\t\t$out.=\"<td>\".$this->getDayName(3).\"</td>\";\n\t\t$out.=\"<td>\".$this->getDayName(4).\"</td>\";\n\t\t$out.=\"<td>\".$this->getDayName(5).\"</td>\";\n\t\t$out.=\"<td>\".$this->getDayName(6).\"</td></tr>\\n\";\n\t}\n\telse\n\t{\n\t\t$out=\"<tr class=\\\"\".$this->cssWeekDay.\"\\\"><td>\".\"Sem\".\"</td>\";\n\t\t$out.=\"<td>\".$this->getDayName(1).\"</td>\";\n\t\t$out.=\"<td>\".$this->getDayName(2).\"</td>\";\n\t\t$out.=\"<td>\".$this->getDayName(3).\"</td>\";\n\t\t$out.=\"<td>\".$this->getDayName(4).\"</td>\";\n\t\t$out.=\"<td>\".$this->getDayName(5).\"</td>\";\n\t\t$out.=\"<td>\".$this->getDayName(6).\"</td>\";\n\t\t$out.=\"<td>\".$this->getDayName(0).\"</td></tr>\\n\";\n\t\t$this->firstday=$this->firstday-1;\n\t\tif ($this->firstday<0)\n\t\t\t$this->firstday=6;\n\t}\n\treturn $out;\n}",
"function weekend_days($days) {\r\n\r\n // set the date picker's attribute\r\n $this->set_attributes(array('view' => $view));\r\n\r\n }",
"public function days_field() {\n\t\tprintf(\n\t\t\t'<input name=\"revision-strike[days]\" id=\"revision-strike-days\" type=\"number\" class=\"small-text\" value=\"%d\" /> %s',\n\t\t\tabsint( $this->get_option( 'days' ) ),\n\t\t\tesc_html_x( 'Days', 'Label for revision-strike[days]', 'revision-strike' )\n\t\t);\n\n\t\tprintf(\n\t\t\t'<p class=\"description\">%s</p>',\n\t\t\tesc_html__(\n\t\t\t\t'A post must be published at least this many days before its revisions can be removed.',\n\t\t\t\t'revision-strike'\n\t\t\t)\n\t\t);\n\t}",
"function make_calendar_pulldowns($d = NULL, $m = NULL, $y = NULL) {\n\t\t\n\t\t$months = array (1 => \"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\");\n\t\t\n\t\techo \"<select name='month'>\";\n\t\tforeach ($months as $key => $value) {\n\t\t\techo \"<option value=\\\"$key\\\"\";\n\t\t\tif ($key == $m) {\n\t\t\t\techo ' selected = \"selected\"';\n\t\t\t}\n\t\t\techo \">$value</option>\\n\";\n\t\t}\n\t\techo \"</select>\";\n\t\t\n\t\techo \"<select name=\\\"day\\\">\";\n\t\tfor ($day = 1; $day <=31; $day++) {\n\t\t\techo \"<option value=\\\"$day\\\"\";\n\t\t\tif ($day == $d) {\n\t\t\t\techo ' selected = \"selected\"';\n\t\t\t}\n\t\t\techo \">$day</option>\\n\";\n\t\t}\n\t\techo \"</select>\";\n\t\t\n\t\techo \"<select name=\\\"year\\\">\";\n\t\t$year = 2005;\n\t\twhile ($year <= 2015) {\n\t\t\techo \"<option value=\\\"$year\\\"\";\n\t\t\tif ($year == $y) {\n\t\t\t\techo ' selected = \"selected\"';\n\t\t\t}\n\t\t\techo \">$year</option>\\n\";\n\t\t\t$year++;\n\t\t}\n\t\techo \"</select>\";\n\t\t\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation crceBundleAdministrationGetByReferenceIdWithHttpInfo returns the requested bundle | public function crceBundleAdministrationGetByReferenceIdWithHttpInfo($id, $correlation_id = null, $transaction_id = null, $user = null)
{
// verify the required parameter 'id' is set
if ($id === null) {
throw new \InvalidArgumentException('Missing the required parameter $id when calling crceBundleAdministrationGetByReferenceId');
}
// parse inputs
$resourcePath = "/bundles/reference/{id}";
$httpBody = '';
$queryParams = [];
$headerParams = [];
$formParams = [];
$_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);
if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept;
}
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);
// header params
if ($correlation_id !== null) {
$headerParams['correlationId'] = $this->apiClient->getSerializer()->toHeaderValue($correlation_id);
}
// header params
if ($transaction_id !== null) {
$headerParams['transactionId'] = $this->apiClient->getSerializer()->toHeaderValue($transaction_id);
}
// header params
if ($user !== null) {
$headerParams['user'] = $this->apiClient->getSerializer()->toHeaderValue($user);
}
// path params
if ($id !== null) {
$resourcePath = str_replace(
"{" . "id" . "}",
$this->apiClient->getSerializer()->toPathValue($id),
$resourcePath
);
}
// default format to json
$resourcePath = str_replace("{format}", "json", $resourcePath);
// for model (json/xml)
if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
} elseif (count($formParams) > 0) {
$httpBody = $formParams; // for HTTP post (form)
}
// this endpoint requires API key authentication
$apiKey = $this->apiClient->getApiKeyWithPrefix('accessKey');
if (strlen($apiKey) !== 0) {
$headerParams['accessKey'] = $apiKey;
}
// make the API Call
try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath,
'GET',
$queryParams,
$httpBody,
$headerParams,
'\iNew\Rest6_1\Model\GetBundleResponse',
'/bundles/reference/{id}'
);
return [$this->apiClient->getSerializer()->deserialize($response, '\iNew\Rest6_1\Model\GetBundleResponse', $httpHeader), $statusCode, $httpHeader];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\iNew\Rest6_1\Model\GetBundleResponse', $e->getResponseHeaders());
$e->setResponseObject($data);
break;
case 400:
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\iNew\Rest6_1\Model\RestError', $e->getResponseHeaders());
$e->setResponseObject($data);
break;
case 500:
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\iNew\Rest6_1\Model\RestError', $e->getResponseHeaders());
$e->setResponseObject($data);
break;
}
throw $e;
}
} | [
"public function crceBundleAdministrationGetWithHttpInfo($bundle_code, $correlation_id = null, $transaction_id = null, $user = null)\n {\n // verify the required parameter 'bundle_code' is set\n if ($bundle_code === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $bundle_code when calling crceBundleAdministrationGet');\n }\n // parse inputs\n $resourcePath = \"/bundles/code/{bundleCode}\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);\n\n // header params\n if ($correlation_id !== null) {\n $headerParams['correlationId'] = $this->apiClient->getSerializer()->toHeaderValue($correlation_id);\n }\n // header params\n if ($transaction_id !== null) {\n $headerParams['transactionId'] = $this->apiClient->getSerializer()->toHeaderValue($transaction_id);\n }\n // header params\n if ($user !== null) {\n $headerParams['user'] = $this->apiClient->getSerializer()->toHeaderValue($user);\n }\n // path params\n if ($bundle_code !== null) {\n $resourcePath = str_replace(\n \"{\" . \"bundleCode\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($bundle_code),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('accessKey');\n if (strlen($apiKey) !== 0) {\n $headerParams['accessKey'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\iNew\\Rest6_1\\Model\\GetBundleResponse',\n '/bundles/code/{bundleCode}'\n );\n\n return [$this->apiClient->getSerializer()->deserialize($response, '\\iNew\\Rest6_1\\Model\\GetBundleResponse', $httpHeader), $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\GetBundleResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 400:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\RestError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 500:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\RestError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function testCrceBundleAdministrationGetByReferenceId()\n {\n\n }",
"function _dic_get_bundle_info($load_from_cache = true) {\n $bundle_info = array();\n\n if ($load_from_cache) {\n $cache = cache_get('dic:bundle_info');\n if (is_object($cache)) {\n $bundle_info = $cache->data;\n }\n }\n\n if (empty($bundle_info)) {\n // fetch bundle information from modules\n $bundle_info = module_invoke_all('dic_bundle_info');\n // fetch bundles from variables to be able to load non drupal module bundles\n $bundle_info_variables = variable_get('dic_bundle_info', array());\n if (is_array($bundle_info_variables)) {\n $bundle_info = drupal_array_merge_deep($bundle_info, $bundle_info_variables);\n }\n cache_set('dic:bundle_info', $bundle_info);\n }\n\n return $bundle_info;\n}",
"public function crceBundleAdministrationGetActiveWithHttpInfo($customer_account_id, $subscription_id, $correlation_id = null, $transaction_id = null, $user = null, $bundle_code = null)\n {\n // verify the required parameter 'customer_account_id' is set\n if ($customer_account_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $customer_account_id when calling crceBundleAdministrationGetActive');\n }\n // verify the required parameter 'subscription_id' is set\n if ($subscription_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $subscription_id when calling crceBundleAdministrationGetActive');\n }\n // parse inputs\n $resourcePath = \"/customers/{customerAccountId}/subscriptions/{subscriptionId}/activeBundles\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);\n\n // query params\n if ($bundle_code !== null) {\n $queryParams['bundleCode'] = $this->apiClient->getSerializer()->toQueryValue($bundle_code);\n }\n // header params\n if ($correlation_id !== null) {\n $headerParams['correlationId'] = $this->apiClient->getSerializer()->toHeaderValue($correlation_id);\n }\n // header params\n if ($transaction_id !== null) {\n $headerParams['transactionId'] = $this->apiClient->getSerializer()->toHeaderValue($transaction_id);\n }\n // header params\n if ($user !== null) {\n $headerParams['user'] = $this->apiClient->getSerializer()->toHeaderValue($user);\n }\n // path params\n if ($customer_account_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"customerAccountId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($customer_account_id),\n $resourcePath\n );\n }\n // path params\n if ($subscription_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"subscriptionId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($subscription_id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('accessKey');\n if (strlen($apiKey) !== 0) {\n $headerParams['accessKey'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\iNew\\Rest6_1\\Model\\GetActivatedBundlesResponse',\n '/customers/{customerAccountId}/subscriptions/{subscriptionId}/activeBundles'\n );\n\n return [$this->apiClient->getSerializer()->deserialize($response, '\\iNew\\Rest6_1\\Model\\GetActivatedBundlesResponse', $httpHeader), $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\GetActivatedBundlesResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 400:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\RestError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 500:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\RestError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function editReferenceAction() {\n $id = $this->params()->fromRoute('id', 0);\n if (0 === $id) {\n return $this->redirect()->toRoute('biblio', ['action' => 'addReference']);\n }\n try {\n $references = $this->referencesTable->getReference($id);\n foreach ($references as $referenceResult) {\n $reference = $referenceResult;\n }\n } catch (\\Exception $e) {\n return $this->redirect()->toRoute('biblio', ['action' => 'references']);\n }\n $form = new ReferenceForm();\n $form->bind($reference);\n $form->get('submit')->setAttribute('value', 'Edit');\n\n $request = $this->getRequest();\n $viewData = ['id' => $id, 'form' => $form];\n\n if (! $request->isPost()) {\n return $viewData;\n }\n\n $form->setInputFilter($reference->getInputFilter());\n $form->setData($request->getPost());\n\n if (! $form->isValid()) {\n return $viewData;\n }\n $this->referencesTable->saveReference($reference);\n return $this->redirect()->toRoute('biblio', ['action' => 'references']);\n }",
"public function getContentOneID($idRef) {\r\n\t\t//Select from database\r\n $sql = \"\r\n\t\t\tSELECT c1.*, c2.*\r\n\t\t\tFROM content c1, category c2, content2category m2g\r\n\t\t\tWHERE c1.id = m2g.idContent AND m2g.idCategory = c2.id\r\n\t\t\tAND c1.id = ?;\r\n\t\t\";\r\n\r\n $res = $this->db->ExecuteSelectQueryAndFetchAll($sql, array($idRef));\r\n\r\n\r\n //If the ID was found and $res is not null...\r\n if(isset($res[0])) {\r\n \t//Get genres and trim\r\n\t\t\t$categories = \"\";\r\n\t\t\tforeach($res as $val) {\r\n\t\t\t\t$categories .= $val->name . ', ';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$categories = rtrim($categories, \", \");\r\n $value\t= $res[0];\r\n $title = htmlentities($value->title, null, 'UTF-8');\r\n\r\n //Put content in array\r\n\t\t\t$resArray \t= array (\r\n\t\t\t\t\"title\" \t=> \"{$title}\",\r\n\t\t\t\t\"text\" \t\t=> \"{$value->DATA}\",\r\n\t\t\t\t\"slug\"\t\t=> \"{$value->slug}\",\r\n\t\t\t\t\"category\" \t=> \"{$categories}\",\r\n\t\t\t\t\"type\" \t\t=> \"{$value->TYPE}\",\r\n\t\t\t\t\"filter\" \t=> \"{$value->FILTER}\",\r\n\t\t\t\t\"published\" => \"{$value->published}\",\r\n\t\t\t\t\"created\" \t=> \"{$value->created}\",\r\n\t\t\t);\r\n } else {\r\n die('Misslyckades: det finns inget innehåll med sådant id.');\r\n }\r\n return $resArray;\r\n\t}",
"public function crceBundleAdministrationGetAvailableSubscriptionWithHttpInfo($subscription_id, $correlation_id = null, $transaction_id = null, $user = null, $entities_per_page = null, $group_code = null, $page = null, $payment_option = null)\n {\n // verify the required parameter 'subscription_id' is set\n if ($subscription_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $subscription_id when calling crceBundleAdministrationGetAvailableSubscription');\n }\n // parse inputs\n $resourcePath = \"/subscriptions/{subscriptionId}/availableBundles\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);\n\n // query params\n if ($entities_per_page !== null) {\n $queryParams['entitiesPerPage'] = $this->apiClient->getSerializer()->toQueryValue($entities_per_page);\n }\n // query params\n if ($group_code !== null) {\n $queryParams['groupCode'] = $this->apiClient->getSerializer()->toQueryValue($group_code);\n }\n // query params\n if ($page !== null) {\n $queryParams['page'] = $this->apiClient->getSerializer()->toQueryValue($page);\n }\n // query params\n if ($payment_option !== null) {\n $queryParams['paymentOption'] = $this->apiClient->getSerializer()->toQueryValue($payment_option);\n }\n // header params\n if ($correlation_id !== null) {\n $headerParams['correlationId'] = $this->apiClient->getSerializer()->toHeaderValue($correlation_id);\n }\n // header params\n if ($transaction_id !== null) {\n $headerParams['transactionId'] = $this->apiClient->getSerializer()->toHeaderValue($transaction_id);\n }\n // header params\n if ($user !== null) {\n $headerParams['user'] = $this->apiClient->getSerializer()->toHeaderValue($user);\n }\n // path params\n if ($subscription_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"subscriptionId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($subscription_id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('accessKey');\n if (strlen($apiKey) !== 0) {\n $headerParams['accessKey'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\iNew\\Rest6_1\\Model\\GetAvailableBundlesResponse',\n '/subscriptions/{subscriptionId}/availableBundles'\n );\n\n return [$this->apiClient->getSerializer()->deserialize($response, '\\iNew\\Rest6_1\\Model\\GetAvailableBundlesResponse', $httpHeader), $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\GetAvailableBundlesResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 400:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\RestError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 500:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\RestError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function get_edit($id = 0)\n\t{\n\t\t// See if we can get the bundle\n\t\tif ( ! $bundle = Listing::where_uri($id)->first())\n\t\t{\n\t\t\treturn Response::error('404');\n\t\t}\n\n\t\tif ($bundle->user_id != Auth::user()->id)\n\t\t{\n\t\t\tif (Auth::user()->group_id != 1)\n\t\t\t{\n\t\t\t\treturn Response::error('404');\n\t\t\t}\n\t\t}\n\n\t\t// Get the associated tags.\n\t\tif (count($bundle->tags) > 0)\n\t\t{\n\t\t\tforeach ($bundle->tags as $key => $tag)\n\t\t\t{\n\t\t\t\t$tags[$key] = $tag->tag;\n\t\t\t}\n\t\t}\n\n\t\t// Get the dependencies and assign them to the layout for js.\n\t\t$dependencies = array();\n\t\tif (count($bundle->dependencies) > 0)\n\t\t{\n\t\t\tforeach ($bundle->dependencies as $key => $dependency)\n\t\t\t{\n\t\t\t\t$dependencies[$key] = $dependency->uri;\n\t\t\t}\n\t\t}\n\n\t\t// Pass everything off to the view and assign it where it should go\n\t\treturn View::make('layouts.default')\n\t\t\t->nest('content', 'bundles.form', array(\n\t\t\t\t'categories' => $this->categories,\n\t\t\t\t'bundle' => $bundle,\n\t\t\t\t'repos' => Github_helper::repos(),\n\t\t\t\t'action' => 'edit',\n\t\t\t\t'tags' => $tags,\n\t\t\t\t'dependencies' => $dependencies\n\t\t\t))\n\t\t\t->with('title', 'Edit Bundle');\n\t}",
"public function getBundle();",
"public function apiDocumentsIdContentGetWithHttpInfo($id, $type = null)\n {\n $returnType = '';\n $request = $this->apiDocumentsIdContentGetRequest($id, $type);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 422:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Lacuna\\Signer\\Model\\ErrorModel',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function crceBundleAdministrationGetAvailable($customer_account_id, $subscription_id, $correlation_id = null, $transaction_id = null, $user = null, $entities_per_page = null, $group_code = null, $page = null, $payment_option = null)\n {\n list($response) = $this->crceBundleAdministrationGetAvailableWithHttpInfo($customer_account_id, $subscription_id, $correlation_id, $transaction_id, $user, $entities_per_page, $group_code, $page, $payment_option);\n return $response;\n }",
"public static function LoadArrayByReferenciaId($intReferenciaId, $objOptionalClauses = null) {\n\t\t\t// Call FluxogramaItem::QueryArray to perform the LoadArrayByReferenciaId query\n\t\t\ttry {\n\t\t\t\treturn FluxogramaItem::QueryArray(\n\t\t\t\t\tQQ::Equal(QQN::FluxogramaItem()->ReferenciaId, $intReferenciaId),\n\t\t\t\t\t$objOptionalClauses\n\t\t\t\t\t);\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\t\t}",
"function clpr_get_listing_by_ref( $reference_id ) {\n\n\tif ( empty( $reference_id ) || ! is_string( $reference_id ) )\n\t\treturn false;\n\n\t$reference_id = appthemes_numbers_letters_only( $reference_id );\n\n\t$listing_q = new WP_Query( array(\n\t\t'post_type' => APP_POST_TYPE,\n\t\t'post_status' => 'any',\n\t\t'meta_key' => 'clpr_id',\n\t\t'meta_value' => $reference_id,\n\t\t'posts_per_page' => 1,\n\t\t'suppress_filters' => true,\n\t\t'no_found_rows' => true,\n\t) );\n\n\tif ( empty( $listing_q->posts ) )\n\t\treturn false;\n\n\treturn $listing_q->posts[0];\n}",
"public function getAccountBundlesWithHttpInfo($accountId, $externalKey = null, $bundlesFilter = null, $audit = 'NONE')\n {\n $returnType = '\\Killbill\\Client\\Swagger\\Model\\Bundle[]';\n $request = $this->getAccountBundlesRequest($accountId, $externalKey, $bundlesFilter, $audit);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n return $this->handleResponse($request, $response, $returnType);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Killbill\\Client\\Swagger\\Model\\Bundle[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"protected function _dspaceGetBundles() {\n\t\tif( is_null( $this->_dspaceRawBundles ) ) {\n\t\t\ttry {\n\t\t\t\t$this->_dspaceRawBundles = $this->getRepository()->restCallJSON('item.bundles', array('id'=>$this->getId()));\n\t\t\t} catch (Exception $e) {\n\t\t\t\tthrow JSpaceRepositoryError::raiseError( $this, JText::sprintf('COM_JSPACE_JSPACEITEM_ERROR_CANNOT_FETCH_BUNDLE', $this->getId()) );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this->_dspaceRawBundles;\n\t}",
"public function get_appbundles($appid='') {\n\t\t$config = $this->config->item('lemur');\n\t\t$settings = array(\n\t\t\tCURLOPT_URL => $config['baseUrl'].\"/da/us-east/v3/appbundles/\".$appid,\n\t\t\tCURLOPT_CUSTOMREQUEST => \"GET\",\n\t\t);\n\t\t$httpheader = array(\n\t\t\t\"Authorization: Bearer {$_SESSION['access_token']}\",\n\t\t);\n\n\t\t$response = $this->do_curl($httpheader, $settings, true);\n\n\t\t//print_r($response);\n\t\treturn $response;\n\t}",
"public function builderAssetUrlsDesignsIdGetWithHttpInfo($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling builderAssetUrlsDesignsIdGet');\n }\n // parse inputs\n $resourcePath = \"/BuilderAsset/urls/designs/{id}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\InlineResponse200',\n '/BuilderAsset/urls/designs/{id}'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\InlineResponse200', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\InlineResponse200', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function getv1bundlesdetails2($getbundleIds)\n {\n $data = $this->getRequestWithCookie(\"https://catalog.roblox.com/v1/bundles/details?bundleIds=$bundleIds\", [], [\"ReturnStatusCode\"=>true]);\n return $data;\n }",
"public function getReference(string $id): ?array;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Replace WordPress smilies by Lazy Load | function rocket_lazyload_smilies() {
if ( ! rocket_lazyload_get_option( 'images' ) || ! apply_filters( 'do_rocket_lazyload', true ) ) {
return;
}
remove_filter( 'the_content', 'convert_smilies' );
remove_filter( 'the_excerpt', 'convert_smilies' );
remove_filter( 'comment_text', 'convert_smilies', 20 );
add_filter( 'the_content', 'rocket_convert_smilies' );
add_filter( 'the_excerpt', 'rocket_convert_smilies' );
add_filter( 'comment_text', 'rocket_convert_smilies', 20 );
} | [
"public function lazyloadSmilies()\r\n {\r\n if (! $this->shouldLazyload()) {\r\n return;\r\n }\r\n\r\n if (! $this->option_array->get('images')) {\r\n return;\r\n }\r\n\r\n $filters = [\r\n 'the_content' => 10,\r\n 'the_excerpt' => 10,\r\n 'comment_text' => 20,\r\n ];\r\n \r\n foreach ($filters as $filter => $prio) {\r\n if (! has_filter($filter)) {\r\n continue;\r\n }\r\n\r\n remove_filter($filter, 'convert_smilies', $prio);\r\n add_filter($filter, [$this->image, 'convertSmilies'], $prio);\r\n }\r\n }",
"function convert_smilies($text) {\n\tglobal $wp_smiliessearch;\n\t$output = '';\n\tif ( get_option('use_smilies') && !empty($wp_smiliessearch) ) {\n\t\t// HTML loop taken from texturize function, could possible be consolidated\n\t\t$textarr = preg_split(\"/(<.*>)/U\", $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between\n\t\t$stop = count($textarr);// loop stuff\n\t\tfor ($i = 0; $i < $stop; $i++) {\n\t\t\t$content = $textarr[$i];\n\t\t\tif ((strlen($content) > 0) && ('<' != $content{0})) { // If it's not a tag\n\t\t\t\t$content = preg_replace_callback($wp_smiliessearch, 'translate_smiley', $content);\n\t\t\t}\n\t\t\t$output .= $content;\n\t\t}\n\t} else {\n\t\t// return default text.\n\t\t$output = $text;\n\t}\n\treturn $output;\n}",
"function convert_smilies($text) {\n\tglobal $smiliessearch;\n\t$output = '';\n\tif ( get_option('use_smilies') && !empty($smiliessearch) ) {\n\t\t// HTML loop taken from texturize function, could possible be consolidated\n\t\t$textarr = preg_split(\"/(<.*>)/U\", $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between\n\t\t$stop = count($textarr);// loop stuff\n\t\tfor ($i = 0; $i < $stop; $i++) {\n\t\t\t$content = $textarr[$i];\n\t\t\tif ((strlen($content) > 0) && ('<' != $content[0])) { // If it's not a tag\n\t\t\t\t$content = preg_replace_callback($smiliessearch, 'translate_smiley', $content);\n\t\t\t}\n\t\t\t$output .= $content;\n\t\t}\n\t} else {\n\t\t// return default text.\n\t\t$output = $text;\n\t}\n\treturn $output;\n}",
"function convert_smilies( $text ) {\n\tglobal $wp_smiliessearch;\n\t$output = '';\n\tif ( get_option( 'use_smilies' ) && ! empty( $wp_smiliessearch ) ) {\n\t\t// HTML loop taken from texturize function, could possible be consolidated\n\t\t$textarr = preg_split( '/(<.*>)/U', $text, -1, PREG_SPLIT_DELIM_CAPTURE ); // capture the tags as well as in between\n\t\t$stop = count( $textarr );// loop stuff\n\n\t\t// Ignore proessing of specific tags\n\t\t$tags_to_ignore = 'code|pre|style|script|textarea';\n\t\t$ignore_block_element = '';\n\n\t\tfor ( $i = 0; $i < $stop; $i++ ) {\n\t\t\t$content = $textarr[$i];\n\n\t\t\t// If we're in an ignore block, wait until we find its closing tag\n\t\t\tif ( '' == $ignore_block_element && preg_match( '/^<(' . $tags_to_ignore . ')>/', $content, $matches ) ) {\n\t\t\t\t$ignore_block_element = $matches[1];\n\t\t\t}\n\n\t\t\t// If it's not a tag and not in ignore block\n\t\t\tif ( '' == $ignore_block_element && strlen( $content ) > 0 && '<' != $content[0] ) {\n\t\t\t\t$content = preg_replace_callback( $wp_smiliessearch, 'translate_smiley', $content );\n\t\t\t}\n\n\t\t\t// did we exit ignore block\n\t\t\tif ( '' != $ignore_block_element && '</' . $ignore_block_element . '>' == $content ) {\n\t\t\t\t$ignore_block_element = '';\n\t\t\t}\n\n\t\t\t$output .= $content;\n\t\t}\n\t} else {\n\t\t// return default text.\n\t\t$output = $text;\n\t}\n\treturn $output;\n}",
"function handle_strip_smilies ( $text )\n{\n\n // global variables\n global $vwar_bbcode_smilieconverted,$vwarmod;\t// check if smilies were converted\n\n\tif ( $vwar_bbcode_smilieconverted !== true )\n\t{\n\t\treturn $text;\n\t}\n\n\t// global variables\n\tstatic $parse_stripsmiliesearch, $parse_stripsmiliereplace;\t// strip smilie arrays\n\n\tif ( !isset($parse_stripsmiliesearch) )\n\t{\n\n\t global $parse_smiliesearch, $parse_smiliereplace,$vwarmod;\t// smilie arrays\n\n\t\t$parse_stripsmiliesearch = array_reverse ( $parse_smiliereplace );\n\t\t$parse_stripsmiliereplace = array_reverse ( $parse_smiliesearch );\n\n\t}\n\n\t$text = str_replace ($parse_stripsmiliesearch, $parse_stripsmiliereplace, $text);\n\n // return\n return $text;\n\n}",
"public static function smilies_init()\n {\n $wpsmiliestrans = array(\n ':mrgreen:' => 'icon_mrgreen.gif',\n ':neutral:' => 'icon_neutral.gif',\n ':twisted:' => 'icon_twisted.gif',\n ':arrow:' => 'icon_arrow.gif',\n ':shock:' => 'icon_eek.gif',\n ':smile:' => 'icon_smile.gif',\n ':???:' => 'icon_confused.gif',\n ':cool:' => 'icon_cool.gif',\n ':evil:' => 'icon_evil.gif',\n ':grin:' => 'icon_biggrin.gif',\n ':idea:' => 'icon_idea.gif',\n ':oops:' => 'icon_redface.gif',\n ':razz:' => 'icon_razz.gif',\n ':roll:' => 'icon_rolleyes.gif',\n ':wink:' => 'icon_wink.gif',\n ':cry:' => 'icon_cry.gif',\n ':eek:' => 'icon_surprised.gif',\n ':lol:' => 'icon_lol.gif',\n ':mad:' => 'icon_mad.gif',\n ':sad:' => 'icon_sad.gif',\n '8-)' => 'icon_cool.gif',\n '8-O' => 'icon_eek.gif',\n ':-(' => 'icon_sad.gif',\n ':-)' => 'icon_smile.gif',\n ':-?' => 'icon_confused.gif',\n ':-D' => 'icon_biggrin.gif',\n ':-P' => 'icon_razz.gif',\n ':-o' => 'icon_surprised.gif',\n ':-x' => 'icon_mad.gif',\n ':-|' => 'icon_neutral.gif',\n ';-)' => 'icon_wink.gif',\n '8)' => 'icon_cool.gif',\n '8O' => 'icon_eek.gif',\n ':(' => 'icon_sad.gif',\n ':)' => 'icon_smile.gif',\n ':?' => 'icon_confused.gif',\n ':D' => 'icon_biggrin.gif',\n ':P' => 'icon_razz.gif',\n ':o' => 'icon_surprised.gif',\n ':x' => 'icon_mad.gif',\n ':|' => 'icon_neutral.gif',\n ';)' => 'icon_wink.gif',\n ':!:' => 'icon_exclaim.gif',\n ':?:' => 'icon_question.gif',\n );\n\n if (count($wpsmiliestrans) == 0) {\n return;\n }\n\n /*\n * NOTE: we sort the smilies in reverse key order. This is to make sure\n * we match the longest possible smilie (:???: vs :?) as the regular\n * expression used below is first-match\n */\n krsort($wpsmiliestrans);\n\n $wp_smiliessearch = '/(?:\\s|^)';\n\n $subchar = '';\n foreach ( (array) $wpsmiliestrans as $smiley => $img ) {\n $firstchar = substr($smiley, 0, 1);\n $rest = substr($smiley, 1);\n\n // new subpattern?\n if ($firstchar != $subchar) {\n if ($subchar != '') {\n $wp_smiliessearch .= ')|(?:\\s|^)';\n }\n $subchar = $firstchar;\n $wp_smiliessearch .= preg_quote($firstchar, '/') . '(?:';\n } else {\n $wp_smiliessearch .= '|';\n }\n $wp_smiliessearch .= preg_quote($rest, '/');\n }\n\n $wp_smiliessearch .= ')(?:\\s|$)/m';\n }",
"function cache_smilies()\n\n {\n\n global $cache;\n\n $this->smilies_cache = array();\n\n\n\n $smilies = $cache->read(\"smilies\");\n\n if(is_array($smilies))\n\n {\n\n foreach($smilies as $sid => $smilie)\n\n {\n\n $this->smilies_cache[$smilie['find']] = \"<img src=\\\"{$this->base_url}{$smilie['image']}\\\" style=\\\"vertical-align: middle;\\\" border=\\\"0\\\" alt=\\\"{$smilie['name']}\\\" title=\\\"{$smilie['name']}\\\" />\";\n\n }\n\n }\n\n }",
"function sf_convert_custom_smileys($postcontent)\n{\n\tglobal $sfglobals;\n\n\tif($sfglobals['smileyoptions']['sfsmallow'] && $sfglobals['smileyoptions']['sfsmtype']==1)\n\t{\n\t\tif($sfglobals['smileys'])\n\t\t{\n\t\t\tforeach ($sfglobals['smileys'] as $sname => $sinfo)\n\t\t\t{\n\t\t\t\t$postcontent = str_replace($sinfo[1], '<img src=\"'.SFSMILEYS.$sinfo[0].'\" title=\"'.$sname.'\" alt=\"'.$sname.'\" />', $postcontent);\n\t\t\t}\n\t\t}\n\t}\n\treturn $postcontent;\n}",
"function add_smilies($text) {\n\t$text = str_replace(':)', '<img src=\"/img/smilies/happy.png\" />', $text);\n\t$text = str_replace(':(', '<img src=\"/img/smilies/sad.png\" />', $text);\n\t$text = str_replace(':P', '<img src=\"/img/smilies/tongue.png\" />', $text);\n\t$text = str_replace(':D', '<img src=\"/img/smilies/laugh.png\" />', $text);\n\t$text = str_replace(':/', '<img src=\"/img/smilies/confused.png\" />', $text);\n\treturn $text;\n}",
"function rocket_translate_smiley( $matches ) {\r\n\tglobal $wpsmiliestrans;\r\n\r\n\tif ( count( $matches ) == 0 )\r\n\t\treturn '';\r\n\r\n\t$smiley = trim( reset( $matches ) );\r\n\t$img = $wpsmiliestrans[ $smiley ];\r\n\r\n\t$matches = array();\r\n\t$ext = preg_match( '/\\.([^.]+)$/', $img, $matches ) ? strtolower( $matches[1] ) : false;\r\n\t$image_exts = array( 'jpg', 'jpeg', 'jpe', 'gif', 'png' );\r\n\r\n\t// Don't convert smilies that aren't images - they're probably emoji.\r\n\tif ( ! in_array( $ext, $image_exts ) ) {\r\n\t\treturn $img;\r\n\t}\r\n\r\n\t/**\r\n\t * Filter the Smiley image URL before it's used in the image element.\r\n\t *\r\n\t * @since 2.9.0\r\n\t *\r\n\t * @param string $smiley_url URL for the smiley image.\r\n\t * @param string $img Filename for the smiley image.\r\n\t * @param string $site_url Site URL, as returned by site_url().\r\n\t */\r\n\t$src_url = apply_filters( 'smilies_src', includes_url( \"images/smilies/$img\" ), $img, site_url() );\r\n\r\n\t// Don't LazyLoad if process is stopped for these reasons\r\n\tif ( ! is_feed() && ! is_preview() ) {\r\n\t\t\r\n\t\t/** This filter is documented in inc/front/lazyload.php */\r\n\t\t$placeholder = apply_filters( 'rocket_lazyload_placeholder', 'data:image/gif;base64,R0lGODdhAQABAPAAAP///wAAACwAAAAAAQABAEACAkQBADs=' );\r\n\t\t\r\n\t\treturn sprintf( ' <img src=\"%s\" data-lazy-src=\"%s\" alt=\"%s\" class=\"wp-smiley\" /> ', $placeholder, esc_url( $src_url ), esc_attr( $smiley ) );\r\n\r\n\t} else {\r\n\r\n\t\treturn sprintf( ' <img src=\"%s\" alt=\"%s\" class=\"wp-smiley\" /> ', esc_url( $src_url ), esc_attr( $smiley ) );\r\n\r\n\t}\r\n}",
"function translate_smiley($smiley) {\n\tglobal $smiliestrans;\n\n\tif (count($smiley) == 0) {\n\t\treturn '';\n\t}\n\n\t$smiley = trim(reset($smiley));\n\t$img = $wpsmiliestrans[$smiley];\n\t$smiley_masked = esc_attr($smiley);\n\n\t$srcurl = apply_filters('smilies_src', includes_url(\"img/smilies/$img\"), $img, site_url());\n\n\treturn \" <img src='$srcurl' alt='$smiley_masked' class='wp-smiley' /> \";\n}",
"function gbSwapSmilies($string) {\n global $cfgSmilies, $cfgSmiliesPath;\n\n while ( list($emoticon, $data) = each($cfgSmilies) ) {\n $imgTag = \"<img src=\\\"\" . $cfgSmiliesPath . $data[0] . \"\\\" alt=\\\"$data[1]\\\" title=\\\"$data[1]\\\" border=\\\"0\\\">\";\n $string = str_replace($emoticon, $imgTag, $string);\n }\n reset($cfgSmilies);\n\n return $string;\n}",
"function translate_smiley($smiley) {\n\tglobal $wpsmiliestrans;\n\n\tif (count($smiley) == 0) {\n\t\treturn '';\n\t}\n\n\t$siteurl = get_option( 'siteurl' );\n\n\t$smiley = trim(reset($smiley));\n\t$img = $wpsmiliestrans[$smiley];\n\t$smiley_masked = esc_attr($smiley);\n\n\treturn \" <img src='$siteurl/wp-includes/images/smilies/$img' alt='$smiley_masked' class='wp-smiley' /> \";\n}",
"function thistle_disable_smilies() {\n add_filter( 'pre_option_use_smilies', '__return_null' );\n }",
"function getSmilie($bbcode)\n{\n if (isset($GLOBALS['Smilie_Search'])) {\n $search = &$GLOBALS['Smilie_Search']['code'];\n $replace = &$GLOBALS['Smilie_Search']['img'];\n } else {\n $results = trim(file_get_contents(PHPWS_SOURCE_DIR . '/core/conf/smiles.pak'));\n if (empty($results)) {\n return $bbcode;\n }\n $smiles = explode(\"\\n\", $results);\n foreach ($smiles as $row) {\n $icon = explode('=+:', $row);\n\n if (count($icon) < 3) {\n continue;\n }\n $search[] = '@(?!<.*?)' . preg_quote($icon[2]) . '(?![^<>]*?>)@si';\n $replace[] = sprintf('<img src=\"images/core/smilies/%s\" title=\"%s\" alt=\"%s\" />',\n $icon[0], $icon[1], $icon[1]);\n\n }\n\n $GLOBALS['Smilie_Search']['code'] = $search;\n $GLOBALS['Smilie_Search']['img'] = $replace;\n }\n\n $bbcode = preg_replace($search, $replace, $bbcode);\n return $bbcode;\n}",
"protected function smilies($text)\n {\n $smile = array(\n ':mrgreen:' => 'icon_mrgreen.gif',\n ':neutral:' => 'icon_neutral.gif',\n ':twisted:' => 'icon_twisted.gif',\n ':arrow:' => 'icon_arrow.gif',\n ':shock:' => 'icon_eek.gif',\n ':smile:' => 'icon_smile.gif',\n ':???:' => 'icon_confused.gif',\n ':cool:' => 'icon_cool.gif',\n ':evil:' => 'icon_evil.gif',\n ':grin:' => 'icon_biggrin.gif',\n ':idea:' => 'icon_idea.gif',\n ':oops:' => 'icon_redface.gif',\n ':razz:' => 'icon_razz.gif',\n ':roll:' => 'icon_rolleyes.gif',\n ':wink:' => 'icon_wink.gif',\n ':cry:' => 'icon_cry.gif',\n ':eek:' => 'icon_surprised.gif',\n ':lol:' => 'icon_lol.gif',\n ':mad:' => 'icon_mad.gif',\n ':sad:' => 'icon_sad.gif',\n '8-)' => 'icon_cool.gif',\n '8-O' => 'icon_eek.gif',\n ':-(' => 'icon_sad.gif',\n ':-)' => 'icon_smile.gif',\n ':-?' => 'icon_confused.gif',\n ':-D' => 'icon_biggrin.gif',\n ':-P' => 'icon_razz.gif',\n ':-o' => 'icon_surprised.gif',\n ':-x' => 'icon_mad.gif',\n ':-|' => 'icon_neutral.gif',\n ';-)' => 'icon_wink.gif',\n '8)' => 'icon_cool.gif',\n '8O' => 'icon_eek.gif',\n ':(' => 'icon_sad.gif',\n ':)' => 'icon_smile.gif',\n ':?' => 'icon_confused.gif',\n ':D' => 'icon_biggrin.gif',\n ':P' => 'icon_razz.gif',\n ':o' => 'icon_surprised.gif',\n ':x' => 'icon_mad.gif',\n ':|' => 'icon_neutral.gif',\n ';)' => 'icon_wink.gif',\n ':!:' => 'icon_exclaim.gif',\n ':?:' => 'icon_question.gif',\n );\n\n if (count($smile) > 0) {\n\n foreach ($smile as $replace_this => $value) {\n $path = '/Media/smilies/';\n $path .= $value;\n $with_this = '<span><img src=\"' . $path . '\" alt=\"' . $value . '\" class=\"smiley-class\" /></span>';\n $text = str_ireplace($replace_this, $with_this, $text);\n }\n }\n\n return $text;\n }",
"function parse_smilies($text, $do_html = false)\n\t{\n\t\treturn $text;\n\t}",
"function cot_smilies_load()\n{\n\tglobal $cot_smilies, $lang, $cache;\n\n\tif (is_array($cot_smilies))\n\t{\n\t\treturn;\n\t}\n\n\tfunction cot_smcp($sm1, $sm2)\n\t{\n\t\tif ($sm1['prio'] == $sm2['prio']) return 0;\n\t\telse return $sm1['prio'] > $sm2['prio'] ? 1 : -1;\n\t}\n\n\n\t$cot_smilies = array();\n\n\tif (file_exists('./images/smilies/set.js')\n\t\t&& preg_match('#var\\s*smileSet\\s*=\\s*(\\[.*?\\n\\]);#s', file_get_contents('./images/smilies/set.js'), $mt))\n\t{\n\t\t$js = str_replace(array(\"\\r\", \"\\n\"), '', $mt[1]);\n\t\t$js = preg_replace('#(smileL\\.\\w+)#', '\"$1\"', $js);\n\t\t$cot_smilies = json_decode($js, true);\n\t\tusort($cot_smilies, 'cot_smcp');\n\t\tif (file_exists(\"./images/smilies/lang/$lang.lang.js\"))\n\t\t{\n\t\t\t$sm_lang = \"./images/smilies/lang/$lang.lang.js\";\n\t\t}\n\t\telseif (file_exists('./images/smilies/lang/en.lang.js'))\n\t\t{\n\t\t\t$sm_lang = './images/smilies/lang/en.lang.js';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sm_lang = false;\n\t\t}\n\t\tif ($sm_lang && preg_match('#var\\s*smileL\\s*=\\s*(\\[.*?\\n\\]);#s', file_get_contents($sm_lang), $mt))\n\t\t{\n\t\t\t$js = str_replace(array(\"\\r\", \"\\n\"), '', $mt[1]);\n\t\t\t$js = preg_replace('#(smileL\\.\\w+)#', '\"$1\"', $js);\n\t\t\t$smileL = json_decode($js, true);\n\t\t\tforeach ($cot_smilies as $key => $val)\n\t\t\t{\n\t\t\t\tif (empty($val['lang']))\n\t\t\t\t{\n\t\t\t\t\t$cot_smilies[$key]['lang'] = $val['name'];\n\t\t\t\t}\n\t\t\t\telseif (preg_match('#^smileL\\.(.+)$#', $val['lang'], $mt))\n\t\t\t\t{\n\t\t\t\t\t$cot_smilies[$key]['lang'] = $smileL[$mt[1]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t$cache && $cache->db->store('cot_smilies', $cot_smilies, 'system');\n}",
"static public function mangled_by_alt_text_fix() {\n // are expected to have this. It is possible this could produce false positives but\n // any posts with this string should be inspected anyway.\n $marker = '<?xml version=\"1.0\" standalone=\"yes\"?>';\n $mangled_posts = array();\n\n $wp_posts = ChapmanPost::search_wp_posts($marker);\n\n foreach ( $wp_posts as $wp_post ) {\n $mangled_posts[] = new ChapmanPost($wp_post);\n }\n\n // Would be nice if this returned a lazy iterator. But not sure how to do that in PHP.\n return $mangled_posts;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Envia "ManagerAction_JabberSend" Envia un mensaje a cliente Jabber | function jabberSend($jabber,$jid,$message){
return $this->eventSimple("JabberSend",array("Jabber"=>$jabber,"JID"=>$jid,"Message"=>$message));
} | [
"public function action_chat() {\n\t\t$recepient = $this->request->param('id');\n\t\t$sender = $this->_current_user;\n\t\t$avatar = ($sender->personnel_info->personnel_avatar) ? $sender->personnel_info->personnel_avatar : 'default.png';\n\t\t//STEP1: Save the chat message;\n\t\t$message = ORM::factory('Message');\n\t\t$message->values($this->request->post());\n\t\t$message->sender = $sender;\n\t\t$message->recepient = $recepient;\n\t\t$message->time = time();\n\t\ttry {\n\t\t\t$message->save();\n\t\t\t//STEP2: Send Chat Notification to Recepient\n\t\t\t$date = gmdate('m/d/Y H:i:s', $message->time) . \" UTC\";\n\t\t\t$payload = array(\n\t\t\t\t'msg_id' => $message->message_id,\n\t\t\t\t'msg' => $message->message,\n\t\t\t\t'time' => $date,\n\t\t\t\t'id' => $sender->id,\n\t\t\t\t'username' => $sender->username,\n\t\t\t\t'avatar' => 'assets/avatars/' . $avatar,\n\t\t\t\t\"local_time\" => Date::local_time(\"now\", \"m/d/Y H:i:s\", \"UTC\")\n\t\t\t);\n\t\t\t$this->_push('appchat', $payload, array(\n\t\t\t\t'id' => $recepient,\n\t\t\t\t'pushUid'=> Kohana::$config->load(\"pusher.pushUid\")\n\t\t\t));\n\t\t\t$this->_set_msg('Successful sent message', 'success', $payload);\n\t\t} catch(ORM_Validation_Exception $e) {\n\t\t\t$this->_set_msg('Someone slept on the job', 'error', TRUE);\n\t\t}\n\t}",
"public function sendMessage()\n {\n // section 10-5-1-60-5ce3491f:15700383283:-8000:0000000000000BAD begin\n // section 10-5-1-60-5ce3491f:15700383283:-8000:0000000000000BAD end\n }",
"public function guest_send_message()\n {\n $this->addchat_lib->guest_send_message();\n }",
"public function getAction() {\n\t\t//$this->setOutputParam('status', true);\n \t//$this->setOutputParam('message', 'Get Message sender');\n\t\t\n\t\t$this->sendMessage();\n\t}",
"public function AdminSendMessage(){\n\t\t$send_team=MakeItemString(DispFunc::X1Clean($_POST['sendteam']));\n\t\t$receive_team=MakeItemString(DispFunc::X1Clean($_POST['receiveteam']));\n\t\t\n\t\tModifySql(\"insert into\", X1_DB_messages, \"(randid,messid,message,hasread,steam_id,sender,rteam_id,tstamp) \n\t\tvalues (\".MakeItemString(DispFunc::X1Clean($_POST['randid'])).\", \n\t\t\".MakeItemString(DispFunc::X1Clean($_POST['messagecount'])).\", \n\t\t\".MakeItemString(DispFunc::X1Clean($_POST['x1_hometext'],$cleantype=3)).\", \n\t\t0,\n\t\t\".$send_team.\", \n\t\t\".MakeItemString(DispFunc::X1Clean($_POST['sender'])).\", \n\t\t\".$receive_team.\", \n\t\t\".time().\")\");\n\t\t\n\t\tModifySql(\"update\", X1_DB_teams, \"set totalnmessag=totalnmessag+1 where team_id = \".$receive_team.\" or team_id = \".$send_team);\n\t}",
"public function SendMessage(){\n\t\t$receive_team=MakeItemString(DispFunc::X1Clean($_POST['receiveteam']));\n\t\tModifySql(\"insert into\", X1_DB_messages, \n\t\t\"(randid, messid, message, hasread, steam_id, sender, rteam_id, tstamp) \n\t\tvalues (\".MakeItemString(DispFunc::X1Clean($_POST['randid'])).\", \n\t\t\".MakeItemString(DispFunc::X1Clean($_POST['messagecount'])).\", \n\t\t\".MakeItemString(trim(DispFunc::X1Clean($_POST['x1_hometext'],$cleantype=3))).\", \n\t\t\".MakeItemString(0).\", \n\t\t\".MakeItemString(DispFunc::X1Clean($_POST['sendteam'])).\", \n\t\t\".MakeItemString(DispFunc::X1Clean($_POST['sender'])).\", \n\t\t\".$receive_team.\", \n\t\t\".MakeItemString(time()).\")\");\n\t\n\t\tModifySql(\"update\", X1_DB_teams, \"set totalnmessag=totalnmessag+1 where team_id = \".$receive_team);\t\n\t}",
"public function chat_message () {\r\n //for client 2 example only\r\n $this->socket->event->addEvent('chat message', function ($socket,$data,$sender) {\r\n $socket->event->broadcastMessage('chat message', $data,true);\r\n });\r\n }",
"function jasmin_hook_sendsms($smsc, $sms_sender, $sms_footer, $sms_to, $sms_msg, $uid = '', $gpid = 0, $smslog_id = 0, $sms_type = 'text', $unicode = 0) {\n\tglobal $plugin_config;\n\t\n\t_log(\"enter smsc:\" . $smsc . \" smslog_id:\" . $smslog_id . \" uid:\" . $uid . \" to:\" . $sms_to, 3, \"jasmin_hook_sendsms\");\n\t\n\t// override plugin gateway configuration by smsc configuration\n\t$plugin_config = gateway_apply_smsc_config($smsc, $plugin_config);\n\t\n\t$sms_sender = stripslashes($sms_sender);\n\tif ($plugin_config['jasmin']['module_sender']) {\n\t\t$sms_sender = $plugin_config['jasmin']['module_sender'];\n\t}\n\t\n\t$sms_footer = stripslashes($sms_footer);\n\t$sms_msg = stripslashes($sms_msg);\n\t$ok = false;\n\t\n\tif ($sms_footer) {\n\t\t$sms_msg = $sms_msg . $sms_footer;\n\t}\n\t\n\tif ($sms_sender && $sms_to && $sms_msg) {\n\t\t\n\t\t$unicode_query_string = '';\n\t\tif ($unicode) {\n\t\t\tif (function_exists('mb_convert_encoding')) {\n\t\t\t\t// $sms_msg = mb_convert_encoding($sms_msg, \"UCS-2BE\", \"auto\");\n\t\t\t\t$sms_msg = mb_convert_encoding($sms_msg, \"UCS-2\", \"auto\");\n\t\t\t\t// $sms_msg = mb_convert_encoding($sms_msg, \"UTF-8\", \"auto\");\n\t\t\t\t$unicode_query_string = \"&coding=8\"; // added at the of query string if unicode\n\t\t\t}\n\t\t}\n\t\t\n\t\t$query_string = \"username=\" . $plugin_config['jasmin']['api_username'] . \"&password=\" . $plugin_config['jasmin']['api_password'] . \"&to=\" . urlencode($sms_to) . \"&from=\" . urlencode($sms_sender) . \"&content=\" . urlencode($sms_msg) . $unicode_query_string;\n\t\t$query_string .= \"&dlr=yes&dlr-level=2&dlr-url=\" . $plugin_config['jasmin']['callback_url'];\n\t\t$url = $plugin_config['jasmin']['url'] . \"?\" . $query_string;\n\t\t\n\t\t_log(\"send url:[\" . $url . \"]\", 3, \"jasmin_hook_sendsms\");\n\t\t\n\t\t// new way\n\t\t$opts = array(\n\t\t\t'http' => array(\n\t\t\t\t'method' => 'POST',\n\t\t\t\t'header' => \"Content-type: application/x-www-form-urlencoded\\r\\nContent-Length: \" . strlen($query_string) . \"\\r\\nConnection: close\\r\\n\",\n\t\t\t\t'content' => $query_string \n\t\t\t) \n\t\t);\n\t\t$context = stream_context_create($opts);\n\t\t$resp = file_get_contents($plugin_config['jasmin']['url'], FALSE, $context);\n\t\t\n\t\t// Success \"07033084-5cfd-4812-90a4-e4d24ffb6e3d\"\n\t\t// Error \"No route found\"\n\t\t$resp = explode(' ', $resp, 2);\n\t\t\n\t\tif ($resp[0] == 'Success') {\n\t\t\t$c_message_id = $resp[1];\n\t\t\t$c_message_id = str_replace('\"', '', $c_message_id);\n\t\t\t_log(\"sent smslog_id:\" . $smslog_id . \" message_id:\" . $c_message_id . \" smsc:\" . $smsc, 2, \"jasmin_hook_sendsms\");\n\t\t\t$db_query = \"\n\t\t\t\tINSERT INTO \" . _DB_PREF_ . \"_gatewayJasmin (local_smslog_id, remote_smslog_id)\n\t\t\t\tVALUES ('$smslog_id', '$c_message_id')\";\n\t\t\t$id = @dba_insert_id($db_query);\n\t\t\tif ($id) {\n\t\t\t\t$ok = true;\n\t\t\t\t$p_status = 1;\n\t\t\t\tdlr($smslog_id, $uid, $p_status);\n\t\t\t}\n\t\t} else {\n\t\t\t// even when the response is not what we expected we still print it out for debug purposes\n\t\t\tif ($resp[0] == 'Error') {\n\t\t\t\t$resp = $resp[1];\n\t\t\t\t$resp = str_replace('\"', '', $resp);\n\t\t\t} else {\n\t\t\t\t$resp = str_replace(\"\\n\", \" \", $resp);\n\t\t\t\t$resp = str_replace(\"\\r\", \" \", $resp);\n\t\t\t}\n\t\t\t_log(\"failed smslog_id:\" . $smslog_id . \" resp:[\" . $resp . \"] smsc:\" . $smsc, 2, \"jasmin_hook_sendsms\");\n\t\t}\n\t}\n\tif (!$ok) {\n\t\t$p_status = 2;\n\t\tdlr($smslog_id, $uid, $p_status);\n\t}\n\t\n\treturn $ok;\n}",
"public function sendmsg()\n\t{\n\t\t$xhr = new Xhr();\n\t\tif($this->mayConversation($_POST['c']))\n\t\t{\n\t\t\tS::noWrite();\n\n\t\t\tif(isset($_POST['b']))\n\t\t\t{\n\t\t\t\t$body = trim($_POST['b']);\n\t\t\t\t$body = htmlentities($body);\n\t\t\t\tif(!empty($body))\n\t\t\t\t{\n\t\t\t\t\tif($message_id = $this->model->sendMessage($_POST['c'],$body))\n\t\t\t\t\t{\n\t\t\t\t\t\t$xhr->setStatus(1);\n\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * for not so db intensive polling store updates in memcache if the recipients are online\n\t\t\t\t\t\t*/\n\t\t\t\t\t\tif($member = $this->model->listConversationMembers($_POST['c']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ($member as $m)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif($m['id'] != fsId())\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tMem::userAppend($m['id'], 'msg-update', (int)$_POST['c']);\n\n\t\t\t\t\t\t\t\t\tsendSock($m['id'],'conv', 'push', array(\n\t\t\t\t\t\t\t\t\t\t'id' => $message_id,\n\t\t\t\t\t\t\t\t\t\t'cid' => (int)$_POST['c'],\n\t\t\t\t\t\t\t\t\t\t'fs_id' => fsId(),\n\t\t\t\t\t\t\t\t\t\t'fs_name' => S::user('name'),\n\t\t\t\t\t\t\t\t\t\t'fs_photo' => S::user('photo'),\n\t\t\t\t\t\t\t\t\t\t'body' => $body,\n\t\t\t\t\t\t\t\t\t\t'time' => date('Y-m-d H:i:s')\n\t\t\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t\t * send an E-Mail if the user is not online\n\t\t\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\t\t\tif($this->model->wantMsgEmailInfo($m['id']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$this->convMessage($m, $_POST['c'], $body);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$xhr->addData('msg', array(\n\t\t\t\t\t\t\t'id' => $message_id,\n\t\t\t\t\t\t\t'body' => $body,\n\t\t\t\t\t\t\t'time' => date('Y-m-d H:i:s'),\n\t\t\t\t\t\t\t'fs_photo' => S::user('photo'),\n\t\t\t\t\t\t\t'fs_name' => S::user('name'),\n\t\t\t\t\t\t\t'fs_id' => fsId()\n\t\t\t\t\t\t));\n\t\t\t\t\t\t$xhr->send();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$xhr->addMessage(s('error'),'error');\n\t\t$xhr->send();\n\t}",
"function SendChatAction($chatid,$action){\r\n\tbot('sendChatAction',[\r\n\t'chat_id'=>$chatid,\r\n\t'action'=>$action\r\n\t]);\r\n\t}",
"public function notify()\r\n\t{\r\n\t\techo \"Send SMS Successfully!\";\r\n\t}",
"function enviarMensaje($datos = array(), $id_usuario_destinatario) {\n global $textos, $sql, $sesion_usuarioSesion;\n\n $usuario = new Contacto();\n $destino = \"/ajax\".$usuario->urlBase.\"/sendMessage\";\n\n if (empty($datos)) {\n \n $nombre = $sql->obtenerValor(\"lista_usuarios\", \"nombre\", \"id = '\".$id_usuario_destinatario.\"'\"); \n \n $sobre = HTML::contenedor(\"\", \"fondoSobre\", \"fondoSobre\");\n \n $codigo = HTML::campoOculto(\"procesar\", \"true\");\n $codigo .= HTML::parrafo($textos->id(\"CONTACTO\"), \"negrilla margenSuperior\");\n $codigo .= HTML::campoTexto(\"\", 50, 255, $nombre, \"\", \"\", array(\"readOnly\" => \"true\"));\n $codigo .= HTML::campoOculto(\"datos[id_usuario_destinatario]\", $id_usuario_destinatario);\n $codigo .= HTML::parrafo($textos->id(\"TITULO\"), \"negrilla margenSuperior\");\n $codigo .= HTML::campoTexto(\"datos[titulo]\", 50, 255);\n $codigo .= HTML::parrafo($textos->id(\"CONTENIDO\"), \"negrilla margenSuperior\");\n $codigo .= HTML::areaTexto(\"datos[contenido]\", 10, 60, \"\", \"\", \"txtAreaLimitado511\");\n $codigo .= HTML::parrafo($textos->id(\"MAXIMO_TEXTO_511\"), \"maximoTexto\", \"maximoTexto\");\n $codigo .= HTML::parrafo(HTML::boton(\"chequeo\", $textos->id(\"ACEPTAR\"), \"botonOk\", \"botonOk\"), \"margenSuperior\");\n $codigo .= HTML::parrafo($sobre.\"<br>\");\n $codigo .= HTML::parrafo($textos->id(\"REGISTRO_AGREGADO\"), \"textoExitoso\", \"textoExitoso\"); \n $codigo = HTML::forma($destino, $codigo);\n\n $respuesta[\"generar\"] = true;\n $respuesta[\"codigo\"] = $codigo;\n $respuesta[\"destino\"] = \"#cuadroDialogo\";\n $respuesta[\"titulo\"] = HTML::contenedor(HTML::frase(HTML::parrafo($textos->id(\"ENVIAR_MENSAJE\"), \"letraNegra negrilla\"), \"bloqueTitulo-IS\"), \"encabezadoBloque-IS\");\n $respuesta[\"ancho\"] = 430;\n $respuesta[\"alto\"] = 450;\n\n } else {\n $respuesta[\"error\"] = true;\n\n if (empty($datos[\"id_usuario_destinatario\"])) {\n $respuesta[\"mensaje\"] = $textos->id(\"ERROR_FALTA_CONTACTO\");\n\n } elseif (empty($datos[\"titulo\"])) {\n $respuesta[\"mensaje\"] = $textos->id(\"ERROR_FALTA_TITULO\");\n\n } elseif (empty($datos[\"contenido\"])) {\n $respuesta[\"mensaje\"] = $textos->id(\"ERROR_FALTA_CONTENIDO\");\n\n } else {\n \n $datos[\"id_usuario_remitente\"] = $sesion_usuarioSesion->id;\n $datos[\"titulo\"] = strip_tags($datos[\"titulo\"]);\n $datos[\"contenido\"] = strip_tags($datos[\"contenido\"]);\n $datos[\"fecha\"] = date(\"Y-m-d G:i:s\");\n $datos[\"leido\"] = 0;\n\n $mensaje = $sql->insertar(\"mensajes\", $datos);\n\n if ($mensaje) {\n $respuesta[\"error\"] = false;\n $respuesta[\"accion\"] = \"insertar\";\n $respuesta[\"insertarAjax\"] = true;\n\n } else {\n $respuesta[\"mensaje\"] = $textos->id(\"ERROR_DESCONOCIDO\");\n }\n \n }\n }\n\n Servidor::enviarJSON($respuesta);\n}",
"public function messageOwnerAction() {\r\n\r\n if (!$this->_helper->requireUser()->isValid())\r\n return;\r\n\r\n //GET VIEWER DETAIL\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n $viewer_id = $viewer->getIdentity();\r\n\r\n //GET STORE ID AND STORE OBJECT\r\n $store_id = $this->_getParam(\"store_id\");\r\n $sitestore = Engine_Api::_()->getItem('sitestore_store', $store_id);\r\n\r\n //STORE OWNER CAN'T SEND MESSAGE TO HIMSELF\r\n if ($viewer_id == $sitestore->owner_id) {\r\n return $this->_forwardCustom('requireauth', 'error', 'core');\r\n }\r\n\r\n //FORM GENERATION\r\n $this->view->form = $form = new Messages_Form_Compose();\r\n $form->setTitle('Contact Store Owner');\r\n $form->setDescription('Create your message with the form given below. Your message will be sent to the admins of this Store.');\r\n $form->removeElement('to');\r\n\r\n //GET ADMINS ID FOR SENDING MESSAGE\r\n $manageAdminData = Engine_Api::_()->getDbtable('manageadmins', 'sitestore')->getManageAdmin($store_id);\r\n $manageAdminData = $manageAdminData->toArray();\r\n $ids = '';\r\n if (!empty($manageAdminData)) {\r\n foreach ($manageAdminData as $key => $user_ids) {\r\n $user_id = $user_ids['user_id'];\r\n if ($viewer_id != $user_id) {\r\n $ids = $ids . $user_id . ',';\r\n }\r\n }\r\n }\r\n $ids = trim($ids, ',');\r\n $form->toValues->setValue($ids);\r\n\r\n if (!$this->getRequest()->isPost()) {\r\n return;\r\n }\r\n\r\n $db = Engine_Api::_()->getDbtable('messages', 'messages')->getAdapter();\r\n $db->beginTransaction();\r\n\r\n try {\r\n $values = $this->getRequest()->getPost();\r\n\r\n $form->populate($values);\r\n\r\n $is_error = 0;\r\n if (empty($values['title'])) {\r\n $is_error = 1;\r\n }\r\n\r\n //SENDING MESSAGE\r\n if ($is_error == 1) {\r\n $error = $this->view->translate('Subject is required field !');\r\n $error = Zend_Registry::get('Zend_Translate')->_($error);\r\n\r\n $form->getDecorator('errors')->setOption('escape', false);\r\n $form->addError($error);\r\n return;\r\n }\r\n\r\n $recipients = preg_split('/[,. ]+/', $values['toValues']);\r\n\r\n //LIMIT RECIPIENTS IF IT IS NOT A SPECIAL LIST OF MEMBERS\r\n $recipients = array_slice($recipients, 0, 1000);\r\n\r\n //CLEAN THE RECIPIENTS FOR REPEATING IDS\r\n //THIS CAN HAPPEN IF RECIPIENTS IS SELECTED AND THEN A FRIEND LIST IS SELECTED\r\n $recipients = array_unique($recipients);\r\n\r\n $recipientsUsers = Engine_Api::_()->getItemMulti('user', $recipients);\r\n\r\n $sitestore_title = $sitestore->title;\r\n $store_title_with_link = '<a href = http://' . $_SERVER['HTTP_HOST'] . Zend_Controller_Front::getInstance()->getRouter()->assemble(array('store_url' => Engine_Api::_()->sitestore()->getStoreUrl($store_id)), 'sitestore_entry_view') . \">$sitestore_title</a>\";\r\n\r\n $conversation = Engine_Api::_()->getItemTable('messages_conversation')->send(\r\n $viewer, $recipients, $values['title'], $values['body'] . \"<br><br>\" . $this->view->translate(\"This message corresponds to the Store:\") . $store_title_with_link\r\n );\r\n\r\n foreach ($recipientsUsers as $user) {\r\n if ($user->getIdentity() == $viewer->getIdentity()) {\r\n continue;\r\n }\r\n Engine_Api::_()->getDbtable('notifications', 'activity')->addNotification(\r\n $user, $viewer, $conversation, 'message_new'\r\n );\r\n }\r\n\r\n //INCREMENT MESSAGES COUNTER\r\n Engine_Api::_()->getDbtable('statistics', 'core')->increment('messages.creations');\r\n\r\n $db->commit();\r\n\r\n return $this->_forwardCustom('success', 'utility', 'core', array(\r\n 'smoothboxClose' => true,\r\n 'parentRefresh' => false,\r\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('Your message has been sent successfully.'))\r\n ));\r\n } catch (Exception $e) {\r\n $db->rollBack();\r\n throw $e;\r\n }\r\n }",
"public function sendMessage()\r\n {\r\n $soap_client_handle = $this->soap_wrapper->createSoapClient();\r\n\r\n if($soap_client_handle !== false){\r\n $soap_function = 'sendMessage';\r\n $webservice_call_parameters = [\r\n $this->username,\r\n $this->password,\r\n $this->deviceMsisdn,\r\n $this->message_content,\r\n true,\r\n 'SMS',\r\n\r\n ];\r\n try{\r\n $soap_result = $this->soap_wrapper->performSoapCall($soap_client_handle, $soap_function, $webservice_call_parameters);\r\n }catch (\\SoapFault $exception){\r\n $soap_result = $exception->getCode();\r\n }\r\n $this->result = $soap_result;\r\n }\r\n }",
"public function sendMessage(CommandSender $sender, $key) {\n\t\t$sender->sendMessage(LanguageManager::getInstance()->getMessage($key));\n\t}",
"public function sendMessage() {\n // Retrieving data from fetch\n $contentType = isset($_SERVER[\"CONTENT_TYPE\"]) ? trim($_SERVER[\"CONTENT_TYPE\"]) : '';\n if ($contentType === \"application/json\") {\n //Receiving the RAW post data.\n $content = trim(file_get_contents(\"php://input\"));\n $decoded = json_decode($content, true);\n\n // Creating a new message object with appropriate properties, and saving it\n $chat_id = $decoded['chatId'];\n $message_body = filter_var($decoded['newPostMessage'], FILTER_SANITIZE_SPECIAL_CHARS);\n $message = new Messages();\n $message->setChatId($chat_id);\n $message->setMessage($message_body);\n $message->setAuthorId($_SESSION['id']);\n $message->save();\n\n //Updating chat updated at property (used to sort chats according to most recent messages)\n $chat = Chats::find($chat_id);\n $chat->setUpdatedAt(new DateTime());\n $chat->save();\n\n //Sending response to be displayed on appropriate chat\n header('Content-type: application/json');\n header('Access-Control-Allow-Origin', '*');\n header('Access-Control-Allow-Methods', 'POST, GET, PUT, DELETE');\n echo json_encode($decoded['chatId']);\n \n }\n \n }",
"private function sendDefaultMessage(){\n\n $db = new Database();\n\n $msg = \"Thanks for signing up!\";\n\n $data = array(\n 'user_id' => $this->user->id,\n 'sender_id' => 1,\n 'subject' => $msg\n );\n\n $db->insert_data(TABLE_MESSAGES, $data);\n }",
"public function messageAction() {\n $params = $this->_getAllParams();\n if (isset($params['message'])) {\n $this->view->class_message = $params['class_message'];\n $this->view->message = $params['message'];\n }\n if ($this->_flashMessenger->hasMessages()) {\n $this->view->class_message = 'warning';\n $this->view->message = $this->_flashMessenger->getMessages();\n }\n\n //Добавим путь к действию\n $this->_breadcrumbs->addStep('Ошибка');\n }",
"public function guest_send_message()\n\t{\n\t\t$this->AC_LIB->form_validation\n\t\t->set_rules('guest_id', lang('guest'), 'required')\n\t\t->set_rules('message', lang('message'), 'required|trim|max_length[1000]');\n\t\t\n if($this->AC_LIB->form_validation->run() === FALSE)\n {\n \t\t$data = array('status' => false, 'response'=> validation_errors());\n\t\t\t$this->format_json($data);\n\t\t}\n\n\t\t$this->AC_LIB->load->library('encryption');\n\t\t$this->AC_LIB->encryption->initialize(\n\t\t\tarray(\n\t\t\t\t\t'cipher' => 'aes-256',\n\t\t\t\t\t'mode' => 'ctr',\n\t\t\t\t\t'key' => 'adkahjdhkasjdh29378aadsjkasdh'\n\t\t\t)\n\t\t);\n\n\t\t$guest_id = $this->AC_LIB->encryption->decrypt($_POST['guest_id']);\n\n\t\t$guest_user = $this->AC_LIB->addchat_db_lib->get_guest_user($guest_id);\t\t\n\n\t\tif(empty($guest_user))\n\t\t\t$this->format_json(['status' => false]);\n\n\t\t$group_users = [];\n\t\t// get guest group users\t\n\t\t$group_users \t\t= (array)$this->get_guest_group_users();\n\n\t\t// get admin user\n\t\tif(!empty($this->AC_SETTINGS->admin_user_id))\n\t\t{\n\t\t\t$admin_guest = $this->AC_LIB->addchat_db_lib->get_user($this->AC_SETTINGS->admin_user_id, 0, $this->AC_SETTINGS->guest_group_id);\n\n\t\t\tif(!empty($group_users && !empty($admin_guest)))\n\t\t\t\tarray_push($group_users, $admin_guest);\n\t\t\telse if(empty($group_users) && !empty($admin_guest))\n\t\t\t\t$group_users = \t$admin_guest;\n\t\t}\n\t\t\n\t\tif(empty($group_users))\n\t\t\t$this->format_json(array('status' => false));\n\t\t\n\t\t$messages\t \t\t= [];\n\t\t$notification = [];\n\n\t\t$g_random \t\t\t= time().rand(1,988);\n\t\tforeach($group_users as $key => $value)\n\t\t{\n\t\t\t$messages[$key]['m_to'] \t \t= $value->id;\n\t\t\t$messages[$key]['message'] \t\t= $_POST['message'];\n\t\t\t$messages[$key]['g_from'] \t\t= $guest_user->id;\n\t\t\t$messages[$key]['m_from'] \t\t\t= 0;\n\t\t\t$messages[$key]['is_read'] \t\t\t= 0;\n\t\t\t$messages[$key]['dt_updated'] \t= date('Y-m-d H:i:s');\n\t\t\t$messages[$key]['g_random'] \t\t= $g_random;\n\t\t\t$notification[$key]['m_to']\t\t\t= $value->id;\n\t\t\t$notification[$key]['g_from']\t\t= $guest_user->id;\n\n\t\t}\n\t\t\n\t\t$status = $this->AC_LIB->addchat_db_lib->guest_send_message($messages);\n\n\t\t// 2. set_notification for guest\n\t\t$this->AC_LIB->addchat_db_lib->set_guest_notification($notification);\n\n\t\tif(empty($status))\n\t\t\t$this->format_json(array('status' => false));\n\n\t\t$data = [\n\t\t\t'message' \t\t=> $messages[0],\n\t\t\t'status' \t\t=> true,\n\t\t\t\n\t\t];\t\t\n\t\n\t\t$this->format_json($data);\t\t\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Store a newly created ResearchArea in storage. | public function store(ResearchAreaRequest $request)
{
ResearchArea::create([
'name' => $request->name
]);
Flash::success('Research area created successfully.');
return redirect('/admin/research_area');
} | [
"public function save(): void\n {\n $areas = [];\n foreach($this->areas as $area)\n {\n $areas[$area->getName()] = $area->toArray();\n }\n\n file_put_contents($this->areaFile, json_encode($areas));\n }",
"public function store(Area $area)\n {\n session()->put('area', $area->slug);\n\n //redirect to area category index\n return redirect()->route('categories.index', [$area]);\n }",
"public function store()\n {\n try {\n $area = $this->areaCreator->make(Input::all());\n\n return $this->respondCreated('Area successfully created', $area->id);\n } catch ( Aidph\\Validators\\ValidationException $e ) {\n return $this->respondValidationFailed($e->getErrors());\n }\n }",
"public function save(BookableArea $bookableArea);",
"public function store(CreateAreaInfluenciaRequest $request) {\n $input = $request->all();\n $areaInfluencia = $this->areaInfluenciaRepository->create($input);\n Flash::success('Area Influencia saved successfully.');\n return redirect(route('areaInfluencias.index'));\n }",
"public function registrarArea(){\n\t\t$id=$this->session->userdata(\"id\");\n\t\t$area = $this->input ->post(\"areaR\");\n\n\t\t$this->Areas_model->registrarAreaDoc($area, $id);\n\t\tredirect(base_url().\"director/Areas\");\n\t}",
"public function assignArea(Area $area)\n {\n $this->area()->associate($area->id)->save();\n }",
"public function registrarArea(){\n\t\t$id=$this->session->userdata(\"id\");\n\t\t$area = $this->input ->post(\"areaR\");\n\n\t\t$this->Areas_model->registrarAreaDoc($area, $id);\n\t\tredirect(base_url().\"docente/Areas\");\n\t}",
"public function store_area() { //procesar el formulario\n $data = request()->validate([\n 'nombre' => 'required',\n 'user_id'=>'',\n ], [\n 'nombre.required' => 'El campo nombre es obligatorio',\n ]);\n Area::create([ //creando o insertando un registro en area\n 'nombre' => $data['nombre'],\n 'user_id'=> $data['user_id'],\n ]);\n return redirect()->route('areas.index'); //redirigiendo a \n }",
"function store(){\r\n\t\t//store to file\r\n\t}",
"public function store(CreateAreaInfluenciaHasTradicionRequest $request)\n {\n $input = $request->all();\n\n $areaInfluenciaHasTradicion = $this->areaInfluenciaHasTradicionRepository->create($input);\n\n Flash::success('Area Influencia Has Tradicion\nguardado exitosamente.');\n\n return redirect(route('areaInfluenciaHasTradicions.index'));\n }",
"public function post_cratearea()\n\t{\n\t\t$data = Module_Area::create(array(\n\t\t\t'area_name'\t=> Input::get('name'),\n\t\t\t'area_slug' => str_replace(' ', '_', Input::get('name')),\n\t\t\t));\t\t\n\n\t\tif( !(bool)$data )\n\t\t\treturn Redirect::back()->with('alert', 'Module Area creation failed!');\n\t\telse\n\t\t\treturn Redirect::to_route('modules')->with('message', 'Module Area ' . ucfirst(Input::get('name') . ' was successfully created'));\n\t}",
"public function handleStoreArea($area)\r\n {\r\n $session = $this->session->getSection('map');\r\n $session->area = $area;\r\n \r\n $this->terminate();\r\n }",
"protected function storeRoot()\n\t{\n\t\t$form = $this->getSearchAreaForm();\n\n\t\t$this->root_node = $form->getItemByPostVar('area')->getValue();\n\t\t$this->search_cache->setRoot($this->root_node);\n\t\t$this->search_cache->save();\n\t\t$this->search_cache->deleteCachedEntries();\n\n\t\tinclude_once './Services/Object/classes/class.ilSubItemListGUI.php';\n\t\tilSubItemListGUI::resetDetails();\n\n\t\t$this->performSearch();\n\t}",
"public function store(CreateConsolidacionAreaInfluenciaRequest $request)\n {\n $input = $request->all();\n\n $consolidacionAreaInfluencia = $this->consolidacionAreaInfluenciaRepository->create($input);\n\n Flash::success('Consolidacion Area Influencia\nguardado exitosamente.');\n\n return redirect(route('consolidacionAreaInfluencias.index'));\n }",
"public function store() {\n $options = $this->getOptions();\n $key = self::DEFAULT_REGISTRY_KEY;\n\n if (isset($options['storage']['registry']['key'])\n && !empty($options['storage']['registry']['key'])\n ) {\n $key = $options['storage']['registry']['key'];\n }\n\n Zend_Registry::set($key, $this->_acl);\n }",
"public function store(QRCodeInterface $qrCode, $id = null);",
"public function store()\n {\n // Save post data in $job var\n if(!(int)$_POST['end_year']){\n $_POST['end_year'] = NULL;\n }\n $job = $_POST;\n\n // Set created_by ID and set the date of creation\n $job['user_id'] = Helper::getUserIdFromSession();\n $job['created_by'] = Helper::getUserIdFromSession();\n $job['created'] = date('Y-m-d H:i:s');\n\n // Save the record to the database\n JobModel::load()->store($job);\n \n // Return to the job-overview\n header(\"Location: /job\");\n }",
"private function maybeCreateAreas()\n {\n /** @var AreaProperties $area */\n foreach ($this->newAreas as $area) {\n $post = array(\n 'post_type' => 'kb-dyar',\n 'post_title' => $area->name,\n 'post_name' => $area->id,\n 'post_status' => 'publish'\n );\n $id = wp_insert_post($post);\n\n if ($id) {\n $storage = new DataProvider($id, 'post');\n $storage->add('_area', $area->export());\n // custom meta data which is specific to wp database structure/queries\n // not exactly area related data\n $storage->update('_kb_added_by_code', '1');\n }\n\n $trans = get_transient('kb_dynamic_areas');\n\n if (!$trans) {\n $trans = array();\n }\n\n $trans[] = $area->id;\n set_transient('kb_dynamic_areas', $trans, 60 * 15);\n }\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a generic Solr document object for this entity. This function will do the basic processing for the document that is common to all entities, but virtually all entities will need their own additional processing. | function _apachesolr_index_process_entity_get_document($entity, $entity_type) {
list($entity_id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);
$document = new ApacheSolrDocument();
// Define our url options in advance. This differs depending on the
// language
$languages = language_list();
$url_options = array('absolute' => TRUE);
if (isset($entity->language) && isset($languages[$entity->language])) {
$url_options['language'] = $languages[$entity->language];
}
$document->id = apachesolr_document_id($entity_id, $entity_type);
$document->site = url(NULL, $url_options);
$document->hash = apachesolr_site_hash();
$document->entity_id = $entity_id;
$document->entity_type = $entity_type;
$document->bundle = $bundle;
$document->bundle_name = entity_bundle_label($entity_type, $bundle);
if (empty($entity->language)) {
// 'und' is the language-neutral code in Drupal 7.
$document->ss_language = LANGUAGE_NONE;
}
else {
$document->ss_language = $entity->language;
}
$path = entity_uri($entity_type, $entity);
// A path is not a requirement of an entity
if (!empty($path)) {
$document->path = $path['path'];
$document->url = url($path['path'], $path['options'] + $url_options);
// Path aliases can have important information about the content.
// Add them to the index as well.
if (function_exists('drupal_get_path_alias')) {
// Add any path alias to the index, looking first for language specific
// aliases but using language neutral aliases otherwise.
$output = drupal_get_path_alias($document->path, $document->ss_language);
if ($output && $output != $document->path) {
$document->path_alias = $output;
}
}
}
return $document;
} | [
"function makeSolrDocument($solrDocument = false){\n\t\n\t\t if(!$solrDocument){\n\t\t\t\t $solrDocument = new Apache_Solr_Document();\n\t\t }\n\t\t \n\t\t //$solrDocument->id = $this->itemUUID;\n\t\t $solrDocument->uuid = $this->itemUUID;\n\t\t $solrDocument->item_label = $this->itemLabel; //primary label for item\n\t\t \n\t\t if((!$this->labelSort) || !is_numeric($this->labelSort)){\n\t\t\t\t\n\t\t\t\tif(function_exists(\"mb_substr_count\")){\n\t\t\t\t\t $sort = $this->nameSorter($this->itemLabel); //generate sort based on item label\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t $sort = $this->nameSorter_noMB($this->itemLabel); //generate sort based on item label, no multibyte working\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!is_numeric($sort)){\n\t\t\t\t\t $sort = ord($this->itemLabel);\n\t\t\t\t}\n\t\t\t\tif(!is_numeric($sort)){\n\t\t\t\t\t $sort = 0;\n\t\t\t\t}\n\t\t\t\t$solrDocument->label_sort = $sort; //generate sort based on item label\n\t\t }\n\t\t else{\n\t\t\t\t$solrDocument->label_sort = $this->labelSort; //sort on this score\n\t\t }\n\t\t \n\t\t \n\t\t $solrDocument->pub_date = $this->pubDate; //publication date. this is only created once\n\t\t $solrDocument->update = $this->update; //last date of significant update, a significant update is a change on the item\n\t\t \n\t\t /*\n\t\t $solrDocument->pubdateNum = strtotime($this->pubDate); //publication date. this is only created once\n\t\t $solrDocument->updateNum = strtotime($this->update); //last date of significant update, a significant update is a change on the item\n\t\t */\n\t\t \n\t\t $solrDocument->project_name = $this->projectName;\n\t\t $solrDocument->project_id = $this->projectUUID;\n\t\t $solrDocument->item_type = $this->documentType; //type of documents (spatial, media, etc.)\n\t\t \n\t\t \n\t\t /*\n\t\t Default Contexts: Default contexts are the most important / signifiant hierarchy in a collection's taxonomy\n\t\t They are slash (\"/\") seperated values, and used to make pretty URLs\n\t\t */\n\t\t if(!$this->defaultContextPath){\n\t\t\t\t$solrDocument->default_context_path = \"ROOT\";\n\t\t }\n\t\t else{\n\t\t\t\t$solrDocument->default_context_path = $this->defaultContextPath;\n\t\t }\n\t\t \n\t\t if(is_array($this->defaultContextArray)){\n\t\t\t\tforeach($this->defaultContextArray as $contextItem){\n\t\t\t\t\t $solrField = $contextItem[\"field\"];\n\t\t\t\t\t $solrValue = $contextItem[\"value\"];\n\t\t\t\t\t $solrDocument->$solrField = $solrValue;\n\t\t\t\t}\n\t\t }\n\t\t \n\t\t /*\n\t\t \n\t\t UPDATE linked_data\n\t\t SET linkedURI = REPLACE(linkedURI, 'http://www.eol.org/', 'http://eol.org/')\n\t\t \n\t\t \n\t\t */\n\t\t \n\t\t /*\n\t\t This enables indexing of hierarchic taxonomies, these are used for faceted searches\n\t\t */\n\t\t $allNote = \"\";\n\t\t if(is_array($this->properties)){\n\t\t\t\tforeach($this->properties as $prop){\n\t\t\t\t\t $value = $prop[\"value\"];\n\t\t\t\t\t $prefix = $prop[\"hashPath\"];\n\t\t\t\t\t \n\t\t\t\t\t if(!array_key_exists('setType', $prop)){\n\t\t\t\t\t\t $prop['setType'] = \"nominal\";\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t if($prop['type'] == \"integer\" && $prop['setType'] == \"integer\"){\n\t\t\t\t\t\t //$solrDocument->setMultiValue($prefix.\"_tax_int_hr\", $value); //human readable variant\n\t\t\t\t\t\t $suffix = \"_tax_int\";\n\t\t\t\t\t }\n\t\t\t\t\t elseif($prop['type'] == \"decimal\" && $prop['setType'] == \"decimal\"){\n\t\t\t\t\t\t //$solrDocument->setMultiValue($prefix.\"_tax_dec_hr\", $value); //human readable variant\n\t\t\t\t\t\t $suffix = \"_tax_dec\";\n\t\t\t\t\t }\n\t\t\t\t\t elseif($prop['type'] == \"integer\" && $prop['setType'] == \"decimal\"){\n\t\t\t\t\t\t //$solrDocument->setMultiValue($prefix.\"_tax_dec_hr\", $value); //human readable variant\n\t\t\t\t\t\t $suffix = \"_tax_dec\";\n\t\t\t\t\t }\n\t\t\t\t\t elseif($prop['type'] == \"decimal\" && $prop['setType'] == \"integer\"){\n\t\t\t\t\t\t //$solrDocument->setMultiValue($prefix.\"_tax_int_hr\", $value); //human readable variant\n\t\t\t\t\t\t $solrDocument->setMultiValue($prefix.\"_tax_int\", round($value,0));\n\t\t\t\t\t\t $suffix = \"_tax_dec\";\n\t\t\t\t\t }\n\t\t\t\t\t elseif($prop['type'] == \"calendric\" && $prop['setType'] == \"calendric\" ){\n\t\t\t\t\t\t $value = date(\"Y-m-d\\TH:i:s\\Z\", strtotime($value));\n\t\t\t\t\t\t //$value = str_replace(\"Z\", \".000Z\", $value);\n\t\t\t\t\t\t $suffix = \"_tax_cal\";\n\t\t\t\t\t }\n\t\t\t\t\t elseif(($prop['setType'] == \"integer\") && $prop['type'] == \"nominal\"){\n\t\t\t\t\t\t $suffix = \"_int_taxon\";\n\t\t\t\t\t }\n\t\t\t\t\t elseif(($prop['setType'] == \"decimal\") && $prop['type'] == \"nominal\"){\n\t\t\t\t\t\t $suffix = \"_dec_taxon\";\n\t\t\t\t\t }\n\t\t\t\t\t elseif(($prop['setType'] == \"calendric\") && $prop['type'] == \"nominal\"){\n\t\t\t\t\t\t $suffix = \"_cal_taxon\";\n\t\t\t\t\t }\n\t\t\t\t\t elseif($prop['setType'] == \"alphanumeric\"){\n\t\t\t\t\t\t $suffix = \"_tax_alpha\";\n\t\t\t\t\t }\n\t\t\t\t\t else{\n\t\t\t\t\t\t $suffix = \"_taxon\";\n\t\t\t\t\t }\n\t\t\t\t\t $taxonField = $prefix.$suffix;\n\t\t\t\t\t $solrDocument->setMultiValue($taxonField, $value);\n\t\t\t\t}\n\t\t }\n\t\t \n\t\t /*\n\t\t This is used to index different variables and associated values, these are mainly used for table outputs\n\t\t */\n\t\t if(is_array($this->variables)){\n\t\t\t\t$keyVarArray = array();\n\t\t\t \n\t\t\t\t$niceVariables = $this->remove_redundant_parent_taxa_from_variables(); // removes parent taxon levels, leaves only full taxon\n\t\t\t\tforeach($niceVariables as $niceVar){\n\t\t\t\t\t $solrDocument->setMultiValue(\"variables\", $niceVar); //index list of variable names\n\t\t\t\t\t foreach($this->variables as $varVal){\n\t\t\t\t\t\t $var = trim($varVal['var']);\n\t\t\t\t\t\t $val = trim($varVal['val']);\n\t\t\t\t\t\t if($niceVar == $var){\n\t\t\t\t\t\t\t\t$keyVarArray[$var] = $val;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$solrDocument->var_vals = Zend_Json::encode($keyVarArray);\n\t\t\t\tforeach($keyVarArray as $varKey => $val){\n\t\t\t\t\t $solrDocument->setMultiValue(\"notes\", $varKey.\": \".$val); //add notes for full-text searches\n\t\t\t\t\t $allNote .= $varKey.\": \".$val.\" \";\n\t\t\t\t}\n\t\t }\n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t if(is_array($this->classes)){\n\t\t\t\tforeach($this->classes as $class){\n\t\t\t\t\t $solrDocument->setMultiValue(\"item_class\", $class); //class of item (can have multiple)\n\t\t\t\t}\n\t\t }\n\t\t \n\t\t if(is_array($this->linkedPersons)){\n\t\t\t\tforeach($this->linkedPersons as $person){\n\t\t\t\t\t $solrDocument->setMultiValue(\"person_link\", $person);\n\t\t\t\t}\n\t\t }\n\t\t \n\t\t if(is_array($this->linkedPersonURIs)){\n\t\t\t\tforeach($this->linkedPersonURIs as $personURI){\n\t\t\t\t\t $solrDocument->setMultiValue(\"person_uri\", $personURI);\n\t\t\t\t}\n\t\t }\n\t\t\t\n\t\t if(is_array($this->alphaNotes)){\n\t\t\t\tforeach($this->alphaNotes as $note){\n\t\t\t\t\t //$solrDocument->setMultiValue(\"notes\", $note); //add notes for full-text searches\n\t\t\t\t\t $allNote .= \" \".$note.\" \";\n\t\t\t\t}\n\t\t }\n\t\t \n\t\t //testing to see if solr actually indexes all of these \n\t\t $solrDocument->setMultiValue(\"notes\", $allNote); //add notes for full-text searches\n\t\t \n\t\t\t\n\t\t //take care of geographic data\n\t\t if(!$this->geo){\n\t\t\t\t$solrDocument->geo_lat = 0; //no geo data, stick in Atlantic\n\t\t\t\t$solrDocument->geo_long = 0; //no geo data, stick in Atlantic\n\t\t\t\t$solrDocument->geo_point = \"0,0\"; //geo point\n\t\t\t\t$solrDocument->geo_coord = \"0,0\"; //geo point\n\t\t }\n\t\t else{\n\t\t\t\t$geoData = $this->geo;\n\t\t\t\t$solrDocument->geo_lat = $geoData['lat']; //geo data, latitude\n\t\t\t\t$solrDocument->geo_long = $geoData['lon']; //geo data, longitude\n\t\t\t\t\n\t\t\t\t$geoPoint = \"0,0\";\n\t\t\t\tif(isset( $geoData['lat']) && isset( $geoData['lon'])){\n\t\t\t\t\t $geoPoint = $geoData['lat'].\",\".$geoData['lon']; //geo point\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$solrDocument->geo_coord = $geoPoint; //geo point, for geospatial queries\n\t\t\t\t$solrDocument->geo_point = $geoPoint; //geo point, for facets\n\t\t\t\t$solrDocument->geo_path = $geoData[\"geoTile\"][\"path\"]; //geo path\n\t\t\t\t$i = 1;\n\t\t\t\tforeach($geoData[\"geoTile\"][\"tiles\"] as $tileArray){\n\t\t\t\t\t //$dynamicGeoTileField = $i.\"_geo_tile\";\n\t\t\t\t\t $dynamicGeoTileField = $tileArray[\"field\"].\"_geo_tile\";\n\t\t\t\t\t $tile = $tileArray[\"value\"];\n\t\t\t\t\t \n\t\t\t\t\t //$solrDocument->$dynamicGeoTileField = $tile; //commented out. don't add dynamic fields for this, a memory hog\n\t\t\t\t\t \n\t\t\t\t\t if($i >= self::maxZoom){\n\t\t\t\t\t\t break; //stop, no need to make tiles deeper than this\n\t\t\t\t\t }\n\t\t\t\t\t $i++;\n\t\t\t\t}\n\t\t }\n\t\t\t\n\t\t //take care of chronological data\n\t\t if($this->chrono != false){\n\t\t\t\t$chrono = $this->chrono;\n\t\t\t\t$solrDocument->setMultiValue(\"time_start\", $chrono[\"timeStart\"]);\n\t\t\t\t//$solrDocument->setMultiValue(\"time_start_hr\", $chrono[\"timeStart\"]);\n\t\t\t\t$solrDocument->setMultiValue(\"time_end\", $chrono[\"timeEnd\"]);\n\t\t\t\t//$solrDocument->setMultiValue(\"time_end_hr\", $chrono[\"timeEnd\"]);\n\t\t\t\t$solrDocument->setMultiValue(\"time_path\", $chrono[\"chronoPath\"]); //chronology path\n\t\t\t\t\n\t\t\t\tif($chrono[\"chronoTagger\"] != false){\n\t\t\t\t //$solrDocument->setMultiValue(\"chrono_creator_name\", $chrono[\"chronoTagger\"]); //chrono tag creator\n\t\t\t\t}\n\t\t\t\tif($chrono[\"chronoSet\"] != false){\n\t\t\t\t //$solrDocument->setMultiValue(\"chrono_set_label\", $chrono[\"chronoSet\"]); //chrono tag creator\n\t\t\t\t}\n\t\t }\n\t\t\t\n\t\t //other Dublin Core metadata\n\t\t if(is_array($this->creators)){\n\t\t\t\tforeach($this->creators as $creator){\n\t\t\t\t\t $solrDocument->setMultiValue(\"creator\", $creator);\n\t\t\t\t}\n\t\t }\n\t\t if(is_array($this->contributors)){\n\t\t\t\tforeach($this->contributors as $contributor){\n\t\t\t\t\t $solrDocument->setMultiValue(\"contributor\", $contributor);\n\t\t\t\t}\n\t\t }\n\t\t if(is_array($this->coverages)){\n\t\t\t\tforeach($this->coverages as $coverage){\n\t\t\t\t\t $solrDocument->setMultiValue(\"coverage\", $coverage);\n\t\t\t\t}\n\t\t }\n\t\t if(is_array($this->subjects)){\n\t\t\t\tforeach($this->subjects as $subject){\n\t\t\t\t\t $solrDocument->setMultiValue(\"subjects\", $subject);\n\t\t\t\t}\n\t\t }\n\t\t if($this->license != false){\n\t\t\t\t$solrDocument->license_uri = $this->license;\n\t\t }\n\t\t \n\t\t //media counts\n\t\t if($this->imageLinkNum != false){\n\t\t\t\t$solrDocument->image_media_count = $this->imageLinkNum;\n\t\t }\n\t\t else{\n\t\t\t\t$solrDocument->image_media_count = 0;\n\t\t }\n\t\t if($this->otherLinkNum != false){\n\t\t\t\t$solrDocument->other_binary_media_count = $this->otherLinkNum;\n\t\t }\n\t\t else{\n\t\t\t\t$solrDocument->other_binary_media_count = 0;\n\t\t }\n\t\t if($this->docLinkNum != false){\n\t\t\t\t$solrDocument->diary_count = $this->docLinkNum;\n\t\t }\n\t\t else{\n\t\t\t\t$solrDocument->diary_count = 0;\n\t\t }\n\t\t \n\t\t //user generated tags\n\t\t if(is_array($this->userTags)){\n\t\t\t\tforeach($this->userTags as $tag){\n\t\t\t\t //$solrDocument->setMultiValue(\"user_tag\", $tag);\n\t\t\t\t}\n\t\t }\n\t\t if(is_array($this->userTagCreators)){\n\t\t\t\tforeach($this->userTagCreators as $tagCreator){\n\t\t\t\t //$solrDocument->setMultiValue(\"tag_creator_name\", $tagCreator);\n\t\t\t\t}\n\t\t }\n\t\t \n\t\t if(!$this->interestScore){\n\t\t\t\t$this->interestScore = $this->interestCalc(); //if no interest score, calculate it\n\t\t }\n\t\t if(!$this->interestScore){\n\t\t\t\t$this->interestScore = 0; //if no interest score, calculate it\n\t\t }\n\t\t $solrDocument->interest_score = $this->interestScore; //interest score, for complicated ranking of results\n\t\t \n\t\t return $solrDocument;\n }",
"function apachesolr_convert_entity_to_documents($entity, $entity_type, $env_id) {\n list($entity_id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);\n\n // Create a new document, and do the bare minimum on it.\n $document = _apachesolr_index_process_entity_get_document($entity, $entity_type);\n\n //Get the callback array to add stuff to the document\n $document_callbacks = apachesolr_entity_get_callback($entity_type, 'document callback', $bundle);\n $documents = array();\n foreach ($document_callbacks as $document_callback) {\n // Call a type-specific callback to add stuff to the document.\n $documents = array_merge($documents, $document_callback($document, $entity, $entity_type, $env_id));\n }\n\n //do this for all possible documents that were returned by the callbacks\n foreach ($documents as $document) {\n // Call an all-entity hook to add stuff to the document.\n module_invoke_all('apachesolr_index_document_build', $document, $entity, $entity_type, $env_id);\n\n // Call a type-specific hook to add stuff to the document.\n module_invoke_all('apachesolr_index_document_build_' . $entity_type, $document, $entity, $env_id);\n\n // Final processing to ensure that the document is properly structured.\n // All records must have a label field, which is used for user-friendly labeling.\n if (empty($document->label)) {\n $document->label = '';\n }\n\n // All records must have a \"content\" field, which is used for fulltext indexing.\n // If we don't have one, enter an empty value. This does mean that the entity\n // will not be fulltext searchable.\n if (empty($document->content)) {\n $document->content = '';\n }\n\n // All records must have a \"teaser\" field, which is used for abbreviated\n // displays when no highlighted text is available.\n if (empty($document->teaser)) {\n $document->teaser = truncate_utf8($document->content, 300, TRUE);\n }\n }\n\n // Now allow modules to alter each other's additions for maximum flexibility.\n\n // Hook to allow modifications of the retrieved results\n foreach (module_implements('apachesolr_index_documents_alter') as $module) {\n $function = $module . '_apachesolr_index_documents_alter';\n $function($documents, $entity, $entity_type, $env_id);\n }\n\n return $documents;\n}",
"public function getSolrObject()\n\t{\n\t\treturn $this->_solrObject;\n\t}",
"function apachesolr_index_entity_to_documents($item, $env_id) {\n global $user;\n drupal_save_session(FALSE);\n $saved_user = $user;\n // build the content for the index as an anonymous user to avoid exposing restricted fields and such.\n // By setting a variable, indexing can take place as a different user\n $uid = variable_get('apachesolr_index_user', 0);\n if ($uid == 0) {\n $user = drupal_anonymous_user();\n }\n else {\n $user = user_load($uid);\n }\n // Pull out all of our pertinent data.\n $entity_type = $item->entity_type;\n\n // Entity cache will be reset at the end of the indexing algorithm, to use the cache properly whenever\n // the code does another entity_load\n $entity = entity_load($entity_type, array($item->entity_id));\n $entity = $entity ? reset($entity) : FALSE;\n\n if (empty($entity)) {\n // If the object failed to load, just stop.\n return FALSE;\n }\n\n $documents = apachesolr_convert_entity_to_documents($entity, $entity_type, $env_id);\n\n // Restore the user.\n $user = $saved_user;\n drupal_save_session(TRUE);\n\n return $documents;\n}",
"public function search_get_document() {\n $doc = new local_ousearch_document();\n $doc->init_module_instance('forumng',\n $this->get_forum()->get_course_module(true));\n if ($groupid = $this->discussion->get_group_id()) {\n $doc->set_group_id($groupid);\n }\n $doc->set_int_refs($this->get_id());\n return $doc;\n }",
"public function createDocument()\r\n {\r\n return new Document($this);\r\n }",
"public static abstract function mapToEntity(BSONDocument $document);",
"public function document()\n\t{\n\t\t$this->trigger_events('document');\n\n\t\t$document = array();\n\t\tif (isset($this->response[0]))\n\t\t{\n\t\t\t// Clone mongoid of the resulting array, if necessary\n\t\t\t$this->response[0] = $this->_clone_mongoid($this->response[0]);\n\t\t\t// Get the first result as an object\n\t\t\t$document = (object) $this->response[0];\n\t\t}\n\t\t// Free memory\n\t\tunset($this->response);\n\n\t\treturn $document;\n\t}",
"public function getSearchDocument();",
"public function getDocument() {\n return $this->getObject();\n }",
"public function getDocument()\n {\n if (!$this->document) {\n $document = null;\n if ($this->isBookmarkRequest()) {\n $document = $this->getBookmarkedDocumentFromRequest();\n }\n if ($this->isMaskRequest() && !$document) {\n $document = $this->getDocumentByMaskAndIdFromRequest();\n }\n if (!$document && $this->getDocumentIdFromRoute()) {\n $document = $this->getDocumentById($this->getDocumentIdFromRoute());\n }\n if ($document) {\n $this->setDocument($document);\n }\n }\n\n return $this->document;\n }",
"public function getSolr() {\n $this->_solr = new Pas_Solr_MoreLikeThis();\n return $this->_solr;\n }",
"public function documentAction() {\r\n $id = $this->getParam(\"id\");\r\n $success = false;\r\n\r\n try {\r\n if ($this->isGet()) {\r\n $doc = Document::getById($id);\r\n if (!$doc) {\r\n $this->encoder->encode(array( \"success\" => false,\r\n \"msg\" => \"Document does not exist\",\r\n \"code\" => self::ELEMENT_DOES_NOT_EXIST));\r\n return;\r\n }\r\n\r\n $this->checkPermission($doc, \"get\");\r\n\r\n if ($doc) {\r\n $type = $doc->getType();\r\n $getter = \"getDocument\" . ucfirst($type) . \"ById\";\r\n\r\n if (method_exists($this->service, $getter)) {\r\n $object = $this->service->$getter($id);\r\n } else {\r\n // check if the getter is implemented by a plugin\r\n $class = \"\\\\Pimcore\\\\Model\\\\Webservice\\\\Data\\\\Document\\\\\" . ucfirst($type) . \"\\\\Out\";\r\n if (class_exists($class)) {\r\n Document\\Service::loadAllDocumentFields($doc);\r\n $object = Webservice\\Data\\Mapper::map($doc, $class, \"out\");\r\n } else {\r\n throw new \\Exception(\"unknown type\");\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n if (!$object) {\r\n throw new \\Exception(\"could not find document\");\r\n }\r\n @$this->encoder->encode(array(\"success\" => true, \"data\" => $object));\r\n return;\r\n } else if ($this->isDelete()) {\r\n $doc = Document::getById($id);\r\n if ($doc) {\r\n $this->checkPermission($doc, \"delete\");\r\n }\r\n $success = $this->service->deleteDocument($id);\r\n $this->encoder->encode(array(\"success\" => $success));\r\n return;\r\n } else if ($this->isPost() || $this->isPut()) {\r\n $data = file_get_contents(\"php://input\");\r\n $data = \\Zend_Json::decode($data);\r\n\r\n $type = $data[\"type\"];\r\n $id = null;\r\n $typeUpper = ucfirst($type);\r\n $className = \"\\\\Pimcore\\\\Model\\\\Webservice\\\\Data\\\\Document\\\\\" . $typeUpper . \"\\\\In\";\r\n\r\n if ($data[\"id\"]) {\r\n $doc = Document::getById($data[\"id\"]);\r\n if ($doc) {\r\n $this->checkPermission($doc, \"update\");\r\n }\r\n\r\n $isUpdate = true;\r\n $setter = \"updateDocument\" . $typeUpper;\r\n if (!method_exists($this->service, $setter)) {\r\n throw new \\Exception(\"method does not exist \" . $setter);\r\n }\r\n $wsData = self::fillWebserviceData($className, $data);\r\n $success = $this->service->$setter($wsData);\r\n\r\n } else {\r\n $setter = \"createDocument\" . $typeUpper;\r\n if (!method_exists($this->service, $setter)) {\r\n throw new \\Exception(\"method does not exist \" . $setter);\r\n }\r\n $wsData = self::fillWebserviceData($className, $data);\r\n $doc = new Document();\r\n $doc->setId($wsData->parentId);\r\n $this->checkPermission($doc, \"create\");\r\n\r\n $id = $this->service->$setter($wsData);\r\n\r\n }\r\n\r\n if (!$isUpdate) {\r\n $success = $id != null;\r\n }\r\n\r\n if ($success && !$isUpdate) {\r\n $this->encoder->encode(array(\"success\" => $success, \"id\" => $id));\r\n } else {\r\n $this->encoder->encode(array(\"success\" => $success));\r\n }\r\n return;\r\n\r\n }\r\n\r\n } catch (\\Exception $e) {\r\n $this->encoder->encode(array(\"success\" => false, \"msg\" => (string) $e));\r\n }\r\n $this->encoder->encode(array(\"success\" => false));\r\n }",
"public function toInsertSOLRdocument(&$client, $id='', $sid, $datasource, $resultNumber, $seg, $user, $dscachetimestamp) {\n \n //print \"<br>toInsertSOLRdocument ($datasource)<br>\";\n\n // create a new document for the data\n $result_doc = new Solarium_Document_ReadWrite();\n\n $result_doc->sid = $sid;\n $result_doc->seg = $seg;\n $result_doc->lod = $this->getLod()?1:0;\n $result_doc->rank \t\t= $this->getRank();\n if ($this->getExplanation())\n \t$result_doc->explanation= $this->getExplanation();\n\t\t\n\t\t\n\t\tif ($result_doc->rank == 0)\n\t\t{\n\t\t\t//print \"<br>NULL RANK... stimmtes? \";var_dump($this);\n\t\t}\n\t\t\n\t\t\n $result_doc->rank = $result_doc->rank; //FRI neu\n $result_doc->user = $user;\n $result_doc->id = $id // do we have already one id?\n \t\t\t\t\t\t\t\t\t\t\t\t? $id // yes: take old id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//: $result_doc->sid.'-'.$resultNumber.'-'.uniqid(); //SOLR ID unique!!!\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: $result_doc->sid.'-'.$datasource.'-'.$resultNumber; //SOLR ID unique - but if it comes several times, only one doc should be stored\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n $result_doc->type = $this->getResultType();\n $result_doc->title = encode4solr($this->getTitle());\n $result_doc->authors = encode4solr($this->getAuthors());\n $result_doc->date = $this->getDate();\n $result_doc->urlPage = encode4solr($this->getUrlPage());\n $result_doc->wdatasource = $datasource; //rodin datasource id (the widget url)\n $result_doc->wdscachetimestamp = $dscachetimestamp; //rodin datasource generation time of the current record\n \n \n //print \"<hr>inserting result: \";var_dump($result_doc);\n \n //Add specific attr/value fields:\n\n $fulltext=$result_doc->title;\n\n foreach ($this->resultProperties as $propertyName=>$propertyValue) {\n\t\t\tif ($propertyValue != '') {\n\n $result_doc->$propertyName = $propertyValue;\n\n $fields[] = array($propertyName,'string',$propertyValue);\n $fulltext.=($fulltext<>'')?' ':'';\n\t\t\t}\n\t\t}\n #Put everything together in order to find per search the value: TBD \n $result_doc->body = encode4solr($fulltext);\n \n\t\treturn $result_doc;\n\t}",
"public function getSolr() {\n $this->_solr = new Pas_Solr_Handler();\n return $this->_solr;\n }",
"public function populateFromSolr($document, $all = false) {\r\n\t\tif ($all) {\r\n\t\t\t$results = array();\r\n\t\t\tforeach($document as $doc) {\r\n\t\t\t\t$results[] = $this->populateFromSolr($doc,false);\r\n\t\t\t}\r\n\t\t\treturn $results;\r\n\t\t}\r\n\t\t$relations = $this->getOwner()->getMetaData()->relations;\r\n\t\t$attributes = array();\r\n\t\t$relationAttributes = array();\r\n\t\tforeach($this->getAttributes() as $modelAttribute => $docAttribute) {\r\n\t\t\t$resolved = $this->resolveAttributeName($modelAttribute);\r\n\t\t\tif (!strstr($modelAttribute,\".\")) {\r\n\t\t\t\t$attributes[$modelAttribute] = $document->{$resolved};\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t$reference = &$relationAttributes;\r\n\t\t\t$pointers = explode(\".\",$modelAttribute);\r\n\t\t\t$last = array_pop($pointers);\r\n\t\t\tforeach($pointers as $pointer) {\r\n\t\t\t\tif (!isset($reference[$pointer])) {\r\n\t\t\t\t\t$reference[$pointer] = array();\r\n\t\t\t\t}\r\n\t\t\t\t$reference =& $reference[$pointer];\r\n\t\t\t}\r\n\t\t\t$reference[$last] = $document->{$resolved};\r\n\t\t}\r\n\t\t$modelClass = get_class($this->getOwner());\r\n\t\t$model = $modelClass::model()->populateRecord($attributes);\r\n\t\tif (count($relationAttributes)) {\r\n\t\t\tforeach($relationAttributes as $relationName => $attributes) {\r\n\t\t\t\t$relationClass = $relations[$relationName]->className;\r\n\t\t\t\t$model->{$relationName} = $relationClass::model()->populateRecord($attributes);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $model;\r\n\t}",
"public function getDocument()\n {\n if (!$document = $this->jsonApiRequest->getDocument()) {\n return null;\n }\n\n return new Document($document);\n }",
"public function getInputDocument()\n {\n if ($this->_inputDocument !== null) {\n\t\t\treturn $this->_inputDocument;\n\t\t}\n\t\t$this->_inputDocument = new SolrInputDocument();\n\t\tforeach($this->solrAttributeNames() as $attribute) {\n\t\t\tif ($this->{$attribute} !== null) {\n\t\t\t\tif (is_array($this->{$attribute})) {\n\t\t\t\t\tforeach($this->{$attribute} as $value) {\n\t\t\t\t\t\t$this->_inputDocument->addField($attribute,$value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->_inputDocument->addField($attribute,$this->prepareAttribute($attribute));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->_inputDocument;\n }",
"public static function uploadDocument()\n\t{\n\t\t$dal = new \\FATS\\DAL\\DataAccessLayer();\n\n\t\t/**\n\t\t * Attach the event handler\n\t\t */\n\t\tnew \\FATS\\DAL\\DataTransactionMonitor($dal);\n\n\t\treturn $dal->createDocument();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve customer IDs for reindex | protected function getCustomerIdsForReindex()
{
$connection = $this->resource->getConnection();
$gridTableName = $this->flatScopeResolver->resolve(Customer::CUSTOMER_GRID_INDEXER_ID, []);
$select = $connection->select()
->from($this->resource->getTableName($gridTableName), 'last_visit_at')
->order('last_visit_at DESC')
->limit(1);
$lastVisitAt = $connection->query($select)->fetchColumn();
$select = $connection->select()
->from($this->resource->getTableName('customer_log'), 'customer_id')
->where('last_login_at > ?', $lastVisitAt);
$customerIds = [];
foreach ($connection->query($select)->fetchAll() as $row) {
$customerIds[] = $row['customer_id'];
}
return $customerIds;
} | [
"protected function _recentCustomerIds()\n\t{\n\t\t$this->_allCustomerIds($this->getRequest()->getParam('date', date('Y-m-d')));\n\t}",
"public function getAllCustomerID(): array\n {\n \\Logger::getLogger(\\get_class($this))->info(__METHOD__);\n if (\\count($this->customerID) === 0) {\n foreach ($this->getCustomer() as $customer) {\n if ($customer->issetCustomerID()) {\n $this->customerID[] = $customer->getCustomerID();\n }\n }\n }\n return $this->customerID;\n }",
"public function getTransactionsByCustomer(int $customerID);",
"public function getCustomerId();",
"private function getCustomerId()\n\t{\n\t\treturn (int)$this->context->cookie->id_customer;\n\t}",
"function get_customer($id_customer)\n {\n return $this->db->get_where('customer',array('id_customer'=>$id_customer))->row_array();\n }",
"public function updateCustomerProductIndex()\n\t{\n\t\ttry {\n\t\t\t$productIds = $this->_getCookie()->get(Df_PageCache_Model_Container_Viewedproducts::COOKIE_NAME);\n\t\t\tif ($productIds) {\n\t\t\t\t$productIds = explode(',', $productIds);\n\t\t\t\tMage::getModel('reports/product_index_viewed')->registerIds($productIds);\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\tMage::logException($e);\n\t\t}\n\n\t\t// renew customer viewed product ids cookie\n\t\t$countLimit = Mage::getStoreConfig(Mage_Reports_Block_Product_Viewed::XML_PATH_RECENTLY_VIEWED_COUNT);\n\t\t$collection = Mage::getResourceModel('reports/product_index_viewed_collection')\n\t\t\t->addIndexFilter()\n\t\t\t->setAddedAtOrder()\n\t\t\t->setPageSize($countLimit)\n\t\t\t->setCurPage(1);\n\t\tMage::getSingleton('catalog/product_visibility')->addVisibleInSiteFilterToCollection($collection);\n\t\t$productIds = $collection->load()->getLoadedIds();\n\t\t$productIds = implode(',', $productIds);\n\t\t$this->_getCookie()->registerViewedProducts($productIds, $countLimit, false);\n\t\treturn $this;\n\t}",
"private function registerCustomerId(int $customerId): void\n {\n $this->registry->unregister(RegistryConstants::CURRENT_CUSTOMER_ID);\n $this->registry->register(RegistryConstants::CURRENT_CUSTOMER_ID, $customerId);\n }",
"public function getCustomerId()\n {\n return $this->customer_id;\n }",
"function get_customers($id)\n {\n \n return $this->db->get_where('customers',array('id'=>$id))->row_array();\n }",
"public function getCustomers();",
"function customerAllList() {\n $arrClms = array(\n 'pkCustomerID',\n 'CustomerFirstName',\n 'CustomerLastName',\n 'CustomerEmail'\n );\n $varOrderBy = \" CustomerFirstName ASC \";\n $arrRes = $this->select(TABLE_CUSTOMER, $arrClms, '', $varOrderBy);\n foreach ($arrRes as $k => $v) {\n $arrRow[$v['pkCustomerID']] = $v;\n }\n\n return $arrRow;\n }",
"public function testGETCustomerIdReturns()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function customerTaxIds()\n {\n return $this->invoice->customer_tax_ids ?? [];\n }",
"public function getIdCust()\n {\n return $this->id_cust;\n }",
"public function listCustomers()\n {\n return $this->request('GET', '/customers');\n }",
"function get_customer($customer_id)\n {\n return $this->db->get_where('customer',array('customer_id'=>$customer_id))->row_array();\n }",
"public function getCompanyCustomerId();",
"public function getAllCustomers(){\n\t\t$ts_uniqueArray = array();\n\t\t$sql = \"SELECT oc.email, CONCAT(oc.firstname,' ',oc.lastname) as name, oc.customer_id FROM \".DB_PREFIX.\"customer oc UNION SELECT c.email, c.name, c.customer_id FROM \".DB_PREFIX.\"ts_customers c \";\n\t\t\n\t\t$sql .= $this->TsLoader->TsHelper->getFilterData(false);\n\t\t$result = $this->db->query($sql)->rows;\n\t\tforeach ($result as $key => $value) {\n\t\t\t$ts_uniqueArray[$value['email']] = $value;\t\t\n\t\t}\n\treturn $ts_uniqueArray;\n\t\t\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
print_r($contents); print_r($demographics); $likedTags = explode("\n", trim($contents[4])); print_r($dislikedTags); | function parseFile($string) {
global $contents, $demographics, $likedArticles, $dislikedAricles, $dislikedTags;
$file = file_get_contents($string);
$contents = explode("\n\n\n", $file);
$demographics = explode("\n", trim($contents[0]));
$likedArticles = explode("\n", trim($contents[1]));
$dislikedArticles = explode("\n", trim($contents[2]));
$readLater = explode("\n", trim($contents[3]));
echo "CONTENTS 3 : </br>";
print_r($readLater);
echo "</br></br></br>";
} | [
"function GetAllPostTags($contents, &$tag_list=array(\"\"), $caseSensitive=true) {\n global $tagstr;\n $startPos = 0;\n do { \n $tag = GetNextTag($contents,$startPos);\n //echo $tag . \" \";\n if (($startPos < 0) | ($tag == \"\"))\n break; //tag could not be assigned, list is done\n \n if (arPos($tag_list,$tag,$caseSensitive)===false)\n\t\t$tag_list[]=$tag;\n\t\t\n $startPos++; //increment so we don't read the same character twice\n } while (($startPos > 0)); \n \n return $tag_list;\n}",
"static function findImageText() {\n $title = array();\n $pattern = \"/title=['\\\"]([^'\\\"]*)['\\\"]*+/i\";\n preg_match_all( $pattern, self::$body, $title );\n\n $alt = array();\n $pattern = \"/alt=['\\\"]([^'\\\"]*)['\\\"]*+/i\";\n preg_match_all( $pattern, self::$body, $alt );\n\n $titlewords = implode( ' ', $title[1] );\n $altwords = implode( ' ', $alt[1] );\n return explode( ' ', trim( $titlewords . ' ' . $altwords ));\n }",
"static function findImageText() {\r\n $title = array();\r\n $pattern = \"/title=['\\\"]([^'\\\"]*)['\\\"]*+/i\";\r\n preg_match_all( $pattern, self::$body, $title );\r\n\r\n $alt = array();\r\n $pattern = \"/alt=['\\\"]([^'\\\"]*)['\\\"]*+/i\";\r\n preg_match_all( $pattern, self::$body, $alt );\r\n\r\n $titlewords = implode( ' ', $title[1] );\r\n $altwords = implode( ' ', $alt[1] );\r\n return explode( ' ', trim( $titlewords . ' ' . $altwords ));\r\n }",
"function displayEditorial()\n{\n $fileName = \"editorial.txt\";\n $data = file($fileName);\n $return = \"\";\n \n if(!file_exists($fileName))\n {\n $return = \"File does not exist or unable to open\";\n return $return;\n }\n else\n {\n foreach($data as $line)\n {\n list($info) = explode(\"|\", $line);\n $return .=\"<p> $info </p>\";\n }\n return $return;\n }\n \n}",
"function explodeContent($content) {\n\t$explode = explode('</p>', $content);\n\tif (stripos($explode['0'], 'jpg') || stripos($explode['0'], 'png')) {\n\t\t$GLOBALS['img'] = array_shift($explode);\n\t} else {\n\t\t$GLOBALS['img'] = '<p><img style=\"display: block; margin-left: auto; margin-right: auto;\" src=\"img/logo.jpg\" /></p>';\n\t}\n\n\tif (stripos($explode['0'] , ' ')) {\n\t\t$explode['0'] .= $explode['1']; \n\t}\n\treturn $explode;\n}",
"function explode_bis($source_, $separateurs_) {\n /*$chaine = \"Bonjour tout le monde\";\n $var_tab_mots = explode(\" \", $chaine);\n foreach ($var_tab_mots as $key => $mot) {\n echo $key . \" : \" . $mot . \"<br />\";\n }*/\n\n global $tab_mots_vides;\n $tab = array();\n\n $tok = strtok ( $source_, $separateurs_);\n //&&!in_array($tok,$tab_mots_vides)\n while ( $tok !== false ) {\n if(strlen($tok) > 2 ) {\n\t\t//echo $tok;\n $tab[] = trim($tok);\n\t \n }\n $tok = strtok($separateurs_);\n }\n return $tab;\n}",
"function extract_motion_text_from_wiki_text($text)\n{\n $motion = extract_motion_text_from_wiki_text_for_edit($text);\n\n if (!preg_match(\"/.*<\\/.*?>/\", $motion))\n {\n $motionlines = explode(\"\\n\", $motion);\n $binUL = 0;\n $res = array();\n $matches = array();\n foreach ($motionlines as $motionline)\n {\n $ml = preg_replace(\"/''(.*?)''/\", \"<em>\\\\1</em>\", $motionline);\n $ml = preg_replace(\"/\\[(https?:\\S*)\\s+(.*?)\\]/\", \"<a href=\\\"\\\\1\\\">\\\\2</a>\", $ml);\n $ml = preg_replace(\"/(?<![*\\s])(\\[(\\d+)\\])/\", \"<sup class=\\\"sup-\\\\2\\\"><a class=\\\"sup\\\" href=\\\"#footnote-\\\\2\\\" onclick=\\\"ClickSup(\\\\2); return false;\\\">\\\\1</a></sup>\", $ml);\n #$ml = preg_replace(\"/(\\[\\d+])/\", \"<sup>\\\\1</sup>\", $ml);\n if (preg_match(\"/^\\s\\s*$/\", $ml))\n continue;\n if (preg_match(\"/^@/\", $ml)) // skip comment lines we lift up for the short sentences\n continue;\n if (preg_match(\"/^(\\*|:)/\", $ml))\n {\n if (!$binUL)\n $res[] = \"<ul>\";\n $binUL = (preg_match(\"/^\\*\\*/\", $ml) ? 2 : 1);\n if (preg_match(\"/^:/\", $ml))\n $binUL = 3;\n else if (preg_match(\"/^\\s*\\*\\s*\\[\\d+\\]/\", $ml, $matches))\n {\n $binUL = 4; \n $footnum = preg_replace(\"/[\\s\\*\\[\\]]+/\", \"\", $matches[0]); // awful stuff because I can't pull out bits like in python\n }\n $ml = preg_replace(\"/^(\\*\\*|\\*|:)\\s*/\", \"\", $ml);\n }\n else if ($binUL != 0)\n {\n $binUL = 0;\n $res[] = \"</ul>\";\n }\n\n \n if ($binUL == 0)\n $res[] = \"<p>\";\n else if ($binUL == 2)\n $res[] = \"<li class=\\\"house\\\">\";\n else if ($binUL == 3)\n $res[] = \"<li class=\\\"block\\\">\";\n else if ($binUL == 4)\n $res[] = \"<li class=\\\"footnote\\\" id=\\\"footnote-$footnum\\\">\";\n else\n $res[] = \"<li>\";\n \n $res[] = $ml;\n \n if ($binUL == 0)\n $res[] = \"</p>\";\n else\n $res[] = \"</li>\";\n }\n if ($binUL)\n $res[] = \"</ul>\";\n $motion = implode(\"\\n\", $res);\n #$motion = preg_replace(\"/\\*/\", \"HIHI\", $motion);\n }\n $motion = guy2html(guy_strip_bad(trim($motion)));\n\n return $motion;\n}",
"public function texttags() {\n\t$tags =\"\";\n\t//$array = $this->getTags()->toArray();\n\t$array = $this->getTags();\n\tforeach ($array as $tag) {\n\t $tags.= $tag->getNombre(). \" \";\n\t}\n\t//echo $tags;\n\treturn $tags;\n//\treturn count($array );\n//\treturn count($this->getTags());\n\t//implode(\", \", ->toArray());\n }",
"function strip_annotations($content)\n{\n $text = str_replace(\"<div class='line'> </div>\", \"\", $content);\n $text = str_replace(\" \", \" \", $text);\n $text = str_replace(\"​\", \"\", $text);\n $text = strip_tags($text);\n $text = str_replace(\" \\n\", \"\\n\", $text);\n $text = htmlspecialchars_decode($text, ENT_QUOTES);\n \n return $text;\n}",
"public function get_tags() {\n\t\t$tags = array(\n\t\t\t'download' => array(\n\t\t\t\t'tag' => strtolower( edd_get_label_singular() ),\n\t\t\t\t'description' => __( 'Name of the download the review was posted on', 'edd-reviews' ),\n\t\t\t\t'function' => 'download_tag',\n\t\t\t\t'discount' => true,\n\t\t\t),\n\t\t\t'direct_link' => array(\n\t\t\t\t'tag' => 'direct_link',\n\t\t\t\t'description' => __( 'Direct link to the review', 'edd-reviews' ),\n\t\t\t\t'function' => 'direct_link_tag'\n\t\t\t),\n\t\t\t'author' => array(\n\t\t\t\t'tag' => 'author',\n\t\t\t\t'description' => __( 'The review author', 'edd-reviews' ),\n\t\t\t\t'function' => 'author_tag',\n\t\t\t\t'discount' => true,\n\t\t\t),\n\t\t\t'email' => array(\n\t\t\t\t'tag' => 'email',\n\t\t\t\t'description' => __( \"The reviewer's email\", 'edd-reviews' ),\n\t\t\t\t'function' => 'email_tag',\n\t\t\t\t'discount' => true,\n\t\t\t),\n\t\t\t'url' => array(\n\t\t\t\t'tag' => 'url',\n\t\t\t\t'description' => __( \"The reviewer's URL\", 'edd-reviews' ),\n\t\t\t\t'function' => 'url_tag',\n\t\t\t\t'discount' => true,\n\t\t\t),\n\t\t\t'rating' => array(\n\t\t\t\t'tag' => 'rating',\n\t\t\t\t'description' => __( 'The rating given by the reviewer', 'edd-reviews' ),\n\t\t\t\t'function' => 'rating_tag',\n\t\t\t\t'discount' => true,\n\t\t\t),\n\t\t\t'title' => array(\n\t\t\t\t'tag' => 'title',\n\t\t\t\t'description' => __( 'The title of the review', 'edd-reviews' ),\n\t\t\t\t'function' => 'title_tag',\n\t\t\t\t'discount' => true,\n\t\t\t),\n\t\t\t'review' => array(\n\t\t\t\t'tag' => 'review',\n\t\t\t\t'description' => __( 'The content of the review', 'edd-reviews' ),\n\t\t\t\t'function' => 'review_tag',\n\t\t\t\t'discount' => true,\n\t\t\t),\n\t\t\t'item_as_described' => array(\n\t\t\t\t'tag' => 'item_as_described',\n\t\t\t\t'description' => __( 'If the item was as described or not', 'edd-reviews' ),\n\t\t\t\t'function' => 'item_as_described_tag',\n\t\t\t\t'fes' => true,\n\t\t\t),\n\t\t\t'feedback' => array(\n\t\t\t\t'tag' => 'feedback',\n\t\t\t\t'description' => __( 'The content of the feedback', 'edd-reviews' ),\n\t\t\t\t'function' => 'review_tag',\n\t\t\t\t'fes' => true,\n\t\t\t),\n\t\t\t'reviewer_discount_code' => array(\n\t\t\t\t'tag' => 'reviewer_discount_code',\n\t\t\t\t'description' => __( 'Discount code for the reviewer', 'edd-reviews' ),\n\t\t\t\t'function' => 'discount_tag',\n\t\t\t\t'discount' => true,\n\t\t\t)\n\t\t);\n\n\t\t$this->tags = $tags;\n\n\t\treturn apply_filters( 'edd_reviews_email_tags', $tags );\n\t}",
"function show_allowedtags()\n\t{\n\n\t\t$arr_example_tags=array();\n\n\t\tforeach($this->allowedtags as $tag => $arr_tag)\n\t\t{\n\n\t\t\t$arr_example_tags[]=htmlentities($arr_tag['example']);\n\n\t\t}\n\t\t\n\t\treturn implode(', ', $arr_example_tags);\n\n\t}",
"function getResults() {\n $fileArr = explode(\"\\n\", file_get_contents('dl.txt'));\n \n $i = 0;\n while (!empty($fileArr[$i])) {\n $results[$i] = explode(' ', $fileArr[$i]);\n $results[$i] = trim($results[$i][2]);\n ++$i;\n }\n return $results;\n}",
"function getLearnedTagnames() {\n\t\t\t$commaSeparatedList = get_option('yapb_learned_exif_tagnames');\n\t\t\tif ($commaSeparatedList == '') return array();\n\t\t\telse {\n\t\t\t\t$result = explode(',', $commaSeparatedList);\n\t\t\t\tsort($result, SORT_STRING);\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}",
"private function read_tags()\n{\n\n // Initialize\n $this->tags = unserialize(base64_decode($this->default_tags));\n if (!file_exists($this->theme_dir . '/tags.tpl')) { return; }\n\n // Set variables\n $lines = file($this->theme_dir . '/tags.tpl');\n $tag_name = '';\n $tag_html = '';\n\n // Go through lines\n foreach ($lines as $line) { \n if (preg_match(\"/\\*/\", $line)) { continue; }\n\n // Check for new tag\n if (preg_match(\"/^\\[\\[(.+?)\\]\\]/\", $line, $match)) { \n if ($tag_html != '') { $this->tags[$tag_name] = $tag_html; }\n $tag_name = $match[1];\n $tag_html = '';\n } elseif ($tag_name != '') { \n $tag_html .= $line;\n }\n }\n if ($tag_html != '') { $this->tags[$tag_name] = $tag_html; }\n\n}",
"function getAts($tweet){\r\n $tags = array();\r\n if(strpos($tweet, '@') === false) { return \"\"; } // does a quick check to see if @ is a part of the tweet\r\n else{\r\n $tweet = remNewlines($tweet);\r\n $words = explode(' ', $tweet); // turns the tweet into an array of words\r\n if(count($words) > 1){\r\n foreach($words as $word){ // loops through all the words in the tweet\r\n $char = str_split($word);\r\n if($char[0] == '@'){ // checks the first character and tests if its a @\r\n unset($char[0]);\r\n $tag = implode(\"\", $char);\r\n $tags[count($tags)] = $tag;\r\n \r\n }\r\n }\r\n foreach($tags as $value){\r\n $tagCheck = preg_replace(\"/[^a-zA-Z0-9]+/\", \"\", $value);\r\n if($value != $tagCheck){\r\n return \"\";\r\n exit();\r\n }\r\n }\r\n $tags = implode(\".\", $tags);\r\n }\r\n elseif(count($words) == 1){\r\n $charArray = str_split($tweet);\r\n unset($charArray[0]);\r\n $tags = implode(\"\", $charArray);\r\n }\r\n return $tags; // returns the formatted string of mentions\r\n }\r\n}",
"function wl_tagline () {\n\techo $this->valores['tagline'];\n}",
"function getTagsList($content, $b_left=\"[\", $b_right=\"]\") {\n $b_left = preg_quote ($b_left);\n $b_right = preg_quote ($b_right);\n $patern = '/'.$b_left.'(\\w{1,50})'.$b_right.'/siU';\n preg_match_all ( $patern , $content , $outdata);\n return array_unique($outdata[1]);\n}",
"function process_images_tag ($atts, $content) {\r\n\t\t$images = explode(\"\\n\", trim(strip_tags($content)));\r\n\t\t//return var_export($images,1);\r\n\t\t$activity_id = bp_get_activity_id();\r\n\t\tglobal $blog_id;\r\n\t\t$activity_blog_id = $blog_id;\r\n\t\tif ($activity_id) {\r\n\t\t\t$activity_blog_id = bp_activity_get_meta($activity_id, 'bpfb_blog_id');\r\n\t\t}\r\n\t\tob_start();\r\n\t\t@include(BPFB_PLUGIN_BASE_DIR . '/lib/forms/images_tag_template.php');\r\n\t\t$out = ob_get_clean();\r\n\t\treturn $out;\r\n\t}",
"static function seek_art($d){[$cat,$tag]=explode('-',$d);\n$r=ma::tag_arts($tag,$cat,7); unset($r[ses('read')]);\nif($r)foreach($r as $k=>$v)\n\t$ret[]=[ma::suj_of_id($k),'art','',$k,$d,'',$d,'article'];\nreturn $ret;}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
main This function is a redirect to modifyconfig | public function main()
{
return $this->modifyconfig();
} | [
"protected function _after_config()\n\t{\n\t}",
"function autolinks_admin_modifyconfig()\n{\n // Security check\n if (!pnSecAuthAction(0, 'Autolinks::', '::', ACCESS_ADMIN)) {\n return pnVarPrepHTMLDisplay(_MODULENOAUTH);\n }\n\n // Create output object - this object will store all of our output so that\n // we can return it easily when required\n\t$pnRender =& new pnRender('Autolinks');\n\n\t// As Admin output changes often, we do not want caching.\n\t$pnRender->caching = false;\n\n // Link everything or just first occurrance\n $pnRender->assign('linkfirst', pnModGetVar('Autolinks', 'linkfirst'));\n\n // Remove text decoration for links\n $pnRender->assign('invisilinks', pnModGetVar('Autolinks', 'invisilinks'));\n\n // Open links in a new window\n $pnRender->assign('newwindow', pnModGetVar('Autolinks', 'newwindow'));\n\n // Items per page in admin view screen\n\t$pnRender->assign('itemsperpage', pnModGetVar('Autolinks', 'itemsperpage'));\n\n return $pnRender->fetch('autolinks_admin_modifyconfig.htm');\n}",
"function before_edit_configuration() { }",
"protected function _configAction()\n {\n $this->_redirect('admin/system_config/edit', ['section' => $this->_configSection()]);\n }",
"public function onConfigUpdate() {}",
"public function testUpdateConfiguration2()\n {\n }",
"public function config();",
"public function testUpdateConfiguration()\n {\n }",
"function saveConfig()\n\t{\n\t\t$change = isset($this->post['change']) ? $this->post['change'] : '';\n\t\t\n\t\tswitch($change)\n\t\t{\n\t\t\tcase 'paths': $this->changePaths(); break;\n\t\t\tcase 'users': $this->changeUsers(); break;\n\t\t\tcase 'misc': $this->changeMisc(); break;\n\t\t\tcase 'ui': $this->changeUi(); break;\n\t\t\tcase 'mailing': $this->changeMailing(); break;\n\t\t\tcase 'namespaces': $this->changeNamespaces(); break;\n\t\t\tcase 'uploads': $this->changeUploads(); break;\n\t\t\tcase 'urlrewrite': $this->changeUrlRewrite(); break;\n\t\t\tcase 'parser': $this->changeParser(); break;\n\t\t}\n\t}",
"function writeConfig()\n{\n if (is_file($GLOBALS['config']['CONFIG_FILE']) && !isLoggedIn()) die('You are not authorized to alter config.'); // Only logged in user can alter config.\n $config='<?php $GLOBALS[\\'login\\']='.var_export($GLOBALS['login'],true).'; $GLOBALS[\\'hash\\']='.var_export($GLOBALS['hash'],true).'; $GLOBALS[\\'salt\\']='.var_export($GLOBALS['salt'],true).'; ';\n $config .='$GLOBALS[\\'timezone\\']='.var_export($GLOBALS['timezone'],true).'; date_default_timezone_set('.var_export($GLOBALS['timezone'],true).'); $GLOBALS[\\'title\\']='.var_export($GLOBALS['title'],true).';';\n $config .= '$GLOBALS[\\'redirector\\']='.var_export($GLOBALS['redirector'],true).'; ';\n $config .= '$GLOBALS[\\'disablesessionprotection\\']='.var_export($GLOBALS['disablesessionprotection'],true).'; ';\n $config .= '$GLOBALS[\\'disablejquery\\']='.var_export($GLOBALS['disablejquery'],true).'; ';\n $config .= '$GLOBALS[\\'privateLinkByDefault\\']='.var_export($GLOBALS['privateLinkByDefault'],true).'; ';\n $config .= ' ?>';\n if (!file_put_contents($GLOBALS['config']['CONFIG_FILE'],$config) || strcmp(file_get_contents($GLOBALS['config']['CONFIG_FILE']),$config)!=0)\n {\n echo '<script language=\"JavaScript\">alert(\"Shaarli could not create the config file. Please make sure Shaarli has the right to write in the folder is it installed in.\");document.location=\\'?\\';</script>';\n exit;\n }\n}",
"protected function _postConfig()\n {\n }",
"final public function applyconfigoptions() {}",
"public function reloadConfig()\n {\n }",
"public function testUpdateConfiguration3()\n {\n }",
"private function set_Configuration()\n {\n $config=array();\n if ((function_exists(\"Autosteuerung_Setup\"))===false) IPSUtils_Include ('Autosteuerung_Configuration.inc.php', 'IPSLibrary::config::modules::Autosteuerung');\t\t\t\t\n if (function_exists(\"Autosteuerung_Setup\")) $configInput = Autosteuerung_Setup();\n else $configInput=array();\n\n // vernünftiges Logdirectory aufsetzen , copy from configInput to config \n configfileParser($configInput, $config, [\"LogDirectory\" ],\"LogDirectory\" ,\"/Autosteuerung/\"); \n $dosOps = new dosOps();\n $systemDir = $dosOps->getWorkDirectory(); \n if (strpos($config[\"LogDirectory\"],\"C:/Scripts/\")===0) $config[\"LogDirectory\"]=substr($config[\"LogDirectory\"],10); // Workaround für C:/Scripts\"\n $config[\"LogDirectory\"] = $dosOps->correctDirName($systemDir.$config[\"LogDirectory\"]);\n configfileParser($configInput, $configHeatControl, [\"HeatControl\" ],\"HeatControl\" ,null); \n //print_R($configHeatControl);\n configfileParser($configHeatControl[\"HeatControl\" ], $config[\"HeatControl\" ], [\"EVENT_IPSHEAT\",\"SwitchName\" ],\"SwitchName\" ,null); \n configfileParser($configHeatControl[\"HeatControl\" ], $config[\"HeatControl\" ], [\"Module\" ],\"Module\" ,\"IPSHeat\"); \n configfileParser($configHeatControl[\"HeatControl\" ], $config[\"HeatControl\" ], [\"Type\" ],\"Type\" ,\"Switch\"); \n configfileParser($configHeatControl[\"HeatControl\" ], $config[\"HeatControl\" ], [\"AutoFill\",\"Autofill\",\"autofill\",\"AUTOFILL\" ],\"AutoFill\" ,\"Aus\"); //Default bedeutet Heizung Aus nach einem Update, ReInstall\n configfileParser($configHeatControl[\"HeatControl\" ], $config[\"HeatControl\" ], [\"setTemp\",\"settemp\",\"Settemp\",\"SETTEMP\",\"SetTemp\" ],\"setTemp\" ,22); //Default bedeutet Heizung Aus nach einem Update, ReInstall\n //print_r($config);\n return ($config);\n }",
"private function _setConfigs() {\n\t}",
"public function testUpdateEventlogConfig()\n {\n }",
"public function testUpdateSamlConfig()\n {\n }",
"private function UpdateConfig()\n\t{\n\t\t$GLOBALS['PrivateKeyPass'] = GetConfig('EncryptionToken');\n\t\t$GLOBALS['MerchantID'] = $this->GetValue('merchantid');\n\t\t$GLOBALS['ReturnURL'] = GetConfig('ShopPathSSL') . \"/finishorder.php\";\n\n\t\t$urls = $this->GetIDealURLs($this->GetValue('bank'));\n\n\t\tif ($this->GetValue('testmode') == \"YES\") {\n\t\t\t$acquirerURL = $urls['test'];\n\t\t}\n\t\telse {\n\t\t\t$acquirerURL = $urls['live'];\n\t\t}\n\t\t$GLOBALS['AcquirerURL'] = $acquirerURL;\n\n\t\t$configContents = $this->ParseTemplate('config', true);\n\n\t\tif (($handle = fopen($this->_configFile, \"wb\")) === false) {\n\t\t\t// could not open config file for writing\n\t\t\t$this->SetError(GetLang('IdealCantOpenConfigFile', array('configFile' => $this->_configFile)));\n\n\t\t\treturn false;\n\t\t}\n\n\t\tfwrite($handle, $configContents);\n\t\tfclose($handle);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tries to add passed HTML code to the HTML page head section and returns insertion position. False otherwise. | public static function addCodeToHead(&$html, $code, $append = true)
{
// Try to find head tag to insert passed code.
if (Utils::match(
'/<head(?:\s[^>]+>|>)|<title[^>]*>|<\/head>|<\/title>/',
$html,
$matches,
PREG_OFFSET_CAPTURE
)) {
$index = -1;
if ($append) {
$matches = array_reverse($matches);
}
foreach ($matches as $no => $match) {
if ($append && ($match[0][0] == '</head>' || $match[0][0] == '</title>')) {
$index = $no;
break;
} elseif (!$append && ($match[0][0] == '<head>' || $match[0][0] == '<title>')) {
$index = $no;
break;
}
}
if ($index === -1) {
$index = 0;
}
$tag = $matches[$index][0];
if ($tag[0] == '</head>' || strpos($tag[0], '<title') === 0) {
// Closing head tag or opening title tag found. Insert passed HTML before it
$html = mb_substr($html, 0, $tag[1]) .
$code . "\n" . mb_substr($html, $tag[1]);
$insertionPosition = $tag[1];
} else {
// Opening head tag or closing title tag found. Insert passed HTML right after it
$insertionPosition = $tag[1] + strlen($tag[0]);
$html = mb_substr($html, 0, $insertionPosition) .
"\n" . $code . mb_substr($html, $insertionPosition);
}
return $insertionPosition;
}
return false;
} | [
"private function addHeadElementIfMissing()\n {\n if ($this->getElementsByTagName('head')->item(0) === null) {\n $htmlElement = $this->getElementsByTagName('html')->item(0);\n $headElement = new \\DOMElement('head');\n if ($htmlElement->childNodes->length === 0) {\n $htmlElement->appendChild($headElement);\n } else {\n $htmlElement->insertBefore($headElement, $htmlElement->firstChild);\n }\n return true;\n }\n return false;\n }",
"function render ($html) {\n\t$toInsert = \\Sleepy\\Hook::addFilter('head_inserter', \"\\n\");\n\t$pos = strrpos($html, '</head>');\n\t$html = ($pos !== false)\n\t\t\t? substr_replace($html, $toInsert, $pos, 0)\n\t\t\t: $html;\n\n\treturn $html;\n}",
"function addCustomHeadTag( $html )\n\t{\n\t\t$document=& JFactory::getDocument();\n\t\tif($document->getType() == 'html') {\n\t\t\t$document->addCustomTag($html);\n\t\t}\n\t}",
"function head_append($html=null) {\n\tglobal $HTML_HEAD;\n\tif(is_null($html)) {\n\t\treturn (string) $HTML_HEAD;\n\t}\n\t$HTML_HEAD .= $html;\n}",
"public function appendToHead($html) {\n\t\t$this->headHtml[] = $html;\n\t}",
"public function add_head_marker() {\n\t\tglobal $wpUnited;\n\n\t\tif ($wpUnited->should_do_action('template-p-in-w') && (!PHPBB_CSS_FIRST)) {\n\t\t\techo '<!--[**HEAD_MARKER**]-->';\n\t\t}\n\t}",
"public static function addTagtoHead($html)\n {\n self::$ExternalTagToHead .= $html . \"\\n\";\n }",
"public function displayHtmlStart();",
"public function prePageHeader();",
"public static function hasHtmlHead(string $html): bool\n {\n return (bool)(new Crawler($html))->filter('head')->count();\n }",
"public function in_head() {\n if ($this->is_done() || $this->when <= page_requirements_manager::WHEN_IN_HEAD) {\n return;\n }\n if ($this->manager->is_head_done()) {\n throw new coding_exception('Too late to ask for a JavaScript file to be linked to from <head>.');\n }\n $this->when = page_requirements_manager::WHEN_IN_HEAD;\n }",
"public function pageBeforeContent(){}",
"function addCustomHeadTag($html)\n {\n $this->_head['custom'][] = trim($html);\n }",
"public function onBeforeParseHead();",
"public function addCustomHeadTag( $html ) {\n\t\t$this->_head['custom'][] = trim( $html );\n\t}",
"public function prePageContent();",
"function uga_insert_html_once($location, $html) {\r\n uga_debug(\"Start uga_insert_html_once: $location, $html\");\r\n global $uga_header_hooked;\r\n global $uga_footer_hooked;\r\n global $uga_html_inserted;\r\n uga_debug(\"Footer hooked: $uga_footer_hooked\");\r\n uga_debug(\"HTML inserted: $uga_html_inserted\");\r\n \r\n if ('head'==$location) {\r\n // header\r\n uga_debug('Location is HEAD');\r\n // notify uga_shutdown that the header hook got executed\r\n $uga_header_hooked = true;\r\n if (!uga_get_option('footer_hooked')) {\r\n // only insert the HTML if the footer is not hooked\r\n uga_debug('Inserting HTML since footer is not hooked');\r\n echo $html;\r\n $uga_html_inserted=true;\r\n }\r\n } else if ('footer'==$location) {\r\n // footer\r\n uga_debug('Location is FOOTER');\r\n // notify uga_shutdown that the footer hook got executed\r\n $uga_footer_hooked = true;\r\n if (!$uga_html_inserted) {\r\n // insert the HTML if it is not yet inserted by the HEAD filter\r\n uga_debug('Inserting HTML');\r\n echo $html;\r\n }\r\n } else if ('adm_footer'==$location) {\r\n // footer of admin page\r\n uga_debug('Location is ADM_FOOTER');\r\n if (!$uga_html_inserted) {\r\n // insert the HTML if it is not yet inserted by the HEAD filter\r\n uga_debug('Inserting HTML');\r\n echo $html;\r\n }\r\n }\r\n uga_debug('End uga_insert_html');\r\n}",
"static public function setHtmlHeader($html)\n\t{\n\t\tini_set('error_prepend_string', $html);\n\t}",
"public function printCodeBeforeClosingHeadTag(): void\n {\n $code = get_field('s_integration_before_head_closing', 'options');\n if (!empty($code)) {\n echo $code;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check the username. Alfanumeric characters and if existe same username in the DB | public function username_check($username) {
$this->db->where('username', $username);
$query = $this->db->get('instagram_users');
if ($query->num_rows == 0) {
if (ctype_alnum($username)) {
return true;
} else {
$this->form_validation->set_message('username_check', 'The %s field only can be alphanumeric');
return false;
}
} else {
$this->form_validation->set_message('username_check', 'The %s record already exists in the database');
return false;
}
} | [
"function verify_username(&$username)\n\t{\n\t\t// this is duplicated from the user manager\n\n\t\t// fix extra whitespace and invisible ascii stuff\n\t\t$username = trim(preg_replace('#\\s+#si', ' ', strip_blank_ascii($username, ' ')));\n\n\t\t$length = vbstrlen($username);\n\t\tif ($length < $this->registry->options['minuserlength'])\n\t\t{\n\t\t\t// name too short\n\t\t\t$this->error('usernametooshort', $this->registry->options['minuserlength']);\n\t\t\treturn false;\n\t\t}\n\t\telse if ($length > $this->registry->options['maxuserlength'])\n\t\t{\n\t\t\t// name too long\n\t\t\t$this->error('usernametoolong', $this->registry->options['maxuserlength']);\n\t\t\treturn false;\n\t\t}\n\t\telse if (preg_match('/(?<!&#[0-9]{3}|&#[0-9]{4}|&#[0-9]{5});/', $username))\n\t\t{\n\t\t\t// name contains semicolons\n\t\t\t$this->error('username_contains_semi_colons');\n\t\t\treturn false;\n\t\t}\n\t\telse if ($username != fetch_censored_text($username))\n\t\t{\n\t\t\t// name contains censored words\n\t\t\t$this->error('censorfield');\n\t\t\treturn false;\n\t\t}\n\t\telse if ($this->dbobject->query_first(\"\n\t\t\tSELECT userid, username FROM \" . TABLE_PREFIX . \"user\n\t\t\tWHERE userid != \" . intval($this->existing['userid']) . \"\n\t\t\tAND\n\t\t\t(\n\t\t\t\tusername = '\" . $this->dbobject->escape_string(htmlspecialchars_uni($username)) . \"'\n\t\t\t\tOR\n\t\t\t\tusername = '\" . $this->dbobject->escape_string(htmlspecialchars_uni(preg_replace('/&#([0-9]+);/esiU', \"convert_int_to_utf8('\\\\1')\", $username))) . \"'\n\t\t\t)\n\t\t\"))\n\t\t{\n\t\t\t// name is already in use\n\t\t\t$this->error('usernametaken', $username, $this->registry->session->vars['sessionurl']);\n\t\t\treturn false;\n\t\t}\n\t\telse if (!empty($this->registry->options['illegalusernames']))\n\t\t{\n\t\t\t// check for illegal username\n\t\t\t$usernames = preg_split('/\\s+/', $this->registry->options['illegalusernames'], -1, PREG_SPLIT_NO_EMPTY);\n\t\t\tforeach ($usernames AS $val)\n\t\t\t{\n\t\t\t\tif (strpos(strtolower($username), strtolower($val)) !== false)\n\t\t\t\t{\n\t\t\t\t\t// wierd error to show, but hey...\n\t\t\t\t\t$this->error('usernametaken', $username, $this->registry->session->vars['sessionurl']);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// if we got here, everything is okay\n\t\t$username = htmlspecialchars_uni($username);\n\n\t\t$this->user['userid'] = 0;\n\t\treturn true;\n\t}",
"function isValidUsername($un, $txt){\r\n $result =mysqli_query(connectDB(), \"SELECT 1 FROM ACCOUNT WHERE ACC_UNAME = '$un'; \");\r\n\r\n if ( $un != $txt && strlen($un) > 3){\r\n if ( mysqli_num_rows($result) < 1 ){\r\n return true;\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n}",
"function checkUsername($name) {\n\t\t$bad_usernames = array('admin','Administrator','administrator','ADMIN'); if((empty($_SESSION['ShoutCloud_Admin_Name'])) && (empty($_SESSION['ShoutCloud_Admin_Loggedin']))) { $bad_usernames[] = $this->adminUser; }\n\t\t$name = utf8_encode(strip_tags($name)); foreach($bad_usernames as $k=>$n) { if($name==$n) { return false; } } return str_ireplace($this->badwords,'',$name);\n\t\t\n\t}",
"public function usernameValid($username);",
"public function checkUserName(){\r\n\t\t$app = JFactory::getApplication();\r\n\t\t$data = $app->getUserState('com_users.registration.data', null);\r\n\t\t\r\n\t\t\r\n\t\t$passedUserName = $data['username'];\r\n\t\t\r\n\t\t//replaces prohibited words to safe word\r\n\t\t$passedUserName = str_replace(array('<','>','%',';','(',')','&',\"'\",'\"'), '-', $passedUserName);\r\n\t\t\r\n\t\t//NEW USER\r\n\t\t$ck = $this->_checkNotExistUserName($passedUserName);\r\n\t\t\r\n\t\tif($ck===false){\r\n\t\t\t$ck = false;\r\n\t\t\tfor($i=0;$i<10;$i++){\r\n\t\t\t\t$newUsername = $passedUserName.'_'.$this->_generateRandomString(5+$i,false);\t\t\t\r\n\t\t\t\t$ck = $this->_checkNotExistUserName($newUsername);\r\n\t\t\t\tif($ck===true){\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif($ck===false){\r\n\t\t\t\t$this->setError('COM_HS_USERS_ERROR_FAILED_TO_GENERATE_USERNAME');\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\t//if the user name is unique\r\n\t\t\t$newUsername = $passedUserName;\r\n\t\t}\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\r\n\t\t$data['username'] = $newUsername;\r\n\t\t$app->setUserState('com_users.registration.data', $data);\t\t\r\n\t\t\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"function usernameTaken($username){\n if(!get_magic_quotes_gpc()){\n $username = addslashes($username);\n }\n $q = \"SELECT username FROM \".TBL_USERS.\" WHERE username = '$username'\";\n $result = mysql_query($q, $this->connection);\n return (mysql_numrows($result) > 0);\n }",
"function checkUsername($conn,$Username,$UsernameManager){\n\t\t $flag=true;\n\t // select the usernames of manager's employees to check if he/she enters a username that already exists in the database\n $sqlUsername = \"SELECT Username FROM Employee WHERE Username LIKE '$Username' AND UsernameManager LIKE '$UsernameManager'\";\n $resultUsername = mysqli_query($conn, $sqlUsername);\n if (!($resultUsername)) {\n print_error_username();\n $Username = \"\";\n } else {\n $rowsUsername = mysqli_num_rows($resultUsername);\n // check if the username of an employee already exists in the database\n if ($rowsUsername != 0) {\n $flag = false;\n print_error_username();\n $Username = \"\";\n }\n }\n\t\treturn $flag;\n}",
"public function checkUsername()\n {\n\n /*\n * Posted not empty data\n */\n if($this->input->post('login')) {\n $login = trim($this->input->post('login'));\n\n /*\n * Login is short\n */\n if(strlen($login) < 4) {\n $this->application->_sendAJAX(array('error' => $this->lang->line('signup_short_login')));\n }\n\n /*\n * Login is invalid\n */\n elseif(!preg_match('/^[a-z0-9\\-_.]{4,30}$/i', $login)) {\n $this->application->_sendAJAX(array('error' => $this->lang->line('signup_login_wrong_format')));\n }\n\n /*\n * Get same login\n */\n $query = $this->db->select('1', false)\n ->where('login', $login);\n\n if($this->vinc_auth->logged()) {\n $query = $query->where('id !=', $this->vinc_auth->_('id'));\n }\n $query = $query->get('users');\n \n /*\n * Same login exists\n */\n if($query->num_rows() > 0) {\n $this->application->_sendAJAX(array('error' => $this->lang->line('signup_login_exists')));\n }\n $this->application->_sendAJAX(array('message' => 'All right:)'));\n }\n $this->application->_sendAJAX(array('error' => $this->lang->line('signup_short_login')));\n }",
"public static function get_exist_username($username) {\n $nameexists = true;\n $index = 0;\n $userName = $username;\n while ($nameexists == true) {\n if (JUserHelper::getUserId($userName) != 0) {\n $index++;\n $userName = $username.$index;\n } \n\t\t else {\n $nameexists = false;\n }\n }\n\t\treturn $userName;\n }",
"function usernameTaken($username){\r\n if(!get_magic_quotes_gpc()){\r\n $username = addslashes($username);\r\n }\r\n $q = \"SELECT username FROM \".TBL_USERS.\" WHERE username = '$username'\";\r\n $result = mysql_query($q, $this->connection);\r\n return (mysql_numrows($result) > 0);\r\n }",
"function check_unique_username() {\n if ($user_name = $this->input->post('user_name')) {\n $exists = $this->traineemodel->check_duplicate_user_name($user_name);\n if (!$exists) {\n $this->form_validation->set_message('check_unique_username', \"Username $user_name already exists.\");\n return FALSE;\n }\n return TRUE;\n }\n }",
"public function isValidUsername()\n {\n }",
"public function validateUsername()\n {\n global $_CORELANG;\n\n if (empty($this->username)) {\n return true;\n }\n if (self::isValidUsername($this->username)) {\n if (self::isUniqueUsername($this->username, $this->id)) {\n return true;\n } else {\n $this->error_msg[] = $_CORELANG['TXT_ACCESS_USERNAME_ALREADY_USED'];\n }\n } else {\n $this->error_msg[] = $_CORELANG['TXT_ACCESS_INVALID_USERNAME'];\n }\n\n return false;\n }",
"public function hasValidUsername(){\n return ((strlen($this->getUsername()) > 3) && (strlen($this->getUsername()) < 21));\n }",
"function usernameTaken($username) {\n if (!get_magic_quotes_gpc()) {\n $username = addslashes($username);\n }\n $q = \"SELECT username FROM \" . TBL_USERS . \" WHERE username = '$username'\";\n $result = mysql_query($q, $this->connection);\n return (mysql_numrows($result) > 0);\n }",
"public static function checkUserName($username){\r\r\n\t\treturn preg_match(\"/^[a-zA-Z0-9_]{4,16}$/\",$username);\r\r\n\t}",
"public function validateUserName()\n\t{\n\t\t$this->connectToDatabase();\n\n\t\t$query = \"SELECT id FROM `site_user` \".\n\t\t\t\"WHERE (`login` = \".$this->uname->escapeSQL($this->mysqli).\") \";\n\t\tif ($this->id->value>0)\n\t\t{\n\t\t\t$query .= \"AND (id != {$this->id->value})\";\n\t\t}\n\n\t\t$rs = $this->fetchRecords($query);\n\t\tif (count($rs) > 0) {\n\t\t\tthrow new ContentValidationException(\"User name already exists.\");\n\t\t}\n\t}",
"function UserNameExistsEdit($username) {\n\t$usernameUser = GetUser('username');\n\n\t$result = DBRead('usuarios', $params = 'username', $fields = 'username');\n\t$query = \"SELECT username FROM usuarios WHERE username = '$username'\";\n\t$result = DBExecute($query);\n\t$resultUsername = mysqli_fetch_assoc($result);\n\t$resultUsername = $resultUsername['username'];\n\n\tif (mysqli_num_rows($result) <= 0 || $usernameUser == $resultUsername)\n\t\treturn true;\n\telse\n\t\treturn false;\n}",
"function usernameTaken($username){\n\t\tif(!get_magic_quotes_gpc()){\n\t\t\t$username = addslashes($username);\n\t\t}\n\t\t$q = \"SELECT username FROM \".TBL_USERS.\" WHERE username = '$username'\";\n\t\t$result = mysql_query($q, $this->connection);\n\t\treturn (mysql_numrows($result) > 0); \n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function gives you the next working days based on the buffer | function getWorkingDays($date,$buffer=1,$holidays='') {
if ($holidays==='') $holidays = 'https://www.gov.uk/bank-holidays/england-and-wales.ics';
if (!is_array($holidays)) {
$ch = curl_init($holidays);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
$ics = curl_exec($ch);
curl_close($ch);
$ics = explode("\n",$ics);
$ics = preg_grep('/^DTSTART;/',$ics);
$holidays = preg_replace('/^DTSTART;VALUE=DATE:(\\d{4})(\\d{2})(\\d{2}).*/s','$1-$2-$3',$ics);
}
$addDay = 0;
while ($buffer--) {
while (true) {
$addDay++;
$newDate = date('Y-m-d', strtotime("$date +$addDay Days"));
$newDayOfWeek = date('w', strtotime($newDate));
if ( $newDayOfWeek>0 && $newDayOfWeek<6 && !in_array($newDate,$holidays)) break;
}
}
return $newDate;
} | [
"public static function getNextWorkingDay(){\n $invalid_day = array('sat','sun');\n $tomorrow_unix = mktime(0, 0, 0, date(\"m\"), date(\"d\")+1, date(\"y\"));\n $tomorrow_date = date('Ymd',$tomorrow_unix);\n $tomorrow_day = strtolower(date('D',$tomorrow_unix));\n\n $datetime = new \\DateTime();\n if(!in_array($tomorrow_day,$invalid_day)){\n $datetime -> setTimestamp($tomorrow_unix);\n return $datetime;\n }else{\n switch($tomorrow_day){\n case 'sat':\n $tomorrow_unix = mktime(0, 0, 0, date(\"m\"), date(\"d\")+3, date(\"y\"));\n break;\n case 'sun':\n $tomorrow_unix = mktime(0, 0, 0, date(\"m\"), date(\"d\")+2, date(\"y\"));\n break;\n }\n $datetime -> setTimestamp($tomorrow_unix);\n return $datetime;\n }\n }",
"function __cb_next_dateLaborable($arr) {\n\t$startDate = new DateTime($arr[0]);\n\t$endDate = new DateTime(__vt_add_days(array($arr[0],180))); // 180 days to make sure we catch next occurrence\n\t$nextDays = explode(',', $arr[1]);\n\tif (isset($arr[2]) && trim($arr[2])!='') { // list of holidays\n\t\t$holiday = explode(',', $arr[2]);\n\t} else {\n\t\t$holiday = array();\n\t}\n\tif (empty($arr[3])) { // saturday is not laborable\n\t\t$weekend = array(6,7);\n\t} else {\n\t\t$weekend = array(7);\n\t}\n\t$interval = new DateInterval('P1D'); // set the interval as 1 day\n\t$daterange = new DatePeriod($startDate, $interval, $endDate);\n\t$found = false;\n\tforeach ($daterange as $date) {\n\t\tif (in_array($date->format('d'), $nextDays)) {\n\t\t\t$found = $date;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif ($found) {\n\t\twhile (in_array($found->format('N'), $weekend) || in_array($found->format('Y-m-d'), $holiday)) {\n\t\t\t$found->add($interval);\n\t\t}\n\t\treturn $found->format('Y-m-d');\n\t} else {\n\t\treturn '';\n\t}\n}",
"function getNextMonday(){ \t\treturn $this->_getNextDay(1);\t}",
"function nextWorkTime() {\n $work = Date::load($this);\n if ($work->hour < 9) {\n $work->seconds = 9*3600;\n }else if ($work->seconds > 16*3600) {\n $work->seconds = 9*3600;\n $work->day++;\n }\n while (!$work->isWorkTime()) {\n $work->seconds = 9*3600;\n $work->day++;\n }\n return $work;\n }",
"public function nextWeekday();",
"public function nextDay();",
"public function get_next_booking(){\n $booking=array();\n $days=array();\n for($count=0;$count<7;$count++){\n $i=$count;\n $date=date('Y-m-d', strtotime(\"+\".$i.\" days\"));\n $book=$this->Admbookings-> filter_by_date($date);\n array_push($booking,sizeof($book));\n array_push($days,$date);\n }\n return array($days,$booking);\n }",
"protected function nextDaily() {\n\n if (!$this->byHour && !$this->byDay) {\n $this->currentDate->modify('+' . $this->interval . ' days');\n return;\n }\n\n if (isset($this->byHour)) {\n $recurrenceHours = $this->getHours();\n }\n\n if (isset($this->byDay)) {\n $recurrenceDays = $this->getDays();\n }\n\n do {\n\n if ($this->byHour) {\n if ($this->currentDate->format('G') == '23') {\n // to obey the interval rule\n $this->currentDate->modify('+' . $this->interval-1 . ' days');\n }\n\n $this->currentDate->modify('+1 hours');\n\n } else {\n $this->currentDate->modify('+' . $this->interval . ' days');\n\n }\n\n // Current day of the week\n $currentDay = $this->currentDate->format('w');\n\n // Current hour of the day\n $currentHour = $this->currentDate->format('G');\n\n } while (($this->byDay && !in_array($currentDay, $recurrenceDays)) || ($this->byHour && !in_array($currentHour, $recurrenceHours)));\n\n }",
"function getNextTuesday(){ \t\treturn $this->_getNextDay(2);\t}",
"public function nextWeekendDay();",
"function getNextFriday(){ \t\treturn $this->_getNextDay(5);\t}",
"public function currentOrNextBusinessDay()\n {\n $day = $this->copy()->subDay();\n\n for ($i=0; $i < 14 ; $i++) {\n if($this->isStandardBusinessDays()) {\n if($day->addDay()->isBusinessDay() && !$day->isBankHoliday()) {\n break;\n }\n } else {\n if($day->addDay()->isBusinessDay()) {\n break;\n }\n }\n }\n\n return $day;\n }",
"public function getCurrentOrNextShiftDay()\n {\n $db = $this->getAdapter();\n $select = $db->select();\n\n $select->from(array('t' => $this->_name))\n ->order('t.start_day_number')\n ->order('t.start_time ASC');\n $results = $db->fetchAll($select);\n\n $currentTime = date('H:i');\n $currentDate = date('Y-m-d');\n $generatedDates = array();\n if (!empty($results))\n {\n foreach($results as $result)\n {\n $startDate = date('Y-m-d', strtotime(strtolower($result['start_day'])));\n $endDate = date('Y-m-d', strtotime(strtolower($result['end_day'])));\n $startTime = date('H:i', strtotime($result['start_time']));\n $endTime = date('H:i', strtotime($result['end_time']));\n\n $dateKey = $startDate. ' ' . $startTime . ' ' . $endDate . ' ' . $endTime;\n if ($startDate == $currentDate)\n {\n if ($currentTime >= $startTime && $currentTime <= $endTime)\n {\n $generatedDates[$dateKey] = $result;\n }\n else if ($currentTime < $endTime)\n {\n $generatedDates[$dateKey] = $result;\n }\n }\n else\n {\n $generatedDates[$dateKey] = $result;\n }\n }\n\n ksort($generatedDates);\n $shift = array_shift($generatedDates);\n return $shift['id'];\n }\n return null;\n }",
"function getNextLoffaMeetingDate($offsetInDays){\n\tglobal $DATE_TIME_NOW;\n\n\t$tuesdayofThisMonth = new DateTime('first tuesday of this month');\t\n\t$tuesdayofThisMonth = $tuesdayofThisMonth->modify('+' . $offsetInDays .'day');\n\t\n\t$tuesdayofNextMonth = new DateTime('first tuesday of next month');\n\t$tuesdayofNextMonth = $tuesdayofNextMonth->modify('+' . $offsetInDays .'day');\n\t\n\t\tif ($DATE_TIME_NOW->format('Ymd') <= $tuesdayofThisMonth->format('Ymd') ){\n\t\t\treturn $tuesdayofThisMonth;\n\t\t}else{\n\t\t\treturn $tuesdayofNextMonth;\n\t\t}\n}",
"protected function nextWeekly() {\n\n if (!$this->byHour && !$this->byDay) {\n $this->currentDate->modify('+' . $this->interval . ' weeks');\n return;\n }\n\n if ($this->byHour) {\n $recurrenceHours = $this->getHours();\n }\n\n if ($this->byDay) {\n $recurrenceDays = $this->getDays();\n }\n\n // First day of the week:\n $firstDay = $this->dayMap[$this->weekStart];\n\n do {\n\n if ($this->byHour) {\n $this->currentDate->modify('+1 hours');\n } else {\n $this->currentDate->modify('+1 days');\n }\n\n // Current day of the week\n $currentDay = (int) $this->currentDate->format('w');\n\n // Current hour of the day\n $currentHour = (int) $this->currentDate->format('G');\n\n // We need to roll over to the next week\n if ($currentDay === $firstDay && (!$this->byHour || $currentHour == '0')) {\n $this->currentDate->modify('+' . $this->interval-1 . ' weeks');\n\n // We need to go to the first day of this week, but only if we\n // are not already on this first day of this week.\n if($this->currentDate->format('w') != $firstDay) {\n $this->currentDate->modify('last ' . $this->dayNames[$this->dayMap[$this->weekStart]]);\n }\n }\n\n // We have a match\n } while (($this->byDay && !in_array($currentDay, $recurrenceDays)) || ($this->byHour && !in_array($currentHour, $recurrenceHours)));\n }",
"public function gotoNextDay()\n {\n $this->date->addField(5, 1);\n\n return $this->date;\n }",
"public function test_WeeklyByDay1()\n\t\t{\n\t\t\t// Every Tuesday\n\t\t\t$ical = 'FREQ=WEEKLY;BYDAY=TU';\n\n\t\t\t$start = new DateTime(\"January 1, 2013\");\n\t\t\t$due = new DateTime(\"January 5, 2013\");\n\t\t\t$comp = 0;\n\t\t\t\n\t\t\t$newstart = new DateTime(\"January 4, 2013\");\n\t\t\t$newdue = new DateTime(\"January 8, 2013\");\n\n\t\t\t$array = rep_getNextDates($start,$due,$comp,$ical);\n\n\t\t\t$this->assertEquals( $newstart->getTimestamp(), $array[0] );\n\t\t\t$this->assertEquals( $newdue->getTimestamp(), $array[1] );\n\t\t\t$this->assertEquals( $ical, $array[2] );\n\t\t}",
"private function getFirstDayOffset()\n {\n $date = getdate(mktime(12, 0, 0, $this->month, 1, $this->year));\n\n $first = $date[\"wday\"];\n $d = $this->startDay + 1 - $first;\n while ($d > 1) {\n $d -= 7;\n }\n return $d; \n }",
"function get_next_date($schedule, $day) {\n\t$start = $schedule[\"s_starttime\"];\n\t$start = mktime(0,0,0,date(\"m\", $start),date(\"d\", $start),date(\"Y\", $start));\n\t//-- add a day of seconds till we get to the day that we want\n\twhile(date(\"w\", $start) != $day) $start = $start + (60*60*24);\n\t//print date(\"m/d/Y\", $start);\n\t$current = mktime(0,0,0,date(\"m\"),date(\"d\"),date(\"Y\"));\n\t//-- while the start time is in the past, add the repeat interval to it\n\twhile(($start < $current)&&($start < $schedule[\"s_exptime\"])) $start = $start + $schedule[\"s_repeat\"];\n\t//print date(\"m/d/Y\", $start);\n\treturn $start;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return value of controller ['cl'] key from $_GET array | public static function getRequestController(): string
{
return SecurityHelper::sanitizeVar($_GET['cl']) ?? '';
} | [
"private function getControllerNameFromQueryString() : string {\n return explode('=', $_SERVER['QUERY_STRING'])[0];\n }",
"public function lget(){\n\t\treset($_GET);\n\t\techo \"<hr>\";\n\t\twhile (list ($clave, $val) = each($_GET)) {\n\t\t\techo \"$clave = \" . $_GET[\"$clave\"] . \" \";\n\t\t}\n\t\techo \"</hr>\";\n\t}",
"public static function getParametresUrl(){\n $url=array();\n parse_str($_SERVER['QUERY_STRING'],$url);\n \n if(!isset($url['controller'])){\n $url['controller']=Application::getControlleurCourant();\n }\n if(!isset($url['action'])){\n $url['action']=Application::getActionCourante();\n }\n return $url;\n }",
"function cc_get( $var ) {\n\tcc_get_fail_if_not_valid( $var );\n\n\tif ( cc_get_isset( $var ) )\n\t\treturn $_GET[$var];\n\telse\n\t\treturn \"\";\n}",
"function get_query_string($key) {\n $val = null;\n if (!empty($_GET[$key])) {\n $val = $_GET[$key];\n }\n return $val;\n}",
"function get($key)\n{\n\treturn System::request()->get($key);\n}",
"function get($strNomParametre){\n return isset($_GET[\"$strNomParametre\"]) ? $_GET[\"$strNomParametre\"] : null;\n}",
"function getAction()\n {\n if (isset($_GET['_px_action'])) {\n return $_GET['_px_action'];\n }\n return $_SERVER['QUERY_STRING'];\n }",
"function GET($key)\n {\n if (isset($_GET[$key]))\n $value = $_GET[$key];\n elseif (isset($GLOBALS['HTTP_GET_VARS'][$key]))\n $value = $GLOBALS['HTTP_GET_VARS'][$key];\n elseif (isset($_POST[$key]))\n $value = $_POST[$key];\n elseif (isset($GLOBALS['HTTP_POST_VARS'][$key]))\n $value = $GLOBALS['HTTP_POST_VARS'][$key];\n else\n return \"\";\n if (get_magic_quotes_gpc())\n return stripslashes($value);\n return $value;\n }",
"function cf7_get($atts){\n\textract(shortcode_atts(array(\n\t\t'key' => 0,\n\t), $atts));\n\t$value = '';\n\tif( isset( $_GET[$key] ) ){\n\t\t$value = urldecode($_GET[$key]);\n\t}\n\treturn $value;\n}",
"public function get($param_name){\r\n\t\treturn $_GET[$param_name];\r\n\t}",
"static function ShowKeyValue_GET() {\n echo \"GET:\" . \"<br />\\n\";\n foreach ($_GET as $key => $values) {\n echo $key . \"=\" . $values . \"<br />\\n\";\n }\n }",
"function getURLVar($str) {\n\treturn isset($_GET[$str]) ? $_GET[$str] : null;\n}",
"public static function get_page() {\n\t\t$query = $_SERVER['QUERY_STRING'];\n\n\t\t$request = explode('/', $query);\n\t\t$controller = array_shift($request);\n\t\t\n\t\treturn $controller;\n\t}",
"function get($str, $default)\n{\n $val = $_GET[$str];\n if (!isset($val)) {\n $val = $default;\n }\n return $val;\n}",
"public function getActionParams()\n\t{\n\t\treturn $_GET;\n\t}",
"public static function get($key) \n {\n return static::value($key, $_GET);\n }",
"function getController( &$uri_array )\n {\n $controller = array_shift($uri_array);\n // var_dump($controller);\n if(isset($controller[0]) && $controller[0] == '?')\n return DEFAULT_PUBLIC_CONTROLLER;\n else\n $controller = strtok($controller, '?');\n \n if(!empty($controller))\n return ucfirst($controller);\n }",
"private function url()\n {\n //check that there is query string entered in url or not\n if (!empty($_SERVER['QUERY_STRING']))\n {\n //explode()---> convert string into array\n $url=explode(\"/\",$_SERVER['QUERY_STRING']);\n //filled the value of controller with the first element of array\n $this->controller=isset($url[0])?$url[0].\"controller\":\"homecontroller\";\n //filled the value of method with the second element of array\n $this->method=isset($url[1])?$url[1]:\"index\";\n //unset()----> Delete the first two element in the array (controller,method)\n unset($url[0],$url[1]);\n //array_values()---->Make the array index begins from zeroBased again\n $this->params=array_values($url);\n // echo \"<pre>\";\n // print_r($this->params);\n }\n else\n {\n $this->controller = 'homecontroller';\n $this->method = 'index';\n }\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle the accounts "deleted" event. | public function deleted(Accounts $accounts)
{
//
} | [
"public function handleAssetDeleted(AssetDeleted $event)\n {\n $this->addEntry(\"Deleted asset '\".$event->asset->url().\"'\");\n }",
"public function deleted()\n {\n // do something after delete\n }",
"public function deleted(Accion $accion)\n {\n //\n }",
"public function onUserDelete($event)\n {\n $this->notification($event, 'delete');\n dispatch(new UpdateCache($event->user, true));\n }",
"public function deleted(Event $event)\n {\n //\n }",
"public static function deleted($callback)\n {\n static::registerModelEvent('deleted', $callback);\n }",
"abstract public function handleDelete($event);",
"function delete_account(){\n // TODO\n }",
"public function on_delete() {}",
"public function handleTermDeleted(TermDeleted $event)\n {\n $this->addEntry(\"Deleted term '\".$event->term->title().\"' (id: '\".$event->term->id().\"') in taxonomy '\".$event->term->taxonomy()->title().\"'\");\n }",
"protected function afterDelete () {}",
"protected function afterDeletion() {}",
"private function onDelete()\r\n {\r\n if ($this->_accessLevel < ACCESS_LEVEL_DELETE)\r\n {\r\n $this->listByView(__('Invalid user level for action.'));\r\n return;\r\n }\r\n\r\n /* Bail out if we don't have a valid company ID. */\r\n if (!$this->isRequiredIDValid('companyID', $_GET))\r\n {\r\n $this->listByView(__('Invalid company ID.'));\r\n return;\r\n }\r\n\r\n $companyID = $_GET['companyID'];\r\n\r\n $companies = new Companies($this->_siteID);\r\n $rs = $companies->get($companyID);\r\n\r\n if (empty($rs))\r\n {\r\n $this->listByView(__('The specified company ID could not be found.'));\r\n return;\r\n }\r\n\r\n if ($rs['defaultCompany'] == 1)\r\n {\r\n $this->listByView(__('Cannot delete internal postings company.'));\r\n return;\r\n }\r\n\r\n if (!eval(Hooks::get('CLIENTS_ON_DELETE_PRE'))) return;\r\n\r\n $companies->delete($companyID);\r\n\r\n /* Delete the MRU entry if present. */\r\n $_SESSION['OSATS']->getMRU()->removeEntry(\r\n DATA_ITEM_COMPANY, $companyID\r\n );\r\n\r\n if (!eval(Hooks::get('CLIENTS_ON_DELETE_POST'))) return;\r\n\r\n osatutil::transferRelativeURI('m=companies&a=listByView');\r\n }",
"public\n function deleted(Event $event)\n {\n //\n }",
"protected function afterDelete()\n {\n }",
"public function deleted(Entry $entry)\n {\n //\n }",
"public function deleting(Accounts $accounts)\n {\n //\n }",
"public function delete($account);",
"public function roleDeleted(RoleDeleted $event)\n\t{\n\t\t$name = $event->getName();\n $this->logger->log(\"A role {$name} was deleted.\");\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draws a boxes plot (Box Plot or Box and Whisker plot) This is the main function for drawing a boxes plot. Supported data types are textdata and datadata, each with 5 or more Y values per row. The first 5 values are Ymin, YQ1, Ymid, YQ3, Ymax. Any additional values are outliers. PHPlot requires Ymin <= YQ1 <= Ymin <= YQ3 <= Ymax but does not assume anything about specific values (quartile, median). | protected function DrawBoxes()
{
if (!$this->CheckDataType('text-data, data-data'))
return FALSE;
if ($this->data_columns < 5) // early error check (more inside the loop)
return $this->PrintError("DrawBoxes(): rows must have 5 or more values.");
// Set up the point shapes/sizes arrays - needed for outliers:
$this->CheckPointParams();
// Calculate the half-width of the boxes.
// This is scaled based on the plot density, but within tight limits.
$width1 = max($this->boxes_min_width, min($this->boxes_max_width,
(int)($this->boxes_frac_width * $this->plot_area_width / $this->num_data_rows)));
// This is the half-width of the upper and lower T's and the ends of the whiskers:
$width2 = $this->boxes_t_width * $width1;
// A box plot can use up to 3 different line widths:
list($box_thickness, $belt_thickness, $whisker_thickness) = $this->line_widths;
$gcvars = []; // For GetDataColor, which initializes and uses this.
for ($row = 0; $row < $this->num_data_rows; $row++) {
$record = 1; // Skip record #0 (data label)
if ($this->datatype_implied) // Implied X values?
$xw = 0.5 + $row; // Place text-data at X = 0.5, 1.5, 2.5, etc...
else
$xw = $this->data[$row][$record++]; // Read it, advance record index
$xd = $this->xtr($xw); // Convert X to device coordinates
$x_left = $xd - $width1;
$x_right = $xd + $width1;
if ($this->x_data_label_pos != 'none') // Draw X Data labels?
$this->DrawXDataLabel($this->data[$row][0], $xd, $row);
// Each row must have at least 5 values:
$num_y = $this->num_recs[$row] - $record;
if ($num_y < 5) {
return $this->PrintError("DrawBoxes(): row $row must have at least 5 values.");
}
// Collect the 5 primary Y values, plus any outliers:
$yd = []; // Device coords
for ($i = 0; $i < $num_y; $i++) {
$yd[$i] = is_numeric($y = $this->data[$row][$record++]) ? $this->ytr($y) : NULL;
}
// Skip the row if either YQ1 or YQ3 is missing:
if (!isset($yd[1], $yd[3])) continue;
// Box plot uses 4 colors, and 1 dashed line style for the whiskers:
$this->GetDataColor($row, 0, $gcvars, $box_color);
$this->GetDataColor($row, 1, $gcvars, $belt_color);
$this->GetDataColor($row, 2, $gcvars, $outlier_color);
$this->GetDataColor($row, 3, $gcvars, $whisker_color);
$whisker_style = $this->SetDashedStyle($whisker_color, $this->line_styles[0] == 'dashed');
// Draw the lower whisker and T
if (isset($yd[0]) && $yd[0] > $yd[1]) { // Note device Y coordinates are inverted (*-1)
imagesetthickness($this->img, $whisker_thickness);
imageline($this->img, $xd, $yd[0], $xd, $yd[1], $whisker_style);
imageline($this->img, $xd - $width2, $yd[0], $xd + $width2, $yd[0], $whisker_color);
}
// Draw the upper whisker and T
if (isset($yd[4]) && $yd[3] > $yd[4]) { // Meaning: Yworld[3] < Yworld[4]
imagesetthickness($this->img, $whisker_thickness);
imageline($this->img, $xd, $yd[3], $xd, $yd[4], $whisker_style);
imageline($this->img, $xd - $width2, $yd[4], $xd + $width2, $yd[4], $whisker_color);
}
// Draw the median belt (before the box, so the ends of the belt don't break up the box.)
if (isset($yd[2])) {
imagesetthickness($this->img, $belt_thickness);
imageline($this->img, $x_left, $yd[2], $x_right, $yd[2], $belt_color);
}
// Draw the box
imagesetthickness($this->img, $box_thickness);
imagerectangle($this->img, $x_left, $yd[3], $x_right, $yd[1], $box_color);
imagesetthickness($this->img, 1);
// Draw any outliers, all using the same shape marker (index 0) and color:
for ($i = 5; $i < $num_y; $i++) {
if (isset($yd[$i]))
$this->DrawShape($xd, $yd[$i], 0, $outlier_color);
}
$this->DoCallback('data_points', 'rect', $row, 0, $x_left, $yd[4], $x_right, $yd[0]);
}
return TRUE;
} | [
"function box1group($fe, $av, $ylim = \"0, 100, 10\"){\n\t\t$p = getcwd(); $t = \"/eigenes/downs/temp/\";\n\t\tif ($this->name == \"\") $this->name = __FUNCTION__.\".png\";\n\t\t$ofi = $p.\"/out/\".$this->name;\n\t\tif ($this->neu == 1) {\n\t\t\t$l = chr(10);\n\t\t\t$fe = data::get($fe, $av);\n\t\t\t$fe = data::comp($fe, \"@alle@ = 1;\");\n\t\t\t$avf = data::vl($fe, $av); $avz = count($avf);\n\t\t\tfor ($j = 0; $j < $avz; ++$j) $avfl[$j] = label::v($avf[$j]); \n\t\t\t$avl = fins($avfl, \",\", \"'\", \"'\"); \n\t\t\t$avs = label::set($avf[0]);\n\t\t\t\n\t\t\t$f = $t.\"box.dat\"; \n\t\t\texport::asc($fe, $f.\"0\");\n\t\t\t\n\t\t\t$fe = data::varstocases($fe, array($av), \"alle\", array(\"av\")); export::asc($fe, $f);\n\t\t\t\n\t\t\t$f = $t.\"box.dat\"; export::asc($fe, $f);\n\t\t\t$r .= \"options(warn=-1); library(ggplot2); library(ggtext); yl = c($ylim)[1:2];\".$l;\n\t\t\t$r .= \"x <- read.table('$f', header = TRUE); y0 <- read.table('\".$f.\"0', header = TRUE);\".$l;\n\t\t\t$r .= \"gg <- ggplot(x, aes(y = av, x = var)) + \n\t\t\t\tstat_boxplot(geom = 'errorbar', width = 0.1) + geom_boxplot(fill = 'green', color = 'grey33') +\n\t\t\t\tstat_summary(fun.y = mean, geom = 'errorbar', aes(ymax = ..y.., ymin = ..y..), width = .75, linetype = 'dashed') +\n\t\t\t\tscale_x_discrete(labels = c($avl)) + xlab('') + ylab('') +\n\t\t\t\tscale_y_continuous(limits = yl, breaks = seq($ylim), expand = c(0, 0)) + \n\t\t\t\tggtitle('$avs') + \n\t\t\t\ttheme(legend.position = 'none', \n\t\t\t\t\taxis.text.x = element_text(size = 14, colour = 'black'), axis.ticks.x = element_blank(),\n\t\t\t\t\taxis.text.y = element_text(size = 14, colour = 'black'),\n\t\t\t\t\taxis.title = element_text(size = 14),\n\t\t\t\t\taxis.line = element_line(color = 'grey55'),\n\t\t\t\t\tplot.title = element_text(size = 28, hjust = 0.5),\n\t\t\t\t\taspect.ratio=0.75\n\t\t\t\t);\";\n\t\t\t\t\n\t\t\t$z = -1;\n\t\t\tfor ($i = 0; $i < $avz; ++$i){\n\t\t\t\tfor ($j = 0; $j < $avz; ++$j){\n\t\t\t\t\t$fe3[\"a\"][++$z] = $avf[$i]; \n\t\t\t\t\t$fe3[\"b\"][+$z] = $avf[$j];\n\t\t\t\t\t$fe3[\"c\"][+$z] = $i + 1;\n\t\t\t\t\t$fe3[\"d\"][+$z] = $j + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$fe3 = data::filter($fe3, \"@c@ !== @d@ and @c@ < @d@\");\n\t\t\t\n\t\t\t$px0 = 1; $px1 = 1; $ogr = fromto($ylim, \",\", \",\");\n\t\t\tfor ($i = 0; $i < count($fe3[\"a\"]); ++$i){\n\t\t\t\t\n\t\t\t\t$px0 = $fe3[\"c\"][$i] + .1;\n\t\t\t\t$px1 = $fe3[\"d\"][$i] - .1;\n\t\t\t\t$y = $ogr - 5 - $i * 5;\n\t\t\t\t\n\t\t\t\t$a1 = $fe3[\"a\"][$i];\n\t\t\t\t$a2 = $fe3[\"b\"][$i];\n\t\t\t\t\n\t\t\t\t$r .= \"gg = gg + geom_segment(aes(x = $px0, y = $y, xend = $px1, yend = $y));\";\n\t\t\t\t$r .= \"gg = gg + geom_segment(aes(x = $px0, y = $y, xend = $px0, yend = $y - 1));\";\n\t\t\t\t$r .= \"gg = gg + geom_segment(aes(x = $px1, y = $y, xend = $px1, yend = $y - 1));\";\n\t\t\t\t\n\t\t\t\t$r .= \"w$i = wilcox.test(y0\\$$a1, y0\\$$a2, data = y0, paired = T, correct = F); p = w$i\\$p.value; if (p < 0.001) {p = 0.001; k = ' < ';} else {k = ' = ';};\";\n\t\t\t\t$r .= \"gg = gg + annotate(geom = 'richtext', x = $px0 + 0.5, y = $y, label = pa2('p', k, round(p, 3)), label.color = NA, fill = 'grey92');\";\n\t\t\t}\n\t\t\t$r .= \"f = friedman.test(as.matrix(y0)); pf = f\\$p.value; if (pf < 0.001) {pf = 0.001; k = ' < ';} else {k = ' = ';};\n\t\t\t gg = gg + annotate(geom = 'richtext', y = $ogr - 5, x = $avz, label = pa2('Overall-Test: p', k, round(pf, 3)), label.color = NA, fill = 'grey92');\";\t\t\t\t\n\t\t\t\t\n\t\t\t$r .= \"ggsave(gg, file = '$ofi', dpi = 600); rm(gg); rm(x); rm(y0);\".$l;\n\t\t\t$fi = $t.\"temp/box.r\"; write2($r, $fi); $s = Rserve_connect(); Rserve_eval($s, \"{ $r }\"); Rserve_close($s);\n\t\t\t\n\t\t\t$lg = $t.\"Rserve.log\";\n\t\t}\n\t\t$fi = fromto($ofi, getcwd().\"/\", \"\");\n\t\t$h = 700; echo $l.$l.\"<table border = 0 id = toptab><tr><td height = $h width = $h><img src = '$fi' style = 'height: 95%; width: 95%;'/></td><tr></table>\";\n\t\techop(\"<br><textarea id = rcmd rows = 8 cols = 130 wrap = off>\".preg_replace(\"/(\\t){1,}/\", \"\", $r).\"</textarea> \");\n\t\t\n\t\t$te = read2($lg); \n\t\techop(\"<br><textarea id = log rows = 8 cols = 130 wrap = off>\".preg_replace(\"/(\\t){1,}/\", \"\", $te).\"</textarea> \");\n\t\techo \"<script language = javascript>ta = document.getElementById('log'); ta.scrollTop = ta.scrollHeight; </script>\";\n\t}",
"public function fitBox()\n {\n // Reset min and max to opposite values\n $this->minRed = $this->minGreen = $this->minBlue = 255;\n $this->maxRed = $this->maxGreen = $this->maxBlue = 0;\n\n for ($i = $this->lowerIndex; $i <= $this->upperIndex; $i++) {\n $color = $this->colorCutQuantizer->getColors()[$i];\n $red = Color::red($color);\n $green = Color::green($color);\n $blue = Color::blue($color);\n\n if ($red > $this->maxRed) {\n $this->maxRed = $red;\n }\n if ($red < $this->minRed) {\n $this->minRed = $red;\n }\n if ($green > $this->maxGreen) {\n $this->maxGreen = $green;\n }\n if ($green < $this->minGreen) {\n $this->minGreen = $green;\n }\n if ($blue > $this->maxBlue) {\n $this->maxBlue = $blue;\n }\n if ($blue < $this->minBlue) {\n $this->minBlue = $blue;\n }\n }\n }",
"function boxes($boxes) {\n\t\t\tforeach($boxes as $box) {\n\t\t\t\t$this->box($box);\n\t\t\t}\n\t\t}",
"function plBoxes($pdf,$layout)\n{\n // note that fill is blank\n $pdf->SetFillColor(0,0,0);\n $pdf->SetTextColor(128,128,128);\n $pdf->SetLineWidth(0.025);\n\n areaRect($pdf,$layout[\"area\"]);\n\n $pdf->SetLineWidth(0.01);\n areaRect($pdf,$layout[\"title\"]);\n areaRect($pdf,$layout[\"customer\"]);\n areaRect($pdf,$layout[\"status\"]);\n areaRect($pdf,$layout[\"items\"]);\n areaRect($pdf,$layout[\"shipping\"]);\n}",
"function LineGraph($w, $h, $data, $options='', $colors=null, $maxVal=0, $nbDiv=4){\n$this->SetDrawColor(0,0,0);\n$this->SetLineWidth(0);\n$keys = array_keys($data);\n$ordinateWidth = 10;\n$w -= $ordinateWidth;\n$valX = $this->getX()+$ordinateWidth;\n$valY = $this->getY();\n$margin = 1;\n$titleH = 8;\n$titleW = $w;\n$lineh = 5;\n$keyH = count($data)*$lineh;\n$keyW = $w/5;\n$graphValH = 5;\n$graphValW = $w-$keyW-3*$margin;\n$graphH = $h-(3*$margin)-$graphValH;\n$graphW = $w-(2*$margin)-($keyW+$margin);\n$graphX = $valX+$margin;\n$graphY = $valY+$margin;\n$graphValX = $valX+$margin;\n$graphValY = $valY+2*$margin+$graphH;\n$keyX = $valX+(2*$margin)+$graphW;\n$keyY = $valY+$margin+.5*($h-(2*$margin))-.5*($keyH);\n//draw graph frame border\nif(strstr($options,'gB')){\n$this->Rect($valX,$valY,$w,$h);\n}\n//draw graph diagram border\nif(strstr($options,'dB')){\n$this->Rect($valX+$margin,$valY+$margin,$graphW,$graphH);\n}\n//draw key legend border\nif(strstr($options,'kB')){\n$this->Rect($keyX,$keyY,$keyW,$keyH);\n}\n//draw graph value box\nif(strstr($options,'vB')){\n$this->Rect($graphValX,$graphValY,$graphValW,$graphValH);\n}\n//define colors\nif($colors===null){\n$safeColors = array(0,51,102,153,204,225);\nfor($i=0;$i<count($data);$i++){\n$colors[$keys[$i]] = array($safeColors[array_rand($safeColors)],$safeColors[array_rand($safeColors)],$safeColors[array_rand($safeColors)]);\n}\n}\n//form an array with all data values from the multi-demensional $data array\n$ValArray = array();\nforeach($data as $key => $value){\nforeach($data[$key] as $val){\n$ValArray[]=$val;\n}\n}\n//define max value\nif($maxVal<ceil(max($ValArray))){\n$maxVal = ceil(max($ValArray));\n}\n//draw horizontal lines\n$vertDivH = $graphH/$nbDiv;\nif(strstr($options,'H')){\nfor($i=0;$i<=$nbDiv;$i++){\nif($i<$nbDiv){\n // $this->Line($graphX,$graphY+$i*$vertDivH,$graphX+$graphW,$graphY+$i*$vertDivH);\n} else{\n//$this->Line($graphX,$graphY+$graphH,$graphX+$graphW,$graphY+$graphH);\n}\n}\n}\n//draw vertical lines\n$horiDivW = floor($graphW/(count($data[$keys[0]])-1));\nif(strstr($options,'V')){\nfor($i=0;$i<=(count($data[$keys[0]])-1);$i++){\nif($i<(count($data[$keys[0]])-1)){\n // $this->Line($graphX+$i*$horiDivW,$graphY,$graphX+$i*$horiDivW,$graphY+$graphH);\n} else {\n//$this->Line($graphX+$graphW,$graphY,$graphX+$graphW,$graphY+$graphH);\n}\n}\n}\n//draw graph lines\nforeach($data as $key => $value){\n$this->setDrawColor($colors[$key][0],$colors[$key][1],$colors[$key][2]);\n$this->SetLineWidth(0.7);\n$valueKeys = array_keys($value);\nfor($i=0;$i<count($value);$i++){\nif($i==count($value)-2){\n$this->Line(\n$graphX+($i*$horiDivW),\n$graphY+$graphH-($value[$valueKeys[$i]]/$maxVal*$graphH),\n$graphX+$graphW,\n$graphY+$graphH-($value[$valueKeys[$i+1]]/$maxVal*$graphH)\n);\n} else if($i<(count($value)-1)) {\n$this->Line(\n$graphX+($i*$horiDivW),\n$graphY+$graphH-($value[$valueKeys[$i]]/$maxVal*$graphH),\n$graphX+($i+1)*$horiDivW,\n$graphY+$graphH-($value[$valueKeys[$i+1]]/$maxVal*$graphH)\n);\n}\n}\n//Set the Key (legend)\n$this->SetFont('Courier','',9);\nif(!isset($n))$n=0;\n$this->Line($keyX+1,$keyY+$lineh/2+$n*$lineh,$keyX+2,$keyY+$lineh/2+$n*$lineh);\n$this->SetXY($keyX+2,$keyY+$n*$lineh);\n$this->Cell($keyW,$lineh,$key,0,1,'L');\n$n++;\n}\n//print the abscissa values\nforeach($valueKeys as $key => $value){\nif($key==0){\n$this->SetXY($graphValX,$graphValY);\n$this->Cell(30,$lineh,$value,0,0,'L');\n} else if($key==count($valueKeys)-1){\n$this->SetXY($graphValX+$graphValW-30,$graphValY);\n$this->Cell(30,$lineh,$value,0,0,'R');\n} else {\n$this->SetXY($graphValX+$key*$horiDivW-15,$graphValY);\n$this->Cell(30,$lineh,$value,0,0,'C');\n}\n}\n//print the ordinate values\nfor($i=0;$i<=$nbDiv;$i++){\n$this->SetXY($graphValX-10,$graphY+($nbDiv-$i)*$vertDivH-3);\n$this->Cell(8,6,sprintf('%.1f',$maxVal/$nbDiv*$i),0,0,'L');\n}\n// $this->SetDrawColor(0,0,0);\n// $this->SetLineWidth(0.2);\n}",
"public function Draw($values)\n\t{\n\t\t$this->temp = $values;\n $num = count($this->temp);\n\t\t$len = ($num+7)*25+60+$num;\n\t\t$box = ($num+7)*20+($num+7);\n\t\t$wid = 300;\n\t\t$im = imagecreate($wid, $len+$box);\n\t\t$bg = imagecolorallocate($im, 255, 255, 255);\n\t\t$black = imagecolorallocate($im, 0, 0, 0);\n\n\n\t\t/**\n\t\t * drawing axis\n\t\t * 1st - y\n\t\t * 2nd - x\n\t\t * next two lines draw arrow on Y axis\n\t\t * next two lines draw arrow on X axis\n\t\t */\n\t\timageline($im, 20, $len-20, 20, 20, $black);\n\t\timageline($im, 20, $len-20, 280, $len-20, $black);\n imageline($im, 20, 20, 15, 25, $black);\n imageline($im, 20, 20, 25, 25, $black);\n imageline($im, 280, $len-20, 275, $len-25, $black);\n imageline($im, 280, $len-20, 275, $len-15, $black);\n /**\n * Draw scale on X axis\n */\n imageline($im, 20, $len-20, 20, $len-17, $black);\n ImageString($im, 2, 18, $len-15, 0, $black);\n for($i = 0; $i<10; $i++)\n {\n \timageline($im, 41+24*$i, $len-20, 41+24*$i, $len-17, $black);\n \tImageString($im, 2, 38+24*$i, $len-15, 10+10*$i . \"%\", $black);\n }\n /**\n * Setting colors for bars\n\t\t * - $this-color[] will contain color for each bar\n\t\t *\t\timagecolorallocate($im, $red, $green, $blue)\n\t\t *\tcolors will be random from 1 to 255\n */\n \n for($i = 0; $i < ($num+7); $i++)\n {\n\t \t$this->color[$i] = ImageColorAllocate($im, rand(1, 255), rand(1, 255),\n\t\t\t\t\t\t\t\trand(1, 255));\n\t\t}\n /**\n\t\t * creating new array with data\n\t\t * - $this->data will contain all values from $this->temp\n\t\t * - $realdiv sums up all values in array $this->data.\n\t\t * - next for() sums up number of Y's to be used in formula \n\t\t */\n\t\tfor($i = 0; $i < $num; $i++)\n {\n \t$this->data[$i] = $this->temp[$i][0];\n }\n\t\t$realdiv = array_sum($this->data);\n\t\tfor($i = 1; $i < ($num+1); $i++){\n\t\t \t@$y = $y+$i;\n\t\t} \n\t\t/**\n\t\t *\tnext thing untill $div = max $this->data does next\n\t\t *\t\tb = Sxy/Sxx\n\t\t *\t\ty = bx - a <- x or y are unknown\n\t\t *\t\ta = Y' - X'\n\t\t */\t \n\t\t$x_dash = $realdiv/($num+7);\n\t\t$y_dash = $y/($num+7);\n\t\t$b = ($realdiv - $x_dash)*($y - $y_dash)/(($realdiv - $x_dash)*($realdiv - $x_dash));\n\t\t$bdash_x = $b*$x_dash;\n\t\t$bx = $b*$realdiv;\n\t\t$a = $y_dash-$bdash_x; \n\t\t/**\n\t\t * Adding next data to array $this->data[]\n\t\t */\n\t\tfor($i= $num; $i < ($num+7); $i++)\n\t\t{\n\t\t\t$this->data[$i] = round(($i-$a)/$b);\n\t\t}\n\t\t/**\n\t\t * Finding max value of $this->data to use to find out procentages\n\t\t * $realdiv will provide slightly different procentage\n\t\t * $pred_value used to display prediction number\n\t\t */\n\t\t$div = max($this->data);\n\t\t$realdiv = array_sum($this->data);\n\t\t$pred_value = 1;\n\t\tfor($i = 0; $i<($num+7); $i++)\n\t\t{\n\t\t\t/**\n\t\t\t * We create two arrays with different sets of procentages \n\t\t\t * $this->pred and $this->realpred.\n\t\t\t * - first image filledrectangle will create bar\n\t\t\t *\t\timagefilledrectangle ($im, $x1, $y1, $x2, $y2, $color)\n\t\t\t * - first imagestring will write value next to the bar which we just created\n\t\t\t *\t\timagestring($im, $font, $x, $y, $string, $color)\n\t\t\t * - second imagefilledrectangle will create small rectangle in the information box\n\t\t\t * - imageline will create a line on the right bottom of the rectange which we \n\t\t\t * \t\tjust created\n\t\t\t *\t\timageline($im, $x1, $y1, $x2, $y2, $color)\n\t\t\t */\n\t\t\t$this->pred[$i] = round(($this->data[$i]/$realdiv)*100);\n\t\t\t$this->realpred[$i] = round(($this->data[$i]/$div)*100);\n \t\t\timagefilledrectangle($im, 21, 41+25*$i, 20+(($wid-60)/100)*$this->realpred[$i],\n\t\t\t\t\t61+25*$i, $this->color[$i]);\n\t\t\timagestring($im, 2, 25+(($wid-60)/100)*$this->realpred[$i],\n\t\t\t\t\t\t44+25*$i, $this->data[$i], $black);\n\n\t\t\timagefilledrectangle($im, 20, $len+10+($i*20), 30, $len+20+($i*20),\n\t\t\t\t\t\t$this->color[$i]);\n\t\t\timageline($im, 20, $len+20+($i*20), 200, $len+20+($i*20), $this->color[$i]);\n\t\t}\n\t\t/** \n\t\t * next for() will create text in the information box next to rectangle which we\n\t\t * created above\n\t\t * imagestring($im, $font, $x, $y, $string, $color)\n\t\t */\n\t\tfor($i= 0; $i < $num; $i++)\n\t\t{\n\t\t\tImageString($im, 1, 35, $len+10+($i*20), $this->pred[$i] . \"% - \" .\n\t\t\t\t\t\t$this->data[$i] . \" from \" . $this->temp[$i][1] , $black);\n\t\t}\n\t\tfor($i= $num; $i < ($num+7); $i++)\n\t\t{\t\t\t\n\t\t\tImageString($im, 1, 35, $len+10+($i*20), $this->pred[$i] . \"% - \" . $this->data[$i] . \" Prediction \" . $pred_value, $black);\n\t\t\t$pred_value++;\t\n\t\t}\n\t\t/**\n\t\t * Save image\n\t\t * Destroy image from memory\n\t\t */\n\t\tImagePNG($im, \"temp/pred-bar-graph.png\");\n\t\tImageDestroy($im);\n\t}",
"private function plotData() : void\n\t{\n\t\t$n = $this->getSize();\n\t\tif($n === -1) {\n\t\t\texit();\n\t\t}\n\n\t\tfor ($i=0; $i < $n; $i++) { \n\t\t\timagefilledellipse($this->im, $this->xValues[$i]*$this->scaleX+$this->shiftX, $this->yValues[$i]*$this->scaleY*(-1)+$this->shiftY, 10, 10, $this->colorPoints);\n\t\t}\n\n\t}",
"function draw_boxes2 ($image, $colorid=0, $offset=0) {\r\n \r\n $color[0]= imagecolorallocate($image, 0, 0, 0);\r\n $color[1]= imagecolorallocate($image, 255, 0, 0);\r\n $color[2]= imagecolorallocate($image, 0, 255, 0);\r\n $color[3]= imagecolorallocate($image, 0, 0, 255);\r\n $color[4]= imagecolorallocate($image, 255, 255, 0);\r\n \r\n $linecolor=$color[$colorid];\r\n \r\n foreach($this->text_blocks as $text_block) {\r\n imageline ( $image , $text_block->ordered['x1'] -$offset, $text_block->ordered['y1'] -$offset, $text_block->ordered['x2'] +$offset, $text_block->ordered['y2'] -$offset, $linecolor);\r\n imageline ( $image , $text_block->ordered['x2'] +$offset, $text_block->ordered['y2'] -$offset, $text_block->ordered['x3'] +$offset, $text_block->ordered['y3']+$offset , $linecolor);\r\n imageline ( $image , $text_block->ordered['x3'] +$offset, $text_block->ordered['y3'] +$offset, $text_block->ordered['x4'] -$offset, $text_block->ordered['y4']+$offset , $linecolor);\r\n imageline ( $image , $text_block->ordered['x4'] -$offset, $text_block->ordered['y4'] +$offset, $text_block->ordered['x1'] -$offset, $text_block->ordered['y1']-$offset , $linecolor);\r\n }\r\n $this->image_drawn=$image;\r\n }",
"private function render_boxes( $boxes ) {\n foreach ( $boxes as $box ) {\n $this->render_box( $box );\n }\n }",
"protected function DrawBubbles()\n {\n if (!$this->CheckDataType('data-data-xyz'))\n return FALSE;\n\n $gcvars = []; // For GetDataColor, which initializes and uses this.\n\n // Calculate or use supplied maximum bubble size:\n if (isset($this->bubbles_max_size)) {\n $bubbles_max_size = $this->bubbles_max_size;\n } else {\n $bubbles_max_size = min($this->plot_area_width, $this->plot_area_height) / 12;\n }\n\n // Calculate bubble scale parameters. Bubble_size(z) = $f_size * $z + $b_size\n if ($this->max_z <= $this->min_z) { // Regressive case, no Z range.\n $f_size = 0;\n $b_size = ($bubbles_max_size + $this->bubbles_min_size) / 2; // Use average size of all bubbles\n } else {\n $f_size = ($bubbles_max_size - $this->bubbles_min_size) / ($this->max_z - $this->min_z);\n $b_size = $bubbles_max_size - $f_size * $this->max_z;\n }\n\n for ($row = 0; $row < $this->num_data_rows; $row++) {\n $rec = 1; // Skip record #0 (data label)\n $x = $this->xtr($this->data[$row][$rec++]); // Get X value from data array.\n\n // Draw X Data labels?\n if ($this->x_data_label_pos != 'none')\n $this->DrawXDataLabel($this->data[$row][0], $x, $row, TRUE);\n\n // Proceed with Y,Z values\n for ($idx = 0; $rec < $this->num_recs[$row]; $rec += 2, $idx++) {\n\n if (is_numeric($y_now = $this->data[$row][$rec])) { //Allow for missing Y data\n $y = $this->ytr($y_now);\n $z = (double)$this->data[$row][$rec+1]; // Z is required if Y is present.\n $size = (int)($f_size * $z + $b_size); // Calculate bubble size\n\n // Select the color:\n $this->GetDataColor($row, $idx, $gcvars, $data_color);\n\n // Draw the bubble:\n ImageFilledEllipse($this->img, $x, $y, $size, $size, $data_color);\n $this->DoCallback('data_points', 'circle', $row, $idx, $x, $y, $size);\n }\n }\n }\n return TRUE;\n }",
"public static function fromTTFBox(array $data)\n\t{\n\t\t#67UL 45UR\n\t\t#01LL 23LR\n\t\treturn new GWF_GDRect($data[6], $data[1], $data[4]-$data[6], $data[1]-$data[7]);\n\t}",
"private function drawYaxis()\n {\n\n $min =\n round($this->min, $this->precision);\n $max =\n round($this->max, $this->precision);\n\n if (!isset($this->y_axis_legend_increment)) {\n\n $increment =\n round(($max - $min) / $this->total_values, $this->precision);\n } else {\n $increment = $this->y_axis_legend_increment;\n }\n\n if ($increment == 0) {\n $increment = 1;\n }\n\n //$spacing = \\round($spacing, 10);\n for ($label = $min; $label <= $max + $increment; $label+=$increment) {\n\n $px_position = $this->plotValue($label);\n if ($this->x_axis_hints == 1) {\n \\imageline($this->im, 0, $px_position, $this->width,\n $px_position, $this->ink['axis']);\n }\n imagestring($this->im, 1, 10, $px_position - 4, $label,\n $this->ink['text']);\n }\n }",
"protected function InitialiseQBoxes()\n\t\t{\n\t\t\t/* Initialise each of the q-boxes using the t-tables */ \n\t\t\t$this->MakeQTable( $this->t_table[0], $this->q_table[0] );\n\t\t\t$this->MakeQTable( $this->t_table[1], $this->q_table[1] ); \n\t\t}",
"public function register_boxes()\n\t{\n\t\t$posttypes = apply_filters(\n\t\t\t$this->vars['filter_prefix'] . '_post_types'\n\t\t,\t(array) $this->vars['posttypes']\n\t\t);\n\n\t\tforeach ( $posttypes as $posttype )\n\t\t{\n\t\t\tadd_meta_box(\n\t\t\t\t$this->vars['key'],\n\t\t\t\t$this->vars['title'],\n\t\t\t\tarray ( $this, 'print_meta_box' ),\n\t\t\t\t$posttype,\n\t\t\t\t'side',\n\t\t\t\t$this->vars['priority']\n\t\t\t);\n\t\t}\n\t}",
"function display_moods_dashboard_graph($blognames, $values) {\r\n\t?>\r\n\r\n<!--[if lt IE 9]><script language=\"javascript\" type=\"text/javascript\" src=\"<?php echo plugins_url(); ?>/eb-enquiryblogbuilder/flot/excanvas.min.js\"></script><![endif]-->\r\n\r\n<div id=\"moods_placeholder\" style=\"width:100%; height:250px;\"></div>\r\n\r\n<div id=\"moods_legend_placeholder\" style=\"width:100%;\"></div>\r\n\r\n<script language=\"javascript\" type=\"text/javascript\">\r\n\r\njQuery(function moods() {\r\n\t\t<?php\r\n\r\n\t\t$i = 0;\r\n\t\t$data = \"\";\r\n\t\tforeach ($values as $value) {\r\n\t\t\t?>\r\n\t\t\tvar moods_data_<?php echo $i; ?> = {label:\"<?php echo $blognames[$i][0]; ?>\", data:[<?php\t$j=0; foreach ($value as $number) {\techo '['.strtotime($number->time).'000,'.$number->mood.']'; $j++; if ($j < count($value)) echo ', ';\t}\t?> ]};\r\n\t\t\t<?php\r\n\t\t\t$data = $data.' moods_data_'.$i;\r\n\t\t\t$i++;\r\n\t\t\tif ($i < count($values)) $data = $data.', ';\r\n\t\t}\r\n\r\n\t\techo \"var tooltip = [\";\r\n\t\t$j = 0;\r\n\t\tforeach ($values as $value) {\r\n\t\t\t$i = 0;\r\n\t\t\techo \" [\";\r\n\r\n\t\t\tforeach ($value as $number) {\r\n\t\t\t\t $date = urlencode($number->post_date);\r\n\t\t\t\t echo '{title:\"'.($number->post_title).'\", url:\"'.$blognames[$j][1].'?mood_view='.($date).'\"}'; $i++; if ($i < count($value)) echo ', ';\r\n\t\t\t}\r\n\t\t\t$j++;\r\n\t\t\techo \"]\";\r\n\t\t\tif ($j < count($values)) echo ', ';\r\n\t\t}\r\n\t\techo \"];\";\r\n\t\t?>\r\n\r\n\r\n\t\t// Attach a click function to links with the metabox-group class to redraw the graph\r\n\t\t// otherwise it doesn't get redrawn if the box starts closed.\r\n\t\t//jQuery('#mood_view_dashboard').click(function(){\r\n\t\t//\tplotGraphMoods();\r\n\t\t//});\r\n\r\n\t\t//jQuery(window).resize(function () {\r\n\t\t//\tplotGraphMoods();\r\n\t\t//});\r\n\r\n function plotGraphMoods() {\r\n\t\t\tjQuery.plot(jQuery(\"#moods_placeholder\"), [ <?php echo $data; ?> ], {\r\n\t\t\t\tseries: {\r\n\t\t\t\t\t points: { show: true },\r\n\t\t\t\t\t lines: { show: true }\r\n\t\t\t },\r\n\r\n\t\t\t\tgrid: {clickable: true, hoverable: true},\r\n\t\t\t\tlegend: {noColumns: 5, container: jQuery(\"#moods_legend_placeholder\")},\r\n\r\n\t\t\t\tyaxis: {\r\n\t\t\t\t\tmin: -0.5,\r\n\t\t\t\t\tmax: 4.5,\r\n\t\t\t\t\tticks: [[0, \":-(\"], [1,\":-/\"], [2,\":-|\"], [3,\":-)\"], [4,\":-D\"]]\r\n\t\t\t\t},\r\n\t\t\t\txaxis: {\r\n\t\t\t\t\trotateTicks: 90,\r\n\t\t\t\t\tmode: \"time\" }\r\n\t\t\t});\r\n }\r\n\r\n\r\n jQuery(\"#moods_placeholder\").bind(\"plotclick\", function (event, pos, item) {\r\n\t\t\tif (item) {\r\n\t\t\t\twindow.open(tooltip[item.seriesIndex][item.dataIndex].url, \"_self\", null, true);\r\n\t\t\t}\r\n });\r\n\r\n function showTooltip(x, y, label) {\r\n\t\t\tjQuery('<div id=\"tooltip\">' + label + '</div>').css( {\r\n\t\t\t\tposition: 'absolute',\r\n\t\t\t\tdisplay: 'none',\r\n\t\t\t\ttop: y + 5,\r\n\t\t\t\tleft: x + 5,\r\n\t\t\t\tborder: '1px solid #fdd',\r\n\t\t\t\tpadding: '2px',\r\n\t\t\t\t'background-color': '#fee',\r\n\t\t\t\topacity: 0.80\r\n\t\t\t}).appendTo(\"body\").fadeIn(200);\r\n }\r\n\r\n\t\tvar previousPoint = null;\r\n\t\tjQuery(\"#moods_placeholder\").bind(\"plothover\", function (event, pos, item) {\r\n\t\t\tif (item) {\r\n\t\t\t\tif (previousPoint != item.datapoint) {\r\n\t\t\t\t\tpreviousPoint = item.datapoint;\r\n\r\n\t\t\t\t\tjQuery(\"#tooltip\").remove();\r\n\t\t\t\t\tvar x = item.pageX;\r\n\t\t\t\t\tvar y = item.pageY;\r\n\r\n\t\t\t\t\tshowTooltip(x, y, item.series.label + \"<br/>\" + tooltip[item.seriesIndex][item.dataIndex].title);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tjQuery(\"#tooltip\").remove();\r\n\t\t\t\tpreviousPoint = null;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\r\n plotGraphMoods();\r\n});\r\n</script>\r\n\r\n<?php\r\n}",
"private function get_inner_boxes() {\n\t\t$dummy_pdf_obj = new TCPDF($this->page_orientation, $this->page_units, $this->page_format);\n\n\t\t$this->default_tcpdf_options($dummy_pdf_obj);\n\t\t$cell_height_padding = 0;\t\t\t\n\t\t$total_width = 0;\n\n\t\t// iterate through all of the child \"box\" nodes and draw them into the dummy pdf\n\t\twhile($this->xml_reader->read()) {\n\t\t\tif ($this->xml_reader->name == \"box\") {\n\t\t\t\t$width = $this->xml_reader->getAttribute(\"width\");\n\t\t\t\t$height = $this->xml_reader->getAttribute(\"height\");\n\t\t\t\t$border = $this->xml_reader->getAttribute(\"border\");\n\t\t\t\t$align = $this->xml_reader->getAttribute(\"align\");\n\t\t\t\t$fill = $this->xml_reader->getAttribute(\"fill\");\n\n\t\t\t\t$this->xml_reader->read();\n\t\t\t\t$text = $this->trim_string($this->xml_reader->value);\n\t\t\t\t$this->xml_reader->read();\n\n\t\t\t\t$text = str_replace(\"\\\\n\", \"\\n\", $text);\n\t\t\t\t$dummy_pdf_obj->MultiCell($width, $height, $text, $border, $align, 0, 0);\n\n\t\t\t\t// calculate the cell height padding\n\t\t\t\tif ($dummy_pdf_obj->GetPreviousMultiCellHeight() > $cell_height_padding)\n\t\t\t\t\t$cell_height_padding = $dummy_pdf_obj->GetPreviousMultiCellHeight();\n\n\t\t\t\t$this->current_cell_count++;\n\t\t\t\t$this->current_groupbox_data[] = array(\"width\" => $width,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"height\" => $height,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"border\" => $border,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"align\" => $align,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"text\" => $text,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"fill\" => $fill);\n\n\t\t\t\t$total_width++;\n\t\t\t}\n\n\t\t\tif ($this->xml_reader->name == \"image\") {\n\t\t\t\t$file = $this->xml_reader->getAttribute(\"file\");\n\t\t\t\t$width = $this->xml_reader->getAttribute(\"width\");\n\t\t\t\t$height = $this->xml_reader->getAttribute(\"height\");\n\t\t\t\t$type = $this->xml_reader->getAttribute(\"type\");\n\t\t\n\t\t\t\t$this->current_cell_count++;\n\n\t\t\t\t$this->current_groupbox_image_data[] = array(\"file\" => $file,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"width\" => $width,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"height\" => $height,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"type\" => $type);\n\t\t\t}\n\n\t\t\t// if we are on the closing boxgroup node then break out of iteration\n\t\t\tif ($this->xml_reader->name == \"boxgroup\" && $this->xml_reader->nodeType == XMLREADER::END_ELEMENT)\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$this->current_cell_height_padding = $cell_height_padding;\n\t}",
"function _draw_axes($max_y, $y_scale, $x_label = 'X axis', $y_label = 'Y axis')\n{\n $output = '';\n $prev_i = 0;\n\n // Draw Y-axis markers, labels, and background lines\n for ($i = 1; $i < intval(ceil($max_y)) + 1; $i++) {\n if (abs($i * $y_scale - $prev_i * $y_scale) >= MIN_Y_MARKER_DISTANCE) {\n $output .= '<text x=\"' . float_to_raw_string(Y_LABEL_WIDTH) . '\" y=\"' . float_to_raw_string(PLOT_HEIGHT - ($i * $y_scale) + PLOT_HEIGHT_BIAS) . '\" class=\"axis_marker_text\">' . integer_format($i) . '</text>' . \"\\n\";\n $output .= '<line x1=\"' . float_to_raw_string(Y_LABEL_WIDTH + (Y_AXIS_WIDTH / 2)) . '\" y1=\"' . float_to_raw_string(PLOT_HEIGHT - ($i * $y_scale) + PLOT_HEIGHT_BIAS) . '\" x2=\"' . float_to_raw_string(Y_LABEL_WIDTH + Y_AXIS_WIDTH) . '\" y2=\"' . float_to_raw_string(PLOT_HEIGHT - ($i * $y_scale) + PLOT_HEIGHT_BIAS) . '\" class=\"axis_marker\" />' . \"\\n\";\n $output .= '<line x1=\"' . float_to_raw_string(Y_LABEL_WIDTH + Y_AXIS_WIDTH) . '\" y1=\"' . float_to_raw_string(PLOT_HEIGHT - ($i * $y_scale) + PLOT_HEIGHT_BIAS) . '\" x2=\"' . float_to_raw_string(SVG_WIDTH) . '\" y2=\"' . float_to_raw_string(PLOT_HEIGHT - ($i * $y_scale) + PLOT_HEIGHT_BIAS) . '\" class=\"axis_background_line\" />' . \"\\n\";\n $prev_i = $i;\n }\n }\n $output .= '<text x=\"' . float_to_raw_string(Y_LABEL_WIDTH) . '\" y=\"' . float_to_raw_string(PLOT_HEIGHT + PLOT_HEIGHT_BIAS) . '\" class=\"axis_marker_text\">0</text>' . \"\\n\";\n\n // X axis\n $output .= '<line x1=\"' . float_to_raw_string(Y_LABEL_WIDTH) . '\" y1=\"' . float_to_raw_string(PLOT_HEIGHT + PLOT_HEIGHT_BIAS) . '\" x2=\"' . float_to_raw_string(SVG_WIDTH) . '\" y2=\"' . float_to_raw_string(PLOT_HEIGHT + PLOT_HEIGHT_BIAS) . '\" class=\"axis_line\" />' . \"\\n\";\n\n // X axis label\n $output .= '<text x=\"' . float_to_raw_string(Y_LABEL_WIDTH + Y_AXIS_WIDTH + X_PADDING) . '\" y=\"' . float_to_raw_string(PLOT_HEIGHT + X_AXIS_HEIGHT + PLOT_HEIGHT_BIAS) . '\" class=\"axis_text\">' . escape_html($x_label) . '</text>' . \"\\n\";\n\n // Y axis\n $output .= '<line x1=\"' . float_to_raw_string(Y_LABEL_WIDTH + Y_AXIS_WIDTH) . '\" y1=\"' . float_to_raw_string(0.0) . '\" x2=\"' . float_to_raw_string(Y_LABEL_WIDTH + Y_AXIS_WIDTH) . '\" y2=\"' . float_to_raw_string(PLOT_HEIGHT + X_AXIS_HEIGHT + PLOT_HEIGHT_BIAS) . '\" class=\"axis_line\" />' . \"\\n\";\n\n // Y axis label\n $output .= '<text transform=\"translate(' . float_to_raw_string(Y_LABEL_WIDTH) . ',' . float_to_raw_string(PLOT_HEIGHT + PLOT_HEIGHT_BIAS) . ') rotate(270)\" class=\"axis_text\">' . escape_html($y_label) . '</text>' . \"\\n\";\n\n return $output;\n}",
"function SetBox($aDrawPlotFrame = true, $aPlotFrameColor = array(0, 0, 0), $aPlotFrameWeight = 1)\n {\n $this->boxed = $aDrawPlotFrame;\n $this->box_weight = $aPlotFrameWeight;\n $this->box_color = $aPlotFrameColor;\n }",
"public function BoxSizes ( )\n\t{\n\t\t/*\n\t\t * Prepare dummy data.\n\t\t */\n\t\t$sizes = Array( 'Total' => 0, 'Inbox' => 0, 'Schedule' => 0, 'Projects' => 0, /*'Calendar' =>0, */'Na' => 0, 'Wf' => 0, 'Sd' => 0, 'Ar' => 0 );\n\t\t$avg = Array( 'Inbox' => 0, 'Schedule' => 0, 'Projects' => 0, 'Na' => 0, 'Wf' => 0, 'Sd' => 0, 'Ar' => 0 );\n\n\t\t/*\n\t\t * Collect data for virtual tab Schedule.\n\t\t */\n\t\t$sch = _db_1line( \"SELECT AVG(`\" . self::F_STUFFPRIORITY . \"`) as rating,COUNT(*) as size FROM ( SELECT * FROM ( SELECT * FROM `\" . self::T_STUFFBOXES . \"` WHERE `\" . self::F_STUFFUID . \"` = \\\"\" . _db_escape( $this->UID ) . \"\\\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGROUP BY `\" . self::F_STUFFSID . \"`,`\" . self::F_STUFFSEQ . \"` DESC ORDER BY `\" . self::F_STUFFSEQ . \"` DESC) boxes\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGROUP BY `\" . self::F_STUFFSID . \"`) noDnTh\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE `\" . self::F_STUFFBOX . \"` <> \\\"Ar\\\" AND `\" . self::F_STUFFDATESET . \"` <> 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\" );\n\n\t\tif ( is_array( $sch ) )\n\t\t{\n\t\t\t$sizes['Schedule'] = (int)$sch['size'];\n\t\t\t$avg['Schedule'] = (float)$sch['rating'];\n\t\t}\n\n\t\t/*\n\t\t * Collect information for Projects tab.\n\t\t */\n\t\t$prj = _db_1line( \"SELECT AVG(`\" . self::F_STUFFPRIORITY . \"`) as rating,COUNT(*) as size FROM ( SELECT * FROM ( SELECT `\" . self::T_STUFFBOXES . \"`.* FROM `\" . self::T_STUFFBOXES . \"`\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN `\" . self::T_STUFFPROJECTS . \"` ON ( `\" . self::T_STUFFPROJECTS . \"`.`\" . self::F_STUFFSID . \"` = `\" . self::T_STUFFBOXES . \"`.`\" . self::F_STUFFSID . \"` )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE `\" . self::T_STUFFBOXES . \"`.`\" . self::F_STUFFUID . \"` = \\\"\" . _db_escape( $this->UID ) . \"\\\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGROUP BY `\" . self::T_STUFFBOXES . \"`.`\" . self::F_STUFFSID . \"`,`\" . self::F_STUFFSEQ . \"` DESC ORDER BY `\" . self::F_STUFFSEQ . \"` DESC) boxes\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGROUP BY `\" . self::F_STUFFSID . \"`) noDnTh\" );\n\n\t\tif ( is_array( $prj ) )\n\t\t{\n\t\t\t$sizes['Projects'] = (int)$prj['size'];\n\t\t\t$avg['Projects'] = (float)$prj['rating'];\n\t\t}\n\n\t\t/*\n\t\t * Collect informations from stuff_boxes.\n\t\t */\n\t\t$res = _db_query( \"SELECT `\" . self::F_STUFFBOX . \"`,AVG(`\" . self::F_STUFFPRIORITY . \"`) as rating,COUNT(*) as size\n\t\t\t\t\t\t\t\tFROM ( SELECT *\n\t\t\t\t\t\t\t\t\tFROM ( SELECT * FROM `\" . self::T_STUFFBOXES . \"`\n\t\t\t\t\t\t\t\t\t\t\t\t\tGROUP BY `\" . self::F_STUFFSID . \"`,`\" . self::F_STUFFSEQ . \"` DESC\n\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY `\" . self::F_STUFFSEQ . \"` DESC\n\t\t\t\t\t\t\t\t\t\t ) sq1\n\t\t\t\t\t\t\t\t\tWHERE `\" . self::F_STUFFUID . \"` = \\\"\" . _db_escape( $this->UID ) . \"\\\" AND `\" . self::F_STUFFBOX . \"` <> \\\"\\\"\n\t\t\t\t\t\t\t\t\tGROUP BY `\" . self::F_STUFFSID . \"`) sq2 GROUP BY `\" . self::F_STUFFBOX . \"`\" );\n\n\t\tif ( $res && _db_rowcount( $res ) )\n\t\t{\n\t\t\twhile ( $row = _db_fetchrow( $res ) )\n\t\t\t{\n\t\t\t\t$sizes[$row[self::F_STUFFBOX]] = $row['size'];\n\t\t\t\t$avg[$row[self::F_STUFFBOX]] = /*round*/( (float) $row['rating'] );\n\t\t\t}\n\t\t}\n\n\t\t//var_dump($avg);\n\t\t$avg = StuffBpAlg::Proxy( $avg, StuffCfgFactory::getInstance( )->get( 'usr.alg' ) );\n\t\t//var_dump($avg);\n\t\t//var_dump($avg);\n\n\t\t$total = 0;\n\t\tforeach( $sizes as $box => $size )\n\t\t{\n\t\t\tif ( !array_key_exists( $box, $avg ) )\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\tif ( ( ( $box != 'Ar' ) && ( $box != 'Schedule' ) ) && ( $box != 'Projects' ) )\t// only open things to do (done and trashed are not counted)\n\t\t\t\t$total += $size;\n\n\t\t\t/* For disabled colors */\n\t\t\tif ( $avg[$box] == 99 )\n\t\t\t\t$avg[$box] = 1;\n\t\t\t/*else\n\t\t\t\t$class[$box] = 'C' . $avg[$box] ;*/\n\t\t}\n\t\t$sizes['Total'] = $total;\n\t\t$sizes['i18n'] = $this->messages['tabNumbers']->ToString( $sizes['Total'] );\n\n\t\treturn Array( 'size' => $sizes, 'avg' => $avg/*, 'class' => $class */);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes the type of the expression. | public function removeExpressionType(O\Expression $expression); | [
"private function unrollExpression($type): void\n {\n for($i = count($this->tokens); $i > 0; $i++) {\n $token = $this->tokens[$i - 1];\n if (($token->getTokenType() & $type) != 0)\n {\n unset($this->tokens[i - 1]);\n }\n else\n {\n break;\n }\n }\n\n $this->tokens = array_values($this->tokens);\n }",
"function removeType()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $db->begin();\r\n\r\n // delete values\r\n $res[] = $db->query( \"DELETE FROM eZTrade_AttributeValue\r\n WHERE ProductID='$this->ID'\" );\r\n\r\n $res[] = $db->query( \"DELETE FROM eZTrade_ProductTypeLink\r\n WHERE ProductID='$this->ID'\" );\r\n eZDB::finish( $res, $db );\r\n\r\n }",
"function removeType()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n // delete values\r\n $db->query( \"DELETE FROM eZLink_AttributeValue WHERE LinkID='$this->ID'\" );\r\n\r\n $db->query( \"DELETE FROM eZLink_TypeLink WHERE LinkID='$this->ID'\" );\r\n\r\n }",
"public function removeType(NodeInterface $type);",
"public function clear($type);",
"public function removeRootBindingTypes(Expression $expr);",
"public function removeType($type)\n {\n foreach ($this->fields as $fieldname => $field) {\n if ($field->type == $type) {\n unset($this->fields[$fieldname]);\n }\n }\n return $this;\n }",
"public function removeTypeHint()\n {\n $this->typeHint = null;\n\n return $this;\n }",
"function removeType()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n // delete values\r\n $db->query( \"DELETE FROM eZMediaCatalogue_AttributeValue WHERE MediaID='$this->ID'\" );\r\n\r\n $db->query( \"DELETE FROM eZMediaCatalogue_TypeLink WHERE MediaID='$this->ID'\" );\r\n\r\n }",
"public function removeFilter( $type = 'where', $expression = null ) {\n\n if( empty( $type ) ) $this->_filters = [];\n else if( isset( $this->_filters[ $type ] ) ) {\n\n if( !is_string( $expression ) ) unset( $this->_filters[ $type ] );\n else foreach( $this->_filters[ $type ] as $index => $filter ) {\n if( $filter[ 'expression' ] == $expression ) unset( $this->_filters[ $type ][ $index ] );\n }\n }\n\n return $this;\n }",
"function removeOptionType($type);",
"public function unregisterTypeInferenceRule(string $phpType): void\n {\n unset($this->typeInferenceRules[$phpType]);\n }",
"function _acf_query_remove_post_type($sql) {}",
"public function remove_vtype()\n {\n\t\t// get array\n\t\t\t$get=$this->get_input_vals();\n\n\t\t// remove\n\t\t\t$this->variation_model->remove_nvar_type($get);\n }",
"function remove_by_type($type) {\n\t\t$db=openqrm_get_db_connection();\n\t\t$rs = $db->Execute(\"delete from $this->_db_table where deployment_type='$type'\");\n\t}",
"public function removeExpressions()\n {\n $this->expressions = [];\n }",
"function remove_type($type=null)\r\n {\r\n if (!isset($type)) {\r\n $this->mime_types = array();\r\n return;\r\n }\r\n $slash_pos = strpos($type, '/');\r\n if (!$slash_pos) return;\r\n\r\n $type_info = array('last_match'=>false, 'wildcard'=>false, 'type'=>$type);\r\n if (substr($type, $slash_pos) == '/*') {\r\n $type_info['wildcard'] = true;\r\n $type_info['type'] = substr($type, 0, $slash_pos);\r\n }\r\n $this->scan(array(&$this, '_remove_type_callback'), $type_info);\r\n }",
"private function removeAccountType()\n {\n $this->get('session')->remove('client.accounts.account_type');\n }",
"public function unsetComparisonType() {\n\t\tunset($this->getModel()->filterArgs[$this->_field]['comp_type']);\n\t\t$this->_makeDirty();\n\n\t\tunset($this->getModel()->filterArgs[$this->_field]['allowEmpty']);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation organizationIdPutAsyncWithHttpInfo Update info on one organization | public function organizationIdPutAsyncWithHttpInfo($id, $organization = null)
{
$returnType = '';
$request = $this->organizationIdPutRequest($id, $organization);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
return [null, $response->getStatusCode(), $response->getHeaders()];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
);
} | [
"public function organizationIdPutWithHttpInfo($id, $organization = null)\n {\n $request = $this->organizationIdPutRequest($id, $organization);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\ErrorResponse[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\ServiceFailureResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function ordersV2PutAsyncWithHttpInfo($id2, $amount, $customer_id, $currency_code, $created_utc, $vat_amount, $roundings_amount, $delivered_amount, $delivered_vat_amount, $delivered_roundings_amount, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $your_reference, $our_reference, $invoice_address1, $invoice_address2, $invoice_city, $invoice_country_code, $invoice_customer_name, $invoice_postal_code, $delivery_method_name, $delivery_method_code, $delivery_term_name, $delivery_term_code, $eu_third_party, $customer_is_private_person, $order_date, $status, $number, $modified_utc, $delivery_date, $house_work_amount, $house_work_automatic_distribution, $house_work_corporate_identity_number, $house_work_property_name, $rows, $shipped_date_time, $rot_reduced_invoicing_type, $rot_property_type, $persons, $reverse_charge_on_construction_services, $uses_green_technology, $id)\n {\n $returnType = 'object';\n $request = $this->ordersV2PutRequest($id2, $amount, $customer_id, $currency_code, $created_utc, $vat_amount, $roundings_amount, $delivered_amount, $delivered_vat_amount, $delivered_roundings_amount, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $your_reference, $our_reference, $invoice_address1, $invoice_address2, $invoice_city, $invoice_country_code, $invoice_customer_name, $invoice_postal_code, $delivery_method_name, $delivery_method_code, $delivery_term_name, $delivery_term_code, $eu_third_party, $customer_is_private_person, $order_date, $status, $number, $modified_utc, $delivery_date, $house_work_amount, $house_work_automatic_distribution, $house_work_corporate_identity_number, $house_work_property_name, $rows, $shipped_date_time, $rot_reduced_invoicing_type, $rot_property_type, $persons, $reverse_charge_on_construction_services, $uses_green_technology, $id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function accountsV2PutAsyncWithHttpInfo($body, $fiscalyear_id, $account_number)\n {\n $returnType = '\\Swagger\\Client\\Model\\AccountApi';\n $request = $this->accountsV2PutRequest($body, $fiscalyear_id, $account_number);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function quotesV2PutAsyncWithHttpInfo($id2, $number, $customer_id, $due_date, $quote_date, $created_utc, $approved_date, $currency_code, $status, $currency_rate, $company_reference, $eu_third_party, $customer_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_method_code, $delivery_term_code, $delivery_term_name, $customer_is_private_person, $includes_vat, $is_domestic, $rot_reduced_invoicing_type, $rot_property_type, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_automatic_distribution, $persons, $terms_of_payment, $sales_document_attachments, $rows, $total_amount, $vat_amount, $roundings_amount, $uses_green_technology, $id)\n {\n $returnType = 'object';\n $request = $this->quotesV2PutRequest($id2, $number, $customer_id, $due_date, $quote_date, $created_utc, $approved_date, $currency_code, $status, $currency_rate, $company_reference, $eu_third_party, $customer_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_method_code, $delivery_term_code, $delivery_term_name, $customer_is_private_person, $includes_vat, $is_domestic, $rot_reduced_invoicing_type, $rot_property_type, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_automatic_distribution, $persons, $terms_of_payment, $sales_document_attachments, $rows, $total_amount, $vat_amount, $roundings_amount, $uses_green_technology, $id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function testOrganizationsOrganizationIdPut()\n {\n }",
"public function update($organizationId, Google_Service_Cloudresourcemanager_Organization $postBody, $optParams = array())\n {\n $params = array('organizationId' => $organizationId, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('update', array($params), \"Google_Service_Cloudresourcemanager_Organization\");\n }",
"public function documentPutAsyncWithHttpInfo($id, $business_id, $model, string $contentType = self::contentTypes['documentPut'][0])\n {\n $returnType = '\\OpenAPI\\Client\\Model\\DocumentModel';\n $request = $this->documentPutRequest($id, $business_id, $model, $contentType);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function testUpdateCompanyUsingPUT()\n {\n }",
"public function restPimAttributesPutAsyncWithHttpInfo()\n {\n $returnType = 'object';\n $request = $this->restPimAttributesPutRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateOrganizationWithHttpInfo($organization_id, $organization_update)\n {\n $returnType = '\\Bluerain\\ID4iClient\\Model\\Organization';\n $request = $this->updateOrganizationRequest($organization_id, $organization_update);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Bluerain\\ID4iClient\\Model\\Organization',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Bluerain\\ID4iClient\\Model\\ApiError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Bluerain\\ID4iClient\\Model\\ApiError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Bluerain\\ID4iClient\\Model\\ApiError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Bluerain\\ID4iClient\\Model\\ApiError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 405:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Bluerain\\ID4iClient\\Model\\ApiError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 406:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Bluerain\\ID4iClient\\Model\\ApiError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 409:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Bluerain\\ID4iClient\\Model\\ApiError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 415:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Bluerain\\ID4iClient\\Model\\ApiError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Bluerain\\ID4iClient\\Model\\ApiError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function organizationIdResourcePutAsync($id, $res_path, $file)\n {\n return $this->organizationIdResourcePutAsyncWithHttpInfo($id, $res_path, $file)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function restShopBuilderContentsPutAsyncWithHttpInfo()\n {\n $returnType = 'object';\n $request = $this->restShopBuilderContentsPutRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function creativeapprovalsCreativeIdPutAsyncWithHttpInfo($creative_id, $body)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\InlineResponse20011';\n $request = $this->creativeapprovalsCreativeIdPutRequest($creative_id, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function auEmployingEntityPutAsyncWithHttpInfo($id, $business_id, $employing_entity, string $contentType = self::contentTypes['auEmployingEntityPut'][0])\n {\n $returnType = '\\OpenAPI\\Client\\Model\\AuEmployingEntityModel';\n $request = $this->auEmployingEntityPutRequest($id, $business_id, $employing_entity, $contentType);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function createOrganizationWithHttpInfo($organization)\n {\n $returnType = '\\Bluerain\\ID4iClient\\Model\\Organization';\n $request = $this->createOrganizationRequest($organization);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Bluerain\\ID4iClient\\Model\\Organization',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Bluerain\\ID4iClient\\Model\\ApiError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Bluerain\\ID4iClient\\Model\\ApiError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Bluerain\\ID4iClient\\Model\\ApiError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Bluerain\\ID4iClient\\Model\\ApiError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 405:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Bluerain\\ID4iClient\\Model\\ApiError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 406:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Bluerain\\ID4iClient\\Model\\ApiError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 409:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Bluerain\\ID4iClient\\Model\\ApiError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 415:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Bluerain\\ID4iClient\\Model\\ApiError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Bluerain\\ID4iClient\\Model\\ApiError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function placementIdYourcompanydetailPutAsync($body, $id)\n {\n return $this->placementIdYourcompanydetailPutAsyncWithHttpInfo($body, $id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function update(Organization $org);",
"public function updateApplicationUsingPutAsyncWithHttpInfo($application, $application_id)\n {\n $returnType = '\\com\\hydrogen\\nucleus\\Model\\Application';\n $request = $this->updateApplicationUsingPutRequest($application, $application_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function quoteDraftsV2PutAsyncWithHttpInfo($id2, $number, $customer_id, $due_date, $quote_date, $created_utc, $approved_date, $currency_code, $status, $currency_rate, $company_reference, $eu_third_party, $customer_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_method_code, $delivery_term_code, $delivery_term_name, $customer_is_private_person, $includes_vat, $is_domestic, $rot_reduced_invoicing_type, $rot_property_type, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_automatic_distribution, $persons, $terms_of_payment, $sales_document_attachments, $rows, $total_amount, $vat_amount, $roundings_amount, $uses_green_technology, $id)\n {\n $returnType = 'object';\n $request = $this->quoteDraftsV2PutRequest($id2, $number, $customer_id, $due_date, $quote_date, $created_utc, $approved_date, $currency_code, $status, $currency_rate, $company_reference, $eu_third_party, $customer_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_method_code, $delivery_term_code, $delivery_term_name, $customer_is_private_person, $includes_vat, $is_domestic, $rot_reduced_invoicing_type, $rot_property_type, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_automatic_distribution, $persons, $terms_of_payment, $sales_document_attachments, $rows, $total_amount, $vat_amount, $roundings_amount, $uses_green_technology, $id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a default "application/json" body parser. | public function getDefaultJsonParser(): callable
{
return function (StreamInterface $body) {
return json_decode($body);
};
} | [
"protected static function parse_json_body() {\n\t\tif(\n\t\t\t($reqbody = trim(file_get_contents('php://input'))) &&\n\t\t\tstrlen($reqbody) > 0\n\t\t) {\n\t\t\t$body = json_decode($reqbody, true);\n\t\t}\n\t\t// Return nuthin'\n\t\telse {\n\t\t\t$body = null;\n\t\t}\n\t\t\n\t\treturn $body;\n\t}",
"public function getBodyParserForRequest(RequestInterface $request): BodyParserInterface\n {\n $bodyParser = JsonBodyParser::class;\n\n $header = $request->getHeader('Content-Type');\n if (!empty($header)) {\n $contentType = reset($header);\n if (substr($contentType, 0, 19) === 'multipart/form-data') {\n throw new InvalidBodyException(sprintf('No body parser for Content-Type \"%s\" found', $contentType));\n } elseif ($contentType === 'application/x-www-form-urlencoded') {\n $bodyParser = FormDataBodyParser::class;\n }\n }\n\n return $this->diContainer->get($bodyParser);\n }",
"protected function getBodyDecoder(): request\\BodyDecoder\n {\n return new request\\BodyDecoder();\n }",
"function json_api()\n {\n return app(JsonApiParser::class);\n }",
"protected function getRequestParser()\n {\n return $this->requestParser;\n }",
"public function createJsonParser(): JsonParser\n {\n return new JsonParser();\n }",
"public function getDefaultParser()\n {\n return $this->app['config']->get('apple-news.parser');\n }",
"protected function getDefaultHandler()\n {\n return \\GuzzleHttp\\choose_handler();\n }",
"public function testJsonRequestParser()\n {\n $request = Request::create(\n '/test',\n 'POST',\n [],\n [],\n [],\n ['CONTENT_TYPE' => 'application/json'],\n '{\"key1\":\"value1\",\"key2\":\"value2\"}'\n );\n\n $app = new Application();\n $app['request'] = $request;\n $app->register(new JsonRequestParser());\n $app->post('/test', function () { return 'test'; });\n $result = $app->handle($app['request']);\n\n $this->assertEquals('value1', $app['request']->request->get('key1'));\n $this->assertEquals('value2', $app['request']->request->get('key2'));\n $this->assertEquals('test', $result->getContent());\n }",
"public function json(string $key = null, $default = null)\n {\n try {\n $contentType = $this->getHeader('content-type');\n if (!$contentType || false === \\stripos($contentType[0], 'application/json')) {\n throw new \\InvalidArgumentException(sprintf('Invalid Content-Type of the request, expects %s, %s given', 'application/json', ($contentType ? current($contentType) : 'null')));\n }\n $body = $this->getBody();\n if ($body instanceof SwooleStream) {\n $raw = $body->getContents();\n $decodedBody = JsonHelper::decode($raw, true);\n }\n } catch (\\Exception $e) {\n return $default;\n }\n if (is_null($key)) {\n return $decodedBody ?? $default;\n } else {\n return ArrayHelper::get($decodedBody, $key, $default);\n }\n }",
"public function getDefaultHttpSerializerFactory(): Factory|null;",
"protected function defaultNegotiator(): ContentNegotiatorInterface\n {\n return $this->factory->createContentNegotiator();\n }",
"public function createRequestParser();",
"protected function getDefaultContentType(): string\n {\n return 'application/json';\n }",
"protected function getJsonParser($type)\n {\n return $this->get('json_parser-'.$type);\n }",
"private function getDefaultJsonConverter(): JsonConverter\n {\n return new StandardConverter();\n }",
"public function getPostParser() : ParserInterface\n {\n return $this->postParser;\n }",
"public static function getParsed()\r\n\t{\r\n\t\t$data = new stdClass();\r\n\t\t\r\n\t\t$request = strtolower(self::getRaw());\r\n\t\t$request = trim($request, '/');\r\n\t\t$request = explode('/', $request);\r\n\t\t$request = explode('?', $request[0]);\r\n\t\t\r\n\t\t$data->method = isset($request[0]) ? $request[0] : '';\r\n\t\t\r\n\t\t$params = isset($request[1]) ? explode('&',$request[1]) : array();\r\n\t\t$data->params = array();\r\n\t\tforeach ($params as $pair) {\r\n\t\t\t$pair = explode('=', $pair);\r\n\t\t\t$k = $pair[0];\r\n\t\t\t$v = isset($pair[1]) ? $pair[1] : '';\r\n\t\t\t$data->params[$k] = $v;\r\n\t\t}\r\n\t\t\r\n\t\t$data->format = isset($data->params['format']) ? $data->params['format'] : '';\r\n\t\t$cfg = Configuration::getInstance();\r\n\t\tif ( !$data->format || !in_array($data->format, $cfg->get('allowedFormats')) ) {\r\n\t\t\t$data->format = $cfg->get('defaultFormat');\r\n\t\t}\r\n\t\t\r\n\t\treturn $data;\r\n\t}",
"public function testIfPreferredFormatIsNotAcceptedReturnJson()\n {\n $server = [\n 'HTTP_ACCEPT' => 'text/text,application/xhtml+xml,application/json;q=0.9,*/*;q=0.8',\n ];\n $request = new Request($this->config, $server);\n\n $result = $request->preferredContentTypeOutOf([\n 'text/html',\n 'application/xml',\n ]);\n\n $this->assertEquals('json', $result);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up a name for current Web Transaction | public function setTransactionName($name)
{
newrelic_name_transaction($name);
} | [
"public static function useRequestAsTransactionName()\n {\n self::setTransactionName(self::guessOperationName());\n }",
"public function nameTransaction($name);",
"public function setTransactionName( string $name ) {\n $this->name = $name;\n }",
"public function getTransactionName(): string\n {\n return $this->name;\n }",
"function newrelic_name_transaction($name) {}",
"public function getTransactionName() : string {\n return $this->name;\n }",
"public function nameTransaction(string $name): void;",
"public static function getTransactionName()\n {\n if (self::$trace['tx'] === 'default' && self::$extension === self::EXTENSION_TIDEWAYS) {\n return tideways_transaction_name() ?: 'default';\n }\n\n return self::$trace['tx'];\n }",
"public function nameTransaction($string) {\n\t\tif ($this->skip()) {\n\t\t\treturn;\n\t\t}\n\t\tnewrelic_name_transaction($string);\n\t}",
"public function set_trans_name($n)\n {\n \t$this->trans_name = (string)$n;\n }",
"public function changeTransactionName(string $name): void;",
"public function getDefaultTransactionName() : string\n {\n return ($this->getConfiguration(\"service_name\")) . date(\"YmdH\");\n }",
"public function getTradeName()\n {\n return $this->tradeName;\n }",
"function getDatebaseName(): string\n {\n return \"tenant215_transaction\";\n }",
"public function getTradingName()\n {\n return $this->tradingName;\n }",
"public function testGetTransactionName()\n {\n $request = new Request();\n\n /** @var Newrelic|MockObject $newrelic */\n $newrelic = $this->getMockBuilder(Newrelic::class)\n ->getMock();\n\n /** @var NewRelicMiddleware $middleware */\n $middleware = new NewRelicMiddleware($newrelic);\n\n // Test without a content type\n $request->attributes->set(NewRelicMiddleware::ATTRIBUTE_TOPIC, 'Contentful.Asset.publish');\n $this->assertEquals('Contentful.Asset.publish', $middleware->getTransactionName($request));\n\n // Test with a content type\n $request->attributes->set(NewRelicMiddleware::ATTRIBUTE_TOPIC, 'Contentful.Entry.publish');\n $request->attributes->set(NewRelicMiddleware::ATTRIBUTE_CONTENT_TYPE, 'article');\n $this->assertEquals('Contentful.Entry.publish@article', $middleware->getTransactionName($request));\n }",
"protected function registerNamedTransactions()\n\t{\n\t\t$app = $this->app;\n\n\t\tif ($app['config']->get( 'newrelic.auto_name_transactions' )) {\n\t\t\t$app['events']->listen(RouteMatched::class, function (RouteMatched $routeMatched) use ( $app ) {\n\t\t\t\t$app['newrelic']->nameTransaction( $this->getTransactionName() );\n\t\t\t});\n\t\t}\n\t}",
"protected function setName()\n {\n $this->DateName = 'Palmarum/Palmsonntag';\n }",
"public function testGetTransactionName()\n {\n // Create a request\n $request = new Request();\n $request->merge([\n 'operationName' => 'foo',\n ]);\n\n /** @var NewRelicMiddleware $middleware */\n $middleware = $this->app->make(NewRelicMiddleware::class);\n $this->assertEquals('GraphQLController@foo', $middleware->getTransactionName($request));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to get instance of Twig loader by type | public function getLoaderInstance($type)
{
$type = strtolower($type);
$loader = null;
switch ($type) {
case 'array' :
$loader = new \Twig_Loader_Array();
break;
case 'string' :
$loader = new \Twig_Loader_String();
break;
case 'filesystem' :
$loader = new \Twig_Loader_Filesystem();
/**
* @todo change it on config value
*/
$loader->addPath(PARSER_TEMPLATES_PATH, 'main', true);
break;
default :
if (clsSysCommon::getCommonDebug()) {
$search = array('{__field_name__}');
$repl = array(__CLASS__ . '::' . $name);
$error_message = clsSysCommon::getMessage('call_undefined_func', 'Errors', $search, $repl);
throw new \Exception($error_message);
}
/**
* @todo for the clients error
*/
}
return $loader;
} | [
"public function getTemplateLoader(): TemplateLoaderInterface;",
"public function getLoader()\n {\n if ( is_null($this->loader) ) {\n if ( ($resolver = $this->resolver()) instanceof Twig_LoaderInterface ) {\n $this->setLoader($resolver);\n }\n }\n\n if ( ! $this->loader instanceof Twig_LoaderInterface ) {\n throw new InvalidArgumentException('Twig loader must be an instance of Twig_LoaderInterface');\n }\n\n return $this->loader;\n }",
"protected function getTwig_LoaderService()\n {\n $this->services['twig.loader'] = $instance = new \\Symfony\\Bundle\\TwigBundle\\Loader\\FilesystemLoader(${($_ = isset($this->services['templating.locator']) ? $this->services['templating.locator'] : $this->getTemplating_LocatorService()) && false ?: '_'}, ${($_ = isset($this->services['templating.name_parser']) ? $this->services['templating.name_parser'] : $this->get('templating.name_parser')) && false ?: '_'}, $this->targetDirs[3]);\n\n $instance->addPath(($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views'), 'Framework');\n $instance->addPath(($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views'), 'Twig');\n $instance->addPath(($this->targetDirs[2].'/Resources/views'));\n\n return $instance;\n }",
"protected function getTwig_LoaderService()\n {\n $this->services['twig.loader'] = $instance = new \\Symfony\\Bundle\\TwigBundle\\Loader\\FilesystemLoader(${($_ = isset($this->services['templating.locator']) ? $this->services['templating.locator'] : $this->getTemplating_LocatorService()) && false ?: '_'}, ${($_ = isset($this->services['templating.name_parser']) ? $this->services['templating.name_parser'] : $this->get('templating.name_parser')) && false ?: '_'}, $this->targetDirs[3]);\n\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\knplabs\\\\knp-menu\\\\src\\\\Knp\\\\Menu/Resources/views'));\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\symfony\\\\symfony\\\\src\\\\Symfony\\\\Bundle\\\\FrameworkBundle/Resources/views'), 'Framework');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\symfony\\\\symfony\\\\src\\\\Symfony\\\\Bundle\\\\SecurityBundle/Resources/views'), 'Security');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\symfony\\\\symfony\\\\src\\\\Symfony\\\\Bundle\\\\TwigBundle/Resources/views'), 'Twig');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\symfony\\\\swiftmailer-bundle/Resources/views'), 'Swiftmailer');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\doctrine\\\\doctrine-bundle/Resources/views'), 'Doctrine');\n $instance->addPath(($this->targetDirs[3].'\\\\src\\\\Grafikat\\\\UploadBundle/Resources/views'), 'GrafikatUpload');\n $instance->addPath(($this->targetDirs[3].'\\\\app/Resources/FOSUserBundle/views'), 'FOSUser');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\friendsofsymfony\\\\user-bundle/Resources/views'), 'FOSUser');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\sonata-project\\\\doctrine-orm-admin-bundle\\\\src/Resources/views'), 'SonataDoctrineORMAdmin');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\sonata-project\\\\core-bundle\\\\src/Resources/views'), 'SonataCore');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\sonata-project\\\\block-bundle\\\\src/Resources/views'), 'SonataBlock');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\knplabs\\\\knp-menu-bundle\\\\src/Resources/views'), 'KnpMenu');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\sonata-project\\\\admin-bundle\\\\src/Resources/views'), 'SonataAdmin');\n $instance->addPath(($this->targetDirs[3].'\\\\src\\\\Chat\\\\ChatBundle/Resources/views'), 'Chat');\n $instance->addPath(($this->targetDirs[3].'\\\\src\\\\pdf\\\\sandboxBundle/Resources/views'), 'sandbox');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\symfony\\\\symfony\\\\src\\\\Symfony\\\\Bundle\\\\DebugBundle/Resources/views'), 'Debug');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\symfony\\\\symfony\\\\src\\\\Symfony\\\\Bundle\\\\WebProfilerBundle/Resources/views'), 'WebProfiler');\n $instance->addPath(($this->targetDirs[3].'\\\\app/Resources/views'));\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\symfony\\\\symfony\\\\src\\\\Symfony\\\\Bridge\\\\Twig/Resources/views/Form'));\n\n return $instance;\n }",
"protected function getTwig_LoaderService()\n {\n $this->services['twig.loader'] = $instance = new \\Symfony\\Bundle\\TwigBundle\\Loader\\FilesystemLoader(${($_ = isset($this->services['templating.locator']) ? $this->services['templating.locator'] : $this->getTemplating_LocatorService()) && false ?: '_'}, ${($_ = isset($this->services['templating.name_parser']) ? $this->services['templating.name_parser'] : $this->get('templating.name_parser')) && false ?: '_'}, $this->targetDirs[3]);\n\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\knplabs\\\\knp-menu\\\\src\\\\Knp\\\\Menu/Resources/views'));\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\symfony\\\\symfony\\\\src\\\\Symfony\\\\Bundle\\\\FrameworkBundle/Resources/views'), 'Framework');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\symfony\\\\symfony\\\\src\\\\Symfony\\\\Bundle\\\\SecurityBundle/Resources/views'), 'Security');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\symfony\\\\symfony\\\\src\\\\Symfony\\\\Bundle\\\\TwigBundle/Resources/views'), 'Twig');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\symfony\\\\swiftmailer-bundle/Resources/views'), 'Swiftmailer');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\doctrine\\\\doctrine-bundle/Resources/views'), 'Doctrine');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\knplabs\\\\knp-menu-bundle\\\\src/Resources/views'), 'KnpMenu');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\knplabs\\\\knp-paginator-bundle/Resources/views'), 'KnpPaginator');\n $instance->addPath(($this->targetDirs[3].'\\\\app/Resources/FOSUserBundle/views'), 'FOSUser');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\friendsofsymfony\\\\user-bundle/Resources/views'), 'FOSUser');\n $instance->addPath(($this->targetDirs[3].'\\\\app/Resources/SonataUserBundle/views'), 'SonataUser');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\sonata-project\\\\user-bundle/Resources/views'), 'SonataUser');\n $instance->addPath(($this->targetDirs[3].'\\\\app/Resources/SonataMediaBundle/views'), 'SonataMedia');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\sonata-project\\\\media-bundle\\\\src/Resources/views'), 'SonataMedia');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\egeloen\\\\ckeditor-bundle/Resources/views'), 'IvoryCKEditor');\n $instance->addPath(($this->targetDirs[3].'\\\\app/Resources/SonataAdminBundle/views'), 'SonataAdmin');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\sonata-project\\\\admin-bundle\\\\src/Resources/views'), 'SonataAdmin');\n $instance->addPath(($this->targetDirs[3].'\\\\app/Resources/SonataDoctrineORMAdminBundle/views'), 'SonataDoctrineORMAdmin');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\sonata-project\\\\doctrine-orm-admin-bundle\\\\src/Resources/views'), 'SonataDoctrineORMAdmin');\n $instance->addPath(($this->targetDirs[3].'\\\\app/Resources/NelmioApiDocBundle/views'), 'NelmioApiDoc');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\nelmio\\\\api-doc-bundle\\\\Nelmio\\\\ApiDocBundle/Resources/views'), 'NelmioApiDoc');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\sonata-project\\\\core-bundle\\\\src/Resources/views'), 'SonataCore');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\sonata-project\\\\intl-bundle\\\\src/Resources/views'), 'SonataIntl');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\sonata-project\\\\formatter-bundle\\\\src/Resources/views'), 'SonataFormatter');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\sonata-project\\\\block-bundle\\\\src/Resources/views'), 'SonataBlock');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\sonata-project\\\\classification-bundle\\\\src/Resources/views'), 'SonataClassification');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\sonata-project\\\\datagrid-bundle\\\\src/Resources/views'), 'SonataDatagrid');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\mopa\\\\bootstrap-bundle\\\\Mopa\\\\Bundle\\\\BootstrapBundle/Resources/views'), 'MopaBootstrap');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\lexik\\\\form-filter-bundle/Resources/views'), 'LexikFormFilter');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\liip\\\\imagine-bundle/Resources/views'), 'LiipImagine');\n $instance->addPath(($this->targetDirs[3].'\\\\app/Resources/GregwarCaptchaBundle/views'), 'GregwarCaptcha');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\gregwar\\\\captcha-bundle/Resources/views'), 'GregwarCaptcha');\n $instance->addPath(($this->targetDirs[3].'\\\\app/Resources/AppBundle/views'), 'App');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\symfony\\\\symfony\\\\src\\\\Symfony\\\\Bundle\\\\DebugBundle/Resources/views'), 'Debug');\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\symfony\\\\symfony\\\\src\\\\Symfony\\\\Bundle\\\\WebProfilerBundle/Resources/views'), 'WebProfiler');\n $instance->addPath(($this->targetDirs[3].'\\\\app/Resources/views'));\n $instance->addPath(($this->targetDirs[3].'\\\\vendor\\\\symfony\\\\symfony\\\\src\\\\Symfony\\\\Bridge\\\\Twig/Resources/views/Form'));\n\n return $instance;\n }",
"protected function getTwig_LoaderService()\n {\n $this->services['twig.loader'] = $instance = new \\Symfony\\Bundle\\TwigBundle\\Loader\\FilesystemLoader(${($_ = isset($this->services['templating.locator']) ? $this->services['templating.locator'] : $this->getTemplating_LocatorService()) && false ?: '_'}, $this->get('templating.name_parser'), $this->targetDirs[3]);\n\n $instance->addPath(($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views'), 'Framework');\n $instance->addPath(($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/views'), 'Security');\n $instance->addPath(($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/TwigBundle/Resources/views'), 'Twig');\n $instance->addPath(($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views'), 'Twig');\n $instance->addPath(($this->targetDirs[3].'/vendor/symfony/swiftmailer-bundle/Resources/views'), 'Swiftmailer');\n $instance->addPath(($this->targetDirs[3].'/vendor/doctrine/doctrine-bundle/Resources/views'), 'Doctrine');\n $instance->addPath(($this->targetDirs[3].'/vendor/a2lix/translation-form-bundle/A2lix/TranslationFormBundle/Resources/views'), 'A2lixTranslationForm');\n $instance->addPath(($this->targetDirs[3].'/vendor/willdurand/js-translation-bundle/Resources/views'), 'BazingaJsTranslation');\n $instance->addPath(($this->targetDirs[3].'/vendor/troopers/alertify-bundle/Troopers/AlertifyBundle/Resources/views'), 'TroopersAlertify');\n $instance->addPath(($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/UserBundle/Resources/views'), 'FOSUser');\n $instance->addPath(($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/views'), 'FOSUser');\n $instance->addPath(($this->targetDirs[3].'/vendor/liip/imagine-bundle/Resources/views'), 'LiipImagine');\n $instance->addPath(($this->targetDirs[3].'/vendor/knplabs/knp-menu-bundle/Resources/views'), 'KnpMenu');\n $instance->addPath(($this->targetDirs[3].'/vendor/snc/redis-bundle/Resources/views'), 'SncRedis');\n $instance->addPath(($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/BlogBundle/Resources/views'), 'VictoireBlog');\n $instance->addPath(($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/BusinessEntityBundle/Resources/views'), 'VictoireBusinessEntity');\n $instance->addPath(($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/BusinessPageBundle/Resources/views'), 'VictoireBusinessPage');\n $instance->addPath(($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/CoreBundle/Resources/views'), 'VictoireCore');\n $instance->addPath(($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/FormBundle/Resources/views'), 'VictoireForm');\n $instance->addPath(($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/MediaBundle/Resources/views'), 'VictoireMedia');\n $instance->addPath(($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/PageBundle/Resources/views'), 'VictoirePage');\n $instance->addPath(($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/SeoBundle/Resources/views'), 'VictoireSeo');\n $instance->addPath(($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/SitemapBundle/Resources/views'), 'VictoireSitemap');\n $instance->addPath(($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/TemplateBundle/Resources/views'), 'VictoireTemplate');\n $instance->addPath(($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/TwigBundle/Resources/views'), 'VictoireTwig');\n $instance->addPath(($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/UIBundle/Resources/views'), 'VictoireUI');\n $instance->addPath(($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/UserBundle/Resources/views'), 'VictoireUser');\n $instance->addPath(($this->targetDirs[3].'/app/Resources/views'));\n $instance->addPath(($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form'));\n $instance->addPath(($this->targetDirs[3].'/vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views'));\n\n return $instance;\n }",
"protected function getLoader()\n {\n $config = $this->getConfig();\n $chain = new \\Twig_Loader_Chain();\n\n // use template's own directory to search for templates\n $paths = array($config['phr_template_dir']);\n\n // inject common paths\n $projectPath = new ProjectPath($config['phr_template_dir']);\n if ($projectPath = $projectPath->get()) {\n $paths[] = $projectPath . DIRECTORY_SEPARATOR . 'layouts';\n $paths[] = $projectPath;\n }\n $chain->addLoader(new \\Twig_Loader_Filesystem($paths));\n\n // add string template loader, which is responsible for loading templates\n // and removing front-matter\n $chain->addLoader(new \\Phrozn\\Twig\\Loader\\String);\n\n return $chain;\n }",
"protected function getTemplating_LoaderService()\n {\n return $this->services['templating.loader'] = new \\Symfony\\Bundle\\FrameworkBundle\\Templating\\Loader\\FilesystemLoader(${($_ = isset($this->services['templating.locator']) ? $this->services['templating.locator'] : $this->getTemplating_LocatorService()) && false ?: '_'});\n }",
"public static function getDefaultLoader () {\n $templatePath = defined('APP_TEMPLATE_PATH')\n ? APP_TEMPLATE_PATH : APP_PATH . 'templates';\n return new Twig_Loader_Filesystem($templatePath);\n }",
"public function getTwigLoader($templates)\n {\n $loader = new \\Twig_Loader_Filesystem($templates);\n\n return $loader;\n }",
"public function getPluginLoader($type = null)\n {\n $type = strtoupper($type);\n if (!isset($this->_loaders[$type])) {\n switch ($type) {\n case self::DECORATOR:\n $prefixSegment = 'List_Decorator';\n $pathSegment = 'List/Decorator';\n break;\n case self::ELEMENT:\n $prefixSegment = 'List_Element';\n $pathSegment = 'List/Element';\n break;\n case self::FILTER:\n $prefixSegment = ucfirst(strtolower($type));\n $pathSegment = $prefixSegment;\n break;\n default:\n require_once 'Zend/Form/Exception.php';\n throw new Zend_Form_Exception(sprintf('Invalid type \"%s\" provided to getPluginLoader()', $type));\n }\n\n require_once 'Zend/Loader/PluginLoader.php';\n $this->_loaders[$type] = new Zend_Loader_PluginLoader(\n array('Hosh_' . $prefixSegment . '_' => 'Hosh/' . $pathSegment . '/')\n );\n }\n\n return $this->_loaders[$type];\n }",
"public function getPluginLoader($type)\n {\n $type = strtolower($type);\n if (!isset($this->_loaders[$type])) {\n switch ($type) {\n case self::FILTER:\n $prefixSegment = 'Zend_Filter_';\n $pathSegment = 'Zend/Filter/';\n break;\n case self::VALIDATE:\n $prefixSegment = 'Zend_Validate_';\n $pathSegment = 'Zend/Validate/';\n break;\n default:\n require_once 'Zend/Filter/Exception.php';\n throw new Zend_Filter_Exception(sprintf('Invalid type \"%s\" provided to getPluginLoader()', $type));\n }\n\n require_once 'Zend/Loader/PluginLoader.php';\n $this->_loaders[$type] = new Zend_Loader_PluginLoader(\n [$prefixSegment => $pathSegment]\n );\n }\n\n return $this->_loaders[$type];\n }",
"public function makeLoader(string $type): Loader\n {\n // @todo the loader generation should be extracted into a \"LoaderFactory\" class\n $appContext = Environment::getContext();\n $loader = GeneralUtility::makeInstance(Loader::class, $type, (string)$appContext);\n $loader->setEventDispatcher($this->eventBus);\n $loader->setConfigContextClass(ExtConfigContext::class);\n $loader->setCache($this->fs->getCache());\n $loader->setContainer($this->container);\n \n if ($type === static::MAIN_LOADER_KEY) {\n $typoContext = $this->context->getTypoContext();\n $loader->setCacheMergeOptions($this->getStateMergeOptions());\n $loader->setConfigFinder(\n $typoContext->di()->makeInstance(\n ExtConfigConfigFinder::class,\n [\n $typoContext->site()->getAll(false),\n ]\n )\n );\n }\n \n foreach ($this->getRootLocations() as $rootLocation) {\n $loader->registerRootLocation(...$rootLocation);\n }\n \n foreach (static::$handlerLocations as $handlerLocation) {\n $loader->registerHandlerLocation($handlerLocation);\n }\n \n $this->eventBus->dispatch(($e = new ConfigLoaderFilterEvent($loader)));\n \n return $e->getLoader();\n }",
"public function getPluginLoader($type)\n {\n switch ($type = strtoupper($type)) \n {\n case self::FILTER:\n case self::VALIDATE:\n $prefixSegment = ucfirst(strtolower($type));\n $pathSegment = $prefixSegment;\n if (!isset($this->_loaders[$type])) \n {\n require_once 'Zend/Loader/PluginLoader.php';\n $this->_loaders[$type] = new Zend_Loader_PluginLoader(\n array('Zend_' . $prefixSegment . '_' => 'Zend/' . $pathSegment . '/')\n );\n }\n \n return $this->_loaders[$type];\n default:\n throw new Lumia_Imex_Exception(sprintf('Invalid type \"%s\" provided to getPluginLoader()', $type));\n }\n }",
"public function getPluginLoader($type)\n {\n $type = strtolower($type);\n if (!in_array($type, $this->_loaderTypes)) {\n // require_once 'Zend/View/Exception.php';\n $e = new Zend_View_Exception(sprintf('Invalid plugin loader type \"%s\"; cannot retrieve', $type));\n $e->setView($this);\n throw $e;\n }\n\n if (!array_key_exists($type, $this->_loaders)) {\n $prefix = 'Zend_View_';\n $pathPrefix = 'Zend/View/';\n\n $pType = ucfirst($type);\n switch ($type) {\n case 'filter':\n case 'helper':\n default:\n $prefix .= $pType;\n $pathPrefix .= $pType;\n $loader = new Zend_Loader_PluginLoader(array(\n $prefix => $pathPrefix\n ));\n $this->_loaders[$type] = $loader;\n break;\n }\n }\n return $this->_loaders[$type];\n }",
"protected function getTwig_LoaderService()\n {\n $a = ${($_ = isset($this->services['sylius.theme.templating.file_locator']) ? $this->services['sylius.theme.templating.file_locator'] : $this->getSylius_Theme_Templating_FileLocatorService()) && false ?: '_'};\n $b = ${($_ = isset($this->services['templating.name_parser']) ? $this->services['templating.name_parser'] : $this->get('templating.name_parser')) && false ?: '_'};\n\n $c = new \\Symfony\\Bundle\\TwigBundle\\Loader\\FilesystemLoader($a, $b, $this->targetDirs[3]);\n $c->addPath(($this->targetDirs[3].'\\\\vendor\\\\sylius\\\\sylius\\\\src\\\\Sylius\\\\Bundle\\\\ChannelBundle/Resources/views'), 'SyliusChannel');\n $c->addPath(($this->targetDirs[3].'\\\\vendor\\\\sylius\\\\sylius\\\\src\\\\Sylius\\\\Bundle\\\\AttributeBundle/Resources/views'), 'SyliusAttribute');\n $c->addPath(($this->targetDirs[3].'\\\\vendor\\\\sylius\\\\sylius\\\\src\\\\Sylius\\\\Bundle\\\\UiBundle/Resources/views'), 'SyliusUi');\n $c->addPath(($this->targetDirs[3].'\\\\vendor\\\\sylius\\\\sylius\\\\src\\\\Sylius\\\\Bundle\\\\CoreBundle/Resources/views'), 'SyliusCore');\n $c->addPath(($this->targetDirs[3].'\\\\vendor\\\\sylius\\\\sylius\\\\src\\\\Sylius\\\\Bundle\\\\ResourceBundle/Resources/views'), 'SyliusResource');\n $c->addPath(($this->targetDirs[3].'\\\\vendor\\\\doctrine\\\\doctrine-bundle/Resources/views'), 'Doctrine');\n $c->addPath(($this->targetDirs[3].'\\\\vendor\\\\symfony\\\\symfony\\\\src\\\\Symfony\\\\Bundle\\\\FrameworkBundle/Resources/views'), 'Framework');\n $c->addPath(($this->targetDirs[3].'\\\\vendor\\\\symfony\\\\symfony\\\\src\\\\Symfony\\\\Bundle\\\\SecurityBundle/Resources/views'), 'Security');\n $c->addPath(($this->targetDirs[3].'\\\\vendor\\\\symfony\\\\swiftmailer-bundle/Resources/views'), 'Swiftmailer');\n $c->addPath(($this->targetDirs[3].'\\\\app/Resources/TwigBundle/views'), 'Twig');\n $c->addPath(($this->targetDirs[3].'\\\\vendor\\\\symfony\\\\symfony\\\\src\\\\Symfony\\\\Bundle\\\\TwigBundle/Resources/views'), 'Twig');\n $c->addPath(($this->targetDirs[3].'\\\\vendor\\\\sonata-project\\\\core-bundle/Resources/views'), 'SonataCore');\n $c->addPath(($this->targetDirs[3].'\\\\vendor\\\\sonata-project\\\\block-bundle/Resources/views'), 'SonataBlock');\n $c->addPath(($this->targetDirs[3].'\\\\vendor\\\\sonata-project\\\\intl-bundle/Resources/views'), 'SonataIntl');\n $c->addPath(($this->targetDirs[3].'\\\\vendor\\\\knplabs\\\\knp-menu-bundle/Resources/views'), 'KnpMenu');\n $c->addPath(($this->targetDirs[3].'\\\\vendor\\\\liip\\\\imagine-bundle/Resources/views'), 'LiipImagine');\n $c->addPath(($this->targetDirs[3].'\\\\vendor\\\\payum\\\\payum-bundle/Resources/views'), 'Payum');\n $c->addPath(($this->targetDirs[3].'\\\\vendor\\\\sylius\\\\sylius\\\\src\\\\Sylius\\\\Bundle\\\\PayumBundle/Resources/views'), 'SyliusPayum');\n $c->addPath(($this->targetDirs[3].'\\\\vendor\\\\sylius\\\\sylius\\\\src\\\\Sylius\\\\Bundle\\\\ThemeBundle/Resources/views'), 'SyliusTheme');\n $c->addPath(($this->targetDirs[3].'\\\\vendor\\\\symfony\\\\symfony\\\\src\\\\Symfony\\\\Bundle\\\\DebugBundle/Resources/views'), 'Debug');\n $c->addPath(($this->targetDirs[3].'\\\\vendor\\\\symfony\\\\symfony\\\\src\\\\Symfony\\\\Bundle\\\\WebProfilerBundle/Resources/views'), 'WebProfiler');\n $c->addPath(($this->targetDirs[3].'\\\\vendor\\\\sylius\\\\sylius\\\\src\\\\Sylius\\\\Bundle\\\\AdminBundle/Resources/views'), 'SyliusAdmin');\n $c->addPath(($this->targetDirs[3].'\\\\vendor\\\\sylius\\\\sylius\\\\src\\\\Sylius\\\\Bundle\\\\ShopBundle/Resources/views'), 'SyliusShop');\n $c->addPath(($this->targetDirs[3].'\\\\vendor\\\\friendsofsymfony\\\\oauth-server-bundle/Resources/views'), 'FOSOAuthServer');\n $c->addPath(($this->targetDirs[3].'\\\\src\\\\AppBundle/Resources/views'), 'App');\n $c->addPath(($this->targetDirs[3].'\\\\vendor\\\\symfony\\\\symfony\\\\src\\\\Symfony\\\\Bridge\\\\Twig/Resources/views/Form'));\n $c->addPath(($this->targetDirs[3].'\\\\vendor\\\\knplabs\\\\knp-menu\\\\src\\\\Knp\\\\Menu/Resources/views'));\n\n return $this->services['twig.loader'] = new \\Sylius\\Bundle\\ThemeBundle\\Twig\\ThemeFilesystemLoader($c, $a, $b);\n }",
"public function getForPath($path)\n\t{\n\t\t$extension = $this->getExtension($path);\n\n\t\tif (!isset($this->loaders[$extension])) {\n\t\t\t$this->resolveLoader($extension);\n\t\t}\n\n\t\treturn $this->loaders[$extension];\n\t}",
"public function _load()\n\t{\n\t\treturn $this->_twig->loadTemplate($this->_template . $this->_config['file_extension']);\n\t}",
"protected function getTemplating_LoaderService()\n {\n return $this->services['templating.loader'] = new \\Symfony\\Bundle\\FrameworkBundle\\Templating\\Loader\\FilesystemLoader($this->get('templating.locator'));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Store a newly created XrefDistrict in storage. | public function store(CreateXrefDistrictRequest $request)
{
$input = $request->all();
$xrefDistrict = $this->xrefDistrictRepository->create($input);
Flash::success('XrefDistrict saved successfully.');
return redirect(route('xrefDistricts.index'));
} | [
"public function store(CreateDistrictRequest $request)\n\t{\n\t \n\t\tDistrict::create($request->all());\n\n\t\treturn redirect()->route(config('quickadmin.route').'.district.index');\n\t}",
"public function store(CreateDistrictRequest $request)\n {\n $input = $request->all();\n\n $district = $this->districtRepository->create($input);\n\n Flash::success('District saved successfully.');\n\n if($input['save']==='save_edit'){\n return redirect(route('admin.districts.edit', $district->id));\n }\n elseif ($input['save']==='save_new'){\n return redirect(route('admin.districts.create'));\n }\n else{\n return redirect(route('admin.districts.index'));\n }\n }",
"public function store(CreateDistrictsRequest $request)\n {\n $district =new Districts();\n $district->name = $request['name'];\n $region = $request['region_id'];\n $district->region_id = $region->id;\n $district->save();\n\n\n\n return redirect()->route(config('quickadmin.route') . '.districts.index');\n }",
"public function districtStore(DistrictRequest $request, District $district = null){\n\n\n if ($district):\n $update = self::getDistrictRepo($district)->saveUpdate($request->all());\n if ($update):\n return $this->response('District Updated','view','200');\n else:\n return $this->response('Failed to Update','view','500');\n endif;\n else:\n $save = self::getDistrictRepo('Fgp\\District')->saveUpdate($request->all());\n if ($save):\n return $this->response('District Successfully Added','view','200');\n else:\n return $this->response('Failed to add District','view','500');\n endif;\n endif;\n }",
"public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Subdistrict::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\tSubdistrict::create($data);\n\n\t\treturn Redirect::route('subdistricts.index');\n\t}",
"public function defineDistrict()\n\t {\n\t\tif ($this->_slicer->valid() === true)\n\t\t {\n\t\t\t$this->address = $this->_slicer->street . \", \" . $this->_slicer->house;\n\n\t\t\tif ($this->_gis->district !== null)\n\t\t\t {\n\t\t\t\t$this->district = $this->_gis->district;\n\t\t\t\t$this->_gis->setConnection($this->_db);\n\t\t\t\t$this->_gis->write();\n\t\t\t }\n\t\t\telse\n\t\t\t {\n\t\t\t\t$this->_gis->setConnection($this->_db);\n\t\t\t\tif ($this->_gis->location === null && isset($this->lat) === true && isset($this->lang) === true)\n\t\t\t\t {\n\t\t\t\t\t$this->_gis->setLocation([\"lat\" => $this->lat, \"lang\" => $this->lang]);\n\t\t\t\t } //end if\n\n\t\t\t\t$this->_gis->defineDistrict();\n\t\t\t\tif ($this->_gis->district !== null)\n\t\t\t\t {\n\t\t\t\t\t$this->district = $this->_gis->district;\n\t\t\t\t\t$this->_gis->write();\n\t\t\t\t } //end if\n\n\t\t\t } //end if\n\n\t\t } //end if\n\n\t }",
"function store()\n {\n $db =& eZDB::globalDatabase();\n $db->begin();\n $name = $db->escapeString( $this->Name );\n if ( !isset( $this->ID ) )\n {\n $db->lock( \"eZAddress_Region\" );\n $this->ID = $db->nextID( \"eZAddress_Region\", \"ID\" );\n\n $res[] = $db->query( \"INSERT INTO eZAddress_Region\n ( ID, CountryID, Abbreviation, Name, HasTax, Removed)\n VALUES ( '$this->ID', '$this->CountryID', '$this->Abbreviation', '$this->Name', '$this->HasTax', '$this->Removed' )\" );\n $db->unlock();\n }\n else\n {\n\n $res[] = $db->query( \"UPDATE eZAddress_Region\n SET CountryID='$this->CountryID',\n\t\t\tAbbreviation='$this->Abbreviation',\n\t\t\tName='$this->Name',\n\t\t\tHasTax='$this->HasTax',\n\t\t\tRemoved='$this->Removed'\n WHERE ID='$this->ID'\" ); \n\n } \n eZDB::finish( $res, $db );\n return $dbError;\n }",
"public function setDistrict($value)\n {\n return $this->set(self::district, $value);\n }",
"public function store(CreatesubdistrictsRequest $request)\n {\n $input = $request->all();\n\n $subdistricts = $this->subdistrictsRepository->create($input);\n\n Flash::success('Subdistricts saved successfully.');\n\n return redirect(route('subdistricts.index'));\n }",
"public function setdistrict($value)\n {\n $this->_fields['district']['FieldValue'] = $value;\n return $this;\n }",
"public function storeDomainDistinguishedName(string $domain, DistinguishedName $distinguishedName);",
"private function createModelDistrict()\n {\n return new $this->modelDistrict;\n }",
"public function testShouldWriteLocationDistrictWithCoordinatesToDatabase()\n\t {\n\t\t$gis = new GisInfo(\"Иркутск\", \"Иркутск, Депутатская, 87/2\");\n\n\t\t$sql = SQL::get(\"MySQL\");\n\t\t$gis->setConnection($sql);\n\t\t$gis->write();\n\t\t$result = $sql->exec(\"SELECT * FROM `districts_locations`\");\n\t\t$this->assertEquals(1, $result->getNumRows());\n\t\twhile ($row = $result->getRow())\n\t\t {\n\t\t\t$this->assertEquals(\"Октябрьский округ\", $row[\"district\"]);\n\t\t\t$this->assertEquals(104.342051, $row[\"lang\"]);\n\t\t\t$this->assertEquals(52.265052, $row[\"lat\"]);\n\t\t } //end while\n\n\t }",
"function districts_post(){\n $name = $this->post('district_name');\n $state_id = $this->post('state_id');\n\n\n if(!$name || !$state_id ){\n $this->response(\"Enter the district details to save\", 400);\n }else{\n $result = $this->District_model->add(array(\"district_name\"=>$name, \"state_id\"=>$state_id));\n if($result === 0){\n $this->response(\"District coild not be saved. Try again.\", 404);\n }else{\n $this->response(\"success\", 200);\n }\n }\n }",
"public function storeDomainDistinguishedName($domain, DistinguishedName $distinguishedName);",
"public function storeSelf() {\n\n\t\t$dataArray = $this->getDataArray();\n $this->set_dtauid(tx_ptgsaaccounting_dtabuchAccessor::getInstance()->storeDtabuchData($dataArray));\n\n\t}",
"public function store()\n {\n $params = request()->validate([\n 'access_document_delivery.person_id' => 'required|integer',\n 'access_document_delivery.year' => 'required|integer'\n ]);\n $p = $params['access_document_delivery'];\n $personId = $p['person_id'];\n $year = $p['year'];\n\n $this->authorize('create', [AccessDocumentDelivery::class, $personId]);\n\n $add = AccessDocumentDelivery::findOrNewForPersonYear($personId, $year);\n $this->fromRest($add);\n\n if ($add->save()) {\n return $this->success($add);\n }\n\n return $this->restError($add);\n }",
"function store()\n {\n $db =& eZDB::globalDatabase();\n\n $name = $db->escapeString( $this->Name );\n $db->begin( );\n\n if ( !isSet( $this->ID ) )\n {\n $db->lock( \"eZAddress_AddressType\" );\n $nextID = $db->nextID( \"eZAddress_AddressType\", \"ID\" );\n\n $db->query_single( $qry, \"SELECT ListOrder FROM eZAddress_AddressType ORDER BY ListOrder DESC\", array( \"Limit\" => \"1\" ) );\n $listorder = $qry[$db->fieldName(\"ListOrder\")] + 1;\n $this->ListOrder = $listorder;\n\n $result = $db->query( \"INSERT INTO eZAddress_AddressType\n ( ID, Name, ListOrder )\n VALUES ( '$nextID',\n '$name',\n '$this->ListOrder') \" );\n\n\t\t\t$this->ID = $nextID;\n\n }\n else\n {\n $result = $db->query( \"UPDATE eZAddress_AddressType set Name='$name', ListOrder='$this->ListOrder' WHERE ID='$this->ID'\" );\n }\n\n $db->unlock();\n \n if ( $result == false )\n $db->rollback( );\n else\n $db->commit();\n\n return $dbError;\n }",
"public function save()\n {\n // If deposit is new, will get assigned database ID.\n $this->dbID = $this->db->saveDeposit($this);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle the user goods favorite "deleted" event. | public function deleted(UserGoodsFavorite $userGoodsFavorite)
{
//
} | [
"public function onRemoveFavorite() {\n try {\n if (!$user = $this->user()) {\n return;\n }\n\n $eventId = (int)post('id');\n\n $favorite = FavoriteModel::where('event_id', $eventId)\n ->where('user_id', $user->id)\n ->firstOrFail();\n $favorite->delete();\n\n $this->page['event'] = $event = EventModel::findOrFail($eventId);\n $this->page['user'] = $user;\n\n Flash::success(Lang::get('klubitus.calendar::lang.favorite.removed'));\n } catch (Exception $e) {\n Flash::error(Lang::get('klubitus.calendar::lang.favorite.remove_failed'));\n }\n }",
"abstract public function handleDelete($event);",
"public function onUserDelete($event)\n {\n $this->notification($event, 'delete');\n dispatch(new UpdateCache($event->user, true));\n }",
"private function deleteFavorite()\n {\n try\n {\n $request = $_REQUEST;\n\n //check if video id provided\n if( !isset($request['videoid']) || $request['videoid']==\"\" )\n throw_error_msg(\"Video Id not provided.\");\n\n if( !is_numeric($request['videoid']) )\n throw_error_msg(\"Video Id is not numeric.\");\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\"));\n\n $video_id = mysql_clean($request['videoid']);\n global $cbvid;\n $cbvid->action->remove_favorite($video_id);\n \n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg() )\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'removed from favorites succesfully', \"data\" => array());\n $this->response($this->json($data));\n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }",
"public function deleteFavorite(){\n\t\t// build FavoriteListing object from external JSON data\n\t\t$userRepo = RepositoryFactory::createRepository(\"user\");\n $arrayOfUserObjects = $userRepo->find($_SESSION[\"email\"], \"email\");\n\t\t$favoriteListing = new FavoriteListing();\n\t\t$favoriteListing->setUserId($arrayOfUserObjects[0]->getId());\n\t\t$favoriteListing->setListingId($_POST[\"listingId\"]);\n\t\t\n\t\t// remove the FavoriteListing from the DB\n $favoriteListingsRepo = RepositoryFactory::createRepository(\n\t\t\t\t\"favorite_listing\");\t\t\n\t\t$favoriteListingsRepo->remove($favoriteListing);\t\t\t\n\t}",
"public function deleted()\n {\n // do something after delete\n }",
"public function on_delete() {}",
"public function onUserBeforeDelete($user)\r\n { \r\n }",
"public function handleAssetDeleted(AssetDeleted $event)\n {\n $this->addEntry(\"Deleted asset '\".$event->asset->url().\"'\");\n }",
"function handleDeleteGift()\n{\n checkUserLoggedIn();\n\n $user = objects\\User::getUser($_SESSION['username']);\n checkUserHasWedding($user, true);\n\n objects\\Gift::delete($user->weddingId, $_POST['name']);\n helpers\\successHandler::sendJSON();\n}",
"public function deleteFromFavorites($user_id, $item_id);",
"public function onFileDeleted($event) {\n\t\t$this->raiseEvent('onFileDeleted', $event);\n\t}",
"public static function deleted($event)\r\n {\r\n // vars\r\n $app = self::app();\r\n $item = $event->getSubject();\r\n $itemType = $item->getType()->id;\r\n\r\n // check index table\r\n $tableName = $app->jbtables->getIndexTable($itemType);\r\n if (!$app->jbtables->isTableExists($tableName)) {\r\n $app->jbtables->createIndexTable($itemType);\r\n }\r\n\r\n // update index data\r\n JBModelSku::model()->removeByItem($item);\r\n JBModelSearchindex::model()->removeById($item);\r\n\r\n // execute item trigger\r\n $jbimageElements = $item->getElements();\r\n foreach ($jbimageElements as $element) {\r\n if (method_exists($element, 'triggerItemDeleted')) {\r\n $element->triggerItemDeleted();\r\n }\r\n }\r\n }",
"public\n function deleted(Event $event)\n {\n //\n }",
"public function deleteSavedItems()\n {\n $user = JWTAuth::parseToken()->authenticate();\n\n try\n {\n $saved_items = $this->userRepo->deleteUserFavorite($user, request()->get('item_id'));\n }\n catch(\\Exception $e)\n {\n return $this->errorWrongArgs($e->getMessage());\n }\n\n return $this->respond([\n 'message' => 'Item Removed'\n ]);\n }",
"public function deleted(Event $event)\n {\n //\n }",
"protected function afterDelete () {}",
"function qa_db_favorite_delete($userid, $entitytype, $entityid)\n{\n\tqa_db_query_sub(\n\t\t'DELETE FROM ^userfavorites WHERE userid=$ AND entitytype=$ AND entityid=#',\n\t\t$userid, $entitytype, $entityid\n\t);\n\n\tqa_db_query_sub(\n\t\t'DELETE FROM ^userevents WHERE userid=$ AND entitytype=$ AND entityid=#',\n\t\t$userid, $entitytype, $entityid\n\t);\n}",
"protected function afterDelete()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if an article with the specified id has been created by certain user | public function isAuthoredBy($article, $user): bool
{
if($article instanceof $this->modelClass)
{
return $article->isAuthoredBy($user);
}
return $this->has($article) && $this->find($article)->isAuthoredBy($user);
} | [
"protected function hasUserCreated($userId) {\n\t\t$article = $this->xml->find(self::FIELD_NAME_ARTICLE);\n\t\t$createdBy = $article->getAttribute(self::FIELD_NAME_CREATED_BY);\n\t\treturn $createdBy === $userId;\n\t}",
"public function create($user)\n {\n return $user->hasPermission('create_articles');\n }",
"public function createdBy($user)\n {\n return ($this->author_id == $user) ? true : false;\n }",
"public function isAuthor($user_id, $id) {\n\t\t$this->db->select('title');\n\t\t$this->db->where('user_id', $user_id);\n\t\t$this->db->where('id', $id);\n\t\t$query = $this->db->get('news');\n\n\t\tif ($query->num_rows() === 1) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn FALSE;\n\t}",
"function isAuthor( $user, $articleID )\r\n {\r\n if( !is_a( $user, \"eZUser\" ) )\r\n return false;\r\n\r\n $db =& eZDB::globalDatabase();\r\n $db->query_single( $res, \"SELECT AuthorID from eZArticle_Article WHERE ID='$articleID'\");\r\n $authorID = $res[$db->fieldName(\"AuthorID\")];\r\n if( $authorID == $user->id() )\r\n return true;\r\n\r\n return false;\r\n }",
"public function create(User $user) {\n return $user->hasPermission('articles.create');\n }",
"function checkCreator( $user_id, $ticket_id ) {\n // they have special priviledges\n $user_id = $this->checkNum($user_id);\n $ticket_id = $this->checkNum($ticket_id);\n if( !$this->settingOn(\"allow_cview\") )\n return false;\n $ticket = $this->get_ticket($ticket_id);\n return( $user_id == $ticket[\"creator_id\"] );\n }",
"public function isEntreprise($user_id)\n {\n }",
"private function hasAuthorId($user, $content) {\n try {\n if(!is_null($content) && $content->load('meta')->metadata('author_id')->id == $user->id) {\n return true;\n }\n }\n catch (\\Exception $e) {\n return false;\n }\n\n return false;\n }",
"public function isUser($id) {\n\t\treturn $this->userId === $id;\n\t}",
"public function checkIsAuthor($user_id) {\n return ($this->client_id == $user_id);\n }",
"private function _ownedByCurrentUser($id) {\n if (empty($id)) {\n return false;\n }\n $queryResult = $this->Entries->findById($id)->limit(1);\n foreach ($queryResult as $entry) {\n if ($entry['user_id'] === $this->Auth->user('id')) {\n return true;\n }\n }\n return false;\n }",
"public function created_by_scope_can_find_user_by_id()\n {\n $user = factory(User::class)->create();\n\n $this->actingAs($user);\n\n $record = factory(Record::class)->create();\n\n $this->assertEquals($user->username, Record::createdBy($user->id)->first()->created_by->username);\n }",
"public function checkIsAuthor($user_id) {\n\t\treturn ($this->client_id == $user_id);\n\t}",
"public function ifV_articleexiste($id){\n\t\t\t\t\t$sql = \"SELECT * FROM v_article WHERE id='\".$id.\"' \";\n\t\t\t\t\tif($this->db != null)\n\t\t\t\t\t {\n\t\t\t\t\t if($this->db->query($sql)->fetch() != null)\n\t\t\t\t\t {\n\t\t\t\t\t return true;\n\t\t\t\t\t }\n\t\t\t\t\t } \n\t\t\t\t\treturn false;\n\t\t\t\t\t }",
"private function is_post_created_by_user()\n\t{\n\t\treturn !isset($this->created_by) && $this->user->loaded() && $this->user_id > 0;\n\t}",
"public static function UserHasExistingPosts($id_user)\n {\n $db = DBConnection::getConnection();\n $request = $db->query(\"SELECT count(*) from sights WHERE id_user = $id_user\");\n\n $request->execute();\n\n if ($request->fetchColumn() > 0) {\n return true;\n } else {\n return false;\n }\n }",
"public function actionSave($id)\n\t{\n\t\tif (!Yii::app()->user->isGuest) {\n\t\t\t$user_id=Yii::app()->user->getId();\n\t\t\t$article_id=$id;\n\t\t\t\n\t\t\t$q = \"SELECT * FROM user_has_article WHERE user_id='$user_id' AND article_id='$article_id'\";\n\t\t\t$cmd = Yii::app()->db->createCommand($q);\n\t\t\t$r = $cmd->queryRow();\n\n\t\t\t// If article has not been saved, save article\n\t\t\tif (!$r) {\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$q = \"INSERT INTO user_has_article (user_id, article_id) VALUES (:user_id, :article_id)\";\n\t\t\t\t\t$cmd = Yii::app()->db->createCommand($q);\n\t\t\t\t\t$cmd->bindParam(':user_id', $user_id, PDO::PARAM_INT);\n\t\t\t\t\t$cmd->bindParam(':article_id', $article_id, PDO::PARAM_INT);\n\t\t\t\t\techo ($cmd->execute() ? 'SAVED' : 'NOT_SAVED');\n\t\t\t\t}\n\t\t\t\tcatch (Exception $e)\n\t\t\t\t{\n\t\t\t\t\t// Article doesn't exist or something else went wrong\n\t\t\t\t\techo 'ERROR';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\techo 'ALREADY_SAVED';\n\t\t\t}\n\t\t} else {\n\t\t\techo 'LOGGED_OUT';\n\t\t}\n\t}",
"public function isOwnedBy($ItemId, $userId) { // Es para usar con el isAuthorized del tutorial del blog\n \treturn $this->exists(['id' => $ItemId, 'user_id' => $userId]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Our own implementation for the groups_non_member shortcode. | public function shortcode_groups_non_member( $atts, $content ) {
return ! $this->shortcode_member( $atts, $content, true );
} | [
"public static function nonmember( $atts, $content = null ) {\n\n\t\t$non_member_content = '';\n\n\t\t// hide non-member messages for super users\n\t\tif ( ! current_user_can( 'wc_memberships_access_all_restricted_content' ) ) {\n\n\t\t\t$plans = wc_memberships_get_membership_plans();\n\t\t\t$exclude_plans = array();\n\t\t\t$non_member = true;\n\n\t\t\t// handle optional shortcode attribute\n\t\t\tif ( ! empty( $atts['plans'] ) ) {\n\t\t\t\t$exclude_plans = array_map( 'trim', explode( ',', $atts['plans'] ) );\n\t\t\t}\n\n\t\t\tforeach ( $plans as $plan ) {\n\n\t\t\t\t// excluded plans can use plan IDs or slugs\n\t\t\t\tif ( ! empty( $exclude_plans ) && ! in_array( $plan->get_id(), $exclude_plans, false ) && ! in_array( $plan->get_slug(), $exclude_plans, false ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( wc_memberships_is_user_active_member( get_current_user_id(), $plan ) ) {\n\t\t\t\t\t$non_member = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $non_member ) {\n\t\t\t\t$non_member_content = do_shortcode( $content );\n\t\t\t}\n\t\t}\n\n\t\treturn $non_member_content;\n\t}",
"public function testGroupV2UnbanMember()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"function UnbGetGroupNames($only_team_visible = false, $publicOnly = false)\r\n{\r\n\tglobal $UNB;\r\n\r\n\t$cond = ($only_team_visible ? 'ShowInTeam = 1' : '');\r\n\tif ($publicOnly)\r\n\t\t$cond .= ($cond ? ' AND ' : '') . 'PublicGroup = 1';\r\n\r\n\t$arr = $UNB['Db']->FastQueryArray('GroupNames', 'ID, Name', $cond, 'ID');\r\n\t$groups = array();\r\n\tif ($arr) foreach ($arr as $rec) $groups[$rec['ID']] = $rec['Name'];\r\n\r\n\treturn $groups;\r\n}",
"function sp_do_sp_UserGroupsTag($userid, $args='', $noMembershipLabel='', $adminLabel='') {\n #check if forum displayed\n if (sp_abort_display_forum()) return;\n\n\tglobal $spPaths;\n\n\t$defs = array('tagClass' \t=> 'spUserGroupsTag',\n 'stacked' => 1,\n 'showTitle' => 1,\n 'showBadge' => 1,\n\t\t\t\t 'echo'\t\t=> 1,\n\t\t\t\t );\n\t$a = wp_parse_args($args, $defs);\n\textract($a, EXTR_SKIP);\n\n\t$tagClass\t= esc_attr($tagClass);\n\t$stacked\t= (int) $stacked;\n\t$showTitle\t= (int) $showTitle;\n\t$showBadge\t= (int) $showBadge;\n\t$echo = (int) $echo;\n\n\t$thisUser = sp_get_user($userid);\n\n $show = false;\n\t$tout = \"<span class='$tagClass'>\";\n if (!empty($thisUser->memberships)) {\n $first = true;\n $split = ($stacked) ? '<br />' : ', ';\n \tforeach ($thisUser->memberships as $membership) {\n \t if (!$first) $tout.= $split;\n if ($showTitle) {\n \t $show = true;\n $tout.= $membership['usergroup_name'];\n }\n\t\t\tif ($showBadge && !empty($membership['usergroup_badge'])) {\n \t $show = true;\n if ($showTitle) $tout.= '<br />';\n $tout.= \"<img src='\".SF_STORE_URL.'/'.$spPaths['ranks'].'/'.$membership['usergroup_badge'].\"' alt='' />\";\n }\n $first = false;\n \t}\n } else if ($thisUser->admin) {\n if ($showTitle) {\n \t $show = true;\n $tout.= sp_filter_title_display($adminLabel);\n }\n } else {\n\t $show = true;\n $tout.= sp_filter_title_display($noMembershipLabel);\n }\n\t$tout.= \"</span>\\n\";\n $out = ($show) ? $tout : '';\n\n if ($echo) {\n echo $out;\n } else {\n return $out;\n }\n}",
"public function contains_no_mc_group($groups)\n {\n }",
"public function groups_nogroups($googlecollab) {\n global $DB, $OUTPUT;\n $fs = get_file_storage();\n $context = context_module::instance($googlecollab->cm->id);\n $files = $fs->get_area_files($context->id, 'mod_googlecollab', 'template', 0, null, false);\n $havetemplate = count($files);\n $doc = $DB->get_record('googlecollab_docs',\n array('actid' => $googlecollab->googlecollab->id, 'groupid' => 0));\n\n $out = '';\n if ($havetemplate) {\n $buttontext = get_string('updatetemplate', 'googlecollab');\n $action = 'update';\n $state = false;\n } else {\n $buttontext = get_string('createtemplate', 'googlecollab');\n $state = false;\n $action = 'create';\n }\n //Do not allow template to be created/updated if doc exists\n if ($doc) {\n $state = true;\n $action = '';\n $out .= $OUTPUT->notification(get_string('googledocexists', 'googlecollab'));\n }\n\n $url = new moodle_url('/mod/googlecollab/managetemplate.php',\n array('id'=>$googlecollab->cm->id, 'group' => 0, 'mode' => NOGROUPS, 'action' => $action));\n $out .= $this->output->single_button($url,\n $buttontext, 'get', array('disabled'=>$state, 'title'=>$buttontext));\n return $out;\n\n }",
"function cbone_non_groups(){\n\tglobal $user, $base_url;\n\t$groups=array();\n\t$query=db_select('node', 'n');\n\t$query->innerJoin('og_membership', 'og', 'n.nid= og.gid');\n\t$query->fields('n', array('nid'))\n\t\t\t->fields('og', array('gid'))\n\t\t\t->condition('n.type', 'office_group', '=')\n\t\t\t->condition('og.group_type', 'node', '=')\n\t\t\t->condition('og.etid', $user->uid, '=');\n\t$result = $query->execute()->fetchAll();\n\tforeach($result as $value){\n\t\t$groups[]=$value->nid;\n\t}\n\t\n\t$query=db_select('node', 'n')\n\t\t\t->fields('n', array('nid'))\n\t\t\t->condition('type', 'circle', '=');\n\t$result = $query->execute()->fetchAll();\n\t$nids=array();\n\tforeach($result as $value){\n\t\t$nids[]=$value->nid;\n\t}\n\t\n\t$non_groups=array();\n\tforeach($nids as $value ){\n\t\tif(!in_array($value, $groups)){\n\t\t\t$non_groups[]=$value;\n\t\t}\n\t}\n\t$non_groups_nid=array();\n\t$output='<div class=\"non-groups\"><ul>';\n\tforeach($non_groups as $nid){\n\t\t$node_group= node_load($nid);\n\t\t\n\t\tif(isset($node_group->group_access)){\n\t\t\tif($node_group->group_access['und'][0]['value']==0){\n\t\t\t\t$non_groups_nid[]=$node_group->nid;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$non_groups_nid[]=$node_group->nid;\n\t\t}\n\t} \n\t$variables = array(\n\t\t\t\t'circle_nid' => $non_groups_nid,\n\t);\n\t$output = theme('browse_circle_page', array('var_name' => $variables));\n\treturn $output;\n}",
"function template_group_members()\n{\n\tglobal $context, $txt;\n\n\techo '\n\t\t<form action=\"<URL>?action=', $context['action'], isset($context['admin_area']) ? ';area=' . $context['admin_area'] : '', ';sa=members;group=', $context['group']['id'], '\" method=\"post\" accept-charset=\"UTF-8\">\n\t\t\t<we:cat>\n\t\t\t\t', $context['page_title'], '\n\t\t\t</we:cat>\n\t\t\t<div class=\"windowbg2 wrc\">\n\t\t\t\t<dl class=\"settings\">\n\t\t\t\t\t<dt>\n\t\t\t\t\t\t<strong>', $txt['name'], ':</strong>\n\t\t\t\t\t</dt>\n\t\t\t\t\t<dd>\n\t\t\t\t\t\t<span ', $context['group']['online_color'] ? 'style=\"color: ' . $context['group']['online_color'] . '\"' : '', '>', $context['group']['name'], '</span> ', $context['group']['stars'], '\n\t\t\t\t\t</dd>';\n\n\t// Any description to show?\n\tif (!empty($context['group']['description']))\n\t\techo '\n\t\t\t\t\t<dt>\n\t\t\t\t\t\t<strong>' . $txt['membergroups_members_description'] . ':</strong>\n\t\t\t\t\t</dt>\n\t\t\t\t\t<dd>\n\t\t\t\t\t\t', $context['group']['description'], '\n\t\t\t\t\t</dd>';\n\n\techo '\n\t\t\t\t\t<dt>\n\t\t\t\t\t\t<strong>', $txt['membergroups_members_top'], ':</strong>\n\t\t\t\t\t</dt>\n\t\t\t\t\t<dd>\n\t\t\t\t\t\t', $context['total_members'], '\n\t\t\t\t\t</dd>';\n\n\t// Any group moderators to show?\n\tif (!empty($context['group']['moderators']))\n\t{\n\t\t$moderators = array();\n\t\tforeach ($context['group']['moderators'] as $moderator)\n\t\t\t$moderators[] = '<a href=\"<URL>?action=profile;u=' . $moderator['id'] . '\">' . $moderator['name'] . '</a>';\n\n\t\techo '\n\t\t\t\t\t<dt>\n\t\t\t\t\t\t<strong>', $txt['membergroups_members_group_moderators'], ':</strong>\n\t\t\t\t\t</dt>\n\t\t\t\t\t<dd>\n\t\t\t\t\t\t', implode(', ', $moderators), '\n\t\t\t\t\t</dd>';\n\t}\n\n\techo '\n\t\t\t\t</dl>\n\t\t\t</div>\n\n\t\t\t<br>\n\t\t\t<we:title2>\n\t\t\t\t', $txt['membergroups_members_group_members'], '\n\t\t\t</we:title2>\n\t\t\t<br>\n\t\t\t<div class=\"pagesection\">\n\t\t\t\t<nav>', $txt['pages'], ': ', $context['page_index'], '</nav>\n\t\t\t</div>\n\t\t\t<table class=\"table_grid w100 cs0\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr class=\"catbg\">\n\t\t\t\t\t\t<th><a href=\"<URL>?action=', $context['action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=name', $context['sort_by'] == 'name' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '\">', $txt['name'], $context['sort_by'] == 'name' ? ' <span class=\"sort_' . $context['sort_direction'] . '\"></span>' : '', '</a></th>\n\t\t\t\t\t\t<th><a href=\"<URL>?action=', $context['action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=email', $context['sort_by'] == 'email' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '\">', $txt['email'], $context['sort_by'] == 'email' ? ' <span class=\"sort_' . $context['sort_direction'] . '\"></span>' : '', '</a></th>\n\t\t\t\t\t\t<th><a href=\"<URL>?action=', $context['action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=active', $context['sort_by'] == 'active' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '\">', $txt['membergroups_members_last_active'], $context['sort_by'] == 'active' ? ' <span class=\"sort_' . $context['sort_direction'] . '\"></span>' : '', '</a></th>\n\t\t\t\t\t\t<th><a href=\"<URL>?action=', $context['action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=registered', $context['sort_by'] == 'registered' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '\">', $txt['date_registered'], $context['sort_by'] == 'registered' ? ' <span class=\"sort_' . $context['sort_direction'] . '\"></span>' : '', '</a></th>\n\t\t\t\t\t\t<th', empty($context['group']['assignable']) ? ' colspan=\"2\"' : '', '><a href=\"<URL>?action=', $context['action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=posts', $context['sort_by'] == 'posts' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '\">', $txt['posts'], $context['sort_by'] == 'posts' ? ' <span class=\"sort_' . $context['sort_direction'] . '\"></span>' : '', '</a></th>';\n\tif (!empty($context['group']['assignable']))\n\t\techo '\n\t\t\t\t\t\t<td class=\"center\" style=\"width: 4%\"><input type=\"checkbox\" onclick=\"invertAll(this, this.form);\"></td>';\n\techo '\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>';\n\n\tif (empty($context['members']))\n\t\techo '\n\t\t\t\t\t<tr class=\"windowbg2 center\">\n\t\t\t\t\t\t<td colspan=\"6\">', $txt['membergroups_members_no_members'], '</td>\n\t\t\t\t\t</tr>';\n\n\tforeach ($context['members'] as $member)\n\t{\n\t\techo '\n\t\t\t\t\t<tr class=\"windowbg2\">\n\t\t\t\t\t\t<td>', $member['name'], '</td>\n\t\t\t\t\t\t<td', $member['show_email'] == 'no_through_forum' ? ' class=\"center\"' : '', '>';\n\n\t\t// Is it totally hidden?\n\t\tif ($member['show_email'] == 'no')\n\t\t\techo '\n\t\t\t\t\t\t\t<em>', $txt['hidden'], '</em>';\n\t\t// ... otherwise they want it hidden but it's not to this person?\n\t\telseif ($member['show_email'] == 'yes_permission_override')\n\t\t\techo '\n\t\t\t\t\t\t\t<a href=\"mailto:', $member['email'], '\"><em>', $member['email'], '</em></a>';\n\t\t// ... otherwise it's visible - but only via an image?\n\t\telseif ($member['show_email'] == 'no_through_forum')\n\t\t\techo '\n\t\t\t\t\t\t\t<a href=\"<URL>?action=emailuser;sa=email;uid=', $member['id'], '\" rel=\"nofollow\"><img src=\"', ASSETS, '/email_sm.gif\" alt=\"', $txt['email'], '\" title=\"', $txt['email'], '\"></a>';\n\n\t\techo '\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td class=\"windowbg\">', $member['last_online'], '</td>\n\t\t\t\t\t\t<td class=\"windowbg\">', $member['registered'], '</td>\n\t\t\t\t\t\t<td', empty($context['group']['assignable']) ? ' colspan=\"2\"' : '', '>', $member['posts'], '</td>';\n\t\tif (!empty($context['group']['assignable']))\n\t\t\techo '\n\t\t\t\t\t\t<td class=\"center\" style=\"width: 4%\"><input type=\"checkbox\" name=\"rem[]\" value=\"', $member['id'], '\"', (MID == $member['id'] && $context['group']['id'] == 1 ? ' onclick=\"return !this.checked || ask(' . JavaScriptEscape($txt['membergroups_members_deadmin_confirm']) . ', e);\"' : ''), '></td>';\n\t\techo '\n\t\t\t\t\t</tr>';\n\t}\n\n\techo '\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t\t<div class=\"pagesection\">\n\t\t\t\t<nav>', $txt['pages'], ': ', $context['page_index'], '</nav>';\n\n\tif (!empty($context['group']['assignable']))\n\t\techo '\n\t\t\t\t<div class=\"floatright\"><input type=\"submit\" name=\"remove\" value=\"', $txt['membergroups_members_remove'], '\" class=\"delete\"></div>';\n\techo '\n\t\t\t</div>\n\t\t\t<br>';\n\n\tif (!empty($context['group']['assignable']))\n\t{\n\t\techo '\n\t\t\t<we:cat>\n\t\t\t\t', $txt['membergroups_members_add_title'], '\n\t\t\t</we:cat>\n\t\t\t<div class=\"windowbg wrc\">\n\t\t\t\t<strong>', $txt['membergroups_members_add_desc'], ':</strong><br>\n\t\t\t\t<input name=\"toAdd\" id=\"toAdd\" value=\"\">\n\t\t\t\t<input type=\"submit\" name=\"add\" value=\"', $txt['membergroups_members_add'], '\" class=\"new\">\n\t\t\t</div>';\n\t}\n\n\techo '\n\t\t\t<input type=\"hidden\" name=\"', $context['session_var'], '\" value=\"', $context['session_id'], '\">\n\t\t</form>';\n\n\tif (!empty($context['group']['assignable']))\n\t{\n\t\tadd_js_file('suggest.js');\n\t\tadd_js('\n\tnew weAutoSuggest({\n\t\t', min_chars(), ',\n\t\tbItemList: true,\n\t\tsControlId: \"toAdd\",\n\t\tsPostName: \"member_add\"\n\t});');\n\t}\n}",
"function vcn_communitygroups() {\r\n\r\n\treturn theme('vcn_communitygroups_template');\r\n}",
"function prepareMembergroupPermissions()\n{\n\tglobal $modSettings, $txt;\n\n\t$db = database();\n\n\t// Start this with the guests/members.\n\t$profile_groups = array(\n\t\t-1 => array(\n\t\t\t'id' => -1,\n\t\t\t'name' => $txt['membergroups_guests'],\n\t\t\t'color' => '',\n\t\t\t'new_topic' => 'disallow',\n\t\t\t'replies_own' => 'disallow',\n\t\t\t'replies_any' => 'disallow',\n\t\t\t'attachment' => 'disallow',\n\t\t\t'children' => array(),\n\t\t),\n\t\t0 => array(\n\t\t\t'id' => 0,\n\t\t\t'name' => $txt['membergroups_members'],\n\t\t\t'color' => '',\n\t\t\t'new_topic' => 'disallow',\n\t\t\t'replies_own' => 'disallow',\n\t\t\t'replies_any' => 'disallow',\n\t\t\t'attachment' => 'disallow',\n\t\t\t'children' => array(),\n\t\t),\n\t);\n\n\t$db->fetchQuery('\n\t\tSELECT \n\t\t\tid_group, group_name, online_color, id_parent\n\t\tFROM {db_prefix}membergroups\n\t\tWHERE id_group != {int:admin_group}\n\t\t\t' . (empty($modSettings['permission_enable_postgroups']) ? ' AND min_posts = {int:min_posts}' : '') . '\n\t\tORDER BY id_parent ASC',\n\t\tarray(\n\t\t\t'admin_group' => 1,\n\t\t\t'min_posts' => -1,\n\t\t)\n\t)->fetch_callback(\n\t\tfunction ($row) use (&$profile_groups) {\n\t\t\tif ($row['id_parent'] == -2)\n\t\t\t{\n\t\t\t\t$profile_groups[$row['id_group']] = array(\n\t\t\t\t\t'id' => $row['id_group'],\n\t\t\t\t\t'name' => $row['group_name'],\n\t\t\t\t\t'color' => $row['online_color'],\n\t\t\t\t\t'new_topic' => 'disallow',\n\t\t\t\t\t'replies_own' => 'disallow',\n\t\t\t\t\t'replies_any' => 'disallow',\n\t\t\t\t\t'attachment' => 'disallow',\n\t\t\t\t\t'children' => array(),\n\t\t\t\t);\n\t\t\t}\n\t\t\telseif (isset($profile_groups[$row['id_parent']]))\n\t\t\t{\n\t\t\t\t$profile_groups[$row['id_parent']]['children'][] = $row['group_name'];\n\t\t\t}\n\t\t}\n\t);\n\n\treturn $profile_groups;\n}",
"public function setNoGroupFilter($a_no_group)\n\t{\n\t\t$this->no_groups = $a_no_group;\n\t}",
"function non_members($group_id){\n\t\t$class_id = $_SESSION['current_class'];\n\t\t$group_members = $this->group_members($group_id);\n\t\t$pendings = $this->pendings();\n\t\t$pending_members = array();\n\t\t\n\t\tforeach($pendings as $key){\n\t\t\t$pending_members[] = $key['user_id'];\n\t\t}\n\t\t\n\t\t$invite_members = array();\n\t\t$query = $this->db->query(\"SELECT tbl_classpeople.user_id, fname, lname FROM tbl_classpeople \n\t\t\t\t\t\t\t\t\tLEFT JOIN tbl_userinfo ON tbl_classpeople.user_id = tbl_userinfo.user_id\n\t\t\t\t\t\t\t\t\tWHERE class_id='$class_id'\");\n\t\tif($query->num_rows() > 0){\n\t\t\tforeach($query->result() as $row){\n\t\t\t\t$user_id = $row->user_id;\n\t\t\t\t$fname\t= $row->fname;\n\t\t\t\t$lname\t= $row->lname;\n\t\t\t\tif(!in_array($user_id, $group_members) && !in_array($user_id, $pending_members)){//exclude users who are already members of the group\n\t\t\t\t\t$invite_members[] = array('user_id'=>$user_id, 'fname'=>$fname, 'lname'=>$lname);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $invite_members;\n\t}",
"public function test_isNotGroupMember() {\r\n $this->userAuth('validUser', 'test');\r\n\t\t$this->assertFalse($this->fixture->isNotGroupMember('validGroup'));\r\n\r\n // Assert true with an user with an unvalid group\r\n $this->userAuth('validUser', 'test');\r\n\t\t$this->assertTrue($this->fixture->isNotGroupMember('unvalidGroup'));\r\n\r\n // Assert true if no group is provided\r\n $this->userAuth('validUser', 'test');\r\n\t\t$this->assertTrue($this->fixture->isNotGroupMember(''));\r\n\r\n // Assert true if an unknown group is provided\r\n $this->userAuth('validUser', 'test');\r\n\t\t$this->assertTrue($this->fixture->isNotGroupMember('unkownGroup'));\r\n\r\n // Assert true if no user is provided\r\n $this->userAuth('', '');\r\n\t\t$this->assertTrue($this->fixture->isNotGroupMember('validGroup'));\r\n\r\n // Assert true if no user and no group are provided\r\n $this->userAuth('', '');\r\n\t\t$this->assertTrue($this->fixture->isNotGroupMember(''));\r\n }",
"public function not_group_start()\r\n {\r\n return $this->group_start('NOT ', 'AND ');\r\n }",
"public function not_group_start()\n\t{\n\t\treturn $this->group_start('NOT ', 'AND ');\n\t}",
"function MembergroupIndex()\n{\n\tglobal $txt, $context;\n\n\t$context['page_title'] = $txt['membergroups_title'];\n\n\t// The first list shows the regular membergroups.\n\t$listOptions = array(\n\t\t'id' => 'regular_membergroups_list',\n\t\t'title' => $txt['membergroups_regular'],\n\t\t'base_href' => '<URL>?action=admin;area=membergroups' . (isset($_REQUEST['sort2']) ? ';sort2=' . urlencode($_REQUEST['sort2']) : ''),\n\t\t'default_sort_col' => 'name',\n\t\t'get_items' => array(\n\t\t\t'file' => 'Subs-Membergroups',\n\t\t\t'function' => 'list_getMembergroups',\n\t\t\t'params' => array(\n\t\t\t\t'regular',\n\t\t\t),\n\t\t),\n\t\t'columns' => array(\n\t\t\t'name' => array(\n\t\t\t\t'header' => array(\n\t\t\t\t\t'value' => $txt['membergroups_name'],\n\t\t\t\t),\n\t\t\t\t'data' => array(\n\t\t\t\t\t'function' => function ($rowData) {\n\t\t\t\t\t\t// Since the moderator group has no explicit members, no link is needed.\n\t\t\t\t\t\tif ($rowData['id_group'] == 3)\n\t\t\t\t\t\t\t$group_name = $rowData['group_name'];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$group_name = sprintf('<a href=\"<URL>?action=admin;area=membergroups;sa=members;group=%1$d\" class=\"group%1$s\">%2$s</a>', $rowData['id_group'], $rowData['group_name']);\n\n\t\t\t\t\t\t// Add a help option for moderator and administrator.\n\t\t\t\t\t\tif ($rowData['id_group'] == 1)\n\t\t\t\t\t\t\t$group_name .= ' (<a href=\"<URL>?action=help;in=membergroup_administrator\" onclick=\"return reqWin(this);\">?</a>)';\n\t\t\t\t\t\telseif ($rowData['id_group'] == 3)\n\t\t\t\t\t\t\t$group_name .= ' (<a href=\"<URL>?action=help;in=membergroup_moderator\" onclick=\"return reqWin(this);\">?</a>)';\n\n\t\t\t\t\t\treturn $group_name;\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t\t'sort' => array(\n\t\t\t\t\t'default' => 'CASE WHEN id_group < 4 THEN id_group ELSE 4 END, group_name',\n\t\t\t\t\t'reverse' => 'CASE WHEN id_group < 4 THEN id_group ELSE 4 END, group_name DESC',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'stars' => array(\n\t\t\t\t'header' => array(\n\t\t\t\t\t'value' => $txt['membergroups_stars'],\n\t\t\t\t),\n\t\t\t\t'data' => array(\n\t\t\t\t\t'function' => function ($rowData) {\n\t\t\t\t\t\t$stars = explode('#', $rowData['stars']);\n\n\t\t\t\t\t\t// In case no stars are setup, return with nothing\n\t\t\t\t\t\tif (empty($stars[0]) || empty($stars[1]))\n\t\t\t\t\t\t\treturn '';\n\n\t\t\t\t\t\t// Otherwise repeat the image a given number of times.\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$image = sprintf('<img src=\"%1$s/%2$s\">', ASSETS, $stars[1]);\n\t\t\t\t\t\t\treturn str_repeat($image, $stars[0]);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\n\t\t\t\t),\n\t\t\t\t'sort' => array(\n\t\t\t\t\t'default' => 'stars',\n\t\t\t\t\t'reverse' => 'stars DESC',\n\t\t\t\t)\n\t\t\t),\n\t\t\t'members' => array(\n\t\t\t\t'header' => array(\n\t\t\t\t\t'value' => $txt['membergroups_members_top'],\n\t\t\t\t),\n\t\t\t\t'data' => array(\n\t\t\t\t\t'function' => function ($rowData) {\n\t\t\t\t\t\tglobal $txt;\n\n\t\t\t\t\t\t// No explicit members for the moderator group.\n\t\t\t\t\t\treturn $rowData['id_group'] == 3 ? $txt['membergroups_guests_na'] : $rowData['num_members'];\n\t\t\t\t\t},\n\t\t\t\t\t'style' => 'text-align: center',\n\t\t\t\t),\n\t\t\t\t'sort' => array(\n\t\t\t\t\t'default' => 'CASE WHEN id_group < 4 THEN id_group ELSE 4 END, 1',\n\t\t\t\t\t'reverse' => 'CASE WHEN id_group < 4 THEN id_group ELSE 4 END, 1 DESC',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'modify' => array(\n\t\t\t\t'header' => array(\n\t\t\t\t\t'value' => $txt['modify'],\n\t\t\t\t),\n\t\t\t\t'data' => array(\n\t\t\t\t\t'sprintf' => array(\n\t\t\t\t\t\t'format' => '<a href=\"<URL>?action=admin;area=membergroups;sa=edit;group=%1$d\">' . $txt['membergroups_modify'] . '</a>',\n\t\t\t\t\t\t'params' => array(\n\t\t\t\t\t\t\t'id_group' => false,\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'style' => 'text-align: center',\n\t\t\t\t),\n\t\t\t),\n\t\t),\n\t\t'additional_rows' => array(\n\t\t\tarray(\n\t\t\t\t'position' => 'below_table_data',\n\t\t\t\t'value' => '<form action=\"<URL>?action=admin;area=membergroups;sa=add;generalgroup\" method=\"post\"><input type=\"submit\" class=\"new\" value=\"' . $txt['membergroups_add_group'] . '\"></form>',\n\t\t\t),\n\t\t),\n\t);\n\n\tloadSource('Subs-List');\n\tcreateList($listOptions);\n\n\t// The second list shows the post count based groups.\n\t$listOptions = array(\n\t\t'id' => 'post_count_membergroups_list',\n\t\t'title' => $txt['membergroups_post'],\n\t\t'base_href' => '<URL>?action=admin;area=membergroups' . (isset($_REQUEST['sort']) ? ';sort=' . urlencode($_REQUEST['sort']) : ''),\n\t\t'default_sort_col' => 'required_posts',\n\t\t'request_vars' => array(\n\t\t\t'sort' => 'sort2',\n\t\t\t'desc' => 'desc2',\n\t\t),\n\t\t'get_items' => array(\n\t\t\t'file' => 'Subs-Membergroups',\n\t\t\t'function' => 'list_getMembergroups',\n\t\t\t'params' => array(\n\t\t\t\t'post_count',\n\t\t\t),\n\t\t),\n\t\t'columns' => array(\n\t\t\t'name' => array(\n\t\t\t\t'header' => array(\n\t\t\t\t\t'value' => $txt['membergroups_name'],\n\t\t\t\t),\n\t\t\t\t'data' => array(\n\t\t\t\t\t'function' => function ($rowData) {\n\t\t\t\t\t\treturn sprintf('<a href=\"<URL>?action=moderate;area=viewgroups;sa=members;group=%1$d\" class=\"group%1$d\">%2$s</a>', $rowData['id_group'], $rowData['group_name']);\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t\t'sort' => array(\n\t\t\t\t\t'default' => 'group_name',\n\t\t\t\t\t'reverse' => 'group_name DESC',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'stars' => array(\n\t\t\t\t'header' => array(\n\t\t\t\t\t'value' => $txt['membergroups_stars'],\n\t\t\t\t),\n\t\t\t\t'data' => array(\n\t\t\t\t\t'function' => function ($rowData) {\n\t\t\t\t\t\t$stars = explode('#', $rowData['stars']);\n\n\t\t\t\t\t\tif (empty($stars[0]) || empty($stars[1]))\n\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$star_image = sprintf('<img src=\"%1$s/%2$s\">', ASSETS, $stars[1]);\n\t\t\t\t\t\t\treturn str_repeat($star_image, $stars[0]);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t\t'sort' => array(\n\t\t\t\t\t'default' => 'CASE WHEN id_group < 4 THEN id_group ELSE 4 END, stars',\n\t\t\t\t\t'reverse' => 'CASE WHEN id_group < 4 THEN id_group ELSE 4 END, stars DESC',\n\t\t\t\t)\n\t\t\t),\n\t\t\t'members' => array(\n\t\t\t\t'header' => array(\n\t\t\t\t\t'value' => $txt['membergroups_members_top'],\n\t\t\t\t),\n\t\t\t\t'data' => array(\n\t\t\t\t\t'db' => 'num_members',\n\t\t\t\t\t'style' => 'text-align: center',\n\t\t\t\t),\n\t\t\t\t'sort' => array(\n\t\t\t\t\t'default' => '1 DESC',\n\t\t\t\t\t'reverse' => '1',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'required_posts' => array(\n\t\t\t\t'header' => array(\n\t\t\t\t\t'value' => $txt['membergroups_min_posts'],\n\t\t\t\t),\n\t\t\t\t'data' => array(\n\t\t\t\t\t'db' => 'min_posts',\n\t\t\t\t\t'style' => 'text-align: center',\n\t\t\t\t),\n\t\t\t\t'sort' => array(\n\t\t\t\t\t'default' => 'min_posts',\n\t\t\t\t\t'reverse' => 'min_posts DESC',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'modify' => array(\n\t\t\t\t'header' => array(\n\t\t\t\t\t'value' => $txt['modify'],\n\t\t\t\t),\n\t\t\t\t'data' => array(\n\t\t\t\t\t'sprintf' => array(\n\t\t\t\t\t\t'format' => '<a href=\"<URL>?action=admin;area=membergroups;sa=edit;group=%1$d\">' . $txt['membergroups_modify'] . '</a>',\n\t\t\t\t\t\t'params' => array(\n\t\t\t\t\t\t\t'id_group' => false,\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'style' => 'text-align: center',\n\t\t\t\t),\n\t\t\t),\n\t\t),\n\t\t'additional_rows' => array(\n\t\t\tarray(\n\t\t\t\t'position' => 'below_table_data',\n\t\t\t\t'value' => '<form action=\"<URL>?action=admin;area=membergroups;sa=add;postgroup\" method=\"post\"><input type=\"submit\" class=\"new\" value=\"' . $txt['membergroups_add_group'] . '\"></form>',\n\t\t\t),\n\t\t),\n\t);\n\n\tcreateList($listOptions);\n}",
"function SkipForbiddenDataGroups()\n {\n foreach (array_keys($this->ItemDataGroups) as $group)\n {\n if (!$this->MyMod_Item_Group_Allowed($this->ItemDataGroups[ $group ]))\n {\n unset($this->ItemDataGroups[ $group ]);\n }\n }\n\n foreach (array_keys($this->ItemDataSGroups) as $group)\n {\n if (!$this->MyMod_Item_Group_Allowed($this->ItemDataSGroups[ $group ]))\n {\n unset($this->ItemDataSGroups[ $group ]);\n }\n }\n }",
"function shortcode_members_only( $atts, $content = null ) {\n\t\n\tif ( is_user_logged_in() && !is_null( $content ) && !is_feed() )\n\t\treturn do_shortcode($content);\n\t\n\treturn '';\n\t\n}",
"function upgrade_group_members_only($groupingid, $availability) {\n // Work out the new JSON object representing this option.\n if ($groupingid) {\n // Require specific grouping.\n $condition = (object)array('type' => 'grouping', 'id' => (int)$groupingid);\n } else {\n // No grouping specified, so require membership of any group.\n $condition = (object)array('type' => 'group');\n }\n\n if (is_null($availability)) {\n // If there are no conditions using the new API then just set it.\n $tree = (object)array('op' => '&', 'c' => array($condition), 'showc' => array(false));\n } else {\n // There are existing conditions.\n $tree = json_decode($availability);\n switch ($tree->op) {\n case '&' :\n // For & conditions we can just add this one.\n $tree->c[] = $condition;\n $tree->showc[] = false;\n break;\n case '!|' :\n // For 'not or' conditions we can add this one\n // but negated.\n $tree->c[] = (object)array('op' => '!&', 'c' => array($condition));\n $tree->showc[] = false;\n break;\n default:\n // For the other two (OR and NOT AND) we have to add\n // an extra level to the tree.\n $tree = (object)array('op' => '&', 'c' => array($tree, $condition),\n 'showc' => array($tree->show, false));\n // Inner trees do not have a show option, so remove it.\n unset($tree->c[0]->show);\n break;\n }\n }\n\n return json_encode($tree);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the [nomor_telepon] column value. | public function getNomorTelepon()
{
return $this->nomor_telepon;
} | [
"public function getTelefno()\n {\n return $this->telefno;\n }",
"public function getTelefono()\n {\n return $this->telefono;\n }",
"public function getTelefono()\r\n {\r\n return $this->telefono;\r\n }",
"public function getTelefono()\r\n {\r\n return $this->telefono;\r\n }",
"public function POSTTelefono() {\n return $this->telefono;\n }",
"public function getTelefono(){\n \treturn $this->telefono;\n\t}",
"public function getTelepon();",
"public function getProveedorTelefono()\n {\n\n return $this->proveedor_telefono;\n }",
"public function getTelefon()\n {\n return $this->telefon;\n }",
"public function getInstTelefono()\n {\n return $this->inst_telefono;\n }",
"public function getMobielnummer() {\r\n\t\t$this->_db->get('Gebruikerstelefoon', array('gebruikersnaam', '=', $this->_gegevens->gebruikersnaam));\r\n\t\treturn $this->_db->first()->mobielnummer;\r\n\t}",
"public function getEmpresa_p_tel(){\n return $this->Empresa_p_tel;\n }",
"public function getTelefone2()\n {\n return $this->getModel()->getValor(\"telefone2\");\n }",
"public function getNumeroTelefono()\n {\n return $this->numeroTelefono;\n }",
"public function getPersonneContact(): ?string {\n return $this->personneContact;\n }",
"public function getNomContact(): ?string {\n return $this->nomContact;\n }",
"public function getTelefonoMovil() {\n\t\treturn $this->getTelefonofijocar().\" - \".$this->getTelefonofijonum();\n\t}",
"public function getFornecedorTelefone()\n {\n return $this->fornecedor_telefone;\n }",
"public function getTelephoneNo()\n\t{\n\t\treturn $this->telephone_no;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of compatibility | public function getCompatibility()
{
return $this->compatibility;
} | [
"public function compatibility() {\n\t\treturn $this->compatibility;\n\t}",
"function getCompatibilityLevel()\n {\n return $this->_props['CompatibilityLevel'];\n }",
"public function getCompatibility();",
"public static function getCompatibilityMode() {\n\t\treturn self::$compatibilityMode;\n\t}",
"public function getSupportVal()\n {\n return $this->support_val;\n }",
"protected function getCompatibility7Status() {}",
"public function getSupportLevel()\n {\n return $this->supportLevel;\n }",
"public function getEnhanceWindowsCompatibility()\n\t\t{\n\t\t\treturn $this->enhanceWindowsCompatibility;\n\t\t}",
"public function getSupportLevel() {\n\t\treturn $this->_supportLevel;\n\t}",
"public function get_compatibility_instance() {\n\n\t\treturn $this->compatibility;\n\t}",
"public function getIE8compat() {\n\n\t//$browser = $this->getRequest()->getBrowser();\n\t//$isIE8 = ($browser['majorver']>7 && $browser['browser']=='MSIE');\n\n\treturn ($this->_IE8compat);// && $isIE8);\n }",
"public function compatibility() : array\n {\n return [\n EstimatorType::classifier(),\n EstimatorType::anomalyDetector(),\n ];\n }",
"public function getCompatibleVersion()\n {\n return APP_VERSION;\n }",
"public static function getSupportActive() {\n\n\t \treturn ( Setting::first() )->support_active ;\n\t }",
"public function getEnhanceWindowsCompatibility();",
"protected function get_minimum_supported_version()\n {\n }",
"public function getStability()\n {\n $name = \"minimum-stability\";\n switch ($this->getComposerJson()->$name) {\n case \"dev\":\n $stability = \"devel\";\n break;\n case \"alpha\":\n $stability = \"alpha\";\n break;\n case \"beta\":\n $stability = \"beta\";\n break;\n case \"RC\" :\n case \"stable\":\n default:\n $stability = \"stable\";\n }\n return $stability;\n }",
"public function getMetricCompatibilities()\n {\n return $this->metric_compatibilities;\n }",
"public function setCompatibility($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Analytics\\Data\\V1beta\\Compatibility::class);\n $this->compatibility = $var;\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create full field name for current module | public function create_full_field_name($name) {
return 'HW_HOANGWEB_Settings['.$this->create_field_name($name).']';
} | [
"public function get_field_name();",
"function name( $field ) {\n return $field;\n }",
"public function create_full_field_name($name) {\r\n return 'HW_Module_Settings_page['.$this->create_field_name($name).']';\r\n }",
"function hc_field_name($field){\n\t\techo hc_get_field_name($field);\n\t}",
"function _field_name($field){\n if(count($this->_path)){\n return $this->_path[count($this->_path) - 1] . '->' . $field;\n }else{\n return '$publication->' . $field;\n }\n }",
"function FormattedFieldName($field)\n{\n\treturn 'field_' . str_replace(\" \", \"_\", strtolower($field));\n}",
"public function getFieldsName();",
"function et_lead_gen_get_field_form_name( $id ) {\n\treturn 'et_lead_gen_field_' . $id;\n}",
"function get_field_name($field) {\r\n\t\tif ( !empty($field->initial_name) ) {\r\n\t\t\t$field_name = $field->initial_name;\r\n\t\t} else {\r\n\t\t\t$field_name = $field->get_name();\r\n\t\t}\r\n\r\n\t\treturn $field_name;\r\n\t}",
"public function get_field_name() {\n\n\t\treturn \"butterbean_{$this->manager->name}_setting_{$this->name}\";\n\t}",
"public function getFullFieldName() {\n\t\treturn $this->fullFieldName;\n }",
"public function buildName()\n\t{\n\t\tif (is_string($this->class_identifier))\n\t\t{\n\t\t\t$contentClass = lcContentClass::getInstance($this->class_identifier);\n\t\t\t$contentName= \"\";\n\t\t\t$namingRule = $contentClass->getNamingRule();\n\t\t\t$field = $this->attribute($namingRule);\n\t\t\t/*\n\t\t\t $this->object_name = $this->makeNormName($field);\n\n $index = 1;\n while ($this->nameExists($field))\n {\n if (preg_match(\"#(\\w+)(_[0-9])+#\", $field,$res))\n {\n $field = $res[1].\"_\".$index;\n }\n //$field .= \"_\". $index;\n $index++;\n }\n */\n\t\t\t$this->object_name = $field;\n\t\t}\n\t\treturn $this->object_name;\n\n\n\t}",
"protected function _createFieldName(CodeGeneratorColumn $column){\n\t\treturn '`\\'.'.$column->getTable()->getClassName().'::'.$column->getFieldConstantName().'.\\'`';\n\t}",
"public function name($field) {\n\t\treturn $field;\n\t}",
"public function generateField()\r\n {\r\n if($this->title!=\"\" && $this->model!=\"\")\r\n {\r\n $string= strtolower($this->title);\r\n $first= preg_replace('#[^\\\\/\\-a-z\\s]#i', '', $string);\r\n $second= preg_replace('!\\s+!', ' ', $first);\r\n $third= str_replace(' ', '_', $second);\r\n $new_string= trim($third,\"_\");\r\n $model= $this->model;\r\n $flag=0;\r\n $field_array= $model::model()->getTableSchema()->getColumnNames(); \r\n \r\n while(in_array($new_string, $field_array))\r\n {\r\n $new_string= FormFields::model()->checkAvailability($new_string,$model); \r\n } \r\n $this->varname= $new_string;\r\n \r\n }\r\n \r\n }",
"public function name()\n {\n return h($this->module->name);\n }",
"protected function get_field_name($module, $name)\n {\n $bean = BeanFactory::newBean($module);\n if(empty($bean) || is_null($bean))\n {\n \t return $name;\n }\n\n $field_defs = $bean->field_defs;\n return isset($field_defs[$name]['name']) ? $field_defs[$name]['name'] : $name;\n }",
"public function setFullFieldName() {\n\t\t$this->fullFieldName = $this->buildFullFieldName($this->kickstarterFieldConfiguration['fieldName']);\n }",
"protected function getSourceFieldName() {\n // Some hub_reference sources are using a deriver, so their plugin IDs may contain\n // a separator (usually ':') which is not allowed in field names.\n $base_id = 'field_hub_reference_' . str_replace(static::DERIVATIVE_SEPARATOR, '_', $this->getPluginId());\n $tries = 0;\n $storage = $this->entityTypeManager->getStorage('field_storage_config');\n\n // Iterate at least once, until no field with the generated ID is found.\n do {\n $id = $base_id;\n // If we've tried before, increment and append the suffix.\n if ($tries) {\n $id .= '_' . $tries;\n }\n $field = $storage->load('hub_reference.' . $id);\n $tries++;\n } while ($field);\n\n return $id;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fails the test with specified error message | private static function fail($message, \PHPUnit_Framework_TestCase $test)
{
$test->fail("{$message} in the test '{$test->toString()}'");
throw new \Exception('The above line was supposed to throw an exception.');
} | [
"abstract protected function _testFailed($message);",
"public function testErrorMessagePassedCorrectly(): void\n {\n $this->expectExceptionMessage($this->message);\n\n throw $this->class;\n }",
"public function fail($message)\n {\n throw new SpecFailedException($message);\n }",
"public function Fail($message)\r\n {\r\n $this->testCaseResults->AddMessage($message, EventType::FAIL_MSG());\r\n }",
"public function fail ($message) {\n return Assert::truthyness(true, false, $message, '==');\n }",
"public function testCreateUnsuccessfulReason()\n {\n }",
"private function failed($message){\n $this->testCount++;\n $this->errorCount++;\n \n $backtrace = debug_backtrace();\n \n if(count($backtrace) > 0){\n $caller = $backtrace[1];\n \n $this->errors[] = \"{$message}\\n\\tIn file {$caller['file']} on line {$caller['line']}\";\n }\n \n echo \"F\";\n }",
"public function testAssertionFailedWithMessage(): void\n {\n $this->expectAssertionFailed('this is no true');\n $this->assertTrue(false, 'this is no true');\n }",
"public function testFailure() {\r\n $scenario = $this->getTestBehatScenario(1);\r\n $result = $this->executeTestBehatScenario($scenario);\r\n $this->assertTestFailed($result);\r\n $exceptionMessages = [\r\n \"Scenario '#1 Failure' had steps:\",\r\n \"Failed: Given a failure\",\r\n \"Failed asserting that false is true.\",\r\n ];\r\n $this->assertBehatScenarioAssertion($scenario, ExpectationFailedException::class, $exceptionMessages);\r\n }",
"public function coverageError(string $message);",
"public function testOnFailureException()\n {\n $command = sprintf(\"%s %s/scripts/failure.php\", PHP_BINARY, __DIR__);\n $result = $this->doExecute($command, 'text:xxx', 'exception:hello world');\n\n $this->assertInstanceOf(\\Exception::class, $result);\n $this->assertEquals('hello world', $result->getMessage());\n }",
"public function testErr()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}",
"function paintFail( $message )\n {\n parent::paintFail( $message );\n \n echo \"<div class=\\\"fail\\\">\";\n \n $breadcrumb = $this->getTestList();\n array_shift( $breadcrumb );\n \n echo implode(\" -> \", $breadcrumb );\n \n echo \" -> \" . $this->_htmlEntities( $message );\n echo \"</div>\";\n }",
"abstract protected function displayFailure($msg);",
"public function failureMessage($description);",
"public function shouldFailInTest()\n {\n return true;\n }",
"public function testAddFailed()\n {\n $this->post('/forum/cpus-andoverclocking/anandtech-intels-skylake-sp-xeon-vs-amds-epyc-7000/4/report', ['message' => '']);\n $this->assertResponseOk();\n $this->assertSession('The report could not be saved. Please, try again.', 'Flash.flash.0.message');\n }",
"public function testFailingStatusThrowsException() {\n $this->expectException(\\Exception::class);\n $this->expectExceptionMessage('The \"does_not_exist\" plugin does not exist.');\n $this->commands->status('invalid_plugin');\n }",
"public function testGetRuleException()\n {\n $input = new Formagic_Item_Mock_MockItem('test');\n $input->getRule('RuleNotExists');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the name of the action the controller is supposed to execute. | public function getControllerActionName() {} | [
"public function getControllerActionName();",
"protected function getActionName()\n {\n $action = $this->request->getParam('action');\n if (empty($action)) $action = 'index';\n return $action;\n }",
"public function getActionName()\r\n {\r\n return $this->action;\r\n }",
"public function getActionName()\n {\n return $this->__get(\"action_name\");\n }",
"public function getActionName() {\n\n\t\treturn $this->_action;\n\t}",
"private function getActionName()\n {\n return strtolower($this->_request->getActionName());\n }",
"public function getFullActionName()\n\t{\n\t\treturn $this->request->getFullActionName();\n\t}",
"public static function action_name() {\n\t\treturn static::ActionName ?: static::action()->ActionName;\n\t}",
"protected function getActionName()\r\n {\r\n $route = $this->getRoute();\r\n return $this->formatActionName($route['action']);\r\n }",
"private static function getActionName()\n\t{\n\t\t$action = Route::currentRouteAction();\n\n\t\treturn substr($action, strpos($action, '@') +1);\n\t}",
"public function getActionname()\r\n {\r\n return $this->actionname;\r\n }",
"public function getAction_name()\n {\n return $this->action_name;\n }",
"private function getActionName()\n {\n if (empty($this->action_name)) {\n $this->action_name = substr($this->name, 0, strlen($this->name) - 6);\n }\n\n return $this->action_name;\n }",
"public function getActionMethodName() {\n return $this->_actionName.self::ACTION_SUFFIX;\n }",
"protected function getActionName()\n {\n $actionName = $this->route()->getActionName();\n $explode = explode('@', $actionName);\n $functionName = end($explode);\n\n return $functionName;\n }",
"protected function getAction(): string\n\t{\n\t\treturn $this->getActionInput() ?: $this->getDefaultAction($this->getNameInput());\n\t}",
"public static function actionFunctionName()\n\t{\n\t\treturn self::$currentMvc->actionFunctionName();\n\t}",
"public function getFullActionName()\n {\n $request = Mage::app()->getRequest();\n return $request->getRequestedRouteName()\n . '_' . $request->getRequestedControllerName()\n . '_' . $request->getRequestedActionName();\n }",
"public function action() {\n\t\treturn $this->action;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the value of prazo | public function setPrazo($prazo)
{
$this->prazo = $prazo;
return $this;
} | [
"function setSorpresa($_caja){\r\n $this->sorpresa=$_caja;\r\n }",
"public function setPano($value) {\n return $this->set(self::PANO, $value);\n }",
"public function setAtaqueProgramador($valor){\n $this->ataqueProgramador=$valor;\n }",
"public function setNapetiKozena(int $value)\r\n {\r\n $this->napetiKozena = $value; \r\n }",
"function setSumarPais(){\n\t\t$this->cantidad_paises++;\n\t}",
"public function set($atributo, $valor) {\r\n\t\t\t $this->$atributo = $valor;\r\n\t\t}",
"public function setValor($valor){\n if($valor == 1){\n $this->_valor = true;\n }\n }",
"public function setCama(){\n $this->cama = \"Sim\";\n }",
"public function setMataPelajaran($mata_pelajaran);",
"public function setPosizione($_posizione){\n\t\t\t$this->posizione=$_posizione;\n\t}",
"public function setNumPatas ($numpatas){\n$this->numPatas=$numpatas;\n}",
"public function _setPrecio($Precio)\n\t {\n\t $this->Precio = $Precio;\n\t }",
"public function setPoz($poz)\n {\n $this->poz = $poz;\n return $this;\n }",
"public function spausdinu() {\n echo $this->spalva; // \"ruda\" pasiekiu CLass kintamaji\n $this->spalva = 'balta';\n echo $this->spalva; // \"balta\" pasiekiu CLass kintamaji\n\n echo $this->kuoMinta; // \"mesa\" , privatus kintamieji pasiekiami visoej Class'eje\n }",
"public function setDataPrazoResposta($data_prazo_resposta)\n {\n $this->data_prazo_resposta = $data_prazo_resposta;\n\n return $this;\n }",
"function __set($atributo, $nuevoValor){\r\n $this -> $atributo = $nuevoValor;\r\n }",
"public function setVat($value);",
"function setDato($dato){\r\n \t$this->dato = $dato;\r\n }",
"public function setPeso($peso)\r\n\t{\r\n\t\t$this->peso = $peso;\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the 'finite.callback.cascade_transition' service. This service is shared. This method always returns the same instance of the service. | protected function getFinite_Callback_CascadeTransitionService()
{
return $this->services['finite.callback.cascade_transition'] = new \Finite\Callback\CascadeTransitionCallback($this->get('finite.factory'));
} | [
"final public function getCascadeController()\n\t{\n\t\treturn $this->cascade_controller;\n\t}",
"protected function getOroWorkflow_Prototype_TransitionManagerService()\n {\n return new \\Oro\\Bundle\\WorkflowBundle\\Model\\TransitionManager();\n }",
"public function getTransition()\n {\n return $this->transition;\n }",
"public function getTransition();",
"protected function getOroWorkflow_Validator_TransitionIsAllowedService()\n {\n return $this->services['oro_workflow.validator.transition_is_allowed'] = new \\Oro\\Bundle\\WorkflowBundle\\Validator\\Constraints\\TransitionIsAllowedValidator($this->get('oro_workflow.registry'));\n }",
"public function getTargetCascade() : Cascade\n {\n return $this->target_cascade;\n }",
"public function getTransitionCallable()\n {\n return $this->callable_transition;\n }",
"public function getTransition($transitionValue);",
"protected function getJobTransition()\n {\n return $this->jobTransition;\n }",
"public function getTransition($transition_id);",
"public function getTransitions();",
"public function getTransitionId()\n {\n return $this->transition_id;\n }",
"public function getTransitions() {\n\t\t\treturn $this->transitions;\n\t\t}",
"public function getTransitionInfo(): TransitionInfoInterface;",
"protected function _getTransition($key)\n {\n $sKey = (string) $key;\n\n return array_key_exists($sKey, $this->transitions)\n ? $this->transitions[$sKey]\n : null;\n }",
"public function getTransitionId()\n\t{\n\t\treturn $this->transitionId; \n\n\t}",
"public function getController():SlideTrigger {\r\n\t\treturn $this->control;\r\n\t}",
"public function addTransition()\n {\n $newTransition = new StateTransition($this->states());\n $this->transitions[] = $newTransition;\n\n return $newTransition;\n }",
"public function getId(): TransitionId;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Information about the destination Freight Service Center. | public function setDestinationDetail(FreightServiceCenterDetail $destinationDetail)
{
$this->DestinationDetail = $destinationDetail;
return $this;
} | [
"public function getDestinationFulfillmentCenterId() \n {\n return $this->_fields['DestinationFulfillmentCenterId']['FieldValue'];\n }",
"public function getCostCenter()\n {\n return $this->costCenter;\n }",
"public function getCost_centre()\n {\n return isset($this->cost_centre) ? $this->cost_centre : null;\n }",
"public function getBusinessCenter() :string\n {\n return $this->businessCenter;\n }",
"public function setDestinationFulfillmentCenterId($value) \n {\n $this->_fields['DestinationFulfillmentCenterId']['FieldValue'] = $value;\n return $this;\n }",
"public function setOriginDetail(FreightServiceCenterDetail $originDetail)\n {\n $this->OriginDetail = $originDetail;\n return $this;\n }",
"protected function getYoastNotificationCenterService()\n {\n return $this->services['Yoast_Notification_Center'] = \\Yoast_Notification_Center::get();\n }",
"public function getDestinationDisplay()\n {\n return $this->destinationDisplay;\n }",
"public function setOrigin(FreightServiceCenterDetail $origin)\n {\n $this->values['Origin'] = $origin;\n return $this;\n }",
"public function getDestinationCity()\n {\n return $this->destination_city;\n }",
"public function getOperatingCentre()\n {\n return $this->operatingCentre;\n }",
"public function getnombrecentral(){\n \n if($this->idAcEsp == null)\n {\n return null;\n }\n\n return $this->idAcEsp->idAcCentr->nombre_accion;\n }",
"public function get_center_flights($req,$res,$args){\n $Centers_has_Flights = Centers_has_Flights::where(\"center_id\",\"=\",$args['center_id'])->with('flight')->get();\n $data = [\n \"msg_data\" => $Centers_has_Flights,\n \"msg_status\" => \"OK\"\n ];\n\t\treturn $res->withJSON($Centers_has_Flights,200);\n }",
"public function withDestinationFulfillmentCenterId($value)\n {\n $this->setDestinationFulfillmentCenterId($value);\n return $this;\n }",
"public function getDataCenter(){\n if (strstr($this->_api_key,\"-\")){\n list($key, $this->_dc) = explode(\"-\",$this->_api_key,2); \n }\n return $this->_dc;\n }",
"public function getTransfertCentre() {\n return $this->transfertCentre;\n }",
"public function getCentreSimple(): ?string {\n return $this->centreSimple;\n }",
"public function getDocumentFreteTransportadoraStreet()\n {\n return $this->document_frete_transportadora_street;\n }",
"public function get_datacenter() {\n $datacenter = explode( '-', MAILCHIMP_API_KEY );\n return $datacenter[1];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Option to search affiliate systems in the basic search panel | function HookResourceConnectAllSearchfiltertop()
{
global $lang,$language,$resourceconnect_affiliates,$baseurl,$resourceconnect_selected;
if (!checkperm("resourceconnect")) {return false;}
?>
<div class="SearchItem"><?php echo $lang["resourceconnect_affiliate"];?><br />
<select class="SearchWidth" name="resourceconnect_selected">
<?php for ($n=0;$n<count($resourceconnect_affiliates);$n++)
{
?>
<option value="<?php echo $n ?>" <?php if ($resourceconnect_selected==$n) { ?>selected<?php } ?>><?php echo i18n_get_translated($resourceconnect_affiliates[$n]["name"]) ?></option>
<?php
}
?>
</select>
</div>
<?php
} | [
"function affiliates_search( $search, $page = 1, $perpage = 6 )\n {\n $request['page'] = $page;\n $request['perpage'] = $perpage;\n $request['search'] = $search;\n\n return $this->hook( \"/affiliates/search\", \"user\", $request, 'GET' );\n }",
"function search()\n {\n $this->Lawmaker =& ClassRegistry::init('Lawmaker');\n $this->LawmakerStats =& ClassRegistry::init('LawmakerStats');\n\n if(!empty($this->data)){\n $params['query'] = $this->data['Search']['query'];\n $params['action'] = 'browse';\n $this->redirect($params);\n } \n }",
"public function doSearch();",
"public function searchable();",
"private function ally_search()\n {\n if ($this->_current_user['user_ally_id'] == 0 && $this->_current_user['user_ally_request'] == 0) {\n\n $parse = $this->_lang;\n $page = parent::$page->parseTemplate(\n parent::$page->getTemplate('alliance/alliance_searchform'), $parse\n );\n $parse['result'] = '';\n\n if ($_POST) {\n $search = parent::$db->query(\n \"SELECT a.*,\n (SELECT COUNT(user_id) AS `ally_members` \n FROM `\" . USERS . \"` \n WHERE `user_ally_id` = a.`alliance_id`) AS `ally_members`\n FROM \" . ALLIANCE . \" AS a\n WHERE a.alliance_name LIKE '%\" . parent::$db->escapeValue($_POST['searchtext']) . \"%' OR\n a.alliance_tag LIKE '%\" . parent::$db->escapeValue($_POST['searchtext']) . \"%' LIMIT 30\"\n );\n\n if (parent::$db->numRows($search) != 0) {\n\n while ($s = parent::$db->fetchArray($search)) {\n\n $search_data = [];\n $search_data['ally_tag'] = \"<a href=\\\"game.php?page=alliance&mode=apply&allyid=\" . $s['alliance_id'] . \"\\\">\" . $s['alliance_tag'] . \"</a>\";\n $search_data['alliance_name'] = $s['alliance_name'];\n $search_data['ally_members'] = $s['ally_members'];\n\n $parse['result'] .= parent::$page->parseTemplate(\n parent::$page->getTemplate('alliance/alliance_searchresult_row'), $search_data\n );\n }\n\n $page .= parent::$page->parseTemplate(\n parent::$page->getTemplate('alliance/alliance_searchresult_table'), $parse\n );\n }\n }\n return $page;\n }\n }",
"function pmp_dist_search_after_primary() { ?>\n\t<!-- Distributor search -->\n\t<label for=\"distributor\">Search by distributor GUID:</label>\n\t<input type=\"text\" name=\"distributor\" placeholder=\"Search by distributor GUID\"></input><?php\n}",
"public function displaySearch()\n\t{\n\t\t$conditions = new Conditions(self::searchFormHandler());\n\t\tself::view('listing/listingSearch', [\n\t\t\t'category' => $conditions->category,\n\t\t\t'search' => $conditions->search,\n\t\t\t'seller' => $conditions->seller]);\n\t}",
"public function search() {\n\t\t$this->tpl->setTitle($this->pl->txt('report_users_per_course'));\n\t\t$this->table = new ilReportingUsersPerCourseSearchTableGUI($this, ilReportingGUI::CMD_SEARCH);\n\t\t$this->table->setTitle($this->pl->txt('search_courses'));\n\t\tparent::search();\n\t}",
"function search() {\n\n $unified_search_modules = $this->getUnifiedSearchModules();\n\t\t$unified_search_modules_display = $this->getUnifiedSearchModulesDisplay();\n\n\n\n\t\tglobal $modListHeader, $beanList, $beanFiles, $current_language, $app_strings, $current_user, $mod_strings;\n\t\t$home_mod_strings = return_module_language($current_language, 'Home');\n\n\t\t$this->query_string = $GLOBALS['db']->quote(securexss(from_html(clean_string($this->query_string, 'UNIFIED_SEARCH'))));\n\n\t\tif(!empty($_REQUEST['advanced']) && $_REQUEST['advanced'] != 'false') {\n\t\t\t$modules_to_search = array();\n\t\t\tif(!empty($_REQUEST['search_modules']))\n\t\t\t{\n\t\t\t foreach(explode (',', $_REQUEST['search_modules'] ) as $key)\n\t {\n if (isset($unified_search_modules_display[$key]) && !empty($unified_search_modules_display[$key]['visible']))\n {\n $modules_to_search[$key] = $beanList[$key];\n }\n\t }\n\t\t\t}\n\n\t\t\t$current_user->setPreference('showGSDiv', isset($_REQUEST['showGSDiv']) ? $_REQUEST['showGSDiv'] : 'no', 0, 'search');\n\t\t\t$current_user->setPreference('globalSearch', $modules_to_search, 0, 'search'); // save selections to user preference\n\t\t} else {\n\t\t\t$users_modules = $current_user->getPreference('globalSearch', 'search');\n\t\t\t$modules_to_search = array();\n\n\t\t\tif(!empty($users_modules)) {\n\t\t\t\t// use user's previous selections\n\t\t\t foreach ( $users_modules as $key => $value ) {\n\t\t\t \tif (isset($unified_search_modules_display[$key]) && !empty($unified_search_modules_display[$key]['visible'])) {\n\t\t \t$modules_to_search[$key] = $beanList[$key];\n\t\t \t}\n\t\t\t }\n\t\t\t} else {\n\t\t\t\tforeach($unified_search_modules_display as $module=>$data) {\n\t\t\t\t if (!empty($data['visible']) ) {\n\t\t\t\t $modules_to_search[$module] = $beanList[$module];\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t}\n\t\t\t$current_user->setPreference('globalSearch', $modules_to_search, 'search');\n\t\t}\n\n\n\t\t$templateFile = SugarAutoLoader::existingCustomOne('modules/Home/UnifiedSearchAdvancedForm.tpl');\n\n\t\techo $this->getDropDownDiv($templateFile);\n\n\t\t$module_results = array();\n\t\t$module_counts = array();\n\t\t$has_results = false;\n\n\t\tif(!empty($this->query_string)) {\n\t\t\tforeach($modules_to_search as $moduleName => $beanName) {\n\t\t\t $seed = BeanFactory::newBean($moduleName);\n\n $lv = new ListViewSmarty();\n $lv->lvd->additionalDetails = false;\n $mod_strings = return_module_language($current_language, $seed->module_dir);\n\n //retrieve the original list view defs and store for processing in case of custom layout changes\n require('modules/'.$seed->module_dir.'/metadata/listviewdefs.php');\n\t\t\t\t$orig_listViewDefs = $listViewDefs;\n $defs = SugarAutoLoader::loadWithMetafiles($seed->module_dir, 'listviewdefs');\n if($defs) {\n require $defs;\n }\n\n if ( !isset($listViewDefs) || !isset($listViewDefs[$seed->module_dir]) )\n {\n continue;\n }\n\n\t\t\t $unifiedSearchFields = array () ;\n $innerJoins = array();\n foreach ( $unified_search_modules[ $moduleName ]['fields'] as $field=>$def )\n {\n \t$listViewCheckField = strtoupper($field);\n \t//check to see if the field is in listview defs\n\t\t\t\t\tif ( empty($listViewDefs[$seed->module_dir][$listViewCheckField]['default']) ) {\n\t\t\t\t\t\t//check to see if field is in original list view defs (in case we are using custom layout defs)\n\t\t\t\t\t\tif (!empty($orig_listViewDefs[$seed->module_dir][$listViewCheckField]['default']) ) {\n\t\t\t\t\t\t\t//if we are here then the layout has been customized, but the field is still needed for query creation\n\t\t\t\t\t\t\t$listViewDefs[$seed->module_dir][$listViewCheckField] = $orig_listViewDefs[$seed->module_dir][$listViewCheckField];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n //bug: 34125 we might want to try to use the LEFT JOIN operator instead of the INNER JOIN in the case we are\n //joining against a field that has not been populated.\n if(!empty($def['innerjoin']) )\n {\n if (empty($def['db_field']) )\n {\n continue;\n }\n $innerJoins[$field] = $def;\n $def['innerjoin'] = str_replace('INNER', 'LEFT', $def['innerjoin']);\n }\n\n if(isset($seed->field_defs[$field]['type']))\n {\n $type = $seed->field_defs[$field]['type'];\n if($type == 'int' && !is_numeric($this->query_string))\n {\n continue;\n }\n }\n\n $unifiedSearchFields[ $moduleName ] [ $field ] = $def ;\n $unifiedSearchFields[ $moduleName ] [ $field ][ 'value' ] = $this->query_string ;\n }\n\n /*\n * Use searchForm2->generateSearchWhere() to create the search query, as it can generate SQL for the full set of comparisons required\n * generateSearchWhere() expects to find the search conditions for a field in the 'value' parameter of the searchFields entry for that field\n */\n\n\t\t\t\trequire_once $this->searchFormPath;\n $searchForm = new $this->searchFormClass ( $seed, $moduleName ) ;\n\n $searchForm->setup (array ( $moduleName => array() ) , $unifiedSearchFields , '' , 'saved_views' /* hack to avoid setup doing further unwanted processing */ ) ;\n $where_clauses = $searchForm->generateSearchWhere() ;\n //add inner joins back into the where clause\n $params = array('custom_select' => \"\");\n foreach($innerJoins as $field=>$def) {\n if (isset ($def['db_field'])) {\n foreach($def['db_field'] as $dbfield)\n $where_clauses[] = $dbfield . \" LIKE '\" . $this->query_string . \"%'\";\n $params['custom_select'] .= \", $dbfield\";\n $params['distinct'] = true;\n }\n }\n\n if (count($where_clauses) > 0)\n {\n $where = '(('. implode(' ) OR ( ', $where_clauses) . '))';\n }\n else\n {\n /* Clear $where from prev. module\n if in current module $where_clauses */\n $where = '';\n }\n $displayColumns = array();\n foreach($listViewDefs[$seed->module_dir] as $colName => $param)\n {\n if(!empty($param['default']) && $param['default'] == true)\n {\n $param['url_sort'] = true;//bug 27933\n $displayColumns[$colName] = $param;\n }\n }\n\n if(count($displayColumns) > 0)\n {\n \t$lv->displayColumns = $displayColumns;\n } else {\n \t$lv->displayColumns = $listViewDefs[$seed->module_dir];\n }\n\n $lv->export = false;\n $lv->mergeduplicates = false;\n $lv->multiSelect = false;\n $lv->delete = false;\n $lv->select = false;\n $lv->showMassupdateFields = false;\n $lv->email = false;\n\n $lv->setup($seed, 'include/ListView/ListViewNoMassUpdate.tpl', $where, $params, 0, 10);\n\n $module_results[$moduleName] = '<br /><br />' . get_form_header($GLOBALS['app_list_strings']['moduleList'][$seed->module_dir] . ' (' . $lv->data['pageData']['offsets']['total'] . ')', '', false);\n $module_counts[$moduleName] = $lv->data['pageData']['offsets']['total'];\n\n if($lv->data['pageData']['offsets']['total'] == 0) {\n $module_results[$moduleName] .= '<h2>' . $home_mod_strings['LBL_NO_RESULTS_IN_MODULE'] . '</h2>';\n } else {\n $has_results = true;\n $module_results[$moduleName] .= $lv->display(false, false);\n }\n\n\t\t\t}\n\t\t}\n\n\t\tif($has_results) {\n\t\t\tforeach($module_counts as $name=>$value) {\n\t\t\t\techo $module_results[$name];\n\t\t\t}\n\t\t} else if(empty($_REQUEST['form_only'])) {\n\t\t\techo $home_mod_strings['LBL_NO_RESULTS'];\n\t\t\techo $home_mod_strings['LBL_NO_RESULTS_TIPS'];\n\t\t}\n\n\t}",
"function getElectedOfficialsAccountsAdmin($search_field=\"\",$search_text=\"\")\n\t\t{ \n\t\t\t\n\t\t\tif(isset($_REQUEST[\"search_field\"]) and (trim($_REQUEST[\"search_field\"]) != \"\"))\n\t\t\t{\n\t\t\t\n\t\t\t\tif($_REQUEST[\"search_field\"] == 'fname')\n\t\t\t\t{\n\t\t\t\t\t$query = \"SELECT first_name, last_name, email, member_id, ElectedOfficialID\n\t\t\t\t\tFROM tbl_member \n\t\t\t\t\twhere member_type='elected_official' and first_name like '%\".$search_text.\"%'\";\n\t\t \t\t}\t\n\t\t\t\telse if($_REQUEST[\"search_field\"] == 'lname')\n\t\t\t\t{\n\t\t\t\t\t$query = \"SELECT first_name, last_name, email, member_id, ElectedOfficialID\n\t\t\t\t\tFROM tbl_member \n\t\t\t\t\twhere member_type='elected_official' and last_name like '%\".$search_text.\"%'\";\n\t\t \t\t}\t\n\t\t \t\telse if($_REQUEST[\"search_field\"] == 'email')\n\t\t\t\t{\n\t\t\t\t\t$query = \"SELECT first_name, last_name, email, member_id, ElectedOfficialID\n\t\t\t\t\t FROM tbl_member \n\t\t\t\t\t where member_type='elected_official' and email = '\".$search_text.\"'\";\n\t\t\t\t} \n\t\t\t}\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\t$query = \"SELECT first_name, last_name, email, member_id, ElectedOfficialID\n\t\t\t\tFROM tbl_member where member_type='elected_official'\";\n\t\t\t}\n\t\t\t\n\t\t\t//$query = \"SELECT member_id, concat(first_name,' ',last_name) as fullname,email,isActive FROM tbl_member where member_type='subscriber'\";\n\t\n\t\t\t$rs = $this->Execute($query);\n\t\t\treturn $this->_getPageArray($rs, 'Member');\n\t\t}",
"public function index()\n\t{\n\t$queryTerm = htmlspecialchars($this->input->get('query'));\n\t\t$origin = $_SERVER['HTTP_REFERER'];\n\t\tif(strpos($origin,\"Communication\") === false)\n\t\t\t$origin = 1;\t//Normal Search\n\t\telse\n\t\t\t$origin = 2;\t//Communication First\n\t\t$this->search_resultfe($queryTerm,$origin);\n\t}",
"public function display_user_search() {\n $userfilter = new user_filtering();\n\n echo \"<h2>\" . $this->heading . \"</h2>\";\n $userfilter->display_add();\n $userfilter->display_active();\n }",
"public function GetSearchProvider();",
"public function search() {\r\n\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t$query = '';\r\n\t\tif (isset($this->params['url']['query'])) {\r\n\t\t\t$query = $this->params['url']['query'];\r\n\t\t}\r\n\r\n\t\t$queryURL = $queryURL.\"/Parties_People/opensearch/lookup?searchTerms=\".$query;\r\n\t\t$queryResponse = \"error\";\r\n\n\t\t$ch = curl_init();\r\n\t\t$timeout = 5;\r\n\t\tcurl_setopt($ch,CURLOPT_URL,$queryURL);\r\n\t\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\r\n\t\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);\r\n\t\t$queryResponse = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$this->autoRender = false;\r\n\t\t$this->response->type('json');\r\n\r\n\t\t$this->response->body($queryResponse);\r\n\t}",
"public function print_search() {\n parent::print_search();\n $parent = $this->optional_param('id', 0, PARAM_INT);\n if (!$parent) {\n $subsets = $this->optional_param('subsets', 0, PARAM_INT);\n $url = $this->url;\n $url->remove_params('subsets');\n echo html_writer::checkbox('subsets', 1, $subsets, get_string('userset_subsets', 'local_elisprogram'), array(\n 'onclick' => 'window.location=\"'.$url.'&subsets=\"+(this.checked ? \"1\" : \"0\");',\n 'language' => 'javascript'));\n }\n }",
"function alt_term_links_search( $args ) {\n \n foreach( alt_term_links_config() as $conf ) {\n $var = adverts_request( $conf[\"param\"] );\n if( ! empty( $var ) ) {\n $args[\"tax_query\"] = _alt_term_links_search_apply( $conf, $var, $args[\"tax_query\"] ); \n }\n }\n \n return $args;\n}",
"function search()\n {\n if (!$this->check_access('report')) {\n return;\n }\n $this->load_lib('List_report', 'list_report', $this->my_tag);\n $this->list_report->list_report('search');\n return;\n }",
"public function search_org()\n\t{\n\t $this->data['orgs'] = $this->employer->search_org($this->input->post('search_text'), 0, 10);\n\t $this->data['pagination'] = '';\n\t \n\t // Check if no results\n\t if (!$this->data['orgs'])\n\t {\n\t redirect('/admin/orgs', 'refresh');\n\t return;\n\t }\n\t \n\t $this->load->view('global_header.php', $this->data);\n\t\t$this->load->view('admin/orgs.php', $this->data);\n\t\t$this->load->view('global_footer.php');\n\t}",
"function avelsieve_search_integration() {\n\tinclude_once(SM_PATH . 'plugins/avelsieve/include/search_integration.inc.php');\n\tavelsieve_search_integration_do();\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add attachments in employee info | public function addAttachmentsAction()
{
if (true === $this->getRequest()->isXmlHttpRequest()) {
$response = new JsonModel();
$response->setVariables(
[
'errors' => [],
'id' => 0,
]
);
$data = $this->getRequest()->getPost();
$id = $data['id'];
$employee = $this->getEntityManager()
->getRepository(EmployeeModel::class)
->findOneBy(
[
'id' => $id
]
);
$fileManager = new FileManager();
$files = $fileManager->storeFiles($this->getRequest()->getFiles('attachments', []), 'files/employee/' . EmployeeModel::hashKey());
foreach ($files as $file) {
$file->setEmployee($employee);
$this->getEntityManager()->persist($file);
$this->getEntityManager()->flush();
}
$url = $this->url()->fromRoute('show-employee', ['hash' => $employee->getHash()]);
$response->setVariables(
[
'id' => $id,
'redirect' => $url
]
);
return $response;
} else {
return $this->notFoundAction();
}
} | [
"public function addAttachments()\n {\n $attachments_relations = [\n 'spots',\n 'plans',\n 'albumPhotos',\n 'areas',\n 'links'\n ];\n $this->addHidden($attachments_relations);\n $this->append('attachments');\n }",
"function addAttachment() {\n\t\tif ($this->isAdmin () == TRUE) {\n\t\t\t$this->loadThis ();\n\t\t} else {\n\t\t\t$data [\"companyData\"] = $this->cms_model->getCompanies();\n\t\t\t$data [\"attchmentTypes\"] = $this->cms_model->getAttachmentTypes();\n\t\t\t\n\t\t\t$this->global ['pageTitle'] = 'Feedbacker : Add Attachment';\n\t\t\t$this->loadViews(\"addAttachment\", $this->global, $data, NULL);\n\t\t}\n\t}",
"private function setAttachments()\n {\n $attachments = $this->mailable->get('_attachments');\n\n if (!is_null($attachments)) {\n foreach ($attachments as $attachment) {\n if (in_array('name')) {\n $this->message->attach(Attachment::fromPath($attachment['file'])->setFilename($attachment['name']));\n } else {\n $this->message->attach(Attachment::fromPath($attachment['file']));\n }\n }\n }\n }",
"protected function add_attachments_form()\n {\n\n }",
"private function set_attachments() {\n\t\t$args = array(\n\t\t\t'entry' => $this->entry,\n\t\t\t'email_key' => $this->email_key,\n\t\t);\n\n\t\t$this->attachments = apply_filters( 'frm_notification_attachment', array(), $this->form, $args );\n\t}",
"function __attachFiles() {\n\t\tforeach ($this->attachments as $attachment) {\n\t\t\t$files[] = $this->__findFiles($attachment);\n\t\t}\n\n\t\tforeach ($files as $file) {\n\t\t\t$handle = fopen($file, 'rb');\n\t\t\t$data = fread($handle, filesize($file));\n\t\t\t$data = chunk_split(base64_encode($data)) ;\n\t\t\t$filetype = trim(mime_content_type($file));\n\n\t\t\tif(empty($filetype)) {\n\t\t\t\tuser_error('Unable to get mimetype for e-mail attachment', E_USER_ERROR);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$this->__message .= '--' . $this->__createBoundary() . $this->_newLine;\n\t\t\t$this->__message .= 'Content-Type: ' . $filetype . '; name=\"' . basename($file) . '\"' . $this->_newLine;\n\t\t\t$this->__message .= 'Content-Transfer-Encoding: base64' . $this->_newLine;\n\t\t\t$this->__message .= 'Content-Disposition: attachment; filename=\"' . basename($file) . '\"' . $this->_newLine . $this->_newLine;\n\t\t\t$this->__message .= $data . $this->_newLine . $this->_newLine;\n\t\t}\n\t}",
"private function setAttachmentInfo() {\n // Get the attachments\n $attachmentData = $this->postData->getAttachmentData();\n\n // Stop if there are none.\n if (!$attachmentData) return;\n\n // Show attachment links as real links. Add a preview tooltip if the attachment is an image.\n $attachmentData = array_map(function ($mediaFile) {\n /** @var MediaFile $mediaFile */\n $tooltip = preg_match('/\\.(jpg|JPG|png|PNG|gif|GIF|jpeg|JPEG)/', $mediaFile->getLocalUrl()) ? true : false;\n\n return Utils::view('site-tester.partial.attachment-item')->with([\n 'item' => $mediaFile,\n 'tooltip' => $tooltip\n ])->render();\n\n }, $attachmentData);\n\n $this->addInfo(_wpcc(\"Attachments\"), $attachmentData);\n }",
"private function add_attachments($experiment, $comb_exp)\n\t{\n\t\t// Add attachment\n\t\tif ($experiment->attachment && file_exists('uploads/' . $experiment->attachment))\n\t\t{\n\t\t\t$this->email->attach('uploads/' . $experiment->attachment);\n\t\t}\n\t\t// Add informed consent\n\t\tif ($experiment->informedconsent && file_exists('uploads/' . $experiment->informedconsent))\n\t\t{\n\t\t\t$this->email->attach('uploads/' . $experiment->informedconsent);\n\t\t}\n\t\t// Add attachment / informed consent of second experiment\n\t\tif ($comb_exp)\n\t\t{\n\t\t\tif ($comb_exp->attachment && file_exists('uploads/' . $comb_exp->attachment))\n\t\t\t{\n\t\t\t\t$this->email->attach('uploads/' . $comb_exp->attachment);\n\t\t\t}\n\t\t\tif ($comb_exp->informedconsent && file_exists('uploads/' . $comb_exp->informedconsent))\n\t\t\t{\n\t\t\t\t$this->email->attach('uploads/' . $comb_exp->informedconsent);\n\t\t\t}\n\t\t}\n\t}",
"private static function addAttachments($mailer, $fields, $data)\n\t{\n\t\t$attachmentsPath = JPATH_ROOT . '/media/com_osmembership/upload/';\n\t\tfor ($i = 0, $n = count($fields); $i < $n; $i++)\n\t\t{\n\t\t\t$field = $fields[$i];\n\t\t\tif ($field->fieldtype == 'File' && isset($data[$field->name]))\n\t\t\t{\n\t\t\t\t$fileName = $data[$field->name];\n\t\t\t\tif ($fileName && file_exists($attachmentsPath . '/' . $fileName))\n\t\t\t\t{\n\t\t\t\t\t$pos = strpos($fileName, '_');\n\t\t\t\t\tif ($pos !== false)\n\t\t\t\t\t{\n\t\t\t\t\t\t$originalFilename = substr($fileName, $pos + 1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$originalFilename = $fileName;\n\t\t\t\t\t}\n\t\t\t\t\t$mailer->addAttachment($attachmentsPath . '/' . $fileName, $originalFilename);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function attachmentsAction() {\n $this->_initProduct();\n $this->loadLayout();\n $this->getLayout()->getBlock('product.edit.tab.attachment')\n ->setProductAttachments($this->getRequest()->getPost('product_attachments', null));\n $this->renderLayout();\n }",
"public function attachFile($fieldname, $filename) {}",
"private function addAttachment(array $params)\n {\n // removed unnecessary empty fields\n $this->attachments[] = $this->checkFields($params);\n }",
"private function addAttachments(Mime\\Message $body, array $attachments) : void\n {\n foreach ($attachments as $name => $attachmentPath) {\n $this->assertViableAttachment($name, $attachmentPath);\n $fileContent = fopen($attachmentPath, 'r');\n $attachment = new Mime\\Part($fileContent);\n $attachment->filename = $name;\n $attachment->type = $this->getMimeType($attachmentPath);\n $attachment->disposition = Mime\\Mime::DISPOSITION_ATTACHMENT;\n $attachment->encoding = Mime\\Mime::ENCODING_BASE64;\n $body->addPart($attachment);\n }\n }",
"function pbe_email_attachments($pbe, $email_message)\n{\n\t// Trying to attach a file with this post ....\n\tglobal $modSettings, $context, $txt;\n\n\t// Init\n\t$attachment_count = 0;\n\t$attachIDs = array();\n\t$tmp_attachments = new TemporaryAttachmentsList();\n\n\t// Make sure we're know where to upload\n\t$attachmentDirectory = new AttachmentsDirectory($modSettings, database());\n\ttry\n\t{\n\t\t$attachmentDirectory->automanageCheckDirectory(isset($_REQUEST['action']) && $_REQUEST['action'] == 'admin');\n\n\t\t$attach_current_dir = $attachmentDirectory->getCurrent();\n\n\t\tif (!is_dir($attach_current_dir))\n\t\t{\n\t\t\t$tmp_attachments->setSystemError('attach_folder_warning');\n\t\t\t\\ElkArte\\Errors\\Errors::instance()->log_error(sprintf($txt['attach_folder_admin_warning'], $attach_current_dir), 'critical');\n\t\t}\n\t}\n\tcatch (\\Exception $e)\n\t{\n\t\t// If the attachments folder is not there: error.\n\t\t$tmp_attachments->setSystemError($e->getMessage());\n\t}\n\n\t// For attachmentChecks function\n\trequire_once(SUBSDIR . '/Attachments.subs.php');\n\t$context['attachments'] = array('quantity' => 0, 'total_size' => 0);\n\n\t// Create the file(s) with a temp name so we can validate its contents/type\n\tforeach ($email_message->attachments as $name => $attachment)\n\t{\n\t\tif ($tmp_attachments->hasSystemError())\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\n\t\t$attachID = $tmp_attachments->getTplName($pbe['profile']['id_member'], bin2hex(random_bytes(16)));\n\n\t\t// Write the contents to an actual file\n\t\t$destName = $attach_current_dir . '/' . $attachID;\n\t\tif (file_put_contents($destName, $attachment) !== false)\n\t\t{\n\t\t\t@chmod($destName, 0644);\n\n\t\t\t$temp_file = new TemporaryAttachment([\n\t\t\t\t'name' => basename($name),\n\t\t\t\t'tmp_name' => $destName,\n\t\t\t\t'attachid' => $attachID,\n\t\t\t\t'user_id' => $pbe['profile']['id_member'],\n\t\t\t\t'size' => strlen($attachment),\n\t\t\t\t'type' => null,\n\t\t\t\t'id_folder' => $attachmentDirectory->currentDirectoryId(),\n\t\t\t]);\n\n\t\t\t// Make sure its valid\n\t\t\t$temp_file->doChecks($attachmentDirectory);\n\t\t\t$tmp_attachments->addAttachment($temp_file);\n\t\t\t$attachment_count++;\n\t\t}\n\t}\n\n\t$prefix = $tmp_attachments->getTplName($pbe['profile']['id_member'], '');\n\t// Space for improvement: move the removeAll to the end before ->unset\n\tif ($tmp_attachments->hasSystemError())\n\t{\n\t\t$tmp_attachments->removeAll();\n\t}\n\telse\n\t{\n\t\t// Get the results from attachmentChecks and see if its suitable for posting\n\t\tforeach ($tmp_attachments as $attachID => $attachment)\n\t\t{\n\t\t\t// If there were any errors we just skip that file\n\t\t\tif (strpos($attachID, $prefix) === false || $attachment->hasErrors())\n\t\t\t{\n\t\t\t\t$attachment->remove(false);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Load the attachmentOptions array with the data needed to create an attachment\n\t\t\t$attachmentOptions = array(\n\t\t\t\t'post' => 0,\n\t\t\t\t'poster' => $pbe['profile']['id_member'],\n\t\t\t\t'name' => $attachment['name'],\n\t\t\t\t'tmp_name' => $attachment['tmp_name'],\n\t\t\t\t'size' => (int) $attachment['size'],\n\t\t\t\t'mime_type' => (string) $attachment['type'],\n\t\t\t\t'id_folder' => (int) $attachment['id_folder'],\n\t\t\t\t'approved' => !$modSettings['postmod_active'] || in_array('post_unapproved_attachments', $pbe['user_info']['permissions']),\n\t\t\t\t'errors' => array(),\n\t\t\t);\n\n\t\t\t// Make it available to the forum/post\n\t\t\tif (createAttachment($attachmentOptions))\n\t\t\t{\n\t\t\t\t$attachIDs[] = $attachmentOptions['id'];\n\t\t\t\tif (!empty($attachmentOptions['thumb']))\n\t\t\t\t{\n\t\t\t\t\t$attachIDs[] = $attachmentOptions['thumb'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// We had a problem so simply remove it\n\t\t\telse\n\t\t\t{\n\t\t\t\t$tmp_attachments->removeById($attachID, false);\n\t\t\t}\n\t\t}\n\t}\n\t$tmp_attachments->unset();\n\n\treturn $attachIDs;\n}",
"function addAttachment($filename) {\n\t\tif (trim($filename) != '') {\n\t\t\t$path = explode ('/', $filename);\n\t\t\t$basename = array_pop ($path);\n\t\t\t$this->files[$basename] = base64_encode(t3lib_div::getURL($filename));\n\t\t\t$this->mimes[$basename] = $this->getMimeType($filename);\n\t\t}\n\t}",
"public function attachment(){\n $app = JFactory::getApplication();\n if ($id = (int)$app->input->get('product_id')){\n $attachments = trim($app->input->get('arrayAttachments'), ',');\n $attachments = explode(',', $attachments);\n if (!JeproshopAttachmentModelAttachment::attachToProduct($id, $attachments))\n JError::raiseError(500, JText::_('An error occurred while saving product attachments.'));\n }\n }",
"private function _addAttachement()\n {\n\n //Attach backup\n $this->addElement(\n 'radio',\n 'attachBackup',\n array(\n 'class' => 'radio emailToggle toggler',\n 'label' => 'L_ATTACH_BACKUP',\n 'onclick' => \"myToggle(this, 'y', 'attachToggle');\",\n 'listsep' => ' ',\n 'disableLoadDefaultDecorators' => true,\n 'multiOptions' => array(\n 'y' => 'L_YES',\n 'n' => 'L_NO',\n ),\n 'decorators' => array('Default'),\n )\n );\n\n //Max filesize\n $this->addElement(\n 'text',\n 'Maxsize',\n array(\n 'class' => 'text right emailToggle attachToggle',\n 'size' => 6,\n 'maxlength' => 6,\n 'label' => 'L_EMAIL_MAXSIZE',\n 'listsep' => ' ',\n 'disableLoadDefaultDecorators' => true,\n 'decorators' => array('LineStart'),\n 'validators' => array('Digits'),\n )\n );\n\n //Max filesize unit\n $this->addElement(\n 'select',\n 'MaxsizeUnit',\n array(\n 'class' => 'select emailToggle attachToggle',\n 'listsep' => ' ',\n 'multiOptions' => array(\n 'kb' => 'L_UNIT_KB',\n 'mb' => 'L_UNIT_MB',\n ),\n 'disableLoadDefaultDecorators' => true,\n 'decorators' => array('LineEnd'),\n )\n );\n }",
"public function process_attachments_files($ctx) {\n $attachments_data = isset($_FILES[\"orbisius_support_tickets_data_attachments\"]) ? $_FILES[\"orbisius_support_tickets_data_attachments\"] : array();\n if (!empty($attachments_data['tmp_name'][0])) { //Check if there are attachment files submitted\n try {\n if (empty($ctx['ticket_id'])) {\n throw new Exception(\"Missing ticket id\");\n }\n\n if (!$this->check_attachment_files_error($attachments_data)) {\n throw new Exception(\"Error uploading the ticket attachments\");\n }\n\n if (!$this->check_attachment_files_max_size($attachments_data)) {\n throw new Exception(\"Error file size limit\");\n }\n\n $attachments = array();\n $ticket_id = $ctx['ticket_id'];\n $hash = md5($ticket_id);\n $deep_folder = substr($hash, 0, 1) . \"/\"\n . substr($hash, 1, 1) . \"/\"\n . substr($hash, 2, 1) . \"/\"\n . $ticket_id;\n\n $this->ticket_folder_dir = ORBISIUS_SUPPORT_TICKETS_ATTACHMENTS_ADDON_FILES_DIR . $deep_folder;\n\n if (!is_dir($this->ticket_folder_dir)) {\n if (!wp_mkdir_p($this->ticket_folder_dir)) {\n throw new Exception(\"Error creating the ticket folder\");\n }\n\n $htaccess_file = ORBISIUS_SUPPORT_TICKETS_ATTACHMENTS_ADDON_FILES_DIR . '.htaccess';\n\n if (!file_exists($htaccess_file)) {\n file_put_contents($htaccess_file, 'deny from all', LOCK_EX);\n }\n\n $index_file = ORBISIUS_SUPPORT_TICKETS_ATTACHMENTS_ADDON_FILES_DIR . 'index.html';\n\n if (!file_exists($index_file)) {\n touch($index_file); // doesn't need content. an empty file prevents file list if enabled.\n }\n }\n\n if (!function_exists('media_handle_upload')) {\n require_once(ABSPATH . \"wp-admin\" . '/includes/image.php'); // required to process image files type\n require_once(ABSPATH . \"wp-admin\" . '/includes/file.php');\n require_once(ABSPATH . \"wp-admin\" . '/includes/media.php');\n }\n\n foreach ($attachments_data['tmp_name'] as $key => $temp_file_path) {\n $file_array['tmp_name'] = $temp_file_path;\n $file_array['name'] = $attachments_data['name'][$key];\n $file_array['type'] = $attachments_data['type'][$key];\n $file_array['error'] = $attachments_data['error'][$key];\n $file_array['size'] = $attachments_data['size'][$key];\n\n // do the validation and storage stuff\n add_filter('upload_dir', array($this, 'custom_upload_dir'));\n $attachment_id = media_handle_sideload($file_array, $ticket_id);\n remove_filter('upload_dir', array($this, 'custom_upload_dir'));\n\n // If error storing permanently, unlink\n if (is_wp_error($attachment_id)) {\n unlink($file_array['tmp_name']);\n throw new Exception(\"Error storing the ticket attachment\");\n }\n\n do_action('orbisius_support_tickets_filter_submit_ticket_form_after_upload_file', $attachment_id);\n }\n if (defined('DOING_AJAX') && DOING_AJAX) {\n return true;\n }\n } catch (Exception $ex) {\n if (defined('DOING_AJAX') && DOING_AJAX) {\n return $ex->getMessage();\n } else {\n wp_die($ex->getMessage());\n }\n }\n }\n }",
"public function addAttachment()\n {\n global $injector, $notification;\n\n $result = new stdClass;\n $result->action = 'addAttachment';\n if (isset($this->vars->file_id)) {\n $result->file_id = $this->vars->file_id;\n }\n $result->success = 0;\n\n /* A max POST size failure will result in ALL HTTP parameters being\n * empty. Catch that here. */\n if (!isset($this->vars->composeCache)) {\n $notification->push(_(\"Your attachment was not uploaded. Most likely, the file exceeded the maximum size allowed by the server configuration.\"), 'horde.warning');\n } else {\n $imp_compose = $injector->getInstance('IMP_Factory_Compose')->create($this->vars->composeCache);\n\n if ($imp_compose->canUploadAttachment()) {\n try {\n foreach ($imp_compose->addAttachmentFromUpload('file_upload') as $val) {\n if ($val instanceof IMP_Compose_Exception) {\n $notification->push($val, 'horde.error');\n } else {\n $result->success = 1;\n\n /* This currently only occurs when\n * pasting/dropping image into HTML editor. */\n if ($this->vars->img_data) {\n $result->img = new stdClass;\n $result->img->src = strval($val->viewUrl()->setRaw(true));\n\n $temp1 = new DOMDocument();\n $temp2 = $temp1->createElement('span');\n $imp_compose->addRelatedAttachment($val, $temp2, 'src');\n $result->img->related = array(\n $imp_compose::RELATED_ATTR,\n $temp2->getAttribute($imp_compose::RELATED_ATTR)\n );\n } else {\n $this->_base->queue->attachment($val);\n $notification->push(sprintf(_(\"Added \\\"%s\\\" as an attachment.\"), $val->getPart()->getName()), 'horde.success');\n }\n }\n }\n\n $this->_base->queue->compose($imp_compose);\n } catch (IMP_Compose_Exception $e) {\n $notification->push($e, 'horde.error');\n }\n } else {\n $notification->push(_(\"Uploading attachments has been disabled on this server.\"), 'horde.error');\n }\n }\n\n return $this->vars->json_return\n ? $result\n : new Horde_Core_Ajax_Response_HordeCore_JsonHtml($result);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load default symfony bundles. Load Doctrine also. | protected function loadSymfonyBundles()
{
$bundles = [
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
];
$this->loadedBundles = array_merge($this->loadedBundles, $bundles);
} | [
"private function LoadBundles(){\n\n $this->FetchAllBundles();\n $bundleConfigDir = \\Get::Config('APPDIRS.BUNDLES.CONFIG');\n $bundleRoutesDir = \\Get::Config('APPDIRS.BUNDLES.ROUTES');\n\n foreach(self::$bundles as $bundle)\n {\n if(is_dir($bundle))\n {\n $configs = $this->LoadOnceFromDir($bundle . $bundleConfigDir, array('php'));\n\n if(is_array($configs))\n {\n self::$configs = array_merge(\n self::$configs,\n $configs\n );\n }\n\n $routes = $this->LoadOnceFromDir($bundle . $bundleRoutesDir, array('php'));\n\n if(is_array($routes))\n {\n self::$routes = array_merge(\n self::$routes,\n $routes\n );\n }\n }\n else\n {\n $params['Backtrace'] = debug_backtrace();\n $message = ' not found in Loader::LoadBundles()';\n require \\Get::Config('APPDIRS.TEMPLATING.TEMPLATES_FOLDER') . 'Errors/BundleNotFound.html.php';\n trigger_error ('Unable to locate Bunlde:'. $bundle, E_USER_ERROR);\n die();\n }\n }\n\n }",
"protected static function loadFixturesBundles()\n {\n return [\n 'ElcodiArticleBundle',\n ];\n }",
"protected static function loadFixturesBundles()\n {\n return [\n 'ElcodiGeoBundle',\n ];\n }",
"protected static function loadFixturesBundles()\r\n {\r\n return [\r\n 'ElcodiArticleBundle',\r\n ];\r\n }",
"protected function loadFixturesBundles()\n {\n return array(\n 'ElcodiLanguageBundle',\n 'ElcodiUserBundle',\n 'ElcodiCurrencyBundle',\n 'ElcodiCouponBundle',\n 'DeliberryReferralProgramBundle',\n );\n }",
"protected function loadFixturesBundles()\n {\n return [\n 'ElcodiCartBundle',\n 'ElcodiCouponBundle',\n ];\n }",
"public function loadSymfonyKernel()\n {\n //====================================================================//\n // Only On MultiShop Mode on PS 1.7.X\n if (Tools::version_compare(_PS_VERSION_, \"1.7\", '<')) {\n return;\n }\n //====================================================================//\n // Only for PrestaShop > 1.7 => Ensure Kernel is Loaded\n KernelManager::ensureKernel();\n }",
"public function init()\n {\n $classLoader = new ClassLoader('Doctrine', dirname(__FILE__) . '/vendor');\n \\Yii::registerAutoloader(array($classLoader, 'loadClass'));\n\n $classLoader = new ClassLoader('Symfony', dirname(__FILE__) . '/vendor');\n \\Yii::registerAutoloader(array($classLoader, 'loadClass'));\n\n }",
"function __autoload_custom_modules_as_symfony_bundle(&$external_config)\n {\n /**\n * I have to create an internal variable to pass the external becos a bug was auto adding the files\n * include in the script as value for the external_config variable\n */\n $internal_config = $external_config ;\n /**\n * we still need to ensure that the file exist\n */\n if(file_exists(PSR4_PLUGGABLE_AUTOLOAD_FILE)) {\n ##\n $lib_list = require PSR4_PLUGGABLE_AUTOLOAD_FILE;\n\n foreach ($lib_list as $namespace => $dir) {\n /**\n * Becaos the main module core-source, is default and would have been added in the main Composer.json and by Composer itself\n * so we need to skit it\n */\n if(false !== strpos($namespace , 'Veiw\\\\BotLogic')) {\n ## skip adding it to autoloader\n continue ;\n }\n\n /**\n * load the composer.json file and locate the key extra->symfony-bundle->name key path\n */\n $composerJsonFile = sprintf('%s/composer.json' , ( (is_array($dir)) ? current($dir) : $dir) );\n\n ##\n $jsonContent = file_get_contents($composerJsonFile);\n ## decode the composer.json sir\n $composerJsonObject = json_decode($jsonContent , true);\n\n ##\n if(! isset($composerJsonObject['extra']['symfony-bundle']['name'])) {\n ##\n trigger_error('Each pluggable bundle requires a name defined for the Bundle to Autoload it') ; die;\n }\n\n ## construct a BundleName\n $construct_a_bundle_name = sprintf('%s\\%s' , $namespace , $composerJsonObject['extra']['symfony-bundle']['name']) ;\n\n /**\n * A bug in Symfony DebugClassLoader is making this function given an error that the BundleClass is not available, perhaps the problem can be fixed later\n\n if(! class_exists($construct_a_bundle_name , true)) {\n ##\n trigger_error(sprintf('%s not valid as a Bundle for Pluggable Module %s' , $construct_a_bundle_name , $namespace) ) ; die;\n }*/\n\n ## ad it as part of bundle\n $internal_config[$construct_a_bundle_name] = ['all' => true] ;\n }\n ## merge both at this point\n $external_config = array_merge($external_config , $internal_config);\n }\n ##\n return $external_config ;\n }",
"public function fetchProtoCmsBundles(){\n // Load all registered bundles\n $prototypeBundles = array();\n $bundles = $this->container->getParameter('kernel.bundles');\n foreach ($bundles as $name => $class) {\n // echo \"<br/>\". $name .\" : \". $class;\n // Check these are really your bundles, not the vendor bundles\n $bundlePrefix = 'Prototype';\n if (strpos($name, 'Prototype') !== false) {\n $prototypeBundles[] = $name;\n }\n }\n return $prototypeBundles;\n }",
"public function loadSchemas() \n\t{\n\t\t$bundles = array_diff(scandir('bundle'), array('.', '..'));\n\t\t\n\t\tif (!empty($bundles)) {\n\t\t\tforeach($bundles as $bundle_name) {\n\t\t\t\t$file_path = 'bundle/'.$bundle_name.'/schema.yml';\n\t\t\t\t\n\t\t\t\tif (file_exists($file_path)) {\n\t\t\t\t\t$file_content = file_get_contents($file_path);\n\t\t\t\t\t$this->app_schema[$bundle_name] = Yaml::parse($file_content)->toArray();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function loadBundleGenerators(Kernel $kernel)\n {\n /** @var Bundle $bundle */\n foreach ($kernel->getBundles() as $bundle) {\n $this->loadGeneratorsForBundle($bundle);\n }\n }",
"function load_bundles($str) {\n $this->load_files($str, \"includes/bundles\");\n }",
"function registerComposerAutoLoad()\n {\n // sx: Register sologics composer autoloader\n $autoloaderPath = __DIR__ . '/../../vendor/autoload.php';\n if (file_exists($autoloaderPath)) {\n include_once $autoloaderPath;\n }\n\n // initialize symfony kernel\n require_once __DIR__ . '/../kernelbootstrap.php';\n }",
"public static function loadBundleProductFixtures()\n {\n require __DIR__ . '/../../_files/productFixtures_bundleProduct.php';\n }",
"protected function initializeBundles()\n {\n // init bundles\n $this->bundles = [];\n $topMostBundles = [];\n $directChildren = [];\n\n foreach ($this->registerBundles() as $bundle) {\n $name = $bundle->getName();\n if (isset($this->bundles[$name])) {\n throw new \\LogicException(sprintf('Trying to register two bundles with the same name \"%s\"', $name));\n }\n $this->bundles[$name] = $bundle;\n\n if ($parentName = $bundle->getParent()) {\n @trigger_error('Bundle inheritance is deprecated as of 3.4 and will be removed in 4.0.', E_USER_DEPRECATED);\n\n if (isset($directChildren[$parentName])) {\n throw new \\LogicException(sprintf('Bundle \"%s\" is directly extended by two bundles \"%s\" and \"%s\".', $parentName, $name, $directChildren[$parentName]));\n }\n if ($parentName == $name) {\n throw new \\LogicException(sprintf('Bundle \"%s\" can not extend itself.', $name));\n }\n $directChildren[$parentName] = $name;\n } else {\n $topMostBundles[$name] = $bundle;\n }\n }\n\n // look for orphans\n if (!empty($directChildren) && count($diff = array_values(array_diff(array_keys($directChildren), array_keys($this->bundles))))) {\n throw new \\LogicException(sprintf('Bundle \"%s\" extends bundle \"%s\", which is not registered.', $directChildren[$diff[0]], $diff[0]));\n }\n\n // inheritance\n $this->bundleMap = [];\n foreach ($topMostBundles as $name => $bundle) {\n $bundleMap = [$bundle];\n $hierarchy = [$name];\n\n while (isset($directChildren[$name])) {\n $name = $directChildren[$name];\n array_unshift($bundleMap, $this->bundles[$name]);\n $hierarchy[] = $name;\n }\n\n foreach ($hierarchy as $bundle) {\n $this->bundleMap[$bundle] = $bundleMap;\n array_pop($bundleMap);\n }\n }\n }",
"private function _load_doctrine()\n {\n require_once __DIR__ . '/libraries/Doctrine.php';\n\n $doctrine = new Doctrine;\n $this->em = $doctrine->em;\n }",
"private function initializeBundles(): array\n {\n // as this method is not called when the container is loaded from the cache.\n $kernel = $this->getApplication()->getKernel();\n $container = $this->getContainerBuilder($kernel);\n $bundles = $kernel->getBundles();\n foreach ($bundles as $bundle) {\n if ($extension = $bundle->getContainerExtension()) {\n $container->registerExtension($extension);\n }\n }\n\n foreach ($bundles as $bundle) {\n $bundle->build($container);\n }\n\n return $bundles;\n }",
"protected function initializeBundles()\n {\n // init bundles\n $this->bundles = array();\n\n /**\n * @var BundleInterface $bundle\n */\n foreach ($this->registerBundles() as $bundle) {\n $name = $bundle->getName();\n\n $this->bundles[$name] = $bundle;\n $this->bundleMap[$name] = array($bundle);\n }\n\n foreach ($this->bundles as $name => $bundle) {\n while ($parentNames = $bundle->getParent()) {\n if (!is_array($parentNames)) {\n $parentNames = array($parentNames);\n }\n $throwUnknownParentException = false;\n foreach ($parentNames as $parentName) {\n if (!array_key_exists($parentName, $this->bundles)) {\n $throwUnknownParentException = true;\n continue;\n }\n $bundle = $this->bundles[$parentName];\n\n array_push($this->bundleMap[$name], $bundle);\n $throwUnknownParentException = false;\n break;\n }\n\n if ($throwUnknownParentException) {\n throw new \\InvalidArgumentException(sprintf(\n 'Bundle \"%s\" declared his parent as one of \"%s\", which is unknown',\n $name,\n implode(', ', $parentNames)\n ));\n }\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Comment wall page setup | function commentwall_pagesetup()
{
} | [
"function comment() {\n\t\tif(!$this->isLogged())\n\t\t\theader('Location: '.URL.'/member/login');\n\t\t\t\n\t\t$sess = $this->mapSession();\n\t\t$post\t= $this->mapPost();\n\t\t\n\t\t$res = $this->comment_model->comment($post->post_id, $post->content, $_SESSION);\n\t\t\n\t\tif($res) {\n\t\t\techo '<script>location.replace(\"'.URL.'/timeline/read/'.$post->post_id.'\");</script>';\n\t\t}\n\t\telse {\n\t\t\techo 'fail';\n\t\t}\n\t}",
"function comments()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\t$data['list'] = $this->_forum->comments($data['d']);\n\t\t$this->load->view('forums/comments', $data);\n\t}",
"function kapee_template_page_comments() {\n\t\tget_template_part( 'template-parts/page/comments');\n\t}",
"public function addCommentToThePhotoAndRelatedWallpostAction()\n\t{\n\t\t$param = $this->getRequest()->getParams();\n\t\t\n\t\t$photo_id = $param['photo_id'] ;\n\t\t$photo_posted_by_user_id = $param['album_posted_by'];\n\t\t$comment = $param['comment'] ;\n\t\t\n\t\t$is_wallpost_exist = \\Extended\\wall_post::checkWallpostByPhotoNUser($photo_id , $photo_posted_by_user_id);\n\t\tif($is_wallpost_exist){\n\t\t\t$wall_post_id = $is_wallpost_exist ;\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$photo_obj = \\Extended\\socialise_photo::getRowObject($photo_id);\n\t\t\tif( $photo_obj )\n\t\t\t{\t\n\t\t\t\t$photo_visibility_criteria = $photo_obj->getVisibility_criteria();\n\t\t\t\t\t\n\t\t\t\t// if photo visibiilty criteria is custom then wallpost visibility creteria change into visibility creteria me only\n\t\t\t\tswitch ($photo_visibility_criteria) {\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\t$photo_visibility_criteria = \\Extended\\wall_post::VISIBILITY_CRITERIA_ME_ONLY ;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$to_user_id = $photo_obj->getSocialise_photosPosted_by()->getId();\n\t\t\t\t$from_user_id = $photo_obj->getSocialise_photosPosted_by()->getId();\n\t\t\t\t$post_update_type = \\Extended\\wall_post::POST_UPDATE_TYPE_PHOTO;\n\t\t\t\t$post_type = \\Extended\\wall_post::POST_TYPE_AUTO;\n\t\t\t\t$wall_type = \\Extended\\wall_post::WALL_TYPE_SOCIALISE;\n\t\t\t\t$album_id = $photo_obj->getSocialise_photosSocialise_album()->getId();\n\t\t\t\t\n\t\t\t\t$wall_post_id = \\Extended\\wall_post::post_photo(\"\", $photo_visibility_criteria, $to_user_id, $from_user_id,$photo_posted_by_user_id, $post_update_type, $post_type, $wall_type, $photo_id, $album_id);\n\t\t\t\t//Zend_Debug::dump($wall_post_id);die;$wall_text, $visibility_criteria, $to_user, $from_user, $original_user, $post_update_type, $post_type, $wall_type, $photo_id, $album_id \n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo Zend_Json::encode(2);\n\t\t\t\tdie;\n\t\t\t}\t\n\t\t}\n\t\tif($wall_post_id)\n\t\t{\n\t\t\t//getting the wall post object.\n \t\t$wall_post_obj = \\Extended\\wall_post::getRowObject( $wall_post_id );\n \t\tif( $wall_post_obj )\n \t\t{\n\t \t\t//Making a entry to like table for wallpost.\n\t \t\t$filterObj = Zend_Registry::get('Zend_Filter_StripTags');\n\t \t\t$comm_text = nl2br($filterObj->filter($this->getRequest()->getParam( 'comment' ) ));\n\t \t\t$comment_on_wallpost_id = \\Extended\\comments::addComment( $comm_text, Auth_UserAdapter::getIdentity()->getId(), NULL, $wall_post_obj->getId() );\n\t \t\t$comment_on_photo_id = \\Extended\\comments::addComment( $comm_text, Auth_UserAdapter::getIdentity()->getId(), $comment_on_wallpost_id, NULL, $wall_post_obj->getWall_postsSocialise_photo()->getId() );\n\t \t\t$comments_obj = \\Extended\\comments::getRowObject( $comment_on_wallpost_id );\n\t \t\t\n\t \t\t//setting like count for wall post.\n\t \t\t$comment_count = \\Extended\\wall_post::commentCountIncreament( $wall_post_obj->getId() );\n\t \n\t \t\t//setting like count for photo\n\t \t\t\\Extended\\socialise_photo::commentCountIncreament( $wall_post_obj->getWall_postsSocialise_photo()->getId() );\n\t \n\t \t\t$ret_r = array();\n\t \t\t$ret_r['comm_id'] = $comment_on_wallpost_id;\n\t \t\t$ret_r['wall_comm_id'] = $comment_on_photo_id;\n\t \t\t$ret_r['comm_text'] = $comm_text;\n\t \t\t$ret_r['commenter_id'] = Auth_UserAdapter::getIdentity()->getId();\n\t \t\t$ret_r['commenter_fname'] = Auth_UserAdapter::getIdentity()->getFirstname();\n\t \t\t$ret_r['commenter_lname'] = Auth_UserAdapter::getIdentity()->getLastname();\n\t \t\t$ret_r['commenter_small_image'] = Helper_common::getUserProfessionalPhoto(Auth_UserAdapter::getIdentity()->getId(), 3);\n\t \t\t$ret_r['comment_count'] = $comment_count;\n\t \t\t$ret_r['wp_id'] = $wall_post_obj->getId();\n\t \t\t$ret_r['created_at'] = Helper_common::nicetime( $comments_obj->getCreated_at()->format( \"Y-m-d H:i:s\" ));\n\t \t\techo Zend_Json::encode($ret_r);\n \t\t}\n \t\telse\n \t\t{\n \t\t\techo Zend_Json::encode(2);\n \t\t\tdie;\n \t\t}\t\n\t\t}\n\t\telse \n\t\t{\n\t\t\techo Zend_Json::encode(0);\n\t\t}\n\t\tdie;\n\t}",
"public static function el_display_comment_template(){\n\t\t\t\n\t\t// If comments are open or we have at least one comment, load up the comment template.\n\t\tif ( comments_open() || get_comments_number() ){\n\t\t\t//display post navigation \n\t\t\techo '<div class=\"el-row animation-container\">';\n\t\t\t\techo '<div class=\"el-col-small-12 el-col-medium-8 el-col-medium-offset-2\">';\n\t\t\t\t\tcomments_template();\n\t\t\t\techo '</div>';\n\t\t\techo '</div>';\n\t\t\t\n\t\t}\n\n\t}",
"function comments_template() {\n\tglobal $bj,$entries,$entry,$comments,$comment;\r\n\tif(is_entry()) {\n\t\tforeach ($entries as $entry) {\n\t\t\t$comments = get_comments('postid='.get_entry_ID());\n\t\t\tif(file_exists(BJPATH . 'content/skins/' . current_skinname() . '/comments.php'))\r\n\t\t\t\tinclude(BJPATH . 'content/skins/' . current_skinname() . '/comments.php');\n\t\t}\n\t}\n}",
"private function extend_comments() {\n foreach ( $this->comments as &$comment ) {\n $cid = $comment->comment_ID;\n\n // Get author link\n $comment->author_link = get_comment_author_link( $cid );\n\n // Set comment classes\n $classes = $this->comment_has_parent( $comment ) ? 'reply ' . $this->comment_class : $this->comment_class;\n\n switch ( $comment->comment_approved ) {\n case 1:\n $classes .= ' comment-approved';\n break;\n case 0:\n $classes .= ' comment-hold';\n break;\n case 'spam':\n $classes .= ' comment-spam';\n break;\n }\n\n global $comment_depth;\n\n $comment_depth = $this->get_comment_depth( $cid );\n\n $comment->comment_class = comment_class( $classes, $cid, $this->comment_post_id, false );\n\n // Load a reply link\n if ( $this->reply ) {\n $this->reply_args['depth'] = $comment_depth;\n $comment->reply_link = \\get_comment_reply_link( $this->reply_args, $cid );\n\n if ( ! empty( $comment->reply_link ) ) {\n $comment->reply = true;\n }\n else {\n $comment->reply = false;\n }\n }\n\n // Set an avatar\n if ( ! empty( $this->avatar_args ) ) {\n extract( $this->avatar_args );\n $id_or_email = isset( $id_or_email ) ? $id_or_email : null;\n $size = isset( $size ) ? $size : null;\n $default = isset( $default ) ? $default : null;\n $alt = isset( $alt ) ? $alt : null;\n $comment->avatar = get_avatar( $id_or_email, $size, $default, $alt );\n }\n else {\n $comment->avatar = false;\n }\n\n // Load a custom profile picture\n $pic = apply_filters( 'dustpress/comments/profile_picture', $comment );\n if ( is_string( $pic ) ) {\n $comment->profile_pic = $pic;\n }\n else {\n $comment->profile_pic = false;\n }\n\n // Filter comment\n $comment = apply_filters( 'dustpress/comments/comment', $comment );\n }\n // Sort replies\n if ( $this->threaded ) {\n $this->comments = $this->threadify_comments( $this->comments );\n }\n }",
"public function getCommentsForWallpostAction()\n {\n $params = $this->getRequest()->getParams();\n //Get users blocked and users who have blocked logged in user.\n\t$blocked_user = \\Extended\\blocked_users::getAllBlockersAndBlockedUsers(Auth_UserAdapter::getIdentity()->getId());\n\t\n\techo Zend_Json::encode( \\Extended\\comments::getCommentsForWallpost( \\Auth_UserAdapter::getIdentity()->getId(), $params['wallpost_id'], $params['offset'], 10, $blocked_user ) );\n\t\n\n\tdie;\n }",
"public static function comment_form() {\n\t\tload_template( dirname( __FILE__ ) . '/webmention-comment-form-template.php' );\n\t}",
"function act_entry_comments()\n\t{\n\t\tUtils::check_request_method( array( 'GET', 'HEAD', 'POST' ) );\n\n\t\tif ( isset( $this->handler_vars['slug'] ) ) {\n\t\t\t$this->act_comments( array( 'slug' => $this->handler_vars['slug'] ) );\n\t\t}\n\t\telse {\n\t\t\t$this->act_comments( array( 'id' => $this->handler_vars['id'] ) );\n\t\t}\n\t}",
"function wp_dashboard_recent_comments_control() {}",
"function zakra_post_comments() {\r\n\t\tif ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) {\r\n\t\t\techo '<span class=\"comments-link\">';\r\n\t\t\tcomments_popup_link(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\twp_kses(\r\n\t\t\t\t\t/* translators: %s: post title */\r\n\t\t\t\t\t\t__( 'No Comments<span class=\"screen-reader-text\"> on %s</span>', 'zakra' ),\r\n\t\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\t'span' => array(\r\n\t\t\t\t\t\t\t\t'class' => array(),\r\n\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t),\r\n\t\t\t\t\tget_the_title()\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\techo '</span>';\r\n\t\t}\r\n\r\n\t}",
"function beans_comments_template() {\n\n\tglobal $post;\n\n\tif ( !post_type_supports( beans_get( 'post_type', $post ), 'comments' ) )\n\t\treturn;\n\n\tcomments_template();\n\n}",
"function beans_comment_links() {\n\n\tglobal $comment;\n\n\techo beans_open_markup( 'beans_comment_links', 'ul', array( 'class' => 'tm-comment-links uk-subnav uk-subnav-line' ) );\n\n\t\t// Reply.\n\t\techo get_comment_reply_link( array_merge( $comment->args, array(\n\t\t\t'add_below' => 'comment-content',\n\t\t\t'depth' => $comment->depth,\n\t\t\t'max_depth' => $comment->args['max_depth'],\n\t\t\t'before' => beans_open_markup( 'beans_comment_item[_reply]', 'li' ),\n\t\t\t'after' => beans_close_markup( 'beans_comment_item[_reply]', 'li' )\n\t\t) ) );\n\n\t\t// Edit.\n\t\tif ( current_user_can( 'moderate_comments' ) ) :\n\n\t\t\techo beans_open_markup( 'beans_comment_item[_edit]', 'li' );\n\n\t\t\t\techo beans_open_markup( 'beans_comment_item_link[_edit]', 'a', array(\n\t\t\t\t\t'href' => esc_url( get_edit_comment_link( $comment->comment_ID ) )\n\t\t\t\t) );\n\n\t\t\t\t\techo beans_output( 'beans_comment_edit_text', __( 'Edit', 'tm-beans' ) );\n\n\t\t\t\techo beans_close_markup( 'beans_comment_item_link[_edit]', 'a' );\n\n\t\t\techo beans_close_markup( 'beans_comment_item[_edit]', 'li' );\n\n\t\tendif;\n\n\t\t// Link.\n\t\techo beans_open_markup( 'beans_comment_item[_link}', 'li' );\n\n\t\t\techo beans_open_markup( 'beans_comment_item_link[_link]', 'a', array(\n\t\t\t\t'href' => esc_url( get_comment_link( $comment->comment_ID ) )\n\t\t\t) );\n\n\t\t\t\techo beans_output( 'beans_comment_link_text', __( 'Link', 'tm-beans' ) );\n\n\t\t\techo beans_close_markup( 'beans_comment_item_link[_link]', 'a' );\n\n\t\techo beans_close_markup( 'beans_comment_item[_link]', 'li' );\n\n\techo beans_close_markup( 'beans_comment_links', 'ul' );\n\n}",
"public function create() {\n $id = $this->sqlData[\"id\"]; //ID of comment\n $videoId = $this->getVideoId(); //Retreve id of which tutorial has related comment\n $postedBy = $this->sqlData[\"postedBy\"]; // Who posted the comment\n $body = $this->sqlData[\"body\"]; //Retreive text of comment\n $profileButton = ButtonProvider::createUserProfileButton($this->con, $postedBy); //Profile Image picture link\n $timespan = $this->time_elapsed_string($this->sqlData[\"datePosted\"]); // retrieve Time \n\n $commentControlsObj = new CommentControls($this->con, $this, $this->userLoggedInObj);\n $commentControls = $commentControlsObj->create();\n\n $numResponses = $this->getNumberOfReplies();\n \n if($numResponses > 0) {\n $viewRepliesText = \"<span class='repliesSection viewReplies' onclick='getReplies($id, this, $videoId)'>\n View all $numResponses replies</span>\";\n }\n else {\n $viewRepliesText = \"<div class='repliesSection'></div>\";\n }\n\n //Comments HTML\n return \"<div class='itemContainer'>\n <div class='comment'>\n $profileButton\n <div class='mainContainer'>\n <div class='commentHeader'>\n <a href='profile.php?username=$postedBy'>\n <span class='username'>$postedBy</span>\n </a>\n <span class='timestamp'>$timespan</span>\n </div>\n <div class='body'>\n $body\n </div>\n </div>\n </div>\n $commentControls\n $viewRepliesText \n </div>\";\n }",
"function get_comments_link($post = 0)\n {\n }",
"public function display_wall_posts()\n {\n \n }",
"function kcl5_preprocess_comment_wrapper(&$vars) {\n if ($vars['content'] && $vars['node']->type != 'forum') {\n $vars['content'] = '<h2 class=\"comments\">'. t('Comments') .'</h2>'. $vars['content'];\n }\n}",
"public function display_comments()\n\t{\n\t\tif ( $this->config('comments_template') )\n\t\t\trequire_once( $this->config('comments_template') );\n\t\telse require_once('template.php');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method used to get the associated customer and customer contact from a given set of support emails. This is especially useful to automatically associate an issue to the appropriate customer contact that sent a support email. | function getCustomerInfoFromEmails($sup_ids)
{
} | [
"function getContactEmailAssocList($customer_id)\n {\n }",
"private function fetchContactOrLead() {\n\t\t/* @var $message MailMessage */\n\t\t$queries = array();\n\t\t\n\t\t// Loop through each mail item and construct a DQL query to match a Contact with\n\t\t// the message sender. First test for an email address. If none found, build the\n\t\t// query around the sender name. Then create another query for a Lead.\n\t\tforeach ( $this->mailStore as $messageNum => $message ) {\n\t\t\t$dql = '';\n\t\t\t$from = $message->from;\n\t\t\t$found1 = preg_match( '/<(.*)>/', $from, $matches );\n\t\t\tif ($found1) {\n\t\t\t\t$address = strtolower( $matches[1] );\n\t\t\t\t$dql = \"select o from Application\\Model\\Contact o where (lower(o.email1) = '\" .\n\t\t\t\t\t $address .\n\t\t\t\t\t \"' or lower(o.email2) = '\" .\n\t\t\t\t\t $address .\n\t\t\t\t\t \"')\";\n\t\t\t} else {\n\t\t\t\t$found2 = preg_match( '/^(.*?)</', strtolower( $from ), $matches );\n\t\t\t\tif ($found2) {\n\t\t\t\t\t$words = preg_split( '/\\s/', trim( $matches[1] ) );\n\t\t\t\t\t$criteria = '';\n\t\t\t\t\tforeach ( $words as $word ) {\n\t\t\t\t\t\t$criteria .= \" and lower(o.displayName) like '%\" . trim( $word ) . \"%'\";\n\t\t\t\t\t}\n\t\t\t\t\t$criteria = substr( $criteria, 5 );\n\t\t\t\t\t$dql = \"select o from Application\\Model\\Contact o where (\" . $criteria . \")\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ($found1 || $found2) {\n\t\t\t\t$queries[$messageNum] = array(\n\t\t\t\t\t'contactDql' => $dql,\n\t\t\t\t\t'leadDql' => preg_replace( '/Contact/', 'Lead', $dql )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Fetch the contact or lead\n\t\t$em = $this->getEntityManager();\n\t\tforeach ( $queries as $messageNum => $query ) {\n\t\t\t$entity = null;\n\t\t\t\n\t\t\t// First search for a matching lead\n\t\t\t$q = $em->createQuery( $query['leadDql'] );\n\t\t\t$recordSet = $q->getResult();\n\t\t\tif (count( $recordSet )) {\n\t\t\t\t$this->entities[$messageNum] = $recordSet[0];\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t// If no lead is found, search for a contact\n\t\t\t$q = $em->createQuery( $query['contactDql'] );\n\t\t\t$recordSet = $q->getResult();\n\t\t\tif (count( $recordSet )) {\n\t\t\t\t$this->entities[$messageNum] = $recordSet[0];\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (count( $this->entities )) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function getContactByEmail($email);",
"public function getContacts()\n {\n $l_sql = 'SELECT *, isys_catg_mail_addresses_list__title AS isys_cats_person_list__mail_address\n\t\t\tFROM isys_cats_person_nagios_list\n\t\t\tINNER JOIN isys_cats_person_list ON isys_cats_person_list__isys_obj__id = isys_cats_person_nagios_list__isys_obj__id\n\t\t\tINNER JOIN isys_obj ON isys_obj__id = isys_cats_person_list__isys_obj__id\n\t\t\tLEFT JOIN isys_catg_mail_addresses_list ON (isys_obj__id = isys_catg_mail_addresses_list__isys_obj__id AND isys_catg_mail_addresses_list__primary = 1)\n\t\t\tWHERE isys_obj__status = ' . $this->convert_sql_int(C__RECORD_STATUS__NORMAL) . ';';\n\n return $this->retrieve($l_sql . ';');\n }",
"public function getCiviContactByEmail($email) {\n\n return $this->getCiviContact('email', $email);\n }",
"public function getContactEmails() {\n return $this->contactEmails; // Return as an object\n }",
"function getContactsWithEmails(){\n\t\t\t$sql = 'select firstname, lastname, stname1, city, state, zip, yob, email, phone, bio\n\t\t\t\t\tfrom voters where email <> \"\"';\n\t\t\t$list = $this -> db -> get_results($sql, 'ARRAY_A');\n\t\t\treturn $list;\n\n\t\t}",
"public function getSuppliersContacts()\n {\n return $this->suppliers_contacts;\n }",
"public function findContactByEmail($email)\n {\n $contact = $this->infusionSoftHelper->getContact($email);\n return $contact;\n }",
"public function getAccountContactEmails();",
"function get_contacts()\n\t{\n\t\t// First, get the list of IDs.\n\t\t$query = \"SELECT c.id, c.first_name, c.last_name, c.title, c.email1, c.phone_work, o_c.contact_role as opportunity_role, o_c.id as opportunity_rel_id \".\n\t\t\t\t \"from $this->rel_contact_table o_c, contacts c \".\n\t\t\t\t \"where o_c.opportunity_id = '$this->id' and o_c.deleted=0 and c.id = o_c.contact_id AND c.deleted=0 order by c.last_name\";\n\n\t $temp = Array('id', 'first_name', 'last_name', 'title', 'email1', 'phone_work', 'opportunity_role', 'opportunity_rel_id');\n\t\treturn $this->build_related_list2($query, new Contact(), $temp);\n\t}",
"public function fetchEmailContacts()\n {\n $insertedEmails = [];\n $jwtClientResponse = $this->clientJwtService->fetchClientJwt();\n $jwtClient = $jwtClientResponse->getContent();\n\n $this->client = HttpClient::create([\n 'headers' => [\n 'Content-Type' => 'text/plain',\n 'Authorization' => $jwtClient\n ]\n ]);\n\n $refreshToken = $this->refreshTokenRepository->findOneBy(['localUserId' => $this->getUser()->getId()], ['id' => 'DESC']);\n\n if ($refreshToken === null) {\n throw new UnauthorizedHttpException('No RefreshToken available');\n }\n\n // Fetch the email contacts at Xmail\n $data = [\n 'email' => $this->parameterBag->get('spam4all_email'),\n 'password' => $this->parameterBag->get('spam4all_password'),\n 'username' => $this->parameterBag->get('spam4all_username'),\n 'secret' => $this->parameterBag->get('spam4all_secret'),\n 'refreshToken' => $refreshToken->getRefreshToken()\n ];\n $response = $this->client->request(\n 'POST',\n 'http://host.docker.internal:8620/client-fetch-email-contacts',\n [\n 'body' => json_encode($data)\n ]\n );\n\n $emailContacts = $response->getContent();\n $emailContacts = json_decode($emailContacts, true);\n\n $user = $this->userRepository->find($this->getUser()->getId());\n\n // Process the email contacts from 3th party to user account here\n foreach ($emailContacts as $emailContact) {\n $contactEmailAddress = new ContactEmailAddress();\n $contactEmailAddress->setUser($user);\n $contactEmailAddress->setEmail($emailContact);\n\n $contactEmailAddressInserted = $this->contactEmailAddressRepository->save($contactEmailAddress);\n\n if ($contactEmailAddressInserted) {\n $insertedEmails[] = $contactEmailAddress;\n }\n }\n\n return $this->render('oauth/result.fetch.contact.email.addresses.url.html.twig', [\n 'insertedEmails' => $insertedEmails\n ]);\n }",
"function getContactsFromEmail($email) {\n $result = civicrm_api3('Contact', 'get', [\n 'email' => $email,\n 'return' => ['id', $this->commsMap['opt_in']],\n ]);\n if (empty($result['values'])) {\n return [];\n }\n return $result['values'];\n }",
"public function contact_get_list($ews,$intail_name, $final_name){\n\t\t$request = new EWSType_FindItemType();\n\t\t\n\t\t$request->ItemShape = new EWSType_ItemResponseShapeType();\n\t\t$request->ItemShape->BaseShape = EWSType_DefaultShapeNamesType::ALL_PROPERTIES;\n\t\t\n\t\t$request->ContactsView = new EWSType_ContactsViewType();\n\t\t$request->ContactsView->InitialName = $intail_name;\n\t\t$request->ContactsView->FinalName = $final_name;\n\t\t\n\t\t$request->ParentFolderIds = new EWSType_NonEmptyArrayOfBaseFolderIdsType();\n\t\t$request->ParentFolderIds->DistinguishedFolderId = new EWSType_DistinguishedFolderIdType();\n\t\t$request->ParentFolderIds->DistinguishedFolderId->Id = EWSType_DistinguishedFolderIdNameType::CONTACTS;\n\t\t\n\t\t$request->Traversal = EWSType_ItemQueryTraversalType::SHALLOW;\n\t\t\n\t\t$response = $ews->FindItem($request);\n\t\t\n\t\t// Add Contacts to array if contact(s) were found\n\t\tif ($response->ResponseMessages->FindItemResponseMessage->RootFolder->TotalItemsInView > 0){\n\t\t $contact_data = $response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->Contact;\t\n\t\t}\n\t\telse{\n\t\t\tif(empty($contact_data)){\n\t\t\t\t$contact_data = \"No Contacts Found\"; \t\n\t\t\t}\n\t\t}\n\t\treturn $contact_data;\n\t\t//return $contact_data; //remember to use the php function urlencode on the id and changekey else it will not work when sent to other EWS functions\n\t }",
"public function getContacts(){\n\t\n\t\t$db\t\t= $this->getDbo();\n\t\t\n\t\t$query\t= $db->getQuery( true );\n\t\t$query->select( '*' );\n\t\t$query->from( '#__zbrochure_providers_contacts as c' );\n\t\t$query->join( 'LEFT','#__zbrochure_providers as p on p.provider_id = c.provider_id' );\n\t\t\n\t\t$db->setQuery( $query );\n\t\t$contacts = $db->loadObjectList();\n\t\t\n\t\treturn $contacts;\n\t}",
"function getUserContacts()\n\t{ \n\t\t// refresh tokens if needed \n\t\t$this->refreshToken(); \n\n\t\tif( ! isset( $this->config['contacts_param'] ) ){\n\t\t\t$this->config['contacts_param'] = array( \"max-results\" => 500 );\n\t\t}\n\n\t\t$response = $this->api->api( \"https://www.google.com/m8/feeds/contacts/default/full?\" \n\t\t\t\t\t\t\t. http_build_query( array_merge( array('alt' => 'json'), $this->config['contacts_param'] ) ) ); \n\n\t\tif( ! $response ){\n\t\t\treturn ARRAY();\n\t\t}\n \n\t\t$contacts = ARRAY(); \n\n\t\tforeach( $response->feed->entry as $idx => $entry ){\n\t\t\t$uc = new Hybrid_User_Contact();\n\n\t\t\t$uc->email = isset($entry->{'gd$email'}[0]->address) ? (string) $entry->{'gd$email'}[0]->address : ''; \n\t\t\t$uc->displayName = isset($entry->title->{'$t'}) ? (string) $entry->title->{'$t'} : ''; \n\t\t\t$uc->identifier = $uc->email;\n\n\t\t\t$contacts[] = $uc;\n\t\t} \n\n\t\treturn $contacts;\n \t}",
"public function getAllEmailContacts() {\n\t\t$this->db->select('*, contacts.id as contact_id')\n\t\t\t\t->from($this->table)\n\t\t\t\t->join('categories','categories.id = contacts.category_id','left')\n\t\t\t\t->order_by('category_id');\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}",
"private function findRegularCustomer()\n {\n $this->validateCmsCustomer();\n\n if (!empty($this->cmsCustomer->id) && !$this->cmsCustomer->is_guest) {\n $customer = $this->api->customersGet($this->cmsCustomer->id);\n\n if ($customer && $customer->isSuccessful() && $customer->offsetExists('customer')) {\n return $customer['customer'];\n }\n }\n\n if (!empty($this->cmsCustomer->email)) {\n $customers = $this->api->customersList(['email' => $this->cmsCustomer->email]);\n\n if ($customers\n && $customers->isSuccessful()\n && $customers->offsetExists('customers')\n && !empty($customers['customers'])\n ) {\n $customer = reset($customers['customers']);\n\n if ($customer['email'] === $this->cmsCustomer->email) {\n return RetailcrmTools::filter(\n 'RetailcrmFilterFindCustomerByEmail',\n $customer,\n [\n 'cmsCustomer' => $this->cmsCustomer,\n ]\n );\n }\n }\n }\n\n return [];\n }",
"public function GetSupportContacts($options = array()){\n if($this->support){\n return $this->support->GetContacts($options);\n }\n return false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get_object_tags method to get tags on webit_id | function get_object_tags($webit_id) {
$sql = " SELECT w.webit_id, w.story, t.tag FROM dfm_webits w, dfm_webit_tags wt, dfm_tags t ";
$sql = $sql . " where w.webit_id = wt.webit_id and wt.tag_id = t.tag_id ";
$sql = $sql . " and w.webit_id = " . $webit_id ;
$taglist = array();
$result = $this->_con->query($sql);
if ($result) {
while($row = $result->fetch_row()) {
$taglist[] = $row[2];
}
}
return $taglist;
} | [
"public function getOwnTags($object)\n {\n return self::getTags($this->getValueId(), $object);\n }",
"public function getTags($obj)\n {\n\n $tag = DB_DataObject::factory('tag');\n $tag->whereAdd('strip in (\"'.implode('\",\"',$this->getTagsArray($obj)).'\")');\n $tag->find();\n return self::returnStatus($tag);\n }",
"public function getTags();",
"function tc_get_the_tags() {\r\n return the_tags();\r\n}",
"function findTags( $id )\r\n\t{\r\n\t\tif( is_numeric( $id )) {\r\n\t\t\t$tags = array( eZTagsObject::fetch( $id ));\r\n\t\t} else {\r\n\t\t\t$tags = eZTagsObject::fetchByKeyword($id);\r\n\t\t}\r\n\t\treturn $tags;\r\n\t}",
"public function list_tags()\n {\n return $this->fetch_results('/api/s/' . $this->site . '/rest/tag');\n }",
"function get_tags($idpost) {\r\n $CI =& get_instance();\r\n $CI->load->model('tag_model', 'tags');\r\n return $CI->tags->get_by_idpost($idpost);\r\n }",
"function article_tag($id){\n\tglobal $article_model;\n\t$tags = null;\n\t\n\t$tags = $article_model->get_article_tags($id);\n\t\n\techo $tags;\n}",
"public static function getTags($value_id, $object)\n {\n $model_name = method_exists($object, \"getModelClass\") ? $object->getModelClass() : get_class($object);\n\n $table = new Application_Model_Db_Table_Tag();\n $select = $table->select(Zend_Db_Table::SELECT_WITH_FROM_PART);\n $select\n ->setIntegrityCheck(false)\n ->join('application_tagoption', 'application_tagoption.tag_id = application_tag.tag_id')\n ->where('application_tagoption.value_id = ?', $value_id)\n ->where('application_tagoption.model = ?', $model_name);\n\n // If the object has no id then retrieve all the tags associated with Objects of the same type belonging to the feature\n $zend_validate_int = new Zend_Validate_Int();\n if ($zend_validate_int->isValid($object->getId())) {\n $select->where('application_tagoption.object_id = ?', $object->getId());\n }\n\n $rows = $table->fetchAll($select);\n return $rows;\n }",
"function get_tags(){\n global $DB;\n\n $collection = $DB->get_record('tag_coll',['name' => PLUGINNAME]);\n if (!$collection->id) {\n throw new moodle_exception('pluginname', 'local_tematica');\n }\n $tags = $DB->get_records('tag', ['tagcollid' => $collection->id]);\n return $tags;\n}",
"function TestCase_get_tags($case_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCase.get_tags', array(new xmlrpcval($case_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"function getTags($talentID)\r\n\t{\r\n\t\t$db = Database::getInstance ();\r\n\t\t$mysqli = $db->getConnection ();\r\n\t\t$tagArray = array();\r\n\t\t$sql_query = \"select * from talent_has_tag where talent_talentid = \".$talentID;\r\n\t\t$result = $mysqli->query ( $sql_query );\r\n\t\twhile ( $row = $result->fetch_object () ) {\r\n\t\t\t$sql_query2 = \"select * from tag where tagid = \" . $row->tag_tagid;\r\n\t\t\t$result2 = $mysqli->query ( $sql_query2 );\r\n\t\t\t\r\n\t\t\twhile ( $row2 = $result2->fetch_object () ) {\r\n\t\t\tarray_push ( $tagArray, $row2->tagnaam);\r\n\t\t\t}\t\t\t\r\n\t\t}\t\r\n\t\t\r\n\t\t// return an array with tags\r\n\t\treturn $tagArray;\r\n\t}",
"public function TagOfId($id);",
"function getTags($photo_id){\n\n\t\t/* Fetch user info from Flickr */\n\t\t$tags = $this->askFlickr('tags.getListPhoto','user_id='.$this->user.'&photo_id='.$photo_id);\n\n\t\t/* Return Tags */\n\t\treturn $tags;\n\t}",
"public function get_ogp_tags($post_id)\n\t{\n\t\t$post = get_post($post_id);\n\t\t$the_query = new WP_Query($args);\n\t\t$html = '';\n\t\twhile ($the_query->have_posts()) :\n\t\t\t$the_query->the_post();\n\t\t\t$html = $this->define_ogp_objects();\n\t\tendwhile;\n\t\twp_reset_postdata();\n\t\treturn $html;\n\t}",
"function related_tags($tag_name_or_id, $limitnum=10) {\n\n $tag_id = tag_id_from_string($tag_name_or_id);\n\n //gets the manually added related tags\n $manual_related_tags = get_item_tags('tag',$tag_id);\n if ($manual_related_tags == false) $manual_related_tags = array();\n\n //gets the correlated tags\n $automatic_related_tags = correlated_tags($tag_id);\n if ($automatic_related_tags == false) $automatic_related_tags = array();\n\n $related_tags = array_merge($manual_related_tags,$automatic_related_tags);\n\n return array_slice( object_array_unique($related_tags) , 0 , $limitnum );\n\n\n}",
"public function getTagIds();",
"public function findTag($id);",
"public function getTags() {\n\t\t\t$returnTags = array();\n\t\t\t$tagIds = array();\n\n\t\t\t$items = $this->getItems();\n\t\t\tforeach ($items as $item) {\n\t\t\t\t$tags = $item->getTags();\n\t\t\t\tforeach ($tags as $tag) {\n\t\t\t\t\tif (!in_array($tag->getID(), $tagIds)) {\n\t\t\t\t\t\t$tagIds[] = $tag->getID();\n\t\t\t\t\t\t$returnTags[] = $tag;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $returnTags;\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle the delivery "restored" event. | public function restored(Delivery $delivery)
{
//
} | [
"function post_restoreItem() {\n }",
"public function handleAfterRestoreOrderEvent(Event $e)\n {\n $subOrders = SubOrder::find()->commerceOrderId($e->sender->id)->trashed()->all();\n if( empty($subOrders) ) return;\n\n Craft::$app->getElements()->restoreElements($subOrders);\n }",
"public function restored(RequestOrder $requestOrder)\n {\n //\n }",
"protected function afterRestore() {}",
"public function action_restore_events() {\n\t\t\tif ( ! isset( $_GET['action'] ) || 'tribe-restore' !== $_GET['action'] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$event = get_post( absint( $_GET['post'] ) );\n\n\t\t\tif ( ! $event instanceof WP_Post ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( Tribe__Events__Main::POSTTYPE !== $event->post_type ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( self::$ignored_status !== $event->post_status ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! function_exists( 'wp_get_referer' ) ) {\n\t\t\t\tif ( ! empty( $_SERVER['REQUEST_URI'] ) ) {\n\t\t\t\t\t$sendback = $_SERVER['REQUEST_URI'];\n\t\t\t\t} elseif ( ! empty( $_REQUEST['_wp_http_referer'] ) ) {\n\t\t\t\t\t$sendback = $_REQUEST['_wp_http_referer'];\n\t\t\t\t} elseif ( ! empty( $_SERVER['HTTP_REFERER'] ) ) {\n\t\t\t\t\t$sendback = $_SERVER['HTTP_REFERER'];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$sendback = wp_get_referer();\n\t\t\t}\n\n\t\t\t$sendback = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'locked', 'ids' ), $sendback );\n\n\t\t\tif ( isset( $_REQUEST['ids'] ) ) {\n\t\t\t\t$post_ids = explode( ',', $_REQUEST['ids'] );\n\t\t\t} elseif ( ! empty( $_REQUEST['post'] ) ) {\n\t\t\t\t$post_ids = array_map( 'intval', (array) $_REQUEST['post'] );\n\t\t\t}\n\n\t\t\t$restored = 0;\n\t\t\tforeach ( (array) $post_ids as $post_id ) {\n\t\t\t\tif ( ! current_user_can( 'delete_post', $post_id ) ) {\n\t\t\t\t\twp_die( esc_html__( 'You do not have permission to restore this post.', 'the-events-calendar' ) );\n\t\t\t\t}\n\n\t\t\t\tif ( ! $this->restore_event( $post_id ) ) {\n\t\t\t\t\twp_die( esc_html__( 'Error restoring from Ignored Events.', 'the-events-calendar' ) );\n\t\t\t\t}\n\n\t\t\t\t$restored++;\n\t\t\t}\n\t\t\t$sendback = add_query_arg( 'restored', $restored, $sendback );\n\n\t\t\twp_redirect( $sendback );\n\t\t\texit;\n\t\t}",
"public function onCartRestored(){\n\n }",
"public function restored(SalesReceipt $salesReceipt)\n {\n //\n }",
"protected function beforeRestore() {}",
"public function restored(Event $event)\n {\n //\n }",
"public function restored(Exchange $exchange)\n {\n //\n }",
"public function restored(Order $order)\n {\n //\n }",
"public function restored(Installment $installment)\n {\n //\n }",
"public function restored ( Message $message )\n {\n //\n }",
"public function restored(PurchaseRequest $purchaseRequest)\n {\n //\n }",
"public function restored(Purchase $purchase)\n {\n //\n }",
"public function restored(EventA $eventA)\n {\n //\n }",
"public function restore()\r\n {\r\n $handlerFunctionName = 'restore_'.$this->handlerType.'_handler';\r\n $handlerFunctionName();\r\n }",
"public function restored(Purchase $purchase)\n {\n //\n }",
"public function restored(OrderDetail $orderDetail)\n {\n //\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the validation mapping files for the format and extends them with files matching a doctrine search pattern (Resources/config/validation.orm.xml). | private function updateValidatorMappingFiles(ContainerBuilder $container, string $mapping, string $extension): void
{
if (!$container->hasParameter('validator.mapping.loader.'.$mapping.'_files_loader.mapping_files')) {
return;
}
$files = $container->getParameter('validator.mapping.loader.'.$mapping.'_files_loader.mapping_files');
$validationPath = '/config/validation.'.$this->managerType.'.'.$extension;
foreach ($container->getParameter('kernel.bundles_metadata') as $bundle) {
if ($container->fileExists($file = $bundle['path'].'/Resources'.$validationPath) || $container->fileExists($file = $bundle['path'].$validationPath)) {
$files[] = $file;
}
}
$container->setParameter('validator.mapping.loader.'.$mapping.'_files_loader.mapping_files', $files);
} | [
"protected function checkExtbaseMappings(): void\n {\n $configurationManager = $this->objectManager->get(ConfigurationManagerInterface::class);\n $configuration = $configurationManager->getConfiguration(\n ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK\n );\n\n $mappings = [\n 'Pixelant\\PxaProductManager\\Domain\\Model\\Image' => 'sys_file_reference',\n 'Pixelant\\PxaProductManager\\Domain\\Model\\AttributeFile' => 'sys_file_reference',\n 'Pixelant\\PxaProductManager\\Domain\\Model\\Category' => 'sys_category',\n ];\n\n foreach ($mappings as $class => $mapping) {\n if (empty($configuration['persistence']['classes'][$class]['mapping']['tableName'])) {\n $configuration['persistence']['classes'][$class]['mapping']['tableName'] = $mapping;\n $configurationManager->setConfiguration($configuration);\n }\n }\n\n $configuration = $configurationManager->getConfiguration(\n ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK\n );\n }",
"private function loadConstraints(){\n \n if($currentConstraintFolder = opendir(HF_VENDOR_DIR.\"/symfony/validator/Constraints\")){\n while (false !== ($constraintFile = readdir($currentConstraintFolder))) {\n if(pathinfo($constraintFile, PATHINFO_EXTENSION) === 'php'){ \n AnnotationRegistry::registerFile(HF_VENDOR_DIR.\"/symfony/validator/Constraints/\".$constraintFile);\n }\n }\n closedir($currentConstraintFolder);\n }\n }",
"public function findSchemaFiles() {\n $return = [];\n $directory = new RecursiveDirectoryIterator('modules');\n $flattened = new RecursiveIteratorIterator($directory);\n $files = new RegexIterator($flattened, '/schema.xml$/');\n\n foreach ($files as $file) {\n $relative_path = str_replace(DRUPAL_ROOT . '/', '', $file->getRealPath());\n $return[$relative_path] = $relative_path;\n }\n return $return;\n }",
"private function loadMappings(): void {\n\t\tif (!empty($this->mimetypes)) {\n\t\t\treturn;\n\t\t}\n\n\t\t$mimetypeMapping = json_decode(file_get_contents($this->defaultConfigDir . '/mimetypemapping.dist.json'), true);\n\t\t$mimetypeMapping = $this->loadCustomDefinitions(self::CUSTOM_MIMETYPEMAPPING, $mimetypeMapping);\n\n\t\t$this->registerTypeArray($mimetypeMapping);\n\t}",
"public function retriveDoctrineSchemas()\n {\n $schemas = array(sfConfig::get('sf_config_dir').'/doctrine');\n $dir = sfConfig::get('sf_plugins_dir');\n $ignores = array('.channels','.registry');\n $finder = sfFinder::type('directory')->maxdepth(0)->sort_by_name()->ignore_version_control()->discard($ignores)->prune($ignores) ;\n foreach ($finder->in($dir) as $path)\n {\n if (is_file($path.'/config/doctrine/schema.yml'))\n {\n $schemas[] = $path.'/config/doctrine' ;\n }\n }\n return $schemas;\n }",
"public function loadFromConfigurationFile()\n {\n $configuration = $this->loader->load();\n $validators = [];\n\n foreach ($configuration[\"validators\"] as $validator) {\n if (array_key_exists($validator, $configuration)) {\n $validators[] = new $validator(getcwd(), $configuration[$validator]);\n } else {\n $validators[] = new $validator(getcwd());\n }\n }\n\n return $validators;\n }",
"public function loadSchemas() \n\t{\n\t\t$bundles = array_diff(scandir('bundle'), array('.', '..'));\n\t\t\n\t\tif (!empty($bundles)) {\n\t\t\tforeach($bundles as $bundle_name) {\n\t\t\t\t$file_path = 'bundle/'.$bundle_name.'/schema.yml';\n\t\t\t\t\n\t\t\t\tif (file_exists($file_path)) {\n\t\t\t\t\t$file_content = file_get_contents($file_path);\n\t\t\t\t\t$this->app_schema[$bundle_name] = Yaml::parse($file_content)->toArray();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"protected function loadValidators()\n\t{\n\t\t$this->_validators = [];\n\t\tforeach ($this->rules() as $options) {\n\t\t\t$validatorClass = array_shift($options);\n\t\t\t$properties = array_shift($options);\n\t\t\tif (isset(self::$validatorAliases[$validatorClass])) {\n\t\t\t\t// redefine $validatorClass, because an alias was used\n\t\t\t\t$validatorClass = self::$validatorAliases[$validatorClass];\n\t\t\t}\n\t\t\t$validator = new $validatorClass;\n\t\t\t// configure the validator\n\t\t\tforeach ($options as $option => $value) {\n\t\t\t\t$validator->$option = $value;\n\t\t\t}\n\t\t\t$validator->model = $this;\n\t\t\t$validator->properties = $properties;\n\t\t\t$this->_validators[] = $validator;\n\t\t}\n\t}",
"private function readMappings()\n {\n $path = base_path(config('app.webling_field_mappings_config_path'));\n \n if (!file_exists($path)) {\n throw new WeblingFieldMappingConfigException('The Webling field mappings config file was not found.');\n }\n \n try {\n $mappings = Yaml::parseFile($path);\n } catch (ParseException $e) {\n throw new WeblingFieldMappingConfigException(\"YAML parse error: {$e->getMessage()}\");\n }\n \n \n if (empty($mappings['mappings'])) {\n throw new WeblingFieldMappingConfigException('The entry point (\"mappings\") was not found or empty.');\n }\n \n return $mappings['mappings'];\n }",
"static public function getSchemaFilePaths(){\n \n $schema_files = \\Altumo\\Utils\\Finder::type('file')\n ->name( '*schema.xml' )\n ->in( __DIR__ . '/../../../../config/', __DIR__ . '/../../config/' );\n \n \n return $schema_files;\n }",
"public function getMappingSources();",
"private function loadSchemaClassMap(Finder $finder)\n {\n $classMap = [];\n foreach ($finder as $file) {\n $schema = json_decode(file_get_contents($file), true);\n\n if (!isset($schema['x-documentClass'])) {\n continue;\n }\n\n foreach ($schema['required'] as $field) {\n $classMap[$schema['x-documentClass']][$field]['required'] = true;\n }\n foreach ($schema['searchable'] as $field) {\n $classMap[$schema['x-documentClass']][$field]['searchable'] = 1;\n }\n foreach ($schema['readOnlyFields'] as $field) {\n $classMap[$schema['x-documentClass']][$field]['readOnly'] = true;\n }\n\n // flags from fields\n if (is_array($schema['properties'])) {\n foreach ($schema['properties'] as $fieldName => $field) {\n if (isset($field['recordOriginException']) && $field['recordOriginException'] == true) {\n $classMap[$schema['x-documentClass']][$fieldName]['recordOriginException'] = true;\n }\n if (isset($field['x-restrictions'])) {\n $classMap[$schema['x-documentClass']][$fieldName]['restrictions'] = $field['x-restrictions'];\n } else {\n $classMap[$schema['x-documentClass']][$fieldName]['restrictions'] = [];\n }\n }\n }\n\n if (isset($schema['solr']) && is_array($schema['solr']) && !empty($schema['solr'])) {\n $classMap[$schema['x-documentClass']]['_base']['solr'] = $schema['solr'];\n } else {\n $classMap[$schema['x-documentClass']]['_base']['solr'] = [];\n }\n }\n\n return $classMap;\n }",
"private function loadValidationClassMap(Finder $finder)\n {\n $classMap = [];\n foreach ($finder as $file) {\n $document = new \\DOMDocument();\n $document->load($file);\n\n $xpath = new \\DOMXPath($document);\n $xpath->registerNamespace('constraint', 'http://symfony.com/schema/dic/constraint-mapping');\n\n $classMap = array_reduce(\n iterator_to_array($xpath->query('//constraint:class')),\n function (array $classMap, \\DOMElement $element) {\n $classMap[$element->getAttribute('name')] = $element;\n return $classMap;\n },\n $classMap\n );\n }\n\n return $classMap;\n }",
"function file_get_validators() {\n static $validators = array();\n if (empty($validators)) {\n foreach (module_implements('file_validate') as $module) {\n $validators[$module .'_file_validate'] = array();\n }\n $validators = is_array($validators) ? $validators : array();\n }\n return $validators;\n}",
"public function loadSchema()\n {\n if (is_null($this->_schema_folder)) throw new \\Exception($this->__('No schema folder has been defined'));\n\n $this->_working_schema = [];\n if (false !== ($handle = opendir($this->_schema_folder))) {\n while (false !== ($file = readdir($handle))) {\n if (substr($file, 0, 1) !== \".\" && substr($file, strlen($file) - 1) !== \"~\") {\n $this->_working_schema = array_merge($this->_working_schema, Config::get(substr($file, 0, strrpos($file, \".\")), $this->_schema_folder));\n }\n }\n closedir($handle);\n }\n\n if ($this->_parseSchema()) {\n //basic check is ok, lets parse each table\n foreach($this->_working_schema as $table_name => $definitions) {\n $tableDefinition = new TableDefinition($table_name, $definitions);\n $this->_table_definitions[] = $tableDefinition;\n }\n }\n\n return $this;\n }",
"private function loadMappers() {\n $this->mappers = array();\n\n $contentFacade = ContentFacade::getInstance();\n\n $types = $contentFacade->getTypes();\n foreach ($types as $type) {\n $mapper = $contentFacade->getMapper($type);\n if ($mapper instanceof SearchableContentMapper) {\n $this->mappers[$type] = $mapper;\n }\n }\n }",
"public static function getAvailableValidators()\n{\n\t// Iteratate over directory to find files\n\t$validators = array();\n\t$iterator = new \\FilesystemIterator(__DIR__ . DIRECTORY_SEPARATOR . 'Standard', \\FilesystemIterator::KEY_AS_FILENAME);\n\tforeach ($iterator as $filename => $finfo)\n\t{\n\t\tif (preg_match('/^\\w+\\.php$/', $filename)\n\t\t\t&& $finfo->isFile())\n\t\t{\n\t\t\t$validators[] = strtolower($finfo->getBasename('.php'));\n\t\t}\n\t}\n\n\t// Return validators\n\treturn $validators;\n}",
"public function loadValidatorFormConfigs() {\n WFCoreService::getInstance()->loadFormConfigs(\n WFModule::WF_WFC_MODULE_NAME,\n __DIR__.'/../../../form/quiz/quizz.json',\n true,\n 'quiz-quizz');\n }",
"public function getXsdValidationBasePath()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the number of rows matching criteria, joining the related MemberRelatedByCopilotId table | public static function doCountJoinMemberRelatedByCopilotId(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// We need to set the primary table name, since in the case that there are no WHERE columns
// it will be impossible for the BasePeer::createSelectSql() method to determine which
// tables go into the FROM clause.
$criteria->setPrimaryTableName(MissionLegPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
MissionLegPeer::addSelectColumns($criteria);
}
$criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
if ($con === null) {
$con = Propel::getConnection(MissionLegPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria->addJoin(array(MissionLegPeer::COPILOT_ID,), array(MemberPeer::ID,), $join_behavior);
foreach (sfMixer::getCallables('BaseMissionLegPeer:doCount:doCount') as $callable)
{
call_user_func($callable, 'BaseMissionLegPeer', $criteria, $con);
}
$stmt = BasePeer::doCount($criteria, $con);
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$count = (int) $row[0];
} else {
$count = 0; // no rows returned; we infer that means 0 matches.
}
$stmt->closeCursor();
return $count;
} | [
"public function getJoinCount() {\n return $this->getCountByKey('nr','membership');\n }",
"public function getJoinedCandidatesCount() {\n $HierarchyIdList = join(\",\",$this->hierarchy());\n\n $query = \"WITH P AS\n (\n SELECT \tCP.job_id,\n COUNT(DISTINCT CP.candidate_id) AS joined_count\n FROM \tneo_job.candidate_placement AS CP\n WHERE \tCP.date_of_join IS NOT NULL\n GROUP BY \tCP.job_id\n )\n SELECT COALESCE(SUM(P.joined_count),0) AS joined_count\n FROM neo_job.jobs AS J\n LEFT JOIN P ON P.job_id=J.id\n WHERE J.job_status_id=2\n AND J.created_by IN (\".$HierarchyIdList.\") \";\n $result = $this->db->query($query)->row()->joined_count;\n return $result;\n }",
"public function count()\n {\n \treturn count($this->_criteria);\n }",
"public function countJoin(): int;",
"public function count(array $criteria): int;",
"public function count($criteria = []);",
"public static function doCountJoinMemberRelatedByBackupCopilotId(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)\n\t{\n\t\t// we're going to modify criteria, so copy it first\n\t\t$criteria = clone $criteria;\n\n\t\t// We need to set the primary table name, since in the case that there are no WHERE columns\n\t\t// it will be impossible for the BasePeer::createSelectSql() method to determine which\n\t\t// tables go into the FROM clause.\n\t\t$criteria->setPrimaryTableName(MissionLegPeer::TABLE_NAME);\n\n\t\tif ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {\n\t\t\t$criteria->setDistinct();\n\t\t}\n\n\t\tif (!$criteria->hasSelectClause()) {\n\t\t\tMissionLegPeer::addSelectColumns($criteria);\n\t\t}\n\n\t\t$criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count\n\n\t\t// Set the correct dbName\n\t\t$criteria->setDbName(self::DATABASE_NAME);\n\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(MissionLegPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\n\t\t$criteria->addJoin(array(MissionLegPeer::BACKUP_COPILOT_ID,), array(MemberPeer::ID,), $join_behavior);\n\n\n foreach (sfMixer::getCallables('BaseMissionLegPeer:doCount:doCount') as $callable)\n {\n call_user_func($callable, 'BaseMissionLegPeer', $criteria, $con);\n }\n\n\n\t\t$stmt = BasePeer::doCount($criteria, $con);\n\n\t\tif ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$count = (int) $row[0];\n\t\t} else {\n\t\t\t$count = 0; // no rows returned; we infer that means 0 matches.\n\t\t}\n\t\t$stmt->closeCursor();\n\t\treturn $count;\n\t}",
"public function countBy($criteria);",
"public function countMembers()\n\t{\n\t\t#init\t\t\n\t\t$stats\t\t= $this->cache->getCache('ibEco_stats');\n\t\t$ecoPoints \t= $this->settings['eco_general_pts_field'];\n\t\t$ptsDB\t\t= ( $ecoPoints == 'eco_points' ) ? 'pc' : 'm';\t\t\t\t\t\t\t\t\t\t\n\t\t\n\t\t#get count\n\t\t$max\t= $this->DB->buildAndFetch( array(\n\t\t\t\t\t\t\t\t\t\t\t\t'select'\t=> 'COUNT( m.member_id ) as memCount',\n\t\t\t\t\t\t\t\t\t\t\t\t'from'\t\t=> array( 'members' => 'm' ),\n\t\t\t\t\t\t\t\t\t\t\t\t'where' \t=> $ptsDB.'.'.$ecoPoints.' > 0 OR pc.eco_worth > 0 OR pc.eco_welfare > 0',\n\t\t\t\t\t\t\t\t\t\t\t\t'add_join'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray( 'from'\t=> array( 'pfields_content' => 'pc' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where'\t=> 'm.member_id=pc.member_id'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t)\t\t);\t\t\t\t\t\t\t\t\t\t\n\t\treturn $max['memCount'];\n\t}",
"public function getCount($join = '', $where = '') {\r\n\t\t$parts = $this->getParts();\r\n\t\treturn $this->db->query('SELECT COUNT(*) FROM '.$parts['tables'].' '.$join.' '.$where)->fetchCell();\r\n\t}",
"function rptCountIncidents() {\r\n\r\n\t\treturn ($this->query('SELECT \r\n\t\t\t\t\t\t\t\t\tCOUNT(*) AS numberIncidents, categories.name\r\n\t\t\t\t\t\t\t FROM \r\n\t\t\t\t\t\t\t\t\tcategories\r\n\t\t\t\t\t\t\t\t\tINNER JOIN incidents ON incidents.category_id = categories.id\r\n\t\t\t\t\t\t\t GROUP BY \r\n\t\t\t\t\t\t\t\t\tcategories.name\r\n\t\t\t\t\t\t\t ORDER BY \r\n\t\t\t\t\t\t\t\t\tcategories.name ASC;'));\r\n\r\n\t}",
"function countRelated(IEntity $entity, $relName, $params);",
"function dataCount($relation, $selection, $conditions){\n if ( !is_array($conditions) ) {\n return FALSE;\n }\n \n $db = connect();\n if (!$db) {\n return FALSE;\n }\n \n\n $query = \"SELECT COUNT(DISTINCT($selection.ModuleID)) FROM $relation RIGHT JOIN (modulecategories, moduletype, modulematerialslink, parentchild)\" .\n \" ON (modulecategories.ModuleID=module.ModuleID OR moduletype.ModuleID=module.ModuleID OR modulematerialslink.ModuleID=module.ModuleID\" . \n \" OR parentchild.ChildID=module.ModuleID)\";\n\n $params = array();\n if ( !empty($conditions) ) {\n $p = parseConditions($conditions);\n if (!$p) {\n return FALSE;\n }\n\n $params = $p[\"params\"];\n $query .= \" WHERE \".implode(\" AND \", $p[\"fields\"]);\n }\n\n $stmt = $db->prepare($query);\n if (!$stmt) {\n disconnect($db);\n return FALSE;\n }\n \n $result = $stmt->execute($params); \n if (!$result) {\n disconnect($db); \n return FALSE;\n }\n \n // fetch associative array \n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n disconnect($db); \n\n //Returns the count found in the associative array \n $arrayValues = array_values($results[0]); \n return $arrayValues[0]; \n}",
"public function count(array $criteria);",
"function count_parcours_ressource ($id_ressource){\n return count(get_parcours_ressource($id_ressource,true)); //tous les parcours\n}",
"public function subpropertyJoinCountTest() {}",
"public function countProduit_cmp(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n return $this->db->getRows(array(\"return_type\"=>\"count\"));\n\t\t\t\t\t }",
"public function getBillableMemberCount();",
"public function getCount() {\n return $this->db->fetchColumn('SELECT COUNT(id) FROM plan');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get the last user id | public function getLastUserId() {
$returnValue = -1;
$query = 'SELECT MAX(`id`) AS `id`'
. 'FROM `' . config::PREFIX . 'user`';
if ($result = database::getInstance()->query($query)) {
$returnValue = $result->fetch(PDO::FETCH_COLUMN);
}
return $returnValue;
} | [
"public function getLastUserId()\n\t{\n\t\treturn $this->last_user_id;\n\t}",
"public function getUserID() {\n return $this->last_id;\n }",
"public static function getLastUserID(){\n $row = getDatabase()->queryFirstRow('SELECT `id` FROM `users` ORDER BY `id` DESC');\n return $row['id'];\n }",
"public static function getLastUserId()\n {\n $db = Db::connect();\n\n $sql = 'SELECT id FROM user ORDER BY id DESC LIMIT 1';\n\n $query = $db->prepare($sql);\n\n $query->execute();\n\n return $query->fetch(PDO::FETCH_OBJ);\n }",
"private function getMaxUserId() {\n $max_id = db_select('users', 'x')\n ->fields('x', array('uid'))\n ->orderby('uid', 'DESC')\n ->range(0, 1)\n ->execute()\n ->fetchCol();\n\n return $max_id[0];\n }",
"function findMaxUserID() {\n global $db;\n\n $dbq = $db->execute(\"select user_id from tblUsers order by user_id desc\");\n //$dbq->lastrow();\n $this->user_id = $dbq->fields['user_id'];\n $dbq->close();\n\n return $this->user_id;\n }",
"public function getLastId()\n {\n return $this->last_id;\n }",
"public function get_new_user_id() {\r\n $this->db->select_max('user_id');\r\n $u_id = $this->db->get('users');\r\n return $u_id->result();\r\n }",
"public function fetchLastId();",
"public function obtenerUltimoId(){\n $query = $this->conexion->prepare(\"SELECT max(id) as id from users\");\n $query->execute();\n $id = $query->fetch(PDO::FETCH_ASSOC);\n return $id['id'];\n }",
"public function getNextId() {\n $userLen = sizeof($this->userList['user']);\n\n $lastId = $this->userList['user'][$userLen - 1]['id'];\n\n return ($lastId + 1);\n }",
"public function get_user_id();",
"public function getCurrentId() {\n\t\treturn $this->current_user;\n\t}",
"public function assignUserID() {\n $this->addID();\n $userid = UserId::get()->last();\n if (isset($userid)) {\n $userid = $userid->id;\n } else {\n $userid = 1;\n }\n return $userid;\n }",
"public function getUserID() {\n if (!$this->isLoggedin()) {\n return -1;\n }\n return $this->user->getId();\n }",
"public function getUserUniqueIdentifier()\n\t{\n\t\t$info = $this->getUserInfo();\n\t\t//return (int) $info['id'];\n\t\treturn $info['id'];\n\t}",
"public function getMaxUserId()\n {\n $this->db->select(\"CAST(coalesce(max(user_id), '0') AS integer) as user_id\");\n $this->db->from('m_user');\n $query = $this->db->get();\n $result = $query->result_array();\n if (sizeof($result) > 0) {\n return $result[0]['user_id'];\n }\n return 0;\n }",
"public function retrouve_lastcredentialsid() {\n\t\treturn $this->retrouve_lastid ( \"id\", 'credentials' );\n\t}",
"function getLastOwnerId()\n\t{\n\t\t$id = mysql_insert_id();\t\t\t// id of last owner in database \n\t\treturn $id;\t\t\t\t\t\t\t// return \n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Print out the log when we're destructed. I'm assuming this will be at the end of the page. If not you might want to remove this destructor and manually call LoggedPDO::printLog(); | public function __destruct()
{
LoggedPDO::printLog();
} | [
"public function __destruct()\n {\n if(Debug::$redirect){\n $_SESSION[\"debug.redirect\"] = Debug::$debug;\n }\n if(defined(\"APPTIMING\") && APPTIMING == true){\n $t = microtime(true);\n Debug::debug(PHP_EOL . \"Start time: \" . APPSTARTUPTIME . PHP_EOL . \"End Time: \" . $t . PHP_EOL . \"Total Application Time: \" . ($t - APPSTARTUPTIME));\n }\n if(count(Debug::$debug) > 0) {\n echo \"<pre class='alert-info csc545-debug-pre'>\";\n $num = 0;\n foreach (Debug::$debug as $db) {\n //Output a new line with line number\n echo \"\n[debug] $num: \";\n //Output the debug object\n print_r($db);\n $num++;\n }\n echo \"</pre>\";\n }\n }",
"public function __destruct()\n {\n LogUtil::close();\n }",
"public function __destruct()\n {\n if ($this->_debug and Debug::isHtmlView() and defined('CLI') and ! CLI) {\n var_dump(Debug::getInfos());\n }\n }",
"public function __destruct()\n {\n // Close connection to syslog\n closelog();\n }",
"public function __destruct()\n {\n // Close connection to ay_log_syslog\n closelog();\n }",
"public function __destruct()\n {\n if ($this->_logWritter) {\n $this->_logWritter->close();\n }\n }",
"public function __destruct()\n {\n self::$PDO = null;\n }",
"public function __destruct()\n {\n $this->endTime = microtime(true);\n $executionTime = $this->endTime - $this->startTime;\n\n $profiler = $this->db->getProfiler();\n\n $totalTime = $profiler->getTotalElapsedSecs();\n $queryCount = $profiler->getTotalNumQueries();\n $longestTime = 0;\n $longestQuery = null;\n \n foreach ($profiler->getQueryProfiles() as $query) {\n if ($query->getElapsedSecs() > $longestTime) {\n $longestTime = $query->getElapsedSecs();\n $longestQuery = $query->getQuery();\n }\n }\n\n $out = array();\n $out[] = \"Page rendered in $executionTime seconds\";\n $out[] = 'Executed ' . $queryCount . ' queries in ' . $totalTime .\n ' seconds';\n $out[] = 'Average query length: ' . $totalTime / $queryCount .\n ' seconds';\n $out[] = 'Queries per second: ' . $queryCount / $totalTime;\n $out[] = 'Longest query length: ' . $longestTime;\n $out[] = \"Longest query: \" . $longestQuery;\n\n echo \"<!--\\n\";\n echo implode(\"\\n\", $out);\n echo \"\\n-->\\n\";\n }",
"public function __destroy(){\n\t\t$this->logger = null;\n\t}",
"function __destruct() {\n\t\tif (DEBUG > 0) {\n\t\t\tkataDebugOutput('Total Render Time (including Models) ' . (microtime(true) - $this->starttime) . ' secs');\n\t\t\tkataDebugOutput('Memory used ' . number_format(memory_get_usage(true)) . ' bytes');\n\t\t\tkataDebugOutput('Parameters ' . print_R($this->params, true));\n\t\t\tif (function_exists('xdebug_get_profiler_filename')) {\n\t\t\t\t$fn = xdebug_get_profiler_filename();\n\t\t\t\tif (false !== $fn) {\n\t\t\t\t\tkataDebugOutput('profilefile:' . $fn);\n\t\t\t\t}\n\t\t\t}\n\t\t\tkataDebugOutput('Loaded classes: ' . implode(' ', array_keys(classRegistry :: getLoadedClasses())));\n\t\t}\n\t}",
"public function __destruct()\n {\n $string = $this->_getRequestFooter();\n self::_write($string . DAHBUG_EOL);\n\n if (self::$_logFile) {\n fclose(self::$_logFile);\n }\n }",
"public function __destruct()\n {\n $this->Query = NULL;\n EasyPDO::$Instance = NULL;\n }",
"function __destruct()\n {\n if (static::$loggerMap != null) {\n foreach (static::$loggerMap as $innerLogger) {\n $innerLogger->logFlush();\n }\n }\n }",
"function __destruct() {\n if(static::$loggerMap != null){\n foreach (static::$loggerMap as $innerLogger){\n $innerLogger->logFlush();\n }\n }\n }",
"public function __destruct() {\n if (empty($this->opencontainers)) {\n return;\n }\n\n // TODO: MDL-20625 this looks dangerous and problematic because we never know\n // the order of calling of constructors ==> the transaction warning will not be included\n\n // It seems you cannot rely on $CFG, and hence the debugging function here,\n // becuase $CFG may be destroyed before this object is.\n if ($this->isdebugging) {\n echo '<div class=\"notifytiny\"><p>Some containers were left open. This suggests there is a nesting problem.</p>' .\n $this->output_log() . '</div>';\n }\n echo $this->pop_all_but_last();\n $container = array_pop($this->opencontainers);\n echo $container->closehtml;\n }",
"public function __destruct()\n {\n $config = self::getConfig();\n file_put_contents($config->tmpfile ?? sys_get_temp_dir().'/gentry', serialize($this->logged));\n }",
"function __destruct()\n\t{\n\t\tforeach( $this->logFiles as $logFile )\n\t\t{\n\t\t\tunset( $logFile );\n\t\t}\n\t}",
"public function __destruct() {\r\n $this->pagefooter();\r\n\techo $this->content;\r\n }",
"public static function clearLog() \n\t{\n\t\ttry {\n\t\t\tVCDClassFactory::getInstance('logSQL')->clearLog();\n\t\t} catch (Exception $ex) {\n\t\t\tthrow $ex;\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Count and returns the number of full pattern matches. | public function matchesCount($subject) {
return (int)preg_match_all($this, $subject);
} | [
"public function count_matched_subpatterns() {\n return count($this->index_first) - 1;//-1 to not include full match\n }",
"public function countMatches() {\n\t\treturn 0;\n\t}",
"public function countMatches($pat) {\r\n $num = preg_match_all($pat, $this->contents, $matches);\r\n //var_dump($matches); // debug patterns\r\n return $num;\r\n }",
"public function getPatternCount() : int{\n\t\treturn \\count($this->getPatternIds());\n\t}",
"function regex_count (string $pattern, string $text, int $flags = 0) : int\n{\n return (int) preg_match($pattern, $text, null, $flags);\n}",
"function regex_count(string $pattern, string $text, int $flags = 0) : int\r\n{\r\n return (int) preg_match($pattern, $text, $matches, $flags);\r\n}",
"function patternCount($genome, $pattern) {\n\t\t$count = 0;\n\t\t$genomeLength = strlen($genome);\n\t\t$patternLength = strlen($pattern);\n\t\t$probeLength = $genomeLength - $patternLength;\n\t\tfor($i=0; $i<=$probeLength; $i++) {\n\t\t\tif(substr($genome, $i, $patternLength) == $pattern) {\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\n\t\treturn $count;\n\t}",
"function w($content, $pattern){\n\t$pattern = preg_quote($pattern);\n $counter = preg_match_all(\"~\".$pattern.\"~\", $content, $out); //easy, just find all occurences of pattern given\n return $counter;\n}",
"function GetNumberOfAllMatches()\n {\n return sizeof($this->all_matches);\n }",
"private function _countdigits( ) {\n // used internally to count how many numeric chars there are\n preg_match_all( \"/[0-9]/\", $this->_str, $_matches );\n return count( $_matches[ 0 ] );\n }",
"public function count() {\n return count($this->strings);\n }",
"public function getMatchCount()\n {\n return $this->matchCount;\n }",
"public function getMatchCount() {\n return $this->_searchMatchCount;\n }",
"public function getMatchesCount(): int\n {\n return $this->db->count('sql_matches_scoretotal');\n }",
"public function getNumberOfMatches()\n {\n return $this->number_of_matches;\n }",
"public function count()\n\t{\n\t\treturn count($this->parts);\n\t}",
"private function countPlaceholders()\n\t{\n\t\treturn substr_count($this->sql, $this->delimiterPrefix);\n\t}",
"public function count(){\n $count = preg_match_all('@<loc>(.+?)<\\/loc>@', $this->getDataSitemap(), $matches);\n return $count;\n }",
"public function nbMatchLeft() {\n $total = 0; $totalEnd = 0;\n foreach($this->getGroups() as $group)\n {\n $total += count($group->getMatchs());\n foreach($group->getMatchs() as $match)\n {\n if($match->getStatus() == \"END\") $totalEnd ++;\n }\n }\n return $total - $totalEnd;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Allows for notes to be NULL to save database storage. | function checkNotes($notes){
if($notes == "Notes"){
$notes = "NULL";
}
else{
$notes = "'".$notes."'"; # SQL-friendly string.
}
return $notes;
} | [
"private function _save_notes(){\n\t\t\n\t\t\n\t\t\n\t}",
"function saveNotes($data=null) {\n\n\t\tif (!$data) $data = $_POST;\n\t\n\t\t$opt = null;\n\t\t$opt[\"notes\"] = $data[\"notes\"];\n\t\t$opt[\"where\"] = \"id='\".$this->taskId.\"'\"; \n\t\t$this->DB->update(\"task.task\",$opt);\n\n\t\t$this->index();\n\t\t\n\t}",
"public function setNotes($var)\n {\n GPBUtil::checkString($var, True);\n $this->notes = $var;\n }",
"public static function possibly_delete_survey_notes()\n {\n }",
"public function setNotes($notes);",
"public function getNotes(): ?string {\n return $this->_notes;\n }",
"static function add_notes(): void {\r\n self::add_acf_field(self::notes, [\r\n 'label' => 'Notes',\r\n 'type' => 'text',\r\n 'instructions' => 'A totally optional field for adding general notes on a volume.',\r\n 'required' => 0,\r\n 'conditional_logic' => 0,\r\n 'wrapper' => [\r\n 'width' => '',\r\n 'class' => '',\r\n 'id' => '',\r\n ],\r\n 'default_value' => '',\r\n 'placeholder' => '',\r\n 'prepend' => '',\r\n 'append' => '',\r\n 'maxlength' => '',\r\n ]);\r\n }",
"public function clearNotes()\n {\n $this->notes = array();\n }",
"function setNotes($notes)\r\n {\r\n $this->_notes = $notes;\r\n }",
"protected function setDefaultNote()\n {\n $name = $this->nameWithoutBracketsAndLocaleForm();\n\n if (Lang::has($trans = \"{$this->resource}.notes.$name\")) {\n $this->note = Lang::get($trans);\n }\n }",
"public function beforeSave()\n {\n foreach ($this->attributes as $key => &$value) {\n if (in_array($key, $this->nullable)) {\n empty($value) and $value = null;\n }\n } \n }",
"public function unsetNotes(): void\n {\n $this->notes = [];\n }",
"function phone_notes_put_note(Note $note)\n{\n\tglobal $wpdb;\n\t$table_name = $wpdb->prefix . 'phone_notes';\n\t$current_user = wp_get_current_user();\n\tdate_default_timezone_set('Europe/Amsterdam');\n\t\n\tif (is_null($note->getId()) || $note->getId() == 0)\n\t{\n\t\t//Add new item to database\n\t\treturn $wpdb->insert( $table_name, array(\n\t\t\t\t'name' => $note->getName(),\n\t\t\t\t'number' => $note->getNumber(),\n\t\t\t\t'date' => $note->getDateTime(),\n\t\t\t\t'notes' => $note->getNotes(),\n\t\t\t\t'user_id' => $current_user->ID,\n\t\t\t\t'update_timestamp' => date('Y-m-d H:i:s')\n\t\t\t\t));\n\t}\t\n\telseif ($note->getId() > 0)\n\t{\n\t\t$id = $note->getId();\n\t\t$dbnote = $wpdb->get_results($wpdb->prepare(\"SELECT id,name,number,date,notes,user_id FROM $table_name WHERE id = %d LIMIT 1\",$id));\n\t\tif (!is_null($dbnote))\n\t\t{\n\t\t\tif ($dbnote[0]->user_id == $current_user->ID || current_user_can('administrator') || current_user_can('super admin'))\n\t\t\t//Update item in database\n\t\t\t\t\treturn $wpdb->update( \n\t\t\t\t\t\t$table_name, \n\t\t\t\t\t\t\tarray( \n\t\t\t\t\t\t\t\t'name' => $note->getName(),\t\n\t\t\t\t\t\t\t\t'number' => $note->getNumber(),\t \n\t\t\t\t\t\t\t\t'date' => $note->getDateTime(),\n\t\t\t\t\t\t\t\t'notes' => $note->getNotes(),\n\t\t\t\t\t\t\t\t'update_timestamp' => date('Y-m-d H:i:s')\n\t\t\t\t\t\t\t), \n\t\t\t\t\t\t\tarray( 'ID' => $note->getId() ), \n\t\t\t\t\t\t\tarray( \n\t\t\t\t\t\t\t\t'%s',\n\t\t\t\t\t\t\t\t'%s',\n\t\t\t\t\t\t\t\t'%s',\n\t\t\t\t\t\t\t\t'%s',\n\t\t\t\t\t\t\t\t'%s'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t}\t\t\n\t}\n\treturn false;\n}",
"public function setAdditionalReviewerNotesAttribute(string|null $notes): void\n {\n if (empty($notes)) {\n return;\n }\n\n $this->_additional_reviewer_notes = $notes;\n $user = Auth::user();\n $callsign = $user ? $user->callsign : '(unknown)';\n\n $date = date('Y/m/d H:m:s');\n $this->reviewer_notes = $this->reviewer_notes . \"From $callsign on $date:\\n$notes\\n\\n\";\n }",
"public function checkNotes( )\n {\n if ( !( $this->loadState & self::LS_NOTES ) ) {\n $this->_sessie->getMapper( $this->getClass( ) )->loadNotes( $this );\n $this->setLoadState( self::LS_NOTES );\n }\n }",
"public function setNotes($var)\n {\n GPBUtil::checkString($var, True);\n $this->notes = $var;\n\n return $this;\n }",
"public function save(KnsprNote $note);",
"public function saveAll(array $notes);",
"public function clearNotes()\n {\n $this->collNotes = null; // important to set this to null since that means it is uninitialized\n $this->collNotesPartial = null;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Resolve a URI or pointer against a base | private static function resolve(string $base, string $uri) : string
{
$target = explode('#', Uri\resolve($base, $uri), 2);
return implode(array_pad($target, 2, ''), '#');
} | [
"abstract public function resolveURL();",
"function uri_resolve( $uri ) {\n global $config;\n\n $base_path = $config->router_baseuri;\n\n if(substr($base_path, strlen($base_path) -1) == '/') {\n $base_path = substr($base_path, 0, strlen($base_path) -1);\n } \n\n return $base_path . $uri;\n}",
"public function resolve($base, $module);",
"function resolve(string $uri): URI\n {\n if (strpos($uri, \"//\") === 0 || strpos($uri, \"/\") === 0) {\n return $this->resolvePath($uri);\n } else if (strpos($uri, \"#\") === 0) {\n return $this->resolveFragment($uri);\n } else {\n return $this->resolvePathRelative($uri);\n }\n }",
"private static function resolveUrl($base, $path){\n $components = parse_url($base);\n $scheme = (isset($components['scheme']) ? $components['scheme'] : 'http') . '://';\n\n if(strpos($path, 'http://') === 0 || strpos($path, 'https://')){\n return $path;\n }\n elseif(strpos($path, '//') === 0){\n return 'http:'. $path;\n }\n // it is an absolute path so prefix it with the domain\n elseif(strpos($path, '/') === 0) {\n $host = $scheme . $components['host'];\n return $host . $path;\n }\n // it must be a relative path so append it to the nearest directory component\n else {\n $host = $scheme . $components['host'];\n $dir = dirname(isset($components['path']) ? $components['path'] : '/');\n\n return $host . $dir . '/' . $path;\n\n }\n }",
"public function resolve($reference)\n {\n $reference = new IRI($reference);\n\n $scheme = null;\n $authority = null;\n $path = '';\n $query = null;\n $fragment = null;\n\n // The Transform References algorithm as specified by RFC3986\n // see: http://tools.ietf.org/html/rfc3986#section-5.2.2\n if ($reference->scheme) {\n $scheme = $reference->scheme;\n $authority = $reference->getAuthority();\n $path = self::removeDotSegments($reference->path);\n $query = $reference->query;\n } else {\n if (null !== $reference->getAuthority()) {\n $authority = $reference->getAuthority();\n $path = self::removeDotSegments($reference->path);\n $query = $reference->query;\n } else {\n if (0 === strlen($reference->path)) {\n $path = $this->path;\n if (null !== $reference->query) {\n $query = $reference->query;\n } else {\n $query = $this->query;\n }\n } else {\n if ('/' === $reference->path[0]) {\n $path = self::removeDotSegments($reference->path);\n } else {\n // T.path = merge(Base.path, R.path);\n if ((null !== $this->getAuthority()) && ('' === $this->path)) {\n $path = '/' . $reference->path;\n } else {\n if (false !== ($end = strrpos($this->path, '/'))) {\n $path = substr($this->path, 0, $end + 1);\n }\n $path .= $reference->path;\n }\n $path = self::removeDotSegments($path);\n }\n $query = $reference->query;\n }\n\n $authority = $this->getAuthority();\n }\n $scheme = $this->scheme;\n }\n\n $fragment = $reference->fragment;\n\n\n // The Component Recomposition algorithm as specified by RFC3986\n // see: http://tools.ietf.org/html/rfc3986#section-5.3\n $result = '';\n\n if ($scheme) {\n $result = $scheme . ':';\n }\n\n if (null !== $authority) {\n $result .= '//' . $authority;\n }\n\n $result .= $path;\n\n if (null !== $query) {\n $result .= '?' . $query;\n }\n\n if (null !== $fragment) {\n $result .= '#' . $fragment;\n }\n\n return new IRI($result);\n }",
"public function resolveUrls(UriInterface $base): void;",
"public static function resolver($uri) {\n\t\t$uri = preg_replace('/\\?.*$/','',$uri);\n\t\t$base = rtrim(Config::get('env', 'baseuri'),'/');\n\t\treturn trim(substr($uri,strlen($base)),'/');\n\t}",
"abstract public function resolve($source);",
"function resolve_uri($id, $parentScope)\n{\n // If there is no parent scope, there is nothing to resolve against.\n if ($parentScope === '') {\n return $id;\n }\n\n return Uri\\resolve($parentScope, $id);\n}",
"public function baseOn(Uri $base) {\n $uri = null;\n if($base->isRelativeUri()) {\n throw new UriException(\"Can't base $this against $base. Invalid base URI\");\n }\n if($this->isAbsoluteUri()) {\n $uri = clone $this;\n }\n else {\n $uri = clone $base;\n $path = $this->get('path');\n $query = $this->get('query');\n if(empty($path)) {\n if(isset($query)) {\n $uri->set('query', $query);\n }\n }\n else if(strpos($path, '/') === 0) {\n $uri->set('path', $path);\n $uri->set('query', $query);\n }\n else {\n $basePath = preg_replace('#/[^/]*$#', \"\", $uri->get('path'));\n $uri->set('path', $basePath . \"/\" . $path);\n $uri->set('query', $query);\n }\n $uri->set('fragment', $this->get('fragment'));\n }\n return $uri;\n }",
"abstract public function withUri(): string;",
"function qualify_url($url, $url_base, $base_is_full_url = false)\n{\n require_code('urls2');\n return _qualify_url($url, $url_base, $base_is_full_url);\n}",
"function uri($s, $base = null) { // see appendix B, http://www.ietf.org/rfc/rfc2396.txt\n\n if (empty($s)) return(array());\n\n if (isset($base) && $base !== '') {\n $b = uri($base);\n if (empty($b['scheme'])) return(array()); // scheme must be present in base\n } else {\n $b = array();\n }\n\n $a = array();\n\n if (preg_match('<^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?>', $s, $m)) { // using < and > expression delimiters\n\n $samescheme = empty($b['scheme']) || empty($m[2]) || ($b['scheme'] == $m[2]);\n\n //$a['m'] = $m;\n $a['scheme'] = (isset($m[2]) && $m[2] !== '') ? $m[2] : null;\n $a['authority'] = (isset($m[3]) && $m[3] !== '') ? $m[3] : null; // domain\n $a['path'] = (isset($m[5]) && $m[5] !== '') ? $m[5] : null;\n $a['query'] = (isset($m[7]) && $m[7] !== '') ? $m[7] : null;\n $a['fragment'] = (isset($m[9]) && $m[9] !== '') ? $m[9] : null;\n\n if (!empty($b['path'])) {\n $c = explode('/', $b['path']);\n array_pop($c);\n $basedirectory = join('/', $c);\n } else {\n $basedirectory = null;\n }\n\n $a['scheme'] = (isset($a['scheme']) ? $a['scheme'] : (isset($b['scheme']) ? $b['scheme'] : null));\n $a['authority'] = (isset($a['authority']) ? $a['authority'] : (isset($b['authority']) && $samescheme ? $b['authority'] : ''));\n\n if (isset($a['path'])) {\n if (isset($b['path']) && $samescheme && ($a['authority'] == $b['authority'])) $a['path'] = absolutepath($a['path'], $b['path']);\n } else {\n if (isset($b['path']) && $samescheme && $a['authority'] == $b['authority']) {\n if (empty($a['query'])) {\n $a['path'] = $b['path'];\n } else {\n $a['path'] = $basedirectory . '/';\n }\n } else {\n $a['path'] = null;\n }\n }\n\n $a['query'] = (isset($a['query']) ? $a['query'] : ((isset($b['path']) && $a['path'] == $b['path']) ? $b['query'] : null));\n $a['fragment'] = (isset($a['fragment']) ? ($a['fragment']) : null);\n $a['protocol'] = $a['scheme'];\n\n if (isset($a['authority']) && substr($a['authority'], 0, 2) == '//') {\n if (($i = strpos($a['authority'], '@'))) {\n $up = explode(':', substr($a['authority'], 2, $i - 2));\n $a['user'] = isset($up[0]) ? $up[0] : null;\n $a['password'] = isset($up[1]) ? $up[1] : null;\n $hostport = substr($a['authority'], $i + 1);\n } else {\n $hostport = substr($a['authority'], 2);\n }\n if (($i = strpos($hostport, ':'))) {\n $a['host'] = substr($hostport, 0, $i);\n $a['port'] = substr($hostport, $i + 1);\n } else {\n $a['host'] = $hostport;\n $a['port'] = null;\n }\n } else {\n $a['host'] = null;\n $a['port'] = null;\n $a['user'] = null;\n $a['password'] = null;\n }\n\n $a['full'] = (\n $a['scheme']\n . ':'\n . (isset($a['authority']) ? $a['authority'] : '')\n . $a['path']\n . (isset($a['query']) ? ('?' . $a['query']) : '')\n . (isset($a['fragment']) ? ('#' . $a['fragment']) : '')\n );\n }\n return($a);\n }",
"function parser_get_absolute_url($base_url, $relative_url) {\n require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'parser') . '/phpuri/phpuri.php';\n\n if (preg_match('#^[a-z]+://[^/]+$#', $base_url)) {\n $base_url .= '/';\n }\n\n return phpUri::parse($base_url)->join($relative_url);\n}",
"public static function resolve(PsrUri $baseUri, PsrUri $locationUri): PsrUri\n {\n if ((string) $locationUri === '') {\n return $baseUri;\n }\n\n if ($locationUri->getScheme() !== '' || $locationUri->getHost() !== '') {\n $resultUri = $locationUri->withPath(self::removeDotSegments($locationUri->getPath()));\n\n if ($locationUri->getScheme() === '') {\n $resultUri = $resultUri->withScheme($baseUri->getScheme());\n }\n\n return $resultUri;\n }\n\n $baseUri = $baseUri->withQuery($locationUri->getQuery());\n $baseUri = $baseUri->withFragment($locationUri->getFragment());\n\n if ($locationUri->getPath() !== '' && \\substr($locationUri->getPath(), 0, 1) === \"/\") {\n $baseUri = $baseUri->withPath(self::removeDotSegments($locationUri->getPath()));\n } else {\n $baseUri = $baseUri->withPath(self::mergePaths($baseUri->getPath(), $locationUri->getPath()));\n }\n\n return $baseUri;\n }",
"public function resolveUrls(UriInterface $base): void\n {\n $this->art = (string)Router::resolveUri($base, $this->art, true);\n }",
"function myUriResolver($resourceURI, $baseURI, $args = null) {\r\n\t$fileName = rtrim($baseURI, '/') . '/' . trim($resourceURI, '/');\r\n\ttry {\r\n\t\t$template = file_get_contents($fileName);\r\n\t\tif ($template) {\r\n\t\t\treturn $template;\r\n\t\t}\r\n\t\treturn '';\r\n\t} catch (Exception $e) {\r\n\t\treturn '';\r\n\t}\r\n}",
"private function uri()\n {\n $this->hexpress\n ->start($this->scheme())\n ->with(':')\n ->has($this->hierPart())\n ->maybe($this->query())\n ->maybe($this->fragment())\n ->end()\n ;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns mail server hostname. | public function get_hostname()
{
clearos_profile(__METHOD__, __LINE__);
$postfix = new Postfix();
$hostname = $postfix->get_hostname();
return $hostname;
} | [
"public function getHostname() : string\n {\n $hostname = Director::absoluteBaseURL();\n $config = SiteConfig::current_site_config();\n if ($config->AlternateHostnameForEmail) {\n $hostname = $config->AlternateHostnameForEmail;\n }\n\n return $hostname;\n }",
"public function getSmtpHost(): string\n\t{\n\t\t$encrypt = $this->get('smtp_encrypt');\n\t\t$host = $this->get('smtp_host');\n\t\t$port = $this->get('smtp_port');\n\n\t\treturn ($encrypt ? \"{$encrypt}://\" : '') . $host . ($port ? \":{$port}\" : '');\n\t}",
"public function get_server_hostname()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $hostname = new Hostname();\n\n return $hostname->get_internet_hostname();\n }",
"private function getHost(): string\n {\n return isset($_SERVER['SERVER_NAME']) && $_SERVER['SERVER_NAME'] ? $_SERVER['SERVER_NAME'] : $_SERVER['SERVER_ADDR'];\n }",
"private function _getServerHostname()\n\t{\n\t\treturn $this->server['hostname'];\n\t}",
"public static function getHostname()\n {\n return gethostname();\n }",
"public function getHostname()\n {\n return gethostname();\n }",
"public function hostname() {\n return !empty($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'];\n }",
"function ServerHostname() {\n if ($this->Hostname != \"\")\n $result = $this->Hostname;\n elseif ($this->ServerVar('SERVER_NAME') != \"\")\n $result = $this->ServerVar('SERVER_NAME');\n else\n $result = \"localhost.localdomain\";\n\n return $result;\n }",
"private function ServerHostname() {\n if (!empty($this->Hostname)) {\n $result = $this->Hostname;\n } elseif (isset($_SERVER['SERVER_NAME'])) {\n $result = $_SERVER['SERVER_NAME'];\n } else {\n $result = 'localhost.localdomain';\n }\n\n return $result;\n }",
"public static function getEmailHost():string {\n\t\t$emailHost = \\getenv('EMAIL_HOST');\n\t\tif ($emailHost === false) {\n\t\t\t$emailHost = \"127.0.0.1\";\n\t\t}\n\t\treturn $emailHost;\n\t}",
"public function getHostname()\n {\n if (is_null($this->hostname)) {\n $server = provider::access('server');\n\n if ($server->isExist('HTTP_HOST') && $server->isValid('HTTP_HOST', validate::T_PRINTABLE)) {\n $this->hostname = $server->getValue('HTTP_HOST');\n }\n\n if ($this->hostname === false) {\n $this->hostname = '';\n }\n }\n\n return $this->hostname;\n }",
"public function getSmtpHost( );",
"public function realHostName() \n {\n $server_name = '';\n\n if ($this->validateHostname($this->getHost()))\n {\n $server_name = $this->getHost();\n } else {\n $server_name = \"HOSTNAME\";\n }\n\n return $server_name;\n\n }",
"public function getHostName() {\r\n\t\tif(!empty($_SERVER['HTTP_HOST'])) {\r\n\t\t\treturn $_SERVER['HTTP_HOST'];\r\n\t\t}\r\n\t\tif(!empty($_SERVER['SERVER_NAME'])) {\r\n\t\t\treturn $_SERVER['SERVER_NAME'];\r\n\t\t}\r\n\t\treturn 'localhost';\r\n\t}",
"public function getHostname() : string\n {\n return $this->hostname;\n }",
"public function get_hostname() {\n\t\treturn $this->hostname;\n\t}",
"public static function getLocalEmailHost():string {\n\t\t$localEmailHost = \\getenv('LOCAL_EMAIL_HOST');\n\t\tif ($localEmailHost === false) {\n\t\t\t$localEmailHost = self::getEmailHost();\n\t\t}\n\t\treturn $localEmailHost;\n\t}",
"public function getMailHost(){\n return $this->smtpHost;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show the form for editing the specified environmentendpoint. | public function edit($appUid, $endpointUid, $id)
{
$environmentendpoint = EnvironmentEndpoint::findOrFail($id);
if( $environmentendpoint->endpoint->uid != $endpointUid
|| $environmentendpoint->endpoint->application->uid != $appUid
) {
return App::abort('404'); // no html view
}
return View::make('environment_endpoints.edit', compact('environmentendpoint'));
} | [
"public function editAction(\\TYPO3\\Semantic\\Domain\\Model\\Sparql\\Endpoint $endpoint) {\n\t\t$this->view->assign('endpoint', $endpoint);\n\t}",
"public function edit_form()\n {\n return View::make(\"app.edit\");\n }",
"public function edit()\n {\n $instance_id = $this->input->get('instance_id', TRUE);\n if ($this->_subdomain_check_route()) {\n return;\n }\n if ($this->_launched_check_route()) {\n return;\n }\n if ($this->_active_check_route()) {\n return;\n }\n if ($this->_paywall_check_route()) {\n return;\n }\n if ($this->_online_only_check_route()) {\n return;\n }\n if (empty($instance_id)) {\n return show_error('No instance provided to edit and/or no return url provided to return to.', 404);\n }\n $edit_obj = $this->_get_edit_obj($instance_id);\n\n if(!$edit_obj) {\n return show_error(\"Couldn't find instance for subdomain \". $this->subdomain . \" and\n instance id \" . $instance_id, 404);\n }\n\n $form = $this->_get_form();\n if ($this->_authentication_route($form, '/edit?instance_id='.$instance_id )) {\n return;\n }\n if ($this->_form_null_check_route($form)) {\n return;\n }\n\n $data = array\n (\n 'title_component'=>'webform edit', \n 'html_title'=> $form->title,\n 'form'=> $form->html,\n 'form_data'=> $form->default_instance,\n 'form_data_to_edit' => $edit_obj->instance_xml,\n 'return_url' => $edit_obj->return_url,\n 'iframe' => $this->iframe,\n 'edit' => true,\n 'offline_storage' => FALSE,\n 'logo_url' => $this->account->logo_url($this->server_url),\n 'stylesheets'=> $this->_get_stylesheets($form->theme)\n );\n\n $data['scripts'] = (ENVIRONMENT === 'production') \n ? array(array('src' => '/build/js/webform-edit-combined.min.js'))\n : array(array('src' => '/lib/bower-components/requirejs/require.js', 'data-main' => '/src/js/main-webform-edit.js'));\n\n $this->load->view('webform_view', $data);\n }",
"public function editAction() {\n\n //TAB CREATION\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')\n ->getNavigation('sitestore_admin_main', array(), 'sitestore_admin_main_viewsitestore');\n\n //GET STORE ID AND STORE OBJECT\n $store_id = $this->_getParam('id');\n $sitestore = Engine_Api::_()->getItem('sitestore_store', $store_id);\n\n //FORM GENERATION\n $this->view->form = $form = new Sitestore_Form_Admin_Manage_Edit();\n\n if (!empty($sitestore->declined)) {\n return $this->_forward('notfound', 'error', 'core');\n }\n\n $status_storeOption = array();\n $approved = $sitestore->approved;\n if (empty($sitestore->aprrove_date) && empty($approved)) {\n $status_storeOption[\"0\"] = \"Approval Pending\";\n $status_storeOption[\"1\"] = \"Approved Store\";\n $status_storeOption[\"2\"] = \"Declined Store\";\n } else {\n $status_storeOption[\"1\"] = \"Approved\";\n $status_storeOption[\"0\"] = \"Dis-Approved\";\n }\n $form->getElement(\"status_store\")->setMultiOptions($status_storeOption);\n\n if (!$this->getRequest()->isPost()) {\n\n $form->getElement(\"closed\")->setValue($sitestore->closed);\n $form->getElement(\"status_store\")->setValue($sitestore->approved);\n $form->getElement(\"featured\")->setValue($sitestore->featured);\n $form->getElement(\"sponsored\")->setValue($sitestore->sponsored);\n $title = \"<a href='\" . $this->view->url(array('store_url' => $sitestore->store_url), 'sitestore_entry_view') . \"' target='_blank'>\" . $sitestore->title . \"</a>\";\n $form->title_dummy->setDescription($title);\n if (Engine_Api::_()->sitestore()->hasPackageEnable()) {\n $form->package_title->setDescription(\"<a href='\" . $this->view->url(array('route' => 'admin_default', 'module' => 'sitestore', 'controller' => 'package', 'action' => 'packge-detail', 'id' => $sitestore->package_id), 'admin_default') . \"' class ='smoothbox'>\" . ucfirst($sitestore->getPackage()->title) . \"</a>\");\n\n $package = $sitestore->getPackage();\n if ($package->isFree()) {\n\n $form->getElement(\"status\")->setMultiOptions(array(\"free\" => \"NA (Free)\"));\n $form->getElement(\"status\")->setValue(\"free\");\n $form->getElement(\"status\")->setAttribs(array('disable' => true));\n } else {\n $form->getElement(\"status\")->setValue($sitestore->status);\n }\n }\n } elseif ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n try {\n //PROCESS\n $values = $form->getValues();\n \n if(!empty ($values) && isset ($values['toggle_products_status'])){\n if(isset ($values['toggle_products_status']) && $values['toggle_products_status'] == 2){\n Engine_Api::_()->getDbtable('stores', 'sitestore')->toggleStoreProductsStatus($store_id, 1);\n }elseif(isset ($values['toggle_products_status']) && $values['toggle_products_status'] == 3){\n Engine_Api::_()->getDbtable('stores', 'sitestore')->toggleStoreProductsStatus($store_id, 0);\n }\n }\n \n if ($values['status_store'] == 2) {\n $values['declined'] = 1;\n } else {\n $approved = $values['status_store'];\n }\n $sitestore->setFromArray($values);\n if (!empty($sitestore->declined)) {\n Engine_Api::_()->sitestore()->sendMail(\"DECLINED\", $sitestore->store_id);\n }\n $sitestore->save();\n $db->commit();\n if ($approved != $sitestore->approved) {\n\n return $this->_helper->redirector->gotoRoute(array('module' => 'sitestore', 'controller' => 'admin', 'action' => 'approved', \"id\" => $store_id), \"default\", true);\n }\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n\n return $this->_helper->redirector->gotoRoute(array('action' => 'index'));\n }\n }",
"public function edit()\n\t{\n\t\t// Check for request forgeries.\n\t\tJSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\n\n\t\t$jinput = JFactory::getApplication()->input;\n\t\t$jinput->set('view', 'attendee');\n\t\t// 'attendee' expects event id as 'event' not 'id'\n\t\t$jinput->set('event', $jinput->getInt('eventid'));\n\t\t$jinput->set('id', null);\n\t\t$jinput->set('hidemainmenu', '1');\n\n\t\tparent::display();\n\t}",
"public function actionOEmbedEdit()\n {\n\n $form = new OEmbedProviderForm;\n\n $prefix = Yii::app()->request->getParam('prefix');\n $providers = UrlOembed::getProviders();\n\n if (isset($providers[$prefix])) {\n $form->prefix = $prefix;\n $form->endpoint = $providers[$prefix];\n }\n\n // uncomment the following code to enable ajax-based validation\n if (isset($_POST['ajax']) && $_POST['ajax'] === 'oembed-edit-form') {\n echo CActiveForm::validate($form);\n Yii::app()->end();\n }\n\n if (isset($_POST['OEmbedProviderForm'])) {\n $_POST['OEmbedProviderForm'] = Yii::app()->input->stripClean($_POST['OEmbedProviderForm']);\n $form->attributes = $_POST['OEmbedProviderForm'];\n\n if ($form->validate()) {\n\n if ($prefix && isset($providers[$prefix])) {\n unset($providers[$prefix]);\n }\n $providers[$form->prefix] = $form->endpoint;\n UrlOembed::setProviders($providers);\n\n $this->redirect(Yii::app()->createUrl('//admin/setting/oembed'));\n }\n }\n\n $this->render('oembed_edit', array('model' => $form, 'prefix' => $prefix));\n }",
"public function getShowEdit(){\n\t\t$data=array(\n\t\t\t\"product_id\"=>$_GET['product_id'],\n\t\t\t\"id\"=>$_GET['id'],\n\t\t\t\"key\"=>$_GET['key'],\n\t\t\t\"value\"=>$_GET['value'],\n\t\t\t\"value_type\"=>$_GET['value_type']);\n\t\t$this->setTitle('Edit Meta Data Fields');\n\t\t$this->setContent( $this->getView('shopify/editForm',$data, dirname(__DIR__)) );\n\t}",
"function apachesolr_environment_settings_page(array $environment = array()) {\n if (empty($environment)) {\n $env_id = apachesolr_default_environment();\n $environment = apachesolr_environment_load($env_id);\n }\n $env_id = $environment['env_id'];\n\n // Initializes output with information about which environment's setting we are\n // editing, as it is otherwise not transparent to the end user.\n $output = array(\n 'apachesolr_environment' => array(\n '#theme' => 'apachesolr_settings_title',\n '#env_id' => $env_id,\n ),\n );\n $output['form'] = drupal_get_form('apachesolr_environment_edit_form', $environment);\n return $output;\n}",
"public function getEdit()\n {\n return View::make('vendors.edit', array('vendor'=>$this->vendor));\n }",
"public function get_edit_form() {\n return $this->edit_form;\n }",
"private function editForm()\n {\n $m = $this->getViewModel();\n\n $blog = $m->blog;\n\n $m->isApprover = true; // isApprover()\n\n $stylelist = BlogView::getStyleList();\n\n $id = $blog->id;\n \n \n if ($m->revid === 0) {\n $m->revid = intval($blog->revision);\n }\n\n $m->revision = BlogRevision::findFirst('blog_id='.$id.' and revision='.$m->revid);\n \n // submit choices\n $m->rev_list = [\n 'Save' => 'Save',\n 'Revision' => 'Save as new revision',\n ];\n\n $m->title = '#' . $id;\n $m->stylelist = $stylelist;\n $m->catset = BlogView::getCategorySet($id);\n $m->events = BlogView::getEvents($id);\n $m->metatags = BlogView::getMetaTags($id);\n $m->content = $m->url = $this->url;\n\n return $this->render('blog', 'edit');\n }",
"public function edit()\n {\n $jobId = Helper::getIdFromUrl('job');\n $job = JobModel::load()->get($jobId);\n\n Helper::checkIdsFromSessionAndUrl($job->user_id);\n\n View::render('jobs/edit.view', [\n 'method' => 'POST',\n 'action' => '/job/' . $jobId . '/update',\n 'job' => $job\n ]); \n }",
"public function edit() {\n\n\t\tif ($this->authenticated===false) {\n\t\t\t$this->index();\n\t\t} else {\n\n\t\t\t// Get model type and id\n\t\t\t$this->requestParser();\n\n\t\t\t// Create the helper\n\t\t\t$viewHelper = new View_Admin_Helper($this->model, $this->id);\n\n\t\t\t// Set notice to View if available\n\t\t\t$message = isset($this->message) ? $viewHelper->notice($this->message) : null;\t\t\n\n\t\t\t// Setup the editor View\n\t\t\t$this->data['view'] = $viewHelper->editView();\n\t\t}\n\t}",
"public function edit_job() {\n\t\tglobal $job_manager;\n\n\t\techo $job_manager->forms->get_form( 'edit-job' );\n\t}",
"public function editconfig()\n {\n if (!Gate::allows('Supervisor')) return redirect('/home')->with('warning', __('Somehow you the system tried to let you do something which is not allowed. So you are sent home!'));\n $models = Config::filter(Input::all())->paginate(1);\n $fields = ['id', 'url', 'index'];\n $vattr = '';\n if ($models) $vattr = (new ValidationAttributes($models[0]))->setCast('id', 'hidden')->setCast('index', 'textarea');\n\n return view('/setup/editconfig', ['models' => $models, 'fields' => $fields, 'vattr' => $vattr]);\n }",
"public function edit()\n {\n $educationId = Helper::getIdFromUrl('education');\n $education = EducationModel::load()->get($educationId);\n\n Helper::checkIdsFromSessionAndUrl($education->user_id);\n\n View::render('educations/edit.view', [\n 'method' => 'POST',\n 'action' => '/education/' . $educationId . '/update',\n 'education' => $education \n ]); \n }",
"function edit(Sandbox $sandbox){\n return view('newSandbox')->with('sandbox', $sandbox);\n }",
"public function createEditRequest()\n {\n $editRequest = new EditRequest();\n return $editRequest->setEnvironment(\n $this->em->getRepository('GovWikiDbBundle:Environment')\n ->getReferenceByName($this->environment)\n );\n }",
"public function actionEdit()\n\t{\n\t \t// render the template, pass model on render template\n \t$this->renderTemplate('weatheroots/_edit');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Moves the curl session in debug mode to display extra info. | public function set_debug_mode()
{
curl_setopt($this->ch, CURLOPT_VERBOSE, TRUE);
curl_setopt($this->ch, CURLOPT_HEADER, TRUE);
curl_setopt($this->ch, CURLOPT_NOPROGRESS, FALSE);
return $this;
} | [
"private function setDebug(&$curl)\n {\n $this->debug = [\n 'errorNum' => curl_errno($curl),\n 'error' => curl_error($curl),\n 'info' => curl_getinfo($curl),\n 'raw' => $this->contents,\n ];\n }",
"private function debug()\n\t{\n\t\t$this->response['REQUEST'] = $this->request;\n\t\tvar_dump($this->response);\n\t}",
"public function setCurlDebugging($debug = true) {\n $this->options['debug'] = $debug;\n\n $this->guzzle = $this->createGuzzleClient();\n }",
"function setDebugStatus(){\n //change the true below to false to always not show debug info\n if ( true && '59.94.209.67' == $_SERVER[ 'REMOTE_ADDR' ] ) {\n $this->debug = true;\n //echo 'Remote:59.94.208.61';\n //echo 'Join Now.';\n //echo $_SERVER[ 'REMOTE_ADDR' ];\n }\n }",
"public function test_output_capture_normal_debug_normal() {\n set_debugging(DEBUG_NORMAL);\n $this->helper_test_clean_output();\n }",
"public function enableDebug() {\n\t\t$this->consumer->enableDebug();\n\t}",
"public function test_output_capture_error_debugdeveloper() {\n set_debugging(DEBUG_DEVELOPER);\n $this->helper_test_dirty_output(true);\n }",
"public function turnOnDebug()\n {\n $this->debug = true;\n }",
"function setDebugUrl( )\n\t{\n\t\t$this->debug_url = true;\n\t}",
"public function test_output_capture_normal_debug_none() {\n set_debugging(DEBUG_NONE);\n $this->helper_test_clean_output();\n }",
"function setDebug($bool)\n {\n $this->dbug = $bool;\n $this->cfs_http->setDebug($bool);\n }",
"public function enableDebugFunctionality()\n {\n $this->debug = true;\n }",
"public function testDebugLogsDebugInfoToClientLog()\n {\n $client = $this->getClient();\n $client->debug(true);\n\n $request = $client->getMessageFactory()->createRequest();\n $response = $client->getMessageFactory()->createResponse();\n\n $request->setMethod('GET');\n $request->setUrl('http://jonnyw.kiwi/tests/test-default.php');\n\n $client->send($request, $response);\n\n $this->assertContains('[DEBUG]', $client->getLog());\n }",
"function verbose_debug_report($ch, $verbose_file = null) {\n $curl_info = curl_getinfo($ch);\n if (isset($curl_info['request_header'])) {\n // Existence of 'request_header' means output response headers were\n // requested and no verbose report is available\n // with output headers, can get request headers this way;\n echo \"<br>Request information: \" . htmlspecialchars($curl_info['request_header']);\n \n } else if ($verbose_file != NULL) {\n rewind($verbose_file);\n $verboseLog = stream_get_contents($verbose_file);\n echo \"<br>Verbose information:\\n<pre>\", htmlspecialchars($verboseLog), \"</pre>\\n\";\n }\n}",
"public function setDebugMode($debug = false)\r\n\t{\r\n\t\t$this->debug = true;\r\n\t}",
"public function logDevMode(): void\n {\n $this->log->debug('Bones is operating in dev mode');\n }",
"public function disable_debug() {\n $this->debug = $this->handler->debug = FALSE;\n }",
"public function enableDebug() {}",
"protected function debug()\n {\n if ($this->config && $this->config->getValue('debug')) {\n $this->logger->debug(var_export($this->debugData, true));\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the pattern plugin manager | public static function setPluginManager(PatternPluginManager $plugins)
{
static::$plugins = $plugins;
} | [
"public function setInstance()\n {\n foreach (array_keys($this->plugins) as $plugin) {\n $this->plugins[$plugin]->setInstance($this);\n }\n }",
"public static function setAdapterPluginManager(AdapterPluginManager $adapters)\n {\n static::$adapters = $adapters;\n }",
"public static function setPluginManager(FilterPluginManager $manager = NULL) {\n // Don't share by default to allow different arguments on subsequent calls\n if ($manager instanceof FilterPluginManager) {\n $manager->setShareByDefault(FALSE);\n }\n static::$plugins = $manager;\n }",
"public static function pluginManager() {\n return self::$_PluginManager; //self::Factory(self::AliasPluginManager);\n }",
"private function setWidgetManager()\n {\n $this->widgetManager = $this->container->get('pi_app_admin.manager.widget');\n }",
"public function setHierarchyDriverManager(\n \\VuFind\\Hierarchy\\Driver\\PluginManager $pm\n ) {\n $this->hierarchyDriverManager = $pm;\n return $this;\n }",
"public function setPluginManager(PluginManager $plugins)\n {\n $this->plugins = $plugins;\n return $this;\n }",
"function setPlugin($plugin) {\n\t\t$this->_plugin = $plugin;\n\t}",
"private function setPlugins($plugins)\n {\n foreach ($plugins as $plugin) {\n $plugin->setSettings($this);\n }\n\n $this->plugins = $plugins;\n }",
"public function setHelperPluginManager(HelperPluginManager $helpers)\n {\n if (!$helpers->has('HalLinks')) {\n $this->injectHalLinksHelper($helpers);\n }\n $this->helpers = $helpers;\n }",
"public function setPluginManager( PluginManager $pManager )\n {\n $this->objPluginManager = $pManager;\n \n return $this;\n }",
"public function setHelperPluginManager(HelperPluginManager $helpers): void\n {\n if (!$helpers->has('HalLinks')) {\n $this->injectHalLinksHelper($helpers);\n }\n $this->helpers = $helpers;\n }",
"public function setPlugins($plugins)\n {\n $this->_plugins = $plugins;\n }",
"private function _setPluginComponents(): void\n {\n $this->setComponents([\n 'api' => Api::class,\n ]);\n }",
"public function setHelperPluginManager(HelperPluginManager $helpers)\n {\n if (!$helpers->has('Hal')) {\n $this->injectHalHelper($helpers);\n }\n $this->helpers = $helpers;\n }",
"abstract public function register_plugin();",
"function _register_remote_theme_patterns()\n {\n }",
"public function setup()\n {\n $this->enablePlugins('sfDoctrinePlugin');\n $this->enablePlugins('sfDoctrineGuardPlugin');\n $this->enablePlugins('sfJqueryReloadedPlugin');\n $this->enablePlugins('caMarkdownEditorPlugin');\n $this->enablePlugins('sfPortalPlugin');\n }",
"protected function setupEngine() {\n foreach($this->getPlugins() as $plugin) {\n if($plugin instanceof EngineDependencyInterface)\n $plugin->setEngine( $this );\n if($plugin instanceof SetupPluginInterface)\n $plugin->setup();\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ check valid file for project | function validate_project_file() {
return validate_post_file($this->input->post("file_name"));
} | [
"public function isValidConfigFile($file);",
"public function IsValid($fileName);",
"protected function validate_file(){\n\t\tif( filter_var( $this->value , FILTER_VALIDATE_URL ) ){ \n\t\t\tif( strpos( $this->value, 'file://' ) !== false )\n\t\t\t\t$this->valid = true; \n\t\t} else {\n\t\t\tif( $this->log )\n\t\t\t\tbrafton_log( array( 'message' => \"Invalid file: \" . $this->value . \" . Validate file called by {$this->trace[1]['class']} :: {$this->trace[1]['function']} \" ) );\n\t\t}\n\t}",
"public function testValidFileWhenItDoesntExist()\n {\n $invalidName = __DIR__ . self::FILENAME_INVALID;\n $code = $this->productLoader->validFile($invalidName);\n\n $this->assertEquals(false, $code);\n Phake::verify($this->logger, Phake::times(1))->warning(sprintf('Invalid filename: %s', $invalidName));\n }",
"function _bandaid_validate_project($project_name = NULL) {\n if (!$project_name) {\n $project_name = getcwd();\n }\n else {\n $project_name = realpath($project_name);\n }\n $project = array(\n 'name' => basename($project_name),\n 'dir' => $project_name,\n 'version_info' => NULL,\n 'local_patch' => NULL,\n 'yaml' => NULL,\n );\n $info_file = $project['dir'] . '/' . $project['name'] . '.info';\n\n if (!file_exists($info_file)) {\n throw new BandaidError('NO_INFO_FILE');\n }\n\n try {\n $project['version_info'] = _bandaid_parse_info($info_file);\n }\n catch (BandaidError $e) {\n throw new BandaidError('COULD_NOT_PARSE_INFO', '', $e);\n }\n\n $project['local_patch_file'] = $project['dir'] . '.local.patch';\n if (file_exists($project['local_patch_file'])) {\n $project['local_patch'] = TRUE;\n }\n\n $project['yaml_file'] = $project['dir'] . '.yml';\n if (file_exists($project['yaml_file'])) {\n $project['yaml'] = Yaml::parse($project['yaml_file']);\n }\n\n return $project;\n}",
"private function validateFile()\n\t\t{\n\t\t\tif (is_readable($this->fileName))\n\t\t\t{\n\t\t\t\t$this->setContentLength();\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse return FALSE;\n\t\t}",
"public function testFileChecks() {\n\t\t$this->assertTrue($this->IpLocation->hasCountryData() === is_file($this->IpLocation->countryDataFile));\n\t\t$this->assertTrue($this->IpLocation->hasCityData() === is_file($this->IpLocation->cityDataFile));\n\t}",
"public function check() {\n\t\tif (!@include_once $this->fileName) {\n\t\t\t$this->log('File \"'.$this->fileName.'\" is required to be includeable', Project::MSG_ERR);\n\t\t\treturn 1;\n\t\t}\n\t\t\n\t\t$this->log('File \"'.$this->fileName.'\" is passed to be includeable', Project::MSG_VERBOSE);\n\t\treturn 0;\n\t}",
"function IsPageValid( $page )\n{\n\tglobal $VALID_SOURCE_FILES;\n\treturn in_array( $page, $VALID_SOURCE_FILES );\n}",
"public abstract function checkFormat($filename);",
"public function testInvalidFileIsFile()\n {\n $this->assertFalse($this->fileSystem->isFile(__DIR__));\n }",
"public function testValidFile()\n {\n $this->assertEquals($this->loader, $this->loader->addFile('.travis.yml'));\n }",
"public function isValidFile(): bool\n {\n $file = $this->sourceFile;\n\n if (!file_exists($file)) {\n throw new FileNotFoundException('File \"'. $file .'\" not found', 0, null, $file);\n }\n\n if (is_dir($file)) {\n throw new FileIOException('Passed file \"'. $file .'\" is a directory', 0, null, $file);\n }\n\n if (!is_readable($file)) {\n throw new FileIOException('File \"'. $file .'\" not readable', 0, null, $file);\n }\n\n return true;\n }",
"function config_check() {\n\tglobal $files;\n\t$errors = array();\n\n\tif ( count( $files ) == 0 ) {\n\t\t$errors[] = __( 'No file is defined in <code>files</code> array' );\n\t\treturn $errors;\n\t}\n\n\tforeach ( $files as $file_id => &$file ) {\n\t\t// error\n\t\tforeach ( array( 'display' , 'path' , 'format' ) as $mandatory ) {\n\t\t\tif ( ! isset( $file[ $mandatory ] ) ) {\n\t\t\t\t$errors[] = sprintf( __( '<code>%s</code> is mandatory for file ID <code>%s</code>' ) , $mandatory , $file_id );\n\t\t\t}\n\t\t}\n\t\t// fix\n\t\tforeach ( array(\n\t\t\t\t'max' => LOGS_MAX,\n\t\t\t\t'refresh' => LOGS_REFRESH,\n\t\t\t\t'notify' => NOTIFICATION,\n\t\t) as $fix => $value ) {\n\t\t\tif ( ! isset( $file[ $fix ] ) ) {\n\t\t\t\t$file[ $fix ] = $value;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( count($errors) == 0 ) {\n\t\treturn true;\n\t}\n\telse {\n\t\treturn $errors;\n\t}\n}",
"public function isValid():bool {\n\t\t\treturn $this->exists() && \\is_file($this->path);\n\t\t}",
"public function checkFile($path) {\n\t\tif (preg_match($this->ignore, $path) == 1){\n\t\t\treturn true;\n\t\t}\n\n\t\t$this->errors = array();\n\t\t$this->tokens = token_get_all(file_get_contents($path));\n\t\t$this->path = $path;\n\t\t$this->_checkHeader();\n\t\t$this->_checkClassDocBlock();\n\t\t$this->_checkDocBlocks();\n\n\t\tif (count($this->errors)) {\n\t\t\t$this->out(\"\\n\" . $this->path . \"\\n\" . implode(\"\\n\", $this->errors));\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public function testValidatingInvalidFile()\n {\n $reader = $this->validator->validate('app/Resources/tests/invalid.txt');\n\n $this->assertEquals($reader, null);\n $this->assertEquals($this->validator->isValid(), false);\n $this->assertEquals(\n $this->validator->getMessage(), '<error>Incorrect file. '.\n 'It should have an *.csv extension</error>'\n );\n }",
"function validate_file( $file, $allowed_files = '' ) {\r\n\tif ( false !== strpos( $file, '..' ))\r\n\t\treturn 1;\r\n\r\n\tif ( false !== strpos( $file, './' ))\r\n\t\treturn 1;\r\n\r\n\tif (':' == substr( $file, 1, 1 ))\r\n\t\treturn 2;\r\n\r\n\tif (!empty ( $allowed_files ) && (!in_array( $file, $allowed_files ) ) )\r\n\t\treturn 3;\r\n\r\n\treturn 0;\r\n}",
"private function check_file() {\n\n\t\t// Checks if JSON file exists, if not create\n\t\tif( !file_exists( $this->file ) ) {\n\t\t\t$this->commit();\n\t\t}\n\n\t\t// Read content of JSON file\n\t\t$content = file_get_contents( $this->file );\n\t\t$content = json_decode( $content );\n\n\t\t// Check if its arrays of jSON\n\t\tif( !is_array( $content ) && is_object( $content ) ) {\n\t\t\tthrow new \\Exception( 'An array of json is required: Json data enclosed with []' );\n\t\t\treturn false;\n\t\t}\n\t\t// An invalid jSON file\n\t\telseif( !is_array( $content ) && !is_object( $content ) ) {\n\t\t\tthrow new \\Exception( 'json is invalid' );\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t\treturn true;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates a new game from the database with 3 random questions First creates a random game, then picks 3 questions using ORDER BY RAND for randomness. Then links the game and the questions. | function generateNewGame($db){
$gameId = false;
try{
$statement = $db->exec('INSERT INTO `game` (`id_game`) VALUES (NULL)');
$gameId = $db->lastInsertId();
}
catch (PDOException $exception){
error_log('Request error on game insertion: '.$exception->getMessage());
return false;
}
try{
$statement = $db->query('SELECT `id_topic`,`num_question` FROM `question` WHERE `enabled` = 1 ORDER BY RAND() LIMIT 3');
// Three questions, chosen randomly
$questions = $statement->fetchAll(PDO::FETCH_ASSOC);
foreach ($questions as $key => $question) {
try {
$statement = $db->prepare("INSERT INTO `game_question` (`id_game`, `id_topic`, `num_question`) VALUES (:id_game, :id_topic, :num_question)");
if (!$statement->execute(array(':id_game'=>$gameId, ':id_topic'=>$question['id_topic'], ':num_question'=>$question['num_question']))) {
error_log("Linking between game and questions failed");
return false;
}
} catch (PDOException $exception){
error_log('Request error on game_question insertion: '.$exception->getMessage());
return false;
}
}
}
catch (PDOException $exception){
error_log('Request error on question query: '.$exception->getMessage());
return false;
}
return $gameId;
} | [
"public function getRandomQuiz() {\n\t\t$sql = \"SELECT * from {$this->_dbName}.{$this->_tableName} ORDER BY RAND()\";\n\t\treturn $this->getRecord($sql);\n\t}",
"function randomlyAddGame(){\n\t\t$myRandomNumber = rand(1,2);\n\t\tglobal $connection;\n\t\t$nextGameDate = getDayForNewGame();\n\t\t$randTeam1id = rand(1,7);\n\t\t$randTeam2id = rand(1,7);\n\t\twhile ($randTeam1id == $randTeam2id) {\n\t\t\t$randTeam2id = rand(1,7);\n\t\t}\n\t\t$randTeam1odds = rand(1,9);\n\t\t$randTeam2odds = rand(1,9);\n\t\t\n\t\t$query = \"INSERT INTO games (game_date, team_one_id, team_two_id, team_1_odds, team_2_odds)\n\t\t\t\t VALUES ('$nextGameDate', $randTeam1id, $randTeam2id, $randTeam1odds, $randTeam2odds)\";\n\t\tif(mysqli_query($connection,$query)){\n\t\t\techo(\"worked\");\n\t\t} else {\n\t\t\techo(\"didn't work\");\n\t\t}\n\t\n\t}",
"private function Get_Random_Daily_Quest()\n{\n $Item_Array = array();\n $Item_SQL = \"SELECT * FROM base_daily_quests\";\n $Random_Results = $this->Connection->Custom_Query($Item_SQL, $Item_Array, true);\n\n shuffle($Random_Results);\n\n $Results = array_pop($Random_Results);\n\n return $Results;\n}",
"public static function generateNewGame(){\r\n\t\t$users = HockUserDB::getAllUsersNotInGame();\r\n\t\tif(empty($users)) return;\r\n\t\tif(count($users) < 6){\r\n\t\t\techo \"<p>Error getting enough users not in a game... \" . $e->getMessage () . \"</p>\";\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//get random users for game\r\n\t\tshuffle($users);\r\n\t\t$user1 = array_pop($users);\r\n\t\t$user2 = array_pop($users);\r\n\t\t$user3 = array_pop($users);\r\n\t\t$user4 = array_pop($users);\r\n\t\t$user5 = array_pop($users);\r\n\t\t$user6 = array_pop($users);\r\n\t\t\r\n\t\t$users1 = array($user1, $user2, $user3);\r\n\t\t$users2 = array($user4, $user5, $user6);\r\n\t\tif(empty($users1)){\r\n\t\t\techo '<p>Error getting users1</p>';\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(empty($users2)){\r\n\t\t\techo '<p>Error getting users2</p>';\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t//calculate each team's skill\r\n\t\t$skill1 = $user1->getSkill() + $user2->getSkill() + $user3->getSkill();\r\n\t\t$skill2 = $user4->getSkill() + $user5->getSkill() + $user6->getSkill();\r\n\t\t\r\n\t\t//create new game\r\n\t\t$game = new Game();\r\n\t\t$gameparms = $game->getParameters();\r\n\t\t$gameparms['teamskill1'] = $skill1;\r\n\t\t$gameparms['teamskill2'] = $skill2;\r\n\t\t$gameparms['pending'] = 1;\r\n\t\t$gameparms['start'] = date(\"Y-m-d H:i:s\");\r\n\t\t$gameparms['type'] = 'random';\r\n\t\t$gameparms['server'] = 1;\r\n\t\t$game = new Game($gameparms);\r\n\t\t$gameid = GameDB::addGame($game);\r\n\t\t$game->setGameId($gameid);\r\n\t\t\r\n\t\t//create team1 \r\n\t\t$team1 = new Team();\r\n\t\t$parms = $team1->getParameters();\r\n\t\t$parms['uid1'] = $user1->getUserId();\r\n\t\t$parms['uid2'] = $user2->getUserId();\r\n\t\t$parms['uid3'] = $user3->getUserId();\r\n\t\t$parms['gameId'] = $game->getID();\r\n\t\t$team1 = new Team($parms);\r\n\t\t$teamid1 = TeamDB::addTeam($team1);\r\n\t\t$team1->setteamId($teamid1);\r\n\t\t\r\n\t\t//create team2\r\n\t\t$team2 = new Team();\r\n\t\t$parms = $team2->getParameters();\r\n\t\t$parms['uid1'] = $user4->getUserId();\r\n\t\t$parms['uid2'] = $user5->getUserId();\r\n\t\t$parms['uid3'] = $user6->getUserId();\r\n\t\t$parms['gameId'] = $game->getID();\r\n\t\t$team2 = new Team($parms);\r\n\t\t$teamid2 = TeamDB::addTeam($team2);\r\n\t\t$team2->setteamId($teamid2);\r\n\t\t\r\n\t\t//update game with teamid's\r\n\t\t$game->setTeamId1($team1->getteamId());\r\n\t\t$game->setTeamId2($team2->getteamId());\r\n\t\t\r\n\t\t$gameupdate = GameDB::updateGame($game);\r\n\t\t\r\n\t\t//update users to show they are in game\r\n\t\tforeach($users1 as $user){\r\n\t\t\t$user->setGameId($game->getID());\r\n\t\t\t$user->setTeamId($team1->getteamId());\r\n\t\t\tHockUserDB::updateUser($user);\r\n\t\t}\r\n\t\t\r\n\t\tforeach($users2 as $user){\r\n\t\t\t$user->setGameId($game->getID());\r\n\t\t\t$user->setTeamId($team1->getteamId());\r\n\t\t\tHockUserDB::updateUser($user);\r\n\t\t}\r\n\t\t\r\n\t\t//Game and teams created and users update... Done!\r\n\t\t\r\n\t}",
"public function getrandomquestion(){\t\t\n\t\t$question = $this->Questions->find('all') /*,['contain' => ['Questionscategories']])\t*/\n ->order('rand()')\n ->first();\n \n\t\t $this->set([\n 'question' => $question,\n '_serialize' => 'question'\n ]);\t\t\n\t}",
"public function test_quizp_with_random_question_attempt_walkthrough() {\n global $SITE;\n\n $this->resetAfterTest(true);\n question_bank::get_qtype('random')->clear_caches_before_testing();\n\n $this->setAdminUser();\n\n // Make a quizp.\n $quizpgenerator = $this->getDataGenerator()->get_plugin_generator('mod_quizp');\n\n $quizp = $quizpgenerator->create_instance(array('course' => $SITE->id, 'questionsperpage' => 2, 'grade' => 100.0,\n 'sumgrades' => 4));\n\n $questiongenerator = $this->getDataGenerator()->get_plugin_generator('core_question');\n\n // Add two questions to question category.\n $cat = $questiongenerator->create_question_category();\n $saq = $questiongenerator->create_question('shortanswer', null, array('category' => $cat->id));\n $numq = $questiongenerator->create_question('numerical', null, array('category' => $cat->id));\n\n // Add random question to the quizp.\n quizp_add_random_questions($quizp, 0, $cat->id, 1, false);\n\n // Make another category.\n $cat2 = $questiongenerator->create_question_category();\n $match = $questiongenerator->create_question('match', null, array('category' => $cat->id));\n\n quizp_add_quizp_question($match->id, $quizp, 0);\n\n $multichoicemulti = $questiongenerator->create_question('multichoice', 'two_of_four', array('category' => $cat->id));\n\n quizp_add_quizp_question($multichoicemulti->id, $quizp, 0);\n\n $multichoicesingle = $questiongenerator->create_question('multichoice', 'one_of_four', array('category' => $cat->id));\n\n quizp_add_quizp_question($multichoicesingle->id, $quizp, 0);\n\n foreach (array($saq->id => 'frog', $numq->id => '3.14') as $randomqidtoselect => $randqanswer) {\n // Make a new user to do the quizp each loop.\n $user1 = $this->getDataGenerator()->create_user();\n $this->setUser($user1);\n\n $quizpobj = quizp::create($quizp->id, $user1->id);\n\n // Start the attempt.\n $quba = question_engine::make_questions_usage_by_activity('mod_quizp', $quizpobj->get_context());\n $quba->set_preferred_behaviour($quizpobj->get_quizp()->preferredbehaviour);\n\n $timenow = time();\n $attempt = quizp_create_attempt($quizpobj, 1, false, $timenow);\n\n quizp_start_new_attempt($quizpobj, $quba, $attempt, 1, $timenow, array(1 => $randomqidtoselect));\n $this->assertEquals('1,2,0,3,4,0', $attempt->layout);\n\n quizp_attempt_save_started($quizpobj, $quba, $attempt);\n\n // Process some responses from the student.\n $attemptobj = quizp_attempt::create($attempt->id);\n $this->assertFalse($attemptobj->has_response_to_at_least_one_graded_question());\n\n $tosubmit = array();\n $selectedquestionid = $quba->get_question_attempt(1)->get_question()->id;\n $tosubmit[1] = array('answer' => $randqanswer);\n $tosubmit[2] = array(\n 'frog' => 'amphibian',\n 'cat' => 'mammal',\n 'newt' => 'amphibian');\n $tosubmit[3] = array('One' => '1', 'Two' => '0', 'Three' => '1', 'Four' => '0'); // First and third choice.\n $tosubmit[4] = array('answer' => 'One'); // The first choice.\n\n $attemptobj->process_submitted_actions($timenow, false, $tosubmit);\n\n // Finish the attempt.\n $attemptobj = quizp_attempt::create($attempt->id);\n $this->assertTrue($attemptobj->has_response_to_at_least_one_graded_question());\n $attemptobj->process_finish($timenow, false);\n\n // Re-load quizp attempt data.\n $attemptobj = quizp_attempt::create($attempt->id);\n\n // Check that results are stored as expected.\n $this->assertEquals(1, $attemptobj->get_attempt_number());\n $this->assertEquals(4, $attemptobj->get_sum_marks());\n $this->assertEquals(true, $attemptobj->is_finished());\n $this->assertEquals($timenow, $attemptobj->get_submitted_date());\n $this->assertEquals($user1->id, $attemptobj->get_userid());\n $this->assertTrue($attemptobj->has_response_to_at_least_one_graded_question());\n\n // Check quizp grades.\n $grades = quizp_get_user_grades($quizp, $user1->id);\n $grade = array_shift($grades);\n $this->assertEquals(100.0, $grade->rawgrade);\n\n // Check grade book.\n $gradebookgrades = grade_get_grades($SITE->id, 'mod', 'quizp', $quizp->id, $user1->id);\n $gradebookitem = array_shift($gradebookgrades->items);\n $gradebookgrade = array_shift($gradebookitem->grades);\n $this->assertEquals(100, $gradebookgrade->grade);\n }\n }",
"private function randomizeQuestions() {\n $this->questions = shuffle($this->questions);\n }",
"public function getRandomQuestion(){\n\n \t\t$question_asked_ids = ArrayUtils::getValues($this->answers, 'question_id');\n\n\t\t$criteria = new CDbCriteria();\n\t\t$criteria->with = array(\n\t\t\t'test' => array(\n\t\t\t\t'select' => false,\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'test.id' => $this->test_id,\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t$criteria->addNotInCondition('t.id', $question_asked_ids);\n\t\t$criteria->order = 'RAND()';\n\n\t\treturn Question::model()->find($criteria);\n\t}",
"function createRandomSelectionObject()\n\t{\n\t\t$this->getQuestionsSubTabs();\n\t\t$question_array = $this->object->randomSelectQuestions($_POST[\"nr_of_questions\"], $_POST[\"sel_qpl\"]);\n\t\t$this->tpl->addBlockFile(\"ADM_CONTENT\", \"adm_content\", \"tpl.il_as_tst_random_question_offer.html\", \"Modules/Test\");\n\t\t$color_class = array(\"tblrow1\", \"tblrow2\");\n\t\t$counter = 0;\n\t\t$questionpools =& $this->object->getAvailableQuestionpools(true);\n\t\tinclude_once \"./Modules/TestQuestionPool/classes/class.assQuestion.php\";\n\t\tforeach ($question_array as $question_id)\n\t\t{\n\t\t\t$dataset = $this->object->getQuestionDataset($question_id);\n\t\t\t$this->tpl->setCurrentBlock(\"QTab\");\n\t\t\t$this->tpl->setVariable(\"COLOR_CLASS\", $color_class[$counter % 2]);\n\t\t\t$this->tpl->setVariable(\"QUESTION_TITLE\", $dataset->title);\n\t\t\t$this->tpl->setVariable(\"QUESTION_COMMENT\", $dataset->description);\n\t\t\t$this->tpl->setVariable(\"QUESTION_TYPE\", assQuestion::_getQuestionTypeName($dataset->type_tag));\n\t\t\t$this->tpl->setVariable(\"QUESTION_AUTHOR\", $dataset->author);\n\t\t\t$this->tpl->setVariable(\"QUESTION_POOL\", $questionpools[$dataset->obj_fi][\"title\"]);\n\t\t\t$this->tpl->parseCurrentBlock();\n\t\t\t$counter++;\n\t\t}\n\t\tif (count($question_array) == 0)\n\t\t{\n\t\t\t$this->tpl->setCurrentBlock(\"Emptytable\");\n\t\t\t$this->tpl->setVariable(\"TEXT_NO_QUESTIONS_AVAILABLE\", $this->lng->txt(\"no_questions_available\"));\n\t\t\t$this->tpl->parseCurrentBlock();\n\t\t}\n\t\t\telse\n\t\t{\n\t\t\t$this->tpl->setCurrentBlock(\"Selectionbuttons\");\n\t\t\t$this->tpl->setVariable(\"BTN_YES\", $this->lng->txt(\"random_accept_sample\"));\n\t\t\t$this->tpl->setVariable(\"BTN_NO\", $this->lng->txt(\"random_another_sample\"));\n\t\t\t$this->tpl->parseCurrentBlock();\n\t\t}\n\t\t$chosen_questions = join($question_array, \",\");\n\t\t$this->tpl->setCurrentBlock(\"adm_content\");\n\t\t$this->tpl->setVariable(\"FORM_ACTION\", $this->ctrl->getFormAction($this));\n\t\t$this->tpl->setVariable(\"QUESTION_TITLE\", $this->lng->txt(\"tst_question_title\"));\n\t\t$this->tpl->setVariable(\"QUESTION_COMMENT\", $this->lng->txt(\"description\"));\n\t\t$this->tpl->setVariable(\"QUESTION_TYPE\", $this->lng->txt(\"tst_question_type\"));\n\t\t$this->tpl->setVariable(\"QUESTION_AUTHOR\", $this->lng->txt(\"author\"));\n\t\t$this->tpl->setVariable(\"QUESTION_POOL\", $this->lng->txt(\"qpl\"));\n\t\t$this->tpl->setVariable(\"VALUE_CHOSEN_QUESTIONS\", $chosen_questions);\n\t\t$this->tpl->setVariable(\"VALUE_QUESTIONPOOL_SELECTION\", $_POST[\"sel_qpl\"]);\n\t\t$this->tpl->setVariable(\"VALUE_NR_OF_QUESTIONS\", $_POST[\"nr_of_questions\"]);\n\t\t$this->tpl->setVariable(\"TEXT_QUESTION_OFFER\", $this->lng->txt(\"tst_question_offer\"));\n\t\t$this->tpl->setVariable(\"BTN_CANCEL\", $this->lng->txt(\"cancel\"));\n\t\t$this->tpl->parseCurrentBlock();\n\t}",
"public function random()\n {\n $count = Quiz::count();\n \n $quiz = null;\n \n \n\n do {\n $rid = rand(1, $count);\n $quiz = Quiz::find($rid);\n }while($quiz == null || \\Auth::user()->hasSolvedQuiz($quiz));\n \n return view('quiz.show', compact('quiz'));\n }",
"function chooseQuestions () {\n\t\tglobal $questionsToBeAsked;\n\t\t$numQuestions = $this->numQuestions;\n\t\t$allQuestions = $this->allQuestions;\n\t\t$questionsToBeAsked=array();\n\t\t$indices = array();\n\t\t$numQuestionsToBeAnswered = $this->numQuestionsToBeAnswered;\n\t\tfor ($i=0; $i<$numQuestionsToBeAnswered; $i++) {\n\t\t\t$index=rand(0, ($numQuestions-1));\n\t\t\twhile (in_array($index, $indices)) {//Don't repeat questions\n\t\t\t\t$index=rand(0, ($numQuestions-1));\n\t\t\t}\n\t\t\t$indices[$i] = $index;\n\t\t\t$questionsToBeAsked[$i]=$allQuestions[$index];\n\t\t}\n\t\t$_SESSION['questions'] = $questionsToBeAsked;\n\t}",
"public function populate() {\n\t\t$quiz = $this->quizesModel->getRandomQuiz();\n\t\t$this->id = $quiz['id'];\n\t\t$this->description = $quiz['description'];\n\t\t$questions = $this->quizQuestionsModel->getRecordsByKeys(array('quizId'=>$quiz['id']));\n\t\tif(is_array($questions)) {\n\t\t\tshuffle($questions);\n\t\t\tforeach (array_reverse($questions) as $question) {\n\t\t\t\t$answers = $this->quizAnswersModel->getRecordsByKeys(array('questionId'=>$question['id']));\n\t\t\t\tif(is_array($answers)) {\n\t\t\t\t\tshuffle($answers);\n\t\t\t\t\t$quizQuestion = new MowattMedia_Components_QuizQuestion($question['id'], ucwords($question['question']), $answers);\n\t\t\t\t\t$this->available[$question['id']] = $quizQuestion;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->totalQuestions = count($this->available);\n\t\t}\n\t}",
"function getQuestion()\n\t{\n\t\t$user=$_SESSION['user_name'];\n\t\t$con=getCon();\n \t$all_q = getQuestionNumbers();\n \t$all_given = getAllotedQuestions($user);\n\t\t\n \t$last = get_last();\n\t\t\n \tif($last[0])\n \t{\n \tgive($last[1]);\n \t}\n \telse\n \t{\n \t$rem = array_diff($all_q,$all_given);\n \tif($rem==[])\n \t{\n \theader(\"Location:last_page.php\");\n \tdie();\n \t}\n\t\t\t\n \t$rand_index = array_rand($rem);\n\t\t\t\n \t$new_quiz = $rem[$rand_index];\n\t\t\t\n \twrite_to_db($new_quiz);\n\t\t\t\n\t\tgive($new_quiz);\n \t}\n\t}",
"function generate_questions_randomly() {\n\t\t// use the get method\n\t\t$this->api->method_required(\"GET\");\n\n\t\t// posted data saved into variable\n\t\t$this->load->model(\"recsys/questions_m\");\n\t\t$rest_data = $this->api->get_rest_data();\n\t\t$info = $rest_data[\"data\"];\n\n\t\t// Get Questions base on LID, TID, SID (from smartJen server)\n\t\t$status = $this->questions_m->generate_questions_randomly_m($info);\n\n\t\t// get the session\n\t\t$sess = $this->session->userdata();\n\n\t\t// create jwt token and pass to header\n\t\tif(array_key_exists(\"user_id\", $sess)) {\n\t\t\t$user_id = $this->session->userdata('user_id');\n\t\t\t$data = array(\n\t\t\t\t// 'user_id' => $user_id\n\t\t\t\t'username' => 'klho'\n\t\t\t);\n\t\t\t$key = \"Sm@rtJen2@!9!@#\";\n\t\t\t$token = $this->jwt->encode($data, $key);\n\t\t\theader(\"Authorization: Bearer \" . $token);\n\t\t} else {\n\t\t\theader(\"HTTP/1.1 401 Unauthorized\");\n\t\t}\n\n\t\t// return api error message\n\t\tif($status === false) {\n\t\t\tapi_return(\"Something wrong while getting the data.\", 500);\n\t\t} else if(is_string($status)) {\n\t\t\tapi_return($status, 400);\n\t\t}\n\n\t\t// return api\n\t\tapi_return($status);\n\t}",
"function doNewGame(){\n $prize = rand(0, 2);\n \n $sql = \"INSERT INTO games (prize_door) VALUE ('$prize')\";\n $db = getDB();\n $db->query($sql);\n \n //Selects current database (hw7)\n $lastID = dbLastInsertID();\n $connection = mysql_connect(\"localhost\",\"root\"); \n mysql_select_db(\"hw7\", $connection); \n \n //Gets current row being edited...\n $result = mysql_query(\"SELECT * FROM games WHERE game_ID=('$lastID')\");\n $row = mysql_fetch_row($result);\n \n $data[] = array(\n 'game_id' => $row[0],\n 'opened_door' => $row[2],\n 'initial_selected' => $row[3],\n 'final_selected' => $row[4]\n );\n \n $response[] = array(\n \t'message' => \"new game created\",\n \t'data' => $data\n );\n \n returnResponse($response, 200);\n \n}",
"function random_game_array(){\n // Connect to database\n include \"connection.php\";\n\n // Run query\n try{\n $results = $db->query(\n \"SELECT id, name, platform, release_date, publishers, labels, user_rating\n FROM games\n ORDER BY RAND()\n LIMIT 4\"\n );\n } catch(Exception $e){\n echo \"Unable to retrieve results... \" . $e->getMessage() . \"\\n\";\n }\n\n // Get results\n $games = $results->fetchAll();\n\n // Close connection\n $db = null;\n\n return $games;\n}",
"function testGame()\n {\n \n dbg(\"+\".__METHOD__.\"\");\n # id, date\n $this->getNew();\n # get highest player_id\n $testPlay = new Player();\n $testPlay->get_next_id();\n $high = $testPlay->get_member_id();\n $this->member_snack = rand(1,$high);\n $this->member_host = rand(1,$high);\n $this->member_gear = rand(1,$high);\n $this->member_caller = rand(1,$high);\n// $this->game_date = rand(1,$high);\n dbg(\"=\".__METHOD__.\":high=$high:{$this->game_id}:{$this->game_date}:{$this->member_snack}:{$this->member_host}:{$this->member_gear}:{$this->member_caller}\");\n unset($testPlay);\n dbg(\"-\".__METHOD__.\"\");\n }",
"private function generateGames() {\n\t\n\t}",
"public function testShuffleQuestions()\r\n {\r\n $db = new Db();\r\n\r\n\t\t// Get list of question id's from exam entry\r\n\t\t$queryStr = \"SELECT questions FROM \" . EXAMS_TABLE . \" WHERE id = 1\";\r\n $rows = $db->select($queryStr);\r\n $rows = $rows[0]; // Get first row\r\n $firstAttemptQuestions = json_decode($rows[\"questions\"]);\r\n \r\n // Get shuffled questions\r\n $questions = generateExamQuestions($db, 1, 1);\r\n\r\n // The two question sets must be identical\r\n $this->assertCount(0, array_diff($questions, $firstAttemptQuestions));\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all of members of an access collection | function get_members_of_access_collection($collection, $idonly = FALSE) {
global $CONFIG;
$collection = (int)$collection;
if (!$idonly) {
$query = "SELECT e.* FROM {$CONFIG->dbprefix}access_collection_membership m"
. " JOIN {$CONFIG->dbprefix}entities e ON e.guid = m.user_guid"
. " WHERE m.access_collection_id = {$collection}";
$collection_members = get_data($query, "entity_row_to_elggstar");
} else {
$query = "SELECT e.guid FROM {$CONFIG->dbprefix}access_collection_membership m"
. " JOIN {$CONFIG->dbprefix}entities e ON e.guid = m.user_guid"
. " WHERE m.access_collection_id = {$collection}";
$collection_members = get_data($query);
if (!$collection_members) {
return FALSE;
}
foreach ($collection_members as $key => $val) {
$collection_members[$key] = $val->guid;
}
}
return $collection_members;
} | [
"public function getMembers();",
"public function getMembers(): Collection\n {\n return $this->members;\n }",
"public function getAllMembers();",
"public function getMembers()\r\n {\r\n }",
"public function getUsers()\n {\n return EnvironmentAccess::getCollection($this->getLink('#manage-access'), 0, [], $this->client);\n }",
"public function getMembers()\n {\n return $this->findMembersBy([], ['id' => 'asc']);\n }",
"public function getMembers()\n {\n return $this->members;\n }",
"public function members(): Collection\n {\n $key = $this->membersKey();\n if ($this->has($key)) {\n return $this->get($key);\n }\n\n $data = $this->campaign->members;\n\n $this->forever($key, $data);\n return $data;\n }",
"public function members(): array;",
"public function getMembers() {\n if(empty($this->members) || empty($this->members[0])) {\n $this->fetchMembers();\n }\n\n return $this->members;\n }",
"public function getUsers()\n {\n return EnvironmentTypeAccess::getCollection($this->getLink('#access'), 0, [], $this->client);\n }",
"function getMemberList()\n\t{\n\t}",
"public function getMembers() {\n return $this -> db -> getGroupMembers($this -> id);\n }",
"public function getAffiliatemembers();",
"public function GetAllMembers()\n {\n $dbTalker = new DbTalker();\n return $dbTalker->GetAllMembers();\n }",
"public function getAuthItems(): Collection;",
"function members_get_caps() {\n\n\treturn members_capability_registry()->get_collection();\n}",
"public function getMemberships(){\n return $this->securityDAO->getMembershipsDAO();\n }",
"public function members_load_all() {\n \n // Get members\n (new MidrubBaseAdminComponentsCollectionMembersHelpers\\Members)->members_load_all();\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
\fninit($className, $objectId, $limit, $skip) \briefInit CommentBox instance all over the website \param$className for the instance of the class that has been commented, $objectId for object that has been commented, \param $limit number of objects to retreive, $skip number of objects to skip | public function init($objectId, $className, $limit = DEFAULTQUERY, $skip = 0) {
$info = array();
$commentP = new CommentParse();
$commentP->wherePointer(strtolower($className), $className, $objectId);
$commentP->where('type', 'C');
$commentP->where('active', true);
$commentP->setLimit((!is_null($limit) && is_int($limit) && $limit >= MIN && MAX >= $limit ) ? $limit : DEFAULTQUERY);
$commentP->setSkip((!is_null($skip) && is_int($skip) && $skip >= 0) ? $skip : 0);
$commentP->whereInclude('fromUser,' . strtolower($className));
$commentP->orderByDescending('createdAt');
$comments = $commentP->getComments();
if ($comments instanceof Error) {
$this->commentArray = array();
$this->error = $comments->getErrorMessage();
return;
} elseif (is_null($comments)) {
$this->commentArray = array();
$this->error = null;
return;
} else {
foreach ($comments as $comment) {
if (!is_null($comment->getFromUser()))
array_push($info, $comment);
}
$this->commentArray = $info;
$this->error = null;
}
} | [
"public function initForMediaPage($objectId, $className, $limit = null, $skip = null) {\r $reviewArray = array();\r $this->mediaInfo = array();\r $review = new CommentParse();\r if ($className == 'Event') {\r $review->wherePointer('event', $className, $objectId);\r $review->where('type', 'RE');\r } else {\r $review->wherePointer('record', $className, $objectId);\r $review->where('type', 'RR');\r }\r $review->where('active', true);\r $review->whereInclude('fromUser');\r $review->setLimit((!is_null($limit) && is_int($limit) && $limit >= MIN && $limit <= MAX ) ? $limit : DEFAULTQUERY);\r $review->setSkip((!is_null($skip) && is_int($skip) && $skip >= 0) ? $skip : 0);\r $review->orderByDescending('createdAt');\r $reviews = $review->getComments();\r if ($reviews instanceof Error) {\r $this->errorManagement($reviews->getErrorMessage());\r return;\r } elseif (is_null($reviews)) {\r $this->errorManagement();\r return;\r } else {\r foreach ($reviews as $review) {\r if (!is_null($review->getFromUser()))\r array_push($reviewArray, $review);\r }\r }\r $this->error = null;\r $this->reviewArray = $reviewArray;\r }",
"function initForPersonalPage($objectId, $type, $className, $limit = null, $skip = null) {\r $reviewArray = array();\r $this->mediaInfo = array();\r $reviewP = new CommentParse();\r $reviewP->where('active', true);\r if ($type == 'SPOTTER' && $className == 'Event') {\r $field = 'fromUser';\r $reviewP->where('type', 'RE');\r $reviewP->whereInclude('event.fromUser');\r } elseif ($type == 'SPOTTER' && $className == 'Record') {\r $field = 'fromUser';\r $reviewP->where('type', 'RR');\r $reviewP->whereInclude('record.fromUser');\r } elseif ($type != 'SPOTTER' && $className == 'Event') {\r $field = 'toUser';\r $reviewP->where('type', 'RE');\r $reviewP->whereInclude('event,fromUser');\r } elseif ($type != 'SPOTTER' && $className == 'Record') {\r $field = 'toUser';\r $reviewP->where('type', 'RR');\r $reviewP->whereInclude('record,fromUser');\r }\r $reviewP->wherePointer($field, '_User', $objectId);\r $reviewP->setLimit((!is_null($limit) && is_int($limit) && $limit >= MIN && MAX <= $limit) ? $limit : DEFAULTQUERY);\r $reviewP->setSkip((!is_null($skip) && is_int($skip) && $skip >= 0) ? $skip : 0);\r $reviewP->orderByDescending('createdAt');\r $reviews = $reviewP->getComments();\r if ($reviews instanceof Error) {\r $this->errorManagement($reviews->getErrorMessage());\r return;\r } elseif (is_null($reviews)) {\r $this->errorManagement();\r return;\r } else {\r foreach ($reviews as $review) {\r $condition1 = ($type == 'SPOTTER' && $className == 'Event' && !is_null($review->getEvent()) && !is_null($review->getEvent()->getFromUser()));\r $condition2 = ($type == 'SPOTTER' && $className == 'Record' && !is_null($review->getRecord()) && !is_null($review->getRecord()->getFromUser()));\r $condition3 = ($type != 'SPOTTER' && $className == 'Event' && !is_null($review->getEvent()) && !is_null($review->getFromUser()));\r $condition4 = ($type != 'SPOTTER' && $className == 'Record' && !is_null($review->getRecord()) && !is_null($review->getFromUser()));\r if ($condition1 || $condition2 || $condition3 || $condition4) {\r array_push($reviewArray, $review);\r }\r }\r $this->error = null;\r $this->reviewArray = $reviewArray;\r }\r }",
"public function initForUploadReviewPage($objectId, $className) {\r require_once BOXES_DIR . 'utilsBox.php';\r $this->reviewArray = array();\r $mediaInfo = array();\r $currentUserId = sessionChecker();\r if (is_null($currentUserId)) {\r $this->errorManagement(ONLYIFLOGGEDIN);\r return;\r }\r if ($className == 'Event') {\r require_once CLASSES_DIR . 'event.class.php';\r require_once CLASSES_DIR . 'eventParse.class.php';\r $event = new EventParse();\r $event->where('objectId', $objectId);\r $event->where('active', true);\r $event->whereInclude('fromUser');\r $event->setLimit(MIN);\r $event->orderByDescending('createdAt');\r $events = $event->getEvents();\r if ($events instanceof Error) {\r $this->errorManagement($events->getErrorMessage());\r return;\r } elseif (is_null($events)) {\r $this->errorManagement();\r return;\r } else {\r foreach ($events as $event) {\r if (!is_null($event->getFromUser()))\r array_push($mediaInfo, $event);\r }\r $this->error = null;\r $this->mediaInfo = $mediaInfo;\r return;\r }\r } else {\r require_once CLASSES_DIR . 'record.class.php';\r require_once CLASSES_DIR . 'recordParse.class.php';\r $record = new RecordParse();\r $record->where('objectId', $objectId);\r $record->where('active', true);\r $record->setLimit(MIN);\r $record->orderByDescending('createdAt');\r $record->whereInclude('fromUser');\r $records = $record->getRecords();\r if ($records instanceof Error) {\r $this->errorManagement($records->getErrorMessage());\r return;\r } elseif (is_null($records)) {\r $this->errorManagement();\r return;\r } else {\r foreach ($records as $record) {\r if (!is_null($record->getFromUser()))\r array_push($mediaInfo, $record);\r }\r }\r }\r $this->error = null;\r $this->mediaInfo = $mediaInfo;\r }",
"public function initForPersonalPage($objectId, $limit = null, $skip = null) {\r\t$record = new RecordParse();\r\t$record->wherePointer('fromUser', '_User', $objectId);\r\t$record->where('active', true);\r\t$record->setLimit((!is_null($limit) && is_int($limit) && $limit >= MIN && MAX >= $limit) ? $limit : DEFAULTQUERY);\r\t$record->setSkip((!is_null($skip) && is_int($skip) && $skip >= 0) ? $skip : 0);\r\t$record->orderByDescending('createdAt');\r\t$records = $record->getRecords();\r\tif ($records instanceof Error) {\r\t $this->errorManagement($records->getErrorMessage());\r\t return;\r\t} elseif (is_null($records)) {\r\t $this->errorManagement();\r\t return;\r\t} else {\r\t $this->error = null;\r\t $this->recordArray = $records;\r\t}\r }",
"public function initComments()\n\t{\n\t\t$this->collComments = array();\n\t}",
"function smarty_function_object_comments($params, &$smarty) {\n AngieApplication::useWidget('select_attachments', FILE_UPLOADER_FRAMEWORK);\n\n $object = array_required_var($params, 'object', true, 'IComments');\n $user = array_required_var($params, 'user', true, 'IUser');\n \n if(empty($params['id'])) {\n $params['id'] = HTML::uniqueId('object_comments');\n } // if\n \n if(isset($params['class']) && $params['class']) {\n $params['class'] .= ' object_comments';\n } else {\n $params['class'] = 'object_comments';\n } // if\n \n $interface = array_var($params, 'interface', AngieApplication::getPreferedInterface(), true);\n \n // Default, web interface\n if($interface == AngieApplication::INTERFACE_DEFAULT) {\n AngieApplication::useWidget('object_comments', COMMENTS_FRAMEWORK);\n\n $count = (integer) array_var($params, 'count', 5, true); // Number of recent comment that need to be loaded initially\n \n $min_last_visit = new DateTimeValue(time() - 2592000); // 30 days...\n $last_visit = $user->getLastVisitOn(true);\n \t\n \tif($last_visit->getTimestamp() < $min_last_visit->getTimestamp()) {\n\t $last_visit = $min_last_visit;\n\t } // if\n \n $total_comments = $object->comments()->count($user);\n \n $new_comments_count = $total_comments ? $object->comments()->countSinceVisit($user, $last_visit) : 0;\n if($new_comments_count && $count < $new_comments_count) {\n $count = $new_comments_count + 1;\n } // if\n \n $options = array(\n 'total_comments' => $total_comments, \n \t'comments_url' => $object->comments()->getUrl(), \n \t'user_id' => $user->getId(), \n \t'user_email' => $user->getEmail(), \n );\n\n $subscribers = $object->subscriptions()->get();\n \n $options['object'] = array(\n 'id' => $object->getId(),\n 'class'\t=> get_class($object),\n 'verbose_type' => $object->getVerboseType(false, $user->getLanguage()),\n 'verbose_type_lowercase'\t=> $object->getVerboseType(true, $user->getLanguage()),\n 'permissions' => array('can_comment' => $object->comments()->canComment($user)),\n 'event_names' => array('updated' => $object->getUpdatedEventName(), 'deleted' => $object->getDeletedEventName()),\n 'is_locked' => $object->getIsLocked(),\n 'is_completed' => $object instanceof IComplete && $object->getCompletedOn() instanceof DateValue,\n 'subscribers' => $subscribers ? JSON::valueToMap($subscribers) : null,\n 'urls' => array(\n 'subscriptions' => $object->subscriptions()->getSubscriptionsUrl()\n )\n );\n\n $current_request = $smarty->getVariable('request')->value;\n $options['event_scope'] = $current_request->getEventScope();\n\n if ($object instanceof ILabel) {\n \t$options['object']['label']['id'] = $object->getLabelId();\n } // if\n \n if ($object instanceof ICategory) {\n \t$options['object']['category']['id'] = $object->getCategoryId();\n } // if\n \n $options['comments'] = Comments::findForWidget($object, $user, 0 , 500);\n \n if(empty($params['load_timestamp'])) {\n $params['load_timestamp'] = time();\n } // if\n \n $result = HTML::openTag('div', $params);\n \n\t\t\t$view = $smarty->createTemplate(get_view_path('_object_comment_form_row', null, COMMENTS_FRAMEWORK));\n $view->assign(array(\n \t'comment_parent' => $object, \n 'comment' => $object->comments()->newComment(), \n 'comments_id' => $params['id'],\n 'comment_data' => array(\n 'body' => null\n ),\n 'user' => $user,\n )); \n $result .= $view->fetch();\n \n return $result . '</div><script type=\"text/javascript\">$(\"#' . $params['id'] . '\").objectComments(' . JSON::encode($options) . ');</script>'; \n \n // Phone interface\n \t} elseif($interface == AngieApplication::INTERFACE_PHONE) {\n AngieApplication::useHelper('image_url', ENVIRONMENT_FRAMEWORK);\n \t\t\n \t$options = array(\n \t\t'comments' => array()\n \t);\n \t\n if($object->comments()->get($user)) {\n foreach($object->comments()->get($user) as $comment) {\n\t $options['comments'][] = $comment->describe($user, true, $interface);\n\t } // if\n } // if\n \n $result = HTML::openTag('div', $params);\n \n if(is_foreachable($options['comments'])) {\n \t$result .= '<ul data-role=\"listview\" data-inset=\"true\" data-dividertheme=\"j\" data-theme=\"p\">\n\t \t<li data-role=\"list-divider\"><img src=\"' . smarty_function_image_url(array(\n\t\t\t\t\t\t'name' => 'icons/listviews/navigate.png',\n\t\t\t\t\t\t'module' => COMMENTS_FRAMEWORK,\n\t\t\t\t\t\t'interface' => AngieApplication::INTERFACE_PHONE\n\t\t\t\t\t), $smarty) . '\" class=\"divider_icon\" alt=\"\">' . lang('Comments') . '</li>';\n \t\n \tAngieApplication::useHelper('datetime', GLOBALIZATION_FRAMEWORK, 'modifier');\n\t \n\t foreach($options['comments'] as $comment) {\n\t \t$result .= '<li>\n\t \t\t<img class=\"ui-li-icon\" src=' . $comment['created_by']['avatar']['large'] . ' alt=\"\"/>\n\t \t\t<p class=\"comment_details ui-li-desc\">By <a class=\"ui-link\" href=\"' . $comment['created_by']['permalink'] . '\">' . $comment['created_by']['short_display_name'] . '</a> on ' . smarty_modifier_datetime($comment['created_on']) . '</p>\n\t \t\t<div class=\"comment_overflow ui-li-desc\">' . nl2br($comment['body']) . '</div>';\n\t \t\n\t \tif(is_foreachable($comment['attachments'])) {\n\t \t\tforeach($comment['attachments'] as $attachment) {\n\t \t\t\t$result .= '<div class=\"comment_attachment\"><a href=\"' . $attachment['urls']['view'] . '\" target=\"_blank\"><img src=\"' . $attachment['preview']['icons']['large'] . '\" /><span class=\"filename\">' . $attachment['name'] . '</span></a></div>';\n\t \t\t} // forech\n\t \t} // if\n\t \t\n\t \t$result .= '</li>';\n\t } // foreach\n\t\t\t\t\n\t\t\t $result .= '</ul>';\n } // if\n \n return $result . '</div><script type=\"text/javascript\">$(\"div.comment_overflow\").find(\"p img\").css(\"max-width\", \"100%\"); // fit comment images to screen</script>';\n \n \t// Print interface\n \t} elseif ($interface == AngieApplication::INTERFACE_PRINTER) {\n \t$comments = $object->comments()->get($user);\n\n \tAngieApplication::useHelper('date', GLOBALIZATION_FRAMEWORK, 'modifier');\n \tAngieApplication::useHelper('object_attachments',ATTACHMENTS_FRAMEWORK);\n \t \n \tif (is_foreachable($comments)) {\n \t $result = '<div class=\"object_comments\"><h2 class=\"comments_title\">' . lang('Comments') . '</h2>';\n \t $result .= '<table cellspacing=\"0\">';\n \t \n \t\tforeach ($comments as $comment) {\n \t\t $result .= '<tr>';\n \t\t\t$result .= \t'<td class=\"comment_avatar\"><img src=\"' . $comment->getCreatedBy()->avatar()->getUrl(IUserAvatarImplementation::SIZE_BIG) . '\"></td>';\n \t\t\t\t$result .= \t'<td class=\"comment_body\">';\n \t\t\t\t$result .=\t\t'<div class=\"comment\">';\n \t\t\t\t$result\t.=\t\t\t'<img class=\"comment_background\" src=\"' . AngieApplication::getImageUrl('layout/comment-background.png', COMMENTS_FRAMEWORK, AngieApplication::INTERFACE_PRINTER) . '\" />';\n \t\t\t\t$result\t.=\t\t\t'<div class=\"comment_details\"><span class=\"comment_author\">' . $comment->getCreatedBy()->getName(true) . '</span><span class=\"comment_date date\">' . smarty_modifier_date($comment->getCreatedOn()) . '</span></div>';\n \t\t\t\t$result .=\t\t\t'<div class=\"comment_body\">' . HTML::toRichText($comment->getBody(), AngieApplication::INTERFACE_PRINTER) . smarty_function_object_attachments(array('object' => $comment, 'interface' => $interface, 'user' => $user), $smarty) . '</div>';\n \t\t\t\t$result .=\t\t'</div>';\n \t\t\t\t$result .= '</td>';\n\t\t\t\t\t$result .= '</tr>';\n\t\t\t\t}//foreach\n\t\t\t$result.= '</table></div>';\n \t} // if\n \t\n \t\n \treturn $result;\n \t\n\t // Other interfaces\n } else {\n\n $options = array('comments' => null);\n \n $comments = $object->comments()->get($user);\n if($comments) {\n $options['comments'] = array();\n \n foreach($comments as $comment) {\n $options['comments'][] = $comment->describe($user, true, $interface);\n } // foreach\n } // if\n \n return HTML::openTag('div', $params) . '</div><script type=\"text/javascript\">$(\"#' . $params['id'] . '\").objectComments(' . JSON::encode($options, $user) . ');</script></div>';\n } // if\n }",
"protected function apiInit($config, $objectId = '')\n {\n\n // Check/Set Config Array\n\t\t$this->setConfig($config);\n\n // Set Endpoint for this object\n\t\t$this->setEndPoint($objectId);\n\n // Log this class and object id\n $class = str_replace(\"Zamzar\\\\\", \"\", static::class);\n if($objectId == '') {\n Logger::log($this->config, 'CreateObj=>' . $class . get_parent_class());\n } else {\n Logger::log($this->config, 'CreateObj=>' . $class . '=>' . $objectId);\n }\n\n }",
"public function initWikiComment()\n\t{\n\t\t$this->initWiki();\n\t\t\n\t\t$this->wiki2xhtml->setOpts(array(\n\t\t\t'active_title' => 0,\n\t\t\t'active_setext_title' => 0,\n\t\t\t'active_hr' => 0,\n\t\t\t'active_lists' => 1,\n\t\t\t'active_quote' => 0,\n\t\t\t'active_pre' => 1,\n\t\t\t'active_empty' => 0,\n\t\t\t'active_auto_br' => 1,\n\t\t\t'active_auto_urls' => 1,\n\t\t\t'active_urls' => 1,\n\t\t\t'active_auto_img' => 0,\n\t\t\t'active_img' => 0,\n\t\t\t'active_anchor' => 0,\n\t\t\t'active_em' => 1,\n\t\t\t'active_strong' => 1,\n\t\t\t'active_br' => 1,\n\t\t\t'active_q' => 1,\n\t\t\t'active_code' => 1,\n\t\t\t'active_acronym' => 1,\n\t\t\t'active_ins' => 1,\n\t\t\t'active_del' => 1,\n\t\t\t'active_footnotes' => 0,\n\t\t\t'active_wikiwords' => 0,\n\t\t\t'active_macros' => 0,\n\t\t\t'parse_pre' => 0,\n\t\t\t'active_fr_syntax' => 0\n\t\t));\n\t\t\n\t\t# --BEHAVIOR-- coreInitWikiComment\n\t\t$this->callBehavior('coreInitWikiComment',$this->wiki2xhtml);\n\t}",
"public function initPictureComments()\n\t{\n\t\t$this->collPictureComments = array();\n\t}",
"static function createComment($commentObject,$comment) {\n if (empty($commentObject)) {\n $commentObject = new ini_Comment($comment);\n return $commentObject;\n }\n if ($commentObject instanceof ini_Comment) {\n $commentObject->addComment($comment);\n return $commentObject;\n }\n return null;\n }",
"public function loadComments($object, $type = 'page')\n\t{\n\t\tif(db_parameter('COMMENTS_SYSTEM') == \"disqus\") \n\t\t{ \n\t\t\tapp('veer')->loadedComponents['comments_disqus'] = viewx('components.disqus', array(\"identifier\" => $type.$object->id));\n\t\t} \n\t\t\n\t\telse \n\t\t{\n\t\t\t$object->load('comments');\n\t\t\t\n\t\t\tapp('veer')->loadedComponents['comments_own'] = $object->comments->toArray();\n\t\t}\n\t}",
"function displayComments($conv_id, $start_from){\r\n\t$manage_db = new manage_db();\r\n\t$query_comments = $manage_db->return_query(\"SELECT * FROM $manage_db->comments cm INNER JOIN $manage_db->users us ON cm.user_id=us.user_id WHERE cm.convo_id='$conv_id' ORDER BY cm.comments_id DESC LIMIT $start_from, 9\");\r\n\t$echo_comments = \"\";\r\n\t$box_num = 0;\r\n\r\n\twhile($row = mysql_fetch_array($query_comments)){\r\n\t\t$pic = $row['profile_picture'];\r\n\t\t$conn_user_id = $row['user_id'];\r\n\t\t//$user = $row['user_id'];\r\n\t\t$comment = $row['comment'];\r\n\t\t$timestamp = $row['timestamp'];\r\n\t\t$time = $this->TranslateTime($timestamp);\r\n\t\t$box_num++;\r\n\r\n\t\t$echo01 = \"<div id='convo_comments'><div id='convo_comments_border'><div id='convo_comments_top'>\";\r\n\t\tif(strlen($pic) > 14){\r\n\t\t\t$echo02 = \"<div id='comment_profile_pic_case'><img id='comment_profile_pic' src='images/\".$pic.\"' /></div>\";\r\n\t\t}else{\r\n\t\t\t$echo02 = \"<div id='comment_profile_pic_case'><img id='comment_profile_pic' src='images/default.png' /></div>\";\r\n\t\t}\r\n\t\tif(strlen($comment) > 150){\r\n\t\t\t$echo03 = \"<div id='comment_users_name'><a onClick='go_to_user(\".$conn_user_id.\")'>\".$row['first_name'].\" \".$row['last_name'].\"</a></div><div id='tcomment_ime'>\".$time.\"</div></div>\";\r\n\t\t\t$echo04 = \"<div id='scroll_comment'><a onClick='scroll_up_comment(\".$box_num.\")'><img src='images/scroll_up_comment1.png' /></a><a onClick='scroll_down_comment(\".$box_num.\")'><img src='images/scroll_down_comment1.png' /></a></div><div id='convo_comment\".$box_num.\"' style='margin-top:0px; z-index: -52; position: relative; height: 100%'>\".$comment.\" </div></div></div>\";\r\n\t\t}else if(strlen($comment) <= 150){\r\n\t\t\t$echo03 = \"<div id='comment_users_name'><a onClick='go_to_user(\".$conn_user_id.\")'>\".$row['first_name'].\" \".$row['last_name'].\"</a></div><div id='comment_time'>\".$time.\"</div></div>\";\r\n\t\t\t$echo04 = \"<div id='convo_comment'>\".$comment.\"</div></div></div>\";\r\n\t\t}\r\n\t\t$echo05 = \"[BRK]\";\r\n\t\t$echo_comments = $echo_comments.$echo01.$echo02.$echo03.$echo04.$echo05;\r\n\t}\r\n\r\n\treturn $echo_comments;\r\n}",
"function comments_init()\n{\n // Get database information\n $dbconn =& pnDBGetConn(true);\n $pntable =& pnDBGetTables();\n\n // Create tables\n $comments_table = $pntable['comments'];\n $comments_column = &$pntable['comments_column'];\n $sql = \"CREATE TABLE $comments_table (\n $comments_column[tid] int(11) NOT NULL auto_increment,\n $comments_column[pid] int(11) default '0',\n $comments_column[sid] int(11) default '0',\n $comments_column[date] datetime default NULL,\n $comments_column[name] varchar(60) NOT NULL default '',\n $comments_column[email] varchar(60) default NULL,\n $comments_column[url] varchar(254) default NULL,\n $comments_column[host_name] varchar(60) default NULL,\n $comments_column[subject] varchar(85) NOT NULL default '',\n $comments_column[comment] text NOT NULL,\n $comments_column[score] tinyint(4) NOT NULL default '0',\n $comments_column[reason] tinyint(4) NOT NULL default '0',\n PRIMARY KEY (pn_tid))\";\n $dbconn->Execute($sql);\n\n // Check database result\n if ($dbconn->ErrorNo() != 0) {\n // Report failed initialisation attempt\n return false;\n }\n\n // Set up config variables\n pnConfigSetVar('anonpost', 1);\n pnConfigSetVar('commentlimit', 4096);\n pnConfigSetVar('moderate', 1);\n\n // Initialisation successful\n return true;\n}",
"private function extend_comments() {\n foreach ( $this->comments as &$comment ) {\n $cid = $comment->comment_ID;\n\n // Get author link\n $comment->author_link = get_comment_author_link( $cid );\n\n // Set comment classes\n $classes = $this->comment_has_parent( $comment ) ? 'reply ' . $this->comment_class : $this->comment_class;\n\n switch ( $comment->comment_approved ) {\n case 1:\n $classes .= ' comment-approved';\n break;\n case 0:\n $classes .= ' comment-hold';\n break;\n case 'spam':\n $classes .= ' comment-spam';\n break;\n }\n\n global $comment_depth;\n\n $comment_depth = $this->get_comment_depth( $cid );\n\n $comment->comment_class = comment_class( $classes, $cid, $this->comment_post_id, false );\n\n // Load a reply link\n if ( $this->reply ) {\n $this->reply_args['depth'] = $comment_depth;\n $comment->reply_link = \\get_comment_reply_link( $this->reply_args, $cid );\n\n if ( ! empty( $comment->reply_link ) ) {\n $comment->reply = true;\n }\n else {\n $comment->reply = false;\n }\n }\n\n // Set an avatar\n if ( ! empty( $this->avatar_args ) ) {\n extract( $this->avatar_args );\n $id_or_email = isset( $id_or_email ) ? $id_or_email : null;\n $size = isset( $size ) ? $size : null;\n $default = isset( $default ) ? $default : null;\n $alt = isset( $alt ) ? $alt : null;\n $comment->avatar = get_avatar( $id_or_email, $size, $default, $alt );\n }\n else {\n $comment->avatar = false;\n }\n\n // Load a custom profile picture\n $pic = apply_filters( 'dustpress/comments/profile_picture', $comment );\n if ( is_string( $pic ) ) {\n $comment->profile_pic = $pic;\n }\n else {\n $comment->profile_pic = false;\n }\n\n // Filter comment\n $comment = apply_filters( 'dustpress/comments/comment', $comment );\n }\n // Sort replies\n if ( $this->threaded ) {\n $this->comments = $this->threadify_comments( $this->comments );\n }\n }",
"public function init($objectId) {\r $friends = getRelatedUsers($objectId, 'friendship', '_User', false, $this->config->friends, 0);\r if ($friends instanceof Error) {\r $this->config = null;\r $this->error = $friends->getErrorMessage();\r $this->friendsArray = array();\r return;\r } elseif (is_null($friends)) {\r $this->config = null;\r $this->error = null;\r $this->friendsArray = array();\r return;\r } else {\r $this->error = null;\r $this->friendsArray = $friends;\r }\r }",
"function commentwall_pagesetup()\n\t{\n\t\t\n\t}",
"function register_block_core_comments_pagination_numbers()\n {\n }",
"public function ShowProfileComments($uid,$page = NULL)\n\t{\n\t\techo '<div class=\"ProfileComments\" id=\"ProfileComments\">';\n\t\tif($page != NULL)\n\t\t{\n\t\t\t$CurrentCount = $page*15;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$CurrentCount = 0;\n\t\t}\n\t\t$numrows = \"SELECT u.ID, u.Username, u.avatarActivate, u.avatarExtension, c.id, c.comments, c.ip, c.dated FROM page_comments AS c, users AS u WHERE page_id = 'u\".$this->id.\"' AND c.uid=u.ID AND c.is_approved = 1\";\n\t\t$numrows = mysqli_query($conn, $numrows);\n\t\t$numrows = mysqli_num_rows($numrows);\n\n\t\t/* Comment paging method */\n\t\tif($numrows > 15){\n\t\t\t$totalpages = ceil($numrows/15);\n\t\t\tif($totalpages > 2 && $page < ($totalpages-3))\n\t\t\t{\n\t\t\t\t$LastPage = '<div title=\"Go to Last Page\" style=\"padding:0 5px 0 5px;width:10px;font-size:14px;color:#777;background-color:#fff;border:1px solid #e1dedd;display:inline;\"><a href=\"#\" onClick=\"$(\\'#ProfileComments\\').load(\\'/scripts.php?view=profile-comments&uid=' . $this->id . '&page=' . ($totalpages-1) . '\\'); return false;\">>></a></div>';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$LastPage = '';\n\t\t\t}\n\t\t\tif($page > 2)\n\t\t\t{\n\t\t\t\t$FirstPage = '<div title=\"Go to Last Page\" style=\"padding:0 5px 0 5px;width:10px;font-size:14px;color:#777;background-color:#fff;border:1px solid #e1dedd;display:inline;\"><a href=\"#\" onClick=\"$(\\'#ProfileComments\\').load(\\'/scripts.php?view=profile-comments&uid=' . $this->id . '&page=0\\'); return false;\"><<</a></div>';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$FirstPage = '';\n\t\t\t}\n\t\t\t//if($totalpages > 4\n\t\t\t$ProfileCommentsFull = '<div class=\"comment-paging\" align=\"right\" style=\"padding:5px 0 5px 0;\">Nav: ' . $FirstPage . ' ';\n\n\t\t\t// Pages BEFORE the curent page\n\t\t\tfor($i=($page-2); $i<$page; $i++)\n\t\t\t{\n\t\t\t\tif($i < 0)\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif($page == $i)\n\t\t\t\t\t{\n\t\t\t\t\t\t$commentstyle = 'padding:0 5px 0 5px;width:10px;font-size:14px;color:#777;background-color:#e1dedd;border:1px solid #aaaaaa;display:inline;';\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$commentstyle = 'padding:0 5px 0 5px;width:10px;font-size:14px;color:#777;background-color:#fff;border:1px solid #e1dedd;display:inline;';\n\t\t\t\t\t}\n\t\t\t\t\t$ProfileCommentsFull .= '<div style=\"'.$commentstyle.'\"><a href=\"#\" onClick=\"$(\\'#ProfileComments\\').load(\\'/scripts.php?view=profile-comments&uid=' . $this->id . '&page=' . $i . '\\'); return false;\">' . ($i+1) . '</a></div> ';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Pages AFTER the curent page\n\t\t\tfor($i=$page; $i<($page+3); $i++)\n\t\t\t{\n\t\t\t\tif($i > ($totalpages-1))\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif($page == $i)\n\t\t\t\t\t{\n\t\t\t\t\t\t$commentstyle = 'padding:0 5px 0 5px;width:10px;font-size:14px;color:#777;background-color:#e1dedd;border:1px solid #aaaaaa;display:inline;';\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$commentstyle = 'padding:0 5px 0 5px;width:10px;font-size:14px;color:#777;background-color:#fff;border:1px solid #e1dedd;display:inline;';\n\t\t\t\t\t}\n\t\t\t\t\t$ProfileCommentsFull .= '<div style=\"'.$commentstyle.'\"><a href=\"#\" onClick=\"$(\\'#ProfileComments\\').load(\\'/scripts.php?view=profile-comments&uid=' . $this->id . '&page=' . $i . '\\'); return false;\">' . ($i+1) . '</a></div> ';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$ProfileCommentsFull .= $LastPage . '</div>';\n\t\t}\n\t\telse {\n\t\t}\n\t\techo $ProfileCommentsFull;\n\t\techo '<div id=\"dynm\">\n\t\t<div id=\"flash\"></div>\n\t\t</div>';\n\t\t/* Comment Loop */\n\t\tif($numrows == 0){\n\t\t\techo '<div id=\"errmsg\" align=\"center\">No comments on this profile..</div>';\n\t\t}\n\t\telse {\n\t\t\t$query = \"SELECT u.ID, u.Username, u.avatarActivate, u.avatarExtension, c.id, c.comments, c.ip, c.dated FROM page_comments AS c, users AS u WHERE page_id = 'u\".$this->id.\"' AND c.uid=u.ID AND c.is_approved = 1 ORDER BY c.dated DESC LIMIT $CurrentCount, 15\";\n\t\t\t$result = mysqli_query($conn, $query);\n\t\t\twhile(list($ID,$Username,$avatarActivate,$avatarExtension,$cid,$comments,$ip,$dated) = mysqli_fetch_array($result)){\n\t\t\t\tif($uid == $this->id){\n\t\t\t\t\t$topd = '<div id=\"pcommod\"><div class=\"pcommodtxt\"><a href=\"#\" id=\"dico'.$cid.'\" onClick=\"javascript:moddel(\\''.$cid.'\\',\\''.$this->id.'\\',\\''.md5($this->id).'\\'); return false;\" title=\"Delete Comment\"><img src=\"//animeftw.tv/images/tinyicons/cancel.png\" alt=\"\" border=\"0\"></a> <a id=\"uico'.$cid.'\" href=\"/user/'.$Username.'\" title=\"Reply to Comment\"><img src=\"//animeftw.tv/images/tinyicons/reply_go.png\" alt=\"\" border=\"0\"></a></div><div id=\"c-'.$cid.'\" style=\"display:none;\" align=\"center\"><a href=\"#\" onClick=\"javascript:modundel(\\''.$cid.'\\',\\''.$this->id.'\\',\\''.md5($this->id).'\\'); return false;\">Click Here to un-delete this comment.</a></div>';\n\t\t\t\t\t$bottomd = '</div>';\n\t\t\t\t}\n\t\t\t\telse {$topd = '';$bottomd = '';}\n\t\t\t\tif($avatarActivate == 'no'){$avatar = '<img src=\"' . $this->ImageHost . '/avatars/default.gif\" alt=\"avatar\" width=\"40px\" style=\"padding:2px;\" border=\"0\" />';}\n\t\t\t\telse {$avatar = '<img src=\"' . $this->ImageHost . '/avatars/user'.$ID.'.'.$avatarExtension.'\" alt=\"User avatar\" width=\"40px\" style=\"padding:2px;\" border=\"0\" />';}\n\t\t\t\t//THE variables.\n\t\t\t\t$comments = stripslashes($comments);\n\t\t\t\t$comments = nl2br($comments);\n\t\t\t\t$dated = strtotime($dated);\n\t\t\t\techo $topd;\n\t\t\t\techo '<a name=\"'.$cid.'\"></a><div id=\"c'.$cid.'\" class=\"side-body floatfix\">';\n\t\t\t\techo '<div id=\"dropmsg0\" class=\"dropcontent\">';\n\t\t\t\techo '<div style=\"float:right;\">'.$avatar.'</div>'; // avatar ftw\n\t\t\t\techo '<div style=\"padding-bottom:2px;\">'.$this->formatUsername($ID).' - <span title=\"Posted '.date('l, F jS, o \\a\\t g:i a',$dated).'\">'.date('M jS',$dated).'</span></div>'; //title of the comment\n\t\t\t\techo '<div style=\"max-width:195px;word-wrap:break-word;\">'.$comments.'</div>';\t// Comment goes here\n\t\t\t\techo '</div></div>';\n\t\t\t\techo $bottomd;\n\t\t\t\techo '<div style=\"height:2px;\"> </div>';\n\t\t\t}\n\t\t}\n\t\tif($uid == 0){\n\t\t\techo '<div align=\"center\">Please <a href=\"/login\">login</a> to post comments.</div>';\n\t\t}\n\t\telse {\n\t\t\tif($uid == $this->id && $this->id != 1){\n\t\t\t\t$msg = ' This is your profile, to comment, post on their profile!';\n\t\t\t\t$disable = ' disabled=\"disabled\"';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$msg = '';\n\t\t\t\t$disable = '';\n\t\t\t}\n\t\t\t\techo '\n\t\t\t\t<div align=\"center\" style=\"padding:5px 0 5px 0;\">\n\t\t\t\t<form action=\"#\" method=\"post\" id=\"ProfileCommentForm\">\n\t\t\t\t<input type=\"hidden\" name=\"form-type\" value=\"ProfileComment\" />\n\t\t\t\t<input type=\"hidden\" name=\"pid\" id=\"pid\" value=\"'.$this->id.'\"/>\n\t\t\t\t<textarea id=\"comment\" name=\"comment\" style=\"width:230px;height:60px;\"'.$disable.'>'.$msg.'</textarea><br /> <input type=\"submit\" class=\"submitpc\" value=\" Submit Comment \"'.$disable.' />\n\t\t\t\t</form></div>';\n\t\t}\n\t\techo $ProfileCommentsFull;\n\t\techo '</div>';\n\t}",
"public function initToolcommentss()\n\t{\n\t\t$this->collToolcommentss = new PropelObjectCollection();\n\t\t$this->collToolcommentss->setModel('Toolcomments');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Rename an existing folder | public function renameFolder(string $old, string $new): Response; | [
"public function renameDir($path, $new_name);",
"function renameFolder($newname,$oldname){\n return rename ( WWW_ROOT .'files' . DS . $oldname , WWW_ROOT .'files' . DS . $newname );\n }",
"function rename_folder()\r\n\t{\r\n\t\t$this->Kalkun_model->rename_folder();\r\n\t\tredirect($this->input->post('source_url'));\r\n\t}",
"function renameFolder($oldName,$newName){\r\n\t\t\t\t// open the user's directory\r\n\t\t\t\t\t$path = './cloud/'.$_SESSION['SESS_USER_ID'].'/'; // '.' for current\r\n\r\n\r\n\t\t\t}",
"function rename_folder()\n\t{\n\t\t$this->db->set('name', $this->input->post('edit_folder_name'));\n\t\t$this->db->where('id_folder', $this->input->post('id_folder'));\n\t\t$this->db->update('user_folders');\n\t}",
"function RenameFolder($path, $new_name) {\n\t\ttry{\n\t\t\tif(!$this->CheckPath($path))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\techo \"<br>rename<br>\";\n\t\t\t\t$this->soap_folder->rename(array('token' => $this->token,'fldPath' => $path,'newName' => $new_name));//($this->token, $path, $new_path);\n\t\t\t\t//(array('token' => $this->token, 'fldPath' => $this->folder->path))\n\t\t\t\techo \"error?\";\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}catch (Exception $e){\n\t\t\techo format_exception($e);\n\t\t}\n\t}",
"public function rename( $newpath=\"\" );",
"public function updateAfterRenameFolder($old, $new);",
"public function renameFolder(\\TYPO3\\CMS\\Core\\Resource\\Folder $folder, $newName) {\n\t}",
"private function renameFolder($old, $new)\n {\n if ($old === $new) {\n return;\n }\n\n $bucket = Auth::user()->getBucket();\n Storage::disk('buckets')->move($bucket.'/'.$old, $bucket.'/'.$new);\n }",
"public function testRenameFolder() {\n $this->objFromFixture('Member', 'apiuser')->login();\n \n\n //Test renaming a folder\n $response=$this->getAMFResponse('Snippets.renameFolder', array(\n 'id'=>$this->objFromFixture('SnippetFolder', 'folder1')->ID,\n 'name'=>'Lorem Ipsum'\n ));\n \n \n //Validate the response\n $this->assertEquals('HELO', $response['status'], 'Response status should have been HELO');\n \n\n //Test renaming a folder to a duplicate\n $response=$this->getAMFResponse('Snippets.renameFolder', array(\n 'id'=>$this->objFromFixture('SnippetFolder', 'folder1')->ID,\n 'name'=>'Test Folder 2'\n ));\n \n \n //Validate the response\n $this->assertEquals('EROR', $response['status'], 'Response status should have been EROR');\n $this->assertEquals(_t('CodeBank.FOLDER_EXISTS', '_A folder already exists with that name'), $response['message'], 'Response message should have been that there is a duplicate');\n }",
"public function renameFolderAction($id) {\r\n\t\t$em = $this -> getDoctrine() -> getManager();\r\n\t\t$securityContext = $this -> get('security.context');\r\n\t\t$parameters = $_GET['acsilserver_appbundle_renamefiletype'];\r\n\t\t$name = $parameters['name'];\r\n\r\n\t\t$folderToRename = $em -> getRepository('AcsilServerAppBundle:Folder') -> findOneBy(array('id' => $id));\r\n\t\t\t\r\n\t\tif (!$folderToRename) {\r\n\t\t\tthrow $this -> createNotFoundException('No folder found for id ' . $id);\r\n\t\t}\r\n\t\t\r\n\t\t$folderId = $folderToRename->getParentFolder();\r\n\r\n\t\tif (false === $securityContext -> isGranted('EDIT', $folderToRename)) {\r\n\t\t\tthrow new AccessDeniedException();\r\n\t\t}\r\n\t\t$folderToRename->setName($name);\r\n\t\t$folderToRename->setLastModifDate(new \\DateTime());\r\n\t\t$em -> persist($folderToRename);\r\n\t\t$em -> flush();\r\n\t\treturn $this -> redirect($this -> generateUrl('_managefile', array(\r\n 'folderId' => $folderId,\r\n )));\r\n\t}",
"public function RenameFolder($folder_id, $new_name)\n\t{\n\t\t$query = \"UPDATE [|PREFIX|]folders SET name = '\" . $this->Db->Quote($new_name) . \"' WHERE folderid = \" . intval($folder_id);\n\t\t$result = $this->Db->Query($query);\n\t\tif (!$result) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public function renameSubFolder(\\TYPO3\\CMS\\Core\\Resource\\Folder $folder, $newDirName) {\n\t\tif (self::DEBUG_MODE) \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump(array($newDirName => $folder), 'Hello from ' . __METHOD__);\n\t\tforeach ($this->getSubObjects($folder->getIdentifier(), FALSE) as $subObject) {\n\t\t\t$subObjectIdentifier = $subObject['Key'];\n\t\t\tif (self::is_dir($subObjectIdentifier)) {\n\t\t\t\t$subFolder = $this->getFolder($subObjectIdentifier);\n\t\t\t\t$this->renameSubFolder($subFolder, $newDirName . $folder->getName() . '/');\n\t\t\t} else {\n\t\t\t\t$newSubObjectIdentifier = $newDirName . $folder->getName() . '/' . basename($subObjectIdentifier);\n\t\t\t\t$this->renameObject($subObjectIdentifier, $newSubObjectIdentifier);\n\t\t\t}\n\t\t}\n\n\t\t$newIdentifier = $newDirName . $folder->getName() . '/';\n\t\t$this->renameObject($folder->getIdentifier(), $newIdentifier);\n\t}",
"public function renameFolder($name, $id) {\n $folder = $this->getFolderByID($id);\n if ($folder !== null) {\n return $folder->setName($name);\n }else{\n return false;\n }\n }",
"public function rename($newname);",
"public function renameDirectory(DirectoryInterface $directory, string $newName): DirectoryInterface;",
"public function changeFolderName($folder_name) {\n\t\t$this->folder_name = $folder_name;\n\t}",
"public function testFoldersRenameOld()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a key value array of alternatives from a Doctrine collection of QuestionAlternatives. The key and the value are the same. | public function createChoices(InterviewAnswer $interviewAnswer)
{
$alternatives = $interviewAnswer->getInterviewQuestion()->getAlternatives();
$values = array_map(function (InterviewQuestionAlternative $a) {
return $a->getAlternative();
}, $alternatives->getValues());
return array_combine($values, $values);
} | [
"public function AlternativesPerProduct()\n {\n $dos = ArrayList::create();\n $altCount = Config::inst()->get('RepeatOrderForm', 'number_of_product_alternatives');\n for ($i = 1; $i <= $altCount; $i++) {\n $alternativeField = \"Alternative\".$i.\"ID\";\n if ($this->$alternativeField) {\n $product = Product::get()->filter(['ID' => $this->$alternativeField])->first();\n if ($product) {\n $dos->push($product);\n }\n }\n }\n if ($dos && $dos->count()) {\n return $dos;\n }\n return null;\n }",
"public function getAlternatives() {\n\t\treturn $this->alternatives;\n\t}",
"protected function orderAlternatives(array &$alternatives) {\n if (!$this->question->choice_random) {\n return;\n }\n $result = db_query('SELECT choice_order FROM {quiz_multichoice_user_answers}\n WHERE result_answer_id = :raid', array(':raid' => $this->result_answer_id))->fetchField();\n if (!$result) {\n return;\n }\n $order = explode(',', $result);\n $newAlternatives = array();\n foreach ($order as $value) {\n foreach ($alternatives as $alternative) {\n if ($alternative['id'] == $value) {\n $newAlternatives[] = $alternative;\n break;\n }\n }\n }\n $alternatives = $newAlternatives;\n }",
"private function createAnswerChoices() {\n // -- Looping through quiz question set and adding in three incorrect answers\n // -- to be included in the quiz along with the right answer\n shuffle($this->wrongAnswers);\n $wrongAnswerChunks = array_chunk($this->wrongAnswers, 3);\n\n for ($i=0; $i < $this->length; $i++) {\n $oneChunk = array_shift($wrongAnswerChunks);\n array_push($oneChunk, $this->questionSetFull[$i]['capital']);\n shuffle($oneChunk);\n array_push($this->answerChoices, $oneChunk);\n }\n return $this->answerChoices;\n }",
"private function _normalizeAlternative($alternatives) {\n $copy = $alternatives;\n // Answer and answer format.\n if (is_array($alternatives['answer'])) {\n $copy['answer'] = array_key_exists('value', $alternatives['answer']) ? $alternatives['answer']['value'] : NULL;\n $copy['answer_format'] = array_key_exists('format', $alternatives['answer']) ? $alternatives['answer']['format'] : NULL;\n }\n // Feedback if chosen and feedback if chosen format.\n if (is_array($alternatives['feedback_if_chosen'])) {\n $copy['feedback_if_chosen'] = array_key_exists('value', $alternatives['feedback_if_chosen']) ? $alternatives['feedback_if_chosen']['value'] : NULL;\n $copy['feedback_if_chosen_format'] = array_key_exists('format', $alternatives['feedback_if_chosen']) ? $alternatives['feedback_if_chosen']['format'] : NULL;\n }\n // Feedback if not chosen and feedback if not chosen format.\n if (is_array($alternatives['feedback_if_not_chosen'])) {\n $copy['feedback_if_not_chosen'] = array_key_exists('value', $alternatives['feedback_if_not_chosen']) ? $alternatives['feedback_if_not_chosen']['value'] : NULL;\n $copy['feedback_if_not_chosen_format'] = array_key_exists('format', $alternatives['feedback_if_not_chosen']) ? $alternatives['feedback_if_not_chosen']['format'] : NULL;\n }\n return $copy;\n }",
"private function createQuestionSet(): array\n {\n return [\n 'entityName' =>\n new Question('Entity name: '),\n 'propertyName' =>\n new Question('Property name: '),\n 'propertyType' =>\n new ChoiceQuestion('Property type: ', [\n 'string', 'int', 'float', 'datetime'\n ], 0),\n 'continue' =>\n new ConfirmationQuestion('Continue with next property? (y/n)', true)\n ];\n }",
"public function voteQuestions(){\n\n return $this->morphedByMany(Question::class, 'votable');\n\n }",
"public function getProductChoices()\n {\n $choices = array();\n\n $results = $this->createQueryBuilder('p')\n ->select('p.id, p.name')\n ->getQuery()->getResult()\n ;\n\n foreach ($results as $product) {\n $choices[$product['name']] = $product['id'];\n }\n\n return $choices;\n }",
"public function alternatives()\n {\n return $this->belongsToMany(\n AlternativeProduct::class,\n 'alternative_boycotted',\n 'boycotted_product_id',\n 'alternative_product_id'\n );\n }",
"public function toArray(): array\n {\n $data = [];\n foreach ($this->answers as $questionId => $answer) {\n $data[$questionId] = $answer->getValue();\n }\n\n return $data;\n }",
"public function getParametersAsChoices()\n {\n $list = $this->getParameters();\n $list = explode(',', $list);\n $result = array();\n\n foreach ($list as $choice)\n {\n $result[$choice] = $choice;\n }\n\n return $result;\n }",
"public function mergeProductOptionsDataProvider()\n {\n return [\n 'options are not array, empty array is returned' => [\n null,\n [],\n [],\n ],\n 'replacement is not array, original options are returned' => [\n ['val'],\n null,\n ['val'],\n ],\n 'ids do not match, no replacement occurs' => [\n [\n [\n 'option_id' => '3',\n 'key1' => 'val1',\n 'default_key1' => 'val2',\n 'values' => [\n [\n 'option_type_id' => '2',\n 'key1' => 'val1',\n 'default_key1' => 'val2'\n ]\n ]\n ]\n ],\n [\n 4 => [\n 'key1' => '1',\n 'values' => [3 => ['key1' => 1]]\n ]\n ],\n [\n [\n 'option_id' => '3',\n 'key1' => 'val1',\n 'default_key1' => 'val2',\n 'values' => [\n [\n 'option_type_id' => '2',\n 'key1' => 'val1',\n 'default_key1' => 'val2'\n ]\n ]\n ]\n ]\n ],\n 'key2 is replaced, key1 is not (checkbox is not checked)' => [\n [\n [\n 'option_id' => '5',\n 'key1' => 'val1',\n 'title' => 'val2',\n 'default_key1' => 'val3',\n 'default_title' => 'val4',\n 'values' => [\n [\n 'option_type_id' => '2',\n 'key1' => 'val1',\n 'key2' => 'val2',\n 'default_key1' => 'val11',\n 'default_key2' => 'val22'\n ]\n ]\n ]\n ],\n [\n 5 => [\n 'key1' => '0',\n 'title' => '1',\n 'values' => [2 => ['key1' => 1]]\n ]\n ],\n [\n [\n 'option_id' => '5',\n 'key1' => 'val1',\n 'title' => 'val4',\n 'default_key1' => 'val3',\n 'default_title' => 'val4',\n 'is_delete_store_title' => 1,\n 'values' => [\n [\n 'option_type_id' => '2',\n 'key1' => 'val11',\n 'key2' => 'val2',\n 'default_key1' => 'val11',\n 'default_key2' => 'val22'\n ]\n ]\n ]\n ]\n ],\n 'key1 is replaced, key2 has no default value' => [\n [\n [\n 'option_id' => '7',\n 'key1' => 'val1',\n 'key2' => 'val2',\n 'default_key1' => 'val3',\n 'values' => [\n [\n 'option_type_id' => '2',\n 'key1' => 'val1',\n 'title' => 'val2',\n 'default_key1' => 'val11',\n 'default_title' => 'val22'\n ]\n ]\n ]\n ],\n [\n 7 => [\n 'key1' => '1',\n 'key2' => '1',\n 'values' => [2 => ['key1' => 0, 'title' => 1]]\n ]\n ],\n [\n [\n 'option_id' => '7',\n 'key1' => 'val3',\n 'key2' => 'val2',\n 'default_key1' => 'val3',\n 'values' => [\n [\n 'option_type_id' => '2',\n 'key1' => 'val1',\n 'title' => 'val22',\n 'default_key1' => 'val11',\n 'default_title' => 'val22',\n 'is_delete_store_title' => 1\n ]\n ]\n ]\n ],\n ],\n ];\n }",
"function getAnswers(){\n $a = array();\n for ($i = 2; $i < count($this->question);$i++){\n $a[] = $this->question[$i];\n }\n return $a;\n}",
"public function provideGenericQuestions(): array\n {\n $questions = [\n new FeedbackQuestion(\n 'Essen',\n 'Essen (Qualität)',\n 'Das Essen hat meistens gut geschmeckt.',\n 'Das Essen war nicht gut.',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_POSITIVE,\n 'ce7990d4-c4be-3532-925a-ec8e9d5ade0e'\n ),\n new FeedbackQuestion(\n 'Essen',\n 'Essen (Menge)',\n 'Es gab meistens genug zu essen.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_POSITIVE,\n 'ce7990d4-c4be-3532-925a-ec8e9d5ade0f'\n ),\n new FeedbackQuestion(\n '',\n 'Wiederholen',\n 'Wenn ich könnte, würde ich beim nächstes Mal wieder dabei sein wollen.',\n 'Auch wenn noch mal mit dürfte, möchte beim nächsten Mal ich nicht kommen.',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_POSITIVE,\n '9f28a002-4d72-306d-86be-165b476bdc7e'\n ),\n new FeedbackQuestion(\n '',\n 'Mitbestimmung',\n 'Ich konnte selbst mitbestimmen und meine Meinung wurde gehört.',\n 'Ich durfte (z.B. beim Programm) nicht mitreden und mitentscheiden.',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_POSITIVE,\n '75e81f95-3bff-3741-9c96-11eb9db6f73a'\n ),\n new FeedbackQuestion(\n '',\n 'Langeweile',\n 'Ich habe mich oft gelangweilt.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_NEGATIVE,\n '71d043fa-33fc-3e7c-af4e-01cd72bbe2f3'\n ),\n new FeedbackQuestion(\n 'Mitarbeitende',\n 'Mitarbeitende (Nett)',\n 'Die meisten Mitarbeitenden waren überwiegend freundlich und nett.',\n 'Die Mitarbeitenden waren unfreundlich.',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_POSITIVE,\n '2e2d8d02-ca9d-38dc-bcba-dd911702c5c4'\n ),\n new FeedbackQuestion(\n 'Mitarbeitende',\n 'Mitarbeitende (Hilfe)',\n 'Ich habe Mitarbeitende gefunden, denen ich vertrauen konnte und die mir bei Problemen halfen.',\n 'Ich konnte keinem der Mitarbeitenden richtig vertrauen.',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_POSITIVE,\n 'c6fee88d-31e8-3cfb-90f6-bcdd8667ac55'\n ),\n new FeedbackQuestion(\n '',\n 'Einsamkeit',\n 'Ich habe mich manchmal einsam gefühlt.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_NEGATIVE,\n '8cc30a44-5d9b-3847-a9f4-3b29245dc6c6'\n ),\n new FeedbackQuestion(\n '',\n 'Heimweh',\n 'Ich hatte manchmal Heimweh.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_NEGATIVE,\n 'f3195a8b-ec76-338d-b5ff-1481161c95fe'\n ),\n new FeedbackQuestion(\n 'Ärger',\n 'Ärger (Gruppe)',\n 'Es gab oft Ärger und Streit in unserer Gruppe.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_NEGATIVE,\n '1228109e-ca0d-39db-a374-4db811e91101'\n ),\n new FeedbackQuestion(\n 'Ärger',\n 'Ärger (selbst)',\n 'Ich wurde viel geärgert.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_NEGATIVE,\n '57262d4e-efd6-33cf-bce4-1e626deb3ecd'\n ),\n new FeedbackQuestion(\n '',\n 'Strenge',\n 'Die Regeln waren zu streng.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_NEGATIVE,\n '7568094e-7440-33c4-bbeb-8e9d5626568d'\n ),\n new FeedbackQuestion(\n '',\n 'Freunde',\n 'Ich habe neue Freundinnen & Freunde kennengelernt.',\n 'Ich habe niemanden gefunden, mit dem ich mich gut verstanden habe.',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_POSITIVE,\n '55bd8739-296c-3eee-8a52-acc9c71f8ea2'\n ),\n new FeedbackQuestion(\n '',\n 'Zufriedenheit',\n 'Ich habe viele schöne Erlebnisse gehabt.',\n 'Die meiste Zeit hat mir nicht gefallen.',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_POSITIVE,\n 'af77b5e1-7b6f-361e-9915-ad535d716c47'\n ),\n new FeedbackQuestion(\n '',\n 'Gruppe',\n 'Ich habe mich in der Gruppe wohlgefühlt.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_POSITIVE,\n '075186ac-2dcf-31da-8fbc-efda67cff4f9'\n ),\n new FeedbackQuestion(\n '',\n 'Selbstreflexion',\n 'Ich habe oft über mich selbst nachgedacht.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_NEUTRAL,\n '3201b6ce-c64f-3035-8986-f33c7b6517e3'\n ),\n new FeedbackQuestion(\n 'Programm',\n 'Angebot',\n 'Ich habe gerne beim Programm (die Aktionen, die Spiele) mitgemacht.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_POSITIVE,\n '1a0313ab-57a5-33ad-9c77-6bf4cfbc1943'\n ),\n new FeedbackQuestion(\n 'Programm',\n 'Bewegung',\n 'Ich habe mich viel bewegt & Sport gemacht.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_POSITIVE,\n '97a56947-c11e-3ac8-b69e-10f316e0e0fd'\n ),\n new FeedbackQuestion(\n 'Programm',\n 'Mehr Ausflüge',\n 'Ich hätte mir mehr Ausflüge oder Unternehmungen gewünscht.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_NEUTRAL,\n '58fe375c-893e-3153-bde2-d9326b0d9b54'\n ),\n new FeedbackQuestion(\n 'Programm',\n 'Mehr Sport',\n 'Ich hätte mir mehr Sportangebote gewünscht.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_NEUTRAL,\n '8c93f812-ca5f-39a8-b190-93e2ee737fd2'\n ),\n new FeedbackQuestion(\n 'Programm',\n 'Mehr Musik',\n 'Ich hätte gern mehr gesungen und Musik gemacht.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_NEUTRAL,\n '7681e805-6212-3892-89e9-191f1603aaad'\n ),\n new FeedbackQuestion(\n '',\n 'Erstes Mal',\n 'Ich war zum ersten Mal mit euch auf Freizeit.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_NEUTRAL,\n '9e1d87f9-b9dc-3ac8-bded-638b97a67e07'\n ),\n ];\n\n $result = [];\n /** @var FeedbackQuestion $question */\n foreach ($questions as $question) {\n $result[$question->getUuid()] = $question;\n }\n return $result;\n }",
"public function setAlternatives($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Cloud\\VideoIntelligence\\V1p1beta1\\SpeechRecognitionAlternative::class);\n $this->alternatives = $arr;\n\n return $this;\n }",
"function &getAddableQuestionInstances() {\n\t\t$ret = array();\n\n\t\tif (!$this->all_question_array || !is_array($this->all_question_array)) {\n\t\t\t $this->_fillSurveyQuestions();\n\t\t}\n\n\t\t$arr = & $this->getQuestionArray();\n\t\tif ($arr) {\n\t\t\t/* Copy questions only if it is not in question string */\n\t\t\tfor ($i=0; $i<count($this->all_question_array); $i++) {\n\t\t\t\tif (array_search($this->all_question_array[$i]->getID(), $arr) == false &&\n\t\t\t\t\t$this->all_question_array[$i]->getID()!=$arr[0]) {\n\t\t\t\t\t$ret[] = $this->all_question_array[$i];\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$ret = $this->all_question_array;\n\t\t}\n\n\t\treturn $ret;\n\t}",
"public function getQuestionsAnswer() {\r\n\t\t$answers = [];\r\n\r\n\t\t$question_id = $this->getQuestionId();\r\n\r\n\t\tif ($question_id) {\r\n\t\t\t$this->_answersCollection = $this->_productQuestionAnswer->create();\r\n\r\n\t\t\t$this->_answersCollection->addFieldToFilter('question_id', $question_id)\r\n\t\t\t\t->addFieldToFilter('status', Status::STATUS_APPROVE)\r\n\t\t\t\t->setPageSize($this->_page_size)\r\n\t\t\t\t->setOrder('created_at', 'DESC');\r\n\r\n\t\t\t$answers = $this->_answersCollection;\r\n\t\t}\r\n\r\n\t\t$this->_total_answer = $this->_answersCollection->getSize();\r\n\r\n\t\treturn $answers;\r\n\t}",
"public function getVariationIds();",
"private function getProductOptions() {\n \n $productVariations = new DataObjectSet();\n $request = $this->getRequest();\n $options = $request->requestVar('Options');\n $product = $this->data();\n $variations = $product->Variations();\n\n if ($variations && $variations->exists()) foreach ($variations as $variation) {\n \n $variationOptions = $variation->Options()->map('AttributeID', 'ID');\n if ($options == $variationOptions && $variation->isEnabled()) {\n $productVariations->push($variation);\n }\n }\n return $productVariations;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the cascade candidate change fraction | function fann_set_cascade_candidate_change_fraction($ann, $cascade_candidate_change_fraction){} | [
"function fann_set_cascade_output_change_fraction($ann, $cascade_output_change_fraction){}",
"function fann_get_cascade_output_change_fraction($ann)\n{\n}",
"private function change(){\n\t\t$k = count($this->coinage);\n\t\t$remain;\n\t\t$total;\n\t\t$amnt;\n\t\tfor($a = 0; $a < $k; $a++){\n\t\t\t/** calculate the amount per coin that can fit into the remaining currency change **/\t\t\n\t\t\t$remain = $this->changeleft % $this->coinage[$a]->getvalue();\n\t\t\t$total = $this->changeleft - $remain;\n\t\t\t$amnt = $total / $this->coinage[$a]->getvalue();\n\t\t\t/** add the number of new coins and set new remaining change **/\n\t\t\t$this->coinage[$a]->add($amnt);\n\t\t\t$this->changeleft = $remain;\n\t\t}\t\n\t}",
"public function testSetCoef() {\n\n $obj = new BudgetLignes();\n\n $obj->setCoef(10.092018);\n $this->assertEquals(10.092018, $obj->getCoef());\n }",
"public function setConfidence(?float $value): void {\n $this->getBackingStore()->set('confidence', $value);\n }",
"public function changeToPercentage() {\n $dataArray = $this->reference->getReferenceArray('data', $this->referenceId);\n \n // Computes the sum\n foreach($dataArray as $data) {\n if (is_array($data)) {\n $dataToProcess = $data[0];\n } else {\n $dataToProcess = $data;\n }\n foreach($dataToProcess as $key => $value) {\n if (!isset($sum[$key])) {\n $sum[$key] = $value;\n } else {\n $sum[$key] += $value;\n }\n }\n }\n\n foreach($dataArray as $dataKey => $data) {\n if (is_array($data)) {\n $dataToProcess = $data[0];\n } else {\n $dataToProcess = $data;\n }\n foreach($dataToProcess as $key => $value) {\n $dataArray[$dataKey][0][$key] = $dataArray[$dataKey][0][$key] * 100 / $sum[$key];\n }\n }\n \n $this->reference->setReferenceArray(\n 'data',\n $this->referenceId,\n $dataArray\n );\n }",
"private function setEstablishedEarnedIncome(){\n $this->establishedEarnedIncome = floor($this->earnedIncome / 100) * 100;\n }",
"public function setCompromisedRate(?float $value): void {\n $this->getBackingStore()->set('compromisedRate', $value);\n }",
"public function testSetExpressionRatio() {\n\t\techo (\"\\n********************Test SetExpressionRatio()************************************************\\n\");\n\t\n\t\t$this->geneCondition->setExpressionRatio( 1 );\n\t\t$this->assertEquals ( 1, $this->geneCondition->getExpressionRatio() );\n\t}",
"function fann_set_cascade_min_cand_epochs($ann, $cascade_min_cand_epochs){}",
"public function migrateFractionalCents() {\n\n // Set original total\n $this->originalTotal = $this->absoluteTotal();\n\n\n // Remove fractional cents from each speder's net total\n\t\t$this->report->each(function($spender) {\n $this->trimCents($spender);\n\t\t});\n\n // Set extra amount to account for\n $this->extraAmount = bcmul(\n round($this->report->sum('total') * 100), 1, 2\n );\n\n // Apply extra amount to users\n $this->applyAllExtras();\n\t}",
"private function metragemCubicaCobrada() {\n\n $iConsumoCobrado = 0;\n foreach ($this->aLeiturasMensuradas as $iConsumo) {\n $iConsumoCobrado += $iConsumo;\n }\n\n $this->iMetragemCubicaCobrada = $iConsumoCobrado;\n }",
"public function reduce() {\r\n\t\t/*\r\n\t\t * divide 84 by 18 to get a quotient of 4 and a remainder of 12.\r\n\t\t * Then divide 18 by 12 to get a quotient of 1 and a remainder of 6.\r\n\t\t * Then divide 12 by 6 to get a remainder of 0, which means\r\n\t\t * that 6 is the gcd.\r\n\t\t */\r\n\t\t$gcf = $this->getGcd($this->numerator, $this->denominator);\r\n\t\t$this->numerator = ($this->numerator / $gcf);\r\n\t\t$this->denominator = ($this->denominator / $gcf);\r\n\t}",
"function setPercentage($percentage)\n\t{\n\t\tif($percentage != $this->percentage)\n\t\t{\n\t\t\t$this->_modified = true;\n\t\t\t$this->percentage = $percentage;\n\t\t}\n\t}",
"public function testSetNbCoupDeCoeurs() \r\n { \r\n $actu = new Actualite(); \r\n $resultat = $actu->setNbCoupDeCoeurs(22 + 8); \r\n $this->assertEquals(30, $resultat); \r\n }",
"function testConcertNormalUpdate() {\n $sellin = 50;\n $quality = 10;\n $this->concert->sell_in = $sellin;\n $this->concert->quality = $quality;\n $target = new GildedRose([$this->concert]);\n $target->update_quality();\n $this->assertEquals($quality + 1, $this->concert->quality);\n }",
"public function setPercentage($value){\n\t\t$this->_mPercentage = $value;\n\t\tNumber::validateBetweenCeroToNinetyNineNumber($value,\n\t\t\t\t'Porcentaje inválido.');\n\t}",
"public function setRelCtFacturation($v)\n {\n if ($v === ''){\n $v = null;\n }\n elseif ($v !== null){\n \n if(is_numeric($v)) {\n $v = (int) $v;\n }\n }\n if ($this->rel_ct_facturation !== $v) {\n $this->rel_ct_facturation = $v;\n $this->modifiedColumns[] = RelancesPeer::REL_CT_FACTURATION;\n }\n\n if ($this->aContactFacturation !== null && $this->aContactFacturation->getCtId() !== $v) {\n $this->aContactFacturation = null;\n }\n\n\n return $this;\n }",
"public function testCascadeCanBeChanged()\n {\n $this->assertSame(true, (new IsArchivedField())->cascade()->getCascade());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test saving custom fields along the recordAction | public function testRecordActionWithCustomFields() {
$this->User->id = 1;
$expected = array('record_action_on_item', array('pio_action' => 'like', 'pio_iid' => 'Article:52', 'rating' => 6, 'level' => 'medium'));
$this->PredictionIOClient->expects($this->once())->method('getCommand')->with(
$this->equalTo($expected[0]),
$this->equalTo($expected[1])
);
$this->PredictionIOClient->expects($this->once())->method('identify')->with($this->equalTo('User:1'));
$this->PredictionIOClient->expects($this->once())->method('execute');
$this->User->recordAction($expected[1]['pio_action'], array('id' => 52, 'model' => 'Article'), array('rating' => 6, 'level' => 'medium'));
} | [
"public function test_updateReplenishmentProcessCustomFields() {\n\n }",
"public function testPutContactCustomFields()\n {\n }",
"public function test_updateReceivingProcessCustomFields() {\n\n }",
"public function testActiveSave()\n {\n \n }",
"public function test_updateCustomerCustomFields() {\n\n }",
"function hook_crm_case_presave(CRMCase $case) {\n $case->name = 'foo';\n}",
"public function test_updateWarehouseCustomFields() {\n\n }",
"public function test_updateReplenishmentPlanCustomFields() {\n\n }",
"public function test_updateQuickAdjustmentCustomFields() {\n\n }",
"public function test_updateAlertCustomFields() {\n\n }",
"public function test_updateFulfillmentPlanCustomFields() {\n\n }",
"public function test_updateThirdPartyParcelAccountCustomFields() {\n\n }",
"public function testCreateActionForRecord () {\n TestingAuxLib::suLogin ('admin');\n\n // Test create action for Contacts\n $contact = $this->contacts('testUser');\n $this->executeCreateActionForRecordFlow('flow4', $contact);\n $this->assertRecordsActionCreated($contact, 'contacts');\n\n // Test create action for Opportunities\n $opportunity = $this->opportunities('ddp');\n $this->executeCreateActionForRecordFlow('flow5', $opportunity);\n $this->assertRecordsActionCreated($opportunity, 'opportunities');\n\n // Test create action for X2Leads\n $lead = $this->x2leads('0');\n $this->executeCreateActionForRecordFlow('flow6', $lead);\n $this->assertRecordsActionCreated($lead, 'x2leads');\n\n // Test create action for Campaigns\n $campaign = $this->campaigns('testUser');\n $this->executeCreateActionForRecordFlow('flow7', $campaign);\n $this->assertRecordsActionCreated($campaign, 'marketing');\n }",
"public function testCreateCustomField()\n {\n\n }",
"public function test_insert_record() {\n global $CFG;\n\n $this->resetAfterTest();\n $manager = new records_manager();\n $this->assertCount(0, $manager->get_all());\n\n $record1 = new record((object)[\n 'id' => 'test1',\n 'enabled' => false,\n 'type' => 'test 1',\n ]);\n\n $manager->save($record1);\n $this->assertCount(1, $manager->get_all());\n\n $record2 = new record((object)[\n 'id' => 'test2',\n 'enabled' => true,\n 'type' => 'test 2',\n 'settings' => [],\n ]);\n\n $manager->save($record2);\n $this->assertCount(2, $manager->get_all());\n\n $this->assertEquals([\n 'test1' => (object) [\n 'id' => 'test1',\n 'name' => '',\n 'enabled' => false,\n 'type' => 'test 1',\n 'trackadmin' => 0,\n 'cleanurl' => 0,\n 'settings' => [],\n\n ],\n 'test2' => (object) [\n 'id' => 'test2',\n 'name' => '',\n 'enabled' => true,\n 'type' => 'test 2',\n 'trackadmin' => 0,\n 'cleanurl' => 0,\n 'settings' => [],\n ]\n ], unserialize($CFG->tool_webanalytics_records));\n }",
"protected function _postSave()\n {}",
"public function testImportationSaveCustomColumn()\n {\n\n }",
"protected function afterSave() {}",
"public function testEditDocumentDocxSetFormFields()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Type checks a list of CBValues against a given container type and then constructs a container CBValue for them | public function containerValueFromCBValues($values, CBType $type)
{
$errorVal = NULL;
$checkValues = $this->containerValue_checkIfInputIsArrayOrNull($values, $type);
if ($checkValues !== TRUE) {
return $checkValues;
}
$valueFactory = $this->createContainerValueFactory($type);
if ($valueFactory === NULL) {
return $errorVal;
}
return $valueFactory->factoryContainerValueFromCBValues($values, $type);
} | [
"public function test_nested_list_plain_where_inner_values_are_cbvalues()\n {\n $type = $this->test_nested_list_cbvalues__type();\n $input = $this->test_nested_list_cbvalues__input();\n $res = $this->listFact->factoryContainerValueFromPlainValues($input, $type);\n $this->assertNull($res);\n }",
"public function test_nested_struct_plain_where_inner_values_are_cbvalues()\n {\n $type = $this->test_nested_struct_cbvalues__type();\n $input = $this->test_nested_struct_cbvalues__input();\n $res = $this->structFact->factoryContainerValueFromPlainValues($input, $type);\n $this->assertNull($res);\n }",
"public static function sanitize_value_types($list) \n\t{\n\t\t$good_list = array();\n\t\t\n\t\tforeach ($list as $key => $item) \n\t\t{\n\t\t\tif (is_array($item)) \n\t\t\t{\n\t\t\t\t$new_item = self::sanitize_value_types($item);\n\t\t\t}\n\t\t\telse if (is_object($item)) { // unhandled\n\t\t\t\t$new_item = $item;\n\t\t\t}\n\t\t\telse if ((string)intval($item) === (string)$item) { // we found an int\n\t\t\t\t$new_item = intval($item);\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t$new_item = $item;\n\t\t\t}\n\t\t\t\n\t\t\t$good_list[$key] = $new_item;\n\t\t}\n\t\t\n\t\treturn $good_list;\n\t}",
"public function form_field_value_type_list()\n {\n }",
"public static function buildBsonP3($value) {\n\t\tif (is_null($value)) {\n\t\t\treturn array(\n\t\t\t\t\t'Type' => self::TYPE_NULL \n\t\t\t);\n\t\t} else if (is_string($value)) {\n\t\t\treturn array(\n\t\t\t\t\t'Type' => self::TYPE_BYTES,\n\t\t\t\t\t'ValueBytes' => new MongoBinData($value) \n\t\t\t);\n\t\t} else if (is_int($value)) {\n\t\t\treturn array(\n\t\t\t\t\t'Type' => self::TYPE_INT,\n\t\t\t\t\t'ValueInt' => $value \n\t\t\t);\n\t\t} else if (is_float($value)) {\n\t\t\treturn array(\n\t\t\t\t\t'Type' => self::TYPE_FLOAT,\n\t\t\t\t\t'ValueFloat' => $value \n\t\t\t);\n\t\t} else if (is_object($value)) {\n\t\t\tswitch (get_class($value)) {\n\t\t\t\tcase 'VTUnsignedInt':\n\t\t\t\t\treturn array(\n\t\t\t\t\t\t\t'Type' => self::TYPE_UINT,\n\t\t\t\t\t\t\t'ValueUint' => $value->bsonValue \n\t\t\t\t\t);\n\t\t\t}\n\t\t} else if (is_array($value)) {\n\t\t\treturn self::buildBsonP3ForList($value);\n\t\t}\n\t\t\n\t\tthrow new Exception('Unknown bind variable type.');\n\t}",
"private function genByType($value) {\n $type = gettype($value);\n $schema = array();\n switch ($type) {\n case 'boolean':\n $schema['type'] = 'boolean';\n $schema['default'] = false;\n break;\n case 'integer':\n $schema['type'] = 'integer';\n $schema['default'] = 0;\n $schema['minimum'] = 0;\n $schema['maximum'] = PHP_INT_MAX;\n $schema['exclusiveMinimum'] = 0;\n $schema['exclusiveMaximum'] = PHP_INT_MAX;\n break;\n case 'double':\n $schema['type'] = 'number';\n $schema['default'] = 0;\n $schema['minimum'] = 0;\n $schema['maximum'] = PHP_INT_MAX;\n $schema['exclusiveMinimum'] = 0;\n $schema['exclusiveMaximum'] = PHP_INT_MAX;\n break;\n case 'string':\n $schema['type'] = 'string';\n $schema['format'] = 'regex';\n $schema['pattern'] = '/^[a-z0-9]+$/i';\n $schema['minLength'] = 0;\n $schema['maxLength'] = PHP_INT_MAX;\n break;\n case 'array':\n $schema['type'] = 'array';\n $schema['minItems'] = 0;\n $schema['maxItems'] = 20;\n $items = array();\n foreach ($value as $value) {\n $items = $this->genByType($value);\n break;\n }\n $schema['items'] = $items;\n break;\n case 'object':\n $schema['type'] = 'object';\n $items = array();\n $value = get_object_vars($value);\n foreach ($value as $key => $value) {\n $items[$key] = $this->genByType($value);\n }\n $schema['properties'] = $items;\n break;\n case 'null': // any in union types\n $schema['type'] = 'null';\n break;\n default:\n break;\n }\n return $schema;\n }",
"private static function CreateValue($value)\r\n {\r\n $type = gettype($value);\r\n switch ($type)\r\n {\r\n case 'NULL':\r\n $str = 'NULL';\r\n break;\r\n case 'string':\r\n case 'integer':\r\n case 'double':\r\n $str = (string)$value;\r\n break;\r\n case 'boolean':\r\n $str = ($value ? 'True' : 'False');\r\n break;\r\n default:\r\n $str = var_export($value, true);\r\n break;\r\n }\r\n return array('type' => $type, 'value' => $str);\r\n }",
"protected function getPossibleScalarTypes($value): array\n {\n return array_filter($this->types, function(string $type) use ($value) {\n if (substr($type, -2) === '[]') {\n return false;\n }\n\n switch (strtolower($type)) {\n case 'string':\n return !is_bool($value);\n case 'integer':\n return !is_string($value) || is_numeric($value);\n case 'float':\n return !is_bool($value) && (!is_string($value) || is_numeric($value));\n case 'boolean':\n return !is_string($value) || in_array($value, BooleanHandler::getBooleanStrings());\n case 'datetime':\n return !is_bool($value) && !is_float($value) && (!is_string($value) || strtotime($value) !== false);\n case 'array':\n case 'object':\n case 'resource':\n case 'stdclass':\n return false;\n default:\n return true;\n }\n });\n }",
"public function getTypeByValue($value);",
"protected function _createValue( $value ) {\n if ( is_array( $value ) ) {\n $result = new ArrayObject();\n foreach( $value as $key => $item ) {\n if ( is_numeric( $key ) ) {\n $result->set(\n new EmptyObject(),\n $this->_createValue( $item )\n );\n } else {\n $result->set(\n new ValueObject( $key ),\n $this->_createValue( $item )\n );\n }\n }\n return $result;\n } else {\n return new ValueObject( $value );\n }\n }",
"public function userTypeWithCompositeTypes() {\n return array_map(function ($cassandraType) {\n $userType = Type::userType(\"a\", $cassandraType[0]);\n $userType = $userType->withName(self::userTypeString($userType));\n $user = $userType->create();\n $user->set(\"a\", $cassandraType[1][0]);\n return array($userType, $user);\n }, $this->compositeCassandraTypes());\n }",
"public static function createValue($value)\n {\n if ($value instanceof Value) {\n return $value;\n } elseif (is_bool($value)) {\n return new BooleanValue($value);\n } elseif (is_float($value) || is_int($value)) {\n return new NumberValue(strval($value));\n } elseif (is_string($value)) {\n return new TextValue($value);\n } elseif ($value instanceof AdManagerDateTime) {\n return new DateTimeValue($value);\n } elseif ($value instanceof Date) {\n return new DateValue($value);\n } elseif (is_array($value)) {\n $values = [];\n foreach ($value as $valueEntry) {\n $values[] = self::createValue($valueEntry);\n }\n $setValue = new SetValue();\n $setValue->setValues($values);\n\n return $setValue;\n } elseif ($value instanceof Targeting) {\n return new TargetingValue($value);\n } else {\n throw new InvalidArgumentException(\n sprintf(\n 'Unsupported value type [%s]',\n is_object($value) ? get_class($value) : gettype($value)\n )\n );\n }\n }",
"function sfa_SFA_FIELD_TYPE_type_filter($raw_value, &$filtered_values, $ac3_field_tag, $ac3_data, &$fields, $node, $connector_params, $virtual_type_params) {}",
"private function buildBlockTypes(ContainerBuilder $container, array $blockTypes): Generator\n {\n foreach ($blockTypes as $identifier => $blockType) {\n $serviceIdentifier = sprintf('netgen_block_manager.block.block_type.%s', $identifier);\n\n $container->register($serviceIdentifier, BlockType::class)\n ->setArguments(\n [\n $identifier,\n $blockType,\n new Reference(\n sprintf(\n 'netgen_block_manager.block.block_definition.%s',\n $blockType['definition_identifier']\n )\n ),\n ]\n )\n ->setLazy(true)\n ->setPublic(true)\n ->setFactory([BlockTypeFactory::class, 'buildBlockType']);\n\n yield $identifier => new Reference($serviceIdentifier);\n }\n }",
"private function createMultiValueValues()\n {\n $createValues = [\n ['image 1', self::CONTENT_TYPE_JPEG],\n ['image 2', self::CONTENT_TYPE_PNG],\n ['test string', self::CONTENT_TYPE_STRING],\n ];\n\n $items = [];\n\n foreach ($createValues as $createValue) {\n $items[] = $this->createMultiValueValue($createValue[0], $createValue[1]);\n }\n\n return $items;\n }",
"public function dbTypecast($value);",
"public function getContainerTypes(\\Magento\\Framework\\DataObject $params = null);",
"protected function composite_data_types_1_2() {\n // Define the composite data types\n $collection_type = Cassandra\\Type::collection(Cassandra\\Type::varchar());\n $map_type = Cassandra\\Type::map(\n Cassandra\\Type::int(),\n Cassandra\\Type::varchar());\n $set_type = Cassandra\\Type::set(Cassandra\\Type::varchar());\n\n return array(\n // Collection data type\n array(\n $collection_type,\n array(\n $collection_type->create(\"a\", \"b\", \"c\"),\n $collection_type->create(\"1\", \"2\", \"3\"),\n $collection_type->create(\n \"The quick brown fox jumps over the lazy dog\",\n \"Hello World\",\n \"DataStax PHP Driver Extension\"\n )\n )\n ),\n\n // Map data type\n array(\n $map_type,\n array(\n $map_type->create(1, \"a\", 2, \"b\", 3, \"c\"),\n $map_type->create(4, \"1\", 5, \"2\", 6, \"3\"),\n $map_type->create(\n 7, \"The quick brown fox jumps over the lazy dog\",\n 8, \"Hello World\",\n 9, \"DataStax PHP Driver Extension\"\n )\n )\n ),\n\n // Set data type\n array(\n $set_type,\n array(\n $set_type->create(\"a\", \"b\", \"c\"),\n $set_type->create(\"1\", \"2\", \"3\"),\n $set_type->create(\n \"The quick brown fox jumps over the lazy dog\",\n \"Hello World\",\n \"DataStax PHP Driver Extension\"\n )\n )\n )\n );\n }",
"private function buildBlockTypes(ContainerBuilder $container, array $blockTypes): Generator\n {\n foreach ($blockTypes as $identifier => $blockType) {\n $serviceIdentifier = sprintf('netgen_layouts.block.block_type.%s', $identifier);\n\n $container->register($serviceIdentifier, BlockType::class)\n ->setArguments(\n [\n $identifier,\n $blockType,\n new Reference(\n sprintf(\n 'netgen_layouts.block.block_definition.%s',\n $blockType['definition_identifier'],\n ),\n ),\n ],\n )\n ->setLazy(true)\n ->setPublic(false)\n ->setFactory([BlockTypeFactory::class, 'buildBlockType']);\n\n yield $identifier => new Reference($serviceIdentifier);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Data filter for submitted requisitions (By different staff levels) | public function filterByDateSubmitted(Request $request)
{
$from = Carbon::parse($request->from);
$to = Carbon::parse($request->to);
$Submittedrequisitions = Requisition::join('budgets','requisitions.budget_id','budgets.id')->join('items','requisitions.item_id','items.id')->join('accounts','requisitions.account_id','accounts.id')->join('users','requisitions.user_id','users.id')->join('departments','users.department_id','departments.id')->select('requisitions.*','users.*','departments.*','budgets.title as budget','items.item_name as item','accounts.account_name as account', 'users.username as username','departments.name as department','requisitions.status as status')->get();
$user = User::where('id', Auth::user()->id)->first();
$requisition = Requisition::where('user_id', Auth::user()->id)->first();
$staff_levels = StaffLevel::all();
$departments = Department::all();
$hod = $staff_levels[0]->id;
$ceo = $staff_levels[1]->id;
$supervisor = $staff_levels[2]->id;
$normalStaff = $staff_levels[3]->id;
$financeDirector = $staff_levels[4]->id;
// $submitted_requisitions = Requisition::where('user_id', Auth::user()->id)->select('user_id')->distinct('user_id','created_at')->get();
// foreach ($submitted_requisitions as $requisition) {
if (Auth::user()->stafflevel_id == $hod)
{
$user_dept = User::join('departments','users.department_id','departments.id')
->where('departments.id', Auth::user()->department_id)
->select('users.department_id as dept_id')
->distinct('dept_id')
->first();
$limitHOD = Limit::where('stafflevel_id',$hod)->select('max_amount')->first();
$limitNormalStaff = Limit::where('stafflevel_id',$normalStaff)
->select('max_amount')->first();
$submitted_requisitions = Requisition::join('users','users.id','requisitions.user_id')
->join('departments','users.department_id','departments.id')
->select('requisitions.req_no','users.*','user_id','users.username as username','departments.name as department')
->where('departments.id',$user_dept->dept_id)
->where('users.stafflevel_id','!=',[$ceo])
// ->whereBetween('requisitions.gross_amount', [0,$limitSupervisor->max_amount])
->whereIn('users.stafflevel_id',[$normalStaff, $supervisor, $hod])
->where('requisitions.status', 'like', '%Approved%')
// ->orWhere('requisitions.status', 'like', '%Confirmed%')
// ->orWhere('requisitions.status', 'like', '%Paid%')
->orWhere('requisitions.status', 'like', '%onprocess%')
// ->where('requisitions.gross_amount','>',$limitNormalStaff->max_amount)
->whereDate('requisitions.created_at', '>=', $from)
->whereDate('requisitions.created_at', '<=', $to)
->distinct('req_no')
->get();
return view('requisitions.hod-requisitions', compact('submitted_requisitions','staff_levels','requisition','Submittedrequisitions'))->withUser($user);
}elseif (Auth::user()->stafflevel_id == $supervisor)
{
$user_dept = User::join('departments','users.department_id','departments.id')
->where('departments.id', Auth::user()->department_id)
->select('users.department_id as dept_id')
->distinct('dept_id')
->first();
$limitNormalStaff = Limit::where('stafflevel_id',$normalStaff)
->select('max_amount')->first();
$limitSupervisor = Limit::where('stafflevel_id',$supervisor)
->select('max_amount')->first();
$submitted_requisitions = Requisition::join('users','users.id','requisitions.user_id')
->join('departments','users.department_id','departments.id')
->select('requisitions.req_no','users.*','user_id','users.username as username','departments.name as department')
->where('departments.id',$user_dept->dept_id)
->where('users.stafflevel_id','!=',[$hod])
// ->whereBetween('requisitions.gross_amount', [0,$limitSupervisor->max_amount])
->whereIn('users.stafflevel_id',[$normalStaff, $supervisor])
->where('requisitions.status', 'like', '%Approved%')
// ->orWhere('requisitions.status', 'like', '%Confirmed%')
// ->orWhere('requisitions.status', 'like', '%Paid%')
->orWhere('requisitions.status', 'like', '%onprocess%')
// ->where('requisitions.gross_amount','>',$limitNormalStaff->max_amount)
->whereDate('requisitions.created_at', '>=', $from)
->whereDate('requisitions.created_at', '<=', $to)
->distinct('req_no')
->get();
return view('requisitions.supervisor-requisitions', compact('submitted_requisitions','staff_levels','requisition'))->withUser($user);
}elseif (Auth::user()->stafflevel_id == $ceo)
{
$hodLimit = Limit::where('stafflevel_id',$hod)->select('max_amount')->first();
$ceoLimit = Limit::where('stafflevel_id',$ceo)->select('max_amount')->first();
$submitted_requisitions = Requisition::select('user_id')
->join('users','users.id','requisitions.user_id')
->join('departments','users.department_id','departments.id')
->select('requisitions.req_no','users.*','user_id','users.username as username','departments.name as department')
->where('requisitions.status', 'like', '%Approved%')
// ->orWhere('requisitions.status', 'like', '%Confirmed%')
// ->orWhere('requisitions.status', 'like', '%Paid%')
->orWhere('requisitions.status', 'like', '%onprocess%')
->whereIn('users.stafflevel_id', [$hod,$financeDirector])
// ->orWhere('users.stafflevel_id', ['4','3'])
// ->whereBetween('requisitions.gross_amount', ['500000','5000000'])
->whereDate('requisitions.created_at', '>=', $from)
->whereDate('requisitions.created_at', '<=', $to)
->distinct('req_no')
->get();
return view('requisitions.ceo-requisitions', compact('submitted_requisitions','staff_levels','requisition'))->withUser($user);
}elseif (Auth::user()->stafflevel_id == $normalStaff)
{
$user_dept = User::join('departments','users.department_id','departments.id')
->where('departments.id', Auth::user()->department_id)
->select('users.department_id as dept_id')
->distinct('dept_id')
->first();
$submitted_requisitions = Requisition::join('users','users.id','requisitions.user_id')
->join('departments','users.department_id','departments.id')
->select('requisitions.req_no','users.*','user_id','users.username as username','departments.name as department')
->where('departments.id',$user_dept->dept_id)
->where('users.stafflevel_id','!=',$hod)
->where('users.stafflevel_id','!=',$ceo)
->where('users.stafflevel_id','!=',$supervisor)
->where('users.stafflevel_id','!=',$financeDirector)
->where('requisitions.status', 'like', '%Approved%')
// ->orWhere('requisitions.status', 'like', '%Confirmed%')
// ->orWhere('requisitions.status', 'like', '%Paid%')
->orWhere('requisitions.status', 'like', '%onprocess%')
->whereIn('users.stafflevel_id', [$normalStaff])
->whereDate('requisitions.created_at', '>=', $from)
->whereDate('requisitions.created_at', '<=', $to)
->distinct('req_no')
->get();
return view('requisitions.normal-staff-requisitions', compact('submitted_requisitions','staff_levels','requisition'))->withUser($user);
}elseif (Auth::user()->stafflevel_id == $financeDirector)
{
$user_dept = User::join('departments','users.department_id','departments.id')
->where('departments.id', Auth::user()->department_id)
->select('users.department_id as dept_id')
->distinct('dept_id')
->first();
$submitted_requisitions = Requisition::join('users','users.id','requisitions.user_id')
->join('staff_levels','users.stafflevel_id','staff_levels.id')
->join('departments','users.department_id','departments.id')
->select('requisitions.req_no','users.*','user_id','users.username as username','departments.name as department')
->where('requisitions.status', 'like', '%Approved%')
// ->orWhere('requisitions.status', 'like', '%Confirmed%')
// ->orWhere('requisitions.status', 'like', '%Paid%')
->orWhere('requisitions.status', 'like', '%onprocess%')
->whereDate('requisitions.created_at', '>=', $from)
->whereDate('requisitions.created_at', '<=', $to)
->distinct('req_no')
->get();
return view('requisitions.finance-requisitions', compact('submitted_requisitions','staff_levels','requisition','Submittedrequisitions'))->withUser($user);
}else {
$user_dept = User::join('departments','users.department_id','departments.id')
->where('departments.id', Auth::user()->department_id)
->select('users.department_id as dept_id')
->distinct('dept_id')
->first();
$submitted_requisitions = Requisition::join('users','users.id','requisitions.user_id')
->join('staff_levels','users.stafflevel_id','staff_levels.id')
->join('departments','users.department_id','departments.id')
->where('departments.name','Finance')
->select('requisitions.req_no','users.*','user_id','users.username as username','departments.name as department')
->where('requisitions.status', 'like', '%Approved%')
// ->orWhere('requisitions.status', 'like', '%Confirmed%')
// ->orWhere('requisitions.status', 'like', '%Paid%')
->orWhere('requisitions.status', 'like', '%onprocess%')
->whereDate('requisitions.created_at', '>=', $from)
->whereDate('requisitions.created_at', '<=', $to)
->distinct('req_no')
->get();
return view('requisitions.finance-requisitions', compact('submitted_requisitions','staff_levels','requisition','Submittedrequisitions'))->withUser($user);
}
} | [
"function scorecardUserCond() {\n //getting all users under this supervisor \n $accessBranchList = $this->_getAccessBranchListArray();\n $accessDeptList = $this->_getAccessDeptListArray();\n $conditions = array();\n\n //$conditions = array();\n if ($accessBranchList != 'all') {\n $branchCndnt = array('User.branch_id' => $accessBranchList);\n $conditions = array_merge($conditions, $branchCndnt);\n }\n\n //$conditions = array();\n if ($accessDeptList != 'all') {\n $deptsCndnt = array('User.department_id' => $accessDeptList);\n $conditions = array_merge($conditions, $deptsCndnt);\n }\n if ($this->Session->read('filterScorecard') != '') {\n\n if ($this->Session->read('filterScorecard.branch_list') != '') {\n $brachCndnt = array('User.branch_id' => $this->Session->read('filterScorecard.branch_list'));\n $conditions = array_merge($conditions, $brachCndnt);\n } else {\n $this->Session->delete('filterData');\n }\n }\n return $conditions;\n }",
"function summary_filter_form(&$form_status) {\n $sla = array('STD', 'offer');\n if (!$form_status['post']) {\n $values['sla'] = 0;\n $values['worktime'] = 0;\n $values['approved'] = TRUE;\n $values['date_from'] = array(\n 'year' => 2014,\n 'month' => 7,\n 'day' => 1);\n $values['date_to'] = array(\n 'year' => (int) gmdate('Y'),\n 'month' => (int) gmdate('m'),\n 'day' => (int) gmdate('d'));\n } else {\n $values = $form_status['post'];\n //limita l'escursione al contratto corrente\n if (dateArrayToTime($values['date_from']) < dateArrayToTime(array('year' => 2014, 'month' => 7, 'day' => 1))) {\n $values['date_from'] = array('year' => 2014, 'month' => 7, 'day' => 1);\n } else {\n $values['date_from']['year'] = (int) $values['date_from']['year'];\n $values['date_from']['month'] = (int) $values['date_from']['month'];\n $values['date_from']['day'] = (int) $values['date_from']['day'];\n }\n//limita alla data corrente \n if (dateArrayToTime($values['date_to']) >= time()) {\n $values['date_to'] = array('year' => (int) date('Y'), 'month' => (int) date('m'), 'day' => (int) date('d'));\n } else {\n $values['date_to']['year'] = (int) $values['date_to']['year'];\n $values['date_to']['month'] = (int) $values['date_to']['month'];\n $values['date_to']['day'] = (int) $values['date_to']['day'];\n }\n }\n $f['c1']['#type'] = 'fieldset';\n $f['c1']['#collapsible'] = FALSE;\n $f['c1']['#attributes']['class'] = 'container-inline';\n $f['c1']['date_from'] = array(\n '#title' => 'valutazione a partire da',\n '#type' => 'date',\n '#default_value' => $values['date_from'],\n '#attributes' => array('onchange' => \"this.form.submit();\")\n );\n $f['c1']['date_to'] = array(\n '#title' => ' fino a',\n '#type' => 'date',\n '#default_value' => $values['date_to'],\n '#attributes' => array('onchange' => \"this.form.submit();\")\n );\n// $f['c1']['approved'] = array(\n// '#title' => 'Solo non approvati',\n// '#type' => 'checkbox',\n// '#default_value' => $values['approved'],\n// '#attributes' => array('onchange' => \"this.form.submit();\")\n// );\n $f['c2']['#type'] = 'fieldset';\n $f['c2']['#collapsible'] = FALSE;\n $f['c2']['#attributes']['class'] = 'container-inline';\n $f['c2']['worktime'] = array(\n '#title' => 'Selezione orario di lavoro',\n '#type' => 'radios',\n '#default_value' => $values['worktime'],\n '#options' => array('Lavorativo standard (8x5)',\n 'Come da offerta (12x5+4x1)'),\n '#attributes' => array('onclick' => \"this.form.submit();\"),\n '#suffix' => ' ',\n );\n $f['c2']['sla'] = array(\n '#title' => 'Livello di servizio',\n '#type' => 'radios',\n '#default_value' => $values['sla'],\n '#options' => array('Da capitolato',\n 'Da offerta'),\n '#attributes' => array('onclick' => \"this.form.submit();\")\n );\n\n $f['#submit'] = array('summary_filter_submit');\n $f['summary'] = array(\n '#type' => 'fieldset',\n '#collapsible' => FALSE,\n '#value' => summary_grid($values),\n );\n $f['counters'] = array(\n '#title' => 'Situazione ritardi manutenzioni programmate',\n '#type' => 'fieldset',\n '#collapsible' => FALSE,\n '#value' => sommario_programmate(),\n );\n $f['maintenance'] = array(\n '#title' => 'Piani manutenzioni programmate',\n '#type' => 'fieldset',\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n '#value' => planned_maintennace($values),\n );\n\n return $f;\n}",
"abstract public function get_filtering_data();",
"abstract protected function filterEducation($data);",
"public function filterAction()\n {\n $authenticatedUser = $this->communityUserService->getCommunityUser();\n $this->view->assign('kantons', $authenticatedUser->getPartyAdminAllowedCantons());\n $this->view->assign('demand', $this->getDemandFromSession(true));\n $statusFilters = array(\n 'active' => LocalizationUtility::translate('panelInvitations.filter.status.active', 'easyvote_education'),\n 'pending' => LocalizationUtility::translate('panelInvitations.filter.status.pending', 'easyvote_education'),\n 'archived' => LocalizationUtility::translate('panelInvitations.filter.status.archived',\n 'easyvote_education'),\n );\n $this->view->assign('statusFilters', $statusFilters);\n }",
"public function filter() {\n $this->autoRender = false;\n $params = $this->request->data;\n $this->BullhornConnection->BHConnect();\n $query = [];\n $candidate_id = isset($params['candidate_id']) ? $params['candidate_id'] : \"\";\n $invitedJobs = [];\n $currentTimestamp = time();\n if (isset($params['aminvited']) && !empty($params['aminvited'])) {\n $invitedJobs = $this->getInvitedJobsList($params['aminvited']);\n }\n if ($candidate_id != \"\") {\n $invisibleTable = TableRegistry::get('InvisibleJob');\n $getCandidate = $invisibleTable->find()->select()->where(['candidate_id' => $candidate_id])->toArray();\n list($hourlyRate, $empPreference,$states) = $this->getHourlyRateEmpPref($candidate_id);\n $query[] = (!empty($getCandidate) && !empty($getCandidate[0]['joborder_ids'])) ? \"-id:(\" . str_replace(\",\", \"+,+\", $getCandidate[0]['joborder_ids']) . \")\" : \"\";\n $query[] = '((customFloat1:[1+TO+' . $hourlyRate . ']+AND+customFloat2:[' . $hourlyRate . '+TO+200])+OR+customFloat2:[' . $hourlyRate . '+TO+200])';\n if (!empty($empPreference)) {\n $words = implode('\"+OR+\"', $empPreference);\n $validString = preg_replace('!\\s+!', '+', $words); // remove space if exists\n $query[] = 'title:(\"' . $validString . '\")';\n } else {\n $query[] = \"title:(dummytitle)\"; // to get empty data when Desired title is empty.\n }\n if(!empty($states)) {\n $query[]= 'address.state:\"'. $states .'\"';\n }\n $company_ids = $this->get_owned_company(CANDIDATE_ROLE, $candidate_id);\n if (!empty($company_ids)) {\n $control_company_ids = implode('+OR+', $company_ids);\n $query[] = 'clientCorporation.id:(' . $control_company_ids . ')';\n }\n }\n $words = \"\";\n $isBookmarkScreen = false;\n $per_page = 10;\n $page_start = (isset($params['page'])) ? ($params['page'] - 1) * $per_page : 0;\n if (isset($params['keyword']) && !empty($params['keyword'])) {\n $params['keyword'] = trim($params['keyword']);\n if (str_word_count($params['keyword']) == 1) {\n $words = $params['keyword'];\n } else {\n $words = implode('*+', str_word_count($params['keyword'], 1));\n }\n $query[] = \"title:(\" . $words . \"*)\";\n }\n if (isset($params['city']) && !empty(trim($params['city']))) {\n $query[] = \"customText1:\" . trim($params['city']);\n }\n if (isset($params['categoryId']) && !empty($params['categoryId'])) {\n// $query[] = \"categories.id:(\" . $params['categoryId'] . \")\";\n $query[] = \"customText8:\" . $params['categoryId'];\n }\n if (isset($params['PostingDate'])) {\n $sort = \"sort=-dateAdded\";\n } else {\n $sort = \"sort=-id\";\n }\n if ($candidate_id != \"\" && isset($params['hourlyRateLow']) && !empty($params['hourlyRateLow'])) { // candidate rate per hour\n $query[] = \"customFloat1:[\" . $params['hourlyRateLow'] . \"+TO+*]\";\n }\n if (isset($params['ScreenStatus']) && $params['ScreenStatus'] == 'Bookmark') {\n $isBookmarkScreen = true;\n }\n\n $matchpercent = (isset($params['PercentageMatched'])) ? 1 : 0;\n $hiringgrade = (isset($params['HiringGrade'])) ? 1 : 0;\n if ($hiringgrade) {\n $hiringMangerGrades = $this->getHiringManagerGrade(); //pr($hiringMangerGrades);\n if (!empty($hiringMangerGrades)) {\n $query[] = \"clientContact.id:(\" . implode('+OR+', array_keys($hiringMangerGrades)) . \")\";\n }\n }\n $queryFilter = implode('+AND+', array_filter($query));\n $queryFilter = !empty($query) ? '+AND+(' . $queryFilter . ')' : '';\n $url = $_SESSION['BH']['restURL'] . '/search/JobOrder?query=isOpen:1+AND+isPublic:1+AND+customInt1:1+AND+isDeleted:false+AND+NOT+status:Placed+AND+NOT+status:Closed' . $queryFilter . '&' . $sort . '&fields=id,'\n . 'employmentType,type,address,clientContact,clientCorporation,customInt1,sendouts(id)'\n . ',status,isDeleted,payRate,salary,salaryUnit,correlatedCustomInt1,customInt2,customText1,customText2,customText3,customText4,customText5,'\n . 'customText6,customFloat1,customFloat2,dateAdded,startDate,dateClosed,dateEnd,title,description,skills[100](id,name)&BhRestToken=' . $_SESSION['BH']['restToken'] . '&start=' . $page_start . '&count=' . $per_page;\n $post_params = json_encode($params);\n $req_method = 'GET';\n $response = $this->BullhornCurl->curlFunction($url, $post_params, $req_method);\n //$response['page_count'] = ceil($response['total'] / $per_page);\n if (isset($response['data']) && !empty($candidate_id)) {\n $response['page_count'] = ceil($response['total'] / $per_page);\n $i = 0;\n $candidateSkills = $this->getCandidateSkills($candidate_id);\n $candidateMatchPercent = [];\n $hiringMangerGradesToSort = [];\n $invisible_job = $this->get_bookmarked_jobs($candidate_id);\n foreach ($response['data'] as $jobOrder) {\n $status = $this->isJobBookmarked($candidate_id, $jobOrder['id'], $invisible_job);\n $response['data'][$i]['isBookmarked'] = $status;\n if ($isBookmarkScreen && $status == 0) { // show only bookmarked jobs in bookmark screen. So removed unbookmarked jobs here\n unset($response['data'][$i]);\n }\n if (isset($response['data'][$i]) && $response['data'][$i]['customInt2'] == 1 && (empty($invitedJobs) || !in_array($response['data'][$i]['id'], $invitedJobs))) {\n unset($response['data'][$i]); // remove if this job is not invited to email user \n }\n // Calculate Match %\n if (isset($response['data'][$i]) && $matchpercent) {\n $skills = [];\n if (!empty($jobOrder['skills']['data'])) {\n foreach ($jobOrder['skills']['data'] as $skill) {\n $skills[] = $skill['name'];\n }\n }\n $percent = $this->getMatchPercent($candidateSkills, $skills);\n $response['data'][$i]['candidateMatchPercent'] = $percent;\n $candidateMatchPercent[$i] = $percent;\n }\n if (isset($response['data'][$i]) && $hiringgrade) {\n if (isset($hiringMangerGrades[$response['data'][$i]['clientContact']['id']])) {\n $response['data'][$i]['hiringManagerGrade'] = $hiringMangerGrades[$response['data'][$i]['clientContact']['id']];\n $hiringMangerGradesToSort[$i] = $hiringMangerGrades[$response['data'][$i]['clientContact']['id']];\n } else {\n $hiringMangerGradesToSort[$i] = 0;\n }\n }\n\n// if ($this->isVisible($candidate_id, $jobOrder['id'])) {\n// unset($response['data'][$i]);\n// }\n $i++;\n continue;\n }\n\n if ($matchpercent) {\n array_multisort($candidateMatchPercent, SORT_DESC, $response['data']);\n }\n if ($hiringgrade) {\n array_multisort($hiringMangerGradesToSort, SORT_DESC, $response['data']);\n }\n if ($matchpercent && $hiringgrade) {\n array_multisort($candidateMatchPercent, SORT_DESC, $hiringMangerGradesToSort, SORT_DESC, $response['data']);\n }\n $response['data'] = array_values($response['data']);\n $response = $this->checkjobDate($response, 'filter', $invitedJobs,CANDIDATE_ROLE); //for filter future start date and past enddate\n \n// foreach ($response['data'] as $jobOrder) {\n// $response['data'][$i]['dateEndFormatted'] = date(\"M d,Y\", $response['data'][$i]['dateEnd']);\n// $response['data'][$i]['dateTodayTime'] = $currentTimestamp;\n// $response['data'][$i]['dateTodayTimeFormatted'] = date(\"M d,Y\", $currentTimestamp);\n// if (strtotime($response['data'][$i]['dateEndFormatted']) < strtotime($response['data'][$i]['dateTodayTimeFormatted'])) {\n// unset($response['data'][$i]); // remove expired jobs\n// $response['total'] = $response['total'] - 1;\n// $response['count'] = $response['count'] - 1;\n// }\n// if (isset($response['data'][$i]) && $response['data'][$i]['customInt2'] == 1 && (empty($invitedJobs) || !in_array($response['data'][$i]['id'], $invitedJobs))) {\n// unset($response['data'][$i]); // remove if this job is not invited to email user \n// $response['total'] = $response['total'] - 1;\n// $response['count'] = $response['count'] - 1;\n// }\n// $i++;\n// continue;\n// }\n $response['data'] = array_values($response['data']);\n }\n if (isset($response['data']) && !empty($response['data'])) {\n $response['status'] = 1;\n $response['hidden_company'] = HIDDEN_COMPANY_TEXT; //for showing hidden company text\n $response['message'] = \"We found some records matching for your search\";\n } else {\n $response['status'] = 0;\n $response['message'] = \"No records found\";\n }\n echo json_encode($response);\n }",
"public function getFilterByRoleCondition($params)\n {\n \t$alais \t\t\t\t\t= $params['alais'];\n \t$user_info \t\t\t\t= $params['user_info'];\n \t$collection_store_id \t= empty($params['collection_store_id'])?null:$params['collection_store_id'];\n \t$getStoreOthers \t\t= empty($params['getStoreOthers'])?'':$params['getStoreOthers'];\n \t$role_condition\t\t\t= \"\";\n \t//$role_condition = parent::getFilterByRoleCondition($user_info,$alais,null);\n $user_role = $user_info['userRole'];\n $company_id = $user_info['company_id'];\n $department_id = $user_info['department_id'];\n if (!empty($alais))\n $alais .= \".\";\n if (RoleUtil::isSuperAdmin($user_role) || RoleUtil::isAdmin($user_role)){\n //allow all records for for super user.\n }\n else if (RoleUtil::isCompanyAdmin($user_role))\n {\n // all department of same company\n if(!empty($collection_store_id)){\n \t$role_condition = \" ({$alais}company_id = {$company_id} OR {$alais}store_id = {$collection_store_id}) \";\n }\n else\n\t $role_condition = \" {$alais}company_id = {$company_id} \";\n }\n else if (RoleUtil::isStoreManager($user_role))\n {\n // same department of same company\n if($getStoreOthers=='1'){\n \t\t$role_condition = \" {$alais}company_id = {$company_id} \";\n }\n else if(!empty($collection_store_id)){\n \t$role_condition = \" {$alais}company_id = {$company_id} AND {$alais}store_id = {$collection_store_id} \";\n }\n else\n \t$role_condition = \" {$alais}company_id = {$company_id} AND {$alais}store_id = {$department_id} \";\n }\n else\n {\n // same department of same company\n $role_condition = \" {$alais}company_id = {$company_id} AND {$alais}store_id = {$department_id} \"; \n }\n return $role_condition;\n }",
"private function restrict_query()\n\t{\n\t\t$settings = Settings::Get();\n\t\t$access = Session::Get()->getAccess();\n\n\t\tif ($settings->getFilterPattern())\n\t\t\tdie('you cannot combine filter-pattern and local history');\n\t\tif (count($settings->getQuarantineFilter()) > 0)\n\t\t\tdie('you cannot combine quarantine-filter and local history');\n\t\tif (count($settings->getArchiveFilter()) > 0)\n\t\t\tdie('you cannot combine archive-filter and local history');\n\n\t\t$filter = array();\n\t\t$params = array();\n\t\t$i = 0;\n\t\t$access = Session::Get()->getAccess();\n\t\tif (isset($access['userid'])) {\n\t\t\t$i++;\n\t\t\t$filter[] = 'userid = :restrict'.$i;\n\t\t\t$params[':restrict'.$i] = $access['userid'];\n\t\t}\n\t\tif (is_array($access['domain'])) {\n\t\t\tforeach ($access['domain'] as $domain) {\n\t\t\t\t$i++;\n\t\t\t\t$filter[] = 'owner_domain = :restrict'.$i;\n\t\t\t\t$params[':restrict'.$i] = $domain;\n\t\t\t}\n\t\t}\n\t\tif (is_array($access['mail'])) {\n\t\t\tforeach ($access['mail'] as $mail) {\n\t\t\t\t$i++;\n\t\t\t\t$filter[] = 'owner = :restrict'.$i;\n\t\t\t\t$params[':restrict'.$i] = $mail;\n\t\t\t}\n\t\t}\n\t\treturn array('filter' => implode(' or ', $filter), 'params' => $params);\n\t}",
"public function searchApprovals()\n\t{\n\t\t$criteria = new CDbCriteria;\n \n \n /**\n * Example of searchApproval query\n * \n * select * from cs_user as u\n * LEFT JOIN cs_work_flow_log as wflog\n * ON u.id = wflog.data_id\n * WHERE\n * u.status=2 OR (u.status = 3 AND wflog.to_user_id = 8 AND wflog.data_type = 'YumUser' AND wflog.action = 2 AND wflog.status = 0)\n */\n Yii::import('application.modules.workflow.models.*');\n \n $criteria->select = 't.*, wflog.*';\n $criteria->join = \"LEFT JOIN cs_work_flow_log as wflog ON t.id = wflog.data_id\";\n $criteria->condition = '(t.status =:pending OR (t.status = :forwarded AND (wflog.to_user_id = :staff_id OR wflog.user_id = :staff_id) AND wflog.data_type = :user_class AND wflog.action = :action AND wflog.status= :wf_status))';\n \n $criteria->params = array(\n ':pending'=> YumUser::STATUS_APPROVAL_PENDING,\n ':forwarded'=> YumUser::STATUS_FORWARDED,\n ':staff_id'=>Yii::app()->user->id,\n ':user_class'=> get_class($this),\n ':action'=> WorkFlow::ACTION_FORWARD,\n ':wf_status'=> WorkFlow::STATUS_NEW,\n );\n \n if($this->_flow != null || $this->_flow != \"\"){\n var_dump($this->_flow);\n if($this->_flow == WorkFlow::REQUEST_NEW){\n $criteria->condition = 't.status =:pending';\n $criteria->params = array(\n ':pending'=> YumUser::STATUS_APPROVAL_PENDING,\n );\n }\n elseif($this->_flow == WorkFlow::REQUEST_FORWARDED){\n $criteria->condition = '(t.status = :forwarded AND wflog.user_id = :staff_id AND wflog.data_type = :user_class AND wflog.action = :action AND wflog.status= :wf_status)';\n \n $criteria->params = array(\n ':forwarded'=> YumUser::STATUS_FORWARDED,\n ':staff_id'=>Yii::app()->user->id,\n ':user_class'=> get_class($this),\n ':action'=> WorkFlow::ACTION_FORWARD,\n ':wf_status'=> WorkFlow::STATUS_NEW,\n );\n }\n elseif($this->_flow == WorkFlow::REQUEST_RECEIVED){\n $criteria->condition = '(t.status = :forwarded AND wflog.to_user_id = :staff_id AND wflog.data_type = :user_class AND wflog.action = :action AND wflog.status= :wf_status)';\n \n $criteria->params = array(\n ':forwarded'=> YumUser::STATUS_FORWARDED,\n ':staff_id'=>Yii::app()->user->id,\n ':user_class'=> get_class($this),\n ':action'=> WorkFlow::ACTION_FORWARD,\n ':wf_status'=> WorkFlow::STATUS_NEW,\n );\n }\n }\n \n //$criteria->compare('t.status', YumUser::STATUS_APPROVAL_PENDING, false, 'AND');\n\t\t\n $criteria->together = false;\n\t\t$criteria->compare('t.id', $this->id, true);\n\t\t$criteria->compare('t.username', $this->username, true);\n \n $criteria->compare('t.user_type', $this->user_type);\n \n\t\t$criteria->compare('t.createtime', $this->createtime, true);\n\t\t\n\t\treturn new CActiveDataProvider(get_class($this), array(\n 'criteria' => $criteria,\n 'pagination' => array('pageSize' => Yum::module()->pageSize), \n ));\n\t}",
"function applyFilters() {\n\n $vName = $this->varName;\n $data = $this->inVarH->getPOST($vName);\n\n // only run filter if this field is required OR data isn't blank\n if ((($this->required)||($data != ''))||($this->forceFilter))\n return $this->inputEntity->applyFilters();\n }",
"public function advanced_filters() {\n\n\t\t\tglobal $wpdb;\n\n\n\n\t\t\t$levels = $wpdb->get_results( \"SELECT * FROM {$wpdb->prefix}js_grade_level \"\n\n\t\t\t\t. \"WHERE is_active = 1 ORDER BY level_order ASC\" );\n\n\t\t\t$level_options = array();\n\n\n\n\t\t\tif ( !empty( $_GET['level'] ) ) {\n\n\t\t\t\t$selected_level = sanitize_text_field( $_GET['level'] );\n\n\t\t\t} else {\n\n\t\t\t\t$selected_level = $levels[0]->level_id;\n\n\t\t\t}\n\n\n\n\t\t\t$subjects = $wpdb->get_results( \"SELECT * FROM {$wpdb->prefix}js_subjects \"\n\n\t\t\t\t. \"WHERE is_active = 1 AND subject_id IN (SELECT subject_id FROM {$wpdb->prefix}js_subject_levels \"\n\n\t\t\t\t\t. \"WHERE level_id = \" . $selected_level . \") \"\n\n\t\t\t\t. \"ORDER BY subject_name ASC\" , 'ARRAY_A' );\n\n\t\t\t$subject_options = array();\n\n\n\n\t\t\tif ( !empty( $_GET['subject'] ) ) {\n\n\t\t\t\t$selected_subject = sanitize_text_field( $_GET['subject'] );\n\n\t\t\t} else {\n\n\t\t\t\t$selected_subject = $subjects[0]->subject_id;\n\n\t\t\t}\n\n\n\n\t\t\tif ( !empty($levels) ) {\n\n\t\t\t\tforeach ( $levels as $level ) {\n\n\t\t\t\t\t$level_options[$level->level_id] =\n\n\t\t\t\t\t\tsprintf( '<option value=\"%s\"%s>%s</option>', \n\n\t\t\t\t\t\t\t\t $level->level_id, \n\n\t\t\t\t\t\t\t\t $selected_level === $level->level_id ? ' selected' : '', \n\n\t\t\t\t\t\t\t\t __( $level->level_name, 'js_topic_manager' ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\n\n\t\t\tif ( !empty($subjects) ) {\n\n\t\t\t\tforeach ( $subjects as $subject ) {\n\n\t\t\t\t\t$subject_options[$subject['subject_id']] =\n\n\t\t\t\t\t\tsprintf( '<option value=\"%s\"%s>%s</option>', \n\n\t\t\t\t\t\t\t\t $subject['subject_id'], \n\n\t\t\t\t\t\t\t\t $selected_subject === $subject['subject_id'] ? ' selected' : '', \n\n\t\t\t\t\t\t\t\t __( $subject['subject_name'], 'js_topic_manager' ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t?>\n\n\n\n\t\t\t<p class=\"filter-title\">Education Level:</p>\n\n\t\t\t<select name=\"topic_level\">\n\n\t\t\t\t<?php echo join( '', $level_options ); ?>\n\n\t\t\t</select>\n\n\n\n\t\t\t<p class=\"filter-title\">Subject:</p>\n\n\t\t\t<select name=\"topic_subject\">\n\n\t\t\t\t<?php echo join( '', $subject_options ); ?>\n\n\t\t\t</select>\n\n\n\n\t\t\t<?php\n\n\t\t}",
"function access_admin_grants_filter_form() {\n $session = isset($_SESSION['access_overview_grant_filter']) ? $_SESSION['access_overview_grant_filter'] : array();\n $filters = access_admin_grants_filters();\n\n $i = 0;\n $form['filters'] = array(\n '#type' => 'fieldset',\n '#title' => t('Show only access grants where'),\n '#theme' => 'exposed_filters__access_grant',\n );\n foreach ($session as $filter) {\n list($type, $value) = $filter;\n if (isset($filters[$type]['options'])) {\n $value = $filters[$type]['options'][$value];\n }\n else {\n $value = check_plain($value);\n }\n if (!empty($value)) {\n $t_args = array(\n '%property' => $filters[$type]['title'],\n '%value' => $value,\n );\n if ($i++) {\n $form['filters']['current'][] = array('#markup' => t('and where %property is %value', $t_args));\n }\n else {\n $form['filters']['current'][] = array('#markup' => t('where %property is %value', $t_args));\n }\n unset($filters[$type]);\n }\n }\n\n $form['filters']['available'] = array(\n '#type' => 'container',\n '#attributes' => array('class' => array('clearfix')),\n '#prefix' => ($i ? '<div class=\"additional-filters\">' . t('and where') . '</div>' : ''),\n );\n $form['filters']['available']['filters'] = array(\n '#type' => 'container',\n '#attributes' => array('class' => array('filters')),\n );\n foreach ($filters as $key => $filter) {\n if (isset($filter['options'])) {\n $form['filters']['available']['filters'][$key] = array(\n '#type' => 'select',\n '#options' => $filter['options'],\n '#title' => check_plain($filter['title']),\n '#default_value' => '[any]',\n );\n }\n else {\n $form['filters']['available']['filters'][$key] = array(\n '#type' => 'textfield',\n '#size' => '31',\n '#title' => check_plain($filter['title']),\n );\n }\n }\n\n $form['filters']['available']['actions'] = array(\n '#type' => 'actions',\n '#attributes' => array('class' => array('container-inline')),\n );\n $available = element_children($form['filters']['available']['filters']);\n if (!empty($available)) {\n $form['filters']['available']['actions']['submit'] = array(\n '#type' => 'submit',\n '#value' => count($session) ? t('Refine') : t('Filter'),\n );\n }\n if (count($session)) {\n $form['filters']['available']['actions']['undo'] = array(\n '#type' => 'submit',\n '#value' => t('Undo'),\n );\n $form['filters']['available']['actions']['reset'] = array(\n '#type' => 'submit',\n '#value' => t('Reset'),\n );\n }\n\n drupal_add_js('misc/form.js');\n\n return $form;\n}",
"function get_object_filters($type, $user_level, $user_id) {\n global $u;\n global $u_level;\n global $u_type;\n global $u_personid;\n global $u_guestid;\n global $u_hostid;\n global $u_agentid;\n global $u_affid;\n global $u_staffid;\n global $u_adminid;\n global $u_guestorg;\n global $u_orgid;\n $filters = array();\n $key = get_object_key($type);\n $type=strtolower($type);\n $table = get_object_table($type);\n\n // add owner_if filter to 'reservation', 'shortstay', 'room', 'bed', 'facilities'\n if(is_property_type($type)) {\n if($u_level < USER_LEVEL_SYSTEM) $filters = user_filters_property();\n } elseif(in_array($type, array('reservation', 'enquiry'))) {\n if($user_level < USER_LEVEL_GUEST) {\n $filters[] = \"$key IS NULL\"; // exclude all\n } elseif($user_level == USER_LEVEL_GUEST) {\n $filters[] = \"$table.guest_id = $u_guestid\";\n } elseif($user_level == USER_LEVEL_ORG) {\n $filters[] = \"$table.org_id = $u_orgid\";\n } elseif($user_level == USER_LEVEL_OWNER) {\n $filters[] = \"$table.host_id = $u_hostid\";\n } elseif($user_level == USER_LEVEL_AFFILIATE) {\n $filters[] = \"$table.aff_id = $u_affid\";\n } elseif($user_level == USER_LEVEL_AGENT) {\n $filters[] = \"$table.agent_id = $u_agentid\";\n } elseif($user_level == USER_LEVEL_STAFF) {\n } elseif($user_level == USER_LEVEL_ADMIN) {\n }\n }\n\n if($u_level < USER_LEVEL_SYSTEM && $type == 'site') $filters = user_filters_site();\n\n // add id filter to guest\n if($type=='guest') {\n if($user_level < USER_LEVEL_GUEST) {\n $filters[] = \"$key IS NULL\"; // exclude all\n } elseif($user_level == USER_LEVEL_GUEST) {\n $filters[] = \"$table.id = $u_guestid\";\n }\n }\n\n // add guest_id filter to invoice\n if(in_array($type, array('invoice', 'draft_invoice', 'payment', 'withdrawal', 'inv_lineitem', 'event', 'checkout', 'checkin', 'cleaning', 'transport', 'maintenance'))) {\n if($user_level < USER_LEVEL_GUEST) {\n $filters[] = \"$key IS NULL\"; // exclude all\n } elseif($user_level == USER_LEVEL_GUEST) {\n $filters[] = \"$table.guest_id = $u_guestid\";\n } elseif($user_level == USER_LEVEL_OWNER) {\n $filters[] = \"$table.host_id = $u_hostid\";\n } elseif($user_level == USER_LEVEL_ORG) {\n $filters[] = \"$table.org_id = $u_orgid\";\n } elseif($user_level == USER_LEVEL_AFFILIATE) {\n $filters[] = \"$table.aff_id = $u_affid\";\n } elseif($user_level == USER_LEVEL_AGENT) {\n $filters[] = \"$table.agent_id = $u_agentid\";\n }\n }\n \n // add id filter to credit cards\n if($type=='cc') {\n if($user_level == USER_LEVEL_GUEST) {\n $filters[] = \"$table.guest_id = $u_guestid\";\n } elseif($user_level < USER_LEVEL_ADMIN) {\n $filters[] = \"$key IS NULL\"; // exclude all\n }\n }\n\n\n // additional filters\n switch($type) {\n\n case \"reservation\":\n break;\n\n default:\n break;\n }\n return $filters;\n}",
"public function getPlanSearchFilters()\n {\n $this->data['goals'] = Goal::select('id', 'name as value')->get()->toArray();\n $this->data['training_days'] = TrainingDay::select('id', 'name as value')->get()->toArray();\n\n $this->data['equipments'] = Equipment::select('id', 'name as value')->get()->toArray();\n\n $this->data['training_ages'] = TrainingAge::select('id', 'name as value')->get()->toArray();\n\n $this->data['age_categories'] = AgeCategory::select('id', 'name as value')->get()->toArray();\n\n $this->data[\"gender\"][0][\"id\"] = \"m\";\n $this->data[\"gender\"][0][\"value\"] = \"Male\";\n $this->data[\"gender\"][1][\"id\"] = \"f\";\n $this->data[\"gender\"][1][\"value\"] = \"Female\";\n }",
"public function filterCandidate($attributes) {\r\n\t\t$paginate = $attributes['paginate'];\r\n\t\treturn $this->model->leftJoin('agency_staff', 'agency_staff.staff_id', '=', \"staff.id\")->where(\"agency_staff.staff_id\", null)\r\n\t\t->filter($attributes)->with(['user', 'staffJobs' => function ($query) use ($attributes) {\r\n \t$query->where('job_id', $attributes['job_id']);\r\n \t}])->select('staff.*')->paginate($paginate);\r\n\t}",
"public function get_submitted_criteria_edit_form_data()\n {\n \n if(isset($_POST['taskIDs']))\n {\n \n // Clear criteria array so that any we don't submit that were there before get deleted\n \n // Overall tasks\n $taskIDs = $_POST['taskIDs'];\n $taskNames = $_POST['taskNames'];\n $taskDetails = $_POST['taskDetails'];\n $taskDates = $_POST['taskTargetDates'];\n $taskOrders = $_POST['taskOrders'];\n \n // Outcomes\n $outcomeIDs = $_POST['outcomesIDs'];\n $outcomeNames = $_POST['outcomeNames'];\n $outcomeDetails = $_POST['outcomeDetails'];\n $outcomeDates = $_POST['outcomeDates'];\n $outcomeNumOfObs = $_POST['outcomeNumOfObservations'];\n \n // Obsv\n $descCritIDs = $_POST['descCritIDs'];\n $descCritNames = $_POST['descCritNames'];\n $descCritDetails = $_POST['descCritDetails'];\n \n // Standard sub criteria\n $subCritIDs = $_POST['subCritIDs'];\n $subCritNames = $_POST['subCritNames'];\n $subCritDetails = $_POST['subCritDetails'];\n $subCritMarkable = (isset($_POST['subCritMarkable'])) ? $_POST['subCritMarkable'] : array();\n \n if(empty($taskNames) || empty($taskIDs)){\n return false;\n }\n \n \n // We will store these details as:\n // Criteria -> SUb Criteria -> Sub Criteria\n // Task\n // Outcome\n // Criterion\n \n // Foreach task as DynamicID => Actual ID\n foreach($taskIDs as $DID => $ID)\n {\n \n // if there is no criteria(task) on the unit with this id, add one\n if(!isset($this->criterias[$ID]))\n {\n \n // If name is empty, skip it\n if (empty($taskNames[$DID])) continue;\n \n $params = new stdClass();\n $params->name = $taskNames[$DID];\n $params->details = $taskDetails[$DID];\n $params->ordernum = $taskOrders[$DID];\n \n $obj = new CGHBNVQCriteria(-1, $params, Qualification::LOADLEVELCRITERIA);\n \n // Target date\n $targetDate = strtotime($taskDates[$DID]);\n $obj->set_target_date($targetDate);\n\n // Check if this task has any observations/criteria\n \n \n // Outcomes\n if(isset($outcomeIDs[$DID]))\n {\n // For each outcomeid[parentdynamicid] as outcomedynamicid -> outcomeid\n foreach($outcomeIDs[$DID] as $ODID => $OID)\n {\n \n // If name is empty, skip it\n if (empty($outcomeNames[$DID][$ODID])) continue;\n \n $params = new stdClass();\n $params->name = $outcomeNames[$DID][$ODID];\n $params->details = $outcomeDetails[$DID][$ODID];\n $params->ordernum = 1;\n $params->numberOfObservations = $outcomeNumOfObs[$DID][$ODID];\n \n $subObj = new CGHBNVQCriteria(-1, $params, Qualification::LOADLEVELCRITERIA);\n \n $targetDate = strtotime($outcomeDates[$DID][$ODID]);\n $subObj->set_target_date($targetDate);\n \n $subObj->set_number_of_observations($outcomeNumOfObs[$DID][$ODID]);\n \n \n // Descriptive Criteria\n if(isset($descCritIDs[$DID][$ODID]))\n {\n // For each criteriaid[parentdynamicid] as criteriadynamicid -> criteriaid\n foreach($descCritIDs[$DID][$ODID] as $CDID => $CID)\n {\n\n // If name is empty, skip it\n if (empty($descCritNames[$DID][$ODID][$CDID])) continue;\n \n // For these we will just assign them as sub criteria on the sub criteria\n $params = new stdClass();\n $params->name = $descCritNames[$DID][$ODID][$CDID];\n $params->details = $descCritDetails[$DID][$ODID][$CDID];\n $params->ordernum = 1;\n $subSubObj = new CGHBNVQCriteria(-1, $params, Qualification::LOADLEVELCRITERIA); \n\n // Add sub criteria to overall criteria (task)\n $subObj->add_sub_criteria($subSubObj);\n\n }\n }\n \n // Add to parent\n $obj->add_sub_criteria($subObj);\n \n }\n }\n \n // Standard sub criteria\n if (isset($subCritIDs[$DID]))\n {\n \n foreach($subCritIDs[$DID] as $SCDID => $SCID)\n {\n \n // If name is empty, skip it\n if (empty($subCritNames[$DID][$SCDID])) continue;\n \n $params = new stdClass();\n $params->name = $subCritNames[$DID][$SCDID];\n $params->details = $subCritDetails[$DID][$SCDID];\n $params->ordernum = 1;\n \n if (!isset($subCritMarkable[$DID][$SCDID]))\n {\n $params->type = 'Read Only';\n }\n \n $subCritObj = new CGHBNVQCriteria(-1, $params, Qualification::LOADLEVELCRITERIA); \n // Add to parent\n $obj->add_sub_criteria($subCritObj);\n \n }\n \n }\n \n \n $this->criterias[] = $obj;\n \n }\n \n // It is already there, so update the object with new values\n else\n {\n \n $params = new stdClass();\n $params->name = $taskNames[$DID];\n $params->details = $taskDetails[$DID];\n $params->ordernum = $taskOrders[$DID];\n \n $obj = new CGHBNVQCriteria($ID, $params, Qualification::LOADLEVELCRITERIA);\n $targetDate = strtotime($taskDates[$DID]);\n $obj->set_target_date($targetDate);\n \n \n \n // Outcomes\n if(isset($outcomeIDs[$DID]))\n {\n \n // For each outcomeid[parentdynamicid] as outcomedynamicid -> outcomeid\n foreach($outcomeIDs[$DID] as $ODID => $OID)\n {\n \n // If name is empty, skip it\n if (empty($outcomeNames[$DID][$ODID])) continue;\n \n $params = new stdClass();\n $params->name = $outcomeNames[$DID][$ODID];\n $params->details = $outcomeDetails[$DID][$ODID];\n $params->ordernum = 1;\n $params->numberOfObservations = $outcomeNumOfObs[$DID][$ODID];\n \n $subObj = new CGHBNVQCriteria($OID, $params, Qualification::LOADLEVELCRITERIA);\n \n $targetDate = strtotime($outcomeDates[$DID][$ODID]);\n \n $subObj->set_target_date($targetDate);\n $subObj->set_number_of_observations($outcomeNumOfObs[$DID][$ODID]);\n\n // Descriptive Criteria\n if(isset($descCritIDs[$DID][$ODID]))\n {\n // For each criteriaid[parentdynamicid] as criteriadynamicid -> criteriaid\n foreach($descCritIDs[$DID][$ODID] as $CDID => $CID)\n {\n\n // If name is empty, skip it\n if (empty($descCritNames[$DID][$ODID][$CDID])) continue;\n \n // For these we will just assign them as sub criteria on the sub criteria\n $params = new stdClass();\n $params->name = $descCritNames[$DID][$ODID][$CDID];\n $params->details = $descCritDetails[$DID][$ODID][$CDID];\n \n $subSubObj = new CGHBNVQCriteria($descCritIDs[$DID][$ODID][$CDID], $params, Qualification::LOADLEVELCRITERIA); \n\n if(!$subSubObj->exists())\n {\n $subObj->add_sub_criteria($subSubObj);\n }\n else\n {\n // Exists, so just update\n $currentSubCriteria = $subObj->get_sub_criteria();\n $currentSubCriteria[$CID] = $subSubObj;\n $subObj->set_sub_criteria($currentSubCriteria);\n }\n\n }\n }\n\n if(!$subObj->exists())\n {\n $obj->add_sub_criteria($subObj);\n }\n else\n {\n // Exists, so just update\n $currentSubCriteria = $obj->get_sub_criteria();\n $currentSubCriteria[$OID] = $subObj;\n $obj->set_sub_criteria($currentSubCriteria);\n }\n \n }\n \n }\n \n // Standard sub criteria\n if (isset($subCritIDs[$DID]))\n {\n \n foreach($subCritIDs[$DID] as $SCDID => $SCID)\n {\n \n // If name is empty, skip it\n if (empty($subCritNames[$DID][$SCDID])) continue;\n \n $params = new stdClass();\n $params->name = $subCritNames[$DID][$SCDID];\n $params->details = $subCritDetails[$DID][$SCDID];\n $params->ordernum = 1;\n \n if (!isset($subCritMarkable[$DID][$SCDID]))\n {\n $params->type = 'Read Only';\n }\n \n $subCritObj = new CGHBNVQCriteria($SCID, $params, Qualification::LOADLEVELCRITERIA); \n \n if(!$subCritObj->exists())\n {\n $obj->add_sub_criteria($subCritObj);\n }\n else\n {\n // Exists, so just update\n $currentSubCriteria = $obj->get_sub_criteria();\n $currentSubCriteria[$SCID] = $subCritObj;\n $obj->set_sub_criteria($currentSubCriteria);\n }\n \n \n }\n \n }\n \n $this->criterias[$ID] = $obj;\n \n }\n \n }\n\n \n }\n \n \n // Remove any not sent this time\n foreach ($this->criterias as $criteria)\n {\n if (!in_array($criteria->get_id(), $taskIDs)){\n unset($this->criterias[$criteria->get_id()]);\n }\n }\n \n \n \n \n // Sign Off Sheets\n if(isset($_POST['sheetIDs']))\n {\n \n $sheetIDs = $_POST['sheetIDs'];\n $sheetNames = $_POST['sheetNames'];\n $sheetNumObs = $_POST['sheetNumObs'];\n \n $rangeIDs = $_POST['rangeIDs'];\n $rangeNames = $_POST['rangeNames'];\n \n // Clear signoff sheets\n $this->signOffSheets = array();\n \n if(empty($sheetIDs) || empty($sheetNames)){\n return false;\n }\n \n // Loop through submitted sheets\n foreach($sheetIDs as $DID => $ID)\n {\n \n // If name is empty, skip it\n if (empty($sheetNames[$DID])) continue;\n \n // If the sheet doesn't exist on the unit, add it\n if(!isset($this->signOffSheets[$ID]))\n {\n \n $sheet = new stdClass();\n if ($ID > 0) $sheet->id = $ID;\n $sheet->name = $sheetNames[$DID];\n $sheet->numofobservations = $sheetNumObs[$DID];\n $sheet->bcgtunitid = $this->id;\n $sheet->ranges = array();\n \n // Ranges on the sheet\n if(isset($rangeIDs[$DID]))\n {\n foreach($rangeIDs[$DID] as $RDID => $RID)\n {\n \n // If name is empty skip it\n if (empty($rangeNames[$DID][$RDID])) continue;\n \n $range = new stdClass();\n if ($RID > 0) $range->id = $RID;\n $range->name = $rangeNames[$DID][$RDID];\n if ($RID > 0) $sheet->ranges[$RID] = $range;\n else $sheet->ranges[] = $range;\n }\n }\n \n $this->add_signoff_sheet($sheet);\n \n }\n \n // Else, update it\n else\n {\n $sheet = $this->signOffSheets[$ID];\n $sheet->name = $sheetNames[$DID];\n $sheet->numofobservations = $sheetNumObs[$DID];\n $sheet->bcgtunitid = $this->id;\n \n // Loop through ranges and see if exist or not\n if(isset($rangeIDs[$DID]))\n {\n foreach($rangeIDs[$DID] as $RDID => $RID)\n {\n \n // If name is empty skip it\n if (empty($rangeNames[$DID][$RDID])) continue;\n \n // CHeck if range exists on sheet\n if(isset($sheet->ranges[$RID]))\n {\n // Update name\n $range = $sheet->ranges[$RID];\n $range->name = $rangeNames[$DID][$RDID];\n $sheet->ranges[$RID] = $range;\n }\n else\n {\n // Add to sheet\n $range = new stdClass();\n if ($RID > 0) $range->id = $RID;\n $range->name = $rangeNames[$DID][$RDID];\n if ($RID > 0) $sheet->ranges[$RID] = $range;\n else $sheet->ranges[] = $range;\n }\n }\n }\n }\n }\n }\n \n \n \n \n }",
"public function applyFilter()\n {\n $objSession = Session::getInstance()->getData();\n\n // Store filter values in the session\n foreach ($_POST as $key => $value) {\n if (substr($key, 0, 6) != 'table_') {\n continue;\n }\n log_message($key, 'debug.log');\n log_message(Input::post($key), 'debug.log');\n // Reset the filter\n if ($key == Input::post($key)) {\n $objSession['filter']['tl_table_list'][$key] = 'future';\n } // Apply the filter\n else {\n $objSession['filter']['tl_table_list'][$key] = Input::post($key);\n }\n }\n\n Session::getInstance()->setData($objSession);\n\n if (Input::get('id') > 0 || !isset($objSession['filter']['tl_table_list'])) {\n return;\n }\n\n $objDate = new Date(time());\n $arrReservations = [];\n\n // Filter reservations\n foreach ($objSession['filter']['tl_table_list'] as $key => $value) {\n if (substr($key, 0, 6) != 'table_') {\n continue;\n }\n\n switch ($value) {\n case 'future':\n $arrReservations = Database::getInstance()->prepare(\"\n SELECT id \n FROM tl_table_list \n WHERE arrival > ?\")\n ->execute($objDate->tstamp)->fetchEach('id');\n break;\n case 'today':\n $arrReservations = Database::getInstance()->prepare(\"\n SELECT id \n FROM tl_table_list \n WHERE arrival BETWEEN ? AND ?\")\n ->execute($objDate->dayBegin, $objDate->dayEnd)->fetchEach('id');\n break;\n case 'thisWeek':\n $arrReservations = Database::getInstance()->prepare(\"\n SELECT id \n FROM tl_table_list \n WHERE arrival BETWEEN ? AND ?\")\n ->execute($objDate->getWeekBegin(1), $objDate->getWeekEnd(0))->fetchEach('id');\n break;\n case 'thisMonth':\n $arrReservations = Database::getInstance()->prepare(\"\n SELECT id \n FROM tl_table_list \n WHERE arrival BETWEEN ? AND ?\")\n ->execute($objDate->monthBegin, $objDate->monthEnd)->fetchEach('id');\n break;\n case 'thisYear':\n $arrReservations = Database::getInstance()->prepare(\"\n SELECT id \n FROM tl_table_list \n WHERE arrival BETWEEN ? AND ?\")\n ->execute($objDate->yearBegin, $objDate->yearEnd)->fetchEach('id');\n break;\n case 'past':\n $arrReservations = Database::getInstance()->prepare(\"\n SELECT id \n FROM tl_table_list \n WHERE arrival < ?\")\n ->execute($objDate->tstamp)->fetchEach('id');\n break;\n default:\n $arrReservations = Database::getInstance()->prepare(\"\n SELECT id \n FROM tl_table_list \")\n ->execute()->fetchEach('id');\n break;\n }\n }\n\n if (is_array($arrReservations) && empty($arrReservations)) {\n $arrReservations = [0];\n }\n $GLOBALS['TL_DCA']['tl_table_list']['list']['sorting']['root'] = $arrReservations;\n }",
"public function getRequisites1c()\n {\n }",
"private function setSearchCriteriaText()\n {\n $criteriaText = '';\n\n /**\n * Gender filtering if defined\n * We have array from $_SESSION and we un-pack it\n */\n\n if(!empty($_SESSION['FilterForm']['gender']))\n {\n if(array_search('M', $_SESSION['FilterForm']['gender']) !== FALSE)\n {\n $criteriaText .= ' AND Male ';\n }\n\n if(array_search('F', $_SESSION['FilterForm']['gender']) !== FALSE)\n {\n $criteriaText .= ' AND Female ';\n }\n }\n\n /**\n * Filter by country if defined\n */\n\n if(!empty($_SESSION['FilterForm']['country.id']))\n {\n $criteriaText .= ' AND ' . CitizenType::model()->findByPk($_SESSION['FilterForm']['country.id'])->name . ' ';\n }\n\n /**\n * Filter by state if defined\n * Also decline state if country != USA or country != Any Country\n */\n\n if(!empty($_SESSION['FilterForm']['states.id']) && $_SESSION['FilterForm']['country.id'] <= 1)\n {\n $criteriaText .= ' AND ' . States::model()->findByPk($_SESSION['FilterForm']['states.id'])->name . ' ';\n }\n\n /**\n * Filter by Focus if defined\n */\n\n if(!empty($_SESSION['FilterForm']['focus']))\n {\n foreach(BasicProfile::$ProfileTypeArray as $key => $type)\n {\n if(array_search($key, $_SESSION['FilterForm']['focus']) !== FALSE)\n {\n $criteriaText .= ' AND ' . BasicProfile::$ProfileTypeArray[$key] . ' ';\n }\n }\n }\n\n /**\n * Filter by Race if defined\n */\n\n if(!empty($_SESSION['FilterForm']['race_id']))\n {\n $criteriaText .= ' AND ' . RaceType::model()->findByPk($_SESSION['FilterForm']['race_id'])->name . ' ';\n }\n\n /**\n * Filter By SAT I Combined Score of defined\n * We filter it if the max Score value is less than 2400 (5 key from array)\n */\n\n $SATUsed = false;\n\n if(!empty($_SESSION['FilterForm']['SATMax']) && $_SESSION['FilterForm']['SATMax'] <= 4)\n {\n $min = BasicProfile::$SATRanges[$_SESSION['FilterForm']['SATMin']];\n $max = BasicProfile::$SATRanges[$_SESSION['FilterForm']['SATMax']];\n\n $criteriaText .= ' AND ' . $min . '-' . $max . ' SAT I Combined Score ';\n $SATUsed = true;\n }\n\n /**\n * Filter By SAT I Combined Score of defined\n * We filter it if the max Score value is less than 600 (0 key from array)\n */\n\n if(!$SATUsed && !empty($_SESSION['FilterForm']['SATMin']) && $_SESSION['FilterForm']['SATMin'] > 0)\n {\n $min = BasicProfile::$SATRanges[$_SESSION['FilterForm']['SATMin']];\n $max = BasicProfile::$SATRanges[$_SESSION['FilterForm']['SATMax']];\n\n $criteriaText .= ' AND ' . $min . '-' . $max . ' SAT I Combined Score ';\n }\n\n /**\n * If we haven't defined university then cut off extra 'AND' from result string\n */\n if(empty($_SESSION['search_q']))\n {\n $criteriaText = substr($criteriaText, 4);\n }\n /*\n * If we still have no text then simply define this text as 'None'\n */\n\n if(empty($criteriaText) && empty($_SESSION['search_q'])) \n {\n $criteriaText = 'None';\n }\n\n /**\n * Actual criteria text defining\n */\n\n if(!empty($_SESSION['search_q']))\n \n $this->searchCriteriaText = 'SEARCH CRITERIA: ' . $_SESSION['search_q'] . $criteriaText;\n \n else \n \n \n {\n $this->searchCriteriaText = 'SEARCH CRITERIA: ' . $criteriaText;;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retorna nome da Cidade pelo id | public function getNameCity($cidade_id)
{
$city = $this->model()->where('id', $cidade_id)->select('nome')->get();
if(sizeof($city)>0){
return $city[0]->nome;
}
} | [
"function get_city_name($id)\n {\n $ci = & get_instance();\n return $ci->db->get_where('ci_cities', array('id' => $id))->row_array()['name'];\n }",
"function get_city_name($id)\n {\n $ci = & get_instance();\n return $ci->db->get_where('xx_cities', array('id' => $id))->row_array()['name'];\n }",
"public function getNomeConsorcio( $id )\n\t{\n\t\treturn $this->getRepository()->getNomeConsorcio( $id );\n\t}",
"function obtener_nombre_estado_por_id($id)\n {\n $estado = new Estado();\n $estado->get_by_id($id);\n return $estado->nombre_estado;\n }",
"function nombre($codigo) {\n return TCiudad::get($codigo, 'nombre');\n }",
"public function getAConstituentNameById($id) {\n $sql = \"SELECT name FROM constituents WHERE id=?\";\n $stmt = $this->conn->prepare($sql);\n $stmt->bind_param(\"i\", $id);\n $stmt->execute();\n $tasks = $stmt->get_result();\n $stmt->close();\n return $tasks->fetch_assoc()[\"name\"];\n }",
"function obtener_nombre_departamento_por_id($id)\n {\n $departamento = new Departamento();\n $departamento->get_by_id($id);\n return $departamento->nombre_departamento;\n }",
"function getNameEmpleado($id) {\n\t\n\t\tif($id) {\n\n\t\t\t$result = executeQuery(\"\tSELECT nombre,apellido\n\t\t\t\t\t\t\t\t\t\tFROM empleados\n\t\t\t\t\t\t\t\t\t\tWHERE id_empleado='$id'\n\t\t\t\t\t\t\t\t\t\t\"); // ejecuta la consulta para traer el nombre\n\n\t\t\t$row = @mysqli_fetch_array($result);\n\t\t\t\n\t\t\t//var_dump($row); //para ver el contenido del array\n\t\n\t\t\t$nombreCompleto = $row['nombre'].' '.$row['apellido'];\n\t\n\t\t\treturn $nombreCompleto;\n\t\t}\n\t}",
"public function getIdCidade()\n {\n return $this->idCidade;\n }",
"function getNomeAvaliador($id_avaliador){\n\n\t\t\t$sql = \"SELECT nome FROM banca WHERE id = $id_avaliador\";\n\t\t\t$sql = $this->db->query($sql);\n\t\t\t$sql->execute();\n\n\t\t\t$sql = $sql->fetch();\n\n\t\t\t$nome_avaliador = $sql['nome'];\n\n\t\t\treturn $nome_avaliador;\n\t\t}",
"public function get_city_name($id)\n\t{\n\t\t$this->db->select('name');\n\t\t$this->db->where(array('is_active' => 1, 'is_deleted' => 0, 'id' => $id));\n\t\t$query = $this->db->get('cities');\n\t\t$result = $query->result_array();\n\t\tif ($result)\n\t\t{\n\t\t\tforeach ($result as $city_name)\n\t\t\t{\n\t\t\t\techo $city_name['name'];\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function getNombre_ciudad()\n {\n return $this->nombre_ciudad;\n }",
"function getCategorieName($id){\n return $this->getCategoriesMapper()->select('name', 'id = '.$id);\n }",
"public function getOrganizationName($id=NULL){\n\t\treturn $this->mysql_query(\"SELECT `org_name_en`, `org_name_fr` FROM career_employers\".(isset($id) ? \" WHERE id = '$id'\" : ''));\n\t}",
"public function getIdCidade()\n {\n return $this->id_cidade;\n }",
"public function getCidade()\n {\n return $this->cidade;\n }",
"public function getCidadePeloNome($nomeCidade){\n // dd($registro);\n return Cidade::where('nome', 'like', $nomeCidade)->with(['estado', 'estado.pais'])->first();\n }",
"public function getCidade()\n {\n return $this->cidade;\n }",
"public function get_name($id)\r\n {\r\n $query = $this->db->query(\"SELECT * FROM \".$this->table_name.\" WHERE id_prov=\".$id);\r\n $q = $query->row_array();\r\n if(isset($q['nombre_prov'])) \r\n {\r\n return $q['nombre_prov'];\r\n }\r\n else \r\n {\r\n return \"-------------\";\r\n } \r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
With a given key, it checks the $_GET superglobal for the index matching the given key, it then sanitizing the input string, if found, and returns a string safe for ouput to a client. If $filter_array is 0 then it will check if the value of the $_GET array at subscript key is an array and will return false. | public static function get($key, $filter_array = 0, $default = NULL)
{
$item = isset($_GET[$key]) ? $_GET[$key] : NULL;
if($filter_array === 0) {
if(is_array($item))
return $default;
}
return isset($_GET[$key]) ? self::clean($_GET[$key]) : $default;
} | [
"static function filterQueryString() {\n\t\t$clean = array();\n\t\tforeach ($_GET as $key => $val) {\n\t\t\t$clean[$key] = htmlspecialchars_decode(filter_var($val, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW));\n\t\t}\n\t\treturn $clean;\n\t}",
"function knowledgebank_get_filters(){\n $allowed_keys = array('order','orderby','view_mode','tags','number','search');\n $filters = array();\n if(!empty($_GET['filters']) && is_array($_GET['filters'])){\n //get any $_GET['filters'] elements with a key in $allowed keys\n $filters = array_intersect_key($_GET['filters'], array_flip($allowed_keys));\n }\n return $filters;\n}",
"function buildURLArray ($filterarray) {\r\n global $urlfilter;\r\n global $i;\r\n // Iterate through each filter in the array\r\n foreach($filterarray as $itemfilter) {\r\n // Iterate through each key in the filter\r\n foreach ($itemfilter as $key =>$value) {\r\n if(is_array($value)) {\r\n foreach($value as $j => $content) { // Index the key for each value\r\n $urlfilter .= \"&itemFilter($i).$key($j)=$content\";\r\n }\r\n }\r\n else {\r\n if($value != \"\") {\r\n $urlfilter .= \"&itemFilter($i).$key=$value\";\r\n }\r\n }\r\n }\r\n $i++;\r\n }\r\n return \"$urlfilter\";\r\n}",
"public function key_filter(array $filter /*. ,$filter .*/)\n {\n $args = func_get_args();\n array_unshift($args, 'and');\n\n return call_user_func_array(array($this, 'key_filter_operator'), $args);\n }",
"function generate_url_sale_list_search($array_get = array(), $key_filter = '', $value = '', $url = ''){\n \n $new_url = $url;\n if($key_filter == '') return $new_url;\n \n switch($key_filter){\n case 'date':\n $date = date('Y-m-d', $value);\n $array_get['start_fill_date'] = $date; \n $array_get['end_fill_date'] = $date;\n break;\n case 'user':\n $array_get['user_id'] = $value;\n break;\n }\n \n if(!empty($array_get)){\n $a = array();\n foreach($array_get as $k => $v){\n $a[] = $k . '=' . $v;\n }\n return $url . '?' . implode('&', $a);\n }\n \n return $new_url;\n}",
"function buildURLArray ($filterarray) {\n global $urlfilter;\n global $i;\n // Iterate through each filter in the array\n foreach($filterarray as $itemfilter) {\n // Iterate through each key in the filter\n foreach ($itemfilter as $key =>$value) {\n if(is_array($value)) {\n foreach($value as $j => $content) { // Index the key for each value\n $urlfilter .= \"&itemFilter($i).$key($j)=$content\";\n }\n }\n else {\n if($value != \"\") {\n $urlfilter .= \"&itemFilter($i).$key=$value\";\n }\n }\n }\n $i++;\n }\n return \"$urlfilter\";\n}",
"public static function post($key, $filter_array = 0, $default = NULL)\n {\n $item = isset($_POST[$key]) ? $_POST[$key] : NULL;\n if($filter_array === 0) {\n if(is_array($item))\n return $default;\n }\n return isset($_POST[$key]) ? self::clean($_POST[$key]) : $default; \n }",
"function buildURLArray ($filterarray) {\r\n global $urlfilter;\r\n global $i;\r\n // Iterate through each filter in the array\r\n foreach($filterarray as $itemfilter) {\r\n // Iterate through each key in the filter\r\n foreach ($itemfilter as $key =>$value) {\r\n if(is_array($value)) {\r\n foreach($value as $j => $content) { // Index the key for each value\r\n $urlfilter .= \"&itemFilter($i).$key($j)=$content\";\r\n }\r\n }\r\n else {\r\n if($value != \"\") {\r\n $urlfilter .= \"&itemFilter($i).$key=$value\";\r\n }\r\n }\r\n }\r\n $i++;\r\n }\r\n return \"$urlfilter\";\r\n }",
"function buildURLArray ($filterarray) {\n\tglobal $urlfilter;\n\tglobal $i;\n\t// Iterate through each filter in the array\n\tforeach($filterarray as $itemfilter) {\n\t\t\n\t\t// Iterate through each key in the filter\n\t\tforeach ($itemfilter as $key => $value) {\n\t\t\t\n\t\t\tif (is_array($value)) {\n\t\t\t\tforeach($value as $j => $content) { // Index the key for each value\n\t\t\t\t\t$urlfilter .= \"&itemFilter($i).$key($j)=$content\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($value != \"\") {\n\t\t\t\t\t$urlfilter .= \"&itemFilter($i).$key=$value\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$i++;\n\t}\n\n\treturn \"$urlfilter\";\n}",
"public function normalizeParams(array $params, $filter_key = 'f') {\n return drupal_get_query_parameters($params, array('q', 'page'));\n }",
"function getGETSafe($key) {\n $val = htmlspecialchars($_GET[$key]);\n return empty($val) ? NULL : $val;\n}",
"private function sanitize_data( $key, $is_array = false ) {\n\n $sanitized_data = null;\n\n if ( $is_array ) {\n\n $array_items = $_POST[ $key ];\n $sanitized_data = array();\n\n foreach ( $array_items as $array_item ) {\n\n $array_item = sanitize_text_field( $array_item );\n if ( ! empty( $array_item ) ) {\n\n $sanitized_data[] = $array_item;\n\n }\n\n }\n\n } else {\n\n $sanitized_data = '';\n $sanitized_data = sanitize_text_field( $_POST[ $key ] );\n\n }\n\n return $sanitized_data;\n\n\t}",
"function sanitizeParams()\n{\n $array = array();\n $str = '';\n $frontParam = '';\n\n // REQUEST_URI of $_SERVER\n $str =& $_SERVER[\"REQUEST_URI\"];\n serverStringToArray($str, $array, $frontParam);\n sanitizeArray($array);\n arrayToServerString($array, $frontParam, $str);\n\n // QUERY_STRING of $_SERVER\n unset($str);\n $str =& $_SERVER[\"QUERY_STRING\"];\n serverStringToArray($str, $array, $frontParam);\n sanitizeArray($array);\n arrayToServerString($array, $frontParam, $str);\n\n // $_GET\n convArrayForSanitizing($_GET, $array);\n sanitizeArray($array);\n revertArrayForSanitizing($array, $_GET);\n\n // $_REQUEST (only GET param)\n convArrayForSanitizing($_REQUEST, $array);\n sanitizeArray($array);\n revertArrayForSanitizing($array, $_REQUEST);\n}",
"static function get($key)\n\t{\n\t\tif (empty($_GET)) return false;\n\t\treturn (isset($_GET[$key])) ? Security::xss_clean(Security::encode_php_tags($_GET[$key])) : false;\n\t}",
"private function preProcessFiltering()\n {\n $filter_by_array = $this->getArrayKeysExist($_GET, $this->columnNames);\n if (!empty($filter_by_array)) {\n if (!isset($this->filter_by)) {\n $this->filter_by = $filter_by_array[0];\n }\n\n if (isset($_GET[$this->filter_by]) && $_GET[$this->filter_by] != \"\") {\n if (!isset($this->filter_by_value)) {\n $this->filter_by_value = $_GET[$this->filter_by];\n }\n } else {\n return $this->notFoundResponseWithMessage(\"No value for $this->filter_by\");\n }\n }\n }",
"function filter_by_key( $varName, $validValuesList, $order, $case_insensitive = false )\n {\n if ( isset( $_GET[$varName] ) && is_array( $_GET[$varName] ) )\n {\n $_GET[$varName] = key( $_GET[$varName] );\n }\n\n if ( isset( $_POST[$varName] ) && is_array( $_POST[$varName] ) )\n {\n $_POST[$varName] = key( $_POST[$varName] );\n }\n\n if ( isset( $_COOKIE[$varName] ) && is_array( $_COOKIE[$varName] ) )\n {\n $_COOKIE[$varName] = key( $_COOKIE[$varName] );\n }\n \n if ( isset( $_REQUEST[$varName] ) && is_array( $_REQUEST[$varName] ) )\n {\n $_REQUEST[$varName] = key( $_REQUEST[$varName] );\n }\n\n return filter( $varName, $validValuesList, $order, $case_insensitive );\n }",
"protected function FilterGetVars() {\n\t\n\t\tif(sizeof($_GET) > 0 && is_array($_GET)) {\n\t\n\t\t\tforeach($_GET as $key => $value) {\n\t\t\t\t\t\n\t\t\t\t$fOut = addslashes($value);\n\t\t\t\t$fOut = htmlentities($fOut);\n\t\t\t\t$fOut = strip_tags($fOut);\n\t\t\t\t$this->mGetVars[$key] = $fOut;\n\t\t\t}\n\t\t}\n\t}",
"private function parseForFiltering() {\n $filters = array_key_exists(\"filter\", $_GET) ? json_decode($_GET['filter'],true) : NULL;\n // If $filters was set, go on and check each item of the array.\n if (isset($filters)) {\n foreach($filters as $filter) {\n // If \"property\" and \"value\" keys exist, go on.\n if(\n array_key_exists(\"property\", $filter ) &&\n array_key_exists(\"value\", $filter )\n ) {\n // check if property is not an empty string\n if($filter[\"property\"] != \"\") {\n // add filter property=>value to the $filterStore[]\n $this->filterStore[$filter[\"property\"]] = $filter[\"value\"];\n }\n }\n }\n }\n }",
"function filter_url($filter = array()) {\n\t\tforeach ($filter as $patern ) {\n\t\t\n\t\t\tif ( strpos($this->url_in, $patern) !== FALSE ) {\n\t\t\t\n\t\t\t\tunset($this->get_vars);\n\t\t\t\t$this->url = $this->url_in;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ $this>addParam('method sp_B2_DG_addSocioEconomico Agraga el niviel socioeconomico de la persona NO SON HIGUALES LOS FORM | public function sp_B2_DG_addSocioEconomico($model){
$this->arrayToPost($model);
$this->load->library('form_validation');
$this->addParam('pID_ALTERNA','pID_ALTERNA','',array('rule'=>'trim|required|numeric|max_length[10]'));
$this->addParam('pID_ESTADO_EMISOR','pID_ESTADO_EMISOR_Socioeconomico','',array('rule'=>'trim|numeric'));
$this->addParam('pID_EMISOR','pID_EMISOR_Socioeconomico','',array('rule'=>'trim|numeric'));
$this->addParam('pVIVE_FAMILIA','pVIVE_FAMILIA','N',array('name'=>'¿Vive con su familia?','rule'=>'trim|max_length[1]'));
$this->addParam('pINGRESO_FAMILIAR','pINGRESO_FAMILIAR','',array('name'=>'Ingreso familiar adicional (mensual)','rule'=>'trim|numeric|max_length[10]'));
$this->addParam('pID_TIPO_DOMIC','pID_TIPO_DOMICILIO','',array('name'=>'Su domicilio es','rule'=>'trim|numeric|max_length[30]'));
$this->addParam('pACTIVIDAD_CULTURAL','pACTIVIDAD_CULTURAL','N',array('name'=>'Actividades culturales o deportivas que practica','rule'=>'trim|max_length[100]'));
$this->addParam('pINMUEBLES','pINMUEBLES','N',array('name'=>'Especificación de inmuebles y costos','rule'=>'trim|max_length[100]'));
$this->addParam('pINVERSIONES','pINVERSIONES','N',array('name'=>'Inversión y monto aproximado','rule'=>'trim|max_length[100]'));
$this->addParam('pNUMERO_AUTOS','pNUMERO_AUTOS','N',array('name'=>'Vehículo y costo aproximado','rule'=>'trim|max_length[100]'));
$this->addParam('pCALIDAD_VIDA','pCALIDAD_VIDA','N',array('name'=>'Calidad de vida','rule'=>'trim|max_length[50]'));
$this->addParam('pVICIOS','pVICIOS','N',array('name'=>'Vicios','rule'=>'trim|max_length[100]'));
$this->addParam('pIMAGEN_PUBLICA','pIMAGEN_PUBLICA','N',array('name'=>'Imagen pública','rule'=>'trim|max_length[50]'));
$this->addParam('pCOMPORTA_SOCIAL','pCOMPORTA_SOCIAL','N',array('name'=>'Comportamiento social ','rule'=>'trim|max_length[40]'));
// $this->addParam('pINGRESO_MENSUAL','pINGRESO_MENSUAL','N',array('name'=>'Ingreso mensual adicional','rule'=>'trim|max_length[30]'));
$this->addParam('pRESPONSABLE_CORP',null); // no se encontro en el formulario
if ($this->form_validation->run() === true) {
$this->procedure('sp_B2_DG_addSocioEconomico');
$this->iniParam('txtError','varchar','250');
$this->iniParam('msg','varchar','80');
$this->iniParam('tranEstatus','int');
$query = $this->db->query($this->build_query());
$response = $this->query_row($query);
if($response == FALSE){
$this->response['status'] = false;
$this->response['message'] = 'Ha ocurrido un error al procesar su última acción.' . " [ GUID = {$this->config->item('GUID')} ]";
}else{
$this->response['status'] = (bool)$response['tranEstatus'];
$this->response['message'] = ($response['tranEstatus'] == 1)? $response['msg'] : $response['txtError'];
}
} else {
$this->load->helper('html');
$this->response['status'] = false;
$message = $this->form_validation->error_array();
$this->response['message'] = ul($message);
$this->response['validation'] = $message;
}
return $this->response;
} | [
"function agregarServicio($codigo, $cantidad, $tipo, $promo=\"\", $grupo=\"N\", $costo=\"\"){\r\n\t\t$servicios = Session::getVar(\"venta_servicios_adicionales\");\r\n\t\t//Session::setVar(\"venta_servicios_adicionales\", array() );\r\n\t\t\r\n\t\tif($codigo == \"\" || $cantidad == \"\" ){\r\n\t\t\treturn JText::_('M_ERROR') . sprintf( JText::_('VENTA_SERVICIO_ERROR_CREACION') );\r\n\t\t}\r\n\t\t\r\n\t\tif( isset($servicios[$codigo])){\r\n\t\t\t//print_r($servicios);\r\n\t\t\t// actualizar\r\n\t\t\t$actServicio = $servicios[$codigo];\r\n\t\t\t//print_r($actServicio);\r\n\t\t\t//echo \"<br/>\";\r\n\t\t\t$nuevaCantidad = $actServicio->cantidad + $cantidad;\r\n\t\t\tif($costo == \"\"){\r\n\t\t\t\t$costo = $this->costoServicioAdicional($codigo, $nuevaCantidad);\r\n\t\t\t\tif($promo != \"\" ){\r\n\t\t\t\t\t$costo = $costo * ($promo/100);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif( $costo != -1 ){\r\n\t\t\t\t$actServicio->costo = $costo;\r\n\t\t\t\t$actServicio->cantidad = $nuevaCantidad;\r\n\t\t\t\t$servicios[$codigo] = $actServicio;\r\n\t\t\t\t// Actualiza sesion\r\n\t\t\t\tSession::setVar(\"venta_servicios_adicionales\", $servicios);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn JText::_('M_ERROR') . sprintf( JText::_('VENTA_SERVICIO_NO_SOPORTA_CONFIGURACION') );\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\t// crear nuevo\r\n\t\t\t$costo = $this->costoServicioAdicional($codigo, $cantidad);\r\n\t\t\tif( $costo != -1 ){\r\n\t\t\t\t$servicio = $this->getServicioAdicionalPorCodigo($codigo);\r\n\t\t\t\t\r\n\t\t\t\t$nuevoServicio = new stdClass();\r\n\t\t\t\t$nuevoServicio->codigo = $codigo;\r\n\t\t\t\t$nuevoServicio->cantidad = $cantidad;\r\n\t\t\t\t$nuevoServicio->tipo = $tipo;\r\n\t\t\t\t$nuevoServicio->grupo = $grupo;\r\n\t\t\t\t$nuevoServicio->costo = $costo;\r\n\t\t\t\t$nuevoServicio->promo = 'N';\r\n\t\t\t\t$nuevoServicio->descripcion = $servicio->nomserv;\r\n\t\t\t\t$nuevoServicio->recurrente = $servicio->cobrrecurrente;\r\n\t\t\t\t$servicios[$codigo] = $nuevoServicio;\r\n\t\t\t\r\n\t\t\t\tif($promo != \"\" ){\r\n\t\t\t\t\t$nuevoServicio->costo = $costo * ($promo/100);\r\n\t\t\t\t\t$nuevoServicio->promo = 'S';\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Actualiza sesion\r\n\t\t\t\tSession::setVar(\"venta_servicios_adicionales\", $servicios);\r\n\t\t\t\t//$this->actualizarTotales();\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn JText::_('M_ERROR') . sprintf( JText::_('VENTA_SERVICIO_NO_SOPORTA_CONFIGURACION') , $row->id );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn JText::_('M_OK') . sprintf( JText::_('VENTA_SERVICIO_ADICIONAL_GUARDADO') );;\r\n\t}",
"function evt__agregar()\n\t{\n if($this->s__pantalla=='pant_seleccion'){\n $this->set_pantalla('pant_edicion');\n }\n //si estoy en la pantalla cargo_seleccion y presiono agregar entonces\n if($this->s__pantalla=='pant_cargo_seleccion'){\n $this->dep('datos')->tabla('designacion')->resetear();\n $this->set_pantalla('pant_cargo');\n } \n\t}",
"function agregarNormal(){\n\n\t$fbd = FachadaBD::getInstance();\n\t$valido = verificarVnormal();\n\tif ($valido == 1) {\n\t\techo \"** Los cuatro campos deben contener información\";\n\t} elseif ($valido == 2) {\n\t\techo \"** Los números deben estar de menor a mayor\";\n\t} elseif ($valido == 3) {\n\t\techo \"** Los campos deben contener sólo números\";\n\t} else {\n\t\t$fbd1 = FachadaBD::getInstance();\n\t\t$peso1 = NEW D_Peso();\n\t\t$peso1-> setLabel('Normal');\n\t\t$peso1-> setN1($_POST[\"n1\"]);\n\t\t$peso1-> setN2($_POST[\"n2\"]);\n\t\t$peso1-> setN3($_POST[\"n3\"]);\n\t\t$peso1-> setN4($_POST[\"n4\"]);\n\t\t$fbd1->agregarPesoBD($peso1);\n\t}\n}",
"public function addPoiPercursoAction() {\n if(Utils::verificaSessao() == false){\n return $this->redirect()->toRoute('turistas', array('action' => 'iniciarSessao'));\n }\n \n $id = (int) $this->params()->fromRoute('id', 0);\n \n $array_poi = WebApiServices::getPois();\n foreach ($array_poi as $value) {\n $opcoes[$value['Id']] = $value['Description'];\n }\n \n $form = new AddPoiPercursoForm();\n \n $form->get('pois')->setValueOptions($opcoes);\n $form->get('submit')->setValue('Adicionar');\n $form->get('id')->setValue($id);\n\n $request = $this->getRequest();\n if ($request->isPost()) {\n $form->setData($request->getPost());\n if ($form->isValid()) {\n WebApiServices::addPoiPercurso($request->getPost());\n return $this->redirect()->toRoute('percurso', array('action' => 'ver','id' => $id));\n }\n }\n return array(\n 'id' => $id,\n 'form' => $form\n );\n }",
"public function addPachet()\r\n\t{\r\n\t\t$serv_sql='';\r\n\t\tif(isset($_POST['servicii']))\r\n\t\t{\r\n\t\t\tforeach($_POST['servicii'] as $ky=>$val)\r\n\t\t\t{\r\n\t\t\t\tif($val!='')\r\n\t\t\t\t{\r\n\t\t\t\t\t$serv_sql.= $val.\";\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$sql = \"INSERT INTO pachete(`name`, `pret`, `servicii`,`luni`) VALUES ('\".addslashes($_POST['name']).\"', '\".$_POST['pret'].\"', '\".$serv_sql.\"','\".$_POST['luni'].\"')\";\r\n\t\t$this->db->query($sql);\r\n\t}",
"public function addServiceCorporatifAction()\n\t{\n\t\t\n\t\t$em = $this->getDoctrine()->getEntityManager();\n\t\t//Récupère le nom de la personne qui accède à l'administration\n\t\t$user = $this->container->get('security.context')->getToken()->getUser();\n\t\t//on vérifie le role\n\t\t$validRole = new ControleDataSecureController();\n\t\t$role = $validRole->getValidRoles($user);\n\t\t//Formulaire d'ajout d'un type événement corporatif\n\t\t$corporatif = new Corporatifs_services();\n\t\t$form = $this->container->get('form.factory')->create(new AddCorporatifServiceForm(), $corporatif);\n\t\t// On récupère la requête.\n\t\t$request = $this->get('request');\n\t\t// On vérifie qu'elle est de type « POST ».\n\t\tif( $request->getMethod() == 'POST' )\n\t\t{\n\t\t\t// On fait le lien Requête <-> Formulaire.\n\t\t\t$form->bindRequest($request);\n\t\t\t// On vérifie que les valeurs rentrées sont correctes.\n\t\t\tif( $form->isValid() )\n\t\t\t{\n\t\t\t\t// On l'enregistre notre objet $evenement dans la base de données.\n\t\t\t\t$em->persist($corporatif);\n\t\t\t\t$em->flush();\n\t\t\t\techo 'Service corporatif ajouté avec succés !';\n\t\t\t\t//On redirige vers la liste des événements corporatifs.\n\t\t\t\treturn $this->redirect($this->generateUrl('_Dashboard_evenementscoporatifshebergement'));\n\t\t\t}\n\t\t}\n\t\t//Préparation de la view dashboard_addservicecorporatif.html.twig\n\t\treturn $this->render('MyAppAdminBundle:Hebergement:dashboard_addservicecorporatif.html.twig',\n\t\t\t\tarray(\n\t\t\t\t\t\t'annee' \t\t\t\t\t\t=> date('Y'),\n\t\t\t\t\t\t'name_admin'\t\t \t\t\t=> $user->getUsername(),\n\t\t\t\t\t\t'pointeur' \t\t\t\t\t\t=> 'pointeur',\n\t\t\t\t\t\t'form' \t\t\t\t\t\t\t=> $form->createView(),\n\t\t\t\t\t\t'corpheb' \t\t\t\t\t\t=> \"menu_hebergement\",\n\t\t\t\t\t\t'exist' \t\t\t\t\t\t=> \"false\",\n\t\t\t\t\t\t'role'\t\t\t\t\t\t\t=> $role,\n\t\t\t\t));\n\t}",
"function add_surat_keputusan_pemutih_penyalur_form() {\n//\t\tif (! $this->get_permission('fill_this')) return $this->intruder();\n\t\tglobal ${$GLOBALS['session_vars']}, ${$GLOBALS['get_vars']};\n\t\t$field_arr = surat_keputusan_pemutih_penyalur::get_field_set();\n\n//\t\t$value_arr = array ();\n\t\t$label_arr = $this->surat_keputusan_pemutih_penyalur_label;\n\t\t$optional_arr = $this->optional_arr;\n\t\t$optional_arr['keputusan_pemutih_penyalur'] = 'user_defined';\n\t\t$value_arr['keputusan_pemutih_penyalur']= '<textarea rows=\"100\" cols=\"75\" name=\"keputusan_pemutih_penyalur\" class=\"text\"></textarea>';\n\n\t\teval($this->save_config);\n\t\t$this->id_cek_pemutih_form($config);\n\t\t\n\n\n//\t\t$label_arr['submit_val'] = 'Submit';\n\t\t$label_arr['form_extra'] = '<input type=hidden name=action value=\"postadd\">'; // default null\n\t\t$label_arr['form_extra'] .= '<input type=hidden name=opener value=\"'.$GLOBALS[$GLOBALS['get_vars']]['opener'].'\">'; // default null\n\t\t$label_arr['form_extra'] .= '<input type=hidden name=opener_sql value=\"'.$GLOBALS[$GLOBALS['get_vars']]['opener_sql'].'\">'; // default null\n\t\t$label_id_cek_pemutiharr['form_extra'] .= '<input type=hidden name=opener_var value=\"'.$GLOBALS[$GLOBALS['get_vars']]['opener_var'].'\">'; // default null\n\t\t$label_arr['form_title'] = __('Form').' '.__('Add').' Surat Keputusan Pemutihan Izin Penyalur'; // default null\n\t\t$label_arr['form_width'] = '100%'; // default 100%\n\t\t$label_arr['form_name'] = 'theform'; // default form\n\n\t\t$_form = new form();\n\t\t$_form->set_config(\n\t\t\tarray (\n\t\t\t\t'field_arr'\t=> $field_arr,\n\t\t\t\t'label_arr'\t=> $label_arr,\n\t\t\t\t'value_arr'\t=> $value_arr,\n\t\t\t\t'optional_arr'\t=> $optional_arr\n\t\t\t)\n\t\t);\n\t\treturn $_form->parse_field();\n\t}",
"function addPreferito($IdpPreferito,$email) {\n \n $Risult= parent::searchColonnaSelect(\"UtenteRegistrato\", \"Prodottiosservati\", \"Email\", $email);\n $StringaPreferiti=$Risult [0][\"Prodottiosservati\"];\n if($StringaPreferiti==\"\")\n {\n $StringaPreferiti=\"$IdpPreferito\";\n }\n else\n {\n $StringaPreferiti=$StringaPreferiti.\",\".$IdpPreferito;\n }\n parent::UpdateAttributo(\"UtenteRegistrato\", \"Prodottiosservati\", $StringaPreferiti, \"Email\", $email); \n }",
"function PCO_CargarObjetoOculto($registro_campos,$registro_datos_formulario,$formulario,$en_ventana)\n\t{\n\t\tglobal $PCO_CampoBusquedaBD,$PCO_ValorBusquedaBD;\n\n\t\t$salida='';\n\t\t$nombre_campo=$registro_campos[\"campo\"];\n\t\t$tipo_entrada=\"hidden\";\n\n\t\t// Define cadena en caso de tener valor predeterminado o el valor tomado desde el registro buscado\n\t\t$cadena_valor='';\n\t\tif ($registro_campos[\"valor_predeterminado\"]!=\"\") $cadena_valor=' value=\"'.$registro_campos[\"valor_predeterminado\"].'\" ';\n\t\t//Evalua si el valor predeterminado tiene signo $ al comienzo y ademas es una variable definida para poner su valor.\n\t\tif (substr($registro_campos[\"valor_predeterminado\"], 0,1)==\"$\")\n\t\t\t{\n\t\t\t\t$nombre_variable = substr($registro_campos[\"valor_predeterminado\"], 1);\n\t\t\t\tglobal ${$nombre_variable};\n\t\t\t\tif (isset($nombre_variable))\n $cadena_valor=${$nombre_variable};\n\t\t\t}\n\t\tif ($PCO_CampoBusquedaBD!=\"\" && $PCO_ValorBusquedaBD!=\"\") $cadena_valor=$registro_datos_formulario[\"$nombre_campo\"];\n\n\t\t// Muestra el campo\n\t\t$salida.='<input type=\"'.$tipo_entrada.'\" name=\"'.$registro_campos[\"campo\"].'\" value=\"'.$cadena_valor.'\" >';\n\t\treturn $salida;\n\t}",
"function agregar_solicitud() \n {\n if ($this->input(\"sol_rut\",\"sol_cod\",\"sol_fecha\")) \n {\n $resultado = $this->modelo->agregar_solicitud(orm::solicitud_maquina([\n orm::solicitud_maquina_rut => $_POST[\"sol_rut\"],\n orm::solicitud_maquina_codigo => $_POST[\"sol_cod\"],\n orm::solicitud_maquina_fecha => $_POST[\"sol_fecha\"]\n ]));\n if ($resultado != null) {\n if (is_array($resultado)) {\n $this->success($resultado);\n }\n } else {\n $this->error(\"No se pudo solicitar la maquina\");\n }\n }\n }",
"function insertarObligacionCompleta()\n {\n $this->objFunc = $this->create('MODObligacionPago');\n if ($this->objParam->insertar('id_obligacion_pago')) {\n $this->res = $this->objFunc->insertarObligacionCompleta($this->objParam);\n } else {\n //TODO .. trabajar en la edicion\n }\n $this->res->imprimirRespuesta($this->res->generarJson());\n }",
"function evt__form_asignacion__agregar_dias (){\n $datos_form_asignacion=$this->dep('form_asignacion')->get_datos();\n print_r($datos_form_asignacion);\n $tipo=$datos_form_asignacion['tipo'];\n if(strcmp($tipo, 'Definitiva')==0){\n $mensaje=\" No se puede asociar fechas a asignaciones definitivas. \";\n toba::notificacion()->agregar($mensaje);\n \n }\n else{\n $fecha_inicio=$datos_form_asignacion['fecha_inicio'];\n $fecha_fin=$datos_form_asignacion['fecha_fin'];\n if(isset($fecha_inicio) && isset($fecha_fin)){\n $this->s__cargar_fechas=TRUE; //se debe poner en false cuando termina la operacion de carga\n if(!isset($tipo)){\n $datos_form_asignacion['tipo']='Periodo';\n }\n $this->s__datos_form_asignacion=$datos_form_asignacion;\n $this->set_pantalla('pant_extra');\n }\n else{\n toba::notificacion()->agregar(\" Debe especificar fecha de inicio y fin. \");\n \n }\n \n }\n \n //para restaurar el estado actual del formulario form_asignacion\n $this->s__datos_form_asignacion=$datos_form_asignacion;\n \n }",
"function addPago() {\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tif (!$this->PermisosComponent->puedeAcceder('ventas', 'addPago'))\n\t\t\t\tthrow new ForbiddenException('No tiene permiso para acceder a esta página'); \n\t\t\t\n\t\t\tif(isset($_POST['pago']) && isset($_POST['idVenta'])){\n\t\t\t\t\n\t\t\t\t$pago = $this->Ventas->addPago($_POST['pago'], $_POST['idVenta']); \n\t\t\t\n\t\t\t\techo $this->json('', $pago); \n\t\t\t\t\n\t\t\t}else\n\t\t\t\tthrow new BadRequestException('Los datos del pago están incompletos.');\n\t\t\t\n\t\t\t\n\n\t\t} catch (Exception $e) {\t\n\n\t\t\tif ($e instanceof RequestException) \n\t\t\t\techo $this->json( $e->getMsg(), $e->getData(), $e->getSatusCode() );\n\t\t}\t\n\t}",
"public function alterar() {\t\t\n\t//\tALTERANDO REGISTRO!!!\n\t\tglobal $start;\n\t\n\t\t$id = $this->getParam('id');\t\t\t\t//\tPega parametro na classe System\n\t\t$confirma = $this->getParam('confirma');\t//\tPega parametro na classe System\n\t\t\n\t\t$this->datas['show_registro'] = $this->verificaRegistro($id, $this->disciplinas->disciplinasShow(\"id=\".$id));\t//\tVERIFICA SE O REGISTRO EXISTE!!!\n\t\t$this->datas['tipo'] = '2';\t\t\t\t\t\t// Alteração\t\t\n\t\t\n\t\t// Gerenciando Campo CHECKBOX - Bloqueado:\n\t\tif ($confirma == \"sim\") {\n\t\t\t$form = $this->retorna_formulario($this->disciplinas->_tabela);\t//\tLendo dados do formulario\n\t\t\t\n\t\t\tinclude_once(FW_PATH_SERV . FW_RAIZ. FW_VIEWS . $start->_controller .\"/blocks/cabCampo.php\");\t//\tINCLUI O ARQUIVO COM CABEÇALHOS E CAMPOS\n\t\t\t$campos = array_values($FW_campos);\n\t\t\t$this->datas['erros'] = $this->disciplinas->ValidaDados($form,$campos);\t//\tvalidacao de dados...\t\n\t\t\t\n\t\t\tif (count($this->datas['erros']) == 0) {\t\t//\t se existem erros volta para o formulario\n\t\t\t\t$this->LimpaFormulario(\"disciplinas\");\t\t//\tlimpa o formulario e sessao de erros...\t\t\n\t\t\t\t$this->disciplinas->update( $form, \"id=\".$id) ;\t//\tALTERA REGISTRO\n\t\t\t\t$this->redirecionar_pagina_inicial();\t\t\t//\tVAI PARA PAGINA INICIAL\n\t\t\t}else{\n\t\t\t\t$redireciona = new RedirectorLib();\t\t\n\t\t\t\theader(\"Location: \". FW_RAIZ . $redireciona->GetCurrentPackage() . \"/\" . $redireciona->GetCurrentController() . \"/\" . \n\t\t\t\t\t\t$redireciona->GetCurrentAction() . \"/id/\" . $id );\n\t\t\t}\n\t\t} else {\n\t\t\t$this->view('incluir_alterar', $this->datas);\n\t\t}\t\n\t}",
"function Frm_Periodo($funcion=\"\",$nParCodigo=\"\",$cPrdDescripcion=\"\",$fechaini=\"\",$fechafin=\"\" , $Observacion =\"\")\n\t\t{\n\t\t\t\t$formulario =\"\";\n\t\t\t $formulario .='\n\t\t\t \t<div class=\"vform vformContenedor\">\n\t\t\t \t\t<fieldset class=\"c12\">\n\t\t\t \t\t\t<input type=\"hidden\" name=\"nParPeriodo\" value=\"'.$nParCodigo.'\" />\n\t\t\t\t\t\t\t'.InputTextPre(\"PERIODO \",\"txtPeriodo\",\"INGRESE PERIODO \",$cPrdDescripcion,\"icon-text\", \"c12 space-min-left\" , \"c12\").'\n\t\t\t\t\t\t\t'.InputTextPre(\"FECHA INICIO\",\"dFechaIni\",\"dd/mm/yyyy\",$fechaini,\"icon-calendar\" ).'\n\t\t\t\t\t\t\t'.InputTextPre(\"FECHA FIN\",\"dFechaFin\",\"dd/mm/yyyy\",$fechafin,\"icon-calendar\" ).'\n\t\t\t\t\t\t\t'.InputTextPre(\"Observación\",\"cParObservacion\",\"Observación\",$Observacion ,\"icon-text\", \"c12 space-min-left\" , \"c12\").'\n\n\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t'.botonRegistrar($funcion).'\n\t\t\t\t\t</div>\n\t\t\t ';\n\t\t\t\treturn $formulario;\n\t\t}",
"function add()\r\n {\r\n $data['sistema'] = $this->sistema;\r\n if($this->acceso(126)) {\r\n if(isset($_POST) && count($_POST) > 0) \r\n { \r\n //se inicia en ACTIVO\r\n $estado_id = 1;\r\n $params = array(\r\n\t\t\t\t'procedencia_descripcion' => $this->input->post('procedencia_descripcion'),\r\n\t\t\t\t'estado_id' => $estado_id,\r\n );\r\n \r\n $procedencia_id = $this->Procedencia_model->add_procedencia($params);\r\n redirect('procedencia/index');\r\n }\r\n else\r\n {\r\n $data['page_title'] = \"Procedencia\";\r\n $data['_view'] = 'procedencia/add';\r\n $this->load->view('layouts/main',$data);\r\n }\r\n }\r\n \r\n }",
"public function insert_tipo_evento()\n {\n $settings = $this->inicialize(\"get_service_add_tipo_evento\");\n\n if ($_REQUEST && $settings) //verifico que exista post y que la inicializacion de curl sea correcta\n {\n\n $tipo_evento = $_POST['tipo_evento'];\n\n\n\n //aqui los parametros que enviaremos al webservice\n curl_setopt($this->curl, CURLOPT_POSTFIELDS, \"tipo_evento=\" .$tipo_evento);\n\n $get = $this->finalize();\n\n\n echo $get;\n\n //return $curl_response;\n\n }//end if ($_POST && $settings)\n else\n {\n echo \"error\";\n }//end else\n }",
"function PCO_CargarObjetoBotonComando($registro_campos,$registro_datos_formulario,$registro_formulario)\n\t{\n\t\tglobal $PCO_CampoBusquedaBD,$PCO_ValorBusquedaBD,$IdiomaPredeterminado;\n global $funciones_activacion_datepickers;\n\t\tglobal $MULTILANG_TitValorUnico,$MULTILANG_DesValorUnico,$MULTILANG_TitObligatorio,$MULTILANG_DesObligatorio;\n\t\tglobal $TabIndex_Elemento;\n\t\t$salida='';\n\n //Determina si el estilo del objeto debe ser inline o no\n\t\t$cadena_modo_inline='';\n if ($registro_campos[\"modo_inline\"])\n $cadena_modo_inline='display:inline;';\n\n\t\t//Transfiere variables de mensajes de retorno asociadas al boton\n\t\t$comando_javascript=\"\";\n\t\tif ($registro_campos[\"retorno_titulo\"]!=\"\")\n\t\t\t$comando_javascript=\"document.\".$registro_formulario[\"id_html\"].\".PCO_ErrorTitulo.value='\".$registro_botones[\"retorno_titulo\"].\"'; document.\".$registro_formulario[\"id_html\"].\".PCO_ErrorDescripcion.value='\".$registro_botones[\"retorno_texto\"].\"'; document.\".$registro_formulario[\"id_html\"].\".PCO_ErrorIcono.value='\".$registro_botones[\"retorno_icono\"].\"'; document.\".$registro_formulario[\"id_html\"].\".PCO_ErrorEstilo.value='\".$registro_botones[\"retorno_estilo\"].\"';\";\n\n //Define el tipo de boton de acuerdo al tipo de accion\n switch ($registro_campos[\"tipo_accion\"]) {\n\n case 'interna_guardar': $comando_javascript.=\"PCOJS_ValidarCamposYProcesarFormulario('\".$registro_formulario[\"id_html\"].\"'); \"; break;\n case 'interna_limpiar': $comando_javascript.=\"document.getElementById('\".$registro_formulario[\"id_html\"].\"').reset();\"; break;\n case 'interna_escritorio': $comando_javascript.=\"document.PCO_FormVerMenu.submit();\"; break;\n case 'interna_actualizar': $comando_javascript.=\"document.\".$registro_formulario[\"id_html\"].\".PCO_Accion.value='PCO_ActualizarDatosFormulario'; PCOJS_ValidarCamposYProcesarFormulario('\".$registro_formulario[\"id_html\"].\"'); \"; break;\n case 'externa_postcode': $comando_javascript.=\"document.\".$registro_formulario[\"id_html\"].\".PCO_Accion.value='PCO_EjecutarPostAccionForm'; PCOJS_ValidarCamposYProcesarFormulario('\".$registro_formulario[\"id_html\"].\"'); \"; break;\n case 'interna_eliminar': $comando_javascript.=\"document.\".$registro_formulario[\"id_html\"].\".PCO_Accion.value='PCO_EliminarDatosFormulario';document.\".$registro_formulario[\"id_html\"].\".submit();\"; break;\n case 'interna_cargar': $comando_javascript.=\"document.\".$registro_formulario[\"id_html\"].\".PCO_Accion.value='PCO_CargarObjeto';document.\".$registro_formulario[\"id_html\"].\".PCO_Objeto.value='\".$registro_campos[\"accion_usuario\"].\"'; PCOJS_SanitizarValoresListaMultiple(); document.\".$registro_formulario[\"id_html\"].\".submit(); \"; break;\n case 'externa_formulario': $comando_javascript.=\"document.\".$registro_formulario[\"id_html\"].\".PCO_Accion.value='\".$registro_campos[\"accion_usuario\"].\"'; PCOJS_SanitizarValoresListaMultiple(); document.\".$registro_formulario[\"id_html\"].\".submit();\"; break;\n case 'externa_javascript': $comando_javascript.=$registro_campos[\"accion_usuario\"];\n }\n\n\n\t\t//Verifica si el registro de botones presenta algun texto de confirmacion y lo antepone al script\n\t\t$cadena_confirmacion_accion_pre=\"\";\n\t\t$cadena_confirmacion_accion_pos=\"\";\n\t\tif (@$registro_campos[\"confirmacion_texto\"]!=\"\")\n\t\t\t{\n\t\t\t\t$cadena_confirmacion_accion_pre=\" if (confirm('\".PCO_ReemplazarVariablesPHPEnCadena($registro_campos[\"confirmacion_texto\"],$registro_datos_formulario).\"')) {\";\n\t\t\t\t$cadena_confirmacion_accion_pos=\" } else {} \";\n\t\t\t}\n\n //Genera cadena par el identificador del elemento usando el campo \"campo\". Normalmente oculto\n $cadena_identificador='';\n if ($registro_campos[\"campo\"]!=\"\")\n $cadena_identificador='id=\"'.$registro_campos[\"id_html\"].'\"';\n\n //Genera la cadena del enlace\n $cadena_javascript='href=\"javascript: '.$cadena_confirmacion_accion_pre.' '.@$comando_javascript.' '.$cadena_confirmacion_accion_pos.' \"';\n\n //Abre el marco del control de datos style=\"display:inline;\"\n\t\t$salida.='<div '.$cadena_identificador.' style=\"'.$cadena_modo_inline.'\" class=\"form-group input-group\">';\n // Muestra el campo\n\t\t$salida.='<a tabindex=\"'.$TabIndex_Elemento.'\" id=\"'.$registro_campos[\"id_html\"].'\" class=\"btn '.$registro_campos[\"personalizacion_tag\"].'\" '.@$cadena_javascript.'><i class=\"'.$registro_campos[\"imagen\"].'\"></i> '.PCO_ReemplazarVariablesPHPEnCadena($registro_campos[\"titulo\"],$registro_datos_formulario).'</a>';\n //Cierra marco del control de datos\n $salida.= '</div>';\n\n\t\treturn $salida;\n\t}",
"public function poi_add() {\r\n\t\t$tag=$this->tagLogic->getOptions();\r\n\t\t$this->assign('tag',$tag);\r\n\t\t$this->display ( 'Admin/poi_add' );\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display a listing of the resource. GET /financial_categories | public function index()
{
$input = Request::all();
$categories = $this->repo->getCategories($input);
return ApiResponse::success($this->response->collection($categories, new FinancialCategoriesTransformer));
} | [
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $finCategories = $em->getRepository('EmpBundle:FinCategory')->findAll();\n\n return $this->render('fincategory/index.html.twig', array(\n 'finCategories' => $finCategories,\n ));\n }",
"public function actionIndexcategory()\n {\n Url::remember();\n $searchModel = new IncomeSearch();\n $dataProvider = $searchModel->searchCategory(Yii::$app->request->queryParams);\n $one = Income::findOne(Yii::$app->request->queryParams['id']);\n\n return $this->render('indexcategory', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'category' => $one->category\n ]);\n }",
"public function list()\n {\n $categories = Category::get();\n\n return MyHelper::response('Category list for drop down', $categories);\n }",
"function categories() {\n $categories = Categories::findByModuleSection($this->active_project, $this->active_module, $this->getControllerName());\n \n if($this->request->isApiCall()) {\n $this->serveData($categories, 'categories');\n } else {\n $this->setTemplate(array(\n 'module' => RESOURCES_MODULE, \n 'controller' => 'categories', \n 'template' => 'list'\n ));\n $this->smarty->assign(array(\n 'categories' => $categories,\n 'can_add_category' => Category::canAdd($this->logged_user, $this->active_project)\n ));\t\n } // if\n }",
"public function listCategoryAction()\n {\n $model = $this->getModel('category');\n $rowset = $model->enumerate(null, null, true);\n\n $this->view()->assign('categories', $rowset);\n $this->view()->assign('title', __('Category List'));\n }",
"public function businessCategories(){\n return view('/portal.businesscategory.business_categories');\n }",
"public function indexAction()\n {\n $categories = $this->repository('Accountant\\Entity\\Category')->findAll();\n\n return $this->render('category.index.html.twig', array('categories' => $categories));\n }",
"public function listCategories() {\n return $this->makeRequest(\"listCategories\", NULL, NULL);\n }",
"public function getListBonusCategories()\n {\n return view('bonus-route::list-bonus-categories')\n ->with('bonusCategories', BonusCategory::all());\n }",
"public function index() {\r\n $this->set('categories', $this->Category->find('all'));\r\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('escuelaBundle:finanzasCategoria')->findAll();\n\n return $this->render('escuelaBundle:finanzasCategoria:index.html.twig', array(\n 'entities' => $entities,\n ));\n }",
"public function categories_all() {\n\t\t// Simple! Get the categories\n\t\t$this->data['categories'] = $this->mojo->blog_model->categories();\n\t\t\n\t\t// ...and display the view. We won't\n\t\t// be needing Pagination or anything like that\n\t\t$this->_view('categories');\n\t}",
"public function indexStockCategories()\n {\n $connection = ConnectionManager::get('default');\n $res2 = $connection\n ->execute(\n 'SELECT * FROM personnalisation'\n )->fetch('assoc');\n $this->set('personnalisation',$res2);\n $stockCategories = $this->paginate(TableRegistry::get('StockCategories'));\n\n $this->set(compact('stockCategories'));\n $this->set('_serialize', ['stockCategories']);\n $this->render('/Espaces/respostocks/index_stockcategories');\n }",
"public function index_deal_categories() \n\t{\n\t\t$deal_categories = DB::table('category')->lists('name');\n\t\t// $deal_categories = DB::table('deal')->distinct()->lists('category');\n\t\t$response = ['total' => count($deal_categories), 'data' => $deal_categories];\n\t\treturn Response::json($response, 200);\n\t}",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $unitCategories = $em->getRepository('AppBundle:UnitCategory')->findAll();\n\n return $this->render('unitcategory/index.html.twig', array(\n 'unitCategories' => $unitCategories,\n ));\n }",
"public function income_category()\n {\n $this->data['categories'] = $this->db->order_by('name', 'asc')->get_where('transaction_category', ['type' => 1])->result();\n $this->admin_template('income_category', $this->data);\n }",
"public function all_income_categories_list()\r\n\t{\r\n\t $query = $this->db->query(\"SELECT * from xin_income_categories\");\r\n \t return $query->result();\r\n\t}",
"public function indexAction()\n {\n $em=$this->getDoctrine()->getManager();\n $categories=$em->getRepository(\"TroiswaBackBundle:Categorie\")\n ->findAll(); // http://www.doctrine-project.org/api/orm/2.2/class-Doctrine.ORM.EntityRepository.html\n\n return $this->render(\"TroiswaBackBundle:Categorie:all.html.twig\",[\"categories\"=>$categories]);\n\n }",
"public function Index()\n\t{\n\t\t$filter_data = $this->uri->uri_to_assoc($this->_getSegmentsOffset()+3);\n\t\t\n\t\tif(!isset($filter_data['category'])) $filter_data['category'] = 0;\n\t\t\n\t\t$data['categories'] = $this->categories_model->GetChildren($filter_data['category'],TRUE);\n\t\t\n\t\t//if no subcategories - show posts\n\t\tif(empty($data['categories']))\n\t\t{\n\t\t\tredirect($this->_getBaseURI().\"/search/category/\".$filter_data['category']);\n\t\t}\n\t\t\n\t\t$data['controller'] = \"companies\";\n\t\t\n\t\t$data['tpl_page'] = \"categories/list\";\n\t\t\n\t\t// === Current Location === //\n\t\t$current_location_arr = \n\t\tarray(\n\t\t\t$this->_getBaseURI()=>$this->_getPageTitle()\n\t\t);\n\t\t\n\t\t// === Categories Location === //\n\t\t$categories_location_arr = $this->categories_model->GetLocation($filter_data['category'],'companies');\n\t\t$current_location_arr = array_merge($current_location_arr,$categories_location_arr);\n\t\t\n\t\t$data['current_location_arr'] = $current_location_arr;\n\t\t\n\t\t//add search category info\n\t\tif($filter_data['category']) $data = array_merge($data,$this->categories_model->getSearchCategoryData($filter_data['category']));\n\t\t\n\t\t//generate additional page title\n\t\t$this->appendPageTitleForListPages($filter_data,$data);\n\t\t\n\t\tparent::_OnOutput($data);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ $param=['id'=>$request>id]; $item=DB::select('select from people where id=:id',$param); return view('hello.del',['form'=>$item[0]]); | public function del(Request $request){
$item=DB::table('people')->where ('id',$request->id)->first();
return view('hello.del',['form'=>$item]);
} | [
"public function getCreate($id,$SOLICITUD_id)\n {\n // $alumno = alumno::lists('id', 'id');\n\n$solicitud=solicitud::where('id', '=', $SOLICITUD_id)\n ->first();\n $alumno = alumno::where('id', '=', $id)\n ->first();\n\n return view('presenta3.create',compact('solicitud','alumno','SOLICITUD_id','id'));\n }",
"public function delete($id){\n\n DB::table('slides')->where('id' , $id)->delete();\n\n return redirect('homeadmin');\n }",
"function programmeshowdata(Request $id){\n $data=programme::where('programme_id',$id->id)->get();\n return view('updateprograminfo',['datastorage'=>$data]);\n }",
"public function deletedevicereg(Request $request){ \n $tray = $request->tray;\n $traycount = $request->traycount; \n /* return $tray; */\n if($traycount > 0){\n DB::connection($this->mysql)->table('tbl_deviceregistration')->wherein('id',$tray)->delete(); \n } \n return $this->displaydevreg();\n }",
"public function customerdeleteinput(Request $request)\n {\n $id = $request->input('id');\n $sequence = $request->input('sequence');\n $type = DB::table('customer_fields')->where('id',$id)->select('field_type','field_name')->get()->toArray();\n $type = array_map(function ($value) {\n return (array)$value;\n }, $type);\n $check = $this->deleteDBfield($request,$type[0]['field_name']);\n if($check == \"404\"){\n return $this->errAPI('Field was not found in the Customer DB!');\n } \n if($type[0]['field_type'] == \"Dropdown\"){\n \n DB::table('customer_fields')\n ->where('destination_id',$id)\n ->where('field_type',\"Option\")\n ->delete();\n }\n \n \n DB::table('customer_fields')\n ->where('id',$id)\n ->delete();\n \n \n return $this->syslog(\"admin\", $id, \"Admin deleted a field of type \".$type[0]['field_type'].\"for a customer\", 'Delete Field.',$request, 'form');\n //return $this->templatecards($request); \n }",
"public function module_delete ($input){\n //return $input->all();\n \n if($this->deleteByid($input->all()['id'])){\n return [\n 'ok'=>true,\n 'msg'=>['Module Deleted successfully.'],\n \n ];\n }\n\n return [\n 'ok'=>false,\n 'msg'=>['Module not Deleted successfully.'],\n \n ];\n // return $this->deleteByid($input->all()['id']);\n \n\n\n}",
"public function deleteAllcar(Request $request){\n$ids = $request->input('ids');\nforeach($ids as $mm){\n$dbs = CarService::where('car_id',$mm)\n->update(['deleted'=>1]);\n}\nreturn back()->with('seccess','Seccess Data Delete');\n}",
"public function deleteVaccine2($vaccineno){\n $temp1 = DB::select('select * from vaccines where vaccine_no = :somevariable'\n ,array('somevariable' => $vaccineno));\n $temp = $temp1[0];\n Session::put('data',$temp);\n return Redirect::to('deleteVaccine2');\n }",
"public function actionDeleteselectedform(){\n \t$id = Yii::$app->request->post('id',0);\n \t$form= Yii::$app->request->post('form',0);\n \t$model = new FormBuilder();\n \tif($form == 'instruction'){\n \t\t$model->deleteFromData($id,1);\n \t}else{\n \t\t$model->deleteFromData($id,2);\n \t}\n \treturn 'OK';\n }",
"public function edit($id)\n {\n\n\n $tblFabricantes = $this->tblFabricantesRepository->find($id);\n $estados = new tbl_vendedores();\n $pais_sql = $estados->pais_sql();\n $tblContactosFabricantes= tbl_contactos_fabricantes::where('id_fabricante',$id)->get();\n $tipo=1; \n\n $id_cliente=$id;\n $idf=$id; \n\n return view('tbl_fabricantes.edit',compact('idf','tblFabricantes','pais_sql','tipo','tblContactosFabricantes'));\n \n }",
"public function show($id){\n //$data['result']=DB::table('members')->where('id',$id)->get();\n $data['result']=Members::find($id);\n\n return view('member_show',$data);\n}",
"public function deletecomplaintc($id){\n\n $chemistry=Chemistry::find($id);\n $chemistry->delete();\n return redirect()->back();\n}",
"public function getDeleteTodo() \n {\n $id = $_GET['id'];\n Todo::deleteById($id);\n\n return redirect('todos');\n }",
"public function deletecomplaintc($id){\n\n $physics=Physics::find($id);\n $physics->delete();\n return redirect()->back();\n}",
"public function donationRequests(Request $request){\n $donationRequests=donationRequests::where(function ($query)use ($request){\n if($request ->has('id')){\n $query->where ('id',$request->id);\n }\n})->get();\n\n return responseJson(1,'success donationRequests',$donationRequests);\n}",
"public function edit($id)\n {\n\n\n\n //declaro una variable venta, que me guardará una venta en especifico, el cual puedo reutilizar la consulta venta que declare arriba en la función index, que en si vendria siendo una consulta a la tabla venta, y obtendré datos de la tabla venta con el alias \"v\", de la tabla persona con el alias \"p\", voy a unir con el campo idventa e idpersona en la tabla p, tambien unire la tabla tienda con la tabla venta, por medio de campo idtienda que es el campo comun entre ambos, y esto me pemitirá obtener información de la base de datos, tanto de la tabla tienda como de la tabla persona en una consulta utilizando el recursos de los join. voy a utilizar el metodo first() en la consuta para solo obtener el primer ingreso que cumpla la condición que por logica debería ser un solo registro, el cumple con el id que se envía desde el formulario.\n\n //join= union de dos tablas por medio de dos campos en comun.\n\n\n\n $venta = DB::table('venta as v')\n ->join('persona as p','v.idcliente','=','p.idpersona')\n ->join('detalle_venta as dv','v.idventa','=','dv.idventa')\n ->join('tienda as td','v.idtienda','=','td.idtienda')\n ->join('vendedor as vend','v.idvendedor','=','vend.idvendedor')\n ->select('v.idventa','v.idcliente','v.fecha_hora','p.nombre','v.tipo_comprobante','v.serie_comprobante','v.num_comprobante','v.impuesto','v.estado','v.total_venta','v.estatus_venta','td.nombre AS tienda','p.tipo_documento AS tipo_documento','p.num_documento AS num_documento ','vend.nombre AS vendedor','vend.num_documento AS cedula','vend.tipo_documento AS documento_vendedor')\n ->where('v.idventa','=',$id)\n ->first();//obtengo solo el primer registro que cumple a condición\n\n\n\n\n\n\n //el metodo raw me sirve para concatenar el codigo del articulo con el nombre del articulo, para mostrar en una sola columna el código con el nombre del articulo, y estos dos campos que concateno les voy a poner el alias articulo, para tambien mostrar el listado de todos los articulos que el usuario puede seleccionar para registrar el ingreso de articulos, y en la consulta tambien extraemos e codigo del articulo por este es que se va a seleccionar en la tabla ingreso para indicar el articulo que esta ingresando a los almacenes. ojo mostraré solo los articulos cuyo estado sea = Activo\n\n //el mtodo ->get() se utiliza para obtener todos los valores de las consulta a la bd realizada\n\n //ojo: AVG: nos permite calcular un promedio entre los valores de un campo\n\n $articulos = DB::table('articulo as art')\n ->join('detalle_ingreso as di','art.idarticulo','=','di.idarticulo')\n ->join('talla as tall','art.idtalla','=','tall.idtalla')\n ->select(DB::raw('CONCAT(art.codigo, \" \",art.nombre) AS articulo'),'art.idarticulo','art.stock',DB::raw('avg(di.precio_venta) as precio_promedio'),'tall.nombre AS talla')\n ->where('art.estado','=','Activo')\n ->where('art.stock','>','0')\n ->groupBy('articulo','art.idarticulo','art.stock')\n ->get(); \n\n\n \t\t\t\n \t\n \t\t\t\t\t\n \t\t\t\t\t//aqui declaro otra variable que en sí será una consuta para mostrar los detalles del ingreso\n \t\t\t\t\t//ojo: en esta consulta en el select le estoy diciendo que el campo nombre de la tabla articulo o sea a.nombre, a ese valor retornado le voy a llamar ahora \"articulo\"\n \t\t\t\t\t// el metodo get(); lo utilizo para obtener todo los detalles de dicha consulta\n\n \t\t\t\t\t$detalles=DB::table('detalle_venta as d')\n \t\t\t\t\t->join('articulo as a','d.idarticulo','=','a.idarticulo')\n \t\t\t\t\t->select('a.nombre as articulo','a.codigo as codigo','a.imagen as imagen','a.descripcion as descripcion','d.cantidad','d.iddetalle_venta','d.descuento','d.precio_venta','d.precio_venta','d.idarticulo')\n \t\t\t\t\t->where('d.idventa','=',$id)\n \t\t\t\t\t->get();\n\n\n //Aqui me traigo el valor del iva de la bd para utilizaro en la interfaz\n $parametros=DB::table('parametros as pm')\n ->select('pm.idparametro','pm.codigo','pm.nombre','pm.valor','pm.descripcion')\n ->where('codigo','=','1')\n ->get();\n\n\n \t\t\t\t\treturn view(\"ventas.devolucion.edit\",[\"venta\"=>$venta,\"detalles\"=>$detalles,\"articulos\"=>$articulos,\"parametros\"=>$parametros]);\n\n\n\n \t\n }",
"public function despacho(){\n \n\n $herramientas = Herramienta::all();\n $foo = $herramientas['id'];\n return view('adminlte::layouts.partials.heramientas.despacho',['herramientas'=>$herramientas,'foo'=>$foo]);\n }",
"public function theatredelete(Request $req){\n $delete = DB::table('theatres')->where('t_id', $req->id)->delete();\n return back();\n }",
"public function hapusdetail()\n {\n $data = array(\n 'id_pemesanan' => $this->input->post('id_pemesanan'),\n 'id_detail' => $this->input->post('id_detail')\n );\n $this->db->where($data);\n $this->db->delete('detail_pemesanan');\n redirect('admin');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get character_ids by input | public function getExpectedCharacterIds($tagName)
{
return DB::table('characters')
->where('character','like',$tagName.'%')
->pluck('character_id')->all();
} | [
"public static function searchableIds();",
"function getCharacterList() {\n try {\n $items = $this->perform_query_no_param(\"SELECT id,name from characters\");\n return $this->result_to_array($items);\n } catch(Exception $ex) {\n $this->print_error_message(\"Unable to get the characterList\");\n return null;\n }\n }",
"abstract public function getCharList();",
"public function getIdentifiers();",
"public abstract function get_ids();",
"public function selectCharacter($game_id)\n {\n $res = Game2character::query()->where('game_id', '=', $game_id)\n ->select('character_id')->get();\n /*\n foreach ($res as $char){\n echo \" - \".$char[\"character_id\"].\"</br>\";\n }\n */\n return $res;\n }",
"public function getIdentifiers(): array;",
"protected function getSelectedIds()\n {\n $ids = array();\n foreach ($_REQUEST as $parameter => $value) {\n $matches = array();\n preg_match('/select_(.*)/', $parameter, $matches);\n if ($matches) {\n $ids[] = $matches[1];\n }\n }\n\n return $ids;\n }",
"function getCharacterGroups();",
"public static function ids($abilities):array\n {\n return (new Collection((array)$abilities))->map(function ($ability) {\n return static::firstOrCreate(['name' => (string)$ability])->id;\n })->all();\n }",
"public function getShortcutIds(){\n return $this::get(['id'])->pluck('id')->toArray();\n }",
"public static function searchableIds()\n {\n return self::lists('id');\n }",
"protected function getIdRegex(): array {\n\t\treturn [];\n\t}",
"public static function getEntityIdsByEntityTypeFromInput($input) {\n $tags = Tags::explode($input);\n $entities = [];\n foreach ($tags as $tag) {\n preg_match('/(?<type>\\w+)\\:(?<id>\\d+)\\)$/', $tag, $matches);\n if (!empty($matches['type']) && !empty($matches['id'])) {\n $entities[$matches['type']][] = $matches['id'];\n }\n }\n return $entities;\n }",
"public function getCardIds(): array;",
"public static function getCurrentIDs()\n\t{\n\t\t\n\t\treturn (new self)->getModelIDs(Character::all());\n\t\t\n\t}",
"public function charList() {\n $query = $this->db->select('name')->get('jdr_chars')->result_array();\n $list = array_column($query, 'name');\n return $list;\n }",
"public function subaccountGetIds();",
"public function entry_ids()\n\t {\n\n\t \t\t$data\t= array();\n\t \t\n\t\t \tif( ! empty($this->settings['channel_id']))\n\t\t \t{\n\t\t\t $query\t= ee()->db\n\t\t\t \t\t\t->select('entry_id')\n\t\t\t \t\t\t->where_in('channel_id',$this->settings['channel_id'])\n\t\t\t \t\t\t->get('channel_titles');\n\t\t\t \t\t\t\n\t\t\t \t\t\tif($query->num_rows()>0)\n\t\t\t \t\t\t{\n\t\t\t\t \t\t\tforeach($query->result() as $key=>$row)\n\t\t\t\t \t\t\t{\n\t\t\t\t\t \t\t\t$data[]\t= $row->entry_id;\n\t\t\t\t \t\t\t}\n\t\t\t \t\t\t}\n\t\t\t \t\t\t\n\t\t\t \t} \n\t\t \n\t\t \t\treturn $data;\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the prefixed `site` table name. | public function grabSiteTableName()
{
return $this->grabPrefixedTableNameFor('site');
} | [
"public function grabSiteTableName() {\n\t\treturn $this->grabPrefixedTableNameFor( 'site' );\n\t}",
"function get_table_prefix()\n{\n global $SITE_INFO;\n if (!isset($SITE_INFO['table_prefix'])) {\n return 'cms' . strval(cms_version()) . '_';\n }\n return $SITE_INFO['table_prefix'];\n}",
"function sm_table_prefix()\n\t\t{\n\t\t\tglobal $sm;\n\t\t\treturn $sm['t'];\n\t\t}",
"function get_table_prefix()\n{\n\tglobal $SITE_INFO;\n\tif (!isset($SITE_INFO['table_prefix'])) return 'ocp'.strval(ocp_version()).'_';\n\treturn $SITE_INFO['table_prefix'];\n}",
"public function get_table_name()\n {\n global $wpdb;\n return $wpdb->prefix . 'reverse_redirect_index';\n }",
"function get_sites_table_name($key)\n{\n // Get the key alias\n $key_alias = get_key_alias($key);\n\n // Get the name of the vulnerabiity table\n $sites_table = $key_alias . \"_sites\";\n\n return $sites_table;\n}",
"public static function get_table_name() : string {\n global $wpdb;\n return $wpdb->prefix . self::TABLE_NAME;\n }",
"protected function getStaticDatabaseTableName() {\r\n $paramDbPrefix=Parameter::getGlobalParameter('paramDbPrefix');\r\n return $paramDbPrefix . self::$_databaseTableName;\r\n }",
"protected static function getTableName() {\n\t\tglobal $wpdb;\n\t\treturn $wpdb->prefix . static::$tableName;\n\t}",
"protected function getStaticDatabaseTableName() {\r\n $paramDbPrefix = Parameter::getGlobalParameter ( 'paramDbPrefix' );\r\n return $paramDbPrefix . self::$_databaseTableName;\r\n }",
"public function get_table_name() {\n\t\treturn $this->get_table_prefix() . $this->table_name;\n\t}",
"public function getTablePrefix() {\n\t\tglobal $wpdb;\n\t\treturn ($this->isNetwork() ? $wpdb->base_prefix : $wpdb->prefix) . self::PREFIX;\n\t}",
"protected function getStaticDatabaseTableName() {\r\n global $paramDbPrefix;\r\n return $paramDbPrefix . self::$_databaseTableName;\r\n }",
"public function get_table_name() {\n\t\treturn $this->table_prefix . self::TABLE_NAME;\n\t}",
"public function getTablePrefix() {\n return craft()->db->tablePrefix;\n }",
"function make_table_name() {\n\n\t\tglobal $wpdb;\n\n\t\t// get WP's table preffix\n\t\t$table_prefix = $wpdb->prefix;\n\t\t$t_name = \"subform_settings\";\n\n\t\t$table_name = $table_prefix . $t_name;\n\n\t\treturn $table_name;\n\t}",
"protected function getStaticDatabaseTableName()\n {\n return strtolower(get_class($this));\n }",
"public static function reports_table_name() {\n\t\tglobal $wpdb;\n\t\treturn $wpdb->prefix . CMS_SLUG . '_reports';\n\t}",
"public function metaTableName()\r\n\t{\r\n\t\t$tblName = self::tableName();\r\n\r\n\t\t// Add _meta prefix to parent table name\r\n\t\t$tblName = str_replace('}}', '_meta}}', $tblName);\r\n\r\n\t\t// Resolve the actual name of the meta table\r\n\t\t$tblName = str_replace('{{%', Yii::$app->db->tablePrefix ?: '', $tblName);\r\n\t\t$tblName = str_replace('}}', '', $tblName);\r\n\r\n\t\treturn $tblName;\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if the component has width defined | public function hasWidth(): bool {
return $this->attrs()->exists('width');
} | [
"public function hasWidth(): bool;",
"protected function _checkWidth()\r\n\t{\r\n\t\t$width = $this->_mapData->getWidth();\r\n\t\tif (is_null($width) || !is_numeric($width) || $width <= 0) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"public function hasWidth() : bool\n {\n return isset($this->width);\n }",
"public function is_valid() {\n return css_is_width($this->value);\n }",
"public function getElementWidth()\n {\n return isset($this->element_width) ? $this->element_width : false;\n }",
"public function isWidth($width)\n {\n return !empty($width) && $this->getWidth() == $width;\n }",
"public function getMissingWidth() {}",
"function AutoCompGetMaxWidth(){}",
"public function hasCssLengthSpec()\n {\n return count($this->get(self::CSS_LENGTH_SPEC)) !== 0;\n }",
"function checkWidth()\r\n\t{\r\n\t\t$file = getimagesize($this->file_tmp);\r\n\t\t//$width = $file[0];\r\n\t\t\r\n\t\tif($file[0] > $this->max_height)\r\n\t\t\treturn false;\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}",
"public function testMinWidth() {\n\t\t$this->assertTrue($this->object->minWidth(355));\n\t\t$this->assertFalse($this->object->minWidth(500));\n\t}",
"function css_is_width($value) {\n $value = trim($value);\n if (in_array(strtolower($value), array('auto', 'inherit'))) {\n return true;\n }\n if (preg_match('#^(\\-\\s*)?(\\d*\\.)?(\\d+)\\s*(em|px|pt|%|in|cm|mm|ex|pc)?$#i', $value)) {\n return true;\n }\n return false;\n}",
"public function test_css_is_width() {\n\n $this->assertTrue(css_is_width('0'));\n $this->assertTrue(css_is_width('0px'));\n $this->assertTrue(css_is_width('0em'));\n $this->assertTrue(css_is_width('199px'));\n $this->assertTrue(css_is_width('199em'));\n $this->assertTrue(css_is_width('199%'));\n $this->assertTrue(css_is_width('-1'));\n $this->assertTrue(css_is_width('-1px'));\n $this->assertTrue(css_is_width('auto'));\n $this->assertTrue(css_is_width('inherit'));\n\n $this->assertFalse(css_is_width('-'));\n $this->assertFalse(css_is_width('bananas'));\n $this->assertFalse(css_is_width(''));\n $this->assertFalse(css_is_width('top'));\n }",
"public function isLength()\n {\n $css = $this->toCSS(new Context());\n\n return !!preg_match(self::LENGTH_REGEXP, $css);\n }",
"private function checkWidth(){\r\n\t\tif ($this->getTableWidth()>(PAGEWIDTH-2*$this->margin_left_right)){\r\n\t\t\techo \"Table doesn't fit the page and the margins set\";\r\n\t\t\texit();\r\n\t\t}\r\n\t}",
"function GetMinWidth(){}",
"private function getWidth() {\n return $this->properties->getWidgetProperty(self::PROPERTY_WIDTH);\n }",
"public function hasWide()\n {\n return $this->wide !== null;\n }",
"public function getWidth() {\n $width = false;\n if (isset($this->_width)) {\n $width = $this->_width;\n }\n\n return $width;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle the given request. Remember that Slack expects a response within three seconds after the slash command was issued. If there is more time needed, dispatch a job. | public function handle(Request $request): Response
{
if (is_numeric($request->text)) {
$this->dispatch(new ShowTDTicketJob());
return $this->respondToSlack('One moment please…');
} else {
$this->dispatch(new SearchTDTicketJob());
return $this->respondToSlack('One moment please…');
}
} | [
"protected function executeRequest(): void\n {\n $jobName = strtolower($this->action);\n if ($this->triggerBackgroundJob($jobName) === true) {\n $this->responder->respond('OK');\n } else {\n $this->responder->respondError('Could not start job.');\n }\n }",
"public function response_to_request()\n\t{\n\t\t$this->load->library('overtime_library');\n\t\t$this->load->library('form_validation');\n\t\t$this->load->helper('form');\n\t\t$this->form_validation->set_rules('request', 'Request ID', 'required');\n\t\t$this->form_validation->set_rules('decision', 'Decision', 'required');\n\t\t$this->form_validation->set_rules('token', 'Token', 'required');\n\n\t\tif ($this->form_validation->run() == FALSE)\n\t\t{\n\t\t\t$this->output->set_status_header(422);\n\t\t\treturn;\n\t\t}\n\n\t\tlog_message('debug', 'Slack dispatch received. Not authenticated yet');\n\n\t\tif ($this->input->post('token') !== $this->config->item('cfpslack_token')) {\n\t\t\t$this->output->set_status_header(403);\n\t\t\treturn;\n\t\t}\n\n\t\tlog_message('debug', 'Slack dispatch received. Authenticated');\n\n\t\tif ($this->input->post('decision') == 'approve') {\n\n\t\t\t$this->form_validation->set_rules('hours', 'Hours', 'required|integer');\t\t\t\n\n\t\t\tif ($this->form_validation->run() == FALSE)\n\t\t\t{\n\t\t\t\t$this->output->set_status_header(422);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t}\n\n\t\t$this->overtime_library->process_response(\n\t\t\t$this->input->post('request'),\n\t\t\t$this->input->post('decision'),\n\t\t\t$this->input->post('hours') ?: null\n\t\t);\n\t}",
"private static function _handle(WorkermanRequest $request)\n {\n \tif ($request->queryString()) {\n parse_str($request->queryString(), $queryParams);\n \t} else {\n $queryParams = [];\n \t}\n\n $req = new Request(\n $request->method(),\n $request->uri(),\n $request->header(),\n $request->rawBody(),\n '1.1',\n $_SERVER,\n $request->cookie(),\n $request->file(),\n $queryParams\n );\n\n $ret = self::$app->handle($req);\n\n $headers = $ret->getHeaders();\n\n if (!isset($headers['Server'])) {\n $headers['Server'] = 'Comet v' . self::VERSION;\n }\n\n if (!isset($headers['Content-Type'])) {\n $headers['Content-Type'] = 'text/plain; charset=utf-8';\n }\n\n return new WorkermanResponse(\n $ret->getStatusCode(),\n $headers,\n $ret->getBody()\n );\n }",
"public function do_slash_command() {\n\n header('Content-Type: application/json');\n\n\t\t// Collect request parameters\n $token = isset($_POST['token']) ? $_POST['token']: '';\n $team_id = isset($_POST['team_id']) ? $_POST['team_id']: '';\n $slack_id = isset($_POST['user_id']) ? $_POST['user_id']: '';\n $team_domain = isset($_POST['team_domain']) ? $_POST['team_domain']: '';\n $channel_id = isset($_POST['channel_id']) ? $_POST['channel_id']: '';\n $channel_name = isset($_POST['channel_name']) ? $_POST['channel_name']: '';\n $command = isset($_POST['command']) ? $_POST['command']: '';\n $message = isset($_POST['text']) ? $_POST['text']: '';\n\n\n // Use the command verification token to verify the request\n if( !empty( $token ) && $this->get_command_token() == $token){\n if (isset($this->slash_commands[$command])) {\n // This slash command exists, call the callback function to handle the command\n $response = call_user_func($this->slash_commands[$command], $message);\n echo json_encode($response);\n } else {\n // Unknown slash command\n echo json_encode(array(\n 'text' => \"Sorry, I don't know how to respond to the command.\"\n ));\n }\n } else {\n echo json_encode( array(\n 'text' => 'Oops... Something went wrong.'\n ) );\n }\n\n\t\t// Don't print anything after the response\n\t\tdie();\n\t}",
"public function process_request()\n {\n $response = null;\n $sender = $this->get_request_data()['sender'];\n $message = $this->get_request_data()['message'];\n\n try {\n $handler = new Handler($message);\n $response = $handler->handle_request();\n } catch (\\Exception $e) {\n $this->send_response($e->getMessage());\n }\n\n if ($response) {\n /* TODO: Globalize responses as arrays */\n if (is_array($response)) {\n foreach ($response as $resp)\n $this->send_response($resp);\n } else {\n $this->send_response($response);\n }\n }\n }",
"function handle_request()\n\t{\n\t\t$req = new Request();\n\t\t$res = new CommandResolver();\n\t\t$cmd = $res->getCommand($req);\n\t\t$cmd->execute($req);\n\t}",
"protected function handleRequest(){\n\t\t$request = new Request();\n\t\t\n\t\t// Check if the user has already login.\n\t\tif(!is_null($this->_mHelper->getUser())){\n\t\t\t$cmd = $request->getProperty('cmd');\n\t\t\tif($cmd == ''){\n\t\t\t\t$command = $this->getDefaultCommand();\n\t\t\t\t$command->execute($request, $this->_mHelper);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t$command = CommandResolver::getCommand($cmd);\n\t\t\tif(is_null($command)){\n\t\t\t\t// If the command provided was not found.\n\t\t\t\t$command = $this->getNotFoundCommand();\n\t\t\t\t$command->execute($request, $this->_mHelper);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$command->execute($request, $this->_mHelper);\n\t\t}\n\t\telse{\n\t\t\t$command = $this->getNotLoginCommand();\n\t\t\t$command->execute($request, $this->_mHelper);\n\t\t}\n\t}",
"function rest_do_request( $request ) {\n\tglobal $wp_rest_server;\n\t$request = rest_ensure_request( $request );\n\treturn $wp_rest_server->dispatch( $request );\n}",
"abstract public function handleRequest();",
"protected function handle_request() {\n\t\tglobal $wp;\n\n\t\t$download_id = $wp->query_vars['photo'];\n\n\t\tif ( !$download_id ) {\n\t\t\t$this->send_response( 'invalid' );\n\t\t}\n\n\t\tif ( $download_id ) {\n\t\t\t$this->send_response( 'success', absint( $download_id ) );\n\t\t} else {\n\t\t\t$this->send_response( 'error' );\n\t\t}\n\t}",
"public function execRequest() {\n // clear any current response data\n $this->clearResponse();\n // send the request\n $this->sendRequest();\n // parse the response\n $this->parseResponse();\n }",
"public function run()\n {\n $request = Request::createFromGlobals();\n $response = $this->handle($request);\n $response->send();\n }",
"public function handleRequest() {\n // Make sure the action parameter exists\n $action = $this->getFromBody('action');\n\n // Call the correct handler based on the action\n switch ($action) {\n\n case 'createReservation':\n $this->handleCreateEquipmentReservation();\n\n case 'cancelReservation':\n $this->handleEquipmentCancelReservation();\n\n case 'checkoutEquipment':\n $this->handleCreateEquipmentCheckout();\n\n case 'returnEquipment':\n $this->handleReturnEquipmentCheckout();\n\n case 'updateDeadlineText':\n $this->handleUpdateDeadlineText();\n\n case 'assignEquipmentFees':\n $this->handleAssignEquipmentFees();\n\n case 'payEquipmentFees':\n $this->handlePayEquipmentFees();\n\n case 'approveEquipmentFees':\n $this->handleApproveEquipmentFees();\n\n case 'rejectEquipmentFees':\n $this->handleRejectEquipmentFees();\n \n case 'equipmentModalHandout':\n $this->handleEquipmentModalHandout();\n\n \n default:\n $this->respond(new Response(Response::BAD_REQUEST, 'Invalid action on project resource'));\n }\n }",
"public function run()\n {\n try {\n $this->process();\n } catch (\\Exception $e) {\n $this->response = $this->errorHandler->handleException($e, $this->request, $this->response);\n } catch (\\Throwable $e) {\n $this->response = $this->errorHandler->handleError($e, $this->request, $this->response);\n } finally {\n $this->formatResponse();\n $this->respond();\n }\n }",
"public function dispatch()\n {\n do_action( 'request/before-dispatch', $this->request );\n call_user_func( [ $this->request->controller, $this->request->action ], $this->request->params );\n do_action( 'request/after-dispatch', $this->request );\n exit;\n }",
"public function handleRequest() {\n // Make sure the action parameter exists\n $this->requireParam('action');\n\n // Call the correct handler based on the action\n switch($this->requestBody['action']) {\n\n case 'saveProfile':\n $this->saveUserProfile();\n\n case 'updateUserType':\n $this->handleUpdateUserType();\n\n case 'addVoucherCodes':\n $this->handleAddVoucherCodes();\n\n case 'clearVouchers':\n $this->handleClearVouchers();\n \n case 'clearPrintVouchers':\n $this->handleClearVouchers();\n\n case 'clearCutVouchers':\n $this->handleClearVouchers();\n\n case 'addCourse':\n $this->handleAddCourse();\n \n case 'addGroup':\n $this->handleAddCourseGroup();\n\n default:\n $this->respond(new Response(Response::BAD_REQUEST, 'Invalid action on cut print group resource'));\n }\n }",
"public function handle_request() {\n\t\t$response_state = array(\n\t\t\t'ok' => 200,\n\t\t\t'no-content' => 204,\n\t\t);\n\n\t\t$response = new stdClass();\n\t\t$response->state = $response_state['ok'];\n\n\t\ttry {\n\t\t\t$response->body = $this->_chain->handle( $this->_model );\n\t\t} catch (Exception $e) {\n\t\t\t$response->state = $response_state['no-content'];\n\t\t\tif ( APP_TYPE == 'DEV' ) {\n\t\t\t\t$response->body = $e->__toString();\n\t\t\t}\n\t\t}\n\t\t$this->_view->show( $response );\n\t}",
"public function handleRequest() {\r\n\t\ttry {\r\n\t\t\t$response = null;\r\n\t\t\t$method = isset($this->request[\"f\"]) ? $this->request[\"f\"] : null;\r\n\t\t\t\r\n\t\t\tif ($method && method_exists($this->handler, $method)) {\r\n\t\t\t\t$fct = new ReflectionMethod($this->handler, $method);\r\n\t\t\t\t\r\n\t\t\t\t$params = isset($this->request[\"params\"]) ? $this->request[\"params\"] : array();\r\n\t\t\t\tif ($fct->getNumberOfRequiredParameters() == count($params))\r\n\t\t\t\t\t$response = call_user_func_array(array($this->handler, $method), $params);\r\n\t\t\t}\r\n\t\t\tif ($response) return json_encode(array(\"r\" => $response));\r\n\t\t\telse return \"{}\";\r\n\t\t} catch(Exception $e) {\r\n\t\t\terror_log($e);\r\n\t\t\treturn \"{}\";\r\n\t\t}\r\n\t}",
"public function handleWebhook(Request $request)\n {\n $this->request = $request;\n $this->roomId = $this->getWebhookVal('room_id');\n $this->chatworkRoom = new ChatworkRoom($this->roomId);\n $this->chatworkApi = new ChatworkApi();\n $eventType = $this->getWebhookVal('webhook_event_type');\n\n if ($eventType === 'mention_to_me') {\n $this->replyToMentionMessage();\n } elseif ($eventType === 'message_created' || $eventType === 'message_updated') {\n $this->handleCreatedAndUpdatedMessageEvents();\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |