query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Returns a list of entities using a fulltextsearch | public function findByFulltext($search, $limit = 10, $offset = 0); | [
"function elgg_tokeninput_search_all($term, $options = array()) {\n\n\t$term = sanitize_string($term);\n\n\t// replace mysql vars with escaped strings\n\t$q = str_replace(array('_', '%'), array('\\_', '\\%'), $term);\n\n\t$entities = elgg_get_config('registered_entities');\n\t$subtypes = array(0);\n\tforeach ($entities['object'] as $subtype) {\n\t\t$subtype_id = get_subtype_id('object', $subtype);\n\t\tif ($subtype_id)\n\t\t\t$subtypes[] = $subtype_id;\n\t}\n\n\t$subtypes_in = implode(',', $subtypes);\n\n\t$dbprefix = elgg_get_config('dbprefix');\n\n\t$options['joins'][] = \"LEFT JOIN {$dbprefix}users_entity ue ON ue.guid = e.guid AND e.type = 'user'\";\n\t$options['joins'][] = \"LEFT JOIN {$dbprefix}groups_entity ge ON ge.guid = e.guid AND e.type = 'group'\";\n\t$options['joins'][] = \"LEFT JOIN {$dbprefix}objects_entity oe ON oe.guid = e.guid AND e.type = 'object'\";\n\n\t$options['wheres'][] = \"(e.type = 'user' AND ue.banned = 'no' AND (ue.name LIKE '%$q%' OR ue.username LIKE '%$q%'))\n\t\t\tOR (e.type = 'group' AND ge.name LIKE '%$q%')\n\t\t\tOR (e.type = 'object' AND e.subtype IN ($subtypes_in) AND oe.title LIKE '%$q%')\";\n\n\treturn elgg_get_entities($options);\n}",
"private function getCompanies($fullText){\n //$client->post('http://httpbin.org/post', ['body' => $body]);\n\n $searchPar = ['entity_type' =>'companies_eng', 'text' => $fullText ];\n\n /* var_dump($this->getCompaniesUrl([\n //'entity_type' =>'companies_eng',\n //'text' => $fullText,\n 'apikey' => self::IDOL_KEY\n ]));die; */\n\n $response = $this->getClient()->get(\n $this->getCompaniesUrl([\n 'entity_type' =>'companies_eng',\n 'text' => $fullText,\n 'unique_entities' => 'true',\n 'apikey' => self::IDOL_KEY\n ])\n );\n\n $companies = json_decode($response->getBody() );\n\n if(!isset($companies->entities)){\n return false;\n }\n\n $companiesRes = [];\n\n foreach($companies->entities as $company){\n $companiesRes[] = $company->normalized_text;\n }\n\n return $companiesRes;\n\n }",
"private function getSearchResults($pattern, $entityClassTechnicalName){\r\n\r\n $finderName = 'fos_elastica.finder.slcore.'.$entityClassTechnicalName; \r\n $finder = $this->get($finderName); \r\n\r\n $filters = $this->em->getFilters();\r\n $filters->disable('softdeleteable');\r\n\r\n $this->get('fos_elastica.index.slcore')->refresh(); \r\n $entities = $finder->find($pattern, $this->numberOfSearchResults);\r\n\r\n $filters->enable('softdeleteable');\r\n\r\n return $entities; \r\n }",
"function analyze_entities($text)\r\n{\r\n // Create the Natural Language client\r\n $language = new LanguageClient([\r\n 'projectId' => $google_project_id,\r\n ]);\r\n\r\n // Call the analyzeEntities function\r\n $annotation = $language->analyzeEntities($text);\r\n\r\n // Print out information about each entity\r\n $entities = $annotation->entities();\r\n\t$names = array();\r\n\t\r\n foreach ($entities as $entity) {\r\n $names[] = $entity['name'];\r\n }\r\n\t\r\n\treturn $names;\r\n}",
"public function fulltext($searchWord);",
"public function testSearchEntitiesByTags()\n {\n $entities = array(\n array(\n 'entity_type' => 'forum_post',\n 'entity_id' => 1,\n 'text' => 'forum post title',\n 'tags' => array(\n 'forum_post'\n )\n ),\n array(\n 'entity_type' => 'forum_post',\n 'entity_id' => 1,\n 'text' => 'forum post body',\n 'tags' => array(\n 'forum_post'\n )\n ),\n array(\n 'entity_type' => 'forum_post',\n 'entity_id' => 2,\n 'text' => 'forum post title',\n 'tags' => array(\n 'forum_post'\n )\n ),\n array(\n 'entity_type' => 'forum_post',\n 'entity_id' => 2,\n 'text' => 'forum post body',\n 'tags' => array(\n 'forum_post'\n )\n ),\n array(\n 'entity_type' => 'forum_topic',\n 'entity_id' => 1,\n 'text' => 'forum topic title',\n 'tags' => array(\n 'forum_topic'\n )\n ),\n array(\n 'entity_type' => 'forum_category',\n 'entity_id' => 1,\n 'text' => 'forum category title',\n 'tags' => array(\n 'forum_category'\n )\n )\n );\n\n // add test entities\n foreach ($entities as $entitiy)\n {\n OW::getTextSearchManager()->\n addEntity($entitiy['entity_type'], $entitiy['entity_id'], $entitiy['text'], time(), $entitiy['tags']);\n }\n\n // search entities by tags\n $entities = OW::getTextSearchManager()->searchEntities('forum', 0, 100, array(\n 'forum_post'\n ));\n\n // did we get only forum posts?\n $this->assertInternalType('array', $entities);\n $this->assertEquals(2, count($entities));\n\n foreach ($entities as $entity) \n {\n $this->assertEquals('forum_post', $entity['entityType']);\n }\n }",
"public function getEntityList();",
"public function getSearchFulltext()\n\t {\n\t\t return $this->GetDAL()->GetFulltext(DotCoreEventDAL::EVENTS_FULLTEXT);\n\t }",
"function elgg_tokeninput_search_owned_entities($query, $options = array()) {\n\n\t$user = elgg_get_logged_in_user_entity();\n\n\t$query = sanitize_string($query);\n\n\t// replace mysql vars with escaped strings\n\t$q = str_replace(array('_', '%'), array('\\_', '\\%'), $query);\n\n\t$entities = elgg_get_config('registered_entities');\n\t$subtypes = array(0);\n\tforeach ($entities['object'] as $subtype) {\n\t\t$subtype_id = get_subtype_id('object', $subtype);\n\t\tif ($subtype_id) $subtypes[] = $subtype_id;\n\t}\n\n\t$subtypes_in = implode(',', $subtypes);\n\n\t$dbprefix = elgg_get_config('dbprefix');\n\n\t$options['types'] = array('object', 'group');\n\n\t$options['joins'][] = \"LEFT JOIN {$dbprefix}groups_entity ge ON ge.guid = e.guid AND e.type = 'group'\";\n\t$options['joins'][] = \"LEFT JOIN {$dbprefix}objects_entity oe ON oe.guid = e.guid AND e.type = 'object'\";\n\n\t$options['wheres'][] = \"(e.type = 'group' AND ge.name LIKE '%$q%')\n\t\t\tOR (e.type = 'object' AND e.subtype IN ($subtypes_in) AND oe.title LIKE '%$q%')\";\n\n\t$options['wheres'][] = \"e.owner_guid = $user->guid\";\n\t\n\treturn elgg_get_entities($options);\n\t\n\n}",
"public function getSearchEntries($search_terms)\r\n {\r\n // ensure that the search terms are not empty or consist only of whitespace\r\n if (!empty($search_terms) and !ctype_space($search_terms)) {\r\n // create an array with all of the search tokens\r\n $search_words = explode(' ', $search_terms);\r\n\r\n // remove any words from the array that are empty\r\n foreach ($search_words as $word) {\r\n if (!empty($word)) {\r\n // add % on each side of work so that we can use like keyword properly\r\n $final_search_words[] = \"%$word%\";\r\n }\r\n }\r\n\r\n // create the array of strings with the SQL where statements\r\n foreach ($final_search_words as $word) {\r\n $where_list[] = \"blog_entry.entry_title LIKE ?\";\r\n }\r\n\r\n // put the list back together into one string separated by OR\r\n $where_clause = \"WHERE \" . implode(' OR ', $where_list);\r\n\r\n // the sql statement to get all of the relevant entries from the database\r\n $sql = \"SELECT blog_entry.id, blog_entry.entry_title, substr(blog_entry.entry_text, 1, 150) AS intro, blog_entry.entry_date, blog_entry.image_url, users.username\r\n FROM blog_entry\r\n JOIN users\r\n ON blog_entry.author_id=users.user_id $where_clause \r\n ORDER BY blog_entry.entry_date DESC\";\r\n\r\n // execute the sql statement and store the result\r\n $retrieval_statement = $this->makeStatement($sql, $final_search_words);\r\n\r\n return $retrieval_statement;\r\n }\r\n // else simply return all entries if the user didn't submit a valid term\r\n else {\r\n return $this->getAllEntries();\r\n }\r\n }",
"abstract public function search($terms);",
"public function getIndexableEntities($entity): array;",
"public function searchArticles($search_term = '') {\n try {\n // Map request as query object. Search by title is currently disabled.\n // More info: https://www.mediawiki.org/wiki/API:Search\n $response = $this->client->get('', [\n 'query' => [\n 'action' => 'query',\n 'list' => 'search',\n 'utf8' => '',\n 'prop' => 'info',\n 'format' => 'json',\n 'srwhat' => 'text',\n 'srsearch' => $search_term,\n 'srlimit' => 20,\n 'sroffset' => 0,\n ],\n ]);\n $data = Json::decode($response->getBody());\n return $data;\n }\n catch (RequestException $e) {\n // Notify user about failed request.\n drupal_set_message(t('An error ocurred while attempting to fetch information from resource: \"%error\"', ['%error' => $e->getMessage()]), 'error');\n }\n }",
"function listAllWithSearch($term) \r\n {\r\n\r\n $newTerm = \"%\".$term.\"%\";\r\n\r\n //new PDOAgent\r\n $p = new PDOAgent(\"mysql\", DB_USER, DB_PASS, DB_HOST, DB_NAME);\r\n\r\n //Connect to the Database\r\n $p->connect();\r\n\r\n //Setup the Bind Parameters\r\n $bindParams = [\"term\"=>$newTerm];\r\n \r\n //Get the results of the insert query (rows inserted)\r\n $results = $p->query(\"SELECT * FROM Coaches WHERE coachFName LIKE :term OR\r\n coachLName LIKE :term OR salary LIKE :term OR teamName LIKE :term \r\n OR dateStarted LIKE :term OR endOfContract LIKE :term;\", $bindParams);\r\n \r\n //Disconnect from the database\r\n $p->disconnect();\r\n \r\n //Return the objects\r\n return $results;\r\n }",
"public function getEntities()\n {\n return $this->makeRequest('GET', 'entities');\n }",
"function getSearchedArticles($search_query)\n {\n $query = $this->createQueryBuilder('a')\n ->where('a.title LIKE :title')\n ->setParameter('title', '%'.$search_query.'%');\n\n return $query->getQuery()->getArrayResult();\n }",
"function setFullTextSearch() {\n\n\t\t\t$dbMain = db_getDBObject(DEFAULT_DB, true);\n\t\t\tif (defined(\"SELECTED_DOMAIN_ID\")) {\n\t\t\t\t$dbObj = db_getDBObjectByDomainID(SELECTED_DOMAIN_ID, $dbMain);\n\t\t\t} else {\n\t\t\t\t$dbObj = db_getDBObject();\n\t\t\t}\n\n\t\t\tunset($dbMain);\n\n\t\t\tif ($this->title) {\n\t\t\t\t$string=str_replace(\" || \", \" \", $this->title);\n $fulltextsearch_keyword[] = $string;\n $addkeyword=format_addApostWords($string);\n if ($addkeyword!='') $fulltextsearch_keyword[] =$addkeyword;\n unset($addkeyword);\n\t\t\t}\n \n $edir_languages = explode(\",\", EDIR_LANGUAGENUMBERS);\n \n foreach($edir_languages as $lang_index){\n if ($this->{\"keywords\".$lang_index}) {\n $string=str_replace(\" || \", \" \", $this->{\"keywords\".$lang_index});\n $fulltextsearch_keyword[] = $string;\n $addkeyword=format_addApostWords($string);\n if ($addkeyword!='') $fulltextsearch_keyword[] =$addkeyword;\n unset($addkeyword);\n }\n \n if ($this->{\"summarydesc\".$lang_index}) {\n $fulltextsearch_keyword[] = string_substr($this->{\"summarydesc\".$lang_index}, 0, 100);\n }\n\n }\n\n\t\t\tif ($this->address) {\n\t\t\t\t$fulltextsearch_where[] = $this->address;\n\t\t\t}\n\n\t\t\tif ($this->zip_code) {\n\t\t\t\t$fulltextsearch_where[] = $this->zip_code;\n\t\t\t}\n\n\t\t\t$_locations = explode(\",\", EDIR_LOCATIONS);\n\t\t\tforeach ($_locations as $each_location) {\n\t\t\t\tunset ($objLocation);\n\t\t\t\t$objLocationLabel = \"Location\".$each_location;\n\t\t\t\t$attributeLocation = 'location_'.$each_location;\n\t\t\t\t$objLocation = new $objLocationLabel;\n\t\t\t\t$objLocation->SetString(\"id\", $this->$attributeLocation);\n\t\t\t\t$locationsInfo = $objLocation->retrieveLocationById();\n\t\t\t\tif ($locationsInfo[\"id\"]) {\n\t\t\t\t\t$fulltextsearch_where[] = $locationsInfo[\"name\"];\n\t\t\t\t\tif ($locationsInfo[\"abbreviation\"]) {\n\t\t\t\t\t\t$fulltextsearch_where[] = $locationsInfo[\"abbreviation\"];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$categories = $this->getCategories();\n\t\t\tif ($categories) {\n\t\t\t\tforeach ($categories as $category) {\n\t\t\t\t\tunset($parents);\n\t\t\t\t\t$category_id = $category->getNumber(\"id\");\n\t\t\t\t\twhile ($category_id != 0) {\n\t\t\t\t\t\t$sql = \"SELECT * FROM ClassifiedCategory WHERE id = $category_id\";\n\t\t\t\t\t\t$result = $dbObj->query($sql);\n\t\t\t\t\t\tif (mysql_num_rows($result) > 0) {\n\t\t\t\t\t\t\t$category_info = mysql_fetch_assoc($result);\n\t\t\t\t\t\t\t$langs = explode(\",\", $category_info[\"lang\"]);\n if (is_array($langs) && $langs[0]){\n $langObj = new Lang();\n foreach($langs as $lang){\n if ($lang){\n $lang_id = $langObj->returnLangId($lang); \n\n if ($category_info[\"enabled\"] == \"y\") {\n if ($category_info[\"title\".$lang_id]) {\n $fulltextsearch_keyword[] = $category_info[\"title\".$lang_id];\n }\n\n if ($category_info[\"keywords\".$lang_id]) {\n $fulltextsearch_keyword[] = $category_info[\"keywords\".$lang_id];\n }\n }\n } \n } \n }\n\t\t\t\t\t\t\t$category_id = $category_info[\"category_id\"];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$category_id = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (is_array($fulltextsearch_keyword)) {\n\t\t\t\t$fulltextsearch_keyword_sql = db_formatString(implode(\" \", $fulltextsearch_keyword));\n\t\t\t\t$sql = \"UPDATE Classified SET fulltextsearch_keyword = $fulltextsearch_keyword_sql WHERE id = $this->id\";\n\t\t\t\t$result = $dbObj->query($sql);\n\t\t\t}\n\t\t\tif (is_array($fulltextsearch_where)) {\n\t\t\t\t$fulltextsearch_where_sql = db_formatString(implode(\" \", $fulltextsearch_where));\n\t\t\t\t$sql = \"UPDATE Classified SET fulltextsearch_where = $fulltextsearch_where_sql WHERE id = $this->id\";\n\t\t\t\t$result = $dbObj->query($sql);\n\t\t\t}\n\n\t\t}",
"protected static function getExpressEntities()\n {\n $entityManager = \\Core::make(EntityManagerInterface::class);\n $repo = $entityManager->getRepository('\\Concrete\\Core\\Entity\\Express\\Entity');\n $entities = $repo->findBy(array('include_in_public_list' => true));\n return $entities;\n }",
"public function fulltextQuery($query)\n\t{\n\t\tif(($search = $this->searchEngine()) === null)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t$rs = $search->query($query);\n\t\t$rs['storableClass'] = 'TroveObject';\n\t\tforeach($rs['list'] as $k => $entry)\n\t\t{\n\t\t\t$rs['list'][$k] = $this->dataForUUID($entry['uuid']);\n\t\t}\n\t\t$set = new StaticStorableSet($this, $rs);\n\t\treturn $set;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
given a user ID return connections connections ids | function getConnectionsConnectionsIds($userConnections){
$userConnectionsConnections=[];
foreach($userConnections as $k=>$v){
array_push($userConnectionsConnections,getConnectionsFromUserId($v));
}
return $userConnectionsConnections;
} | [
"function getConnectionsFromUserID($userID){\n require \"includes/dbh-inc.php\";\n $userConnectionsIDs = [];\n $sql = \"SELECT Connections.UserB_Id\n FROM Connections\n WHERE Connections.UserA_Id = {$userID};\";\n $result = $conn->query($sql);\n if($result->num_rows > 0){\n while($row = $result->fetch_assoc()){\n array_push($userConnectionsIDs,$row['UserB_Id']);\n }\n }\n \n return $userConnectionsIDs;\n}",
"function getConnectedUserIdsOfUsers($ids) {\n\t$userids = idsToArray($ids);\n\n\t// Get users that they have a connection TO\n\t//SELECT connectionid FROM connections WHERE type = 'user' AND (userid = 2 OR userid = 5)\n\t$sql = \"SELECT connectionid FROM connections WHERE type = 'user' AND (\";\n\tforeach($userids as $userid) {\n\t\t$sql .= 'userid = ' . $userid;\n\t\tif (end($userids) != $userid) { $sql .= \" OR \"; }\n\t}\n\t$sql .= \")\";\n\t$connectionIds = queryColumn($sql);\n\n\treturn $connectionIds;\n}",
"function getConnectedUserIdsToUsers($ids) {\n\t$userids = idsToArray($ids);\n\n\t// Get users that they have a connection FROM\n\t//SELECT userid FROM connections WHERE type = 'user' AND (connectionid = 4)\n\t$sql = \"SELECT userid FROM connections WHERE type = 'user' AND (\";\n\tforeach($userids as $userid) {\n\t\t$sql .= 'connectionid = ' . $userid;\n\t\tif (end($userids) != $userid) { $sql .= \" OR \"; }\n\t}\n\t$sql .= \");\";\n\t$connectionIds = queryColumn($sql);\n\n\treturn $connectionIds;\n}",
"public static function get_user_connections(){\n\n\t\t$user = wp_get_current_user();\n\t\t$res = get_user_meta(\n\t\t\t$user->ID, \n\t\t\tAPI_Con_Model::$meta_keys['user_connections'],\n\t\t\ttrue\n\t\t);\n\n\t\tif ( !$res )\n\t\t\treturn array();\n\t\treturn $res;\n\t}",
"public function listConnectionsIds()\n {\n return $this->_procFunc(\"listConnectionsIds\");\n }",
"function getConnectedUserIdsOfStudents($ids) {\n\t$userids = idsToArray($ids);\n\n\t// Get user ids from connection table\n\t//SELECT connectionid FROM connections WHERE type = 'student' AND (connectionid = 2 OR connectionid = 5)\n\t$sql = \"SELECT userid FROM connections WHERE type = 'student' AND (\";\n\tforeach($userids as $userid) {\n\t\t$sql .= 'connectionid = ' . $userid;\n\t\tif (end($userids) != $userid) { $sql .= \" OR \"; }\n\t}\n\t$sql .= \");\";\n\t$connections = queryColumn($sql);\n\n\treturn $connections;\n}",
"public function getAssignableConnections() {\n\t\treturn Yii::app()->db->createCommand()\n\t\t\t->select('connectionID, IPAddress, username')\n\t\t\t->from('tbl_connection')\n\t\t\t->where('connectionID NOT IN (SELECT connectionID FROM tbl_user_connection WHERE userID = :userID)', array(':userID' => $this->userID))\n\t\t\t->order(array('IPAddress', 'username'))\n\t\t\t->queryAll();\n\t}",
"public static function getUserDelegatedIds($user_id)\n {\n return ServerDelegation::where('user_id', $user_id)->select('server_id')->get()->toArray();\n }",
"function updateConnections($uid)\n\t{\n\t\t$conn = connect(\"127.0.0.1\", \"5000\", \"root\", \"\");\n\t\t$memcached = initMemcached();\n\t\t\n\t\t$userConnections = array();\n\n\t\t// Query connections table\n\t\t$query = \"Select conn_user1 as connectedUser from connections where conn_user2 = $uid UNION \".\n\t\t \t\t \"Select conn_user2 as connectedUser from connections where conn_user1 = $uid\";\n\t\t$result = mysqli_query($conn, $query) or die(\"Query Execution failed: \".mysqli_error($conn));\n\t\twhile($connectedUser = mysqli_fetch_array($result, MYSQL_ASSOC))\n\t\t\t$userConnections[] = getUserInfo($connectedUser[\"connectedUser\"]);\n\n\t\t$memcached->set(md5(\"user-connections-\".$uid), $userConnections);\n\t\tmysqli_close($conn);\n\n\t\treturn $userConnections;\n\t}",
"public function GetCurrentConnectionIDs(){\n $args=\"\";\n $filter=\"ConnectionIDs\";\n return $this->BASE->Upnp($this->SERVICEURL,$this->SERVICE,'GetCurrentConnectionIDs',$args,$filter);\n }",
"static public function connections() {\n\t\t$connections\t= array();\n\t\t$list\t\t\t= static::connection_list();\n\t\tforeach ($list as $id)\n\t\t\t$connections[$id] = static::cn($id);\n\t\treturn $connections;\n\t}",
"public function getUserIds();",
"public function GetCurrentConnectionIDs(){\n if (!$this->GetOnlineState()) return null;\n $filter=array('ConnectionIDs');\n return self::Call('ConnectionManager','GetCurrentConnectionIDs',null,$filter);;\n }",
"public function getConnectedUsers(){\n\t\t$uarr = array();\n\t\tforeach($this->users as $user){\n\t\t\t$uarr[$user->id] = $user->name;\n\t\t}\n\t\treturn $uarr;\n\t}",
"public function getPublicConnections();",
"public function getConnectedUsers()\n {\n $users = $this->sendRequest('connected_users', []);\n\n return isset($users['connected_users']) ? $users['connected_users'] : [];\n }",
"public static function getAllConnectedUsers(){\n\t\treturn UserDBHandler::getAllConnectedUsers();\n\t}",
"public function getConnections()\n {\n $connections = array();\n foreach ($this->connections as $name => $id) {\n $connections[$name] = $this->container->get($id);\n }\n\n return $connections;\n }",
"public static function getConnections () {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate MYSQL for float | public function generateMySQL($param) {
$size = $this->getSize($param["params"]);
$size = ($size == "") ? "(11)" : "($size)";
$null = $this->getNull($param["params"]);
$null = ($null == true) ? "NULL" : "NOT NULL";
$default = $this->getDefault($param["params"]);
$default = ($default == "") ? "" : "DEFAULT '$default'";
return "`" . $param['name'] . "` FLOAT$size $null $default";
} | [
"function getFloat($column_name) {}",
"function SetColFormatFloat($col, $width=-1, $precision=-1){}",
"function escapeFloat4Sql($f){\n\t\treturn (string)$f;\n\t}",
"protected function getDecimalSql($value)\n {\n return (float) $value;\n }",
"function writeFloat(){\r\n\t\tdie('Not implemented');\r\n\t}",
"function floatval($var) {}",
"function numero_mysql($numero)\r\n{ \r\n return number_format($numero,2,'.',','); \r\n}",
"protected function type_float(Fluent $column)\n\t{\n\t\treturn \"float({$column->total}, {$column->places})\";\n\t}",
"public function writeFloat($num){ }",
"function setBigFloat($index, $value)\n\t{\n\t\tif( $value === NULL ){\n\t\t\t$v = \"NULL\";\n\t\t} else {\n\t\t\t$v = $value->__toString();\n\t\t\t$scale = $value->scale() + 1;\n\t\t\tif( $scale == strlen($v) ){\n\t\t\t\t$precision = 0;\n\t\t\t} else {\n\t\t\t\t$precision = strlen($v) - $scale - 1;\n\t\t\t\t$scale += $precision;\n\t\t\t}\n\t\t\t$v = \"cast('$v' as DECIMAL($scale,$precision))\";\n\t\t}\n\t\t$this->setParameter($index, $v);\n\t}",
"private function columnFloat($fieldName)\n {\n $this->table->addColumn($fieldName, 'float', ['default' => 0]);\n }",
"function TempToDB($conn,$T){\r\n $c_f = settings($conn, 'c_f');\r\n if($c_f==1 || $c_f=='1'){\r\n return round(($T-32)*5/9,1);\r\n }\r\n return round($T,1);\r\n}",
"public function toSQL()\n {\n return DB::Raw('POINT(' . $this->getLongitude() . ', ' . $this->getLatitude() . ')');\n }",
"protected function type_float(Fluent $column)\n\t{\n\t\treturn 'float';\n\t}",
"public function asFloat() {}",
"function _db_create_field_sql($name, $spec) {\n $sql = \"`\". $name .\"` \". $spec['mysql_type'];\n\n if (isset($spec['length'])) {\n $sql .= '('. $spec['length'] .')';\n }\n else if (isset($spec['precision']) && isset($spec['scale'])) {\n $sql .= '('. $spec['precision'] .', '. $spec['scale'] .')';\n }\n\n if (!empty($spec['unsigned'])) {\n $sql .= ' unsigned';\n }\n\n if (!empty($spec['not null'])) {\n $sql .= ' NOT NULL';\n }\n\n if (!empty($spec['auto_increment'])) {\n $sql .= ' auto_increment';\n }\n\n if (isset($spec['default'])) {\n if (is_string($spec['default'])) {\n $spec['default'] = \"'\". $spec['default'] .\"'\";\n }\n\n $sql .= ' DEFAULT '. $spec['default'];\n }\n\n if (empty($spec['not null']) && !isset($spec['default'])) {\n $sql .= ' DEFAULT NULL';\n }\n\n return $sql;\n}",
"function gmp_init_float($value)\n{\n if (is_int($value))\n {\n return $value;\n }\n if (is_float($value))\n {\n return sprintf(\"%.0f\", $value);\n }\n if (strpos($value, '.') !== FALSE)\n {\n // Return int part of string\n list($value) = explode('.', $value);\n return $value;\n }\n\n return \"$value\";\n}",
"function setBigFloat($index, $value)\n\t{\n\t\tif( $value === NULL )\n\t\t\t$v = \"NULL\";\n\t\telse\n\t\t\t$v = \"'\" . $value->__toString() . \"'\";\n\t\t$this->setParameter($index, $v);\n\t}",
"function Float($val)\n{\n return new Float($val);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update company member table and set permission values | function set_company_member_permission($user_id, $company_id, $values) {
echo "<pre>";
print_r($values);
exit();
$data = $this->get_company_member_data($user_id, $company_id);
if ($data) {
$original_values = !empty($data['permissions']) && $data['permissions'] != 'null' ? json_decode(stripslashes($data['permissions']), TRUE) : array();
$new_values = array_merge($original_values, $values);
$this->db->where('id', $data['id']);
$res = $this->db->update($this->company_member_table, array('permissions' => json_encode($new_values)));
if ($res) {
return true;
}
}
return false;
} | [
"function ncn_admin_assign_member_to_am($member_id, $am_uid)\n{\n// $query = \"UPDATE member_id_pool SET am_uid=$am_uid WHERE member_id='$member_id'\";\n $result = db_query('UPDATE {member_id_pool} SET am_uid=:a WHERE member_id=:b',\n array(':a'=>$am_uid ,':b'=>$member_id));\n if ($result->rowCount()==0)\n {\n return FALSE;\n }\n\n ncn_admin_check_am_auto_assign_row($am_uid);\n ncn_admin_update_am_auto_assign_row($am_uid);\n return TRUE;\n}",
"function updateMember($member_id, $name, $email, $company_id){\n\t\t$sql = \"UPDATE members SET name='$name', email='$email', company_id='$company_id' WHERE member_id='$member_id'\";\n\t\t$this->conn->query($sql);\n\t}",
"public function updatePermissions() {\n\n // check that required parameters are defined\n $params = $this->subsetArray($this->_params, [\"user_id\",\n \"target_id\", \"network\", \"permissions\"]);\n\n if ($params['target_id'] == \"admin\") {\n throw new Exception(\"Cannot change permissions for admin\");\n }\n\n $targetid = $params['target_id'];\n $newperm = (int) $params['permissions'];\n\n // get the netid that matches the network name\n $netid = $this->getNetworkId($params['network']);\n\n // get permissions for the asking user\n // only curators and admin can update permissions \n $uperm = $this->getUserPermissions($netid, $this->_uid);\n if ($uperm < NC_PERM_CURATE) {\n throw new Exception(\"Insufficient permissions\");\n }\n\n // make sure the target user exists and the permisions are valid\n if ($newperm < NC_PERM_NONE || $newperm > NC_PERM_CURATE) {\n throw new Exception(\"Invalid permission code $newperm\");\n }\n if ($targetid == \"guest\" && $newperm > NC_PERM_VIEW) {\n throw new Exception(\"Guest user cannot have high permissions\");\n }\n $sql = \"SELECT user_id, user_firstname, user_middlename, user_lastname \n FROM \" . NC_TABLE_USERS . \" WHERE user_id = ?\";\n $stmt = $this->qPE($sql, [$targetid]);\n $result = $stmt->fetch();\n if (!$result) {\n throw new Exception(\"Target user does not exist\");\n }\n $userinfo = array();\n $userinfo[$targetid] = $result;\n $userinfo[$targetid]['permissions'] = $newperm;\n\n // make sure the new permission is different from the existing value\n $targetperm = $this->getUserPermissions($netid, $targetid);\n if ($targetperm === $newperm) {\n throw new Exception(\"Permissions do not need updating\");\n }\n\n // if reached here, all is well. Update the permissions code \n $sql = \"INSERT INTO \" . NC_TABLE_PERMISSIONS . \" \n (user_id, network_id, permissions) VALUES \n (?, ?, ?) ON DUPLICATE KEY UPDATE permissions = ?\";\n $stmt = $this->qPE($sql, [$targetid, $netid, $newperm, $newperm]);\n\n // log the activity \n $this->logActivity($this->_uid, $netid, \"updated permissions for user\", $targetid, $newperm);\n $this->sendUpdatePermissionsEmail($netid);\n\n return $userinfo;\n }",
"public function updatePermissions()\n {\n if ($this->isHiringOrganization()) {\n $organization = $this->getParent();\n $owner = $organization->getUser();\n\n $this->setUser($owner);\n } else {\n $organization = $this;\n }\n\n /* @var $employees null | ArrayCollection | \\Doctrine\\ODM\\MongoDB\\PersistentCollection */\n $employees = $organization->getEmployees();\n\n $perms = $this->getPermissions();\n\n foreach ($employees as $emp) {\n /* @var $emp \\Organizations\\Entity\\Employee */\n $perms->grant($emp->getUser(), PermissionsInterface::PERMISSION_CHANGE, false);\n }\n $perms->build();\n }",
"public function testUpdateSiteMembershipRequestForPerson()\n {\n }",
"function aconnect_update_meeting_perm($aconnect, $meetingscoid, $perm) {\n $params = array('action' => 'permissions-update',\n 'acl-id' => $meetingscoid,\n 'principal-id' => 'public-access',\n );\n\n switch ($perm) {\n case ADOBE_MEETPERM_PUBLIC:\n $params['permission-id'] = 'view-hidden';\n break;\n case ADOBE_MEETPERM_PROTECTED:\n $params['permission-id'] = 'remove';\n break;\n case ADOBE_MEETPERM_PRIVATE:\n default:\n $params['permission-id'] = 'denied';\n break;\n }\n\n $aconnect->create_request($params);\n\n if ($aconnect->call_success()) {\n return true;\n } else {\n return false;\n }\n\n\n }",
"function update_accessright()\n {\n $parameter_array = $this->get_parameter_array();\n parent::update($this->id, 'ssi', $parameter_array);\n }",
"public function update() {\n if(!$this->request->is('restful')) {\n $targetCoPersonId = $this->request->data['CoGroupMember']['co_person_id'];\n $userCoPersonId = $this->Session->read('Auth.User.co_person_id');\n $requesterIsAdmin = $this->Role->isCoAdmin($userCoPersonId, $this->cur_co['Co']['id'])\n || $this->Role->identifierIsCmpAdmin($this->Session->read('Auth.User.username'));\n \n try {\n $this->CoGroupMember->updateMemberships($targetCoPersonId,\n $this->request->data['CoGroupMember']['rows'],\n $userCoPersonId,\n $requesterIsAdmin);\n \n $this->Flash->set(_txt('rs.saved'), array('key' => 'success'));\n }\n catch(Exception $e) {\n $this->Flash->set($e->getMessage(), array('key' => 'error'));\n }\n \n // Issue redirect\n $redir = array();\n $redir['controller'] = 'co_groups';\n $redir['action'] = 'select';\n $redir['co'] = $this->cur_co['Co']['id'];\n\n // If the current user is not the same as the target CO Person for whom\n // memberships are being managed then include the copersonid parameter.\n if($targetCoPersonId != $userCoPersonId) {\n $redir['copersonid'] = $targetCoPersonId;\n }\n\n $this->redirect($redir);\n }\n }",
"public function testUpdatePrivilege2()\n {\n }",
"public function testUpdatePrivilege3()\n {\n }",
"public function update_role() {\n\t\t$table = new cli\\Table();\n\t\t$table->setHeaders( [ 'No Change', 'Upgrade', 'Resign' ] );\n\t\t$body = capitalp_update_bulk_role();\n\t\t$table->addRow( $body );\n\t\t$table->display();\n\t\tWP_CLI::success( sprintf( 'Above is the CCP %d members status.', $body[0] + $body[1] + $body[2] ) );\n\t}",
"public function updatePermission()\n {\n $permArray = array();\n $menuArray = array();\n $currentUserRole = Auth::user()->user_role;\n $roleList = DB::table('roles')->select('id','permission')->get();\n try {\n $menuArray = $this->fetchMenu();\n foreach($roleList as $role){\n $roleID = $role->id;\n $permission = trim($role->permission);\n if ($roleID == 1 || $permission==\"\") {\n $trigger = true;\n $resp = (object)$this->setPermSuperAdmin(array(), $menuArray, 0, $trigger);\n $permArray = json_encode($resp);\n $roleobj = Role::find($roleID);\n $roleinfo = array();\n $roleinfo['permission'] = $permArray;\n $roleobj->fill($roleinfo)->update();\n\n }else{\n $currentPermissionArr = $this->permissionArrRedefine($permission);\n $resp = (object)$this->setPerm(array(), $menuArray, 0, $currentPermissionArr);\n $permArray = json_encode($resp);\n $roleobj = Role::find($roleID);\n\n $roleinfo = array();\n $roleinfo['permission'] = $permArray;\n $roleobj->fill($roleinfo)->update();\n }\n }\n\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n\n return true;\n }",
"private function update_permitted()\n {\n $this->logopen_ispermit();\n\n foreach($this->supportgroups as $key => $garbage) {\n $this->supportgroups[$key][\"permitted\"] =\n $this->is_permitted($this->supportgroups[$key][\"name\"]);\n\n $this->logwrite_ispermit(\"is_permitted: \" .\n $this->supportgroups[$key][\"name\"] . \" \" .\n (($this->supportgroups[$key][\"permitted\"] ==1) ?\n \"permitted.\" : \"not permitted.\") . \"\\n\");\n }\n\n $this->logclose_ispermit();\n }",
"function update_permissions()\n\t{\n\t\taccess_control($this, array('admin'));\n\n\t\t# Get the passed details into the url data array if any\n\t\t$urldata = $this->uri->uri_to_assoc(3, array('m', 'i', 't'));\n\t\t# Pick all assigned data\n\t\t$data = assign_to_data($urldata);\n\n\t\tif(!empty($data['i'])){\n\t\t\t$result = $this->db->query($this->Query_reader->get_query_by_code('get_group_permissions', array('groupid'=>decryptValue($data['i'])) ));\n\t\t\t$the_permissions_list = $result->result_array();\n\t\t\t$data['permissions_list'] = array();\n\t\t\tforeach($the_permissions_list AS $permission_row){\n\t\t\t\tarray_push($data['permissions_list'], $permission_row['permissionid']);\n\t\t\t}\n\n\n\t\t\t$data['groupdetails'] = $this->Query_reader->get_row_as_array('get_group_by_id', array('groupid'=>decryptValue($data['i']) ));\n\t\t\t$usertype = ($this->session->userdata('isadmin') == 'Y')? \"admin\": \"\";\n\t\t\t$result = $this->db->query($this->Query_reader->get_query_by_code('get_all_permissions', array('accesslist'=>\"'\".$usertype.\"'\") ));\n\t\t\t$data['all_permissions'] = $result->result_array();\n\n\t\t\t#put all permissions in a manageable array\n\t\t\t$data['all_permissions_list'] = array();\n\t\t\tforeach($data['all_permissions'] AS $thepermission){\n\t\t\t\tarray_push($data['all_permissions_list'], $thepermission['id']);\n\t\t\t}\n\t\t}\n\n\t\tif(!empty($data['t']) && $data['t'] == 'super'){\n\t\t\t$tstr = \"/t/super\";\n\t\t}else{\n\t\t\t$tstr = \"\";\n\t\t}\n\n\t\tif($this->input->post('updatepermissions'))\n\t\t{\n\t\t\tif(!empty($_POST['permissions'])){\n\t\t\t\t$result_array = array();\n\t\t\t\t#First delete all permissions from the access table\n\t\t\t\t$delresult = $this->db->query($this->Query_reader->get_query_by_code('delete_group_permissions', array('groupid'=>$_POST['editid']) ));\n\n\t\t\t\tarray_push($result_array, $delresult);\n\n\t\t\t\tforeach($_POST['permissions'] AS $permissionid)\n\t\t\t\t{\n\t\t\t\t\t$insresult = $this->db->query($this->Query_reader->get_query_by_code('add_group_permission', array('groupid'=>$_POST['editid'], 'permissionid'=>$permissionid, 'author'=>$this->session->userdata('userid')) ));\n\t\t\t\t\tarray_push($result_array, $insresult);\n\t\t\t\t}\n\n\t\t\t\tif(get_decision($result_array)){\n\t\t\t\t\t$this->session->set_userdata('pgroup', \"The Group permissions have been assigned.\");\n\t\t\t\t\tredirect(\"admin/manage_user_groups/m/pgroup\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(empty($result) || !$result)\n\t\t{\n\t\t\tif(empty($_POST['permissions']))\n\t\t\t{\n\t\t\t\t$this->session->set_userdata('puser', \"WARNING: No permissions are assigned to the group.\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->session->set_userdata('puser', \"ERROR: The group permissions could not be assigned.\");\n\t\t\t}\n\t\t\tredirect(base_url().\"admin/manage_user_groups/m/puser\");\n\t\t}\n\n\t\t$data['view_to_load'] = 'users/user_group_permissions_v';\n\t\t$data['page_title'] = 'User group permissions ' . (!empty($data['groupdetails']['groupname'])?\n\t\t\t\t\t\t\t'for user group ['. $data['groupdetails']['groupname'] . ']' : '');\n\t\t$data['current_menu'] = 'user_groups';\n\t\t$data['search_url'] = '';\n\t\t$data['form_title'] = 'User group permissions ' . (!empty($data['groupdetails']['groupname'])?\n\t\t\t\t\t\t\t'for user group <i>['. $data['groupdetails']['groupname'] . ']</i>' : '');;\n\n\t\t$this->load->view('dashboard_v', $data);\n\n\t}",
"function trailsforthepeople_db_update_2002() {\n\t$db = db_connect();\n\n\t$sql = 'ALTER TABLE contributors ADD COLUMN allow_trails bool NOT NULL DEFAULT false;';\n\t$result = pg_query($db, $sql)\n\t\tor exit(\"Error running query.\");\n\n\t$sql = 'UPDATE contributors SET allow_trails=TRUE WHERE admin=true;';\n\n\t$result = pg_query($db, $sql) or exit(\"Error running query.\");\n}",
"function eventUpdatePermissions(){\n\t\tif(!security::hasAccess(\"Edit Permissions\"))\n\t\t\treturn;\n\n\t\tglobal $sql;\n\t\t//iterate through all the groups, finding which permissions where\n\t\t//checked of for each\n\t\t$userGroups = security::getUserGroups();\n\t\tforeach($userGroups as $userGroup){\n\t\t\t//permissions for this group (array of permission ids)\n\t\t\t$permissions = $this->getData(\"permissions_\".$userGroup->id);\n\t\t\tif(!is_array($permissions)) {\n\t\t\t\t$permissions = array();\n\t\t\t}\n\t\t\t//update the group in the database\n\t\t\t$userGroup->permissions = implode(\",\",$permissions);\n\t\t\t$userGroup->save();\n\n\t\t}\n\t\t$this->setEventResult(true, \"Updated\" );\n\t}",
"public function assignNewAdmin( $member );",
"public static function setContractorId() {\n\n $sql = \"UPDATE contractor SET users_id='8' WHERE id='3'\";\n self::insert($sql);\n\n\n }",
"public function setMembers(CompanyMembership $members);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if the current node is a sibling of a supplied node. (Both have the same direct parent) | public function is_sibling($target)
{
if ( ! ($target instanceof $this))
{
$target = self::factory($this->_object_name, $target);
}
if ((int) $this->pk() === (int) $target->pk())
return FALSE;
return ((int) $this->{$this->_parent_column} === (int) $target->{$target->_parent_column});
} | [
"public function isSiblingOf($node)\n {\n $this->checkNotNewModel(); \n $owner = $this->owner;\n if ($this->isRoot() || $node->isRoot()) {\n return $owner === $node;\n }\n return $owner->{$this->getPathFieldName()} == $node->{$this->getPathFieldName()};\n }",
"public function hasSiblings () {}",
"public function hasSiblings() {}",
"public function hasPrevSibling();",
"public function hasNextSibling()\n {\n return $this->isValidNode($this->getNextSibling()); \n }",
"public static function hasNextSibling(NodeObject $node, PropelPDO $con = null);",
"public function hasSiblings( ) {\n\n\t\treturn ( $this->_Parent->childCount > 1 );\n\t}",
"public function hasPrevSiblings();",
"public function hasSiblings() {\n $result = false;\n $children = null;\n $name = $this->_getName();\n $parentColumn = $this->_parentColumn;\n $idColumn = $this->_idColumn;\n\n if ($this->hasParent()) {\n $parent = $this->getParent();\n if ($parent!==null) {\n $id = $parent->$idColumn;\n $myId = $this->$idColumn;\n\n $children = $name->count('*',array(\n array (\n \"name\" => $parentColumn,\n \"operator\" => \"=\",\n \"value\" => $id\n ),\n array (\n \"name\" => $idColumn,\n \"operator\" => \"<>\",\n \"value\" => $myId\n )\n ));\n if ($children>0) {\n $result = true;\n }\n }\n }\n return $result;\n }",
"abstract public function isSiblingOf( $child1Id, $child2Id );",
"abstract public function isSiblingOf($child1Id, $child2Id);",
"public function hasNextSibling();",
"public static function hasPrevSibling(NodeObject $node, PropelPDO $con = null)\n\t{\n\t\treturn sfAssetFolderPeer::isValid(sfAssetFolderPeer::retrievePrevSibling($node, $con));\n\t}",
"public function hasPrevTextOrInlineSibling(DOMNode $node): bool{\n\t\t\tif (property_exists($node, \"previousSibling\")){\n\t\t\t\t$prevSibling = $node->previousSibling;\n\t\t\t}\n\n\t\t\tif (isset($prevSibling)){\n\t\t\t\tif ($prevSibling->nodeType === XML_TEXT_NODE){\n\t\t\t\t\tif (trim($prevSibling->textContent) !== \"\"){\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\t$this->nodeSettings->isInlineElement($prevSibling->nodeName)\n\t\t\t\t\t||\n\t\t\t\t\t$this->nodeSettings->isInlineSelfClosingElement($prevSibling->nodeName)\n\t\t\t\t){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}",
"public function isPrevSiblingOf(ElementInterface $element): bool;",
"public function isNextSiblingOf(ElementInterface $element): bool;",
"public function moveAsPrevSiblingOf(\\App\\DomainObject\\Node $node);",
"public function adjacentSibling($direction = 1);",
"function make_previous_sibling_of($object, $node)\n\t{\n\t\tif ( ! $this->is_root($node) )\n\t\t{\n\t\t\treturn $this->_moveSubtree($object, $node, $node->{$this->_leftindex});\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fungsi Add To Cart | function add_to_cart(){
$data = array(
'id' => $this->input->post('for_id'),
'name' => $this->input->post('title'),
'price' => $this->input->post('price'),
'qty' => $this->input->post('quantity'),
//cart sesion dari controller cart
);
$this->cart->insert($data);
echo $this->show_cart(); //tampilkan cart setelah added
} | [
"private function addToCart() {\n\t}",
"public function add()\n\t{\n\t\t$product = ORM::factory('product', $this->input->post('product_id'));\n\t\t$quantity = $this->input->post('quantity', 1);\n\t\t$variant = ORM::factory('variant', $this->input->post('variant_id'));\n\t\t\n\t\t$this->cart->add_product($product, $variant, $quantity);\n\t\t\n\t\turl::redirect('cart');\n\t}",
"function add_to_cart(){\n\t\t$data = array(\n\t\t\t'id' => $this->input->post('produk_id'), \n\t\t\t'name' => $this->input->post('produk_nama'), \n\t\t\t'price' => $this->input->post('produk_harga'),\n\t\t\t'price_before' => $this->input->post('produk_harga_origin'), \n\t\t\t'qty' => $this->input->post('qty') , \n\t\t\t'gbr' => $this->input->post('gambar'),\n\t\t);\n\t\t$this->cart->insert($data);\n\t\techo $this->show_cart(); //tampilkan cart setelah added\n\t}",
"public function addToCart(): void\n {\n //añadimos un Item con la cantidad indicada al Carrito\n Cart::add($this->oferta->id, $this->product->name, $this->oferta->getRawOriginal('offer_prize'), $this->quantity);\n //emite al nav-cart el dato para que lo actualize\n $this->emitTo('nav-cart', 'refresh');\n }",
"public function createCart();",
"public function addCartItem()\r\n\t\t{\r\n\t\t\tif(isset($_GET['pid'])) {\r\n\t\t\t\r\n\t\t\t\t$product_id = $_GET['pid'];\r\n\t\t\t\t\r\n\t\t\t\t//check that product ID is valid number\r\n\t\t\t\tif(!is_numeric($product_id)) {\r\n\t\t\t\t\techo \"Invalid product ID\";\r\n\t\t\t\t\tdie();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$productData = $this->store_m->getSingleProduct($product_id);\r\n\t\t\t\t\r\n\t\t\t\t$data = array(\r\n\t\t\t\t\t'id' => $product_id,\r\n\t\t\t\t\t'qty' => '1',\r\n\t\t\t\t\t'price' => $productData['0']['price'],\r\n\t\t\t\t\t'name' => $productData['0']['name'],\r\n\t\t\t\t\t'options' => array('sku' => $productData['0']['code'], 'photo' => $productData['0']['photo'])\r\n\t\t\t\t);\r\n\t\t\t\t\r\n\t\t\t\t$this->cart->insert($data);\r\n\t\t\t\tredirect('store', 'refresh');\r\n\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\techo \"No Product Found.\";\r\n\t\t\t\tdie();\r\n\t\t\t}\r\n\t\t}",
"public function createCartItem();",
"public function addOneToCart() {\n $idProduct = Tools::getValue('id_product');\n $idProductAttribute = Tools::getValue('id_product_attribute');\n $qty = Tools::getValue('qty');\n \n $this->updateProductInCart($idProduct, $idProductAttribute, $qty);\n\n $this->indexFullListProduct();\n }",
"public function addProductToCartByUser(){\n\t\t\t $product_code=$_POST['product-code'];\n $shopId=\"666666\";\n $updateIf=\"yes\";\n $stockAct=$_POST['product-stock']-$_POST['quantity'];\n\t\t\t $this->productActController->updateStock($stockAct,$product_code);\n\t\t\t\t$new_product=array('user_id'=>$_SESSION[\"name\"],'product_id'=>$product_code,'shop_id'=>$shopId,'cant'=>$_POST['quantity'],'um'=>$_POST['product-um']);\n \t\t\t$this->cart->insert($new_product);\n\n\t\t\t\t//find the new register\n\t\t\t\t$addedCart=$this->cart->getNameById($product_code,$table_work);\n\t\t\t\t//ShoppingCart::setTable('product_cart');\n\t\t\t\t$mensaggeAddedCart=\"Was an error inserting data\";\n\t\t\t\tRedirect::to(\"/products\")->with([\n\t\t\t\t\t'message'=>$addedCart[0][\"name\"],\n\t\t\t\t])->do();\n\t\t}",
"function addToCart()\n{\n\t$cf = new Fwcore();\n\t\n\t$data = array();\n\t$data['auth_token'] = isset($_POST['auth_token']) ? $_POST['auth_token'] : '';\n\t$data['app_id'] = isset($_POST['app_id']) ? $_POST['app_id'] : '';\n\t$data['cart_data'] = isset($_POST['cart_data']) ? $_POST['cart_data'] : '';\n\t$data['email'] = isset($_POST['email']) ? $_POST['email'] : '';\n\t$data['device_id'] = isset($_POST['device_id']) ? $_POST['device_id'] : '';\n\t$cf->addToCart($data);\n}",
"public function add() {\n\t\tif (!$this->request->is('get')) {\n\t\t\tif ($this->Cart->add($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__d('cart', 'New cart created'));\n\t\t\t\t$this->redirect(array('action' => 'view', $this->Cart->data['Cart']['id']));\n\t\t\t}\n\t\t}\n\t}",
"public function addCartId($cart_id);",
"public function add_cart($data)\n {\n $id = 0;\n $quantity = 1;\n\n if(isset($data[2]))\n $id = $data[2];\n\n if(isset($data[3]))\n $quantity = $data[3];\n\n // search if cart does not have this item already\n // if it has update it\n // else add it\n if($this -> search_cart($id) === false)\n {\n $prod['id'] = $id;\n $prod['quantity'] = $quantity;\n $_SESSION['cart'][] = $prod;\n\n $msg = \"Product is added to the cart\";\n echo json_encode($msg);\n }else echo json_encode(\"Already added\");\n\n }",
"function addProduct(Product $product){\n \t$this->myCart ->add($product);\n }",
"public function addItemsToCartNewAction()\n {\n $decoded = $this->get('webservice.helper')->processRequest($this->getRequest());\n\n $user = array_key_exists('auth_token', $decoded) ? $this->get('webservice.helper')->findUserByAuthToken($decoded['auth_token']) : null;\n if ($user) {\n $items = isset($decoded[\"items\"]) ? $decoded[\"items\"] : \"0\";\n if ($items != 0) {\n //$this->container->get('cart.helper.cart')->removeUserCart($user);\n foreach ($items as $detail) {\n /*Remove From Wish list*/\n $this->container->get('cart.helper.wishlist')->removeWishlistByItem($user, $detail[\"item_id\"]);\n $this->container->get('cart.helper.cart')->fillCartforService($detail[\"item_id\"], $user, $detail[\"quantity\"]);\n }\n $resp = 'Items has been added to Cart Successfully';\n $res = $this->get('webservice.helper')->response_array(true, $resp);\n } else {\n $res = $this->get('webservice.helper')->response_array(false, 'Array Item not found');\n }\n } else {\n $res = $this->get('webservice.helper')->response_array(false, 'User not authenticated.');\n }\n return new Response($res);\n\n }",
"public function addToCart()\n { \n // is the request ajax?\n if( $this->request->is('ajax') ) {\n // get parameters (product id and wanted amount)\n $id = $this->request->data('id');\n $amount = $this->request->data('amount');\n $msg = \"cant add\";\n // get the product\n $product = TableRegistry::get('product')->find()->where(['id'=>$id])->first();\n // get the cart\n $cart = $this->getRequest()->getSession()->read('cart');\n // if trying to add 0 or negative amount of items to cart, remove the item compleately from the cart\n if($amount<1){\n $cart[\"$id\"] = null;\n unset($cart[\"$id\"]);\n } else {\n // try to add the item to the cart if there is enough of the product available\n if(isset($cart[\"$id\"])){\n if($product->amount>=($cart[\"$id\"]+$amount)){\n $cart[\"$id\"] += $amount;\n $msg = \"Added to cart\";\n }\n } else {\n if($product->amount>=$amount){\n $cart[\"$id\"] = $amount;\n $msg = \"Added to cart\";\n } \n }\n }\n // update the cart\n $this->getRequest()->getSession()->write('cart',$cart);\n echo json_encode([\"msg\"=>$msg,\"amount\"=>$product->amount-$cart[\"$id\"]]);\n return;\n }\n }",
"public function addAction()\n {\n $cart = $this->_getCart();\n $params = $this->getRequest()->getParams();\n try {\n if (isset($params['qty'])) {\n $filter = new Zend_Filter_LocalizedToNormalized(\n array('locale' => Mage::app()->getLocale()->getLocaleCode())\n );\n $params['qty'] = $filter->filter($params['qty']);\n }\n\n $product = $this->_initProduct();\n $related = $this->getRequest()->getParam('related_product');\n\n /**\n * Check product availability\n */\n if (!$product) {\n $this->_goBack();\n return;\n }\n\n $cart->addProduct($product, $params);\n if (!empty($related)) {\n $cart->addProductsByIds(explode(',', $related));\n }\n\n $cart->save();\n\n $this->_getSession()->setCartWasUpdated(true);\n\n /**\n * @todo remove wishlist observer processAddToCart\n */\n Mage::dispatchEvent('checkout_cart_add_product_complete',\n array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())\n );\n\n if (!$this->_getSession()->getNoCartRedirect(true)) {\n if (!$cart->getQuote()->getHasError()){\n $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->htmlEscape($product->getName()));\n $this->_getSession()->addSuccess($message);\n }\n $this->_goBack();\n }\n } catch (Mage_Core_Exception $e) {\n if ($this->_getSession()->getUseNotice(true)) {\n $this->_getSession()->addNotice($e->getMessage());\n } else {\n $messages = array_unique(explode(\"\\n\", $e->getMessage()));\n foreach ($messages as $message) {\n $this->_getSession()->addError($message);\n }\n }\n\n $url = $this->_getSession()->getRedirectUrl(true);\n if ($url) {\n //tobihille: CHANGE:\n // if IE and error > redirect to cart to show messages\n // user can go back in browser after reading message\n // if we don't do this, user does not get message \"quantity not sufficent\"\n $option_enabled = Mage::getStoreConfig('system/aoe_static/redirect_ie_cart_on_error');\n if ( stripos(Mage::app()->getRequest()->getServer('HTTP_USER_AGENT'), 'Trident') !== false &&\n !empty($option_enabled)\n )\n {\n $this->getResponse()->setRedirect( Mage::helper('checkout/cart')->getCartUrl() );\n }\n else\n {\n $this->getResponse()->setRedirect($url);\n }\n //tobihille: ENDCHANGE\n } else {\n $this->_redirectReferer(Mage::helper('checkout/cart')->getCartUrl());\n }\n } catch (Exception $e) {\n $this->_getSession()->addException($e, $this->__('Cannot add the item to shopping cart.'));\n Mage::logException($e);\n $this->_goBack();\n }\n }",
"public function addItem(Cart $cart, CartItem $item);",
"public function addItem($id,$phone)\n{\n\n//$price = (int)str_replace(\"$\",\"\",$phone->price);//converts the price value back to string.\n //$quantity= $phone->id;\n\t$price = $phone->price; \n\t$name = $phone->name;\n\t$image = $phone->image;\n //$num = $phone->id;\n\n//First check if the phone is in the previous cart or not\n if(array_key_exists($id,$this->items))\n {\n //$productToAdd = $this->items[$id];\n $productToAdd = $items[$id]; //added\n $productToAdd['num']++;\n }\n else //if it is the first time the user is adding the item to the cart\n {\n $productToAdd = ['num' => 1, 'price'=>$price, 'name'=>$name,'image'=>$image]; \n }\n $this->items[$id] = $productToAdd;\n $this->totalQuantity++;\n $this->totalPrice = $this->totalPrice + $price;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get reverse path to current path part. | public function getReversePath()
{
return $this->pageContext->getReversePath();
} | [
"public function\t\t\tgetReversePath()\n\t{\n\t\treturn is_null($this->remainPath) ? \"\" : \\net\\dryuf\\core\\StringUtil::replaceRegExp(\\net\\dryuf\\core\\StringUtil::replaceRegExp($this->remainPath, \"[^/]+/\", \"../\"), \"[^/]+\\$\", \"\");\n\t}",
"public function getRelativePath()\n\t{\n\t\t$baseName = $this->initialPath->getName();\n\t\t$parts = explode($baseName, $this->currentPath->getName());\n\t\t$relPath = str_replace(Enviroment::getDirectorySeparator(), '/', $parts[1]);\n\n\t\tif(!preg_match('#^/#', $relPath))\n\t\t\t$relPath = '/' . $relPath;\n\n\t\treturn $relPath;\n\t}",
"public function current_path()\n\t{\n\t\t$url = parse_url($this->connection()->get('url'));\n\n\t\treturn $url['path'].(isset($url['query']) ? '?'.$url['query'] : '');\n\t}",
"public function getReverse()\n\t{\n\t\treturn (new Path())\n\t\t\t->setSegments(array_reverse($this->segments))\n\t\t\t->setSeparator($this->separator);\n\t}",
"public function getCurrentPath()\n {\n $result = '';\n \n $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? \"https://\" : \"http://\";\n $currentUrl = $protocol . $_SERVER['SERVER_NAME'];\n if ($_SERVER['SERVER_PORT'] !== '') {\n $currentUrl .= ':' . $_SERVER['SERVER_PORT'];\n }\n $currentUrl .= $_SERVER['REQUEST_URI'];\n \n // Remove the extra parameters\n $position = strrpos($currentUrl, '?');\n \n if ($position !== false) {\n $currentUrl = substr($currentUrl, 0, $position);\n }\n \n // Remove the file name\n $position = strrpos($currentUrl, '/', -0); \n \n if ($position !== false) {\n $currentUrl = substr($currentUrl, 0, $position + 1);\n }\n \n return $currentUrl;\n }",
"public function getFullPath()\n {\n $parentPath = $this->context->getFullPath();\n\n $fullPath = $this->getPath();\n\n if ($parentPath) {\n if (empty($fullPath)) {\n $fullPath = $parentPath;\n } else {\n $fullPath = $parentPath.'/'.$fullPath;\n }\n }\n\n return $fullPath;\n }",
"private function current_uri() {\r\n return implode('/', $this->uri->rsegments);\r\n }",
"public function getLastPathSegment(){\n $path = $this->path;\n if(strrpos($path, '/') === false){\n return $path;\n }\n return substr($path, strrpos($path, '/') + 1, strlen($path));\n }",
"public function getCurrentFullPath() {}",
"protected function getCurrentUrlPath()\n {\n return explode(\"?\", \\XLite\\Core\\URLManager::getCurrentURL())[0];\n }",
"public function getCurrentRelativePath()\n {\n }",
"public function getFullPath()\n\t{\n\t\treturn Generic::getCompletePath($this->getPath(), $this->getBasename());\n\t}",
"public function getFullPath()\n {\n $path = $this->isRelativePath() ? '/' : '';\n $path .= $this->getPath();\n $path .= empty($this->components['query']) ? '' : '?'.$this->components['query'];\n $path .= empty($this->components['fragment']) ? '' : '#'.$this->components['fragment'];\n\n return $path;\n }",
"public function getInternalPath()\n {\n return empty($this->currentFolder) ? '' : $this->currentFolder.'/';\n }",
"public function fullyQualifiedPathPreservingTrailingSlash()\n {\n $fqp = $this->fullyQualifiedPath();\n\n if ((substr($this->path, strlen($this->path) - 1) == '/') && (substr($fqp, strlen($fqp) - 1) != '/')) {\n $fqp .= '/';\n }\n return $fqp;\n }",
"function get_path_relativo()\n\t{\n\t\tif (! isset($this->_path_absoluto))\n\t\t\treturn $this->_dir_actual;\n\t\t$pos = strlen($this->_path_absoluto);\n\t\t$relativo = substr($this->_dir_actual, $pos);\n\t\treturn $relativo;\n\t}",
"public static function trailBackUrl(){\n\n $count = count(self::$segments);\n\n if($count) {\n\n // If there is a trailing slash, will increase the count by 1, so the path_back can be ok\n if(preg_match('/\\/$/',self::$uri_string)) $count++;\n\n // Add another slash, but will be removed\n $path=str_repeat(\"../\",$count+1);\n\n // Remove the last slash\n $path=substr($path,0,-1);\n\n return $path;\n }\n\n }",
"public function getFinalPath();",
"function getFullPath() {\n $path = '';\n if ($p = $this->getParent())\n $path .= $p->getFullPath();\n else\n $path .= '/';\n $path .= $this->getId() . '/';\n return $path;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
List all and search movies (/movies/index) | function index()
{
$search = isset($_POST["searchterm"]) ? $_POST["searchterm"] : '';
$this->set('active','list');
$this->set('search',$search);
if($search)
{
$this->set('title','Results for '.$search . ' - Netflix Movies');
$this->set('data',$this->Movie->search($search));
}
else
{
$this->set('title','All Results - Netflix Movies');
$this->set('data',$this->Movie->selectAll());
}
} | [
"public function searchMovies() {\n $query = Input::get('title');\n\n if (!$query) {\n return Redirect::back();\n }\n\n $results = [];\n $response = Tmdb::getSearchApi()->searchMovies($query);\n $num_of_pages = $response['total_pages'];\n\n if ($num_of_pages > 1) {\n for($i = 1; $i <= $num_of_pages; $i++){\n $response = Tmdb::getSearchApi()->searchMovies($query, array('page' => $i));\n $movies = $response['results'];\n foreach($movies as $movie){\n array_push($results, $movie);\n }\n }\n }\n else {\n $movies = $response['results'];\n foreach($movies as $movie){\n array_push($results, $movie);\n }\n }\n return Redirect::back()->with('search_result', $results);\n }",
"public function actionIndex()\n {\n $searchModel = new MovieSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function listMovies(){\n $this->printMovieWelcomeScreen('Movie List');\n $this->getMovieList();\n\n $this->waitForReturnToMenu();\n }",
"public function showMoviesAction() : object\n {\n $db = $this->app->db;\n $page = $this->app->page;\n\n $title = \"Show movies\";\n\n if (isset($_SESSION[\"resSearchTitle\"])) {\n $resultset = $this->getSession(\"resSearchTitle\");\n $searchTitle = $this->getSession(\"searchTitle\");\n } elseif (isset($_SESSION[\"resSearchYear\"])) {\n $year1 = $this->getSession(\"year1\");\n $year2 = $this->getSession(\"year2\");\n $resultset = $this->getSession(\"resSearchYear\");\n } else {\n $sql = \"SELECT * FROM movie;\";\n $resultset = $db->executeFetchAll($sql);\n }\n\n $page->add(\"movie/sidebar\");\n $page->add(\"movie/article-header\");\n $page->add(\"movie/search-title\", [\n \"searchTitle\" => $searchTitle ?? null,\n ]);\n $page->add(\"movie/search-year\", [\n \"year1\" => $year1 ?? null,\n \"year2\" => $year2 ?? null,\n ]);\n $page->add(\"movie/show-movies\", [\n \"resultset\" => $resultset,\n ]);\n $page->add(\"movie/article-footer\");\n\n return $page->render([\n \"title\" => $title,\n ]);\n }",
"public function indexAction()\n {\n\n $em = $this->getDoctrine()->getManager();\n\n $movies = $em->getRepository('AppBundle:Movies')->findAll();\n\n return $this->render('movies/index.html.twig', array(\n 'movies' => $movies,\n ));\n }",
"public static function allMovies()\n {\n return route('movies');\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $movies = $em->getRepository('AppBundle:Movie')->findAll();\n\n return $this->render('admin/movie/index.html.twig', array(\n 'movies' => $movies,\n ));\n }",
"public function searchMovies()\n {\n }",
"public function getAllMovies()\n {\n }",
"public function movieSearch(Request $request) {\n $search = $request->input('search');\n\n $requestURL = \"http://www.myapifilms.com/imdb?title=\".urlencode($search).\"&limit=5&token=fc9e6951-2b3b-4785-9553-bfb78754c740\";\n\n $movies = json_decode(file_get_contents($requestURL), true);\n\n $movies = $this->changeToValidPosterUrl($movies);\n\n return $movies;\n }",
"public function actionIndex()\n {\n $searchModel = new FilmSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function listMovies()\n {\n $pdo = $this->getPdo();\n $query = 'SELECT * FROM movies';\n\n $statement = $pdo->prepare($query);\n $statement->execute();\n return $statement->fetchAll();\n }",
"public function actionIndex()\n {\n $searchModel = new FilmSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function discoverMovies()\n {\n return $this->get('discover/movie');\n }",
"public function testListMovies()\r\n {\r\n $response = $this->get('/movies');\r\n\r\n $response->assertStatus(200)\r\n ->assertSee(e($this->movie->title))\r\n ->assertSee(e($this->movie->genre))\r\n ->assertSee(e($this->movie->actors))\r\n ->assertSee($this->movie->path());\r\n }",
"public function allMovie() {\n $movies = Movie::with('genre','cast')->get();\n return view('admin.movie.allmovies', [\n 'movies' => $movies\n ]);\n }",
"public function actionIndex()\n {\n $searchModel = new RaFilmDocumentSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function displayMovies() {\n $movies = Movie::get()->sortBy('name');\n return view('movies', [ 'movies' => $movies ]);\n }",
"public function getMoviesByFullTextSearch(){\n\t\ttry {\n\t\t\t//sanitize the form data\n\t\t\t$args = array(\n\t\t\t\t'movieSearch'\t\t\t=> FILTER_SANITIZE_STRING,\n\t\t\t\t'movieTitleFilter'\t\t=> FILTER_SANITIZE_STRING,\n\t\t\t\t'movieSagaFilter'\t\t=> FILTER_SANITIZE_STRING,\n\t\t\t\t'movieArtistFilter'\t\t=> FILTER_SANITIZE_STRING,\n\t\t\t\t'movieLoanFilter'\t\t=> FILTER_SANITIZE_STRING,\n\t\t\t\t'movieStorageFilter'\t=> FILTER_SANITIZE_NUMBER_INT,\n\t\t\t\t'movieSortType'\t\t\t=> FILTER_SANITIZE_NUMBER_INT,\n\t\t\t);\n\t\t\t$filters = filter_var_array($_POST, $args);\n\n\t\t\t$filters['movieStorageFilter'] = filter_var($filters['movieStorageFilter'], FILTER_VALIDATE_INT, array('min_range' => 1));\n\t\t\t$filters['movieSortType'] = filter_var($filters['movieSortType'], FILTER_VALIDATE_INT, array('min_range' => 0, 'max-range' => 4));\n\t\t\tif( $filters['movieSortType'] === false ) $filters['movieSortType'] = 0;\n\n\t\t\t//construct the query\n\t\t\t$sql = \" SELECT *\";\n\n\t\t\t$sqlSelect = array();\n\t\t\t$sqlWhere = array();\n\t\t\t$sqlOrder = 'score DESC, ';\n\t\t\t$params = array();\n\t\t\tif( !empty($filters['movieSearch']) ){\n\t\t\t\t$sqlSelect = array(\n\t\t\t\t\t\"MATCH(movieTitle) AGAINST (:searchS)\",\n\t\t\t\t\t\"MATCH(sagaTitle) AGAINST (:searchS)\",\n\t\t\t\t\t\"MATCH(artistFullName) AGAINST (:searchS)\",\n\t\t\t\t\t\"MATCH(loanHolder) AGAINST (:searchS)\",\n\t\t\t\t);\n\t\t\t\t$sqlWhere = array(\n\t\t\t\t\t\"MATCH(movieTitle) AGAINST (:searchW)\",\n\t\t\t\t\t\"MATCH(sagaTitle) AGAINST (:searchW)\",\n\t\t\t\t\t\"MATCH(artistFullName) AGAINST (:searchW)\",\n\t\t\t\t\t\"MATCH(loanHolder) AGAINST (:searchW)\",\n\t\t\t\t);\n\t\t\t\t$params[':searchS'] = $this->prepareForFullTextQuery($filters['movieSearch']);\n\t\t\t\t$params[':searchW'] = $params[':searchS'];\n\t\t\t}\n\t\t\tif( !empty($filters['movieTitleFilter']) ){\n\t\t\t\t$sqlSelect[] = \"MATCH(movieTitle) AGAINST (:movieTitleS)\";\n\t\t\t\t$sqlWhere[] = \"MATCH(movieTitle) AGAINST (:movieTitleW)\";\n\t\t\t\t$params[':movieTitleS'] = $this->prepareForFullTextQuery($filters['movieTitleFilter']);\n\t\t\t\t$params[':movieTitleW'] = $params[':movieTitleS'];\n\t\t\t}\n\t\t\tif( !empty($filters['movieSagaFilter']) ){\n\t\t\t\t$sqlSelect[] = \"MATCH(sagaTitle) AGAINST (:sagaTitleS)\";\n\t\t\t\t$sqlWhere[] = \"MATCH(sagaTitle) AGAINST (:sagaTitleW)\";\n\t\t\t\t$params[':sagaTitleS'] = $this->prepareForFullTextQuery($filters['movieSagaFilter']);\n\t\t\t\t$params[':sagaTitleW'] = $params[':sagaTitleS'];\n\t\t\t}\n\t\t\tif( !empty($filters['movieArtistFilter']) ){\n\t\t\t\t$sqlSelect[] = \"MATCH(artistFullName) AGAINST (:artistS)\";\n\t\t\t\t$sqlWhere[] = \"MATCH(artistFullName) AGAINST (:artistW)\";\n\t\t\t\t$params[':artistS'] = $this->prepareForFullTextQuery($filters['movieArtistFilter']);\n\t\t\t\t$params[':artistW'] = $params[':artistS'];\n\t\t\t}\n\t\t\tif( !empty($filters['movieLoanFilter']) ){\n\t\t\t\t$sqlSelect[] = \"MATCH(loanHolder) AGAINST (:loanS)\";\n\t\t\t\t$sqlWhere[] = \"MATCH(loanHolder) AGAINST (:loanW)\";\n\t\t\t\t$params[':loanS'] = $this->prepareForFullTextQuery($filters['movieLoanFilter']);\n\t\t\t\t$params[':loanW'] = $params[':loanS'];\n\t\t\t}\n\t\t\tif( !empty($filters['movieStorageFilter']) ){\n\t\t\t\t$sqlWhere[] = \"storageID = :storageID\";\n\t\t\t\t$params[':storageID'] = $filters['storageID'];\n\t\t\t}\n\n\t\t\t$sql = \" SELECT mft.*, ma.*\"\n\t\t\t\t .( !empty($sqlSelect) ? ', '.implode(' + ', $sqlSelect).' AS score' : '')\n\t\t\t\t .\" FROM movies_view_ft mft\"\n\t\t\t\t .\" INNER JOIN movie_artists_view_ft maft ON movieID = maft.movieFK \"\n\t\t\t\t .\" LEFT JOIN movie_artists_view ma ON movieID = ma.movieFK \"\n\t\t\t\t .\" WHERE 1 \"\n\t\t\t\t .( !empty($sqlWhere) ? ' AND '.implode(' AND ', $sqlWhere) : '')\n\t\t\t\t .\" ORDER BY \"\n\t\t\t\t .( !empty($sqlSelect) ? $sqlOrder : '')\n\t\t\t\t .$this->_sortTypes[$filters['movieSortType']];\n\n\t\t\t//stash cache init\n\t\t\t$stashFileSystem = new StashFileSystem(array('path' => STASH_PATH));\n\t\t\tStashBox::setHandler($stashFileSystem);\n\n\t\t\tStashManager::setHandler(get_class( $this ), $stashFileSystem);\n\t\t\tif( empty($params) ) $stash = StashBox::getCache(get_class( $this ), __FUNCTION__, $sql);\n\t\t\telse $stash = StashBox::getCache(get_class( $this ), __FUNCTION__, $sql, serialize($params));\n\t\t\t$results = $stash->get();\n\t\t\tif( $stash->isMiss() ){ //cache not found, retrieve values from database and stash them\n\n\t\t\t\t//drop the temporary table if it exists\n\t\t\t\t$destroyTmpTable = $this->db->prepare(\"DROP TEMPORARY TABLE IF EXISTS movies_view_ft\");\n\t\t\t\t$destroyTmpTable->execute();\n\t\t\t\t$destroyTmpTable = $this->db->prepare(\"DROP TEMPORARY TABLE IF EXISTS movie_artists_view_ft\");\n\t\t\t\t$destroyTmpTable->execute();\n\n\t\t\t\t//create the temporary table\n\t\t\t\t$tmpTable = $this->db->prepare(\"\n\t\t\t\t\tCREATE TEMPORARY TABLE movies_view_ft AS\n\t\t\t\t\tSELECT movieID, movieTitle, movieGenre, movieMediaType, movieLength, movieDate,\n\t\t\t\t\t\t\tsagaID, sagaTitle, movieSagaPosition, movieSagaSize, sagaSearchURL,\n\t\t\t\t\t\t\tstorageID, storageRoom, storageType, storageColumn, storageLine,\n\t\t\t\t\t\t\tloanID, loanHolder, loanDate\n\t\t\t\t\tFROM movies_view\n\t\t\t\t\");\n\t\t\t\t$tmpTable->execute();\n\n\t\t\t\t//add the fulltext index\n\t\t\t\t$indexTmpTable = $this->db->prepare(\"\n\t\t\t\t\tALTER TABLE movies_view_ft ENGINE = MyISAM,\n\t\t\t\t\tADD FULLTEXT INDEX movieFT (movieTitle),\n\t\t\t\t\tADD FULLTEXT INDEX sagaFT (sagaTitle),\n\t\t\t\t\tADD FULLTEXT INDEX loanFT (loanHolder),\n\t\t\t\t\tADD INDEX storageID (storageID),\n\t\t\t\t\tADD INDEX movieID (movieID)\n\t\t\t\t\");\n\t\t\t\t$indexTmpTable->execute();\n\n\t\t\t\t//create the temporary table\n\t\t\t\t$tmpTable = $this->db->prepare(\"\n\t\t\t\t\tCREATE TEMPORARY TABLE movie_artists_view_ft AS\n\t\t\t\t\tSELECT movieFK, artistID, CONCAT(artistFirstName, ' ', artistLastName) AS artistFullName\n\t\t\t\t\tFROM movie_artists_view\n\t\t\t\t\");\n\t\t\t\t$tmpTable->execute();\n\n\t\t\t\t//add the fulltext index\n\t\t\t\t$indexTmpTable = $this->db->prepare(\"\n\t\t\t\t\tALTER TABLE movie_artists_view_ft ENGINE = MyISAM,\n\t\t\t\t\tADD FULLTEXT INDEX artistFT (artistFullName),\n\t\t\t\t\tADD INDEX movieFK (movieFK)\n\t\t\t\t\");\n\t\t\t\t$indexTmpTable->execute();\n\n\n\t\t\t\t$getMovies = $this->db->prepare($sql);\n\n\t\t\t\t$getMovies->execute( $params );\n\n\t\t\t\t$results = $this->_merge($getMovies->fetchAll());\n\n\t\t\t\tif( !empty($results) ) $stash->store($results, STASH_EXPIRE);\n\t\t\t}\n\n\t\t\treturn $results;\n\n\t\t} catch ( PDOException $e ){\n\t\t\terreur_pdo( $e, get_class( $this ), __FUNCTION__ );\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
END function test_formEmail provide_formEmail() Provides data to use for testing the formEmail method of the Rx_View_Helper_FormEmail class | public function provide_formEmail ( )
{
return array(
'simple test' => array(
'expected' => '<input type="email" name="test_name" id="test_name" value="test-value" class=" input email" />',
'name' => 'test_name',
'value' => 'test-value',
),
'disabled attribute test' => array(
'expected' => '<input type="email" name="test_name" id="test_name" value="test-value" disabled="disabled" class=" input email" />',
'name' => 'test_name',
'value' => 'test-value',
array(
'disable' => true,
)
),
);
} | [
"public function validEmailValidDataProvider() {}",
"function testEmailFieldPopulation() {\n\n\t\t$this->get('EmailFieldTest_Controller');\n\t\t$this->submitForm('Form_Form', null, array(\n\t\t\t'Email' => 'test@test.com'\n\t\t));\n\n\t\t$this->assertPartialMatchBySelector('p.good',array(\n\t\t\t'Test save was successful'\n\t\t));\n\t}",
"public function test_default_html_for_email() {\n\t\t$form_id = $this->get_form_id_for_test();\n\n\t\t$atts = array(\n\t\t\t'form_id' => $form_id,\n\t\t\t'default_email' => true,\n\t\t\t'plain_text' => false,\n\t\t);\n\n\t\t$content = $this->get_formatted_content( $atts );\n\t\t$expected_content = $this->get_expected_default_html( $atts );\n\n\t\t$this->assertSame( $expected_content, $content );\n\t}",
"public function getChangeEmailForm();",
"function showEmailForm()\r\n {\r\n $data = array();\r\n $data['cmdd'] = 'send';\r\n $data['email'] = getUserField('email');\r\n //dumpvar($_REQUEST);\r\n\r\n return createPage(EMAIL_FORM_TEMPLATE, $data);\r\n }",
"public function providerTestGetUserMail()\n {\n return [\n \"Invalid selector\" => array(\"123\", false),\n \"Valid selector\" => array(\"abc\", \"test@test.test\")\n ];\n }",
"function shib_auth_custom_email() {\n $form = array();\n\n $form['custom_mail'] = array(\n '#type' => 'textfield',\n '#title' => t('E-mail'),\n '#size' => 60,\n );\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Send'),\n );\n\n return $form;\n}",
"public function testEmailAction() {\n\t\t$content = array();\n\t\t$title = 'Test e-mail configuration';\n\t\t\n\t\t$content[] = Bootstrap::row()->add(12, Bootstrap::h(1, $title));\n\t\t\n\t\t$panel = Bootstrap::panel('Send test mail')->color('blue');\n\t\t$form = BootstrapUI::form()\n\t\t\t->horizontal()\n\t\t\t->add(Bootstrap::textfield('to', null, 'to e-mail')->placeholder('your@email.com'))\n\t\t\t->addSubmit('Submit')\n\t\t\t->addButton(Bootstrap::anchor('Cancel', Url::href('system', 'alerts'))->asButton()->color('red'));\n\t\t$panel->content($form);\n\t\t$content[] = Bootstrap::row()->add(8, $panel, 2);\n\t\t\n\t\treturn View::create('base')\n\t\t\t->with('title', $title)\n\t\t\t->with('content', $content);\n\t}",
"public function test_smtp_settings()\n {\n $this->load->model('violator_m');\n $this->load->helper(array('form', 'url'));\n $this->load->library('form_validation');\n \n $this->form_validation->set_rules('email', 'Email Address', 'xss_clean');\n \n //$email_settings = $this->violator_m->get_violator_notification_email_setting_by_store($store_id);\n \n if ($this->form_validation->run() === FALSE)\n {\n // validation failed, or first load\n }\n else\n {\n \n } \n }",
"public function testEmailFieldValidators() {\n $asserts = [\n Assert\\Length::class => \"lorem-ipsum-dolor-sit-amet.consectetur-adipiscing-elit.nullam-at-nibh-ut-sem-lobortis-ullamcorper@lorem.com\",\n Assert\\Email::class => \"nairus@\"\n ];\n\n $contactMessage = new ContactMessage();\n $contactMessage->setIp(\"127.0.0.99\")\n ->setMessage(\"Lorem ipsum dolor sit amet, consectetur cras amet.\")\n ->setName(\"Son Goku\")\n ->setRequestDate(new \\DateTime());\n $this->launchAssertions($asserts, $contactMessage, \"setEmail\");\n }",
"public function prepareDataforEmail($data = array())\n { \n $params = Factory::getApplication()->getUserState('com_tkdclub.participant.itemparams', '');\n $store_data = $data['store_data'] === 1 ? $store_data = Text::_('JYES') : $store_data = Text::_('JNO');\n $field_text = '';\n\n $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_FIRSTNAME') . ': ' . $data['firstname'] . \"\\r\\n\";\n $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_LASTNAME') . ': ' . $data['lastname'] . \"\\r\\n\";\n $data['email'] ? $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_EMAIL') . ': ' . $data['email'] . \"\\r\\n\" : null;\n $data['clubname'] ? $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_CLUB') . ': ' . $data['clubname'] . \"\\r\\n\" : null;\n $data['grade'] ? $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_GRADE_EMAIL') . ': ' . $data['grade'] . \"\\r\\n\" : null;\n $data['age'] ? $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_AGE') . ': ' . $data['age'] . \"\\r\\n\" : null;\n $data['registered'] ? $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_SUM') . ': ' . $data['registered'] . \"\\r\\n\" : null;\n $data['user1'] ? $field_text .= $params->user1 . ': ' . $data['user1'] . \"\\r\\n\" : null;\n $data['user2'] ? $field_text .= $params->user2 . ': ' . $data['user2'] . \"\\r\\n\" : null;\n $data['user3'] ? $field_text .= $params->user3 . ': ' . $data['user3'] . \"\\r\\n\" : null;\n $data['user4'] ? $field_text .= $params->user4 . ': ' . $data['user4'] . \"\\r\\n\" : null;\n $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_PRIVACY_ACCEPTED_EMAIL') . ': ' . Text::_('JYES') . \"\\r\\n\";\n $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_STOREDATA_ACCEPTED_EMAIL') . ': ' . $store_data . \"\\r\\n\";\n $data['notes'] ? $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_NOTES') . ': ' . $data['notes'] . \"\\r\\n\" : null;\n $field_text .= \"\\r\\n\";\n\n return $field_text;\n }",
"public function testEmailConfirmPost()\n {\n }",
"public function validEmailInvalidDataProvider() {}",
"function bibdk_modal_heimdal_write_email_form() {\n $form_state = _bibdk_modal_set_form_state();\n\n $output = bibdk_modal_form_wrapper('bibdk_heimdal_verify_email_form', $form_state);\n\n $commands = array();\n if (empty($form_state['executed']) && empty($form_state['submitted'])) {\n $commands = $output;\n }\n elseif (empty($form_state['executed']) && !empty($form_state['submitted'])) {\n $commands[] = bibdk_modal_command_replace_form($output);\n }\n elseif (!empty($form_state['executed']) && !empty($form_state['submitted'])) {\n $commands[] = bibdk_modal_command_reload();\n $commands[] = bibdk_modal_command_dismiss();\n }\n\n bibdk_modal_deliver_output($commands);\n}",
"function email_data(){\n $config = array(\n 'protocol' => 'smtp',\n 'smtp_host' => 'ssl://smtp.gmail.com',\n 'smtp_port' => '465',\n //for example: 'smtp_user' => 'example@gmail.com ', \n 'smtp_user' => 'dissectionmailer@gmail.com ', \n //for example: 'smtp_pass' => 'your password ',\n 'smtp_pass' => '6945635415*',\n 'charset' => 'utf-8',\n 'newline' => \"\\r\\n\",\n 'mailtype' => 'html',\n 'validation' => TRUE // bool whether to validate email or not \n );\n return $config;\n }",
"public function testRegistrationEmailWrongFormat(): void { }",
"public function testCreateUserCredentialsEmail()\n {\n }",
"private function EnviarEmail(){\n \n // setando conteudo do email para avisos\t\n\n \n }",
"function ninja_forms_register_field_email_validate(){\n\t$args = array(\n\t\t'name' => __( 'Validate E-mail', 'ninja-forms' ),\n\t\t'sidebar' => 'template_fields',\n\t\t'edit_function' => 'ninja_forms_email_validate_edit',\n\t\t'edit_options' => array(\n\t\t\tarray(\n\t\t\t\t'type' => 'hidden',\n\t\t\t\t'name' => 'email',\n\t\t\t\t'default' => 1,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'name' => 'send_email',\n\t\t\t\t'label' => __( 'Send a response email to this email address?', 'ninja-forms' ),\n\t\t\t),\n\t\t\t// array(\n\t\t\t// \t'type' => 'checkbox',\n\t\t\t// \t'name' => 'from_email',\n\t\t\t// \t'label' => __( 'Use this as the \"From\" email address for Administrative recipients of this form?', 'ninja-forms' ),\n\t\t\t// ),\n\t\t\tarray(\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'name' => 'replyto_email',\n\t\t\t\t'label' => __( 'Use this email address as the Reply-To address?', 'ninja-forms' ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'hidden',\n\t\t\t\t'name' => 'user_email',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'hidden',\n\t\t\t\t'name' => 'user_info_field_group',\n\t\t\t\t'default' => 1,\n\t\t\t),\n\t\t),\n\t\t'display_function' => 'ninja_forms_field_email_validate_display',\n\t\t'save_function' => '',\n\t\t'group' => 'standard_fields',\n\t\t'edit_label' => true,\n\t\t'edit_label_pos' => false,\n\t\t'edit_req' => true,\n\t\t'edit_custom_class' => true,\n\t\t'edit_help' => true,\n\t\t'edit_desc' => true,\n\t\t'edit_meta' => false,\n\t\t'edit_conditional' => true,\n\t\t'conditional' => array(\n\t\t\t'value' => array(\n\t\t\t\t'type' => 'text',\n\t\t\t),\n\t\t),\n\t\t'pre_process' => 'ninja_forms_field_email_validate_pre_process',\n\t);\n\n\tninja_forms_register_field( 'Email Validation', $args );\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the metricType property value. The user experience analytics metric type. | public function setMetricType(?string $value): void {
$this->getBackingStore()->set('metricType', $value);
} | [
"public function setMetricClass($type, $class)\n {\n $this->metricClasses[$type] = $class;\n }",
"public function setAnomalyType(?UserExperienceAnalyticsAnomalyType $value): void {\n $this->getBackingStore()->set('anomalyType', $value);\n }",
"public function getMetricsType()\n {\n return $this->metrics_type;\n }",
"public function set_report_type($type)\n {\n }",
"public function set_meta_type($meta_type)\r\n {\r\n $this->meta_type = $meta_type;\r\n }",
"function set_meta_type( $meta_type ) {\n\t\t$this->_meta_type = $meta_type;\n\t}",
"public function setType($type) {\n $this->type = $type;\n }",
"public function setUserType( $userType )\n {\n $this->_daUser->setUserType( $this->getId(), $userType );\n }",
"public function getMetricType()\n {\n if (array_key_exists(\"metricType\", $this->_propDict)) {\n return $this->_propDict[\"metricType\"];\n } else {\n return null;\n }\n }",
"public function set_performance_type( $performance_type ) {\n\t\t$this->performance_type = $performance_type;\n\t}",
"public function setUsageType(string $usage_type): void\n {\n $this->_usage_type = $usage_type;\n }",
"public function setAnalysisType($type);",
"function set_user_type($user_type)\r\n {\r\n $this->set_default_property(self :: PROPERTY_USER_TYPE, $user_type);\r\n }",
"public function setUsageCalculationType(string $usage_calculation_type): void\n {\n $this->_usage_calculation_type = $usage_calculation_type;\n }",
"public function setAnnotationType($type)\n {\n $this->currentAnnotation['type'] = $type;\n }",
"public function setActionType($actionType) {\n $this->actionType = $actionType;\n }",
"public function set_type( $type ) {\n\n\t\tif ( isset( $this->options['type'] ) && $this->options['type'] === $type )\n\t\t\treturn;\n\n\t\tparent::set_type( $type );\n\n\t\t$this->options['type'] = $type;\n\n\t\t$this->clear_filesize_cache();\n\n\t}",
"public function set_type($type)\n\t{\n\t\t$this->contrib_type = $type;\n\t\t$this->type = $this->types->get($this->contrib_type);\n\t}",
"function UpdateMetric($type)\n{\n $sql = \"UPDATE heroku_7e12094ae71a8cd.metrics SET metric_value = metric_value + 1 WHERE metric_type = '{$type}'\";\n QueryTable($sql);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets query for [[MstStatus]]. | public function getMstStatus()
{
return $this->hasOne(MstStatus::className(), ['id' => 'mst_status_id']);
} | [
"public function getStatus()\n {\n return $this->queryStatus;\n }",
"public function get_mms_status()\n {\n if ($this->_mms_status && is_array($this->_mms_status)) {\n return $this->_mms_status;\n } else {\n return FALSE;\n }\n }",
"public function getStatus()\n {\n return $this->driverCommand(BaseConstants::$GET, '/status');\n }",
"function GetStatus()\r\n\t{\r\n\t\treturn $this->m_status;\r\n\t}",
"public function getAllStatus()\n\t{\n\t\treturn $this->status;\n\t}",
"private function query_status() {\n\t\tif ($this->header === true) {\n\t\t\t$status = new eyewire_status($this->status . '-header', $this->issue);\n\t\t} else {\n\t\t\t$status = new eyewire_status($this->status, $this->issue);\n\t\t}\n\t\t\n\t\t$status->get_tasks($this->user);\n\n\t\t// Prepare result object\n\t\t$result = new stdClass();\n\t\t$result->status = $this->status;\n\t\t$result->statusText = $status->Text();\n\t\t$result->header = $this->header;\n\t\t$result->issue = $this->issue;\n\t\t$result->user = $this->user;\n\t\t$result->tasks = $status->Tasks();\n\t\t$result->count = $status->Total();\n\t\t\n\t\t// Save result to request output\n\t\t$this->request->OutputType('text/json');\n\t\t$this->request->OutputReplace(json_encode($result));\n\t\t\n\t}",
"function getDetailedStatus() ;",
"public function getMdmStatus()\n {\n if (array_key_exists(\"mdmStatus\", $this->_propDict)) {\n return $this->_propDict[\"mdmStatus\"];\n } else {\n return null;\n }\n }",
"public function getStatuses(){\n if($this->mastodon_user_id > 0){\n \n //Create our object\n $http = HttpRequest::Instance($this->getApiURL());\n $statusses = $http::Get(\n \"api/v1/accounts/{$this->mastodon_user_id}/statuses\",\n null,\n $this->getHeaders()\n );\n if(is_array($statusses) && count($statusses) > 0){\n return $statusses;\n }\n \n }\n return false;\n }",
"public function getLatestStatus();",
"public function getStatus() {\n $query = $this->db->get('tb_status');\n //Retorna em formato de array\n return $query->result();\n }",
"public static function getStatuses()\n {\n $sql = 'SELECT * FROM reservation_status';\n $command = Yii::app()->db->createCommand($sql);\n return $command->queryAll(true);\n }",
"function getStatus($item_id)\t{\n\t\t$query = new Query();\n\t\t$query->sql(\"SELECT status FROM \".UT_ITE.\" WHERE id = $item_id\");\n\t\treturn $query->getQueryResult(0, \"status\"); \n\t}",
"public function getType(): string\n {\n return CoreAdminQuery::ACTION_STATUS;\n }",
"public function getStatus() {\n $this->request = new stdClass();\n $this->request->msisdnList = $this->mobile;\n\n $this->__request('getPhoneStatus');\n\n $response = new stdClass();\n $response->status = $this->response->msisdnList->classIdList->status;\n return $response;\n }",
"public function getStatus();",
"public function getStatus()\r\n {\r\n return $this->fields['Status']['value'];\r\n }",
"public function getAllMaritalStatus()\n {\n \t$sql = \"SELECT * FROM ref_marital_status ORDER BY rms_desc\";\n \t\n \t$que = $this->db->query($sql);\n \treturn $que->result_array();\n \t\n }",
"private function getAllStatus()\n {\n return $status = tb_csc_acordo_status::all();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the native translation of greaterThan token. | public function greaterThan(TokenConditionGreaterThan $token, TokenBase $previous = null) {
return "`{$token->property}` > '{$token->value}'";
} | [
"public static function greater() { return self::$gt; }",
"function gt($value)\n{\n return new Expr\\Expression('%s > ?', [$value]);\n}",
"public function greaterThanOrEquals(TokenConditionGreaterThanOrEquals $token, TokenBase $previous = null) {\n\t\treturn \"\\t{$token->property} >= {$token->value}\";\n\t}",
"public function gt($value1, $value2)\r\n {\r\n $value1 = $this->getIdentifier($value1);\r\n $value2 = $this->getIdentifier($value2);\r\n return $value1 . ' > ' . $value2;\r\n }",
"public function gt ()\n {\n return ( $this->operand > $this->validation->value );\n }",
"function mGREATER(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$GREATER;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:688:3: ( '>' ) \n // Tokenizer11.g:689:3: '>' \n {\n $this->matchChar(62); \n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"public function greaterThan($comp) {\n return $this->compare($comp, \">\");\n }",
"public function greater($b);",
"protected function _gle( $value )\n\t{\n\t\tswitch ( $value )\n\t\t{\n\t\t\tcase 'g':\n\t\t\t\t$lang = 'gt';\n\t\t\t\tbreak;\n\t\t\tcase 'l':\n\t\t\t\t$lang = 'lt';\n\t\t\t\tbreak;\n\t\t\tcase 'e':\n\t\t\t\t$lang = 'exactly';\n\t\t\t\tbreak;\n\t\t}\n\t\treturn mb_strtolower( \\IPS\\Member::loggedIn()->language()->addToStack( $lang ) );\n\t}",
"public function visitBinaryIsGreater(Node $node);",
"function get_locale_translation_status( int $percent_translated ): string {\n\tif ( $percent_translated == 100 ) {\n\t\treturn 'translated-100';\n\t} elseif ( $percent_translated >= 95 ) {\n\t\treturn 'translated-95';\n\t} elseif ( $percent_translated >= 90 ) {\n\t\treturn 'translated-90';\n\t} elseif ( $percent_translated >= 50 ) {\n\t\treturn 'translated-50';\n\t} else {\n\t\treturn 'translated-50-less';\n\t}\n}",
"public function greaterThan($value) {\n return Restrictions::greaterThan($this->name, $value);\n }",
"public function getGreaterThanOrderID()\n {\n return $this->greaterThanOrderID;\n }",
"public function greater($b)\n {\n switch (true) {\n case $b instanceof Matrix:\n $c = $this->greaterMatrix($b);\n break;\n\n case $b instanceof ColumnVector:\n $c = $this->greaterColumnVector($b);\n break;\n\n case $b instanceof Vector:\n $c = $this->greaterVector($b);\n break;\n\n case is_int($b) or is_float($b):\n $c = $this->greaterScalar($b);\n break;\n\n default:\n throw new InvalidArgumentException('Cannot compare matrix'\n . ' to a ' . gettype($b) . '.');\n }\n\n return $c;\n }",
"public function greaterThan($value)\n {\n return $this->get() > $value;\n }",
"public static function greaterThan($version1, $version2)\n {\n return self::compare($version1, '>', $version2);\n }",
"private static function buildGreaterThan(Build $v1, Build $v2)\n {\n return $v1->getNumber() > $v2->getNumber();\n }",
"public function greaterThan($variable)\n {\n return new Operator\\GreaterThan($this, $this->asVariable($variable));\n }",
"private function getComparisonOp(?int $numValue = null): string\n {\n if ($numValue === 2) {\n return '>';\n } elseif ($numValue === 3) {\n return '<';\n } else {\n return '=';\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of segni_taglio | public function getSegni_taglio()
{
return $this->segni_taglio;
} | [
"public function get_tag();",
"public function setSegni_taglio($segni_taglio)\n {\n $this->segni_taglio = $segni_taglio;\n\n return $this;\n }",
"function tag()\n {\n return di()->get('tag');\n }",
"public function getTag()\n {\n return $this->get(self::tag);\n }",
"public function getTag ()\n {\n return $this->tag;\n }",
"public function getIdTagu()\n\t{\n\t\treturn $this->id_tagu;\n\t}",
"public function getTag()\n {\n return $this->tag;\n }",
"public function getTagValue()\n {\n return $this->tag_value;\n }",
"public function getIGetTag()\n {\n return $this->get(self::IGETTAG);\n }",
"function wl_tagline () {\n\techo $this->valores['tagline'];\n}",
"public function getIdTag()\n {\n return $this->id_tag;\n }",
"public function getTag()\n {\n }",
"public function getTagId()\r\n {\r\n return $this->tagId;\r\n }",
"public function getTagline(){\r\n\t\t\treturn $this->tagline;\r\n\t\t}",
"public function getTagId()\r\n\r\n\t{\r\n\r\n\t\treturn $this->tagId;\r\n\r\n \t}",
"public function getIdTag()\n {\n return $this->idTag;\n }",
"public function getSystemTag() {\n\t\treturn $this->tag;\n\t}",
"public function getTag()\n {\n return $this->name;\n }",
"public function getTagAsString() {\r\n\t\treturn Util::uLongToString($this->tag);\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Links tag to the note | public function linkTag($tag)
{
if (empty($tag))
return false;
$tagInstance = Tag::findByName($tag);
if (is_null($tagInstance))
$tagInstance = Tag::createNew($tag);
$connection = \Yii::$app->db;
$connection->createCommand()->insert('note_tag', array(
'note_id' => $this->id,
'tag_id' => $tagInstance->id
))->execute();
} | [
"function get_tag_link($tag)\n {\n }",
"function dbt_the_LinkTag($text=\"Bookmark on del.icio.us\",$attr=\"\") {\r\n\t\tglobal $post;\r\n\t\tif($post && is_object($post) && $post->ID>0) {\r\n\t\t\tdbt_addJavaScript();\r\n\t\t\techo \"<a href=\\\"#\\\" onclick=\\\"return dbt_bookmark('\" . get_permalink($post->ID) . \"');\\\" $attr>$text</a>\";\r\n\t\t}\r\n\t}",
"public function testAddNoteLink()\n {\n }",
"public function addTag();",
"public function makeTag()\n {\n $link = $this->getCObj()->typoLink($this->_makeLabel(), $this->_makeConfig('tag'));\n if ($this->isAbsUrl() && (@simplexml_load_string($link))) {\n $link = self::parseAbsUrl($link, $this->getAbsUrlSchema());\n }\n\n return $link;\n }",
"function build_tag_link($tag)\n\t{\n\t\t$tag_link = '<a href=\"' . append_sid(CMS_PAGE_TAGS . '?mode=view&tag_text=' . urlencode($tag)) . '\">' . $tag . '</a>';\n\n\t\treturn $tag_link;\n\t}",
"function tagreplace_link($replace, $opentag, $tagoriginal, $closetag, $sign) {\n\n global $cfg, $defaults, $specialvars;\n\n $tagwert = $tagoriginal;\n // ------------------------------\n\n // tcpdf extra\n if ( $cfg[\"pdfc\"][\"state\"] == true ) {\n if ( !preg_match(\"/^http/\",$tagwert) ) {\n $tagwert = \"http://\".$_SERVER[\"SERVER_NAME\"].\"/\".$tagwert;\n }\n }\n\n if ( $sign == \"]\" ) {\n $ausgabewert = \"<a href=\\\"\".$tagwert.\"\\\" title=\\\"\".$tagwert.\"\\\">\".$tagwert.\"</a>\";\n $replace = str_replace($opentag.$tagoriginal.$closetag,$ausgabewert,$replace);\n } else {\n $tagwerte = explode(\"]\",$tagwert,2);\n $linkwerte = explode(\";\",$tagwerte[0]);\n $href = $linkwerte[0];\n if ( !isset($tagwerte[1]) ) {\n $beschriftung = $href;\n } else {\n $beschriftung = $tagwerte[1];\n }\n\n // ziel\n if ( isset($linkwerte[1]) ) {\n $target = \" target=\\\"\".$linkwerte[1].\"\\\"\";\n } else {\n $target = null;\n }\n\n // title-tag\n if ( isset($linkwerte[2]) ) {\n $title = $linkwerte[2];\n } else {\n if ( !isset($linkwerte[1]) ) $linkwerte[1] = null;\n if ( $linkwerte[1] == \"_blank\" ) {\n $title = \"Link in neuem Fenster: \".str_replace(\"http://\",\"\",$href);\n } elseif ( !strstr($beschriftung,\"<\") ) {\n $title = $beschriftung;\n } else {\n $title = null;\n }\n }\n\n // css-klasse\n $class = \" class=\\\"link_intern\";\n if ( preg_match(\"/^http/\",$href) ) { # automatik\n $class = \" class=\\\"link_extern\";\n } elseif ( preg_match(\"/^\".str_replace(\"/\",\"\\/\",$cfg[\"file\"][\"base\"][\"webdir\"]).\".*\\.([a-zA-Z]+)/\",$href,$match) ) {\n if ( $cfg[\"file\"][\"filetyp\"][$match[1]] != \"\" ) {\n $class = \" class=\\\"link_\".$cfg[\"file\"][\"filetyp\"][$match[1]];\n }\n }\n if ( isset($linkwerte[3]) ) { # oder manuell\n $class .= \" \".$linkwerte[3];\n }\n $class .= \"\\\"\";\n\n // id\n if ( isset($linkwerte[4]) ) {\n $id = \" id=\\\"\".$linkwerte[4].\"\\\"\";\n } else {\n $id = null;\n }\n\n if ( !isset($pic) ) $pic = null;\n $ausgabewert = $pic.\"<a href=\\\"\".$href.\"\\\"\".$id.$target.\" title=\\\"\".$title.\"\\\"\".$class.\">\".$beschriftung.\"</a>\";\n $replace = str_replace($opentag.$tagoriginal.$closetag,$ausgabewert,$replace);\n }\n\n // ------------------------------\n return $replace;\n }",
"public function addTagLink($tag)\n {\n return Horde::url('browse.php')->add(array('tag' => $tag));\n }",
"function ozh_ta_linkify_local( &$tag, $key, $nofollow ) {\r\n\t$tag = '<a href=\"'.ozh_ta_get_tag_link( $tag ).'\">#'.$tag.'</a>';\r\n}",
"function link($image,$text=\"\",$uri,$help=\"\",$helpfree=\"\",$name=\"\")\r\n {\r\n if (right::field_view($help))\r\n {\r\n $retString = \"\";\r\n if ($name) $retString .= \"<a name='anchor$name'></a>\"; // insert anchor\r\n \r\n if (right::field_edit($help)) // editable: enable edit\r\n {\r\n $retString .= \"<a href='$uri'\";\r\n \t\t if ($help or $helpfree) $retString .= help::show($help,$helpfree);\r\n $retString .= \">\";\r\n \r\n if ($image) $retString .= grafik::disp($image,$text,20);\r\n else $retString .= $text;\r\n $retString .= \"</a>\";\r\n }\r\n else\r\n {\r\n $retString .= $text;\r\n }\r\n }\r\n return ($retString);\r\n }",
"public function renderLink();",
"function tag_get_link( array $p_tag_row ) {\n\treturn sprintf(\n\t\t'<a class=\"btn btn-xs btn-primary btn-white btn-round\" href=\"tag_view_page.php?tag_id=%s\" title=\"%s\">%s</a>',\n\t\t$p_tag_row['id'],\n\t\tstring_display_line( $p_tag_row['description'] ),\n\t\tstring_display_line( $p_tag_row['name'] )\n\t);\n}",
"public function link()\n {\n }",
"function showReplyLink()\n {\n $this->out->elementStart('li', 'reply');\n \t$this->out->elementStart('a', array('href' => common_path('notice/replyat/' . $this->profile->uname),\n \t\t\t\t\t'nid' => $this->notice->id,\n 'title' => '回复'));\n \t$this->out->text('回复');\n \t$this->out->elementEnd('a'); \t\t\n \t$this->out->elementEnd('li');\n }",
"public function tag() {return 'trello';}",
"function linkTags($tags)\n{\n\t$tags = explode(\", \", $tags);\n\tforeach ($tags as $k => $tag) $tags[$k] = \"<a href='\" . makeLink(\"search\", \"?q2=tag:$tag\") . \"'>$tag</a>\";\n\treturn implode(\", \", $tags);\n}",
"function ref_shortcode($atts, $content = \"\") {\n $foot = CMOA_Footnotes::getInstance();\n $foot->addNote($content);\n $count = count($foot->getNotes());\n return $foot->mustache->render('footnote-link.html', array('count' => $count, 'content' => $content));\n}",
"function s2t_is_link_note($link)\n{\n return strpos($link['url'], $link['shorturl']) !== false;\n}",
"public function makeLinkButton() {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handler: _copyMultiple If multiple arrays are passed as arguments mulitple will be returned. Otherwise _copy is used. | private static function _copyMultiple($function, $args)
{
$function(...$args);
$arrays = [];
foreach ($args as $arg) {
if (is_array($arg)) {
$arrays[] = $arg;
}
}
if (count($arrays) === 1) {
return $arrays[0];
}
return $arrays;
} | [
"public static function batchCopy() {\n $result = array();\n $copied = lC_Products_Admin::batchCopy($_GET['batch'], $_GET['new_category_id'], $_GET['copy_as']);\n if ($copied) {\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n }\n\n echo json_encode($result);\n }",
"public function copy($ids);",
"public function testCopyMultiple()\n {\n $config = array(\n 'test1' => 'new1',\n 'test2' => 'new2',\n );\n $request = array(\n 'Attributes' => array('test1' => array('val1'), 'test2' => array('val2.1','val2.2')),\n );\n $result = self::processFilter($config, $request);\n $attributes = $result['Attributes'];\n $this->assertArrayHasKey('new1', $attributes);\n $this->assertEquals($attributes['new1'], array('val1'));\n $this->assertArrayHasKey('new2', $attributes);\n $this->assertEquals($attributes['new2'], array('val2.1','val2.2'));\n }",
"public function testImagesBatchCopy()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"function array_copy( array $array ) {\n $copy = array();\n foreach( $array as $key => $val ) {\n if(is_array($val)) \n $copy[$key] = array_copy($val);\n elseif (is_object( $val )) \n $copy[$key] = clone $val;\n else \n $copy[$key] = $val;\n }\n return $copy;\n }",
"static function JoinArrays(){\n\t\t$out = array();\n\t\t$arguments = func_get_args();\n\t\tforeach($arguments as $arg){\n\t\t\tif(!isset($arg)){ continue; }\n\t\t\tif(!is_array($arg)){ $arg = array($arg); }\n\t\t\tforeach($arg as $item){\n\t\t\t\t$out[] = $item;\n\t\t\t}\n\t\t}\n\t\treturn $out;\n\t}",
"protected function cloneArgumentsForQueueing(array $arguments)\n {\n return array_map(function ($a) {\n return is_object($a) ? clone $a : $a;\n }, $arguments);\n }",
"function T3COPY($source,$dest,&$filearray,$level) {\r\n\t\t\t$this->tx_cbywebdav_devlog(3,\"=== T3COPY > \".$dest.\" \".$source,\"cby_webdav\",\"COPY\");\r\n\t\t\t$t3io=$this->CFG->t3io;\r\n\t\t\t$source=$this->_slashify($source);\r\n \t$filearray[$level][$source][]=$source;\r\n\t\t\t$sourceinfo=$t3io->T3IsFile($source); \r\n\t\t\t$lvl=$level;\r\n\t\t\t$destinfo=$t3io->T3IsFile($dest);\r\n\t\t\t$file = $this->_slashify($source);\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t$fileinfo=$t3io->T3IsFile($file); \r\n\t\t\t$new=!$destinfo['exists']; \t\t\t\t\t\t\r\n\t\t\t$this->tx_cbywebdav_devlog(2,\"=== T3COPY file \".serialize($fileinfo).\" files : \".serialize($files),\"cby_webdav\",\"COPY\");\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t//if ($fileinfo['isWebmount'] && $fileinfo['isDir']) { // Répertoire Webmount\r\n\r\n\t\t\t// we handle copy root rename here ....\r\n\t\t\t$page['title']=basename($file);\r\n\t\t\t// we handle copy root rename here ....\r\n\t\t\t$this->tx_cbywebdav_devlog(3,\"=== T3COPY fs \".$file.\" \".$source,\"cby_webdav\",\"COPY\");\r\n\t\t\t// if we are first dir to copy we take dest dir name\r\n\t\t\tif ($file==$source && $level==0 && $new){\r\n\t\t\t\t$this->tx_cbywebdav_devlog(3,\"=== T3COPY f=s \".$file.\" \".$source,\"cby_webdav\",\"COPY\");\r\n\t\t\t\t$page['title']=basename($dest);\r\n\t\t\t}\r\n\r\n\t\t\t$page['pid']=$destinfo['pid'];\r\n\t\t\tif ($destinfo['isWebmount']) $page['title']=$t3io->T3ExtractPageTitle($destinfo['uid'],$page['title']);\r\n\t\t\t//$where=\" uid='$sourceinfo[uid]' \";\r\n\t\t\t$this->tx_cbywebdav_devlog(2,\"=== T3COPY \".$this->CFG->T3DB->INSERTquery('pages',$page),\"cby_webdav\",\"COPY\");\r\n\t\t\t\t\t\r\n\t\t\t$this->CFG->T3DB->exec_INSERTquery('pages',$page); \t\t// copie récursive à mettre en place ici ...???\t\t\t\t\t\r\n\t\t\t$pid=$this->CFG->T3DB->sql_insert_id();\t\r\n\r\n\t\t\t// we copy the page content ...\r\n\t\t\t\r\n\t\t\t$this->tx_cbywebdav_devlog(2,\"=== T3COPY $source sinfo : \".serialize($sourceinfo).\" #######################\",\"cby_webdav\",\"COPY\");\r\n\t\t\t\r\n\t\t\t// We add the tt_content, could also be tt_news, users (vcf ...)\r\n\t\t\t$content['pid']=$pid;\r\n\t\t\t\r\n\t\t\t$enable=$GLOBALS['TSFE']->sys_page->enableFields('tt_content',-1,array('fe_group'=>1));\r\n\t\t\t$res=$this->CFG->T3DB->exec_SELECTquery('header','tt_content','pid='.intval($sourceinfo['uid']).$enable );\r\n\t\t\tif ($res) {\r\n\t\t\t\twhile ($row=$this->CFG->T3DB->sql_fetch_assoc($res)) {\r\n\t\t\t\t\t$file=$source.$row['header'];\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t$fileinfo=$t3io->T3IsFile($file);\r\n\t\t\t\t\t$destinfo=$t3io->T3IsFile($dest.'/'.$row['header']);\t\t\t\t\t\r\n\t\t\t\t\t//TODO handle upload file rename ...\r\n\t\t\t\t\t//$content['header']=basename($file);\r\n\t\t\t\t\t\r\n\t\t\t\t\t$where=\" uid='$destinfo[uid]' \";\r\n\t\t\t\t\tif ($destinfo['isWebmount']) {\r\n\t\t\t\t\t\tif ($destinfo['uid']) {\r\n\t\t\t\t\t\t\t$this->CFG->T3DB->exec_UPDATEquery('tt_content',$where,$content); \r\n\t\t\t\t\t\t \t$this->tx_cbywebdav_devlog(2,\"=== COPY \".$this->CFG->T3DB->UPDATEquery('tt_content',$where,$content),\"cby_webdav\",\"COPY\");\r\n\t\t\t\t\t\t} else {\t\r\n \t\t\t\t\t\t\t$content['header']=basename($file); \r\n\t\t\t\t\t\t\t$this->CFG->T3DB->exec_INSERTquery('tt_content',$content); \t\r\n\t\t\t\t\t\t \t$this->tx_cbywebdav_devlog(2,\"=== COPY \".$this->CFG->T3DB->INSERTquery('tt_content',$content),\"cby_webdav\",\"COPY\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// We get the directories (pages)....(should be a recursive call here ...\r\n\t\t\t$enable=$GLOBALS['TSFE']->sys_page->enableFields('pages',-1,array('fe_group'=>1));\r\n\t\t\t$res=$this->CFG->T3DB->exec_SELECTquery('title','pages','pid='.intval($sourceinfo['uid']).$enable );\r\n\t\t\tif ($res) {\r\n\t\t\t\twhile ($row=$this->CFG->T3DB->sql_fetch_assoc($res)) {\r\n\t\t\t\t\t$this->T3COPY($source.$row['title'].'/',$dest.'/'.$page['title'],$filearray,$level+1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->tx_cbywebdav_devlog(2,\"=== T3COPY files:\" .serialize($filearray).\" #######################\",\"cby_webdav\",\"COPY\");\r\n }",
"function _arrayMergeMixed() {\n $array = [];\n foreach (func_get_args() as $arg) {\n if (is_array($arg)) {\n $array = _flattenArray($arg);\n } else if ($arg) {\n $array [] = $arg;\n }\n }\n return $array;\n}",
"public function testDataSetsBatchCopy()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testPrivateImagesBatchCopy()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public static function dataProviderCopyMove(): array\n {\n return [\n [\n [\n 'operation' => 'copy',\n 'fileNames' => [\n 'some_file_1',\n 'some_file_2',\n ],\n 'filePaths' => [\n '/some_dir/some_file_1',\n '/some_dir/some_file_2',\n ],\n 'responseCode' => 200,\n 'assert' => true,\n ],\n ],\n [\n [\n 'operation' => 'copy',\n 'fileNames' => [\n 'some_file_1',\n 'some_file_2',\n ],\n 'filePaths' => [\n '/some_dir/some_file_1',\n '/some_other_invalid_dir/some_file_2',\n ],\n 'responseCode' => 200,\n 'assert' => false // because the files are in different folders which is illegal\n ],\n ],\n [\n [\n 'operation' => 'move',\n 'fileNames' => [\n 'some_file_1',\n 'some_file_2',\n ],\n 'filePaths' => [\n '/some_dir/some_file_1',\n '/some_dir/some_file_2',\n ],\n 'responseCode' => 200,\n 'assert' => true,\n ],\n ],\n [\n [\n 'operation' => 'move',\n 'fileNames' => [\n 'some_file_1',\n 'some_file_2',\n ],\n 'filePaths' => [\n '/some_dir/some_file_1',\n '/some_other_invalid_dir/some_file_2',\n ],\n 'responseCode' => 200,\n 'assert' => false // because the files are in different folders which is illegal\n ],\n ],\n ];\n }",
"function concat() {\n $arrs = func_get_args();\n return apply('array_merge', $arrs);\n}",
"public function getArrayCopy()\n {\n \treturn get_object_vars($this);\n }",
"function &array_copy(array &$array) {\n\t\t$copy = array();\n\n\t\t$keys = array_keys($array);\n\t\t$vals = array_values($array);\n\t\t$count = count($keys);\n\n\t\tfor($i = 0; $i < $count; ++$i) {\n\n\t\t\t// assume scalar / immediate\n\t\t\t$val = $vals[$i];\n\n\t\t\tif(is_object($val))\n\t\t\t\t$val = clone $val;\n\t\t\telse if(is_array($val))\n\t\t\t\t$val = &$this->deepCopy($val);\n\n\t\t\t// make the copy\n\t\t\t$copy[$keys[$i]] = &$val;\n\t\t}\n\n\t\treturn $copy;\n\t}",
"function SetMultiPaste($multiPaste){}",
"function makeArray()\n {\n return func_get_args();\n }",
"function addtoarray_single($array1, $array2)\n{\n //\n if (is_array($array2))\n {\n foreach ($array2 as $ar)\n {\n if ($ar && $ar !== null)\n {\n $array1[]=$ar;\n }\n }\n }\n return $array1;\n}",
"function arrayUnion()\n{\n\t$args = func_get_args();\n\t//if only 1 arg, use arrays in this arg \n\tif(count($args) == 1)\n\t\t$args = reset($args);\n\n\t$result = array();\n\tforeach($args as $ar)\n\t\tforeach ($ar as $key => $value)\n\t\t\t$result[$key] = $value;\n\n\treturn $result;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test for new lines removal. | public function testNewLines()
{
$this->assertEquals('testnewlines', $this->getSlugger()->slugify("test\nnew\rlines\n\r"));
} | [
"function line_endings_cleanup() {\n\tglobal $fcontents;\n\n\t$ct = preg_match(\"/\\r\\n(\\r\\n)+/\", $fcontents);\n\t$ct += preg_match(\"/\\r\\r+/\", $fcontents);\n\t$ct += preg_match(\"/\\n\\n+/\", $fcontents);\n\tif ($ct>0) {\n\t\t$fcontents = preg_replace(array(\"/(\\r\\n)+/\", \"/\\r+/\", \"/\\n+/\"), array(\"\\r\\n\", \"\\r\", \"\\n\"), $fcontents);\n\t\treturn true;\n\t}\n\telse return false;\n}",
"function need_line_endings_cleanup() {\n\tglobal $fcontents;\n\n\t$ct = preg_match(\"/\\r\\n(\\r\\n)+/\", $fcontents);\n\t$ct += preg_match(\"/\\r\\r+/\", $fcontents);\n\t$ct += preg_match(\"/\\n\\n+/\", $fcontents);\n\tif ($ct>0) {\n\t\treturn true;\n\t}\n\treturn false;\n}",
"public function testNewlines() {\n $this->assertEquals(\"Testing\\rCarriage\\rReturns\", Sanitize::newlines(\"Testing\\rCarriage\\r\\rReturns\"));\n $this->assertEquals(\"Testing\\r\\rCarriage\\rReturns\", Sanitize::newlines(\"Testing\\r\\rCarriage\\r\\r\\rReturns\", array('limit' => 3)));\n $this->assertEquals(\"TestingCarriageReturns\", Sanitize::newlines(\"Testing\\r\\rCarriage\\r\\r\\rReturns\", array('limit' => 0)));\n\n $this->assertEquals(\"Testing\\nLine\\nFeeds\", Sanitize::newlines(\"Testing\\nLine\\n\\nFeeds\"));\n $this->assertEquals(\"Testing\\nLine\\n\\nFeeds\", Sanitize::newlines(\"Testing\\n\\n\\nLine\\n\\nFeeds\", array('limit' => 3)));\n $this->assertEquals(\"TestingLineFeeds\", Sanitize::newlines(\"Testing\\n\\nLine\\n\\nFeeds\", array('limit' => 0)));\n\n $this->assertEquals(\"Testing\\r\\nBoth\\r\\nLineFeeds\\r\\n\\r\\nAnd\\r\\nCarriageReturns\", Sanitize::newlines(\"Testing\\r\\nBoth\\r\\r\\n\\nLineFeeds\\r\\n\\r\\r\\n\\nAnd\\r\\nCarriageReturns\"));\n $this->assertEquals(\"Testing\\r\\nBoth\\r\\nLineFeeds\\r\\nAnd\\r\\nCarriageReturns\", Sanitize::newlines(\"Testing\\r\\nBoth\\r\\n\\r\\nLineFeeds\\r\\n\\r\\n\\r\\nAnd\\r\\nCarriageReturns\"));\n $this->assertEquals(\"Testing\\r\\nBoth\\r\\n\\r\\nLineFeeds\\r\\n\\r\\n\\r\\nAnd\\r\\nCarriageReturns\", Sanitize::newlines(\"Testing\\r\\nBoth\\r\\n\\r\\nLineFeeds\\r\\n\\r\\n\\r\\nAnd\\r\\nCarriageReturns\", array('crlf' => false)));\n }",
"function _trim_newlines($code)\n\t{\n\t\t$code = preg_replace(\"/^\\n{1,}/s\", \"\", $code );\n\t\t$code = preg_replace(\"/\\n{1,}$/s\", \"\", $code );\n\t\treturn $code;\n\t}",
"function remove_new_lines($raw){\n\t\t$newlines = array(\"\\t\",\"\\n\",\"\\r\",\"\\x20\\x20\",\"\\0\",\"\\x0B\");\n\t\treturn str_replace($newlines, \"\", html_entity_decode($raw));\n\t}",
"protected function removeNewLines(&$html) {\n\t\t$splitArray = array(\n\t\t\t'textarea',\n\t\t\t'pre'\n\t\t); // eventuell auch: span, script, style\n\t\t$peaces = preg_split('#(<(' . implode('|', $splitArray) . ').*>.*</\\2>)#Uis', $html, -1, PREG_SPLIT_DELIM_CAPTURE);\n\t\t$html = \"\";\n\t\tfor ($i = 0; $i < count($peaces); $i++) {\n\t\t\tif (($i + 1) % 3 == 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$html .= (($i - 1) % 3 != 0) ? $this->killLineBreaks($peaces[$i]) : $peaces[$i];\n\t\t}\n\t}",
"function atNewline(): bool\n {\n return $this->char === \"\\n\" && $this->lastChar !== \"\\r\" || $this->char === \"\\r\";\n }",
"function _strip_newlines($html, $data, $url) {\n\t\tif (false !== strpos ( $html, \"\\n\" ))\n\t\t\t$html = str_replace ( array (\"\\r\\n\", \"\\n\" ), '', $html );\n\t\t\n\t\treturn $html;\n\t}",
"static function cleanNewLines($string) {\n\n $string = preg_replace(\"/\\r\\n/\", \" \", $string);\n $string = preg_replace(\"/\\n/\", \" \", $string);\n $string = preg_replace(\"/\\r/\", \" \", $string);\n return $string;\n }",
"function parse_whitespace_newlines($text, $do_nl2br = true)\n\t{\n\t\t// don't do new lines!\n\t\treturn parent::parse_whitespace_newlines($text, false);\n\t}",
"public function testNewlineOnlyInsertsIgnored()\n {\n $result = null;\n\n try {\n $quill = new QuillRender($this->delta_bug_101);\n $result = $quill->render();\n } catch (\\Exception $e) {\n $this->fail(__METHOD__ . 'failure, ' . $e->getMessage());\n }\n\n $this->assertEquals(\n $this->expected_bug_101,\n trim($result),\n __METHOD__ . ' newline only inserts ignored failure'\n );\n }",
"function testRemoveEmptyLines()\r\n {\r\n $this->assertIdentical(\r\n StringUtility::removeEmptyLines(\r\n \" \t\\n\t\t\t\t\\r\\n\t\t\\r\\n\t\\n \"\r\n ),\r\n ''\r\n );\r\n\r\n $this->assertIdentical(\r\n StringUtility::removeEmptyLines(\r\n \" \t\\n\t\t\tWill Buckner\t\\r\\n\t\t\\r\\n\t\\n \"\r\n ),\r\n 'Will Buckner'\r\n );\r\n\r\n $this->assertIdentical(\r\n StringUtility::removeEmptyLines(\"\\n\\r\\n\\r\\n\\n\"),\r\n ''\r\n );\r\n\r\n $this->assertNotIdentical(\r\n StringUtility::removeEmptyLines(\"\\n\\ra\\n\\r\\n\\n\"),\r\n ''\r\n );\r\n }",
"public function test_tokenizeHTML_removeNewline()\n {\n $this->config->set('Core.NormalizeNewlines', true);\n $this->assertTokenization(\n \"plain\\rtext\\r\\n\",\n array(\n new HTMLPurifier_Token_Text(\"plain\\ntext\\n\")\n )\n );\n }",
"public function checkCRLF(&$text)\n {\n $text = preg_replace(\"#(\\r\\n|\\r|\\n)#\", \"\\r\\n\", $text);\n }",
"protected function addMissingNewLine(): void\n {\n $last = end($this->ops);\n\n if ($last === false) {\n return;\n }\n\n $insert = $last->getInsert();\n\n if ($insert === self::LINE_SEPARATOR) {\n return;\n }\n\n if (is_string($insert) && str_ends_with($insert, self::LINE_SEPARATOR)) {\n $last->setInsert(substr($insert, 0, -1));\n }\n\n $this->ops[] = DeltaOp::text(self::LINE_SEPARATOR);\n }",
"public function testCanCreateLineBreak()\n {\n $newlineTest = new Newline();\n $nl = $newlineTest->nl;\n $this->assertEquals(\"\\n\", $nl);\n }",
"static function blankNewlines( $text )\n {\n return preg_replace( \"/\\r\\n|\\r|\\n/\", ' ', $text );\n }",
"public function testMultilineRecordsCollapseOntoSingleLine()\n {\n $zone = file_get_contents(__DIR__.'/Resources/testCollapseMultilines_sample.txt');\n $expectation = str_replace(\"\\r\\n\", \"\\n\", file_get_contents(__DIR__.'/Resources/testCollapseMultilines_expectation.txt'));\n $this->assertEquals($expectation, Normaliser::normalise($zone));\n }",
"public function isNewline() {\n\t\treturn $this->newline;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve home_enabled in json format | public function get_home()
{
$obj = new View();
if (! $this->authorized()) {
$obj->view('json', array('msg' => 'Not authorized'));
return;
}
$queryobj = new Icloud_model();
$sql = "SELECT COUNT(1) as total,
COUNT(CASE WHEN `home_enabled` = 1 THEN 1 END) AS 'yes',
COUNT(CASE WHEN `home_enabled` = 0 THEN 1 END) AS 'no'
from icloud
LEFT JOIN reportdata USING (serial_number)
WHERE
".get_machine_group_filter('');
$obj->view('json', array('msg' => current($queryobj->query($sql))));
} | [
"function getEnabled() {\n\t\treturn $this->getData('enabled');\n\t}",
"public function get_vnc_enabled()\n {\n $obj = new View();\n if (! $this->authorized()) {\n $obj->view('json', array('msg' => 'Not authorized'));\n return;\n }\n \n $queryobj = new Ard_model();\n $sql = \"SELECT COUNT(1) as total,\n COUNT(CASE WHEN `vnc_enabled` = 1 THEN 1 END) AS 'yes',\n COUNT(CASE WHEN `vnc_enabled` = 0 THEN 1 END) AS 'no'\n from ard\n LEFT JOIN reportdata USING (serial_number)\n WHERE\n \".get_machine_group_filter('');\n $obj->view('json', array('msg' => current($queryobj->query($sql))));\n }",
"public function getUserSearchableSettings()\n {\n $json = array();\n $user_meta = new UserMeta();\n $user_data = $user_meta::select('profile_searchable', 'disable_account')\n ->where('user_id', Auth::user()->id)->get()->first();\n if (!empty($user_data)) {\n $json['type'] = 'success';\n if ($user_data->profile_searchable == 'true') {\n $json['profile_searchable'] = 'true';\n }\n if ($user_data->disable_account == 'true') {\n $json['disable_account'] = 'true';\n }\n } else {\n $json['type'] = 'error';\n }\n return $json;\n }",
"public function getHomePageFeaturedEnabled()\n {\n return $this->homePageFeaturedEnabled;\n }",
"public function getEnabled();",
"private function get_enabled()\n\t{\n\t\t$query = $this->db->query('\n\t\t\tSELECT *\n\t\t\tFROM ' . $this->db->dbprefix('plugins') . '\n\t\t\tWHERE enabled = 1\n\t\t');\n\n\t\treturn $query->result();\n\t}",
"public function get_visible_in_rest_api() {\n\t\treturn $this->visible_in_rest_api;\n\t}",
"public function authGetEnableAction()\n {\n $result = $this->backend->auth_getenable();\n $this->processUnnormalBackendResult($result);\n\n $this->apiOk(array(\n 'enable' => $result['data'],\n ), 'get auth enable status successfully');\n }",
"public function getUserHomeInfo()\r\n {\r\n $home_info = [\r\n 'homeAddress' => '魔都',\r\n 'homeNumber' =>'029-8848888',\r\n ];\r\n return $home_info;\r\n }",
"public function isRecommendationEnabledOnHome() {\n return $this->isEnabled()\n && $this->getApiToken()\n && $this->getRecommendationConfig('home/enabled')\n && $this->getRecommendationConfig('home/endpoint');\n }",
"public function get_enabled_features() {\n $responsedata = new stdClass();\n\n // Make request to get the enabled features on the account.\n try {\n $endpoint = TURNITINSIM_ENDPOINT_GET_FEATURES_ENABLED;\n $response = $this->tsrequest->send_request($endpoint, json_encode(array()), 'GET');\n $responsedata = json_decode($response);\n\n // Latest version retrieved.\n if ($responsedata->httpstatus == TURNITINSIM_HTTP_OK) {\n mtrace(get_string('taskoutputenabledfeaturesretrieved', 'plagiarism_turnitinsim'));\n return $responsedata;\n }\n\n mtrace(get_string('taskoutputenabledfeaturesnotretrieved', 'plagiarism_turnitinsim'));\n return $responsedata;\n\n } catch (Exception $e) {\n $this->tsrequest->handle_exception($e, 'taskoutputenabledfeaturesretrievalfailure');\n return $responsedata;\n }\n }",
"public function getEnabled()\n {\n if ($this->model->where('is_disabled', '=', 0)->get())\n return $this->model->where('is_disabled', '=', 0)->get();\n else return [];\n }",
"protected static function get_enabled()\n\t{\n\t\treturn \\DB::select()\n\t\t\t->from('plugins')\n\t\t\t->where('enabled', 1)\n\t\t\t->execute()\n\t\t\t->as_array();\n\t}",
"public function getAllEnabled()\n\t{\n\t\treturn $this->findBy(array('is_enabled' => true));\n\t}",
"public function enabled()\n {\n return $this->getByEnabled(true);\n }",
"public function getAvailableStatuses()\n {\n $statuses = new Varien_Object(array(\n self::STATUS_ENABLED => Mage::helper('mybrand')->__('Enabled'),\n self::STATUS_DISABLED => Mage::helper('mybrand')->__('Disabled'),\n ));\n\n Mage::dispatchEvent('mybrand_manufacturer_get_available_statuses', array('statuses' => $statuses));\n\n return $statuses->getData();\n }",
"public function getAccountEnabled()\n {\n return $this->getProperty(\"AccountEnabled\");\n }",
"public function getEnabledApis () {\n $result = [];\n $apis = $this->apiModel::all()->toArray();\n if ($apis) {\n foreach ($apis as $api) {\n $result[$api['id']] = $api['name'];\n }\n }\n\n return $this->enabledApis = $result;\n }",
"public function getAvailableStatuses()\n {\n $statuses = new Varien_Object(array(\n self::STATUS_ENABLED => Mage::helper('profile')->__('Enabled'),\n self::STATUS_DISABLED => Mage::helper('profile')->__('Disabled'),\n ));\n\n Mage::dispatchEvent('profile_get_available_statuses', array('statuses' => $statuses));\n\n return $statuses->getData();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if bcmath extension is loaded | public function checkBcMath()
{
return extension_loaded('bcmath') ? 2 : 1;
} | [
"public static function isBcMathAvailable()\n {\n return extension_loaded(static::EXTENSION_BCMATH);\n }",
"static protected function _useBCMath()\n {\n if (!function_exists('bccomp')) {\n throw new \\LogicException('BC Math extension currently is required', 1405066207);\n }\n\n return true;\n }",
"private static function bcExists()\r\n {\r\n if(self::$bcExists) return self::$bcExists;\r\n\r\n if(!extension_loaded('bcmath')){\r\n self::$bcExists = FALSE;\r\n exit(\"bcmath extention required\\nFile: \" . basename(__FILE__) . \"\\nLine: \" . __LINE__ . \"\\n\");\r\n } else {\r\n self::$bcExists = TRUE;\r\n }\r\n return self::$bcExists;\r\n }",
"private function checkIfBcmodIsAvailable(): bool\n {\n return function_exists('bcmod');\n }",
"private function _checkGdLibrary(){\n if (extension_loaded('gd') && function_exists('gd_info')) {\n return TRUE;\n } else {\n return FALSE;\n }\n }",
"protected function crc32cExtensionLoaded()\n {\n return extension_loaded('crc32c');\n }",
"function extension_loaded($name)\n{\n if ($name === 'gmp' && SignerTest::$disableGmp) {\n return false;\n }\n\n return \\extension_loaded($name);\n}",
"public static function checkGd()\n {\n return extension_loaded(\"gd\");\n }",
"private static function loadExtension()\n\t{\n\t\t// Is bz2 extension loaded? If not try to load it\n\t\tif (!extension_loaded('bz2'))\n\t\t{\n\t\t\tif (TPATH_ISWIN)\n\t\t\t{\n\t\t\t\t@ dl('php_bz2.dll');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t@ dl('bz2.so');\n\t\t\t}\n\t\t}\n\t}",
"public function testIfNeededExtensionsAreLoaded()\n {\n $needed = \\P7TriviaGame\\Core\\System::REQUIRED_PECL_LIB;\n\n for($i=0;$i<count($needed);$i++) {\n $this->assertTrue(in_array($needed[$i], get_loaded_extensions() ));\n }\n\n }",
"function checkExtensionLoad($name)\n{\n if (extension_loaded($name)) {\n return true;\n }\n return false;\n}",
"function lynkff_checkGd(){\r\n\tif(extension_loaded('gd')){\r\n\treturn true;\r\n\t}\t\r\n\telse{\r\n\t\treturn false;\r\n\t\t}\r\n}",
"function mcrypt_loaded($show_error=false) {\r\n if ((extension_loaded('mcrypt') || (function_exists('dl') && dl(((PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '') . (null ? null : 'mcrypt') . '.' . PHP_SHLIB_SUFFIX))) != 1) {\r\n\t\tif ($show_error) {\r\n\t\t\texit('<div class=\"red\"><b>ERROR:</b><br>The \"mcrypt\" PHP extension is not loaded but is required for encryption/decryption.<br>\r\n\t\t\t\t Please install the PHP extension \"mcrypt\" on your server, reboot your server, and then reload this page.</div>');\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t} else {\r\n\t\treturn true;\r\n\t}\r\n}",
"private function checkExtensionLoaded() {\n\t\tif (!extension_loaded('curl') ) {\n\t\t\techo \"===========================================\\n\";\n\t\t\techo \"curl extension is required!\\n\";\n\t\t\techo \"===========================================\\n\";\n\t\t\texit;\n\t\t}\t\n\t}",
"private static function checkModule()\n\t{\n\t\tif(extension_loaded('imagick')) return 'imagick';\n\t\treturn 'gd';\n\t}",
"function checkForLDAPExtension()\r\n{\r\n return extension_loaded(\"ldap\");\r\n}",
"protected function isCryptLoaded() {\n\n if (!function_exists('crypt')) {\n\n trigger_error(sprintf('%s Expects crypt loaded.', __METHOD__));\n return FALSE;\n }\n return TRUE;\n }",
"public function isExtensionLoaded($ext='gd') { \n return extension_loaded($ext); \n }",
"private function extensionCheck()\n {\n // Check for required PHP extensions\n $required_extensions = ['PDO', 'curl', 'gd', 'json', 'openssl', 'mbstring'];\n $missing = [];\n foreach ($required_extensions as $extension) {\n if (!extension_loaded($extension)) {\n $missing[] = $extension;\n }\n }\n if (count($missing)) {\n asort($missing);\n $this->console->error('Extension required: ' . implode(', ', $missing));\n $this->errors = true;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Category widget for unresolved / resolved posts | function jl_unresolved_posts_cat_register_widget() {
register_widget( 'jl_unresolved_posts_cat_widget' );
} | [
"private function getPostCategory()\n\t{\n\t\t$default_category=$this->pluginOptions['default_category'];\n\n\t\t$this->categoriesStringToArray();\n\n\t\t$categories=$this->feed_item->categories;\n\n\t\t$this->feed_item->category=$default_category;\n\n\t\tif(count($categories)==0&&count($this->feed->categories_array)==0)\n\t\t{\n\t\t\t$this->feed_item->category='';\n\t\t\t//\n\t\t}\n\t\telse if(count($categories)==0)\n\t\t{\n\t\t\tforeach($this->feed->categories_array as $k=>$v)\n\t\t\t{\n\t\t\t\tif($k=='')\n\t\t\t\t{\n\t\t\t\t\t$this->feed_item->category=$v;\n\t\t\t\t\tbreak;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if(count($this->feed->categories_array)==0)\n\t\t{\n\t\t\t//\n\t\t}\n\t\t/* */\n\t\telse\n\t\t{\n\t\t\tforeach($this->feed->categories_array as $k=>$v)\n\t\t\t{\n\t\t\t\tforeach($categories as $cat)\n\t\t\t\t{\n\t\t\t\t\tif($cat==$k||$k=='')\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->feed_item->category=$v;\n\t\t\t\t\t}\n\t\t\t\t\tif($cat==$k)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function widget($args, $instance) {\n $categories = get_categories(array(\"include\" => \"35, 9\", \"hide_empty\" => 0));\n // if there are any categories (!)\n if ($categories) {\n // Loop through them and display\n foreach ($categories as $category) {\n echo '<div class = \"maincats\"><a href = ' . home_url() . '/category/' . $category->category_nicename . '>'\n . $category->name . '</a></div>';\n }\n }\n }",
"function fc_load_widget() {\n register_widget( 'fajar_categories_widget' );\n}",
"function lsx_post_meta_category() {\n\t\t$post_categories = wp_get_post_categories( get_the_ID() );\n\t\t$cats = array();\n\n\t\tforeach ( $post_categories as $c ) {\n\t\t\t$cat = get_category( $c );\n\t\t\t/* Translators: %s: category name */\n\t\t\t$cats[] = '<a href=\"' . esc_url( get_category_link( $cat->term_id ) ) . '\" title=\"' . sprintf( esc_html__( 'View all posts in %s' , 'lsx' ), $cat->name ) . '\">' . $cat->name . '</a>';\n\t\t}\n\n\t\tif ( ! empty( $cats ) ) {\n\t\t\t?>\n\t\t\t<span class=\"post-meta-categories\"><span><?php esc_html_e( 'Posted in: ', 'lsx' ); ?></span> <?php echo wp_kses_post( implode( ', ', $cats ) ); ?></span>\n\t\t\t<?php\n\t\t}\n\t}",
"function widget_get_category()\n{\n $categories = BlogManager::getCategoryBlogCount();\n return $categories;\n}",
"function widget($args, $instance) {\n\tglobal $post;\n\t$post_old = $post; // Save the post object.\n\t\n\techo '<div class=\"cat_news_box fix\">';\n\t\n\t// Widget title\n\techo '<h4 class=\"headbar\">';\n\t\techo '<a href=\"' . get_category_link($instance[\"cat\"]) . '\">' . get_cat_name($instance[\"cat\"]) . '</a>';\n\techo '</h4>';\n\n\t// First of Post list START\n $first_cat_posts = new WP_Query( array('post_type' => 'post', 'showposts' =>1, 'cat' => $instance[\"cat\"], 'orderby' => 'date', 'order' => 'DESC' ) ); \n\t\n\techo '<div class=\"cat_main\">';\n\twhile ( $first_cat_posts->have_posts() )\n\t{\n\t\t$first_cat_posts->the_post();\n\t?>\n\t\t<h2 class=\"title\"><a href=\"<?php the_permalink(); ?>\" rel=\"bookmark\" title=\"\"><?php the_title(); ?></a></h2>\n\t\t<div class=\"additional_info\"><?php the_time('F j, Y, g:i A') ?> </span></div>\n\t\t<div class=\"content fix\">\n\t\t\t<?php\n\t\t\tif ( has_post_thumbnail() ) {\n\t\t\tthe_post_thumbnail('post-thumb', array('class' => 'sidebar_cat_image', 'alt' => ''));\n\t\t\t}\n\t\t\t?>\t\n\t\t\t<a href=\"<?php the_permalink(); ?>\" class=\"content_right\"><?php echo excerpt(40); ?></a>\n\t\t</div>\n\t\t<div class=\"bottom\">\n\t\t\t<a class=\"comment\" href=\"<?php comments_link(); ?>\" title=\"comment\"><i class=\"fa fa-comment\"></i><span><?php comments_number( '০', '১', '%' ); ?></span></a>\n\t\t\t<div class=\"holder\"><a href=\"<?php the_permalink(); ?>\" class=\"more_link\">বিস্তারিত</a></div>\n\t\t</div>\t\t\n\t<?php\n\t}\t\n\techo '</div>';\t\n\t// First of Post list END\t\t\n\t\n\n\t// Rest of Post list START\n $more_cat_posts = new WP_Query( array('post_type' => 'post', 'showposts' =>$instance[\"num\"], 'cat' => $instance[\"cat\"], 'offset'=>1, 'orderby' => 'date', 'order' => 'DESC' ) ); \n\n\techo '<div class=\"cat_more\">';\n\techo \"<ul>\\n\";\n\twhile ( $more_cat_posts->have_posts() )\n\t{\n\t\t$more_cat_posts->the_post();\n\t?>\n\t\t<li>\n\t\t\t<?php\n\t\t\tif ( has_post_thumbnail() ) {\n\t\t\tthe_post_thumbnail('post-thumb', array('class' => 'cat_more_image', 'alt' => ''));\n\t\t\t}\n\t\t\t?>\t\n\t\t\t<a href=\"<?php the_permalink(); ?>\" rel=\"bookmark\" title=\"\"><?php the_title(); ?></a>\n\t\t</li>\n\t<?php\n\t}\n\techo \"</ul>\\n\";\n\techo '</div>';\n\t// Rest of Post list END\n\t?>\t\n\t<div class=\"footbar\"><a class=\"more_link\" href=\"<?php echo get_category_link($instance[\"cat\"]) ?>\">আরও</a></div>\t\n\t<?php\n\techo '</div>';\n\t$post = $post_old; // Restore the post object.\n}",
"public function category()\n {\n $posts = $this->Post->getAll();\n $category = $this->Category->find($_GET['id']);\n if ($category === false) {\n $this->notFound();\n }\n $articles = $this->Post->firstByCategory($_GET['id']);\n if ($articles === false) {\n $this->notFound();\n }\n $categories = $this->Category->getAll();\n $this->render('posts.category', compact('articles', 'posts', 'categories', 'category'));\n }",
"public function display_category()\n {}",
"static function add_no_issue_cats(): void {\r\n\t\tself::add_acf_field(self::no_issue_cats, [\r\n\t\t\t'label' => 'For these categories, do not attach posts to a specific'\r\n\t\t\t\t. ' issue.<br><em>The post will then link to the volume, but' .\r\n\t\t\t ' not vice versa.</em>',\r\n\t\t\t'type' => 'taxonomy',\r\n\t\t\t'instructions' => '',\r\n\t\t\t'required' => 0,\r\n\t\t\t'conditional_logic' => 0,\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '75',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t\t'taxonomy' => 'category',\r\n\t\t\t'field_type' => 'multi_select',\r\n\t\t\t'allow_null' => 0,\r\n\t\t\t'add_term' => 0,\r\n\t\t\t'save_terms' => 0,\r\n\t\t\t'load_terms' => 0,\r\n\t\t\t'return_format' => 'id',\r\n\t\t\t'ajax' => 0\r\n\t\t]);\r\n\t}",
"function kapee_template_loop_post_category() {\n\t\tget_template_part( 'template-parts/post-loop/category' );\t\t\n\t}",
"public function setup_category_posts_boxes() {\n\t\t\tadd_meta_box(\n\t\t\t\t'master-add-category-posts-metabox',\n\t\t\t\t__( 'All Posts In Category', 'easy-custom-sidebars' ),\n\t\t\t\tarray( $this, 'render_category_post_meta_box' ),\n\t\t\t\t$this->plugin_screen_hook_suffix,\n\t\t\t\t'side',\n\t\t\t\t'default'\n\t\t\t);\n\t\t}",
"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}",
"function widget_mdv_most_commented_per_cat($args) {\r\n\t extract($args);\r\n\r\n\tif (is_category() ) { \r\n\t\t\r\n\t\t$cat_id = get_query_var('cat');\r\n\r\n\t // Fetch our parameters\r\n\t $bfa_pic_options = get_option('widget_mdv_most_commented_per_cat');\r\n\t $bfa_pic_title = $bfa_pic_options['bfa_pic_title'];\r\n\t $bfa_pic_no_posts = $bfa_pic_options['bfa_pic_no_posts'];\r\n\t $bfa_pic_duration = $bfa_pic_options['bfa_pic_duration'];\r\n\t $bfa_pic_min_amount_comments = $bfa_pic_options['bfa_pic_min_amount_comments'];\r\n\t $bfa_pic_prepend_cat_title = $bfa_pic_options['bfa_pic_prepend_cat_title']; \r\n\t $bfa_pic_append_cat_title = $bfa_pic_options['bfa_pic_append_cat_title'];\r\n\t \r\n\t $current_cat_title = htmlentities(single_cat_title('', false),ENT_QUOTES);\r\n\t if ($bfa_pic_prepend_cat_title == \"on\" ) { $bfa_pic_title = $current_cat_title . \" \" . $bfa_pic_title; }\r\n\t if ($bfa_pic_append_cat_title == \"on\" ) { $bfa_pic_title = $bfa_pic_title . \" \" . $current_cat_title; }\t \r\n\t \t \r\n\t global $wpdb;\r\n\r\n\r\n\t\t$bfa_pic_request = \"SELECT DISTINCT ID, post_title, comment_count FROM $wpdb->posts as p\";\r\n\t\t$bfa_pic_request .= \" INNER JOIN $wpdb->term_relationships AS tr ON\";\r\n\t\t$bfa_pic_request .= \" (p.ID = tr.object_id AND\";\r\n\t\t$bfa_pic_request .= \" tr.term_taxonomy_id = $cat_id )\";\r\n\t\t$bfa_pic_request .= \" INNER JOIN $wpdb->term_taxonomy AS tt ON\";\r\n\t\t$bfa_pic_request .= \" (tr.term_taxonomy_id = tt.term_taxonomy_id AND\";\r\n\t\t$bfa_pic_request .= \" taxonomy = 'category')\";\r\n\t\t$bfa_pic_request .= \" WHERE post_status = 'publish' AND comment_count >= $bfa_pic_min_amount_comments\";\r\n\t\t$bfa_pic_request .= \" AND post_password =''\";\r\n\t\r\n\t\tif ($bfa_pic_duration !=\"\") $bfa_pic_request .= \" AND DATE_SUB(CURDATE(),INTERVAL \".$bfa_pic_duration.\" DAY) < post_date \";\r\n\t\r\n\t\t$bfa_pic_request .= \" ORDER BY comment_count DESC LIMIT $bfa_pic_no_posts\";\r\n\t\t$bfa_pic_posts = $wpdb->get_results($bfa_pic_request);\r\n\r\n\t\tif ($bfa_pic_posts) {\r\n\t\t\t$widget_mdv_most_commented_per_cat = '';\r\n\t\t\tforeach ($bfa_pic_posts as $bfa_pic_post) {\r\n\t\t\t\t$bfa_pic_post_title = stripslashes($bfa_pic_post->post_title);\r\n\t\t\t\t$bfa_pic_comment_count = $bfa_pic_post->comment_count;\r\n\t\t\t\t$bfa_pic_permalink = get_permalink($bfa_pic_post->ID);\r\n\t\t\t\t$widget_mdv_most_commented_per_cat .= '<li><a href=\"' . $bfa_pic_permalink . '\" title=\"' . $bfa_pic_post_title.'\">' . $bfa_pic_post_title . ' (' . $bfa_pic_comment_count . ')</a></li>';\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$widget_mdv_most_commented_per_cat = \"None found\";\r\n\t\t}\r\n\t\r\n\r\n if ($widget_mdv_most_commented_per_cat != \"None found\") {\r\n echo $before_widget . $before_title . $bfa_pic_title . $after_title;\t\r\n echo \"<ul>\" . $widget_mdv_most_commented_per_cat . \"</ul>\";\r\n echo $after_widget;\r\n } else { return $widget_mdv_most_commented_per_cat; }\r\n}\r\n}",
"function sheru_posts($args) {\n echo $args['before_widget'];\n echo $args['before_title'] . 'My Unique Widget' . $args['after_title'];\n echo $args['after_widget'];\n\n echo \"Your Widget Test\";\n\n $slug = \"blog\";\n\n $args = array(\n 'posts_per_page' => 5,\n 'category__not_in' => array( sheru_get_category_id_from_slug( $slug ) )\n );\n\n $sheru_posts = new WP_Query($args);\n\n if($sheru_posts->have_posts() ) :\n echo '<ul>';\n while ( $sheru_posts->have_posts() ) : $sheru_posts->the_post();\n echo '<li>';\n echo '<a href=\"'.the_permalink().'\">';\n the_title();\n echo '</a>';\n echo '</li>';\n endwhile;\n echo '</ul>';\n endif;\n\n}",
"function wp_ajax_press_this_add_category()\n {\n }",
"function uwmadison_categorized_blog() {\n if ( false === ( $all_the_cool_cats = get_transient( 'uwmadison_categories' ) ) ) {\n // Create an array of all the categories that are attached to posts.\n $all_the_cool_cats = get_categories( array(\n 'fields' => 'ids',\n // We only need to know if there is more than one category.\n 'number' => 2,\n ) );\n\n // Count the number of categories that are attached to the posts.\n $all_the_cool_cats = count( $all_the_cool_cats );\n\n set_transient( 'uwmadison_categories', $all_the_cool_cats );\n }\n\n if ( $all_the_cool_cats > 1 ) {\n // This blog has more than 1 category so uwmadison_categorized_blog should return true.\n return true;\n } else {\n // This blog has only 1 category so uwmadison_categorized_blog should return false.\n return false;\n }\n}",
"function bunchy_render_entry_categories( $args = array() ) {\n\techo bunchy_capture_entry_categories( $args );\n}",
"function kapee_template_portfolio_loop_categories() {\n\t\tget_template_part( 'template-parts/portfolio-loop/category' );\t\t\n\t}",
"public function getCategories()\n {\n return ['my-widgets'];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get specific employee data by his Desktime email. | public function getEmployeeByEmail($email) {
$result = new \stdClass();
$result->pass = FALSE;
$all_employees = $this->all();
if (($all_employees->pass) && isset($all_employees->body->employees)) {
$employees = reset($all_employees->body->employees);
if (count($employees) > 0) {
foreach ($employees as $employee) {
if ($email == $employee->email) {
$result->pass = TRUE;
$result->data = $employee;
break;
}
}
}
}
return $result;
} | [
"public function getEmployeeByEmail(Request $request) \n {\n $employee = Employees::getEmployeeByEmail($request->input('email'));\n $employee = $this->generateEmployeeData($employee); \n\n return $employee;\n }",
"public function getEmployeeByEmail($email){\n\t\t\n\t\t$this->db->where('email', $email);\n\t\t$rows = $this->db->get('employee');\n\t\t\n\t\tif($rows->num_rows() > 0){\n\t\t\treturn new Employee($rows->first_row());\n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t}",
"function viewEmployee ($single_employee_email) {\n\n\t\t$return_employee_record = \"SELECT `user_name`, `email`, `address`, `image_location` FROM `users` WHERE `email` = '$single_employee_email'\";\n\n\t\t$employee_data = mysqli_query($this -> conn, $return_employee_record);\n\n\t\tif($employee_data) {\n\n\t\t\twhile ($employee_row = mysqli_fetch_row($employee_data)) {\n\t\t\t\t\n\t\t\t\t $employee_result = $employee_row;\n\n\t\t\t}\n\n\t\t\treturn $employee_result;\n\n\t\t}\n\n\t\tmysqli_close($this -> conn);\n\n\t}",
"public function getEmail($id,$email);",
"function getUserDetails($email){\n \n $this->rk->where(\"email\",$email);\n $this->rk->where(\"status\",0);\n $query = $this->rk->get(\"users\");\n \n return $query;\n \n }",
"public function userdeatils_email($hfemail)\n\t{\n\t\t$db = Zend_Db_Table::getDefaultAdapter();\n\t\t \n\t\t$sql ='select hf_id,hf_facility_suffix,hf_facility_name,hf_facility_lname,hf_address,hf_state,hf_city,hf_zip,hf_country,reg_date from hosted_facilities where hf_email=\"'.$hfemail.'\"';\n\t\treturn $db->fetchRow($sql);\n\t}",
"function readByEmail()\n {\n\n // query to read single record\n $query = \"SELECT * FROM \" . $this->table_name . \" r \n WHERE r.email = ? LIMIT 0,1\";\n\n // prepare query statement\n $stmt = $this->conn->prepare($query);\n\n // sanitize\n $this->email = htmlspecialchars(strip_tags($this->email));\n\n // bind id of restaurant to be updated\n $stmt->bindParam(1, $this->email);\n\n // execute query\n $stmt->execute();\n\n // get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n // set values to object properties\n $this->id = $row['id'];\n $this->name = $row['name'];\n $this->email = $row['email'];\n $this->urlName = $row['urlName'];\n $this->address = $row['address'];\n $this->admin = $row['admin'];\n $this->token = $row['token'];\n }",
"public function getEmployeeForCheckExists($email)\n\t{\n\t\t$result = $this->myPdoObj\n\t\t\t->select('name_employee, mail_employee')\n\t\t\t->table('employee')\n\t\t\t->where(array('mail_employee' => $email), array('='))\n\t\t\t->query()\n\t\t\t->commit();\n\n\t\treturn $result;\n\t}",
"function get_member_detail_by_email($email)\n {\n $data = $this->make_request('members/email/'.$email, 'GET');\n return $data;\n }",
"function getUserBasicInfoByEmail($emailId = null){\n \n $UsersModel = TableRegistry::get('Users'); \n $getUserData = $UsersModel->find('all')->select(['id','role_id','firstname','lastname','email','phone_number'])->where(['Users.email' => $emailId])->hydrate('false')->first();\n return $getUserData;\n }",
"public function getByEmail($email='') {\n\t\t\n\t\t//\tValidate email:\n\t\t\t$email = $this->validate($email, 'EMAIL');\n\t\t\tif ($email === false) { return false;}\n\t\t\t$email =strtolower($email);\n\t\t\n\t\t//\tGet record from user-table:\n\t\t\t$options = array();\n\t\t\t$options['where'] = '`email`=\"'.$email.'\"';\n\t\t\t$records = $this->active_table->select_all($options);\n\t\t\t\n\t\t\t\n\t\t\t$aR = count($records) === 1? $records[0] : false;\n\t\t\tif ($aR == false ) {return false;}\n\t\t\t\n\t\t//\tAdd respond_date:\n\t\t\t$date = new DateTime($aR['updateRequest']);\n\t\t\t$date->add(new DateInterval('PT'.TIMESLOT.'H'));\n\t\t\t$aR['respond_date'] =$date->format('j-M-Y, H:i');\n\t\t\t\n\t\t//\tAdd fullname:\n\t\t\t$full_name = array();\n\t\t\t$name = array_key_exists('firstName', $aR)? trim($aR['firstName'])\t\t: \"\";\n\t\t\tif ( strlen($name) > 0) {\n\t\t\t\t$full_name[] = $name;\n\t\t\t}\n\t\t\t$name = array_key_exists('midName', $aR)? trim($aR['midName'])\t\t: \"\";\n\t\t\tif ( strlen($name) > 0) {\n\t\t\t\t$full_name[] = $name;\n\t\t\t}\n\t\t\t$name = array_key_exists('lastName', $aR)? trim($aR['lastName'])\t\t: \"\";\n\t\t\tif ( strlen($name) > 0) {\n\t\t\t\t$full_name[] = $name;\n\t\t\t}\n\t\t\t$aR['full_name'] = implode(' ',$full_name);\n\t\t\t\n\t\t\treturn $aR;\n\t\t\t\n\t}",
"function getUserInfoByEmail($email=null){\n\t\t$CI\t= & get_instance();\n\t\ttry{\n\t\t\tif(!empty($email)){\n\t\t\t\t$result\t\t= $CI->db->where('qw_users.email',$email)->select('qw_users.*')\n\t\t\t\t\t\t->get('qw.qw_users')->row();\n\t\t\t\tif($result){\n\t\t\t\t\treturn $result;\n\t\t\t\t}return false;\n\t\t\t}return false;\n\t\t}catch(Exception\t$ex){\n\t\t\tlog_message('error','Unable to get user info based on user email '.$ex->getMessage());\n\t\t}\n\t}",
"public function getByemail($email, $passwd = NULL)\n\t{\n\t \tif (!Validate::isEmail($email) || ($passwd != NULL && !Validate::isPasswd($passwd)))\n\t \t\tdie(Tools::displayError());\n\n\t\t$result = DB::GetRow('\n\t\tSELECT * \n\t\tFROM `employee`\n\t\tWHERE `active` = 1\n\t\tAND `email` = \\''.$email.'\\'\n\t\t'.($passwd ? 'AND `passwd` = \\''.Tools::encrypt($passwd).'\\'' : ''));\n\t\tif (!$result)\n\t\t\treturn false;\n\t\t$this->id = $result['id_employee'];\n\t\t$this->id_profile = $result['id_profile'];\n\t\tforeach ($result as $key => $value)\n\t\t\tif (key_exists($key, $this))\n\t\t\t\t$this->{$key} = $value;\n\t\treturn $this;\n\t}",
"function searchForPersonByEmail($email) {\n $searchItems = array(\n 'term='.$email,\n \"field=email\",\n \"exact_match=true\"\n );\n $searchString = implode ('&', $searchItems);\n $searchResults = searchForPerson($searchString);\n\n // Person ID of 0 === non-existing user\n $person = array(\"id\" => 0, \"name\" => \"\");\n if ($searchResults[\"success\"]) {\n $emailMatches = $searchResults[\"data\"][\"items\"];\n if (count($emailMatches) > 0) {\n $person = $emailMatches[0][\"item\"];\n }\n }\n return $person;\n }",
"public function getUserByEmail($email);",
"public function infoPorEmail($email){ \r\n $consulta = $this->conexion->prepare(\"select idUsuario,nombre,apellido1,apellido2,email,telefono,contrasena,foto FROM \".$this->table.\" WHERE email= :email \" );\r\n $consulta->execute(array('email'=>$email));\r\n $usuario= $consulta->fetchAll();\r\n $this->conexion=null;\r\n return $usuario;\r\n }",
"public function getStaffByEmail($email) {\n $this->select->reset();\n $this->select->from($this);\n $this->select->where('email = ?', $email);\n return $this->fetchRow($this->select);\n }",
"public function _searchByEmail($email) { \n \n $url = \"https://crm.zoho.com/crm/private/json/Accounts/searchRecords\"; \n $params = 'authtoken='.$this->authToken.'&scope=crmapi&newFormat=2&criteria=(Correo electrónico:\"'.$email.'\")'; \n $response = json_decode($this->_curl($url, $params), true); \n if (isset($response['response']['result']['Accounts']['row']['FL'])){\n $data = $response['response']['result']['Accounts']['row']['FL'];\n $idGlobal = $this->_content($data, 'Account Number');\n $this->_zohoAccountToDB($data, $idGlobal); \n return $idGlobal;\n }else{\n $url = \"https://crm.zoho.com/crm/private/json/Contacts/searchRecords\"; \n $params = 'authtoken='.$this->authToken.'&scope=crmapi&newFormat=2&criteria=(Email:\"'.$email.'\")'; \n $response = json_decode($this->_curl($url, $params), true); \n\n if (isset($response['response']['result']['Contacts']['row']['FL'])){\n $data = $response['response']['result']['Contacts']['row']['FL'];\n $accountId = $this->_content($data, 'ACCOUNTID');\n\n $url = \"https://crm.zoho.com/crm/private/json/Accounts/getRecordById\"; \n $params = 'authtoken='.$this->authToken.'&scope=crmapi&newFormat=2&id='.$accountId; \n $response = json_decode($this->_curl($url, $params), true); \n\n if (isset($response['response']['result']['Accounts']['row']['FL'])){\n $data = $response['response']['result']['Accounts']['row']['FL']; \n $idGlobal = $this->_content($data, 'Account Number');\n $this->_zohoAccountToDB($data, $idGlobal); \n return $idGlobal; \n } \n } \n }\n return \"\";\n }",
"function getEmployeePrivateDataFromUser($employeeFirstname, $employeeLastname){\n $employeesData = $this->exportEmployeesPrivateData();\n foreach($employeesData as $employee){\n if(($employee['employeeFirstName'] == $employeeFirstname) && ($employee['employeeSurname'] == $employeeLastname)){\n return $employee;\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the [podtdesc2] column value. | public function getPodtdesc2()
{
return $this->podtdesc2;
} | [
"public function getDesc2()\n {\n return $this->desc2;\n }",
"public function getOedtdesc2()\n {\n return $this->oedtdesc2;\n }",
"public function getPodtdesc1()\n {\n return $this->podtdesc1;\n }",
"public function getOedhdesc2()\n {\n return $this->oedhdesc2;\n }",
"public function setPodtdesc2($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->podtdesc2 !== $v) {\n $this->podtdesc2 = $v;\n $this->modifiedColumns[EditPoDetailTableMap::COL_PODTDESC2] = true;\n }\n\n return $this;\n }",
"public function setPodtdesc2($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->podtdesc2 !== $v) {\n $this->podtdesc2 = $v;\n $this->modifiedColumns[PurchaseOrderDetailTableMap::COL_PODTDESC2] = true;\n }\n\n return $this;\n }",
"public function getIntbconfusedesc2()\n {\n return $this->intbconfusedesc2;\n }",
"public function getDescription2()\n {\n return $this->description2;\n }",
"public function getPanell2c2() {\n return $this->get(self::PANELL2C2);\n }",
"public function getHeading2() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (array_key_exists(9, $this->_result)) return (string) $this->_result[9];\n\t\t\telse parent::throwGetColException('Not set PagesModel::getHeading2', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('No result From PagesModel::getHeading2', __LINE__, __FILE__);\n\t}",
"public function getOehddiscpct2()\n {\n return $this->oehddiscpct2;\n }",
"public function getVal2()\r\n {\r\n return $this->val2;\r\n }",
"public function getProduct_desc () {\n\t$preValue = $this->preGetValue(\"product_desc\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"product_desc\")->preGetData($this);\n\treturn $data;\n}",
"public function setOedtdesc2($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->oedtdesc2 !== $v) {\n $this->oedtdesc2 = $v;\n $this->modifiedColumns[SoDetailTableMap::COL_OEDTDESC2] = true;\n }\n\n return $this;\n }",
"public function getDescription1()\n {\n return $this->description1;\n }",
"public function getDescription1Unwrapped()\n {\n return $this->readWrapperValue(\"description1\");\n }",
"public function getOedhacdisc2()\n {\n return $this->oedhacdisc2;\n }",
"public function getField2()\n {\n return $this->data['fields']['field2'];\n }",
"public function getHeading2() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (array_key_exists(6, $this->_result)) return (string) $this->_result[6];\n\t\t\telse parent::throwGetColException('Not set CampaignPagesModel::getHeading2', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('No result From CampaignPagesModel::getHeading2', __LINE__, __FILE__);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
renders a closing option group tag | public static function renderOptionGroupClose(){
self::out(
self::closeTag('optgroup')
);
} | [
"protected function endOptgroup()\n {\n $this->html .= $this->indent(1, \"</optgroup>\");\n $this->optlevel -= 1;\n }",
"public function end_el(&$output, $item, $depth){\n $output .= \"</option>\\n\";\n }",
"public function end_el(&$output, $item, $depth = 0, $args = array()){\n $output .= \"</option>\\n\";\n }",
"public function end_el(&$output, $item, $depth = 0, $args = array()) {\r\n\t\t$output .= \"</option>\\n\";\r\n\t}",
"function optgroup( $vContent = NULL, $aAttrs = array() )\n\t{\n\t\t$bHasEnd = TRUE;\n\t\treturn $this->_create_tag( __FUNCTION__, $aAttrs, $bHasEnd, $vContent );\n\t}",
"function option_group_tag($label, $options, $attributes = null) {\n if(is_array($attributes)) {\n $attributes['label'] = $label;\n } else {\n $attributes = array('label' => $label);\n } // if\n \n $output = open_html_tag('optgroup', $attributes) . \"\\n\";\n if(is_array($options)) {\n foreach($options as $option) {\n $output .= $option . \"\\n\";\n } // foreach\n } // if\n return $output . close_html_tag('optgroup') . \"\\n\";\n }",
"public function end_widget_options() {\n\t\t?>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}",
"public function close_group() {\n\t\t$this->group = null;\n\t\t$this->required = false;\n\t\t$this->disabled = false;\n\t\treturn \"</div>\\n\";\n\t}",
"function Coption(){\r\n \r\n print('</option>');\r\n \r\n }",
"public function optionGroup();",
"public function render_options_dropdown_optgroup($args = array())\n {\n printf(\n '<select id=\"%s\" name=\"woochimp_options[%s]\" class=\"woochimp-field\">',\n $args['name'],\n $args['name']\n );\n\n foreach ($this->options[$args['name']] as $optgroup) {\n\n printf(\n '<optgroup label=\"%s\">',\n $optgroup['title']\n );\n\n foreach ($optgroup['children'] as $value => $title) {\n\n printf(\n '<option value=\"%s\" %s %s>%s</option>',\n $value,\n selected($value, $args['options'][$args['name']], false),\n ($value === 0 ? 'disabled=\"disabled\"' : ''),\n $title\n );\n }\n\n echo '</optgroup>';\n }\n\n echo '</select>';\n }",
"public function selectEnd() {\r\n return '</select>';\r\n }",
"Protected Function renderOptionTags($options, $nestingLevel = 1) {\n\t\t$content = '';\n\t\tForEach ($options As $option) {\n\t\t\tIf ($option['_isRoot']) {\n\t\t\t\t$content .= '<optgroup label=\"' . htmlspecialchars($option['name']) . '\">' . chr(10);\n\t\t\t\t$content .= $this->renderOptionTags($option['_children'], $nestingLevel + 1);\n\t\t\t\t$content .= '</optgroup>';\n\t\t\t} Else {\n\t\t\t\t$isSelected = $this->isSelected($option['uid']);\n\t\t\t\t$indent = ($nestingLevel - 1) * 20;\n\t\t\t\t$style = 'padding-left: ' . $indent . 'px;';\n\t\t\t\t$content .= '<option style=\"' . $style . '\" value=\"' . $option['uid'] . '\" ' . ($isSelected ? 'selected=\"selected\"' : '') . '>' . htmlspecialchars($option['name']) . '</option>' . chr(10);\n\t\t\t\t$content .= $this->renderOptionTags($option['_children'], $nestingLevel + 1);\n\t\t\t}\n\t\t}\n\t\tReturn $content;\n\t}",
"protected function _radioGroupEnd()\n {\n return '</div>';\n }",
"public function testRenderOptionGroups(): void\n {\n $select = new SelectBoxWidget($this->templates);\n $data = [\n 'name' => 'Birds[name]',\n 'options' => [\n 'Mammal' => [\n 'beaver' => 'Beaver',\n 'elk' => 'Elk',\n ],\n 'Bird' => [\n 'budgie' => 'Budgie',\n 'eagle' => 'Eagle',\n ],\n ],\n ];\n $result = $select->render($data, $this->context);\n $expected = [\n 'select' => [\n 'name' => 'Birds[name]',\n ],\n ['optgroup' => ['label' => 'Mammal']],\n ['option' => ['value' => 'beaver']],\n 'Beaver',\n '/option',\n ['option' => ['value' => 'elk']],\n 'Elk',\n '/option',\n '/optgroup',\n ['optgroup' => ['label' => 'Bird']],\n ['option' => ['value' => 'budgie']],\n 'Budgie',\n '/option',\n ['option' => ['value' => 'eagle']],\n 'Eagle',\n '/option',\n '/optgroup',\n '/select',\n ];\n $this->assertHtml($expected, $result);\n }",
"private function SelectClose( $tag )\r\n\t{\r\n\t\t$this->appendHTML( \" </select>\" );\r\n\t\t$this->appendBreak( $tag );\r\n\t}",
"function balise_select_optgroup($datas)\n{\n\t$balise = '<select name=\"'.$datas['name'].'\" id=\"'.$datas['name'].'\" class=\"'.$datas['class'].'\" tabindex=\"'.$datas['tabindex'].'\">';\n\t$old_theme = \"\";\n\t$compteur = 0;\n\tfor($i=0; $i<count($datas['value']); $i++)\n\t{\n\t\t$new_theme = $datas['value'][$i]['theme'];\n\t\tif ($old_theme != $new_theme)\n\t\t{\n\t\t\tif ($compteur > 0)\n\t\t\t{\n\t\t\t\t$balise .= '</optgroup>';\n\t\t\t}\n\t\t\t$balise .= '<optgroup label=\"'.$new_theme.'\">';\n\t\t}\n\t\t$balise .= '<option value=\"'.$datas['value'][$i]['entite'].'\"';\n\t\tif ($datas['value'][$i]['entite'] == $datas['default'])\n\t\t{\n\t\t\t$balise .= ' selected=\"selected\" ';\n\t\t}\n\t\t$balise .= '>'.$datas['value'][$i]['nom'].'</option>';\n\t\t$compteur = 1;\n\t\t$old_theme = $new_theme;\n\t}\n\t$balise .= '</optgroup>';\n\t$balise .= '</select>';\n\treturn $balise;\n}",
"public function getOptionGroupDescription()\n {\n return '';\n }",
"function endGroup()\n {\n $this->_indent = substr($this->_indent, 0, -4);\n $this->_addElement('</g>');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Getter for deleted files. | public function getDeletedFiles(): Collection
{
return $this->files->filter(function (File $file) {
return $file->getStatus() === File::FILE_DELETED;
});
} | [
"public function _get_deleted() {\n\t\treturn $this->_deleted;\n\t}",
"public function get_deleted()\n {\n return $this->deleted;\n }",
"public function getDeleted()\n {\n return $this->deleted;\n }",
"public function getdeleted()\n {\n return $this->deleted;\n }",
"function get_deleted(){\n return $this->deleted;\n }",
"public function delete()\n {\n // delete the file (and previous versions of files)\n $filesToDelete = array();\n $storageFolder = $this->getStorageFolder();\n\n if (file_exists($storageFolder)) {\n if ($handle = opendir($storageFolder)) {\n while (false !== ($entry = readdir($handle))) {\n // only delete if filename starts the the relevant ID\n if (strpos($entry, $this->ID.'~') === 0) {\n $filesToDelete[] = $entry;\n }\n }\n\n closedir($handle);\n\n //delete all this files that have the id of this document\n foreach ($filesToDelete as $file) {\n $filePath = $storageFolder .DIRECTORY_SEPARATOR . $file;\n\n if (is_file($filePath)) {\n unlink($filePath);\n }\n }\n }\n }\n\n // get rid of any versions have saved for this DMSDocument, too\n if (DMSDocument_versions::$enable_versions) {\n $versions = $this->getVersions();\n\n if ($versions->Count() > 0) {\n foreach ($versions as $v) {\n $v->delete();\n }\n }\n }\n\n return parent::delete();\n }",
"public function getOldFiles();",
"public function getDeleted() {\n\t\t$v = $this->getField('deleted');\n\t\treturn $v === null ? null : (int) $v;\n\t}",
"public function getAllDeleted();",
"public function provideDelete()\n {\n return [\n 'file exists' => [\n 'exists' => true,\n 'filename' => implode(DIRECTORY_SEPARATOR, [ROOT, 'tests', '_file', '.test']),\n ],\n ];\n }",
"public function getFiles()\n {\n \treturn $this->addedFiles;\n }",
"final public function getDeletedCount() {}",
"public function getDeletedOids() {\n \treturn $this->deletedOids;\n }",
"public static function files()\n {\n return Files::_get();\n }",
"public function getDelete()\r\n {\r\n return $this->delete;\r\n }",
"abstract protected function getFilesToDelete(AbstractAdapter $source);",
"public function getDeletedAttribute();",
"public function getDelete()\n {\n return $this->delete;\n }",
"function getFiles(){\n\t\treturn $this->used_files;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get country by ip | function get_country_by_ip($user_ip='')
{
if ($user_ip)
{ // Запрос на получение страны по IP
$url = "http://ip-to-country.webhosting.info/node/view/36";
$ch = @curl_init();
curl_setopt($ch, CURLOPT_URL,$url); // set url to post to
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable
curl_setopt($ch, CURLOPT_TIMEOUT, 3); // times out after 4s
curl_setopt($ch, CURLOPT_POST, 1); // set POST method
curl_setopt($ch, CURLOPT_POSTFIELDS, "ip_address=$user_ip&submit=Find+Country"); // add POST fields
$result = curl_exec($ch); // run the whole process
curl_close($ch);
preg_match("/IP Address(.*?)belongs to(.*?)\./i", $result, $matches);
if (strlen($matches[2])>0)
{
$matches[2]=strip_tags($matches[2]);
if (!ereg('Dont', $matches[2])) $country=$matches[2]; else $country="Unknown";
} else $country="Unknown";
return trim($country);
}
else return;
} | [
"public function getCountryForIp(string $ip) : IpInfo;",
"function skyGetCountry($ip=''){\n\tglobal $getCountryByIpClass;\n\tif(!$ip)\n\t\t$ip=$_SERVER['REMOTE_ADDR'];\n\t$getCountryByIpClass->set_ip($ip);\n\t$getCountryByIpClass->dist_ip();\n\t$getCountryByIpClass->count_ip();\n\t$info = $getCountryByIpClass->search_country();\n\treturn $info['2letters_country'];\n}",
"public static function getCountryByIp($ip) {\n $url = 'http://api.hostip.info/?ip=' . $ip;\n $xml = file_get_contents($url);\n $doc = new DOMDocument();\n $doc->loadXML($xml);\n $countryName = $doc->getElementsByTagName(\"countryName\")->item(0)->nodeValue;\n return $countryName;\n }",
"function get_countryname_by_ip($ip = false)\n{\n $data = get_geo_location_by_ip($ip);\n if(avail($data, 'countryName'))\n return $data->countryName;\n return false;\n}",
"function getCountryFromIp() {\n\n\n //error_log(\"getting country for your IP\");\n\n \n\n $ch = curl_init('http://geoip.nekudo.com/api/' . $_SERVER['REMOTE_ADDR']);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n\n $geoip = json_decode($result);\n \n if ($geoip) {\n $countryCode = $geoip->country->code;\n return $countryCode;\n\n \n }\n else {\n // No results returned from the API\n // return country US\n //error_log(\"no results from API, call getCountyFromURL\");\n \n return \"US\";\n }\n}",
"protected function getUserCountry(){\n\t\t$ip = $this->getUserIP();\n\t\t$json = file_get_contents(\"http://ipinfo.io/\".$ip);\n \t$details = json_decode($json);\n \t$country = $details->country;\n \treturn $country;\n\t}",
"private function fetch_country_code($ip) {\n\t\t$content = @file_get_contents(\"http://freegeoip.net/json/\" + $ip);\n\n\t\tif ($content === FALSE) {\n\t\t\t// Looks like we had a problem with the API.\n\t\t\treturn \"ERROR\";\n\t\t} else {\n\t\t\t$json = json_decode($content, TRUE);\n\t\t\treturn $json[\"country_code\"];\n\t\t}\n\t}",
"public static function getCountryFromWebservice ($ip = ''){\r\n\t\treturn (self::getWebservice($ip, self::WEBSERVICE_COUNTRY, self::WEBSERVICE_BACKUP_COUNTRY));\r\n\t}",
"function getCountryByIP($ip) {\n if (isset($ip) && $ip != '') {\n if (extension_loaded('geoip')) {\n if (geoip_db_avail(GEOIP_COUNTRY_EDITION)) {\n return @geoip_country_code_by_name($ip);\n }\n } else {\n if (include_once(PAPAYA_INCLUDE_PATH.'external/geoip/geoip.inc')) {\n $gi = geoip_open(PAPAYA_INCLUDE_PATH.'external/geoip/geoip.dat', GEOIP_STANDARD);\n $country = geoip_country_code_by_addr($gi, $ip);\n geoip_close($gi);\n return $country;\n }\n }\n }\n return FALSE;\n }",
"function Ip2Country($ip)\r\n{\r\n\tglobal $GEOIP_COUNTRY_NAMES;\r\n\tglobal $GEOIP_COUNTRY_CODES;\r\n\t$country = array();\r\n\t$country[0] = 'unknown';\r\n\t$country[1] = 'Unknown';\r\n\t$gi = geoip_open(\"../classes/admin/geoIp/GeoIP.dat\",GEOIP_STANDARD);\r\n\t$country_code = geoip_country_code_by_addr($gi, $ip);\r\n\tgeoip_close($gi);\r\n\tif($country_code)\r\n\t{\r\n\t\t$country_index = array_search($country_code, $GEOIP_COUNTRY_CODES);\r\n\t\t$country[0] = strtolower($country_code);\r\n\t\t$country[1] = $GEOIP_COUNTRY_NAMES[$country_index];\r\n\t}\r\n\treturn $country;\r\n}",
"public static function CLbyIP() {\n $ip = getSQL('SELECT i.country, c.name FROM ip2nation4 AS i, country_codes AS c WHERE INET_ATON(\"'.$_SERVER['REMOTE_ADDR'].'\") BETWEEN ip_from AND ip_to AND i.country = c.code2 LIMIT 1');\n $cntry = \"\";\n if (isset($ip[0]) && count($ip[0]) > 0) {\n $_SESSION['nation'] = $ip[0]['country'];\n \n $cntry = strtolower($ip[0]['country']);\n self::$countryIP = $ip[0]['name'];\n \n switch ($cntry) {\n case strpos('de,at', $cntry):\n $result = array('country' => 'de', 'lang' => 'de');\n break; \n case 'nl':\n $result = array('country' => 'nl', 'lang' => 'nl');\n break;\n case 'be':\n $result = array('country' => 'be', 'lang' => 'nl');\n break;\n case 'fr':\n $result = array('country' => 'be', 'lang' => 'fr');\n break;\n case strpos('ar,bo,cl,do,ec,gt,hn,co,cr,cu,mx,ni,pa,py,pe,sv,uy,ve', $cntry):\n $result = array('country' => 'mx', 'lang' => 'es');\n break;\n case 'es':\n $result = array('country' => 'es', 'lang' => 'es');\n break;\n case strpos('ag,bs,bb,bz,br,dm,gd,gy,ht,jm,sr,lc,kn,vc,tt,us', $cntry):\n $result = array('country' => 'us', 'lang' => 'ae');\n break;\n case 'ca':\n $result = array('country' => 'ca', 'lang' => 'ae');\n break;\n case strpos('au,nz,nf,fj,nc,pg,sb,vu,ck,pf,nu,ws,tk,to,tv', $cntry):\n $result = array('country' => 'au', 'lang' => 'en');\n break;\n case strpos('ao,bw,ls,mg,mw,mz,na,sz,zm,zw,za', $cntry):\n $result = array('country' => 'za', 'lang' => 'en');\n break;\n case strpos('cz,sk', $cntry):\n $result = array('country' => 'cz', 'lang' => 'cs');\n break;\n case 'tr':\n $result = array('country' => 'tr', 'lang' => 'tr');\n break;\n case strpos('cn,my,jp,ph,tw,hk,sg,bn,tl,la,mm,th,vn,cx,cc', $cntry):\n $result = array('country' => 'sg', 'lang' => 'en');\n break;\n case 'cn':\n $result = array('country' => 'cn', 'lang' => 'cn');\n break;\n case 'ie':\n $result = array('country' => 'ie', 'lang' => 'en');\n break; \n case 'it':\n $result = array('country' => 'it', 'lang' => 'it');\n break; \n default:\n $result = array('country' => 'gb', 'lang' => 'en');\n break;\n }\n } else {\n $result = array('country' => 'gb', 'lang' => 'en');\n }\n return $result;\n }",
"private function getCountryIdByIp()\n {\n try {\n $countryId = $this->geoIpAdapter->getCountryCode($this->request->getClientIp());\n } catch (\\Exception $e) {\n $countryId = null;\n }\n return $countryId;\n }",
"function get_countryname_by_ip()\n{\n//\t// maxmind installed as server module?\n//\tif(isset($_SERVER[\"GEOIP_COUNTRY_CODE\"]))\n//\t\treturn $_SERVER[\"GEOIP_COUNTRY_CODE\"];\n\tif( function_exists('geoip_open') )\n\t{\n\t\t$gi = geoip_open($GLOBALS['CONFIG']['geoip']['city_dat_file'],GEOIP_STANDARD);\n\t\t$country_name = geoip_country_name_by_name($gi,Wdf::$ClientIP);\n\t\tgeoip_close($gi);\n\t}\n\telse\n\t\t$country_name = geoip_country_name_by_name(Wdf::$ClientIP);\n\n\treturn $country_name;\n}",
"function ip_visitor_country()\n{\n\n $client = @$_SERVER['HTTP_CLIENT_IP'];\n $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];\n $remote = $_SERVER['REMOTE_ADDR'];\n $country = \"Unknown\";\n\n if(filter_var($client, FILTER_VALIDATE_IP))\n {\n $ip = $client;\n }\n elseif(filter_var($forward, FILTER_VALIDATE_IP))\n {\n $ip = $forward;\n }\n else\n {\n $ip = $remote;\n }\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, \"http://www.geoplugin.net/json.gp?ip=\".$ip);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n $ip_data_in = curl_exec($ch); // string\n curl_close($ch);\n\n $ip_data = json_decode($ip_data_in,true);\n $ip_data = str_replace('"', '\"', $ip_data); // for PHP 5.2 see stackoverflow.com/questions/3110487/\n\n if($ip_data && $ip_data['geoplugin_countryName'] != null) {\n $country = $ip_data['geoplugin_countryName'];\n }\n\n return $country;\n}",
"private static function IpToLocator($ip) {\n $reader = new Reader('/usr/local/share/GeoIP/GeoLite2-Country.mmdb');\n\n // Get the record of the corrsponding ip\n // The country can still be unknown e.g. if the $ip is a link local ipv6\n // address, so if the $record throws a 'GeoIp2\\Exception\\AddressNotFoundException'\n // Set the country to Unknown.\n try {\n $record = $reader->country($ip);\n $country = $record->country->name;\n\n // Country does exists, so now find the city\n $city = self::IpToCity($ip);\n\n // City can be empty, we rather return Unknown\n if ($city == '') {\n $city = \"Unknown\";\n }\n\n // Only in this case we can return a country and city\n return $country.\".\".$city;\n } catch (GeoIp2\\Exception\\AddressNotFoundException $e) {\n // No country found, hence city makes no sense either\n return $country = \"Unknown\";\n }\n }",
"function countryCityFromIP($ipAddr)\n\t{\n\t //Developed by Roshan Bhattarai \n\t //Visit http://roshanbh.com.np for this script and more.\n\t \n\t //verify the IP address for the \n\t ip2long($ipAddr)== -1 || ip2long($ipAddr) === false ? trigger_error(\"Invalid IP\", E_USER_ERROR) : \"\";\n\t // This notice MUST stay intact for legal use\n\t $ipDetail=array(); //initialize a blank array\n\t //get the XML result from hostip.info\n\t $xml = file_get_contents(\"http://api.hostip.info/?ip=\".$ipAddr);\n\t //get the city name inside the node <gml:name> and </gml:name>\n\t preg_match(\"@<Hostip>(\\s)*<gml:name>(.*?)</gml:name>@si\",$xml,$match);\n\t //assing the city name to the array\n\t $ipDetail['city']=$match[2]; \n\t $lokasi = $ipDetail['city'];\n\t //get the country name inside the node <countryName> and </countryName>\n\t preg_match(\"@<countryName>(.*?)</countryName>@si\",$xml,$matches);\n\t //assign the country name to the $ipDetail array \n\t $ipDetail['country']=$matches[1];\n\t //get the country name inside the node <countryName> and </countryName>\n\t preg_match(\"@<countryAbbrev>(.*?)</countryAbbrev>@si\",$xml,$cc_match);\n\t $ipDetail['country_code']=$cc_match[1]; //assing the country code to array\n\t //return the array containing city, country and country code\n\t return $lokasi;\n\t}",
"public function getCity(string $ip);",
"public function getCountryName($ip=null) {\r\r\n\t\tif (!$this->database)\r\r\n\t\t\treturn geoip_country_name_by_name($this->currentIp($ip));\r\r\n\t\treturn geoip_country_name_by_addr($this->database, $this->currentIp($ip));\r\r\n\t}",
"function get_ip_country($domain,$proxy='')\n\t{\n\n\t\t$domain=str_replace(\"www.\",\"\",$domain);\n\t\t$domain=str_replace(\"http://\",\"\",$domain);\n\t\t$domain=str_replace(\"https://\",\"\",$domain);\n\t\t$domain=str_replace(\"/\",\"\",$domain);\n\t\t$domain=strtolower($domain);\n\t\t$domain_ip\t= gethostbyname($domain);\n\t\t$response=$this->ip_information($domain_ip);\n\n\t\treturn $response;\n\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests the setCpteCollectifFrn() method. | public function testSetCpteCollectifFrn() {
$obj = new Constantes();
$obj->setCpteCollectifFrn("cpteCollectifFrn");
$this->assertEquals("cpteCollectifFrn", $obj->getCpteCollectifFrn());
} | [
"public function testSetCollectif() {\n\n $obj = new Clients();\n\n $obj->setCollectif(\"collectif\");\n $this->assertEquals(\"collectif\", $obj->getCollectif());\n }",
"public function testSetNumCptCollectif() {\n\n $obj = new Clients();\n\n $obj->setNumCptCollectif(\"numCptCollectif\");\n $this->assertEquals(\"numCptCollectif\", $obj->getNumCptCollectif());\n }",
"public function testSetCollectifClientFin() {\n\n $obj = new Dossier2();\n\n $obj->setCollectifClientFin(\"collectifClientFin\");\n $this->assertEquals(\"collectifClientFin\", $obj->getCollectifClientFin());\n }",
"public function testSetChampsCritereAffaire6() {\n\n $obj = new Constantes();\n\n $obj->setChampsCritereAffaire6(\"champsCritereAffaire6\");\n $this->assertEquals(\"champsCritereAffaire6\", $obj->getChampsCritereAffaire6());\n }",
"public function testSetChampsCritereAffaire7() {\n\n $obj = new Constantes();\n\n $obj->setChampsCritereAffaire7(\"champsCritereAffaire7\");\n $this->assertEquals(\"champsCritereAffaire7\", $obj->getChampsCritereAffaire7());\n }",
"public function testSetVisualisationFicheCabinet() {\n\n $obj = new Collaborateurs();\n\n $obj->setVisualisationFicheCabinet(true);\n $this->assertEquals(true, $obj->getVisualisationFicheCabinet());\n }",
"public function testSetFichierLicence() {\n\n $obj = new Produits();\n\n $obj->setFichierLicence(\"fichierLicence\");\n $this->assertEquals(\"fichierLicence\", $obj->getFichierLicence());\n }",
"public function testSetPjMailCLiDucsEdi() {\n\n $obj = new ConstantesEntreprise();\n\n $obj->setPjMailCLiDucsEdi(true);\n $this->assertEquals(true, $obj->getPjMailCLiDucsEdi());\n }",
"public function testSetCodeAffaire() {\n\n $obj = new CriteresChantier();\n\n $obj->setCodeAffaire(\"codeAffaire\");\n $this->assertEquals(\"codeAffaire\", $obj->getCodeAffaire());\n }",
"public function testSetCicePjMailCliDucsEdi() {\n\n $obj = new ConstantesEntreprise();\n\n $obj->setCicePjMailCliDucsEdi(true);\n $this->assertEquals(true, $obj->getCicePjMailCliDucsEdi());\n }",
"public function testSetCodeAffaire() {\n\n $obj = new FichesControlesEntetes();\n\n $obj->setCodeAffaire(\"codeAffaire\");\n $this->assertEquals(\"codeAffaire\", $obj->getCodeAffaire());\n }",
"public function setCompteCollectifVente(?string $compteCollectifVente): Constantes {\n $this->compteCollectifVente = $compteCollectifVente;\n return $this;\n }",
"public function testSetActivationLstRestriFrn() {\n\n $obj = new Confidentialite();\n\n $obj->setActivationLstRestriFrn(10);\n $this->assertEquals(10, $obj->getActivationLstRestriFrn());\n }",
"public function testSetTexteF() {\n\n $obj = new CriteresLibres();\n\n $obj->setTexteF(\"texteF\");\n $this->assertEquals(\"texteF\", $obj->getTexteF());\n }",
"public function setCollectifComptable($collectifComptable) {\n $this->collectifComptable = $collectifComptable;\n return $this;\n }",
"public function testSetFctInterrogationCpt() {\n\n $obj = new iComptaDroits();\n\n $obj->setFctInterrogationCpt(true);\n $this->assertEquals(true, $obj->getFctInterrogationCpt());\n }",
"public function testSetRffCptRegul() {\n\n $obj = new Dossier2();\n\n $obj->setRffCptRegul(\"rffCptRegul\");\n $this->assertEquals(\"rffCptRegul\", $obj->getRffCptRegul());\n }",
"public function testSetAfficher() {\n\n $obj = new RegroupementEdBulEntete();\n\n $obj->setAfficher(true);\n $this->assertEquals(true, $obj->getAfficher());\n }",
"public function testSetCivilite() {\n\n $obj = new DevisCommercialEntetes();\n\n $obj->setCivilite(\"civilite\");\n $this->assertEquals(\"civilite\", $obj->getCivilite());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the list of KYC documents for the contractor record. | public function kycDocuments()
{
return $this->hasMany(KycDocument::class);
} | [
"public function documents()\n {\n return $this->hasMany(KycDocuments::class, 'kyc_verification_id');\n }",
"function getdocuments($ClientID){\n $table = TableRegistry::get(\"documents\");\n return $table->find('all', array('conditions' => array('client_id'=>$ClientID)));\n }",
"public function getDocuments();",
"public function get_document_list() {\n $returnArr['status'] = '0';\n $returnArr['response'] = '';\n try {\n\t\t\t$documentsArr = array();\n\t\t\t$getDocuments = $this->app_model->get_all_details(DOCUMENTS,array('status' =>\"Active\"));\n\t\t\tif($getDocuments->num_rows()>0){\n\t\t\t\tforeach($getDocuments->result() as $doc){\n\t\t\t\t\t$documentsArr[] = array(\"id\"=>(string)$doc->_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\"=>(string)$doc->name,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"category\"=>(string)$doc->category,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"is_req\"=>(string)$doc->hasReq,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"is_exp\"=>(string)$doc->hasExp\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$returnArr['status'] = '1';\n\t\t\t$returnArr['response'] = array(\"documents\"=>$documentsArr);\n } catch (MongoException $ex) {\n $returnArr['response'] = $this->format_string(\"Error in connection\", \"error_in_connection\");\n }\n $json_encode = json_encode($returnArr, JSON_PRETTY_PRINT);\n echo $this->cleanString($json_encode);\n }",
"function get_documents($cust_id){\n global $connection;\n $query = \"SELECT id FROM documents WHERE FK_cust_id = $cust_id\";\n $result = mysqli_query($connection, $query);\n confirmQResult($result);\n $list = array();\n while($row = mysqli_fetch_assoc($result)){\n $doc_id = $row['id'];\n $doc = get_document($doc_id);\n array_push($list, $doc);\n }\n return $list;\n }",
"public function get_document_list()\n {\n $query = $this->db->get('document');\n return $query->result_array();\n }",
"public function get_docs() {\n\n\t\tif ( file_exists( $this->settings['cache_file'] ) ) {\n\t\t\t$docs = json_decode( file_get_contents( $this->settings['cache_file'] ), true );\n\t\t}\n\n\t\tclearstatcache();\n\n\t\tif (\n\t\t\tempty( $docs ) ||\n\t\t\t(int) filemtime( $this->settings['cache_file'] ) + $this->settings['cache_ttl'] > time()\n\t\t) {\n\t\t\t// This code should execute once when the method called the first time,\n\t\t\t// Next update_docs() should be executed by schedule.\n\t\t\t$docs = $this->update_docs();\n\t\t}\n\n\t\t// Store in class private variable for further use.\n\t\t$this->docs = ! empty( $docs ) ? $docs : [];\n\n\t\treturn $this->docs;\n\t}",
"public function getDocuments() {\n\t\t$user = $this->auth->user();\n\n\t\tif(!$user) {\n\t\t\treturn CustomResponsesHandler::response([\n\t\t\t\t\"code\" => 401,\n\t\t\t\t\"message\" => \"Permisos denegados para el cliente\",\n\t\t\t\t\"response\" => null\n\t\t\t]);\n\t\t} else {\n\t\t\t$documents = Documents::where('id_user', $user->id)->where('status', '1')->get(['id', 'folio', 'location', 'type', 'alias', 'notes', 'subtype', 'picture_path', 'expedition', 'expiration', 'created_at']);\n\n\t\t\tif($documents->count()) {\n\t\t\t\treturn CustomResponsesHandler::response([\n\t\t\t\t\t\"code\" => 200,\n\t\t\t\t\t\"message\" => \"Listado de documentos\",\n\t\t\t\t\t\"response\" => array(\"documents\" => $documents)\n\t\t\t\t]);\n\t\t\t} else {\n\t\t\t\treturn CustomResponsesHandler::response([\n\t\t\t\t\t\"code\" => 202,\n\t\t\t\t\t\"message\" => \"No se encontraron documentos\",\n\t\t\t\t\t\"response\" => null\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\t}",
"public function getDocuments()\n {\n return Controllers\\Documents::getInstance();\n }",
"public function getDocuments()\n {\n # GET /accounts/{accountId}/envelopes/{envelopeId}/documents\n }",
"function get_contract_documents()\n {\n $this->load_relationship('contracts_documents');\n $query_array = $this->contracts_documents->getQuery(array('return_as_array' => true));\n $query = <<<KGB\n SELECT documents.*,\n\t\t\t\tdocuments.document_revision_id AS latest_revision_id,\n\t\t\t\tfor_latest_revision.revision AS latest_revision_name,\n\t\t\t\tfor_selected_revision.revision AS selected_revision_name,\n\t\t\t\tlinked_documents.document_revision_id AS selected_revision_id,\n\t\t\t\tcontracts.status AS contract_status,\n\t\t\t\tfor_selected_revision.filename AS selected_revision_filename,\n\t\t\t\tlinked_documents.id AS linked_id,\n\t\t\t\tcontracts.name AS contract_name\n\nKGB;\n\n $query .= $query_array['from'];\n $query .= <<<CIA\n\t\t\tLEFT JOIN documents ON documents.id = linked_documents.document_id\n\t\t\tLEFT JOIN document_revisions for_latest_revision\n\t\t\t\tON for_latest_revision.id = documents.document_revision_id\n\t\t\tINNER JOIN contracts \n\t\t\t\tON contracts.id = linked_documents.parent_id\n\t\t\tLEFT JOIN document_revisions for_selected_revision \n\t\t\t\tON for_selected_revision.id = linked_documents.document_revision_id\n\nCIA;\n $query .= $query_array['where'];\n return $query;\n }",
"public function getDocumentList()\n {\n $allComments = $this->getList(null, null);\n $documents = array();\n foreach ($allComments as $key => $comment) {\n if (empty($documents[$comment['document_id']])) {\n $document = DocumentModel::fromId($comment['document_id']);\n $documents[$document->getId()] = $document;\n }\n }\n\n return $documents;\n }",
"public function kycDocument()\n {\n return $this->hasMany(KycDocument::class, 'user_id');\n }",
"public function getDocuments()\n {\n return $this->documents;\n }",
"public function allDocs()\n {\n $docs = Doc::where(['owner_id' => Auth::id()])->orderBy('updated_at', 'desc')->get();\n return (new SuccessResponse($docs))->send();\n }",
"public function getCompanyDocuments()\n {\n return $this->hasMany(CompanyDocument::className(), ['company_id' => 'id']);\n }",
"public function getDocs()\n {\n return $this->docs;\n }",
"public function documents()\n {\n $data['employee'] = $this->employee->load('documents');\n\n return view('employee.documents', $data);\n }",
"public function getDocsRetrieved()\n {\n return $this->get(self::DOCS_RETRIEVED);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sanitize the value by replacing special chars with their html unicode equivalent | protected function sanitizeHtmlencode($value)
{
return filter_var($value, FILTER_SANITIZE_SPECIAL_CHARS);
} | [
"function replace_special_characters($value)\n {\n // Detecta a codificação da string.\n $originalEncode = mb_detect_encoding($value);\n\n // Resgata os caracteres que serão substituídos.\n $toSearch = config('constant.specialCharacter.search');\n $toReplace = config('constant.specialCharacter.replace');\n\n // Converte a codificação para ISO-8859-1.\n $toSearch = mb_convert_encoding($toSearch, \"ISO-8859-1\");\n $toReplace = mb_convert_encoding($toReplace, \"ISO-8859-1\");\n $value = mb_convert_encoding($value, \"ISO-8859-1\");\n\n // Substitui os caracteres.\n $value = strtr($value, $toSearch, $toReplace);\n\n // Converte a codificação da string para o formato original.\n $value = mb_convert_encoding($value, $originalEncode);\n\n return $value;\n }",
"private function sspecialchars($value)\n {\n return filter_var($value, FILTER_SANITIZE_SPECIAL_CHARS);\n }",
"function unsanitizeText($text) { \n\t\t$text = stripcslashes($text); \n\t\t$text = str_replace(\"'\", \"'\", $text); \n\t\t$text = str_replace(\">\", \">\", $text); \n\t\t$text = str_replace(\""\", \"\\\"\", $text); \n\t\t$text = str_replace(\"<\", \"<\", $text); \n return $text; \n}",
"private function decode_special_characters( $value ) {\n\t\treturn (string) htmlspecialchars_decode( $value, ENT_QUOTES );\n\t}",
"function xss_clean(string $xss_string) {\n //Convert all characters to HTML entities\n return htmlentities($xss_string, ENT_QUOTES | ENT_IGNORE);\n}",
"function remove_special_chars($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }",
"function sanitiseString($dirty){\n $dirty = filter_var($dirty, FILTER_SANITIZE_FULL_SPECIAL_CHARS);\n $clean = filter_var($dirty, FILTER_SANITIZE_STRING);\n return $clean;\n }",
"function sanitize_html_string($string)\n{\n $pattern[0] = '/\\&/';\n $pattern[1] = '/</';\n $pattern[2] = \"/>/\";\n $pattern[3] = '/\\n/';\n $pattern[4] = '/\"/';\n $pattern[5] = \"/'/\";\n $pattern[6] = \"/%/\";\n $pattern[7] = '/\\(/';\n $pattern[8] = '/\\)/';\n $pattern[9] = '/\\+/';\n $pattern[10] = '/-/';\n $replacement[0] = '&';\n $replacement[1] = '<';\n $replacement[2] = '>';\n $replacement[3] = '<br>';\n $replacement[4] = '"';\n $replacement[5] = ''';\n $replacement[6] = '%';\n $replacement[7] = '(';\n $replacement[8] = ')';\n $replacement[9] = '+';\n $replacement[10] = '-';\n return preg_replace($pattern, $replacement, $string);\n}",
"private function sanitize() {}",
"function scrub_out($string) {\n\n return htmlentities($string, ENT_QUOTES, Config::get('site_charset'));\n\n}",
"function reverse_sanitize($str){\n\t\t return htmlspecialchars_decode($str);\n\t\t}",
"protected function encodeSpecials() : string\n {\n $value = $this->getValue();\n $regex = '(\\'|\"|\\\\x00|\\\\\\\\(?![\\\\\\\\NGETHLnlr]))';\n\n return (string) preg_replace($regex, '\\\\\\\\$0', $value);\n }",
"protected function normalizeStringValueForHtml($value)\r\n\t\t{\r\n\t\t\treturn htmlentities(utf8_decode(utf8_decode($value)));\r\n\t\t}",
"function skyre_sanitize_nohtml($input) {\n return wp_filter_nohtml_kses($input);\n}",
"function sanitize_alpha ( $mValue )\n{\n return preg_replace('/[^\\w\\x80-\\xff]/', '', $mValue);\n}",
"function sanitizeForHTTP($value)\n{\n\treturn str_replace(array(\"\\r\", \"\\n\", \"%0a\", \"%0d\", \"%0A\", \"%0D\"), \"\", $value);\n}",
"function makeMODxSafe($value) {\n\t\t$value = (strpos($value,\"<\") !== FALSE) ? \"<pre>\".htmlentities($value).\"</pre>\" : $value;\n\t\t$value = str_replace(\"[\",\"[\",$value);\n\t\t$value = str_replace(\"]\",\"]\",$value);\n\t\t$value = str_replace(\"{\",\"{\",$value);\n\t\t$value = str_replace(\"}\",\"}\",$value);\n\t\treturn $value;\n\t}",
"function ldapspecialchars($string) {\r\n $sanitized=array('\\\\' => '\\5c',\r\n '*' => '\\2a',\r\n '(' => '\\28',\r\n ')' => '\\29',\r\n \"\\x00\" => '\\00');\r\n\r\n return str_replace(array_keys($sanitized),array_values($sanitized),$string);\r\n}",
"private function contraXSS($unsafe) {\r\n return htmlspecialchars($unsafe);\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
End of preview. Expand
in Dataset Viewer.
README.md exists but content is empty.
Use the Edit dataset card button to edit it.
- Downloads last month
- 7