query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
end convertAlterQuery() Converts ALTER TABLE ADD COLUMN statement to its SQL form. Throws DALConverterException if no columns found. | protected function convertAlterQueryAddColumn(array $addColumn)
{
$sql = 'ADD (';
if (isset($addColumn['COLUMNS']) === TRUE) {
$cols = array();
foreach ($addColumn['COLUMNS'] as $column) {
$cols[] = $this->convertSingleCreateColumn($column);
}
$sql .= implode(', ', $cols);
} else {
$msg = 'Cannot convert ALTER TABLE ADD COLUMN without columns.';
throw new DALConverterException($msg);
}
$sql .= ')';
return $sql;
} | [
"public function verifyAlterTableAddColumnSql()\n {\n $id = new Integer('id', ['size' => Size::big(), 'autoIncrement' => true]);\n $name = new Text('name', ['size' => Size::small()]);\n $username = new Varchar('username', '255');\n\n $expected = \"ALTER TABLE users ADD (\";\n $expected .= \"username VARCHAR(255) NOT NULL\";\n $end = \")\";\n\n $ddl = new AlterTable('users');\n $ddl->setAdapter($this->_adapter);\n $ddl->addColumn($username);\n $this->assertEquals($expected.$end, $ddl->getQueryString());\n\n $expected .= ', ';\n $expected .= \"name VARCHAR(255) NOT NULL\";\n $ddl->addColumn($name);\n $this->assertEquals($expected.$end, $ddl->getQueryString());\n }",
"public function addColumn() {\n\t\t\tif ($this->strQueryType == self::SELECT_QUERY) {\n\t\t\t\t$strColumnMethod = 'addSelectColumn';\n\t\t\t} else {\n\t\t\t\t$strColumnMethod = 'addAlterColumn';\n\t\t\t}\n\t\t\t\n\t\t\t$arrFunctionArgs = func_get_args();\n\t\t\tcall_user_func_array(array($this, $strColumnMethod), $arrFunctionArgs);\n\t\t}",
"public function testAlterTableAddColumn()\n {\n $fromSchema = new Schema();\n $fromSchema->createTable('tl_foobar')->addColumn('foo', 'string');\n\n $toSchema = new Schema();\n $toSchema->createTable('tl_foobar')->addColumn('foo', 'string');\n $toSchema->getTable('tl_foobar')->addColumn('bar', 'string');\n\n $installer = $this->createInstaller($fromSchema, $toSchema);\n $commands = $installer->getCommands();\n\n $this->assertArrayHasKey('ALTER_ADD', $commands);\n\n $commands = array_values($commands['ALTER_ADD']);\n\n $this->assertEquals('ALTER TABLE tl_foobar ADD bar VARCHAR(255) NOT NULL', $commands[0]);\n }",
"function gen_add_column( $add )\n\t{\n\t\t$s = $this->gen_column( $add );\n\t\t$s = \"ALTER TABLE \" . $add['table'] . \" ADD COLUMN \" . $s;\n\t\tif( $this->DBO ) {\n\t\t\t$this->DBO->query( $s );\n\t\t}\n\t\treturn $s;\n\t}",
"public function createColumns()\n {\n foreach ($this->getSchema() as $column => $type) {\n $tableColumns = $this->db->schema->getTableSchema($this->getTableName(), true);\n if (!$tableColumns->getColumn($column)) {\n $this->db->createCommand()->addColumn($this->getTableName(), $column, $type)->execute();\n }\n }\n }",
"private function compileAlterTable() {\n\t\t$query = array('ALTER TABLE', Grammar::compileName($this->schema->prefix($this->table)));\n\t\t$specifications = array();\n\n\t\t// Add commands\n\t\tforeach ($this->commands as $command) {\n\t\t\t$specifications[] = (string)$command;\n\t\t}\n\n\t\t// Add columns\n\t\tforeach ($this->columns as $column) {\n\t\t\t$specifications[] = (string)$column;\n\t\t}\n\n\t\t// Delimit the specifications by commas\n\t\t$query[] = implode(', ', $specifications);\n\n\t\treturn str_join($query);\n\t}",
"function add_columns($table, $columns, $con) {\n\tforeach ($columns as $column) {\n\t\t$sql = \"ALTER TABLE \".$table.\" ADD \".$column;\n\t\techo $sql.\"\\n\";\n\t\tmysqli_query($con, $sql);\n\t}\n}",
"function add_column($table,$column=null,$type=\"string\",$opt=array()) {\n global $config;\n if ($column!==null)\n t_column($column,$type,$opt);\n $columns=$config['fields'];\n foreach($columns as $column=>$options) {\n execute('ALTER TABLE '._wrap($table).' ADD '. $config['fields'][$column]);\n unset($config['fields'][$column]);\n }\n}",
"public function prepareAlter() {\n\t\t$q = 'ALTER TABLE ' . $this->quote_db ( $this->_table_prefix . $this->create_table ) . ' ';\n\t\tif (isset ( $this->create_definition )) {\n\t\t\tif (is_array ( $this->create_definition )) {\n\t\t\t\t$first = true;\n\t\t\t\tforeach ( $this->create_definition as $def ) {\n\t\t\t\t\tif ($first) {\n\t\t\t\t\t\t$first = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$q .= ', ';\n\t\t\t\t\t}\n\t\t\t\t\t$q .= $def ['action'] . ' ' . $def ['type'] . ' ' . $def ['spec'];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$q .= 'ADD ' . $this->create_definition;\n\t\t\t}\n\t\t}\n\t\treturn $q;\n\t}",
"function buildAlter()\n {\n if ($this->m_table!=\"\")\n {\n $fields = $this->buildFields();\n\n if ($fields!=\"\" || $this->m_remove_field)\n {\n $q = \"ALTER TABLE \".$this->m_db->quoteIdentifier($this->m_table);\n\n if ($this->m_remove_field)\n {\n $q.=\" DROP\\n \".$this->m_db->quoteIdentifier($this->m_remove_field);\n }\n else\n {\n $q.=\" ADD\\n (\";\n\n\n $q.= $fields;\n\n $constraints = $this->buildConstraints();\n\n if ($constraints!=\"\")\n {\n $q.= \",\\n\".$constraints;\n }\n\n $q.= \")\";\n }\n return array($q);\n }\n }\n return \"\";\n }",
"public function buildAlter()\n {\n if ($this->m_table != '') {\n $fields = $this->buildFields();\n\n if ($fields != '' || $this->m_remove_field) {\n $q = 'ALTER TABLE '.$this->m_db->quoteIdentifier($this->m_table);\n\n if ($this->m_remove_field) {\n $q .= \" DROP\\n \".$this->m_db->quoteIdentifier($this->m_remove_field);\n } else {\n $q .= \" ADD\\n (\";\n\n $q .= $fields;\n\n $constraints = $this->buildConstraints();\n\n if ($constraints != '') {\n $q .= \",\\n\".$constraints;\n }\n\n $q .= ')';\n }\n\n return array($q);\n }\n }\n\n return '';\n }",
"public function compileTableAlterFields()\n\t{\n\t\treturn 'ALTER TABLE '.\n\t\t\t$this->quoteIdentifier($this->query['table']).' '.\n\t\t\t$this->compilePartFields('alter');\n\t}",
"abstract public function add_column($table_name, $column_name, $params);",
"public function addColumnOptions($sql, $options)\n {\n if (isset($options['null']) && $options['null'] === false) {\n $sql .= ' NOT NULL';\n }\n if (isset($options['default'])) {\n $default = $options['default'];\n $column = isset($options['column']) ? $options['column'] : null;\n $sql .= ' DEFAULT '.$this->quote($default, $column);\n }\n return $sql;\n }",
"public function modifyTable()\n {\n foreach ($this->getSingleColumns() as $column)\n {\n if (!$this->getTable()->containsColumn($column))\n {\n $this->getTable()->addColumn(array(\n \t'name' => $column,\n 'type' => 'VARCHAR',\n 'size' => '255',\n ));\n }\n }\n }",
"abstract protected function buildAddColumns();",
"function sql_column_change($dbms, $table_name, $column_name, $column_data)\n{\n\tglobal $dbms_type_map, $db;\n\tglobal $errored, $error_ary;\n\n\t$column_data = prepare_column_data($dbms, $column_data);\n\n\tswitch ($dbms)\n\t{\n\t\tcase 'firebird':\n\t\t\t// Change type...\n\t\t\t$sql = 'ALTER TABLE \"' . $table_name . '\" ALTER COLUMN \"' . $column_name . '\" TYPE ' . ' ' . $column_data['column_type_sql'];\n\t\t\t_sql($sql, $errored, $error_ary);\n\t\tbreak;\n\n\t\tcase 'mssql':\n\t\t\t$sql = 'ALTER TABLE [' . $table_name . '] ALTER COLUMN [' . $column_name . '] ' . $column_data['column_type_sql'];\n\t\t\t_sql($sql, $errored, $error_ary);\n\t\tbreak;\n\n\t\tcase 'mysql_40':\n\t\tcase 'mysql_41':\n\t\t\t$sql = 'ALTER TABLE `' . $table_name . '` CHANGE `' . $column_name . '` `' . $column_name . '` ' . $column_data['column_type_sql'];\n\t\t\t_sql($sql, $errored, $error_ary);\n\t\tbreak;\n\n\t\tcase 'oracle':\n\t\t\t$sql = 'ALTER TABLE ' . $table_name . ' MODIFY ' . $column_name . ' ' . $column_data['column_type_sql'];\n\t\t\t_sql($sql, $errored, $error_ary);\n\t\tbreak;\n\n\t\tcase 'postgres':\n\t\t\t$sql = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN ' . $column_name . ' SET ' . $column_data['column_type_sql'];\n\t\t\t_sql($sql, $errored, $error_ary);\n\t\tbreak;\n\n\t\tcase 'sqlite':\n\n\t\t\t$sql = \"SELECT sql\n\t\t\t\tFROM sqlite_master\n\t\t\t\tWHERE type = 'table'\n\t\t\t\t\tAND name = '{$table_name}'\n\t\t\t\tORDER BY type DESC, name;\";\n\t\t\t$result = _sql($sql, $errored, $error_ary);\n\n\t\t\tif (!$result)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$row = $db->sql_fetchrow($result);\n\t\t\t$db->sql_freeresult($result);\n\n\t\t\t$db->sql_transaction('begin');\n\n\t\t\t// Create a temp table and populate it, destroy the existing one\n\t\t\t$db->sql_query(preg_replace('#CREATE\\s+TABLE\\s+\"?' . $table_name . '\"?#i', 'CREATE TEMPORARY TABLE ' . $table_name . '_temp', $row['sql']));\n\t\t\t$db->sql_query('INSERT INTO ' . $table_name . '_temp SELECT * FROM ' . $table_name);\n\t\t\t$db->sql_query('DROP TABLE ' . $table_name);\n\n\t\t\tpreg_match('#\\((.*)\\)#s', $row['sql'], $matches);\n\n\t\t\t$new_table_cols = trim($matches[1]);\n\t\t\t$old_table_cols = preg_split('/,(?![\\s\\w]+\\))/m', $new_table_cols);\n\t\t\t$column_list = array();\n\n\t\t\tforeach ($old_table_cols as $key => $declaration)\n\t\t\t{\n\t\t\t\t$entities = preg_split('#\\s+#', trim($declaration));\n\t\t\t\t$column_list[] = $entities[0];\n\t\t\t\tif ($entities[0] == $column_name)\n\t\t\t\t{\n\t\t\t\t\t$old_table_cols[$key] = $column_name . ' ' . $column_data['column_type_sql'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$columns = implode(',', $column_list);\n\n\t\t\t// create a new table and fill it up. destroy the temp one\n\t\t\t$db->sql_query('CREATE TABLE ' . $table_name . ' (' . implode(',', $old_table_cols) . ');');\n\t\t\t$db->sql_query('INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;');\n\t\t\t$db->sql_query('DROP TABLE ' . $table_name . '_temp');\n\n\t\t\t$db->sql_transaction('commit');\n\n\t\tbreak;\n\t}\n}",
"function supportsAlterTableWithDropColumn(){\r\n\t\tdie('Not implemented');\r\n\t}",
"public function testAlterTableColumns() {\n $db = self::$db;\n $def = new TableDef();\n $tbl = 'tstAlterTableColumns';\n\n $def->setTable($tbl)\n ->setColumn('col1', 'int', false)\n ->setColumn('col2', 'uint', 0)\n ->addIndex(Db::INDEX_IX, 'col1');\n $def->exec($db);\n\n $expected = $def\n ->setColumn('cola', 'int', false)\n ->setColumn('colb', 'bool', false)\n ->setColumn('col2', 'uint', false)\n ->toArray();\n\n $db->defineTable($expected);\n $db->reset();\n $actual = $db->fetchTableDef($tbl);\n\n $this->assertDefEquals($expected, $actual);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the product SKU. | public function setSKU($sku); | [
"public function setSku($sku){\n $this->sku = $sku;\n }",
"public function setSku($sku);",
"public function setSku($sku)\n {\n $this->sku = $sku;\n }",
"public function setAssignedProductSkus(array $productSkus)\n {\n $this->setSessionData(self::SESSION_KEY_ASSIGNED_PRODUCT_SKUS, array_unique($productSkus));\n }",
"public function setSellerSKU($value)\n {\n $this->_fields['SellerSKU']['FieldValue'] = $value;\n return $this;\n }",
"public function getProductSKU()\n {\n }",
"private function setSimpleSkus()\n {\n $p = array();\n foreach ($this->getSimpleProducts() as $product /** @var Simple $product */) {\n $p[] = $product->get('sku');\n }\n $this->set('simples_skus', implode(',', $p));\n }",
"public function testUpdateProductSku()\n {\n $newSku = 'simple-edited';\n $productId = $this->productResource->getIdBySku('simple');\n $initialProduct = $this->productFactory->create();\n $this->productResource->load($initialProduct, $productId);\n\n $initialProduct->setSku($newSku);\n $this->productRepository->save($initialProduct);\n\n $updatedProduct = $this->productFactory->create();\n $this->productResource->load($updatedProduct, $productId);\n self::assertSame($newSku, $updatedProduct->getSku());\n\n //clean up.\n $this->productRepository->delete($updatedProduct);\n }",
"protected function initProductToSku()\n {\n $productCollection = $this->productCollectionFactory->create();\n $select = $productCollection->getSelect()->reset('columns')->columns(['entity_id', 'sku']);\n $this->idToSku = $productCollection->getConnection()->fetchPairs($select);\n }",
"public function setRecommendedSku(?string $value): void {\n $this->getBackingStore()->set('recommendedSku', $value);\n }",
"public function generateProductSKU()\n {\n return $this->skuString . int_random();\n }",
"public function set_product($product)\n {\n }",
"public function loadProduct($sku);",
"public function setFNSKU($value)\n {\n $this->_fields['FNSKU']['FieldValue'] = $value;\n return $this;\n }",
"function setSku($inSku) {\n\t\tif ( $inSku !== $this->_Sku ) {\n\t\t\t$this->_Sku = $inSku;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}",
"function generate_skus( $args, $assoc_args ) {\n\t\tlist( $args, $assoc_args ) = $this->parse_args($args, $assoc_args);\n\t\tforeach ($args as $product_id) {\n\t\t\tWP_CLI::debug(\"Product $product_id\");\n\t\t\t$product = $this->api->get_product($product_id);\n\t\t\tforeach ($product->variations as $variation) {\n\n\t\t\t\t$atts = CBWoo::extract_attributes($variation->attributes);\n\t\t\t\t$sku = '' . $product->sku;\n\n\t\t\t\t// Add in a comonent for each attribute marked to use in variations\n\t\t\t\tforeach ($product->attributes as $pat) {\n\n\t\t\t\t\t// Only use attributes in sku that are marked to use in variations\n\t\t\t\t\tif (! $pat->variation) continue;\n\n\t\t\t\t\t$value = $atts[$pat->slug];\n\t\t\t\t\tif (isset($value)) {\n\t\t\t\t\t\t// Special case for diet\n\t\t\t\t\t\tif ('diet' === $pat->slug && 'no-restrictions' === $value) {\n\t\t\t\t\t\t\t// Don't add anything on the sku\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$sku .= '_' . $atts[$pat->slug];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Prep update\n\t\t\t\t$variation_id = $variation->id;\n\t\t\t\t$update = array('product' => array('sku' => $sku));\n\t\t\t\tWP_CLI::debug(\"\\tVariation $variation_id -> sku $sku\");\n\t\t\t\tif ($this->options->verbose) WP_CLI::debug(var_export($update, true));\n\n\t\t\t\t// Apply update\n\t\t\t\tif (! $this->options->pretend) {\n\t\t\t\t\t$result = $this->api->update_product($variation_id, $update);\n\t\t\t\t\tif ($this->options->verbose) WP_CLI::debug(var_export($result, true));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function withSKU($value)\n {\n $this->setSKU($value);\n return $this;\n }",
"public function editSKU() {\n\t\t\t\t//Build edit SKU json.\n $jsonString = '{\n\t\t\t\t \"SKUMapping\": {\n\t\t\t\t\t\"ClientSKU\": \"Sample Client SKU\",\n\t\t\t\t\t\"CCHProductCode\": \"90002199000000000019\",\n\t\t\t\t\t\"Description\": \"Sample Mapping 45 New\",\n\t\t\t\t\t\"StartDate\": \"2014-08-29T00:00:00\",\n\t\t\t\t\t\"EndDate\": \"2015-08-30T00:00:00\"\n\t\t\t\t }\n\t\t\t\t}';\n\n\t\t\t\t//Replace ENTITY_ID placeholder with your actual entity id below. \n $curl = curl_init($this->URL.'entity/STX-02199-00/productMapping/edit');\n \n\t\t\t\t//Set other options for the call.\n curl_setopt($curl, CURLOPT_HTTPHEADER, $this->multiHeaders);\n curl_setopt($curl, CURLOPT_POST, 1);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $jsonString);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n \n\t\t\t\t//Make the call and then close the connection\n $response = curl_exec($curl);\n\t\t\t\tprint \"\\n\\nEdit SKU Response::\\n\".$response;\n curl_close($curl);\n }",
"public function setStock(string $productId, float $quantity): void;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all tickets for a story in a board | public function getTicketsAction(Board $board, $storyId)
{
$story = $this->getStory($board, $storyId);
return $story->getTickets();
} | [
"public function findTickets();",
"public function getTickets(): array\n {\n return (new Ticket())->where('projectId', $this->id)->findAll();\n }",
"public function getTickets() {\n $priorityId = $this->priority_id;\n $tagId = $this->tag->id;\n return \\App\\Ticket::whereIn('id', function($q) use($tagId){\n return $q->from('taggables')->join('escalation_rules', 'taggables.tag_id', 'escalation_rules.tag_id')->where('taggables.tag_id', $tagId)->select('taggables.taggable_id');\n })->where('priority_id', $priorityId)->get();\n }",
"public function Tickets() {\n\t$filter = array(\"Status\"=>\"Open\");\n\treturn self::get_tickets($filter);\n\t\n \n \n \n \n\t}",
"public function findTickets()\n {\n return $this->ticketRepository->findAll();\n }",
"public function getTickets()\n {\n return parent::search('Ticket', ['OwnerID' => $this->id, 'Status' => '!=:closed'], ['Priority', 'DueDate DESC'], $this->getDatabase());\n }",
"public function getTickets() {\n\n /* Fetch all included ticket IDs */\n $ticketIDs = $this->getIncludedTicketIDs();\n\n\n /* Include assigned tickets */ \n if($this->user->getTicketApproval()->count())\n $ticketIDs = array_merge($ticketIDs, $this->user->getTicketApproval()->pluck('id')->toArray());\n\n\n /* Set whereIn variables */\n array_push($this->whereIn, [\n 'column' => 'ticket_id',\n 'array' => $ticketIDs\n ]); \n }",
"private function getTicketsByBoardbyDayList($board) {\r\n\t\t$sql = \"SELECT dateadd(DAY,0, datediff(day,0, Date_Entered_UTC)) AS day, count(TicketNbr) as count \";\r\n\t\t$sql .= \"FROM v_rpt_Service \";\r\n\t\t$sql .= \"WHERE Date_Entered_UTC >= DATEADD(day, -30, GETDATE()) \";\r\n\t\t$sql .= \"AND Board_Name LIKE '{$board}' \";\r\n\t\t$sql .= \"GROUP BY dateadd(DAY,0, datediff(day,0, Date_Entered_UTC)) \";\r\n\t\t$sql .= \"ORDER BY dateadd(DAY,0, datediff(day,0, Date_Entered_UTC)) \";\r\n\t\t$result = sqlsrv_query($this->conn, $sql) or die ('Error in SQL: ' . $sql);\r\n\r\n\t\t$i = 0;\r\n\t\twhile($row = sqlsrv_fetch_array($result)) {\r\n\t\t\t$r[$i]['date'] = (strtotime($row['day'])*1000)-6*60*60*1000;\r\n\t\t\t$r[$i]['count'] = (string)$row['count'];\r\n\t\t\t$i++;\r\n\t\t}\r\n\r\n\t\treturn($r);\r\n\t}",
"public function getTickets()\n {\n return $this->tickets;\n }",
"public function getTickets(){\n \n $result = self::where([\n \"status\" => \"Active\"\n ])\n ->select([\"id\",\"ticket\"])\n ->orderBy(\"ticket\")\n ->get();\n \n return $result;\n }",
"public function getAllTickets() {\n\t\t$res = $this->callApi(\"tickets.json\");\n\t\t// handle 404 error\n\t\tif($res[\"code\"] == 404){ \n\t\t\t$res[\"error\"] = $this->getErrorMsg(\"Requested API url is not valid\");\n\t\t\treturn $res;\n\t\t}\n\t\t$resArr = json_decode($res[\"data\"], true);\n\t\t// handle api error in processing the request\n\t\tif(isset($resArr[\"error\"])) {\n\t\t\t$resArr[\"error\"] = $this->getErrorMsg($resArr[\"error\"]);\n\t\t\treturn $resArr;\n\t\t}\n\t\treturn $resArr[\"tickets\"];\n\t}",
"function getTickets() {\r\n\t$ticket_table = readTable(\"ticket\");\r\n\r\n\treturn $ticket_table;\r\n}",
"public function getTickets() {\n global $sql_prefix;\n\n if ($this->_tickets == null) {\n $this->_tickets = TicketManager::getInstance()->getTicketsOfUser($this->getUserID());\n }\n\n return $this->_tickets;\n }",
"public function GetTickets($date, $eventId){\n\t\t$sql = \"SELECT *\n\t\t\t\t\t\tFROM ticket\n\t\t\t\t\t\tJOIN venue ON venue.venue=ticket.venue\n\t\t\t\t\t\tJOIN artist ON artist.name=ticket.artist\n\t\t\t\t\t\tWHERE DATE(end)='$date' AND \tevent_id = $eventId\";\n\n\t\tglobal $conn;\n\t\t$results = $conn->query($sql);\n\t\t$numRows = $results->num_rows;\n\t\tif($numRows > 0){\n\t\t\twhile($row = $results->fetch_assoc()){\n\t\t\t$data[] = $row;\n\t\t\t}\n\t\t\treturn $data;\n\t\t}\n\t}",
"public static function getTicketsForComparison(){\n $tickets = self::dbConn();\n\n }",
"public function FetchThreads($accessToken,$id){\n $response = Http::withHeaders([\n 'orgId' => '20078274006',\n 'Authorization' => 'Zoho-oauthtoken '. $accessToken\n ])->get('https://desk.zoho.eu/api/v1/tickets/' . $id . '/conversations');\n\n $fetchedThreads = json_decode($response,true);\n\n if(isset($fetchedThreads['data'])){\n $threads = $fetchedThreads['data'];\n }else{\n $threads = null;\n }\n\n // get plainText from each conversation\n if($threads != null){\n $AllThreads = array();\n\n foreach ($threads as $item) {\n $response = Http::withHeaders([\n 'orgId' => '20078274006',\n 'Authorization' => 'Zoho-oauthtoken '. $accessToken\n ])->get('https://desk.zoho.eu/api/v1/tickets/' . $id . '/threads/' .$item['id']. '?include=plainText');\n\n $fetchedThreads = json_decode($response,true);\n\n if(isset($fetchedThreads)){\n $AllThreads[] = $fetchedThreads;\n }\n }\n //dd($AllThreads);\n }\n\n return $AllThreads;\n }",
"public function fetchAllAssignedTickets()\n {\n try {\n\n $allAgentTickets = TicketAssignedAgent::get();\n\n $allTickets = [];\n foreach ($allAgentTickets as $allAgentTicket) {\n array_push($allTickets, $allAgentTicket->ticket_id);\n }\n\n $tickets = Ticket::whereIn('id', $allTickets)->orderBy('created_at', 'desc')->paginate(10);\n\n\n return response()->json($tickets);\n } catch (\\Exception $exception) {\n return 'Something Went Wrong';\n }\n }",
"public function geefKlantTickets()\n {\n $id = $_REQUEST['klant_id'];\n $sql = 'SELECT * FROM `tickets` WHERE `klant_id` = :id';\n $stmnt = $this->db->prepare($sql);\n $stmnt->bindParam(':id', $id);\n $stmnt->execute();\n $tickets = $stmnt->fetchAll(\\PDO::FETCH_CLASS, __NAMESPACE__ . '\\Ticket');\n return $tickets;\n }",
"public function findUserStoryOrBugTitle($ticketId)\n {\n $bugInfo = $this->_getBugInfo($ticketId);\n if ($bugInfo && !isset($bugInfo['Status'])) {\n if (!isset($bugInfo['UserStory'])) {\n return [$ticketId, $bugInfo['Name'], self::BUG];\n } else {\n $userStoryInfo = $this->_getStoryInfo($bugInfo['UserStory']['Id']);\n return [$bugInfo['UserStory']['Id'], $userStoryInfo['Name'], self::STORY];\n }\n }\n\n $taskInfo = $this->_getTaskInfo($ticketId);\n if ($taskInfo) {\n if (isset($taskInfo['UserStory']['Id'])) {\n $userStoryInfo = $this->_getStoryInfo($taskInfo['UserStory']['Id']);\n\n if (isset($taskInfo['UserStory']['Id'])) {\n return [$taskInfo['UserStory']['Id'], $userStoryInfo['Name'], self::STORY];\n }\n }\n }\n\n $userStory = $this->_getStoryInfo($ticketId);\n if (!isset($userStory['Id'])) {\n return [];\n }\n return [$userStory['Id'], $userStory['Name'], self::STORY];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes a specific Redis instance. Instance stops serving and data is deleted. | public function DeleteInstance(\Google\Cloud\Redis\V1beta1\DeleteInstanceRequest $argument,
$metadata = [], $options = []) {
return $this->_simpleRequest('/google.cloud.redis.v1beta1.CloudRedis/DeleteInstance',
$argument,
['\Google\LongRunning\Operation', 'decode'],
$metadata, $options);
} | [
"public function delete($instance) : void ;",
"public function DeleteInstance()\n {\n $sTmpInstanceID = $this->instanceID;\n $this->OnDeleteInstance();\n $this->instanceID = $sTmpInstanceID;\n $this->_ClearInstance();\n $sPageId = $this->global->GetUserData('pagedef');\n $this->RedirectToEditPage($sPageId);\n }",
"public function delete($project, $instance, $optParams = array()) {\n $params = array('project' => $project, 'instance' => $instance);\n $params = array_merge($params, $optParams);\n $data = $this->__call('delete', array($params));\n if ($this->useObjects()) {\n return new Google_InstancesDeleteResponse($data);\n } else {\n return $data;\n }\n }",
"public function killInstance($instance)\n {\n if ($instance->getPid()) {\n exec('kill -9 '.$instance->getPid());\n }\n\n UtilityComponent::rrmdir(UtilityComponent::getTempDirectory('pvw-data').'/'.$instance->getKey());\n\n /** @var Pvw_InstanceModel $instanceModel */\n $instanceModel = MidasLoader::loadModel('Instance', 'pvw');\n $instanceModel->delete($instance);\n }",
"public function destroy(string $instanceName): void\n {\n unset($this->instances->$instanceName);\n }",
"function deleteInstance()\n\t{ \t\t\t\n\t\t$args = new safe_args();\n\t\t$args->set( 'company_id',NOTSET, 'sqlsafe');\t\t\t\t\n\t\t$args = $args->get(func_get_args());\t\n \n\t\t// no company to delete\n\t\tif( ($company = getOneAssocArray( 'select * from '.BACKOFFICE_DB.'.customers where company_id = \"'.$args['company_id'].'\"')) == null )\n\t\t{\n\t\t\tmessagebox( 'Instance not deleted, customer doesn\\'t exist', ERROR);\n\t\t\treturn false;\n\t\t}\n\t\n\t\t// drop the db\n\t\texecuteSQL('DROP DATABASE `'.PRIVATE_LABEL.$company['company_alias'].'`');\n\t\t\t\n\t\t// delete the subdomain in the domains db\n\t\texecuteSQL('DELETE FROM '.LIGHTTPD_DB.'.domains WHERE domain = \"'.$company['company_alias'].'.'.INSTANCES_DOMAIN.'\"');\t\n\t\t\t\t\n\t\t// remove data rep and files of the instance\n\t\tif( is_dir( INSTANCES_DATA.SEP.$company['company_alias']) == true ) \n\t\t\texec('rm -fr '.INSTANCES_DATA.SEP.$company['company_alias']) ;\n\n\t\t// remove instance from Cloudflare DNS\n\t\texec('cfcli -c /home/appshore/.cfcli.yml rm '.$company['company_alias'].'.'.INSTANCES_DOMAIN) ;\n\n\t\texecuteSQL( 'update '.BACKOFFICE_DB.'.customers set updated = now() where company_id = \"'.$company['company_id'].'\"');\t\n\t\t\n\t\t//save the deleted custome to archive\n\t\texecuteSQL( 'insert into '.BACKOFFICE_DB.'.customers_archived select * from '.BACKOFFICE_DB.'.customers where company_id = \"'.$company['company_id'].'\"');\t\n\t\t\t\n\t\treturn true;\n\t}",
"public function delete_method($instance_id);",
"public function delete()\r\n {\r\n shmop_delete($this->shmId);\r\n }",
"public function delete()\n {\n // ckeck if properly instancied\n $this->_isInstancied();\n\n $query = \"\n DELETE FROM\n example\n WHERE TRUE\n AND id_example = :id_example\n ;\n \";\n\n $stmt = self::getStatement($query);\n $stmt->bindValue(':id_example', $this->getExampleId());\n $stmt->execute();\n\n $this->flushFromCache();\n }",
"function delete_instance(\n string $projectId,\n string $zone,\n string $instanceName\n) {\n // Delete the Compute Engine instance using the InstancesClient\n $instancesClient = new InstancesClient();\n $operation = $instancesClient->delete($instanceName, $projectId, $zone);\n\n /** TODO: wait until operation completes */\n\n printf('Deleted instance %s' . PHP_EOL, $instanceName);\n}",
"public function remove(ApplicationInstance $instance);",
"public function delete($project, $instance, $optParams = [])\n {\n $params = ['project' => $project, 'instance' => $instance];\n $params = array_merge($params, $optParams);\n return $this->call('delete', [$params], Operation::class);\n }",
"static function deleteHostByInstanceId( $instanceid ) {\n\t\tglobal $wgAuth;\n\n\t\tOpenStackNovaLdapConnection::connect();\n\n\t\t$host = OpenStackNovaHost::getHostByInstanceId( $instanceid );\n\t\tif ( ! $host ) {\n\t\t\t$wgAuth->printDebug( \"Failed to delete host $instanceid as the DNS entry does not exist\", NONSENSITIVE );\n\t\t\treturn false;\n\t\t}\n\t\t$dn = $host->hostDN;\n\t\t$domain = $host->getDomain();\n\n\t\t$success = LdapAuthenticationPlugin::ldap_delete( $wgAuth->ldapconn, $dn );\n\t\tif ( $success ) {\n\t\t\t$domain->updateSOA();\n\t\t\t$wgAuth->printDebug( \"Successfully deleted host $instanceid\", NONSENSITIVE );\n\t\t\treturn true;\n\t\t} else {\n\t\t\t$wgAuth->printDebug( \"Failed to delete host $instanceid\", NONSENSITIVE );\n\t\t\treturn false;\n\t\t}\n\t}",
"public function delete_instance() {\r\n\t\t//check the nonce field for security\r\n\t\tcheck_ajax_referer( $this->nonce, 'nonce' );\r\n\r\n\t\tif ( isset( $_POST['category'] )&& isset( $_POST['taxonomy'] ) ) {\r\n\t\t\t$res=$this->data_manager->delete_instance(\r\n\t\t\t\t$_POST['category'],\r\n\t\t\t\t$_POST['taxonomy'],\r\n\t\t\t\t$_POST['post_type'] );\r\n\t\t}\r\n\r\n\t\t$r = isset( $res ) && $res ? \"1\" : \"-1\";\r\n\t\techo $r;\r\n\t\texit;\r\n\t}",
"public function deleteFromServer()\n {\n return $this->dispatchJob(KeyDestroyJob::class);\n }",
"function poasassignment_delete_instance($id) {\n // global $DB;\n $poasassignmentmodelinstance = poasassignment_model::get_instance($poasassignment);\n return $poasassignmentmodelinstance->delete_instance($id);\n}",
"public function purge($jobInstanceCode);",
"public function delete()\n {\n $response = $this->request->request(\n 'users/' . $this->getUser()->id . '/keys/' . $this->id,\n ['method' => 'delete',]\n );\n if ($response['status_code'] !== 200) {\n throw new TerminusException(\n 'There was an problem deleting the SSH key.'\n );\n }\n }",
"public function disconnect() {\n $this->getRedis()->close();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
RELACION DE UNO A MUCHOS rechazoresmedtom | public function rechazoresmedtoms()
{
return $this->hasMany(RechazoResMedTom::class);
} | [
"public function getMarcoMuestral(){\n\t\t$query = \"SELECT * FROM prop_marco_muestral\";\n\t\treturn $this->adoDbFab->GetAll($query);\n\t}",
"function bajarReputacionUsuario($matricula){\n \t}",
"function alta_unidad_m(){\n\t\t$u= new Unidad_medida();\n\t\t$u->fecha_alta=date(\"Y-m-d\");\n\t\t$u->estatus_general_id=1;\n\t\t$u->usuario_id=$GLOBALS['usuarioid'];\n\t\t$related = $u->from_array($_POST);\n\n\t\t// save with the related objects\n\t\tif($u->save($related))\n\t\t{\n\t\t\techo \"<html> <script>alert(\\\"Se han registrado los datos de la Unidad de Medida.\\\"); window.location='\".base_url().\"index.php/inicio/acceso/\".$GLOBALS['ruta'].\"/menu';</script></html>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tshow_error(\"\".$u->error->string);\n\t\t}\n\t}",
"function get_medicacao($id_utente){\n $select = \"SELECT m.*,r.estado,r.data,r.id as id_receita FROM medicamentos m, receitas r WHERE r.nu_utente = '$id_utente' AND r.id_medicamento IN (SELECT id_medicamento FROM receitas WHERE r.id_medicamento = m.id)\";\n $query = $this->db->query($select);\n return $query;\n }",
"function mandar_mesa_comandera($objeto) {\n\t// Si el objeto viene vacio(llamado desde el index) se le asigna el $_REQUEST que manda el Index\n\t// Si no conserva su valor normal\n\t\t$objeto = (empty($objeto)) ? $_REQUEST : $objeto;\n\t\t\n\t// Valida si existe una comanda\n\t\t$objeto['id_comanda'] = (empty($objeto['id_comanda'])) ? $this -> comandasModel -> insertComanda($objeto['id_mesa'], 0) : $objeto['id_comanda'] ;\n\t\n\t// Obtiene la informacion de la mesa\n\t\t$objeto['info_mesa'] = $this -> comandasModel -> getComanda($objeto['id_mesa']);\n\t\t$objeto['info_mesa'] = $objeto['info_mesa'] -> fetch_array(MYSQLI_ASSOC);\n\t\t\n\t// Si viene el nombre y la direccion se le asignan a una variable de sesion\n\t// si no conserva su valor\n\t\t$_SESSION['nombre'] = (!empty($_GET['nombre'])) ? $_GET['nombre'] : $_SESSION['nombre'];\n\t\t$_SESSION['direccion'] = (!empty($_GET['direccion'])) ? $_GET['direccion'] : $_SESSION['direccion'];\n\t\t$_SESSION['tel'] = (!empty($_GET['tel'])) ? $_GET['tel'] : $_SESSION['tel'];\n\t\t\n\t// Consulta si existe una union de mesas\n\t\t$objeto['mesas_juntas'] = $this -> comandasModel -> mesas_juntas($objeto);\n\n\t\t$nombre = $_SESSION['nombre'];\n\t\t$objeto['nombre'] = str_replace('\"', '', $nombre);\n\t\t$direccion = $_SESSION['direccion'];\n\t\t$objeto['direccion'] = str_replace('\"', '', $direccion);\n\t\t$tel = $_SESSION['tel'];\n\t\t$objeto['tel'] = str_replace('\"', '', $tel);\n\t\n\t// Obtiene el arreglo con las personas de la comanda\n\t\t$objeto['personas'] = $this -> comandasModel -> getPersons($objeto['id_comanda']);\n\t\t$objeto['personas'] = $objeto['personas']['rows'];\n\t\t$objeto['num_personas'] = $objeto['personas'][0]['num_personas'];\n\t\t\n\t\tsession_start();\n\t\t$_SESSION['tables']['id']['idcomanda'] = $objeto['id_comanda'];\n\t\t$objeto['mesero'] = $_SESSION['mesero']['usuario'];\n\t\t$objeto['id_mesero'] = $_SESSION['mesero']['id'];\n\t\n\t// Asigna el mesero a la mesa\n\t\t$result = $this -> comandasModel -> actualizar_mesa($objeto);\n\t\t\n\t\techo json_encode($objeto);\n\t}",
"public function ConsultaMateriaUnico($cod){\n $resultado = $this->bd->query(\"SELECT * FROM snp_mate WHERE MAT_CODIGO = $cod\");\n return $resultado;\n }",
"public function alteraUnidademedida()\n {\n // recebe dados do formulario\n $post = DadosFormulario::formularioCadastroUnidademedida(NULL, 2);\n // valida dados do formulario\n $oValidador = new ValidadorFormulario();\n if (!$oValidador->validaFormularioCadastroUnidademedida($post, 2)) {\n $this->msg = $oValidador->msg;\n return false;\n }\n // cria variaveis para validacao com as chaves do array\n foreach ($post as $i => $v) $$i = $v;\n // cria objeto para grava-lo no BD\n $oUnidademedida = new Unidademedida($idUnidade, $nome, $sigla);\n $oUnidademedidaBD = new UnidademedidaBD();\n if (!$oUnidademedidaBD->alterar($oUnidademedida)) {\n $this->msg = $oUnidademedidaBD->msg;\n return false;\n }\n return true;\n }",
"public function getMedicoApellidopaterno()\n {\n\n return $this->medico_apellidopaterno;\n }",
"function act_unidad_m(){\n\t\t$u= new Unidad_medida();\n\t\t$u->usuario_id=$GLOBALS['usuarioid'];\n\t\t$related = $u->from_array($_POST);\n\n\t\t// save with the related objects\n\t\tif($u->save($related))\n\t\t{\n\t\t\techo \"<html> <script>alert(\\\"Se han actualizado los datos de la Unidad de Medida.\\\"); window.location='\".base_url().\"index.php/inicio/acceso/\".$GLOBALS['ruta'].\"/menu';</script></html>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tshow_error(\"\".$u->error->string);\n\t\t}\n\t}",
"public function restarMemoria(){\n\n if(is_numeric($this->pantalla)){ //Comprobar si es un number\n $resta = $this->memoria - $this->pantalla;\n $this->memoria = $resta;\n $this->pantalla = $this->memoria;\n } else {\n $this->pantalla = \"Operación no permitida\";\n }\n\n }",
"function getIdManutencaoFutur() {\n return $this->idManutencaoFutur;\n }",
"public function buscarUltimo() {\n }",
"public function formesMedicaments(){\n\t\t$adapter = $this->tableGateway->getAdapter ();\n\t\t$sql = new Sql ( $adapter );\n\t\t$select = $sql->select ();\n\t\t$select->columns( array('*'));\n\t\t$select->from( array( 'forme' => 'forme_medicament' ));\n\t\n\t\t$stat = $sql->prepareStatementForSqlObject ( $select );\n\t\t$result = $stat->execute ();\n\t\n\t\treturn $result;\n\t}",
"function incluirMembrosnaCelulaControle($matricula,$celula){\r\n require_once (\"control/dao.php\");\r\n require_once (\"modelo/objetoMembro.php\");\r\n \r\n $objDao = dao::getInstance();\r\n \r\n return $objDao->incluirMembrosnaCelulaDao($matricula,$celula);\r\n \r\n }",
"public function usarMedio() {\n $this->usoDeMedio++; \n }",
"function excluirMembrodaCelulaControle($codCelula,$matricula){\r\n require_once (\"control/dao.php\");\r\n require_once (\"modelo/objetoMembro.php\");\r\n $objDao = dao::getInstance();\r\n \r\n return $objDao->excluirMembrodaCelulaDao($codCelula,$matricula);\r\n \r\n }",
"function cargar_memoria()\n\t{\n\t\tif($this->_memoria = toba::memoria()->get_dato_sincronizado(\"obj_\".$this->_id[1])){\n\t\t\t$this->_memoria_existencia_previa = true;\n\t\t}\n\t}",
"public function acessarRelatorios(){\n\n }",
"function crediti_rimasti($utente) {\n\t\t\n\textract($GLOBALS);\n\tglobal $percorso_cartella_dati, $reset_form, $outente, $frase;\n\t\t$calciatori = file($percorso_cartella_dati.\"/mercato_\".$_SESSION['torneo'].\"_\".$_SESSION['serie'].\".txt\");\n\t\tarray_multisort($calciatori,SORT_NUMERIC,SORT_ASC);\t# Ordino numericamente, decrescente, per avere data più recente top\n\t\t$np = 0;\n\t\t$nd = 0;\n\t\t$nc = 0;\n\t\t$nf = 0;\n\t\t$na = 0;\n\t\t$num_calciatori = count($calciatori);\n\t\tfor($num2 = 0; $num2 < $num_calciatori; $num2++) {\t\n\t\t\t$dati_calciatore = explode(\",\", $calciatori[$num2]);\n\t\t\t$numero = $dati_calciatore[0];\n\t\t\t$ruolo = $dati_calciatore[2];\n\t\t\t$squadra = $dati_calciatore[6];\n\t\t\t$proprietario = $dati_calciatore[4];\n\t\t\tassegna_ruoli('mercato');\n\t\t\tif ($proprietario == $utente) {\n\t\t\t\t$soldi_spesi = $soldi_spesi + $dati_calciatore[3];\n\t\t\t\t$num_calciatori_posseduti++;\n\t\t\t\tif ($ruolo == \"P\")\n\t\t\t\t\t$np++;\n\t\t\t\telse if ($ruolo == \"D\")\n\t\t\t\t\t$nd++;\n\t\t\t\telse if ($ruolo == \"C\")\n\t\t\t\t\t$nc++;\n\t\t\t\telse if ($ruolo == \"F\")\n\t\t\t\t\t$nf++;\n\t\t\t\telse if ($ruolo == \"A\")\n\t\t\t\t\t$na++;\n\t\t\t\t\n\t\t\t\t$surplus = INTVAL($ocrediti);\n\t\t\t\t$variazioni = INTVAL($ovariazioni);\n\t\t\t\t$cambi_effettuati = INTVAL($ocambi);\n\t\t\t\t$soldi_spendibili = $soldi_iniziali + $surplus + $variazioni - $soldi_spesi;\n\t\t\t}\n\t\t}\n\tif ($soldi_spendibili != null) echo $soldi_spendibili; else echo $soldi_iniziali;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The item code for the sixth level of the list. Empty when this level doesn't exist in the list. Maximum 32 characters. | public function getLevel6Code(): ?string
{
return $this->level6Code;
} | [
"public function getItemClassificationCode()\n {\n return $this->itemClassificationCode;\n }",
"public function getFirstLevel() : string\n\t{\n\t\treturn \\substr($this->_hash, 0, 2);\n\t}",
"function BarCode_Get($item)\n {\n $code=\"11\";\n if (!empty($item[ \"Code\" ]))\n {\n $code=$item[ \"Code\" ];\n }\n return $code;\n }",
"public function get_new_item_code(){\n\t\t$data=\"01\";\n\t\t$sql = \"SELECT op_kode FROM tb_options WHERE op_tipe='Items' ORDER BY op_kode DESC LIMIT 1 \";\n\t\t$result=$this->db->query($sql);\n\t\tif($result->num_rows() > 0)\n\t\t{\n\t\t\t$data = $result->row()->op_kode;\n\t\t\t$data = intval($data); $data = $data+1;\n\t\t\t$data = $data<10 ? \"0\".$data : $data;\n\t\t}\n\t\techo $data;\n\t}",
"public function getTypeCode() {\n\t\t\tif ($t_list_item = $this->getTypeInstance()) {\n\t\t\t\treturn $t_list_item->get('idno');\n\t\t\t}\n\t\t\treturn null;\n\t\t}",
"public function GetSpokenAtHomeInitLevelIndex()\n {\n return 'SpokenAtHomeInitLevel';\n }",
"public function getParentItemCode()\n {\n return $this->parentItemCode;\n }",
"public function getCupLevelIndex()\n\t{\n\t\tif(!isset($this->cupLevelIndex) || $this->cupLevelIndex === null)\n\t\t{\n\t\t\t$this->cupLevelIndex = $this->getXml()->getElementsByTagName('CupLevelIndex')->item(0)->nodeValue;\n\t\t}\n\t\treturn $this->cupLevelIndex;\n\t}",
"public function getSevenBitExtendedChar( $code ) \n {\n $key = array_search($code, static::$sevenbitextended);\n\n if( $key !== false ) {\n return $key;\n }\n\n return '\\u2639';\n }",
"public function getCupLevelIndex()\n {\n return $this->getXml()->getElementsByTagName('CupLevelIndex')->item(0)->nodeValue;\n }",
"public function getNiche_code () {\n\t$preValue = $this->preGetValue(\"niche_code\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->niche_code;\n\treturn $data;\n}",
"public function getCupLevelIndex()\n\t{\n\t\tif(!$this->isDeleted())\n\t\t{\n\t\t\tif($this->isInCup())\n\t\t\t{\n\t\t\t\tif(!isset($this->cupLevelIndex) || $this->cupLevelIndex === null)\n\t\t\t\t{\n\t\t\t\t\t$this->cupLevelIndex = $this->getXml()->getElementsByTagName('CupLevelIndex')->item(0)->nodeValue;\n\t\t\t\t}\n\t\t\t\treturn $this->cupLevelIndex;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public function getCodeUnite() {\n return $this->codeUnite;\n }",
"public function getLevelIndex()\n\t{\n\t\tif(!isset($this->levelIndex) || $this->levelIndex === null)\n\t\t{\n\t\t\t$this->levelIndex = $this->getXml()->getElementsByTagName('CupLevelIndex')->item(0)->nodeValue;\n\t\t}\n\t\treturn $this->levelIndex;\n\t}",
"public function getMenugroup() {\n\t\t$this->db->where('rnID' , 4);\n\t\t$result = $this->db->get('tbrunnumber')->row();\n\t\treturn $result->rnprefix . sprintf(\"%02d\", ($result->rnnumber +1));\n\t}",
"public function getAdminCodeLevel( );",
"public function getPackageLevelCode()\n {\n return $this->packageLevelCode;\n }",
"public function getCodeArticle6() {\n return $this->codeArticle6;\n }",
"public function getCuisineCode()\n {\n return $this->cuisineCode;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Get an array which contains SQL statement and the time it takes. Also contains 'EXPLAIN' infomation for SELECT statements if your turn on the Debug module. | private function _getSQLStats($sql, $time)
{
$stats = array(
'sql' => $sql,
'time' =>$time,
);
if($this->_config['DBLite']['debug'] && strtoupper(substr($sql, 0, 6)) == 'SELECT')
{
$stats['explain'] = $this->_adapter->explain($sql);
}
return $stats;
} | [
"function executeAndExplain()\r\n {\r\n // at this point, stop debugging\r\n $this->db->setOption('debug', 0);\r\n $this->db->loadModule('Extended');\r\n\r\n // take the SQL for all the unique queries\r\n $queries = array_keys($this->queries);\r\n foreach ($queries AS $sql) {\r\n // for all SELECTs…\r\n $sql = trim($sql);\r\n if (stristr($sql,\"SELECT\") !== false){\r\n // note the start time\r\n $start_time = array_sum(\r\n explode(\" \", microtime())\r\n );\r\n // execute query\r\n $this->db->query($sql);\r\n // note the end time\r\n $end_time = array_sum(\r\n explode(\" \", microtime())\r\n );\r\n // the time the query took\r\n $total_time = $end_time - $start_time;\r\n\r\n // now execute the same query with\r\n // EXPLAIN EXTENDED prepended\r\n $explain = $this->db->getAll(\r\n 'EXPLAIN EXTENDED ' . $sql\r\n );\r\n\r\n $this->explains[$sql] = array();\r\n // update the debug array with the\r\n // new data from\r\n // EXPLAIN and SHOW WARNINGS\r\n if (!PEAR::isError($explain)) {\r\n $this->explains[$sql]['explain'] = $explain;\r\n $this->explains[$sql]['warnings'] = $this->db->getAll('SHOW WARNINGS');\r\n }\r\n\r\n // update the debug array with the\r\n // count and time\r\n $this->explains[$sql]['time'] = $total_time;\r\n }\r\n }\r\n }",
"function run_timed_query($sql){\n\t\t$t1 = microtime(true);\n\t\t//print __FILE__.\"\\n$sql\\n\";\n\t\t$res = $this->dbh->query($sql);\n $ret = $res->fetchAll(PDO::FETCH_FUNC, 'FuzzyIndex::renderColRow');\n\t\t$t2 = microtime(true);\n\t\t$diff = round($t2-$t1, 5);\n\t\tif ( !empty($ret)){\n\t\t\t$ret[0] = $diff.'s | '.$ret[0]; \n\t\t}\n return $ret;\t\t\n\t}",
"protected function getSlowSqlLoggingTime()\n {\n return $this->app['config']->get('sql_logger.slow_queries_min_exec_time');\n }",
"public function slowLogTime()\n {\n return $this->repository->get('sql_logger.slow_queries.min_exec_time');\n }",
"protected function performQueryAnalysis()\n {\n \\array_map(array($this, 'performQueryAnalysisTest'), array(\n array(\\preg_match('/^\\s*SELECT\\s*`?[a-zA-Z0-9]*`?\\.?\\*/i', $this->sql) === 1,\n 'Use %cSELECT *%c only if you need all columns from table',\n ),\n array(\\stripos($this->sql, 'ORDER BY RAND()') !== false,\n '%cORDER BY RAND()%c is slow, avoid if you can.',\n ),\n array(\\strpos($this->sql, '!=') !== false,\n 'The %c!=%c operator is not standard. Use the %c<>%c operator instead.',\n ),\n array(\\preg_match('/^SELECT\\s/i', $this->sql) && \\stripos($this->sql, 'WHERE') === false,\n 'The %cSELECT%c statement has no %cWHERE%c clause and could examine many more rows than intended',\n ),\n function () {\n $matches = array();\n return \\preg_match('/LIKE\\s+[\\'\"](%.*?)[\\'\"]/i', $this->sql, $matches)\n ? 'An argument has a leading wildcard character: %c' . $matches[1] . '%c and cannot use an index if one exists.'\n : false;\n },\n array(\\preg_match('/LIMIT\\s/i', $this->sql) && \\stripos($this->sql, 'ORDER BY') === false,\n '%cLIMIT%c without %cORDER BY%c causes non-deterministic results',\n ),\n ));\n }",
"public function profilerQueries(): array\n {\n return $this->queries;\n }",
"function dumpSQL() {\n $db = Zend_Db_Table::getDefaultAdapter();\n $dbProfiler = $db->getProfiler();\n $dbQuery = $dbProfiler->getLastQueryProfile();\n $dbSQL = $dbQuery->getQuery();\n\n print_r($dbSQL);\n\n return;\n}",
"function mysqlnd_qc_get_query_trace_log(): array {}",
"function time_queries () {\n\t\t$t_count = count( $this->queries_array );\n\t\t$t_total = 0;\n\t\tfor ( $i = 0; $i < $t_count; $i++ ) {\n\t\t\t$t_total += $this->queries_array[$i][1];\n\t\t}\n\t\treturn $t_total;\n\t}",
"function initQuery()\n {\n $profiler = $this->db->getProfiler();\n\n $totalTime = $profiler->getTotalElapsedSecs();\n $queryCount = $profiler->getTotalNumQueries();\n $this->queryTime=$totalTime;\n $this->queryCount=$queryCount;\n\n //$queries=$profiler->getQueryProfiles();\n $queries = $profiler->getQueryProfiles(Zend_Db_Profiler::SELECT);\n\n if($queries != false) \n {\n foreach ($queries as $query)\n {\n $sql=$query->getQuery();\n $params=$query->getQueryParams();\n\n foreach($params as $param)\n {\n $sql=$this->db->quoteInto($sql,$param,'string',1);\n }\n\n\n //echo get_class($query);\n $this->queries[]=array(\n 'sql'=>$sql,\n 'type'=>$query->getQueryType(),\n 'time'=>$query->getElapsedSecs() ,\n );\n }\n }\n\n }",
"public static function profile($sql)\r\n {\r\n $start = microtime(1);\r\n self::query($sql);\r\n return microtime(1) - $start;\r\n }",
"protected function getSqlLog()\n {\n $log = array();\n foreach ($this->getDoctrineEvents() as $i => $event) {\n $params = sfDoctrineConnectionProfiler::fixParams($event->getParams());\n $query = $event->getQuery();\n\n // interpolate parameters\n foreach ($params as $param) {\n $query = join(var_export(is_scalar($param) ? $param : (string) $param, true), explode('?', $query, 2));\n }\n\n $log[] = array(\n ($event->slowQuery ? 'QUERY' : 'query') => $query,\n 'time' => number_format($event->getElapsedSecs(), 2),\n );\n }\n return $log;\n }",
"function debug_sql() {\n global $c_debug_sql;\n global $c_debug_sql_analyze;\n global $debuginfo;\n if ($c_debug_sql == 1) {\n echo \"<div class='centerbig'>\\n\";\n echo \"<div class='block'>\\n\";\n echo \"<div class='dataBlock'>\\n\";\n echo \"<div class='blockHeader'>SQL Debugging</div>\\n\";\n echo \"<div class='blockContent'>\\n\";\n echo \"<textarea rows=20 class='debugsql'>\";\n if (is_array($debuginfo)) {\n foreach ($debuginfo as $val) {\n echo \"$val\\n\";\n if ($c_debug_sql_analyze == 1) {\n $pattern = '/^SELECT.*$/';\n if (preg_match($pattern, $val)) {\n echo str_repeat(\"-\", 80) .\"\\n\";\n $sql = \"EXPLAIN ANALYZE $val\";\n $result = pg_query($sql);\n while ($row = pg_fetch_assoc($result)) {\n $stuff = $row[\"QUERY PLAN\"];\n echo \"$stuff\\n\";\n }\n echo str_repeat(\"-\", 80) .\"\\n\";\n }\n }\n echo \"\\n\";\n }\n }\n echo \"</textarea>\\n\";\n echo \"</div>\\n\"; #</blockContent>\n echo \"<div class='blockFooter'></div>\\n\";\n echo \"</div>\\n\"; #</dataBlock>\n echo \"</div>\\n\"; #</block>\n echo \"</div>\\n\"; #</centerbig>\n }\n}",
"public function bench(){\n\t\t// http://54.72.119.149/bench/50000/nocache/1\n\t\t// http://54.72.119.149/bench/50000/memcached/1\n\t\t// http://54.72.119.149/bench/50000/memcached/10\n\n\t\tif(isset($this->request->params['type'])){\n\t\t\t$type = $this->request->params['type'];\n\t\t} else {\n\t\t\t$type = 'nocache';\n\t\t}\n\n\t\tif(isset($this->request->params['iterations'])){\n\t\t\t$iterations = $this->request->params['iterations'];\n\t\t} else {\n\t\t\t$iterations = 1000;\n\t\t}\n\n\t\tif(isset($this->request->params['cacheduration'])){\n\t\t\t$cacheduration = $this->request->params['cacheduration'];\n\t\t\tcache::config('defaultcache', array('duration' => $cacheduration));\n\t\t}\n\n\t\t$startTime = microtime(true);\n\t\tfor($i=0; $i<=$iterations; $i++){\n\t\t\tif($type == 'nocache'){\n\t\t\t\t$output = $this->Patient->find('all');\n\t\t\t} elseif($type == 'memcached'){\n\t\t\t\t$output = $this->Patient->find('all', array(\n\t\t\t\t\t'cache' => 'patient_all',\n\t\t\t\t\t'cacheConfig' => 'defaultcache',\n\t\t\t\t\t// 'cacheDebug' => true\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t\t$endTime = microtime(true);\n\n\t\t$timeElapsed = ($endTime - $startTime);\n\t\t$avgTimePerQueryMS = ($timeElapsed / $iterations) * 1000;\n\t\t$queryLog = $this->Patient->getDataSource()->getLog();\n\n\t\tpr($iterations . ' queries took ' . $timeElapsed. ' sec');\n\t\tpr('Query average: ' . $avgTimePerQueryMS . ' ms');\n\t\tpr('Queries ran on DB: '. $queryLog['count']);\n\t}",
"protected function getDatabaseQueries()\n\t{\n\t\t$queries = array();\n\n\t\tforeach ($this->queries as $query)\n\t\t\t$queries[] = array(\n\t\t\t\t'query' => $this->createRunnableQuery($query['query'], $query['bindings'], $query['connection']),\n\t\t\t\t'duration' => $query['time'],\n\t\t\t\t'connection' => $query['connection']\n\t\t\t);\n\n\t\treturn $queries;\n\t}",
"private function _startQuery(){\n\t\t$this->_querytime_start = microtime(true);\n\t}",
"function mysqlnd_qc_get_query_trace_log()\n{\n}",
"public function explain() {\r\n\t\treturn $this->select(true)->explain();\r\n\t}",
"public function explain()\n\t{\n\t\treturn $this->explain_query();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a list of new IPv4 address ($inaNewRawAddresses) it'll add them to the existing list ($inaCurrent) where they're not already found | public static function Add_New_Raw_Ips( $inaCurrent, $inaNewRawAddresses, &$outnNewAdded = 0 ) {
if ( empty( $inaNewRawAddresses ) ) {
return $inaCurrent;
}
if ( !array_key_exists( 'ips', $inaCurrent ) ) {
$inaCurrent['ips'] = array();
}
if ( !array_key_exists( 'meta', $inaCurrent ) ) {
$inaCurrent['meta'] = array();
}
foreach( $inaNewRawAddresses as $sRawIpAddress => $sLabel ) {
$mVerifiedIp = self::Verify_Ip( $sRawIpAddress );
if ( $mVerifiedIp !== false && !in_array( $mVerifiedIp, $inaCurrent['ips'] ) ) {
$inaCurrent['ips'][] = $mVerifiedIp;
if ( empty($sLabel) ) {
$sLabel = 'no label';
}
$inaCurrent['meta'][ md5( $mVerifiedIp ) ] = $sLabel;
$outnNewAdded++;
}
}
return $inaCurrent;
} | [
"public function addIPv4Addresses($ipList, $ignoreReduntants=true)\n {\n if (!is_array($ipList)) $ipList = array($ipList);\n foreach ($ipList as $ip) {\n $ip = strval($ip);\n if ($ignoreReduntants && in_array($ip, $this->_ipv4)) continue;\n array_push($this->_ipv4, $ip);\n }\n return $this;\n }",
"protected function addIpAddresses()\n {\n foreach ($this->ipAddresses as $ipAddress) {\n $this->addIpAddress($ipAddress);\n }\n }",
"protected function applyIPs(array $newIPs)\n {\n $oldIPs = $this->config->get('concrete.security.trusted_proxies.ips');\n if (!is_array($oldIPs)) {\n $oldIPs = [];\n }\n if (array_diff($newIPs, $oldIPs) === [] && array_diff($oldIPs, $newIPs) === []) {\n $this->write(LogLevel::INFO, t('No changes in the final proxy IP list.'));\n\n return;\n }\n $this->config->set('concrete.security.trusted_proxies.ips', $newIPs);\n $this->config->save('concrete.security.trusted_proxies.ips', $newIPs);\n $this->write(LogLevel::NOTICE, t('Changes to the final proxy IP list have been persisted.'));\n }",
"protected function removeInvalidAdresses()\n {\n //This resulted array should be repeated fields removed\n //and all not valid strings, and also trim and strtolower strings\n $this->addresses = array_unique($this->addresses);\n $this->addresses = array_map(array($this, 'clearAddressString'), $this->addresses);\n $this->addresses = array_filter($this->addresses, array($this, 'checkEmailAddress'));\n }",
"function addAddresses($conn, $from, $to, $list){\r\n\t\t// If the departure is a new address\r\n\t\tif(!in_array($from, $list)){\t\r\n\t\t\taddAddress($conn, $from);\r\n\t\t}\r\n\t\t\r\n\t\t// If the arrival is a new address\r\n\t\tif(!in_array($to, $list)){\r\n\t\t\taddAddress($conn, $to);\r\n\t\t}\t\r\n}",
"function stripAway($servRecInfo_IN, $MID_Info_IN) {\n /*\n Iterate through $servRecInfo_IN. While doing so build $new_servRecInfo.\n Elements of $servRecInfo_IN get copied into $new_servRecInfo only if\n they meet the criteria.\n */\n foreach ($servRecInfo_IN as $sR) {\n /*\n If the id belonging to the service record $sR correlates to one of the\n maintenance items for this vehicle according to the table servRecToMaintenItem\n then copy add $sR as a member of $new_servRecInfo.\n */\n if (correlatesHmm($sR[0], $MID_Info_IN)) {\n $new_servRecInfo[] = $sR;\n }\n }\n if (empty($new_servRecInfo)) {\n form_destroy();\n die('Again, no service records (224). -Programmer.');\n }\n return $new_servRecInfo;\n}",
"public function checkIncomingMessages()\n\t{\n\t\t$messages = $this->nhz->getAccountTransactions(\n\t\t\tarray(\n\t\t\t\t'account'=>$this->asset->account,\n\t\t\t\t'timestamp'=>$this->lastnhz,\n\t\t\t\t'type'=>1\n\t\t\t)\n\t\t)->transactions;\n\t\t$newAddresses = array();\n\t\tforeach($messages as $message)\n\t\t{\n\t\t\tif($message->senderRS != $this->asset->accountRS)\n\t\t\t{\n\t\t\t\t$newAddresses[$message->transaction] = $message->senderRS;\n\t\t\t}\n\t\t}\n\n\t\treturn $newAddresses;\n\t}",
"protected function ip_array_to_servers_ids_pre_ZS5_03() {\n\t\tunset ( $this->replacement_ids );\n\t\tforeach ( $this->replacement_ip_list as $replaced_ip => $replacement_array ) {\n\t\t\tforeach ( $this->servers as $id => $server ) {\n\t\t\t\tif ($server ['internal_ip'] === $replaced_ip) {\n\t\t\t\t\t$replaced_id = $id;\n\t\t\t\t}\n\t\t\t\tif ($server ['internal_ip'] == $replacement_array ['ip']) {\n\t\t\t\t\t$replacement_id = $id;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->replacement_ids [$replaced_id] = $replacement_id;\n\t\t}\n\t\tINFO ( \"the replacement id array is \" . print_r ( $this->replacement_ids ), 1 );\n\t}",
"protected function populateOldDomains()\n\t{\n\t\t$this->oldDomains = array();\n\n\t\t$list = $this->cparams->getValue('migratelist', '');\n\n\t\t// Do not run if we don't have anything\n\t\tif (!$list)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Sanitize input\n\t\t$list = str_replace(\"\\r\", \"\", $list);\n\n\t\t$temp = explode(\"\\n\", $list);\n\n\t\tif (!empty($temp))\n\t\t{\n\t\t\tforeach ($temp as $entry)\n\t\t\t{\n\t\t\t\t// Skip empty lines\n\t\t\t\tif (!$entry)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (substr($entry, -1) == '/')\n\t\t\t\t{\n\t\t\t\t\t$entry = substr($entry, 0, -1);\n\t\t\t\t}\n\n\t\t\t\tif (substr($entry, 0, 7) == 'http://')\n\t\t\t\t{\n\t\t\t\t\t$entry = substr($entry, 7);\n\t\t\t\t}\n\n\t\t\t\tif (substr($entry, 0, 8) == 'https://')\n\t\t\t\t{\n\t\t\t\t\t$entry = substr($entry, 8);\n\t\t\t\t}\n\n\t\t\t\t$this->oldDomains[] = $entry;\n\t\t\t}\n\t\t}\n\t}",
"public function appendApprovals(array $newApprovals): void {\n $this->approvals = array_values(array_merge($this->approvals, $newApprovals));\n }",
"public function saveWhitelistedIpAddresses(array $ip_addresses, $overwriteExisting = TRUE);",
"function get_unclean_addresses() {\n\t\t$unclean_addresses = $this->db->query(\"SELECT v.sys_address_verified_id, a.* FROM address a LEFT JOIN address_verified v ON (a.sys_address_id=v.sys_address_id) WHERE (v.address!=a.address OR v.suburb!=a.suburb OR v.state!=a.state OR v.postcode!=a.postcode OR v.country!=a.country) AND a.country='AUSTRALIA' AND a.end_date='infinity' LIMIT {$this->verify_process->chunk_size} OFFSET {$this->verify_process->offset};\");\n\n\t\treturn $unclean_addresses;\n\t}",
"public function setJUST_JOINED_MATCHES_NEW($current = 0)\n {\n $this->JUST_JOINED_MATCHES_NEW = $current;\n \n }",
"function mapOldNamesToNewIDs($oldProviders) {\r\n\t$providerIDMapping = array();\r\n\tfor ($i = 0; $i < $_SESSION[\"numberOfOldProviders\"]; $i++) {\r\n\t\t//if(strlen($_POST[\"NewProviderNameID\" . $i])>0) { //obsolete 20180321\r\n\t\tif(in_array($_POST[\"NewProviderNameID\" . $i],$_SESSION[\"listOfFullNewProviderNames\"])) {\r\n $explodeName = explode(\" (\",$_POST[\"NewProviderNameID\" . $i]);\r\n $newID = end($explodeName);\r\n $providerIDMapping[$oldProviders[$i][1]] = rtrim($newID,\")\");\r\n\t\t}\r\n\t}\r\n\treturn $providerIDMapping;\r\n}",
"private function addAddress(\n &$emailAddresses,\n &$emailAddress,\n $encoding,\n $i\n ) {\n if (!$emailAddress['invalid']) {\n if ($emailAddress['address_temp'] || $emailAddress['quote_temp']) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = 'Incomplete address';\n $this->log('error', \"Email\\\\Parse->addAddress - corruption during parsing - leftovers:\\n\\$i: {$i}\\n\\$emailAddress['address_temp'] : {$emailAddress['address_temp']}\\n\\$emailAddress['quote_temp']: {$emailAddress['quote_temp']}\\n\");\n } elseif ($emailAddress['ip'] && $emailAddress['domain']) {\n // Error - this should never occur\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = 'Confusion during parsing';\n $this->log('error', \"Email\\\\Parse->addAddress - both an IP address '{$emailAddress['ip']}' and a domain '{$emailAddress['domain']}' found for the email address '{$emailAddress['original_address']}'\\n\");\n } elseif ($emailAddress['ip'] || ($emailAddress['domain'] && preg_match('/\\d+\\.\\d+\\.\\d+\\.\\d+/', $emailAddress['domain']))) {\n // also test if the current domain looks like an IP address\n\n if ($emailAddress['domain']) {\n // Likely an IP address if we get here\n\n $emailAddress['ip'] = $emailAddress['domain'];\n $emailAddress['domain'] = null;\n }\n if (!$this->ipValidator) {\n $this->ipValidator = new Ip();\n }\n try {\n if (!$this->ipValidator->isValid($emailAddress['ip'])) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = 'IP address invalid: \\''.$emailAddress['ip'].'\\' does not appear to be a valid IP address';\n } elseif (preg_match('/192\\.168\\.\\d+\\.\\d+/', $emailAddress['ip']) ||\n preg_match('/172\\.(1[6-9]|2[0-9]|3[0-2])\\.\\d+\\.\\d+/', $emailAddress['ip']) ||\n preg_match('/10\\.\\d+\\.\\d+\\.\\d+/', $emailAddress['ip'])) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = 'IP address invalid (private): '.$emailAddress['ip'];\n } elseif (preg_match('/169\\.254\\.\\d+\\.\\d+/', $emailAddress['ip'])) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = 'IP address invalid (APIPA): '.$emailAddress['ip'];\n }\n } catch (\\Exception $e) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = 'IP address invalid: '.$emailAddress['ip'];\n }\n } elseif ($emailAddress['domain']) {\n // Check for IDNA\n if (max(array_keys(count_chars($emailAddress['domain'], 1))) > 127) {\n try {\n $emailAddress['domain'] = idn_to_ascii($emailAddress['domain']);\n } catch (\\Exception $e) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = \"Can't convert domain {$emailAddress['domain']} to punycode\";\n }\n }\n\n $result = $this->validateDomainName($emailAddress['domain']);\n if (!$result['valid']) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = isset($result['reason']) ? 'Domain invalid: '.$result['reason'] : 'Domain invalid for some unknown reason';\n }\n }\n }\n\n // Prepare some of the fields needed\n $emailAddress['name_parsed'] = rtrim($emailAddress['name_parsed']);\n $emailAddress['original_address'] = rtrim($emailAddress['original_address']);\n $name = $emailAddress['name_quoted'] ? \"\\\"{$emailAddress['name_parsed']}\\\"\" : $emailAddress['name_parsed'];\n $localPart = $emailAddress['local_part_quoted'] ? \"\\\"{$emailAddress['local_part_parsed']}\\\"\" : $emailAddress['local_part_parsed'];\n $domainPart = $emailAddress['ip'] ? '['.$emailAddress['ip'].']' : $emailAddress['domain'];\n\n if (!$emailAddress['invalid']) {\n if (0 == mb_strlen($domainPart, $encoding)) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = 'Email address needs a domain after the \\'@\\'';\n } elseif (mb_strlen($localPart, $encoding) > 63) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = 'Email address before the \\'@\\' can not be greater than 63 characters';\n } elseif ((mb_strlen($localPart, $encoding) + mb_strlen($domainPart, $encoding) + 1) > 254) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = 'Email addresses can not be greater than 254 characters';\n }\n }\n\n // Build the email address hash\n $emailAddrDef = ['address' => '',\n 'simple_address' => '',\n 'original_address' => rtrim($emailAddress['original_address']),\n 'name' => $name,\n 'name_parsed' => $emailAddress['name_parsed'],\n 'local_part' => $localPart,\n 'local_part_parsed' => $emailAddress['local_part_parsed'],\n 'domain_part' => $domainPart,\n 'domain' => $emailAddress['domain'],\n 'ip' => $emailAddress['ip'],\n 'invalid' => $emailAddress['invalid'],\n 'invalid_reason' => $emailAddress['invalid_reason'], ];\n\n // Build the proper address by hand (has comments stripped out and should have quotes in the proper places)\n if (!$emailAddrDef['invalid']) {\n $emailAddrDef['simple_address'] = \"{$emailAddrDef['local_part']}@{$emailAddrDef['domain_part']}\";\n $properAddress = $emailAddrDef['name'] ? \"{$emailAddrDef['name']} <{$emailAddrDef['local_part']}@{$emailAddrDef['domain_part']}>\" : $emailAddrDef['simple_address'];\n $emailAddrDef['address'] = $properAddress;\n }\n\n $emailAddresses[] = $emailAddrDef;\n\n return $emailAddrDef['invalid'];\n }",
"function invIP($orig) {\n\t$new[0] = $orig[3];\n\t$new[1] = $orig[0];\n\t$new[2] = $orig[2];\n\t$new[3] = $orig[4];\n\t$new[4] = $orig[6];\n\t$new[5] = $orig[1];\n\t$new[6] = $orig[7];\n\t$new[7] = $orig[5];\n\n\treturn $new;\n}",
"private function _inactivate_other_active() {\n\t\t$addresses = new Addresses( $this->pidm );\n\t\t$addresses->load();\n\n\t\t$active\t= $addresses->active_by_type( $this->atyp_code );\n\t\tforeach( $active as $address ) {\n\t\t\t$address->inactivate();\n\t\t\t$address->save();\n\t\t}//end foreach\n\t}",
"static function saveNew($newPatterns)\n {\n $oldPatterns = self::getPatterns();\n\n // Delete stuff that's old that not in new\n $toDelete = array_diff($oldPatterns, $newPatterns);\n\n // Insert stuff that's in new and not in old\n $toInsert = array_diff($newPatterns, $oldPatterns);\n\n foreach ($toDelete as $pattern) {\n $nb = Nickname_blacklist::staticGet('pattern', $pattern);\n if (!empty($nb)) {\n $nb->delete();\n }\n }\n\n foreach ($toInsert as $pattern) {\n $nb = new Nickname_blacklist();\n $nb->pattern = $pattern;\n $nb->created = common_sql_now();\n $nb->insert();\n }\n\n self::blow('nickname_blacklist:patterns');\n }",
"protected function UpdateCoinList() {\n\t\t\n\t\t$ExchangeCoins = $this->getActiveCoinList();\n\n\t\t$ActiveCoins = Coin::with('exchanges')\n\t\t\t ->whereHas('exchanges', function($q) {\n\t\t\t $q->where('exchanges.active', 1);\n\t\t\t })\n\t\t\t ->pluck('shortname')\n\t\t\t ->toArray();\n\n\t\t$NewCoins = array_filter($ExchangeCoins, function($a) use ($ActiveCoins) {\n\t\t return ! in_array($a['shortname'], $ActiveCoins); \n\t\t});\n\n\t\t$this->AddTheseCoins($NewCoins);\n\n\t\t// Deactivate coins\n\t\t$DeactivateTheseCoins = array_diff($ActiveCoins, array_map(array($this, 'getShortOfArray'), $ExchangeCoins));\n\t\t$this->DeactivateTheseCoins($DeactivateTheseCoins);\n\t\t\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Getter for property URI. | function getURI()
{
return $this->URI;
} | [
"public function getUri()\n {\n if (array_key_exists(\"uri\", $this->_propDict)) {\n return $this->_propDict[\"uri\"];\n } else {\n return null;\n }\n }",
"public function getURI()\n {\n return $this->get('URI');\n }",
"public function getURIProperties()\r\n\t{\r\n\t\treturn $this->arrURI;\r\n\t}",
"public function getUri() : string\n {\n $rtn = $this->data['uri'];\n\n return $rtn;\n }",
"public function getPropertiesUris()\n {\n $this->params[\"mode\"] = \"uris\";\n }",
"public function getProperty($uri, $name);",
"public function getUri()\n {\n return $this->normalize($this->service->uri()) . '/' . $this->normalize($this->uri ?: '');\n }",
"function getUriPath() {\n\t\treturn $this->getPathAsString('/');\n\t}",
"public function getProperties($uri);",
"public function getUriString()\n {\n return $this->uri->toString();\n }",
"public function fullURI()\n\t{\n\t\treturn $this->uri;\n\t}",
"public function getUri()\n {\n return $this->readOneof(3);\n }",
"public function getResourceUri()\n {\n return $this->resource_uri;\n }",
"public function getUri()\n {\n return $this->readOneof(1);\n }",
"public function getUriAttribute($value)\n {\n return $this->uri;\n }",
"public function getPropertyPath() {\n return $this->propertyPath;\n }",
"public function getPath() : Property\n {\n return $this->path;\n }",
"public function getResourceUri()\n\t{\n\t\treturn $this->resourceUri; \n\n\t}",
"public function getUriAttribute()\n {\n return app('site')->url($this->type.'/'.$this->slug);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extracts identificator from an item or task url. | private static function obtainId($url) {
preg_match('~/\w{32}/(items/\w+|tasks)/([\w-_]+)/?$~', $url, $matches);
return $matches[2];
} | [
"function obtainId($url){\n preg_match('~/\\w{32}/(items/\\w+|tasks)/([\\w-_]+)/?$~', $url, $matches);\n return $matches[2];\n}",
"public abstract function getItemId( $url, \\DOMElement $item ): string;",
"private function extractIaId( string $urlOrId ): string {\n\t\t$urlOrId = trim( $urlOrId );\n\n\t\tif ( strpos( $urlOrId, 'http' ) === 0 ) {\n\t\t\t$path = parse_url( $urlOrId, PHP_URL_PATH );\n\n\t\t\tif ( !empty( $path ) ) {\n\t\t\t\t$pathParts = explode( '/', $path );\n\t\t\t\tif ( count( $pathParts ) > 2 ) {\n\t\t\t\t\t$urlOrId = $pathParts[2];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $urlOrId;\n\t}",
"private static function urlId($url) {\n\t\treturn $url['id'];\n\t}",
"public function getIdentifier()\n {\n return parse_url($this->url, PHP_URL_HOST);\n }",
"private function extract_itemid() {\n $ItemID = $ItemID = $this->{'Item.ItemID'};\n if (!$ItemID) { // parse from OrderLineItemID\n $matches = [];\n if (preg_match(\"/^(\\d+)-\\d+/\", $this->OrderLineItemID, $matches)) {\n $ItemID = $matches[1];\n }\n }\n return $ItemID;\n }",
"protected function extractId($url)\n {\n $parts = explode('/', $url);\n return end($parts);\n }",
"function get_pid_by_url() {\n \n $url = current_path();\n if(preg_match('/((uuid\\/)|(islandora\\/object\\/islandora)(:|%3A))((\\w|-)+)($|(#|\\/)\\w+)/', $url, $matches)){\n return \"islandora:\".$matches[5];\n }\n else{\n return false;\n }\n}",
"private function getIdFromRedirectedUrl(): string\n {\n $url = $this->getResponse()\n ->getHeader('Location')\n ->getFieldValue();\n $pattern = '!/id/(.*?)/!';\n $result = preg_match($pattern, $url, $matches);\n\n return $result ? $matches[1] : '';\n }",
"public function getId()\n {\n $parts = explode('/', $this->getUri());\n return $parts[3];\n }",
"public function getIdFromUri(string $uri): string;",
"private function getItemIdParameter()\n {\n // Reference: https://stackoverflow.com/questions/6768793/get-the-full-url-in-php\n $url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? \"https\" : \"http\") . \"://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]\";\n // Reference: https://www.geeksforgeeks.org/how-to-get-parameters-from-a-url-string-in-php/\n $url_components = parse_url($url);\n // string passed via URL \n parse_str($url_components['query'], $params);\n return $params['item'];\n }",
"public function getMailboxId($url)\n {\n return explode('@', explode('_', $url)[2])[0];\n }",
"public static function getAuthorIdFromUrl($url) {\n \n $idOn = str_after($url,'/authors/');\n $split = explode('/', $idOn);\n \n return $split[0];\n }",
"public function getIdent();",
"function imdb_url_id($url) {\n if (!is_string($url)) {\n return '';\n }\n $id = regex_get('#title\\\\/(.*)\\\\/#', $url, 1);\n return empty($id) ? FALSE : $id;\n}",
"protected function getStoreIdByUrl()\n\t{\n\t\t$url = $this->server->getValue( 'REQUEST_URI', 'text');\n\t\t$url_explode = explode('/', $url);\n\t\treturn $url_explode[2];\n\t}",
"function getIDfromURI ( $uri ) {\n \tpreg_match('/otvet(\\d+).html/s', $uri, $matches);\n\t\t//company\\/realty(\\d+).html/s\n \tif ( $matches[1] > 0 ) {\n \t\treturn $matches[1];\n \t}\n \treturn false;\n }",
"abstract public function getIdentifier();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the available page clients | public static function getPageClients()
{
return Test::getClients(Test::TYPE_PAGE);
} | [
"public function getClients();",
"public function getClients(){\n\t\treturn $this->get(\"/client\");\n\t}",
"public function clientList ()\n {\n $clients_number = $this->Client->find('count');\n \n $current_page = 1;\n $max_per_page = 20;\n $total_pages = $this->getNumberOfPages($clients_number,$max_per_page);\n \n $clients = $this->getPaginatedList($max_per_page, $current_page);\n $this->set(array ('clients', 'total_pages', 'current_page', 'max_per_page'), array ($clients, $total_pages, $current_page, $max_per_page));\n \n }",
"public function obtainAllClients()\n {\n return $this->performRequest('GET', 'clients');\n }",
"private function getClientList()\n {\n return Client::get()\n ->filter(['active' => true])\n ->sort('LastFetch')\n ;\n }",
"public function list_clients()\n {\n $return = array();\n if (!$this->is_loggedin) {\n echo \"not logged in?\";\n return $return;\n }\n $return = array();\n $json = json_encode(array());\n $content = $this->exec_curl($this->baseurl . \"/api/s/\" . $this->site . \"/stat/sta\", \"json=\" . $json);\n $content_decoded = json_decode($content);\n if (isset($content_decoded->meta->rc)) {\n if ($content_decoded->meta->rc == \"ok\") {\n if (is_array($content_decoded->data)) {\n foreach ($content_decoded->data as $client) {\n $return[] = $client;\n }\n }\n }\n }\n return $return;\n }",
"public function getClients()\n {\n return $this->clients;\n }",
"public function get_Clients() \n\t{\n\t\t$query = '';\n\t\t$result = '';\n\t\t$clients = array();\n\n\t\tswitch( $this->db_link->getDriver() )\n\t\t{\n\t\t\tcase 'sqlite':\n\t\t\tcase 'mysql':\n\t\t\tcase 'pgsql':\n\t\t\t\t$query = \"SELECT Client.ClientId, Client.Name FROM Client \";\n\t\t\t\tif( $this->bwcfg->get_Param( 'show_inactive_clients' ) )\n\t\t\t\t\t$query .= \"WHERE FileRetention > '0' AND JobRetention > '0' \"; \n\t\t\t\t$query .= \"ORDER BY Client.Name;\";\n\t\t\tbreak;\n\t\t}\n\n\t\t$result = $this->db_link->runQuery($query);\n\t\t\t\n\t\tforeach( $result->fetchAll() as $client )\n\t\t\t$clients[ $client['clientid'] ] = $client['name'];\n\t\t\t\t\n\t\treturn $clients;\t\t\n\t}",
"public function getClients()\n {\n return $this->clients;\n }",
"public function getClients(){\n return $this->clients;\n }",
"public function getAllClients(): Clients\n {\n return Harvest::clients()->all();\n }",
"public function getClients() {\n\n return $this->clients;\n\n }",
"public function getClientsAction()\n {\n $this->throwIfClientNot('backend');\n $clientManager = $this->get(\n 'fos_oauth_server.client_manager.default'\n );\n\n $class = $clientManager->getClass();\n\n return $this->getDoctrine()->getRepository($class)->findAll();\n }",
"public function getAll()\n {\n return self::$isp->getAllClients();\n }",
"function retrieve_promoter_clients_list(){\n\t\t\n\t\t$this->CI->load->model('model_users_promoters', 'users_promoters', true);\n\t\t$clients = $this->CI->users_promoters->retrieve_promoter_clients_list($this->promoter->up_id, $this->promoter->team->t_fan_page_id);\n\t\tforeach($clients as $key => &$client){\n\t\t\t\n\t\t\tif($client->pglr_user_oauth_uid === null){\n\t\t\t\tunset($clients[$key]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$client = $client->pglr_user_oauth_uid;\n\t\t}\n\t\treturn $clients;\n\t\t\n\t}",
"public function clients() {\n\t\tif (!$this->configured(true)) { return $this->workflow->toxml(); }\n\n\t\t$url = $this->host.\"/clients\";\n\t\t$clients = $this->workflow->request( $url );\n\t\t$clients = simplexml_load_string( $clients );\n\t\tforeach( $clients->Server as $server ) {\n\t\t\t$this->workflow->result( $server['name'], $server['address'], $server['name'], $server['address'], 'icon.png' );\n\t\t}\n\t\t$this->workflow->result( 'plex:web', 'web', 'Web', 'Plex server web client', 'icon.png' );\n\n\t\treturn $this->workflow->toxml();\n\t}",
"protected function getClients()\n {\n /* @var $collection \\yii\\authclient\\Collection */\n $collection = Yii::$app->get($this->clientCollection);\n\n return $collection->getClients();\n }",
"function get_all()\n {\n $clients = $this->query(\"SELECT * FROM clients WHERE admin_id='\" .$_SESSION['auth_id']. \"'\");\n\t\t\n return $clients;\n }",
"public function getClientes()\n {\n return $this->clientes;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function index Add site tag section Args: none Return: none | function addSiteTag() {
return $this->editSiteTag();
} | [
"public function addTag();",
"public function add($name,$site = []);",
"public function\t\taddWebsite() {\n\t\t\t\n\t\t}",
"public function tag()\n\t{\n\t\t$_slug = preg_replace( '#' . app_setting( 'url', 'shop' ) . 'tag/?#', '', uri_string() );\n\n\t\tif ( $_slug ) :\n\n\t\t\t$this->_tag_single( $_slug );\n\n\t\telse :\n\n\t\t\t$this->_tag_index();\n\n\t\tendif;\n\t}",
"public function addTag($tag);",
"public function addsiteAction()\n {\n $pageIndex = (int)$this->_request->getParam('pageIndex');\n $hidSrhName = $this->_request->getParam('hidSrhName');\n $hidSrhUrl = $this->_request->getParam('hidSrhUrl');\n $hidSrhArea = (int)$this->_request->getParam('hidSrhArea');\n $hidSrhCate = (int)$this->_request->getParam('hidSrhCate');\n\n require_once 'Admin/Dal/SiteArea.php';\n require_once 'Admin/Dal/SiteCategory.php';\n $dalArea = Admin_Dal_SiteArea::getDefaultInstance();\n $dalCate = Admin_Dal_SiteCategory::getDefaultInstance();\n $this->view->lstArea = $dalArea->getAreaList(1, 1000);\n $this->view->lstCate = $dalCate->getCategoryList(1, 1000);\n\n $this->view->pageIndex = $pageIndex;\n $this->view->hidSrhName = $hidSrhName;\n $this->view->hidSrhUrl = $hidSrhUrl;\n $this->view->hidSrhArea = $hidSrhArea;\n $this->view->hidSrhCate = $hidSrhCate;\n $this->view->title = 'FENS様検索エンジン管理システム|FENS';\n $this->render();\n }",
"function add_tag($ContactId, $TagId) {\r\n }",
"function site_add($args, $assoc_args) {\n if (array_key_exists(\"site\", $assoc_args)) {\n $site_uuid = $this->_validateSiteUuid($assoc_args[\"site\"]);\n }\n if (empty($site_uuid)) {\n Terminus::error(\"You must specify the site to remove with --site=\");\n return false;\n }\n //TODO: format output\n return $this->terminus_request(\"user\", $this->_uuid, 'organizations/' . $this->_org . '/sites/' . $site_uuid, \"PUT\");\n }",
"function register_block_core_site_tagline()\n {\n }",
"function add_site_meta($site_id, $meta_key, $meta_value, $unique = \\false)\n {\n }",
"function wetuts_seo_tags() {\n ?>\n <!-- weTuts SEO Plugin -->\n <meta name=\"description\" content=\"Tareq Hasan | Web Application Developer\" />\n <meta name=\"keywords\" content=\"php, ajax, jQuery, php5, php4, wordpress, twitter\" />\n <!-- weTuts SEO Plugin -->\n <?php\n}",
"public function addseo(){\n\t\t$pagetitle=$this->input->post(\"pagetitle\");\t\n\t\t$metadesc=$this->input->post(\"metadesc\");\t\n\t\t$metakey=$this->input->post(\"metakey\");\t\n\t\t$slug=$this->input->post(\"slug\");\t\n\t\n\t\t$insert=array(\n\t\t\t'page_title'=>$pagetitle,\n\t\t\t'meta_description'=>$metadesc,\n\t\t\t'meta_keywords'=>$metakey,\n\t\t\t'slug'=>$slug,\n\t\t\t'date_created'=>date(\"Y-m-d H:i:s\"),\n\t\t\t\n\t\t);\n\t\t$result_inserted=$this->insert($insert,'site_seo');\n\t\treturn $result_inserted;\n\n\t}",
"public function init_seo_tags() {\n\t\tif ( ! empty( $this->seo_tags ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->seo_tags['sitename'] = array(\n\t\t\t'name' => '%%sitename%%',\n\t\t\t'desc' => __( 'Site name', 'fw' ),\n\t\t\t'value' => get_bloginfo( 'name' ),\n\t\t);\n\n\t\t$this->seo_tags['sitedesc'] = array(\n\t\t\t'name' => '%%sitedesc%%',\n\t\t\t'desc' => __( 'Site description', 'fw' ),\n\t\t\t'value' => get_bloginfo( 'description' ),\n\t\t);\n\n\t\t$this->seo_tags['currenttime'] = array(\n\t\t\t'name' => '%%currenttime%%',\n\t\t\t'desc' => __( 'Current time', 'fw' ),\n\t\t\t'value' => date( 'H:i' ),\n\t\t);\n\n\t\t$this->seo_tags['currentdate'] = array(\n\t\t\t'name' => '%%currentdate%%',\n\t\t\t'desc' => __( 'Current date', 'fw' ),\n\t\t\t'value' => date( 'M jS Y' ),\n\t\t);\n\n\t\t$this->seo_tags['currentmonth'] = array(\n\t\t\t'name' => '%%currentmonth%%',\n\t\t\t'desc' => __( 'Current month', 'fw' ),\n\t\t\t'value' => date( 'F Y' ),\n\t\t);\n\n\t\t$this->seo_tags['currentyear'] = array(\n\t\t\t'name' => '%%currentyear%%',\n\t\t\t'desc' => __( 'Current year', 'fw' ),\n\t\t\t'value' => date( 'Y' ),\n\t\t);\n\n\t\t$this->seo_tags['date'] = array(\n\t\t\t'name' => '%%date%%',\n\t\t\t'desc' => __( 'Date of the post/page', 'fw' ),\n\t\t\t'value' => '',\n\t\t);\n\n\t\t$this->seo_tags['title'] = array(\n\t\t\t'name' => '%%title%%',\n\t\t\t'desc' => __( 'Title of the post/page/term', 'fw' ),\n\t\t\t'value' => '',\n\t\t);\n\n\t\t$this->seo_tags['excerpt'] = array(\n\t\t\t'name' => '%%excerpt%%',\n\t\t\t'desc' => __( 'Excerpt of the current post, of auto-generate if it is not set', 'fw' ),\n\t\t\t'value' => '',\n\t\t);\n\n\t\t$this->seo_tags['excerpt_only'] = array(\n\t\t\t'name' => '%%excerpt_only%%',\n\t\t\t'desc' => __( 'Excerpt of the current post, without auto-generation', 'fw' ),\n\t\t\t'value' => '',\n\t\t);\n\n\t\t$this->seo_tags['post_tags'] = array(\n\t\t\t'name' => '%%post_tags%%',\n\t\t\t'desc' => __( 'Post tags, separated by coma', 'fw' ),\n\t\t\t'value' => '',\n\t\t);\n\n\t\t$this->seo_tags['post_categories'] = array(\n\t\t\t'name' => '%%post_categories%%',\n\t\t\t'desc' => __( 'Post categories, separated by coma', 'fw' ),\n\t\t\t'value' => '',\n\t\t);\n\n\t\t$this->seo_tags['description'] = array(\n\t\t\t'name' => '%%description%%',\n\t\t\t'desc' => __( 'Category/tag/term description', 'fw' ),\n\t\t\t'value' => '',\n\t\t);\n\n\t\t$this->seo_tags['term_title'] = array(\n\t\t\t'name' => '%%term_title%%',\n\t\t\t'desc' => __( 'Term title', 'fw' ),\n\t\t\t'value' => '',\n\t\t);\n\n\t\t$this->seo_tags['modified'] = array(\n\t\t\t'name' => '%%modified%%',\n\t\t\t'desc' => __( 'Post modified time', 'fw' ),\n\t\t\t'value' => '',\n\t\t);\n\n\t\t$this->seo_tags['id'] = array(\n\t\t\t'name' => '%%id%%',\n\t\t\t'desc' => __( 'Post/page id', 'fw' ),\n\t\t\t'value' => '',\n\t\t);\n\n\t\t$this->seo_tags['author_name'] = array(\n\t\t\t'name' => '%%author_name%%',\n\t\t\t'desc' => __( 'Post/page author \"nicename\"', 'fw' ),\n\t\t\t'value' => '',\n\t\t);\n\n\t\t$this->seo_tags['author_id'] = array(\n\t\t\t'name' => '%%author_id%%',\n\t\t\t'desc' => __( 'Post/page author id', 'fw' ),\n\t\t\t'value' => '',\n\t\t);\n\n\t\t$this->seo_tags['searchphrase'] = array(\n\t\t\t'name' => '%%searchphrase%%',\n\t\t\t'desc' => __( 'Search phrase in search page', 'fw' ),\n\t\t\t'value' => '',\n\t\t);\n\n\t\t$this->seo_tags['pagenumber'] = array(\n\t\t\t'name' => '%%pagenumber%%',\n\t\t\t'desc' => __( 'Page number', 'fw' ),\n\t\t\t'value' => '',\n\t\t);\n\n\t\t$this->seo_tags['max_page'] = array(\n\t\t\t'name' => '%%max_page%%',\n\t\t\t'desc' => __( 'Page number', 'fw' ),\n\t\t\t'value' => '',\n\t\t);\n\n\t\t$this->seo_tags['caption'] = array(\n\t\t\t'name' => '%%caption%%',\n\t\t\t'desc' => __( 'Attachment caption', 'fw' ),\n\t\t\t'value' => '',\n\t\t);\n\n\t\tforeach ( apply_filters( 'fw_ext_seo_init_tags', array() ) as $tag_id => $tag ) {\n\t\t\tif ( isset( $this->seo_tags[ $tag_id ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$this->seo_tags[ $tag_id ] = $tag;\n\t\t}\n\t}",
"function add_tag($tag) {\n array_push($this->tags, $tag);\n }",
"public function add($site_name, $organization, $tag)\n {\n $org = $this->session()->getUser()->getOrgMemberships()->get($organization)->getOrganization();\n $site = $org->getSiteMemberships()->get($site_name)->getSite();\n $site->tags->create($tag);\n $this->log()->notice(\n '{org} has tagged {site} with {tag}.',\n ['org' => $org->get('profile')->name, 'site' => $site->get('name'), 'tag' => $tag,]\n );\n }",
"public function add_site_post()\n {\n // $user_keys = array('first_name', 'last_name', 'organization_name', 'email_1', 'email_type_1', 'email_2', 'email_type_2', 'phone_1', 'phone_type_1', 'phone_2', 'phone_type_2', 'phone_3', 'phone_type_3', 'company_id', 'customer_preferred_contact');\n // $user_address_keys = array('address_type', 'address', 'address_ext', 'country', 'city', 'state', 'zipcode');\n // $site_keys = array('address', 'address_ext', 'city', 'state', 'zipcode', 'address_type'); \n\n $data = $this->post();\n $response = $this->site->add_site($data);\n $this->response($response, 200);\n }",
"public function addTags()\n {\n $this->tagsservice->addTags();\n }",
"function set_seo($data = array()) {\n if($data['description']) {\n $meta_description = array(\n '#type' => 'html_tag',\n '#tag' => 'meta',\n '#attributes' => array(\n 'name' => 'description',\n 'content' => $data['description'],\n )\n );\n\n drupal_add_html_head($meta_description,'meta_description');\n }\n \n if($data['keywords']) {\n $meta_keywords = array(\n '#type' => 'html_tag',\n '#tag' => 'meta',\n '#attributes' => array(\n 'name' => 'keywords',\n 'content' => $data['keywords'],\n )\n );\n drupal_add_html_head($meta_keywords,'meta_keywords');\n\n }\n \n $qqCheck = array(\n '#type' => 'html_tag',\n '#tag' => 'meta',\n '#attributes' => array(\n 'name' => 'qc:admins',\n 'content' => '354473327764137776375'\n )\n );\n \n drupal_add_html_head($qqCheck, 'meta_qc:admins');\n \n}",
"public function poi_add() {\r\n\t\t$tag=$this->tagLogic->getOptions();\r\n\t\t$this->assign('tag',$tag);\r\n\t\t$this->display ( 'Admin/poi_add' );\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Format text according to PHP SmartyPants Typographer. | public static function smartyPantsTypographer($text)
{
require_once(__DIR__ . '/php-smartypants/smartypants.php');
return SmartyPants($text);
} | [
"function getSpamCheckFormat()\n {\n return \"<p>{$this->_text}</p>\";\n }",
"function tpl_block_textformat($params, $content, &$template_object)\n{\n\n\t$style = null;\n\t$indent = 0;\n\t$indent_first = 0;\n\t$indent_char = ' ';\n\t$wrap = 80;\n\t$wrap_char = \"\\n\";\n\t$wrap_cut = false;\n\t$assign = null;\n\n\tif($content == null)\n\t{\n\t\treturn false;\n\t}\n\n extract($params);\n\n\tif($style == 'email')\n\t{\n\t\t$wrap = 72;\n\t}\n\t// split into paragraphs\n\t$paragraphs = preg_split('![\\r\\n][\\r\\n]!',$content);\n\n\tforeach($paragraphs as $paragraph)\n\t{\n\t\tif($paragraph == '')\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\t\t// convert mult. spaces & special chars to single space\n\t\t$paragraph = preg_replace(array('!\\s+!','!(^\\s+)|(\\s+$)!'),array(' ',''),$paragraph);\n\t\t// indent first line\n\t\tif($indent_first > 0)\n\t\t{\n\t\t\t$paragraph = str_repeat($indent_char,$indent_first) . $paragraph;\n\t\t}\n\t\t// wordwrap sentences\n\t\t$paragraph = wordwrap($paragraph, $wrap - $indent, $wrap_char, $wrap_cut);\n\t\t// indent lines\n\t\tif($indent > 0)\n\t\t{\n\t\t\t$paragraph = preg_replace('!^!m',str_repeat($indent_char,$indent),$paragraph);\n\t\t}\n\t\t$output .= $paragraph . $wrap_char . $wrap_char;\n\t}\n\tif($assign != null)\n\t{\n\t\t$template_object->assign($assign,$output);\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\techo $output;\n\t}\n\t//echo $content;\n}",
"function template_text_format($text)\n {\n // Remove Escape Character Slashes\n $text = trim(stripslashes($text));\n // Get rid of carriage returns\n $text = str_replace(\"\\r\",\"\",$text);\n // Strip out all html except simple text formatting\n $text = htmlentities($text);\n // Convert urls to hyperlinks\n $text = eregi_replace(\"((http://)|(https://).[^\\s]+)\\ \",\"<a href=\\\"\\\\0\\\">\\\\0</a>\",$text); \n\n if ($_SESSION['prefs']['disable_wrap'] != \"t\") {\n $lines = explode(\"\\n\",$text);\n $text = \"\";\n\n $wrap = preg_match(\"/[0-9]+/\",$_SESSION['prefs']['word_wrap']) ? $_SESSION['prefs']['word_wrap'] : 80;\n foreach ($lines as $key => $val) {\n if (empty($val)) {\n $text .= \"\\n\";\n } else {\n if (strlen($val) > $wrap) {\n $val = wordwrap($val,$wrap,\"\\n\",TRUE);\n }\n\n $text .= stripslashes($val).\"\\n\";\n }\n }\n \n $text = \"<pre>$text</pre>\";\n } else {\n // Replace newlines with <br />'s\n $text = str_replace(\"\\n\",\"<br />\",$text);\n }\n return $text;\n }",
"static function enable_format_text() \t\t{ self::format_text(); }",
"function smarty_block_t($params, $text, &$smarty)\n{\n\t$text = stripslashes($text);\n\t\n\t// set escape mode\n\tif (isset($params['escape'])) {\n\t\t$escape = $params['escape'];\n\t\tunset($params['escape']);\n\t}\n\t\n\t// set plural version\n\tif (isset($params['plural'])) {\n\t\t$plural = $params['plural'];\n\t\tunset($params['plural']);\n\t\t\n\t\t// set count\n\t\tif (isset($params['count'])) {\n\t\t\t$count = $params['count'];\n\t\t\tunset($params['count']);\n\t\t}\n\t}\n\t\n\tglobal $i18n; // LOADING GLOBAL INTERNATIONALISATION\n\n\tif ($text !=\"\")\n\t\t$text = $i18n->translate($text, $params);\n\telse\n\t\t$text=\"\";\n\t\n\n\tif (!isset($escape) || $escape == 'html') { // html escape, default\n\t $text = nl2br(htmlspecialchars($text));\n } elseif (isset($escape)) {\n\t\tswitch ($escape) {\n\t\t\tcase 'javascript':\n\t\t\tcase 'js':\n\t\t\t\t// javascript escape\n\t\t\t\t$text = str_replace('\\'', '\\\\\\'', stripslashes($text));\n\t\t\t\tbreak;\n\t\t\tcase 'url':\n\t\t\t\t// url escape\n\t\t\t\t$text = urlencode($text);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\t\n\treturn $text;\n}",
"public static function format(&$text)\n {\n $text = static::$parsedown->text($text);\n }",
"public function formatMessage($text) {\n\t\t$text = preg_replace('/([~`_])/', \"\\\\$1\", $text);\n\t\t$text = preg_replace('/<highlight>(.*?)<end>/', '**$1**', $text);\n\t\t$text = str_replace(\"<myname>\", $this->chatBot->vars[\"name\"], $text);\n\t\t$text = str_replace(\"<myguild>\", $this->chatBot->vars[\"my_guild\"], $text);\n\t\t$text = str_replace(\"<symbol>\", $this->settingManager->get(\"symbol\"), $text);\n\t\t$text = str_replace(\"<br>\", \"\\n\", $text);\n\t\t$text = str_replace(\"<tab>\", \"\\t\", $text);\n\t\t$text = preg_replace('/<[a-z]+?>(.*?)<end>/', '*$1*', $text);\n\t\t\t\n\t\t$text = strip_tags($text);\n\t\treturn $text;\n\t}",
"function format_content( $text ) {\n\n\t\t$text = wptexturize( $text );\n\t\t$text = convert_chars( $text );\n\t\t$text = wpautop( $text );\n\t\treturn $text;\n\n\t}",
"function flash_tlf_format_str($str) {\n\t\t\n\t\t// Format bold/italic text\n\t\t$str = str_replace(array(\"<strong>\", \"</strong>\"), array('<span fontWeight=\"bold\">', \"</span>\"), $str);\n\t\t$str = str_replace(array(\"<em>\", \"</em>\"), array('<span fontStyle=\"italic\">', '</span>'), $str);\n\n\t\t// Replace invalid HTML character codes with Hex equivalents\n\t\t$str = str_replace(array('&trade;','™','™'), '™', $str);\n\t\t$str = str_replace(array('&copy;','©',\"©\"), '©', $str);\n\t\t$str = str_replace(array('&reg;','®','®'), '®', $str);\n\t\t$str = str_replace(array('’',''','&rlquo;'), \"'\", $str);\n\t\t$str = str_replace(array(\"&ldquo;\", \"“\", \"&rdquo;\", \"”\"), '\"', $str);\n\t\t$str = str_replace(\"•\", \"•\", $str);\n\t\t$str = str_replace(array(\"&hellip;\", \"…\"), \"...\", $str);\n\t\t$str = str_replace(array(\"&ndash;\", \"–\", \"&mdash;\", \"—\"), \"-\", $str);\n\t\t\n\t\treturn NotificationCenter::execute(NotificationCenter::FILTER_XML_FLASH_TLF_FORMAT, $str);\n\t\t\n\t}",
"function format($tplFile=null) \n {\n $error = $this->getTrace();\n if ($tplFile !== null) {\n $code = '?'.'>'.file_get_contents($tplFile).'<'.'?php';\n $code = preg_replace('/(\\?>)(\\r?\\n)/sx', \"$1<?php echo \\\"$2\\\"?>\", $code);\n $code = preg_replace('/(<\\? (?:php\\s+)? ) echo (?=[\\s(]) \\s* (.*?) \\s* (\\?>)/xs', \"$1 \\$__result__ .= ($2); $3\", $code);\n $code = preg_replace_callback('/\\?>\\r?\\n?(.*?)<\\?(?:php)?/s', array(&$this, '_genOutHtml'), $code);\n# echo nl2br(htmlspecialchars($code));\n $__result__ = '';\n eval($code);\n $text = $__result__;\n } else {\n $text = print_r($error, 1);\n }\n $text = preg_replace('/<!--.*?-->/s', \"\", $text);\n $text = preg_replace('/\\t|^[ ]+/m', '', $text);\n $text = preg_replace('/\\s*[\\r\\n]+/s', ' ', $text);\n $text = preg_replace('/\\\\\\\\n/s', \"\\n\", $text);\n return $text;\n }",
"public function getTextFormat($type) {\n\t\t$text = \"\";\n\t\tif (method_exists($this, 'textFormat' . $type)) {\n\t\t\t$text = $this->{\"textFormat\" . $type}();\n\t\t}\n\t\treturn $text;\n\t}",
"function reformat( $text ) {\n\t\treturn str_replace( '<br />', '<br /><br />', wpautop( $text ) );\n\t}",
"public function plain_text_formatter ()\n {\n return $this->app->plain_text_formatter ();\n }",
"abstract public function setTextFormatting( $type, $value );",
"function smartypants($text) {\n // em-dashes\n $text = str_replace('---', \"\\u2014\", $text);\n\n // en-dashes\n $text = str_replace('--', \"\\u2013\", $text);\n\n // opening singles\n $text = preg_replace('/(^|[-\\u2014/(\\[{\"\\s])\\'/', \"$1\\u2018\", $text);\n\n // closing singles & apostrophes\n $text = str_replace(\"'\", \"\\u2019\", $text);\n\n // opening doubles\n $text = preg_replace('/(^|[-\\u2014/(\\[{\\u2018\\s])\"/', \"$1\\u201C\", $text);\n\n // closing doubles\n $text = str_replace('\"', \"\\u201D\", $text);\n\n // ellipses\n $text = str_replace('...', \"\\u2026\", $text);\n\n return $text;\n}",
"function smarty_mod_string_format($string, $format)\r\n{\r\n return sprintf($format, $string);\r\n}",
"public static function format($str, $template) {}",
"function parseTemplateText()\r\n\t{\r\n\t\t$buf = '';\r\n\t\t// we only need this if we are going to use JSP tags for wrapping\r\n\t\t// scriptlet blocks\r\n\t\t//if ($this->reader->matches('<' . '\\\\%'))\r\n\t\t//{\r\n\t\t//\t$buf .= '<' . '%';\r\n\t\t//}\r\n\r\n\t\t$buf .= $this->reader->nextContent();\r\n\r\n\t\t// don't output meaningless whitespace\r\n\t\tif (trim($buf) == '')\r\n\t\t{\r\n\t\t\treturn '';\r\n\t\t}\r\n\t\telseif ($this->ctxt->options->isElIgnored() || strpos($buf, '${') === false)\r\n\t\t{\r\n\t\t\treturn $buf;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn '<?php echo $pageContext->evaluateTemplateText(' . StringUtils::quote($buf) . ');?>';\r\n\t\t}\r\n\t}",
"public function formatPText($value)\r\n\t{\r\n\t\treturn PHtml::nl2p(PHtml::encode($value));\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds multiple Statements to (default) graph. | public function addStatements($Statements, $graphUri = null, array $options = array()); | [
"public function testAddStatements()\n {\n // clear test graph\n $this->fixture->query('CLEAR GRAPH <'.$this->testGraph->getUri().'>');\n\n $anyStatement = new StatementImpl(\n new AnyPatternImpl(),\n new AnyPatternImpl(),\n new AnyPatternImpl(),\n $this->testGraph\n );\n\n // graph is empty\n $statements = $this->fixture->getMatchingStatements($anyStatement, $this->testGraph);\n $this->assertCountStatementIterator(0, $statements);\n\n // 2 triples\n $statements = new ArrayStatementIteratorImpl([\n new StatementImpl(\n $this->nodeFactory->createNamedNode('http://s/'),\n $this->nodeFactory->createNamedNode('http://p/'),\n $this->nodeFactory->createNamedNode('http://o/')\n ),\n new StatementImpl(\n $this->nodeFactory->createNamedNode('http://s/'),\n $this->nodeFactory->createNamedNode('http://p/'),\n new LiteralImpl('test literal')\n ),\n ]);\n\n // add triples\n $this->fixture->addStatements($statements, $this->testGraph);\n\n // graph has two entries\n $statements = $this->fixture->getMatchingStatements($anyStatement, $this->testGraph);\n $this->assertCountStatementIterator(2, $statements);\n }",
"public function add(Statement $statement, array $arguments = null) {}",
"public function setStatements(array $statements);",
"public function add($statement)\n {\n $key = $statement->getKey();\n if(!in_array($key, $this->statementKeys))\n {\n $this->model[] = $statement;\n $this->statementKeys[] = $key;\n }\n }",
"protected function addMultipleStatements(array $statements) {\n\t\tforeach ($statements as $subject => $subjectStatements) {\n\t\t\tforeach ($subjectStatements as $predicate => $objects) {\n\t\t\t\tforeach ($objects as $object) {\n\t\t\t\t\t$this->addStatement($subject, $predicate, $object);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function addDefaultGraph($default){\r\n\t\tif(!in_array($named,$this->default))\r\n\t\t$this->default[] = $default;\r\n\t}",
"public function append($statement)\n\t{\n\t\tarray_push($this->current_clause, $statement);\n\t}",
"function rdf_insert_all($statements, array $options = array()) {\n $result = TRUE;\n foreach ($statements as $statement) {\n $result = call_user_func_array('rdf_insert', array_merge($statement, array($options))) && $result;\n }\n return $result;\n}",
"public function add_statement($statement){\n $this->last_query = $statement;\n if ( $this->debug ){\n array_push($this->debug_queries, $statement);\n }\n return $this;\n }",
"function addAll($otherDataset)\r\n\t{\r\n\t\tfor($iterator = $otherDataset->listNamedGraphs(); $iterator->valid(); $iterator->next())\r\n\t\t{\r\n\t\t\t$this->addNamedGraph($iterator->current());\r\n \t\t};\r\n\r\n \t\tif ($otherDataset->hasDefaultGraph())\r\n \t\t{\r\n \t\t\t$this->defaultGraph = $this->defaultGraph->unite($otherDataset->getDefaultGraph());\r\n \t\t}\r\n\t}",
"public function addExecutedStatement(TracedStatement $stmt)\n {\n array_push($this->executedStatements, $stmt);\n }",
"private static function _register_statements($statements)\n {\n if (count($statements) > 0) {\n $query = \"INSERT INTO `\" . self::STATEMENTS_TABLE . \"` (`model_id`, `md5`, `statement`, `executed`) VALUES\";\n\n foreach ($statements as $statement) {\n $query .= \"(\" . $statement['model_id'] . \",'\" . $statement['md5'] . \"','\" . self::$primary_connection->escape_string($statement['query']) . \"', NOW()),\";\n }\n\n if (!self::$primary_connection->query(substr_replace($query, '', -1)))\n throw new Model_DALM_UNABLE_TO_REGISTER_STATEMENTS_Exception;\n }\n }",
"public function statementNode()\n {\n }",
"private function appendChainedStatement()\n {\n $this->setStatementResult([\n \"name\" => $this->nodeHandler->getName(),\n \"args\" => $this->nodeHandler->getArguments(),\n ], true);\n }",
"public function addStatementsToTransaction(Transaction $transaction, $statements=array(), $commit=false)\n\t{\n\t\t$command = new Command\\AddStatementsToTransaction($this, $transaction, $statements, $commit);\n\t\treturn $this->runCommand($command);\n\t}",
"public function createAllGraphs()\n {\n $db = new DB($this->logLevel, $this->entityManager);\n $nodes = $db->getNodes();\n foreach ($nodes as $node) {\n $this->createGraph($node->getNodeId());\n }\n }",
"public static function resetStatements()\n {\n static::$statements = static::makeStatementCollection();\n }",
"public function addExecutedStatement(TracedStatement $stmt): void\n {\n $this->executedStatements[] = $stmt;\n }",
"function addGraph( $graph ){\n $this->aGraphs[$graph->id] = $graph;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes a Secret. (secrets.delete) | public function delete($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params], SecretmanagerEmpty::class);
} | [
"public function deleteSecret(string $id): void\n {\n $uri = 'projects/secrets/{id}';\n $uriArguments = [\n 'id' => $id,\n ];\n\n $this->client->delete($this->buildUrl($uri, $uriArguments));\n }",
"public function testDeleteCoreV1NamespacedSecret()\n {\n\n }",
"public function delete_secret($username)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! $this->is_loaded)\n $this->_load();\n\n if (! isset($this->secrets[$username]))\n return;\n\n $this->secrets[$username]['linestate'] = self::LINE_DELETE;\n $this->_save();\n }",
"public function testDeleteNamespacedSecret()\n {\n }",
"public function testDeleteCoreV1CollectionNamespacedSecret()\n {\n\n }",
"public static function deleteSecret(string $namespace, string $name, $secret_name)\n {\n return Http::withToken(config('services.drone.token'))\n ->delete(config('services.drone.server') . \"/repos/$namespace/$name/secrets/$secret_name\");\n }",
"public function delete_ppp_secret($id){\n $input = array(\n 'command' => '/ppp/secret/remove',\n 'id' => $id\n );\n return $this->query($input);\n }",
"public function deleteSecret($secretId)\n {\n return $this->requestWithErrorHandling(\n 'delete',\n 'api/secrets/'.$secretId\n );\n }",
"public function delete_secret( $id ) {\n\n\t\t$request = $this->get_new_request( 'webhook' );\n\n\t\t$request->delete_secret( $id );\n\n\t\treturn $this->perform_request( $request );\n\t}",
"public function testDeleteEmbedSecret()\n {\n }",
"public function revokeTempSecret()\n {\n Cache::forget(\"user{$this->id}_temp_secret\");\n }",
"public function destroy(string $key)\n {\n $this->validateSecretExists($key);\n\n $this->secrets->delete($key);\n\n return view('destroyed');\n }",
"public function clear()\n {\n unset($this->secretKeys);\n $this->secretKeys = array();\n }",
"public function deleteToken() {\n Cache::forget(self::TOKEN_NAME);\n }",
"public function deleteToken();",
"public function delete()\n {\n $response = $this->request->request(\n 'users/' . $this->getUser()->id . '/keys/' . $this->id,\n ['method' => 'delete',]\n );\n if ($response['status_code'] !== 200) {\n throw new TerminusException(\n 'There was an problem deleting the SSH key.'\n );\n }\n }",
"public function delete() \r\n\t{\r\n\t\tunset($_SESSION[$this->key]);\r\n\t}",
"protected function getConsole_Command_SecretsRemoveService()\n {\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\console\\\\Command\\\\Command.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\framework-bundle\\\\Command\\\\SecretsRemoveCommand.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\framework-bundle\\\\Secrets\\\\AbstractVault.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\dependency-injection\\\\EnvVarLoaderInterface.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\framework-bundle\\\\Secrets\\\\SodiumVault.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\framework-bundle\\\\Secrets\\\\DotenvVault.php';\n\n $this->privates['console.command.secrets_remove'] = $instance = new \\Symfony\\Bundle\\FrameworkBundle\\Command\\SecretsRemoveCommand(($this->privates['secrets.vault'] ?? ($this->privates['secrets.vault'] = new \\Symfony\\Bundle\\FrameworkBundle\\Secrets\\SodiumVault((\\dirname(__DIR__, 4).'/config/secrets/dev'), $this->getEnv('base64:default::SYMFONY_DECRYPTION_SECRET')))), ($this->privates['secrets.local_vault'] ?? ($this->privates['secrets.local_vault'] = new \\Symfony\\Bundle\\FrameworkBundle\\Secrets\\DotenvVault((\\dirname(__DIR__, 4).'/.env.dev.local')))));\n\n $instance->setName('secrets:remove');\n\n return $instance;\n }",
"function release_secret_lock( string $secret ) : void {\n\ttry {\n\t\twpdesk_release_lock( $secret );\n\t\tdelete_option( get_deadlock_name( $secret ) );\n\t} catch ( Mutex\\MutexNotFoundInStorage $error ) {\n\t\t// No harm done.\n\t}\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show the form for creating a new F2debatec3m2. | public function create()
{
return view('f2debatec3m2s.create');
} | [
"public function create()\n {\n return view('e2debatec2m2s.create');\n }",
"public function create()\n {\n return view('f4aulac2m2s.create');\n }",
"public function create()\n {\n return view('f2aulac2m2s.create');\n }",
"public function create()\n {\n return view('e3debatec2m2s.create');\n }",
"public function create()\n {\n return view('ap1debatec2m2s.create');\n }",
"public function create()\n {\n return view('f1aulac2m2s.create');\n }",
"public function create()\n {\n return view('f3exercicioc2m2s.create');\n }",
"public function create()\n {\n return view('f2exercicioc3m2s.create');\n }",
"public function create()\n {\n return view('p3debatec3m2s.create');\n }",
"public function create()\n {\n return view('f3debatec3m2s.create');\n }",
"public function create()\n {\n return view('ap3aulac3m2s.create');\n }",
"public function create()\n {\n return view('f4exercicioc3m2s.create');\n }",
"public function create()\n {\n return view('e2aulac1m2s.create');\n }",
"public function create()\n {\n return view('p2debatec1m2s.create');\n }",
"public function create()\n {\n return view('e2debatec1m2s.create');\n }",
"public function create()\n {\n return view('ap4aulac3m2s.create');\n }",
"public function create()\n {\n return view('f2aulac1m2s.create');\n }",
"public function create()\n {\n return view('ap1aulac2m2s.create');\n }",
"public function create()\n {\n return view('e3exercicioc2m2s.create');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the formatted errors for the visible fields of this form. | public function renderErrors()
{
$errors = array();
foreach ($this->getVisibleFormFieldsNames() as $name)
{
if ($this[$name]->hasError())
{
$errors[] = $this[$name]->getError();
}
}
return $this->getWidgetSchema()->getFormFormatter()->formatErrorRow($errors);
} | [
"function displayError(){\n\t\tprint \"<div class=\\\"validationerror\\\">\";\n\t\tfor ($i=0;$i<count($this->error);$i++){\n\t\t\tprintln($this->error[$i]);\n\t\t}\n\t\tprint \"</div>\";\n\t}",
"function displayError(){\r\n\t\tprint \"<div class=\\\"validationerror\\\">\";\r\n\t\tfor ($i=0;$i<count($this->error);$i++){\r\n\t\t\tprintln($this->error[$i]);\r\n\t\t}\r\n\t\tprint \"</div>\";\r\n\t}",
"public function displayErrors(){\r\n \r\n foreach($this->getErrors() as $error){\r\n $html = $error.'<br>';\r\n }\r\n return $html;\r\n \r\n }",
"public function RenderErrors ();",
"function renderErrors() {\n\t\treturn $this->dump( 'errors' );\n\t}",
"public function renderGlobalErrors()\n {\n return $this->widgetSchema->getFormFormatter()->formatErrorsForRow($this->getGlobalErrors());\n }",
"public final function display_validation_errors()\n {\n $string = 'Validation errors '. LINE_BREAK .'---';\n \n if(count($this->validation_errors) == 0)\n {\n $string .= LINE_BREAK . \"None\";\n \n } else {\n \n foreach($this->validation_errors as $key => $value)\n {\n $string .= LINE_BREAK .'(' . $key . ') => ' . $value;\n }\n }\n $string .= LINE_BREAK;\n \n echo $string;\n }",
"public function renderErrors()\n {\n if ($this->filterModel instanceof Model && $this->filterModel->hasErrors()) {\n return Html::errorSummary($this->filterModel, $this->filterErrorSummaryOptions);\n } else {\n return '';\n }\n }",
"public function display_errors() {\n foreach ($this->error as $error) {\n echo '<p class=\"error\">' . $error . '</p>';\n }\n }",
"public function display_errors() {\n\t\tforeach ($this->error as $error) {\n\t\t\techo '<p class=\"error\">' . $error . '</p>';\n\t\t}\n\t}",
"public function renderHiddenFields()\n {\n $clone = clone $this;\n\n if ($this->isBound())\n {\n $errorSchemaClass = get_class($this->errorSchema);\n $clone->setErrorSchema(new $errorSchemaClass($this->validatorSchema));\n }\n\n foreach ($this->getFormFieldSchema() as $name => $field)\n {\n if (!$field->isHidden())\n {\n unset($clone[$name]);\n }\n }\n\n return $clone->render();\n }",
"public static function dump_remaining_errors() {\n $errors = [];\n if (self::$validation_errors !== NULL) {\n foreach (self::$validation_errors as $errorKey => $error) {\n if (!in_array($error, self::$displayed_errors)) {\n $errors[] = lang::get($error) . '<br/> ' . lang::get(' (related to attribute {1})', \"[$errorKey]\");\n }\n }\n }\n $r = '';\n if (count($errors)) {\n $msg = <<<TXT\nValidation errors occurred when this form was submitted to the server. The form configuration may be incorrect as\nit appears the controls associated with these messages are missing from the form.\nTXT;\n $r = lang::get($msg) . '<ul><li>' . implode('</li><li>', $errors) . '</li></ul>';\n if (function_exists('hostsite_show_message')) {\n hostsite_show_message($r, 'error');\n }\n return '';\n }\n return $r;\n }",
"function ShowErrBackEnd() {\n if ($this->Err) {\n echo '\n <fieldset class=\"err\" title=\"' . $this->Msg->show_text('MSG_ERRORS') . '\"> <legend>' . $this->Msg->show_text('MSG_ERRORS') . '</legend>\n <div class=\"err_text\">' . $this->Err . '</div>\n </fieldset>';\n }\n }",
"function printErrors(){\r\n\t\tif (!empty($this->error)) {\r\n\t\t\techo \"<div class='error'><ul>\\n\";\r\n\t\t\tforeach($this->error AS $error){\r\n\t\t\t\techo \"<li>$error</li>\\n\";\r\n\t\t\t}\r\n\t\t\techo \"</ul></div>\\n\";\r\n\t\t}\r\n\t}",
"public static function showFormErrors() {\r\n\t\t\tif ( isset($_GET['err']) && $_GET['pt'] && $_SESSION[$_GET['pt']] ) {\r\n\t\t\t\t$errMsg = $_SESSION[$_GET['pt']]['errMsg'];\r\n?>\r\n<div class=\"err\"><?= $errMsg ?></div>\r\n<?\r\n\t\t\t\treturn $errMsg;\r\n\t\t\t}\r\n\t\t\telse if ( isset($_GET['err']) ) {\r\n?>\r\n<div class=\"err\">Произошла неопознанная ошибка.<br />Пожалуйста, <a href=\"<?= WebPage::QUERY ?>\">сообщите администрации сайта</a>.<br />Приносим свои извинения.</div>\r\n<?\r\n\t\t\t}\r\n\t\t}",
"public function display_errors() {\n\t\tif ( count( $this->errors ) ) :\n\t\t?>\n\t\t<div id=\"message\" class=\"error\">\n\t\t\t<p>\n\t\t\t\t<?php echo esc_html( _n( 'There was an issue retrieving your user account: ', 'There were issues retrieving your user account: ', count( $this->errors ), 'editorial-statistics' ) ) ?>\n\t\t\t\t<br /> • <?php echo wp_kses_post( implode( \"\\n\\t\\t\\t\\t<br /> • \", $this->errors ) ) ?>\n\t\t\t</p>\n\t\t</div>\n\t\t<?php\n\t\tendif;\n\t}",
"public function getValidationErrorsHTML()\n {\n // Build HTML unordered list\n $strHTML = '<ul class=\"error\">';\n\n // Loop through balidation errors\n foreach($this->validationErrors as $error)\n {\n // Add list item\n $strHTML .= '<li>' . $error . '</li>';\n }\n\n // End unordered list\n $strHTML .= '</ul>';\n\n // Return HTML\n return $strHTML;\n }",
"private function printOutValidationErrors()\n {\n echo $this->ansiFormat(\"\\n\\nthe following errors occurred:\\n\", Console::BOLD, Console::FG_RED);\n \n $inputs = [];\n \n foreach ($this->_admin->errors as $attributeName => $attribute) {\n $inputs[] = $attributeName;\n foreach ($attribute as $message) {\n $this->stdout(\"\\n\\t - \" . $message, Console::FG_RED);\n }\n }\n \n $this->stdout(\"\\n\\n\");\n \n $this->requestInputs($inputs);\n }",
"public function renderErrors(DebugView $view)\n {\n if ($this->isValid()) return;\n\n echo $view->renderInfo(\"{$this->getClass()} failed config validation\", '');\n $inlinePreStyle = 'display:inline;padding:0 6px';\n $classConfig = Config::forClass($this->getClass());\n\n foreach ($this->getErrors() as $configName => $errors) {\n // Config variable invalid header\n echo <<<EOT\n<h3><pre style=\"{$inlinePreStyle}\">{$this->getClass()}::\\${$configName}</pre> is invalid</h3>\nEOT;\n\n // Config variable value\n echo $view->renderVariable($classConfig->get($configName), [\n 'file' => $this->getClass(),\n 'line' => ':$' . $configName,\n ]);\n\n // List of errors\n echo '<ul>';\n foreach ($errors as $error) {\n $caller = $error[static::CALLER];\n echo <<<EOT\n<li>\n {$error[static::MESSAGE]}\n (<pre style=\"{$inlinePreStyle}\">{$caller['class']}{$caller['type']}{$caller['function']}() - Line {$caller['line']}</pre>)\n</li>\nEOT;\n }\n echo '</ul><hr>';\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Assert that value is a ipv4 and in the given subnet mask. | public static function ipv4InSubnetMask($value, $subnetMask, $message = null, $propertyPath = null)
{
if (is_array($subnetMask)) {
foreach ($subnetMask as $item) {
try {
static::ipv4InSubnetMask($value, $item, $message, $propertyPath);
return;
} catch (\InvalidArgumentException $ex) {}
}
$message = sprintf(
$message ?: 'Value "%s" is not within the %s subnet masks.',
self::stringify($value),
implode(' or ', $subnetMask)
);
throw static::createException($value, $message, static::INVALID_IPV4_SUBNETMASK, $propertyPath, array('subnetMask' => $subnetMask));
}
self::ipv4($value, null, $propertyPath);
// Extract subnetmask data
list($lower, $netmask) = explode('/', $subnetMask, 2);
$lower = ip2long($lower);
$netmask = -1 << (32 - $netmask) & ip2long('255.255.255.255');
$lower &= $netmask;
// Check if the ip is valid
if ((ip2long($value) & $netmask) !== $lower) {
$message = sprintf(
$message ?: 'Value "%s" is not within the %s subnet.',
self::stringify($value),
$subnetMask
);
throw static::createException($value, $message, static::INVALID_IPV4_SUBNETMASK , $propertyPath, array('subnetMask' => $subnetMask));
}
} | [
"public function testIsInNetmaskWithBitsInNetmask() {\n $testip = \"FE80:FFFF:0:FFFF:129:144:52:38\";\n $testprefix = \"FE80::/16\";\n $is = $this->ip->isInNetmask($testip, $testprefix);\n $this->assertTrue($is);\n }",
"public function testIsInNetmaskWithBitsAsParameter()\n {\n $testip = \"FE80:FFFF:0:FFFF:129:144:52:38\";\n $testprefix = \"FE80::\";\n $is = $this->ip->isInNetmask($testip, $testprefix, 16);\n $this->assertTrue($is);\n }",
"public function testIsInNetmaskWithBitsAsParameter() {\n $testip = \"FE80:FFFF:0:FFFF:129:144:52:38\";\n $testprefix = \"FE80::\";\n $is = $this->ip->isInNetmask($testip, $testprefix, 16);\n $this->assertTrue($is);\n }",
"public function testIsInNetmaskWithBitsInIP()\n {\n $testip = \"FE80:FFFF:0:FFFF:129:144:52:38/16\";\n $testprefix = \"FE80::\";\n $is = $this->ip->isInNetmask($testip, $testprefix);\n $this->assertTrue($is);\n }",
"public function testValidate() {\n\t\t$ip = 'test';\n\t\t$this->assertFalse ( $this->_ipv4->validateIP ( $ip ) );\n\t\t$this->assertFalse ( $this->_ipv4->check_ip ( $ip ) );\n\t\t$ip = '192.168.0.1';\n\t\t$this->assertTrue ( $this->_ipv4->validateIP ( $ip ) );\n\t\t$this->assertTrue ( $this->_ipv4->check_ip ( $ip ) );\n\t\t$ip = '999.168.0.1';\n\t\t$this->assertFalse ( $this->_ipv4->validateIP ( $ip ) );\n\t\t$this->assertFalse ( $this->_ipv4->check_ip ( $ip ) );\n\t\t$mask = 'test';\n\t\t$this->assertFalse ( $this->_ipv4->validateNetmask ( $mask ) );\n\t\t$mask = '255.255.255.0';\n\t\t$this->assertTrue ( $this->_ipv4->validateNetmask ( $mask ) );\n\t\t$mask = '999.255.255.0';\n\t\t$this->assertFalse ( $this->_ipv4->validateNetmask ( $mask ) );\n\t}",
"#[@test]\n public function inSubnet() {\n $this->assertTrue(create(new Inet4Address('192.168.2.1'))->inSubnet(new Network(new Inet4Address('192.168.2'), 24)));\n }",
"public function check_ipv4_in_range( $ip, $range ) {\n\t\tif ( strpos( $range, '/' ) !== false ) {\n\t\t\t// $range is in IP/NETMASK format.\n\t\t\tlist($range, $netmask) = explode( '/', $range, 2 );\n\n\t\t\tif ( strpos( $netmask, '.' ) !== false ) {\n\t\t\t\t// $netmask is a 255.255.0.0 format.\n\t\t\t\t$netmask = str_replace( '*', '0', $netmask );\n\t\t\t\t$netmask_dec = ip2long( $netmask );\n\t\t\t\treturn ( ( ip2long( $ip ) & $netmask_dec ) === ( ip2long( $range ) & $netmask_dec ) );\n\t\t\t} else {\n\t\t\t\t// $netmask is a CIDR size block\n\t\t\t\t// fix the range argument.\n\t\t\t\t$x = explode( '.', $range );\n\t\t\t\t$x_count = count( $x );\n\n\t\t\t\twhile ( $x_count < 4 ) {\n\t\t\t\t\t$x[] = '0';\n\t\t\t\t\t$x_count = count( $x );\n\t\t\t\t}\n\n\t\t\t\tlist($a,$b,$c,$d) = $x;\n\t\t\t\t$range = sprintf( '%u.%u.%u.%u', empty( $a ) ? '0' : $a, empty( $b ) ? '0' : $b, empty( $c ) ? '0' : $c, empty( $d ) ? '0' : $d );\n\t\t\t\t$range_dec = ip2long( $range );\n\t\t\t\t$ip_dec = ip2long( $ip );\n\n\t\t\t\t// Strategy 1 - Create the netmask with 'netmask' 1s and then fill it to 32 with 0s\n\t\t\t\t// $netmask_dec = bindec(str_pad('', $netmask, '1') . str_pad('', 32-$netmask, '0'));\n\t\t\t\t// Strategy 2 - Use math to create it.\n\t\t\t\t$wildcard_dec = pow( 2, ( 32 - $netmask ) ) - 1;\n\t\t\t\t$netmask_dec = ~ $wildcard_dec;\n\n\t\t\t\treturn ( ( $ip_dec & $netmask_dec ) === ( $range_dec & $netmask_dec ) );\n\t\t\t}\n\t\t} else {\n\t\t\t// Range might be 255.255.*.* or 1.2.3.0-1.2.3.255.\n\t\t\tif ( strpos( $range, '*' ) !== false ) { // a.b.*.* format\n\t\t\t\t// Just convert to A-B format by setting * to 0 for A and 255 for B.\n\t\t\t\t$lower = str_replace( '*', '0', $range );\n\t\t\t\t$upper = str_replace( '*', '255', $range );\n\t\t\t\t$range = \"$lower-$upper\";\n\t\t\t}\n\n\t\t\t// A-B format.\n\t\t\tif ( strpos( $range, '-' ) !== false ) {\n\t\t\t\tlist($lower, $upper) = explode( '-', $range, 2 );\n\t\t\t\t$lower_dec = (float) sprintf( '%u', ip2long( $lower ) );\n\t\t\t\t$upper_dec = (float) sprintf( '%u', ip2long( $upper ) );\n\t\t\t\t$ip_dec = (float) sprintf( '%u', ip2long( $ip ) );\n\t\t\t\treturn ( ( $ip_dec >= $lower_dec ) && ( $ip_dec <= $upper_dec ) );\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\t}",
"public function testGetNetmaskOneParameter() {\n $testip = \"FE80:0:0:FFFF:129:144:52:38/16\";\n $is = $this->ip->getNetmask($testip);\n $this->assertEquals( \"fe80:0:0:0:0:0:0:0\", $is);\n }",
"public function validateIpv4($value)\n {\n if ($this->_filter->validateBlank($value)) {\n return ! $this->_filter->getRequire();\n }\n \n // does the value convert back and forth properly?\n $result = ip2long($value);\n if ($result == -1 || $result === false) {\n // does not properly convert to a \"long\" result\n return false;\n } elseif (long2ip($result) !== $value) {\n // the long result does not convert back to an identical original\n // value\n return false;\n } else {\n // looks valid\n return true;\n }\n }",
"public function testGetNetmaskOneParameter()\n {\n $testip = \"FE80:0:0:FFFF:129:144:52:38/16\";\n $is = $this->ip->getNetmask($testip);\n $this->assertEquals(\"fe80:0:0:0:0:0:0:0\", $is);\n }",
"public function testGetNetmaskTwoParameters()\n {\n $testip = \"FE80:0:0:FFFF:129:144:52:38\";\n $is = $this->ip->getNetmask($testip, 16);\n $this->assertEquals(\"fe80:0:0:0:0:0:0:0\", $is);\n }",
"public function testGetNetmaskTwoParameters() {\n $testip = \"FE80:0:0:FFFF:129:144:52:38\";\n $is = $this->ip->getNetmask($testip, 16);\n $this->assertEquals( \"fe80:0:0:0:0:0:0:0\", $is);\n }",
"function is_ipaddr_valid($val)\n{\n return is_string($val) && (is_ipaddr($val) || is_masksubnet($val) || is_subnet($val) || is_iprange_sg($val));\n}",
"function is_ipaddr4($var) {\r\n\tif (!is_string($var))\r\n\t\treturn FALSE;\r\n\treturn filter_var($var, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);\r\n}",
"protected function validateIP_IPv4($ipAddress) {\n\t\t$parts = t3lib_div::trimExplode('/', $ipAddress);\n\t\tif ((count($parts) == 1) || (count($parts) == 2)) {\n\t\t\t$address = $parts[0];\n\t\t\t$netmask = $parts[1];\n\t\t\t$ip_int = ip2long($address);\n\n\t\t\tif (strlen($netmask)) {\n\t\t\t\tif (t3lib_div::testInt($netmask)) {\n\t\t\t\t\t$netmask_int = $this->netmask_digits2int($netmask);\n\t\t\t\t} else {\n\t\t\t\t\t$netmask_int = ip2long($netmask);\n\t\t\t\t}\n\t\t\t} elseif (strpos($address, '*') !== false) {\n\t\t\t\t$addressAndNetmask = $this->wildcardedIP_to_addressAndNetmask($address);\n\t\t\t\tif (!$addressAndNetmask) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t$ip_int = $addressAndNetmask[0];\n\t\t\t\t$netmask_int = $addressAndNetmask[1];\n\t\t\t} else {\n\t\t\t\t\t// When no netmask is given the passed IP specifies a host address (255.255.255.255)\n\t\t\t\t$netmask_int = 0xffffffff;\n\t\t\t}\n\t\t\tif (!$this->netmask_ok($netmask_int)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn array($ip_int, $netmask_int);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function testIPv4Match()\n {\n $cidrMatch = new CIDRmatch();\n $this->assertTrue($cidrMatch->match('104.132.31.99', '104.132.0.0/14'));\n $this->assertTrue($cidrMatch->match('74.125.60.99', '74.125.0.0/16'));\n\n }",
"public function ipv4($value)\r\n {\r\n return filter_var($value, \\FILTER_VALIDATE_IP, \\FILTER_FLAG_IPV4) !== false;\r\n }",
"public function assertIPv4CIDR($object){\n \tif(!self::isIPv4CIDR($object)){\n \t\tself::throwException('valid IPv4 CIDR address', $object);\n \t}\n }",
"#[@test]\n public function inSubnet() {\n $this->assertTrue(create(new Inet6Address('::1'))->inSubnet(new Network(new Inet6Address('::1'), 120)));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a stream with a string body | private function createStreamWithStringBody(string $body): IStream&MockObject
{
$stream = $this->createMock(IStream::class);
$stream->expects($this->once())
->method('__toString')
->willReturn($body);
return $stream;
} | [
"public function createBodyStream(): InputStream;",
"public function bodyStream(): Stream\n {\n }",
"public function setBodyStream($string)\n {\n $this->bodyStream = $string;\n }",
"public function getBodyStream();",
"public static function getRequestBodyStream() {}",
"public function withBody(ReadableStream $stream): Message;",
"protected function createDefaultBody()\n {\n return Stream::open('data://text/plain,', 'r');\n }",
"public function setBodyString($body)\n {\n $stream = new Stream('php://memory', 'wb+');\n $stream->write($body);\n $this->setBody($stream);\n return $this;\n }",
"public function setBody(StreamInterface $body);",
"public function setBody(StreamableInterface $body);",
"private function normalizeBody($body = null)\n {\n $body = $body ? $body : new Stream(fopen('php://temp', 'r+'));\n if (is_string($body)) {\n $memoryStream = fopen('php://temp', 'r+');\n fwrite($memoryStream, $body);\n rewind($memoryStream);\n $body = new Stream($memoryStream);\n } elseif (!($body instanceof StreamInterface)) {\n throw new InvalidArgumentException(\n 'Body must be a string, null or implement Psr\\Http\\Message\\StreamInterface'\n );\n }\n\n return $body;\n }",
"abstract protected function createStream();",
"public function createStream(string $content = ''): StreamInterface\n {\n $resource = fopen('php://temp', 'r+');\n assert($resource !== false, 'Unable to create resource');\n fwrite($resource, $content);\n rewind($resource);\n\n return $this->createStreamFromResource($resource);\n }",
"public function stream(string $input)\n {\n $fp = fopen('php://temp', 'wb');\n fwrite($fp, $input);\n return new Stream($fp);\n }",
"public function toStream($string)\n {\n if (! $this->hash) {\n fwrite($this->stream, $string);\n\n return $this->stream;\n }\n\n return $this->mergeStream($string, $this->stream);\n }",
"public function testReadingAsStringConvertsUnderlyingStreamToString(): void\n {\n /** @var IStream&MockObject $stream */\n $stream = $this->createMock(IStream::class);\n $stream->expects($this->once())\n ->method('__toString')\n ->willReturn('foo');\n $body = new StreamBody($stream);\n $this->assertSame('foo', $body->readAsString());\n }",
"private function newStream($headers, $contents)\n {\n return $this->newObject(\"<<\\n\"\n . $headers\n . \"\\n/Length \" . strlen($contents) . \"\\n\"\n . \">>\\n\"\n . \"stream\\n\"\n . $contents\n . \"\\nendstream\", true);\n }",
"public function withBody(StreamInterface $body){\r\n \t$clone = clone $this;\r\n \t$clone->body = $body;\r\n \treturn $clone;\r\n }",
"private function toStream($string)\n {\n $stream = fopen('php://temp', 'r+');\n fwrite($stream, $string);\n rewind($stream);\n\n return $stream;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Suggest the channel mapping, based on levenshtein matching | public static function suggestChannelMapping($internal_fields_array,$channel_fields_array)
{
$lev_min_matching_grade = DFBUILDER_CHANNEL_FINALIZE_SENSITIVITY; // adjust the matching grade for the channel mapping
$return_arrays = [];
foreach($internal_fields_array as $internal_fields) {
$found = [];
foreach($channel_fields_array as $channel_fields) {
$lev_result = levenshtein_difference($internal_fields,$channel_fields);
if($lev_result >= $lev_min_matching_grade ) {
$found[$lev_result] = [$internal_fields => $channel_fields ] ;
}
}
if(count($found) == 0 ) {
continue;
}
$found_key = max(array_keys($found));
$found_array =$found[$found_key];
$found_array_value = $found_array[key($found_array)];
$return_arrays[key($found_array)] = $found_array_value;
unset($channel_fields_array[array_search($found_array_value,$channel_fields_array)]);
}
return $return_arrays;
} | [
"function levenshtein_calculer($term) {\n\n\t// La comparaison ce fait sans les majuscules\n\t$term = strtolower($term);\n\n\t// On demande au pipeline de travailler de sortir les mots qui s'approche\n\t$get_lev = pipeline('levenshtein_calculer', array('mot' => array(), 'term' => $term));\n\n\t// Simplification du tableau allfetsel\n\t$get_lev = array_column($get_lev['mot'], 'mot');\n\n\t// Cette variable va contenu un index des distances de levenshtein\n\t$lev_index = array();\n\n\t// On boucle sur les SOUNDEX\n\tforeach ($get_lev as $lev) {\n\t\t// On calcule la distance\n\t\t$distance = levenshtein($term, $lev);\n\n\t\t// Si on trouve un mot, il n'y a pas de faute, on renvoie directement\n\t\tif ($distance == 0) {\n\t\t\treturn $lev;\n\t\t} else {\n\t\t\t// ce n'est pas un perfect match, on va ajouter le mot\n\t\t\t// à notre index de distance\n\t\t\t$index[$lev] = $distance;\n\t\t}\n\t}\n\n if (!empty($index)) {\n // Trier le tableau pour avoir les plus petites distances au dessus\n asort($index);\n\n // On chercher la distance la plus proche\n $min = min($index);\n\n // Renvoyer les mots les plus probables\n $index = array_keys($index, $min);\n\n return $index;\n } else {\n return false;\n }\n}",
"function normalize_matches($query_string,$match_array)\n{\n foreach($match_array as $match => $score )\n {\n $score = $score/(1+levenshtein ( $query_string, $match));\n $match_array[$match] = $score;\n }\n arsort($match_array);\n return $match_array;\n}",
"function customLevenshtein($str1, $str2) {\n $_REQUEST[ABJ404_PP]['debug_info'] = 'customLevenshtein. str1: ' . esc_html($str1) . ', str2: ' . esc_html($str2);\n\n $sRow = $this->multiByteStringToArray($str1);\n $sCol = $this->multiByteStringToArray($str2);\n $RowLen = count($sRow);\n $ColLen = count($sCol);\n $cost = 0;\n \n /// Test string length. URLs should not be more than 2,083 characters\n if (max($RowLen, $ColLen) > 4096) {\n throw new Exception(\"Maximum string length in customLevenshtein is \" . 4096 . \". Yours is \" . \n max($RowLen, $ColLen) + \".\");\n }\n \n // Step 1\n if ($RowLen == 0) {\n return $ColLen;\n } else if ($ColLen == 0) {\n return $RowLen;\n }\n\n /// Create the two vectors\n $v0 = array_fill(0, $RowLen + 1, 0);\n $v1 = array_fill(0, $RowLen + 1, 0);\n \n /// Step 2\n /// Initialize the first vector\n for ($RowIdx = 1; $RowIdx <= $RowLen; $RowIdx++) {\n $v0[$RowIdx] = $RowIdx;\n }\n \n // Step 3\n /// For each column\n for ($ColIdx = 1; $ColIdx <= $ColLen; $ColIdx++) {\n /// Set the 0'th element to the column number\n $v1[0] = $ColIdx;\n \n $Col_j = $sCol[$ColIdx - 1];\n\n // Step 4\n /// For each row\n for ($RowIdx = 1; $RowIdx <= $RowLen; $RowIdx++) {\n $Row_i = $sRow[$RowIdx - 1];\n \n // Step 5\n if ($Row_i == $Col_j) {\n $cost = 0;\n } else {\n $cost = 1;\n }\n\n // Step 6\n /// Find minimum\n // cost to delete/insert: = $m_min = $v0[$RowIdx] + 1;\n // cost to delete/isnert: = $v1[$RowIdx - 1] + 1;\n // cost to replace: = $v0[$RowIdx - 1] + $cost;\n \n $v1[$RowIdx] = min($v0[$RowIdx] + 1, $v1[$RowIdx - 1] + 1, $v0[$RowIdx - 1] + $cost);\n }\n\n /// Swap the vectors\n $vTmp = $v0;\n $v0 = $v1;\n $v1 = $vTmp;\n }\n\n $_REQUEST[ABJ404_PP]['debug_info'] = 'Cleared after customLevenshtein.';\n return $v0[$RowLen];\n }",
"function getPOINames($name, $matches, $guessbest=FALSE, $levmaxratio=0.20) {\n if ( empty($matches) ) return NULL;\n $newmatches = array();\n \n try {\n $pgconn = getDBConnection();\n \n foreach ($matches as $m) {\n $l = $m->locuuid;\n $sql = \"select parentid from location where myid = '$l'\";\n // echo \"SQL: $sql\\n\";exit;\n $c = $pgconn->query($sql);\n if ( $c ) {\n foreach ($c as $row) { \n $names = array();\n $foundone = false;\n // got location's parent id\n $puuid = $row['parentid'];\n $m->poiuuid = $puuid;\n\n // if no name was passed, don't do name match, just stop at adding the poiuuid to the match candidate\n if ( empty($name) ) {\n continue;\n }\n\n // now get LABELs with the same parent uuid\n $sql = \"select value from poitermtype where parentid = '$puuid' and objname like 'LABEL'\";\n $d = $pgconn->query($sql);\n $result = 0.0;\n if ( $d ) {\n foreach ($d as $lrow) { \n $v = $lrow['value'];\n \n //// The Levenshtein distance is defined as the minimal number of characters you have to \n //// replace, insert or delete to transform str1 into str2. \n $result = levenshtein($name, $v);\n\t\t\t\t\t\t\t//// now scale it by the number of characters in the original name\n\t\t\t\t\t\t\t//// (note: this value may be greater than 1 if length of input string is greater than \n\t\t\t\t\t\t\t//// length of original, and # of characters to change is greater than original)\n\t\t\t\t\t\t\t$result = $result / strlen($name);\n // echo \"$name matched against $v>> \\nresult: $result | distance: $m->dist\\n\";\n \n // if ( $result >= $minscore ) {\n if ( $result < $levmaxratio ) {\n $names[$v] = $result;\n $foundone = true;\n // echo \"got label: $v\\tscore: $result\\n\";\n }\n }\n $m->labels = $names;\n if ( $foundone ) $newmatches[] = $m;\n\n // if we want to try to use a shortcut and return a really close match as soon \n // as it's found....\n if ( $guessbest && $result < 0.010 ) return array($m);\n } // end if d (labels exist)\n } // end for each row in location query (should only be 1)\n } // end if any location with the right id\n } // end looping on matches\n $conn = NULL;\n } catch (Exception $e) {\n echo \"conflate->getPOINames() failed: \" . $e->getMessage() . \"\\n\";\n return NULL; // successful loading is false\n }\n \n return $newmatches;\n}",
"function levenshtein($str1, $str2, $cost_ins, $cost_rep, $cost_del)\n{\n}",
"function levenshtein($str1, $str2)\n{\n return 0;\n}",
"function weak_match_with($a, $b, $match) {\r\n\t\t$match_items = explode(',', $match);\r\n\t\tif ($match_items) {\r\n\t\t\tforeach ($match_items as $match_item) {\r\n\t\t\t\t$match_item = trim($match_item);\r\n\t\t\t\tif (strcmp(trim((string) $a), (string) $match_item) == 0) {\r\n\t\t\t\t\tforeach ($match_items as $tmp_match_item) {\r\n\t\t\t\t\t\t$tmp_match_item = trim($tmp_match_item);\r\n\t\t\t\t\t\tif (strcmp(trim((string) $b), (string) $tmp_match_item) == 0) {\r\n\t\t\t\t\t\t\treturn 100;\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\treturn 0;\r\n\t\t} else {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}",
"function score_matches($bot_parent_id,$allrows,$lookingfor,$current_thatpattern,$current_topic,$default_aiml_pattern){\n\tglobal $commonwordsArr;\n\t\n\trunDebug( __FILE__, __FUNCTION__, __LINE__, \"Scoring the matches\",4);\n\t\n\t//set the scores for each type of word or sentance to be used in this function\n\t$default_pattern_points = 2;\n\t$underscore_points = 100;\n\t$starscore_points = 1;\t\n\t$uncommon_word_points = 6;\t\n\t$common_word_points = 3;\t\t\n\t$direct_match = 1;\n\t$topic_match = 50;\n\t$that_pattern_match = 75; \n\t$that_pattern_match_general = 9;\n\t$this_bot_match = 500; //even the worst match from the actual bot is better than the best match from the base bot\n\t\n\t//loop through all relevant results\n\tforeach($allrows as $all => $subrow){\n\t\t//get items\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t$aiml_pattern = trim($subrow['pattern']);\n\t\t$aiml_thatpattern = trim($subrow['thatpattern']);\n\t\t$aiml_topic = trim($subrow['topic']);\n\n\t\t\n\t\t\n\t\tif(!isset($subrow['pattern']))\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\t\n\t\t//convert aiml wildcards to php wildcards\n\t\tif($aiml_thatpattern!=\"\"){\n\t\t\t$aiml_thatpattern_wildcards = match_wildcard_rows($aiml_thatpattern);\n\t\t}else{\n\t\t\t$aiml_thatpattern_wildcards = \"\";\n\t\t}\n\t\t\n\t\t//to debug the scoring...\n\t\t$allrows[$all]['track_score']=\"\";\n\t\t\n\t\t//if the aiml is from the actual bot and not the base bot\n\t\t//any match in the current bot is better than the base bot\n\t\tif(($bot_parent_id!=0)&&($allrows[$all]['bot_id']!=$bot_parent_id)){\n\t\t\t$allrows[$all]['score']+=$this_bot_match;\n\t\t\t$allrows[$all]['track_score'].=\"a\";\n\t\t} \t\t\t\n\t\t//if the result aiml pattern matches the user input increase score\n\t\tif($aiml_pattern==$lookingfor){\n\t\t\t$allrows[$all]['score']+=$direct_match;\n\t\t\t$allrows[$all]['track_score'].=\"b\";\n\t\t} \t\t\n\t\t//if the result topic matches the user stored aiml topic increase score \n\t\tif(($aiml_topic==$current_topic) && ($aiml_topic!=\"\")) {\n\t\t\t$allrows[$all]['score']+=$topic_match;\n\t\t\t$allrows[$all]['track_score'].=\"c\";\n\t\t} \t\n\t\t//if the result that pattern matches the user stored that pattern increase score\n\t\tif(($aiml_thatpattern==$current_thatpattern) && ($aiml_thatpattern!=\"\") && ($aiml_pattern!=\"*\")){\n\t\t\t$allrows[$all]['score']+=$that_pattern_match;\n\t\t\t$allrows[$all]['track_score'].=\"d\";\n\t\t}elseif(($aiml_thatpattern_wildcards!=\"\") && ($aiml_thatpattern!=\"\") && ($aiml_pattern!=\"*\") && (preg_match($aiml_thatpattern_wildcards,$current_thatpattern,$m))){\n\t\t\t$allrows[$all]['score']+=$that_pattern_match;\n\t\t\t$allrows[$all]['track_score'].=\"e\";\n\t\t}\t\n\t\t\t//if the that pattern is just a star we need to score it seperately as this is very general\n\t\t\tif( ($aiml_pattern==\"*\")&&( (substr($aiml_thatpattern, -1)==\"*\") || (substr($aiml_thatpattern, 0, 1)==\"*\")) )\n\t\t\t{\n\t\t\t\t\n\t\t\t\t//if the result that pattern matches the user stored that pattern increase score with a lower number\n\t\t\t\tif(($aiml_thatpattern==$current_thatpattern) && ($aiml_thatpattern!=\"\")){\n\t\t\t\t\t$allrows[$all]['score']+=$that_pattern_match_general;\n\t\t\t\t\t$allrows[$all]['track_score'].=\"f\";\n\t\t\t\t}elseif(($aiml_thatpattern_wildcards!=\"\") && ($aiml_thatpattern!=\"\") && (preg_match($aiml_thatpattern_wildcards,$current_thatpattern,$m))){\n\t\t\t\t\t$allrows[$all]['score']+=$that_pattern_match_general;\n\t\t\t\t\t$allrows[$all]['track_score'].=\"g\";\n\t\t\t\t\t}\n\t\t\t}\n\t\t \t\t\t\n\n\t\t//if stored result == default pattern increase score\n\t\tif(strtolower($aiml_pattern)==strtolower($default_aiml_pattern)){\n\t\t\t$allrows[$all]['score']+=$default_pattern_points;\n\t\t\t$allrows[$all]['track_score'].=\"h\";\n\t\t} elseif($aiml_pattern==\"*\"){ //if stored result == * increase score\n\t\t\t$allrows[$all]['score']+=$starscore_points;\n\t\t\t$allrows[$all]['track_score'].=\"i\";\n\t\t} elseif($aiml_pattern==\"_\"){ //if stored result == _ increase score\n\t\t\t$allrows[$all]['score']+=$underscore_points;\n\t\t\t$allrows[$all]['track_score'].=\"j\";\n\t\t} else { //if stored result == none of the above BREAK INTO WORDS AND SCORE INDIVIDUAL WORDS\n\t\t\t$wordsArr = explode(\" \",$aiml_pattern);\t\t\n\t\t\tforeach($wordsArr as $index => $word){\n\t\t\t\t$word = strtolower(trim($word));\n\t\t\t\tif(in_Array($word,$commonwordsArr)){ // if it is a commonword increase with (lower) score\n\t\t\t\t\t$allrows[$all]['score']+=$common_word_points;\n\t\t\t\t\t$allrows[$all]['track_score'].=\"k\";\n\t\t\t\t} elseif($word==\"*\"){\n\t\t\t\t\t$allrows[$all]['score']+=$starscore_points; //if it is a star wildcard increase score\n\t\t\t\t\t$allrows[$all]['track_score'].=\"l\";\n\t\t\t\t} elseif($word==\"_\"){\n\t\t\t\t\t$allrows[$all]['score']+=$underscore_points; //if it is a underscore wildcard increase score\n\t\t\t\t\t$allrows[$all]['track_score'].=\"m\";\n\t\t\t\t} else {\n\t\t\t\t\t$allrows[$all]['score']+=$uncommon_word_points; //else it must be an uncommon word so increase the score\n\t\t\t\t\t$allrows[$all]['track_score'].=\"n\";\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//send off for debugging \n\tsort2DArray(\"show top scoring aiml matches\",$allrows,\"score\", 1,10);\n\t\n\t/*\n\techo \"<pre>\";\n\tprint_r($allrows);\n\techo \"</pre>\";\n\t*/\n\t\n\treturn $allrows; //return the scored rows\n}",
"public function improveComplexMatchesCausedByHarmonizedModels() {\r\n\t\t\r\n\t\t$correspondencyCache = NLP::loadCorrespondentLabelsFromPersistedFile();\r\n\t\t$nonCorrespondencyCache = NLP::loadNonCorrespondentLabelsFromPersistedFile();\r\n\t\t$matchingCorrespondenceCache = NLP::loadMatchingCorrespondentLabelsFromPersistedFile();\r\n\t\t$matchingNonCorrespondenceCache = NLP::loadMatchingNonCorrespondentLabelsFromPersistedFile();\r\n\t\t$labelElements = NLP::loadLabelElementsFromPersistedFile();\r\n\t\t\r\n\t\t$complexMatches = $this->getComplexMatches();\r\n\t\tforeach ( $complexMatches as $match ) {\r\n\t\t\t$bestSimValue = 0;\r\n\t\t\t$nodeID1ForMap = null;\r\n\t\t\t$nodeID2ForMap = null;\r\n\t\t\t$nodeLabel1ForMap = null;\r\n\t\t\t$nodeLabel2ForMap = null;\r\n\t\t\tforeach ( $match->nodeIDsOfModel1 as $nodeID1 ) {\r\n\t\t\t\tforeach ( $match->nodeIDsOfModel2 as $nodeID2 ) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t$label1 = $this->epc1->getNodeLabel($nodeID1);\r\n\t\t\t\t\t$label2 = $this->epc2->getNodeLabel($nodeID2);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (strtolower($label1) == strtolower($label2)) {\r\n\t\t\t\t\t\t$bestSimValue = 1;\r\n\t\t\t\t\t\t$nodeID1ForMap = $nodeID1;\r\n\t\t\t\t\t\t$nodeID2ForMap = $nodeID2;\r\n\t\t\t\t\t\t$nodeLabel1ForMap = $label1;\r\n\t\t\t\t\t\t$nodeLabel2ForMap = $label2;\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t/**\r\n\t\t\t\t\t * Aehnlichkeit ueber Porter-Stems bestimmen\r\n\t\t\t\t\t */\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t$node1 = new FunctionOntologyWithSynonyms ($this->epc1, $nodeID1, $label1);\r\n\t\t\t\t\t$node2 = new FunctionOntologyWithSynonyms ($this->epc2, $nodeID2, $label2);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t$countWordstemsOfLabel1 = count ( $node1->wordstems );\r\n\t\t\t\t\t$countWordstemsOfLabel2 = count ( $node2->wordstems );\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tif ($countWordstemsOfLabel1 > $countWordstemsOfLabel2) {\r\n\t\t\t\t\t\t// Label1 muss immer dasjenigen mit der geringeren Anzahl an Komponenten (Woertern) sein\r\n\t\t\t\t\t\t$node_temp = $node1;\r\n\t\t\t\t\t\t$node1 = $node2;\r\n\t\t\t\t\t\t$node2 = $node_temp;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t$countWordstemMappings = 0;\r\n\t\t\t\t\tforeach ( $node1->wordstems as $wordstem1 ) {\r\n\t\t\t\t\t\tforeach ( $node2->wordstems as $wordstem2 ) {\r\n\t\t\t\t\t\t\tif ($wordstem1 == $wordstem2) {\r\n\t\t\t\t\t\t\t\t$countWordstemMappings ++;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t$stemSimilarity = round ( (2 * $countWordstemMappings / ($countWordstemsOfLabel1 + $countWordstemsOfLabel2)) * 100, 2 );\r\n\r\n\t\t\t\t\tif ( $stemSimilarity >= $bestSimValue ) {\r\n\t\t\t\t\t\t$bestSimValue = $stemSimilarity;\r\n\t\t\t\t\t\t$nodeID1ForMap = $nodeID1;\r\n\t\t\t\t\t\t$nodeID2ForMap = $nodeID2;\r\n\t\t\t\t\t\t$nodeLabel1ForMap = $label1;\r\n\t\t\t\t\t\t$nodeLabel2ForMap = $label2;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tforeach ( $match->nodeIDsOfModel1 as $nodeID1 ) {\r\n\t\t\t\tforeach ( $match->nodeIDsOfModel2 as $nodeID2 ) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ( $nodeID1ForMap == $nodeID1 && $nodeID2ForMap == $nodeID2 ) continue;\r\n\t\t\t\t\t\r\n\t\t\t\t\t$verb1ForMap = NLP::getLabelVerb($nodeLabel1ForMap, $labelElements);\r\n\t\t\t\t\t\r\n\t\t\t\t\tforeach ( $this->mapping as $index => $pair ) {\r\n\t\t\t\t\t\t$id1_arr = array_keys($pair);\r\n\t\t\t\t\t\t$id1 = $id1_arr[0];\r\n\t\t\t\t\t\t$id2 = $pair[$id1];\r\n\t\t\t\t\t\t$label1 = $this->epc1->getNodeLabel($id1);\r\n\t\t\t\t\t\t$label2 = $this->epc2->getNodeLabel($id2);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ( strtolower($label1) == strtolower($label2) ) continue;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ( $nodeID1 == $id1 && $nodeID2 == $id2 ) {\r\n\t\t\t\t\t\t\t$verb1 = NLP::getLabelVerb($label1, $labelElements);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ( !NLP::areAntonymVerbs($verb1, $verb1ForMap) ) {\r\n\t\t\t\t\t\t\t\tunset($this->mapping[$index]);\r\n\t\t\t\t\t\t\t\tprint(\" map between \\\"\".$label1.\"\\\" and \\\"\".$label2.\"\\\" removed (complexity reduction caused by harmonization degree)\\n\");\r\n\t\t\t\t\t\t\t\t//print(\" map between \\\"\".$label1.\"\\\" and \\\"\".$label2.\"\\\" removed (complexity reduction caused by harmonization degree, conflict: \".$nodeLabel1ForMap.\" => \".$nodeLabel2ForMap.\")\\n\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function test_corrected_to_compared_bypass() {\r\n $bestmatchpair = $this->make_pair('abc cde', 'cae abo sizeo');\r\n $this->question->lexicalerrorthreshold = 0.99;\r\n $this->question->lexicalerrorweight = 0.1;\r\n $analyzer = new qtype_correctwriting_lexical_analyzer($this->question, $bestmatchpair, $this->lang, true);\r\n $result = $analyzer->result_pairs();\r\n\r\n $this->assertTrue(count($result) == 1);\r\n /** @var qtype_correctwriting_string_pair $pair */\r\n $pair = $result[0];\r\n $string = $this->corrected_to_string($pair);\r\n $this->assertTrue($string == 'cae abo sizeo', $string);\r\n\r\n $index = $pair->map_from_corrected_string_to_compared_string(0);\r\n $this->assertTrue($index == array( 0 ), implode(' ', $index));\r\n\r\n $index = $pair->map_from_corrected_string_to_compared_string(1);\r\n $this->assertTrue($index == array( 1 ), implode(' ', $index));\r\n\r\n $index = $pair->map_from_corrected_string_to_compared_string(2);\r\n $this->assertTrue($index == array( 2 ), implode(' ', $index));\r\n }",
"public function testSuggestCaseSensitive()\n {\n $haystack = [\n 'apple',\n 'pineapple',\n 'banana',\n 'orange',\n 'radish',\n 'carrOT',\n 'carrot',\n 'Carrot',\n 'CARROT',\n 'pea',\n 'bean',\n 'potato'\n ];\n\n $matcher = new Suggester(new LevensteinComparer());\n $results = $matcher->suggest('Carrot', $haystack);\n\n $resultStrs = array_map(function (MatchResultInterface $result) {\n return $result->getString();\n }, $results);\n\n $this->assertEquals(\n [\n 'Carrot',\n 'carrot',\n 'carrOT',\n 'apple',\n 'banana',\n 'radish',\n 'CARROT',\n 'orange',\n 'pea',\n 'bean',\n 'potato',\n 'pineapple',\n ],\n $resultStrs\n );\n }",
"public function test_corrected_to_compared_moved() {\r\n $bestmatchpair = $this->make_pair('abc cde', 'cde abc');\r\n $analyzer = new qtype_correctwriting_lexical_analyzer($this->question, $bestmatchpair, $this->lang, false);\r\n $result = $analyzer->result_pairs();\r\n\r\n $this->assertTrue(count($result) == 1);\r\n /** @var qtype_correctwriting_string_pair $pair */\r\n $pair = $result[0];\r\n $string = $this->corrected_to_string($pair);\r\n $this->assertTrue($string == 'cde abc', $string);\r\n\r\n $index = $pair->map_from_corrected_string_to_compared_string(0);\r\n $this->assertTrue($index == array( 0 ), implode(' ', $index));\r\n\r\n $index = $pair->map_from_corrected_string_to_compared_string(1);\r\n $this->assertTrue($index == array( 1 ), implode(' ', $index));\r\n }",
"function find_similar_words($word, $threshold)\n {\n $similar = array();\n $tbl = 'babl_words_' . $this->lan;\n $word = addslashes( ( trim( $word ) ) );\n $sndx = substr($word, 0, 2);\n $query = \"select `word` AS word from `$tbl` where `di`=?\";\n @$result = $this->mDb->query($query, array($sndx));\n while ($res = $result->fetchRow() )\n {\n $tword = $res[\"word\"];\n $lev = levenshtein($tword, $word);\n if (count($similar) < $threshold)\n {\n $similar[$tword] = $lev;\n asort ($similar);\n }\n else\n {\n // If the array is full then if the lev is better than the worst lev\n // then update $keys = array_keys($similar);\n $last_key = $keys[count($keys) - 1];\n if ($lev < $similar[$last_key])\n {\n unset ($similar[$last_key]);\n $similar[$tword] = $lev;\n asort ($similar);\n }\n }\n }\n return $similar;\n }",
"function search_short($patt, $k, $text, $start_index = 0, $max_len = -1, $text_strlen = -1)\n {\n if ($text_strlen < 0) {\n $text_strlen = strlen($text);\n }\n\n if ($max_len < 0) {\n $max_len = $text_strlen;\n }\n\n $start_index = (int)max(0, $start_index);\n $n = min($max_len, $text_strlen - $start_index);\n $m = strlen($patt);\n $end_index = $start_index + $n;\n\n // If $text is shorter than $patt, use the built-in\n // levenshtein() instead:\n if ($n < $m) {\n $lev = levenshtein(substr($text, $start_index, $n), $patt);\n\n if ($lev <= $k) {\n return Array($start_index + $n - 1 => $lev);\n } else {\n return Array();\n }\n }\n\n $s = Array();\n\n for ($i = 0; $i < $m; $i++) {\n $c = $patt[$i];\n\n if (isset($s[$c])) {\n $s[$c] = min($i, $s[$c]);\n } else {\n $s[$c] = $i;\n }\n }\n\n if ($end_index < $start_index) {\n return Array();\n }\n\n $matches = Array();\n $da = $db = range(0, $m - $k + 1);\n\n $mk = $m - $k;\n\n for ($t = $start_index; $t < $end_index; $t++) {\n $c = $text[$t];\n $in_patt = isset($s[$c]);\n\n if ($t & 1) {\n $d = &$da;\n $e = &$db;\n } else {\n $d = &$db;\n $e = &$da;\n }\n\n for ($i = 1; $i <= $mk; $i++) {\n $g = min($k + 1, $e[$i] + 1, $e[$i + 1] + 1);\n\n // TODO: optimize this with a look-up-table?\n if ($in_patt)\n for ($j = $e[$i - 1]; ($j < $g && $j <= $mk); $j++) {\n if ($patt[$i + $j - 1] == $c) {\n $g = $j;\n }\n }\n\n $d[$i] = $g;\n }\n\n if ($d[$mk] <= $k) {\n $err = $d[$mk];\n $i = min($t-$err + $k + 1, $start_index + $n - 1);\n\n if (!isset($matches[$i]) || $err < $matches[$i]) {\n $matches[$i] = $err;\n }\n }\n }\n\n unset($da, $db);\n\n return $matches;\n }",
"function longestCommonSubstringWithRelevantWords($str1u, $str2u, $nivel_debug = 4)\n{\n // fixme revisar caso de que las primeras sean distintas\n $array_words1 = splitRelevantWordsUtf8(utf8_encode($str1u));\n $array_words2 = splitRelevantWordsUtf8(utf8_encode($str2u));\n if (!$array_words1 || !$array_words2){\n pintaln(\"\\tlongestCommon...Words recibió una string false str1u[\" . $str1u . \"] o str2u[\" . $str2u . \"]\",\"gris\", $nivel_debug);\n\n return false;\n }\n\n $shorter_array = (count($array_words1) < count($array_words2)) ? $array_words1 : $array_words2;\n $min_num_words = count($shorter_array);\n\n $nw1 = 0;\n $nw2 = 0;\n while ($nw1 < $min_num_words && $nw2 < $min_num_words){\n if ($array_words1[$nw1][0] == \"Y\") $nw1++;\n if ($array_words2[$nw2][0] == \"Y\") $nw2++;\n\n if ($array_words1[$nw1][0] != $array_words2[$nw2][0]) break;\n $nw1++;\n $nw2++;\n }\n\n // hasta offset de la última palabra coincidente + strlen de esa palabra + 1\n pintaln(\"\\tlongestCommon...Words str1u:\",\"gris\", $nivel_debug);\n pintaln($str1u, \"blanco\", $nivel_debug);\n pintaln(\"\\tlongestCommon...Words str2u:\",\"gris\", $nivel_debug);\n pintaln($str2u, \"blanco\", $nivel_debug);\n\n if (0 == $nw1 || 0 == $nw2){\n pintaln(\"\\tlongestCommon...Words encontró distinta la primera palabra\",\"gris\", $nivel_debug);\n pintaln($str1u . \"]\",\"gris\", $nivel_debug);\n pintaln($str2u . \"]\",\"gris\", $nivel_debug);\n\n return false;\n }\n\n pintaln(\"DEBUG - longestCommon...Words última palabra coincidente de str1 [\" . $array_words1[$nw1 - 1][0] . \"] str2 [\". $array_words2[$nw2 - 1][0] . \"]\", \"azul\", $nivel_debug);\n // $debug_siguiente1 = (isset($array_words1[$nw1][0]))? $array_words1[$nw1][0] : \"[]\" ;\n // $debug_siguiente2 = (isset($array_words2[$nw2][0]))? $array_words2[$nw2][0] : \"[]\" ;\n // $resultado_comparacion = ($debug_siguiente1 != $debug_siguiente2)?\"DISTINTAS\":\"IGUALES\";\n // pintaln(\"las siguientes palabras, si existen, son: \" . $debug_siguiente1 . \" y \" . $debug_siguiente2 . \"; ambas \" . $resultado_comparacion, \"azul\", $nivel_debug);\n\n // offset de la última palabra coincidente + longitud de esa última palabra\n $coincidencias_str1u = mb_substr($str1u, 0, $array_words1[$nw1 - 1][1] + mb_strlen($array_words1[$nw1 - 1][0]) + 1);\n $coincidencias_str2u = mb_substr($str2u, 0, $array_words2[$nw2 - 1][1] + mb_strlen($array_words2[$nw2 - 1][0]) + 1);\n\n // $nw1-1 y $nw2-1 son los índices de las últimas palabras coincidentes\n // podría analizar qué string es más largo (offset, no número de palabras) y decidir\n // de momento elijo str1 por cojones.\n\n pintaln(\"\\tlongestCommon...Words delimitadores flexibles - coincidencia antes de terminar las dos strings\", \"gris\", $nivel_debug);\n pintaln($coincidencias_str1u.\"]\",\"gris\");\n pintaln($coincidencias_str2u.\"]\",\"gris\");\n pintaln(\"\\tescojo arbitrariamente el primero\", \"gris\", $nivel_debug);\n $coincidencias = $coincidencias_str1u;\n\n pintaln($coincidencias . \"]\", \"gris\", $nivel_debug);\n\n return $coincidencias; \n}",
"function jr_mt_best_match_alias( $alias_array, $matches ) {\n\t/*\tFor each component, if they differ,\n\t\tBest is determined as follows, in the following order:\n\t\tHost - longest string is Best\n\t\tPort - non-zero is Best\n\t\tPath - longest string is Best.\n\t*/\n\t$best = $matches;\n\t$max = -1;\n\tforeach ( $best as $key ) {\n\t\t$len = strlen( $alias_array[ $key ]['prep']['host'] );\n\t\tif ( $len > $max ) {\n\t\t\t$max = $len;\n\t\t}\n\t}\n\tforeach ( $best as $index => $key ) {\n\t\tif ( $max > strlen( $alias_array[ $key ]['prep']['host'] ) ) {\n\t\t\tunset ( $best[ $index ] );\n\t\t}\n\t}\n\tforeach ( $best as $key ) {\n\t\tif ( 0 !== $alias_array[ $key ]['prep']['port'] ) {\n\t\t\tforeach ( $best as $index => $key ) {\n\t\t\t\tif ( 0 === $alias_array[ $key ]['prep']['port'] ) {\n\t\t\t\t\tunset( $best[ $index ] );\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\t$max = -1;\n\tforeach ( $best as $key ) {\n\t\tif ( empty( $alias_array[ $key ]['prep']['path'] ) ) {\n\t\t\t$len = 0;\n\t\t} else {\n\t\t\t$len = strlen( $alias_array[ $key ]['prep']['path'] );\n\t\t}\n\t\tif ( $len > $max ) {\n\t\t\t$max = $len;\n\t\t}\n\t}\n\tforeach ( $best as $index => $key ) {\n\t\tif ( empty( $alias_array[ $key ]['prep']['path'] ) ) {\n\t\t\t$len = 0;\n\t\t} else {\n\t\t\t$len = strlen( $alias_array[ $key ]['prep']['path'] );\n\t\t}\n\t\tif ( $max > $len ) {\n\t\t\tunset ( $best[ $index ] );\n\t\t}\n\t}\t\t\t\n\t/*\tIf there is more than one Site Alias left\n\t\tin the $best array, then it should mean\n\t\tthere are duplicate entries,\n\t\tbut that makes no sense.\n\t\tSo, just return the first one in the array.\n\t\t\n\t\treset() returns the first array element,\n\t\tnot the key.\n\t*/\n\treturn reset( $best );\n}",
"private function makeProblemMap()\n {\n // get the groups\n $g105 = $this->ds->getGroup(105);\n $g111 = $this->ds->getGroup(111);\n\n // find the matches\n foreach ($g111 as $k => $v) {\n $pos = array_search($v, $g105);\n if (false !== $pos) {\n $this->problemMap[$k] = $pos;\n }\n }\n }",
"public function test_corrected_to_compared_typo() {\r\n $bestmatchpair = $this->make_pair('abc cde', 'cae abo sizeo');\r\n $this->question->lexicalerrorthreshold = 0.99;\r\n $this->question->lexicalerrorweight = 0.1;\r\n $analyzer = new qtype_correctwriting_lexical_analyzer($this->question, $bestmatchpair, $this->lang, false);\r\n $result = $analyzer->result_pairs();\r\n\r\n $this->assertTrue(count($result) == 1);\r\n /** @var qtype_correctwriting_string_pair $pair */\r\n $pair = $result[0];\r\n $string = $this->corrected_to_string($pair);\r\n $this->assertTrue($string == 'cde abc sizeo', $string);\r\n\r\n $index = $pair->map_from_corrected_string_to_compared_string(0);\r\n $this->assertTrue($index == array( 0 ), implode(' ', $index));\r\n\r\n $index = $pair->map_from_corrected_string_to_compared_string(1);\r\n $this->assertTrue($index == array( 1 ), implode(' ', $index));\r\n\r\n $index = $pair->map_from_corrected_string_to_compared_string(2);\r\n $this->assertTrue($index == array( 2 ), implode(' ', $index));\r\n }",
"function getSimilarityRanking($str1, $str2) \n{\n $pairs1 = wordLetterPairs($str1);\n $pairs2 = wordLetterPairs($str2);\n $union = count($pairs1) + count($pairs2);\n if ($union == 0) { \n return 0; \n }\n $intersection = count(array_intersect($pairs1, $pairs2));\n return 2 * $intersection / $union;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Name newPage Description Creates a new page Input $u_id $title $description Output | function newPage($u_id, $parent, $title, $description)
{
$u_id = $this->dbh->sql_safe($u_id);
$parent = $this->dbh->sql_safe($parent);
$title = $this->dbh->sql_safe($title);
$description = $this->dbh->sql_safe($description);
$sql = 'INSERT INTO scrapbook_page (sp_u_id, sp_title, sp_description, sp_dateCreated) '
. 'VALUES (' . $u_id . ', ' . $title . ', ' . $description . ', NOW())';
$this->dbh->execute($sql);
$sp_id = $this->dbh->insert_id();
$sql = 'INSERT INTO scrapbook_book_page_map (sbpm_sb_id, sbpm_sp_id) '
. 'VALUES (' . $parent . ', ' . $sp_id . ')';
$this->dbh->execute($sql);
} | [
"public function createPage($page_title) {\n\n\t\t\t$sql = new DB_Sql();\n\t\t\t$sql->connect();\n\n\t\t\t$errors = FALSE;\n\t\t\t$error_msgs = array();\n\n\t\t\t// sanitise page_title\n\t\t\t$page_title = mysql_real_escape_string($page_title, $sql->Link_ID);\n\n\t\t\t// Changed to show which entries were added by the SubjectAdmin class (with FSM [Flying Spaghetti Monster] Privileges)\n\t\t\t$user = 'Subject Admin Script (FSM)';\n\n\t\t\t// Create date - \"2009-06-21 14:34:04\": MySQL timestamp format\n\t\t\t$date_now = date('Y-m-d H:i:s');\n\n\t\t\t// Get the page_id of the page matching the passed page_title\n\t\t\t$query = \"SELECT page_id FROM webmatrix_user_pages WHERE title = '$page_title' AND template = \".$this->subject_tpl_id.\"\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t// If page ID found for page_title given\n\t\t\tif ($sql->num_rows() > 0) {\n\t\t\t\twhile($sql->next_record()) {\n\t\t\t\t\t$page_id = $sql->Record['page_id'];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t// Page does NOT exist so create it\n\t\t\t\t$query = \"INSERT INTO webmatrix_user_pages (title, active, template, homepage, client_id, type, created, user) VALUES ('$page_title','1','\".$this->subject_tpl_id.\"','0','1','page','$date_now','$user')\";\n\n\t\t\t\t$sql->query($query, $this->debug);\n\t\t\t\tif ($sql->num_rows_affected() == 0) {\n\t\t\t\t\t$errors = TRUE;\n\t\t\t\t\t$error_msgs[] = \"Could not add new page for $page_title\";\n\t\t\t\t}\n\n\t\t\t\t// Get page_id of created page\n\t\t\t\t$query = \"SELECT page_id FROM webmatrix_user_pages WHERE title = '$page_title' AND template = \".$this->subject_tpl_id.\"\";\n\t\t\t\t$sql->query($query, $this->debug);\n\t\t\t\tif ($sql->num_rows() > 0) {\n\t\t\t\t\twhile($sql->next_record()) {\n\t\t\t\t\t\t$page_id = $sql->Record['page_id'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Work out largest structure_order number for next insert\n\t\t\t$query = \"SELECT structure_order FROM webmatrix_structure WHERE structure_parent = \".$this->subjects_structure_id.\" ORDER BY structure_order DESC LIMIT 1\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\tif ($sql->num_rows() > 0) {\n\t\t\t\twhile($sql->next_record()) {\n\t\t\t\t\t$latest_order_no = $sql->Record['structure_order'];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// No pages exists so make $latest_order_no = 0;\n\t\t\t\t$latest_order_no = 0;\n\t\t\t\t/*\n\t\t\t\t$errors = TRUE;\n\t\t\t\t$error_msgs[] = \"Could not retrieve structure_order of existing subjects\";\n\t\t\t\t*/\n\t\t\t}\n\n\t\t\t// Work out if valid subject code has courses - if not, de-activate page in webmatrix\n\t\t\t$topic_code = $this->getTopicCodeFromTitle($page_title);\n\t\t\t$subject_stats = $this->getSubjectStats($topic_code);\n\t\t\t$no_courses = $subject_stats['pages'];\n\t\t\t$structure_flag = ($no_courses > 0) ? 2 : 0;\n\n\t\t\t// Create webmatrix_structure\n\t\t\t$structure_url = $this->makeURL($page_title);\n\t\t\t$next_order_no = $latest_order_no + 1;\n\t\t\t$query = \"INSERT INTO webmatrix_structure (structure_parent, structure_order, structure_text, structure_url, structure_flag, page_id, client_id) VALUES ('$this->subjects_structure_id','$next_order_no','$page_title','$structure_url','$structure_flag','$page_id','1')\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\tif ($sql->num_rows_affected() == 0) {\n\t\t\t\t$errors = TRUE;\n\t\t\t\t$error_msgs[] = \"Could not update page structure for $page_title\";\n\t\t\t}\n\n\t\t\t// Add Page Content (Just Heading)\n\t\t\t$query = \"INSERT INTO webmatrix_page_content (page_id, identifier, text, modified, client_id) VALUES ('$page_id', 'HEADLINE', '$page_title', '$date_now','1')\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\tif ($sql->num_rows_affected() == 0) {\n\t\t\t\t$errors = TRUE;\n\t\t\t\t$error_msgs[] = \"Could not create Headline for $page_title\";\n\t\t\t}\n\n\t\t\t// Create Page Date Entry - Unixtime date format\n\t\t\t$date_now_unixtime = date('U');\n\t\t\t$query = \"INSERT INTO webmatrix_page_date (page_id, identifier, date, client_id) VALUES ('$page_id','DATE','$date_now_unixtiime','1')\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\tif ($sql->num_rows_affected() == 0) {\n\t\t\t\t$errors = TRUE;\n\t\t\t\t$error_msgs[] = \"Could not create date entry for $page_title\";\n\t\t\t}\n\n\t\t\t// Finally, assign the newly created page to its correct Subject Topic Code if it doesn't already exist\n\t\t\t$assignment_exists = FALSE;\n\t\t\t$query = \"SELECT * FROM webmatrix_extra_checkboxgroup WHERE identifier = 'SUBJECT' AND page_id = $page_id\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\tif ($sql->num_rows() > 0) {\n\t\t\t\t$assignment_exists = TRUE;\n\t\t\t}\n\t\t\t// If page is not assigned then assign it\n\t\t\tif ($assignment_exists === FALSE) {\n\t\t\t\t$topic_code = $this->getTopicCodeFromTitle($page_title);\n\t\t\t\t$query = \"INSERT INTO webmatrix_extra_checkboxgroup (page_id, identifier, text, client_id) VALUES ('$page_id','SUBJECT','$topic_code','1')\";\n\t\t\t\t$sql->query($query, $this->debug);\n\t\t\t\tif ($sql->num_rows_affected() == 0) {\n\t\t\t\t\t$errors = TRUE;\n\t\t\t\t\t$error_msgs[] = \"Could not create subject topic code assignment for $page_title\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($errors === FALSE) {\n\t\t\t\treturn TRUE;\n\t\t\t} else {\n\t\t\t\tif ($this->debug === TRUE) {\n\t\t\t\t\techo \"<h3>Errors Found</h3>\";\n\t\t\t\t\tvar_dump($error_msgs);\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}",
"function newBook($u_id, $title, $description)\r\n {\r\n $u_id = $this->dbh->sql_safe($u_id);\r\n $title = $this->dbh->sql_safe($title);\r\n $description = $this->dbh->sql_safe($description);\r\n \r\n $sql = 'INSERT INTO scrapbook_book (sb_u_id, sb_title, sb_description, sb_dateCreated) '\r\n . 'VALUES (' . $u_id . ', ' . $title . ', ' . $description . ', NOW())';\r\n \r\n $this->dbh->execute($sql);\r\n return $this->dbh->insert_id();\r\n }",
"function load_insert_new_item( $page, $description )\n{\n # Begin URL with protocol, domain, and current directory.\n $url = 'http://' . $_SERVER[ 'HTTP_HOST' ] . dirname( $_SERVER[ 'PHP_SELF' ] ) ;\n\n # Remove trailing slashes then append page name to URL and the print id.\n $url = rtrim( $url, '/\\\\' ) ;\n $url .= '/' . $page . '';\n\n # Execute redirect then quit.\n session_start( );\n\n $_SESSION['description'] = $description;\n \n header( \"Location: $url\" ) ;\n\n exit() ;\n}",
"function insertPage()\n\t{\n\t\tglobal $ilCtrl, $lng;\n\t\t\n\t\tinclude_once(\"./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php\");\n\t\t\n\t\t$num = ilChapterHierarchyFormGUI::getPostMulti();\n\t\t$node_id = ilChapterHierarchyFormGUI::getPostNodeId();\n\t\t\n\t\tif (!ilChapterHierarchyFormGUI::getPostFirstChild())\t// insert after node id\n\t\t{\n\t\t\t$parent_id = $this->tree->getParentId($node_id);\n\t\t\t$target = $node_id;\n\t\t}\n\t\telse\t\t\t\t\t\t\t\t\t\t\t\t\t// insert as first child\n\t\t{\n\t\t\t$parent_id = $node_id;\n\t\t\t$target = IL_FIRST_NODE;\n\t\t}\n\n\t\tfor ($i = 1; $i <= $num; $i++)\n\t\t{\n\t\t\t$page = new ilLMPageObject($this->content_object);\n\t\t\t$page->setType(\"pg\");\n\t\t\t$page->setTitle($lng->txt(\"cont_new_page\"));\n\t\t\t$page->setLMId($this->content_object->getId());\n\t\t\t$page->create();\n\t\t\tilLMObject::putInTree($page, $parent_id, $target);\n\t\t}\n\n\t\t$ilCtrl->redirect($this, \"showHierarchy\");\n\t}",
"function create_page() {\n global $user_ID;\n $page = array(\n 'post_type' => 'page',\n 'post_title' => 'Code is Poterie',\n 'post_content' => 'Opération Template du Dessert',\n 'post_status' => 'publish',\n 'post_author' => $user_ID,\n );\n \n return wp_insert_post( $page );\n }",
"static function create_page( $page, $title ) {\n if ( get_page_by_title( $page ) == NULL ) {\n $createPage = [\n 'post_title' => $title,\n 'post_content' => \"[$page]\", // Shortcode dedicated to that page\n 'post_status' => 'publish',\n 'post_author' => 1,\n 'post_type' => 'page',\n 'post_name' => $page\n ];\n wp_insert_post( $createPage );\n }\n }",
"function createPage($title, $points, $message, $teaser, $reflect, $url, $file, $groupId)\r\n{\r\n\t$filename = uploadFile($file);\r\n\t\r\n\tif($filename != null) \r\n\t{\r\n\t\t$nextPageNum = getNextPageNum($groupId);\r\n\t\t$shareId = uniqid('', true);\r\n\t\t$result = insertNewPage($nextPageNum, $title, $points, $message, $teaser, $reflect, $url, $filename, $groupId, $shareId);\r\n\t\t\t\r\n\t\tif($result == 1)\r\n\t\t{\r\n\t\t\theader(\"Location: ./groups.php?form=edit&id=\". $groupId);\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\theader(\"Location: ./groups.php?form=edit&id=\" . $groupId . \"&message=An Error Occurred While Attempting to Add a Page to the Group!\");\r\n\t}\r\n}",
"function createWikiPage($a_page_title, $a_template_page = 0)\n\t{\n\t\t// check if template has to be used\n\t\tif ($a_template_page == 0)\n\t\t{\n\t\t\tif (!$this->getEmptyPageTemplate())\n\t\t\t{\n\t\t\t\tinclude_once(\"./Modules/Wiki/classes/class.ilWikiPageTemplate.php\");\n\t\t\t\t$wt = new ilWikiPageTemplate($this->getId());\n\t\t\t\t$ts = $wt->getAllInfo(ilWikiPageTemplate::TYPE_NEW_PAGES);\n\t\t\t\tif (count($ts) == 1)\n\t\t\t\t{\n\t\t\t\t\t$t = current($ts);\n\t\t\t\t\t$a_template_page = $t[\"wpage_id\"];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// create the page\n\t\t$page = new ilWikiPage();\n\t\t$page->setWikiId($this->getId());\n\t\t$page->setTitle(ilWikiUtil::makeDbTitle($a_page_title));\n\t\tif($this->getRating() && $this->getRatingForNewPages())\n\t\t{\n\t\t\t$page->setRating(true);\n\t\t}\n\n\t\t// needed for notification\n\t\t$page->setWikiRefId($this->getRefId());\n\t\t$page->create();\n\n\t\t// copy template into new page\n\t\tif ($a_template_page > 0)\n\t\t{\n\t\t\t$orig = new ilWikiPage($a_template_page);\n\t\t\t$orig->copy($page->getId());\n\t\t\t\n\t\t\t// #15718\n\t\t\tinclude_once \"Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php\";\n\t\t\tilAdvancedMDValues::_cloneValues(\n\t\t\t\t$this->getId(),\n\t\t\t\t$this->getId(),\n\t\t\t\t\"wpg\",\n\t\t\t\t$a_template_page,\n\t\t\t\t$page->getId()\n\t\t\t);\n\t\t}\n\n\t\treturn $page;\n\t}",
"function wd_page($title, $parent = false){\n\treturn $parent ? new WD_Creator_Page_Sub($title, $parent) : new WD_Creator_Page_TopLevel($title);\n}",
"function create($a_prevent_page_creation = false)\n\t{\n\t\tglobal $ilDB;\n\n\t\t$id = $ilDB->nextId(\"il_wiki_page\");\n\t\t$this->setId($id);\n\t\t$query = \"INSERT INTO il_wiki_page (\".\n\t\t\t\"id\".\n\t\t\t\", title\".\n\t\t\t\", wiki_id\".\n\t\t\t\", blocked\".\n\t\t\t\", rating\".\n\t\t\t\" ) VALUES (\".\n\t\t\t$ilDB->quote($this->getId(), \"integer\")\n\t\t\t.\",\".$ilDB->quote($this->getTitle(), \"text\")\n\t\t\t.\",\".$ilDB->quote((int) $this->getWikiId(), \"integer\")\n\t\t\t.\",\".$ilDB->quote((int) $this->getBlocked(), \"integer\")\n\t\t\t.\",\".$ilDB->quote((int) $this->getRating(), \"integer\")\n\t\t\t.\")\";\n\t\t$ilDB->manipulate($query);\n\n\t\t// create page object\n\t\tif (!$a_prevent_page_creation)\n\t\t{\n\t\t\tparent::create();\n\t\t\t$this->saveInternalLinks($this->getDomDoc());\n\n\t\t\tinclude_once \"./Services/Notification/classes/class.ilNotification.php\";\n\t\t\tilWikiUtil::sendNotification(\"new\", ilNotification::TYPE_WIKI, $this->getWikiRefId(), $this->getId());\n\t\t}\n\n\t\t$this->updateNews();\n\t}",
"function insertPage($page){}",
"function createPage($name) {\n //Keep track of the new page's location.\n $location = $_SERVER['DOCUMENT_ROOT'] . \"/pages/\" . $name . \".php\";\n //Check to make sure the file doesn't already exist.\n if(file_exists($location)) {\n //If it does exist, just load into that page.\n header('Refresh: 0; URL = /pages/' . $name . '.php');\n }\n //Create a new php page in the pages folder.\n $newPage = fopen($location, \"w\");\n //Ensure that the user can write, and that anyone can read it.\n //If need be, put this in an \"if\" statement in case it throws an error.\n chmod($location, 0644);\n //Add the default stuff like header.php\n $defaultText = '<?php\n include ($_SERVER[\\'DOCUMENT_ROOT\\'] . \"/php/header.php\");\n?>\n<head>\n</head>\n<body id=\"body\" class=\"nested\">\n</body>';\n //Write the default text into the new page.\n fwrite($newPage, $defaultText);\n //Close editing\n fclose($newPage);\n //Load the new page\n header('Refresh: 0; URL = /pages/' . $name . '.php');\n }",
"public function page()\n {\n $name = isset($this->args[2]) ? $this->args[2] : null;\n $test = str_replace(' ', '', $this->args[2]);\n if (is_null($name) || empty($test)) {\n Friend::say(\n function($f) {\n $f::red('Please specify a path');\n $f::plain(' ex: ruhoh page projects/hello-world');\n exit(1);\n }\n );\n }\n\n $filename = Ruhoh::getInstance()->paths['pages'] . DIRECTORY_SEPARATOR . str_replace(' ', '-', $this->args[2]);\n $ext = Filesystem::extension($filename);\n if (empty($ext)) {\n $filename .= DIRECTORY_SEPARATOR . \"index\" . $this->options['ext'];\n }\n if (Filesystem::exists($filename)) {\n if ($this->ask(\"$filename already exists. Do you want to overwrite?\", ['y', 'n']) == 'n') {\n echo \"Create new page: \\e[31maborted!\\e[0m\";\n exit(1);\n }\n }\n\n Filesystem::mkdir(dirname($filename));\n $output = Filesystem::get($this->paths[\"page_template\"]);\n Filesystem::put($filename, $output);\n\n Friend::say(\n function($f) use($filename) {\n $f::green(\"New page:\");\n $f::plain(Utils::relativePath($filename));\n }\n );\n }",
"function addPage(){}",
"function createPages() { }",
"function themeisle_hestia_create_page( $slug, $page_title ) {\n\t// Check if page exists\n\t$args = array(\n\t\t'name' => $slug,\n\t\t'post_type' => 'page',\n\t\t'post_status' => 'publish',\n\t\t'numberposts' => 1,\n\t);\n\t$post = get_posts( $args );\n\tif ( ! empty( $post ) ) {\n\t\t$page_id = $post[0]->ID;\n\t} else {\n\t\t// Page doesn't exist. Create one.\n\t\t$postargs = array(\n\t\t\t'post_type' => 'page',\n\t\t\t'post_name' => $slug,\n\t\t\t'post_title' => $page_title,\n\t\t\t'post_status' => 'publish',\n\t\t\t'post_author' => 1,\n\t\t);\n\t\t// Insert the post into the database\n\t\t$page_id = wp_insert_post( $postargs );\n\t}\n\treturn $page_id;\n}",
"public function _add_page()\n {\n check_submit_permission('cat_low');\n\n require_code('content2');\n $metadata = actual_metadata_get_fields('wiki_page', null);\n\n $id = wiki_add_page(post_param_string('title'), post_param_string('post'), post_param_string('notes', ''), (get_option('wiki_enable_content_posts') == '1') ? post_param_integer('hide_posts', 0) : 1, $metadata['submitter'], $metadata['add_time'], $metadata['views'], post_param_string('meta_keywords', ''), post_param_string('meta_description', ''), null, false);\n\n set_url_moniker('wiki_page', strval($id));\n\n require_code('permissions2');\n set_category_permissions_from_environment('wiki_page', strval($id), 'cms_wiki');\n\n require_code('fields');\n if (has_tied_catalogue('wiki_page')) {\n save_form_custom_fields('wiki_page', strval($id));\n }\n\n if (addon_installed('awards')) {\n require_code('awards');\n handle_award_setting('wiki_page', strval($id));\n }\n\n if (addon_installed('content_reviews')) {\n require_code('content_reviews2');\n content_review_set('wiki_page', strval($id));\n }\n\n // Show it worked / Refresh\n $url = get_param_string('redirect', null);\n if (is_null($url)) {\n $_url = build_url(array('page' => 'wiki', 'type' => 'browse', 'id' => ($id == db_get_first_id()) ? null : $id), get_module_zone('wiki'));\n $url = $_url->evaluate();\n }\n return redirect_screen($this->title, $url, do_lang_tempcode('SUCCESS'));\n }",
"function thumbwhere_program_add_page() {\n $controller = entity_ui_controller('thumbwhere_program');\n return $controller->addPage();\n}",
"private function add_page( &$item )\n\t{\n\t\textract($item);\n\t\t$user_slug = $this->get_string_value( $slug, true );\n\t\t$post = $this->get_post_by_title( $title, 'page' );\n\t\tif( $post ){\n\t\t\t$this->model->last_error = 'A page titled \"'.$title.'\" already exists. Slug has been modified to accommodate.';\n\t\t\treturn false;\n\t\t\t//Could remove error and empty user slug and let WP increment as needed so that multiple pages with same title could be created.\n\t\t\t//Issues arise with child pages specifiying a parent by title. get_page_by_title returns page with lowest ID when multiple exist.\n\t\t\t//$user_slug = '';\n\t\t}\n\t\n\t\t$post_data = array(\n\t\t\t'post_content'\t=> $this->get_string_value( $content, true ),\n\t\t\t'post_name'\t\t=> $user_slug,\n\t\t\t'post_title'\t=> $title,\n\t\t\t'post_status'\t=> $this->get_post_status( $status ),\n\t\t\t'post_type'\t\t=> 'page',\n\t\t\t'menu_order'\t=> $this->get_int_value( $order, true ),\n\t\t\t'post_parent'\t=> $this->get_post_by_title( $parent, 'page' )->ID,\n\t\t\t'post_author'\t=> $this->get_author_id( $author ),\n\t\t\t'post_password'\t=> $this->get_string_value( $password, true ),\n\t\t\t'guid'\t\t\t=> $this->get_string_value( $guid, true ),\n\t\t\t'post_excerpt'\t=> $this->get_string_value( $excerpt, true ),\n\t\t\t'post_date'\t\t=> $this->parse_date( $date, true ),\n\t\t);\n\t\t\n\t\t$this->filter_post_data( $post_data );\n\t\t$result = wp_insert_post( $post_data, true );\n\t\t\n\t\tif( is_wp_error($result) )\n\t\t{\n\t\t\t$this->model->last_error = 'Unable to insert post \"'.$title.'\". '.$result->get_error_message();\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$post_id = $result;\n\t\tforeach( $meta as $key => $value )\n\t\t{\n\t\t\tupdate_post_meta( $post_id, $key, $value );\n\t\t}\n\t\t\n\t\treturn true;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
register the location content type | public function register_location_content_type(){
//Labels for post type
$labels = array(
'name' => __('Location', 'my-plugin'),
'singular_name' => __('Location', 'my-plugin'),
'menu_name' => __('Locations','my-plugin'),
'name_admin_bar' => __('Location','my-plugin'),
'add_new' => __('Add New', 'my-plugin'),
'add_new_item' => __('Add New Location','my-plugin'),
'new_item' => __('New Location', 'my-plugin'),
'edit_item' => __('Edit Location','my-plugin'),
'view_item' => __('View Location','my-plugin'),
'all_items' => __('All Locations','my-plugin'),
'search_items' => __('Search Locations','my-plugin'),
'parent_item_colon' => __('Parent Location:', 'my-plugin'),
'not_found' => __('No Locations found.', 'my-plugin'),
'not_found_in_trash' => __('No Locations found in Trash.','my-plugin'),
);
//arguments for post type
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable'=> true,
'show_ui' => true,
'show_in_nav' => true,
'query_var' => true,
'hierarchical' => false,
'supports' => array('title','thumbnail','editor'),
'has_archive' => true,
'menu_position' => 20,
'show_in_admin_bar' => true,
'menu_icon' => 'dashicons-location-alt',
'rewrite' => array('slug' => 'locations', 'with_front' => 'true')
);
//register post type
register_post_type('wp_locations', $args);
} | [
"function location_post_type() {\n\tregister_post_type( 'locations',\n\t\tarray(\n\t\t\t'labels' => array(\n\t\t\t\t'name' => __( 'Locations' ),\n\t\t\t\t'singular_name' => __( 'Locations' )\n\t\t\t),\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array('slug' => 'locations'),\n\t\t\t'menu_icon' => 'dashicons-location',\n\t\t\t'supports' => array('title','custom-fields','editor','category','author','thumbnail','revisions')\n\t\t)\n\t);\n}",
"function acf_register_location_type( $class_name ) {\n\t$store = acf_get_store( 'location-types' );\n\n\t// Check class exists.\n\tif ( ! class_exists( $class_name ) ) {\n\t\t$message = sprintf( __( 'Class \"%s\" does not exist.', 'acf' ), $class_name );\n\t\t_doing_it_wrong( __FUNCTION__, $message, '5.9.0' );\n\t\treturn false;\n\t}\n\n\t// Create instance.\n\t$location_type = new $class_name();\n\t$name = $location_type->name;\n\n\t// Check location type is unique.\n\tif ( $store->has( $name ) ) {\n\t\t$message = sprintf( __( 'Location type \"%s\" is already registered.', 'acf' ), $name );\n\t\t_doing_it_wrong( __FUNCTION__, $message, '5.9.0' );\n\t\treturn false;\n\t}\n\n\t// Add to store.\n\t$store->set( $name, $location_type );\n\n\t/**\n\t * Fires after a location type is registered.\n\t *\n\t * @date 8/4/20\n\t * @since 5.9.0\n\t *\n\t * @param string $name The location type name.\n\t * @param ACF_Location $location_type The location type instance.\n\t */\n\tdo_action( 'acf/registered_location_type', $name, $location_type );\n\n\t// Return location type instance.\n\treturn $location_type;\n}",
"public static function register_type()\n {\n }",
"function bbpress_add_content_location() {\n\t\tglobal $gantry;\n\n\t\t$template_locations = bbp_get_template_stack();\n\t\t$template_locations = array_reverse( $template_locations );\n\n\t\tif( ( $key = array_search( $gantry->templatePath, $template_locations ) ) !== false ) {\n\t\t\tunset( $template_locations[$key] );\n\t\t}\n\n\t\tforeach( $template_locations as $location ) {\n\t\t\t$gantry->addContentTypePath( $location );\n\t\t}\n\t}",
"function tkno_locations_register_post_type() {\n\t$labels = array(\n 'name' => _x( 'Locations', 'post type general name' ),\n 'singular_name' => _x( 'Location', 'post type singular name' ),\n 'add_new' => _x( 'Add New', 'venue' ),\n 'add_new_item' => __( 'Add New Location' ),\n 'edit_item' => __( 'Edit Location' ),\n 'new_item' => __( 'New Location' ),\n 'all_items' => __( 'All Locations' ),\n 'view_item' => __( 'View Location' ),\n 'search_items' => __( 'Search Locations' ),\n 'not_found' => __( 'No locations found' ),\n 'not_found_in_trash' => __( 'No locations found in the Trash' ), \n 'parent_item_colon' => '',\n 'menu_name' => 'Locations'\n );\n $args = array(\n 'labels' => $labels,\n 'description' => 'Locations feature a single destination or geographic activity, and can pull in related items based on proximity',\n 'public' => true,\n 'publicly_queryable' => true,\n 'exclude_from_search' => false,\n 'show_ui' => true,\n 'menu_position' => 6,\n 'capability_type' => 'post',\n 'query_var' => true,\n 'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt', 'page-attributes', 'revisions', 'author', 'custom-fields', ),\n /*'rewrite' => array(\n 'slug' => 'location',\n 'with_front' => true\n ),*/\n 'has_archive' => true,\n 'taxonomies' => array( 'category' ),\n );\n register_post_type( 'location', $args );\n}",
"public function register_content_types() {\n\t\tforeach ( $this->content_types as $content_type_class ) {\n\t\t\t$this->register_content_type( new $content_type_class() );\n\t\t}\n\t}",
"public function addLocation($location);",
"function addLocation($uri) {}",
"public function registerCustomTypeMappings();",
"public function addLocation(string $location): void;",
"public function register_location_taxonomy() {\n\n\t\tregister_taxonomy(\n\t\t\t'location',\n\t\t\t'restaurant',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Location' ),\n\t\t\t\t'hierarchical' => true,\n\t\t\t)\n\t\t);\n\t}",
"public function register_content_type() {\n\t\t$content_type_labels = array(\n\t\t\t'name' => 'Site Domains',\n\t\t\t'singular_name' => 'Site Domain',\n\t\t\t'add_new' => 'Add Domain',\n\t\t\t'add_new_item' => 'Add New Domain',\n\t\t\t'edit_item' => 'Edit Domain',\n\t\t\t'edit_new_item' => 'Edit New Domain',\n\t\t\t'all_items' => 'All Domains',\n\t\t\t'view_item' => 'View Domains',\n\t\t\t'search_items' => 'Search Domans',\n\t\t\t'not_found' => 'No domains found',\n\t\t\t'not_found_in_trash' => 'No domains found in Trash',\n\t\t);\n\n\t\t$content_type_arguments = array(\n\t\t\t'labels' => $content_type_labels,\n\t\t\t'public' => false,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_admin_bar' => true,\n\t\t\t'menu_position' => 5,\n\t\t\t'menu_icon' => NULL,\n\t\t\t'supports' => array( 'title' ),\n\t\t\t'register_meta_box_cb' => array( $this, 'register_meta_boxes' ),\n\t\t\t'has_archive' => false,\n\t\t\t'rewrite' => false,\n\t\t);\n\n\t\tregister_post_type( self::post_type, $content_type_arguments );\n\t}",
"protected static function registerKnownTypes()\n {\n if (!empty(static::$registeredByType)) {\n return;\n }\n static::internalRegister(new UrlXrefResolver());\n static::internalRegister(new LocalFileXrefResolver());\n static::internalRegister(new InlineXrefResolver());\n }",
"public function register_post_types() {}",
"public function addLocation(string $location);",
"public function register_post_types() {\n\n }",
"public function register_post_types()\n {\n\n }",
"public function register()\n\t{\n\t\t$this->posttypeObject = register_post_type( $this->postTypeStr, $this->argsRegister );\n\t}",
"function create_post_type_locations()\n{\n register_taxonomy_for_object_type('category', 'html5-blank'); // Register Taxonomies for Category\n register_taxonomy_for_object_type('post_tag', 'html5-blank');\n register_post_type('locations', // Register Custom Post Type\n array(\n 'labels' => array(\n 'name' => __('Locations', 'html5blank'), // Rename these to suit\n 'singular_name' => __('Location', 'html5blank'),\n 'add_new' => __('Add New', 'html5blank'),\n 'add_new_item' => __('Add New Location', 'html5blank'),\n 'edit' => __('Edit', 'html5blank'),\n 'edit_item' => __('Edit Location', 'html5blank'),\n 'new_item' => __('New Location', 'html5blank'),\n 'view' => __('View Location', 'html5blank'),\n 'view_item' => __('View Location', 'html5blank'),\n 'search_items' => __('Search Location', 'html5blank'),\n 'not_found' => __('No Location found', 'html5blank'),\n 'not_found_in_trash' => __('No Location found in Trash', 'html5blank')\n ),\n 'rewrite' => array('slug' => 'locations'),\n 'public' => true,\n 'hierarchical' => true, // Allows your posts to behave like Hierarchy Pages\n 'has_archive' => true,\n 'supports' => array(\n 'title',\n 'editor',\n 'excerpt',\n 'thumbnail'\n ), // Go to Dashboard Custom HTML5 Blank post for supports\n 'can_export' => true // Allows export in Tools > Export\n // 'taxonomies' => array(\n // 'post_tag',\n // 'category'\n // ) // Add Category and Post Tags support\n ));\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a binary dummy file to the archive | public function addBinaryFileData(&$data, $filename, $time=0)
{
$dummyfile = XOOPS_CACHE_PATH.'/dummy_'.time().'.html';
$fp = fopen($dummyfile, 'wb');
fwrite($fp, $data);
fclose($fp);
$this->archiver->addFile($dummyfile, true);
unlink($dummyfile);
// dirty, but no other way
for ($i = 0; $i < $this->archiver->numFiles; $i++) {
if ($this->archiver->files[$i]['name'] == $dummyfile) {
$this->archiver->files[$i]['name'] = $filename;
if (0 != $time) {
$this->archiver->files[$i]['time'] = $time;
}
break;
}
}
} | [
"function addBinaryFile($filepath, $newfilename=null)\r\n\t{\r\n\t\t$this->archiver->addFile($filepath, true);\r\n\t\tif (isset($newfilename)) {\r\n\t\t\t// dirty, but no other way\r\n\t\t\tfor ($i = 0; $i < $this->archiver->numFiles; $i++) {\r\n\t\t\t\tif ($this->archiver->files[$i]['name'] == $filepath) {\r\n\t\t\t\t\t$this->archiver->files[$i]['name'] = trim($newfilename);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function testZeroByteFile() {\n $archive = sys_get_temp_dir() . '/dwziptest' . md5(time()) . '.zip';\n $extract = sys_get_temp_dir() . '/dwziptest' . md5(time() + 1);\n\n $zip = new Zip();\n $zip->create($archive);\n $zip->addFile($this->getDir() . '/zip/zero.txt', 'foo/zero.txt');\n $zip->close();\n $this->assertFileExists($archive);\n\n $zip = new Zip();\n $zip->open($archive);\n $contents = $zip->contents();\n\n $this->assertEquals(1, count($contents));\n $this->assertEquals('foo/zero.txt', ($contents[0])->getPath());\n\n $zip = new Zip();\n $zip->open($archive);\n $zip->extract($extract);\n $zip->close();\n\n $this->assertFileExists(\"$extract/foo/zero.txt\");\n $this->assertEquals(0, filesize(\"$extract/foo/zero.txt\"));\n\n self::RDelete($extract);\n unlink($archive);\n }",
"public function testZeroByteFile() {\n $archive = sys_get_temp_dir() . '/dwziptest' . md5(time()) . '.zip';\n $extract = sys_get_temp_dir() . '/dwziptest' . md5(time() + 1);\n\n $tar = new Tar();\n $tar->create($archive);\n $tar->addFile($this->getDir() . '/zip/zero.txt', 'foo/zero.txt');\n $tar->close();\n $this->assertFileExists($archive);\n\n $tar = new Tar();\n $tar->open($archive);\n $contents = $tar->contents();\n\n $this->assertEquals(1, count($contents));\n $this->assertEquals('foo/zero.txt', ($contents[0])->getPath());\n\n $tar = new Tar();\n $tar->open($archive);\n $tar->extract($extract);\n $tar->close();\n\n $this->assertFileExists(\"$extract/foo/zero.txt\");\n $this->assertEquals(0, filesize(\"$extract/foo/zero.txt\"));\n\n self::RDelete($extract);\n unlink($archive);\n }",
"private function addNonCheckedInFile(): void\n {\n $newFile = new RelativeFileName('new.php');\n $this->fileSystem->dumpFile($this->projectRoot->getAbsoluteFileName($newFile)->getFileName(), 'new');\n }",
"public function testCreateArchiveOfDefaultTypeByTag()\n {\n $archive = self::$uploadApi->createArchive(\n [\n 'tags' => self::$ARCHIVE_TEST_TAGS,\n 'target_tags' => self::$UNIQUE_TEST_TAG,\n ]\n );\n\n self::assertValidArchive(\n $archive,\n 'zip',\n [\n 'resource_count' => 2,\n 'file_count' => 2,\n ]\n );\n self::assertContains(self::$UNIQUE_TEST_TAG, $archive['tags']);\n }",
"public function addFileHeader(): void\n {\n $name = static::filterFilename($this->name);\n\n // calculate name length\n $nameLength = strlen($name);\n\n // create dos timestamp\n $time = static::dosTime($this->opt->getTime()->getTimestamp());\n\n $comment = $this->opt->getComment();\n\n if (!mb_check_encoding($name, 'ASCII') ||\n !mb_check_encoding($comment, 'ASCII')) {\n // Sets Bit 11: Language encoding flag (EFS). If this bit is set,\n // the filename and comment fields for this file\n // MUST be encoded using UTF-8. (see APPENDIX D)\n if (mb_check_encoding($name, 'UTF-8') &&\n mb_check_encoding($comment, 'UTF-8')) {\n $this->bits |= self::BIT_EFS_UTF8;\n }\n }\n\n if ($this->method->equals(Method::DEFLATE())) {\n $this->version = Version::DEFLATE();\n }\n\n $force = (bool)($this->bits & self::BIT_ZERO_HEADER) &&\n $this->zip->opt->isEnableZip64();\n\n $footer = $this->buildZip64ExtraBlock($force);\n\n // If this file will start over 4GB limit in ZIP file,\n // CDR record will have to use Zip64 extension to describe offset\n // to keep consistency we use the same value here\n if ($this->zip->ofs->isOver32()) {\n $this->version = Version::ZIP64();\n }\n\n $fields = [\n ['V', ZipStream::FILE_HEADER_SIGNATURE],\n ['v', $this->version->getValue()], // Version needed to Extract\n ['v', $this->bits], // General purpose bit flags - data descriptor flag set\n ['v', $this->method->getValue()], // Compression method\n ['V', $time], // Timestamp (DOS Format)\n ['V', $this->crc], // CRC32 of data (0 -> moved to data descriptor footer)\n ['V', $this->zlen->getLowFF($force)], // Length of compressed data (forced to 0xFFFFFFFF for zero header)\n ['V', $this->len->getLowFF($force)], // Length of original data (forced to 0xFFFFFFFF for zero header)\n ['v', $nameLength], // Length of filename\n ['v', strlen($footer)], // Extra data (see above)\n ];\n\n // pack fields and calculate \"total\" length\n $header = ZipStream::packFields($fields);\n\n // print header and filename\n $data = $header . $name . $footer;\n $this->zip->send($data);\n\n // save header length\n $this->hlen = Bigint::init(strlen($data));\n }",
"public function add(){\n\t\t\n\t\t// Open or create file\n\t\t$f = fopen($this->file, 'wb');\n\t\tfclose($f);\n\t}",
"private function packFiles() {\n $this->addFilesToZip($this->listOfFiles);\n }",
"public function testBinaryNull()\n {\n $filename = __DIR__ . '/php-zip-ext-test-resources/binarynull.zip';\n\n $zipFile = new ZipFile();\n $zipFile->openFile($filename);\n foreach ($zipFile as $name => $contents) {\n $info = $zipFile->getEntryInfo($name);\n $this->assertEquals(strlen($contents), $info->getSize());\n }\n $zipFile->close();\n\n $this->assertCorrectZipArchive($filename);\n }",
"function addBinarypackage($package)\n {\n if ($this->getPackageType() != 'extsrc' && $this->getPackageType() != 'zendextsrc') {\n return false;\n }\n $r = &$this->_getCurrentRelease(false);\n if ($r === null) {\n return false;\n }\n $this->_isValid = 0;\n $r = $this->_mergeTag($r, $package,\n array(\n 'binarypackage' => array('filelist'),\n ));\n }",
"function xml_create_archive()\n\t{\n\t\t$this->xml->xml_set_root( 'xmlarchive', array( 'generator' => 'IPB', 'created' => time() ) );\n\t\t$this->xml->xml_add_group( 'fileset' );\n\t\t\n\t\t$entry = array();\n\t\t\n\t\tforeach( $this->file_array as $f )\n\t\t{\n\t\t\t$content = array();\n\t\t\t\n\t\t\tforeach ( $f as $k => $v )\n\t\t\t{\n\t\t\t\tif ( $k == 'content' )\n\t\t\t\t{\n\t\t\t\t\t$v = chunk_split(base64_encode($v));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$content[] = $this->xml->xml_build_simple_tag( $k, $v );\n\t\t\t}\n\t\t\t\n\t\t\t$entry[] = $this->xml->xml_build_entry( 'file', $content );\n\t\t}\n\t\t\n\t\t$this->xml->xml_add_entry_to_group( 'fileset', $entry );\n\t\t\n\t\t$this->xml->xml_format_document();\n\t}",
"protected function _packAndWriteCurrentFile()\n {\n $archiveWriter = $this->_getWriter();\n $archiveWriter->write($this->_composeHeader());\n $currentFile = $this->_getCurrentFile();\n $fileSize = 0;\n if (is_file($currentFile) && !is_link($currentFile)) {\n $fileReader = new Mage_Archive_Helper_File($currentFile);\n $fileReader->open('r');\n while (!$fileReader->eof()) {\n $archiveWriter->write($fileReader->read());\n }\n $fileReader->close();\n $fileSize = filesize($currentFile);\n }\n $appendZerosCount = (self::TAR_BLOCK_SIZE - $fileSize % self::TAR_BLOCK_SIZE) % self::TAR_BLOCK_SIZE;\n $archiveWriter->write(str_repeat(\"\\0\", $appendZerosCount));\n }",
"function add_to_fractal_zip($filename) {\n\t// how to determine which .fzc to add to??\n}",
"function TarAddHeader($f,$phisfn,$archfn)\n{\n\t$info=stat($phisfn);\n\t$ouid=sprintf(\"%6s \", decoct($info[4]));\n\t$ogid=sprintf(\"%6s \", decoct($info[5]));\n\t$omode=sprintf(\"%6s \", decoct(fileperms($phisfn)));\n\t$omtime=sprintf(\"%11s\", decoct(filemtime($phisfn)));\n\tif (@is_dir($phisfn))\n\t{\n\t\t $type=\"5\";\n\t\t $osize=sprintf(\"%11s \", decoct(0));\n\t}\n\telse\n\t{\n\t\t $type='';\n\t\t $osize=sprintf(\"%11s \", decoct(filesize($phisfn)));\n\t\t clearstatcache();\n\t}\n\t$dmajor = '';\n\t$dminor = '';\n\t$gname = '';\n\t$linkname = '';\n\t$magic = '';\n\t$prefix = '';\n\t$uname = '';\n\t$version = '';\n\t$chunkbeforeCS=pack(\"a100a8a8a8a12A12\",$archfn, $omode, $ouid, $ogid, $osize, $omtime);\n\t$chunkafterCS=pack(\"a1a100a6a2a32a32a8a8a155a12\", $type, $linkname, $magic, $version, $uname, $gname, $dmajor, $dminor ,$prefix,'');\n\n\t$checksum = 0;\n\tfor ($i=0; $i<148; $i++) $checksum+=ord(substr($chunkbeforeCS,$i,1));\n\tfor ($i=148; $i<156; $i++) $checksum+=ord(' ');\n\tfor ($i=156, $j=0; $i<512; $i++, $j++) $checksum+=ord(substr($chunkafterCS,$j,1));\n\n\tfwrite($f,$chunkbeforeCS,148);\n\t$checksum=sprintf(\"%6s \",decoct($checksum));\n\t$bdchecksum=pack(\"a8\", $checksum);\n\tfwrite($f,$bdchecksum,8);\n\tfwrite($f,$chunkafterCS,356);\n\treturn true;\n}",
"function archiveFiles();",
"public function testSkipBinaryFileResponse()\n {\n $request = Request::create('/', 'GET', [], [], ['file' => new UploadedFile(__FILE__, 'foo.php')]);\n\n $response = $this->middleware->handle($request, $this->getNextBinaryFileResponse());\n\n $this->assertInstanceOf(BinaryFileResponse::class, $response);\n }",
"function add_file($name, $data, $opt = array()) {\n # compress data\n $zdata = gzdeflate($data);\n\n # calculate header attributes\n $crc = crc32($data);\n $zlen = strlen($zdata);\n $len = strlen($data);\n $meth = 0x08;\n\n # send file header\n $this->add_file_header($name, $opt, $meth, $crc, $zlen, $len);\n\n # print data\n $this->send($zdata);\n }",
"function installBin($tag) {\n $tmpDir = __DIR__ . \"/__hw_tmp__\";\n makeDirectory($tmpDir);\n extractBinTo(downloadBin($tag), $tmpDir);\n \n echo \"> installing hello-world-framework/bin...\\n\";\n $binDir = $tmpDir . \"/bin-\" . substr($tag, 1);\n $dst = __DIR__ . \"/hw\";\n if(copyDirectoryRecursively($binDir, $dst)) {\n echo \"error occured in copying files from \\\"\" . $bindir\n . \"to \\\"\" . $dst . \"\\\" directory\\n\";\n } else {\n echo \"removing \\\"\" . $tmpDir . \"\\\":\\n\";\n if(removeDirectoryRecursively($tmpDir) > 0) {\n echo \"error occured in deleting files from \\\"\" . $tmpDir . \"\\n\";\n } else {\n echo \"hello-world-framework/bin installed successfully...\\n\";\n }\n }\n}",
"#[@test]\n public function helloZip() {\n $entries= $this->entriesIn($this->archiveReaderFor($this->vendor, 'hello'));\n $this->assertEquals(1, sizeof($entries));\n $this->assertEquals('hello.txt', $entries[0]->getName());\n $this->assertEquals(5, $entries[0]->getSize());\n $this->assertFalse($entries[0]->isDirectory());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if parameter is compatible with given chart type | public function isCompatibleWithChart($chartType); | [
"public function isCompatibleWithChart($chartType){\n\t\t\treturn true;\n\t\t}",
"function isValidType($data);",
"public function isAcceptable($type);",
"function checkDatatype($datatype, $parameter) {\n\n\t$typeCheck = false;\n\n\tif(strpos($datatype, \"datetime\") !== false AND validateDate($parameter) === true) $typeCheck = true;\n\tif(strpos($datatype, \"int\") !== false AND is_numeric($parameter) === true) $typeCheck = true;\n\tif(strpos($datatype, \"decimal\") !== false AND is_numeric($parameter) === true) $typeCheck = true;\n\tif(strpos($datatype, \"text\") !== false AND is_string($parameter) === true) $typeCheck = true;\n\tif(strpos($datatype, \"varchar\") !== false AND is_string($parameter) === true) $typeCheck = true;\n\n\tif($typeCheck != true) {\n\t\toutputError($format, 400, \"Wrong data type in one of your parameters.\");\n\t}\n\n}",
"function containsChartType($intChartType)\n {\n foreach($this->arrSeriesData as $objSeriesData) {\n if($objSeriesData->getIntChartType() === $intChartType) {\n return true;\n }\n }\n return false;\n }",
"function zg_ai_is_data_type(array $arr) {\n return (is_array($arr) && array_key_exists('return value', $arr) &&\n zg_ai_is_type_type($arr['return value'], 'data'));\n}",
"private function isGraphableQuestionType(string $type) {\n $type = SessionTemplate::processQuestionType($type);\n\n return in_array($type, ['multi-choice', 'checkboxes', 'scale']);\n }",
"private function checkChartType($chartType)\n {\n $methods = array(\n 'draw'.ucfirst($chartType).'Chart',\n 'draw'.ucfirst($chartType)\n );\n foreach ($methods as $method) {\n if (method_exists($this->namespace.'pImage', $method)) {\n throw new \\Exception(\n 'The requested chart is not a seperate class, to draw it you'\n . ' need to call the \"'.$method.'\" method on the pImage object'\n . ' after populating it with data!'\n . ' Check the documentation on library\\'s website for details.'\n );\n }\n }\n }",
"protected function validateType()\n {\n $types = [null, 'proportion', 'portion_num', 'portion_str'];\n\n return in_array($this->input['type'], $types, true);\n }",
"private static function isDatatype($type)\n {\n return in_array($type, ['Boolean', 'DataType', 'Date', 'DateTime', 'Float', 'Integer', 'Number', 'Text', 'Time', 'URL']);\n }",
"public function is_compatible_with($plugin = null, $type = null);",
"public function acceptsDataStructure($type);",
"public function testVerifyType()\n\t{\n\t\t$testedObject = new params(array(\"1\",\"2\",\"3\",\"4\"));\n\t\t$res = $testedObject->verifyType('csv:sim');\n\t\t$this->assertFalse($res, false);\n\t}",
"protected function validateType()\r\n {\r\n $ok = TRUE;\r\n $type = $this->column->getType();\r\n\r\n if ($type == \\Db\\Column\\Column::TYPE_INTEGER)\r\n {\r\n if (!self::isInteger($this->value))\r\n {\r\n $ok = FALSE;\r\n }\r\n }\r\n else if ($type == \\Db\\Column\\Column::TYPE_DECIMAL)\r\n {\r\n if (!is_numeric(str_replace(',', '', $this->value)))\r\n {\r\n $ok = FALSE;\r\n }\r\n }\r\n\r\n return $ok;\r\n }",
"private function supportData()\n {\n $dataClass = $this->type->getDataClass();\n\n return $this->data instanceof $dataClass || $dataClass === get_class($this->data);\n }",
"public function acceptsDataStructure($type) {\n\t\treturn FALSE;\n }",
"function rule_valid_arg($type, $arg) {\r\n $ruletype = Conditions::$rules[$type];\r\n\r\n if (is_array($ruletype)) {\r\n return in_array($arg, $ruletype);\r\n } else if ($ruletype == 'bool') {\r\n return is_valid_boolean($arg);\r\n } else if (function_exists($ruletype)) {\r\n return $ruletype($arg);\r\n }\r\n\r\n return TRUE;\r\n}",
"public function validType ($type) {\r\n return in_array($type, static::$types);\r\n }",
"public function checkType() {\n return !$this->bTypeMissmatch;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests Alertable::activateOrganizationsSurvey()'s pass conditions: Active community Survey is inactive Survey has no responses The corresponding product has been purchased | public function testActivateOrgSurveyPass()
{
$communityId = 6;
$this->assertAlertable($communityId, 'activateOrganizationsSurvey');
} | [
"public function testActivateOrgSurveyFailHasResponses()\n {\n $communityId = 6;\n $surveyType = 'organization';\n $this->addResponse($communityId, $surveyType);\n $this->assertUnalertable($communityId, 'activateOrganizationsSurvey');\n }",
"public function testCreateOrganizationsSurveyPass()\n {\n $communityId = 5;\n $this->assertAlertable($communityId, 'createOrganizationsSurvey');\n }",
"public function testActivateOfficialsSurveyFailHasResponses()\n {\n $communityId = 6;\n $surveyType = 'official';\n $this->addResponse($communityId, $surveyType);\n $this->assertUnalertable($communityId, 'activateOfficialsSurvey');\n }",
"public function testActivateOfficialsSurveyFailNotPurchased()\n {\n $communityId = 6;\n $this->purchases->deleteAll(['community_id' => $communityId]);\n $this->assertUnalertable($communityId, 'activateOfficialsSurvey');\n }",
"public function testCreateOrganizationsSurveyFailNotPurchased()\n {\n $communityId = 5;\n $this->purchases->deleteAll(['community_id' => $communityId]);\n $this->assertUnalertable($communityId, \"createOrganizationsSurvey\");\n }",
"public function testActivateOfficialsSurveyFailInactiveCommunity()\n {\n $communityId = 6;\n $this->deactivateCommunity($communityId);\n $this->assertUnalertable($communityId, 'activateOfficialsSurvey');\n }",
"public function testCreateOfficialsSurveyPass()\n {\n $communityId = 5;\n $this->assertAlertable($communityId, 'createOfficialsSurvey');\n }",
"public function test_activate_license_success() {\n\t\t$api_response = (object) array(\n\t\t\t'license' => 'valid',\n\t\t\t'license_limit' => 0,\n\t\t);\n\n\t\t$message = 'Your test-product license has been activated. ';\n\t\t$message .= 'You have an unlimited license. ';\n\n\t\t$this->class->set_license_api_response( 'activate', $api_response );\n\t\t$this->class->activate_license();\n\n\t\t$expected = array(\n\t\t\tarray(\n\t\t\t\t'message' => $message,\n\t\t\t\t'success' => true,\n\t\t\t),\n\t\t);\n\t\t$this->assertEquals( $expected, $this->class->__get_notices() );\n\t}",
"public function testEnvelopeApproval()\n {\n }",
"public function ensure_keys_are_actually_active () {\n $already_active = (array)$this->get_activated_products();\n $products = $this->get_detected_products();\n if ( 0 < count( $already_active ) ) {\n foreach ( $already_active as $k => $v ) {\n //** Only look through activated plugins */\n if( !array_key_exists( $k, $products ) ) {\n continue;\n }\n $deactivate = true;\n \n if ( !empty( $already_active[ $k ][2] ) ) {\n //** Get license and activation email */\n $data = base64_decode( $already_active[ $k ][2] );\n $data = explode( '::', $data );\n $license_key = isset( $data[0] ) ? trim( $data[0] ) : '';\n $activation_email = isset( $data[1] ) ? trim( $data[1] ) : '';\n\n //** Do request */\n $response = $this->api->status( array(\n 'product_id' \t=> $already_active[ $k ][0],\n 'instance' \t\t=> $already_active[ $k ][1],\n 'email' => trim($activation_email),\n 'licence_key' => trim($license_key),\n ), false, false );\n \n //** Do not deactivate if cannot reach UD */\n if ( $response === false ) {\n continue;\n }\n if( is_array( $response ) && !empty( $response[ 'status_check' ] ) && $response[ 'status_check' ] == 'active' ) {\n $deactivate = false;\n }\n }\n if( $deactivate ) {\n $this->deactivate_product( $k, true );\n }\n }\n }\n }",
"public function testCreateOfficialsSurveyFailInactiveCommunity()\n {\n $communityId = 5;\n $this->deactivateCommunity($communityId);\n $this->assertUnalertable($communityId, \"createOfficialsSurvey\");\n }",
"public function test_api_survey_with_status_restrictions() {\n // Every other test case should be tested elsewhere.\n \n // Cleanup\n self::$CI->mongo_db->dropCollection('aw_datacollection_test', 'surveys');\n self::$CI->mongo_db->dropCollection('aw_datacollection_test', 'call_tasks');\n $this->_reset_status_restrictions();\n \n // Shorter statuses.\n $draft = Survey_entity::STATUS_DRAFT;\n $open = Survey_entity::STATUS_OPEN;\n $closed = Survey_entity::STATUS_CLOSED;\n $canceled = Survey_entity::STATUS_CANCELED;\n \n \n // Login user\n $this->_change_user(9903);\n \n /////////////////////////////////////////////////////////////////\n \n // Set actions to be allowed only in Draft status.\n $mock_config = self::$status_resctriction_config;\n $mock_config['enketo collect data'] = array(Survey_entity::STATUS_DRAFT);\n $mock_config['enketo testrun'] = array(Survey_entity::STATUS_DRAFT);\n $this->_set_status_restrictions($mock_config);\n \n // Logged user is 9903\n // User is agent.\n \n // Create survey.\n // Status open.\n // Valid xml file.\n // User is assigned to survey.\n $survey = Survey_entity::build(array(\n 'sid' => 1,\n 'status' => Survey_entity::STATUS_OPEN,\n 'files' => array(\n 'xml' => 'valid_survey.xml'\n ),\n 'agents' => array(9903)\n ));\n self::$CI->survey_model->save($survey);\n \n // Create call task\n self::$CI->mongo_db->insert('call_tasks', array(\n 'ctid' => 1001,\n 'number' => \"1100500000000\",\n 'created' => Mongo_db::date(),\n 'updated' => Mongo_db::date(),\n 'assigned' => Mongo_db::date(),\n 'author' => 1,\n 'assignee_uid' => 9903,\n 'survey_sid' => 1,\n 'activity' => array()\n )\n );\n \n self::$CI->api_survey_xslt_transform(1);\n $result = json_decode(self::$CI->output->get_output(), TRUE);\n $this->assertEquals(array('code' => 403, 'message' => 'Not allowed.'), $result['status']);\n $this->assertArrayHasKey('xml_form', $result);\n \n self::$CI->api_survey_request_respondents(1);\n $result = json_decode(self::$CI->output->get_output(), TRUE);\n $this->assertEquals(array('code' => 403, 'message' => 'Not allowed.'), $result['status']);\n \n // User assigned to call task.\n // Call task is assigned to survey.\n // User is assigned to survey.\n // Survey is the one data is being submitted for.\n $_POST = array(\n 'csrf_aw_datacollection' => self::$CI->security->get_csrf_hash(),\n 'respondent' => array(\n 'ctid' => 1001,\n 'form_data' => '<valid><tag/></valid>'\n )\n );\n self::$CI->api_survey_enketo_form_submit(1);\n $result = json_decode(self::$CI->output->get_output(), TRUE);\n $this->assertEquals(array('code' => 403, 'message' => 'Not allowed.'), $result['status']);\n \n /////////////////////////////////////////////////////////////////\n // Test again with correct status restrictions.\n $mock_config = self::$status_resctriction_config;\n $mock_config['enketo collect data'] = array(Survey_entity::STATUS_OPEN);\n $mock_config['enketo testrun'] = array(Survey_entity::STATUS_OPEN);\n $this->_set_status_restrictions($mock_config);\n \n \n self::$CI->api_survey_xslt_transform(1);\n $result = json_decode(self::$CI->output->get_output(), TRUE);\n $this->assertEquals(array('code' => 200, 'message' => 'Ok!'), $result['status']);\n $this->assertArrayHasKey('xml_form', $result);\n \n self::$CI->api_survey_request_respondents(1);\n $result = json_decode(self::$CI->output->get_output(), TRUE);\n $this->assertEquals(array('code' => 200, 'message' => 'Ok!'), $result['status']);\n \n // User assigned to call task.\n // Call task is assigned to survey.\n // User is assigned to survey.\n // Survey is the one data is being submitted for.\n $_POST = array(\n 'csrf_aw_datacollection' => self::$CI->security->get_csrf_hash(),\n 'respondent' => array(\n 'ctid' => 1001,\n 'form_data' => '<valid><tag/></valid>'\n )\n );\n self::$CI->api_survey_enketo_form_submit(1);\n $result = json_decode(self::$CI->output->get_output(), TRUE);\n $this->assertEquals(array('code' => 200, 'message' => 'Ok!'), $result['status']);\n \n \n /////////////////////////////////////////////////////////////////\n /////////////////////////////////////////////////////////////////\n // To test the manage agents api we need an admin.\n \n $this->_change_user(9901);\n // Logged user 9901.\n // User is administrator.\n \n // Create survey.\n // Status open.\n // Valid xml file.\n $survey = Survey_entity::build(array(\n 'sid' => 2,\n 'status' => Survey_entity::STATUS_OPEN,\n 'files' => array(\n 'xml' => 'valid_survey.xml'\n ),\n 'agents' => array()\n ));\n self::$CI->survey_model->save($survey);\n \n // Create new agent.\n // Absolute minimum properties for the test.\n $user_agent = User_entity::build(array(\n 'uid' => 8801,\n 'status' => User_entity::STATUS_ACTIVE,\n 'roles' => array(ROLE_CC_AGENT)\n ));\n self::$CI->user_model->save($user_agent);\n \n // Set conditions.\n $mock_config = self::$status_resctriction_config;\n $mock_config['manage agents'] = array(Survey_entity::STATUS_DRAFT);\n $this->_set_status_restrictions($mock_config);\n \n // User is an agent.\n // Action assign\n $_POST = array(\n 'uid' => 8801,\n 'action' => 'assign',\n 'csrf_aw_datacollection' => self::$CI->security->get_csrf_hash(),\n );\n \n self::$CI->api_survey_manage_agents(1);\n $result = json_decode(self::$CI->output->get_output(), TRUE);\n $this->assertEquals(array('code' => 403, 'message' => 'Not allowed.'), $result['status']);\n \n /////////////////////////////////////////////////////////////////\n \n // Set conditions.\n $mock_config = self::$status_resctriction_config;\n $mock_config['manage agents'] = array(Survey_entity::STATUS_OPEN);\n $this->_set_status_restrictions($mock_config);\n \n // User is an agent.\n // Action assign\n $_POST = array(\n 'uid' => 8801,\n 'action' => 'assign',\n 'csrf_aw_datacollection' => self::$CI->security->get_csrf_hash(),\n );\n \n self::$CI->api_survey_manage_agents(1);\n $result = json_decode(self::$CI->output->get_output(), TRUE);\n $this->assertEquals(array('code' => 200, 'message' => 'Ok!'), $result['status']);\n }",
"public function test_form_getEnquiryPurposes() {\n $enquiryPurposes = MMFormHelper::getEnquiryPurposes();\n\n $this->assertCount(5, $enquiryPurposes);\n\n $this->assertContains('-- Select --', $enquiryPurposes);\n $this->assertContains('Buyer Call', $enquiryPurposes);\n $this->assertContains('Buyer Site Visit', $enquiryPurposes);\n $this->assertContains('Broker Call', $enquiryPurposes);\n $this->assertContains('Broker Site Visit', $enquiryPurposes);\n\n $this->assertArrayHasKey('buyer-call', $enquiryPurposes);\n $this->assertArrayHasKey('buyer-site-visit', $enquiryPurposes);\n $this->assertArrayHasKey('broker-call', $enquiryPurposes);\n $this->assertArrayHasKey('broker-site-visit', $enquiryPurposes);\n unset($enquiryPurposes);\n }",
"private function activateSurvey($data)\n {\n $email = $this\n ->setStandardConfig($data)\n ->setViewVars([\n 'actionUrl' => $this->getTaskUrl([\n 'controller' => 'Surveys',\n 'action' => 'activate',\n $data['surveyType'],\n ]),\n 'surveyType' => $data['surveyType'],\n ]);\n $email->viewBuilder()->setTemplate('admin_alert/activate_survey');\n\n return $email;\n }",
"public function testActivateByTenantAdmin(): void\n {\n // Login via tenant-admin\n $token = $this->loginByEmail(self::TENANT_ADMIN_2[0], self::TENANT_ADMIN_2[1]);\n\n // Request\n $response = $this->put('api/v1/brandColours/activate/3?token=' . $token);\n\n // Check response status\n $response->assertStatus(403);\n\n $responseJSON = json_decode($response->getContent(), true);\n $success = $responseJSON['success']; // array\n $code = $responseJSON['code']; // array\n $message = $responseJSON['message']; // array\n\n $this->assertEquals(false, $success);\n $this->assertEquals(403, $code);\n $this->assertEquals('Permission is absent', $message);\n }",
"public function isProductApprovalRequired(){\t\treturn Mage::getStoreConfig('ced_vproducts/general/confirmation',Mage::app()->getStore()->getId());\t}",
"public function isProductApprovalRequired(){\n\t\treturn Mage::getStoreConfig('ced_vproducts/general/confirmation',Mage::app()->getStore()->getId());\n\t}",
"public function testHandleActivation()\n {\n // @TODO check if $doubleOptInUtil->activateByKey was called correctly!\n // @TODO check if the performSuccessRedirect was called correctly\n $this->markTestIncomplete();\n }",
"public function testPostOrgauthorizationTrusteesAudits()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if user can add object | static function canAdd(User $user) {
return self::canManage($user);
} | [
"public function canAddUsers();",
"function canAdd($user) {\n return $user->getSystemPermission('can_manage_invoices');\n }",
"public function allowAdd() {\n\n return true;\n }",
"function canAdd($user) {\n \treturn $user->isAdministrator() || $user->getSystemPermission('can_add_documents') && (boolean) DocumentCategories::findAll($user);\n }",
"function ask_access_to_add_user ()\n { \n if( ($this->B->logged_user_rights > 3) )\n {\n return TRUE;\n }\n return FALSE;\n }",
"public function canCreate()\n {\n return $this->permission('create');\n }",
"public function canAdd(IdentityInterface $user, Book $book)\n {\n return true;\n }",
"function canAdd($user, $project) {\n return ProjectObject::canAdd($user, $project, 'repository');\n }",
"public function hasAccessCreate() : bool\n {\n return (user() and user()->hasAccess(strtolower($this->moduleName), PERM_CREATE));\n }",
"public function create_items_permission_check( $request ) {\n return true;\n }",
"final protected function CanCreateIn()\n {\n return $this->AllowChildren() && \n BackendModule::Guard()->Allow(BackendAction::Create(), $this->content);\n }",
"static function canCreate() {\n return (Session::haveRight('document', CREATE)\n || Session::haveRight('followup', ITILFollowup::ADDMYTICKET));\n }",
"public function check_if_model_can_add_a_role_with_object ()\n {\n $this->testUser->assignRole($this->testUserRole);\n $this->assertTrue($this->testUser->hasRole($this->testUserRole));\n }",
"public function authorizePost()\n {\n return $this->user()->can('users.create');\n }",
"function canAdd($user, $project) {\n return ProjectObject::canAdd($user, $project, 'milestone');\n }",
"public function canHaveObject(): bool\n {\n return self::canHaveObjectFor($this->name);\n }",
"public static function hasCreateAccess() {\n $entity_class = get_called_class();\n\n return $entity_class::hasAccess('create');\n }",
"public function create(User $user): bool\n {\n return $user->hasAccess('collection:create');\n }",
"public function isUserAssignable(): bool;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets value of 'NeedReceipt' property | public function setNeedReceipt($value)
{
return $this->set(self::NEEDRECEIPT, $value);
} | [
"public function requireReceipt(): void {\n\t}",
"public function setReceiptReference($reference);",
"public function shouldSendReceipt();",
"public function testUpdateQuickReceipt()\n {\n }",
"public function setReceiptRequest( $receipt )\n {\n $this->receipt = (bool)$receipt;\n return $this;\n }",
"public function setReceipt($var)\n {\n GPBUtil::checkString($var, False);\n $this->receipt = $var;\n\n return $this;\n }",
"public function setGiftReceipt($receipt) {\n $this->collection->setValue('GIFTRECEIPTENABLE', $receipt);\n }",
"public function getNeedReceipt()\n {\n $value = $this->get(self::NEEDRECEIPT);\n return $value === null ? (boolean)$value : $value;\n }",
"public function setReceiptReference($reference)\n {\n return $this->offsetSet(self::RECEIPT_REFERENCE, $reference);\n }",
"public function setReceiptRequested($var)\n {\n GPBUtil::checkBool($var);\n $this->receipt_requested = $var;\n\n return $this;\n }",
"public function should_send_receipt() {\n return (bool) $this->get('send_receipt');\n }",
"public function declineReceipt(): void {\n\t}",
"public function isDonationReceiptRequested() {\n return isset($this->request['elefunds_receipt']) && $this->request['elefunds_receipt'] !== 'false';\n }",
"public function setReceiptOptions(?ReceiptOptions $receiptOptions): void\n {\n $this->receiptOptions = $receiptOptions;\n }",
"function beginReceipt() {\n\t\ttry {\n\t\t\t$data = $this->cr->beginReceipt();\n\t\t\t$this->saveStatus();\n\t\t\t// var_dump( $data ); // Example of returned data\n\t\t\t// die();\n\t\t} catch (Exception $e) {\n\t\t\theader('Location: index.php?error='.urlencode($e->getMessage())); die();\n\t\t}\n\t}",
"public function setDonationReceipt( ?bool $donationReceipt ): self {\n\t\t$this->donationReceipt = $donationReceipt;\n\n\t\treturn $this;\n\t}",
"public function setIsReadReceiptRequested(?bool $value): void {\n $this->getBackingStore()->set('isReadReceiptRequested', $value);\n }",
"public function sendConfirmationOfReceipt() {\n global $smarty, $user, $language;\n\n $smarty->assign('user', $user);\n $smarty->assign('cart', $this);\n $smarty->assign('date', new DateTime());\n\n $mailOutput = $smarty->fetch('mail_' . $language . '_receipt.tpl');\n mail($user->getUsername(), \"Plants for your Home\", $mailOutput, \"From: plants-for-your-home@no-host\");\n }",
"function fn_is_yandex_checkpoint_receipt_required($processor_data)\n{\n return !empty($processor_data['processor_params']['send_receipt'])\n && $processor_data['processor_params']['send_receipt'] == 'Y';\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for getWarehouseDocumentTags Get the tags for a warehouseDocument.. | public function testGetWarehouseDocumentTags()
{
} | [
"protected function getWarehouseDocumentTagsRequest($warehouse_document_id)\n {\n // verify the required parameter 'warehouse_document_id' is set\n if ($warehouse_document_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $warehouse_document_id when calling getWarehouseDocumentTags'\n );\n }\n\n $resourcePath = '/beta/warehouseDocument/{warehouseDocumentId}/tag';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($warehouse_document_id !== null) {\n $resourcePath = str_replace(\n '{' . 'warehouseDocumentId' . '}',\n ObjectSerializer::toPathValue($warehouse_document_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getTags();",
"public function getTags() {\n if($this->id !== null) {\n $tagQuery = new BaseQuery('tg');\n $tagQuery->select()\n ->join('document_tag', 'dt', ['tg.id = dt.tag_id'])\n ->join('document', 'doc', ['dt.document_id = doc.id'])\n ->andWhere(['doc.id' => $this->id]);\n\n $objTags = new Tag();\n $tagList = $objTags->queryAllFromObject($tagQuery);\n\n if($tagList !== null)\n return $tagList;\n }\n return [];\n }",
"public function testAddWarehouseDocumentTag()\n {\n }",
"public function testGetTags()\n {\n $pushwooshMock = new PushwooshMock();\n\n // At the beginning no pushwoosh requests have been sent\n $this->assertCount(0, $pushwooshMock->getPushwooshRequests());\n\n // Test call\n $getTagsRequest = GetTagsRequest::create();\n $getTagsResponse = $pushwooshMock->getTags($getTagsRequest);\n\n $this->assertNotNull($getTagsResponse);\n $this->assertSame(200, $getTagsResponse->getStatusCode());\n $this->assertSame('OK', $getTagsResponse->getStatusMessage());\n $this->assertTrue($getTagsResponse->isOk());\n\n $getTagsResponseResponse = $getTagsResponse->getResponse();\n $this->assertNotNull($getTagsResponseResponse);\n $this->assertCount(1, $getTagsResponseResponse->getResult());\n $this->assertArrayHasKey('Language', $getTagsResponseResponse->getResult());\n $this->assertSame('fr', $getTagsResponseResponse->getResult()['Language']);\n\n // One more requests has been send\n $this->assertCount(1, $pushwooshMock->getPushwooshRequests());\n $this->assertSame($getTagsRequest, $pushwooshMock->getPushwooshRequests()[0]);\n }",
"public function generateTags(): array;",
"function get_tags(){\n global $DB;\n\n $collection = $DB->get_record('tag_coll',['name' => PLUGINNAME]);\n if (!$collection->id) {\n throw new moodle_exception('pluginname', 'local_tematica');\n }\n $tags = $DB->get_records('tag', ['tagcollid' => $collection->id]);\n return $tags;\n}",
"public function testAddWarehouseDocumentTypeTag()\n {\n }",
"function get_object_tags($webit_id) {\n\n\t $sql = \" SELECT w.webit_id, w.story, t.tag FROM dfm_webits w, dfm_webit_tags wt, dfm_tags t \";\n\t $sql = $sql . \" where w.webit_id = wt.webit_id and wt.tag_id = t.tag_id \";\n\t $sql = $sql . \" and w.webit_id = \" . $webit_id ;\n\n\t $taglist = array();\n\n \t $result = $this->_con->query($sql);\n if ($result) {\n\t while($row = $result->fetch_row()) {\n\t $taglist[] = $row[2];\n\t }\n\t }\n\n return $taglist;\n\n }",
"public function getAppDocTags ()\n {\n return $this->app_doc_tags;\n }",
"public function getTweetTags() {\n\t\t$tweetsmodel = new Tweetsmodel;\n\t\t$sadTags= $tweetsmodel->getSadTweetTags();\n\t\t$happyTags = $tweetsmodel->getHappyTweetTags();\n\t\n\t\t$this->writeJSONFile($sadTags, 'sadTweetTags');\n\t\t$this->writeJSONFile($happyTags, 'happyTweetTags');\n\t}",
"function GetSupportedTags(){}",
"public function testProductTagsGet()\n {\n\n }",
"public function getWarehouseDocumentTags($warehouse_document_id)\n {\n list($response, $statusCode, $httpHeader) = $this->getWarehouseDocumentTagsWithHttpInfo ($warehouse_document_id);\n return $response; \n }",
"abstract protected function import_ecommerce_tags_into_phppos();",
"public function testDeleteWarehouseDocumentTag()\n {\n }",
"protected function readTags() {\n\t\t// include files\n\t\trequire_once(WCF_DIR.'lib/data/tag/TagCloud.class.php');\n\t\t\n\t\t// get tags\n\t\t$tagCloud = new TagCloud(WCF::getSession()->getVisibleLanguageIDArray());\n\t\t$this->tags = $tagCloud->getTags();\n\t}",
"public function testListSellerTagsGET1()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"function findDocumentsByTags($tags) {\n \t\t$docs = array();\n\t\tforeach ($tags as $tag) {\n\t\t\t$tmp = $this->find('all', array(\n\t\t \t\t'conditions' => array(\n\t\t\t\t\t'Tag.tag' => $tag,\n\t\t \t\t), \n\t\t \t\t'recursive' => -1, \n\t\t \t\t'fields' => array('Tag.id_documento')\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t\t$hola = array();\t\t\t\n\t\t\tforeach($tmp as $t) {\n\t\t \t\t$hola[] = $t['Tag']['id_documento'];\n\t\t\t}\n\t\t\t$docs[] = $hola;\t \n\t }\n\t if(count($docs) > 0) {\n\t \t$res = $docs[0];\n\t \tfor ($i = 1; $i < count($docs); $i++) {\n\t \t\t$res = array_intersect($res, $docs[$i]);\n\t \t}\n\t } else {\n\t \t$res = $this->find('all', array(\n\t \t\t'fields' => 'DISTINCT Tag.id_documento',\n\t \t\t'recursive' => -1\n\t \t\t)\n\t \t);\n\t }\t \n\n\t return $res;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funcion getter para obtener el valor del precio final | function get_precio_final(){
$valor_final = $this -> precio_base - self::$ayuda;
return $valor_final;
} | [
"public function getPrecio()\n {\n return $this->precio;\n }",
"public function getPrecio(){\n\n return $this->precio ;\n }",
"public function getPrecio(){\n return $this->precio;\n }",
"function getPrecio(){ return $this->precio;}",
"public function getPrecio()\n {\n return $this->precio;\n }",
"public function getPrecio()\r\n {\r\n return $this->precio;\r\n }",
"public function getPrecio()\n {\n return $this->precio;\n }",
"public function getPrecio_final_iva()\n {\n return $this->precio_final_iva;\n }",
"public function getPreciseValue(): int;",
"public function getValor()\n {\n return $this->valor;\n }",
"public function getValor()\n {\n return $this->valor;\n }",
"public function getValorCalculado() {\n return $this->nValor; \n }",
"public function getPrecioOferta()\n {\n return $this->precioOferta;\n }",
"public function getValorAtual() {\n\t\treturn $this->valor_atual;\n\t}",
"function getValor()\n {\n return $this->valor;\n }",
"public function getValorSolicitado();",
"public function getPrecioInicial() {\n\t\treturn $this->precioInicial;\n\t}",
"public function getPrecioPrestacion() {\n return $this->precioPrestacion;\n }",
"public function getValue()\n\t{\n\t\treturn $this->amount * $this->unit->getUnit();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a result processor. | public function addResultProcessor(ProcessResultInterface $resultProcessor, $name = '*')
{
$this->hooks[$name][self::PROCESS_RESULT][] = $resultProcessor;
return $this;
} | [
"public function addProcessor(callable $processor);",
"public function addProcessor(array $processor);",
"public function addProcessor(ProcessorInterface $processor);",
"public function addProcessor(Processor $processor) {\n $stack = $this->stack;\n $this->stack = function ($value) use ($processor, $stack) {\n /**\n * Passing the stack allows a processor to control whether it will be executed before or after the rest of\n * the stack, or to avoid processing the rest of the stack, altogether.\n */\n $result = $processor->handle($value, $stack);\n return $result;\n };\n return $this;\n }",
"private function addResult($result) {\n //Adds a result to the results array\n $this->results[] = $result;\n }",
"public function addResult(Resultable $result)\n {\n $this->results[] = $result;\n }",
"public function add() {\n $this->out('Result System Queue ResultSystem.');\n $this->hr();\n $this->out('This will process all the results .');\n $this->out('based on the parameters given to it ');\n $this->out('The parameters are ');\n $this->out('the class_id , term_id , session_id');\n $this->out(' ');\n $this->out('You can find the sourcecode of this task in: ');\n $this->out(__FILE__);\n $this->out(' ');\n /*\n * Adding a task of type 'example' with no additionally passed data\n */\n if ($this->QueuedTasks->createJob('ResultProcessing',['class_id'=>1,'session_id' =>1,'term_id' =>1] )) {\n $this->out('OK, job created, now run the worker');\n } else {\n $this->err('Could not create Job');\n }\n }",
"public function addResult(RestResponseResult $result)\n {\n $this->results[] = $result;\n $this->calculateCounts($result);\n\n if (is_null($this->getMethod())) {\n $this->setMethod($result->getMethod());\n }\n }",
"public function addProcessors(array $processors);",
"public function addResult(IResult $result)\n {\n $this->results[] = $result;\n\n return $this;\n }",
"public function addResult(ResultInterface $result)\n {\n }",
"public function add(ResultInterface $result): void;",
"function addResult($result)\n {\n $this->doSql2Xml($result);\n }",
"public function addProcessor(ProcessorInterface $processor)\n {\n $this->processors[$processor->getName()] = $processor;\n }",
"public function addProcessor(ProcessorInterface $processor)\n {\n $this->processors[$processor->getIdentifier()->getFull()] = $processor;\n }",
"function addResult($result)\r\n {\r\n $this->doSql2Xml($result);\r\n }",
"protected function addResult( Node $node ) {\n\t\t$this->result++;\n\t}",
"public function registerResponseResult()\n {\n $this->container['result'] = function ($c) {\n $result = new Renderer();\n\n return $result;\n };\n }",
"public function enable_processor() {\n\t\tif (!MediaManager::$_processor_registered) {\n\t\t\tnew Media_Manager_Post_Processor();\n\t\t\tMediaManager::$_processor_registered = true;\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates a help topic This method will save back to the database, the information that is associated with a topic. | public function edit_help_topic($help_id,$category_id,$question,$answer) {
$db = nessquikDB::getInstance();
$sql = array(
'update' => "UPDATE help SET category_id=':1', question=':2', answer=':3' WHERE help_id=':4'"
);
$stmt = $db->prepare($sql['update']);
$stmt->execute($category_id, $question, $answer, $help_id);
if($stmt->affected() < 0) {
return false;
} else {
return true;
}
} | [
"public function update() {\n $query = DB::connection()->prepare('UPDATE Topic SET name = :name, description = :description, course = :course WHERE id = :id');\n $query->execute(array('id' => $this->id, 'name' => $this->name, 'description' => $this->description, 'course' => $this->course));\n \n $query = DB::connection()->prepare('DELETE FROM Person_Topic WHERE topic = :topic');\n $query->execute(array('topic' => $this->id));\n \n $query = DB::connection()->prepare('INSERT INTO Person_Topic (person, topic) VALUES (:person, :topic)');\n \n foreach ($this->persons as $person) {\n $query->execute(array('person' => $person, 'topic' => $this->id)); \n }\n }",
"public function updated(Topic $topic)\n {\n //\n }",
"public function actionTopicEdit(){\n\t\t$form = $_POST;\n\t\t$container = $this->getContext();\n\t\t$actionModel = new \\Models\\ActionModel($container);\n\t\t$actionModel->editTopic($form);\n\t\t$this->redirect('actionPages:topics', array('id' => $this->getParam('id')));\n\t}",
"public function update_help_buying_data_topic(Request $request){\n Session::put('menu_item_parent', 'help');\n Session::put('menu_item_child', 'buying_data');\n Session::put('menu_item_child_child', 'buying_topics');\n if($request->helpTopicIdx==0){ \n $topic['page'] = \"buying\";\n $topic['title'] = $request->title;\n $topic['description'] = $request->description;\n $topic['meta_title'] = $request->meta_title;\n $topic['meta_description'] = $request->meta_description;\n $topic['active'] = $request->active;\n HelpTopic::create($topic);\n Session::flash('flash_success', 'Buying Help New Topic has been added successfully');\n }else{\n $topic['page'] = \"buying\";\n $topic['title'] = $request->title;\n $topic['description'] = $request->description;\n $topic['meta_title'] = $request->meta_title;\n $topic['meta_description'] = $request->meta_description;\n $topic['active'] = $request->active;\n HelpTopic::where('helpTopicIdx', $request->helpTopicIdx)->update($topic);\n Session::flash('flash_success', 'Buying Help Topic has been updated successfully');\n }\n return \"success\";\n }",
"public function Update()\n\t{\n\t\ttry\n\t\t{\n\t\t\t\t\t\t\n\t\t\t$json = json_decode(RequestUtil::GetBody());\n\n\t\t\tif (!$json)\n\t\t\t{\n\t\t\t\tthrow new Exception('The request body does not contain valid JSON');\n\t\t\t}\n\n\t\t\t$pk = $this->GetRouter()->GetUrlParam('id');\n\t\t\t$topic = $this->Phreezer->Get('Topic',$pk);\n\n\t\t\t// TODO: any fields that should not be updated by the user should be commented out\n\n\t\t\t// this is a primary key. uncomment if updating is allowed\n\t\t\t// $topic->Id = $this->SafeGetVal($json, 'id', $topic->Id);\n\n\t\t\t$topic->Keyword = $this->SafeGetVal($json, 'keyword', $topic->Keyword);\n\t\t\t$topic->Reply = $this->SafeGetVal($json, 'reply', $topic->Reply);\n\t\t\t$topic->TotalHits = $this->SafeGetVal($json, 'totalHits', $topic->TotalHits);\n\n\t\t\t$topic->Validate();\n\t\t\t$errors = $topic->GetValidationErrors();\n\n\t\t\tif (count($errors) > 0)\n\t\t\t{\n\t\t\t\t$this->RenderErrorJSON('Please check the form for errors',$errors);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$topic->Save();\n\t\t\t\t$this->RenderJSON($topic, $this->JSONPCallback(), true, $this->SimpleObjectParams());\n\t\t\t}\n\n\n\t\t}\n\t\tcatch (Exception $ex)\n\t\t{\n\n\n\t\t\t$this->RenderExceptionJSON($ex);\n\t\t}\n\t}",
"public function testUpdateFullTopic()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function editTopic() {\n $this->request->onlyAllow('post');\n $this->response->type('json');\n\n $data = array();\n $status = false;\n $message = \"\";\n\n if (isset($this->request->data)) {\n $topicId = $this->request->data['Topic']['id'];\n $topicName = $this->request->data['Topic']['name'];\n $data = $this->Library->editTopic($topicId, $topicName);\n $status = !empty($data);\n }\n\n if ($status) {\n $message = \"Topic renamed successfully.\";\n } else {\n $message = \"Could not rename, Topic may have been deleted\";\n }\n\n $this->set(compact('data', 'status', 'message'));\n $this->set('_serialize', array('data', 'status', 'message'));\n }",
"public function update() {\n if(isset($_SESSION['topic'])) {\n $idTopic = filter_var($_SESSION['topic'], FILTER_SANITIZE_NUMBER_INT);\n $_SESSION['topicUpdate'] = $_SESSION['topic'];\n unset($_SESSION['topic']);\n\n $this->render(\"update.topic\", \"Sujet\", [\"id\" => $idTopic]);\n }\n else {\n header(\"Location: /index.php\");\n }\n }",
"public function actionUpdate($topic_id, $language)\n {\n $mainModel = $this->findModel($topic_id);\n $mediaModel = ($mainModel->mediaData) ? $mainModel->mediaData : new Media();\n $model =$mainModel->topicsInfo[0];\n\n if (Yii::$app->request->post()) {\n\n $postInfo = Yii::$app->request->post();\n\n $mainModel->attributes = $postInfo['Topics'];\n\n $mainModel->topic_image = $postInfo['Topics']['topic_image'];\n $mainModel->slug = (Yii::$app->language == Admin::DEFAULT_LANGUAGE) ? $postInfo['Topics']['slug'] : $model->slug;\n $model->attributes = $postInfo['TopicsInfo'];\n $languageSelected = Yii::$app->language;\n\n $mainModel->topic_name = ($language == Admin::DEFAULT_LANGUAGE) ? $model->topic_name : $mainModel->topic_name;\n\n if($model->save() && $mainModel->save() ) {\n\n self::saveTopicImage($mainModel,$mediaModel,$postInfo);\n\n self::updateQuestionModel($mainModel,$model);\n\n $language = Yii::$app->language;\n $key = Yii::t('app', Admin::TOPICS_CACHE_KEY);\n Admin::clearCache($key);\n\n $key = Yii::t('app', Admin::QUESTIONS_CACHE_KEY) . '_' . $language . '_' . $model->topic_id;\n Admin::clearCache($key);\n\n $key = Yii::t('app', Admin::TOP_QUESTIONS) . '_' . $language . '_' . $topic_id;\n Admin::clearCache($key);\n Yii::$app->language = $languageSelected;\n return $this->redirect(['index']);\n } else {\n Yii::$app->language = $languageSelected;\n return $this->render('update', [\n 'model' => $model,\n 'mainModel' => $mainModel\n ]);\n }\n\n } else {\n\n return $this->render('update', [\n 'model' => $model,\n 'mainModel' => $mainModel,\n 'mediaModel' => $mediaModel\n ]);\n }\n }",
"public function DBupdate(Request $request) {\n // data update validation\n $validatedData = $request->validate([ 'topic' => 'required', ]);\n\n // gets requested topic entry\n $row = TopicOption::find($request['topic_id']);\n\n // updates entry if found\n if ($row != NULL) {\n $row->topic = $request['topic'];\n $row->save();\n }\n\n // redirect with success\n return redirect('topics')->with('success', 'Topic successfully updated');\n }",
"function updateTopic($idTopic, $title, $editDate)\n{\n\t$regexTitle=\"/^[a-zA-Z0-9]+([a-zA-Z0-9](_|-| )[a-zA-Z0-9])*[a-zA-Z0-9]+$/\";\n\n\t//Cleaning input data\n\t$idTopic=htmlentities($idTopic);\n\t$title=htmlentities($title);\n\t$title=trim($title);\n\n\t$editDate=time();\n\n\t//Verifying input data\n\tif(preg_match($regexTitle, $title))\n\t{\n\t\t//Inject in the database\n\t\t$link=connectDB();\n\t\tif($link)\n\t\t{\n\t\t\t//Secure input data before SQL query\n\t\t\t$idTopic=secureString($link, $idTopic);\n\t\t\t$title=secureString($link, $title);\n\n\t\t\t$stmt=mysqli_stmt_init($link);\n\t\t\tif(mysqli_stmt_prepare($stmt, 'UPDATE topic SET title=\"?\", editDate=? WHERE idTopic=?'))\n\t\t\t{\n\t\t\t\tmysqli_stmt_bind_param($stmt, 'sii', $title, $editDate, $idTopic);\n\t\t\t\tmysqli_stmt_execute($stmt);\n\t\t\t\tmysqli_stmt_close($stmt);\n\t\t\t\tmysqli_close($link);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo 'Erreur de connection a la BD';\n\t\t}\n\t}\n\telse\n\t{\n\t\techo 'Le nom de la description et/ou la description est invalide';\n\t\treturn false;\n\t}\n}",
"function updateTopic ($name, $language, $newName, $newLanguae, $newDescription, $newImage) {\n\t}",
"public function updated(ProvideHelp $provideHelp)\n {\n //\n }",
"public function save()\r\n\t{\r\n\t\tif( $this->id > 0 )\r\n\t\t{\r\n\t\t\t$update = array();\r\n\t\t\t$update['creator'] = $this->creator;\r\n\t\t\t$update['name'] = $this->name;\r\n\t\t\t$update['group'] = $this->group;\r\n\t\t\t$this->registry->getObject('db')->updateRecords( 'topics', $update, 'ID=' . $this->id );\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$insert = array();\r\n\t\t\t$insert['creator'] = $this->creator;\r\n\t\t\t$insert['name'] = $this->name;\r\n\t\t\t$insert['group'] = $this->group;\r\n\t\t\t$this->registry->getObject('db')->insertRecords( 'topics', $insert );\r\n\t\t\t$this->id = $this->registry->getObject('db')->lastInsertID();\r\n\t\t\tif( $this->includeFirstPost == true )\r\n\t\t\t{\r\n\t\t\t\t$this->post->setTopic( $this->id );\r\n\t\t\t\t$this->post->save();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"function forschungsatlas_admin_topic_edit($topic = array()){\n drupal_set_title($topic['name']);\n\n return drupal_get_form('forschungsatlas_admin_topic_form', $topic);\n}",
"public function vxTopicModify($Topic) {\n\t\t$Node = new Node($Topic->tpc_pid, $this->db);\n\t\t$Section = $Node->vxGetNodeInfo($Node->nod_sid);\n\t\t$permit = 0;\n\t\tif ($this->User->usr_id == $Topic->tpc_uid) {\n\t\t\tif ((time() - $Topic->tpc_created) < 86400) {\n\t\t\t\tif ($Topic->tpc_posts < 1) {\n\t\t\t\t\t$permit = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ($this->User->usr_id == 1) {\n\t\t\t$permit = 1;\n\t\t}\n\t\techo('<div id=\"main\">');\n\t\tif ($permit == 1) {\n\t\t\techo('<div class=\"blank\" align=\"left\">');\n\t\t\t_v_ico_map();\n\t\t\techo(' <a href=\"/\">' . Vocabulary::site_name . '</a> > <a href=\"/section/view/' . $Section->nod_id . '.html\">' . $Section->nod_title . '</a> > <a href=\"/board/view/' . $Node->nod_id . '.html\">' . $Node->nod_title . '</a> > <a href=\"/topic/view/' . $Topic->tpc_id . '.html\">' . make_plaintext($Topic->tpc_title) . '</a> > ' . Vocabulary::action_modifytopic . '</div>');\n\t\t\techo('<div class=\"blank\" align=\"left\"><span class=\"text_large\"><img src=\"/img/ico_conf.gif\" align=\"absmiddle\" class=\"home\" />' . Vocabulary::action_modifytopic . '</span>');\n\t\t\techo('<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" class=\"form\">');\n\t\t\techo('<form action=\"/topic/update/' . $Topic->tpc_id . '.vx\" method=\"post\" id=\"form_topic_modify\">');\n\t\t\techo('<tr><td width=\"100\" align=\"right\">标题</td><td width=\"400\" align=\"left\"><input type=\"text\" class=\"sll\" name=\"tpc_title\" value=\"' . make_single_return($Topic->tpc_title, 0) . '\" /></td></tr>');\n\t\t\techo('<tr><td width=\"100\" align=\"right\" valign=\"top\">主题简介</td><td width=\"400\" align=\"left\"><textarea rows=\"5\" class=\"ml\" name=\"tpc_description\">' . make_multi_return($Topic->tpc_description, 0) . '</textarea></td></tr>');\n\t\t\techo('<tr><td width=\"100\" align=\"right\" valign=\"top\">主题内容</td><td width=\"400\" align=\"left\"><textarea rows=\"15\" class=\"ml\" name=\"tpc_content\">' . make_multi_return($Topic->tpc_content, 0) . '</textarea></td></tr>');\n\t\t\techo('<td width=\"500\" colspan=\"3\" valign=\"middle\" align=\"right\"><span class=\"tip\">');\n\t\t\t_v_btn_f('立即修改', 'form_topic_modify');\n\t\t\techo('</span></td></tr>');\n\t\t\techo('</form>');\n\t\t\techo('</table>');\n\t\t\t_v_hr();\n\t\t\techo('<span class=\"tip\"><img src=\"/img/pico_left.gif\" align=\"absmiddle\" /><a href=\"/topic/view/' . $Topic->tpc_id . '.html\"> 返回主题 / ' . make_plaintext($Topic->tpc_title) . '</a></span>');\n\t\t\techo('</div>');\n\t\t} else {\n\t\t\techo('<div class=\"blank\" align=\"left\">');\n\t\t\t_v_ico_map();\n\t\t\techo(' <a href=\"/\">' . Vocabulary::site_name . '</a> > <a href=\"/section/view/' . $Section->nod_id . '.html\">' . $Section->nod_title . '</a> > <a href=\"/board/view/' . $Node->nod_id . '.html\">' . $Node->nod_title . '</a> > <a href=\"/topic/view/' . $Topic->tpc_id . '.html\">' . make_plaintext($Topic->tpc_title) . '</a> > ' . Vocabulary::action_modifytopic . ' > <strong>本主题的修改功能被禁止</strong></div>');\n\t\t\techo('<div class=\"blank\" align=\"left\"><span class=\"text_large\"><img src=\"/img/ico_bomb.gif\" align=\"absmiddle\" class=\"home\" />本主题的修改功能被禁止</span><br />你不能对本主题进行修改,是由于以下原因:');\n\t\t\t_v_hr();\n\t\t\tif ($this->User->usr_id != $Topic->tpc_uid) {\n\t\t\t\techo('<div class=\"geo_home_entry_odd\"> <img src=\"/img/gt.gif\" align=\"absmiddle\" /> 你所要修改的主题并不属于你</div>');\n\t\t\t}\n\t\t\tif ((time() - $Topic->tpc_created) > 86400) {\n\t\t\t\techo('<div class=\"geo_home_entry_odd\"> <img src=\"/img/gt.gif\" align=\"absmiddle\" /> 该主题创建于 24 小时以前,你不能对创建时间超过 24 小时的主题进行修改</div>');\n\t\t\t}\n\t\t\tif ($Topic->tpc_posts > 2) {\n\t\t\t\techo('<div class=\"geo_home_entry_odd\"> <img src=\"/img/gt.gif\" align=\"absmiddle\" /> 该主题已有 ' . $Topic->tpc_posts . ' 个回复,你不能修改已有至少 2 个回复的主题</div>');\n\t\t\t}\n\t\t\t_v_hr();\n\t\t\techo('<img src=\"/img/pico_left.gif\" align=\"absmiddle\" /> 返回主题 <a href=\"/topic/view/' . $Topic->tpc_id . '.html\" class=\"t\">' . make_plaintext($Topic->tpc_title) . '</a>');\n\t\t\t_v_d_e();\n\t\t}\n\t\techo('</div>');\n\t}",
"function save_help_data()\n\t{\n\t\t# Get the passed details into the url data array if any\n\t\t$urldata = $this->uri->uri_to_assoc(4, array('id'));\n\t\t\n\t\t# Display appropriate message based on the results\n\t\tif(($this->input->post('saveandnew') || $this->input->post('save')) && $this->process_form_data($urldata, $_POST, 'save'))\n\t\t{\n\t\t\t# Load view base on where the user wants to go\n\t\t\tif($this->input->post('saveandnew'))\n\t\t\t{\n\t\t\t\t$view_to_load = 'settings/createhelp_view';\n\t\t\t}\n\t\t\t\n\t\t\t$data['msg'] = \"The help data was successfully saved.\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t# For each error to be displayed as an error, it should start with \"ERROR:\"\n\t\t\t$data['msg'] = \"ERROR: The help data was not saved or may not be saved correctly. Please contact your administrator.\";\n\t\t\t\n\t\t\t# Check if error is because help topic already exists\n\t\t\tif($urldata['id'] === FALSE)\n\t\t\t{\n\t\t\t\t$data['msg'] .= $this->Control_check->check_if_already_exists('pick_help_by_page_and_topic', array('page'=>$_POST['page'], 'topic'=>$_POST['topic']));\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tif(!isset($view_to_load))\n\t\t{\n\t\t\t$query = $this->Query_reader->get_query_by_code('pick_all_help_topics', array());\n\t\t\t$result = $this->db->query($query);\n\t\t\t$data['help_topics_array'] = $result->result_array();\n\t\t\t\n\t\t\t$view_to_load = 'settings/helptopics_view';\n\t\t}\n\t\t\n\t\t\n\t\t$data['userdetails'] = $this->session->userdata('alluserdata');\n\t\t$this->load->view($view_to_load, $data);\n\t}",
"protected function _editForm()\n\t{\n\t\t$this->_resetModerator( $this->topic['forum_id'] );\n\t\t\n\t\t$this->_genericPermissionCheck( 'edit_topic' );\n\t\t\t\t\t\t\t\t\n\t\t$this->output .= $this->registry->getClass('output')->getTemplate('mod')->editTopicTitle( $this->forum, $this->topic );\n\n\t\t$navigation = $this->registry->getClass('class_forums')->forumsBreadcrumbNav( $this->forum['id'] );\n\t\t\n\t\tif( is_array( $navigation ) AND count( $navigation ) )\n\t\t{\n\t\t\tforeach( $navigation as $_id => $_nav )\n\t\t\t{\n\t\t\t\t$this->registry->getClass('output')->addNavigation( $_nav[0], $_nav[1], $_nav[2], $_nav[3] );\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t$this->registry->getClass('output')->addNavigation( $this->topic['title'], \"showtopic={$this->topic['tid']}\", $this->topic['title_seo'], 'showtopic' );\n\t\t$this->registry->getClass('output')->setTitle( $this->lang->words['t_edit'].\": \".$this->topic['title'] . ' - ' . ipsRegistry::$settings['board_name']);\n\t}",
"function updateQuestion($Topic, $QNo, $QText, $AText1, $AText2, $AText3, $AText4, $CorrectA, $connector)\n{\n\t$query = $connector->prepare(\"Update questions SET\n\tQText = '\".$QText.\"', \n\tAText1 = '\".$AText1.\"', AText2 = '\".$AText2.\"', \n\tAText3 = '\".$AText3.\"', AText4 = '\".$AText4.\"', \n\tCorrectA = \".$CorrectA.\" WHERE Topic = '\".$Topic.\"' AND QNo = '\".$QNo.\"'\");\n\t$query->execute();\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the escaped data for database. | function db_driver_escape($data)
{
global $_db;
if ($_db['resource'][$_db['target']]['config']['type'] === 'pdo_mysql') {
return '\'' . addslashes($data) . '\'';
} elseif ($_db['resource'][$_db['target']]['config']['type'] === 'pdo_pgsql' or $_db['resource'][$_db['target']]['config']['type'] === 'pdo_sqlite' or $_db['resource'][$_db['target']]['config']['type'] === 'pdo_sqlite2') {
return '\'' . str_replace('\'', '\'\'', $data) . '\'';
}
} | [
"function db_driver_escape($data)\n{\n global $_db;\n\n return '\\'' . addslashes($data) . '\\'';\n}",
"function db_driver_unescape($data)\n{\n global $_db;\n\n $data = regexp_replace('(^\\'|\\'$)', '', $data);\n $data = stripslashes($data);\n\n return $data;\n}",
"protected function obj_db_escape_data( $data )\n {\n return str_replace( \"'\", \"''\", $data );\n }",
"public function getEscapedValue();",
"function db_driver_unescape($data)\n{\n global $_db;\n\n if ($_db['resource'][$_db['target']]['config']['type'] === 'pdo_mysql') {\n $data = regexp_replace('(^\\'|\\'$)', '', $data);\n $data = stripslashes($data);\n\n return $data;\n } elseif ($_db['resource'][$_db['target']]['config']['type'] === 'pdo_pgsql' or $_db['resource'][$_db['target']]['config']['type'] === 'pdo_sqlite' or $_db['resource'][$_db['target']]['config']['type'] === 'pdo_sqlite2') {\n $data = regexp_replace('(^\\'|\\'$)', '', $data);\n $data = str_replace('\\'\\'', '\\'', $data);\n\n return $data;\n }\n}",
"function getEscaped( $text )\n\t{\n\t\treturn sqlite_escape_string($text);\n\t}",
"public function dbFetchRow()\n {\n \n $row = $this->result->fetch(PDO::FETCH_ASSOC);\n\n if(is_array($row)) {\n $row = array_map('htmlspecialchars', $row);\n return $row;\n \n }\n\n\n }",
"public function providerEscapeDatabase() {\n return [\n ['/name/', 'name', ['/', '/']],\n ['`backtick`', 'backtick', ['`', '`']],\n ['testname', 'test.name', ['', '']],\n ['\"name\"', 'name'],\n ['[name]', 'name', ['[', ']']],\n ];\n }",
"public function escape ($data) {\r\n\t\tif (gettype($data)==='array') foreach ($data as $key => $value) {\r\n\t\t\tif (isset($value['escape']) && $value['escape']===false) {\r\n\t\t\t\t$data[$key] = $value['value'];\r\n\t\t\t}\r\n\t\t\telse $data[$key] = $this->escape($value);\r\n\t\t}\r\n\t\tif (gettype($data)==='string') {\r\n\t\t\t$data = htmlspecialchars($data, ENT_QUOTES);\r\n\t\t}\r\n\t\treturn $data;\r\n\t}",
"private function quote( )\n {\n if ( @ count( $this->data_buffer ) == 0 )\n return;\n foreach ( $this->data_buffer as $key => $val )\n {\n if ( in_array( $key, $this->string_fields ))\n $this->data_buffer[$key] = @\"'\".mysql_real_escape_string($val,underQL::$db_handle).\"'\";\n else\n $this->data_buffer[$key] = $val;\n }\n }",
"function _sql_escape() { }",
"function sanitize($data) {\n return pg_escape_string($data);\n }",
"private static function db_encode_blob($data) {\n\t\treturn \"'\" . mysql_real_escape_string ( $data ) . \"'\";\n\t}",
"public function ConvertPostDataToSQL()\n {\n $sData = parent::ConvertPostDataToSQL();\n $sData = unserialize($sData);\n\n return $sData;\n }",
"function escapeData($data)\n{\n\n if (get_magic_quotes_gpc() || get_magic_quotes_runtime()) {\n $data = stripslashes_deep($data);\n }\n\n return $data;\n}",
"function bb2_db_escape($string) {\n\treturn $string;\n#\treturn $GLOBALS['lbdata']->Quote($string);\n}",
"function dbescape ($s)\n {\n global $dbcon;\n return $dbcon->real_escape_string ($s);\n }",
"function to_db($string=NULL){\n\t\treturn htmlentities($string);\n\t}",
"public static function sanitize_for_db($data) {\r\n // Strip tags from $data and convert special characters (+ double & single quotes) to HTML entities\r\n return strip_tags($data);\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check is transmission daemon is installed. Return true if transmission daemon is installed and false if it isn't. | private function isInstalled()
{
$command = 'which transmission-daemon';
$process = new Process($command);
$process->run();
if (!$process->isSuccessful()) {
throw new ProcessFailedException($command);
}
return true;
} | [
"public function is_package_install() {\n\n\t\tif ( empty( $_SESSION['monstroid_install_type'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$type = esc_attr( $_SESSION['monstroid_install_type'] );\n\n\t\tif ( in_array( $type, array( 'advanced', 'full' ) ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\n\t}",
"public function isInstalled()\n {\n $service = array_get($this->configuration(), 'service');\n\n return $service && File::exists($service);\n }",
"public function isInstalled(): bool\n {\n return $this->program->isInstalled();\n }",
"public function isInstalled();",
"public function isInstalled($packet);",
"public function checkIsInstalled() {\n\t\tif (!self::$settingsFileExists) {\n\t\t\treturn false;\n\t\t}\n\t\t$installationComplete = Settings::getSetting(\"installationComplete\");\n\t\tif (!isset($installationComplete) || $installationComplete == \"no\") {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"static function checkInstall()\n {\n // check if ChatWing component is installed\n if (!JComponentHelper::getComponent('com_chatwing', true)->enabled)\n {\n if (self::DEBUG)\n {\n JFactory::getApplication()->enqueueMessage('ChatWing component is not installed!!', 'error');\n }\n return false;\n }\n else\n {\n return true;\n }\n }",
"public function isInstallation()\n {\n $this->is_installation = false;\n if (!empty($this->echelon)) {\n if (preg_match('/^[Hh]\\-$/', $this->echelon)) {\n $this->is_installation = true;\n }\n }\n return($this->is_installation);\n }",
"public static function alreadyInstalled()\n {\n $process = new Process('brew list | grep dnsmasq');\n\n $process->run();\n\n return strlen(trim($process->getOutput())) > 0;\n }",
"public function isInstalled()\r\n\t{\r\n\t\t$installed = false;\r\n\t\t// load config\r\n\t\trequire_once dirname(__FILE__) . '/config.php';\r\n\t\t// check configuration options\r\n\t\tif (!$this->testMyMadeToPrintConfigServer()) {\r\n\t\t\t$installed = true;\r\n\t\t}\r\n\t\t\r\n\t\treturn $installed;\r\n\t}",
"public function isInstalled(): bool\n {\n return extension_loaded('swoole') || extension_loaded('openswoole');\n }",
"public static function isInstalled(){\n\n $dbcon = Connection::getInstance();\n\n $query = \"SELECT 1 FROM \".$dbcon->ele_entry.\"\";\n\n $dbcon->initiateConnection();\n $dbcon->query($query);\n $dbcon->prepare();\n\n try {\n\n $dbcon->execute();\n $dbcon->resetData();\n return true;\n\n } catch (Exception $e) {\n\n return false;\n\n }\n\n }",
"function btc_is_installed() {\r\n\tglobal $wpdb;\r\n\r\n\t$installed = get_option('btc_installed');\r\n\t\r\n\tif(!$installed) {\r\n\t\tbtc_install_system();\r\n\t\treturn false;\r\n\t}\r\n\telse {\r\n\t\treturn true;\r\n\t}\r\n\r\n}",
"function checkInstall() {\n if (file_exists($this->_addon . \"install.php\"))\n return true;\n }",
"function isRunning()\n {\n return file_exists(\"/tmp/.onInstall\");\n }",
"public static function isInstallerAvailable()\n {\n return file_exists(DOCROOT . '/install/index.php');\n }",
"final public function isAvailable()\n {\n return file_exists($this->composerBin);\n }",
"private function _hasSystemd()\n {\n try {\n $this->cli->run(\n 'which systemctl',\n function ($exitCode, $output) {\n throw new DomainException('Systemd not available');\n }\n );\n\n return true;\n } catch (DomainException $e) {\n return false;\n }\n }",
"private function checkDaemonAvailability()\n {\n return $this->check(\n $this->daemonService->isAvailable(),\n 'Daemon is not available',\n 'Daemon at localhost:1025 is not available. You may want to start the daemon: /etc/init.d/wlanthemro-daemon start'\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Save data from $pathFrom in $path | public function saveDataFromPath($path, $pathFrom, $processedHash = null)
{
// TODO: Implement saveDataFromPath() method.
} | [
"public function setPath($path);",
"public function setPath($path)\n {\n }",
"function path_save(&$path) {\n $path += array('language' => LANGUAGE_NONE);\n\n // Load the stored alias, if any.\n if (!empty($path['pid']) && !isset($path['original'])) {\n $path['original'] = path_load($path['pid']);\n }\n\n if (empty($path['pid'])) {\n drupal_write_record('url_alias', $path);\n module_invoke_all('path_insert', $path);\n }\n else {\n drupal_write_record('url_alias', $path, array('pid'));\n module_invoke_all('path_update', $path);\n }\n if (!empty($path['original'])) {\n redis_path_backend_get()->deleteAlias($path['original']['source'], $path['original']['alias'], $path['original']['language']);\n }\n redis_path_backend_get()->saveAlias($path['source'], $path['alias'], $path['language']);\n\n // Clear internal properties.\n unset($path['original']);\n\n // Clear the static alias cache.\n drupal_clear_path_cache($path['source']);\n}",
"public function save_json( $path ) {\n\t\t\treturn $this->new_save_location;\n\t\t}",
"private static function setValueInPath($path, $value)\n {\n $pathElements = explode('.', $path);\n $data = &self::getTyposcriptFrontendController()->applicationData;\n $pathElementCount = count($pathElements);\n foreach ($pathElements as $index => $key) {\n if ($index < $pathElementCount - 1) {\n if(!is_array($data[$key])) {\n $data[$key] = [];\n }\n $data = &$data[$key];\n } else {\n $data[$key] = $value;\n }\n }\n }",
"public function setSaveCopyPath($path)\n\t{\n\t\t$this->save_copy_path = $path;\n\t}",
"public function setStoragePath($path);",
"public function setOriginalPath($path);",
"public function setPath($name, $path) {}",
"public function setWriteTo($path)\r\n {\r\n $this->writeTo = $path;\r\n }",
"public function fillPropertiesFromPath()\n {\n // Check if the path exists\n if (!isset($this->path) || empty($this->path)) {\n throw new Zend_Exception('BitstreamDao path is not set in fillPropertiesFromPath()');\n }\n\n // TODO: Compute the full path from the asset store. For now using the path.\n $this->setMimetype($this->Component->MimeType->getType($this->path));\n // clear the stat cache, as the underlying file might have changed\n // since the last time filesize was called on the same filepath\n clearstatcache();\n $this->setSizebytes(UtilityComponent::fileSize($this->path));\n if (!isset($this->checksum) || empty($this->checksum)) {\n $this->setChecksum(UtilityComponent::md5file($this->path));\n }\n }",
"protected function update(&$data, $path, $value) {\r\n $parts = explode('/', $path);\r\n $current = &$data;\r\n\r\n foreach ($parts as $part) {\r\n $current = &$current[$part];\r\n }\r\n\r\n $current = $value;\r\n }",
"function puzzle_set_path(&$data, $path, $value)\n {\n $current =& $data;\n $queue = explode('/', $path);\n while (null !== ($key = array_shift($queue))) {\n if (!is_array($current)) {\n throw new RuntimeException(\"Trying to setPath {$path}, but \"\n . \"{$key} is set and is not an array\");\n } elseif (!$queue) {\n if ($key == '[]') {\n $current[] = $value;\n } else {\n $current[$key] = $value;\n }\n } elseif (isset($current[$key])) {\n $current =& $current[$key];\n } else {\n $current[$key] = array();\n $current =& $current[$key];\n }\n }\n }",
"protected function setPath(){\n $this->aScope['path'] = $this->parse('path_all');\n }",
"public function localPath($path)\n {\n $this->localPath = $path;\n }",
"function saveTo($path)\n\t{\n\t\t$dir = dirname($path);\n\t\tif (!file_exists($dir)) {\n\t\t\tmkdir($dir, 0777, true);\n\t\t}\n\n\t\tif (!move_uploaded_file($this->info['tmp_name'], $path)) {\n\t\t\tthrow new Exception(\"could not move uploaded file \" . $this->info['tmp_name']);\n\t\t}\n\n\t\treturn $path;\n\t}",
"public function setSourcePath($path);",
"public function save($data, $path='') {\n $path = \\arc\\path::collapse($path, $this->path);\n $parent = ($path=='/' ? '' : \\arc\\path::parent($path));\n if ($path!='/' && !$this->exists($parent)) {\n throw new \\arc\\IllegalRequest(\"Parent $parent not found.\", \\arc\\exceptions::OBJECT_NOT_FOUND);\n }\n $name = ($path=='/' ? '' : basename($path));\n $queryStr = <<<EOF\ninsert into nodes (parent, name, data) \nvalues (:parent, :name, :data) \non duplicate key update \n data = :data;\nEOF;\n $query = $this->db->prepare($queryStr);\n return $query->execute([\n ':parent' => $parent,\n ':name' => $name,\n ':data' => json_encode($data)\n ]);\n }",
"public function newPath(){}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a form to delete a Board entity by id. | private function createDeleteForm($id)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('board_delete', array('id' => $id)))
->setMethod('DELETE')
->add('submit', 'submit', array('label' => 'Delete'))
->getForm()
;
} | [
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('zimzim_worldcup_game_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'button.delete'))\n ->getForm();\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cup_team_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm()\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('box_delete', array('id' => '__obj_id__')))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('zastepstwo_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', SubmitType::class, array('label' => 'Skasuj zastępstwo','attr' => array('class' => 'btn btn-danger' )))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id) {\r\n $session = $this->get(\"session\");\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('occupy_delete', array('id' => $id,\r\n )))\r\n ->setMethod('DELETE')\r\n ->add('submit', 'submit', array('label' => 'Delete'))\r\n ->getForm()\r\n ;\r\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('panel_card_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n \n \n \n return $this->createFormBuilder()\n ->setAction($this->generateUrl('datostareas_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('card_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('colores_delete', array('id' => $id)))\n ->setMethod('DELETE')\n //->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder(NULL, array ( 'attr' => array ( 'id' => 'formOGD' ) ) )\n ->setAction($this->generateUrl('specificcompetence_delete2', array('id' => $id)))\n ->add('delete', 'submit', array('label' => 'Oui','attr' => array ( 'class' => 'btn btn-color2' )))\n ->add('nodelete', 'submit', array('label' => 'Non','attr' => array ( 'class' => 'btn btn-inverse' )))\n ->getForm() \n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('player_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n $id=urlencode($id);\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('forwardings_delete', array('id' => $id)))\n ->setMethod('DELETE')\n //->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('modelo_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('character_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm(MainBoard $mainBoard)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('mainboard_delete', array('id' => $mainBoard->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('partida_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('modelo101b_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('clientes_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tecnoequipo_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'ELIMINAR'))\n ->getForm()\n ;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[sortAlpArray sort DB>results Alphabetically for quicker matching] | public static function sortAlpArray($array){
$count = count($array) ;
$z = 0;
$beta = 'A' ;
$alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','w','u','v','x','y','z'] ;
$reCheck = 0 ;
$q = 0;
$checkCounter = [] ;
for ($i=0; $i < 27; $i++) {
$checkCounter[$i] = 0;
}
for($i = 0; $i < $count; $i++){
$alpha = strtoupper(substr($array[$i]->name,0,1)) ;
$check = array_search(strtolower($alpha), $alphabet) ;
if($check !== FALSE){
$arranged[$check][$checkCounter[$check]]['name'] = $array[$i]->name ;
$arranged[$check][$checkCounter[$check]]['id'] = $array[$i]->id ;
$arranged[$check][$checkCounter[$check]]['url'] = $array[$i]->url ;
$checkCounter[$check]++;
}
else if(($array[$i]->id) && ($array[$i]->url)){
$arranged[26][$checkCounter[26]]['name'] = $array[$i]->name ;
$arranged[26][$checkCounter[26]]['id'] = $array[$i]->id ;
$arranged[26][$checkCounter[26]]['url'] = $array[$i]->url ;
$checkCounter[26]++;
}
else{
}
$reCheck = $check ;
}
return $arranged ;
} | [
"protected function _sort() {}",
"public function asort () {}",
"public function natcasesort () {}",
"public function sort();",
"function ldap_sort ($link, $result, $sortfilter) {}",
"public function natcasesort() {}",
"function natcasesort() {\n\t\tnatcasesort($this->array);\n\t}",
"public function natcasesort() { }",
"protected function sortDataArray() {}",
"function dbx_sort($result, $user_compare_function)\n{\n}",
"public function natsort();",
"protected function _sortByArray($array) {}",
"function sortEntriesAlphabetical()\n {\n $assoc = array();\n foreach ($this->arrEntries as $key => $entry ) {\n $assoc[$entry['translation'][$this->_intLanguageId]['subject']] = $key;\n }\n\n ksort($assoc);\n $newEntries = array();\n foreach ($assoc as $key) {\n $newEntries[$key] = $this->arrEntries[$key];\n }\n $this->arrEntries = $newEntries;\n }",
"function sort_by_domain($array_data){\r\n $DBC = get_centralized_db_connection();\r\n\r\n if($array_data){\r\n $domains = $DBC->get_records('local_indexation_domains', null, 'name');\r\n $data_sorted = array();\r\n $datawithoutdomain = array();\r\n foreach($domains as $domain){\r\n $temporary_array = array();\r\n foreach($array_data as $data){\r\n if($data->domainid == $domain->id){\r\n $temporary_array[$data->fakeid] = $data;\r\n }\r\n if($data->domainid == null){\r\n $datawithoutdomain[$data->fakeid] = $data;\r\n }\r\n }\r\n if(count($temporary_array) != 0){\r\n $data_sorted = $data_sorted + $temporary_array;\r\n }\r\n }\r\n $data_sorted = $data_sorted + $datawithoutdomain;\r\n return $data_sorted;\r\n }\r\n return false;\r\n}",
"function sortMemUsage(&$array)\r\n {\r\n usort($array, \"Smapsparser::cmpKey\");\r\n }",
"function tsort ($a, $c = FALSE, $id = FALSE, $db = FALSE) {\n $pid = 0;\n $s = array();\n if ($id !== FALSE) $s[0] = '- - в начало - -';\n while(isset($a[$pid])) {\n if ($id === FALSE) $s[$a[$pid]['id']] = $a[$pid];\n else $s[$a[$pid]['id']] = ($db ? $db[$a[$pid][$c]] : $a[$pid][$c]);\n $pid = $a[$pid]['id'];\n }\n if ($id) unset($s[$id]);\n return $s;\n }",
"function ldap_sort($link, $result, $sortfilter)\n{\n}",
"private function getSortedSearchResults(array $resultSet) {\n uasort($resultSet, function($a, $b) {\n if ($a['relevenceScore'] == $b['relevenceScore']) {\n $aLength = strlen($a['title']) + strlen($a['description']);\n $bLength = strlen($b['title']) + strlen($b['description']);\n if ($aLength == $bLength) {\n return 0;\n }\n return ($aLength < $bLength) ? -1 : 1;\n }\n return ($a['relevenceScore'] < $b['relevenceScore']) ? 1 : -1;\n });\n return $resultSet;\n }",
"function _sortMixedResults() {\n if (isset($this->_groupMixedResults['results'])) {\n foreach ($this->_groupMixedResults['results'] as $key => $row) {\n $order[$key] = $row['order'];\n }\n array_multisort($order, SORT_ASC, $this->_groupMixedResults['results']);\n $this->groupResults[] = $this->_groupMixedResults;\n $this->nbGroups++;\n if ($this->dbgRes) $this->asUtil->dbgRecord($this->_groupMixedResults['results'], \"AjaxSearch - sorted noName results\");\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Immutable. Points to a YAML file stored on Google Cloud Storage describing additional information about the Model, that is specific to it. Unset if the Model does not have any additional information. The schema is defined as an OpenAPI 3.0.2 [Schema Object]( AutoML Models always have this field populated by Vertex AI, if no additional metadata is needed, this field is set to an empty string. Note: The URI given on output will be immutable and probably different, including the URI scheme, than the one given on input. The output URI will point to a location where the user only has a read access. Generated from protobuf field string metadata_schema_uri = 5 [(.google.api.field_behavior) = IMMUTABLE]; | public function getMetadataSchemaUri()
{
return $this->metadata_schema_uri;
} | [
"public function getSchemaUri(): string;",
"public function getPredictInstanceSchemaUri()\n {\n return $this->predict_instance_schema_uri;\n }",
"public function setMetadataSchemaUri($var)\n {\n GPBUtil::checkString($var, True);\n $this->metadata_schema_uri = $var;\n\n return $this;\n }",
"public function getMetadataUrl()\n {\n if (array_key_exists(\"metadataUrl\", $this->_propDict)) {\n return $this->_propDict[\"metadataUrl\"];\n } else {\n return null;\n }\n }",
"public function getSchemaUri()\n {\n $host = Mage::helper('xcom_xfabric')->getOntologyBaseUri();\n $this->_schemaUri = $host . $this->_topic . '/' . $this->_schemaVersion;\n return $this->_schemaUri;\n }",
"public function dumpSchema()\n {\n $schema = $this->getCurrentSchema();\n $normalizer = new SchemaNormalizer();\n $desc = $normalizer->normalize($schema);\n $yamlSchema = Yaml::dump(['schema' =>$desc], 10, 2);\n $directory = dirname($this->schemaFile);\n if (!file_exists($directory)) {\n if (mkdir($directory, 0666, true) === false) {\n throw new \\RuntimeException('Could not create directory '.$directory);\n }\n }\n if (file_put_contents($this->schemaFile, $yamlSchema) === false) {\n throw new \\RuntimeException('Could not edit dump file '.$this->schemaFile);\n }\n }",
"public function getAnnotationSchemaUri()\n {\n return $this->annotation_schema_uri;\n }",
"public function get_item_schema() {\n\t\t$schema = [\n\t\t\t'$schema' => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title' => 'info',\n\t\t\t'type' => 'object',\n\t\t\t'properties' => [\n\t\t\t\t'url' => [\n\t\t\t\t\t'description' => __( 'Site URL.' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => [ 'view' ],\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t],\n\t\t\t\t'home' => [\n\t\t\t\t\t'description' => __( 'Home URL.' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => [ 'view' ],\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t],\n\t\t\t\t'name' => [\n\t\t\t\t\t'description' => __( 'The name for the object.' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => [ 'view' ],\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t],\n\t\t\t\t'description' => [\n\t\t\t\t\t'description' => __( 'The description for the resource.' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => [ 'view' ],\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t],\n\t\t\t\t'lang' => [\n\t\t\t\t\t'description' => __( 'Site language.' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => [ 'view' ],\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t],\n\t\t\t\t'html_dir' => [\n\t\t\t\t\t'description' => __( 'HTML direction.' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => [ 'view' ],\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t],\n\t\t\t\t'settings' => [\n\t\t\t\t\t'description' => __( 'Site settings.' ),\n\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t'context' => [ 'view' ],\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t'properties' => [\n\t\t\t\t\t\t'archive' => [\n\t\t\t\t\t\t\t'description' => __( 'Archive settings.' ),\n\t\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t\t'context' => [ 'view' ],\n\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t'properties' => [\n\t\t\t\t\t\t\t\t'per_page' => [\n\t\t\t\t\t\t\t\t\t'description' => __( 'Posts per page.' ),\n\t\t\t\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t\t\t\t'context' => [ 'view' ],\n\t\t\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'comments' => [\n\t\t\t\t\t\t\t'description' => __( 'Comments settings.' ),\n\t\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t\t'context' => [ 'view' ],\n\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t'properties' => [\n\t\t\t\t\t\t\t\t'per_page' => [\n\t\t\t\t\t\t\t\t\t'description' => __( 'Comments per page.' ),\n\t\t\t\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t\t\t\t'context' => [ 'view' ],\n\t\t\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t'threads' => [\n\t\t\t\t\t\t\t\t\t'description' => __( 'Whether or not threaded comments is enabled.' ),\n\t\t\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t\t\t\t'context' => [ 'view' ],\n\t\t\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t'threads_depth' => [\n\t\t\t\t\t\t\t\t\t'description' => __( 'Comments threads depth.' ),\n\t\t\t\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t\t\t\t'context' => [ 'view' ],\n\t\t\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'blog_page' => [\n\t\t\t\t\t\t\t'description' => __( 'Blog page.' ),\n\t\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t\t'context' => [ 'view' ],\n\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t'properties' => [\n\t\t\t\t\t\t\t\t'id' => [\n\t\t\t\t\t\t\t\t\t'description' => __( 'Blog page ID.', 'bridge' ),\n\t\t\t\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t\t\t\t'context' => [ 'view' ],\n\t\t\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t'url' => [\n\t\t\t\t\t\t\t\t\t'description' => __( 'Blog page URL.', 'bridge' ),\n\t\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t\t'context' => [ 'view' ],\n\t\t\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'front_page' => [\n\t\t\t\t\t\t\t'description' => __( 'Front page.' ),\n\t\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t\t'context' => [ 'view' ],\n\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t'properties' => [\n\t\t\t\t\t\t\t\t'id' => [\n\t\t\t\t\t\t\t\t\t'description' => __( 'Front page ID.', 'bridge' ),\n\t\t\t\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t\t\t\t'context' => [ 'view' ],\n\t\t\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t'url' => [\n\t\t\t\t\t\t\t\t\t'description' => __( 'Front page URL.', 'bridge' ),\n\t\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t\t'context' => [ 'view' ],\n\t\t\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t],\n\t\t];\n\n\t\treturn $schema;\n\t}",
"protected function fullSchema() {\n return new \\Vanilla\\Models\\VanillaMediaSchema(true);\n }",
"public function writeSchema() {\n\t\tYaml::write(MIGRATIONS_DIR . '.schema', $this -> schema);\n\t}",
"public function getMetadataFilepath();",
"public function getMetadataSchema()\n {\n return isset($this->metadata_schema) ? $this->metadata_schema : null;\n }",
"private function initSchema(): void\n {\n if ($this->option('laravel50')) {\n File::copy($this->getDefaultSchemasPath('laravel50_default.yml'), $this->schemasStorage->getPath('default.yml'));\n } elseif ($this->option('laravel57')) {\n File::copy($this->getDefaultSchemasPath('laravel57_default.yml'), $this->schemasStorage->getPath('default.yml'));\n } elseif ($this->option('laravel60')) {\n File::copy($this->getDefaultSchemasPath('laravel60_default.yml'), $this->schemasStorage->getPath('default.yml'));\n } else {\n File::copy($this->getDefaultSchemasPath('laravel70_default.yml'), $this->schemasStorage->getPath('default.yml'));\n }\n\n $this->info('Init dacapo default schema yaml.');\n }",
"private function metadataPath()\n {\n return $this->repoDir.'/'.$this->prop('username').'/'.$this->prop('name').'.git/description';\n }",
"public function getSchema() : string;",
"public function getDataItemSchemaUri()\n {\n return $this->data_item_schema_uri;\n }",
"public function setMetadataSchema($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\AIPlatform\\V1beta1\\MetadataSchema::class);\n $this->metadata_schema = $var;\n\n return $this;\n }",
"public function getSamlMetadataUrl()\n {\n if (array_key_exists(\"samlMetadataUrl\", $this->_propDict)) {\n return $this->_propDict[\"samlMetadataUrl\"];\n } else {\n return null;\n }\n }",
"public function getMetadata();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if a field is unarrayed. | function wponion_is_unarrayed( $field ) {
return ( isset( $field['un_array'] ) && true === $field['un_array'] );
} | [
"function wponion_is_unarrayed( $field ) {\n\t\treturn ( isset( $field['un_array'] ) && true === $field['un_array'] ) ? true : false;\n\t}",
"public function testIsArrayType()\n {\n $field = new TextField();\n\n $this->assertFalse($field->isArrayType());\n }",
"public function isDataTypeArray()\n\t{\n\t\treturn substr($this->getRawDataType(), -2) == '[]';\n\t}",
"public final function hasArray() {\n\t\treturn ($this->hb != null) && !$this->isReadOnly();\n\t}",
"public function isNotAnArray()\n {\n $this->failIf(is_array($this->data[0]));\n }",
"public function is_value_submission_array() {\n\t\treturn false; // TODO: setup field type setting and toggle this on that condition\n\t }",
"function acf_is_array($array) {}",
"public function testAssertIsNotArray() {\n\t\tself::assertIsNotArray( true );\n\t}",
"function isArray() {\n\t\treturn is_array($this->getFieldValue());\n\t}",
"public function hasArrayAllowed()\n {\n return array_key_exists(self::ALLOW_ARRAY, $this->items);\n }",
"function wponion_valid_user_input_field( $field ) {\n\t\t$field = ( is_array( $field ) ) ? ( isset( $field['type'] ) ) ? $field['type'] : false : $field;\n\t\treturn ( ! in_array( $field, wponion_noninput_fields() ) );\n\t}",
"public function isInputField($field)\n {\n return ! is_null(array_get($this->data, $field));\n }",
"public static function isNotArray($value)\n\t{\n\t\treturn !is_array($value);\n\t}",
"public function removeFromMetaArray($field)\n {\n /*-----------------------------------------------\n | Bypass ...\n */\n if ($this->hasnotMetaSystem() or $this->isNotMeta($field)) {\n return false;\n }\n if (!isset($this->meta_array[$field])) {\n return false;\n }\n\n /*-----------------------------------------------\n | Process ...\n */\n unset($this->meta_array[$field]);\n return true;\n }",
"function acf_is_array($array)\n{\n}",
"public function testGetFieldReturnsArrayForExistingFieldWithoutFormDefaults()\n {\n $flexModel = new FlexModel($this->defaultIdentifier);\n $flexModel->load($this->loadFlexModelTestFile(), $this->cacheDirectory);\n\n $this->assertInternalType('array', $flexModel->getField('Test', 'varcharfield', true));\n $this->assertArrayNotHasKey('form_defaults', $flexModel->getField('Test', 'varcharfield', true));\n }",
"public function testAllFieldsByArrayWrongData()\n {\n $oItem = new \\SetterGetter();\n\n // the test\n $result = $oItem->allFieldsByArray('test');\n\n // assert\n $this->assertFalse($result);\n }",
"public function isAnArray()\n {\n $this->failIf(!is_array($this->data[0]));\n }",
"public function getAllowedArray()\r\n {\r\n return false;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse options to find those pertinent to jquery helper and invoke them | protected function _parseOptions(array $options)
{
foreach ($options as $key => $value) {
switch(strtolower($key)) {
case 'noconflictmode':
if (!(bool)$value) {
ZendX_JQuery_View_Helper_JQuery::disableNoConflictMode();
} else {
ZendX_JQuery_View_Helper_JQuery::enableNoConflictMode();
}
break;
case 'version':
$this->_view->JQuery()->setVersion($value);
break;
case 'localpath':
$this->_view->JQuery()->setLocalPath($value);
break;
case 'uiversion':
case 'ui_version':
$this->_view->JQuery()->setUiVersion($value);
break;
case 'uilocalpath':
case 'ui_localpath':
$this->_view->JQuery()->setUiLocalPath($value);
break;
case 'cdn_ssl':
$this->_view->JQuery()->setCdnSsl($value);
break;
case 'render_mode':
case 'rendermode':
$this->_view->JQuery()->setRenderMode($value);
break;
case 'javascriptfile':
$this->_view->JQuery()->addJavascriptFile($value);
break;
case 'javascriptfiles':
foreach($options['javascriptfiles'] as $file) {
$this->_view->JQuery()->addJavascriptFile($file);
}
break;
case 'stylesheet':
$this->_view->JQuery()->addStylesheet($value);
break;
case 'stylesheets':
foreach ($value as $stylesheet) {
$this->_view->JQuery()->addStylesheet($stylesheet);
}
break;
}
}
if ((isset($options['uienable']) && (bool) $options['uienable'])
|| (isset($options['ui_enable']) && (bool) $options['ui_enable'])
|| (!isset($options['ui_enable']) && !isset($options['uienable'])))
{
$this->_view->JQuery()->uiEnable();
} else {
$this->_view->JQuery()->uiDisable();
}
if ((isset($options['enable']) && (bool) $options['enable'])
|| !isset($options['enable']))
{
$this->_view->JQuery()->enable();
} else {
$this->_view->JQuery()->disable();
}
} | [
"function ui_tabs_get_option($selector,$option){\n return jquery_support($selector,'tabs', \"'option' , '$option'\");\n}",
"function ui_slider_get_option($selector,$option){\n return jquery_support($selector,'slider', \"'option' , '$option'\");\n}",
"public function processOptions()\n {\n $classes = ['fade'];\n foreach ($classes as $class)\n if ($this->getData(ucwords($class))) $this->addWidgetClass($class);\n }",
"function ui_droppable_get_option($selector,$option){\n return jquery_support($selector,'droppable', \"'option' , '$option'\");\n}",
"function ui_datepicker_get_option($selector,$option){\n return jquery_support($selector,'datepicker', \"'option' , '$option'\");\n}",
"protected abstract function _setupOptions();",
"public function initOptions()\n {\n if (array_key_exists('url', $this->pluginOptions) && $this->pluginOptions['url'] != '') {\n if (filter_var($this->pluginOptions['url'], FILTER_VALIDATE_URL) === FALSE) {\n $this->addError('url');\n } else {\n $this->options['url'] = 'data-url=\"' . $this->pluginOptions['url'] . '\"';\n }\n } else {\n $this->options['url'] = '';\n }\n\n if (array_key_exists('title', $this->pluginOptions) && $this->pluginOptions['title'] != '') {\n $this->options['title'] = 'data-title=\"' . $this->pluginOptions['title'] . '\"';\n } else {\n $this->options['title'] = '';\n }\n\n if (array_key_exists('colorClass', $this->pluginOptions) && $this->pluginOptions['colorClass'] != '') {\n if ($this->pluginOptions['colorClass'] == 'light') {\n $this->options['colorClass'] = 'likely-light';\n } else {\n $this->addError('colorClass');\n }\n } else {\n $this->options['colorClass'] = '';\n }\n\n if (array_key_exists('sizeClass', $this->pluginOptions) && $this->pluginOptions['sizeClass'] != '') {\n if ($this->pluginOptions['sizeClass'] == 'small') {\n $this->options['sizeClass'] = 'likely-small';\n } elseif ($this->pluginOptions['sizeClass'] == 'big') {\n $this->options['sizeClass'] = 'likely-big';\n } else {\n $this->addError('sizeClass');\n }\n } else {\n $this->options['sizeClass'] = '';\n }\n\n if (array_key_exists('items', $this->pluginOptions)) {\n if (is_array($this->pluginOptions['items']) && count($this->pluginOptions['items']) > 0) {\n foreach ($this->pluginOptions['items'] as $i => $item) {\n if (is_array($item)) {\n if (array_key_exists('class', $item) && array_key_exists($item['class'], $this->getSocialNetworksList())) {\n $this->options['items'][$i]['class'] = $item['class'];\n if (array_key_exists('title', $item)) {\n $this->options['items'][$i]['title'] = $item['title'];\n } else {\n $this->options['items'][$i]['title'] = $this->getSocialNetworksList()[$item['class']];\n }\n\n if ($item['class'] == 'twitter' && array_key_exists('via', $item) && $item['via'] != '') {\n $this->options['items'][$i]['via'] = 'data-via=\"' . $item['via'] . '\"';\n } else {\n $this->options['items'][$i]['via'] = '';\n }\n\n if ($item['class'] == 'facebook' && array_key_exists('imagePath', $item) && $item['imagePath'] != '') {\n $this->registerFacebookImageMeta($item['imagePath'], $i);\n }\n\n if ($item['class'] == 'telegram' && array_key_exists('text', $item) && $item['text'] != '') {\n $this->options['items'][$i]['text'] = 'data-text=\"' . $item['text'] . '\"';\n } else {\n $this->options['items'][$i]['text'] = '';\n }\n\n if ($item['class'] == 'pinterest' && $item['media'] != '') {\n if (file_exists($item['media'])) {\n $this->options['items'][$i]['media'] = 'data-media=\"' . $item['media'] . '\"';\n } else {\n $this->addError('items', $i, 'media');\n }\n } else {\n $this->options['items'][$i]['media'] = '';\n }\n } else {\n $this->addError('items', $i, 'class');\n }\n } else {\n $this->addError('items', '');\n }\n }\n } else {\n $this->addError('items');\n }\n } else {\n $this->options['items'] = [\n [\n 'class' => 'twitter',\n 'title' => 'Tweet',\n 'text' => '',\n 'media' => '',\n 'via' => '',\n 'image' => '',\n ],\n [\n 'class' => 'facebook',\n 'title' => 'Share',\n 'text' => '',\n 'media' => '',\n 'via' => '',\n 'image' => '',\n ],\n [\n 'class' => 'gplus',\n 'title' => 'Share',\n 'text' => '',\n 'media' => '',\n 'via' => '',\n 'image' => '',\n ],\n [\n 'class' => 'vkontakte',\n 'title' => 'Поделиться',\n 'text' => '',\n 'media' => '',\n 'via' => '',\n 'image' => '',\n ],\n [\n 'class' => 'telegram',\n 'title' => 'Send',\n 'text' => '',\n 'media' => '',\n 'via' => '',\n 'image' => '',\n ],\n [\n 'class' => 'odnoklasskini',\n 'title' => 'Класснуть',\n 'text' => '',\n 'media' => '',\n 'via' => '',\n 'image' => '',\n ],\n [\n 'class' => 'pinterest',\n 'title' => 'Pin',\n 'text' => '',\n 'media' => '',\n 'via' => '',\n 'image' => '',\n ],\n ];\n }\n return true;\n }",
"public function initPluginOptions()\n\t{\n\t\tif (null !== $this->remote)\n\t\t\t$this->pluginOptions['remote'] = Html::url($this->remote);\n\n\t\tforeach (array('backdrop', 'keyboard', 'show') as $option) {\n\t\t\t$this->pluginOptions[$option] = isset($this->pluginOptions[$option])\n\t\t\t\t? $this->pluginOptions[$option]\n\t\t\t\t: $this->{$option};\n\t\t}\n\t}",
"function LoadOptions($opts=array('options', 'plugin')){\r\n\t\tforeach ($opts as $pn) $this->{$pn} = get_option(\"fwp_search_{$pn}\");\r\n\t}",
"public function processOptions()\n {\n $classes = ['vertical', 'justified', 'xs', 'sm', 'lg'];\n foreach ($classes as $class)\n if ($this->getData(ucwords($class))) $this->addWidgetClass('btn-group-' . $class);\n }",
"public function include_options_helper() {\n\t\t\trequire_once 'classes/Helpers/Options.php';\n\t\t\tif ( ! isset( $this->options_helper ) ) {\n\t\t\t\t$this->options_helper = new \\WSAL\\Helpers\\Options( self::OPTIONS_PREFIX );\n\t\t\t}\n\t\t\treturn $this->options_helper;\n\t\t}",
"function renderOptions($args) {\n\n\t\t$options = get_option( $this->activeTab );\n\n\t\tif( isset($args['headline']) ) echo '<hr><h3>'.$args['headline'].'</h3>';\n\n\t\t$class = '';\n\t\tif( $args['class']) $class = 'class=\"' . $args['class'] . ' \"';\n\n\t\tswitch($args['type']) {\n\n\t\t\tcase 'checkbox':\n\n\t\t\t\t$checked = '';\n\t\t\t\tif( isset($options[$args['option_name']]) ) {\n\t\t\t\t\t$checked = checked( $options[$args['option_name']], 1, false );\n\t\t\t\t}\n\t\t\t\techo '<input id=\"'.$this->activeTab.'['.$args['option_name'].']\" name=\"'.$this->activeTab.'['.$args['option_name'].']\" type=\"checkbox\" value=\"1\" ' . $checked . '/>';\n\n\t\t\t\tif($args['label']) echo '<label for=\"'.$this->activeTab.'['.$args['option_name'].']\"> ' . $args['label'] . '</label>';\n\n\t\t\t\techo '<br />';\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'input':\n\n\t\t\t\t$value = '';\n\t\t\t\tif( isset($options[$args['option_name']]) ) {\n\t\t\t\t\t$value = esc_attr($options[$args['option_name']]);\n\t\t\t\t}\n\t\t\t\techo '<input type=\"text\" ' . $class . 'id=\"'.$this->activeTab.'['.$args['option_name'].']\" name=\"'.$this->activeTab.'['.$args['option_name'].']\" value=\"' . $value . '\" />'; \n\n\t\t\t\tif($args['label']) echo '<br><label for=\"'.$this->activeTab.'['.$args['option_name'].']\" ><span class=\"description\"> ' . $args['label'] . '</span></label>';\n\n\t\t\t\techo '<br />';\n\n\t\t\t\tbreak;\t\n\n\t\t\tcase 'number':\n\t\t\t\t$value = '';\n\t\t\t\tif( isset($options[$args['option_name']]) ) {\n\t\t\t\t\t$value = $options[$args['option_name']];\n\t\t\t\t}\n\t\t\t\techo '<input type=\"number\" id=\"'.$this->activeTab.'['.$args['option_name'].']\" name=\"'.$this->activeTab.'['.$args['option_name'].']\" value=\"' . $value . '\" />'; \n\t\t\t\tif($args['label']) echo '<label for=\"'.$this->activeTab.'['.$args['option_name'].']\" ><span class=\"description\"> ' . $args['label'] . '</span></label>';\n\n\t\t\t\techo '<br />';\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'select':\n\n\t\t\t\tif( $args['label'] ) echo '<label for=\"'.$this->activeTab.'['.$args['option_name'].']\" ><span class=\"description\"> ' . $args['label'] . '</span></label>';\n\n\t\t\t\techo '<select name=\"'.$this->activeTab.'['.$args['option_name'].']\" id=\"'.$this->activeTab.'['.$args['option_name'].']\">';\n\t\t\t\tforeach( $args['options'] as $option => $option_label) {\n\t\t\t\t\t$selected = ($options[$args['option_name']] == $option ) ? 'selected=\"selected\"' : '';\n\t\t\t\t\techo '<option '.$selected.' value=\"'.$option.'\">'.$option_label.'</option>';\t\n\t\t\t\t}\n\n\t\t\t\techo '</select>';\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'selectmultiple':\n\n\t\t\t\tif( $args['label'] ) echo '<label for=\"'.$this->activeTab.'['.$args['option_name'].']\" ><span class=\"description\"> ' . $args['label'] . '</span></label><br>';\n\n\t\t\t\tif( count($args['options']) > 6 ) {\n\t\t\t\t\t$size = 6;\n\t\t\t\t} else {\n\t\t\t\t\t$size = count($args['options']);\n\t\t\t\t}\n\n\t\t\t\techo '<select name=\"'.$this->activeTab.'['.$args['option_name'].'][]\" id=\"'.$this->activeTab.'['.$args['option_name'].']\" multiple=\"multiple\" size=\"'.$size.'\">';\n\n\t\t\t\t$selectedOptions = (isset($options[$args['option_name']])) ? explode(',', $options[$args['option_name']]) : array();\n\n\t\t\t\tforeach( $args['options'] as $option => $option_label) {\n\t\t\t\t\t$selected = ( in_array($option, $selectedOptions) ) ? 'selected=\"selected\"' : '';\n\t\t\t\t\techo '<option '.$selected.' value=\"'.$option.'\">'.$option_label.'</option>';\t\n\t\t\t\t}\n\n\t\t\t\techo '</select>';\n\n\t\t\t\tbreak;\n\n\n\t\t\tdefault:\n\t\t\t\techo 'Please set a type (checkbox, select, selectmultiple, input).';\n\t\t\t\tbreak;\n\t\t}\n\t}",
"protected abstract function _setupBriefOptions();",
"abstract protected function init_options(): void;",
"public function options_callback() {\n\t}",
"final public function setupOptions()\n {\n \n $this->loadOptions();\n \n //first arg is path we don't need it here\n array_shift($this->args);\n \n foreach ($this->args as $value) {\n \n if(strpos($value, '-') !== false || strpos($value, '--') !== false) {\n \n $this->loadInternalOption($value);\n \n }\n \n }\n \n }",
"function md_get_admin_app_options() {\n \n // Get app's options\n $app_options = md_the_admin_app_options();\n\n // Verify if app's options exists\n if ( $app_options ) {\n\n // Lista all options\n foreach ( $app_options as $app_option ) {\n\n // Verify if class has the method\n if ( method_exists((new MidrubBaseClassesApps\\Admin_options_templates), $app_option['type']) ) {\n\n // Set the method to call\n $method = $app_option['type'];\n\n // Display input\n echo (new MidrubBaseClassesApps\\Admin_options_templates)->$method($app_option);\n \n }\n\n }\n\n }\n \n }",
"public function amd($options);",
"public static function optionsframework_machine($options) {\r\n\r\n $data = get_option(OPTIONS);\r\n\t\r\n\t$defaults = array(); \r\n $counter = 0;\r\n\t$menu = '';\r\n\t$output = '';\r\n\tforeach ($options as $value) {\r\n\t \r\n\t\t$counter++;\r\n\t\t$val = '';\r\n\t\t\r\n\t\t//create array of defaults\t\t\r\n\t\tif ($value['type'] == 'multicheck'){\r\n\t\t\tif (is_array($value['std'])){\r\n\t\t\t\tforeach($value['std'] as $i=>$key){\r\n\t\t\t\t\t$defaults[$value['id']][$key] = true;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t\t$defaults[$value['id']][$value['std']] = true;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (isset($value['id'])) {\r\n\t\t\t\t$defaults[$value['id']] = $value['std'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//Start Heading\r\n\t\t if ( $value['type'] != \"heading\" )\r\n\t\t {\r\n\t\t \t$class = ''; \r\n\t\t\t$onclick ='';\r\n\t\t\tif(isset( $value['class'] )) { $class = $value['class']; }\r\n\t\t\tif(isset( $value['onclick'] )) { $onclick = $value['onclick']; }\r\n\t\t\t\r\n\t\t\tif($value['type'] != \"innerheading\"){\r\n\t\t\t\t$output .= '<div class=\"section section-'.$value['type'].' '. $class .'\" onclick = \"'.$onclick .'\">'.\"\\n\";\r\n\t\t\t\t$output .= '<h3 class=\"heading\">'. $value['name'] .'</h3>'.\"\\n\";\r\n\t\t\t\t$output .= '<div class=\"option\">'.\"\\n\" . '<div class=\"controls\">'.\"\\n\";\r\n\t\t\t}\r\n\t\t\tif($value['type'] == \"innerheading\"){\r\n\t\t\t\r\n\t\t\t\t$output .= '<div style=\"margin-top:30px;border-top:3px solid #E7E7E7; border-bottom:3px solid #E7E7E7; background:#E7E7E7; padding:10px 0 0 10px;\" class=\"section section-'.$value['type'].' '. $class .'\" onclick = \"'.$onclick .'\">'.\"\\n\";\r\n\t\t\t\t$output .= '<h1>'. $value['name'] .'</h1>'.\"\\n\";\r\n\t\t\t\t$output .= '<div class=\"option\">'.\"\\n\" . '<div class=\"controls\">'.\"\\n\";\r\n\t\t\t}\r\n\r\n\t\t } \r\n\r\n\t\t \r\n\r\n\t\t //End Heading\r\n\t\t \r\n\t\tswitch ( $value['type'] ) {\r\n\t\tcase 'innerheading':\r\n\t\t\t$output .= '<h2 style=\"margin:10px 0 0 0 !important;\">'. $value['name'] .'</h2>';\r\n\t\tbreak;\t\t\t\r\n\r\n\t\t\r\n\t\tcase 'text':+\r\n\t\t\t$textvalue = str_replace('\\\\','',$data[$value['id']]) ;\r\n\t\t\t$output .= '<input class=\"of-input\" name=\"'.$value['id'].'\" id=\"'. $value['id'] .'\" type=\"'. $value['type'] .'\" value=\"'. $textvalue .'\" />';\r\n\t\tbreak;\t\t\r\n\t\tcase 'select':\r\n\t\t\t$output .= '<div class=\"select_wrapper\">';\r\n\t\t\t$output .= '<select class=\"select of-input\" name=\"'.$value['id'].'\" id=\"'. $value['id'] .'\">';\r\n\t\t\tforeach ($value['options'] as $option) {\t\t\t\r\n\t\t\t\t$output .= '<option value=\"'.$option.'\" ' . selected($data[$value['id']], $option, false) . ' />'.$option.'</option>';\t \r\n\t\t\t } \r\n\t\t\t $output .= '</select></div>';\r\n\t\tbreak;\r\n\t\tcase 'select2':\r\n\t\t\t$output .= '<div class=\"select_wrapper mini\">';\r\n\t\t\t$output .= '<select class=\"select of-input\" name=\"'.$value['id'].'\" id=\"'. $value['id'] .'\">';\r\n\t\t\tforeach ($value['options'] as $option=>$name) {\r\n\t\t\t\t$output .= '<option value=\"'.$option.'\" ' . selected($data[$value['id']], $option, false) . ' />'.$name.'</option>';\r\n\t\t\t } \r\n\t\t\t$output .= '</select></div>';\r\n\t\tbreak;\r\n\t\tcase 'textarea':\t\r\n\t\t\t$cols = '8';\r\n\t\t\t$ta_value = '';\r\n\t\t\t\r\n\t\t\tif(isset($value['options'])){\r\n\t\t\t\t\t$ta_options = $value['options'];\r\n\t\t\t\t\tif(isset($ta_options['cols'])){\r\n\t\t\t\t\t$cols = $ta_options['cols'];\r\n\t\t\t\t\t} \r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$ta_value = str_replace('\\\\','',$data[$value['id']]);\t\t\t\r\n\t\t\t\t$output .= '<textarea class=\"of-input\" name=\"'.$value['id'].'\" id=\"'. $value['id'] .'\" cols=\"'. $cols .'\" rows=\"8\">'.$ta_value.'</textarea>';\t\t\r\n\t\tbreak;\r\n\t\tcase \"radio\":\r\n\t\t\t\r\n\t\t\t foreach($value['options'] as $option=>$name) {\r\n\t\t\t\t$output .= '<input class=\"of-input of-radio\" name=\"'.$value['id'].'\" type=\"radio\" value=\"'.$option.'\" ' . checked($data[$value['id']], $option, false) . ' />'.$name.'<br/>';\t\t\t\t\r\n\t\t\t}\t \r\n\t\tbreak;\r\n\t\tcase 'checkbox':\r\n\t\t\r\n\t\t\tif (!isset($data[$value['id']])) {\r\n\t\t\t\t$data[$value['id']] = '';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$output .= '<input type=\"checkbox\" class=\"checkbox of-input\" name=\"'.$value['id'].'\" id=\"'. $value['id'] .'\" value=\"1\" '. checked($data[$value['id']], true, false) .' />';\r\n\t\t\t\r\n\t\tbreak;\r\n\t\tcase 'multicheck': \t\t\t\r\n\t\t\t$multi_stored = $data[$value['id']];\r\n\t\t\t\t\t\t\r\n\t\t\tforeach ($value['options'] as $key => $option) {\r\n\t\t\t\tif (!isset($multi_stored[$key])) {$multi_stored[$key] = '';}\r\n\t\t\t\t$of_key_string = $value['id'] . '_' . $key;\r\n\t\t\t\t$output .= '<input type=\"checkbox\" class=\"checkbox of-input\" name=\"'.$value['id'].'['.$key.']'.'\" id=\"'. $of_key_string .'\" value=\"1\" '. checked($multi_stored[$key], 1, false) .' /><label for=\"'. $of_key_string .'\">'. $option .'</label><br />';\t\t\t\t\t\t\t\t\r\n\t\t\t}\t\t\t \r\n\t\tbreak;\r\n\t\tcase 'upload':\r\n\t\t\tif(!isset($value['mod'])) $value['mod'] = '';\r\n\t\t\t$output .= Options_Machine::optionsframework_uploader_function($value['id'],$value['std'],$value['mod']);\t\t\t\r\n\t\tbreak;\r\n\t\tcase 'media':\r\n\t\t\t$_id = strip_tags( strtolower($value['id']) );\r\n\t\t\t$int = '';\r\n\t\t\t$int = optionsframework_mlu_get_silentpost( $_id );\r\n\t\t\tif(!isset($value['mod'])) $value['mod'] = '';\r\n\t\t\t$output .= Options_Machine::optionsframework_media_uploader_function( $value['id'], $value['std'], $int, $value['mod'] ); // New AJAX Uploader using Media Library\t\t\t\r\n\t\tbreak;\r\n\t\tcase 'slider':\r\n\t\t\t$_id = strip_tags( strtolower($value['id']) );\r\n\t\t\t$int = '';\r\n\t\t\t$int = optionsframework_mlu_get_silentpost( $_id );\r\n\t\t\t$output .= '<div class=\"slider\"><ul id=\"'.$value['id'].'\" rel=\"'.$int.'\">';\r\n\t\t\t$slides = $data[$value['id']];\r\n\t\t\t$count = count($slides);\r\n\t\t\tif ($count < 2) {\r\n\t\t\t\t$oldorder = 1;\r\n\t\t\t\t$order = 1;\r\n\t\t\t\t$output .= Options_Machine::optionsframework_slider_function($value['id'],$value['std'],$oldorder,$order,$int,$value['descshow'],$value['team'],$value['nivo']);\r\n\t\t\t} else {\r\n\t\t\t\t$i = 0;\r\n\t\t\t\tforeach ($slides as $slide) {\r\n\t\t\t\t\t$oldorder = $slide['order'];\r\n\t\t\t\t\t$i++;\r\n\t\t\t\t\t$order = $i;\r\n\t\t\t\t\t$output .= Options_Machine::optionsframework_slider_function($value['id'],$value['std'],$oldorder,$order,$int,$value['descshow'],$value['team'],$value['nivo']);\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t\t$output .= '</ul>';\r\n\t\t\tif($value['descshow'] and !$value['team'] and !$value['nivo']){\r\n\t\t\t$output .= '<a href=\"#\" class=\"button slide_add_button\">Add New Slide</a></div>';\r\n\t\t\t}\r\n\t\t\tif($value['team'] and !$value['descshow'] and !$value['nivo']){\r\n\t\t\t$output .= '<a href=\"#\" class=\"button slide_add_button_team\">Add New Team</a></div>';\r\n\t\t\t}\t\t\t\r\n\t\t\tif(!$value['team'] and !$value['descshow'] and !$value['nivo']){\r\n\t\t\t$output .= '<a href=\"#\" class=\"button slide_add_button_desc\">Add New Client</a></div>';\t\t\t\r\n\t\t\t}\r\n\t\t\tif($value['nivo']){\r\n\t\t\t$output .= '<a href=\"#\" class=\"button nivo_slide_add_button\">Add New Nivo Slider</a></div>';\t\t\t\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\tbreak;\r\n\t\tcase 'sorter':\r\n\t\t\r\n\t\t\t$sortlists = $data[$value['id']];\r\n\t\t\t\r\n\t\t\t$output .= '<div id=\"'.$value['id'].'\" class=\"sorter\">';\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif ($sortlists) {\r\n\t\t\t\r\n\t\t\t\tforeach ($sortlists as $group=>$sortlist) {\r\n\t\t\t\t\r\n\t\t\t\t\t$output .= '<ul id=\"'.$value['id'].'_'.$group.'\" class=\"sortlist_'.$value['id'].'\">';\r\n\t\t\t\t\t$output .= '<h3>'.$group.'</h3>';\r\n\t\t\t\t\t\r\n\t\t\t\t\tforeach ($sortlist as $key => $list) {\r\n\t\t\t\t\t\tif ($key == \"placebo\") {\r\n\t\t\t\t\t\t\t$output .= '<input class=\"sorter-placebo\" type=\"hidden\" name=\"'.$value['id'].'['.$group.'][placebo]\" value=\"placebo\">';\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$output .= '<li id=\"'.$key.'\" class=\"sortee\">';\r\n\t\t\t\t\t\t\t$output .= '<input class=\"position\" type=\"hidden\" name=\"'.$value['id'].'['.$group.']['.$key.']\" value=\"'.$list.'\">';\r\n\t\t\t\t\t\t\t$output .= $list;\r\n\t\t\t\t\t\t\t$output .= '</li>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$output .= '</ul>';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$output .= '</div>';\r\n\t\tbreak;\t\t\r\n\t\tcase 'color':\t\t\r\n\t\t\t$output .= '<div id=\"' . $value['id'] . '_picker\" class=\"colorSelector\"><div style=\"background-color: '.$data[$value['id']].'\"></div></div>';\r\n\t\t\t$output .= '<input class=\"of-color\" name=\"'.$value['id'].'\" id=\"'. $value['id'] .'\" type=\"text\" value=\"'. $data[$value['id']] .'\" />';\r\n\t\tbreak; \r\n\t\t\r\n\t\tcase 'colorrgb':\t\t\r\n\t\t\t$output .= '<div id=\"' . $value['id'] . '_picker\" class=\"colorSelector\"><div style=\"background-color: '.$data[$value['id']].'\" data-color-format=\"rgb\"></div></div>';\r\n\t\t\t$output .= '<input class=\"of-color\" name=\"'.$value['id'].'\" id=\"'. $value['id'] .'\" type=\"text\" value=\"'. $data[$value['id']] .'\" />';\r\n\t\tbreak; \r\n\t\t\r\n\t\tcase 'sizeColor':\r\n\t\t$sizeColor = $data[$value['id']];\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t$output .= '<div class=\"select_wrapper typography-size\">';\r\n\t\t\t\t$output .= '<select class=\"of-typography of-typography-size select\" name=\"'.$value['id'].'[size]\" id=\"'. $value['id'].'_size\">';\r\n\t\t\t\t\tfor ($i = 9; $i < 44; $i++){ \r\n\t\t\t\t\t\t$test = $i.'px';\r\n\t\t\t\t\t\t$output .= '<option value=\"'. $i .'px\" ' . selected($sizeColor['size'], $test, false) . '>'. $i .'px</option>'; \r\n\t\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t$output .= '</select></div>';\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t/* Font Color */\r\n\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t$output .= '<div id=\"' . $value['id'] . '_color_picker\" class=\"colorSelector\"><div style=\"background-color: '.$sizeColor['color'].'\"></div></div>';\r\n\t\t\t\t$output .= '<input class=\"of-color of-typography of-typography-color\" name=\"'.$value['id'].'[color]\" id=\"'. $value['id'] .'_color\" type=\"text\" value=\"'. $sizeColor['color'] .'\" />';\r\n\t\t\t\r\n\t\t\t\r\n\r\n\t\tbreak; \t\r\n\t\t\r\n\t\tcase 'typography':\r\n\t\t\r\n\t\t\t$typography_stored = $data[$value['id']];\r\n\t\t\t\r\n\t\t\t/* Font Size */\r\n\t\t\t\r\n\t\t\tif(isset($typography_stored['size'])) {\r\n\t\t\t\r\n\t\t\t\t$output .= '<div class=\"select_wrapper typography-size\">';\r\n\t\t\t\t$output .= '<select class=\"of-typography of-typography-size select\" name=\"'.$value['id'].'[size]\" id=\"'. $value['id'].'_size\">';\r\n\t\t\t\t\tfor ($i = 9; $i < 44; $i++){ \r\n\t\t\t\t\t\t$test = $i.'px';\r\n\t\t\t\t\t\t$output .= '<option value=\"'. $i .'px\" ' . selected($typography_stored['size'], $test, false) . '>'. $i .'px</option>'; \r\n\t\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t$output .= '</select></div>';\r\n\t\t\t\r\n\t\t\t}\r\n\t\r\n\t\t\t/* Font Face */\r\n\t\t\t\r\n\t\t\tif(isset($typography_stored['face'])) {\r\n\t\t\t\r\n\t\t\t\t$output .= '<div class=\"select_wrapper typography-face\">';\r\n\t\t\t\t$output .= '<select class=\"of-typography of-typography-face select\" name=\"'.$value['id'].'[face]\" id=\"'. $value['id'].'_face\">';\r\n\t\t\t\t\r\n\t\t\t\t$faces = array('arial'=>'Arial',\r\n\t\t\t\t\t\t\t\t'verdana'=>'Verdana, Geneva',\r\n\t\t\t\t\t\t\t\t'trebuchet'=>'Trebuchet',\r\n\t\t\t\t\t\t\t\t'georgia' =>'Georgia',\r\n\t\t\t\t\t\t\t\t'Helvetica Neue' =>'Helvetica Neue',\r\n\t\t\t\t\t\t\t\t'times'=>'Times New Roman',\r\n\t\t\t\t\t\t\t\t'tahoma'=>'Tahoma, Geneva',\r\n\t\t\t\t\t\t\t\t'Telex' => 'Telex',\r\n\t\t\t\t\t\t\t\t'Droid%20Sans' => 'Droid Sans',\r\n\t\t\t\t\t\t\t\t'Convergence' => 'Convergence',\r\n\t\t\t\t\t\t\t\t'Oswald' => 'Oswald',\r\n\t\t\t\t\t\t\t\t'News%20Cycle' => 'News Cycle',\r\n\t\t\t\t\t\t\t\t'Yanone%20Kaffeesatz' => 'Yanone Kaffeesatz',\r\n\t\t\t\t\t\t\t\t'Duru%20Sans' => 'Duru Sans',\r\n\t\t\t\t\t\t\t\t'Open%20Sans' => 'Open Sans',\r\n\t\t\t\t\t\t\t\t'PT%20Sans%20Narrow' => 'PT Sans Narrow',\r\n\t\t\t\t\t\t\t\t'Macondo Swash Caps'=>'Macondo Swash Caps',\r\n\t\t\t\t\t\t\t\t'Telex'=>'Telex' ,\r\n\t\t\t\t\t\t\t\t'Sirin%20Stencil' => 'Sirin Stencil',\r\n\t\t\t\t\t\t\t\t'Actor' => 'Actor',\r\n\t\t\t\t\t\t\t\t'Iceberg' => 'Iceberg',\r\n\t\t\t\t\t\t\t\t'Ropa%20Sans' => 'Ropa Sans',\r\n\t\t\t\t\t\t\t\t'Amethysta' => 'Amethysta',\r\n\t\t\t\t\t\t\t\t'Alegreya' => 'Alegreya',\r\n\t\t\t\t\t\t\t\t'Germania One' => 'Germania One',\r\n\t\t\t\t\t\t\t\t'Gudea' => 'Gudea',\r\n\t\t\t\t\t\t\t\t'Trochut' => 'Trochut',\r\n\t\t\t\t\t\t\t\t'Ruluko' => 'Ruluko',\r\n\t\t\t\t\t\t\t\t'Alegreya' => 'Alegreya',\r\n\t\t\t\t\t\t\t\t'Questrial' => 'Questrial',\r\n\t\t\t\t\t\t\t\t'Armata' => 'Armata',\r\n\t\t\t\t\t\t\t\t'PT%20Sans' => 'PT Sans'\r\n\t\t\t\t\t\t\t\t);\t\t\t\r\n\t\t\t\tforeach ($faces as $i=>$face) {\r\n\t\t\t\t\t$output .= '<option value=\"'. $i .'\" ' . selected($typography_stored['face'], $i, false) . '>'. $face .'</option>';\r\n\t\t\t\t}\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t$output .= '</select></div>';\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/* Font Weight */\r\n\t\t\t\r\n\t\t\tif(isset($typography_stored['style'])) {\r\n\t\t\t\r\n\t\t\t\t$output .= '<div class=\"select_wrapper typography-style\">';\r\n\t\t\t\t$output .= '<select class=\"of-typography of-typography-style select\" name=\"'.$value['id'].'[style]\" id=\"'. $value['id'].'_style\">';\r\n\t\t\t\t$styles = array('normal'=>'Normal',\r\n\t\t\t\t\t\t\t\t'bold'=>'Bold'\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\tforeach ($styles as $i=>$style){\r\n\t\t\t\t\r\n\t\t\t\t\t$output .= '<option value=\"'. $i .'\" ' . selected($typography_stored['style'], $i, false) . '>'. $style .'</option>';\t\t\r\n\t\t\t\t}\r\n\t\t\t\t$output .= '</select></div>';\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/* Font Color */\r\n\r\n\t\t\tif(isset($typography_stored['color'])) {\r\n\t\t\t\r\n\t\t\t\t$output .= '<div id=\"' . $value['id'] . '_color_picker\" class=\"colorSelector\"><div style=\"background-color: '.$typography_stored['color'].'\"></div></div>';\r\n\t\t\t\t$output .= '<input class=\"of-color of-typography of-typography-color\" name=\"'.$value['id'].'[color]\" id=\"'. $value['id'] .'_color\" type=\"text\" value=\"'. $typography_stored['color'] .'\" />';\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\tbreak; \r\n\t\tcase 'border':\r\n\t\t\t\r\n\t\t\tif(!isset($data[$value['id'] . '_width'])) $data[$value['id'] . '_width'] ='';\r\n\t\t\tif(!isset($data[$value['id'] . '_style'])) $data[$value['id'] . '_style'] ='';\r\n\t\t\tif(!isset($data[$value['id'] . '_color'])) $data[$value['id'] . '_color'] ='';\r\n\t\t\t\r\n\t\t\t$border_stored = array('width' => $data[$value['id'] . '_width'] ,\r\n\t\t\t\t\t\t\t\t\t'style' => $data[$value['id'] . '_style'],\r\n\t\t\t\t\t\t\t\t\t'color' => $data[$value['id'] . '_color'],\r\n\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\r\n\t\t\t/* Border Width */\r\n\t\t\t$border_stored = $data[$value['id']];\r\n\t\t\t\r\n\t\t\t$output .= '<div class=\"select_wrapper border-width\">';\r\n\t\t\t$output .= '<select class=\"of-border of-border-width select\" name=\"'.$value['id'].'[width]\" id=\"'. $value['id'].'_width\">';\r\n\t\t\t\tfor ($i = 0; $i < 21; $i++){ \r\n\t\t\t\t$output .= '<option value=\"'. $i .'\" ' . selected($border_stored['width'], $i, false) . '>'. $i .'</option>';\t\t\t\t }\r\n\t\t\t$output .= '</select></div>';\r\n\t\t\t\r\n\t\t\t/* Border Style */\r\n\t\t\t$output .= '<div class=\"select_wrapper border-style\">';\r\n\t\t\t$output .= '<select class=\"of-border of-border-style select\" name=\"'.$value['id'].'[style]\" id=\"'. $value['id'].'_style\">';\r\n\t\t\t\r\n\t\t\t$styles = array('none'=>'None',\r\n\t\t\t\t\t\t\t'solid'=>'Solid',\r\n\t\t\t\t\t\t\t'dashed'=>'Dashed',\r\n\t\t\t\t\t\t\t'dotted'=>'Dotted');\r\n\t\t\t\t\t\t\t\r\n\t\t\tforeach ($styles as $i=>$style){\r\n\t\t\t\t$output .= '<option value=\"'. $i .'\" ' . selected($border_stored['style'], $i, false) . '>'. $style .'</option>';\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$output .= '</select></div>';\r\n\t\t\t\r\n\t\t\t/* Border Color */\t\t\r\n\t\t\t$output .= '<div id=\"' . $value['id'] . '_color_picker\" class=\"colorSelector\"><div style=\"background-color: '.$border_stored['color'].'\"></div></div>';\r\n\t\t\t$output .= '<input class=\"of-color of-border of-border-color\" name=\"'.$value['id'].'[color]\" id=\"'. $value['id'] .'_color\" type=\"text\" value=\"'. $border_stored['color'] .'\" />';\r\n\t\t\t\r\n\t\tbreak; \r\n\t\tcase 'images':\r\n\t\t\r\n\t\t\t$i = 0;\r\n\t\t\t\r\n\t\t\t$select_value = $data[$value['id']];\r\n\t\t\t\r\n\t\t\tforeach ($value['options'] as $key => $option) \r\n\t\t\t{ \r\n\t\t\t$i++;\r\n\t\r\n\t\t\t\t$checked = '';\r\n\t\t\t\t$selected = '';\r\n\t\t\t\tif(NULL!=checked($select_value, $key, false)) {\r\n\t\t\t\t\t$checked = checked($select_value, $key, false);\r\n\t\t\t\t\t$selected = 'of-radio-img-selected'; \r\n\t\t\t\t}\r\n\t\t\t\t$output .= '<span>';\r\n\t\t\t\t$output .= '<input type=\"radio\" id=\"of-radio-img-' . $value['id'] . $i . '\" class=\"checkbox of-radio-img-radio\" value=\"'.$key.'\" name=\"'.$value['id'].'\" '.$checked.' />';\r\n\t\t\t\t$output .= '<div class=\"of-radio-img-label\">'. $key .'</div>';\r\n\t\t\t\t$output .= '<img src=\"'.$option.'\" alt=\"\" class=\"of-radio-img-img '. $selected .'\" onClick=\"document.getElementById(\\'of-radio-img-'. $value['id'] . $i.'\\').checked = true;\" />';\r\n\t\t\t\t$output .= '</span>';\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\tbreak;\r\n\t\tcase 'tiles':\r\n\t\t\r\n\t\t\t$i = 0;\r\n\t\t\t\r\n\t\t\t$select_value = $data[$value['id']];\r\n\t\t\t\r\n\t\t\tforeach ($value['options'] as $key => $option) \r\n\t\t\t{ \r\n\t\t\t$i++;\r\n\t\r\n\t\t\t\t$checked = '';\r\n\t\t\t\t$selected = '';\r\n\t\t\t\tif(NULL!=checked($select_value, $option, false)) {\r\n\t\t\t\t\t$checked = checked($select_value, $option, false);\r\n\t\t\t\t\t$selected = 'of-radio-tile-selected'; \r\n\t\t\t\t}\r\n\t\t\t\t$output .= '<span>';\r\n\t\t\t\t$output .= '<input type=\"radio\" id=\"of-radio-tile-' . $value['id'] . $i . '\" class=\"checkbox of-radio-tile-radio\" value=\"'.$option.'\" name=\"'.$value['id'].'\" '.$checked.' />';\r\n\t\t\t\t$output .= '<div class=\"of-radio-tile-img '. $selected .'\" style=\"background: url('.$option.')\" onClick=\"document.getElementById(\\'of-radio-tile-'. $value['id'] . $i.'\\').checked = true;\"></div>';\r\n\t\t\t\t$output .= '</span>';\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\tbreak;\r\n\t\tcase \"info\":\r\n\t\t\t$info_text = $value['std'];\r\n\t\t\t$output .= '<div class=\"of-info\">'.$info_text.'</div>';\r\n\t\tbreak; \t\r\n\t\tcase 'heading':\r\n\t\t\tif($counter >= 2){\r\n\t\t\t $output .= '</div>'.\"\\n\";\r\n\t\t\t}\r\n\t\t\t$header_class = ereg_replace(\"[^A-Za-z0-9]\", \"\", strtolower($value['name']) );\r\n\t\t\t$jquery_click_hook = ereg_replace(\"[^A-Za-z0-9]\", \"\", strtolower($value['name']) );\r\n\t\t\t$jquery_click_hook = \"of-option-\" . $jquery_click_hook;\r\n\t\t\t$menu .= '<li class=\"'. $header_class .'\"><a title=\"'. $value['name'] .'\" href=\"#'. $jquery_click_hook .'\">'. $value['name'] .'</a></li>';\r\n\t\t\t$output .= '<div class=\"group\" id=\"'. $jquery_click_hook .'\"><h2>'.$value['name'].'</h2>'.\"\\n\";\r\n\t\tbreak;\r\n\t\tcase 'backup':\r\n\t\t\r\n\t\t$instructions = $value['options'];\r\n\t\t$backup = get_option(BACKUPS);\r\n\t\t\r\n\t\tif(!isset($backup['backup_log'])) {\r\n\t\t\t$log = 'No backups yet';\r\n\t\t} else {\r\n\t\t\t$log = $backup['backup_log'];\r\n\t\t}\r\n\t\t\r\n\t\t$output .= '<div class=\"backup-box\">';\r\n\t\t$output .= '<div class=\"instructions\">'.$instructions.\"\\n\";\r\n\t\t$output .= '<p><strong>Last Backup : <span class=\"backup-log\">'.$log.'</span></strong></p></div>'.\"\\n\";\r\n\t\t$output .= '<a href=\"#\" id=\"of_backup_button\" class=\"button\" title=\"Backup Options\">Backup Options</a>';\r\n\t\t$output .= '<a href=\"#\" id=\"of_restore_button\" class=\"button\" title=\"Restore Options\">Restore Options</a>';\r\n\t\t$output .= '</div>';\r\n\t\t\r\n\t\tbreak;\t\t\r\n\t\t} \r\n\t\t\r\n\t\t// if TYPE is an array, formatted into smaller inputs... ie smaller values\r\n\t\tif ( is_array($value['type'])) {\r\n\t\t\tforeach($value['type'] as $array){\r\n\t\t\t\r\n\t\t\t\t\t$id = $array['id']; \r\n\t\t\t\t\t$std = $array['std'];\r\n\t\t\t\t\t$saved_std = get_option($id);\r\n\t\t\t\t\tif($saved_std != $std){$std = $saved_std;} \r\n\t\t\t\t\t$meta = $array['meta'];\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($array['type'] == 'text') { // Only text at this point\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t $output .= '<input class=\"input-text-small of-input\" name=\"'. $id .'\" id=\"'. $id .'\" type=\"text\" value=\"'. $std .'\" />'; \r\n\t\t\t\t\t\t $output .= '<span class=\"meta-two\">'.$meta.'</span>';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t}\r\n\t\tif ( $value['type'] != 'heading' ) { \r\n\t\t\tif ( $value['type'] != 'checkbox' ) \r\n\t\t\t\t{ \r\n\t\t\t\t$output .= '<br/>';\r\n\t\t\t\t}\r\n\t\t\tif(!isset($value['desc'])){ $explain_value = ''; } else{ \r\n\t\t\t\t$explain_value = '<div class=\"explain\">'. $value['desc'] .'</div>'.\"\\n\"; \r\n\t\t\t} \r\n\t\t\t$output .= '</div>'.$explain_value.\"\\n\";\r\n\t\t\t$output .= '<div class=\"clear\"> </div></div></div>'.\"\\n\";\r\n\t\t\t}\r\n\t \r\n\t}\r\n $output .= '</div>';\r\n return array($output,$menu,$defaults);\t\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Is there a version of this page in the deletion archive? | public function isDeletedQuick()
{
if ($this->getNamespace() < 0)
{
return false;
}
$dbr = wfGetDB(DB_SLAVE);
$deleted = (bool) $dbr->selectField(
'archive',
'1',
array('ar_namespace' => $this->getNamespace(), 'ar_title' => $this->getDBkey()),
__METHOD__);
if (! $deleted && $this->getNamespace() == NS_FILE)
{
$deleted = (bool) $dbr->selectField('filearchive', '1', array('fa_name' => $this->getDBkey()), __METHOD__);
}
return $deleted;
} | [
"function getIsDeletedFromStage() {\n\t\t// new unsaved pages could be deleted from stage\n\t\tif(!$this->ID) return true;\n\t\tif($this->isNew()) return false;\n\t\t\n\t\t// new pages with a pseudo-id are regarded as deleted from stage as well\n\t\tif(!is_numeric($this->ID)) return false;\n\t\t\n\t\t$stageVersion = Versioned::get_versionnumber_by_stage('SiteTree', 'Stage', $this->ID);\n\t\t$liveVersion = Versioned::get_versionnumber_by_stage('SiteTree', 'Live', $this->ID);\n\n\t\treturn (!$stageVersion && $liveVersion);\n\t}",
"function astra_is_edd_archive_page() {\r\n\t\tif (\r\n\t\t\tis_post_type_archive( 'download' ) ||\r\n\t\t\tis_tax( 'download_category' ) ||\r\n\t\t\tis_tax( 'download_tag' )\r\n\t\t) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public function isPublishedVersion()\n\t{\n\t\treturn Page::STATE_PUBLISHED == $this->version;\n\t}",
"public function canDeletePages();",
"function is_archive_page(): bool {\n return (strpos(get_current_url(), '/jewellery/archive') === 0);\n}",
"public function isDeleted() {\n if ($this->type == VERSIONCONTROL_ITEM_FILE_DELETED\n || $this->type == VERSIONCONTROL_ITEM_DIRECTORY_DELETED) {\n return TRUE;\n }\n return FALSE;\n }",
"public function getIsRevision(): bool;",
"function has_archives_page() {\n\n\t$page = get_archives_page();\n\n\treturn ! is_null( $page );\n}",
"protected function is_trashed_page() {\n\t\treturn 'trashed' === Param::get( 'status' );\n\t}",
"public function hasArchive()\n\t{\n\t\treturn Archive::get()->Filter(['OriginalRecordClass' => $this->owner->getClassName(),'BigID' => $this->owner->BigID])->First();\n\t}",
"protected function _postHasDeletedUndeletablePage()\n {\n // get undeleteable page uids from new navigation\n $nav = $this->_getNavigationFromPost();\n $iterator = new RecursiveIteratorIterator($nav, RecursiveIteratorIterator::SELF_FIRST);\n $newUndeleteableUids = array();\n foreach ($iterator as $page) {\n if ($page->can_delete == false) {\n $newUndeleteableUids[] = $page->uid;\n }\n }\n // make sure every undeleteable page uid from old navigation is in the list of new undeleteable page uids\n $nav = Omeka_Navigation::createNavigationFromFilter('public_navigation_main');\n $iterator = new RecursiveIteratorIterator($nav, RecursiveIteratorIterator::SELF_FIRST);\n foreach ($iterator as $page) {\n if ($page->can_delete == false) {\n if (!in_array($page->uid, $newUndeleteableUids)) {\n $this->addError(__('Navigation links that have undeleteable sublinks cannot be deleted.'));\n return true;\n }\n }\n }\n return false;\n }",
"function wp_is_post_revision($post)\n {\n }",
"public function has_published_pages() {}",
"public function isRevisioningEnabled() : bool;",
"function delete_content_object_version($object);",
"public function isArchive(): bool;",
"public function isMountedPage() {}",
"public function needsUpdate() {\n\t\treturn ( $this->versionTag == static::PAGE_WILLUPDATE\n\t\t\t&& $this->hasChanged()\n\t\t\t)\n\t\t\t|| $this->versionTag == static::PAGE_NEW;\n\t}",
"public function isRevisionable();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
test load parameters from array | public function testLoadParameters()
{
// load parameters
$p1 = [ 'parameters' => [ 'test.test' => 'one']];
$this->object->load($p1);
$this->assertEquals(
[ 'test' => 'one'], $this->invokeMethod('getParameter', ['test'])
);
$this->assertEquals(
'one', $this->invokeMethod('getParameter', ['test.test'])
);
// merge parameters
$p2 = [ 'parameters' => [ 'test.test2' => 'two']];
$this->object->load($p2);
$this->assertEquals(
[ 'test' => 'one', 'test2' => 'two'],
$this->invokeMethod('getParameter', ['test'])
);
// load array
$p3 = [ 'parameters' => [ 'test' => [ 'test3' => 'three']]];
$this->object->load($p3);
$this->assertEquals(
[ 'test' => 'one', 'test2' => 'two', 'test3' => 'three'],
$this->invokeMethod('getParameter', ['test'])
);
// replace parameters
$p4 = [ 'parameters' => [ 'test.test' => 'four']];
$this->object->load($p4);
$this->assertEquals(
[ 'test' => 'four', 'test2' => 'two', 'test3' => 'three'],
$this->invokeMethod('getParameter', ['test'])
);
$p5 = [ 'parameters' => [ 'test' =>
[ 'test' => 'wow', 'test3' => 'wow2']]];
$this->object->load($p5);
$this->assertEquals(
[ 'test' => 'wow', 'test2' => 'two', 'test3' => 'wow2'],
$this->invokeMethod('getParameter', ['test'])
);
$p6 = [ 'parameters' => [ 'test' => 'six']];
$this->object->load($p6);
$this->assertEquals(
'six', $this->invokeMethod('getParameter', ['test'])
);
} | [
"public function testLoad()\n {\n $array = Fixtures::getSamplePhpArray();\n $this->assertSame($array, $this->arrayLoader->load($array));\n }",
"public function testLoadArray()\n\t{\n\t\t$array = array(\n\t\t\t'foo' => 'bar'\n\t\t);\n\t\t$registry = new Registry;\n\t\t$result = $registry->loadArray($array);\n\n\t\t// Checking result is self that we can chaining\n\t\t$this->assertEquals($result, $registry, '$result should be $registry self that support chaining');\n\n\t\t// Test getting a known value.\n\t\t$this->assertThat(\n\t\t\t$registry->get('foo'),\n\t\t\t$this->equalTo('bar'),\n\t\t\t'Line: ' . __LINE__ . '.'\n\t\t);\n\t}",
"public function testLoad()\n {\n Config::load(array(\n 'App' => array(\n 'one' => 1,\n 'two' => 2,\n 'three' => 3,\n ),\n 'Test' => 'test',\n 'another' => new \\stdClass()\n ));\n\n $expected = array(\n 'App' => array(\n 'one' => 1,\n 'two' => 2,\n 'three' => 3,\n ),\n 'Test' => 'test',\n 'another' => new \\stdClass()\n );\n\n foreach ($expected as $key => $value) {\n $actual = Config::get($key);\n $this->assertEquals($value, $actual);\n }\n }",
"private function & loadParameters (&$array)\n {\n\n // list of available parameters\n $available = array('database', 'host', 'password', 'user');\n \n $parameters = array();\n\n foreach ($available as $parameter)\n {\n\n $$parameter = $this->getParameter($parameter);\n\n $parameters[$parameter] = ($$parameter != null)\n ? $array[$$parameter] : null;\n\n }\n\n return $parameters;\n\n }",
"public function test_loadRealFileGetRealParams()\n\t{\n\t\t$file = new ConfigFile;\n\t\t$file->load(dirname(__DIR__) . '/Data/TestFiles/test.yml');\n\n\t\t$this->assertInstanceOf('Danzabar\\Config\\Data\\ParamBag', $file->params());\n\t\t$this->assertTrue(isset($file->params()->test));\n\t\t$this->assertTrue(is_array($file->params()->test));\n\n\t\t$file->params()->test = 'value';\n\n\t\t$this->assertEquals('value', $file->params()->test);\n\t}",
"public function testLoadConfiguration()\n {\n $configParams = $this->configParams;\n $this->assertTrue(is_array($configParams) and ! empty($configParams));\n\n $disqontrolConfig = new Configuration($configParams);\n $this->assertArraySubset($configParams, $disqontrolConfig->getWholeConfig());\n }",
"public function testLoadValidData()\n {\n $data = array('test1' => 'testing 1234');\n\n $this->model->load($data);\n $this->assertEquals($data, $this->model->toArray());\n }",
"private function loadByArray ()\r\n {\r\n // set our data\r\n foreach ($this->loadData AS $key => $value)\r\n $this->{$key} = $value;\r\n\r\n // extract columns\r\n $this->executeOutputFilters();\r\n }",
"public function testParameterizeData() {\n /**\n * Test with an empty array\n */\n $asFeedData = array();\n $asData1 = $this->obModel->parameterizeData();\n $this->assertEmpty($asData1);\n $this->assertTrue(is_string($asData1));\n\n $ssExpectedStr = \"id_vehicle=:id_vehicle,maintenance_name=:maintenance_name,cost=:cost,description=:description\";\n\n /**\n * Test with valid array \n */\n $asFeedData = array('id_vehicle' => 13, 'maintenance_name' => 'tire_rotation', 'cost' => 1000, 'description' => 'Tire Rotation');\n $asData2 = $this->obModel->parameterizeData($asFeedData);\n\n $this->assertTrue(is_string($asData2));\n $this->assertStringStartsWith(\"id_vehicle\", $asData2);\n $this->assertStringMatchesFormat($ssExpectedStr, $asData2);\n }",
"#[@test]\n public function getArrayParams() {\n $this->assertEquals(\n array('a' => array('b', 'c')), \n create(new URL('http://localhost?a[]=b&a[]=c'))->getParams()\n );\n }",
"public function loadFromArray(array $data);",
"public function loadParams()\n {\n $dir = dirname((new \\ReflectionClass($this))->getFileName());\n if(file_exists($dir . '/params.php')){\n $this->params = require($dir . '/params.php');\n }\n $externalConfig = Yii::getAlias('@app').\"/config/params-\".$this->getUniqueId().\".php\";\n if(file_exists($externalConfig)) {\n $this->params = array_replace_recursive($this->params, require ($externalConfig) );\n }\n\n }",
"private function loadParams($filename) {\n //gets paras from the file\n $siteparams = SpycSceau::YAMLLoad(SCEAU_ROOT_DIR . '/lib/sceau/const/' . $filename);\n //reads all params and stores each one localy\n foreach ($siteparams as $key => $value) {\n $funcname = \"set$key\";\n $this->$funcname($value);\n }\n }",
"public function testInvalidParametersOnLoadArray()\r\n {\r\n $ams = new HTML_QuickForm_advmultiselect('foo');\r\n $r = $ams->loadArray('apple,orange');\r\n $this->catchError($r, HTML_QUICKFORM_ADVMULTISELECT_ERROR_INVALID_INPUT, 'exception');\r\n }",
"public function testLoad3()\n {\n $this->assertEquals(\n ['config_good' => [\n ['test' => 'wow', 'bingo' => 'xxx'],\n ['test' => 'prod'],\n ['bingo' => 'yyy']\n ]],\n $this->loader->load('config_good', 'production\\\\host1')\n );\n }",
"protected function _loadArray($array)\n {\n $string = $this->_toString($array);\n $this->_loadString($string);\n }",
"public function test_import_array()\n {\n $import = new UsersImportController;\n\n $results = $import->import();\n $this->assertNotEmpty($results);\n $this->assertIsArray($results);\n }",
"public function test_loadVars_called_returnArrayWithProperData()\n {\n $this->markTestSkipped('This test don\\'t works anymore :( | Fix it? ');\n\n $order = OrderMother::aJustOrder()->build();\n $user = UserMother::aUserWith50Eur()->build();\n $expected = $this->getArrayContentTemplate($user, $order->getPlayConfig());\n $emailTemplate = new EmailTemplate();\n $emailTemplateDataStrategy_double = $this->getInterfaceWebDouble('IEmailTemplateDataStrategy');\n $sut = new PurchaseConfirmationEmailTemplate($emailTemplate, $emailTemplateDataStrategy_double->reveal());\n $sut->setUser($user);\n $sut->setLine($order->getPlayConfig());\n $actual = $sut->loadVars();\n $this->assertEquals($expected,$actual);\n }",
"private function loadParams()\n {\n //parsing parameters\n parse_str($this->params, $params);\n $this->target = isset($params['type']) ? $params['type'] : false;\n $this->target_id = isset($params['id']) ? $params['id'] : false;\n $this->missingOnly = isset($params['missingOnly']) ? $params['missingOnly'] : false;\n $modules = isset($params['includes']) ? $params['includes'] : false;\n\n // if no module is defined, include all\n if (!$modules) {\n $modules = 'enrich,index';\n }\n\n $modules = explode(',', $modules);\n if (in_array('enrich', $modules)) {\n $modules = array_merge($modules,\n ['processIdentifiers', 'addRelationships', 'updateQualityMetadata', 'processLinks']);\n }\n if (in_array('index', $modules)) {\n $modules = array_merge($modules, ['indexPortal', 'indexRelations']);\n }\n\n $this->modules = $modules;\n\n $this->log('Task parameters: ' . http_build_query($params));\n $this->log('Task modules: ' . implode(', ', $this->modules))->save();\n\n //analyze if there is no chunkPosition\n if (isset($params['chunkPos'])) {\n $this->chunkPos = $params['chunkPos'];\n $this->mode = 'sync';\n } elseif (isset($params['clearIndex'])) {\n $this->mode = 'clearIndex';\n } else {\n $this->mode = 'analyze';\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Set the SenderID | function set_senderid($senderid) {
//Validate the Recipients
$validate = $this->_validate_senderid($senderid);
if ($validate != FALSE)
$this->senderid = $senderid;
else
\sms\Error\Error::set_error('Invalid Sender ID Provided');
} | [
"public function setIDSender($idSender){\n $this->IDsender = $idSender;\n }",
"public function setSenderId()\n {\n $this->senderId = Config::get('hostpinnacle.senderId');\n }",
"function setSenderId($value) {\n return $this->setFieldValue('sender_id', $value);\n }",
"public function setSenderId($sender_id)\n {\n $this->sender_id = $sender_id;\n }",
"public function setSenderID($var)\n {\n GPBUtil::checkInt32($var);\n $this->senderID = $var;\n\n return $this;\n }",
"public function setSenderId($value)\n {\n return $this->set(self::SENDER_ID, $value);\n }",
"function SetSender($from)\n{\nif (strlen($from) > 20) {\n$this->debug(\"Error: sender id too long.\\n\");\nreturn;\n}\n$this->_source_address = $from;\n}",
"public function getSenderID()\n {\n return $this->senderID;\n }",
"function setSender( $newSender )\r\n {\r\n $this->From = $newSender;\r\n }",
"public function getSender_id()\n {\n return $this->sender_id;\n }",
"public function getSenderId()\n {\n return $this->sender_id;\n }",
"function SetSender($from)\n\t{\n\t\tif (strlen($from) > 20) {\n\t\t\t$this->debug(\"Error: sender id too long.\\n\");\n\t\t\treturn;\n\t\t}\n\t\t$this->_source_address = $from;\n\t}",
"function SetSender($from)\n\t{\n\t\tif (strlen($from) > 20) {\n\t\t\t$this->debug(\"Error: sender id too long.<br />\");\n\t\t\treturn;\n\t\t}\n\t\t$this->_source_address = $from;\n\t}",
"public function getSenderId()\n {\n return $this->senderId;\n }",
"public function setSender($sender)\n {\n $this->_sender = $sender;\n }",
"public function setSender($sender)\n\t{\n\t\t$this->sender = $sender;\n\t}",
"public function setSender($sender);",
"public function setSenderId($id) {\n\t\t$userModel = new Default_Model_User();\n\t\t$this->_sender = $userModel->getUserRow($id);\n\t\tif ($this->_sender == null) {\n\t\t\t$this->_errorMessage = \"Error on sender id\";\n\t\t}\n\t\treturn $this;\n\t}",
"public function testSetSenderId()\n {\n $controller = new MessageModel();\n $controller->setSenderId(1);\n $this->assertEquals(1,$controller->getSenderId());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set view script path specification Specification can contain one or more of the following: :moduleDir current module directory :controller name of current controller in the request :action name of current action in the request :module name of current module in the request | public function setViewScriptPathSpec($path)
{
$this->_viewScriptPathSpec = (string) $path;
return $this;
} | [
"private static function _initViewScriptsFullPathBase () {\n\t\t$app = & \\MvcCore\\Application::GetInstance();\n\t\tself::$_viewScriptsFullPathBase = implode('/', [\n\t\t\t$app->GetRequest()->GetAppRoot(),\n\t\t\t$app->GetAppDir(),\n\t\t\t$app->GetViewsDir()\n\t\t]);\n\t}",
"public function setViewPaths() {\n $this->setVar('TEMPLATES_URL', $this->config->website->params->url . TEMPLATES_DIR);\n $this->setVar('IMAGES_URL', $this->config->website->params->url . IMAGES_DIR . '/' . $this->requestModule);\n $this->setVar('SITE_URL', $this->config->website->params->url);\n }",
"public function getViewScriptPathSpec()\n {\n return $this->_viewScriptPathSpec;\n }",
"protected static function initViewScriptsFullPathBase () {\n\t\t$app = \\MvcCore\\Application::GetInstance();\n\t\tself::$_viewScriptsFullPathBase = implode('/', [\n\t\t\t$app->GetRequest()->GetAppRoot(),\n\t\t\t$app->GetAppDir(),\n\t\t\t$app->GetViewsDir()\n\t\t]);\n\t}",
"protected function _changeViewScriptPathSpec($change = true)\n {\n if ($change) {\n $this->_viewRenderer->setViewScriptPathSpec('crud/:action.:suffix');\n }\n }",
"public function setViewConfigurationFilesFromTypoScriptConfiguration()\n {\n // Gets the viewer\n $viewer = $this->getController()->getViewer();\n if ($viewer === null) {\n return;\n }\n\n // Gets the TypoScript configuration\n $typoScriptConfiguration = self::getTypoScriptConfiguration();\n if ($typoScriptConfiguration === null) {\n return;\n }\n\n // Sets the template root path if any\n $templateRootPath = $typoScriptConfiguration['templateRootPath'];\n if (empty($templateRootPath) === false) {\n $viewer->setTemplateRootPath($templateRootPath);\n }\n\n // Sets the partial root path if any\n $viewType = lcfirst($viewer->getViewType()) . '.';\n if (is_array($typoScriptConfiguration[$viewType])) {\n $partialRootPath = $typoScriptConfiguration[$viewType]['partialRootPath'];\n } else {\n $partialRootPath = $typoScriptConfiguration['partialRootPath'];\n }\n if (empty($partialRootPath) === false) {\n $viewer->setPartialRootPath($partialRootPath);\n }\n\n // Sets the layout root path if any\n $layoutRootPath = $typoScriptConfiguration['layoutRootPath'];\n if (empty($layoutRootPath) === false) {\n $viewer->setLayoutRootPath($layoutRootPath);\n }\n }",
"public function setScriptPath($template_dir);",
"public function setViewConfigurationFilesFromTypoScriptConfiguration()\r\n {\r\n // Sets the template root path with the default\r\n $this->templateRootPath = $this->defaultTemplateRootPath;\r\n $this->getController()\r\n ->getPageTypoScriptConfigurationManager()\r\n ->setViewConfigurationFilesFromPageTypoScriptConfiguration();\r\n $this->getController()\r\n ->getExtensionConfigurationManager()\r\n ->setViewConfigurationFilesFromTypoScriptConfiguration();\r\n $this->getController()\r\n ->getLibraryConfigurationManager()\r\n ->setViewConfigurationFilesFromTypoScriptConfiguration();\r\n }",
"protected function configureViewPartialPath() {\n\t\t// set partial path\n\t\t$partialRootPath = t3lib_div::getFileAbsFileName($this->configuration['partialRootPath']);\n\t\tif($partialRootPath) {\n\t\t\t$this->view->setPartialRootPath($partialRootPath);\n\t\t}\n\t}",
"private function matchView()\n\t{\n\t\treturn $this->config->config['basePath'] .DIRECTORY_SEPARATOR . 'module' . DIRECTORY_SEPARATOR . ucwords($this->module) .\n\t\t\tDIRECTORY_SEPARATOR . 'view' .DIRECTORY_SEPARATOR. $this->camelCaseToDash($this->controller) .DIRECTORY_SEPARATOR .\n\t\t\t($this->camelCaseToDash($this->action)) . $this->config->view['suffix'];\n\t}",
"protected function _initViewPaths()\n {\n $this->bootstrap('Layout');\n \n $view = Zend_Layout::getMvcInstance()->getView();\n \n $view->addScriptPath(APPLICATION_PATH . '/modules/frontend/views/');\n $view->addScriptPath(APPLICATION_PATH . '/modules/frontend/views/forms/');\n $view->addScriptPath(APPLICATION_PATH . '/modules/frontend/views/paginators/');\n $view->addScriptPath(APPLICATION_PATH . '/modules/frontend/views/scripts/');\n $view->addScriptPath(ROOT_PATH . '/library/App/Mail/Templates/');\n }",
"protected function _setScriptVars()\n {\n $request = $this->getView()->getRequest();\n\n $vars = [\n 'baseUrl' => Router::fullBaseUrl(),\n 'alert' => [\n 'ok' => __d('alert', 'Ok'),\n 'cancel' => __d('alert', 'Cancel'),\n 'sure' => __d('alert', 'Are you sure?'),\n ],\n 'request' => [\n 'url' => $request->getPath(),\n 'params' => [\n 'pass' => $request->getParam('pass'),\n 'theme' => $request->getParam('theme'),\n 'action' => $request->getParam('action'),\n 'prefix' => $request->getParam('prefix'),\n 'plugin' => $request->getParam('plugin'),\n 'controller' => $request->getParam('controller'),\n ],\n 'query' => $request->getQueryParams(),\n 'base' => $request->getAttribute('base'),\n 'here' => $request->getRequestTarget(),\n ]\n ];\n\n $this->Html->scriptBlock('window.CMS = ' . json_encode($vars), ['block' => 'css_bottom']);\n }",
"function setViewDir($viewDir)\r\n {\r\n }",
"public function setLayoutScript($script) {\n\t\t$this->_layoutScript = $script . '.' . $this->_viewSuffix;\n\t\n\t}",
"protected function determineScriptUrl()\n {\n if ($routePath = GeneralUtility::_GP('route')) {\n $router = GeneralUtility::makeInstance(Router::class);\n $route = $router->match($routePath);\n $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);\n $this->thisScript = (string)$uriBuilder->buildUriFromRoute($route->getOption('_identifier'));\n } elseif ($moduleName = GeneralUtility::_GP('M')) {\n $this->thisScript = BackendUtility::getModuleUrl($moduleName);\n } else {\n $this->thisScript = GeneralUtility::getIndpEnv('SCRIPT_NAME');\n }\n }",
"protected function configureViewPartialPaths() {\n\t\t// set partial path\n\t\t$partialRootPathConfig = $this->configuration['partialRootPaths.'];\n\t\tif($partialRootPathConfig) {\n\t\t\t$this->view->setPartialRootPaths($partialRootPathConfig);\n\t\t}\n\t}",
"protected function setCustomViewPath()\n {\n Config::set('view.paths', [__DIR__ . '/Stubs/views']);\n }",
"protected function getViewActionScriptPath()\n {\n return strtolower($this->getTitle().'.'.$this->getActionTitle()).'.php';\n }",
"public function getModuleViewPath($sModuleName, $sViewName);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load Deployer routes using the api middleware. | protected function loadRemoteRoutes()
{
Route::as('deployer.')
->middleware('same-token', 'client')
->namespace('Waygou\Deployer\Http\Controllers')
->prefix(app('config')->get('deployer.remote.prefix'))
->group(__DIR__.'/../routes/api.php');
// Load Laravel Passport routes.
Passport::routes();
} | [
"public function addLoadApiRoutes(): void\n {\n $this->addToServiceProviderBoot('$this->loadApiRoutes();');\n }",
"protected function mapApiRoutes()\n {\n #Event::listen('rest_api_init', function () {\n Route::middleware('api')->prefix('api')->group(base_path('routes/api.php'));\n #});\n }",
"protected function loadRemoteRoutes()\n {\n Route::as('larapush.')\n ->middleware('same-token', 'client')\n //->namespace('Brunocfalcao\\Larapush\\Http\\Controllers')\n ->prefix(app('config')->get('larapush.remote.suffix'))\n ->group(__DIR__.'/../routes/api.php');\n\n // Load Laravel Passport routes.\n Passport::routes();\n }",
"protected function defineApiRoutes()\n {\n $this->app->make('router')->prefix('api')->middleware('api')\n ->namespace(AcachaForgeServiceProvider::NAMESPACE)\n ->group(ACACHA_FORGE_PATH .'/routes/api.php');\n }",
"protected function mapApiRoutes()\n {\n Route::prefix(\"api\")\n ->middleware(\"api\")\n ->namespace($this->namespace)\n ->group(base_path(\"routes/api/api.php\"));\n\n $this->loadApiRoute(\"user\");\n $this->loadApiRoute(\"role\");\n $this->loadApiRoute(\"invitation\");\n $this->loadApiRoute(\"configuration\");\n $this->loadApiRoute(\"telegram\");\n $this->loadApiRoute(\"permission\");\n }",
"protected function mapApiRoutes()\n\t{\n\t\tRoute::middleware('api')\n\t\t //->namespace($this->namespace)\n\t\t ->group(__DIR__ . DIRECTORY_SEPARATOR. '..'. DIRECTORY_SEPARATOR.'Routes'.DIRECTORY_SEPARATOR.'api.php');\n\t\t\n\t}",
"protected function mapApiRoutes()\n {\n Route::prefix('api')\n ->middleware('api')\n ->group($this->routeBasePath.'api.php');\n }",
"static public function routes() {\n require __DIR__ . '/../routes/api.php';\n require __DIR__ . '/../routes/web.php';\n }",
"public function loadCustomRoutes()\n {\n if (!$this->app->routesAreCached()) {\n\n Route::group([\n 'middleware' => ['api'],\n 'namespace' => 'SumanIon\\TelegramBot\\Controllers',\n 'prefix' => 'api',\n ], function () {\n require __DIR__ . '/../../routes/api.php';\n });\n }\n }",
"protected function mapApiRoutes()\r\n {\r\n Route::prefix('api')\r\n ->middleware('api')\r\n ->namespace($this->namespace)\r\n ->group(base_path('routes/api.php'));\r\n }",
"protected function mapApiRoutes()\n {\n Route::prefix('api')\n ->middleware('api')\n ->namespace($this->namespace)\n ->group(base_path('core/routes/api.php'));\n }",
"protected function mapServerApiRoutes()\n {\n Route::prefix('server-api')\n ->middleware('checkServerApiKey')\n ->namespace($this->server_api_namespace)\n ->group(base_path('routes/server-api.php'));\n }",
"protected function mapApiRoutes() {\n Route::prefix('api')\n ->middleware('api')\n ->namespace($this->namespace)\n ->group(base_path('routes/api.php'));\n }",
"protected function mapApiRoutes()\n {\n Route::prefix('api')\n ->middleware('api')\n ->namespace($this->namespace)\n ->group(base_path('routes/api.php'));\n }",
"protected function mapApiRoutes ()\n {\n Route::prefix ('api')\n ->middleware ('api')\n ->namespace ($this->namespace)\n ->group ($this->getPath ('api'));\n }",
"public function setRoutes(): void\n {\n $versions = $this->_versions;\n $default = 'api/v1/v0';\n\n Router::scope('/api', function ($routes) use ($versions, $default) {\n // Setting up fallback non-versioned API url calls.\n // It can handle `api/controller/index.json` as well\n // as `api/controller.json` calls.\n Router::prefix('api', function ($routes) use ($default) {\n $routes->setExtensions(['json']);\n $routes->connect('/:controller', ['prefix' => $default], ['routeClass' => DashedRoute::class]);\n $routes->connect('/:controller/:action/*', ['prefix' => $default], ['routeClass' => DashedRoute::class]);\n $routes->fallbacks(DashedRoute::class);\n });\n\n foreach ($versions as $version) {\n Router::prefix($version['prefix'], ['path' => $version['path']], function ($routes) {\n $routes->setExtensions(['json']);\n $routes->fallbacks(DashedRoute::class);\n });\n }\n });\n }",
"private function registerApplicationDefaultApiRoutes()\n {\n $this->apiRouter->version('v1', function ($router) {\n\n $router->group([\n 'middleware' => 'api.throttle',\n 'limit' => env('API_LIMIT'),\n 'expires' => env('API_LIMIT_EXPIRES'),\n ], function (DingoApiRouter $router) {\n require $this->validateRouteFile(\n app_path('Kernel/Routes/default-api.php')\n );\n });\n\n });\n }",
"public static function loadApiEndpoints() {\n $plugins = self::listPlugins();\n\n foreach ($plugins as $pluginName) {\n $className = '\\\\Plugins\\\\' . $pluginName . '\\\\Api';\n if (!class_exists($className))\n continue;\n if (method_exists($className, 'load'))\n $className::load();\n }\n }",
"private function loadRoutes()\n { \n $this->router = new Router($this->request);\n $this->router->addRoute(\n 'OsynapsyAssetsManager',\n '/assets/osynapsy/'.self::VERSION.'/?*',\n 'Osynapsy\\\\Assets\\\\Loader',\n '',\n 'Osynapsy'\n );\n $applications = $this->loader->get('app');\n if (empty($applications)) {\n throw new KernelException('No app configuration found', 1001);\n }\n foreach (array_keys($applications) as $applicationId) {\n $routes = $this->loader->search('route', \"app.{$applicationId}\");\n foreach ($routes as $route) {\n if (!isset($route['path'])) {\n continue;\n }\n $id = isset($route['id']) ? $route['id'] : uniqid();\n $uri = $route['path'];\n $controller = $route['@value'];\n $template = !empty($route['template']) ? $this->request->get('app.layouts.'.$route['template']) : '';\n $this->router->addRoute($id, $uri, $controller, $template, $applicationId, $route); \n }\n } \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ handles adding locations in the same way as categories | function couponxl_process_locations( $location, $offer_id ){
$locations = explode( ',', $location );
$last_parent = 0;
$location_hierarchicy = array();
foreach( $locations as $location ){
$term = term_exists( $location, 'location');
if ( !$term ) {
$term = wp_insert_term(
$location,
'location',
array(
'parent' => $last_parent
)
);
}
$last_parent = $term['term_id'];
$location_hierarchicy[] = $term['term_id'];
}
wp_set_post_terms( $offer_id, $location_hierarchicy, 'location', true );
} | [
"function create_location_category( $post_id, $post, $update ) {\n\n\tif ( 'sm-location' !== $post->post_type || 'wpseo_locations' !== $post->post_type ) { return; }\n\tif ( wp_is_post_revision( $post_id ) ) { return; }\n\tif ( wp_is_post_autosave( $post_id ) ) { return; }\n\n\t$status = get_post_status( $post_id );\n\n\tif ( 'auto-draft' == $status || 'draft' == $status || 'pending' == $status || 'future' == $status ) { return; }\n\n\t$exists = term_exists( $post->post_title, 'category' );\n\n\tif ( $exists !== 0 && $exists !== null ) { return; }\n\n\twp_insert_term( $post->post_title, 'category', array( 'description' => 'News about the ' . $post->post_title . ' store.', 'slug' => $post->post_name ) );\n\n\t//wp_die( pretty( $post ) );\n\n}",
"private function set_location_category_properties( $marker ) {\n\t\tif ( ! $this->slplus->currentLocation->isvalid_ID( $marker[ 'id' ] ) ) {\n\t\t\treturn $marker;\n\t\t}\n\n\t\t$this->addon->set_LocationCategories();\n\n\t\t// If we are looking for a specific category,\n\t\t// check to see if it is assigned to this location\n\t\t// Category searched for not in array, Skip this one.\n\t\t//\n\t\t//\n\t\t$filterOut = isset( $_POST[ 'formflds' ] ) && isset( $_POST[ 'formflds' ][ 'cat' ] ) && ( $_POST[ 'formflds' ][ 'cat' ] > 0 );\n\t\tif ( $filterOut ) {\n\t\t\t$selectedCat = (int) $_POST[ 'formflds' ][ 'cat' ];\n\t\t\tif ( ! in_array( $selectedCat , $this->addon->current_location_categories ) ) {\n\t\t\t\treturn array();\n\t\t\t}\n\t\t}\n\n\t\t// Category Count\n\t\t//\n\t\t$category_count = count( $this->addon->current_location_categories );\n\n\t\t// Category Details\n\t\t// If category details is enabled (on by default), return them in the AJAX string.\n\t\t//\n\t\t$category_names = '';\n\t\tif ( $category_count > 0 ) {\n\t\t\t$category_name_array = array();\n\t\t\tforeach ( $this->addon->current_location_categories as $term_id ) {\n\t\t\t\t$category_info = $this->addon->get_TermWithTagalongData( $term_id );\n\t\t\t\t$category_name_array[] = isset( $category_info[ 'name' ] ) ? $category_info[ 'name' ] : '';\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * FILTER: slp_category_name_separator\n\t\t\t * Change the default ', ' separator used between category names.\n\t\t\t *\n\t\t\t * @param string the character string to be used between each category on the category name results output\n\t\t\t *\n\t\t\t * @return string the character string to be used between each category on the category name results output\n\t\t\t */\n\t\t\t$category_name_separator = apply_filters( 'slp_category_name_separator' , ', ' );\n\t\t\t$category_names = implode( $category_name_separator , $category_name_array );\n\t\t}\n\n\t\t// Return our modified array\n\t\t//\n\t\treturn array_merge( $marker , array(\n\t\t\t 'attributes' => $this->slplus->currentLocation->attributes ,\n\t\t\t 'categories' => $this->addon->current_location_categories ,\n\t\t\t 'category_count' => $category_count ,\n\t\t\t 'category_names' => $category_names ,\n\t\t\t 'icon' => $this->get_location_marker() ,\n\t\t\t 'iconarray' => $this->addon->create_string_icon_array() ,\n\t\t ) );\n\t}",
"public function addLocation($location);",
"function addLocations($uris) {}",
"public function register_taxonomy_location_group() {\n register_taxonomy(\n 'location-group',\n 'location',\n array(\n 'label' => __( 'Standort-Gruppe', 'compassion-posts' ),\n 'rewrite' => array( 'slug' => 'location-group' ),\n 'query_var' => true,\n 'hierarchical' => true,\n )\n );\n }",
"function addLocations(){\n $l = $this->api->locate('addons', __NAMESPACE__, 'location');\n\t\t$addon = $this->api->locate('addons', __NAMESPACE__);\n $this->api->pathfinder->addLocation($addon, array(\n \t'template' => 'templates',\n //'css' => 'templates/css',\n 'js' => 'js',\n ))->setParent($l);\n\t}",
"protected function set_categories_map() {\n $this->partial(\"Generating categories map ... \");\n $categories = get_terms([\n 'taxonomy' => 'travel-dir-category',\n 'hide_empty'=> false,\n ]);\n foreach ($categories as $category) {\n $this->categories[$category->term_id] = $category->name;\n }\n $this->success(\"OK\");\n }",
"public function createLocationGroup();",
"public function addLocation(string $location): void;",
"function add_location( $l ) {\n $is_duplicate = false;\n $locations = get_option( self::$location_key );\n $location = array(\n 'name' => null,\n 'title' => null,\n 'size' => null\n );\n \n $location['name'] = sanitize_title( $l['title'] );\n $location['title'] = sanitize_text_field( $l['title'] );\n $location = array_filter( $location );\n $location['size'] = intval( $l['size'] );\n \n if( count( $location ) == 3 ) {\n // On duplicate, update old location\n for( $i = 0; ( $i < count( $locations ) ) && !$is_duplicate; $i++ )\n if( $locations[$i]['name'] == $location['name'] ) {\n $locations[$i] = $location;\n $is_duplicate = true;\n }\n \n if( !$locations )\n update_option( self::$location_key, array( $location ) );\n else {\n if( !$is_duplicate )\n $locations[] = $location;\n update_option( self::$location_key, $locations );\n }\n return true;\n } else\n return false;\n }",
"public function addLocationElements()\n {\n $hat = $this->options['auth']->getIdentity()->hat;\n /** @var \\InterpretersOffice\\Entity\\Repository\\LocationRepository $repo*/\n $repo = $this->objectManager->getRepository(Entity\\Location::class);\n\n $options = $repo->getLocationOptionsForHat($hat);\n array_unshift($options, ['label' => ' ','value' => '']);\n $this->add(\n [\n 'type' => 'Laminas\\Form\\Element\\Select',\n 'name' => 'location',\n 'options' => [\n 'label' => 'location',\n 'value_options' => $options,\n ],\n 'attributes' => ['class' => 'custom-select text-muted', 'id' => 'location'],\n ]\n );\n $this->add([\n 'type' => 'textarea',\n 'name' => 'comments',\n 'attributes' => ['id' => 'comments', 'class' => 'form-control',\n 'placeholder' => 'any noteworthy details or special instructions'\n ]\n ]);\n\n return $this;\n }",
"public function addLocation(string $location);",
"public function addLocation(Recipe $r, Location $l);",
"public function cs_register_locations(){\r\n\t\t\t//add submenu page\r\n\t\t\tadd_submenu_page('edit.php?post_type=directory', 'Locations ', 'Locations', 'manage_options', 'cs_locations_settings', array(&$this, 'cs_locations_settings'));\r\n\t\t}",
"public function register_location_taxonomy() {\n\n\t\tregister_taxonomy(\n\t\t\t'location',\n\t\t\t'restaurant',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Location' ),\n\t\t\t\t'hierarchical' => true,\n\t\t\t)\n\t\t);\n\t}",
"public function add_location_metaboxes() {\n\t\t\t$post_type = PostType::get_instance()->get_post_type();\n\t\t\tadd_meta_box(\n\t\t\t\t$post_type,\n\t\t\t\t__( 'Yoast Local SEO', 'yoast-local-seo' ),\n\t\t\t\t[ $this, 'metabox_locations' ],\n\t\t\t\t$post_type,\n\t\t\t\t'normal',\n\t\t\t\t'high'\n\t\t\t);\n\t\t}",
"function create_locations_hierarchical_taxonomy() {\n\n// Add new taxonomy, make it hierarchical like categories\n//first do the translations part for GUI\n\n $labels = array(\n 'name' => _x( 'Location Types', 'taxonomy general name' ),\n 'singular_name' => _x( 'Location Type', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Location Types' ),\n 'all_items' => __( 'All Location Types' ),\n 'parent_item' => __( 'Parent Location Type' ),\n 'parent_item_colon' => __( 'Parent Location Type:' ),\n 'edit_item' => __( 'Edit Location Type' ),\n 'update_item' => __( 'Update Location Type' ),\n 'add_new_item' => __( 'Add New Location Type' ),\n 'new_item_name' => __( 'New Location Type' ),\n 'menu_name' => __( 'Location Types' ),\n );\n\n// Now register the taxonomy\n\n register_taxonomy('location_types',array('location'), array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n 'show_in_rest' => true,\n 'rest_base' => 'location-types',\n 'rewrite' => array( 'slug' => 'location-type' ),\n ));\n\n}",
"public function add_location()\r\n {\r\n if (!$this->session->userdata('is_admin'))\r\n {\r\n // No access if not admin.\r\n redirect('/not_admin');\r\n }\r\n \r\n $this->data['page_body'] = 'locations/add_location';\r\n $this->render();\r\n }",
"public function getLocationCategory()\n {\n return $this->readOneof(1);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the default encryption salt to use. | private function get_default_salt() {
if ( defined( 'GOOGLESITEKIT_ENCRYPTION_SALT' ) && '' !== GOOGLESITEKIT_ENCRYPTION_SALT ) {
return GOOGLESITEKIT_ENCRYPTION_SALT;
}
if ( defined( 'LOGGED_IN_SALT' ) && '' !== LOGGED_IN_SALT ) {
return LOGGED_IN_SALT;
}
// If this is reached, you're either not on a live site or have a serious security issue.
return 'das-ist-kein-geheimes-salz';
} | [
"public function getSalt()\n {\n // you *may* need a real salt depending on your encoder\n // see section on salt below\n return null;\n }",
"static public function getSalt()\n {\n static $salt = null;\n if(is_null($salt))\n {\n $config = Zend_Registry::get('config');\n if($config !== false)\n {\n $salt = @$config->superuser->salt;\n }\n }\n return $salt;\n }",
"public static function salt() {\n return static::get('app.salt');\n }",
"public function getSalt()\r\n {\r\n $time = Carbon::now()->subMinutes(3);\r\n $time->second(0);\r\n $salt = $time->getTimestamp();\r\n\r\n return $salt;\r\n }",
"public function getSalt()\r\n {\r\n return $this->salt;\r\n }",
"public function salt()\n\t{\n\t\treturn $this->salt;\n\t}",
"private function _get_salt(){\n return bin2hex(openssl_random_pseudo_bytes(32));\n }",
"protected function getPasswordSalt() {\n\t\treturn $this->_salt;\n\t}",
"public function getSalt() {\n\t\t}",
"public function getUserSalt() : string {\n\t\treturn($this->userSalt);\n\t}",
"public function get_salt(){\n return $this->_get_session('salt');\n }",
"private function generateSalt() {\n $salt = base64_encode(pack(\"H*\", md5(microtime())));\n return substr($salt, 0, $this->saltLng);\n }",
"protected function getConfigSalt()\n {\n $config = $this->getConfig();\n return $config['authSalt'];\n }",
"public function getPrivateSalt(){\n\t\t$salt = Mage::getStoreConfig('payment/instamojo/salt');\n\t\treturn $salt;\n\t}",
"private function createSalt () {\n $salt = rand() . time() . rand();\n return $salt;\n }",
"public function getDefaultEncryption()\n {\n return $this->default_encryption;\n }",
"public function decryptionDefaultWithSalt()\n {\n return Encryption::decrypt(\n $this->encryptionDefaultWithSalt(),\n $this->salt\n );\n }",
"function getSalt() { return 'Zk1*<@]]$4bU;5=i9#(pqCL/&$paoKj.Q7g-(D==Z)C[?Ih(Y]%}0xF/u Dc`SlU'; }",
"public function getIdSalt()\n {\n return $this->config['id_salt'];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates an existing Paymentinvoice model. If update is successful, the browser will be redirected to the 'view' page. | public function actionUpdate($id)
{
$model = $this->findModel($id);
// if (isset($_POST['hasEditable'])) {
// \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
if ($model->load(Yii::$app->request->post())) {
if($model->confirm = Paymentinvoice::CONFIRM_CANCEL){
$transaction = $model->getDb()->beginTransaction(//Yii::$app->db->beginTransaction( //$return->getDb()->beginTransaction
// Transaction::SERIALIZABLE
);
try{
$valid = $model->validate();
Yii::$app->db->createCommand()->update('accounts', ['status' => Accounts::ACCOUNTS_CANCEL],['idinvoice' => $model->idpaymenti])->execute();
if ($valid) {
// the model was validated, no need to validate it once more
$model->save(false);
$transaction->commit();
Yii::$app->session->setFlash('success', 'Статус данного счета успешно изменен!');
return $this->redirect(['view', 'id' => $model->idpaymenti]);
} else {
$transaction->rollBack();
}
}catch (ErrorException $e) {
$transaction->rollBack();
echo $e->getMessage();
}
}
} else {
return $this->render('update', [
'model' => $model,
]);
// }
}
} | [
"public function subs_modal_payment_update()\r\r\n {\r\r\n\r\r\n \r\r\n $paymentid = $this->input->post('paymentid');\r\r\n $data['orderid'] = $this->input->post('orderid');\r\r\n $data['subsid'] = $this->input->post('subsid');\r\r\n $data['distid'] = $this->input->post('distid');\r\r\n $data['paymentdetails'] = $this->Subscriber_model->payment_details($paymentid); // to get individual payment details\r\r\n $this->load->view('backend/national/subs_payment_update_form',$data);\r\r\n\r\r\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->loan_repayment_detail_id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate( $id )\n\t{\n\t\t$Model = $this->findModel( $id );\n\t\t\n\t\tif( $Model->load( Yii::$app->request->post() ) && $Model->save() ) {\n\t\t\treturn $this->redirect( Url::to( [ '/payment-method' ] ) );\n\t\t}\n\t\t\n\t\treturn $this->render( 'update', [\n\t\t\t'Model' => $Model,\n\t\t] );\n\t}",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post())) {\n $model->payment_date = date(\"Y-m-d\", strtotime($model->payment_date));\n // print_r($model);\n // exit;\n if($model->save()){\n $credit = $this->findCreditModel($model->customerpay_ID);\n //$credit->credit_bill_Id = $model->customerpay_ID;\n $credit->credit_ac_Id = $model->customer_Id;\n $credit->credit_type_Id = 5;\n $credit->credit_amount = $model->Amount;\n $credit->credit_date = date(\"Y-m-d\", strtotime($model->payment_date));\n $credit->credit_debit = 0;\n $credit->save(false);\n\n return $this->redirect(['index']);\n // return $this->redirect(['view', 'id' => $model->customerpay_ID]);\n }\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($idInboundPo = NULL)\n {\n $this->layout = 'blank';\n if($idInboundPo == NULL) $idInboundPo = \\Yii::$app->session->get('idInboundPo');\n\n $model = $this->findModel($idInboundPo);\n\t\t\n\t\t\\Yii::$app->session->set('rrNumber',$model->rr_number);\n\t\t\\Yii::$app->session->remove('idInboundPo');\n\t\t\\Yii::$app->session->set('idInboundPo',$model->id);\n\t\t\n\t\t$modelOrafin = OrafinViewMkmPrToPay::find()->where(['and',['po_num'=>$model->po_number],['rcv_no'=>$model->rr_number]])->one();\n\n if ($model->load(Yii::$app->request->post()) ) {\n // if($model->status_listing==3 || $model->status_listing==2){\n // $model->status_listing=2;\n // }\n if($model->save()) {\n // \\Yii::$app->session->set('idInboundPo',$model->id);\n\t\t\t\t\n // \\Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n // $this->createLog($model);\n \n return 'success';\n } else {\n return print_r($model->getErrors());\n }\n\n } else {\n\t\t\t\n \n return $this->render('update', [\n 'model' => $model,\n 'modelOrafin' => $modelOrafin,\n ]);\n }\n }",
"public function updatePayment() {\n\n Session::check();\n header('Content-Type: application/json');\n\n if (isset($_GET['pid']) && isset($_GET['id'])) {\n\n $stripe = new \\Stripe\\StripeClient([\n 'api_key' => getenv('STRIPE_SECRET_KEY'),\n 'stripe_version' => getenv('STRIPE_API_VERSION'),\n ]);\n\n $pi = $stripe->paymentIntents->retrieve(\n $_GET['pid'],\n []\n );\n\n // ensure the payment has succeeded\n if ($pi->status == 'succeeded') {\n\n // make sure the pid amount matches the invoice id amount\n $invoices = Invoice::where('id', '=', $_GET['id']);\n if (sizeof($invoices) > 0) {\n $invoice = $invoices[0];\n $invoice_amount = str_replace('.', '', $invoice->total_amount);\n\n if ($pi->amount == $invoice_amount) {\n\n // update the database\n $db_success = $invoice->applyPayment();\n if ($db_success) {\n echo json_encode(true);\n exit();\n }\n }\n } \n \n }\n echo json_encode(false);\n exit();\n\n }\n }",
"public function actionUpdate($id)\n {\n Yii::$app->CheckAdmin->authCheck();\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->pk_int_payroll_id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate()\n {\n $model = $this->findModel(Yii::$app->request->post('id'));\n\n if ($model->load(Yii::$app->request->post(),'') && $model->save()) {\n return $this->success();\n }\n\n return $this->fail();\n }",
"public function actionUpdate($id)\n {\n $this->layout = 'dashboard'; \n if(Yii::$app->user->can('cylinder-booking/update')){ \n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post())) {\n $model->customer_id = Helper::getCurrentUserId(); \n\n if($model->save()){\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n return $this->render('update', [\n 'model' => $model,\n ]);\n }else{\n throw new NotFoundHttpException('You are not authorized to access.');\n }\n }",
"public static function InvoiceUpdate()\n {\n $invoice = new Invoice();\n try {\n $invoice->UpdateInvoice();\n } catch (Exception $e) {\n Controller::ErrorLog($e);\n }\n }",
"public function actionUpdate($id)\n {\n $request = Yii::$app->request;\n $model = $this->findModel($id); \n\n if($request->isAjax){\n /*\n * Process for ajax request\n */\n Yii::$app->response->format = Response::FORMAT_JSON;\n if($request->isGet){\n return [\n 'title'=> \"Update Invoices #\".$id,\n 'content'=>$this->renderAjax('update', [\n 'model' => $model,\n ]),\n 'footer'=> Html::button('Close',['class'=>'btn btn-default pull-left','data-dismiss'=>\"modal\"]).\n Html::button('Save',['class'=>'btn btn-primary','type'=>\"submit\"])\n ]; \n }else if($model->load($request->post()) && $model->save()){\n return [\n 'forceReload'=>'#crud-datatable-pjax',\n 'title'=> \"Invoices #\".$id,\n 'content'=>$this->renderAjax('view', [\n 'model' => $model,\n ]),\n 'footer'=> Html::button('Close',['class'=>'btn btn-default pull-left','data-dismiss'=>\"modal\"]).\n Html::a('Edit',['update','id'=>$id],['class'=>'btn btn-primary','role'=>'modal-remote'])\n ]; \n }else{\n return [\n 'title'=> \"Update Invoices #\".$id,\n 'content'=>$this->renderAjax('update', [\n 'model' => $model,\n ]),\n 'footer'=> Html::button('Close',['class'=>'btn btn-default pull-left','data-dismiss'=>\"modal\"]).\n Html::button('Save',['class'=>'btn btn-primary','type'=>\"submit\"])\n ]; \n }\n }else{\n /*\n * Process for non-ajax request\n */\n if ($model->load($request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->receivableNum]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate()\n {\n $model = $this->findModel();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n \\Yii::$app->getSession()->setFlash('success', $this->getFlashMsg('success'));\n return $this->redirect(ArrayHelper::merge(['view'], $model->getPrimaryKey(true)));\n } else {\n if ($model->hasErrors()) {\n \\Yii::$app->getSession()->setFlash('error', $this->getFlashMsg('error'));\n }\n return $this->render($this->viewID, [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate()\n {\n if(isset(Yii::$app->request->post()['id'])){\n $id=Yii::$app->request->post()['id'];\n $akta_ppat_id=Yii::$app->request->post()['akta_ppat_id'];\n $model = $this->findModel($id, $akta_ppat_id);\n }else{\n $id=Yii::$app->request->post()['AktaPpatPihak']['id'];\n $akta_ppat_id=Yii::$app->request->post()['AktaPpatPihak']['akta_ppat_id'];\n $model = $this->findModel($id, $akta_ppat_id);\n }\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n //return $this->redirect(['view', 'id' => $model->id]);\n return $this->redirect(['akta-ppat/view', 'id' => $model->akta_ppat_id]);\n } else {\n $kelurahan = Kelurahan::find()->where(['id'=>$model->kelurahan_id])->one();\n $kecamatan = Kecamatan::find()->where(['id'=>$kelurahan->kecamatan])->one();\n $kabupaten = Kabupaten::find()->where(['id'=>$kecamatan->kabupaten])->one();\n\n $model->kelurahan_id = $kelurahan->id;\n $model->kecamatan_id = $kelurahan->kecamatan_id;\n $model->kabupaten_id = $kecamatan->kabupaten_id;\n $model->provinsi_id = $kabupaten->provinsi_id;\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->idprorrateo]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function actionUpdate()\n {\n $purifier = new HtmlPurifier;\n $param = $purifier->process(Yii::$app->request->get('id'));\n $model = $this->findModel($param);\n\n //if ($model->load(Yii::$app->request->post()) && $model->save()) {\n //return $this->redirect(['view', 'id' => $model->idperscom]);\n //}\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function update(Update $request ,$payableinvoice_id)\n {\n $input_data = $request->only('id','date','invoice_number','vendor_id',\n 'notes', 'subtotal', 'pst', 'gst', 'total', 'override_gst',\n 'override_pst', 'posted','posted_date');\n \n $input_data['posted_date']=$request->posted == '1' ? date('Y-m-d H:i:s') : NULL;\n PayableInvoice::where('id',$request->id)->update($input_data);\n $this->payableInvoiceRepository->updatePayableItem($request->all());\n $this->payableInvoiceRepository->deletePayableItem($request->all());\n return $this->response->array([STATUS => 200, MESSAGE => 'Details has been saved.']);\n }",
"public function actionUpdate($id)\n {\n $provincia = new Provincia();\n $canton = new Canton();\n $parroquia = new Parroquia();\n $genero = new Genero();\n $nacionalidad = new Nacionalidad();\n\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) ) {\n\n $provincia = Provincia::find()->where(['CODPROVINCIA' => $model->PROVINCIA])->one();\n $canton = Canton::find()->where(['CODCANTON' => $model->CANTON])->one();\n $parroquia = Parroquia::find()->where(['CODPARROQUIA' => $model->PARROQUIA])->one();\n $genero = Genero::find()->where(['CODSEXO' => $model->SEXO])->one();\n $nacionalidad = Nacionalidad::find()->where(['CODNACIONALIDAD' => $model->NACIONALIDAD])->one();\n\n\n $model->PROVINCIA = $provincia->PROVINCIA;\n $model->CANTON = $canton->CANTON;\n $model->PARROQUIA = $parroquia->PARROQUIA;\n $model->SEXO = $genero->SEXO;\n $model->NACIONALIDAD = $nacionalidad->NACIONALIDAD;\n\n $model->save();\n\n return $this->redirect(['view', 'id' => $model->idCiudadano]);\n\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function updated(Invoice $invoice)\n {\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets a new shippingServiceCutOffTime The last time of day that an order using the specified shipping service will be accepted by the seller for the current listing. The cut off time applies and is returned only when the ShippingService field contains the name of a qualifying timesensitive shipping service, such as eBayNowImmediateDelivery. The cut off time is set by eBay and determined in part by the policies and locations of the seller and the shipping carrier. | public function setShippingServiceCutOffTime(\DateTime $shippingServiceCutOffTime)
{
$this->shippingServiceCutOffTime = $shippingServiceCutOffTime;
return $this;
} | [
"public function getShippingServiceCutOffTime()\n {\n return $this->shippingServiceCutOffTime;\n }",
"public function setCutOffTime(string $cut_off_time, $day = null): DeliverydateRequest\n {\n if (!preg_match(\"/[0-9]{2}:[0-9]{2}:[0-9]{2}/\", $cut_off_time)) {\n throw new BadMethodCallException(\"Wrong cut off time format, use: HH:ii:ss\");\n }\n if (is_null($day)) {// global cut off time\n $this->arguments['cut_off_time'] = $cut_off_time;\n } else {\n if (is_array($day)) {\n foreach ($day as $dayName) {\n $dayName = strtolower($dayName);\n if (in_array($dayName, $this->validDayNames)) {\n $this->arguments[\"cut_off_time_{$dayName}\"] = $cut_off_time;\n }\n }\n } else {\n $dayName = strtolower($day);\n if (in_array($dayName, $this->validDayNames)) {\n $this->arguments[\"cut_off_time_{$dayName}\"] = $cut_off_time;\n }\n }\n }\n return $this;\n }",
"public function setShippingServiceCost($value)\n {\n return $this->set('ShippingServiceCost', $value);\n }",
"public function withShippingServiceOptions($value)\n {\n $this->setShippingServiceOptions($value);\n return $this;\n }",
"public function setShippingServiceOptions($value)\n {\n $this->_fields['ShippingServiceOptions']['FieldValue'] = $value;\n return $this;\n }",
"public function setCutOffTime(?Attribute\\DateTime $cutOffTime): self\n {\n $this->cutOffTime = $cutOffTime;\n\n return $this;\n }",
"public function setShippingServiceUsed($shippingServiceUsed)\n {\n $this->shippingServiceUsed = $shippingServiceUsed;\n return $this;\n }",
"public function setShippingService(ShippingService $service)\n {\n $this->shippingService = $service;\n }",
"public function setShippingPrice($value) \n {\n $this->_fields['ShippingPrice']['FieldValue'] = $value;\n return;\n }",
"public function setShippingPrice(?float $shippingPrice = null): self\n {\n // validation for constraint: float\n if (!is_null($shippingPrice) && !(is_float($shippingPrice) || is_numeric($shippingPrice))) {\n throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a float value, %s given', var_export($shippingPrice, true), gettype($shippingPrice)), __LINE__);\n }\n if (is_null($shippingPrice) || (is_array($shippingPrice) && empty($shippingPrice))) {\n unset($this->ShippingPrice);\n } else {\n $this->ShippingPrice = $shippingPrice;\n }\n \n return $this;\n }",
"public function setShippingService(ShippingServiceInterface $service)\n {\n $this->shippingService = $service;\n }",
"public function setShippingServiceOptions(array $shippingServiceOptions)\n {\n $this->shippingServiceOptions = $shippingServiceOptions;\n return $this;\n }",
"public function setShippingTime($value)\n {\n $this->_fields['ShippingTime']['FieldValue'] = $value;\n return $this;\n }",
"public function setShippingServiceId($value) {\n\t\t$this->shipping_service_id = $value;\n\t}",
"public function withShippingServiceOfferId($value)\n {\n $this->setShippingServiceOfferId($value);\n return $this;\n }",
"public function setPriceFromService()\n {\n $this->price = $this->service->price;\n }",
"public function processDeliveryTimeCutOff($delivery_times, $delivery_times_cutoff, $delivery_time_selected) {\n\t\t$cut_off_time = '';\n\t\t$key_found = '';\n\t\tforeach($delivery_times as $find_key => $time){\n\t\t\tif(trim($time[$this->config->get('config_language_id')]) == trim($delivery_time_selected)){\n\t\t\t\t$key_found = $find_key;\n\t\t\t}\n\n\t\t\tif(isset($delivery_times_cutoff[$find_key]) && $delivery_times_cutoff[$find_key] != ''){\n\t\t\t\t$cut_off_time = $delivery_times_cutoff[$find_key];\n\t\t\t\tif($cut_off_time != '' && $this->isValidDate($cut_off_time, 'H:i:s')){\n\t\t\t\t\t//compare time now with cut off time\n\t\t\t\t\t$time_now = date('H:i:s');\n\t\t\t\t\tif(strtotime($time_now) >= strtotime($cut_off_time)){\n\t\t\t\t\t\t//hide the array\n\t\t\t\t\t\tunset($delivery_times[$find_key]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $delivery_times;\n\t}",
"public function withShippingServiceName($value)\n {\n $this->setShippingServiceName($value);\n return $this;\n }",
"public function cutoffTime($cutoffTime)\n {\n return $this->setProperty('cutoffTime', $cutoffTime);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ check if user already submitted first proposition into DB. userid with courseid is needed return true or false; courseid==1 >frontpage | function issubmitted_firstproposition($userid, $courseid){
global $DB;
if ($courseid !=1){
$sessions=$DB->get_records('first_thesis_proposition',array('courseid'=>$courseid, 'userid'=>$userid));
if($sessions !=NULL){
return true; //user already submitted
}
}else{
return true; //user is accessing the page but not from a course.
}
return false; //user did not submit;
} | [
"function viewedCourse($userID, $courseID){\n\t\t$query = \"\n\t\t\tINSERT IGNORE INTO viewed\n\t\t\t(user_id, course_id)\n\t\t\tVALUES ('$userID','$courseID')\";\n\t\t\n\t\t$result = mysql_query($query);\n\t\t\n\t\tif ($result){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function userIsProfessor($user_id){\n $user_temp = Users::find($user_id);\n return !empty($user_id) && $user_temp && $user_temp['type'] == 1;\n }",
"function is_parcours($id_parcours) {\n\n\t$id_user = get_current_user_id();\n\tglobal $wpdb;\n\t$results = $wpdb->get_results(\"SELECT * FROM parcours_user WHERE id_user = $id_user AND id_parcours = $id_parcours\", ARRAY_A);\n\tif(!empty($results)) return false;\n\treturn true;\t\n}",
"function is_course_followed($userid,$courseid)\n{\n\t$con = mysqli_connect(DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);\n \n\tif (mysqli_connect_errno())\n\t{\n\t printf(\"Unable to connect to database: %s\", mysqli_connect_error());\n\t exit();\n\t}\n\n\t$sql = \"SELECT id FROM usercourse WHERE userid=\" . $userid . \" and courseid=\". $courseid;\n\n\t$result = mysqli_query($con,$sql); \n\t\n\t$size = mysqli_num_rows($result);\n\n\tif($size==0)\n\t{\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\treturn true;\n\t}\n\n}",
"function addCourseToPlanned($userID, $courseID){\n\t\t$query = \"\n\t\t\t\t\tINSERT IGNORE INTO planned (user_id, course_id)\n\t\t\t\t\tVALUES ('$userID', '$courseID')\";\n\n\t\t$result = mysql_query($query);\t\n\t\tif($result){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"function checkFirstTime($user){\n\t\n\t\t$user = parent::$db->clean($user);\n\t\t$sql = \"SELECT survey_sent_on\n\t\t\t\t FROM survey_student_list\n\t\t\t\t WHERE student_number = (SELECT student_number\n\t\t\t\t\t\t\t\t\t\t FROM survey_student_list\n\t\t\t\t\t\t\t\t\t\t WHERE email_link = '$user')\n\t\t\t\t AND completed = '1'\";\n\t\t$data = parent::$db->query($sql);\n\t\t\n\t\tforeach($data as $d){\n\t\t\tif($this->checkSessionExpire($d['survey_sent_on'])){\n\t\t\t\tcontinue;\n\t\t\t}else{\n\t\t\t\t$array[] = $d['survey_sent_on'];\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(count($array) == \"0\"){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"function checkUserAutority() {\r\n include \"/home/cypress/www/htdocs/fear-the-end-secrets/sqlConnect.php\";\r\n $projectManager = new ProjectManager($db);\r\n $memberManager = new MemberManager($db);\r\n $project = $projectManager->getProjectById($_GET['id']);\r\n $isDeveloper = false;\r\n $userArrayOnProject = $memberManager->getMembreByProject($project->getId());\r\n for ($i = 0; $i < count($userArrayOnProject); $i++) {\r\n if ($_SESSION['loggedUserObject'] != null && ($userArrayOnProject[$i]->getId() == unserialize($_SESSION['loggedUserObject'])->getId()) && ($userArrayOnProject[$i]->getFunction() == \"Developer\")) {\r\n $isDeveloper = true;\r\n }\r\n }\r\n\r\n $res = false;\r\n if (($_SESSION['loggedUserObject'] != null && unserialize($_SESSION['loggedUserObject'])->getId() == $project->getFk_auteur()) || $isDeveloper) {\r\n $res = true;\r\n } else {\r\n $res = false;\r\n }\r\n return $res;\r\n}",
"function instructorIsProf($iid)\n{\n if (!$iid) {\n die(\"Need instructor id.\");\n }\n $query = \"select position from instructor where iid='$iid' and position='professor'\";\n $result = mysql_query($query);\n\n if (!$result) {\n die(\"Unknown instructor id='$iid' \" . mysql_error());\n }\n\n // Return true if this is a professor (a non-empty query)\n return mysql_num_rows($result) >= 1;\n}",
"function request_course($course){\n\t\t\t$tid = $_SESSION['T_ID'];\n\n\t\t\t$query = \"SELECT COUNT(C_ID) FROM course WHERE C_ID = '$course'\";\n\t\t\t$result = mysqli_query($GLOBALS['conn'],$query);\n\t\t\t$row = mysqli_fetch_row($result);\n\t\t\tif ($row[0]>0){\n\t\t\t\t$query = \"SELECT COUNT(Request_ID) FROM request_course WHERE (T_ID = '$tid' and Status = 'PENDING' and C_ID = '$course')\";\n\t\t\t\t$result = mysqli_query($GLOBALS['conn'],$query);\n\t\t\t\t$row = mysqli_fetch_row($result);\n\t\t\t\tif ($row[0]==0){\n\t\t\t\t\tinsert(array('C_ID','T_ID'),array($course,$tid),'request_course');\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"function check_studAddOnce($user,$student_code)\n{\n\t$q = mysql_query(\"SELECT id FROM Members_Student WHERE mem_id = '$user' AND stud_id = '$student_code\");\n\n\tif($q === false)\n\t{\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n\t\n}",
"function isCourseLeader(){\n\t\t$result = $this->db->exec('SELECT courseID FROM courseLeader WHERE userID = ?', $this->f3->get('SESSION.userID'));\n\t\tif(empty($result)){\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn $result[0]['courseID'];\n\t\t}\n\t}",
"public function isProposition()\n {\n $u = $this->user()->first();\n\n return auth()->user()->id != $u->id;\n }",
"public function selectOrCreateUserCourse($courseid, $userid){\n // Check if users_courses exist\n DB::beginTransaction();\n try{\n $userCourse = DB::table('users_courses')\n ->where('users_courses.course_id', '=', $courseid)\n ->where('users_courses.user_id', '=', $userid)\n ->select('users_courses.id')\n ->first();\n DB::commit();\n }catch (\\Exception $e) {\n DB::rollBack();\n $userCourse = null;\n }\n\n // Create a new users_courses\n if($userCourse == null){\n DB::beginTransaction();\n try {\n $userCourseInserted = DB::table('users_courses')->insertGetId([\n 'user_id' => Auth::user()->id,\n 'course_id' => $courseid\n ]);\n if($userCourseInserted > 0){\n DB::commit();\n return $userCourseInserted;\n }else{\n DB::rollBack();\n return false;\n }\n }catch (\\Exception $e) {\n DB::rollBack();\n return false;\n }\n }else{\n return $userCourse->id;\n }\n \n }",
"private function validate_user() {\n\t\t$query = \"select pk from login where email='$this->user_id'\";\n\t\t$resource = executeSql($query, $this->conn);\n\t\tif($resource == false) {\n\t\t\treturn 'error';\n\t\t}\n\t\t$count = mysql_num_rows($resource);\n\t\tif($count > 0) {\n\t\t\treturn false; //user already exists\n\t\t} else {\n\t\t\treturn true; //means no user by this id\n\t\t}\n\n\t}",
"public function isCurrentUserPrepared()\n {\n if ($this->isCompletedByCurrentUser()) {\n return true;\n }\n\n foreach ($this->getPrerequisites() as $p) {\n if (!$p->isCompletedByCurrentUser()) {\n return false;\n }\n }\n\n return true;\n }",
"public static function existeCompra($userID, $courseID): bool\n {\n $app = Aplicacion::getSingleton();\n $conn = $app->conexionBd();\n $query = sprintf(\"SELECT `id` FROM `purchases` WHERE `userID`='%d' AND `courseID`='%d'\", $conn->real_escape_string($userID), $conn->real_escape_string($courseID));\n $rs = $conn->query($query);\n if ($rs && $rs->num_rows >= 1) {\n $rs->free();\n return true;\n }\n $rs->free();\n return false;\n }",
"function check_volunteer_exist_prior_to_register($vol_id){\r\n\t\r\n\t\tglobal $connection;\r\n\t\treturn (AppModel::grab_db_function_class()->return_num_of_rows_in_result(AppModel::grab_db_function_class()->execute_query(\"SELECT tagos_id FROM pahro__user WHERE tagos_id = {$vol_id}\")) == \"\") ? true : false;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t}",
"function student_has_curriculum($uid) {\n global $CURMAN;\n\n return $CURMAN->db->record_exists(CURASSTABLE, 'userid', $uid);\n}",
"function is_pro_user($user_id = false) {\r\n\t\tglobal $wpdb, $current_user, $current_site;\r\n\r\n\t\tif ( !$user_id ) {\r\n\t\t\t$user_id = $current_user->ID;\r\n\t\t}\r\n $user_id = intval($user_id);\r\n\r\n\t\tif ( is_super_admin($user_id) )\r\n\t\t\treturn true;\r\n\r\n\t\t//very db intensive, so we cache (1 hour)\r\n\t\t$expire_time = time()-3600;\r\n\t\t@list($expire, $is_pro) = get_user_meta($user_id, 'psts_user', true);\r\n\t\tif ($expire && $expire >= $expire_time) {\r\n\t return $is_pro;\r\n\t }\r\n\r\n\t\t//TODO - add option to select which user levels from supporter blog will be supporter user. Right now it's all (>= Subscriber)\r\n\t\t//$results = $wpdb->get_results(\"SELECT * FROM `$wpdb->usermeta` WHERE `user_id` = $user_id AND `meta_key` LIKE 'wp_%_capabilities' AND `meta_value` LIKE '%administrator%'\");\r\n\t\t$results = $wpdb->get_results(\"SELECT * FROM `$wpdb->usermeta` WHERE `user_id` = $user_id AND `meta_key` LIKE '{$wpdb->base_prefix}%_capabilities'\");\r\n\t if (!$results) {\r\n\t //update cache\r\n\t update_user_meta($user_id, 'psts_user', array(time(), 0));\r\n\t return false;\r\n\t }\r\n\r\n\t foreach ($results as $row) {\r\n\t\t $tmp = explode('_', $row->meta_key);\r\n\t\t //skip main blog\r\n\t\t if ($tmp[1] != $current_site->blogid)\r\n\t $blog_ids[] = $tmp[1];\r\n\t }\r\n\t $blog_ids = implode(',',$blog_ids);\r\n\r\n\t $count = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites WHERE expire > '\" . time() . \"' AND blog_ID IN ($blog_ids)\");\r\n\t if ($count) {\r\n\t update_user_meta($user_id, 'psts_user', array(time(), 1)); //update cache\r\n\t return true;\r\n\t } else {\r\n\t //update cache\r\n\t update_user_meta($user_id, 'psts_user', array(time(), 0)); //update cache\r\n\t return false;\r\n\t }\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
request metadata of a timeseries | function getTimeseriesMeta($tsId){
$json = file_get_contents('http://sensorweb.demo.52north.org/sensorwebclient-webapp-stable/api/v1/timeseries/'.$tsId);
} | [
"public function metadata($data) {\n $request_url = $this->_apiURL.'metadata/'.$data.'?AccessID='.$this->_accessID.'&Expires='.$this->_expires.'&Signature='.$this->_signature;\n\n $result = $this->_curlRequest($request_url);\n \n return $result;\n }",
"public function getTimeSeries()\n {\n return $this->time_series;\n }",
"public function getTimeSeriesData()\n {\n return $this->time_series_data;\n }",
"function get_metadata_for_data_views(){\n\tglobal $workbooks;\n\t$result = $workbooks->assertGet('/reporting/data_views/metadata.api');\n $workbooks->log('Result', $result, 'debug', 200000); //log 200000 characters of the result. This is more than the default logging, may be too noisy.\n\treturn $result;\n}",
"public function meta(string $ticker): Response\n {\n $q = $this->params();\n return $this->request('GET', \"daily/{$ticker}?{$q}\");\n }",
"public function getMetadata();",
"public function getHistoricalData()\n {\n }",
"public function metadata(): array;",
"public abstract function getSummaryData();",
"public function serialize()\n {\n $timeseries = parent::serialize();\n return (array) $this->metadata + ['timeseries' => $timeseries];\n }",
"public function query_time_series($time)\n\t{\n\t\t$result = array();\n\n\t\t$jdata = $this->query_analytics($time);\n\t\tif (!$jdata)\n\t\t{\n\t\t\treturn json_encode($result);\n\t\t}\n\n\t\t$data = (array)$jdata;\n\t\tif (!$data || !array_key_exists(\"__result__\", $data))\n\t\t{\n\t\t\treturn json_encode($result);\n\t\t}\n\n\t\t$result = (array)$jdata->__result__;\n\n\t\t$time_series = array();\n\n\t\tforeach ($jdata->zones as $item)\n\t\t{\n\t\t\t$m = array();\n\t\t\t$m[\"date_time\"] = $item->dimensions->timeslot;\n\t\t\t$m[\"count_visitors\"] = $item->uniq->uniques;\n\t\t\tarray_push($time_series, $m);\n\t\t}\n\n\t\t$result[\"time_series\"] = $time_series;\n\n\t\treturn a2j($result);\n\t}",
"private function getMetaData ()\n\t\t{\n\t\t\t$data = file_get_contents (\"META.inf\");\n\t\t\t$o = json_decode ($data,true);\n\t\t\treturn $o;\t\n\t\t}",
"function getMetaData($dataType){\n\t\t$AccessToken = Auth::token();\n\t\t$baseUrl = url . '/api/v1/' . customerAlias . '/' . databaseAlias;\n\t\t$endpoint = '/meta/';\n\t\t$request = $baseUrl . $endpoint . $dataType;\n\t\t$ch = curl_init();\n\t\tcurl_setopt_array($ch, array(\n\t\t CURLOPT_HTTPGET => true,\n\t\t CURLOPT_HTTPHEADER => array(\n\t\t\t\t'Authorization: Bearer ' . $AccessToken),\n\t\t CURLOPT_URL => $request,\n\t\t\tCURLOPT_RETURNTRANSFER => 1\n\t\t ));\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\treturn $response;\n\t}",
"public function _getMetadata()\r\n\t{\t\r\n\t\tif ( $this->metainfo !== null ) \r\n\t\t{\r\n\t\t\t$response['fields'] = $this->fields;\r\n\t\t\t$response['primarykeys'] = $this->primarykeys;\r\n\t\t\t$response['metainfo'] = $this->metainfo;\r\n\t\t}else\r\n\t\t{\r\n\t\t\t$filename = \"models/metadata/$this->tablename.php\";\r\n\t\t\tif (file_exists($filename) )\r\n\t\t\t{\r\n\t\t\t\tinclude($filename);\r\n\r\n\t\t\t\treturn $metadata;\r\n\t\t\t}\r\n\t\t\t$conn = ORMConnection::getConnection(); \r\n\t\t\t$rs = $conn->MetaColumns($this->tablename,False);\r\n\t\r\n\t\t\tforeach($rs as $item)\r\n\t\t\t{\t\r\n\t\t\t\t$fields[$item->name]=null;\r\n\t\t\t\t$metainfo[$item->name]= (array)$item; //array(\"type\"=>$item->type,\"length\"=>$item->max_length);\r\n\t\t\t\tif (isset($item->primary_key) && $item->primary_key === true )\r\n\t\t\t\t{\r\n if(isset($item->auto_increment))\r\n\t\t\t\t\t$primarykeys[$item->name] = ($item->auto_increment===true)?-1:0;\r\n else\r\n $primarykeys[$item->name] = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//$metainfo = $rs;\r\n\t\t\t$response[\"fields\"] = &$fields;\r\n\t\t\t$response[\"primarykeys\"] = &$primarykeys;\r\n\t\t\t$response[\"metainfo\"] = &$metainfo;\r\n \r\n\t\t}\r\n\t\t\r\n\t\treturn $response;\r\n\t}",
"function getResultsMeta() {\n\n\t\treturn($this->metadata);\n\n\t}",
"function get_metadata_for_data_view_execution_by_id($id){\n global $workbooks;\n $result = $workbooks->assertGet('/data_view/'.$id.'/data/metadata.api');\n $workbooks->log('Result', $result, 'debug', 200000); //log 200000 characters of the result. This is more than the default logging, may be too noisy.\n return $result;\n}",
"function getHistoricKPI($kpi, $devices, $fromDate, $toDate, $resolution, $unitSystem) {\n\techo \"Getting historical date based on KPI\" . $kpi . \"</br>\";\n\t$queryString = '?';\n\t#add devices to query string\n\tif(!empty($devices)){\n\t\t$deviceQueryString = \"\";\n\t\tfor($i = 0; $i < count($devices); $i++){\n\t\t\tif ($i > 0){\n\t\t\t\t$deviceQueryString = $deviceQueryString . '&'; \n\t\t\t}\n\t\t\t$deviceQueryString = $deviceQueryString . 'devices=' . $devices[$i];\n\t\t}\n\t\t$queryString = $queryString . $deviceQueryString;\n\t}\n\t#add from/to dates to query string\n\t$queryString = $queryString . '&from=' . $fromDate;\n\tif ($toDate != null){\n\t\t$queryString = $queryString . '&to=' . $toDate;\n\t}\n\t#add resolution and unit system\n\t$queryString = $queryString . '&resolution=' . $resolution . '&unitSystem=' . $unitSystem;\n\techo \"Query string is: \" . $queryString . \"</br>\";\n\t$response = getRequest('/externalApi/v1/Historic/' . $kpi, $queryString);\n\tprintInfo($response);\n}",
"function getAllSeries() {\n\n $service_url = \"/series.json\";\n if($series = $this->getJSON($service_url)){\n //$x = \"search-results\";\n //$episodes = $search->$x->result;\n return $series;\n } else return false;\n }",
"function t1_get_stat_data($unit_serial, $start_time, $stop_time){\n\t\t$q = \"SELECT * FROM data_daily_stats WHERE unit_serial = $unit_serial AND `date` >= '$start_time' AND `date` <= '$stop_time' ORDER BY date ASC\";\n\t\treturn t1_query($q);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'emailUserSearchCompanies' | protected function emailUserSearchCompaniesRequest($virtual_operator)
{
// verify the required parameter 'virtual_operator' is set
if ($virtual_operator === null) {
throw new \InvalidArgumentException(
'Missing the required parameter $virtual_operator when calling emailUserSearchCompanies'
);
}
if (strlen($virtual_operator) > 60) {
throw new \InvalidArgumentException('invalid length for "$virtual_operator" when calling EmailUserApi.emailUserSearchCompanies, must be smaller than or equal to 60.');
}
$resourcePath = '/api/{virtualOperator}/emailuser/companies';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($virtual_operator !== null) {
$resourcePath = str_replace(
'{' . 'virtualOperator' . '}',
ObjectSerializer::toPathValue($virtual_operator),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json', 'text/json', 'application/xml', 'text/xml']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json', 'text/json', 'application/xml', 'text/xml'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
$httpBody = $_tempBody;
// \stdClass has no __toString(), so we should encode it manually
if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($httpBody);
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | [
"private function getRequestedCompanies()\n {\n $collection = $this->companyCollectionFactory->create();\n $collection = $this->filter->getCollection($collection);\n\n return $collection->getItems();\n }",
"public function getAllOrderCompany(Request $request) \n {\n $input = $request->all();\n $searchBy = [];\n\n if($request->has('search') && $request->input('search')){\n\n $searchValues = explode(';', $request->input('search'));\n \n foreach ($searchValues as $val) {\n $tmp = explode(':', $val);\n \n if(count($tmp) > 1){\n $searchBy[$tmp[0]] = $tmp[1];\n }\n }\n }\n\n $orders = $this->orderRepository->getAllOrders($input['company_id'],$searchBy);\n if ($orders) {\n return $this->sendResponse($orders->toArray(), 'Orders retrieved successfully');\n }else{\n return $this->sendError('Data not found');\n }\n }",
"public static function getCompanyUserByEmail($request)\n {\n return self::find()\n ->from(self::tableName())\n ->where(['company.email' => $request])\n ->orderBy(['company.created_at' => SORT_DESC])\n ->all();\n }",
"public function get_company_of_user(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'user_id' => 'required',\n ]);\n if ($validator->fails()) {\n return AdapterHelper::sendResponse(false, 'Validator error', 400, $validator->errors()->first());\n }\n try {\n //code...\n $user = User::find($request->user_id);\n if (!$user) {\n return AdapterHelper::sendResponse(false, 'Not found', 404, 'User Not Found');\n }\n $data = $user->company()->get();\n } catch (\\Throwable $th) {\n //throw $th;\n AdapterHelper::write_log_error($th, \"Mobile\", $request->getRequestUri());\n return AdapterHelper::sendResponse(false, 'Undefined error', 500, $th->getMessage());\n }\n return AdapterHelper::sendResponse(true, $data, 200, 'success');\n }",
"public function searchCompanies($searchOptions)\n {\n return $this->searchItems(self::ITEM_COMPANIES, $searchOptions);\n }",
"public function getAllCompanyUsers(){\n $data = array();\n $entityType = $_GET[\"entityType\"];\n $companyList = $_GET[\"companyList\"];\n $user_name = $_GET[\"user_name\"];\n\n $users = $this->user->findCompanyUsers($entityType, $companyList, $user_name);\n\n foreach($users as $user){\n\n $entityTypeVal = $this->entityType->find($user[\"masterUserGroup\"][\"entity_type_id\"]);\n if($entityType != \"\"){\n if ($user[\"masterUserGroup\"][\"entity_type_id\"] == $entityType){\n $data[] = array(\n $user['name'],\n $user['email'],\n $user['masterUserGroup'][\"name\"],\n $user['company'][\"name\"],\n $entityTypeVal->name,\n );\n }\n }\n else{\n $data[] = array(\n $user['name'],\n $user['email'],\n $user['masterUserGroup']['name'],\n $user['company'][\"name\"],\n $entityTypeVal->name,\n );\n }\n }\n\n return response()->json([\"data\" => $data]);\n\n }",
"public function businessSearchRequest($country_code = SENTINEL_VALUE, $company = SENTINEL_VALUE, string $contentType = self::contentTypes['businessSearch'][0])\n {\n\n // Check if $country_code is a string\n if ($country_code !== SENTINEL_VALUE && !is_string($country_code)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($country_code, true), gettype($country_code)));\n }\n\n\n $resourcePath = '/api/v1/kyb/business/search';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n if ($country_code !== SENTINEL_VALUE) {\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $country_code,\n 'country_code', // param base name\n 'string', // openApiType\n 'form', // style\n true, // explode\n false // required\n ) ?? []);\n }\n if ($company !== SENTINEL_VALUE) {\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $company,\n 'company', // param base name\n 'integer', // openApiType\n 'form', // style\n true, // explode\n false // required\n ) ?? []);\n }\n\n\n\n\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', ],\n $contentType,\n $multipart\n );\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('AppId');\n if ($apiKey !== null) {\n $headers['AppId'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $method = 'GET';\n $this->beforeCreateRequestHook($method, $resourcePath, $queryParams, $headers, $httpBody);\n\n $operationHost = $this->config->getHost();\n $query = ObjectSerializer::buildQuery($queryParams);\n return [\n \"request\" => new Request(\n $method,\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n ),\n \"serializedBody\" => $httpBody\n ];\n }",
"public function get_companies() {\n\n\t\t\t$request = $this->base_uri . '/core/companies';\n\n\t\t\treturn $this->fetch( $request );\n\n\t\t}",
"public function getCompaniesAction()\n {\n # Retrieve available companies.\n $auth = array(\n 'username' => $this->container->getParameter('soap_username'),\n 'password' => $this->container->getParameter('soap_password')\n );\n $client = new SoapClient($this->container->getParameter('soap_wsdl'));\n\n try {\n $response = $client->__soapCall(\"getCompanies\", [$auth]);\n } catch (Exception $e) {\n throw new RuntimeException(\n 'Failed to get companies.'\n );\n }\n\n if(!is_array($response)){\n throw $this->createNotFoundException();\n }\n\n # Save companies to database.\n $companies = [];\n\n foreach ($response as $data) {\n # Determine if already exists.\n $company = $this->getDoctrine()->getRepository('AppBundle:Company')\n ->findOneByName($data->name);\n\n if (!$company) {\n $company = new Company();\n $company->setName($data->name);\n $company->setSymbol($data->symbol);\n\n $em = $this->getDoctrine()->getManager();\n $em->persist($company);\n $em->flush();\n\n sleep(1);\n }\n\n array_push($companies, $company);\n }\n\n return $companies;\n }",
"public function getCompanies(User $user)\n {\n return response($user->getCompanies()->paginate());\n }",
"public function companyUsers(Request $request) {\n\n\t\t$data = ['msg' => 'please try again later.', 'success' => '0', 'data' => []];\n\n\t\tif ($request->ajax()) {\n\n\t\t\t$companyId = $request->input('company_id');\n\n\t\t\t$query = User::where('company_id', $companyId)->where('role_id', '!=', 1)->where('is_active', '1');\n\n\t\t\tif ($request->input('group_owner')) {\n\n\t\t\t\t$query = $query->where('id', '!=', $request->input('group_owner'));\n\n\t\t\t}\n\n\t\t\t$users = $query->get();\n\n\t\t\treturn Response::json(array(\n\n\t\t\t\t'success' => '1',\n\n\t\t\t\t'data' => $users,\n\n\t\t\t\t'msg' => 'Success',\n\n\t\t\t));\n\n\t\t}\n\n\t\treturn $data;\n\n\t}",
"public function testGetUserCompanies()\n {\n // create some companies for the user\n $org = $this->createOrganization();\n $co1 = $this->createRecruitingCompany($org->id);\n $co2 = $this->createRecruitingCompany($org->id);\n $co3 = $this->createRecruitingCompany($org->id);\n $this->User->organization_id = $org->id;\n $this->User->save();\n\n $companies = (new RecruitingToken())->getUserCompanies($this->User->id);\n $this->assertEquals(3, count($companies));\n $this->assertEquals($companies[0]['id'], $co1->id);\n $this->assertEquals($companies[0]['name'], $co1->name);\n $this->assertEquals($companies[1]['id'], $co2->id);\n $this->assertEquals($companies[1]['name'], $co2->name);\n $this->assertEquals($companies[2]['id'], $co3->id);\n $this->assertEquals($companies[2]['name'], $co3->name);\n }",
"public function actionGetCompany(){\n\t\t$aResult = array();\n\t\t$sTerm = trim($_GET['term']);\n\t\t// set allowed instance\n\t\t$aSessionUser = unserialize(Yii::app()->session->get('app_setts'));\n\t\t$aCurrentInstanceId = $aSessionUser['current_instance_id'];\n\t\t$oCriteria = new CDbCriteria;\n\t\t$oCriteria->addCondition('t.name LIKE \"'.$sTerm.'%\"');\n\t\t$oCriteria->addCondition('t.instances_id ='.$aCurrentInstanceId);\n\t\t$oCriteria->order = 't.name ASC';\n\t\t$oCriteria->limit = 15;\n\t\t$aCompanies = Companies::model()->findAll($oCriteria);\n\t\tforeach($aCompanies as $iKey => $aCompany){\n\t\t\t$aResult[] = array(\n\t\t\t\t'item' => $aCompany['name'],\n\t\t\t\t'value' => $aCompany['name'],\n\t\t\t\t'title' => CHtml::encode(nl2br($aCompany['products']))\n\t\t\t);\n\t\t}\n\n\t\techo CJSON::encode($aResult);\n\t\tYii::app()->end();\n\t}",
"protected function listMrsCompaniesRequest($x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0')\n {\n\n $resourcePath = '/api/v2/companies/mrs';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($x_avalara_client !== null) {\n $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client);\n }\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function viewFavouriteCompaniesList(Request $request)\n {\n $user = User::find(auth()->user()->id);\n return response()->json([\"data\" => $user->companies()->get()], 200);\n }",
"private function getUserCompanies()\n {\n $userId = Auth::user()->id;\n return Company::where('user', $userId)->get();\n }",
"public function getEmptyCompanies()\n {\n $token_header = @$this->input->request_headers()['token'];\n $user_id = @$this->input->request_headers()['user_id'];\n\n if (check_token($token_header, $user_id)) {\n if (!isset($_POST['role']) || $_POST['role'] == \"\") {\n $json = array('status' => 'error', 'txt' => 'Role cannot be empty');\n } else {\n $json = $this->model->getEmptyCompanies($_POST);\n }\n } else {\n $json = array('status' => 'error', 'txt' => 'Invalid Token');\n http_response_code(401);\n }\n\n print_r(json_encode($json));\n }",
"public function getCompanyUsers() {\n\n \t\t//parse inputs\n \t\t$resourcePath = \"/users/company\";\n \t\t$resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n \t\t$method = \"GET\";\n $queryParams = array();\n $headerParams = array();\n $headerParams['Accept'] = 'application/json';\n $headerParams['Content-Type'] = 'application/json';\n\n //make the API Call\n if (! isset($body)) {\n $body = null;\n }\n \t\t$response = $this->apiClient->callAPI($resourcePath, $method,\n \t\t $queryParams, $body,\n \t\t $headerParams);\n\n\n if(! $response){\n return null;\n }\n\n \t\t$responseObject = $this->apiClient->deserialize($response,\n \t\t 'array[UserDto]');\n \t\treturn $responseObject;\n\n }",
"public function register_companyAction(Request $request)\n {\n //$request = $this->getRequest();\n //$session = $request->getSession();\n $server = $_SERVER['SERVER_NAME'];\n $em = $this->getDoctrine()->getManager();\n // $maincompany = $em->getRepository('NvCargaBundle:Maincompany')->findOneByHomepage($homepage);\n $maincompany = $em->getRepository('NvCargaBundle:Maincompany')->createQueryBuilder('m')\n ->where('m.homepage =:server OR m.homepage_aux =:server')\n ->setParameter('server', $server )\n ->setMaxResults(1)\n ->getQuery()\n ->getOneOrNullResult();\n // exit(\\Doctrine\\Common\\Util\\Debug::dump($maincompany->getName()));\n $form = $this->createRegisterForm();\n\n $termcond = $em->getRepository(\"NvCargaBundle:Termcond\")->findOneBy(array('maincompany'=>$maincompany, 'tableclass' => 'Subscriber', 'active' => true));\n if ($termcond) {\n $content = $termcond->getMessage();\n } else {\n $content = null;\n }\n return array(\n 'form' => $form->createView(),\n 'fondo' => $maincompany->getBackground(),\n 'logomain' => $maincompany->getLogomain(),\n 'content' =>$content,\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Call the generate:migration command | private function callMigration()
{
$name = $this->getMigrationName($this->option('migration'));
if ($this->confirm("Create a migration ($name) for the $this->resource resource?", 1)) {
$this->callCommand('migration', $name, [
'--name' => date('Y_m_d_His') . '_' . $name,
'--schema' => $this->option('schema'),
]);
}
} | [
"function generateMigration()\n {\n $content = $this->getAssetFile('Migration');\n $content = $this->replace($content,\n ['{package}', \"{table_name}\"],\n [$this->getGeneratedMigrationName(), $this->getGeneratedMigrationName(true)]);\n file_put_contents($this->getDatabasesPath() . $this->fileSeparator() . $this->getMigrationName() . '.php', $content);\n $this->printConsole($msg ?? \"< Migration > generated successfully\");\n }",
"public function callMigration()\n {\n Artisan::call('lucy:migration', $this->builder->getAttribute('migration'));\n\n Artisan::call('migrate');\n }",
"public function migrations_generate()\n {\n $script = array_shift($GLOBALS['argv']);\n $task = array_shift($GLOBALS['argv']);\n\n $migrationName = array_shift($GLOBALS['argv']);\n $migrationKey = null;\n if (preg_match('/^(\\d{14})_([a-z]\\w*)$/i', $migrationName, $matches)) {\n $migrationKey = $matches[1];\n $migrationName = $matches[2];\n } elseif (preg_match('/^[a-z]\\w*$/i', $migrationName)) {\n $migrationKey = date('YmdHi01');\n } else {\n echo 'You must specify a migration to crate' . PHP_EOL . PHP_EOL;\n $this->migrations();\n }\n \n $appMigrationPath = current(explode(PATH_SEPARATOR, $this->_smokeMigrator()->migrationsPath));\n \n $migrationContents = <<<HEREDOC\n<?php\nclass {$migrationName} extends Smoke_Migration_Base\n{\n public function up()\n {\n \\$this->say('This is only an example migrate up!!!');\n \\$this->say('Done', true);\n }\n \n public function down()\n {\n \\$this->say('This is only an example migrate down!!!');\n \\$this->say('Done', true);\n }\n} \nHEREDOC;\n \n $migrationFilepath = $appMigrationPath . DIRECTORY_SEPARATOR . $migrationKey . '_' . $migrationName . '.php';\n \n $success = file_put_contents($migrationFilepath,$migrationContents) ? '' : 'NOT ';\n \n echo \"An empty migration was {$success}generated for {$migrationKey} in {$migrationFilepath}\" . PHP_EOL;\n }",
"public function generate() {\n $this->writeMigrationInfo();\n $this->registerMigration();\n $this->writeMigrationFile();\n }",
"private function callMigration(): void\n {\n $name = $this->getMigrationName($this->option('migration'));\n\n if ($this->confirm(\"Create a migration ($name) for the $this->resource resource?\")) {\n $this->callCommand('migration', $name, [\n '--model' => false,\n '--schema' => $this->option('schema')\n ]);\n }\n }",
"public function generateFollowUpMigrations();",
"protected function createMigration()\n {\n $table = Str::plural(Str::snake(class_basename($this->argument('name'))));\n\n $this->call('arche:migration', [\n 'name' => \"create_{$table}_table\",\n '--create' => $table,\n ]);\n }",
"protected function bakeMigration()\n {\n $table = Str::plural(Str::snake(class_basename($this->argument('name'))));\n\n $this->call('make:migration', [\n 'name' => \"create_{$table}_table\",\n '--create' => $table,\n ]);\n }",
"protected function createMigration()\n {\n $table = Str::snake(Str::pluralStudly(class_basename($this->argument('name'))));\n\n if ($this->option('pivot')) {\n $table = Str::singular($table);\n }\n\n $this->call('make:migration', [\n 'name' => \"create_{$table}_table\",\n '--create' => $table,\n '--fullpath' => true,\n ]);\n }",
"protected function createMigration()\n {\n $this->call('make:meta-migration', [\n 'name' => $this->getNameInput()\n ]);\n }",
"protected function createMigration()\n {\n $table = Str::plural(Str::snake(class_basename($this->argument('name'))));\n\n $this->call('package:migration', [\n 'name' => \"create_{$table}_table\",\n '--create' => $table,\n '--namespace' => $this->getNamespaceInput(),\n '--dir' => $this->getDirInput(),\n ]);\n }",
"protected function createMigration()\n {\n if ($this->option('migration')) {\n $table = $this->getTableInput();\n\n $migrationVariables = ['name' => \"create_{$table}_table\", '--schema' => $this->getSchemaInput()];\n\n //Check if the model is to be archived\n if ($this->getArchiveInput()) {\n $migrationVariables['--soft-deletes'] = true;\n }\n\n $this->call('starter:migration', $migrationVariables);\n }\n }",
"public function runMigrations()\n {\n Artisan::call('migrate', ['--path' => 'plugins/' . $this->vendor . '/' . $this->name . '/database/migrations/']);\n }",
"public function migrate()\n\t{\n\t\t// Set our group arg & call migration\n\t\t$this->arguments->setOpt('group', $this->group->get('cn'));\n\t\t\\App::get('client')->call('migration', 'run', $this->arguments, $this->output);\n\t}",
"function generate_laravel_migration($class, $up, $down)\n{\n return <<<MIGRATE\n<?php\n\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass $class extends Migration\n{\n /**\n * Run the migrations.\n *\n * @return void\n */\n public function up()\n {\n try\n {\n DB::transaction(function() {\n DB::unprepared(<<<EOS\n$up\nEOS\n );\n });\n DB::commit();\n }\n catch (Exception \\$e)\n {\n DB::rollBack();\n throw new Exception(\\$e->getMessage());\n }\n }\n\n /**\n * Reverse the migrations.\n *\n * @return void\n */\n public function down()\n {\n try\n {\n DB::transaction(function() {\n DB::unprepared(<<<EOS\n$down\nEOS\n );\n });\n DB::commit();\n }\n catch (Exception \\$e)\n {\n DB::rollBack();\n throw new Exception(\\$e->getMessage());\n }\n }\n}\nMIGRATE;\n}",
"public function generateMigration()\n {\n $this->checkSchema();\n $params = [\n 'tableName' => $this->generateTableName($this->tableName),\n 'className' => $this->className,\n 'columns' => $this->prepareColumnsDefinitions(),\n 'foreignKeys' => $this->prepareForeignKeysDefinitions(),\n ];\n return $this->view->renderFile(Yii::getAlias($this->templateFile), $params);\n }",
"public function migration(){}",
"protected function installMigration()\n {\n $this->log('Set all migration as executed ..');\n\n $application = $this->getApplication();\n $commandInput = new ArrayInput(array(\n 'command' => 'doctrine:migration:version',\n '--add' => true,\n '--all' => true\n ));\n // Replace --no-interaction option which only work on CLI mode\n $commandInput->setInteractive(false);\n $application->doRun($commandInput, $this->output);\n\n $this->log('Set all migration as executed done..');\n }",
"private function create_migration(){\n $file = $this->path('migrations') . date('Y_m_d_His') . '_create_slender_table.php';\n $this->write_file($file, static::$migrationCode);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Obtenir le(s) seance(s) de l'etudiant user>seancesEtu() | public function seancesEtu(){
return $this->hasManyThrough(Seance::class,Groupe_Etudiants::class,'idEtudiant','idGroupe','id','idGroupe');
} | [
"function listeStagiaireTuteurEnseignant() {\n\t\t\t$bd = new bd();\n\t\t\t$co = $bd->connexion();\n\n\t\t\t// On recupère l'id du tuteur Enseignant\n\t\t\t$utilisateurs = new utilisateurs($co, $_SESSION['identifiant']);\n\t\t\t$id_tuteurEnseignant = $utilisateurs->getId();\n\n\t\t\t// On recupere le tableau des id des stagiaires du tuteur Enseignant\n\t\t\t$ficheLocalisationStage = new ficheLocalisationStage($co);\n\t\t\t$tableau_id_etudiant = $ficheLocalisationStage->rechercheStagiaireTuteurEnseignant($id_tuteurEnseignant);\n\n\t\t\t// On retourne le resultat\n\t\t\tforeach ($tableau_id_etudiant as $value) {\n\t\t\t\t$nom_stagiaire = $utilisateurs->nomEtudiant($value);\n\t\t\t\t$prenom_stagiaire = $utilisateurs->prenomEtudiant($value);\n\t\t\t\t$nomPrenom = $nom_stagiaire;\n\t\t\t\t$nomPrenom .= ' ';\n\t\t\t\t$nomPrenom .= $prenom_stagiaire;\n\n\t\t\t\techo'<option value=\"'.$value.'\">'.$nomPrenom.'</option>';\n\t\t\t}\n\n\t\t$bd->deconnexion();\n\t}",
"public function seancesEns(){\n return $this->hasManyThrough(Seance::class,Enseignant_Groupe::class,'idEnseignant','idGroupe','id','idGroupe');\n }",
"public function getEstudiante() \n {\n return $this->estudiante;\n }",
"public function produitUtilisateurSemaineAction()\n {\n $em = $this->container->get('doctrine')->getEntityManager();\n $username = $this->container->get('security.context')->getToken()->getUsername();\n \n $qb = $em->createQueryBuilder();\n $qb ->select('sum (a.prix)')\n ->from('MyAppApBundle:ClientService', 'a')\n ->join('a.client', 's')\n ->join('s.contrat', 'c')\n ->join('c.production', 'p')\n ->where(\"s.user LIKE :username \")\n ->andWhere(\"p.statut LIKE :Termine\")\n ->andWhere (\"p.created >= :date\")\n ->setParameters(array(\n 'username' => $username,\n 'Termine' => 'Terminé',\n 'date' =>new \\DateTime('-1 week')\n ));\n $query = $qb->getQuery(); \n $nbDollarProduitSemaine = $query->getResult();\n\n return $this->container->get('templating')->renderResponse('MyAppApBundle:Dashboard:produitUtilisateurSemaine.html.twig', \n\tarray(\n 'nbDollarProduitSemaine' => $nbDollarProduitSemaine,\n 'username' => $username,\n \t));\n }",
"public function professeur(){\r\n $idU = $this->requete->getSession()->getAttribut(\"idUtilisateur\");\r\n $adult=$this->adult->getadult($idU);\r\n $tab =$this->adult->getAdults();\r\n\r\n $this->genererVue(array('adult'=>$adult,'lists'=>$tab));\r\n }",
"public function docentesSecundaria(){\r\n try {\r\n if($this->verificarSession()){\r\n $this->vista->set('titulo', 'docentes Secundaria');\r\n $limI='6';\r\n $limS='11';\r\n $salones = new Salon();\r\n $secundaria = $salones->leerSalonesJornada($limI,$limS);\r\n $this->vista->set('secundaria', $secundaria);\r\n return $this->vista->imprimir();\r\n }\r\n } catch (Exception $exc) {\r\n echo 'Error de aplicacion: ' . $exc->getMessage();\r\n }\r\n }",
"public function eventiSegnalati(){\r\n if($this->isUserConnected()){\r\n if($_SESSION['user']->isAdmin()){\r\n if($this->esisteView(views::spaziopersonaleAdmin)){\r\n $tot = DB_handler::totSegna();\r\n $str = \"\\n<div id=\\\"risultaticontent\\\">\\n<strong>Sono stati segnalati $tot annunci di eventi</strong>\\n\";\r\n $eventi = evento::eventiSegnalati();\r\n if($tot > 0){\r\n $str =$str.\"<p class=\\\"mobilegoup viewinmobilelink\\\"><a href=\\\"#navUtente\\\">Salta l'elenco degli annunci segnalati e Torna nel menù del tuo spazio amministratore</a></p>\\n<ul>\\n\";\r\n $index = 1;\r\n foreach($eventi as $ev){\r\n $str = $str. '<li><a href=\"spazioadmin.php?evsegnalato='.$ev->giveId().'\">Annuncio '.$index.' segnalato ('.DB_handler::totSegna($ev->giveId()).\r\n ' segnalazioni): '.$ev->giveTipo().' - '.$ev->Titolo().\"</a></li>\\n\";\r\n ++$index;\r\n }\r\n $str = $str.\"</ul>\";\r\n }\r\n $str = $str.\"\\n<p class=\\\"mobilegoup viewinmobilelink\\\"><a href=\\\"#navUtente\\\">Torna nel menù del tuo spazio amministratore</a></p></div>\\n\";\r\n $str = $this->buildUtenteNav($str, 0);\r\n if($str !=''){\r\n $str = $this->putInContenuto($str,'<a href=\"index.php\">Home</a> > Spazio amministratore: Annunci segnalati dagli utenti');\r\n echo $this->giveHeader(\"Annunci segnalati dagli utenti ($tot annunci)\",6).$str.file_get_contents(views::footer);\r\n }\r\n }\r\n }\r\n else $this->errore(1);\r\n }\r\n else $this->loginPage();\r\n }",
"function GetSejours($Service=\"\",$Anesthesiste=\"\",$Chirurgien=\"\")\n\t{\n\t\t$filtre_sql=\"\";\n\n\t\t//Service\n\t\tif ((strlen($Service) > 0) and ($Service !=\"TOUS\"))\n\t\t{\n\t\t\t$filtre_sql.= \" AND \".$this->Table_bloc_structure.\".lib_service='\".$Service.\"' \";\t\t\t\t\t\n\t\t}\n\n\t\t//Chirurgien\n\t\tif ((strlen($Chirurgien) > 0) and ($Chirurgien !=\"TOUS\"))\n\t\t{\n\t\t\t$filtre_sql.= \" AND \".$this->TableIpop.\".Chirurgien='\".$Chirurgien.\"' \";\t\t\t\t\t\n\t\t}\n\t\t\n\t\t//Anesthesiste\n\t\tif ((strlen($Anesthesiste) > 0) and ($Anesthesiste !=\"TOUS\"))\n\t\t{\n\t\t\t$filtre_sql.= \" AND \".$this->TableIpop.\".Anesthesiste='\".$Anesthesiste.\"' \";\t\t\t\t\t\n\t\t}\n\t\t$sql = \"SELECT * from \".$this->TableIpop.\" LEFT JOIN \".$this->Table_bloc_structure.\" ON \".$this->Table_bloc_structure.\".ug = \".$this->TableIpop.\".um_de_travail\n\t\t\t\t\tWHERE date_intervention between '\". CommonFunctions::Normal2Mysql($this->DateDeb).\"' \n\t\t\t\t\tAND '\". CommonFunctions::Normal2Mysql($this->DateFin).\"' \n\t\t\t\t\tAND \".$this->TableIpop.\".site='\".$this->Site.\"' \n\t\t\t\t\t$filtre_sql\n\t\t \tORDER BY date_intervention,um_de_travail\";\t\t\t\t\t\n\n\t\t$data=parent::select($sql);\n\t\treturn $data;\n\t}",
"public function getSemestre(){\n return $this->semestre;\n }",
"public function professeur() {\r\n $idU = $this->requete->getSession()->getAttribut(\"idUtilisateur\");\r\n $adult = $this->adult->getadult($idU);\r\n $tab = $this->adult->getAdults();\r\n\r\n $this->genererVue(array('adult' => $adult, 'lists' => $tab));\r\n }",
"public function getSessaoSeis()\n {\n return $this->sessaoSeis;\n }",
"public function getSujet()\r\n {\r\n return $this->sujet;\r\n }",
"public function setSexe_utilisateur($sexe_utilisateur)\n {\n $this->sexe_utilisateur = $sexe_utilisateur;\n\n return $this;\n }",
"public function getVitesseTheorique() {\n return $this->vitesseTheorique;\n }",
"public function getAsistenciaestudiantesuser()\n\t{\n\t\treturn $this->asistenciaestudiantesuser;\n\t}",
"public function getSujet()\n {\n return $this->sujet;\n }",
"public function estudiantesSalones(){\n try {\n $idSalon = isset($_POST['idSalon']) ? $_POST['idSalon'] : NULL;\n $persona = new Persona();\n $estudiante = $persona->leerPorSalon($idSalon);\n $this->vista->set('idSalon', $idSalon);\n $this->vista->set('estudiante', $estudiante);\n return $this->vista->imprimir();\n } catch (Exception $exc) {\n $this->setVista('mensaje');\n $msj= \"Error en la aplicación.. Coloquese en contacto con el Desarrollador\";\n $this->vista->set('msj', $msj);\n return $this->vista->imprimir();\n } \n }",
"public function getSuperviseurs() {\n $qb = $this->createQueryBuilder('u')\n ->where('u.etat !=:etat ')\n ->setParameter('etat', TypeEtat::SUPPRIME)\n ->addSelect('p')\n ->leftJoin('u.profil', 'p')\n ->andWhere('p.code =:code')\n ->setParameter('code', TypeCodeProfil::SUPERVISEUR)\n ->orderBy('u.nom', 'ASC')\n ;\n\n\n return $qb->getQuery()->getResult();\n }",
"public function getEstudio_seguridad(){\n return $this->estudio_seguridad;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
int32 current_period_bucket = 1; | public function setCurrentPeriodBucket($var)
{
GPBUtil::checkInt32($var);
$this->current_period_bucket = $var;
} | [
"public function getCurrentPeriodBucket()\n {\n return $this->current_period_bucket;\n }",
"public function getLifetimeValueBucket()\n {\n return isset($this->lifetime_value_bucket) ? $this->lifetime_value_bucket : 0;\n }",
"function logger_get_storage_periods() {\n return array(\n //resolution storage period\n 1 * MINUTE => 1 * DAY,\n 15 * MINUTE => 1 * WEEK,\n 1 * DAY => 365 * DAY,\n 1 * WEEK => 10 * YEAR);\n}",
"private function getCurrentBucketID() {\n return (int)(time() / $this->getBucketDuration());\n }",
"private function getCurrentBucketIndex(): int\n {\n return (int)$this->getBucketIndex(0, $this->getTimeInMilliseconds());\n }",
"function trader_maxindex($real, $timePeriod){}",
"public function getRetentionPeriod(): int;",
"public function getConversionLagBucket()\n {\n return $this->conversion_lag_bucket;\n }",
"public function memtableFlushPeriodMs() {}",
"function hourly_epoch_dataplus_transactions() {\r\r\n\t\tmgm_epoch_update_dataplus_transactions();\t\r\r\n\t}",
"function gw_incrData($p_dataStart, $ii){ //timeStamp\n return $p_dataStart+($ii*86400);\n}",
"private function daily_limit_transient_key() {\n\t\treturn 'tribe-aggregator-limit-used_' . date( 'Y-m-d' );\n\t}",
"public function memtableFlushPeriodMs();",
"protected function _cachingPeriod() {\n\t\treturn 60 * 60 * 24 * 365;\n\t}",
"function bucket($arr){\n\t\t$bucket = array();\n\t\t\n\t\t\n\t\tfor($i = 0; $i < 100; $i ++)//Assuming no prime numbers over 100 will be needed\n\t\t\tarray_push($bucket, 0);\t\t\n\t\t\t\n\t\tforeach($arr as $i){\n\t\t\tif($bucket[$i] > 0)\n\t\t\t\tcontinue;\n\t\t\tforeach($arr as $j){\n\t\t\t\tif($j == $i)\n\t\t\t\t\t$bucket[$i] ++;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $bucket;\n\t}",
"public function getPeriod();",
"public function getConversionOrAdjustmentLagBucket()\n {\n return $this->conversion_or_adjustment_lag_bucket;\n }",
"public function test_min_data_age_with_Checkperiod(){\n\t\t// EXPECTED RESULT : The first 100 keys get persisted after 120 seconds and the remaining 400 keys get persisted after 180 seconds.\n\t\t// Setting chk_period\n\t\tzbase_setup::reset_zbase_vbucketmigrator(TEST_HOST_1, TEST_HOST_2);\n\t\t$instance = Connection::getMaster();\n\t\tflushctl_commands::set_flushctl_parameters(TEST_HOST_1, \"chk_period\" ,60);\n\t\t//Setting chk_max_items\n\t\tflushctl_commands::set_flushctl_parameters(TEST_HOST_1, \"chk_max_items\",500);\n\t\t//Setting min_data_age\n\t\tflushctl_commands::set_flushctl_parameters(TEST_HOST_1, \"min_data_age\", 120);\n\t\tflushctl_commands::set_flushctl_parameters(TEST_HOST_2, \"min_data_age\", 120);\n\t\tflushctl_commands::set_flushctl_parameters(TEST_HOST_2, \"queue_age_cap\", 180);\n\t\t//Get stats before any key is set\n\t\t$items_persisted_master_before_set = Utility::Get_ep_total_persisted(TEST_HOST_1);\n\t\t$items_persisted_slave_before_set = Utility::Get_ep_total_persisted(TEST_HOST_2);\n\t\t$checkpoint_before_set = stats_functions::get_checkpoint_stats(TEST_HOST_1,\"open_checkpoint_id\");\n\t\t$this->assertTrue(Data_generation::add_keys(100,500,1,20) ,\"Failed adding keys\");\n\t\tsleep(60);\n\t\t$checkpoint_after_set = stats_functions::get_checkpoint_stats(TEST_HOST_1,\"open_checkpoint_id\");\n\t\t$this->assertEquals($checkpoint_after_set-$checkpoint_before_set ,1 ,\"Checkpoint not closed\");\n\t\t$this->assertFalse(Utility::Get_ep_total_persisted(TEST_HOST_1, $items_persisted_master_before_set),\"min_data_age not respected on master\");\n\t\t$this->assertFalse(Utility::Get_ep_total_persisted(TEST_HOST_2, $items_persisted_slave_before_set) ,\"min_data_age not respected on slave\");\n\t\t$this->assertTrue(Data_generation::add_keys(400,500,101,20) ,\"Failed adding keys\");\n\t\tsleep(80);\n\t\t$items_persisted_master_after_min_data_age = stats_functions::get_all_stats(TEST_HOST_1, \"ep_total_persisted\");\n\t\t$items_persisted_slave_after_min_data_age = stats_functions::get_all_stats(TEST_HOST_2, \"ep_total_persisted\");\n\t\t$this->assertEquals($items_persisted_master_after_min_data_age-$items_persisted_master_before_set, 100, \"Item not persisted after min_data_age period on master\");\n\t\t//This won't be applicable\n#$this->assertEquals($items_persisted_slave_after_min_data_age-$items_persisted_slave_before_set, 100, \"Item not persisted after min_data_age period on slave\");\n\t\t$this->assertFalse(Utility::Get_ep_total_persisted(TEST_HOST_1,$items_persisted_master_after_min_data_age),\"min_data_age not respected for new keys on master\");\n\t\t$this->assertFalse(Utility::Get_ep_total_persisted(TEST_HOST_2,$items_persisted_slave_after_min_data_age) ,\"min_data_age not respected for new keys on slave\");\n\t\tsleep(110);\n\t\t$new_items_persisted_master_after_min_data_age = stats_functions::get_all_stats(TEST_HOST_1, \"ep_total_persisted\");\n\t\t$new_items_persisted_slave_after_min_data_age = stats_functions::get_all_stats(TEST_HOST_2, \"ep_total_persisted\");\n\t\t$this->assertEquals($new_items_persisted_master_after_min_data_age-$items_persisted_master_after_min_data_age , 400 , \"Item not persisted after min_data_age period on master\");\n\t\t$this->assertEquals($new_items_persisted_slave_after_min_data_age - $items_persisted_slave_before_set , 500 , \"Item not persisted after min_data_age period on slave\");\n\n\t}",
"protected function interval_offset() {\n\t\treturn 0;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
(generated code: DataLogger functions) Retrieves a data logger for a given identifier. The identifier can be specified using several formats: FunctionLogicalName ModuleSerialNumber.FunctionIdentifier ModuleSerialNumber.FunctionLogicalName ModuleLogicalName.FunctionIdentifier ModuleLogicalName.FunctionLogicalName This function does not require that the data logger is online at the time it is invoked. The returned object is nevertheless valid. Use the method YDataLogger.isOnline() to test if the data logger is indeed online at a given time. In case of ambiguity when looking for a data logger by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name. | function yFindDataLogger($func)
{
return YDataLogger::FindDataLogger($func);
} | [
"public function get_dataLogger(): ?YDataLogger\n {\n // $logger is a YDataLogger;\n // $modu is a YModule;\n // $serial is a str;\n // $hwid is a str;\n\n $modu = $this->get_module();\n $serial = $modu->get_serialNumber();\n if ($serial == YAPI::INVALID_STRING) {\n return null;\n }\n $hwid = $serial . '.dataLogger';\n $logger = YDataLogger::FindDataLogger($hwid);\n return $logger;\n }",
"public static function FindDataLogger(string $func): YDataLogger\n {\n // $obj is a YDataLogger;\n $obj = YFunction::_FindFromCache('DataLogger', $func);\n if ($obj == null) {\n $obj = new YDataLogger($func);\n YFunction::_AddToCache('DataLogger', $func, $obj);\n }\n return $obj;\n }",
"public static function FindDataLogger($func)\n {\n // $obj is a YDataLogger;\n $obj = YFunction::_FindFromCache('DataLogger', $func);\n if ($obj == null) {\n $obj = new YDataLogger($func);\n YFunction::_AddToCache('DataLogger', $func, $obj);\n }\n return $obj;\n }",
"final public static function getLog(string $identifier = 'default') : \\codename\\core\\log {\n return self::getSingletonClient('log', $identifier);\n }",
"public static function getLogger()\n {\n if (self::$logger === null)\n {\n try\n {\n $result = Hook::execute(\n \"Wedeto.Util.GetLogger\", \n [\"logger\" => null, \"class\" => static::class]\n );\n }\n catch (RecursionException $e)\n {\n // Apparently the hook is calling getLogger which is failing, so\n // use an emergency logger to log anyway.\n $result = ['logger' => new EmergencyLogger];\n }\n\n self::$logger = $result['logger'] ?? new NullLogger();\n }\n return self::$logger;\n }",
"function getExistingCampaignLogEntry($identifier)\n{\n $targeted = BeanFactory::newBean('CampaignLog');\n $where = \"campaign_log.activity_type='targeted' AND campaign_log.target_tracker_key = ?\";\n $query = $targeted->create_new_list_query('', $where);\n return $targeted->db->getConnection()\n ->executeQuery(\n $query,\n [$identifier]\n )\n ->fetch();\n}",
"public function get($id): LogInterface;",
"function logger_instance($name = null)\n {\n if ($name instanceof LoggerInterface) {\n return $name;\n }\n\n return Log::getLog($name);\n }",
"private function getLogger()\r\n {\r\n if ($this->logger === null) {\r\n $this->logger = $this->create();\r\n }\r\n\r\n return $this->logger;\r\n }",
"protected function getLogger()\n {\n // errors.\n if (is_null($this->logger)) {\n $this->logger = new NoLog();\n }\n return $this->logger;\n }",
"protected function getLogger()\n {\n return $this->logger ?: new NullLogger();\n }",
"public function getLogById($id) {\n $query = $this->db->get_where('log', array('id_ot_hija' => $id));\n return $query->result();\n }",
"protected function getLogger()\n {\n if (!$this->logger) {\n $this->logger = new NullLogger();\n }\n return $this->logger;\n }",
"public function getSystemLogID();",
"public function getDrLogger(): Logger\n {\n return $this->_logger;\n }",
"public function getLogger()\n {\n\n if (!$this->logger) {\n $sl = $this->getServiceLocator();\n // check we were able to get a service locator\n $this->logger = $sl->get('logger');\n }\n return $this->logger;\n }",
"protected function getLogger()\n {\n return $this->logger;\n }",
"public static function getLogger()\n {\n return self::$logger;\n }",
"protected function getLogger()\n {\n return new DbPatch_Core_Log();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
\fnconstruct() \brief load config file for the controller | function __construct() {
parent::__construct();
$this->config = json_decode(file_get_contents(CONFIG_DIR . "controllers/message.config.json"), false);
} | [
"public function __construct($file) {\n $this->config = json_decode(file_get_contents($file), true);\n }",
"abstract protected function load_config();",
"function __construct()\n {\n $this->conf = Config::get_config();\n }",
"public function __construct($pathToConfig)\n {\n// $configFile = file_exists('config.yml') ? 'config.yml' : '../config.yml';\n $this->config = YAML::parse($pathToConfig.'/config.yml');\n }",
"public function __construct()\n {\n $this->config = Yaml::parse(\n __BASE__ . DIRECTORY_SEPARATOR . 'configs' . DIRECTORY_SEPARATOR\n . 'config.' . DependencyManager::get('Environment') . '.yaml'\n );\n }",
"public function __construct(){\n \\acdhOeaw\\util\\RepoConfig::init($_SERVER[\"DOCUMENT_ROOT\"].'/modules/oeaw/config.ini');\n }",
"private function __construct()\n {\n if (!file_exists(self::CONFIG_LOCATION)) {\n // TODO: Better error handling\n echo 'settings.ini configuration file missing or damaged.';\n die();\n }\n $readConfig = [];\n if (file_exists(self::CONFIG_LOCATION)) {\n if ($readConfig = parse_ini_file(self::CONFIG_LOCATION)) {\n self::$config = $readConfig;\n }\n }\n }",
"function __construct() {\n\n $path = dirname(dirname(__DIR__)).\"/config/\";\n\n $this->contenttypes = Yaml::parse($path.\"contenttypes.yml\");\n $this->configuration = Yaml::parse($path.\"config.yml\");\n $this->taxonomies = Yaml::parse($path.\"taxonomies.yml\");\n $this->widgets = Yaml::parse($path.\"widgets.yml\");\n\n }",
"private function __construct()\n {\n $this->data = require __DIR__ . '/../config.php';\n }",
"static function loadConfig() {\n\t\t$config = self::file($_SERVER[\"DOCUMENT_ROOT\"] . \"/../config.json\");\n\t\tif (!is_null($config))\n\t\t\tself::$config = json_decode($config);\n\t}",
"private function loadConfig()\n {\n $this->config = Json::decode(preg_replace(\"/\\/\\*[\\s\\S]+?\\*\\//\", '', file_get_contents($this->currentPath . '/config.json')), true);\n $this->action = Yii::$app->getRequest()->get('action');\n $this->jsonpCallback = Yii::$app->getRequest()->get('jsonpCallback');\n }",
"public function __construct()\n {\n $this->config = $this->loadDefaultConfig();\n\n if (is_file(self::ELEPHFRONT_BOOTSTRAP)) {\n include self::ELEPHFRONT_BOOTSTRAP;\n }\n \n // We store it in a variable so the included file has access to the existing configuration if needed\n $config = $this->config;\n\n if (is_file(self::ELEPHFRONT_CONFIG)) {\n $userConfig = include self::ELEPHFRONT_CONFIG;\n $this->config = $this->merge($this->config, $userConfig);\n }\n }",
"protected function __construct() {\n $this->loadConfiguration();\n }",
"protected function init()\n {\n $this->config_file = FactoryDefault::getDefault()->get('config')->globals->config_path . \"config.xml\";\n try {\n $this->load();\n } catch (\\Exception $e) {\n $this->configxml = null ;\n }\n\n }",
"public function __construct() {\n $this->config = new config();\n }",
"private function __construct() {\r\n if(!$this->exists('config')) {\r\n $this->set('config', new Config());\r\n }\r\n }",
"public function __construct() {\n\t\t$this->readFiles();\n\t\t$this->ini = array();\n\t}",
"public function load() {\n\n if ($this->exists() && is_null(self::$config)) {\n\n self::$config = include self::CONFIG_FILE;\n }\n }",
"public static function load() {\n require_once ROOT_DIR . \"config.php\";\n self::prepare_config();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add custom API endpoint for videos listing | function mu_livestream_videos_api_listing() {
if ( false === get_transient( 'mu-livestream-videos' ) ) {
$videos = array();
$args = array(
'post_type' => 'mu-livestream',
'post_status' => 'publish',
'posts_per_page' => 300, // phpcs:ignore
'meta_key' => 'mu_livestream_start', // phpcs:ignore
'orderby' => 'meta_value',
'meta_type' => 'DATETIME',
'order' => 'DESC',
);
$the_query = new WP_Query( $args );
while ( $the_query->have_posts() ) {
$the_query->the_post();
$video = array(
'id' => get_the_ID(),
'video_title' => get_post_field( 'post_title', get_the_ID(), 'raw' ),
'video_url' => get_the_permalink(),
'video_thumbnail' => esc_url( get_field( 'mu_livestream_thumbnail', get_the_ID() )['url'] ),
'video_date' => esc_attr( Carbon::parse( get_field( 'mu_livestream_start', get_the_ID() ) )->format( 'l, F j, Y' ) ),
);
array_push( $videos, $video );
}
wp_reset_postdata();
set_transient( 'mu-livestream-videos', $videos, 43000 );
} else {
$videos = get_transient( 'mu-livestream-videos' );
}
$response = new WP_REST_Response( $videos );
$response->set_status( 200 );
return $response;
} | [
"function tve_api_video_urls() {\n\tif ( tve_get_current_screen_key() === 'admin_page_tve_dash_api_connect' ) {\n\n\t\trequire_once __DIR__ . '/classes/ApiVideos.php';\n\n\t\t$api_videos = new ApiVideos();\n\t}\n}",
"public function obtainVideos()\n {\n return $this->performRequest('GET','/videos');\n }",
"function videos() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['user_id'];\n if ($id > 0) {\n $query = \"select * from videos where user_id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__); \n if($r->num_rows > 0) {\n $result = array();\n while ($row = $r->fetch_assoc()) {\n $result[] = $row;\n } \n\n $this->response(json_encode($result), 200); \n } else {\n $this->response('',204);\n }\n } else {\n $this->response('', 400);\n }\n }",
"public function getVideoListByType()\n {\n if ($_GET != null) {\n // Verification API Token\n if (isset($_GET['type']) && $_GET['api_token'] == 'zonaenglish2021!') {\n $data = DB::table('tb_video_tutorial')\n ->where('type', '=', $_GET['type'])\n ->get();\n\n if (!$data->isEmpty()) {\n return response()->json([\n 'message' => 'success',\n 'code' => 200,\n 'data' => $data\n ]);\n } else {\n return response()->json([\n 'message' => 'failed',\n 'code' => 204,\n 'data' => null\n ]);\n }\n } else {\n return response()->json([\n 'message' => 'failed',\n 'code' => 401,\n 'data' => null\n ]);\n }\n }\n return response()->json([\n 'message' => 'failed',\n 'code' => 404,\n 'data' => null\n ]);\n }",
"public function videosAction() {\r\n\r\n try {\r\n \r\n // Get video press reviews using cache\r\n $pressReviews = $this->getPressReviews(PressReviewTypes::VIDEO, null, null, true);\r\n \r\n // Add common items to model view\r\n $this->addCommonListItemsToModelView(null, null, null, $pressReviews, PressReviewTypes::VIDEO);\r\n } catch (\\Exception $e) {\r\n Trace::addItem(sprintf(\"Une erreur s'est produite dans \\\"%s->%s\\\", TRACE : %s\\\"\", get_class(), __FUNCTION__, $e->getTraceAsString()));\r\n $this->forward(\"error\", \"error\", \"default\");\r\n }\r\n }",
"public function videosAction() {\n $playlist = array();\n //-----------------------\n // Получим файл конфигурации\n $ini = Zend_Registry::get('config');\n $adapter = $ini['http']['adapter'];\n $proxy_host = $ini['proxy']['host'];\n\n // Получим обьект запроса\n $request = $this->getRequest();\n $params = $request->getParams();\n $type_action = $params['type_action'];\n $username = trim($request->getUserParam('username'));\n $post_id = (int) $request->getUserParam('post_id');\n\n\n if ($type_action == 'playlist') {\n // Получим файлы видео для сообщения\n $videos = Default_Model_DbTable_BlogPostVideo::GetVideo($this->db, array('post_id' => $post_id));\n // Получим список видео данных для статьи\n foreach ($videos as $video) {\n\n // Получим URL ресурса\n $type = $video->type;\n $arrType = explode('-', $type);\n if ($arrType[0] == 'file') {\n $url = $video->getFullUrl_Res($username);\n } else {\n $url = $video->identifier;\n }\n\n $path = $video->GetUploadPath($username) . '/' . $video->getId() . '.json';\n if (is_file($path)) {\n $strJson = file_get_contents($path);\n $strJson = stripslashes($strJson);\n try {\n\n // Получим пути к изобржаениям и флеш для пользователя\n $pathImages = Default_Model_DbTable_BlogPostImage::GetUploadUrl($username);\n $pathFlash = Default_Model_DbTable_BlogPostVideo::GetUploadUrlForFlash($username);\n\n // Преобразуем Json в PHP массив\n $itemPlaylist = Zend_Json::decode($strJson);\n // Изменим данные в массиве\n $itemPlaylist['clip_id'] = $video->getId();\n $itemPlaylist['clip_type'] = $video->type;\n $itemPlaylist['url'] = $url;\n $itemPlaylist['title'] = $video->name;\n if (isset($itemPlaylist['cuepoints'])) {\n $cuepoints = $itemPlaylist['cuepoints'];\n $newCuepoints = array();\n foreach ($cuepoints as $cuepoint) {\n if (isset($cuepoint['image'])) {\n $cuepoint['image'] = $this->getUrlRes($pathImages . '/' . ltrim($cuepoint['image'], '/'));\n }\n if (isset($cuepoint['flash'])) {\n $cuepoint['flash'] = $this->getUrlRes($pathFlash . '/' . ltrim($cuepoint['flash'], '/'));\n }\n $newCuepoints[] = $cuepoint;\n }\n $itemPlaylist['cuepoints'] = $newCuepoints;\n }\n } catch (Exception $exc) {\n $jsons = array(\n 'class_message' => 'warning',\n 'messages' => array(\n '<em>' . $this->Translate('Ошибка получения видео') . '</em>',\n Default_Plugin_SysBox::getMessageError($exc)\n )\n );\n $this->sendJson($jsons);\n return;\n }\n } else {\n $itemPlaylist = array();\n $itemPlaylist['clip_id'] = $video->getId();\n $itemPlaylist['clip_type'] = $video->type;\n $itemPlaylist['url'] = $url;\n $itemPlaylist['title'] = $video->name;\n $itemPlaylist['description'] = $video->comment;\n }\n $playlist[] = $itemPlaylist;\n }\n if ($this->_isAjaxRequest) {\n $this->sendJson($playlist);\n }\n } elseif ($type_action == 'godtv_url') {\n\n // Получим параметры клипа\n $clip_name = $params['clip_name'];\n $clip_id = $params['clip_id'];\n\n // Получим файлы видео для сообщения\n $videos = Default_Model_DbTable_BlogPostVideo::GetVideo($this->db, array('post_id' => $post_id));\n // Найдем нужное видео и обновим \"identifier\"\n foreach ($videos as $video) {\n if ($video->getId() == $clip_id) {\n\n // Получим уникальный URL для фильма\n $arrBox = new Default_Plugin_ArrayBox();\n $url_video = $arrBox->set($video->identifier, '/')->getLast();\n // Получим новый URL для этого видео\n $new_url = $this->_getGodtvURL($clip_name, $url_video);\n if ($new_url === FALSE) {\n $jsons = array(\n 'class_message' => 'warning',\n 'messages' => array(\n '<em>' . $this->Translate('Ошибка URL') . '</em>',\n $this->Translate('Ошибка получения URL для видео')\n )\n );\n $this->sendJson($jsons);\n return;\n }\n $video->identifier = $new_url;\n if ($video->save()) {\n $json = array(\n 'url' => $new_url\n );\n } else {\n $json = array(\n 'class_message' => 'warning',\n 'messages' => array(\n '<em>' . $this->Translate('Ошибка при сохранении данных') . '</em>'\n )\n );\n }\n $this->sendJson($json);\n return;\n }\n }\n } elseif ($type_action == 'play') {\n $json = array(\n 'result' => 'OK'\n );\n $this->sendJson($json);\n return;\n }\n }",
"public function get_sample_videoList( $flag = NULL, $fields = array( 'id', 'title', 'embed_url', 'thumbnail_url', 'private', 'type' ), $status, $page_no = 1, $per_page = 10, $search_title )\n {\n switch ( $flag ) {\n case 'all':\n try {\n if ( !empty( $search_title ) ) {\n $result = $this->sample->get( '/videos?sort=relevance', array(\n 'fields' => $fields,\n 'country' => $this->visitorCountry(),\n 'search' => $search_title,\n 'page' => ( $page_no ),\n 'limit' => ( $per_page )\n ) );\n } else {\n $result = $this->sample->get( '/videos?filters=creative-official', array(\n 'fields' => $fields,\n 'country' => $this->visitorCountry(),\n 'page' => ( $page_no ),\n 'limit' => ( $per_page )\n ) );\n }\n if ( isset( $result['list'] ) && !empty( $result['list'] ) ) {\n foreach ( $result['list'] as $key => $media ) {\n $this->returndata['videos'][$key]['id'] = !empty( $media['id'] ) ? $media['id'] : null;\n $this->returndata['videos'][$key]['title'] = !empty( $media['title'] ) ? $media['title'] : null;\n $this->returndata['videos'][$key]['embed_url'] = !empty( $media['embed_url'] ) ? $media['embed_url'] : null;\n $this->returndata['videos'][$key]['thumbnail_url'] = !empty( $media['thumbnail_url'] ) ? $media['thumbnail_url'] : null;\n $this->returndata['videos'][$key]['description'] = !empty( $media['description'] ) ? $media['description'] : null;\n $this->returndata['videos'][$key]['views_total'] = !empty( $media['views_total'] ) ? $media['views_total'] : 0;\n $this->returndata['videos'][$key]['tags'] = !empty( $media['tags'] ) ? $media['tags'] : null;\n $this->returndata['videos'][$key]['channel.name'] = !empty( $media['channel.name'] ) ? $media['channel.name'] : null;\n $this->returndata['videos'][$key]['created_time'] = !empty( $media['created_time'] ) ? $media['created_time'] : null;\n $this->returndata['videos'][$key]['duration'] = !empty( $media['duration'] ) ? $media['duration'] : null;\n $this->returndata['videos'][$key]['owner.screenname'] = !empty( $media['owner.screenname'] ) ? $media['owner.screenname'] : null;\n $this->returndata['videos'][$key]['private'] = !empty( $media['private'] ) ? $media['private'] : null;\n }\n $this->returndata['total_record'] = !empty( $result['total'] ) ? $result['total'] : null;\n $this->returndata['has_more'] = !empty( $result['has_more'] ) ? $result['has_more'] : null;\n }\n return ( $this->returndata );\n }\n catch ( Exception $e ) {\n $this->log_error( $e->getMessage() . ' in class.sample.php function name get_sample_videoList all video', 'phparray', $e->getLine(), $e->getFile() );\n }\n break;\n case 'me':\n try {\n if ( !empty( $search_title ) && $status != 'all') {\n $result = $this->sample->get( '/me/videos?sort=relevance', array(\n 'fields' => $fields,\n 'page' => ( $page_no ),\n 'limit' => ( $per_page ),\n 'search' => $search_title,\n 'private' => $status,\n ) );\n } else if( !empty( $search_title ) && $status == 'all') {\n $result = $this->sample->get( '/me/videos?sort=relevance', array(\n 'fields' => $fields,\n 'page' => ( $page_no ),\n 'search' => $search_title,\n 'limit' => ( $per_page )\n ) );\n } else if(empty( $search_title ) && $status == 'all') {\n $result = $this->sample->get( '/me/videos?filters=creative-official', array(\n 'fields' => $fields,\n 'page' => ( $page_no ),\n 'limit' => ( $per_page )\n ) );\n } else if ( empty( $search_title ) && $status != 'all') {\n $result = $this->sample->get( '/me/videos?filters=creative-official', array(\n 'fields' => $fields,\n 'page' => ( $page_no ),\n 'limit' => ( $per_page ),\n 'private' => $status\n ) );\n }\n //print '<pre>'; print_r($result); print '</pre>';\n if ( isset( $result['list'] ) && !empty( $result['list'] ) ) {\n foreach ( $result['list'] as $key => $media ) {\n $this->returndata['videos'][$key]['id'] = !empty( $media['id'] ) ? $media['id'] : null;\n $this->returndata['videos'][$key]['title'] = !empty( $media['title'] ) ? $media['title'] : null;\n $this->returndata['videos'][$key]['embed_url'] = !empty( $media['embed_url'] ) ? $media['embed_url'] : null;\n $this->returndata['videos'][$key]['thumbnail_url'] = !empty( $media['thumbnail_url'] ) ? $media['thumbnail_url'] : null;\n $this->returndata['videos'][$key]['description'] = !empty( $media['description'] ) ? $media['description'] : null;\n $this->returndata['videos'][$key]['views_total'] = !empty( $media['views_total'] ) ? $media['views_total'] : 0;\n $this->returndata['videos'][$key]['tags'] = !empty( $media['tags'] ) ? $media['tags'] : null;\n $this->returndata['videos'][$key]['channel.name'] = !empty( $media['channel.name'] ) ? $media['channel.name'] : null;\n $this->returndata['videos'][$key]['created_time'] = !empty( $media['created_time'] ) ? $media['created_time'] : null;\n $this->returndata['videos'][$key]['duration'] = !empty( $media['duration'] ) ? $media['duration'] : null;\n $this->returndata['videos'][$key]['owner.screenname'] = !empty( $media['owner.screenname'] ) ? $media['owner.screenname'] : null;\n $this->returndata['videos'][$key]['private'] = !empty( $media['private'] ) ? $media['private'] : null;\n $this->returndata['videos'][$key]['published'] = !empty( $media['published'] ) ? $media['published'] : null;\n }\n //$this->returndata['total_record'] = $result['total'];\n $this->returndata['has_more'] = $result['has_more'];\n }\n return ( $this->returndata );\n }\n catch ( Exception $e ) {\n $this->log_error( $e->getMessage() . ' in class.sample.php function name get_sample_videoList me video', 'phparray', $e->getLine(), $e->getFile() );\n }\n break;\n case 'commented':\n try {\n if ( !empty( $search_title ) && $status != 'all') {\n $result = $this->sample->get( '/me/videos?sort=relevance', array(\n 'fields' => $fields,\n 'page' => ( $page_no ),\n 'limit' => ( $per_page ),\n 'search' => $search_title,\n 'sort' => 'commented',\n 'private' => $status,\n ) );\n } else if( !empty( $search_title ) && $status == 'all') {\n $result = $this->sample->get( '/me/videos?sort=relevance', array(\n 'fields' => $fields,\n 'page' => ( $page_no ),\n 'search' => $search_title,\n 'limit' => ( $per_page ),\n 'sort' => 'commented'\n ) );\n } else if(empty( $search_title ) && $status == 'all') {\n $result = $this->sample->get( '/me/videos?filters=creative-official', array(\n 'fields' => $fields,\n 'page' => ( $page_no ),\n 'limit' => ( $per_page ),\n 'sort' => 'commented'\n ) );\n } else if ( empty( $search_title ) && $status != 'all') {\n $result = $this->sample->get( '/me/videos?filters=creative-official', array(\n 'fields' => $fields,\n 'page' => ( $page_no ),\n 'limit' => ( $per_page ),\n 'private' => $status,\n 'sort' => 'commented'\n ) );\n }\n if ( isset( $result['list'] ) && !empty( $result['list'] ) ) {\n foreach ( $result['list'] as $key => $media ) {\n $this->returndata['videos'][$key]['id'] = !empty( $media['id'] ) ? $media['id'] : null;\n $this->returndata['videos'][$key]['title'] = !empty( $media['title'] ) ? $media['title'] : null;\n $this->returndata['videos'][$key]['embed_url'] = !empty( $media['embed_url'] ) ? $media['embed_url'] : null;\n $this->returndata['videos'][$key]['thumbnail_url'] = !empty( $media['thumbnail_url'] ) ? $media['thumbnail_url'] : null;\n $this->returndata['videos'][$key]['description'] = !empty( $media['description'] ) ? $media['description'] : null;\n $this->returndata['videos'][$key]['views_total'] = !empty( $media['views_total'] ) ? $media['views_total'] : 0;\n $this->returndata['videos'][$key]['tags'] = !empty( $media['tags'] ) ? $media['tags'] : null;\n $this->returndata['videos'][$key]['channel.name'] = !empty( $media['channel.name'] ) ? $media['channel.name'] : null;\n $this->returndata['videos'][$key]['created_time'] = !empty( $media['created_time'] ) ? $media['created_time'] : null;\n $this->returndata['videos'][$key]['duration'] = !empty( $media['duration'] ) ? $media['duration'] : null;\n $this->returndata['videos'][$key]['owner.screenname'] = !empty( $media['owner.screenname'] ) ? $media['owner.screenname'] : null;\n $this->returndata['videos'][$key]['private'] = !empty( $media['private'] ) ? $media['private'] : null;\n $this->returndata['videos'][$key]['published'] = !empty( $media['published'] ) ? $media['published'] : null;\n }\n //$this->returndata['total_record'] = $result['total'];\n $this->returndata['has_more'] = $result['has_more'];\n }\n return ( $this->returndata );\n }\n catch ( Exception $e ) {\n $this->log_error( $e->getMessage() . ' in class.sample.php function name get_sample_videoList comented video', 'phparray', $e->getLine(), $e->getFile() );\n }\n break;\n case 'rated':\n try {\n if ( !empty( $search_title ) && $status != 'all') {\n $result = $this->sample->get( '/me/videos?sort=relevance', array(\n 'fields' => $fields,\n 'page' => ( $page_no ),\n 'limit' => ( $per_page ),\n 'search' => $search_title,\n 'sort' => 'rated',\n 'private' => $status,\n ) );\n } else if( !empty( $search_title ) && $status == 'all') {\n $result = $this->sample->get( '/me/videos?sort=relevance', array(\n 'fields' => $fields,\n 'page' => ( $page_no ),\n 'search' => $search_title,\n 'limit' => ( $per_page ),\n 'sort' => 'rated'\n ) );\n } else if(empty( $search_title ) && $status == 'all') {\n $result = $this->sample->get( '/me/videos?filters=creative-official', array(\n 'fields' => $fields,\n 'page' => ( $page_no ),\n 'limit' => ( $per_page ),\n 'sort' => 'rated'\n ) );\n } else if ( empty( $search_title ) && $status != 'all') {\n $result = $this->sample->get( '/me/videos?filters=creative-official', array(\n 'fields' => $fields,\n 'page' => ( $page_no ),\n 'limit' => ( $per_page ),\n 'private' => $status,\n 'sort' => 'rated'\n ) );\n }\n if ( isset( $result['list'] ) && !empty( $result['list'] ) ) {\n foreach ( $result['list'] as $key => $media ) {\n $this->returndata['videos'][$key]['id'] = !empty( $media['id'] ) ? $media['id'] : null;\n $this->returndata['videos'][$key]['title'] = !empty( $media['title'] ) ? $media['title'] : null;\n $this->returndata['videos'][$key]['embed_url'] = !empty( $media['embed_url'] ) ? $media['embed_url'] : null;\n $this->returndata['videos'][$key]['thumbnail_url'] = !empty( $media['thumbnail_url'] ) ? $media['thumbnail_url'] : null;\n $this->returndata['videos'][$key]['description'] = !empty( $media['description'] ) ? $media['description'] : null;\n $this->returndata['videos'][$key]['views_total'] = !empty( $media['views_total'] ) ? $media['views_total'] : 0;\n $this->returndata['videos'][$key]['tags'] = !empty( $media['tags'] ) ? $media['tags'] : null;\n $this->returndata['videos'][$key]['channel.name'] = !empty( $media['channel.name'] ) ? $media['channel.name'] : null;\n $this->returndata['videos'][$key]['created_time'] = !empty( $media['created_time'] ) ? $media['created_time'] : null;\n $this->returndata['videos'][$key]['duration'] = !empty( $media['duration'] ) ? $media['duration'] : null;\n $this->returndata['videos'][$key]['owner.screenname'] = !empty( $media['owner.screenname'] ) ? $media['owner.screenname'] : null;\n $this->returndata['videos'][$key]['private'] = !empty( $media['private'] ) ? $media['private'] : null;\n $this->returndata['videos'][$key]['published'] = !empty( $media['published'] ) ? $media['published'] : null;\n }\n //$this->returndata['total_record'] = $result['total'];\n $this->returndata['has_more'] = $result['has_more'];\n }\n return ( $this->returndata );\n }\n catch ( Exception $e ) {\n $this->log_error( $e->getMessage() . ' in class.sample.php function name get_sample_videoList rated video', 'phparray', $e->getLine(), $e->getFile() );\n }\n break;\n case 'visited':\n try {\n if ( !empty( $search_title ) && $status != 'all') {\n $result = $this->sample->get( '/me/videos?sort=relevance', array(\n 'fields' => $fields,\n 'page' => ( $page_no ),\n 'limit' => ( $per_page ),\n 'search' => $search_title,\n 'sort' => 'visited',\n 'private' => $status,\n ) );\n } else if( !empty( $search_title ) && $status == 'all') {\n $result = $this->sample->get( '/me/videos?sort=relevance', array(\n 'fields' => $fields,\n 'page' => ( $page_no ),\n 'search' => $search_title,\n 'limit' => ( $per_page ),\n 'sort' => 'visited'\n ) );\n } else if(empty( $search_title ) && $status == 'all') {\n $result = $this->sample->get( '/me/videos?filters=creative-official', array(\n 'fields' => $fields,\n 'page' => ( $page_no ),\n 'limit' => ( $per_page ),\n 'sort' => 'visited'\n ) );\n } else if ( empty( $search_title ) && $status != 'all') {\n $result = $this->sample->get( '/me/videos?filters=creative-official', array(\n 'fields' => $fields,\n 'page' => ( $page_no ),\n 'limit' => ( $per_page ),\n 'private' => $status,\n 'sort' => 'visited'\n ) );\n }\n if ( isset( $result['list'] ) && !empty( $result['list'] ) ) {\n foreach ( $result['list'] as $key => $media ) {\n $this->returndata['videos'][$key]['id'] = !empty( $media['id'] ) ? $media['id'] : null;\n $this->returndata['videos'][$key]['title'] = !empty( $media['title'] ) ? $media['title'] : null;\n $this->returndata['videos'][$key]['embed_url'] = !empty( $media['embed_url'] ) ? $media['embed_url'] : null;\n $this->returndata['videos'][$key]['thumbnail_url'] = !empty( $media['thumbnail_url'] ) ? $media['thumbnail_url'] : null;\n $this->returndata['videos'][$key]['description'] = !empty( $media['description'] ) ? $media['description'] : null;\n $this->returndata['videos'][$key]['views_total'] = !empty( $media['views_total'] ) ? $media['views_total'] : 0;\n $this->returndata['videos'][$key]['tags'] = !empty( $media['tags'] ) ? $media['tags'] : null;\n $this->returndata['videos'][$key]['channel.name'] = !empty( $media['channel.name'] ) ? $media['channel.name'] : null;\n $this->returndata['videos'][$key]['created_time'] = !empty( $media['created_time'] ) ? $media['created_time'] : null;\n $this->returndata['videos'][$key]['duration'] = !empty( $media['duration'] ) ? $media['duration'] : null;\n $this->returndata['videos'][$key]['owner.screenname'] = !empty( $media['owner.screenname'] ) ? $media['owner.screenname'] : null;\n $this->returndata['videos'][$key]['private'] = !empty( $media['private'] ) ? $media['private'] : null;\n $this->returndata['videos'][$key]['published'] = !empty( $media['published'] ) ? $media['published'] : null;\n }\n //$this->returndata['total_record'] = $result['total'];\n $this->returndata['has_more'] = $result['has_more'];\n }\n return ( $this->returndata );\n }\n catch ( Exception $e ) {\n $this->log_error( $e->getMessage() . ' in class.sample.php function name get_sample_videoList visited video', 'phparray', $e->getLine(), $e->getFile() );\n }\n break;\n }\n }",
"public function popularVideos(){\n $search_url = \"videos?part=snippet&order=relevance&chart=mostPopular&videoDefinition=high&videoEmbeddable=true&key={$this->api_key}\";\n $client = new Client($this->base_url);\n $request = $client->get($search_url);\n $response = $request->send();\n $videos = $response->json();\n $video_items = $videos[\"items\"];\n\n $formatted_response = array();\n foreach($video_items as $video_item){\n $video = new Video;\n $video->url = \"https://www.youtube.com/watch?v=\".$video_item[\"id\"];\n $video->name = $video_item[\"snippet\"][\"title\"];\n $video->picture= $video_item[\"snippet\"][\"thumbnails\"][\"high\"][\"url\"];\n $video->type= \"youtube\";\n $video->id = $video_item[\"id\"];\n array_push($formatted_response, $video->toArray());\n }\n return Response::json($formatted_response,200);\n }",
"public function videoAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $items = $em->getRepository('AppBundle:Item')->findBy(array('type' => 'video'));\n\n return $this->render('item/video_list.html.twig', array(\n 'items' => $items,\n ));\n }",
"public function testListLiveVideos()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function videos(Request $request, $channel = null)\n {\n $id = $request->input('id', 'false');\n\n if (empty($channel)) {\n $nb = new Nightbot($request);\n if (empty($nb->channel)) {\n return Helper::text(__('generic.channel_name_required'));\n }\n\n $channel = $nb->channel['providerId'];\n $id = 'true';\n }\n\n if ($id !== 'true') {\n try {\n $channel = $this->userByName($channel)->id;\n } catch (Exception $e) {\n return Helper::text($e->getMessage());\n }\n }\n\n $limit = intval($request->input('limit', 1));\n $broadcastTypes = $request->input('broadcast_type', 'archive');\n $separator = $request->input('separator', ' | ');\n $format = $request->input('video_format', '${title} - ${url}');\n\n if ($limit > 100 || $limit < 1) {\n $limitError = __('twitch.invalid_limit_parameter', [\n 'min' => '1',\n 'max' => '100',\n ]);\n\n return Helper::text($limitError);\n }\n\n $formattedVideos = [];\n try {\n $videos = $this->api->channelVideos($channel, $broadcastTypes, $limit);\n\n foreach ($videos as $video) {\n $formattedVideos[] = str_replace(['${title}', '${url}'], [$video['title'], $video['url']], $format);\n }\n }\n catch (TwitchApiException $ex)\n {\n return Helper::text('[Error from Twitch API] ' . $ex->getMessage());\n }\n catch (Exception $ex)\n {\n return Helper::text(__('twitch.error_loading_data_api'));\n }\n\n if (count($formattedVideos) === 0) {\n return Helper::text(__('twitch.end_of_video_list'));\n }\n\n return Helper::text(implode($separator, $formattedVideos));\n }",
"public function indexAction() {\n\t if($this->settings['channel']) {\n\t $videos = $this->videoRepository->getUserUploads($this->settings['channel']); \n } else {\n $this->videoRepository->setQuery($this->settings);\n $queryUrl = $this->videoRepository->getQueryUrl(); \n\t\t $videos = $this->videoRepository->getVideos($query); \n\t\t $this->view->assign('query', $queryUrl);\n } \n\t\t$this->view->assign('videos', $videos);\n\t\tif($this->settings['singlePageOnListPage']) {\n\t\t $comments = $this->videoRepository->getComments($videos[0][vid]);\n\t\t $this->view->assign('comments', $comments);\n $this->response->addAdditionalHeaderData('\n <style>\n .tx-youtubeapi-video-list {\n \t\t\tfloat:left;\t\n \t\t\twidth:50%;\n \t\t\tpadding:0.5em;\n \t\t}\n \t\t\n \t\t.tx-youtubeapi-video-single {\n \t\t\tpadding:0.5em;\n \t\t}\n \t\t\n \t\t.tx-pagebrowse-pi1 {\n clear: both;\n }\n </style>');\n }\n \n\t\t$this->view->assign('settings', $this->settings);\n\t}",
"public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n $entities = $em->getRepository('PolmediaBundle:Video')->getAllVideos();\n return array(\n 'entities' => $entities,\n );\n }",
"public function vod_videos_list(Request $request) {\n\n $take = $request->take ? $request->take : Setting::get('admin_take_count');\n\n $query = VodVideo::vodResponse()->orderBy('created_at', 'desc')->skip($request->skip)\n ->take($take);\n\n if ($request->status) {\n\n $query->where('user_id', $request->id);\n\n } else {\n\n $query->where('vod_videos.status', DEFAULT_TRUE)\n ->where('vod_videos.admin_status', DEFAULT_TRUE)\n ->where('vod_videos.publish_status', VIDEO_PUBLISHED);\n\n }\n\n if ($request->video_id) {\n\n $query->where('vod_videos.unique_id', '!=',$request->video_id);\n }\n\n $model = $query->get();\n\n $data = [];\n\n $user = $request->id ? User::find($request->id) : '';\n\n foreach ($model as $key => $value) {\n\n $share_link = Setting::get('ANGULAR_URL').'vod/single?title='.$value->title;\n\n $ppv_status = ($value->user_id == $request->id) ? true : UserRepo::pay_per_views_status_check($user ? $request->id : '', $user ? $user->user_type : 0, $value);\n \n $data[] = [\n 'user_id'=>$value->user_id,\n 'user_name'=>$value->user_name,\n 'user_picture'=>$value->user_picture,\n 'vod_id'=>$value->vod_id,\n 'title'=>$value->title,\n 'description'=>$value->description,\n 'image'=>$value->image,\n 'video'=>$value->video,\n 'amount'=>$value->amount,\n 'type_of_subscription'=>$value->type_of_subscription,\n 'type_of_user'=>$value->type_of_user,\n 'created_at'=>$value->created_at->diffForhumans(),\n 'status'=>$value->status,\n 'admin_status'=>$value->admin_status,\n 'ppv_status'=> $ppv_status['success'] ?? false,\n 'ppv_details'=>$ppv_status,\n 'publish_time'=>$value->publish_time,\n 'publish_status'=>$value->publish_status,\n 'currency'=>Setting::get('currency'),\n 'unique_id'=>$value->unique_id,\n 'share_link'=>$share_link\n \n ];\n\n }\n\n $response_array = ['success'=>true, 'data'=>$data];\n \n return response()->json($response_array); \n\n }",
"public function getPlaylistVideos(){\n\t\t// init Video class\n\t\t$playlist = new Playlist($this->db);\n\t\t$playlist->playlist_id = $this->get_params['id'];\n\t\t$stmt = $playlist->getOne();\n\t\t// data will be fetched, store into a result and send with a HTTP response\n\t\t$this->return_data($stmt);\n\t}",
"function kcw_movies_get_vimeo_videos($token, $user, $folderid, $page = 1, $per_page = 24) {\n $url = \"https://api.vimeo.com/users/\".$user.\"/folders/\".$folderid.\"/videos?page=\".$page.\"&per_page=\".$per_page;\n //$url .= \"&fields=total,page,per_page,paging,data[]\";\n $header = kcw_movies_get_header($token, kcw_movies_get_vimeo_accept());\n $res = kcw_movies_do_get($url, $header, null);\n return kcw_movies_parse_vimeo_array($res);\n}",
"public function getVideosForPagination($page = 1, $per_page = 100);",
"function get_all_videos_lists() {\n \n $offset = (int)get_input('offset', 0);\n$limit = (int)get_input('limit', 10); \n \n $options = array(\n\t'type' => 'object',\n\t'subtype' => 'video',\n\t'limit' => $limit,\n\t'offset' => $offset,\n\t'full_view' => false,\n\t'list_type_toggle' => false,\n\t'no_results' => elgg_echo('video:notfound'),\n\t\n\t);\n\n $getter = 'elgg_get_entities';\n $entities = call_user_func($getter, $options); \n \n return $entities;\n}",
"protected function get_videos()\n {\n //Authenticate\n $this->authenticate();\n \n //Set some starting variables\n $current = 0;\n $end = false;\n $xml = null;\n \n //Find the max pages\n $page = ($this->page == 1) ? 0 : $this->page;\n $max = floor(($this->max_per / $this->per_page) + $page);\n \n //Loop thru all videos to find every public and domain restricted video\n for ($this->page; $this->page <= $max; $this->page++) {\n \n //Get your videos, 100 at a time\n $videos = parent::viddler_videos_getByUser(array(\n 'sessionid' => $this->sessionid,\n 'page' => $this->page,\n 'per_page' => $this->per_page,\n 'visibility' => 'public,embed',\n ));\n \n //Log any errors\n if (isset($videos['error'])) {\n $this->log_error($videos);\n }\n \n /**\n :: Start putting videos in xml variable\n :: Documentation: http://support.google.com/webmasters/bin/answer.py?hl=en&answer=80472\n **/\n $videos = (isset($videos['list_result']['video_list'])) ? $videos['list_result']['video_list'] : array();\n foreach ($videos as $k => $video) {\n $embed = (isset($video['permissions']['embed']) && $video['permissions']['embed'] != 'private') ? 'yes' : 'no';\n $download = (isset($video['permissions']['download']) && $video['permissions']['download'] != 'private') ? true : false;\n \n $xml .= '<url>';\n $xml .= '<loc>' . $video['permalink'] . '</loc>';\n $xml .= '<video:video>';\n $xml .= '<video:thumbnail_loc>http://www.viddler.com/thumbnail/' . $video['id'] . '</video:thumbnail_loc>';\n $xml .= '<video:title>' . htmlspecialchars($video['title'], ENT_QUOTES, 'UTF-8') . '</video:title>';\n $xml .= '<video:description>' . htmlspecialchars($video['description'], ENT_QUOTES, 'UTF-8') . '</video:description>';\n \n //If downloads for this content are not private, allow this param\n if ($download === true) {\n $xml .= '<video:content_loc>' . $video['files'][1]['url'] . '</video:content_loc>';\n }\n \n $xml .= '<video:player_loc allow_embed=\"' . $embed . '\">http://www.viddler.com/embed/' . $video['id'] . '</video:player_loc>';\n $xml .= '<video:duration>' . $video['length'] . '</video:duration>';\n $xml .= '<video:view_count>' . $video['view_count'] . '</video:view_count>';\n $xml .= '<video:publication_date>' . date('Y-m-d', $video['upload_time']) . '</video:publication_date>';\n $xml .= '<video:family_friendly>yes</video:family_friendly>';\n $xml .= '<video:live>no</video:live>';\n $xml .= '</video:video>';\n $xml .= '</url>';\n $current += 1;\n $this->stats['total_videos_indexed'] = (isset($this->stats['total_videos_indexed'])) ? $this->stats['total_videos_indexed'] + 1 : 1;\n \n if ($current >= $this->max_per) {\n break;\n }\n }\n \n //Figure if we should kill the loop (no more videos)\n if (count($videos) < $this->per_page || $current >= $this->max_per) {\n break;\n }\n \n }\n \n //Write the current sitemap file\n $this->write_sitemap($xml);\n \n //If broke out because we hit the 50,000 video max, start again at next interval and increment sitemap filename\n if ($current >= $this->max_per) { \n $this->total_per += 1;\n $find = ($this->total_per > 1) ? '-' . ($this->total_per - 1) . '.xml' : '.xml';\n $current = 0;\n $this->create($this->sitemap_path, str_replace($find, '-' . $this->total_per . '.xml', $this->filename), $this->page + 1);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return male products. Optionally filter by category. | function male(Request $request){
$where_clause= '(sub_section LIKE "male" OR sub_section LIKE "unisex") AND (';
// Check for filters
// Check if category filter is active
if($request->category != null){
foreach($request->category as $key => $category){
if($key == 0){
$where_clause= $where_clause . "category LIKE ?";
}
else{
$where_clause= $where_clause . " OR category LIKE ?";
}
}
// Closing Parenthesis for where
$where_clause= $where_clause . ")";
//Parameters to inject
$where_params= (\is_array($request->category)) ? $request->category : [$request->category];
// Pull matched products
$products= Product::whereRaw($where_clause, $where_params)->paginate();
// Append category query string to generated pagination links
$query_string= ["category" => $request->category];
$products->appends($query_string);
// Return requested products
return view("multi_products", ["page_name"=> "Men's Clothing", "page_route"=> "male", "products"=> $products, "query_string"=> $query_string]);
}
// No filters
else{
// Get all male products
$products= Product::where("sub_section", "male")->paginate();
return view("multi_products", ["page_name"=> "Men's Clothing", "page_route"=> "male", "products"=> $products]);
}
} | [
"private function getProductsByGenderCategory()\n {\n\n $this->m_all_products = $this->m_loaded_model->countProductsByGenderCategory($this->m_tags[0]);\n\n /*\n Pagination properties\n * $this->m_data['total_records'] (Total number of items paginated)\n * $this->m_data['records_per_page'] (Number of items to be displayed per page)\n * $this->m_data['pagination_url'] (URL to the current page.)\n */\n $this->m_data['total_records'] = ($this->m_all_products['counter']);\n $this->m_data['records_per_page'] = 6;\n if (!$this->m_tags) {\n $this->m_data['pagination_url'] = $this->m_base_url . $this->m_product_category_name;\n } else {\n $this->m_data['pagination_url'] = $this->m_base_url . $this->m_product_category_name . '/' . implode('/', $this->m_tags);\n }\n\n $this->m_pagination = new Pagination($this->m_data);\n\n $this->m_pager = $this->m_pagination->PaginationDisplay($this->m_data);\n\n $this->m_start_record = $this->m_pagination->StartRecord($this->m_data);\n $this->m_records_per_page = $this->m_data['records_per_page'];\n\n $this->m_category_products = $this->m_loaded_model->getProductsByGender($this->m_start_record, $this->m_records_per_page, $this->m_tags[0]);\n\n include_once VIEWS . 'templates/layouts/products-layout.php';\n\n return $this->m_content_builder;\n }",
"function female(Request $request){\n\n $where_clause= '(sub_section LIKE \"female\" OR sub_section LIKE \"unisex\") AND (';\n\n // Check for filters\n // Check if category filter is active\n if($request->category != null){\n\n foreach($request->category as $key => $category){\n if($key == 0){\n $where_clause= $where_clause . \"category LIKE ?\";\n }\n else{\n $where_clause= $where_clause . \" OR category LIKE ?\";\n }\n }\n \n // Closing Parenthesis for where\n $where_clause= $where_clause . \")\";\n\n //Parameters to inject\n $where_params= (\\is_array($request->category)) ? $request->category : [$request->category];\n\n // Pull matched products\n $products= Product::whereRaw($where_clause, $where_params)->paginate();\n\n // Append category query string to generated pagination links\n $query_string= [\"category\" => $request->category];\n $products->appends($query_string);\n \n // Return requested products\n return view(\"multi_products\", [\"page_name\"=> \"Women's Clothing\", \"page_route\"=> \"female\", \"products\"=> $products, \"query_string\"=> $query_string]);\n } \n\n // No filters\n else{\n // Get all female products\n $products= Product::where(\"sub_section\", \"female\")->paginate();\n\n return view(\"multi_products\", [\"page_name\"=> \"Women's Clothing\", \"page_route\"=> \"female\", \"products\"=> $products]);\n }\n }",
"public function getByGender()\n\t{\n\t\t$data = Functions::getDataFromClient();\n\t\tif ($data['gender']) {\n\t\t\t$gender = $data['gender'];\n\t\t\t$table = Category::$table;\n\t\t\t$paramsGenderCondition = [\n\t\t\t\t'gender' => $gender\n\t\t\t];\n\n\t\t\t$catesByGender = Category::getByParams(['*'], $paramsGenderCondition);\n\t\t\tforeach($catesByGender as $key => $cate) {\n\t\t\t\t$paramsGetFields = ['id', 'name', 'price', 'image'];\n\t\t\t\t$paramsConditions = [\n\t\t\t\t\t'category_id' => $cate->id\n\t\t\t\t];\n\t\t\t\n\t\t\t\t$product_details = ProductDetail::getByParams($paramsGetFields, $paramsConditions);\n\t\t\t\t$catesByGender[$key]->products = $product_details;\n\t\t\t}\n\t\t\t$success = \"Success\";\n\t\t\t$failure = \"Failure\";\n\t\t\tFunctions::returnAPI($catesByGender, $success, $failure);\n\t\t} else {\n\t\t\t$failure = \"Missing params\";\n\t\t\tFunctions::returnAPI([], \"\", $failure);\n\t\t}\n\t}",
"function maleCategories(){\n\n $male_products= Product::where(\"sub_section\", \"male\")->orWhere(\"sub_section\", \"unisex\")->get();\n\n $male_product_categories= $male_products->map(function($product){\n return $product->category;\n });\n\n $male_product_categories= $male_product_categories->unique();\n\n return response()->json($male_product_categories);\n\n }",
"public function filterCategory($category);",
"public function getCategoriesByCatalog() \n\t{\n\t\t$table = Category::$table;\n\t\t$sqlMale = \"select * from {$table} where gender='male'\";\n\t\t$catesByMale = Category::query($sqlMale);\n\n\t\t$sqlFemale = \"select * from {$table} where gender='female'\";\n\t\t$catesByFemale = Category::query($sqlFemale);\n\n\t\t$data = [\n\t\t\t\"male\" => $catesByMale,\n\t\t\t\"female\" => $catesByFemale\n\t\t];\n\t\t$success = \"Success\";\n\t\t$failure = \"Failure\";\n\t\tFunctions::returnAPI($data, $success, $failure);\n\t}",
"public function get_all_products_by_gender($where = '', $sort_by = ''){\n\t\t\t$column = 'name';\n\t\t\t$order = 'ASC';\n\t\t\t\n\t\t\tif( strpos($sort_by, '-' ) !== false ) {\n\t\t\t\t$sort = explode('-', $sort_by, 2);\n\t\t\t\t$column = $sort[0];\n\t\t\t\t$order = $sort[1];\n\t\t\t\t\t\t\n\t\t\t\tif($order == 'ascending'){\n\t\t\t\t\t$order = 'ASC';\n\t\t\t\t}else{\n\t\t\t\t\t$order = 'DESC';\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tif($column == 'created'){\n\t\t\t\t\t$column = 'date_added';\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tif($column == 'best'){\n\t\t\t\t\t$column = 'id';\n\t\t\t\t\t$order = 'ASC';\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t\tif($sort_by == 'featured'){\n\t\t\t\t$column = 'id';\n\t\t\t\t$order = 'ASC';\n\t\t\t}\n\t\t\t\n\t\t\tif(!empty($where)){\n\t\t\t\t$this->db->where($where);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//$this->db->limit($limit, $offset);\n\t\t\t//$this->db->order_by('id','DESC');\n\t\t\t//$this->db->order_by('name','ASC');\n\t\t\t$this->db->order_by($column,$order);\t\t\n\t\t\t$query = $this->db->get('products');\n\t\t\tif($query->num_rows() > 0){\n\n\t\t\t\tforeach ($query->result() as $row){\n\t\t\t\t\t$data[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $data;\n\t\t\t}\n\t\t\treturn false;\n\t\t}",
"public function viewIngredientCategories($category) { \n\n if($category == 'allCategories') {\n $ingredients = DB::table('ingredients')\n ->orderBy('ingredientName')\n ->get();\n } else {\n $ingredients = DB::table('ingredients')\n ->where('ingredientCategory', '=', $category)\n ->orderBy('ingredientName')\n ->get();\n }\n\n return $ingredients;\n }",
"protected function productsFilterByCategory()\n\t{\n\t\t$this->adapter->joinProductFilter ();\n\t\t//add category information\n\t\t$this->adapter->joinCategoryFlat ();\n\t\t\n\t\tif(!$this->loadAllProductCategoriesCondition())\n\t\t{\n\t\t\t//one category per product\n\t\t\t$this->adapter->joinExportCategoryProductMaxLevel ();\n\t\t\t$this->adapter->groupByProduct ();\n\t\t}\n\t\t$this->adapter->orderByCategory ();\n\t\t$this->adapter->joinTaxonomy();\n\t\t$this->adapter->joinParentCategory();\n\t}",
"public function getProductosFiltroCategoria($categoria){\n $pdo=self::getConexion();\n $sql=\"SELECT * FROM Productos WHERE categoria=? ORDER BY nombre\";\n $consulta=$pdo->prepare($sql);\n $consulta->execute([$categoria]);\n $resultado=$consulta->fetch(PDO::FETCH_ASSOC);\n return $resultado;\n }",
"public static function getManufacturerFilter() {\n $pArr = self::__getProductsListingData();\n \n return $pArr['mfgFilter'];\n }",
"public function filter_by_category(){\n\t\t$check = 0;\n\t\t$where = '(';\n\t\t$categories = $this->product->categories;\n\t\tforeach ($categories as $category) {\n\t\t\t$this->session->unset_userdata($category);\n\t\t\tif($this->input->post($category)){\n\t\t\t\t$check++;\n\t\t\t\t$this->session->set_flashdata($category,$category);\n\t\t\t\t$this->db->escape($category);\n\t\t\t\t$where .= \"category = '\".$category.\"' OR \";\n\t\t\t} \n\t\t}\n\t\tif($check > 0){\n\t\t\t$where = substr($where,0,strlen($where) - 3);\n\t\t\treturn $where .= \")\";\n\t\t}\n\t}",
"protected function _filtered() {\n\t\tif (!empty($this->params['category'])) {\n\t\t\treturn 'category';\n\t\t}\n\t\treturn false;\n\t}",
"function getProductList($category) {\n}",
"public static function get_products($category)\n {\n $products = Product::findByCategory($category);\n\n foreach ($products as $product) {\n $ingredients = Product::findIngredients($product->id);\n\n if ($product->category != 'Juoma') {\n $product->price = Ingredient::count_total_price($ingredients);\n }\n\n $product->ingredients = $ingredients;\n }\n\n $ingredients = Ingredient::findByCategory($category);\n\n View::make('product/list.html', array('products' => $products,\n 'ingredients' => $ingredients, 'category' => $category, ));\n }",
"public function getProductByFilter($filter)\r\n\t{\r\n\t\tif(!empty($filter))\r\n\t\t{\r\n\t\t\t$sql= new Sql($this->adapter);\r\n\t\t\t$select = $sql->select('products')->where(\"category_id=$filter\");\r\n\t\t\t$st = $sql->prepareStatementForSqlObject($select)->execute();\r\n\t\t\t$rs = new ResultSet();\r\n\t\t\treturn $rs->initialize($st)->buffer()->toArray();\r\n\t\t}\r\n\t}",
"function similarProducts() {\n $filter = Yii::$app->session->get('filterOption');\n }",
"public function onFilterProducts()\n {\n $filters = [];\n $filters = post();\n $categoryId = post( 'category-id' );\n $attributes = Request::input( 'attributes' );\n\n if (empty(array_filter( $attributes ))) $this->setDefaults(); // no values in arrayd\n else\n $ids = Product::listFrontEnd( $attributes, $categoryId )->pluck('id')->all();\n\n $this->brands = Brand::ordered()->with(['products'=> function( $query ) use ( $ids){\n $query->whereIn( 'id',$ids );\n }])->get( );\n\n }",
"public function filterByCategory($category)\n {\n return $this->createQueryBuilder('u')\n ->leftJoin('u.training', 't')\n ->addSelect('t')\n ->leftJoin('t.category', 'ca')\n ->addSelect('ca')\n ->leftJoin('t.city', 'ci')\n ->addSelect('ci')\n ->leftJoin('u.feedbackTo', 'f')\n ->addSelect('f')\n ->where('ca.title = :category')\n ->setParameter(':category', $category)\n ->getQuery()->getArrayResult();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Displays a form to create a new Userdoing entity. | public function newAction()
{
$entity = new Userdoing();
$form = $this->createCreateForm($entity);
return $this->render('LcLcBundle:Userdoing:new.html.twig', array(
'entity' => $entity,
'form' => $form->createView(),
));
} | [
"public function newAction()\n {\n $entity = new User();\n\n $form = $this->createForm(new UserType(), $entity, array(\n 'action' => $this->generateUrl('user_create'),\n 'method' => 'POST'\n ));\n\n //$form->add('submit', 'submit', array('label' => 'Create'));\n\n return $this->render('CoreBundle:User:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function newAction()\n {\n $entity = new User();\n $form = $this->createCreateForm($entity)\n ->add('create', 'submit', array('label' => 'c'));\n\n return $this->render(\n 'VipaAdminBundle:AdminUser:new.html.twig',\n array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n )\n );\n }",
"public function create_form() {\n\n\t\treturn $this->render('user-create-form.php', array(\n\t\t\t'page_title' => 'Create Account',\n\t\t));\n\t}",
"public function newAction()\n {\n if(AccueilController::verifUserAdmin($this->getRequest()->getSession(), 'user')) return $this->redirect($this->generateUrl('EDiffAdminBundle_accueil', array()));\n \n $entity = new User();\n $form = $this->createForm(new UserType(), $entity);\n\n return $this->render('EDiffAdminBundle:User:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'layout' => \"EDiffAdminBundle::layout_\".$this->getRequest()->getSession()->get('user')->getDroits().\".html.twig\"\n ));\n }",
"public function newAction() {\n $entity = new User();\n $form = $this->createCreateForm($entity);\n\n return $this->render('purecircleAdminBundle:User:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function actionCreate()\n {\n $model = new User();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->user_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function newAction()\n {\n $entity = new User();\n $form = $this->createCreateForm($entity);\n\n return $this->render('PnPnBundle:User:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function newAction()\n {\n $entity = new Usuario();\n $form = $this->createForm(new UsuarioType(), $entity);\n\n return $this->render('INCESComedorBundle:Usuario:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }",
"public function newAction() {\n $entity = new FosUser();\n $form = $this->createCreateForm($entity);\n\n return $this->render('BackOfficebackBundle:FosUser:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function Create(){\n\t\tif(!$this->user['isAuthenticated']){\n\t\t\t$this->RedirectToController('login');\n\t\t}elseif($this->user['isAuthenticated'] AND $this->user['acronym'] != 'root'){\n\t\t\t$this->RedirectToController('login');\n\t\t}else{\n\t\t\t$form = new CFormUserCreate($this);\n\t\t\tif($form->Check() === false){\n\t\t\t\t$this->AddMessage(\"notice\", \"Please: input all fields.\");\n\t\t\t\t$this->RedirectToController(\"Create\");\n\t\t\t}\n\t\t\n\t\t\t$this->views->SetTitle(\"Create user\");\n\t\t\t$this->views->AddInclude(__DIR__ . \"/create.tpl.php\", array(\"form\"=>$form->GetHTML()));\n\t\t}\n\t}",
"public function actionCreate()\n {\n $model = new User();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->Id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function newAction()\n {\n $entity = new User();\n $form = $this->createCreateForm($entity);\n\n return $this->render('SinettMLABBuilderBundle:User:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function newAction()\n {\n $entity = new Usuario();\n $form = $this->createForm(new UsuarioType(), $entity);\n\n return $this->render('INCESComedorBundle:Usuario:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }",
"public function create() {\n $data = array();\n $this->render('user/create', 'Create User', 'users', $data);\n }",
"public function create() {\n\t\t\n\t\t\n\t\t//Form has been submitted\n\t\tif(isset($_POST['name']) && isset($_POST['email'])) {\n\t\t\t$user = new User();\n\t\t\t//3b. Check the validity of datas\n\t\t\t$user->setName($_POST['name']);\n\t\t\t$user->setEmail($_POST['email']);\n\t\t\t$userManager = new UserManager();\n\t\t\t$userManager->createUser($user);\n\n\t\t\theader('Location: index.php?ctrl=user&action=index');\n\t\t}\n\n\t\t//3. Display the form\n\t\trequire __DIR__ . '/../view/user/create.php';\n\t}",
"public function newUserAction()\n {\n $user = (new UserModel())->createUser();\n echo (new View('userCreated'))\n ->addData('user', $user)\n ->render();\n }",
"public function actionCreate()\n {\n $model = new Adminuser();\n\n if ($model->load(Yii::$app->request->post())) {\n $model->generateDefaultInfo();\n if ($model->save()){\n return $this->redirect(['index']);\n }\n Yii::$app->session->setFlash('danger',Json::encode($model->getErrors()));\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function newAction()\n {\n $userManager = $this->get('fos_user.user_manager');\n $entity = $userManager->createUser();\n $roles = $this->get('security.system_roles')->getRoles();\n $form = $this->createForm(new UserType(array('roles'=>$roles)), $entity);\n\n return $this->render('CoreUserBundle:User:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function actionCreate()\n {\n $model = new Usuarios();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get by StrainLeafRatingStrainId This function retrieves a strain Leaf Rating by strain Leaf Rating Profile Id | public static function getStrainLeafRatingByStrainLeafRatingProfileId(\PDO $pdo, $strainLeafRatingProfileId) {
// check validity of $strainName
$strainLeafRatingProfileId = filter_var($strainLeafRatingProfileId, FILTER_SANITIZE_NUMBER_INT);
if($strainLeafRatingProfileId <= 0) {
throw(new \InvalidArgumentException("Strain Leaf Rating Profile Id is not valid."));
}
if($strainLeafRatingProfileId === null) {
throw(new \RangeException("Strain Leaf Rating Profile Id does not exist."));
}
// prepare query
$query = "SELECT strainLeafRatingRating, strainLeafRatingStrainId, strainLeafRatingProfileId FROM strainLeafRating WHERE strainLeafRatingProfileId = :strainLeafRatingProfileId";
$statement = $pdo->prepare($query);
$parameters = array("strainLeafRatingProfileId" => $strainLeafRatingProfileId);
$statement->execute($parameters);
// build an array of dispensaries based on strainLeafRatingProfileId
$strainLeafRatings = new \SplFixedArray($statement->rowCount());
$statement->setFetchMode(\PDO::FETCH_ASSOC);
while(($row = $statement->fetch()) !== false) {
try{
$strainLeafRating = new StrainLeafRating($row["strainLeafRatingRating"], $row["strainLeafRatingStrainId"], $row["strainLeafRatingProfileId"]);
$strainLeafRatings[$strainLeafRatings->key()] = $strainLeafRating;
$strainLeafRatings->next();
} catch(\Exception $exception) {
//if the row couldn't be converted, rethrow it
throw(new \PDOException($exception->getMessage(), 0, $exception));
}
}
return ($strainLeafRatings);
} | [
"public function getStrainLeafRatingStrainId() {\n\t\treturn $this->strainLeafRatingStrainId;\n\t}",
"public function testGetStrainLeafRatingByStrainLeafRatingRating() {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"strainLeafRating\");\n\n\t\t//create a new strainLeafRating and insert into mySQL\n\t\t$strainLeafRating = new StrainLeafRating($this->VALID_STRAINLEAFRATINGRATING0, $this->strain->getStrainId(), $this->profile->getProfileId());\n\t\t$strainLeafRating->insert($this->getPDO());\n\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$results = StrainLeafRating::getStrainLeafRatingsByStrainLeafRatingRating($this->getPDO(), $this->VALID_STRAINLEAFRATINGRATING0);\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"strainLeafRating\"));\n\t\t$this->assertCount(1, $results);\n\t\t$this->assertContainsOnlyInstancesOf(\"Edu\\\\Cnm\\\\Cannaduceus\\\\StrainLeafRating\", $results);\n\n\t\t// grab the result from the array and validate it\n\t\t$pdoStrainLeafRating = $results[0];\n\t\t$this->assertEquals($pdoStrainLeafRating->getStrainLeafRatingRating(), $this->VALID_STRAINLEAFRATINGRATING0);\n\t\t$this->assertEquals($pdoStrainLeafRating->getStrainLeafRatingProfileId(), $this->profile->getProfileId());\n\t\t$this->assertEquals($pdoStrainLeafRating->getStrainLeafRatingStrainId(), $this->strain->getStrainId());\n\t}",
"public function testGetInvalidStrainLeafRatingByProfileId() {\n\t\t// grab a strainLeafRating id that exceeds the maximum allowable profile id\n\t\t$strainLeafRating = StrainLeafRating::getStrainLeafRatingByStrainLeafRatingProfileId($this->getPDO(), CannaduceusTest::INVALID_KEY);\n\t\t$this->assertCount(0, $strainLeafRating);\n\t}",
"function get_school_code_by_student_id($sid)\r\n{\r\n\trequire(\"../config/config.php\");\r\n\t$result=mysqli_query($db,\"SELECT `school_code` FROM schooldetails\");\r\n\t$value=mysqli_fetch_object($result);\r\n\tmysqli_close($db);\r\n\treturn $value->school_code;\r\n}",
"public static function getDispensaryLeafRatingByDispensaryLeafRatingDispensaryIdAndDispensaryLeafRatingProfileId(\\PDO $pdo, int $dispensaryLeafRatingDispensaryId, int $dispensaryLeafRatingProfileId) {\n\n\t\t$dispensaryLeafRatingDispensaryId = filter_var($dispensaryLeafRatingDispensaryId, FILTER_SANITIZE_NUMBER_INT);\n\n\t\t$dispensaryLeafRatingProfileId = filter_var($dispensaryLeafRatingProfileId, FILTER_SANITIZE_NUMBER_INT);\n\n\t\tif(empty($dispensaryLeafRatingDispensaryId) || $dispensaryLeafRatingDispensaryId <= 0) {\n\t\t\tthrow(new \\InvalidArgumentException(\"Dispensary Id or is not valid.\"));\n\t\t}\n\n\t\tif(empty($dispensaryLeafRatingProfileId) || $dispensaryLeafRatingProfileId <= 0) {\n\t\t\tthrow(new \\InvalidArgumentException(\"Profile Id or is not valid.\"));\n\t\t}\n\n\t\t// prepare query\n\t\t$query = \"SELECT dispensaryLeafRatingRating, dispensaryLeafRatingDispensaryId, dispensaryLeafRatingProfileId FROM dispensaryLeafRating WHERE dispensaryLeafRatingDispensaryId = :dispensaryLeafRatingDispensaryId AND dispensaryLeafRatingProfileId = :dispensaryLeafRatingProfileId\";\n\t\t$statement = $pdo->prepare($query);\n\t\t$parameters = array(\"dispensaryLeafRatingDispensaryId\" => $dispensaryLeafRatingDispensaryId, \"dispensaryLeafRatingProfileId\" => $dispensaryLeafRatingProfileId);\n\t\t$statement->execute($parameters);\n\n\t\t// setup results from query\n\t\ttry {\n\t\t\t$dispensaryLeafRating = null;\n\t\t\t$statement->setFetchMode(\\PDO::FETCH_ASSOC);\n\t\t\t$row = $statement->fetch();\n\t\t\tif($row !== false) {\n\t\t\t\t$dispensaryLeafRating = new DispensaryLeafRating($row[\"dispensaryLeafRatingRating\"], $row[\"dispensaryLeafRatingDispensaryId\"], $row[\"dispensaryLeafRatingProfileId\"]);\n\t\t\t}\n\t\t} catch(\\Exception $exception) {\n\t\t\tthrow(new \\PDOException($exception->getMessage(), 0, $exception));\n\t\t}\n\t\treturn ($dispensaryLeafRating);\n\t}",
"public function getRating($student_id)\n\t{\n\t\t$cmd = Yii::app()->db->createCommand();\n\t\t$cmd->select('value');\n\t\t$cmd->from('bk_rate');\n\t\t$cmd->where('note_id=:X AND student_id=:Y', array(':X' => $this->id, ':Y' => $student_id));\n\n\t\t$res = $cmd->queryRow();\n\t\treturn $res['value'];\n\t}",
"function get_tbllevelstudent($id)\n {\n // return $this->db->get_where('tbllevelstudent',array('id'=>$id))->row_array();\n return $this->db->query(\"\n select tls.id,tls.level_id,tls.student_id,tl.level_name,ts.full_name as 'student_name' FROM\n tbllevelstudent tls inner join tblstudent ts on tls.student_id=ts.student_id\n inner join tbllevel tl on tls.level_id=tl.level_id\n where tls.id=$id\n \")->row_array();\n }",
"public function physicianProfile_get(){\n\t\t$getProfile = $this->PM->getPK('physicianprofile',$this->get('id'));\n\t\t\n\t\t$this->response(array(\n\t\t\t'status' => 'TRUE',\n\t\t\t'profile' => json_encode($getProfile),\n\t\t));\n\t}",
"function get_rating($unique_id){\n $movie_ratings = get_ratings();\n\n return $movie_ratings[$unique_id];\n}",
"public function get($studentId);",
"public function getStudentDetails($id)\n {\n return DB::table('studentDetails')->where('Id', $id)->first();\n }",
"function iss_get_student_by_studentid($studentid, $regyear) {\n\ttry {\n\t\t// echo \"br/> get student {$studentid} , {$regyear}\"; // ISS TEST\n\t\tglobal $wpdb;\n\t\t$table = iss_get_table_name ( \"students\" );\n\t\t$query = $wpdb->prepare ( \"SELECT * FROM {$table} WHERE RegistrationYear = '{$regyear}' and StudentID = %d LIMIT 1\", $studentid );\n\t\t$row = $wpdb->get_row ( $query, ARRAY_A );\n\t\tif ($row != NULL) {\n\t\t\treturn $row;\n\t\t}\n\t} catch ( Exception $ex ) {\n\t\tiss_write_log ( \"Error\" . $ex . getMessage () );\n\t}\n\treturn NULL;\n}",
"public static function getDispensaryLeafRatingByDispensaryLeafRatingProfileId(\\PDO $pdo, $dispensaryLeafRatingProfileId) {\n\t\t// check validity of $dispensaryName\n\t\t$dispensaryLeafRatingProfileId = filter_var($dispensaryLeafRatingProfileId, FILTER_SANITIZE_NUMBER_INT);\n\n\t\tif($dispensaryLeafRatingProfileId <= 0) {\n\t\t\tthrow(new \\InvalidArgumentException(\"Dispensary Leaf Rating Profile Id is not valid.\"));\n\t\t}\n\n\t\tif($dispensaryLeafRatingProfileId === null) {\n\t\t\tthrow(new \\RangeException(\"Dispensary Leaf Rating Profile Id does not exist.\"));\n\t\t}\n\n\t\t// prepare query\n\t\t$query = \"SELECT dispensaryLeafRatingRating, dispensaryLeafRatingDispensaryId, dispensaryLeafRatingProfileId FROM dispensaryLeafRating WHERE dispensaryLeafRatingProfileId = :dispensaryLeafRatingProfileId\";\n\t\t$statement = $pdo->prepare($query);\n\t\t$parameters = array(\"dispensaryLeafRatingProfileId\" => $dispensaryLeafRatingProfileId);\n\t\t$statement->execute($parameters);\n\n\t\t// build an array of dispensaries based on dispensaryLeafRatingProfileId\n\t\t$dispensaryLeafRatings = new \\SplFixedArray($statement->rowCount());\n\t\t$statement->setFetchMode(\\PDO::FETCH_ASSOC);\n\t\twhile(($row = $statement->fetch()) !== false) {\n\t\t\ttry{\n\t\t\t\t$dispensaryLeafRating = new DispensaryLeafRating($row[\"dispensaryLeafRatingRating\"], $row[\"dispensaryLeafRatingDispensaryId\"], $row[\"dispensaryLeafRatingProfileId\"]);\n\t\t\t\t$dispensaryLeafRatings[$dispensaryLeafRatings->key()] = $dispensaryLeafRating;\n\t\t\t\t$dispensaryLeafRatings->next();\n\t\t\t} catch(\\Exception $exception) {\n\t\t\t\t//if the row couldn't be converted, rethrow it\n\t\t\t\tthrow(new \\PDOException($exception->getMessage(), 0, $exception));\n\t\t\t}\n\t\t}\n\t\treturn ($dispensaryLeafRatings);\n\t}",
"function get_by_id( $sy_id,$student_id ) {\n\t\treturn $this->query(\n\t\t\t\"SELECT * FROM $this->tblname\" .\n\t\t\t\" WHERE ($sy_id BETWEEN sy_id AND sy_id_end)\" .\n\t\t\t\" AND student_id=$student_id\"\n\t\t);\n\t}",
"public static function getRatingByID($id) {\n $ratingbyid = Rating::where('id', '=', $id)->first();\n return $ratingbyid;\n }",
"public function profilePolitician($fullname){\n\t\t$politician = Politician::where('full_name','=',$fullname);\n\n\t\tif($politician->count()){\n\n\t\t\t//shows only issues logged in user follows\n\t\t\tif(Auth::check())\n\t\t\t\t$issues = User::find(Auth::user()->id)->issues;\n\t\t\telse $issues = null;\n\n\t\t\t//gets specific politician entity/record\n\t\t\t$politician = $politician->first();\n\n\t\t\t//make list of all ids\n\t\t\t$democrat_ratings = array();\n\t\t\t$republican_ratings = array();\n\n\t\t\t//Hate to throw tacky direct php mysql queries instead of ORM. But having trouble with\n\t\t\t//ORM query logic for inner joins of derived tables. Need beta now and will ORM later.\n\t\t\t$con=mysqli_connect(\"127.0.0.1\",\"root\",\"pepper\",\"iratepolitics\");\n \n\n\t\t\t//Democrat Ratings: Get value and timestamp of all democrat users' ratings for this politician\n $query = \"select value,r.created_at from (select * from ratings where politician_id='\".$politician->id.\"') as r inner join (select * from users where party='Democrat') as u on r.user_id = u.id\";\n\t\t\t$result = mysqli_query($con,$query);\n\t\t\t$i=0;\n\t\n\t\t\t\twhile($row = mysqli_fetch_array($result)) {\n $democrat_ratings[$i++] = array(\n\t\t\t\t\t'value'=>$row['value'],\n\t\t\t\t\t'created_at' => $row['created_at']\n\t\t\t\t);\n \t\t\t\t \n\t\t\t\t}//close while\n\t\t\t//Republican Ratings: Get value and timestamp of all republican users' ratings for this politician\t\t\t\n\t\t\t$query = \"select value,r.created_at from (select * from ratings where politician_id='\".$politician->id.\"') as r inner join (select * from users where party='Republican') as u on r.user_id = u.id\";\n\t\t\t$result = mysqli_query($con,$query);\n\t\t\t$i=0;\n\t\n\t\t\t\twhile($row = mysqli_fetch_array($result)) {\n $republican_ratings[$i++] = array(\n\t\t\t\t\t'value'=>$row['value'],\n\t\t\t\t\t'created_at' => $row['created_at']\n\t\t\t\t);\n \t\t\t\t \n\t\t\t\t}//close while\n\t\t\t\n\t\t\tmysqli_close($con);\n\n\t\t\t//we have raw data. now we need to turn data into format for highchart with appropriate time interval resolution\n\t\t\t//For now we are going to use 7 day intervals. So we are going back 7 days from today.\n\t\t\t//0 on x-axis is 7 days ago. \n\t\t\t\n\t\t\t//creating array where each index represents a day (whatever time unit in future)\n\t\t\t//For now, 0 is 7 days ago. So we loop through each day and sum up all raw data values that took place during\n\t\t\t//that time unit\n \n\t\t\t$todays_date = new DateTime(\"now\"); \t \t\n\n\n\t\t\t$democrat_chart_data = array(\"0\"=>0,\"1\"=>0,\"2\"=>0,\"3\"=>0,\"4\"=>0,\"5\"=>0,\"6\"=>0);\t\t\t\n\t\t\tforeach ($democrat_ratings as $rating) {\n\t\t\t\t$rate = array();\n\t\t\t\t$rating_date = new DateTime($rating['created_at']); //echo ' Rating Date: '.$rating_date->format(\"Y-m-d H:i:s\");\n\t\t\t\t\n\t\t\t\t$date_interval = $todays_date->diff($rating_date);//echo ' $date_interval: '.$date_interval->format(\"%a\").\"days\\n\";\n\t\t\t $date_interval = intval($date_interval->format(\"%a\"));\t\t\t \n\t\t\t\tif ($date_interval <=6) \n\t\t\t\t{\n\t\t\t\t\t$democrat_chart_data[6-$date_interval] += $rating['value'];\n\t\t\t\t}\n\n\t\t\t}\n\n\n\t\t\t$republican_chart_data = array(\"0\"=>0,\"1\"=>0,\"2\"=>0,\"3\"=>0,\"4\"=>0,\"5\"=>0,\"6\"=>0);\n\n\t\t\tforeach ($republican_ratings as $rating) {\n\t\t\t\t$rate = array();\n\t\t\t\t$rating_date = new DateTime($rating['created_at']); //echo ' Rating Date: '.$rating_date->format(\"Y-m-d H:i:s\");\n\t\t\t\t\n\t\t\t\t$date_interval = $todays_date->diff($rating_date);//echo ' $date_interval: '.$date_interval->format(\"%a\").\"days\\n\";\n\t\t\t $date_interval = intval($date_interval->format(\"%a\"));\n\t\t\t\tif ($date_interval<=6) \n\t\t\t\t{\n\t\t\t\t\t$republican_chart_data[6-$date_interval] += $rating['value'];\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t//Issue Tag Cloud\n\n\t\t\t\t\t\n\t\t\t$con=mysqli_connect(\"127.0.0.1\",\"root\",\"pepper\",\"iratepolitics\");\n\n\t\t\t//create list of issues for which politician has received votes by selecting \n\t\t\t//rows on first occurance of each unique value\n\t\t\t$query = \"select id,issue_id from ratings where politician_id=\".$politician->id.\" group by issue_id;\";\n\t\t\t$result = mysqli_query($con,$query);\n\t\t\t$issue_tag_cloud = \"\";\n\t\t\t$i=0;\n\t\t\t//for each id in list of issues, count all the rows in ratings where a vote was made for that politician & that issue\n\t\t\t//this is a count of 'activity' for each issue per politican. (ex. votes on Pelosi's stance on Obamacare)\n\t\t\twhile($row = mysqli_fetch_array($result)) {\n\t\t\t\t$query = \"select id from ratings where issue_id=\".$row['issue_id'].\" and politician_id=\".$politician->id;\n\t\t\t\t//echo 'query: '.$query;\n\t\t\t $result2 = mysqli_query($con,$query);\n\t\t\t\t$issue_name = Issue::find($row['issue_id'])->issue_name;\n\n\t\t\t\t\n\n\n\n\t\t\t\t$issue_tag_cloud .='{text: \"'\n\t\t\t\t\t\t .ucwords($issue_name).'\", weight: '\n\t\t\t\t\t\t .mysqli_num_rows ($result2).' , link: \"'\n\t\t\t\t\t\t .URL::route('news',$issue_name).'\"},'.\"\\n\";\n\t\t\t\t\n\n\t\t\t\t}//close while\n\t\t\t\t//remove trailing new line and trailing comma so tag cloud js will work\n\t\t\t\t$issue_tag_cloud = substr_replace($issue_tag_cloud ,\"\",-1);\n\t\t\t\t$issue_tag_cloud = substr_replace($issue_tag_cloud ,\"\",-1);\n\n\t\t\t//Display Comments...only comments with no parents\n\t\t\t$comments = $politician->comments()->where('parent_id', '=', '0')->orderBy('rank', 'desc')->orderBy('created_at', 'desc')->get();\t\n\t\t\t\n\t\t\t//$comments = Comment::where('politician_id','=',$politician->id)->where('parent_id', '=', '0')->get();\t\t\n\t\t\tif(Auth::check())\n\t\t\t\t$issues_not_followed = $this->issuesNotFollowed(Auth::user()->id);\n\n\t\t\telse $issues_not_followed = Issue::all();\n\t\t\t\n\t\t\t$fb_og = array('url'=>Request::url() , 'title'=>$politician->full_name, 'image'=>$_SERVER['SERVER_NAME'].$politician->pic_url,\n\t\t\t\t\t'description'=>$politician->bio);\n\n\n\n\n\t\t\treturn View::make('politician')\n\t\t\t ->with('politician',$politician)\n\t\t\t ->with('issues',$issues)\n\t\t\t ->with('comments',$comments)\n\t\t\t ->with('democrat_chart_data',$democrat_chart_data)\n\t\t\t ->with('republican_chart_data',$republican_chart_data)\n\t\t\t\t->with('issue_tag_cloud',$issue_tag_cloud)\n\t\t\t\t->with('issues_not_followed',$issues_not_followed)\n\t\t\t\t->with('fb_og',$fb_og )\n\t\t\t\t->with('title',$politician->full_name.\"'s Profile\");\n\t\t\n\t\t}else return App::abort(404);//if politician not found in database then page not found error returned.\t\n\n\t}",
"public static function getStudentRecord($id) {\n\t\t$student = Student::find($id);\n\t\tif($student) {\n\t\t\t// echo $student->first_name;\n\t\t\t// echo \"<br>\";\n\t\t\t\n\t\t\t// foreach($student->marks as $mark) {\n\t\t\t\t// echo $mark;\n\t\t\t\t// echo \"<br>\";\n\t\t\t// }\n\t\t\t// foreach($student->attendances as $attendance) {\n\t\t\t\t// echo $attendance;\n\t\t\t\t// echo \"<br>\";\n\t\t\t// }\n\t\t\treturn $student;\n\t\t}else{\n\t\t\treturn \"Not Found\";\n\t\t}\n\t}",
"public function getEncryptionProfile($encryption_profile_id);",
"function individualGetDetail($individualId) {\n\t\t\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checking to make sure stime is before ftime or not the same | function checkTimings($stime, $ftime)
{
//First check if one of them is not passed as false
if($stime == false || $ftime == false)
{ //return false
return false;
}
//converting time to minutes format of time is hh:mm
$astime = explode(":",$stime);
$aftime = explode(":",$ftime);
$stmin = ($astime[0] * 60) + $astime[1]; //Start time
$ftmin = ($aftime[0] * 60) + $aftime[1]; //Finish time
if($stmin < $ftmin)
return true;
else
return false;
} | [
"public function timeFutureChecker()\n {\n $now = app_now();\n if (date_greater_than($this->entry->entry_time,$now)) {\n $this->build_error([\n 'message' => 'Please the last entry time can not be a future time'\n ]);\n }\n }",
"protected function setTimeCheck() {\r\n\t\t$this->set('timecheck', $this->requesttime-$this->time);\r\n\t}",
"function time_collision( $t1 , $t2 )\n\t{\n\t\tif( strlen($t1) != 8 || strlen($t2) != 8 )\t// is not correct time\n\t\t{\n\t\t\techo (\"input time is not correct\");\n\t\t\tdie();\n\t\t}\n\n\t\t$t1sh = (int)substr( $t1 , 0 , 2 );\n\t\t$t1sm = (int)substr( $t1 , 2 , 2 );\n\t\t$t1eh = (int)substr( $t1 , 4 , 2 );\n\t\t$t1em = (int)substr( $t1 , 6 , 2 );\n\t\t\n\t\t$t2sh = (int)substr( $t2 , 0 , 2 );\n\t\t$t2sm = (int)substr( $t2 , 2 , 2 );\n\t\t$t2eh = (int)substr( $t2 , 4 , 2 );\n\t\t$t2em = (int)substr( $t2 , 6 , 2 );\n\n\t\tif( ( $t1sm + $t1sh * 60 < $t2sm + $t2sh * 60 ) &&\n\t\t\t( $t1em + $t1eh * 60 > $t2sm + $t2sh * 60 ))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse if( ( $t1sm + $t1sh * 60 >= $t2sm + $t2sh * 60 ) &&\n\t\t\t\t ( $t1sm + $t1sh * 60 < $t2em + $t2eh * 60 ))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"function time_check()\r\n\t{\r\n\t\t$time = microtime();\r\n\t\t$time = explode(' ',$time);\r\n\t\t$time = $time[1]+$time[0];\r\n\t\treturn $time;\r\n\t}",
"function v0_check_time_before($instruction, $class, $parent, &$errors, &$l_errors) {\n\t// Get time from parent\n\t$timeframe_params=$instruction['value'][0]['value'];\n\t$opentime_name=$timeframe_params[0]['value'][0];\n\t$opentime_unc_name=$timeframe_params[1]['value'][0];\n\t\n\t// Get value of open time\n\tswitch (substr($opentime_name, 0, 1)) {\n\t\tcase '*':\n\t\t\t// Local element\n\t\t\tif (!v0_ul_get_element($opentime_name, $parent, $opentime_value, $errors, $l_errors)) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase '/':\n\t\t\t// Attribute\n\t\t\tif (!v0_ul_get_attribute($opentime_name, $parent, $opentime_value, $errors, $l_errors)) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase '#':\n\t\t\t// Function result\n\t\t\tif (!v0_ul_get_result($opentime_name, $parent, NULL, $opentime_value, $errors, $l_errors)) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t// Static value\n\t\t\t$opentime_value=$opentime_name;\n\t}\n\t\n\t// If a NULL value was returned\n\tif ($opentime_value==NULL) {\n\t\t// Cannot check\n\t\treturn TRUE;\n\t}\n\t\n\t// Get value of open time uncertainty\n\tswitch (substr($opentime_unc_name, 0, 1)) {\n\t\tcase '*':\n\t\t\t// Local element\n\t\t\tif (!v0_ul_get_element($opentime_unc_name, $parent, $opentime_unc_value, $errors, $l_errors)) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase '/':\n\t\t\t// Attribute\n\t\t\tif (!v0_ul_get_attribute($opentime_unc_name, $parent, $opentime_unc_value, $errors, $l_errors)) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase '#':\n\t\t\t// Function result\n\t\t\tif (!v0_ul_get_result($opentime_unc_name, $parent, NULL, $opentime_unc_value, $errors, $l_errors)) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t// Static value\n\t\t\t$opentime_unc_value=$opentime_unc_name;\n\t}\n\t\n\t// Get time from current\n\t$timebefore_params=$instruction['value'][1]['value'];\n\t$time_name=$timebefore_params[0]['value'][0];\n\t$time_unc_name=$timebefore_params[1]['value'][0];\n\t\n\t// Get value of open time\n\tswitch (substr($time_name, 0, 1)) {\n\t\tcase '*':\n\t\t\t// Local element\n\t\t\tif (!v0_ul_get_element($time_name, $class, $time_value, $errors, $l_errors)) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase '/':\n\t\t\t// Attribute\n\t\t\tif (!v0_ul_get_attribute($time_name, $class, $time_value, $errors, $l_errors)) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase '#':\n\t\t\t// Function result\n\t\t\tif (!v0_ul_get_result($time_name, $class, NULL, $time_value, $errors, $l_errors)) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t// Static value\n\t\t\t$time_value=$time_name;\n\t}\n\t\n\t// If a NULL value was returned\n\tif ($time_value==NULL) {\n\t\t// Cannot check\n\t\treturn TRUE;\n\t}\n\t\n\t// Get value of open time uncertainty\n\tswitch (substr($time_unc_name, 0, 1)) {\n\t\tcase '*':\n\t\t\t// Local element\n\t\t\tif (!v0_ul_get_element($time_unc_name, $class, $time_unc_value, $errors, $l_errors)) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase '/':\n\t\t\t// Attribute\n\t\t\tif (!v0_ul_get_attribute($time_unc_name, $class, $time_unc_value, $errors, $l_errors)) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase '#':\n\t\t\t// Function result\n\t\t\tif (!v0_ul_get_result($time_unc_name, $class, NULL, $time_unc_value, $errors, $l_errors)) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t// Static value\n\t\t\t$time_unc_value=$time_unc_name;\n\t}\n\t\n\t// Calculate maximum open time\n\tif ($opentime_unc_value==NULL) {\n\t\t$max_opentime=$opentime_value;\n\t}\n\telse {\n\t\trequire_once \"php/funcs/datetime_funcs.php\";\n\t\tif (!datetime_add_datetime($opentime_value, $opentime_unc_value, $max_opentime, $local_error)) {\n\t\t\t$errors[$l_errors]=array();\n\t\t\t$errors[$l_errors]['code']=1514;\n\t\t\t$errors[$l_errors]['message']=\"Error when trying to calculate minimum start time [v0_check_time_before] // \".$local_error;\n\t\t\t$l_errors++;\n\t\t\treturn FALSE;\n\t\t}\n\t}\n\t\n\t// Calculate minimum time\n\tif ($time_unc_value==NULL) {\n\t\t$min_time=$time_value;\n\t}\n\telse {\n\t\trequire_once \"php/funcs/datetime_funcs.php\";\n\t\tif (!datetime_substract_datetime($time_value, $time_unc_value, $min_time, $local_error)) {\n\t\t\t$errors[$l_errors]=array();\n\t\t\t$errors[$l_errors]['code']=1514;\n\t\t\t$errors[$l_errors]['message']=\"Error when trying to calculate minimum start time [v0_check_time_before] // \".$local_error;\n\t\t\t$l_errors++;\n\t\t\treturn FALSE;\n\t\t}\n\t}\n\t\n\t// Compare times\n\trequire_once \"php/funcs/datetime_funcs.php\";\n\tif (!datetime_date_before_date($min_time, $max_opentime, $is_before, $local_error)) {\n\t\t$errors[$l_errors]=array();\n\t\t$errors[$l_errors]['code']=1516;\n\t\t$errors[$l_errors]['message']=\"Error when trying to compare dates [v0_check_time_before] // \".$local_error;\n\t\t$l_errors++;\n\t\treturn FALSE;\n\t}\n\tif ($is_before==2) {\n\t\t// Error\n\t\t$errors[$l_errors]=array();\n\t\t$errors[$l_errors]['code']=2;\n\t\t$errors[$l_errors]['message']=\"Element \".substr($time_name, 1).\" from class \".$class['tag'].\" is supposed to be earlier than element \".substr($opentime_name, 1).\" from class \".$parent['tag'];\n\t\t$l_errors++;\n\t\treturn FALSE;\n\t}\n\t\n\treturn TRUE;\n}",
"function timecmp($timeone, $timetwo)\n {\n // convert to time\n $timeone = strtotime($timeone);\n $timetwo = strtotime($timetwo);\n\n // make comparison\n // must be positive to return true\n return (($timeone - $timetwo) >= 0);\n }",
"public function getTrueTime();",
"function is_time_to_post($gametime) {\n\t$diff = (strtotime($gametime) - time()) / 60;\n\techo $diff.\"<br>\";\n\treturn ($diff >= 50 && $diff <= 68);\n}",
"private function validateTimes(){\n \n //El delta de lecturas no puede ser mayor al delta de fechas \n $diferenciavalores=$this->differenceValuesBack($this->manttohorometros->ums->escala+0);\n $diferenciavalores=is_null($diferenciavalores)?0:$diferenciavalores;\n $diferenciatiempo=$this->differenceTimeBack();\n $diferenciatiempo=is_null($diferenciatiempo)?0:$diferenciatiempo;\n \n if( $diferenciavalores > $diferenciatiempo ) \n $this->adderror('lectura',yii::t('errvalid','The diference between last value is greater than the time difference '));\n ///incremental= 1 la lectura no debe ser menor que la lectura anterior\n //El delta de lecturas no puede ser mayor al delta de fechas \n $diferenciavalores=$this->differenceValuesForward($this->manttohorometros->ums->escala+0);\n $diferenciavalores=is_null($diferenciavalores)?0:$diferenciavalores;\n $diferenciatiempo=$this->differenceTimeForward();\n $diferenciatiempo=is_null($diferenciatiempo)?0:$diferenciatiempo;\n \n if( $diferenciavalores > $diferenciatiempo ) \n $this->adderror('lectura',yii::t('errvalid','The diference between next value is greater than the time difference '));\n \n }",
"function timeOnline(){\n\tif(isset($_SESSION['startTime'])){\n\t\t$time = time();\n\t\t$_SESSION['time'] = $time - $_SESSION['startTime'];\n\t\t/* CURRENTLY GIVES WARNINGS AND WORKS ON AND OFF... */\n\t\tif($_SESSION['time'] > 60){\n\t\t\tinsertTime();\n\t\t\t//Set the time again.\n\t\t\t$time = time();\n\t\t\t$_SESSION['time'] = 0;\n\t\t\t$_SESSION['startTime'] = $time;\n\t\t}\n\t}\n\telse{\n\t\t$time = time();\n\t\t$_SESSION['time'] = 0;\n\t\t$_SESSION['startTime'] = $time;\n\t}\n}",
"protected function isTimeFrameValid() {\n\t\treturn ($GLOBALS['EXEC_TIME'] <= $this->arguments['time'] + self::VALUE_TimeFrame);\n\t}",
"public function test_time_less_than_false() {\n\t\t$field = FrmField::getOne( 'time-field' );\n\n\t\t$field_value = '8:00 AM';\n\t\t$compare_type = 'less_than';\n\t\t$compare_to = '4:00';\n\n\t\t$opening_tag = '[if ' . $field->id . ' ' . $compare_type . '=\"' . $compare_to . '\"]';\n\t\t$content = 'Before ' . $opening_tag . 'Hide me[/if ' . $field->id . '] After';\n\n\t\t$atts = $this->package_atts_for_steve_entry( $compare_type, $compare_to, $opening_tag );\n\t\t$tag = $field->id;\n\t\t$args = array( 'field' => $field );\n\n\t\tFrmProContent::check_conditional_shortcode( $content, $field_value, $atts, $tag, 'if', $args );\n\n\t\t$this->assert_conditional_is_false( $content );\n\t}",
"protected function compareTime($date){\n\t\t$currentTime = strtotime(date('Y-m-d H:i:s'));\n\t\t$paramTime = strtotime($date);\n\t\t$timeDiff = $paramTime - $currentTime ;\n\t\tif($timeDiff > 0) return true;\n\t\telse return false;\n\t\t\n\t}",
"function nearTimeLimit() {\n\t\t# returns TRUE if we are too near time's up\n\t\tif (scriptTime() > CONS_TIMEWARNING) {\n\t\t\t$this->errorControl->raise(167,$this->context_str.\"/\".$this->action,'',scriptTime());\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function isTime(): bool;",
"function checkTimeout(){\n\t\tif ($_SESSION['lastactivity'] + 5*60 < time()) {\n \treturn TRUE;\t\t\t\n \t} else {\n\t $_SESSION['lastactivity'] = time();\n\t\t\treturn FALSE;\n\t }\n\t}",
"public function isBeforeOrEqual(Time $other): bool\n {\n return $this->toSeconds() <= $other->toSeconds();\n }",
"private function checkTime()\n {\n $morning_start = new \\DateTime($this->date->format('Y-m-d') . '07:00', $this->date->getTimezone());\n $morning_end = new \\DateTime($this->date->format('Y-m-d') . '09:30', $this->date->getTimezone());\n\n if ($this->date >= $morning_start && $this->date < $morning_end) {\n return false;\n }\n\n $afternoon_start = new \\DateTime($this->date->format('Y-m-d') . ' 16:00', $this->date->getTimezone());\n $afternoon_end = new \\DateTime($this->date->format('Y-m-d') . '19:30', $this->date->getTimezone());\n \n if ($this->date >= $afternoon_start && $this->date < $afternoon_end) {\n return false;\n }\n\n return true;\n }",
"public function testCheckTime() {\n $f1 = array();\n $f2 = array();\n $f3 = array();\n $f4 = array();\n \n $f1['depart_time'] = \"8:00\";\n $f1['arrive_time'] = \"10:00\";\n \n $f2['depart_time'] = \"9:00\";\n $f2['arrive_time'] = \"11:00\";\n \n $f3['depart_time'] = \"10:29\";\n $f3['arrive_time'] = \"11:40\";\n \n $f4['depart_time'] = \"13:00\";\n $f4['arrive_time'] = \"15:00\";\n \n //Connection leaves after initial, and there is 30 mins in between\n $this->assertTrue($this->CI->flightModel->checkTime($f1, $f4)); \n //Connection leaves before initial arrives\n $this->assertFalse($this->CI->flightModel->checkTime($f1, $f2));\n //There is only 29 minutes between flights\n $this->assertFalse($this->CI->flightModel->checkTime($f1, $f3));\n //Initial flight departs after connection arrives\n $this->assertFalse($this->CI->flightModel->checkTime($f4, $f2));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Add a Unique field restraint to field(s). This will cause ORM to use the doUniqueInsert() method when making calls to insert data to the database. At some point, this could also perform checks before ever talking to the db. | protected function addUnique($fields)
{
$this->orm['unique'] = true;
} | [
"public function addUnique($field)\n\t\t{\n\t\t\tif(array_key_exists($field, $this->fields))\n\t\t\t\t$this->uniques[] = $field;\n\t\t}",
"function addUniqueConstraint($a_table, $a_fields, $a_name = \"con\")\n\t{\n\t\t$manager = $this->db->loadModule('Manager');\n\t\t\n\t\t// check index name\n\t\tif (!$this->checkIndexName($a_name))\n\t\t{\n\t\t\t$this->raisePearError(\"ilDB Error: addUniqueConstraint(\".$a_table.\",\".$a_name.\")<br />\".\n\t\t\t\t$this->error_str);\n\t\t}\n\t\t\n\t\t$fields = array();\n\t\tforeach ($a_fields as $f)\n\t\t{\n\t\t\t$fields[$f] = array();\n\t\t}\n\t\t$definition = array (\n\t\t\t'unique' => true,\n\t\t\t'fields' => $fields\n\t\t);\n\t\t\n\t\t$r = $manager->createConstraint($a_table, $this->constraintName($a_table, $a_name), $definition);\n\n\t\treturn $this->handleError($r, \"addUniqueConstraint(\".$a_table.\")\");\n\t}",
"public function addUniqueKey($field) {\n $schema = $this->table_schema;\n if ($schema['fields'][$field]) {\n $ret = array();\n $index = data_build_index_array($field, $schema['fields'][$field]);\n db_add_unique_key($ret, $this->name, $field, $index);\n if ($ret[0]['success']) {\n $schema['unique keys'][$field] = array($field);\n $this->update(array('table_schema' => $schema));\n drupal_get_schema($this->name, TRUE);\n return TRUE;\n }\n }\n return FALSE;\n }",
"public function addUniqueConstraint( $type, $columns );",
"protected function field_unique() {\n\t\treturn $this->unique() . '/' . $this->get_id();\n\t}",
"public function isUnique($field)\n {\n// return true;\n return in_array($field, $this->currentRules(\"unique\"));\n }",
"public function unique() : DBBuilder {\n if (!$this->lastColumn) return $this;\n $this->definition[$this->name][$this->lastColumn]['unique'] = true;\n return $this;\n }",
"public function setUnique($unique);",
"public function testIsUniqueAllowMultipleNulls(): void\n {\n $this->skipIf(ConnectionManager::get('test')->getDriver() instanceof Sqlserver);\n\n $table = $this->getTableLocator()->get('UniqueAuthors');\n $rules = $table->rulesChecker();\n $rules->add($rules->isUnique(\n ['first_author_id', 'second_author_id']\n ));\n\n $entity = new Entity([\n 'first_author_id' => null,\n 'second_author_id' => 1,\n ]);\n $this->assertNotEmpty($table->save($entity));\n\n $entity->first_author_id = 2;\n $this->assertSame($entity, $table->save($entity));\n\n $entity = new Entity([\n 'first_author_id' => 2,\n 'second_author_id' => 1,\n ]);\n $this->assertFalse($table->save($entity));\n $this->assertEquals(['first_author_id' => ['_isUnique' => 'This value is already in use']], $entity->getErrors());\n }",
"function addUniqueFieldset($fieldArr)\n {\n sort($fieldArr);\n if(!in_array($fieldArr, $this->m_uniqueFieldSets))\n $this->m_uniqueFieldSets[] = $fieldArr;\n }",
"function ensureUniqueProfileField($colname, $initial_colname, $unique = false)\n{\n\t$db = database();\n\t// Make sure this is unique.\n\t// @todo This may not be the most efficient way to do this.\n\tfor ($i = 0; !$unique && $i < 9; $i++)\n\t{\n\t\t$request = $db->query('', '\n\t\t\tSELECT \n\t\t\t\tid_field\n\t\t\tFROM {db_prefix}custom_fields\n\t\t\tWHERE col_name = {string:current_column}',\n\t\t\tarray(\n\t\t\t\t'current_column' => $colname,\n\t\t\t)\n\t\t);\n\t\tif ($request->num_rows() === 0)\n\t\t{\n\t\t\t$unique = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$colname = $initial_colname . $i;\n\t\t}\n\t\t$request->free_result();\n\t}\n\n\treturn $unique;\n}",
"public function uniqueFieldName($attribute, $params = array()) {\n $fields = self::model()->findAllByAttributes(array($attribute=>$this->$attribute,'modelName'=>$this->modelName));\n if(count($fields) > 0) {\n // There can and should only be one.\n $existingField = reset($fields);\n if($this->id != $existingField->id) {\n // This is not the field! Saving will produce a database\n // cardinality violation error due to the unique constraint on\n // model name and field name.\n $this->addError($attribute,Yii::t('admin','A field in the specified data model with that name already exists.'));\n }\n }\n }",
"function db_add_unique_key(&$ret, $table, $name, $fields) {\n $ret[] = update_sql('ALTER TABLE {'. $table .'} ADD UNIQUE KEY '.\n $name .' ('. _db_create_key_sql($fields) .')');\n}",
"public function skip_unique_validation () {\r\n\t\t$this->__skip_unique_validation = true;\r\n\t}",
"public function unique()\n {\n $this->assertUniqueIndex($this->getIndexName('unique'), $this->table->getIndexes());\n }",
"protected function validateUniquenessOf($fields,$message=null) {\n\t\t$this->isUnique[]=$fields;\n\t\tif(!is_array($fields)) {\n\t\t\t$fields=array($fields);\n\t\t}\n\t\tforeach($fields as $fieldname) {\n\t\t\tif(!$this->isField($fieldname)) {\n\t\t\t\tthrow new Exception('Invalid fieldname ('.$fieldname.') provided to validateUniquenessOf() in DataObject.php');\n\t\t\t}\n\t\t}\n\n\t\t$this->addValidator(new UniquenessValidator($fields,$message));\n\t}",
"function testAddUniqueKey(){\r\n global $webUrl;\r\n global $lang, $SERVER, $DATABASE;\r\n \r\n // Go to the constraints page\r\n\t\t$this->assertTrue($this->get(\"$webUrl/constraints.php\", array(\r\n\t\t\t'server' => $SERVER,\r\n\t\t\t'action' => 'add_unique_key',\r\n\t\t\t'database' => $DATABASE,\r\n\t\t\t'schema' => 'public',\r\n\t\t\t'table' => 'student'))\r\n\t\t);\r\n \r\n // Set properties for the new constraint \r\n $this->assertTrue($this->setField('name', 'unique_name'));\r\n $this->assertTrue($this->setField('TableColumnList', array('name'))); \r\n $this->assertTrue($this->setField('tablespace', 'pg_default'));\r\n $this->assertTrue($this->setField('IndexColumnList[]', 'name')); \r\n \r\n $this->assertTrue($this->clickSubmit($lang['stradd']));\r\n // Verify if the constraint is created correctly.\r\n $this->assertTrue($this->assertWantedText($lang['struniqadded']));\r\n \r\n return TRUE; \r\n }",
"public function unique(){\n if($this->unique != ''){\n $this->unique .= ',';\n }\n $this->unique = \" UNIQUE INDEX `\".$this->col.\"_UNIQUE` (`$this->col` ASC) VISIBLE\";\n }",
"public function validateUnique($field, $object) {\r\n\t\t$existing = $this->findByProperty($field, $object->$field);\r\n\t if (!is_null($existing)) {\r\n\t\t\tif ($object->isNew() || (!$object->isNew() && $object->getId() != $existing->getId())) {\r\n\t \t\t\treturn false;\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\t \t\t\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of idcontexte | public function getIdcontexte()
{
return $this->idcontexte;
} | [
"function getContextId() {\n\t\treturn $this->getData('contextId');\n\t}",
"public function getIdTypeContexte()\n {\n return $this->idTypeContexte;\n }",
"function getContextId() {\n\t\treturn $this->_contextId;\n\t}",
"function _getContextId() {\n\t\treturn $this->_contextId;\n\t}",
"function getIdValue()\n {\n }",
"public function getListContextId();",
"function idValue() {\n\t\treturn $this->_id ? $this->_id->__toString() : null;\n\t}",
"public function getContextObjId()\n\t{\n\t\treturn $this->context_obj_id;\n\t}",
"public function getContextIdentifier(): string;",
"public function getId(){\n\t\treturn $this->EventId;\n\t}",
"public function getContextIdentifier() {\n\t\treturn $this->contextIdentifier;\n\t}",
"public function getEvent_id() {\n return $this->getValue('event_id');\n }",
"public function getIdTecnico()\n {\n return $this->idTecnico;\n }",
"public function getValueId()\n {\n return $this->valueId;\n }",
"public function getIdent();",
"public function getIdTecnico() {\n return $this->idTecnico;\n }",
"public function getLabelcontexte()\n {\n return $this->labelcontexte;\n }",
"public function getContextSubObjId()\n\t{\n\t\treturn $this->context_sub_obj_id;\n\t}",
"private function getId () { return $this->id; }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to set the value of field is_new | public function setIsNew($is_new)
{
$this->is_new = $is_new;
return $this;
} | [
"public function setNew()\r\n {\r\n $this->new = true;\r\n }",
"public function setNew(){ $this->isNew = true; }",
"public function setIsNewRecord($value)\n\t{\n\t\t$this->_new=$value;\n\t}",
"public function setNew()\n {\n $this->status = self::STATUS_NEW;\n $this->save();\n }",
"public function getIsNew()\n {\n return $this->is_new;\n }",
"public function isNew()\n {\n return (bool) $this->is_new;\n }",
"public function setIsNewRecord($value)\n {\n $this->_isNewRecord = $value;\n }",
"public function getIsNew()\n {\n }",
"public function setIsNew()\n\t{\n\t\t$this->is_new_session = true;\n\n\t\treturn $this;\n\t}",
"public static function enableNewValues()\r\n\t{\r\n\t\tself::$createNew = true;\r\n\t}",
"public function setNewRevision($value = TRUE);",
"public function setIsNewView($isNewview)\r\n {\r\n $this->isNewView = $isNewview;\r\n }",
"public function test__IsAndSetNewResource() {\n\t\t// Reset value\n\t\t$this->_rr->setIsNewResource( true );\n\n\t\t// Verify previous class object\n\t\tverify( $this->_rr->isNewResource() )->true();\n\t}",
"public function isNew(){\n\t\treturn $this->newEntity;\n\t}",
"public function getIsNewRecord()\n {\n return $this->_isNewRecord;\n }",
"public function isCreateNewProperty(): bool\n {\n return $this->createNewProperty;\n }",
"public function isNew() {\n return $this->status == self::STATUS_NEW;\n }",
"function is_new_record() {\n\t\t\treturn $this->new_record;\n\t\t}",
"public function isnewUser()\n {\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetching the next eight upcoming events. | private function fetchUpcomingEvents()
{
$today = Carbon::now();
$upcomingEvents = Events::where('date', '>', $today)
->orderBy('date', 'asc')
->limit(8)
->get();
return $upcomingEvents;
} | [
"function\tget_upcoming_events() {\n\t\ttry {\n\t\t\t$now = new DateTime('NOW', new DateTimeZone('UTC'));\n\t\t\t$next_week = new DateTime('NOW', new DateTimeZone('UTC')); $next_week->modify('+1 week');\n\t\t\t$datetime_fmt = 'Y-m-d\\TH:i:s\\Z';\n\t\t\t$events = $this->get(\n\t\t\t\t'/v2/events',\n\t\t\t\tarray(\n\t\t\t\t\t'range[begin_at]' => ''.$now->format($datetime_fmt).','\n\t\t\t\t\t\t\t\t\t\t\t.$next_week->format($datetime_fmt),\n\t\t\t\t\t'sort' => 'begin_at,-id',\n\t\t\t\t\t'page[size]' => '100'\n\t\t\t\t)\n\t\t\t);\n\t\t\tif ($events === null) {\n\t\t\t\tcontextual_error_log('FtApiHandler: could not get upcoming events.');\n\t\t\t\treturn (null);\n\t\t\t}\n\t\t\t$events = $this->pare_events_data($events);\n\t\t\t$this->cache['upcoming_events'] = $events;\n\t\t\treturn ($events);\n\t\t}\n\t\tcatch (Exception $ex) {\n\t\t\tcontextual_error_log('FtApiHandler: could not get upcoming events. '\n\t\t\t\t.'Exception Message: '.$ex->getMessage());\n\t\t\treturn (null);\n\t\t}\n\t}",
"protected function fetchUpcomingEvents() {\n $startDateMin = strtotime('tomorrow 0:00:00');\n $startdateMax = strtotime('tomorrow 23:59:59');\n $result = $this->db->fetchAll('SELECT * FROM ' . $this->eventTable . ' WHERE publish_social = 1 AND startDate > ? AND startDate <= ?', array($startDateMin, $startdateMax));\n\n return $result;\n }",
"private function fetchUpcomingEvents()\n {\n $today = Carbon::now();\n $events = Events::where('date', '>=', $today )\n ->orderBy('date', 'asc')\n ->get();\n return $events;\n }",
"public static function getNextEvents() {\n\n $startDate = Carbon::now() -> format('Y-m-d');\n $endDate = Carbon::now() -> addWeeks(4) -> format('Y-m-d');\n\n $events = Event::all() -> where(\"date\", \">=\", $startDate)\n -> where(\"date\", \"<=\", $endDate);\n\n foreach ($events as $event) {\n $event -> date = Carbon::createFromFormat(\"Y-m-d\", $event -> date)\n -> format(\"d/m/Y\");\n }\n\n return $events;\n\n }",
"protected function fetch_upcoming_events() {\n\t\t$wordcamp_events = $this->get_wordcamp_events();\n\t\t$meetup_events = $this->get_meetup_events();\n\n\t\t$events = array_merge( $wordcamp_events, $meetup_events );\n\n\t\treturn $events;\n\t}",
"function getUpcomingEvents($limit)\n{\n\t$data = array();\n\t$limitText = '';\n\tif($limit != 0)\n\t\t$limitText = 'LIMIT '.$limit;\n\t\n\t$eventquery = 'SELECT event_id, name FROM `events` WHERE `eventdatetime` >= NOW() ORDER BY `eventdatetime` '.$limitText;\n\t$eventresults = mysql_query($eventquery)\n\t\tor die(mysql_error());\n\t\n\tif (mysql_num_rows($eventresults) != 0)\n\t{\n\t\twhile ($eventrow = mysql_fetch_array($eventresults))\n\t\t{\n\t\t\t$data[] = array('link'=>'./viewevent.php?event_id='.$eventrow['event_id'],\n\t\t\t\t\t\t\t'name'=>$eventrow['name']);\n\t\t}\n\t}\n\treturn $data;\n}",
"public function fetchEvents();",
"public function getUpcoming() {\r\n \r\n $params = array(\r\n date(\"Y-m-d\"),\r\n date(\"Y-m-d\", strtotime(\"tomorrow\")),\r\n 0\r\n );\r\n \r\n $query = \"SELECT id FROM reminders WHERE reminder >= ? AND reminder < ? AND sent = ?\";\r\n \r\n foreach ($this->db->fetchAll($query, $params) as $row) {\r\n yield new Reminder($row['id']);\r\n }\r\n }",
"public function getUpcoming()\n {\n return $this->database\n ->table('events')\n ->whereRaw('Date(start) > CURDATE() AND status < 4')\n ->orderBy('start', 'asc')\n ->get();\n }",
"public function listUpcomingEventsAction() {\n\t\t$url = $this->settings['calendarUrl'];\n\t\tif (empty($url)) {\n\t\t\treturn '';\n\t\t}\n\t\t$service = $this->objectManager->get('B13\\\\Amazingcalendar\\\\Service\\\\CalendarService');\n\t\t// only take the upcoming ones\n\t\t$events = $service->getUpcomingEvents($url);\n\n\t\t$limit = (int)$this->settings['limit'];\n\t\tif ($limit) {\n\t\t\t$events = array_slice($events, 0, $limit);\n\t\t}\n\t\t$this->view->assign('events', $events);\n\t}",
"function getFutureEvents($count, $offset) {\n $query = \"SELECT *, lower(termin)::date AS von, upper(termin)::date AS bis, wettkampf.anzahl_strecken FROM main.wettkampf WHERE (now() BETWEEN lower(termin) AND upper(termin)) OR now() < lower(termin) ORDER BY termin ASC LIMIT \".pg_escape_literal($count).\" OFFSET \".pg_escape_literal($offset).\";\";\n return $query;\n}",
"function getCommingEvents($maxPageSize, $numberOfEventsToDisplay){\n $commingEvents = array($numberOfEventsToDisplay);\n $now=time();\n\t$allEvents = mysqlQuery($db,\"select * from event order by date desc\");// Tous les evenements\n $numberOfEvent = count($allEvents);\n $numberOfPages = ceil($numberOfEvent / $maxPageSize);\n\t\n\t$numberAlreadyDisplayed = 0;\n\tfor ($i=0; $i<$numberOfEvent; $i++){\n\t $event=$allEvents[$i];\n\t $eventDate=sqlDateToTs($event[\"date\"]);\n\t if($eventDate>$now && $numberAlreadyDisplayed < $numberOfEventsToDisplay){ // Display only 4 next future events\n\t $commingEvents[$numberAlreadyDisplayed]=$event;\n\t $numberAlreadyDisplayed++;\n\t }\n\t }\n\treturn $commingEvents;\n}",
"function fwp_display_upcoming_events()\n {\n $events = fwp_get_future_events();\n\n $count = count($events);\n if ($count <= 1) {\n return 'Coming Soon.';\n }\n $i = 1;\n while ($i <= 4 && $i < $count) :\n $post = get_post($events[$i]['id']);\n $permalink = get_permalink($post->ID);\n // get event start date\n $start_date = fwp_get_start_date($post->ID);\n //get section html\n ob_start();\n ?>\n <a class=\"row p-0 m-0\" href=\"<?= $permalink ?>\">\n <div id=\"<?= $post->post_title ?>\" class=\"col-sm-12 p-0\" style=\"border-left:2px solid black;\">\n <h5 style=\"margin:0 0 0 0;color:black;\"><?= $start_date ?></h5>\n <h4 style=\"margin:0 0 5px 0;\"><?= $post->post_title ?></h4>\n </div>\n </a>\n<?php\n $i++;\n endwhile;\n $output = ob_get_contents();\n ob_end_clean();\n\n /* Restore original Post Data */\n wp_reset_postdata();\n return $output;\n }",
"public static function get_events()\n {\n global $CFG,$PAGE;\n\n require_once($CFG->dirroot.'/calendar/lib.php');\n $courseid = $PAGE->course->id;\n $categoryid = ($PAGE->context->contextlevel === CONTEXT_COURSECAT) ? $PAGE->category->id : null;\n $calendar = \\calendar_information::create(time(), $courseid, $categoryid);\n\n list($data, $template) = calendar_get_view($calendar, 'upcoming_mini');\n return $data->events;\n }",
"public function get_upcoming() {\n\t\t$sql = \"SELECT DATE_FORMAT (datetime,'%M %e') as date, event FROM events\n\t\tWHERE datetime > now() limit 2\";\n\t\t$eh = $this->pdo->query($sql);\n\t\t$text = \"Upcoming Events: \\n-------------------\\n \";\n\t\t\tforeach ($eh as $ev ){\n\t\t\t\t$text .= $ev['date'] . \": \" . $ev['event'] . NL;\n\t\t\t}\n\t\t$text .= NL;\n\t\tfile_put_contents(FileDefs::next_dir . '/' . FileDefs::tease_calendar,$text);\n\t\t//echo $text . BRNL;\n\n\t\treturn true;\n\t}",
"public function upcomingEvents ($limit = 20) {\n\t\treturn $this->getData('upcomingEvents', array('limit' => intval($limit)));\n\t}",
"public function get_all_upcoming_event_list($startingLimit)\n\t{\n\t\t/*$sql=\"SELECT *,TIMESTAMP(CURDATE(),CURTIME()) as current_date_time,\n\t\tTIMESTAMP(events_start_date,events_start_time) as events_starting_date_time,\n\t\tTIMESTAMP(events_end_date,events_end_time) as events_ending_date_time, \n\t\tFLOOR(HOUR(TIMEDIFF(TIMESTAMP(events_start_date,events_start_time), TIMESTAMP(CURDATE(),CURTIME()))) / 24) as events_counting_days ,\n\t\tMOD(HOUR(TIMEDIFF(TIMESTAMP(events_start_date,events_start_time), TIMESTAMP(CURDATE(),CURTIME()))), 24)as events_counting_hours, \n\t\tMINUTE(TIMEDIFF(TIMESTAMP(events_start_date,events_start_time), TIMESTAMP(CURDATE(),CURTIME()))) as events_counting_minutes FROM events \n\t\tWHERE TIMESTAMP(events_start_date,events_start_time)>TIMESTAMP(CURDATE(),CURTIME())\n\t\t AND TIMESTAMP(events_end_date,events_end_time)>TIMESTAMP(CURDATE(),CURTIME())\n\t\t AND events_active=1\n\t\torder by events_id DESC limit $startingLimit,\".EVENTS_LIMIT;*/\n\t\t\n\t\t\n\t\t$sql=\"SELECT *,TIMESTAMP(CURDATE(),CURTIME()) as current_date_time,\n\t\tTIMESTAMP(events_start_date,events_start_time) as events_starting_date_time,\n\t\tTIMESTAMP(events_end_date,events_end_time) as events_ending_date_time\n\t\tFROM events \n\t\tWHERE TIMESTAMP(events_start_date,events_start_time)>TIMESTAMP(CURDATE(),CURTIME())\n\t\t AND TIMESTAMP(events_end_date,events_end_time)>TIMESTAMP(CURDATE(),CURTIME())\n\t\t AND events_active=1\n\t\torder by events_id DESC limit $startingLimit,\".EVENTS_LIMIT;\n\t\t$query=$this->db->query($sql);\n\t\treturn $query->result_array();\n\t}",
"public function fetchAllEvents();",
"public function yieldUpcomingEvents() {\n $Events = new Events;\n \n foreach ($Events->getUpcomingEventsForOrganisation($this) as $date) {\n foreach ($date as $row) {\n yield new EventDate($row['event_date']);\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the full list of donation items | public function getDonationItems()
{
return craft()->httpSession->get('growDoughItems', array());
} | [
"public function getDonationItems(): array\n {\n return \\Craft::$app->session->get('growDoughItems', []);\n }",
"public function donations(){\n include_once 'donation.class.php';\n return $this->get_dependents('donation');\n }",
"public function getDonations()\r\n\t \t{\r\n\t \t\treturn $this->player->donations;\r\n\t \t}",
"function donated()\n\t{\n\t\tuser::login($org_id);\n\n\t\t$query = result::fields\n\t\t(\n\t\t\t['Name', 'item_name', 'item_pop()', 'input()'],\n\t\t\t['Partner', 'partner', 'partner()', 'input()'],\n\t\t\t['Status', 'date_status', 'status()'],\n\t\t\t['', '', '', ['status' => 'dropdown()']],\n\t\t\t['Donor', 'donor_qty', 'donor', 'input()'],\n\t\t\t['Donee', 'donee_qty', 'donee', 'input()'],\n\t\t\t['', '', '', 'submit(Search)'],\n\t\t\t['', '', 'button(donations/{donation_id}, Details)']\n\t\t);\n\n\t\t//Search was taking too long (and db running out of memory) without a specific search term\n\t\t$terms = count(array_filter($query));\n\n\t\tif($terms) {\n\t\t\t//item_id > 0 makes query significantly faster\n\t\t\t$query += ['item_id >' => 0, 'donor_id' => $org_id];\n\n\t\t\t//Added because otherwise mysql temp file size throws error, although this does ruin user sorting\n\t\t\t//$this->db->order_by('donation_items.id', 'desc');\n\t\t\t$v = ['record' => donation::search($query, 'donation_items.id')];\n\t\t} else {\n\t\t\t$v = ['record' => new result];\n\t\t}\n\n\t\tview::full('records', 'donated record', $v);\n\t}",
"public function getPurchasedItems();",
"public function getDonations() {\n\t\tif ($this->donations === NULL) {\n\t\t\t$this->donations = New Tx_Extbase_Persistence_ObjectStorage();\n\t\t\tForEach($this->getRegistrations() As $registration)\n\t\t\t$this->donations->addAll($registration->getDonations());\n\t\t}\n\t\treturn $this->donations;\n\t}",
"public function getRefrigeratorItems() {\n return $this->getEntityManager()\n ->createQuery('SELECT produceItem FROM App\\Entity\\ProduceItem produceItem WHERE produceItem.isInShoppingList = :bool ORDER BY produceItem.expiration_date ASC')\n ->setParameter('bool', false)\n ->getResult();\n }",
"public function donations()\n {\n return $this->hasMany(Donation::class);\n }",
"public function getDueItems(){\n\t\t$dueItems = array();\n\t\t$today = date('Ymd');\n\t\t$data = $this->connection->selectValues('SELECT tNr FROM skolib_ausleihe \n\t\tWHERE rueck = 0 \n\t\tAND frist <\"'.$today.'\"\n\t\tAND mahn = 0');\n\t\tif ($data) {\n\t\t\tforeach ($data as $d){\n\t\t\t$item = new LibraryItem();\n\t\t\t$item->constructFromId( $d[0] ); \n\t\t\t$dueItems[] = $item;\t\t\t\n\t\t\t}\n\t\t}\n\treturn $dueItems;\t\n\t}",
"public function getDonation()\n {\n $url = \"https://api-staging.globedreamers.fr/api/v1/travels/donations/list\";\n $vqr = file_get_contents($url);\n $donation = json_decode($vqr, true)['data'];\n\n return view('Donation/list', array('donation' => $donation));\n }",
"public function donations()\n {\n return $this->hasManyThrough('Helpsmile\\Donation','Helpsmile\\Donor');\n }",
"public function donations()\n {\n return $this->morphedByMany(Donation::class, 'taggable');\n }",
"public function donations()\n {\n return $this->hasMany('App\\\\Donation');\n }",
"private function get_donations( $atts = array() ) {\n\t\tglobal $wpdb;\n\n\t\t// Backward compatibility\n\t\t$donation_id_col = Give()->payment_meta->get_meta_type() . '_id';\n\n\t\t$query_params = $this->get_query_param( $atts );\n\n\t\t$sql = \"SELECT p1.ID FROM {$wpdb->posts} as p1\";\n\t\t$where = \" WHERE p1.post_status IN ('publish') AND p1.post_type = 'give_payment'\";\n\n\t\t// exclude donation with zero amount from result.\n\t\t$sql .= \" INNER JOIN {$wpdb->donationmeta} as m1 ON (p1.ID = m1.{$donation_id_col})\";\n\t\t$where .= \" AND m1.meta_key='_give_payment_total' AND m1.meta_value>0\";\n\n\n\t\tif ( $query_params['form_id'] ) {\n\t\t\t$sql .= \" INNER JOIN {$wpdb->donationmeta} as m2 ON (p1.ID = m2.{$donation_id_col})\";\n\t\t\t$where .= \" AND m2.meta_key='_give_payment_form_id' AND m2.meta_value={$query_params['form_id']}\";\n\t\t}\n\n\t\t// exclude donations which does not has donor comment.\n\t\tif ( $query_params['only_comments'] ) {\n\t\t\t$sql .= \" INNER JOIN {$wpdb->give_comments} as gc1 ON (p1.ID = gc1.comment_parent)\";\n\t\t\t$where .= \" AND gc1.comment_type='donor_donation'\";\n\t\t}\n\n\t\t// exclude anonymous donation form query based on query parameters.\n\t\tif (\n\t\t\t! $query_params['anonymous']\n\t\t\t|| $query_params['only_comments']\n\t\t) {\n\t\t\t$where .= \" AND p1.ID NOT IN ( SELECT DISTINCT({$donation_id_col}) FROM {$wpdb->donationmeta} WHERE meta_key='_give_anonymous_donation' AND meta_value='1')\";\n\t\t}\n\n\t\t// order by query based on parameter.\n\t\tif ( 'donation_amount' === $query_params['orderby'] ) {\n\t\t\t$order = \" ORDER BY m1.meta_value+0 {$query_params['order']}\";\n\t\t} else {\n\t\t\t$order = \" ORDER BY p1.{$query_params['orderby']} {$query_params['order']}, p1.ID {$query_params['order']}\";\n\t\t}\n\n\t\t$limit = \" LIMIT {$query_params['limit']}\";\n\t\t$offset = \" OFFSET {$query_params['offset']}\";\n\n\t\t$sql = $sql . $where . $order . $limit . $offset;\n\n\t\t$donation_ids = $wpdb->get_col( $sql );\n\n\t\treturn $donation_ids;\n\t}",
"public function donations()\n {\n return $this->hasMany('App\\Donation');\n }",
"function getSupplierItems();",
"public function donations()\n {\n return $this->hasMany('Helpsmile\\Donation');\n }",
"public function getAdditionalDeliveries();",
"public function getAllOneTimeDonations()\n {\n return craft()->donationForm_model->getAllOneTimeDonations();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns whether the Database has been set | public function databaseExists ()
{
return isset( $this->database );
} | [
"private function hasDatabaseSet()\n {\n\n if( empty( $this->database ) )\n {\n\n return false;\n }\n\n return true;\n }",
"public function hasDB(){\n\t\t\treturn !is_null($this->getConnection());\n\t\t}",
"private function applicationUsesDatabase()\n {\n return ! empty($this->app['config']['database.default']);\n }",
"public function usesDatabase()\n {\n return $this->database()->exists();\n }",
"public function isDatabaseRequired(): bool\n {\n return $this->config[self::ENABLED_DATABASE];\n }",
"public function canManageDatabase() {\n\t\tif($this->manageDatabase == false) {\n\t\t\t$this->manageDatabase = 0;\n\t\t}\n\t\treturn $this->manageDatabase;\n\t}",
"public function isDatabaseRequired():bool;",
"public function hasDb(): bool;",
"public function is_valid_db() {\n if ($this->dbcount > 0) {\n return true;\n } else {\n return false;\n }\n }",
"public function databaseInitialised()\r\n {\r\n return !empty($this->database_handler);\r\n }",
"public function hasDatabaseName()\n {\n return $this->databaseName !== '';\n }",
"public function isDatabaseRequired()\n {\n return $this->isSomethingRequired(array(\n 'full_backup', 'database'\n ));\n }",
"public function isInDb()\n\t{\n\t\treturn $this->_inDb;\n\t}",
"protected function isDatabaseReady() {\n\t\t// Such as during setup of testsession prior to DB connection.\n\t\tif(!DB::isActive()) return false;\n\n\t\t// If we have a DB of the wrong type then complain\n\t\tif (!(DB::getConn() instanceof MySQLDatabase)) {\n\t\t\tthrow new Exception('HybridSessionStore currently only works with MySQL databases');\n\t\t}\n\n\t\t// Prevent freakout during dev/build\n\t\treturn ClassInfo::hasTable('HybridSessionDataObject');\n\t}",
"public function hasDatabaseName();",
"protected function isDatabaseReady()\n {\n // Such as during setup of testsession prior to DB connection.\n if (!DB::is_active()) {\n return false;\n }\n\n // If we have a DB of the wrong type then complain\n if (!(DB::get_conn() instanceof MySQLDatabase)) {\n throw new Exception('HybridSessions\\Store\\DatabaseStore currently only works with MySQL databases');\n }\n\n // Prevent freakout during dev/build\n return ClassInfo::hasTable('HybridSessionDataObject');\n }",
"public function inDB()\n {\n return $this->in_db;\n }",
"function _dbInfoExists()\n\t{\n\t\tif(!$this->master_db)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\tif(count($this->slave_db) === 0)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}",
"private static function selectDatabaseIfNecessary() {\n\t\t\n\t\tif (strcasecmp(DatabaseManager::$lastDatabaseSelected, SystemDatabaseManager::$dbName) != 0) {\n\t\t\t\n\t\t\tif (DatabaseManager::selectDatabase(SystemDatabaseManager::$dbName, SystemDatabaseManager::$instance->connection)) {\n\t\t\t\tDatabaseManager::$lastDatabaseSelected = SystemDatabaseManager::$dbName;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for createOidcTestConfig Create OIDC Test Configuration. | public function testCreateOidcTestConfig()
{
} | [
"public function createOidcTestConfig($body)\n {\n list($response) = $this->createOidcTestConfigWithHttpInfo($body);\n return $response;\n }",
"public function testUserCredentialsOidc()\n {\n }",
"public function testCreateOrganizationConfigTemplate()\n {\n }",
"public function testGetLti13OidcLoginInitiation()\n {\n }",
"public function testGetConfigCreatesConfig()\n {\n $this->assertAttributeEmpty('config', $this->obj);\n $cfg = $this->obj->config();\n $this->assertInstanceOf(GenericConfig::class, $cfg);\n }",
"public function createOidcTestConfigWithHttpInfo($body)\n {\n $returnType = '\\Swagger\\Client\\Model\\OIDCConfig';\n $request = $this->createOidcTestConfigRequest($body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\OIDCConfig',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 422:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\ValidationError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function testGetConfig()\n {\n $config = $this->api->getConfig();\n $this->assertTrue(!is_null($config['clientid']), \"Please fill out the configuration files\");\n }",
"public function testGetIdentityprovidersCic()\n {\n }",
"public function testUpdateOidcConfig()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testGetSeedCompanyStrainsByOcpc()\n {\n }",
"public function testCreateClientConfig() {\n $client_config = ['rest_api_url' => 'http://example.com'];\n $akamai_client = $this->getClient($client_config);\n $this->assertEquals(['base_uri' => 'http://example.com', 'timeout' => 300], $akamai_client->createClientConfig());\n\n $client_config = ['devel_mode' => TRUE];\n $akamai_client = $this->getClient($client_config);\n $this->assertEquals(['base_uri' => 'http://debug.com', 'timeout' => 300], $akamai_client->createClientConfig());\n }",
"public function testConfigure() {\n \n }",
"public function testExecuteConfigurationAction()\n {\n }",
"public function testDeleteUserCredentialsOidc()\n {\n }",
"public function testElementCreateConfig()\r\n {\r\n\r\n }",
"public function testCreateBuildOpenshiftIoV1BuildConfigForAllNamespaces()\n {\n\n }",
"public function testCustomerContractSetupAndActivateContractBycontractId()\n {\n }",
"public function testUpdateOidcConfig()\n {\n }",
"public function testGetIdentityprovidersOkta()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
confirm order and send notification to the client | public function confirmOrder(Request $request)
{
$order = $request->user()->orders()->find($request->order_id);
if(!$order){ return apiResponse(0, 'هذا الطلب غير موجود'); }
if($order->state!='accepted'){ return apiResponse(1, 'لا يمكن تأكيد طلبك , الطلب غير مقبول'); }
$order->update(['state'=>'delivered']);
$client = Client::find($request->client_id);
//send notification to client for the rejected order
$client->notifications()->create([
'title' =>'تم تأكدي وصول طلبك',
'content'=>'تم تأكيد توصيل طلبك رقم '.$request->order_id,
'order_id'=>$order->id
]);
$tokens = $client->tokens()->where('token', '!=', '')->pluck('token')->toArray();
//by fire base
$send = null;
if(count($tokens)){
$title='Sofra';
$body =$notifications->content;
$data = [
'order'=>$order->fresh()->load('items')//load(lazy eager loading)like ->with('items')
];
$send = notifyByFirebase($title,$body, $tokens, $data);
info('Firebase result:' . $send);
}
return apiResponse(1, 'تم الطلب بنجاح' , $send);
} | [
"public function requestconfirmAction() {\n $purchaseOrderId = $this->getRequest()->getParam('id');\n $purchaseOrder = Mage::getModel('inventorypurchasing/purchaseorder')->load($purchaseOrderId);\n try {\n $purchaseOrder->setStatus(Magestore_Inventorypurchasing_Model_Purchaseorder::WAITING_CONFIRM_STATUS)\n ->save();\n if (Mage::getStoreConfig('inventoryplus/purchasing/send_email_to_supplier_after_request_confirmation')) {\n $purchaseOrderProducts = Mage::getModel('inventorypurchasing/purchaseorder_product')->getCollection()\n ->addFieldToFilter('purchase_order_id', $purchaseOrderId);\n\n $sqlNews = $purchaseOrderProducts->getData();\n $this->sendEmail($purchaseOrder->getSupplierId(), $sqlNews, $purchaseOrderId);\n $purchaseOrder->setSendMail(1)->save();\n }\n Mage::getSingleton('vendors/session')->addSuccess(\n Mage::helper('inventorypurchasing')->__('Purchase order has been requested for confirmation.')\n );\n $this->_redirect('*/*/edit', array('id' => $purchaseOrderId));\n } catch (Exception $e) {\n Mage::getSingleton('vendors/session')->addError(\n Mage::helper('inventorypurchasing')->__('There is error while confirming purchase order.')\n );\n Mage::getSingleton('vendors/session')->addError(\n $e->getMessage()\n );\n $this->_redirect('*/*/edit', array('id' => $purchaseOrderId));\n }\n }",
"public function postConfirmOrder()\n {\n // $order_id = request('order_id');\n\n // // confirm the sales order\n // $this->odoo->call('sale.order', 'action_confirm', array($order_id));\n\n // /**\n // * Validate the picking. Since we invoice only products that are delivered, we first have to create a transfer\n // * and then process that transfer. It is the same as clicking on \"validate\" on the stock picking view\n // */\n // $picking_id = $this->odoo->where('id', '=', $order_id)\n // ->fields('picking_ids')\n // ->get('sale.order')\n // ->first();\n // $immediate_picking_id=$this->odoo->create('stock.immediate.transfer', array('pick_id' => $picking_id['picking_ids'][0]));\n // $this->odoo->call('stock.immediate.transfer', 'process', array($immediate_picking_id));\n\n // /**\n // * Create the invoice related to order and picking\n // */\n // $sale_order_to_invoice_data = array($order_id, array('context' => array('active_ids' => $order_id)));\n // $invoice_id = $this->odoo->call('sale.order', 'action_invoice_create', $sale_order_to_invoice_data);\n // $this->odoo->call_wf('account.invoice', 'invoice_open', $invoice_id->first());\n\n /**\n * Create the payment in Odoo\n */\n\n\n return response()->json(['confirmed' => true]);\n }",
"public function confirm_order($id)\n {\n $order = Order::where('id', $id)->first();\n \n $data['user'] = User::where('id', $order->user_id)->first();\n $data['order'] = $order;\n $user = $data['user']; \n\n Mail::send('emails.confirmation_email', $data , function ($m) use ($user) \n {\n $m->to($user->email, $user->first_name.\" \".$user->last_name)->subject('Order Confirmation');\n });\n //dd(view('emails.admin_confirmation_email', $data)->render());\n Mail::send('emails.admin_confirmation_email', $data , function ($m) use ($user) \n {\n $m->to(Config::get('settings.admin_email'),'Admin')->subject('Order Confirmation');\n });\n\n Order::where('id', $id)->update(['is_confirmed' => '1', 'status' => Config::get('status.confirmed')]);\n return redirect('new_orders/list');\n }",
"public function confirmOrder($order)\n {\n /** @var $order \\Magento\\Sales\\Model\\Order */\n if ($order->getShippingMethod() == 'logitrail_logitrail') {\n $api = $this->getApi();\n $api->setResponseAsRaw(true);\n $logitrailId = $order->getLogitrailOrderId();\n $address = $order->getShippingAddress();\n $email = $address->getEmail() ? : $order->getCustomerEmail();\n // Update customerinfo to make sure they are correct\n // firstname, lastname, phone, email, address, postalCode, city\n $api->setCustomerInfo(\n $address->getFirstname(),\n $address->getLastname(),\n $address->getTelephone(),\n $email,\n join(' ', $address->getStreet()),\n $address->getPostcode(),\n $address->getCity(),\n $address->getCompany(),\n $address->getCountryId()\n );\n\n $api->setOrderId($order->getId());\n $api->updateOrder($logitrailId);\n $rawResponse = $api->confirmOrder($logitrailId);\n $response = json_decode($rawResponse, true);\n if ($response) {\n if ($this->_getConfig('autoship') and $order->canShip()) {\n /** @var \\Magento\\Sales\\Model\\Convert\\Order $convertOrder */\n $convertOrder = $this->convertOrderFactory->create();\n\n /** @var \\Magento\\Sales\\Model\\Order\\Shipment $shipment */\n $shipment = $convertOrder->toShipment($order);\n\n foreach ($order->getAllItems() as $item) {\n // Check if order item has qty to ship or is virtual\n if (! $item->getQtyToShip() || $item->getIsVirtual()) {\n continue;\n }\n\n $qtyShipped = $item->getQtyToShip();\n\n // Create shipment item with qty\n $shipmentItem = $convertOrder->itemToShipmentItem($item)->setQty($qtyShipped);\n\n // Add shipment item to shipment\n $shipment->addItem($shipmentItem);\n }\n\n $shipment->register();\n $shipment->addComment(__(\"Tracking URL: \") . str_replace('\\\\', '', $response['tracking_url']));\n $track = $this->trackFactory->create();\n $track->addData(array(\n 'carrier_code' => 'custom',\n 'title' => 'Logitrail',\n 'number' => $response['tracking_code']\n ));\n $shipment->addTrack($track);\n $shipment->getOrder()->setIsInProcess(true);\n\n $transactionSave = $this->transactionFactory->create();\n $transactionSave->addObject($shipment)\n ->addObject($order)\n ->save();\n $this->shipmentNotifier->notify($shipment);\n } // if autoship\n $order->addStatusHistoryComment(sprintf(__(\"Logitrail Order Id: %s, Tracking number: %s, Tracking URL: %s\"), $logitrailId, $response['tracking_code'], str_replace('\\\\', '', $response['tracking_url'])));\n if ($this->isTestMode()\n ) {\n $this->logger->info(\"Confirmed order $logitrailId, response $rawResponse\");\n }\n } else { // confirmation failed\n $order->addStatusHistoryComment(__('Error: could not confirm order to Logitrail. Logitrail Order Id: ' . $logitrailId));\n $this->logger->error(\"Could not confirm order to Logitrail. Logitrail Order Id: $logitrailId Response: $rawResponse\");\n if ($this->isTestMode()) {\n $this->logger->error(\"Error: could not confirm order to Logitrail. Logitrail Order Id: $logitrailId Response: $rawResponse\");\n }\n }\n }\n }",
"public function sendOrderConfirmationEmail() {\n\n // prepare confirmation email data\n $httpHost = t3lib_div::getIndpEnv('HTTP_HOST'); // this is empty in CLI mode\n $orderHost = (!empty($httpHost) ? $httpHost : $this->gsaShopConfig['shopName']);\n $mailRecipient = $this->orderWrapperObj->get_feCustomerObj()->get_feUserObj()->get_email1();\n $mailSubject = sprintf(tx_pttools_div::getLLL(__CLASS__.'.orderEmailSubject', $this->llArray), $orderHost);\n \n // prepare email body\n $orderPresentatorObj = new tx_ptgsashop_orderPresentator($this->orderWrapperObj->get_orderObj());\n $mailBody = $orderPresentatorObj->getPlaintextPresentation($this->gsaShopConfig['templateFileFinalOrderMail'], $this->orderWrapperObj->get_relatedDocNo()); // get final order as plaintext\n if (is_int(stripos($mailBody, 'Smarty error'))) {\n throw new tx_pttools_exception('Error in smarty template'); // recognize error in mail body\n }\n #die('<pre>'.$mailBody.'</pre>'); // for development only: display mail body and die (outcomment this line in production environment!!)\n\n // prepare mail object\n $mail = new tx_ptmail_mail($this, 'orderConfirmation'); \n $mail->set_subject($mailSubject); \n $mail->set_body($mailBody);\n $mail->set_to(new tx_ptmail_addressCollection(new tx_ptmail_address($mailRecipient))); \n \n // additional email configuration (from, cc, bcc, reply-to) is done via typoscript, basic config see pt_gsashop/static/pt_mail_config/setup.txt\n /*\n $mailSender = (!empty($this->gsaShopConfig['orderEmailSender']) ? $this->gsaShopConfig['orderEmailSender'] : $this->extKey.'@'.$orderHost); \n $mail->set_from(new tx_ptmail_address($mailSender));\n if (!empty($this->gsaShopConfig['orderEmailRecipient'])) {\n $mail->set_cc(new tx_ptmail_addressCollection(new tx_ptmail_address($this->gsaShopConfig['orderEmailRecipient'])));\n }\n if (!empty($this->gsaShopConfig['orderConfirmationEmailBcc'])) {\n $mail->set_bcc(new tx_ptmail_addressCollection(new tx_ptmail_address($this->gsaShopConfig['orderConfirmationEmailBcc'])));\n }\n if (!empty($this->gsaShopConfig['orderConfirmationEmailReplyTo'])) {\n $mail->set_reply(new tx_ptmail_address($this->gsaShopConfig['orderConfirmationEmailReplyTo']));\n }\n */\n \n // TODO: charsets? language?\n \n // send mail\n $result = $mail->sendMail();\n tx_pttools_assert::isTrue($result, array('message' => 'Error while sending the order confirmation email!'));\n \n }",
"function hrb_order_canceled_notify_admin( $order ) {\n\n\t$order_link = html_link( esc_url( hrb_get_order_admin_url( $order->get_id() ) ), '#' . $order->get_id() );\n\t$subject = sprintf( __( '[%s] Order #%d was canceled', APP_TD ), get_bloginfo( 'name' ), $order->get_id() );\n\n\t$content = sprintf( __( \"Hello,%s Order %s has just been canceled.\", APP_TD ), \"\\r\\n\\r\\n\", $order_link );\n\n\t$content .= _hrb_order_summary_email_body( $order );\n\n\tappthemes_send_email( get_option( 'admin_email' ), $subject, wpautop( $content ) );\n}",
"protected function sendConfirmation()\n\t{\n\t\t$mail = new AccountConfirmation($this->user);\n\t\tapp('queue')->push(new MailDispatcher($mail));\n\t}",
"function hrb_order_canceled_notify_admin( $order ) {\n\n\t$order_link = html_link( hrb_get_order_admin_url( $order->get_id() ), '#'.$order->get_id() );\n\t$subject = sprintf( __( '[%s] Order #%d was Canceled', APP_TD ), get_bloginfo( 'name' ), $order->get_id() );\n\n\t$content = sprintf(\n\t\t__( \"Hello,%s\n\t\tOrder %s, has just been canceled.\", APP_TD ), \"\\r\\n\\r\\n\", $order_link\n\t);\n\n\t$content .= _hrb_order_summary_email_body( $order );\n\n\tappthemes_send_email( get_option( 'admin_email' ), $subject, wpautop( $content ) );\n}",
"public function sendConfirmationOfReceipt() {\n global $smarty, $user, $language;\n\n $smarty->assign('user', $user);\n $smarty->assign('cart', $this);\n $smarty->assign('date', new DateTime());\n\n $mailOutput = $smarty->fetch('mail_' . $language . '_receipt.tpl');\n mail($user->getUsername(), \"Plants for your Home\", $mailOutput, \"From: plants-for-your-home@no-host\");\n }",
"public function onConfirmPayment()\n {\n $data = post();\n\n try{\n\n $order = Order::whereOrderNo($data['order_no'])->first();\n\n if(!$order) {\n throw new \\ApplicationException(\"Order doesn't exist\");\n } else if(Confirm::whereOrderNo($data['order_no'])->exists()) {\n throw new \\ApplicationException(\"You have confirmed your payment before, we will tell you if your payment has been confirmed.\");\n // \\Log::info(Confirm::whereOrderNo($data['order_no'])->exists());\n } else if($order->status_code != \"waiting\") {\n throw new \\ApplicationException(\"Your order has been paid\");\n } else if($order->invoice->payment_method->name != \"Bank Transfer\") {\n throw new \\ApplicationException(\"Your order didn't use bank transfer method\");\n } else {\n if($confirm = Confirm::create($data)) {\n $paymentConfirmation = $order->payment_confirmation()->orderBy('created_at', 'DESC')->first();\n Mail::send('octobro.banktransfer::mail.payment_confirmation', compact('order', 'paymentConfirmation'), function($message) use($order) {\n $message->to($order->email, $order->name);\n $message->subject('Konfirmasi Pembayaran anda [#'.$order->order_no.']');\n });\n }\n\n Flash::success($this->property(\"successMessage\"));\n return Redirect::to(Page::url($this->property('redirectPage')));\n }\n\n } catch(Exception $e) {\n throw new \\ApplicationException(\"Your order is not valid\");\n }\n }",
"public function testMatchedOrderConfirmation()\n {\n\t\t$result = TiresiasOrderConfirmation::send($this->order, $this->account, 'test123');\n\n\t\t$this->specify('successful matched order confirmation', function() use ($result) {\n\t\t\t$this->assertTrue($result);\n\t\t});\n }",
"public function sendOrderConfirmation($order)\n {\n $customerModel = JModelLegacy::getInstance('Customer', 'KetshopModel');\n $customer = $customerModel->getItem($order->customer_id);\n $order = $this->getCompleteOrder($order);\n\n $message = $this->setOrderConfirmationEmail($customer, $order);\n $this->sendEmail($customer, $message);\n }",
"public function confirm_delivery(Request $request)\n {\n $trans_id = $request->transaction_id;\n $tracking_number = $request->tracking_number;\n $couriers = Courier::where('transaction_id', $trans_id);\n $update_couriers = $couriers->update([\n 'confrim' => 1,\n 'tracking_number' => $tracking_number\n ]); \n\n if($update_couriers){\n\n $user = DB::table('order_confirm_view')\n ->where('transaction_id', $trans_id)\n ->first();\n\n $detail_order = DB::table('order_detail_view')\n ->where('id', $trans_id)\n ->get();\n \n // This for send mails if Admin has been cofirm Tracking Delivery the reques order\n event(new CourierConfirm($user, $detail_order));\n \n \\Session::flash('success', 'Konfirmasi Pengiriman Berhasil dan Email Terkirim ke Customer');\n return redirect()->route('admin.transaksi_delivery');\n }else{\n \\Session::flash('failled', 'Konfirmasi Pengiriman Gagal dan Email tidak Terkirim ke Customer');\n return redirect()->route('admin.transaksi_delivery');\n }\n\n }",
"function confirmord()\n\t{\n\t\t$input \t= JFactory::getApplication()->input;\n\t\t$dbo \t= JFactory::getDbo();\n\n\t\t$oid \t\t= $input->getUint('oid', 0);\n\t\t$conf_key \t= $input->getString('conf_key');\n\t\t\n\t\tif (empty($conf_key))\n\t\t{\n\t\t\techo '<div class=\"vap-confirmpage order-error\">'.JText::_('VAPCONFORDNOROWS').'</div>';\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$q = $dbo->getQuery(true)\n\t\t\t->select($dbo->qn(array('id', 'sid', 'status')))\n\t\t\t->from($dbo->qn('#__vikappointments_reservation'))\n\t\t\t->where(array(\n\t\t\t\t$dbo->qn('id') . ' = ' . $oid,\n\t\t\t\t$dbo->qn('conf_key') . ' = ' . $dbo->q($conf_key),\n\t\t\t));\n\n\t\t$dbo->setQuery($q, 0, 1);\n\t\t$dbo->execute();\n\n\t\tif (!$dbo->getNumRows())\n\t\t{\n\t\t\techo '<div class=\"vap-confirmpage order-error\">'.JText::_('VAPCONFORDNOROWS').'</div>';\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$order = $dbo->loadObject();\n\n\t\tif ($order->status != 'PENDING')\n\t\t{\n\t\t\tif ($order->status == 'CONFIRMED')\n\t\t\t{\n\t\t\t\techo '<div class=\"vap-confirmpage order-notice\">'.JText::_('VAPCONFORDISCONFIRMED').'</div>';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo '<div class=\"vap-confirmpage order-error\">'.JText::_('VAPCONFORDISREMOVED').'</div>';\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$q = $dbo->getQuery(true)\n\t\t\t->update($dbo->qn('#__vikappointments_reservation'))\n\t\t\t->set($dbo->qn('status') . ' = ' . $dbo->q('CONFIRMED'))\n\t\t\t->where(array(\n\t\t\t\t$dbo->qn('id') . ' = ' . $oid,\n\t\t\t\t$dbo->qn('id_parent') . ' = ' . $oid,\n\t\t\t), 'OR');\n\n\t\t$dbo->setQuery($q);\n\t\t$dbo->execute();\n\n\t\t// the status has been altered, we can track it\n\t\tVAPOrderStatus::getInstance()->keepTrack('CONFIRMED', $oid, 'VAP_STATUS_CONFIRMED_WITH_LINK');\n\t\t//\n\t\t\n\t\techo '<div class=\"vap-confirmpage order-good\">'.JText::_('VAPCONFORDCOMPLETED').'</div>';\n\t\t\n\t\t$order_details = VikAppointments::fetchOrderDetails($oid, $order->sid);\n\t\tVikAppointments::sendCustomerEmail($order_details);\n\t\t////////\n\t\t$order_details_original = VikAppointments::fetchOrderDetails($order_details[0]['id'], $order_details[0]['sid'], VikAppointments::getDefaultLanguage('site'));\n\t\tVikAppointments::sendAdminEmail($order_details_original);\n\t}",
"public function confirm() {\n\n\t\t//Use false to prevent valid boolean to get deleted\n\t\t$cart = retinashopCart::getCart();\n\t\tif ($cart) {\n\t\t\t$cart->confirmDone();\n\t\t\t$view = $this->getView('cart', 'html');\n\t\t\t$view->setLayout('order_done');\n\t\t\t// Display it all\n\t\t\t$view->display();\n\t\t} else {\n\t\t\t$mainframe = JFactory::getApplication();\n\t\t\t$mainframe->redirect(JRoute::_('index.php?option=com_retinashop&view=cart'), RText::_('COM_RETINASHOP_CART_DATA_NOT_VALID'));\n\t\t}\n\t}",
"public function acknowledgeKredOrderOnConfirmation(Varien_Event_Observer $observer)\n {\n $helper = Mage::helper('klarna_kco');\n $checkoutHelper = Mage::helper('klarna_kco/checkout');\n\n /** @var Mage_Sales_Model_Order $order */\n $order = $observer->getOrder();\n\n /** @var Klarna_Kco_Model_Klarnaorder $klarnaOrder */\n $klarnaOrder = $observer->getKlarnaOrder();\n\n $checkoutId = $klarnaOrder->getKlarnaCheckoutId();\n $checkoutType = $checkoutHelper->getCheckoutType($order->getStore());\n $pushQueue = Mage::getModel('klarna_kcokred/pushqueue')->loadByCheckoutId($checkoutId);\n\n try {\n if ('kred' == $checkoutType && !$klarnaOrder->getIsAcknowledged() && $pushQueue->getId()) {\n /** @var Mage_Sales_Model_Order_Payment $payment */\n $payment = $order->getPayment();\n $payment->registerPaymentReviewAction(Mage_Sales_Model_Order_Payment::REVIEW_ACTION_UPDATE, true);\n $status = false;\n\n if ($order->getState() == Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW) {\n $statusObject = new Varien_Object(\n array(\n 'status' => $checkoutHelper->getProcessedOrderStatus($order->getStore())\n )\n );\n\n Mage::dispatchEvent(\n 'kco_push_notification_before_set_state', array(\n 'order' => $order,\n 'klarna_order' => $klarnaOrder,\n 'status_object' => $statusObject\n )\n );\n\n if (Mage_Sales_Model_Order::STATE_PROCESSING == $order->getState()) {\n $status = $statusObject->getStatus();\n }\n }\n\n $order->addStatusHistoryComment($helper->__('Order processed by Klarna.'), $status);\n\n $api = Mage::helper('klarna_kco')->getApiInstance($order->getStore());\n $api->updateMerchantReferences($checkoutId, $order->getIncrementId());\n $api->acknowledgeOrder($checkoutId);\n $order->addStatusHistoryComment('Acknowledged request sent to Klarna');\n $order->save();\n\n $klarnaOrder->setIsAcknowledged(1);\n $klarnaOrder->save();\n }\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }",
"public function hookpaymentConfirm($params)\r\n\t{\r\n\t\t//send xml to FIA-NET when payment is confirmed\r\n\t\t$id_order = $params['id_order'];\r\n\t\t$this->sendXML((int) $id_order);\r\n\t}",
"function sv_wc_process_order_meta_box_action( $order ) { \n\tWC()->mailer()->emails['WC_Confirmation_Email']->trigger( $order->get_id(), $order );\n}",
"public function confirmPayment(OrderTransfer $orderTransfer);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reconnects the database connection associated with this storage, if it doesn't respond to a ping | private function reconnectDatabaseConnection(): void
{
if ($this->queryBuilder->getConnection()->ping() === false) {
$this->queryBuilder->getConnection()->close();
$this->queryBuilder->getConnection()->connect();
}
} | [
"function reconnect(){\n\t\tif (is_resource($this->conn_id) OR is_object($this->conn_id)){\n\t\t\tif (mysqli_ping($this->conn_id) === FALSE){\n\t\t\t\t$this->conn_id = FALSE;\n\t\t\t}\t\n\t\t}\t\t\n\t}",
"public function reconnect()\n {\n if (mysqli_ping($this->conn_id) === false) {\n $this->conn_id = false;\n }\n }",
"public final function _reconnect()\n\t{\n\t\tif (mysqli_ping($this->_conn_id) === FALSE)\n\t\t{\n\t\t\t$this->_conn_id = FALSE;\n\t\t}\n\t}",
"protected function reconnect()\n {\n if (is_null($this->conn) || !$this->conn) {\n $this->connect();\n }\n }",
"public function dbReconnect()\r\n\t{\r\n\t\tif($this->connection == false)\r\n\t\t{\r\n\t\t\tdo()\r\n\t\t\t{\r\n\t\t\t\t$this->dbConnect();\r\n\t\t\t}\r\n\t\t\twhile(die('The MySQL connection was dropped...attempting to reconnect.'))\r\n\t\t}\r\n\t}",
"protected function reconnectIfMissingConnection()\n {\n if ($this->getPdo() === null) {\n $this->reconnect();\n }\n }",
"function reconnect()\n {\n $this->close();\n $this->connect($this->host, $this->user, $this->pass, $this->port, $this->ssl);\n \n // issue SELECT command to restore connection status\n if ($this->mailbox)\n $this->conn->select($this->mailbox);\n }",
"protected function reconnectIfMissingConnection()\n {\n if (is_null($this->getPdo()) || is_null($this->getReadPdo())) {\n $this->reconnect();\n }\n }",
"protected function reconnectIfMissingConnection()\n\t{\n\t\t$this->neoeloquent->reconnectIfMissingConnection();\n\t}",
"public function reconnect();",
"public function forceReconnect()\n {\n $oldConnDetails = (array) $this->connDetails;\n $this->connDetails['newLink'] = true;\n $this->connect();\n $this->connDetails = $oldConnDetails;\n }",
"protected function reconnect()\n {\n \n }",
"protected function reconnect()\n {\n }",
"public function testReconnectToTheDatabase() {\n\t\tDB::reconnect();\n\t}",
"public function reconnect()\n {\n $this->log('Reconnecting...');\n $this->close();\n $this->connect();\n\n }",
"public function reconnect()\n {\n // Opposite order to connect() because we don't\n // want to ever purge the central connection\n $this->switchConnection($this->originalDefaultConnectionName);\n $this->setDefaultConnection($this->originalDefaultConnectionName);\n }",
"public function reconnect()\n {\n $this->forge->reconnectToServer($this->id);\n }",
"protected function reconnectIfMissingConnection()\n {\n if (is_null($this->arangoConnection)) {\n $this->reconnect();\n }\n }",
"protected function reconnectIfMissingConnection()\n {\n if (is_null($this->client)) {\n $this->reconnect();\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
view method to get the matching tracks from the db based on the 'album_id' passed in the url as $id using the model's get_tracks() method and pass the results to the view | public function view($id = NULL) {
$data['track_list'] = $this->tracks_model->get_tracks($id);
/*
* if no id is passed in the url then show the 404 error page
*/
if (empty($data['track_list']))
{
show_404();
}
$this->load->view('tracks/track_list', $data);
} | [
"function getAlbumTracks() {\n $album_id=Input::get(\"albumid\") ;\n $end_point='/albums/'.$album_id.'/tracks';\n $data=$this->getSpotifyEndPointsData($end_point);\n return view('albumtracks',[\"album_id\"=>$album_id,'album_tracks'=>$data]);\n }",
"public function get_album_from_track(string $trackId) {\n $sql = \"SELECT `album`.`id`, `album`.`name`, `album`.`release_date`, `album`.`uri`, `album`.`total_tracks` FROM `track_on_album` INNER JOIN `album` ON `track_on_album`.`album_id` = `album`.`id` WHERE `track_on_album`.`track_id` = ?\";\n if ($stmt = $this->conn->prepare($sql))\n {\n $stmt->bind_param('s', $trackId);\n $stmt->execute();\n $stmt->bind_result($albumId, $name, $releaseDate, $uri, $totalTracks);\n $stmt->fetch();\n $stmt->close();\n \n if ($albumId != null)\n {\n $album = new Album($name, $albumId, $uri, $releaseDate, $totalTracks);\n $album->images = $this->get_images_for_id($albumId);\n \n $tracklist = array();\n\n // get tracklist\n $sql = <<<EOD\n SELECT `track`.`id`, `track`.`name`, `track`.`uri`, `track`.`preview_url` \n FROM `track_on_album` \n INNER JOIN `track` ON `track`.`id` = `track_on_album`.`track_id`\n WHERE `track_on_album`.`album_id` = ?\n EOD;\n\n $stmt = $this->conn->prepare($sql);\n $stmt->bind_param('s', $albumId);\n $stmt->execute();\n $stmt->bind_result($trackId, $name, $uri, $preview_url);\n\n while($stmt->fetch())\n {\n array_push($tracklist, new Track($name, $trackId, $uri, $preview_url));\n }\n\n \n return $album;\n }\n }\n }",
"public function findAlbum($id);",
"public function display($album) {\n parent::displayHeader(\"Listen UP | Home\");\n \n\n ?>\n<div class=\"content_wraper\">\n <h2 id=\"main_header\">Albums That Are Current Available</h2>\n\n \n <!-- \n \n Some kind of fun introduction \n \n -->\n \n\n <?php\n //insert a new song for each record\n foreach ($album as $count => $album) {\n $id = $album->getId();\n $artist = $album->getArtist();\n $album_title = $album->getAlbum();\n $album_art = $album->getImage();\n $genre = $album->getGenre();\n $release_date = $album->getRelease_date();\n \n echo \"<div class='album'>\";\n echo \"<p><a href='\" . base_url . \"/album/detail/$id'><img src='\" . base_url . \"/includes/album_art/$album_art' /></a></p>\";\n echo \"<div class='rolloverinfo'><h3 class='albums_page'>Band Name:</h3>$artist\";\n echo \"<h3 class='albums_page'>Album:</h3>$album_title\";\n echo \"<h3 class='albums_page'>Genre:</h3>$genre\";\n echo \"<h3 class='albums_page'>Release Date:</h3>$release_date\";\n echo \"</div>\";\n echo \"</div>\";\n }\n ?>\n</div>\n <?php\n parent::displayFooter();\n \n\n }",
"public function show($id)\n\t{\n\n\t\t$track = Track::find($id);\n\t\treturn view('tracks.show', compact('track'));\n\n\t}",
"public function getSingleTrack($user_id, $album_id, $track_id) {\n $track = Track::findorFail($track_id);\n $publicId = $track['public_id'];\n $this->song_url = [\"song_url\" => $track['url']];\n// dd($publicId);\n\n// $this->song_url = \\Cloudder::secureShow($publicId, ['resource_type' => 'video', 'format' => 'mp3', \"width\" => null, \"height\"=> null, \"crop\" => null]);\n return response()->json($this->song_url, 200);\n }",
"public function artist($artist) {\n\n $artist = str_replace('%20', ' ', $this->uri->segment(3));\n $songs = $this->cache->model('Song_model','search',array(array('status'=>'published'), $artist, 150, 0, 'songs.song_id DESC', 'EXCLUDE_DESCRIPTION'), 300);\n\n if (!$songs) {\n redirect('errors/no_artist_playlist');\n }\n\n foreach ($songs as $key => $song) {\n if ($song->external_source == 'soundcloud') {\n $http_file_path = 'http://api.soundcloud.com/tracks/'.$song->external_file.'/stream?consumer_key=' . $this->config->item('soundcloud_client_id');\n } else {\n $http_file_path = getSignedURL($this->config->item('cloudfront_music') . '/tracks/' . $song->username . '/' . $song->file_name, '84000');\n }\n\n $producer = (!empty($song->song_producer)) ? ' (Prod. ' . htmlspecialchars($song->song_producer, ENT_QUOTES). ')' : NULL;\n $featuring = (!empty($song->featuring)) ? ' (Feat. ' . htmlspecialchars($song->featuring, ENT_QUOTES) . ') ' : NULL;\n\n\n $song_data[] = array(\n 'identifier'=>$song->song_id,\n 'type'=>'audio',\n 'host'=>$song->song_id,\n 'title'=>htmlspecialchars($song->song_title, ENT_QUOTES),\n 'artist'=>htmlspecialchars($song->song_artist, ENT_QUOTES),\n 'program'=>$featuring . $producer,\n 'image_lg'=>song_img($song->username, $song->song_url, $song->song_image, 300),\n 'image_sm'=>$song->file_name,\n 'url'=>base_url('song/' . $song->username . '/' . $song->song_url),\n 'external_url'=>$song->external_url,\n 'http_file_path'=>$http_file_path\n );\n }\n $this->data['tracks'] = json_encode($song_data,JSON_UNESCAPED_SLASHES);\n $this->data['track_count'] = count($song_data);\n\n //get artist image from last.fm API and add to cache.\n //if no image present, display placeholder\n //\n if ($this->cache->get('images/playlists/' . urlencode($artist))) {\n $this->data['lastfm_image'] = $this->cache->get('playlist_images/' . urlencode($artist));\n } else {\n \n $lastfm_key = 'c6f979d14e2320fb59955afc3e923133';\n $lastfm_artist = urlencode($artist);\n $lastfm_data = \"http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist={$lastfm_artist}&api_key={$lastfm_key}&format=json\";\n $json = @file_get_contents($lastfm_data);\n $lastfm_results = json_decode($json);\n $image = get_object_vars($lastfm_results->artist->image[4]);\n \n if (!empty($image['#text'])) {\n $this->data['lastfm_image'] = $image['#text'];\n } else {\n $this->data['lastfm_image'] = '//secure.hiphopvip.com/resources/img/placeholders/playlist_img.jpg';\n }\n\n $this->cache->write($this->data['lastfm_image'], 'images/playlists/' . urlencode($artist));\n }\n\n\n $this->data['meta_name'] = array(\n 'description'=> 'Listen to ' . $artist . ' Playlist',\n 'twitter:card'=>'player',\n 'twitter:site'=>'@hiphopvip1',\n 'twitter:title'=>$artist . ' Playlist',\n 'twitter:description'=>'Listen to ' . $artist . ' Playlist on ' . $this->lang->line('meta_title'),\n 'twitter:image'=>$this->data['lastfm_image'],\n 'twitter:player'=> $this->config->item('secure_base_url').'/embed/playlist/artist/1/'. $this->uri->segment(3),\n 'twitter:player:width'=>'480',\n 'twitter:player:height'=>'325',\n 'twitter:player:stream:content_type'=>'audio/mp3'\n );\n\n $this->data['meta_prop'] = array(\n 'og:title'=> 'Listen to a dope ' . $artist . ' Playlist on ' . $this->lang->line('meta_title'),\n 'og:url'=> base_url('playlist/artist/' . $this->uri->segment(3)),\n 'og:image'=> $this->data['lastfm_image'],\n 'og:site_name'=> 'hiphopVIP',\n 'og:description'=> $this->data['track_count'] . ' songs by ' . $artist . ' to listen to on ' . $this->lang->line('meta_title')\n ); \n\n $artist = htmlspecialchars($artist, ENT_QUOTES);\n\n $this->data['playlist_title'] = ucwords($artist);\n $this->data['title'] = ucwords($artist) . ' Playlist | hiphopVIP';\n $this->data['vendorCSS'] = array('apm/skin/hhvip.css','apm/skin/jquery-ui-slider.custom.css','social-likes/social-likes_classic.css');\n $this->data['vendorJS'] = array('apm/lib/jquery-ui-slider-1.10.4.custom.min.js','apm/lib/modernizr-2.5.3-custom.min.js', 'apm/lib/soundmanager2-jsmin.js', 'apm/apmplayer.js','apm/apmplayer_ui.jquery.js','social-likes/social-likes.min.js');\n\n $this->_render('playlist/artist/artist_player', $this->data);\n }",
"public function tracks($id){\n $vinyl = Vinyl::find($id);\n $tracks = $vinyl->tracks;\n return $tracks;\n }",
"public function getAlbum($id);",
"public function audioAlbum(Request $request, $album_id){\n\n // Find album by id\n try {\n $album = PlaylistSerie::where([\n ['mediatype_id', 2],\n ['id', $album_id]\n ])\n ->whereHas('posts')\n ->with('posts')\n ->firstOrFail();\n\n $nextAlbum = PlaylistSerie::where([\n ['mediatype_id', 2],\n ['id', '>', $album_id]\n ])\n ->whereHas('posts')\n ->first();\n\n if(empty($nextAlbum)){\n $nextAlbum = PlaylistSerie::where([\n ['mediatype_id', 2]\n ])\n ->whereNotIn('id', [$album->id])\n ->whereHas('posts')\n ->orderBy('created_at', 'desc')\n ->first();\n }\n\n if(!empty($nextAlbum)){\n $relatedAlbums = PlaylistSerie::where('mediatype_id', 2)\n ->whereNotIn('id', [$album->id, $nextAlbum->id])\n ->orderBy('created_at', 'desc')\n ->take(3)\n ->get();\n }else{\n $relatedAlbums = null;\n }\n\n } catch (ModelNotFoundException $e) {\n return view('errors.404')->with('exception', 'Oop! you have requested the resource that does not exists.\\n We may considered create something new for you :D');\n }\n\n return view('visitor.listen.album_detail')->with([\n 'audioAlbum' => $album,\n 'nextAlbum' => $nextAlbum,\n 'relatedAlbums' => $relatedAlbums\n ]);\n }",
"public function albumAudioTracks()\n {\n $this->setRules(['slug' => 'required']);\n $this->validate($this->request, $this->getRules());\n $inputArray = $this->request->all();\n if (!isMobile()) {\n $albumInfo = $this->albums->where($this->getKeySlugorId(), $inputArray['slug'])->first();\n $albumId = (!empty($albumInfo)) ? $albumInfo->id : 0;\n } else {\n $albumId = $inputArray['slug'];\n }\n return $this->audios->selectRaw('*')->where('album_id', $albumId)->paginate($this->album_tracks_per_page)->toArray();\n }",
"function tracks()\r\n\t{\r\n\t\t$this->set( \"title_for_layout\", \"Tracks\" );\r\n\r\n\t\t// Unbinding models to avoid loading unnecessary data\r\n\t\t$this->Track->unbindModel(array('hasAndBelongsToMany'=>array('Order')),false);\r\n\t\t// Tracks with pagination\t\r\n\t\t$this->set('tracks', $this->paginate('Track'));\r\n\t}",
"public function tracks() {\n return $this->hasMany(Track::class, 'album_id');\n }",
"public function photos_list($albumid);",
"public function getTracks()\n {\n return $this->hasMany(Tracks::className(), ['album_id' => 'id']);\n }",
"public function fetchTracks($params)\n\t{\n if(isset($params['order'])) :\n \t $order = strtoupper($params['order']);\n \telse :\n \t $order = 'DESC';\n endif;\n \n \t$select = $this->registry->db->select();\n \t$select->from(array('m' => 'music'));\n \t$select->join(array('r' => 'releases'),'r.release_id = m.music_release',array('r.release_title'));\n \t\n \tif (isset($params['sort'])) :\n \t\n \t if ($params['sort'] == 'date') :\n \t $select->order('m.music_date '.$order);\n \t elseif ($params['sort'] == 'track') :\n \t $select->order('m.music_title '.$order);\n \t elseif ($params['sort'] == 'release') :\n \t $select->order('m.music_release '.$order);\n \t endif;\n \t \n \telse :\n \t $select->order('m.music_date '.$order);\n \tendif;\n \t\n \tif(isset($params['page']) && is_numeric($params['page'])) :\n \t\t$pagenum = $params['page'];\n \telse :\n \t\t$pagenum = 1;\n \tendif;\n \t\n \tif(isset($params['items']) && is_numeric($params['items'])) :\n \t\t$items = $params['items'];\n \telse :\n \t\t$items = 15;\n \tendif;\n \t\n \tif(isset($params['range']) && is_numeric($params['range'])) :\n \t\t$range = $params['range'];\n \telse :\n \t\t$range = 5;\n \tendif;\n \t\n \t$paginator = Zend_Paginator::factory($select);\n\t\t$paginator->setCurrentPageNumber($pagenum);\n\t\t$paginator->setItemCountPerPage($items);\n\t\t$paginator->setPageRange($range);\n\t \n \treturn $paginator;\n\t}",
"function getViewAlbumDetail($album_uid) {\n\t\t// Get Smarty Instance\n \t$smartyInstance = tx_cwtcommunity_lib_common::getSmartyInstance();\n $conf = tx_cwtcommunity_lib_common::getConfArray();\n $tplPath = tx_cwtcommunity_lib_common::getTemplatePath($conf['template_album_detail']);\n \n $album = self::getAlbum($album_uid);\n $photos = self::getPhotos($album_uid);\n \n\t\tforeach ($photos as &$photo) {\n \t$photo['pic'] = self::getPhotoURI($photo['uid'], $conf); \n \t$photo['comment_count'] = self::getCommentCount($photo['uid']);\n }\n // Provide smarty with the information for the template\n $smartyInstance->assign('album', $album);\n $smartyInstance->assign('photos', $photos);\n \n $content .= $smartyInstance->display($tplPath);\n return $content;\n\t}",
"public function index(){\n\n\t\t//memanggil fungsi getalbum pada model\n\t\t$data=$this->models->getalbum();\n\t\tif ($data){\t\n\t\t\t$this->view->assign('data',$data);\n\t\t}\n\t\treturn $this->loadView('gallery/listalbum');\n\t}",
"public function tracks() {\n $gset = ($this->settings->statistics ? unserialize($this->settings->statistics) : array());\n $limit = (isset($_GET['c']) && (int) $_GET['c'] > 0 ? (int) $_GET['c'] : $gset['best']);\n $html = array();\n $sltn = file_get_contents(PATH . 'templates/html/table-skeleton.htm');\n $rows = array();\n $Q = db::db_query(\"SELECT\n `\" . DB_PREFIX . \"music`.`title` AS `trackTitle`,\n `\" . DB_PREFIX . \"collections`.`name` AS `colName`,\n count(*) AS `saleCount`\n FROM `\" . DB_PREFIX . \"sales_items`\n LEFT JOIN `\" . DB_PREFIX . \"music`\n ON `\" . DB_PREFIX . \"sales_items`.`item` = `\" . DB_PREFIX . \"music`.`id`\n LEFT JOIN `\" . DB_PREFIX . \"collections`\n ON `\" . DB_PREFIX . \"sales_items`.`collection` = `\" . DB_PREFIX . \"collections`.`id`\n WHERE `\" . DB_PREFIX . \"sales_items`.`type` = 'track'\n GROUP BY `\" . DB_PREFIX . \"sales_items`.`item`\n ORDER BY `saleCount` DESC\n LIMIT $limit\n \");\n while ($T = db::db_object($Q)) {\n $rows[] = str_replace(array(\n '{title}',\n '{info}',\n '{sales}'\n ), array(\n mswCleanData($T->trackTitle),\n mswCleanData($T->colName),\n @number_format($T->saleCount)\n ), file_get_contents(PATH . 'templates/html/table-row.htm'));\n }\n if (!empty($rows)) {\n return array(\n 'data' => str_replace('{rows}', implode(mswDefineNewline(), $rows), $sltn)\n );\n }\n return array(\n 'data' => ''\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Dither using error diffusion. | private function diffusion($image)
{
$pixels = [];
// Localize vars
$width = $image->getWidth();
$height = $image->getHeight();
// Loop using image1
$pixelIterator = $image->getCore()->getPixelIterator();
foreach ($pixelIterator as $y => $rows) { /* Loop through pixel rows */
foreach ($rows as $x => $px) { /* Loop through the pixels in the row (columns) */
/**
* @var \ImagickPixel */
$rgba = $px->getColor();
$gray = round($rgba['r'] * 0.3 + $rgba['g'] * 0.59 + $rgba['b'] * 0.11);
if (isset($pixels[$x][$y])) { // Add errors to color if there are
$gray += $pixels[$x][$y];
}
if ($gray <= 127) { // Determine if black or white. Also has the benefit of clipping excess val due to adding the error
$blackOrWhite = 0;
} else {
$blackOrWhite = 255;
}
$oldPixel = $gray;
$newPixel = $blackOrWhite;
// Current pixel
$px->setColor("rgb($newPixel,$newPixel,$newPixel)");
$qError = $oldPixel - $newPixel; // Quantization error
// Propagate error on neighbor pixels
if ($x + 1 < $width) {
$pixels[$x + 1][$y] = (isset($pixels[$x + 1][$y]) ? $pixels[$x + 1][$y] : 0) + ($qError * (7 / 16));
}
if ($x - 1 > 0 and $y + 1 < $height) {
$pixels[$x - 1][$y + 1] = (isset($pixels[$x - 1][$y + 1]) ? $pixels[$x - 1][$y + 1] : 0) + ($qError * (3 / 16));
}
if ($y + 1 < $height) {
$pixels[$x][$y + 1] = (isset($pixels[$x][$y + 1]) ? $pixels[$x][$y + 1] : 0) + ($qError * (5 / 16));
}
if ($x + 1 < $width and $y + 1 < $height) {
$pixels[$x + 1][$y + 1] = (isset($pixels[$x + 1][$y + 1]) ? $pixels[$x + 1][$y + 1] : 0) + ($qError * (1 / 16));
}
}
$pixelIterator->syncIterator(); /* Sync the iterator, this is important to do on each iteration */
}
$type = $image->getType();
$file = $image->getImageFile();
$image = $image->getCore();
return new Image($image, $file, $width, $height, $type); // Create new image with updated core
} | [
"protected function dither()\n {\n if ( ! imageistruecolor($this->image)) {\n imagepalettetotruecolor($this->image);\n }\n\n imagefilter($this->image, IMG_FILTER_GRAYSCALE);\n imagetruecolortopalette($this->image, true, 2);\n }",
"function ImageDither(\\raylib\\Image &$image, int $rBpp, int $gBpp, int $bBpp, int $aBpp): void { }",
"function imagetruecolortopalette($image, bool $dither, int $num_colors): void\n{\n error_clear_last();\n $safeResult = \\imagetruecolortopalette($image, $dither, $num_colors);\n if ($safeResult === false) {\n throw ImageException::createFromPhpError();\n }\n}",
"function renderWebSafeDither($filename = ''){\n if($filename == ''){\n $filename = strtolower($this->hex) . '_websafe.png';\n }\n $safe = $this->getWebSafeDither();\n $im = imagecreate(2,2);\n\n $col1 = imagecolorallocate($im, $safe[0]->r, $safe[0]->g, $safe[0]->b);\n $col2 = imagecolorallocate($im, $safe[1]->r, $safe[1]->g, $safe[1]->b);\n imageSetPixel($im, 0, 0, $col1);\n imageSetPixel($im, 1, 1, $col1);\n imageSetPixel($im, 0, 1, $col2);\n imageSetPixel($im, 1, 0, $col2);\n imagepng($im, $filename);\n return $filename;\n }",
"function DitherImage($pixels, $palette, $combinations, $fn)\n{\n global $dither8x8;\n $cache = Array();\n\n $wid = 0;\n $hei = count($pixels);\n foreach($pixels as $y => $xspan)\n {\n $wid = count($xspan);\n break;\n }\n \n $im2 = ImageCreateTrueColor($wid, $hei);\n $result = Array();\n \n $count = 16;\n $uncount = 1/$count;\n $ypmask = 7;\n $xpmask = 7;\n \n foreach($pixels as $y => $xspan)\n {\n printf(\"\\rQuantizing... %d/%d\", $y, $hei); flush();\n foreach($xspan as $x => $pixel)\n {\n $rgb = $pixel[4];\n $mix = &$cache[$rgb];\n if(!isset($mix))\n {\n $mix = DitherPixel($pixel, $palette, $combinations, $count);\n }\n \n $yp = ($y % 8) & $ypmask;\n $xp = ($x % 8) & $xpmask;\n \n #print_r($mix);\n\n $choose = $mix[ (int) ($dither8x8[$yp][$xp] * $count / 64) ];\n\n #$choose = $mix[ $dither8x8[$y % 8][$x % 8] >> (6-2) ];\n\n ImageSetPixel($im2, $x,$y, $palette[$choose][4]);\n \n $m = Array(0,0,0);\n foreach($mix as $c)\n {\n $m[0] += $palette[$c][0];\n $m[1] += $palette[$c][1];\n $m[2] += $palette[$c][2];\n }\n $m[0] *= $uncount;\n $m[1] *= $uncount;\n $m[2] *= $uncount;\n $m[5] = $choose;\n $result[$y][$x] = $m;\n unset($mix);\n }\n }\n ImagePng($im2, $fn);\n $result[-1] = $im2;\n return $result;\n}",
"function darker_negative ($image)\n {\n \n list ($target_file, $width, $height, $image_matrix,$imageFileType) = imagespec ($image); \n \n \n $new_image_matrix = HALFDARKER_HALFNEGATIVE($image_matrix,$width,$height);\n outputimage($new_image_matrix, $imageFileType); \n }",
"public function testDesaturateEffect() {\n $this->assertImageEffect(['desaturate'], 'image_desaturate', []);\n\n // Check the parameters.\n $calls = $this->imageTestGetAllCalls();\n // No parameters were passed.\n $this->assertEmpty($calls['desaturate'][0]);\n }",
"public function brighter() { }",
"private function custom_noise($diff)\n\t{\n\t\t$imagex = imagesx($this->image);\n\t\t$imagey = imagesy($this->image);\n\n\t\tfor($x = 0; $x < $imagex; ++$x)\n\t\t{\n\t\t\tfor($y = 0; $y < $imagey; ++$y)\n\t\t\t{\n\t\t\t\tif(rand(0, 1) )\n\t\t\t\t{\n\t\t\t\t\t$rgb = imagecolorat($this->image, $x, $y);\n\t\t\t\t\t$red = ($rgb >> 16) & 0xFF;\n\t\t\t\t\t$green = ($rgb >> 8) & 0xFF;\n\t\t\t\t\t$blue = $rgb & 0xFF;\n\t\t\t\t\t$modifier = rand($diff * -1, $diff);\n\t\t\t\t\t$red += $modifier;\n\t\t\t\t\t$green += $modifier;\n\t\t\t\t\t$blue += $modifier;\n\n\t\t\t\t\tif ($red > 255) $red = 255;\n\t\t\t\t\tif ($green > 255) $green = 255;\n\t\t\t\t\tif ($blue > 255) $blue = 255;\n\t\t\t\t\tif ($red < 0) $red = 0;\n\t\t\t\t\tif ($green < 0) $green = 0;\n\t\t\t\t\tif ($blue < 0) $blue = 0;\n\n\t\t\t\t\t$newcol = imagecolorallocate($this->image, $red, $green, $blue);\n\t\t\t\t\timagesetpixel($this->image, $x, $y, $newcol);\n\t\t\t\t}//end if\n\t\t\t}//end for\n\t\t}//end for\n\t}",
"public function darker() { }",
"function redimg($arrayDataOutput,$filePathDest,$filePathSrc,$flagClean=0){\n\t\t\n $res = '';\n\t\tforeach($arrayDataOutput as $row)\n {\n if( file_exists($filePathSrc) ){\n $data = file_get_contents($filePathSrc);\n\t\t\t\tif(!empty($data)){\t\n\t\t\t\t\t$im = imagecreatefromstring($data);\n\t\t\t\t\tif($im){\n\t\t\t\t\t\tif( file_exists($filePathDest) )\n\t\t\t\t\t\t\t@unlink($filePathDest);\n\t\t\t\t\t \n\t\t\t\t\t $x = imagesx($im);\n\t\t\t\t\t $y = imagesy($im);\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t $ratioInput = ( $y>0 ) ? $x / $y : 1 ;\n\t\t\t\t\t \n\t\t\t\t\t if( $row['W'] == 0 && $row['H'] == 0 ){\n\t\t\t\t\t\t\t$width = $x;\n\t\t\t\t\t\t\t$height = $y;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($x < $row['W'] && $y < $row['H']){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$ratioOutput = 1;\n\t\t\t\t\t\t\t\t$height = $row['H'];\n\t\t\t\t\t\t\t\t$width = $row['W'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif( $row['W'] > 0 && $row['H'] > 0){\n\t\t\t\t\t\t\t\t$ratioOutput = $row['W'] /$row['H'];\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ($ratioOutput > $ratioInput) {\n\t\t\t\t\t\t\t\t\t$height = $row['H'];\n\t\t\t\t\t\t\t\t\t$width = $ratioInput * $row['H'];\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$height = $row['W'] / $ratioInput;\n\t\t\t\t\t\t\t\t\t$width = $row['W'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ($height > $row['H']) {\n\t\t\t\t\t\t\t\t\t$height = $row['H'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ($width > $row['W']) {\n\t\t\t\t\t\t\t\t\t$height = $row['W'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t $width = ( $row['W'] > 0 ) ? ($row['W']) : ($row['H'] * $ratioInput);\n\t\t\t\t\t\t\t $height = ( $row['H'] > 0 ) ? ($row['H']) : ($row['W'] / $ratioInput); \n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t \n\t\t\t\t\t\tif( $row['W'] > 0 && $row['H'] > 0)\n\t\t\t\t\t\t\t$copyIm = ImageCreateTrueColor($row['W'],$row['H']);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t $copyIm = ImageCreateTrueColor($width,$height);\n\t\t\t\t\t\t\t \n\t\t\t\t\t\timagealphablending($copyIm, false);\n\t\t\t\t\t\timagesavealpha($copyIm, true); \n\t\t\t\t\t\timagealphablending($im, true);\n\t\t\t\t\t\t$transparent = imagecolorallocatealpha($copyIm, 255, 255, 255, 127);\n\t\t\t\t\t\tif( $row['W'] > 0 && $row['H'] > 0)\n\t\t\t\t\t\t\timagefilledrectangle($copyIm, 0, 0, $row['W'],$row['H'], $transparent);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\timagefilledrectangle($copyIm, 0, 0, $width, $height, $transparent);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif( $row['W'] > 0 && $row['H'] > 0)\n\t\t\t\t\t\t\tImageCopyResampled($copyIm,$im,($row['W']-$width)/2, ($row['H']-$height)/2,0,0,$width,$height,$x,$y);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tImageCopyResampled($copyIm,$im,0,0,0,0,$width,$height,$x,$y);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\timagejpeg($copyIm,$filePathDest,100);\n\t\t\t\t\t\tchmod($filePathDest,0777);\n\t\t\t\t\t\t$res = 1;\n\t\t\t\t\t}else\t\t\t\t\t\n\t\t\t\t\t\t$res = 0;\n\t\t\t\t}\n }\n else\n {\n $res = 0;\n }\n \n }\n \n //on ne conserve pas l'original\n if($flagClean == 1){\n @unlink($filePathSrc); \n \n }\n\t\t\n\t\t\n\t\treturn $res;\n }",
"function filter(){\n\n\t\t$newpixel = array();\n\t\t$this->newimage = imagecreatetruecolor($this->size[0], $this->size[1]);\n\t\tfor($y = 0; $y < $this->size[1]; $y++){\n\t\t\tfor($x = 0; $x < $this->size[0]; $x++){\n\t\t\t\t$newpixel[0] = 0;\n\t\t\t\t$newpixel[1] = 0;\n\t\t\t\t$newpixel[2] = 0;\n\t\t\t\t$a11 = $this->rgbpixel($x - 1, $y - 1);\n\t\t\t\t$a12 = $this->rgbpixel($x, $y - 1);\n\t\t\t\t$a13 = $this->rgbpixel($x + 1, $y - 1);\n\t\t\t\t$a21 = $this->rgbpixel($x - 1, $y);\n\t\t\t\t$a22 = $this->rgbpixel($x, $y);\n\t\t\t\t$a23 = $this->rgbpixel($x + 1, $y);\n\t\t\t\t$a31 = $this->rgbpixel($x - 1, $y + 1);\n\t\t\t\t$a32 = $this->rgbpixel($x, $y + 1);\n\t\t\t\t$a33 = $this->rgbpixel($x + 1, $y + 1);\n\t\t\t\t$newpixel[0] += $a11['red'] * $this->Filter[0] + $a12['red'] * $this->Filter[1] + $a13['red'] * $this->Filter[2];\n\t\t\t\t$newpixel[1] += $a11['green'] * $this->Filter[0] + $a12['green'] * $this->Filter[1] + $a13['green'] * $this->Filter[2];\n\t\t\t\t$newpixel[2] += $a11['blue'] * $this->Filter[0] + $a12['blue'] * $this->Filter[1] + $a13['blue'] * $this->Filter[2];\n\t\t\t\t$newpixel[0] += $a21['red'] * $this->Filter[3] + $a22['red'] * $this->Filter[4] + $a23['red'] * $this->Filter[5];\n\t\t\t\t$newpixel[1] += $a21['green'] * $this->Filter[3] + $a22['green'] * $this->Filter[4] + $a23['green'] * $this->Filter[5];\n\t\t\t\t$newpixel[2] += $a21['blue'] * $this->Filter[3] + $a22['blue'] * $this->Filter[4] + $a23['blue'] * $this->Filter[5];\n\t\t\t\t$newpixel[0] += $a31['red'] * $this->Filter[6] + $a32['red'] * $this->Filter[7] + $a33['red'] * $this->Filter[8];\n\t\t\t\t$newpixel[1] += $a31['green'] * $this->Filter[6] + $a32['green'] * $this->Filter[7] + $a33['green'] * $this->Filter[8];\n\t\t\t\t$newpixel[2] += $a31['blue'] * $this->Filter[6] + $a32['blue'] * $this->Filter[7] + $a33['blue'] * $this->Filter[8];\n\t\t\t\t$newpixel[0] = max(0, min(255, intval($newpixel[0] / $this->Divisor) + $this->Offset));\n\t\t\t\t$newpixel[1] = max(0, min(255, intval($newpixel[1] / $this->Divisor) + $this->Offset));\n\t\t\t\t$newpixel[2] = max(0, min(255, intval($newpixel[2] / $this->Divisor) + $this->Offset));\n\t\t\t\timagesetpixel($this->newimage, $x, $y, imagecolorallocatealpha($this->newimage, $newpixel[0], $newpixel[1], $newpixel[2], $a11['alpha']));\n\t\t\t}\n\t\t}\n\t\timagecopy($this->im, $this->newimage, 0, 0, 0, 0, $this->size[0], $this->size[1]);\n\t\timagedestroy($this->newimage);\n\n\t}",
"function colour_field($userAnswer, $correctAnswer, $responses, $error){\n\n //remove the # from the colour code and store in variable \"colour\"\n //this is to make it easier to find \"nearly\" correct answers\n $colour = str_replace(\"#\", \"\", $userAnswer);\n\n\n //split the colour code into 3 components red, green and blue - we can use this to find 5% error\n $userRgb = str_split($colour, 2);\n //- split the correct answer hex colour code in red, green and blue components. Store in variable errorRgbs\n $errorRgb = str_split($correctAnswer, 2);\n //assign array item (each colour) \"red, \"green\" and \"blue\" to a variable to store each component in a variable\n $userRed = hexdec($userRgb[0]);\n $userGreen = hexdec($userRgb[1]);\n $userBlue = hexdec($userRgb[2]);\n\n //assign each array item (each colour) to a variable that will be used to calculate the error later\n $errorRed = hexdec($errorRgb[0]);\n $errorGreen = hexdec($errorRgb[1]);\n $errorBlue = hexdec($errorRgb[2]);\n\n \n\n //calculate upper bounds\n //important to check if an rgb error value is 0 otherwise will cause issues\n //if one is equal to 0 find the upper bound using the error*255 rather than error*0\n //if not 0 calculate upper error by adding the colour error with calculated error leniancy\n if ($errorRed == 0){\n $errorRedUpper = $error*255;\n } else {\n $errorRedUpper = $errorRed + $errorRed*$error;\n }\n if ($errorGreen == 0){\n $errorGreenUpper = $error*255;\n } else {\n $errorGreenUpper = $errorGreen + $errorGreen*$error;\n }\n if ($errorBlue == 0){ \n $errorBlueUpper = $error*255;\n } else {\n $errorBlueUpper = $errorBlue + $errorBlue*$error;\n \n }\t\n \n //calculate lower bounds\n //does not need to checked for 0 as rgb colour value must be >= 0\n //lowerbound = correctAnswer - error leniency (correctAnswer*error)\n $errorRedLower = $errorRed - $errorRed*$error;\n $errorGreenLower = $errorGreen - $errorGreen*$error;\n $errorBlueLower = $errorBlue - $errorBlue*$error;\n\n //if user is exactly correct\n if ($colour == $correctAnswer){\n //display correct answer response\n echo $GLOBALS[\"c\"] . $responses[0] . \"You score 5 points\";\n $GLOBALS['score'] += 5;\n }\n \n //compare user given rgb values with correct / error accounted rgb values that have been calulcated\n //if the user answer falls with the error % specified - user is nearly correct\n else if (($userRed >= $errorRedLower and $userRed <= $errorRedUpper) and \n ($userGreen >= $errorGreenLower and $userGreen <= $errorGreenUpper) and\n ($userBlue >= $errorBlueLower and $userBlue <= $errorBlueUpper)\n ) {\n //display the nearly correct response message\n echo $GLOBALS[\"nc\"] . $responses[1] . \"You score 2 points\";\n //increment score by 2 for nearly correct colour answers\n $GLOBALS['score'] += 2;\n\n } \n else {\n //display the incorrect response message\n echo $GLOBALS[\"ic\"] . $responses[2] . \"You score 0 points\";\n //do not update score\n\n }\n}",
"function gd_true_color_to_palette ($image, $dither, $ncolors)\n{\n return imagetruecolortopalette($image, $dither, $ncolors);\n}",
"public function luminance();",
"function colorreplace(){\n\n\t\t$red = hexdec(substr($this->Colorreplace[1], 1, 2));\n\t\t$green = hexdec(substr($this->Colorreplace[1], 3, 2));\n\t\t$blue = hexdec(substr($this->Colorreplace[1], 5, 2));\n\t\t$rednew = hexdec(substr($this->Colorreplace[2], 1, 2));\n\t\t$greennew = hexdec(substr($this->Colorreplace[2], 3, 2));\n\t\t$bluenew = hexdec(substr($this->Colorreplace[2], 5, 2));\n\t\t$tolerance = sqrt(pow($this->Colorreplace[3], 2) + pow($this->Colorreplace[3], 2) + pow($this->Colorreplace[3], 2));\n\t\tfor($y = 0; $y < $this->size[1]; $y++){\n\t\t\tfor($x = 0; $x < $this->size[0]; $x++){\n\t\t\t\t$pixel = ImageColorAt($this->im, $x, $y);\n\t\t\t\t$redpix = ($pixel >> 16 & 0xFF);\n\t\t\t\t$greenpix = ($pixel >> 8 & 0xFF);\n\t\t\t\t$bluepix = ($pixel & 0xFF);\n\t\t\t\tif(sqrt(pow($redpix - $red, 2) + pow($greenpix - $green, 2) + pow($bluepix - $blue, 2)) < $tolerance)\n\t\t\t\t\timagesetpixel($this->im, $x, $y, imagecolorallocatealpha($this->im, $rednew, $greennew, $bluenew, $pixel >> 24 & 0xFF));\n\t\t\t}\n\t\t}\n\n\t}",
"public function getImageRedPrimary () {}",
"function despeckleImage(){}",
"private function colorreplace() {\n\t\t$red = hexdec ( substr ( $this->Colorreplace [1], 1, 2 ) );\n\t\t$green = hexdec ( substr ( $this->Colorreplace [1], 3, 2 ) );\n\t\t$blue = hexdec ( substr ( $this->Colorreplace [1], 5, 2 ) );\n\t\t$rednew = hexdec ( substr ( $this->Colorreplace [2], 1, 2 ) );\n\t\t$greennew = hexdec ( substr ( $this->Colorreplace [2], 3, 2 ) );\n\t\t$bluenew = hexdec ( substr ( $this->Colorreplace [2], 5, 2 ) );\n\t\t$tolerance = sqrt ( pow ( $this->Colorreplace [3], 2 ) + pow ( $this->Colorreplace [3], 2 ) + pow ( $this->Colorreplace [3], 2 ) );\n\t\tfor($y = 0; $y < $this->size [1]; $y ++) {\n\t\t\tfor($x = 0; $x < $this->size [0]; $x ++) {\n\t\t\t\t$pixel = ImageColorAt ( $this->im, $x, $y );\n\t\t\t\t$redpix = ($pixel >> 16 & 0xFF);\n\t\t\t\t$greenpix = ($pixel >> 8 & 0xFF);\n\t\t\t\t$bluepix = ($pixel & 0xFF);\n\t\t\t\tif (sqrt ( pow ( $redpix - $red, 2 ) + pow ( $greenpix - $green, 2 ) + pow ( $bluepix - $blue, 2 ) ) < $tolerance)\n\t\t\t\t\timagesetpixel ( $this->im, $x, $y, imagecolorallocatealpha ( $this->im, $rednew, $greennew, $bluenew, $pixel >> 24 & 0xFF ) );\n\t\t\t}\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the base lang folder. | public function getBaseLangFolder(): string
{
return self::$languageFolder;
} | [
"public function getBaseLanguageDir()\n {\n return $this->paths->getBaseLanguageDir();\n }",
"public function getLangDir(){\n return $this->getRootDir() . 'lang/';\n }",
"public static function LanguageFolder()\n {\n return dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . Configuration::getApplicationFolder() . DIRECTORY_SEPARATOR . 'Language';\n }",
"public function langPath()\n {\n return $this->basePath.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'lang';\n }",
"function wp_lang_dir() {\n return $this->find_folder(WP_LANG_DIR);\n }",
"public static function lang()\n {\n return self::dirURL() . 'lang/';\n }",
"private static function _getLanguagesDir()\n\t{\n\t\treturn BASE_DIR . 'language' . DS;\n\t}",
"private function getMainLangDir()\n {\n return self::$langDir . '\\\\' .\n (isset($_SESSION['Loca']['locale'])) ? $_SESSION['Loca']['locale'] : self::$locale;\n }",
"public function langPath()\n {\n return $this->resourcePath() . DIRECTORY_SEPARATOR . 'lang';\n }",
"public function langPath()\n {\n return $this->resourcePath().DIRECTORY_SEPARATOR.'lang';\n }",
"public static function get_lang_dir() {\n\n\t\treturn static::$lang_dir;\n\t}",
"public function langPath()\n {\n return __DIR__ . \"/../Lang\";\n }",
"public function getLanguagePath()\n {\n return self::$languageRootPath . '/';\n }",
"public static function get_default_language_directory() {\n\t\treturn Plugin_Name::get_plugin_path( 'languages' );\n\t}",
"function base_path()\n\t\t{\n\t\t\treturn dirname(__DIR__);\n\t\t}",
"function getThemeBase() {\n return VPATH_ROOT.DS.'themes';\n }",
"protected function lang1Path()\n {\n return realpath(dirname(__FILE__) . '/data/languages/language1');\n }",
"public static function getLanguagesPath()\n {\n $path = self::getStringBaseValue('languages_path', 'resources/lang');\n\n return Helpers::getPathWithSlash($path);\n }",
"public static function getTranslationFolderPath(): string\n {\n return self::$translationFolderPath;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check that in the DBBean $obj there is no other record where the field 'fieldName' has the value 'fieldValue' (fex. unique emails....) | public function validateIsUnique($dbObj, $fieldName, $fieldValue, $errorMsg=null) {
if ( empty($fieldValue) ) return;
$isOk = null;
try {
$found = $dbObj->getByField($fieldName, $fieldValue);
// If no exception has been thrown, that means there is a record and this
// is an error EXCEPT is rthe same record
$isOk = $found['Id']===$dbObj->getId();
} catch(NoRowSelectedException $e) {
// This is ok, there are no other records
$isOk = true;
} catch(MultipleRowsSelectedException $e) {
$isOk = false;
}
if ( !$isOk ) {
if ( is_null($errorMsg) ) {
$this->addErrorCode( $fieldName . 'IsNotUnique', $fieldName);
} else {
$this->addErrorMsg( $errorMsg, $fieldName);
}
}
} | [
"public function hasRepeatedObjField()\n {\n return count($this->get(self::REPEATED_OBJ_FIELD)) !== 0;\n }",
"private function recordExistCreate($field, $value) {\n //Hent udvalgt i db\n $account = $this->getAccountmapper()->findOneBy(array($field => $value));\n $exists = true;\n if ($account === NULL) {\n $exists = false;\n } \n return $exists;\n }",
"public function _value_exists($field_value,$field_name)\n\t{\n\t\treturn !($this->_unique_field($field_value,$field_name));\n\t}",
"function checkUnique($data, $fieldName)\t{\n\t\t$valid = false;\n\t\tif ( isset($fieldName) && $this->hasField($fieldName)) {\n\t\t\t$valid = $this->isUnique(array($fieldName => $data));\n\t\t}\n\t\treturn $valid;\n\t}",
"public function validateUnique($field, $object) {\r\n\t\t$existing = $this->findByProperty($field, $object->$field);\r\n\t if (!is_null($existing)) {\r\n\t\t\tif ($object->isNew() || (!$object->isNew() && $object->getId() != $existing->getId())) {\r\n\t \t\t\treturn false;\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\t \t\t\r\n\t}",
"function checkUniquenessOfString1($tableName,$fieldName,$fieldValue,$fieldName1,$fieldValue1)\n{\n\n $query = $this->db->query(\"Select $fieldName from $tableName where $fieldName='$fieldValue' and $fieldName1!='$fieldValue1'\");\n $totalRowsUnique =$query->num_rows();\n if($totalRowsUnique!=0)\n { \n return true;\n }\n else\n { \n return false;\n }\n}",
"public function fieldExists($fieldName) {}",
"public function record_exists(){\r\n\r\n $this->where( array( $this->id_field.'<>' => $this->{$this->id_field} ) );\r\n \r\n $sql = $this->build_select_sql().\" LIMIT 1\";\r\n\r\n if( $row = $this->fetch_data( $this->query( $sql ) ) ){\r\n $this->clear_clauses();\r\n return TRUE;\r\n }else{\r\n $this->clear_clauses();\r\n return FALSE;\r\n }\r\n }",
"public function has($_field);",
"private function recordExistEdit($field, $value, $id) {\n $account = $this->identity()->getFkaccountid();\n //Hent udvalgt i db\n $user = $this->getUsermapper()->findOneBy(array($field => $value, 'fkaccountid' => $account));\n if ($user === NULL) {\n return false;\n } else {\n if ($user->getId() === $id) {\n return false;\n } if ($user->getId() != $id) {\n return true;\n }\n }\n }",
"function testForUniqueness($tblname,$fieldname,$value)\n\t\t{\n\n\t\t\t$query = \"select * from \".$tblname.\" where \".$fieldname.\"='\".$value.\"'\";\n\t\t\tmyLog($query);\n\t\t\t$array=@mysql_query($query) or die(errorCatch(mysql_error()));\n\t\t\t\n\t\t $totalid=mysql_num_rows($array);\n\t\t if(!$totalid==0)\n\t\t\treturn true;\n\t\t else\n\t\t\treturn true;\n\t\t}",
"function checkByField() {\n //Get the name of the table\n $db =& ConnectionManager::getDataSource($this->useDbConfig);\n $tableName = $db->fullTableName($this, false);\n\n // cek if field created_by and modified_by is exists in current table\n $result = $this->query(\"SELECT column_name FROM information_schema.columns WHERE table_name ='{$tableName}' and column_name LIKE '%ed_by';\");\n if( isset( $result[0]['COLUMNS']['column_name']) || isset($result[0][0]['column_name'])) {\n return true;\n } else {\n return false;\n }\n }",
"function existRecords($table, $field_name, $field_value, $pk, $pk_value = 0, $field_name1 = \"\", $field_value1 = \"\") {\n\n $query = \"SELECT COUNT(\" . $pk . \") as CNT FROM \" . $table . \" where \" . $field_name . \"=\" . $this->obj->db->escape($field_value) . \" \";\n\n if ($field_name1 != \"\" && $field_value1 != \"\") {\n $query.=\" AND \" . $field_name1 . \"='\" . $field_value1 . \"' \";\n }\n if ($pk_value) {\n $query.=\" AND \" . $pk . \"!='\" . $pk_value . \"'\";\n }\n\n $recordSet = $this->obj->db->query($query);\n if ($recordSet->num_rows() > 0) {\n $row = $recordSet->row();\n return $row->CNT;\n } else {\n return \"\";\n }\n }",
"private function isUnique($field)\n\t{\n\t\t$db = JFactory::getDbo();\n\t\t$query = $db->getQuery(true);\n\n\t\t$query\n\t\t\t->select($db->quoteName($field))\n\t\t\t->from($db->quoteName($this->_tbl))\n\t\t\t->where($db->quoteName($field) . ' = ' . $db->quote($this->$field))\n\t\t\t->where($db->quoteName('id') . ' <> ' . (int)$this->{$this->_tbl_key});\n\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\n\t\treturn ($db->getNumRows() == 0) ? true : false;\n\t}",
"function tep_field_exists($table,$field) {\n $describe_query = tep_db_query(\"describe $table\");\n while($d_row = tep_db_fetch_array($describe_query))\n {\n if ($d_row[\"Field\"] == \"$field\")\n return true;\n }\n return false;\n }",
"function tep_field_exists($table,$field) {\n\n $describe_query = tep_db_query(\"describe $table\");\n while($d_row = tep_db_fetch_array($describe_query))\n {\n if ($d_row[\"Field\"] == \"$field\")\n return true;\n }\n\n return false;\n }",
"function has_field($object, $field) {\n //return in_array($field, array_keys(get_object_vars($object)));\n return array_key_exists($field, get_object_vars($object));\n}",
"function isDuplicate($table_name, $field_name, $value, $type){\r\n \tif($type == \"string\"){\r\n \t\t$value = \"'\" . $value . \"'\";\r\n \t}\r\n \t$isduplicate = false;\r\n \tif(getValue(\"SELECT * FROM \" . $table_name . \" WHERE \" . $field_name . \" = \" . $value) != \"\")$isduplicate = true;\r\n \treturn $isduplicate;\r\n }",
"function checkUniquenessOfString($tableName,$fieldName,$fieldValue)\n{\n $query = $this->db->query(\"Select $fieldName from $tableName where $fieldName='\".$fieldValue.\"'\");\n $totalRowsUnique = $query->num_rows();\n if($totalRowsUnique!=0)\n {\n \n return true;\n }\n else\n {\n \n return false; \n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of insertUnilevelTree | public function getInsertUnilevelTree()
{
return $this->insertUnilevelTree;
} | [
"public function executeAdd_tree() {\n\t\tif ($this->getName () == \"\") {\n\t\t\treturn $this->onError ( \"Il faut un nom.\" );\n\t\t}\n\t\t\n\t\tif ($this->valide_tree_by_name ( $this->getName () )) {\n\t\t\treturn $this->onError ( \"Doublon de tree en base.\" );\n\t\t}\n\t\t\n\t\t// On ajoute le tree en base\n\t\t$treeOpts = array ();\n\t\t$treeOpts [\"id\"] = 0; // Zero means create a new one rather than save over an existing one\n\t\t$treeOpts [\"name\"] = $this->getName ();\n\t\t$treeOpts [\"sort_type\"] = SORT_TYPE_TREE;\n\t\t$treeId = sql_save ( $treeOpts, \"graph_tree\" );\n\t\tsort_tree ( SORT_TYPE_TREE, $treeId, $treeOpts [\"sort_type\"] );\n\t\t$this->setTreeId ( $treeId );\n\t\t$this->onDebug ( \"Tree-id : \" . $treeId, 1 );\n\t\t\n\t\treturn $treeId;\n\t}",
"public static function getTreeId()\n {\n return ++self::$tree_counter;\n }",
"public function getTreeID() {\n\treturn $this->treeid;\n}",
"public function get_level_value() {\n\t\t\treturn $this->{$this->level_column_name};\n\t\t}",
"public function insert() {\n $conn = DataObject::connect();\n $sql = \"INSERT INTO \" . TBL_MENU_NODE . \"(parentId, caption, text) VALUES (:parentId, :caption, :text)\";\n \n $st = $conn->prepare($sql);\n $st->bindValue(\":parentId\", $this->data[\"parentId\"], PDO::PARAM_INT);\n $st->bindValue(\":caption\", $this->data[\"caption\"], PDO::PARAM_STR);\n $st->bindValue(\":text\", $this->data[\"text\"], PDO::PARAM_STR);\n \n try {\n $st->execute();\n } catch(PDOException $e) {\n die(\"Connection failed: \" . $e->getMessage());\n }\n \n $lastInsertId = $conn->lastInsertId();\n\n DataObject::disconnect($conn);\n return $lastInsertId;\n }",
"public function setInsertUnilevelTree(bool $insertUnilevelTree)\n {\n $this->insertUnilevelTree = $insertUnilevelTree;\n\n return $this;\n }",
"public function getTreeParent(){\n return $this->treeParentRow;\n }",
"public function getTreeLeft()\n\t{\n\n\t\treturn $this->tree_left;\n\t}",
"public function getTree();",
"public function tree()\n {\n return $this->nodeVisitorHandler->result;\n }",
"protected function get_root_value()\n {\n }",
"public function tree()\n {\n return Tree::i();\n }",
"protected function insertLeft(){\n\t\t$parentInfo = $this->getNodeInfo($this->_parent);\n\t\t$parentLeft = $parentInfo['lft'];\n\t\t\n\t\t$bind\t\t= array(\"lft\"\t\t=> new Zend_db_Expr('lft + 2'));\n\t\t$where\t\t= 'lft >= '. $parentLeft;\n\t\t$this->_db->update($this->_name,$bind,$where);\n\t\t\n\t\t$bind\t\t= array(\"rgt\"\t\t=> new Zend_db_Expr('rgt + 2'));\n\t\t$where\t\t= 'rgt >= '. ($parentLeft + 1);\n\t\t$this->_db->update($this->_name,$bind,$where);\n\t\t\n\t\t$data = $this->_data;\t\t\n\t\t$data['parents']\t= $this->_parent;\n\t\t$data['lft'] \t\t= $parentLeft + 1;\n\t\t$data['rgt'] \t\t= $parentLeft + 2;\n\t\t$data['level'] \t\t= $parentInfo['level'] + 1;\n\t\t\n\t\t$this->_db->insert($this->_name,$data);\n\t}",
"function childs_insert($value,$inside=TRUE,$pos=NULL){//TODU CODE\n $pos = $this->extpos($pos);\n if(is_null($inside)) $inside = TRUE;\n }",
"function get_tree_result_data() {\n return $this->tree_result_data;\n }",
"public function getLevel(){\n\t\t$list_nodes=$this->list_nodes;\n\t\tforeach ($list_nodes as $id=>$level) {\n\t\t\tif($this->id==$id) return $level;\n\t\t}\n\t}",
"protected function _getTree(){\n\t\tif (!$this->_tree) {\n\t\t\t$this->_tree = Mage::getResourceModel('megamenu2/menuitem_tree')->load();\n\t\t}\n\t\treturn $this->_tree;\n\t}",
"function TMDgetTreeID($name){\r\n\tglobal $TMDtbl_tree;\r\n\r\n\t$query = \"SELECT id FROM $TMDtbl_tree WHERE name='$name';\";\r\n\t$result = mysql_query($query) or die(\"Cannot query $query<br>\".mysql_error());\r\n\tif(mysql_num_rows($result) != 1) return false;\r\n\t$tree = mysql_fetch_array($result);\r\n\treturn $tree[\"id\"];\r\n}",
"public function getLevel()\n {\n if ( ! isset($this->record['level'])) {\n $baseAlias = $this->_tree->getBaseAlias();\n $componentName = $this->_tree->getBaseComponent();\n $q = $this->_tree->getBaseQuery();\n $q = $q->addWhere(\"$baseAlias.lft < ? AND $baseAlias.rgt > ?\", array($this->getLeftValue(), $this->getRightValue()));\n\n $q = $this->_tree->returnQueryWithRootId($q, $this->getRootValue());\n \n $coll = $q->execute();\n\n $this->record['level'] = count($coll) ? count($coll) : 0;\n }\n return $this->record['level'];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation getMealPlanTemplateAsyncWithHttpInfo Get Meal Plan Template | public function getMealPlanTemplateAsyncWithHttpInfo($username, $id, $hash)
{
$returnType = 'object';
$request = $this->getMealPlanTemplateRequest($username, $id, $hash);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
);
} | [
"public function getTemplateInfo();",
"public function getTemplate()\n {\n $callback = $this->callback;\n\n $callback($template = new TemplateBuilder($this->bot));\n\n return $template->getTemplate();\n }",
"public function retrieveTemplate8WithHttpInfo($loanId)\n {\n $returnType = '\\Frengky\\Fineract\\Model\\GetLoansLoanIdChargesTemplateResponse';\n $request = $this->retrieveTemplate8Request($loanId);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if (!in_array($returnType, ['string','integer','bool'])) {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Frengky\\Fineract\\Model\\GetLoansLoanIdChargesTemplateResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function retrieveOfficeTemplate1Async()\n {\n return $this->retrieveOfficeTemplate1AsyncWithHttpInfo()\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function restReportsKeyFiguresConfigTemplatesGetAsyncWithHttpInfo()\n {\n $returnType = 'object[]';\n $request = $this->restReportsKeyFiguresConfigTemplatesGetRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function v1PropertyTemplatesPerilsGetAsyncWithHttpInfo($accept_language = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\TemplateMetadataResponse[]';\n $request = $this->v1PropertyTemplatesPerilsGetRequest($accept_language);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getPolicyTemplatesAsyncWithHttpInfo()\n {\n $returnType = '\\OpenAPI\\Client\\Model\\TemplateMetadataResponse[]';\n $request = $this->getPolicyTemplatesRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function select_template() {\n // $templates = $this->run_api_query('templates');\n // print_r($templates);\n print \"********** TEMP select_template() returning 283073 **********\\n\";\n\n return '283073';\n }",
"public function getTemplatesAsyncWithHttpInfo()\n {\n $returnType = '\\KlippaOCRAPI\\Model\\GetTemplatesBody';\n $request = $this->getTemplatesRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function auLeaveAllowanceTemplateGetAsyncWithHttpInfo($id, $business_id, string $contentType = self::contentTypes['auLeaveAllowanceTemplateGet'][0])\n {\n $returnType = '\\OpenAPI\\Client\\Model\\AuLeaveAllowanceTemplateModel';\n $request = $this->auLeaveAllowanceTemplateGetRequest($id, $business_id, $contentType);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function getTemplate($name);",
"public function getBundleTemplateAsync($id)\n {\n return $this->getBundleTemplateAsyncWithHttpInfo($id)->then(function ($response) {\n return $response[0];\n });\n }",
"public function analysisTemplateGetByPath($path, $selected_fields = null)\r\n {\r\n list($response) = $this->analysisTemplateGetByPathWithHttpInfo($path, $selected_fields);\r\n return $response;\r\n }",
"public function builderAssetUrlsTweakTemplatesIdGetWithHttpInfo($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling builderAssetUrlsTweakTemplatesIdGet');\n }\n // parse inputs\n $resourcePath = \"/BuilderAsset/urls/tweakTemplates/{id}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\InlineResponse200',\n '/BuilderAsset/urls/tweakTemplates/{id}'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\InlineResponse200', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\InlineResponse200', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function getAchievementTemplateAsyncWithHttpInfo($id)\n {\n $returnType = '\\KnetikCloud\\Model\\TemplateResource';\n $request = $this->getAchievementTemplateRequest($id);\n\n return $this->client->sendAsync($request)->then(function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }, function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n \"[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})\",\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n });\n }",
"protected function getTemplate()\n {\n // If not specified, default to the registered name of the prop\n $template = empty($this->template) ? $this->name : $this->template;\n return $template;\n }",
"public function inventoryAttributeGroupTemplateGETRequestAttributeGroupTemplatesAttributeGroupTemplateIDGetAsync($accept, $attribute_group_template_id, $jiwa_stateful = null)\n {\n return $this->inventoryAttributeGroupTemplateGETRequestAttributeGroupTemplatesAttributeGroupTemplateIDGetAsyncWithHttpInfo($accept, $attribute_group_template_id, $jiwa_stateful)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getDynamicTemplate()\n {\n return $this->readOneof(6);\n }",
"public function getMyTemplates() {\n return $this->client->MakeActiveTrailApiCall(\n EndPoints::$TEMPLATES['uri'],\n EndPoints::$TEMPLATES['method']\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set use button set | public function setUseButtonSet($useButtonSet){
$this->_useButtonSet = $useButtonSet;
} | [
"public function setFormButtons();",
"public function setButtons()\n {\n $this->setDefaultButtons();\n }",
"public function setButtons()\n {\n // set buttons by widget parameters or defaults\n foreach (self::$defaults as $name => $values) {\n foreach ($values as $property => $value)\n if(!isset($this->btns[$name][$property]))\n $this->btns[$name][$property] = $property == 'action' && !$this->secure \n ? str_replace('-secure', '', self::$defaults[$name][$property])\n : self::$defaults[$name][$property];\n }\n // full path server side handlers\n $this->btns['delete']['action'] = Url::toRoute($this->btns['delete']['action']);\n $this->btns['save']['action'] = Url::toRoute($this->btns['save']['action']);\n $this->btns['crop']['action'] = Url::toRoute($this->btns['crop']['action']);\n $this->btns['swap']['action'] = Url::toRoute($this->btns['swap']['action']);\n }",
"public function configureButtons();",
"public function getUseButtonSet(){\n return $this->_useButtonSet;\n }",
"function _setButtonBehavior($button, $show, $label, $post_url, $onclick) {\n\t\t\t$b = $this->buttons[$button];\n\t\t\tif ($b) {\n\t\t\t\t$b['show'] = $show;\n\t\t\t\tif ($label != false)\n\t\t\t\t\t$b['label'] = $label;\n\t\t\t\tif ($post_url != false)\n\t\t\t\t\t$b['post_url'] = $post_url;\n\t\t\t\tif ($onclick != false)\n\t\t\t\t\t$b['onclick'] = $onclick;\n\t\t\t\t$this->buttons[$button] = $b;\n\t\t\t}\n\t\t}",
"function theme_button_set($buttons, $options = array())\n{\n return _theme_button_set($buttons, $options, 'normal');\n}",
"protected function setUpButtons()\n {\n $this->setButtons(\n [\n 'cancel',\n 'delete',\n ]\n );\n }",
"public function initButtons()\n {\n $this->buttons = collect();\n\n if ($this->tienePermiso('update')) {\n $this->addButton('line', 'update', 'view', 'cesi::crud.buttons.update', 'end');\n }\n if ($this->tienePermiso('delete')) {\n $this->addButton('line', 'delete', 'view', 'cesi::crud.buttons.delete', 'end');\n }\n\n if ($this->tienePermiso('create')) {\n $this->addButton('top', 'create', 'view', 'cesi::crud.buttons.create', 'end');\n }\n\n $this->addButton('top', 'refresh', 'view', 'cesi::crud.buttons.refresh', 'end');\n }",
"protected function makeButtons() {}",
"public function setButtons ($setting)\n {\n if (is_array($setting)) {\n $this->validateDataType($setting, 'setButtons');\n\n $this->jsConfig = array_replace_recursive($this->jsConfig, array('buttons' => $setting));\n $this->jsConfig['dom']['B'] = true;\n } else {\n if (strtolower($setting) == 'all') { //@enhancement if needed add array of possible keywords and if them through\n $this->jsConfig = array_replace_recursive($this->jsConfig, array('buttons' => array(\"print\", \"copy\", \"csv\", \"excel\", \"pdf\")));\n $this->jsConfig['dom']['B'] = true;\n } else {\n $this->validateDataType($setting, 'setButtons');\n }\n }\n }",
"function SetAffirmativeButton(wxButton &$button){}",
"public function button($button) { return $this->getButton($button);}",
"public function getButton() {}",
"public function setButtonName(){\r\n switch ($this->page) {\r\n case 'login':\r\n $this->buttonName = 'Login'; break;\r\n case 'register':\r\n $this->buttonName = 'Register'; break;\r\n default:\r\n $this->buttonName = 'Submit'; break;\r\n }\r\n }",
"function wpyes_button() {\n\t\t$settings = new Wpyes( 'wpyes_button' ); // Initialize the Wpyes class.\n\n\t\t$settings->add_tab(\n\t\t\tarray(\n\t\t\t\t'id' => 'tab_1',\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_section(\n\t\t\tarray(\n\t\t\t\t'id' => 'section_1',\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_field(\n\t\t\tarray(\n\t\t\t\t'id' => 'wpyes_button_field_1',\n\t\t\t\t'required' => true,\n\t\t\t\t'type' => 'number',\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_field(\n\t\t\tarray(\n\t\t\t\t'id' => 'wpyes_button_field_2',\n\t\t\t\t'required' => true,\n\t\t\t\t'type' => 'multiselect',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'foo' => 'foo',\n\t\t\t\t\t'bar' => 'bar',\n\t\t\t\t\t'foo bar' => 'foo bar',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_button( 'Custom Action Button', 'index.php' );\n\t\t$settings->add_button( 'Custom Action Button 2', 'index.php' );\n\n\t\t$settings->init(); // Run the Wpyes class.\n\t}",
"public function pressButton();",
"function theme_field_button_set($buttons, $options = array())\n{\n return _theme_button_set($buttons, $options, 'field');\n}",
"public function setButton($value) {\n return $this->set(self::BUTTON, $value);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display Post Insert Form | public function postInsertForm() {
view('admin/post-insert');
} | [
"public function insertAction()\n\t{\n\t\t$module = $this->_useModules ? \"{$this->_moduleName}/\" : '';\n\t\t\n\t\t$data = $this->_getDataFromPost();\n\n\t\t$options = array(\n\t\tFgsl_Form_Edit::DATA => $data,\n\t\tFgsl_Form_Edit::ACTION => BASE_URL.\"$module{$this->_controllerAction}/save\",\n\t\tFgsl_Form_Edit::MODEL => $this->_model\n\t\t);\n\n\t\t$this->_view->assign('form', new Fgsl_Form_Edit($options));\n\t\t$this->_view->render('insert.phtml');\n\t}",
"public function insertAction()\n\t{\n\t\t$module = $this->_useModules ? \"{$this->_moduleName}/\" : '';\n\t\t\n\t\t$data = $this->_getDataFromPost();\n\n\t\t$options = array(\n\t\tFgsl_Form_Edit::DATA => $data,\n\t\tFgsl_Form_Edit::ACTION => BASE_URL.\"/$module{$this->_controllerAction}/save\",\n\t\tFgsl_Form_Edit::MODEL => $this->_model\n\t\t);\n\n\t\t$this->view->assign('form', new Fgsl_Form_Edit($options));\n\t\t$this->view->render('insert.phtml');\n\t}",
"function form_insert() {\n\n $data['groups'] = $this->load_groups_options();\n $data['subsecretary'] = $this->loadSubSecretary();\n // $data['departments'] = $this->load_departments_options();\n\n $tamplate['_B'] = 'users/insert_user_view.php';\n\n $this->load->template_view($this->template_base, $data, $tamplate);\n }",
"public function showPostCreationForm() {\n $post = null;\n return view('posts.create-edit', compact('post'));\n }",
"public function createPost()\n {\n // Call of view\n $myView = new View('addpost');\n $myView->build(array('chapters' => null, 'comments' => null, 'warningList' => null,'HOST' => HOST, 'adminLevel' => $_SESSION['adminLevel']));\n }",
"public function getAddPost() {\n\n return view('admin.post_add', $this->data);\n }",
"public function addPost()\n {\n if (!(isset($_POST['AnnulAddPost']))) {\n if ( (isset($_POST['newTitle'])) AND (!empty(isset($_POST['newTitle']))) AND (isset($_POST['newPost'])) AND (!empty(isset($_POST['newPost']))) ) {\n // set of Post object\n $newPost = new Post();\n $newPost->setTitle($_POST['newTitle']);\n $newPost->setContent($_POST['newPost']);\n $newPost->setPosition($_POST['position']);\n // call of manager\n $manager = new PostManager();\n $manager->addPost($newPost);\n // Call of view\n $myView = new View('');\n $myView->redirect('home.html');\n }else {\n $myView = new View('error');\n $myView->build( array('chapters'=> null ,'comments'=>null,'warningList' => null,'HOST'=>HOST, 'adminLevel' => $_SESSION['adminLevel']));\n }\n } else{\n $myView = new View('');\n $myView->redirect('home.html');\n }\n }",
"public function add() \n { \n $data['posts'] = $this->postss->add();\n $data['action'] = 'posts/save';\n \n $this->template->js_add('\n $(document).ready(function(){\n // binds form submission and fields to the validation engine\n $(\"#form_posts\").parsley();\n });','embed');\n \n $this->template->render('posts/form',$data);\n\n }",
"public function insertPost($post);",
"public function create()\n\t{\n\t\treturn view('add_post_form');\n\t}",
"protected function DisplayPost()\n\t{\n\t\t\n\t}",
"public function displayInsertForm($options = array()){\n\t\t// Add a submit button if one does not exist\n\t\t$submitAdded = $this->addFormSubmit($this->submitTextInsert);\n\n\t\t// Set default title if needed\n\t\tif (!isset($options['title'])) $options['title'] = $this->insertTitle;\n\n\t\t// Get the template text (overriding the template if needed)\n\t\t$templateFile = 'insertUpdate.html';\n\t\t$templateText = isset($options['template'])\n\t\t\t? $this->getTemplateText($templateFile, $options['template'])\n\t\t\t: $this->getTemplateText($templateFile);\n\n\t\t// Create the template object\n\t\t$template = new formBuilderTemplate($this, $templateText);\n\t\t$template->formID = $this->generateFormID();\n\t\t$template->formType = self::TYPE_INSERT;\n\t\t$template->renderOptions = $options;\n\n\t\t// Apply any options\n\t\tif (isset($options['formAction'])) $template->formAttributes['action'] = $options['formAction'];\n\n\t\t// Render time!\n\t\t$output = $template->render();\n\n\t\t// Remove any submit button which we added (must be before form is saved)\n\t\tif($submitAdded) $this->fields->removeField('submit');\n\n\t\t// Save the form to the session\n\t\t$this->saveForm($template->formID, $template->formType);\n\n\t\t// Return the final output\n\t\treturn $output;\n\t}",
"function display_insert_form() {\n\t\tglobal $socialflow;\n\t\t?>\n\t\t<form id=\"sf-account-category-form\" action=\"options.php\" method=\"post\">\n\t\t\t<select id=\"sf-select-account\" name=\"account_id\">\n\t\t\t\t<option value=\"-1\"><?php _e( 'Select Account', 'socialflow' ); ?></option>\n\t\t\t\t<?php foreach ( $socialflow->accounts->get( $socialflow->options->get( 'show' ) ) as $account_id => $account ) : ?>\n\t\t\t\t\t<option value=\"<?php echo esc_attr( $account_id ); ?>\" ><?php echo esc_attr( $socialflow->accounts->get_display_name( $account ) ); ?></option>\n\t\t\t\t<?php endforeach ?>\n\t\t\t</select>\n\t\t\t<?php wp_dropdown_categories(array(\n\t\t\t\t'hide_empty' => 0,\n\t\t\t\t'name' => 'term_id',\n\t\t\t\t'id' => 'sf-term-id',\n\t\t\t\t'show_option_none' => __( 'Select Category' )\n\t\t\t)); ?>\n\t\t\t<input class=\"button\" type=\"submit\" value=\"<?php _e( 'Add', 'socialflow' ) ?>\" />\n\t\t\t<img class=\"sf-loader\" style=\"display:none;\" src=\"<?php echo plugins_url( 'assets/images/wpspin.gif', SF_FILE ) ?>\" alt=\"\">\n\t\t</form>\n\t\t<?php\n\t}",
"public function add () {\n if (!$this->is_blog()) {\n return;\n }\n\n echo $this->popup_form();\n }",
"public function handleAddPost() {\n\t\treturn View::make('housing.postSuccess');\n\t}",
"public function p_add() {\n $_POST['user_id'] = $this->user->user_id;\n\n # Unix timestamp of when this post was created / modified\n $_POST['created'] = Time::now();\n $_POST['modified'] = Time::now();\n\n # Insert\n # Note we didn't have to sanitize any of the $_POST data because we're using the insert method which does it for us\n DB::instance(DB_NAME)->insert('posts', $_POST);\n\n # Send 'em back\n \n Router::redirect(\"/users/profile\");\n }",
"public function print_form() {\r\n\t\tglobal $post_ID;\r\n\r\n\t\tinclude_once( GEO_MASHUP_DIR_PATH . '/edit-form.php');\r\n\t\tgeo_mashup_edit_form( 'post', $post_ID, get_class( $this ) );\r\n\t}",
"public function actionCreate()\n {\n\t$this->layout='wide';\n $post=new Post;\n if(isset($_POST['Post']))\n {\n $post->attributes=$_POST['Post'];\n if(isset($_POST['previewPost']))\n $post->validate();\n else if(isset($_POST['submitPost']) && $post->save())\n {\n if(Yii::app()->user->status==User::STATUS_VISITOR)\n {\n Yii::app()->user->setFlash('message','Thank you for your post. Your post will be posted once it is approved.');\n $this->redirect(Yii::app()->homeUrl);\n }\n $this->redirect(array('show','slug'=>$post->slug));\n }\n }\n $this->pageTitle=Yii::t('lan','New Post');\n $this->render('create',array('post'=>$post));\n }",
"public function add(){\n\t\tif($this->request->is('post')){\n\t\t\tif($this->Post->save($this->request->data)){\n\t\t\t\t$this->Session->setFlash('Your post has been saved');\n\t\t\t\t$this->redirect(array('action'=>'index'));\n\t\t\t} \n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Connect to an external web service and look up the latest versions of Web Mill and PHP Returns an array that holds 2 strings that have a PHP version, and a Web Mill version. If the cURL request fails to connect, the function will log the error and return false | function checkVersions() {
//TODO: Put the version checker service online instead of localhost
$curl_request = curl_init("0.0.0.0:3002");
//By default the request type is "GET"
curl_setopt_array($curl_request, array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CONNECTTIMEOUT => 10, //Must connect within 10 seconds
CURLOPT_TIMEOUT => 20, //Must finish the whole request in 20 seconds... or else
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2_0, //Falls back to 1.1 if 2.0 won't work
));
//Get a response or a returned error (or if failed to connect)
$response = curl_exec($curl_request);
$err = curl_error($curl_request);
//Don't needlessly call logMsg if no error was thrown:
if(isset($err)) {
logMsg($err);
curl_close($curl_request);
return false;
}
//A sample successful response body would look like this: "7.3.1 1.0.3"
//where "7.3.1" is the PHP version and "1.0.3" is the Web Mill version.
//Close the connection and free up $curl_request's resources:
curl_close($curl_request);
//Put the PHP version and Web Mill version into an array
//They are currently separated by a space:
$versions = explode(" ", $response);
return $versions;
} | [
"function get_host_status($host_data)\n{\n global $API_version;\n global $CGM_version;\n\n $arr = array ('command'=>'version','parameter'=>'');\n $version_arr = send_request_to_host($arr, $host_data);\n\n if ($version_arr)\n {\n if ($version_arr['STATUS'][0]['STATUS'] == 'S')\n {\n $API_version = $version_arr['VERSION'][0]['API'];\n $CGM_version = $version_arr['VERSION'][0]['CGMiner'];\n \n if ($API_version >= 1.0)\n return true;\n }\n }\n return false;\n}",
"function curl_version() {}",
"public function _retrieveCurrentVersions() {\n\t \tif (!function_exists('curl_init')) {\n\t\t\t\t// Override the OK Message - Even if this passes we can't be 100% sure they are accurate since we didn't fetch the latest version\n\t\t\t\t$this->_message_ok = \"You are running a current stable version of PHP!\n\t\t\t\t\t\t<br /><strong>NOTE:</strong> CURL was unable to fetch the latest PHP Versions from the internet. This test may not be accurate if\n\t\t\t\t\t\tPhpSecInfo is not up to date.\";\n\t\t\t\t\n\t\t\t\treturn array( 'stable' => $this->recommended_value, 'eol' => $this->last_eol_value);\n\t \t}\n\t \t\n\t \t\t// Attempt to fetch from server\n\t \t\t$uri = 'https://raw.githubusercontent.com/bigdeej/PhpSecInfo/master/.version.json';\n\t \t\t$ch = curl_init();\n\t \t\t$timeout = 5;\n\t \t\t\n\t \t\t// CURL\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $uri);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n//\t\t\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n\t\t\t$data = curl_exec($ch);\n\t\t\t// Close CURL\n\t\t\tcurl_close($ch);\n\t\t\t\n\t\t\t// Decode json\n\t\t\t$json = json_decode($data);\n\t\t\t\n\t\t\t// Detect CURL error and return local value\n\t\t\tif ($data === false || !isset($json->stable) || !isset($json->eol)) {\n\t\t\t\t// Override the OK Message - Even if this passes we can't be 100% sure they are accurate since we didn't fetch the latest version\n\t\t\t\t$this->_message_ok = \"You are running a current stable version of PHP!\n\t\t\t\t\t\t<br /><strong>NOTE:</strong> CURL was unable to fetch the latest PHP Versions from the internet. This test may not be accurate if\n\t\t\t\t\t\tPhpSecInfo is not up to date.\";\n\t\t\t\t\n\t\t\t\treturn array( 'stable' => $this->recommended_value, 'eol' => $this->last_eol_value);\n\t\t\t}\n\t\t\t\n\t\t\t// to array\n\t\t\t$versions = array( 'stable' => $json->stable, 'eol' => $json->eol);\n\t\t\t\n\t\t\t// Update local recommended value (it is used elsewhere and we don't want to modify that code just yet)\n\t\t\t$this->recommended_value = $json->stable;\n\t\t\t\n\t\t\t\n\t\t\treturn $versions;\n\t }",
"function get_tls_version($curl_ssl_opt = null)\n{\n $c = curl_init();\n curl_setopt($c, CURLOPT_URL, \"https://www.howsmyssl.com/a/check\");\n curl_setopt($c, CURLOPT_RETURNTRANSFER, true);\n if ($sslversion !== null) {\n curl_setopt($c, CURLOPT_SSLVERSION, $sslversion);\n }\n $rbody = curl_exec($c);\n if ($rbody === false) {\n $errno = curl_errno($c);\n $msg = curl_error($c);\n curl_close($c);\n return \"Error! errno = \" . $errno . \", msg = \" . $msg;\n } else {\n $r = json_decode($rbody);\n curl_close($c);\n return $r->tls_version;\n }\n}",
"function versionCheck() {\n\t\trequire_once 'Cache/Lite.php';\n\t\t$options = array('cacheDir'=>CACHE_DIR . '/ntercache/', 'lifeTime'=>$this->check_version_interval);\n\t\t$cache = new Cache_Lite($options);\n\t\t$yaml = $cache->get($this->cache_name, $this->cache_group);\n\t\tif (empty($yaml)) {\n\t\t\tinclude_once 'HTTP/Request.php';\n\t\t\t$req = new HTTP_Request($this->check_version_url);\n\t\t\tif (!PEAR::isError($req->sendRequest())) {\n\t\t\t\t$yaml = $req->getResponseBody();\n\t\t\t\t$cached = $cache->save($yaml, $this->cache_name, $this->cache_group);\n\t\t\t\tif ($cached == true) {\n\t\t\t\t\tNDebug::debug('Version check - data is from the web and is now cached.' , N_DEBUGTYPE_INFO);\n\t\t\t\t} else {\n\t\t\t\t\tNDebug::debug('Version check - data is from the web and is NOT cached.' , N_DEBUGTYPE_INFO);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tNDebug::debug('Version check - data is from the cache.' , N_DEBUGTYPE_INFO);\n\t\t}\n\t\trequire_once 'vendor/spyc.php';\n\t\t$newest_version_info = @Spyc::YAMLLoad($yaml);\n\t\treturn $newest_version_info;\n\t}",
"public function getVersion() \n\t{\n\t\t$url = \"http://{$this->wnServer}/webnative/portalDI?action=version\";\n\t\treturn $this->curlObj->fetch_url($url);\n\t}",
"public function checkUpdate()\n {\n $response = null;\n $this_version = $this->get('esm:version');\n $update_url = $this->get('esm:website').'/esm-web/update/'.$this_version;\n\n if (!function_exists('curl_version'))\n {\n $tmp = @file_get_contents($update_url);\n $response = json_decode($tmp, true);\n }\n else\n {\n $curl = curl_init();\n\n curl_setopt_array($curl, array(\n CURLOPT_CONNECTTIMEOUT => 10,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_SSL_VERIFYPEER => false,\n CURLOPT_TIMEOUT => 60,\n CURLOPT_USERAGENT => 'eZ Server Monitor `Web',\n CURLOPT_URL => $update_url,\n ));\n\n $response = json_decode(curl_exec($curl), true);\n\n curl_close($curl);\n }\n\n if (!is_null($response) && !empty($response))\n {\n if (is_null($response['error']))\n {\n return $response['datas'];\n }\n }\n }",
"public function get_version () {\n $this->error = '';\n $fields = array( \"action\" => \"get_version\", \"auth\" => \"{$this->auth}\" );\n $response = $this->_sendRequest ( $fields );\n if ( $response ) {\n if ( $response[ \"status\" ] == \"success\" ) {\n return isset ( $response[ \"data\" ] ) ? $response[ \"data\" ] : false;\n } else {\n $this->error = $response[ 'errmsg' ];\n }\n }\n return false;\n }",
"private function checkConnection(){\n\t\t\t\n\t\t\t$request = $this->url.$this->getMode(\"version\").\"?\".$this->key_string;\n\t\t\t$this->http->setURL($request);\n\t\t\t$response = $this->http->send();\n\t\t\t//echo $this->http->HTMLizeErrlog();\n\t\t\t$this->bn_version = str_replace(\"_\", \".\", $response[\"version\"]);\n\n\t\t\treturn $this->http->status;\n\t\t}",
"public function getResponseVersion();",
"function checkConnectivity() {\n\t$stream = curl_init();\n\tif ($stream) {\n\t\tcurl_setopt($stream, CURLOPT_URL, \"https://push.notifica.re/status\");\n\t\tcurl_setopt($stream, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($stream, CURLOPT_HEADER, 0);\n\t\tcurl_setopt($stream, CURLOPT_VERBOSE, 1);\n\t\tcurl_setopt($stream, CURLOPT_HTTPGET, 1);\n\t\t/*\n\t\t * Uncomment the following if you get SSL self-signed certificate errors\n\t\t */\n\t\t//curl_setopt($stream, CURLOPT_CAINFO, dirname(__FILE__) . \"/cacert.pem\");\n\t\tcurl_setopt($stream, CURLOPT_USERAGENT, \"PHP Diagnostics Test 1.0\");\n\t\t$result = curl_exec($stream);\n\t\t$error = curl_error($stream);\n\t\t$info = curl_getinfo($stream, CURLINFO_CONTENT_TYPE);\n\t\t$statuscode = curl_getinfo($stream, CURLINFO_HTTP_CODE);\n\t\tcurl_close($stream);\n\t\tif ($error) {\n\t\t\techo \"\\nGot an error: \" . $error . \"\\n\"; \n\t\t} else {\n\t\t\techo \"\\nGot result: \" . $statuscode . \"\\n\" . $info . \"\\n\" . $result . \"\\n\";\n\t\t\treturn true;\n\t\t}\n\t} else {\n\t\techo \"Unable to open connection\\n\";\n\t}\n\treturn false;\n}",
"public static function compareVersion()\n\t{\n\t\tstatic $data = null;\n\n\t\tif ($data === null) {\n\t\t\ttry {\n\t\t\t\t$data = self::fetchServiceResult('build/compare-version.json', array('my_build' => DP_BUILD_TIME));\n\t\t\t} catch (\\Exception $e) {\n\t\t\t\t$data = array();\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}",
"public function getCdnVersions();",
"protected function _checkTLSVersion()\n {\n $return = array(\n 'status' => false,\n 'error_message' => ''\n );\n if (defined('CURL_SSLVERSION_TLSv1_2')) {\n $tls_server = $this->context->link->getModuleLink($this->module->name, 'tlscurltestserver');\n $curl = curl_init($tls_server);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);\n $response = curl_exec($curl);\n if ($response != 'ok') {\n $return['status'] = false;\n $curl_info = curl_getinfo($curl);\n if ($curl_info['http_code'] == 401) {\n $return['error_message'] = $this->module->l('401 Unauthorized. Please note that the TLS verification can not be done if you have a htaccess password protection enabled on your website.', 'AdminPayPalController');\n } else {\n $return['error_message'] = curl_error($curl);\n }\n } else {\n $return['status'] = true;\n }\n } else {\n $return['status'] = false;\n if (version_compare(curl_version()['version'], '7.34.0', '<')) {\n $return['error_message'] = $this->module->l('You are using an old version of cURL. Please update your cURL extension to version 7.34.0 or higher.', 'AdminPayPalController');\n } else {\n $return['error_message'] = $this->module->l('TLS version is not compatible', 'AdminPayPalController');\n }\n }\n return $return;\n }",
"protected function get_curl_version()\n {\n }",
"private function getCurrentVersion(){\n\n $uri = sprintf(\n \"%s\".\n \"?OPERATION-NAME=getVersion\".\n \"&SECURITY-APPNAME=%s\".\n \"&RESPONSE-DATA-FORMAT=%s\",\n $this->uri_finding,\n $this->appid,\n $this->format\n\t\t);\n\n $response_xml = $this->curl($uri);\n\n $formatter = Formatter::make($response_xml, Formatter::XML);\n\n $response_array = $formatter->toArray();\n\n return $response_array['version'];\n }",
"public function checkUpdate()\n {\n if ($this->get('esm:check_updates') === false)\n return null;\n \n $response = null;\n $this_version = $this->get('esm:version');\n $update_url = $this->get('esm:website').'/esm-web/update/'.$this_version;\n\n if (!function_exists('curl_version'))\n {\n $tmp = @file_get_contents($update_url);\n $response = json_decode($tmp, true);\n }\n else\n {\n $curl = curl_init();\n\n curl_setopt_array($curl, array(\n CURLOPT_CONNECTTIMEOUT => 10,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_SSL_VERIFYPEER => false,\n CURLOPT_TIMEOUT => 60,\n CURLOPT_USERAGENT => 'eZ Server Monitor `Web',\n CURLOPT_URL => $update_url,\n ));\n\n $response = json_decode(curl_exec($curl), true);\n\n curl_close($curl);\n }\n\n if (!is_null($response) && !empty($response))\n {\n if (is_null($response['error']))\n {\n return $response['datas'];\n }\n }\n }",
"public function version()\n {\n return curl_version();\n }",
"public function getVersion() {\n\t\treturn curl_version();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method is to unsuspend user | public function unsuspendUser() {
AppLogger::info("Entering AdminController.unsuspendUser()");
try{
//GET method for user id
$id = $_GET['id'];
//calls admin business service
$service = new AdminBusinessService();
$unsuspend = $service->unsuspendUser($id);
//renders a success or fail view
if($unsuspend) {
return redirect()->back()->with('message', 'Account was unsuspended');
// return view('unsuspendSuccess');
}
else {
return redirect()->back()->with('message', 'Failed to unsuspend account');
// return view('unsuspendFail');
}
}
catch(Exception $e) {
AppLogger::error("Exception: ", array("message" => $e->getMessage()));
$data = ['errorMsg' => $e->getMessage()];
return view('exception')->with($data);
}
} | [
"public function suspendInstance()\n\t{\n\t\tglobal $DB;\n\n\t\t$this->userdata->status = 0;\n\t\t$DB->update_record('edugamemaker_user_data', $this->userdata);\n\t}",
"public function unsuspendUser($userName);",
"public function Unsuspend() {\n $action = 'unsuspendAccount';\n $post = '&username='.$this->details['option1']['value'];\n if($this->Send($action, $post)) {\n $this->addInfo('Account has been unsuspended.');\n return true;\n } else\n return false;\n }",
"public function Unsuspend() {\n return true;\n $action = 'unsuspendAccount';\n $post = '&username='.$this->details['option1']['value'];\n if($this->Send($action, $post)) {\n $this->addInfo('Account has been unsuspended.');\n return true;\n } else\n return false;\n }",
"public function unsuspend()\n {\n return $this->unsuspendAccess($this->access());\n }",
"function suspendUser ($user){\n \n Log::info(\"Entering SecurityService.suspendUser() \");\n \n //create connection to database\n $database = new Database();\n $db = $database->getConnection();\n \n // Create a User Data Service with this connection and calls suspendUser method/\n $dbService = new UserDataService($db);\n \n $user->setStatus(\"suspended\");\n $flag = $dbService->updateUser($user);\n \n // close the connection\n $db = null;\n \n // return the finder result\n Log::info(\"Exit UserBusinessService.suspendUser()\");\n return $flag;\n \n }",
"public function unblock()\n\t{\n\t\t$this->status = User::STATUS_ACTIVE;\n\n\t\tif ($this->save(FALSE))\n\t\t\treturn TRUE;\n\n\t\treturn FALSE;\n\t}",
"public function adminUnsuspendUser($id)\n\t{\n\t\t$sql = \"SELECT id,active FROM users WHERE id = '\".$id.\"'\";\n\t\t$res = $this->processSql($sql);\n\t\tif ($res){\n\t\t\t$update = \"UPDATE users SET active = 1 WHERE id = '\".$id.\"'\";\n\t\t\t$result = $this->processSql($update);\n\t\t\tif ($result)\n\t\t\treturn 99;\n\t\t\treturn 1;\n\t\t} else return 2;\n\t}",
"public function suspend()\n {\n $subscription = $this->loadSubscription();\n if ($this->isActive()) {\n $subscription->suspend();\n }\n }",
"public function actionUnlock()\n {\n UserOnline::unlock(Yii::$app->adminuser->id);\n }",
"public function suspend();",
"function unsuspend_plesk_account()\n {\n $id = $this->order_data['plesk_id'];\n $data=<<<EOF\n<packet version=\"1.3.4.0\">\n<client>\n<set>\n<filter>\n<id>$id</id>\n</filter>\n<values>\n<gen_info>\n<status>0</status>\n</gen_info>\n</values>\n</set>\n</client>\n</packet>\nEOF;\n $contents = $this->plesk_request($data);\n $return = $this->anaRes($contents);\n if($this->error)\n {\n $result['response'] = $this->error;\n $result['result'] = 0;\n }\n else\n {\n $result['response'] = \"OK\";\n $result['result'] = 1;\n $this->error = false;\n }\n $this->result = $result;\n return $this->result;\n }",
"function deActivateAccount(){\n\t\t$userID = Auth::getUserID();\n\t\t$this->setStatus($userID,0);\n\t\t$this->logout();\n\t\t$this->send(true);\t\n\t}",
"public function resumeInstance()\n\t{\n\t\tglobal $DB;\n\t\t\n\t\t$this->userdata->status = 1;\n\t\t$DB->update_record('edugamemaker_user_data', $this->userdata);\t\t\n\t\t\n\t}",
"function unsubscribe()\n {\n $agent = new Usermanager($this->thing, \"usermanager unsubscribe\");\n $this->thing->log(\n \"called the Usermanager to update user state to unsubscribe.\"\n );\n }",
"public function logoffUser():void\n {\n unset($_SESSION['user']);\n }",
"public function deactivateUser(){\n\n\t\tglobal $db;\n\t\t\n\t\t$db->SQL = \"UPDATE ebb_users SET active='0' WHERE Username='\".$this->user.\"' LIMIT 1\";\n\t\t$db->query();\n\t}",
"public function suspend_user_account()\n\t{\n\t\t$this->load->library('form_validation', $this->Dashboard_m->suspend_form_rules);\n\t\tif ($this->form_validation->run() == FALSE) {\n\t\t\t$data = $this->Dashboard_m->find_user_by_surname();\n\t\t} else {\n\t\t\t$data = $this->Dashboard_m->find_user_by_surname(true);\n\t\t}\n\t\t$this->load_my_views('Forms/suspend_f', $data);\n\t}",
"public function unblockAccess();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a list of extendedforums not tracked by the user. | function extendedforum_tp_get_untracked_extendedforums($userid, $courseid) {
global $CFG;
$sql = "SELECT f.id
FROM {$CFG->prefix}extendedforum f
LEFT JOIN {$CFG->prefix}extendedforum_track_prefs ft ON (ft.extendedforumid = f.id AND ft.userid = $userid)
WHERE f.course = $courseid
AND (f.trackingtype = ".EXTENDEDFORUM_TRACKING_OFF."
OR (f.trackingtype = ".EXTENDEDFORUM_TRACKING_OPTIONAL." AND ft.id IS NOT NULL))";
if ($extendedforums = get_records_sql($sql)) {
foreach ($extendedforums as $extendedforum) {
$extendedforums[$extendedforum->id] = $extendedforum;
}
return $extendedforums;
} else {
return array();
}
} | [
"private function getInactiveForums()\n {\n $inactiveforums = get_inactive_forums();\n if ($inactiveforums)\n {\n $this->where .= \" AND fid NOT IN ($inactiveforums)\";\n }\n }",
"function get_extendedforums_in_course($course) \n {\n global $CFG;\n \n $sql = \"SELECT f.id, f.name\n FROM {$CFG->prefix}modules m,\n {$CFG->prefix}course_modules cm,\n {$CFG->prefix}extendedforum f\n WHERE cm.course = $course->id\n AND cm.module = m.id AND cm.visible = 1\n and m.name = 'extendedforum'\n and cm.instance = f.id\n and f.type in ('general', 'qanda','news', 'eachuser') \n order by f.name asc\";\n \n return get_records_sql($sql) ;\n \n }",
"function &getForums() {\n\t\tif ($this->forums) {\n\t\t\treturn $this->forums;\n\t\t}\n\n\t\t$this->forums = array();\n\t\t$ids = $this->getAllForumIds();\n\n\t\tif (!empty($ids) ) {\n\t\t\tforeach ($ids as $id) {\n\t\t\t\tif (forge_check_perm ('forum', $id, 'read')) {\n\t\t\t\t\t$this->forums[] = new Forum($this->Group, $id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->forums;\n\t}",
"function get_unviewable_forums($only_readable_threads=false)\n{\n\tglobal $forum_cache, $permissioncache, $mybb;\n\n\tif(!is_array($forum_cache))\n\t{\n\t\tcache_forums();\n\t}\n\n\tif(!is_array($permissioncache))\n\t{\n\t\t$permissioncache = forum_permissions();\n\t}\n\n\t$password_forums = $unviewable = array();\n\tforeach($forum_cache as $fid => $forum)\n\t{\n\t\tif($permissioncache[$forum['fid']])\n\t\t{\n\t\t\t$perms = $permissioncache[$forum['fid']];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$perms = $mybb->usergroup;\n\t\t}\n\n\t\t$pwverified = 1;\n\n\t\tif($forum['password'] != \"\")\n\t\t{\n\t\t\tif($mybb->cookies['forumpass'][$forum['fid']] !== md5($mybb->user['uid'].$forum['password']))\n\t\t\t{\n\t\t\t\t$pwverified = 0;\n\t\t\t}\n\n\t\t\t$password_forums[$forum['fid']] = $forum['password'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Check parents for passwords\n\t\t\t$parents = explode(\",\", $forum['parentlist']);\n\t\t\tforeach($parents as $parent)\n\t\t\t{\n\t\t\t\tif(isset($password_forums[$parent]) && $mybb->cookies['forumpass'][$parent] !== md5($mybb->user['uid'].$password_forums[$parent]))\n\t\t\t\t{\n\t\t\t\t\t$pwverified = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif($perms['canview'] == 0 || $pwverified == 0 || ($only_readable_threads == true && $perms['canviewthreads'] == 0))\n\t\t{\n\t\t\t$unviewable[] = $forum['fid'];\n\t\t}\n\t}\n\n\t$unviewableforums = implode(',', $unviewable);\n\n\treturn $unviewableforums;\n}",
"function extendedforum_get_unmailed_posts($starttime, $endtime, $now=null) {\n global $CFG;\n\n if (!empty($CFG->extendedforum_enabletimedposts)) {\n if (empty($now)) {\n $now = time();\n }\n $timedsql = \"AND (d.timestart < $now AND (d.timeend = 0 OR d.timeend > $now))\";\n } else {\n $timedsql = \"\";\n }\n \n \n return get_records_sql(\"SELECT p.*, d.course, d.extendedforum\n FROM {$CFG->prefix}extendedforum_posts p\n JOIN {$CFG->prefix}extendedforum_discussions d ON d.id = p.discussion\n WHERE p.mailed = 0\n AND p.created >= $starttime\n AND (p.created < $endtime OR p.mailnow = 1)\n $timedsql\n ORDER BY p.modified ASC\");\n \n \n \n}",
"public function getForbiddenForums()\n\t{\n\t\t$aForums = $this->database()->select('forum_id')\n\t\t\t->from(Phpfox::getT('forum_access'))\n\t\t\t->where('var_value = 0 AND user_group_id = ' . Phpfox::getUserBy('user_group_id'))\n\t\t\t->execute('getSlaveRows');\n\t\tif (empty($aForums))\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t$aOut = array();\n\t\tforeach ($aForums as $aForum)\n\t\t{\n\t\t\t$aOut[] = $aForum['forum_id'];\n\t\t}\n\t\treturn $aOut;\n\t}",
"function digestforum_tp_get_untracked_digestforums($userid, $courseid) {\n global $CFG, $DB;\n\n if ($CFG->digestforum_allowforcedreadtracking) {\n $trackingsql = \"AND (f.trackingtype = \".DFORUM_TRACKING_OFF.\"\n OR (f.trackingtype = \".DFORUM_TRACKING_OPTIONAL.\" AND (ft.id IS NOT NULL\n OR (SELECT trackforums FROM {user} WHERE id = ?) = 0)))\";\n } else {\n $trackingsql = \"AND (f.trackingtype = \".DFORUM_TRACKING_OFF.\"\n OR ((f.trackingtype = \".DFORUM_TRACKING_OPTIONAL.\" OR f.trackingtype = \".DFORUM_TRACKING_FORCED.\")\n AND (ft.id IS NOT NULL\n OR (SELECT trackforums FROM {user} WHERE id = ?) = 0)))\";\n }\n\n $sql = \"SELECT f.id\n FROM {digestforum} f\n LEFT JOIN {digestforum_track_prefs} ft ON (ft.digestforumid = f.id AND ft.userid = ?)\n WHERE f.course = ?\n $trackingsql\";\n\n if ($digestforums = $DB->get_records_sql($sql, array($userid, $courseid, $userid))) {\n foreach ($digestforums as $digestforum) {\n $digestforums[$digestforum->id] = $digestforum;\n }\n return $digestforums;\n\n } else {\n return array();\n }\n}",
"function extendedforum_get_discussions($cm, $extendedforumsort=\"d.timemodified DESC\", $fullpost=true, $unused=-1, $limit=-1, $userlastmodified=false, $page=-1, $perpage=0) {\n global $CFG, $USER;\n\n $timelimit = '';\n\n $modcontext = null;\n\n $now = round(time(), -2);\n\n $modcontext = get_context_instance(CONTEXT_MODULE, $cm->id);\n\n if (!has_capability('mod/extendedforum:viewdiscussion', $modcontext)) { /// User must have perms to view discussions\n return array();\n }\n\n if (!empty($CFG->extendedforum_enabletimedposts)) { /// Users must fulfill timed posts\n\n if (!has_capability('mod/extendedforum:viewhiddentimedposts', $modcontext)) {\n $timelimit = \" AND ((d.timestart <= $now AND (d.timeend = 0 OR d.timeend > $now))\";\n if (isloggedin()) {\n $timelimit .= \" OR d.userid = $USER->id\";\n }\n $timelimit .= \")\";\n }\n }\n\n if ($limit > 0) {\n $limitfrom = 0;\n $limitnum = $limit;\n } else if ($page != -1) {\n $limitfrom = $page*$perpage;\n $limitnum = $perpage;\n } else {\n $limitfrom = 0;\n $limitnum = 0;\n }\n\n $groupmode = groups_get_activity_groupmode($cm);\n $currentgroup = groups_get_activity_group($cm);\n\n if ($groupmode) {\n if (empty($modcontext)) {\n $modcontext = get_context_instance(CONTEXT_MODULE, $cm->id);\n }\n\n if ($groupmode == VISIBLEGROUPS or has_capability('moodle/site:accessallgroups', $modcontext)) {\n if ($currentgroup) {\n $groupselect = \"AND (d.groupid = $currentgroup OR d.groupid = -1)\";\n } else {\n $groupselect = \"\";\n }\n\n } else {\n //seprate groups without access all\n if ($currentgroup) {\n $groupselect = \"AND (d.groupid = $currentgroup OR d.groupid = -1)\";\n } else {\n $groupselect = \"AND d.groupid = -1\";\n }\n }\n } else {\n $groupselect = \"\";\n }\n\n\n if (empty($extendedforumsort)) {\n $extendedforumsort = \"d.timemodified DESC\";\n }\n if (empty($fullpost)) {\n $postdata = \"p.id,p.subject,p.modified,p.discussion,p.userid\";\n } else {\n $postdata = \"p.*\";\n }\n\n if (empty($userlastmodified)) { // We don't need to know this\n $umfields = \"\";\n $umtable = \"\";\n } else {\n $umfields = \", um.firstname AS umfirstname, um.lastname AS umlastname\";\n $umtable = \" LEFT JOIN {$CFG->prefix}user um ON (d.usermodified = um.id)\";\n }\n\n \n $sql = \"SELECT $postdata, d.extendedforum, d.course, d.name, d.timemodified, d.usermodified, d.groupid, d.timestart, d.timeend, d.on_top, \n u.firstname, u.lastname, u.email, u.picture, u.imagealt, ra.roleid as role, r.name as rolename $umfields\n FROM {$CFG->prefix}extendedforum_discussions d\n JOIN {$CFG->prefix}extendedforum_posts p ON p.discussion = d.id\n JOIN {$CFG->prefix}user u ON p.userid = u.id\n $umtable\n LEFT JOIN {$CFG->prefix}role_assignments ra ON ( ra.userid = u.id )\n LEFT JOIN {$CFG->prefix}role r ON ra.roleid = r.id \n WHERE d.extendedforum = {$cm->instance} AND p.parent = 0\n AND r.sortorder IN ( SELECT MIN( r2.sortorder ) \n FROM {$CFG->prefix}role_assignments ra2, {$CFG->prefix}context c, {$CFG->prefix}role r2 \n WHERE ra2.userid = p.userid AND ra2.contextid = c.id AND c.instanceid IN ( d.course, 0 ) \nAND c.contextlevel IN ( 50, 10 ) AND c.contextlevel = ( SELECT MAX( contextlevel ) \nFROM {$CFG->prefix}role_assignments ra2, {$CFG->prefix}context c, {$CFG->prefix}role r2 \nWHERE ra2.userid =p.userid AND ra2.contextid = c.id AND c.instanceid IN ( d.course, 0 ) \nAND c.contextlevel IN ( 50, 10 ) ) AND ra2.roleid = r2.id ) AND ra.contextid IN \n(SELECT MAX( c2.id ) FROM {$CFG->prefix}role_assignments ra3 , {$CFG->prefix}context c2 \nWHERE ra3.userid = p.userid AND ra3.contextid = c2.id \nAND c2.instanceid IN ( d.course, 0 ) AND c2.contextlevel IN ( 50, 10 ) )\n $timelimit $groupselect\n ORDER BY on_top desc , $extendedforumsort \";\n \n \n return get_records_sql($sql, $limitfrom, $limitnum);\n}",
"function &getForumsAdmin() {\n\t\tif ($this->forums) {\n\t\t\treturn $this->forums;\n\t\t}\n\n\t\tif (session_loggedin()) {\n\t\t\tif (!forge_check_perm ('forum_admin', $this->Group->getID())) {\n\t\t\t\t$this->setError(_(\"You don't have a permission to access this page\"));\n\t\t\t\t$this->forums = false;\n\t\t\t} else {\n\t\t\t\t$result = db_query_params('SELECT * FROM forum_group_list_vw\n\t\t\t\t\t\t\tWHERE group_id=$1\n\t\t\t\t\t\t\tORDER BY group_forum_id',\n\t\t\t\t\t\t\tarray($this->Group->getID())) ;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->setError(_(\"You don't have a permission to access this page\"));\n\t\t\t$this->forums = false;\n\t\t}\n\n\t\t$rows = db_numrows($result);\n\n\t\tif (!$result) {\n\t\t\t$this->setError(_('Forum not found')._(': ').db_error());\n\t\t\t$this->forums = false;\n\t\t} else {\n\t\t\twhile ($arr = db_fetch_array($result)) {\n\t\t\t\t$this->forums[] = new Forum($this->Group, $arr['group_forum_id'], $arr);\n\t\t\t}\n\t\t}\n\t\treturn $this->forums;\n\t}",
"public static function get_forums()\n\t{\n\t\t$forums = Posts::get( array( 'content_type' => Post::type('forum') ) );\n\t\treturn $forums;\n\t}",
"function extendedforum_get_user_discussions($courseid, $userid, $groupid=0) {\n global $CFG;\n\n if ($groupid) {\n $groupselect = \" AND d.groupid = '$groupid' \";\n } else {\n $groupselect = \"\";\n }\n\n return get_records_sql(\"SELECT p.*, d.groupid, u.firstname, u.lastname, u.email, u.picture, u.imagealt,\n f.type as extendedforumtype, f.name as extendedforumname, f.id as extendedforumid\n FROM {$CFG->prefix}extendedforum_discussions d,\n {$CFG->prefix}extendedforum_posts p,\n {$CFG->prefix}user u,\n {$CFG->prefix}extendedforum f\n WHERE d.course = '$courseid'\n AND p.discussion = d.id\n AND p.parent = 0\n AND p.userid = u.id\n AND u.id = '$userid'\n AND d.extendedforum = f.id $groupselect\n ORDER BY p.created DESC\");\n}",
"function extendedforum_tp_can_track_extendedforums($extendedforum=false, $user=false) {\n global $USER, $CFG;\n\n // if possible, avoid expensive\n // queries\n if (empty($CFG->extendedforum_trackreadposts)) {\n return false;\n }\n\n if ($user === false) {\n $user = $USER;\n }\n\n if (isguestuser($user) or empty($user->id)) {\n return false;\n }\n\n if ($extendedforum === false) {\n // general abitily to track extendedforums\n return (bool)$user->trackforums;\n }\n \n\n // Work toward always passing an object...\n if (is_numeric($extendedforum)) {\n debugging('Better use proper extendedforum object.', DEBUG_DEVELOPER);\n $extendedforum = get_record('extendedforum', 'id', $extendedforum, '','','','', 'id,trackingtype');\n }\n\n $extendedforumallows = ($extendedforum->trackingtype == EXTENDEDFORUM_TRACKING_OPTIONAL);\n $extendedforumforced = ($extendedforum->trackingtype == EXTENDEDFORUM_TRACKING_ON);\n \n \n return ($extendedforumforced || $extendedforumallows) && !empty($user->trackforums);\n}",
"function bbp_get_excluded_forum_ids()\n{\n}",
"function mysupport_forums()\r\n{\r\n\tglobal $cache;\r\n\t\r\n\t$forums = $cache->read(\"forums\");\r\n\t$mysupport_forums = array();\r\n\t\r\n\tforeach($forums as $forum)\r\n\t{\r\n\t\t// if this forum/category has MySupport enabled, add it to the array\r\n\t\tif($forum['mysupport'] == 1)\r\n\t\t{\r\n\t\t\tif(!in_array($forum['fid'], $mysupport_forums))\r\n\t\t\t{\r\n\t\t\t\t$mysupport_forums[] = $forum['fid'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t// if this forum/category hasn't got MySupport enabled...\r\n\t\telse\r\n\t\t{\r\n\t\t\t// ... go through the parent list...\r\n\t\t\t$parentlist = explode(\",\", $forum['parentlist']);\r\n\t\t\tforeach($parentlist as $parent)\r\n\t\t\t{\r\n\t\t\t\t// ... if this parent has MySupport enabled...\r\n\t\t\t\tif($forums[$parent]['mysupport'] == 1)\r\n\t\t\t\t{\r\n\t\t\t\t\t// ... add the original forum we're looking at to the list\r\n\t\t\t\t\tif(!in_array($forum['fid'], $mysupport_forums))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$mysupport_forums[] = $forum['fid'];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// this is for if we enable MySupport for a whole category; this will pick up all the forums inside that category and add them to the array\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn $mysupport_forums;\r\n}",
"function get_passworded_forums()\n\t{\n\t\tglobal $db;\n\n\t\t$sql = 'SELECT f.forum_id, fa.user_id\n\t\t\tFROM ' . FORUMS_TABLE . ' f\n\t\t\tLEFT JOIN ' . FORUMS_ACCESS_TABLE . \" fa\n\t\t\t\tON (fa.forum_id = f.forum_id\n\t\t\t\t\tAND fa.session_id = '\" . $db->sql_escape($this->session_id) . \"')\n\t\t\tWHERE f.forum_password <> ''\";\n\t\t$result = $db->sql_query($sql);\n\n\t\t$forum_ids = array();\n\t\twhile ($row = $db->sql_fetchrow($result))\n\t\t{\n\t\t\t$forum_id = (int) $row['forum_id'];\n\n\t\t\tif ($row['user_id'] != $this->data['user_id'])\n\t\t\t{\n\t\t\t\t$forum_ids[$forum_id] = $forum_id;\n\t\t\t}\n\t\t}\n\t\t$db->sql_freeresult($result);\n\n\t\treturn $forum_ids;\n\t}",
"public function getNotModeratedUsers()\n {\n return $this->userRepository->getNotModeratedUsers();\n }",
"public static function getAll()\n {\n $forums = array();\n\n $query = 'select f.ID, f.NAME, f.DESCRIPTION, ' . \n\t\t\t\t' COUNT(m.ID) as MESSAGE_COUNT, ' .\n\t\t\t\t' UNIX_TIMESTAMP(MIN(m.MESSAGE_DATE)) as LATEST_DATE ' .\n\t\t\t\t' from FORUM f ' .\n\t\t\t\t' left join MESSAGE m ' .\n\t\t\t\t' on f.ID = m.FORUM_ID ' .\n\t\t\t\t' group by f.ID, f.NAME, f.DESCRIPTION ' .\n\t\t\t\t' order by COUNT(m.ID) desc'; \n $result = mysql_query($query, $GLOBALS['DB']);\n\t\t\n if (mysql_num_rows($result))\n {\n\t\t\twhile ($row = mysql_fetch_assoc($result))\n\t\t\t{\t\n\t\t\t\t$f = new Forum();\n\t\t\t\tForum::setValuesFromDB($f, $row);\n\t\t\t\t// add the question to the list, using its id as a key\n\t\t\t\tarray_push($forums, $f);\n\t\t\t}\n\t\t}\n\t\tmysql_free_result($result);\n return $forums;\t\t\n }",
"public function findVisibleRootForums() {\n\n\t\t$query = $this->createQuery();\n\n\t\t$constraints = array();\n\n\t\tif ($this->getUser()) {\n\t\t\t$groupConstraints = array();\n\t\t\tforeach ($this->getUser()->getFlattenedGroups() as $group) {\n\t\t\t\t$groupConstraints[] = $query->contains('groupsWithReadAccess', $group);\n\t\t\t}\n\t\t\t$constraints[] = $query->logicalOr(\n\t\t\t\t$groupConstraints\n\t\t\t);\n\t\t\t$constraints[] = $query->contains('usersWithReadAccess', $this->getUser());\n\t\t}\n\n\t\t$constraints[] = $query->logicalAnd(\n\t\t\tarray(\n\t\t\t\t$query->equals('groupsWithReadAccess', 0),\n\t\t\t\t$query->equals('usersWithReadAccess', 0)\n\t\t\t)\n\t\t);\n\n\t\tif (count($constraints) > 1) {\n\t\t\t$permissionConstraint = $query->logicalOr($constraints);\n\t\t} else {\n\t\t\t$permissionConstraint = current($constraints);\n\t\t}\n\n\t\t$query->matching(\n\t\t\t$query->logicalAnd(\n\t\t\t\tarray(\n\t\t\t\t\t$permissionConstraint,\n\t\t\t\t\t$query->equals('parent', 0)\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t$query->setOrderings(array('crdate' => \\TYPO3\\CMS\\Extbase\\Persistence\\QueryInterface::ORDER_DESCENDING));\n\t\t$forums = $query->execute();\n\n\t\treturn $forums;\n\t}",
"function getForums() {\n\n $stmt = $this->conn->prepare(\"SELECT * FROM n2u_forum_category\");\n $stmt->execute();\n $result = $stmt->get_result();\n $forums = array();\n if ($result->num_rows > 0) {\n while($row = $result->fetch_assoc()) {\n array_push($forums, $row);\n }\n }\n $stmt->close();\n return $forums;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gets list of lessons that match a list of tags lesson needs to have all of these tags attached | public function getMatchingLessons($tagsString) {
// todo: security check
$tagNames = $this->tagManager->splitTagNames($tagsString);
$tags = $this->tagManager->getTagsByNames($tagNames);
$lessons = array();
if (count($tags) < count($tagNames)) {
// not all tags are known yet -> it is not possible that there is any matching journey
} else {
$lessons = $this->tagMatchingManager->getMatchingLessons($tags);
$this->addLessonsUrls($lessons);
}
return $lessons;
} | [
"private function attachTags($story_list){\n if(($maxStories = count($story_list)) > 0){\n for($i = 0; $i < $maxStories; $i++){\n $story_tag_id_list = StoryTagList::findAll(['story_id' => $story_list[$i]['story_id']]);\n if(($maxStoryTags = count($story_tag_id_list)) > 0){\n /**************COLLECT STORY TAGS ASSOCIATED WITH THIS STORY - START***************/\n $story_tag_id_set = array();\n $story_list[$i]['existing_tag_list'] = array();\n for($j = 0; $j < $maxStoryTags; $j++){\n $story_tag = StoryTag::find()\n ->select('*')\n ->where(['story_tag_id' => $story_tag_id_list[$j]['story_tag_id']])\n ->asArray()\n ->one();\n $story_tag['story_tag_list_id'] = $story_tag_id_list[$j]['story_tag_list_id'];\n $story_list[$i]['existing_tag_list'][] = $story_tag;\n $story_tag_id_set[] = $story_tag_id_list[$j]['story_tag_id'];\n }\n /**************COLLECT STORY TAGS ASSOCIATED WITH THIS STORY - END***************/\n\n /**************COLLECT STORY TAGS THAT ARE NOT ASSOCIATED WITH THIS STORY - START***************/\n $story_list[$i]['available_tag_list'] = StoryTag::find()\n ->select('story_tag_id, tag_name')\n ->where(['not', ['story_tag_id' => $story_tag_id_set]])\n ->orderBy('tag_name ASC')\n ->asArray()\n ->all();\n /**************COLLECT STORY TAGS THAT ARE NOT ASSOCIATED WITH THIS STORY - END***************/\n } else {\n $story_list[$i]['existing_tag_list'] = array(); \n $story_list[$i]['available_tag_list'] = StoryTag::find()\n ->select('story_tag_id, tag_name')\n ->orderBy('tag_name ASC')\n ->asArray()\n ->all();\n }\n }\n }\n return $story_list;\n }",
"public function tags()\n\t{\n\t\t$lessons = Lesson::with('tags')->get();\n\n\t\treturn View::make('lessons.list',compact('lessons'));\n\t}",
"function getLessons()\n {\n $returned_lessons = $GLOBALS['DB']->query(\"SELECT * FROM lessons WHERE unit_id = {$this->getId()};\");\n $unit_lessons = array();\n foreach ($returned_lessons as $lesson) {\n $lesson_id = $lesson['id'];\n $found_lesson = Lesson::find($lesson_id);\n\n array_push($unit_lessons, $found_lesson);\n }\n return $unit_lessons;\n }",
"private static function getTaggings($tags = array(), $options = array())\n {\n $tags = sfPropelActAsTaggableToolkit::explodeTagString($tags);\n \n $vals = array();\n if (is_string($tags))\n {\n $tags = array($tags);\n }\n \n $taggings = array();\n \n foreach(array('ReaktorArtwork', 'ReaktorFile', 'Article') as $taggable_obj)\n {\n \t\n\t $c = new Criteria();\n\t $c->addJoin(TagPeer::ID, TaggingPeer::TAG_ID);\n\t $c->add(TagPeer::NAME, $tags, Criteria::IN);\n\t \n\t /**\n\t * loop through the different options\n\t */\n if (isset($options['parent_approved']) && $taggable_obj !== 'Article' )\n {\n // Users should see their own unapproved artworks too\n if ($user = sfContext::getInstance()->getUser())\n {\n $approved = $c->getNewCriterion(TaggingPeer::PARENT_APPROVED, $options['parent_approved']);\n $mytags = $c->getNewCriterion(TaggingPeer::PARENT_USER_ID, $user->getId());\n $approved->addOr($mytags);\n $c->add($approved);\n }\n else\n {\n $c->add(TaggingPeer::PARENT_APPROVED, $options['parent_approved']);\n }\n }\n\t \n $c->add(TaggingPeer::TAGGABLE_MODEL, $taggable_obj);\n \n\t if (isset($options[\"approved\"]))\n\t {\n\t $c->add(TagPeer::APPROVED, 1);\n\t }\n\t \n\t self::addReaktorsToCriteria($c, $taggable_obj, $options);\n\t $c->add(TaggingPeer::TAGGABLE_MODEL, $taggable_obj);\n\t $c->addGroupByColumn(TaggingPeer::TAGGABLE_ID);\n\t $having = $c->getNewCriterion(TagPeer::ID, ' COUNT(tag.ID) >= ' . 1, Criteria::CUSTOM);\n\t $c->addHaving($having);\n\t \n\t $c->addDescendingOrderByColumn(TaggingPeer::TAGGABLE_ID);\n\t \n\t $res = TaggingPeer::doSelect($c);\n\t foreach ($res as $row)\n\t {\n\t \t$model = $row->getTaggableModel();\n\t\n\t if (!isset($taggings[$model]))\n\t {\n\t $taggings[$model] = array();\n\t }\n\t\n\t $taggings[$model][] = $row->getTaggableId();\n\t }\n }\n \n return $taggings;\n }",
"public function findAllWithTags();",
"function TAG_scanAllStories() {\n\tglobal $_TABLES;\n\n\t$sql = \"SELECT sid, introtext, bodytext \"\n\t\t . \" FROM {$_TABLES['stories']} \"\n\t\t . \"WHERE ((draft_flag = 0) AND (date <= NOW())) \";\n\t$result = DB_query($sql);\n\n\tif (!DB_error()) {\n\t\t$all_tags = array();\n\n\t\twhile (($A = DB_fetchArray($result)) !== false) {\n\t\t\t$tags1 = TAG_scanTag(stripslashes($A['introtext']));\n\t\t\t$tags2 = TAG_scanTag(stripslashes($A['bodytext']));\n\t\t\t$tags = array_merge($tags1, $tags2);\n\n\t\t\tif (count($tags) > 0) {\n\t\t\t\t$all_tags[$A['sid']] = $tags;\n\t\t\t}\n\t\t}\n\n\t\tif (count($all_tags) > 0) {\n\t\t\tforeach ($all_tags as $sid => $tags) {\n\t\t\t\tforeach ($tags as $tag) {\n\t\t\t\t\tTAG_saveTagToList($tag);\n\t\t\t\t\tTAG_saveTagToMap($tag, $sid, 'article');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}",
"public function getLessons()\n {\n $entries = $this->getEntries();\n\n $entries = $this->filterLessons($entries);\n\n return $this->wrapLessons($entries);\n }",
"function getTags() {\n\n parent::getTags();\n\n $tags = [\n 'satisfactionsmiley.smileys' => __(\"Affichage notation avec les smileys\", \"satisfactionsmiley\"),\n ];\n\n foreach ($tags as $tag => $label) {\n $this->addTagToList([\n 'tag' => $tag,\n 'label' => $label,\n 'value' => true,\n 'events' => NotificationTarget::TAG_FOR_ALL_EVENTS\n ]);\n }\n\n asort($this->tag_descriptions);\n }",
"function ld_lesson_list( $attr = array() ) {\n\tglobal $learndash_shortcode_used;\n\t$learndash_shortcode_used = true;\n\n\tif ( ! is_array( $attr ) ) {\n\t\t$attr = array();\n\t}\n\n\t$attr['post_type'] = learndash_get_post_type_slug( 'lesson' );\n\t$attr['mycourses'] = false;\n\t$attr['status'] = false;\n\n\t// If we have a course_id. Then we set the orderby to match the items within the course.\n\tif ( ( isset( $attr['course_id'] ) ) && ( ! empty( $attr['course_id'] ) ) ) {\n\t\t$attr['course_id'] = absint( $attr['course_id'] );\n\t\t$course_steps = learndash_course_get_steps_by_type( $attr['course_id'], $attr['post_type'] );\n\t\tif ( ! empty( $course_steps ) ) {\n\t\t\t$attr['post__in'] = $course_steps;\n\t\t}\n\n\t\tif ( LearnDash_Settings_Section::get_section_setting( 'LearnDash_Settings_Courses_Builder', 'shared_steps' ) == 'yes' ) {\n\t\t\tif ( ! isset( $attr['order'] ) ) {\n\t\t\t\t$attr['order'] = 'ASC';\n\t\t\t}\n\t\t\tif ( ! isset( $attr['orderby'] ) ) {\n\t\t\t\t$attr['orderby'] = 'post__in';\n\t\t\t}\n\t\t}\n\t}\n\n\treturn ld_course_list( $attr );\n}",
"public function findAllAdvTags() {\n\t\t$tags = $this->find('all', array(\n\t\t\t\t'contain' => array('Tag'),\n\t\t\t\t'fields' => array(),\n\t\t\t\t'order' => 'Tag.name'\n\t\t\t));\n\t\t\n\t\t$names = Set::extract($tags, '/Tag/name');\t\t\t\t\t\t\t\n\t\t$ids = Set::extract($tags, '/Tag/id');\n\t\t\n\t\treturn array_combine($ids, $names);\n\t}",
"public function getAddableTags() {\r\n if ($this->_addableTags == null) {\r\n if ($this->_tagIds == null) {\r\n $this->_tagIds = Mage::getModel('CrmTicket/TicketTag')->getTicketTagsIds($this);\r\n }\r\n if (count($this->_tagIds) > 0) {\r\n $this->_addableTags = Mage::getModel('CrmTicket/Tag')->getCollection()->addFieldToFilter('ctg_id', array('nin' => $this->_tagIds));\r\n } else {\r\n $this->_addableTags = Mage::getModel('CrmTicket/Tag')->getCollection();\r\n }\r\n }\r\n return $this->_addableTags;\r\n }",
"public function getTags($key=NULL){\n\t\t//Going to use this array like a map to ensure uniqueness of keys\n\t\t$tags = array();\n\t\t$storyTag = array();\n\t\tsession_start();\n\t\tif($key){\n\t\t\tLog::debug(\"Looking for tags for key: \".$key);\n\t\t\t$post = Post::where(\"post_key\",$key)->first();\n\t\t\tforeach ($post->tags()->get() as $tag){\n\t\t\t\tif($tag->tag_type == \"story\"){\n\t\t\t\t $storyTag[$tag->name]=$tag;\n\t\t\t\t}else{\n\t\t\t\t $tags[$tag->name]=$tag;\n\t\t\t\t};\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tLog::debug(\"Related tag count: \".count($tags));\n\t\tif(count($tags)<50){\n\t\t\tLog::debug(\"Adding more tags to list from related tags\");\n\t\t\tforeach ($tags as $tag){\n\t\t\t\t$tagRelations = Tagrelationranks::where(\"tag_from_id\",$tag->id)->get();\n\t\t\t\tforeach ($tagRelations as $tagRel){\n\t\t\t\t\t$toTags = $tagRel->toTags()->get();\n\t\t\t\t\tforeach ($toTags as $toTag){\n\t\t\t\t\t if($genTag->tag_type == \"story\"){\n\t\t\t\t\t \t$storyTag[$toTag->name]=$toTag;\n\t\t\t\t\t }else{\n\t\t\t\t\t \t$tags[$toTag->name]=$toTag;\n\t\t\t\t\t };\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tLog::debug(\"Related tag count2: \".count($tags));\n\t\tif(count($tags)<50){\n\t\t\tLog::debug(\"Adding more tags to list from system\");\n\t\t\t#get all tags and pic random tags\n\t\t\t$generalTags = Tag::all()->random(50);\n\t\t\tforeach($generalTags as $genTag){\n\t\t\t if($genTag->tag_type == \"story\"){\n\t\t\t\t $storyTag[$genTag->name]=$genTag;\n\t\t\t\t}else{\n\t\t\t\t $tags[$genTag->name]=$genTag;\n\t\t\t\t};\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t$tagArr = array();\n\t\tforeach ($tags as $tag){\n\t\t\t$posts = $tag->posts()->get();\n\t\t\tforeach ($posts as $post){\n\t\t\t if($post->flag == 1){\n\t\t\t\t array_push($tagArr,$tag);\n\t\t\t\t break;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$storyTagArr = array();\n\t\tforeach ($storyTag as $tag){\n\t\t\t$posts = $tag->posts()->get();\n\t\t\tforeach ($posts as $post){\n\t\t\t if($post->flag == 1){\n\t\t\t\t array_push($storyTagArr,$tag);\n\t\t\t\t break;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(count($storyTagArr)>5){\n\t\t\t$storyTagArr = array_slice($storyTagArr, 0, 5);\n\t\t}\n\t\t$_SESSION['storyTag'] = $storyTagArr;\n\t\tif(count($tagArr)>30){\n\t\t\t$tagArr = array_slice($tagArr, 0, 30);\n\t\t}\n\t\treturn View::make('tags')->with(\"tags\", $tagArr);\n\t}",
"private function filterTags($spells,$tags){\n\n $newArr = [];\n\n foreach ($spells as $spell) {\n $spellTags = $spell->getTags()->getValues();\n $isValid = true;\n\n foreach ($tags as $tag){\n if(!in_array($tag,$spellTags))$isValid=false;\n }\n\n if($isValid)array_push($newArr,$spell);\n }\n\n return $newArr;\n }",
"public function get_lessons_by_lang() {\n\t\t$param = $this->escape_string( self::P_LANG );\n\t\t$s = $this->sql_search_lessons_by_lang( $param );\n\t\t$result = $this->db->query( $s ); \n\t\t$arr = array();\n\t\twhile ($r = $result->fetch_assoc()) {\n\t\t\t$add = array($r[self::COL_LESSON_NAME] => $r[self::COL_ID]);\n\t\t\tarray_push($arr, $add);\n\t\t}\n\t\treturn $arr;\n\t}",
"public function getTags();",
"public function getQuestonsWithTag($tagName) {\n\t\t\n\t\t$sql = \"SELECT * FROM stack_questionTag as questionTag, stack_question as question WHERE questionTag.tagName = '{$tagName}' and questionTag.questionId = question.id;\"; \n\t\t$this->db->execute($sql);\n\t\treturn $this->db->fetchAll();\n\t\t\n\t}",
"public function findAll() {\n $sql = \"SELECT * FROM lesson ORDER BY less_id\";\n $result = $this->getDb()->fetchAll($sql);\n\n // Convert query result to an array of domain objects\n $lesson = array();\n foreach ($result as $row) {\n $lessonId = $row['less_id'];\n $lesson[$lessonId] = $this->buildDomainObject($row);\n }\n return $lesson;\n }",
"public function filterByAndTags($tags)\n {\n $tagArr = explode(\"%\", $tags);\n $res = null;\n foreach ($tagArr as $value) {\n if ($res == null) {\n $res = Tag::find($value)->resources;\n } else {\n $res = $res->intersect(Tag::find($value)->resources);\n }\n }\n dd($res);\n }",
"private function attachTags($story_list, $main_story = false){\n if(!$main_story){\n if(($maxStories = count($story_list)) > 0){\n for($i = 0; $i < $maxStories; $i++){\n $story_tag_id_list = StoryTagList::findAll(['story_id' => $story_list[$i]['story_id']]);\n if(($maxStoryTags = count($story_tag_id_list)) > 0){\n /**************COLLECT STORY TAGS ASSOCIATED WITH THIS STORY - START***************/\n $story_tag_id_set = array();\n for($j = 0; $j < $maxStoryTags; $j++){\n $story_tag_id_set[] = $story_tag_id_list[$j]['story_tag_id'];\n }\n $story_list[$i]['tags'] = StoryTag::find()\n ->select('*')\n ->where(['in', 'story_tag_id', $story_tag_id_set])\n ->orderBy('tag_name ASC')\n ->asArray()\n ->all();\n /**************COLLECT STORY TAGS ASSOCIATED WITH THIS STORY - END***************/\n } else {\n $story_list[$i]['tags'] = array(); \n }\n }\n }\n } else {\n $story_tag_id_list = StoryTagList::findAll(['story_id' => $story_list['story_id']]);\n if(($maxStoryTags = count($story_tag_id_list)) > 0){\n /**************COLLECT STORY TAGS ASSOCIATED WITH THIS STORY - START***************/\n $story_tag_id_set = array();\n for($j = 0; $j < $maxStoryTags; $j++){\n $story_tag_id_set[] = $story_tag_id_list[$j]['story_tag_id'];\n }\n $story_list['tags'] = StoryTag::find()\n ->select('*')\n ->where(['in', 'story_tag_id', $story_tag_id_set])\n ->orderBy('tag_name ASC')\n ->asArray()\n ->all();\n /**************COLLECT STORY TAGS ASSOCIATED WITH THIS STORY - END***************/\n } else {\n $story_list['tags'] = array(); \n }\n }\n return $story_list;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Monitoring Stats HiLink::getMonitor() Returns status monitor object or false on error | public function getMonitor() {
$monitor = $this->monitor;
if (isset($monitor->UpdateTime) && ($monitor->UpdateTime + 3) > time()) {
return $monitor;
}
$ch = $this->init_curl($this->host.'/api/monitoring/status', null, false);
$res = curl_exec($ch);
$this->status_xml = $res;
curl_close($ch);
$monitor = simplexml_load_string($res);
if (!$this->isError($monitor)){
$monitor->UpdateTime = time();
$this->monitor = $monitor;
return $monitor;
}
return false;
} | [
"public function healthMonitor()\n {\n return $this->getService()->resource('HealthMonitor', null, $this);\n }",
"public function getMonitorInfo() {\r\n\t\t$monitor_info = mysql_query(\"SELECT * FROM monitor_info\") or die(mysql_error());\r\n\t\treturn $monitor_info;\r\n }",
"function monitor(){\r\n \tif ($this->monitor == null){\r\n \t\t$this->monitor = new SOS_Scheduler_Job_monitor();\r\n \t}\r\n \treturn $this->monitor;\r\n }",
"function getMonitor($monitor_id) {\n\t\tif (!isset($this->__monitores[$monitor_id])) {\n\t\t\t$this->getMonitores(REP_DATOS_CLIENTE, $monitor_id);\n\t\t}\n\t\tif (isset($this->__monitores[$monitor_id])) {\n\t\t\treturn $this->__monitores[$monitor_id];\n\t\t}\n\t\telse {\n\t\t\treturn null;\n\t\t}\n\t}",
"public function getMonitorSystem()\n {\n return $this->monitor_system;\n }",
"public static function getMonitor(): Monitor\n {\n return Factory::makeInstance(Monitor::class);\n }",
"public function getMonitoringType()\n {\n return $this->monitoringType;\n }",
"public function getMonitorVersion()\n {\n return $this->monitor_version;\n }",
"public function getMonitoring()\n {\n return $this->monitoring;\n }",
"public function getAppMonitor()\n {\n return $this->app_monitor;\n }",
"public function getMessageMonitor()\n {\n return $this->messageMonitor;\n }",
"public function monitor() {\n\n $hold = $this->cfg['hold'];\n\n $http = $this->extcode();\n\n $rqst = $this->req->gettime();\n\n $time = ($rqst > $hold);\n\n $code = ($http != NULL);\n\n if($http == $this->req->conf['code']) {\n\n $this->logdata($this->cfg['log2']);\n\n return;\n\n }\n\n else if($time && !$code) {\n\n return $this->alert()->load($rqst);\n\n }\n\n else if(!$time && $code) {\n\n return $this->alert()->resp($http);\n\n }\n\n else if($time && $code) {\n\n return $this->alert()->tcrq($rqst, $http);\n\n }\n\n else {\n\n return;\n\n }\n\n }",
"public function testMonitorOK()\n {\n $this->loadDataFixtures();\n\n // remove commands to get 'OK' status\n $this->callUrl(\n 'GET',\n '/command-scheduler/action/remove/command/2'\n );\n $this->callUrl(\n 'GET',\n '/command-scheduler/action/remove/command/5'\n );\n $this->callUrl(\n 'GET',\n '/command-scheduler/action/remove/command/13'\n );\n\n // call monitor\n $json = $this->getMonitorResponse();\n\n $this->assertEmpty($json);\n }",
"public function get_connection_status()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n try {\n $ifaces = $this->get_working_external_interfaces();\n\n if (empty($ifaces))\n return self::STATUS_OFFLINE;\n else\n return self::STATUS_ONLINE;\n } catch (Network_Status_Unknown_Exception $e) {\n return self::STATUS_UNKNOWN;\n }\n }",
"public function getMonitoringRef()\n {\n return $this->monitoringRef;\n }",
"function actionOpenMonitor(){\n $userId=$this->_userId;\n $id = Yii::$app->request->post('id');\n\n if( !$this->actionCheckmaxnumber() ){\n return SeaShellResult::error('超出最大可监控数 ' .$this->maxmonitor. \"个\");\n }\n\n $model = new Monitor();\n $res = $model->openMonitor($id,$userId);\n\n if(!$res){\n return SeaShellResult::error('开启失败,请联系管理员');\n }\n return SeaShellResult::success('1');\n }",
"function GetMonitorRefreshRate(int $monitor): int { return 0; }",
"public static function getMonitorName(int $monitor) : string {}",
"function get_status(&$client,&$g) {\n\t$socket = \"unix://{$g['openvpn_base']}/{$client['mgmt']}/sock\";\n\t$status = openvpn_get_client_status($client, $socket);\n\tif($status['status'] != \"up\" ) {\n\t\treturn 0;\n\t} else {\n\t\treturn 1;\n\t}\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns classes to be added to . If it's enabled, 'infinitescroll'. If set to continuous scroll, adds 'neverending' too. | function body_class() {
$classes = '';
// Do not add infinity-scroll class if disabled through the Reading page
$disabled = '' === get_option( self::$option_name_enabled ) ? true : false;
if ( ! $disabled || 'click' == self::get_settings()->type ) {
$classes = 'infinite-scroll';
if ( 'scroll' == self::get_settings()->type )
$classes .= ' neverending';
}
return $classes;
} | [
"function goodwish_edge_smooth_scroll_class($classes) {\n\n //is smooth scroll enabled enabled?\n if(goodwish_edge_options()->getOptionValue('smooth_scroll') == 'yes') {\n $classes[] = 'edgtf-smooth-scroll';\n } else {\n $classes[] = '';\n }\n\n return $classes;\n }",
"function aton_qodef_smooth_scroll_class($classes) {\n\n //is smooth scroll enabled enabled?\n if(aton_qodef_options()->getOptionValue('smooth_scroll') == 'yes') {\n $classes[] = 'qodef-smooth-scroll';\n } else {\n $classes[] = '';\n }\n\n return $classes;\n }",
"function pxlz_edgtf_page_smooth_scroll_class($classes) {\n //is smooth scroll enabled enabled?\n if (pxlz_edgtf_options()->getOptionValue('page_smooth_scroll') == 'yes') {\n $classes[] = 'edgtf-smooth-scroll';\n }\n\n return $classes;\n }",
"function voyage_mikado_smooth_scroll_class($classes) {\n\t\t//is smooth scroll enabled enabled and not Mac device?\n\t\tif(voyage_mikado_options()->getOptionValue('smooth_scroll') == 'yes') {\n\t\t\t$classes[] = 'mkdf-smooth-scroll';\n\t\t}\n\n\t\treturn $classes;\n\t}",
"function zuhaus_mikado_page_smooth_scroll_class( $classes ) {\n\t\t//is smooth scroll enabled enabled?\n\t\tif ( zuhaus_mikado_options()->getOptionValue( 'page_smooth_scroll' ) == 'yes' ) {\n\t\t\t$classes[] = 'mkdf-smooth-scroll';\n\t\t}\n\t\t\n\t\treturn $classes;\n\t}",
"function medigroup_mikado_smooth_scroll_class($classes) {\n\t\t//is smooth scroll enabled enabled and not Mac device?\n\t\tif(medigroup_mikado_options()->getOptionValue('smooth_scroll') == 'yes') {\n\t\t\t$classes[] = 'mkd-smooth-scroll';\n\t\t}\n\n\t\treturn $classes;\n\t}",
"function minti_onepage_class( $classes ) {\n\tglobal $minti_data;\n\tif(isset($minti_data['switch_pagescroll']) && ($minti_data['switch_pagescroll'] == 1)) {\n\t\t$classes[] = 'pagescroll';\n\t}\n\treturn $classes;\n}",
"function fiorello_mikado_page_smooth_scroll_class( $classes ) {\n\t\t//is smooth scroll enabled enabled?\n\t\tif ( fiorello_mikado_options()->getOptionValue( 'page_smooth_scroll' ) == 'yes' ) {\n\t\t\t$classes[] = 'mkdf-smooth-scroll';\n\t\t}\n\t\t\n\t\treturn $classes;\n\t}",
"function immanis_body_class($class) {\n\tif ('infinite-scroll' == get_theme_mod('immanis_page_navigation'))\n\t\t$class[] = 'infinite-scroll';\n\n\treturn $class;\n}",
"function chandelier_elated_smooth_scroll_class($classes) {\n\n\t\t$mac_os = strpos($_SERVER['HTTP_USER_AGENT'], 'Macintosh; Intel Mac OS X');\n\n //is smooth scroll enabled enabled and not Mac device?\n if(chandelier_elated_options()->getOptionValue('smooth_scroll') == 'yes' && $mac_os == false) {\n $classes[] = 'eltd-smooth-scroll';\n } else {\n $classes[] = '';\n }\n\n return $classes;\n }",
"function oddeven_post_class ( $classes ) {\n global $current_class;\n $classes[] = $current_class;\n $current_class = ($current_class == 'odd') ? 'omega' : 'odd';\n return $classes;\n}",
"public function _tiles_wrap_classes() {\n\n\t\t$settings = $this->get_settings();\n\t\t$classes = array( 'jet-smart-tiles-wrap' );\n\n\t\tif ( 'yes' === $settings['excerpt_on_hover'] ) {\n\t\t\t$classes[] = 'jet-hide-excerpt';\n\t\t}\n\n\t\tif ( 'yes' === $settings['carousel_enabled'] ) {\n\t\t\t$classes[] = 'jet-smart-tiles-carousel';\n\t\t}\n\n\t\tif ( 'yes' === $settings['carousel_enabled'] && 'yes' === $settings['show_arrows_on_hover'] ) {\n\t\t\t$classes[] = 'jet-arrows-on-hover';\n\t\t}\n\n\t\techo implode( ' ', $classes );\n\t}",
"static function add_body_class() {\n\t\t$out = array();\n\n\t\tif ( 'boxed' === get_theme_mod( 'layout_mode', 'wide' ) ) {\n\t\t\t$out[] = 'boxed';\n\t\t}\n\n\t\tif ( 'sticky' === get_theme_mod( 'main_navigation_sticky', 'static' ) ) {\n\t\t\t$out[] = 'sticky-navigation';\n\t\t}\n\n\t\treturn implode( ' ', $out );\n\t}",
"function hemma_excursion_header_classes( $classes ) {\n\tglobal $post;\n\t$header_position = get_theme_mod( 'header_position', 'header-position-1' );\n\n\t// Add hero class\n\tif ( ( is_singular( array( 'excursion' ) ) || is_page_template( 'template-excursion.php' ) ) && ( $header_position != 'header-position-2' ) ) {\n\t\t$classes[] = 'is-hero-on';\n\t}\n\n\treturn $classes;\n}",
"function gotravel_mikado_search_body_class($classes) {\n\n\t\tif(is_active_widget(false, false, 'mkd_search_opener')) {\n\n\t\t\t$classes[] = 'mkdf-'.gotravel_mikado_options()->getOptionValue('search_type');\n\n\t\t\tif(gotravel_mikado_options()->getOptionValue('search_type') == 'fullscreen-search') {\n\n\t\t\t\t$is_fullscreen_bg_image_set = gotravel_mikado_options()->getOptionValue('fullscreen_search_background_image') !== '';\n\n\t\t\t\tif($is_fullscreen_bg_image_set) {\n\t\t\t\t\t$classes[] = 'mkdf-fullscreen-search-with-bg-image';\n\t\t\t\t}\n\n\t\t\t\t$classes[] = 'mkdf-search-fade';\n\t\t\t}\n\t\t}\n\n\t\treturn $classes;\n\t}",
"function athen_get_staff_wrap_classes() {\n\n // Define main classes\n $classes = array( 'wpex-row', 'clr' );\n\n // Get grid style\n $grid_style = athen_get_mod( 'staff_archive_grid_style' );\n $grid_style = $grid_style ? $grid_style : 'fit-rows';\n\n // Add grid style\n $classes[] = 'staff-'. $grid_style;\n\n // Apply filters\n apply_filters( 'athen_staff_wrap_classes', $classes );\n\n // Turninto space seperated string\n $classes = implode( \" \", $classes );\n\n // Return\n return $classes;\n\n}",
"function green_woocommerce_loop_shop_columns_class($class) {\n\t\tif (!is_product() && !is_cart() && !is_checkout() && !is_account_page()) {\n\t\t\t$ccc_add = in_array(green_get_custom_option('body_style'), array('fullwide', 'fullscreen')) ? 1 : 0;\n\t\t\t$class[] = ' column-1_'.(green_sc_param_is_off(green_get_custom_option('show_sidebar_main')) ? 3+$ccc_add : 3+$ccc_add);\n\t\t}\n\t\treturn $class;\n\t}",
"function reactor_change_sticky_class( $classes ) {\n\t$count = count( $classes );\n\tfor ( $i=0; $i < $count; $i++ ) {\n\t\tif ( $classes[$i] == 'sticky' ) {\n\t\t\t$classes[$i] = 'sticky-post';\n\t\t\t$classes[] = 'featured';\n\t\t}\n\t}\n\treturn $classes;\n}",
"function browser_body_class($classes) {\n\t\t\n\t\tglobal $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone;\n\n\t\tif($is_lynx) $classes[] = 'lynx';\n\t\telseif($is_gecko) $classes[] = 'gecko';\n\t\telseif($is_opera) $classes[] = 'opera';\n\t\telseif($is_NS4) $classes[] = 'ns4';\n\t\telseif($is_safari) $classes[] = 'safari';\n\t\telseif($is_chrome) $classes[] = 'chrome';\n\t\telseif($is_IE) $classes[] = 'ie';\n\t\telse $classes[] = 'unknown';\n\n\t\tif($is_iphone) $classes[] = 'iphone';\n\t\t\n\t\tif ( is_archive() || is_search() || is_page_template( 'page_blog.php' ) )\n\t\t\t$classes[] = 'blog';\n\t\t\n\t\treturn $classes;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'createServerPool' Note: the input parameter is an associative array with the keys listed as the parameter name below This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. URL: | public function createServerPoolRequest($options)
{
// unbox the parameters from the associative array
$service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null;
$version_id = array_key_exists('version_id', $options) ? $options['version_id'] : null;
$tls_ca_cert = array_key_exists('tls_ca_cert', $options) ? $options['tls_ca_cert'] : 'null';
$tls_client_cert = array_key_exists('tls_client_cert', $options) ? $options['tls_client_cert'] : 'null';
$tls_client_key = array_key_exists('tls_client_key', $options) ? $options['tls_client_key'] : 'null';
$tls_cert_hostname = array_key_exists('tls_cert_hostname', $options) ? $options['tls_cert_hostname'] : 'null';
$use_tls = array_key_exists('use_tls', $options) ? $options['use_tls'] : 0;
$created_at = array_key_exists('created_at', $options) ? $options['created_at'] : null;
$deleted_at = array_key_exists('deleted_at', $options) ? $options['deleted_at'] : null;
$updated_at = array_key_exists('updated_at', $options) ? $options['updated_at'] : null;
$service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null;
$version = array_key_exists('version', $options) ? $options['version'] : null;
$name = array_key_exists('name', $options) ? $options['name'] : null;
$shield = array_key_exists('shield', $options) ? $options['shield'] : 'null';
$request_condition = array_key_exists('request_condition', $options) ? $options['request_condition'] : null;
$tls_ciphers = array_key_exists('tls_ciphers', $options) ? $options['tls_ciphers'] : null;
$tls_sni_hostname = array_key_exists('tls_sni_hostname', $options) ? $options['tls_sni_hostname'] : null;
$min_tls_version = array_key_exists('min_tls_version', $options) ? $options['min_tls_version'] : null;
$max_tls_version = array_key_exists('max_tls_version', $options) ? $options['max_tls_version'] : null;
$healthcheck = array_key_exists('healthcheck', $options) ? $options['healthcheck'] : null;
$comment = array_key_exists('comment', $options) ? $options['comment'] : null;
$type = array_key_exists('type', $options) ? $options['type'] : null;
$override_host = array_key_exists('override_host', $options) ? $options['override_host'] : 'null';
$between_bytes_timeout = array_key_exists('between_bytes_timeout', $options) ? $options['between_bytes_timeout'] : 10000;
$connect_timeout = array_key_exists('connect_timeout', $options) ? $options['connect_timeout'] : null;
$first_byte_timeout = array_key_exists('first_byte_timeout', $options) ? $options['first_byte_timeout'] : null;
$max_conn_default = array_key_exists('max_conn_default', $options) ? $options['max_conn_default'] : 200;
$quorum = array_key_exists('quorum', $options) ? $options['quorum'] : 75;
$tls_check_cert = array_key_exists('tls_check_cert', $options) ? $options['tls_check_cert'] : null;
// verify the required parameter 'service_id' is set
if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $service_id when calling createServerPool'
);
}
// verify the required parameter 'version_id' is set
if ($version_id === null || (is_array($version_id) && count($version_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $version_id when calling createServerPool'
);
}
if ($quorum !== null && $quorum > 100) {
throw new \InvalidArgumentException('invalid value for "$quorum" when calling PoolApi.createServerPool, must be smaller than or equal to 100.');
}
if ($quorum !== null && $quorum < 0) {
throw new \InvalidArgumentException('invalid value for "$quorum" when calling PoolApi.createServerPool, must be bigger than or equal to 0.');
}
$resourcePath = '/service/{service_id}/version/{version_id}/pool';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($service_id !== null) {
$resourcePath = str_replace(
'{' . 'service_id' . '}',
ObjectSerializer::toPathValue($service_id),
$resourcePath
);
}
// path params
if ($version_id !== null) {
$resourcePath = str_replace(
'{' . 'version_id' . '}',
ObjectSerializer::toPathValue($version_id),
$resourcePath
);
}
// form params
if ($tls_ca_cert !== null) {
$formParams['tls_ca_cert'] = ObjectSerializer::toFormValue($tls_ca_cert);
}
// form params
if ($tls_client_cert !== null) {
$formParams['tls_client_cert'] = ObjectSerializer::toFormValue($tls_client_cert);
}
// form params
if ($tls_client_key !== null) {
$formParams['tls_client_key'] = ObjectSerializer::toFormValue($tls_client_key);
}
// form params
if ($tls_cert_hostname !== null) {
$formParams['tls_cert_hostname'] = ObjectSerializer::toFormValue($tls_cert_hostname);
}
// form params
if ($use_tls !== null) {
$formParams['use_tls'] = ObjectSerializer::toFormValue($use_tls);
}
// form params
if ($created_at !== null) {
$formParams['created_at'] = ObjectSerializer::toFormValue($created_at);
}
// form params
if ($deleted_at !== null) {
$formParams['deleted_at'] = ObjectSerializer::toFormValue($deleted_at);
}
// form params
if ($updated_at !== null) {
$formParams['updated_at'] = ObjectSerializer::toFormValue($updated_at);
}
// form params
if ($service_id !== null) {
$formParams['service_id'] = ObjectSerializer::toFormValue($service_id);
}
// form params
if ($version !== null) {
$formParams['version'] = ObjectSerializer::toFormValue($version);
}
// form params
if ($name !== null) {
$formParams['name'] = ObjectSerializer::toFormValue($name);
}
// form params
if ($shield !== null) {
$formParams['shield'] = ObjectSerializer::toFormValue($shield);
}
// form params
if ($request_condition !== null) {
$formParams['request_condition'] = ObjectSerializer::toFormValue($request_condition);
}
// form params
if ($tls_ciphers !== null) {
$formParams['tls_ciphers'] = ObjectSerializer::toFormValue($tls_ciphers);
}
// form params
if ($tls_sni_hostname !== null) {
$formParams['tls_sni_hostname'] = ObjectSerializer::toFormValue($tls_sni_hostname);
}
// form params
if ($min_tls_version !== null) {
$formParams['min_tls_version'] = ObjectSerializer::toFormValue($min_tls_version);
}
// form params
if ($max_tls_version !== null) {
$formParams['max_tls_version'] = ObjectSerializer::toFormValue($max_tls_version);
}
// form params
if ($healthcheck !== null) {
$formParams['healthcheck'] = ObjectSerializer::toFormValue($healthcheck);
}
// form params
if ($comment !== null) {
$formParams['comment'] = ObjectSerializer::toFormValue($comment);
}
// form params
if ($type !== null) {
$formParams['type'] = ObjectSerializer::toFormValue($type);
}
// form params
if ($override_host !== null) {
$formParams['override_host'] = ObjectSerializer::toFormValue($override_host);
}
// form params
if ($between_bytes_timeout !== null) {
$formParams['between_bytes_timeout'] = ObjectSerializer::toFormValue($between_bytes_timeout);
}
// form params
if ($connect_timeout !== null) {
$formParams['connect_timeout'] = ObjectSerializer::toFormValue($connect_timeout);
}
// form params
if ($first_byte_timeout !== null) {
$formParams['first_byte_timeout'] = ObjectSerializer::toFormValue($first_byte_timeout);
}
// form params
if ($max_conn_default !== null) {
$formParams['max_conn_default'] = ObjectSerializer::toFormValue($max_conn_default);
}
// form params
if ($quorum !== null) {
$formParams['quorum'] = ObjectSerializer::toFormValue($quorum);
}
// form params
if ($tls_check_cert !== null) {
$formParams['tls_check_cert'] = ObjectSerializer::toFormValue($tls_check_cert);
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/x-www-form-urlencoded']
);
}
// for model (json/xml)
if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
foreach ($formParamValueItems as $formParamValueItem) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValueItem
];
}
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
}
}
// this endpoint requires API token authentication
$apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key');
if ($apiToken !== null) {
$headers['Fastly-Key'] = $apiToken;
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$operationHosts = ["https://api.fastly.com"];
if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) {
throw new \InvalidArgumentException("Invalid index {$this->hostIndex} when selecting the host. Must be less than ".sizeof($operationHosts));
}
$operationHost = $operationHosts[$this->hostIndex];
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
return new Request(
'POST',
$operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | [
"public function createPoolServerRequest($options)\n {\n // unbox the parameters from the associative array\n $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null;\n $pool_id = array_key_exists('pool_id', $options) ? $options['pool_id'] : null;\n $weight = array_key_exists('weight', $options) ? $options['weight'] : 100;\n $max_conn = array_key_exists('max_conn', $options) ? $options['max_conn'] : 0;\n $port = array_key_exists('port', $options) ? $options['port'] : 80;\n $address = array_key_exists('address', $options) ? $options['address'] : null;\n $comment = array_key_exists('comment', $options) ? $options['comment'] : null;\n $disabled = array_key_exists('disabled', $options) ? $options['disabled'] : false;\n $override_host = array_key_exists('override_host', $options) ? $options['override_host'] : 'null';\n\n // verify the required parameter 'service_id' is set\n if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $service_id when calling createPoolServer'\n );\n }\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling createPoolServer'\n );\n }\n if ($weight !== null && $weight > 100) {\n throw new \\InvalidArgumentException('invalid value for \"$weight\" when calling ServerApi.createPoolServer, must be smaller than or equal to 100.');\n }\n if ($weight !== null && $weight < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$weight\" when calling ServerApi.createPoolServer, must be bigger than or equal to 1.');\n }\n\n\n $resourcePath = '/service/{service_id}/pool/{pool_id}/server';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($service_id !== null) {\n $resourcePath = str_replace(\n '{' . 'service_id' . '}',\n ObjectSerializer::toPathValue($service_id),\n $resourcePath\n );\n }\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n\n // form params\n if ($weight !== null) {\n $formParams['weight'] = ObjectSerializer::toFormValue($weight);\n }\n // form params\n if ($max_conn !== null) {\n $formParams['max_conn'] = ObjectSerializer::toFormValue($max_conn);\n }\n // form params\n if ($port !== null) {\n $formParams['port'] = ObjectSerializer::toFormValue($port);\n }\n // form params\n if ($address !== null) {\n $formParams['address'] = ObjectSerializer::toFormValue($address);\n }\n // form params\n if ($comment !== null) {\n $formParams['comment'] = ObjectSerializer::toFormValue($comment);\n }\n // form params\n if ($disabled !== null) {\n $formParams['disabled'] = ObjectSerializer::toFormValue($disabled);\n }\n // form params\n if ($override_host !== null) {\n $formParams['override_host'] = ObjectSerializer::toFormValue($override_host);\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API token authentication\n $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key');\n if ($apiToken !== null) {\n $headers['Fastly-Key'] = $apiToken;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHosts = [\"https://api.fastly.com\"];\n if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) {\n throw new \\InvalidArgumentException(\"Invalid index {$this->hostIndex} when selecting the host. Must be less than \".sizeof($operationHosts));\n }\n $operationHost = $operationHosts[$this->hostIndex];\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getServerPoolRequest($options)\n {\n // unbox the parameters from the associative array\n $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null;\n $version_id = array_key_exists('version_id', $options) ? $options['version_id'] : null;\n $pool_name = array_key_exists('pool_name', $options) ? $options['pool_name'] : null;\n\n // verify the required parameter 'service_id' is set\n if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $service_id when calling getServerPool'\n );\n }\n // verify the required parameter 'version_id' is set\n if ($version_id === null || (is_array($version_id) && count($version_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $version_id when calling getServerPool'\n );\n }\n // verify the required parameter 'pool_name' is set\n if ($pool_name === null || (is_array($pool_name) && count($pool_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_name when calling getServerPool'\n );\n }\n\n $resourcePath = '/service/{service_id}/version/{version_id}/pool/{pool_name}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($service_id !== null) {\n $resourcePath = str_replace(\n '{' . 'service_id' . '}',\n ObjectSerializer::toPathValue($service_id),\n $resourcePath\n );\n }\n // path params\n if ($version_id !== null) {\n $resourcePath = str_replace(\n '{' . 'version_id' . '}',\n ObjectSerializer::toPathValue($version_id),\n $resourcePath\n );\n }\n // path params\n if ($pool_name !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_name' . '}',\n ObjectSerializer::toPathValue($pool_name),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API token authentication\n $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key');\n if ($apiToken !== null) {\n $headers['Fastly-Key'] = $apiToken;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHosts = [\"https://api.fastly.com\"];\n if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) {\n throw new \\InvalidArgumentException(\"Invalid index {$this->hostIndex} when selecting the host. Must be less than \".sizeof($operationHosts));\n }\n $operationHost = $operationHosts[$this->hostIndex];\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createPool($pool)\n {\n return $this->request('create-pool', [\n 'pool' => $pool,\n ]);\n }",
"public function createPool($pool)\n {\n $_params = array(\"pool\" => $pool);\n return $this->master->call('ips/create-pool', $_params);\n }",
"public function getPoolServerRequest($options)\n {\n // unbox the parameters from the associative array\n $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null;\n $pool_id = array_key_exists('pool_id', $options) ? $options['pool_id'] : null;\n $server_id = array_key_exists('server_id', $options) ? $options['server_id'] : null;\n\n // verify the required parameter 'service_id' is set\n if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $service_id when calling getPoolServer'\n );\n }\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling getPoolServer'\n );\n }\n // verify the required parameter 'server_id' is set\n if ($server_id === null || (is_array($server_id) && count($server_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $server_id when calling getPoolServer'\n );\n }\n\n $resourcePath = '/service/{service_id}/pool/{pool_id}/server/{server_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($service_id !== null) {\n $resourcePath = str_replace(\n '{' . 'service_id' . '}',\n ObjectSerializer::toPathValue($service_id),\n $resourcePath\n );\n }\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($server_id !== null) {\n $resourcePath = str_replace(\n '{' . 'server_id' . '}',\n ObjectSerializer::toPathValue($server_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API token authentication\n $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key');\n if ($apiToken !== null) {\n $headers['Fastly-Key'] = $apiToken;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHosts = [\"https://api.fastly.com\"];\n if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) {\n throw new \\InvalidArgumentException(\"Invalid index {$this->hostIndex} when selecting the host. Must be less than \".sizeof($operationHosts));\n }\n $operationHost = $operationHosts[$this->hostIndex];\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public static function createPoolAction()\n\t{\n\t\t// Start the session in case we need to save\n\t\tparent::startSession();\n\n\t\t// Prepare POST parameters array\n\t\t$params = self::convertPOST();\n\n\t\t// Instantiate a NewSuicidePool Bean and validate all parameters\n\t\t$newPoolBean = new NewSuicidePoolModel($params);\n\n\t\t$poolsDAO = new SuicidePoolsDAO();\n\t\t$poolsDAO->addPool($newPoolBean);\n\n\t\tparent::sendPositiveHTTPResponse();\n\t}",
"public function Pools()\n {\n return Request::Request(\"/pools\");\n }",
"public function createRequestPool()\n {\n $requestPool = new RequestPool(array(\n 'timeout' => $this->getTimeout()\n ));\n\n return $requestPool;\n }",
"public function poolControllerListRequest()\n {\n $resourcePath = '/sync-core/pool';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem,\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n } elseif ('application/json' === $headers['Content-Type']) {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires Bearer (JWT) authentication (access token)\n if (null !== $this->config->getAccessToken()) {\n $headers['Authorization'] = 'Bearer '.$this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n\n return new Request(\n 'GET',\n $this->config->getHost().$resourcePath.($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function testCreatePool()\n {\n }",
"public function createPoolServerWithHttpInfo($options)\n {\n $request = $this->createPoolServerRequest($options);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n if ('POST' != 'GET' && 'POST' != 'HEAD') {\n $header = $response->getHeader('Fastly-RateLimit-Remaining');\n if (count($header) > 0) {\n $this->config->setRateLimitRemaining($header[0]);\n }\n\n $header = $response->getHeader('Fastly-RateLimit-Reset');\n if (count($header) > 0) {\n $this->config->setRateLimitReset($header[0]);\n }\n } \n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n switch($statusCode) {\n case 200:\n if ('\\Fastly\\Model\\ServerResponse' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\Fastly\\Model\\ServerResponse', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\Fastly\\Model\\ServerResponse';\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Fastly\\Model\\ServerResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function updatePoolServerRequest($options)\n {\n // unbox the parameters from the associative array\n $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null;\n $pool_id = array_key_exists('pool_id', $options) ? $options['pool_id'] : null;\n $server_id = array_key_exists('server_id', $options) ? $options['server_id'] : null;\n $weight = array_key_exists('weight', $options) ? $options['weight'] : 100;\n $max_conn = array_key_exists('max_conn', $options) ? $options['max_conn'] : 0;\n $port = array_key_exists('port', $options) ? $options['port'] : 80;\n $address = array_key_exists('address', $options) ? $options['address'] : null;\n $comment = array_key_exists('comment', $options) ? $options['comment'] : null;\n $disabled = array_key_exists('disabled', $options) ? $options['disabled'] : false;\n $override_host = array_key_exists('override_host', $options) ? $options['override_host'] : 'null';\n\n // verify the required parameter 'service_id' is set\n if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $service_id when calling updatePoolServer'\n );\n }\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling updatePoolServer'\n );\n }\n // verify the required parameter 'server_id' is set\n if ($server_id === null || (is_array($server_id) && count($server_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $server_id when calling updatePoolServer'\n );\n }\n if ($weight !== null && $weight > 100) {\n throw new \\InvalidArgumentException('invalid value for \"$weight\" when calling ServerApi.updatePoolServer, must be smaller than or equal to 100.');\n }\n if ($weight !== null && $weight < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$weight\" when calling ServerApi.updatePoolServer, must be bigger than or equal to 1.');\n }\n\n\n $resourcePath = '/service/{service_id}/pool/{pool_id}/server/{server_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($service_id !== null) {\n $resourcePath = str_replace(\n '{' . 'service_id' . '}',\n ObjectSerializer::toPathValue($service_id),\n $resourcePath\n );\n }\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($server_id !== null) {\n $resourcePath = str_replace(\n '{' . 'server_id' . '}',\n ObjectSerializer::toPathValue($server_id),\n $resourcePath\n );\n }\n\n // form params\n if ($weight !== null) {\n $formParams['weight'] = ObjectSerializer::toFormValue($weight);\n }\n // form params\n if ($max_conn !== null) {\n $formParams['max_conn'] = ObjectSerializer::toFormValue($max_conn);\n }\n // form params\n if ($port !== null) {\n $formParams['port'] = ObjectSerializer::toFormValue($port);\n }\n // form params\n if ($address !== null) {\n $formParams['address'] = ObjectSerializer::toFormValue($address);\n }\n // form params\n if ($comment !== null) {\n $formParams['comment'] = ObjectSerializer::toFormValue($comment);\n }\n // form params\n if ($disabled !== null) {\n $formParams['disabled'] = ObjectSerializer::toFormValue($disabled);\n }\n // form params\n if ($override_host !== null) {\n $formParams['override_host'] = ObjectSerializer::toFormValue($override_host);\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API token authentication\n $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key');\n if ($apiToken !== null) {\n $headers['Fastly-Key'] = $apiToken;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHosts = [\"https://api.fastly.com\"];\n if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) {\n throw new \\InvalidArgumentException(\"Invalid index {$this->hostIndex} when selecting the host. Must be less than \".sizeof($operationHosts));\n }\n $operationHost = $operationHosts[$this->hostIndex];\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'PUT',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public abstract function submit_action(string $pool_name, array $request, array $nodes = null, int $timeout = null): array;",
"private function actionCreate()\n {\n $model = new DcmdServicePoolNode();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function createPoolServerAsync($options)\n {\n return $this->createPoolServerAsyncWithHttpInfo($options)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"private function _createPool()\n {\n $schedule = Schedule::lookupById((int)$this->m_scheduleId);\n $divisionNameWithGender = $schedule->division->name . \" \" . $schedule->division->gender;\n $this->m_divisionNames[] = $divisionNameWithGender;\n $flight = Flight::lookupById((int)$this->m_flightId);\n $pool = Pool::create($flight, $schedule, $this->m_poolName);\n\n $this->m_messageString = \"Pool $pool->fullName successfully created\";\n }",
"private function _getRequestPool(): Pool\n {\n return new Pool($this->_getClient(), $this->_getRequestPromise(), [\n 'concurrency' => max(1, $this->configOfConcurrency),\n 'fulfilled' => function () {\n call_user_func_array([$this, '_responseSuccessHandle'], func_get_args());\n },\n 'rejected' => function () {\n call_user_func_array([$this, '_responseFailHandle'], func_get_args());\n }\n ]);\n }",
"private function createProjectPool() {\n //TODO\n }",
"public function actionCreate()\n {\n $model = new TaskPool();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Array of MX domains this provider will respond to. To get a MX domain, check MX records for domain and strip everything but top level domain. Sample: In your terminal: $ host t MX gmail.com gmail.com MX lookup, resolved with gmailsmtpin.l.google.com So our mxDomains property will have array( 'google.com' ) | public function getMXDomains()
{
return $this->mxDomains;
} | [
"function get_domains() {\n\t\tif ( !empty( $this->_config['domain'] ) ) {\n\t\t\treturn (array) $this->_config['domain'];\n\t\t}\n\n\t\treturn array();\n\t}",
"function queryMX($domain) {\r\n $hosts = array();\r\n $mxweights = array();\r\n if (function_exists('getmxrr')) {\r\n getmxrr($domain, $hosts, $mxweights);\r\n } else {\r\n // windows, we need Net_DNS\r\n require_once 'Net/DNS.php';\r\n\r\n $resolver = new Net_DNS_Resolver();\r\n $resolver->debug = $this->debug;\r\n // nameservers to query\r\n $resolver->nameservers = $this->nameservers;\r\n $resp = $resolver->query($domain, 'MX');\r\n if ($resp) {\r\n foreach($resp->answer as $answer) {\r\n $hosts[] = $answer->exchange;\r\n $mxweights[] = $answer->preference;\r\n }\r\n }\r\n\r\n }\r\n return array($hosts, $mxweights);\r\n }",
"function get_domains() {\n\t\tif ( !empty( $this->_config['cname'] ) ) {\n\t\t\treturn (array) $this->_config['cname'];\n\t\t} elseif ( !empty( $this->_config['id'] ) ) {\n\t\t\t$domain = sprintf( '%s.cloudfront.net', $this->_config['id'] );\n\n\t\t\treturn array(\n\t\t\t\t$domain\n\t\t\t);\n\t\t}\n\n\t\treturn array();\n\t}",
"public static function get_domains() {\n\t\treturn array( self::DOMAIN_POSTS, self::DOMAIN_USERS, self::DOMAIN_TERMS );\n\t}",
"public static function getMobileMailAddressDomains() {\n return (array) include(sfContext::getInstance()->getConfigCache()->checkConfig('config/mobile_mail_domain.yml'));\n }",
"function get_domains() {\n\t\treturn array();\n\t}",
"public function domains()\n {\n $_params = [];\n return $this->master->call('senders/domains', $_params);\n }",
"public static function domains()\n {\n\n // Only return configured domains if domain_mode is active. This is typically disabled\n // if there are no domains configured, or if testing locally\n if (self::is_domain_mode()) {\n return self::config()->domains;\n } else {\n return array();\n }\n }",
"public function getMXRecords($domains)\n {\n $mxRecords = [];\n\n foreach ($domains as $domain => $emails) {\n\n $mxHosts = [];\n $mxWeights = [];\n\n // On windows systems getmxrr doesn't exist\n if (function_exists('getmxrr')) {\n\n getmxrr($domain, $mxHosts, $mxWeights);\n\n // Order the mxhosts by their weight / importance\n array_multisort($mxWeights, $mxHosts);\n\n /**\n * Add A-record as last chance (e.g. if no MX record is there).\n */\n $mxHosts[ ] = $domain;\n\n $mxRecords[ $domain ] = $mxHosts;\n } else {\n\n // Provide some sort of alternative here\n }\n }\n\n return $mxRecords;\n }",
"public static function getMobileMailAddressDomains()\n {\n return (array)include(sfContext::getInstance()->getConfigCache()->checkConfig('config/mobile_mail_domain.yml'));\n }",
"public function domains()\n {\n $_params = array();\n return $this->master->call('senders/domains', $_params);\n }",
"public function getDomains()\n\t{\n\t\treturn $this->apiRequest('get-domains');\n\t}",
"public function getDomainsArray()\n {\n $return = array();\n if ($this->hasDataKey('DATA', 'domains'))\n\t{\n foreach ($this->getDataKey('DATA', 'domains') as $domain)\n\t {\n $domain = trim($domain);\n if (!empty($domain))\n\t\t{\n $return[$domain] = $domain;\n }\n }\n }\n return $return;\n }",
"private static function get_domains(){\n $config = self::get_config();\n $domains = array();\n unset($config['threshold']);\n foreach($config as $domain_name => $domain_id){\n $domains[$domain_id][] = $domain_name;\n }\n return $domains;\n }",
"public function getDomains() {\n if ($this->metadata && isset($this->metadata['domains'])) {\n return $this->metadata['domains'];\n }\n }",
"private function getMxRecords($domain) {\n\n $hosts = [];\n $mxWeights = [];\n\n // retrieve SMTP Server via MX query on domain\n getmxrr($domain, $hosts, $mxWeights);\n $mxs = array_combine($hosts, $mxWeights);\n asort($mxs, SORT_NUMERIC);\n\n return $mxs;\n }",
"public function getMXRecords($domain)\n {\n static $mxRecords = array();\n\n if (array_key_exists($domain, $mxRecords) === true) {\n echo 'From runtime!';\n return $mxRecords[$domain];\n }\n\n $hosts = array();\n $weights = array();\n $mxRecord = getmxrr($domain, $hosts, $weights);\n\n if ($mxRecord === false) {\n $record = dns_get_record($domain);\n\n if (empty($record) === true) {\n throw new Exception\\InvalidArgument(sprintf($this->exceptions[1], $domain), 1);\n }\n\n $socket = @fsockopen($domain, 25, $code, $message, 0.1);\n if ($socket === false) {\n throw new Exception\\InvalidArgument(sprintf($this->exceptions[2], $domain), 2);\n }\n\n fclose($socket);\n\n return $mxRecords[$domain] = array($domain);\n }\n\n // Sort on weight. We use the less weight first\n asort($weights);\n\n $records = array();\n foreach ($weights as $index => $weight) {\n $records[] = $hosts[$index];\n }\n\n return $mxRecords[$domain] = $records;\n }",
"public function getDomains()\n {\n return $this->domains;\n }",
"public function getDomains(): array;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation deleteTierAsyncWithHttpInfo Delete Tier | public function deleteTierAsyncWithHttpInfo($body, $programId, $tierId)
{
$returnType = 'object';
$request = $this->deleteTierRequest($body, $programId, $tierId);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
);
} | [
"public function tier_deleteAction($tid){\n\t\t$tier = new tier();\n\t\t$tier->get($tid);\n\n\t\t// Verification que le tier demandé est valide\n\t\tif(empty($tier)){\n\t\t\t$this->registry->Helper->pnotify('Tiers', 'Erreur tier introuvable dans la base','danger');\n\t\t\treturn $this->tiersAction();\n\t\t}\n\n\t\t$this->registry->db->delete('tiers', $tid);\n\t\t$this->registry->Helper->pnotify('Tiers', 'Informations supprimées dans la base','success');\n\t\treturn $this->tiersAction();\n\t}",
"private function deleteTableAsyncWithHttpInfo(Requests\\deleteTableRequest $request) \n {\n $returnType = 'void';\n $request = $request->createRequest($this->config);\n\n return $this->client\n ->sendAsync($request, $this->_createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) { \n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n\n if ($exception instanceof RepeatRequestException) {\n $this->_requestToken();\n throw new RepeatRequestException(\"Request must be retried\", 401, null, null);\n }\n\n throw new ApiException(\n sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), $statusCode, $response->getHeaders(), $response->getBody()\n );\n }\n );\n }",
"public function teamDeleteAsyncWithHttpInfo()\n {\n $returnType = '';\n $request = $this->teamDeleteRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function deleteTelegrafsIDAsyncWithHttpInfo($telegraf_id, $zap_trace_span = null)\n {\n $returnType = '';\n $request = $this->deleteTelegrafsIDRequest($telegraf_id, $zap_trace_span);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function deleteRouteTableWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->ownerAccount)) {\n $query['OwnerAccount'] = $request->ownerAccount;\n }\n if (!Utils::isUnset($request->ownerId)) {\n $query['OwnerId'] = $request->ownerId;\n }\n if (!Utils::isUnset($request->regionId)) {\n $query['RegionId'] = $request->regionId;\n }\n if (!Utils::isUnset($request->regionId)) {\n $query['RegionId'] = $request->regionId;\n }\n if (!Utils::isUnset($request->resourceOwnerAccount)) {\n $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount;\n }\n if (!Utils::isUnset($request->resourceOwnerId)) {\n $query['ResourceOwnerId'] = $request->resourceOwnerId;\n }\n if (!Utils::isUnset($request->routeTableId)) {\n $query['RouteTableId'] = $request->routeTableId;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'DeleteRouteTable',\n 'version' => '2016-04-28',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return DeleteRouteTableResponse::fromMap($this->callApi($params, $req, $runtime));\n }",
"public function deleteAsyncWithHttpInfo($request)\n {\n $request = $this->deleteRequest($request);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $this->handleClientException($exception);\n }\n );\n }",
"public function privateDesignsDeleteAsyncWithHttpInfo($id, $tenant_id = null, $owner_id = null)\n {\n $returnType = '\\Aurigma\\AssetStorage\\Model\\DesignDto';\n $request = $this->privateDesignsDeleteRequest($id, $tenant_id, $owner_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"private function deleteParagraphTabStopAsyncWithHttpInfo(Requests\\deleteParagraphTabStopRequest $request) \n {\n $returnType = '\\Aspose\\Words\\Model\\TabStopsResponse';\n $request = $request->createRequest($this->config);\n\n return $this->client\n ->sendAsync($request, $this->_createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject' || $returnType === 'FILES_COLLECTION') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n if ($this->config->getDebug()) {\n $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()));\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) { \n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n\n if ($exception instanceof RepeatRequestException) {\n $this->_requestToken();\n throw new RepeatRequestException(\"Request must be retried\", 401, null, null);\n }\n\n throw new ApiException(\n sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), $statusCode, $response->getHeaders(), $response->getBody()\n );\n }\n );\n }",
"public function restPimAttributesNamesDeleteAsyncWithHttpInfo()\n {\n $returnType = 'object';\n $request = $this->restPimAttributesNamesDeleteRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function deleteTelegrafsIDWithHttpInfo($telegraf_id, $zap_trace_span = null)\n {\n $request = $this->deleteTelegrafsIDRequest($telegraf_id, $zap_trace_span);\n\n $response = $this->defaultApi->sendRequest($request);\n\n return [null, $response->getStatusCode(), $response->getHeaders()];\n }",
"public function removeTier1 (Request $request) {\n\n $result = array (\n 'success' => null,\n 'messages' => [],\n 'data' => [],\n );\n\n\n // Begin validate request\n $data = $request->input();\n $validationResult = Validator::make($data, [\n 'id' => ['required']\n ]);\n\n if($validationResult->fails() == true) {\n\n $result['success'] = false;\n\n $messages = $validationResult->errors();\n $messages = $messages->messages();\n\n foreach ($messages as $key => $value) {\n $result['messages'][] = $value[0];\n }\n\n $response = response(\n json_encode($result),\n 200\n )\n ->header('Content-Type', 'application/json');\n\n return $response;\n\n }\n // End validate request\n\n\n // Begin check tier1 exists\n $exists = Tier1::where([\n 'id' => $request->input('id'),\n ])\n ->get()\n ->count();\n\n if($exists == 0) {\n\n $result['success'] = false;\n $result['messages'][] = \"Tier1 does not exists !\";\n\n $response = response(\n json_encode($result),\n 200\n )\n ->header('Content-Type', 'application/json');\n\n return $response;\n\n }\n // End check tier1 exists\n\n\n\n // TODO: Remove all things belongs to the tier1\n\n // Begin remove tier1\n\n $tier1_link = Tier1::where('id', $request->input('id'))->value('tier1_link');\n\n Tier1::where('id', $request->input('id'))->delete();\n Tier2::where('tier1_link_id', $tier1_link)->delete();\n\n // End remove tier1\n\n\n // Begin return response\n $result = array (\n 'success' => true,\n 'messages' => array('Tier1 has been removed successfully'),\n 'data' => array(\n 'id' => $request->input('id')\n )\n );\n\n $response = response(\n json_encode($result),\n 200\n )\n ->header('Content-Type', 'application/json');\n\n return $response;\n // End return response\n\n }",
"public function restPimAttributesDeleteAsyncWithHttpInfo()\n {\n $returnType = 'object';\n $request = $this->restPimAttributesDeleteRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function deleteTenantWithRequest($tenantId, $request)\n {\n return $this->start()->uri(\"/api/tenant\")\n ->urlSegment($tenantId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->delete()\n ->go();\n }",
"public function trialBalanceDeleteByKeysAsyncWithHttpInfo($ids)\n {\n $returnType = '';\n $request = $this->trialBalanceDeleteByKeysRequest($ids);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function teamDeleteWithHttpInfo()\n {\n $request = $this->teamDeleteRequest();\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n $this->response = $response;\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n } catch (ApiException $e) {\n $statusCode = $e->getCode();\n\n $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00');\n $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99');\n if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) {\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Dropbox\\Sign\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n }\n\n throw $e;\n }\n }",
"public function deleteTier($body, $programId, $tierId)\n {\n list($response) = $this->deleteTierWithHttpInfo($body, $programId, $tierId);\n return $response;\n }",
"public function v1TagsDeletePostAsyncWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->v1TagsDeletePostRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function deleteTelegrafsIDLabelsIDAsyncWithHttpInfo($telegraf_id, $label_id, $zap_trace_span = null)\n {\n $returnType = '';\n $request = $this->deleteTelegrafsIDLabelsIDRequest($telegraf_id, $label_id, $zap_trace_span);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function warehouseTransferOutLineDELETERequestWarehouseTransferOutIDLinesWarehouseTransferOutLineIDDeleteAsyncWithHttpInfo($accept, $warehouse_transfer_out_id, $warehouse_transfer_out_line_id, $jiwa_stateful = null, $item_no = null, $inventory_id = null, $part_no = null, $description = null, $decimal_places = null, $quantity_wanted = null, $quantity_transferred = null, $quantity_back_ordered = null, $cost = null, $ref = null, $back_order_id = null, $purchase_order_id = null, $purchase_order_line_id = null, $total_cost_transferred = null, $total_cost_received = null, $added_cost_ledger1_rec_id = null, $added_cost_ledger1_account_no = null, $added_cost_ledger1_description = null, $added_cost_ledger2_rec_id = null, $added_cost_ledger2_account_no = null, $added_cost_ledger2_description = null, $added_cost_ledger3_rec_id = null, $added_cost_ledger3_account_no = null, $added_cost_ledger3_description = null, $line_details = null)\n {\n $returnType = '\\Jiwa\\Model\\Object';\n $request = $this->warehouseTransferOutLineDELETERequestWarehouseTransferOutIDLinesWarehouseTransferOutLineIDDeleteRequest($accept, $warehouse_transfer_out_id, $warehouse_transfer_out_line_id, $jiwa_stateful, $item_no, $inventory_id, $part_no, $description, $decimal_places, $quantity_wanted, $quantity_transferred, $quantity_back_ordered, $cost, $ref, $back_order_id, $purchase_order_id, $purchase_order_line_id, $total_cost_transferred, $total_cost_received, $added_cost_ledger1_rec_id, $added_cost_ledger1_account_no, $added_cost_ledger1_description, $added_cost_ledger2_rec_id, $added_cost_ledger2_account_no, $added_cost_ledger2_description, $added_cost_ledger3_rec_id, $added_cost_ledger3_account_no, $added_cost_ledger3_description, $line_details);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a form to delete a profil_FN entity. | private function createDeleteForm(Profil_FN $profil_FN)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('profilfn_delete', array('id' => $profil_FN->getIdPFN())))
->setMethod('DELETE')
->getForm()
;
} | [
"private function createDeleteForm(Profil $profil)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('profil_delete', array('id' => $profil->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"public function deleteAction(Request $request, Profil_FN $profil_FN)\n {\n $form = $this->createDeleteForm($profil_FN);\n $form->handleRequest($request);\n\n if ($form->isSubmitted() && $form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->remove($profil_FN);\n $em->flush();\n }\n\n return $this->redirectToRoute('profilfn_index');\n }",
"private function createDeleteForm(Perfil $perfil)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_profile_delete', array('id' => $perfil->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Profesionales $profesionale)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('profesionales_delete', array('id' => $profesionale->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Proprio $proprio)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_proprio_delete', array('id' => $proprio->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(RhPuestoPerfil $rhPuestoPerfil)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('rhpuestoperfil_delete', array('id' => $rhPuestoPerfil->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(ServicioProfesional $servicioProfesional)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('servicioprofesional_delete', array('id' => $servicioProfesional->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Profession $profession)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('profil_member_profession_delete', array('id' => $profession->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteFormPerfil($id) {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('pakmail_perfiles_delete', array('id' => $id)))\r\n ->setMethod('DELETE')\r\n //->add('submit', 'submit', array('label' => 'Delete'))\r\n ->getForm()\r\n ;\r\n }",
"private function createDeleteForm(ConfNatureOperation $confNatureOperation)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('natureoperation_delete', array('id' => $confNatureOperation->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Funcionaros $funcionaro)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('funcionaros_delete', array('idfuncionaros' => $funcionaro->getIdfuncionaros())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Provincias $provincia)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('provincias_delete', array('id' => $provincia->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(PersonaAccion $personaAccion)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_personaaccion_delete', array('id' => $personaAccion->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Fonction $fonction)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('fonction_delete', array('id' => $fonction->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Proeflessen $proeflessen)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_proeflessen_delete', array('id' => $proeflessen->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Funcionario $funcionario)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('funcionario_delete', array('id' => $funcionario->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Funcionario $funcionario)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('funcionarios_delete', array('id' => $funcionario->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(FroFacRetefuente $froFacRetefuente)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('frofacretefuente_delete', array('id' => $froFacRetefuente->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(preferences $preference)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('pref_delete', array('id' => $preference->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method returns AgencyInfo for all agencies. | public function getAgencyList()
{
$dataAgencyList = $this->sendWithSession('ox.getAgencyList');
$returnData = array();
foreach ($dataAgencyList as $dataAgency) {
$agencyInfo = new AgencyInfo();
$agencyInfo->readDataFromArray($dataAgency);
$returnData[] = $agencyInfo;
}
return $returnData;
} | [
"function getAgencyList()\n {\n $dataAgencyList = $this->_sendWithSession('ox.getAgencyList');\n $returnData = [];\n foreach ($dataAgencyList as $dataAgency) {\n $oAgencyInfo = new AgencyInfo();\n $oAgencyInfo->readDataFromArray($dataAgency);\n $returnData[] = $oAgencyInfo;\n }\n\n return $returnData;\n }",
"public function getAgenciesByID ()\n {\n $result = array();\n\n foreach($this->getAgencies(\"All\") as $agency) {\n $result[$agency->id] = $agency;\n }\n\n return($result);\n }",
"public function getAgenciesUsed()\n {\n return $this\n ->hasMany(Agency::class, ['owner_id' => 'id'])\n ->viaTable('{{%tours}}', ['agency_id' => 'id']);\n }",
"public function agency()\n {\n return $this->belongsTo('App\\Models\\Api\\v1\\Person', 'n_AgencyPersoninfoId_FK')->withDefault();\n }",
"public function getAgenciesHtml() {\n $html = '<div class=\"row\">';\n\n //call the db global class to perform queries\n $dB = new DB('travelexperts');\n $query = \"SELECT * FROM `agencies`\";\n $agencies = $dB->get($query);\n\n //start looping through agencies\n for ($i = 0; $i < count($agencies); $i++) {\n $agency = new Agency($agencies[$i]);\n $html .= '<div class=\"row\"><div class=\"col-md-12 text-center\">\n <h2 class=\"section-heading\" style=\"background-color:#f05f40; color:white; padding:.5em; margin:1em; border-radius:10px;\">' . $agency->getAgncyCity() . ' Office</h2><strong>'\n . 'Phone: ' . $agency->getAgncyPhone() . '<br/>'\n . 'Fax: ' . $agency->getAgncyFax() . '<br/>'\n . $agency->getAgncyAddress() . ', ' . $agency->getAgncyCity() . ', ' . $agency->getAgncyProv() . '<br/>'\n . $agency->getAgncyPostal() . ', ' . $agency->getAgncyCountry() . '<br/></strong><hr/>';\n\n //get agents and pass in the current agency\n $html .= $this->getAgentsHtml($agency);\n }\n $html .= '</div></div></div>';\n return $html;\n }",
"function getAgencies()\n\t{\n\t\t$dbconnection = connectDB();// make databse connection\n\n\t\t$myQuery = \"SELECT * from agencies\";\n\n\t\t$agencies = $dbconnection->query($myQuery);\n\n\t\t$dbconnection->close(); //Close the database connection here.\n\n\t\treturn $agencies;\n\t}",
"public function getAllEmergencyAgencies()\n {\n return new EmergencylineCollection(EmergencyAgency::all());\n }",
"public function getAll()\n {\n try\n {\n return $this->db->get('agencies')->result_array();\n }\n catch(Exception $e)\n {\n return false;\n }\n }",
"public function actionIndex()\n {\n $searchModel = new AgencySearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n \n $agenciesCount = Agency::find()->count();\n \n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'agenciesCount' => $agenciesCount,\n ]);\n }",
"public function getAllAgencyInfo($pid=0)\n {\n try\n {\n\t\t\t$this->db->select('a.*,u.email_id,c.name as city,s.id as state_id,s.name as state,co.id as country_id,co.name as country,bc.name as bank_city,pa.name as parent_name,rs.name as resident_state');\n\t\t\t$this->db->from('agencies a');\n\t\t\tif($pid != 0)\n\t\t\t{\n\t\t\t\t$this->db->where('a.parent_agency',$pid);\n\t\t\t}\n\t\t\t$this->db->join('users u','u.id = a.user_id');\n\t\t\t$this->db->join('city c','c.id = a.city_id');\n\t\t\t$this->db->join('state s','s.id = c.state_id');\n\t\t\t$this->db->join('country co','co.id = s.country_id');\n\t\t\t$this->db->join('city bc','bc.id=a.bank_city_id','left');\n\t\t\t$this->db->join('agencies pa','pa.id = a.parent_agency','left');\n\t\t\t$this->db->join('state rs','rs.id = a.resident_license_state_id','left');\n return $this->db->get()->result_array();\n }\n catch(Exception $e)\n {\n return false;\n }\n }",
"public function actionIndex()\n {\n $searchModel = new AgencySearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function agency()\n {\n return $this->belongsTo(Agency::class);\n }",
"function getAdvertiserListByAgencyId($agencyId)\n {\n $dataAdvertiserList = $this->_sendWithSession('ox.getAdvertiserListByAgencyId', [(int)$agencyId]);\n $returnData = [];\n foreach ($dataAdvertiserList as $dataAdvertiser) {\n $oAdvertiserInfo = new AdvertiserInfo();\n $oAdvertiserInfo->readDataFromArray($dataAdvertiser);\n $returnData[] = $oAdvertiserInfo;\n }\n\n return $returnData;\n }",
"function get_all_agency()\n {\n $this->db->order_by('id', 'desc');\n return $this->db->get('agency')->result_array();\n }",
"public function all()\n {\n return new AgenceCollection($this->Agence->all());\n }",
"public function getAgencyOffers($agency_id){\r\n return Property::find()->where(['user_id' => $agency_id])->orderBy(['id' => SORT_DESC])->all();\r\n }",
"public function getAgencySubDomains()\n {\n return $this->domains['agency'];\n }",
"public function agents(){\n\n return $this->hasMany('App\\Agent', 'agency_id', 'id');\n\n\n }",
"public function agenciesAction()\n {\n $this->data['agenciesList'] = $this->get('CorpoAgenciesServices')->getCorpoAdminAgenciesList();\n return $this->render('@Corporate/admin/agencies/agenciesList.twig', $this->data);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the value of [pothnbr] column. | public function setPothnbr($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->pothnbr !== $v) {
$this->pothnbr = $v;
$this->modifiedColumns[PoReceivingHeadTableMap::COL_POTHNBR] = true;
}
if ($this->aPurchaseOrder !== null && $this->aPurchaseOrder->getPohdnbr() !== $v) {
$this->aPurchaseOrder = null;
}
return $this;
} | [
"public function setPoNumber($poNumber);",
"public function getPothnbr()\n {\n return $this->pothnbr;\n }",
"public function setPoNumber(string $po_number): void\n {\n $this->_po_number = $po_number;\n }",
"public function get_po_number(){\n\t\treturn $this->v_po_number;\n\t}",
"public function getPothinvcnbr()\n {\n return $this->pothinvcnbr;\n }",
"public function setPothrcptnbr($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->pothrcptnbr !== $v) {\n $this->pothrcptnbr = $v;\n $this->modifiedColumns[PoReceivingHeadTableMap::COL_POTHRCPTNBR] = true;\n }\n\n return $this;\n }",
"public function setPuntNum($v)\n\t{\n\r\n\t\t// Since the native PHP type for this column is integer,\r\n\t\t// we will cast the input value to an int (if it is not).\r\n\t\tif ($v !== null && !is_int($v) && is_numeric($v)) {\r\n\t\t\t$v = (int) $v;\r\n\t\t}\r\n\n\t\tif ($this->punt_num !== $v || $v === 0) {\n\t\t\t$this->punt_num = $v;\n\t\t\t$this->modifiedColumns[] = FilePeer::PUNT_NUM;\n\t\t}\n\n\t}",
"public function setPodtrcptnbr($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->podtrcptnbr !== $v) {\n $this->podtrcptnbr = $v;\n $this->modifiedColumns[EditPoDetailTableMap::COL_PODTRCPTNBR] = true;\n }\n\n return $this;\n }",
"public function setPothinvcnbr($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->pothinvcnbr !== $v) {\n $this->pothinvcnbr = $v;\n $this->modifiedColumns[PoReceivingHeadTableMap::COL_POTHINVCNBR] = true;\n }\n\n return $this;\n }",
"public function getPhadicellnbr()\n {\n return $this->phadicellnbr;\n }",
"public function setPodtrcptnbr($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->podtrcptnbr !== $v) {\n $this->podtrcptnbr = $v;\n $this->modifiedColumns[PurchaseOrderDetailTableMap::COL_PODTRCPTNBR] = true;\n }\n\n return $this;\n }",
"public function testSetNumeroPj() {\n\n $obj = new BonTravPrev();\n\n $obj->setNumeroPj(10);\n $this->assertEquals(10, $obj->getNumeroPj());\n }",
"public function setOsBuildNumber($val)\n {\n $this->_propDict[\"osBuildNumber\"] = $val;\n return $this;\n }",
"public function setNumber(?NumberColumn $value): void {\n $this->getBackingStore()->set('number', $value);\n }",
"public function setPohdrcnt($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->pohdrcnt !== $v) {\n $this->pohdrcnt = $v;\n $this->modifiedColumns[EditPoHeadTableMap::COL_POHDRCNT] = true;\n }\n\n return $this;\n }",
"public function setPodtwipnbr($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->podtwipnbr !== $v) {\n $this->podtwipnbr = $v;\n $this->modifiedColumns[EditPoDetailTableMap::COL_PODTWIPNBR] = true;\n }\n\n return $this;\n }",
"public function setTicketNumber($val)\n {\n $this->_propDict[\"ticketNumber\"] = $val;\n return $this;\n }",
"public function setNb($nb)\n\t{\n\t\t$this->nb = $nb;\n\t}",
"public function setPohdrcnt($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->pohdrcnt !== $v) {\n $this->pohdrcnt = $v;\n $this->modifiedColumns[PurchaseOrderTableMap::COL_POHDRCNT] = true;\n }\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[getBlogManager Returns the BlogManager Model object.] | public function &getBlogManager(): BlogManager {
return $this->ci->bmanager;
} | [
"private function getManager() {\n return $this->get('pickle_blog.manager');\n }",
"private function getBlogModel() {\n if ($this->_blogModel == null) {\n $this->_blogModel = new Blog();\n }\n return $this->_blogModel;\n }",
"public function getBlogDAO()\n {\n return $this->BlogDAO;\n }",
"public function getBlogService()\n {\n return $this->blogService;\n }",
"public function getBlog()\n {\n return $this->blog;\n }",
"public function getBlog() {\n\t\treturn $this->blog;\n\t}",
"public function getBlog()\n\t{\n\t\treturn $this->blog;\n\t}",
"public function getBlog()\n {\n return $this->id_blog;\n }",
"protected function getDoctrineManager()\n {\n return Doctrine_Manager::getInstance();\n }",
"public function newBlogInstance()\n\t{\n\t\treturn $this->blog;\n\t}",
"public function __construct()\n {\n $this->blogPosts = new PostManager();\n }",
"public function getBlogPost()\n {\n return $this->blogPost;\n }",
"protected function getManager()\n {\n return $this->objectManager;\n }",
"protected function getPostManager()\n {\n return $this->container->get('forum.post.manager');\n }",
"public function getBlog()\n {\n return $this->getParent();\n }",
"protected function _initBlog() {\n/*\n $cfg = new Zend_Config_Ini(APPLICATION_PATH.'/modules/blog/configs/application.ini');\n $blog = Foomy_Blog_Model_Blog_Peer::getById($cfg->blog->activeBlog);\n*/\n }",
"function getBlogById($bId)\n {\n return findBlogById($bId);\n }",
"public function getCurrentBlog()\n {\n return $this->currentBlog;\n }",
"public function getModelsManager(){ }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the value of field fatura | public function getFatura()
{
return $this->fatura;
} | [
"public function getFactura()\n {\n return $this->factura;\n }",
"public function getValor_factura() {\r\n return $this->valor_factura;\r\n }",
"public function getFeeValue()\n {\n return $this->fee_value;\n }",
"public function getMedicoFisio(){\n return $this->Medico_Fisio;\n }",
"public function getFumo()\n {\n return $this->fumo;\n }",
"public function getFechabaja()\r\n {\r\n return $this->fechabaja;\r\n }",
"public function getFieldValue(): string {\n\t\t\treturn $this->value;\n\t\t}",
"public function getFloatField()\n {\n return $this->float_field;\n }",
"public function getAfDuree() {\n return $this->afDuree;\n }",
"public function getFieldTypeValue();",
"public function getAsistenciaValue()\n {\n return $this->asistenciaValue;\n }",
"public function getFechaprueba()\n {\n return $this->fechaprueba;\n }",
"function getFieldValue($field);",
"public function getIdfundacion_foto(){\n return $this->idfundacion_foto;\n }",
"public function getCodeFamille() {\n return $this->codeFamille;\n }",
"public function getFallecido()\r\n\t{\r\n\t\treturn($this->fallecido);\r\n\t}",
"public function get_fatura() {\n $criteria = new Criteria;\n $criteria->add(new Filter('id_processo', '=', $this->id_processo));\n return (new Repository(Fatura::class))->load($criteria);\n }",
"public static function frGetFieldValue($form, $name){\n\t\treturn $form->getValue($name);\n\t}",
"function get_face_value()\n {\n return $this->face_value;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return user activation code. | public function activationCode(); | [
"public function getActivationCode()\r\n {\r\n return sha1(\"Activate:\" . $this->id . $this->salt . \".\" . $this->password);\r\n }",
"public function activationCode() {\n\t\treturn $this->activationCode;\n\t}",
"public function activationCode()\n {\n $routeParameter = $this->property('paramCode');\n\n if ($code = $this->param($routeParameter)) {\n return $code;\n }\n\n return get('activate');\n }",
"protected function get_activation_code() {\n\t$code = '';\n\tfor($i = 0; $i < 6; $i++) {\n\t $code .= chr(mt_rand(65, 90));\n\t}\n\treturn $code;\n }",
"function get_user_activation_code($login)\n\t{\n\n\t\t$query = 'SELECT activationcode FROM activation WHERE user_id = \\'' . get_user_id($login) ? '\\';';\n\t\t$result = $dbsocket->query($query);\n\t\t$activation = $result->fetch();\n\t\treturn $activation['activationcode'];\n\t}",
"public function getActivationCode();",
"public function getApiActivationCode()\n {\n $this->api_activation_code = $activationCode = $this->getRandomString(6);\n\n $this->save();\n\n return $activationCode;\n }",
"public function activate()\n\t{\n\t\t$code = $this->input('activation_code');\n\n\t\ttry {\n\t\t\t$this->users->activateByCode($code);\n\t\t\t$msg = Lang::get('c::auth.activation-success');\n\t\t\treturn $this->redirect('login')->with('success', $msg);\n\t\t} catch (ActivationException $e) {\n\t\t\tif ($this->debug) throw $e;\n\t\t\treturn $this->redirect('login')\n\t\t\t\t->with('error', Lang::get('c::auth.activation-failed'));\n\t\t}\n\t}",
"public function getUserCode(){\n\t\t/* return user code */\n\t\treturn $this->_intUserCode;\n\t}",
"public function getActivationKey()\n\t{\n\t\t$this->activation_key = Security::generateRandomKey();\n\t\treturn $this->save(false) ? $this->activation_key : false;\n\t}",
"public function getActivationKey()\n {\n return $this->activation_key;\n }",
"public function getActivationId()\n {\n return $this->activation_id;\n }",
"public function getActivationkey() {\n return $this->activationkey;\n }",
"public function getConfirmationCode()\n\t{\n return UserPeer::generateConfirmationCode( $this );\n\t}",
"public function getActivationToken()\n {\n return md5($this->email . Yii::$app->params['activationSalt'] . $this->authKey);\n }",
"public function getUserCode()\n {\n return $this->user_code;\n }",
"public function getCodeActivite() {\n return $this->codeActivite;\n }",
"public function getOfferActivationCode()\n {\n return $this->offerActivationCode;\n }",
"public function getUserIdByActivationCode(string $activationCode): int {\r\n $user = new User ( $this->_db );\r\n $user->activate = $activationCode;\r\n \r\n return $this->_system->getUserIdByActivationCode ( $user );\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the current design package | public function getDesignPackage()
{
if (is_null($this->_design_package)) {
$packages = $this->getWebsiteDesigns(
array(
"date_from <= :date: AND date_to >= :date:",
"bind" => array("date" => date("Y-m-d H:i:s"))
)
);
$this->_design_package = $this->getDefaultDesignPackage();
foreach ($packages as $override) {
$this->_design_package = $override->design_package;
}
}
return $this->_design_package;
} | [
"public static function getDesign()\n {\n return self::getSingleton('core/design_package');\n }",
"public function getDesignPackageId()\n {\n return $this->getProperty(\"DesignPackageId\");\n }",
"function getPackage() {\n return Package::getPackage($this);\n }",
"public function getPackage()\n {\n return $this->pkg;\n }",
"public function getPackage()\n {\n return $this->package;\n }",
"public function getPackage() {\r\n\t\treturn $this->package;\r\n\t}",
"public function get_package_name()\n {\n return $this->_package_name;\n }",
"public function getPackage()\n {\n $value = $this->get(self::PACKAGE);\n return $value === null ? (string)$value : $value;\n }",
"public function getPackageName()\n {\n return $this->package_name;\n }",
"public function getModule()\n {\n if ($this->owner->DesignModule) {\n return Green::inst()->getDesignModule($this->owner->DesignModule);\n }\n\n return null;\n }",
"public function getpackagename(){}",
"public function getPackage()\n {\n return str_replace('Model', 'Listing', parent::getPackage()) . \".Base\";\n }",
"public function getPackage(): string\n {\n if (($licenseData = $this->getLicenseData()) && $licenseData['status'] === 'active') {\n return $licenseData['product_ref'];\n }\n return $this->isDemo() ? static::DEMO_PACKAGE : false;\n }",
"public function getDesignation()\r\n {\r\n return $this->designation;\r\n }",
"public function getpackagename()\n {\n }",
"protected function get_package_name()\n {\n $class = get_class($this);\n \n return ClassnameUtilities::getInstance()->getNamespaceParent(\n ClassnameUtilities::getInstance()->getNamespaceParent(\n ClassnameUtilities::getInstance()->getNamespaceFromClassname($class)));\n }",
"public function get_package_name(){\n\t\treturn $this->v_package_name;\n\t}",
"public function getChannelPackage()\n {\n return $this->_channelPackage;\n }",
"public function getPackageName()\n {\n return substr($this->ebuild->getFilename(), 0, -7);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Looks up the given itemIds and returns the full set of Resources | public function callGetItemsFull($itemIds, $extraParams=[]) {
$resources = [
GetItemsResource::BROWSE_NODE_INFOBROWSE_NODES,
GetItemsResource::BROWSE_NODE_INFOBROWSE_NODESANCESTOR,
GetItemsResource::BROWSE_NODE_INFOBROWSE_NODESSALES_RANK,
GetItemsResource::BROWSE_NODE_INFOWEBSITE_SALES_RANK,
GetItemsResource::CUSTOMER_REVIEWSCOUNT,
GetItemsResource::CUSTOMER_REVIEWSSTAR_RATING,
// GetItemsResource::IMAGESPRIMARYSMALL,
// GetItemsResource::IMAGESPRIMARYMEDIUM,
GetItemsResource::IMAGESPRIMARYLARGE,
// GetItemsResource::IMAGESVARIANTSSMALL,
// GetItemsResource::IMAGESVARIANTSMEDIUM,
GetItemsResource::IMAGESVARIANTSLARGE,
GetItemsResource::ITEM_INFOBY_LINE_INFO,
GetItemsResource::ITEM_INFOCONTENT_INFO,
GetItemsResource::ITEM_INFOCONTENT_RATING,
GetItemsResource::ITEM_INFOCLASSIFICATIONS,
GetItemsResource::ITEM_INFOEXTERNAL_IDS,
GetItemsResource::ITEM_INFOFEATURES,
GetItemsResource::ITEM_INFOMANUFACTURE_INFO,
GetItemsResource::ITEM_INFOPRODUCT_INFO,
GetItemsResource::ITEM_INFOTECHNICAL_INFO,
GetItemsResource::ITEM_INFOTITLE,
GetItemsResource::ITEM_INFOTRADE_IN_INFO,
GetItemsResource::OFFERSLISTINGSAVAILABILITYMAX_ORDER_QUANTITY,
GetItemsResource::OFFERSLISTINGSAVAILABILITYMESSAGE,
GetItemsResource::OFFERSLISTINGSAVAILABILITYMIN_ORDER_QUANTITY,
GetItemsResource::OFFERSLISTINGSAVAILABILITYTYPE,
GetItemsResource::OFFERSLISTINGSCONDITION,
GetItemsResource::OFFERSLISTINGSCONDITIONSUB_CONDITION,
GetItemsResource::OFFERSLISTINGSDELIVERY_INFOIS_AMAZON_FULFILLED,
GetItemsResource::OFFERSLISTINGSDELIVERY_INFOIS_FREE_SHIPPING_ELIGIBLE,
GetItemsResource::OFFERSLISTINGSDELIVERY_INFOIS_PRIME_ELIGIBLE,
GetItemsResource::OFFERSLISTINGSDELIVERY_INFOSHIPPING_CHARGES,
GetItemsResource::OFFERSLISTINGSIS_BUY_BOX_WINNER,
GetItemsResource::OFFERSLISTINGSLOYALTY_POINTSPOINTS,
GetItemsResource::OFFERSLISTINGSMERCHANT_INFO,
GetItemsResource::OFFERSLISTINGSPRICE,
GetItemsResource::OFFERSLISTINGSPROGRAM_ELIGIBILITYIS_PRIME_EXCLUSIVE,
GetItemsResource::OFFERSLISTINGSPROGRAM_ELIGIBILITYIS_PRIME_PANTRY,
GetItemsResource::OFFERSLISTINGSPROMOTIONS,
GetItemsResource::OFFERSLISTINGSSAVING_BASIS,
GetItemsResource::OFFERSSUMMARIESHIGHEST_PRICE,
GetItemsResource::OFFERSSUMMARIESLOWEST_PRICE,
GetItemsResource::OFFERSSUMMARIESOFFER_COUNT,
GetItemsResource::PARENT_ASIN,
];
return $this->getItemsAndReturnAsinMappedItems($itemIds, $resources, $extraParams);
} | [
"function getAllResourcesFromItem($itemId) {\n $key = md5(osc_base_url().'ItemResource:getAllResourcesFromItem:'.$itemId);\n $found = null;\n $cache = osc_cache_get($key, $found);\n if($cache===false) {\n $this->dao->select();\n $this->dao->from($this->getTableName());\n $this->dao->where('fk_i_item_id', (int)$itemId);\n\n $result = $this->dao->get();\n\n if( $result == false ) {\n return array();\n }\n\n $return = $result->result();\n osc_cache_set($key, $return, OSC_CACHE_TTL);\n return $return;\n } else {\n return $cache;\n }\n }",
"public function findMany(array $resourceIds);",
"public function findMany(ResourceIdentifierCollectionInterface $identifiers);",
"function getItems($itemIds) {\r\n $this->db->select('id, title, description, selling_price');\r\n $this->db->where_in('id', $itemIds);\r\n $query = $this->db->get('tbl_items');\r\n\r\n $data['data'] = $query->result();\r\n $data['num_rows'] = $query->num_rows();\r\n return $data;\r\n }",
"public function getByIds($ids);",
"public function getItems()\n {\n return $this->items()->join('resources', 'rs_id', 'bili_resource')->orderBy('rs_type')->get();\n }",
"public function fetch( array $item_ids = NULL );",
"public static function queryAllContainItems ($itemIds)\n {\n $rids = array();\n\n if (is_array($itemIds)) {\n $rids = DB::table('Item')\n ->whereIn('ItemID', $itemIds)\n ->groupBy('ReceiptID')\n ->lists('ReceiptID');\n }\n\n return $rids;\n }",
"public function getResourceTypeIds();",
"public function mGet($ids);",
"public function getItemsByOrderIds($ids){\n return $this->whereIn('id', $ids)->get();\n }",
"public abstract function get_ids();",
"public function lookupItem($item_id);",
"private function get_non_cached_ids( $item_ids = array(), $group = '' ) {\n\n\t\t// Default return value\n\t\t$retval = array();\n\n\t\t// Bail if no item IDs\n\t\tif ( empty( $item_ids ) ) {\n\t\t\treturn $retval;\n\t\t}\n\n\t\t// Loop through item IDs\n\t\tforeach ( $item_ids as $id ) {\n\n\t\t\t// Shape the item ID\n\t\t\t$id = $this->shape_item_id( $id );\n\n\t\t\t// Add to return value if not cached\n\t\t\tif ( false === $this->cache_get( $id, $group ) ) {\n\t\t\t\t$retval[] = $id;\n\t\t\t}\n\t\t}\n\n\t\t// Return array of IDs\n\t\treturn $retval;\n\t}",
"public function getItemsByUids($uids)\n {\n\n return $this->whereIn('uuid', $uids)\n ->whereHas('category', function ($sql) {\n $sql->where('archive', 0);\n })\n ->whereHas('sub_category', function ($sql) {\n $sql->where('archive', 0);\n })->where('is_approved', 1)->where('archive', 0)->get();\n }",
"public function searchByIds($ids = array());",
"private function loadRelatedProducts($items)\n {\n $productIds = array_map(\n function ($item) {\n /** @var OrderItemInterface|Item $element */\n return $item->getProductId();\n },\n $items\n );\n $this->criteriaBuilder->addFilter('entity_id', $productIds, 'in');\n $productList = $this->productRepostory->getList($this->criteriaBuilder->create())->getItems();\n\n return $productList;\n }",
"public function getLookupItems();",
"function get_multiple_info($item_ids,$location=false)\n\t{\n\t\tif(!$location)\n\t\t{\n\t\t\t$location= $this->Employee->get_logged_in_employee_current_location_id();\n\t\t}\n\t\t\n\t\t$this->db->from('location_items');\n\t\t$this->db->where('location_id',$location);\n\t\t\n\t\tif (!empty($item_ids))\n\t\t{\n\t\t\t$this->db->group_start();\n\t\t\t$item_ids_chunk = array_chunk($item_ids,25);\n\t\t\tforeach($item_ids_chunk as $item_ids)\n\t\t\t{\n\t\t\t\t$this->db->or_where_in('item_id',$item_ids);\n\t\t\t}\n\t\t\t$this->db->group_end();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->db->where('1', '2', FALSE);\n\t\t}\n\t\t\n\t\t\n\t\t$this->db->order_by(\"item_id\", \"asc\");\n\t\treturn $this->db->get();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return escaped quota string for shell use | protected function _getEscapedQuota()
{
if(!($quota = $this->_getStorage()->getData('quota'))) {
return null;
}
return escapeshellarg($quota);
} | [
"protected function _getEscapedQuota()\n {\n $quota = $this->_getAccount()->getQuota();\n if(!$quota || $quota == \"\") {\n $quota = 'NOQUOTA';\n } else {\n $quota = $quota * 1048576;\n }\n \n return escapeshellarg($quota);\n }",
"public static function disk_quota_markup() {\n\t\t$quota_info = self::get_resource_usage();\n\t\tif ($quota_info != null) {\n\t\t\t$used = $quota_info->disk_used;\n\t\t\t$quota = $quota_info->soft_quota;\n\t\t\t$percent = intval(($used / $quota) * 100);\n\n\t\t\t// Select the color of the bar.\n\t\t\t$color = 'green';\n\t\t\tif ($percent >= 80) {\n\t\t\t\t$color = 'yellow';\n\t\t\t}\n\t\t\tif ($percent >= 100) {\n\t\t\t\t$color = 'red';\n\t\t\t}\n\t\t\t?>\n\t\t\t<h3 class=\"title\"><?php _e('Disk Quota'); ?></h3>\n\t\t\t<div id=\"synthesis-disk-quota\">\n\t\t\t\t<p>\n\t\t\t\t\t<?php _e('Disk quota usage:'); ?>\n\t\t\t\t\t<span class=\"quota-text\"><?php echo esc_html($percent); ?>%<span>\n\t\t\t\t</p>\n\n\t\t\t\t<div class=\"quota-progress-wrapper\">\n\t\t\t\t\t<div class=\"quota-progress <?php echo esc_attr($color); ?>\"\n\t\t\t\t\t\t style=\"width:<?php echo $percent; ?>%;max-width: 100%;\"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t<?php\n\t\t}\n\t}",
"function formatProgressBar($quota) {\r\n\t\r\n\t\t$used_label = $quota['quota_usage'].' MB';\r\n\t\t$max_label = $quota['quota_limit'].' MB';\r\n\r\n\t\tif($quota['quota_usage']<40) {\r\n\t\t\t$small_label = ' '.$used_label;\r\n\t\t\t$used_label = '';\r\n\t\t}\r\n\t\t\r\n\t\t$params = array(\r\n\t\t\t'text' => $used_label,\r\n\t\t\t'percent' => $quota['percent_usage'],\r\n\t\t\t'class' => $quota['percent_usage'] >= 90 ? 'progress-red' : ''\r\n\t\t);\r\n\r\n\t\t$tpl = new PSUTemplate();\r\n\t\treturn $tpl->psu_progress($params, $tpl);\r\n}",
"function getAliquota();",
"function tracsvn_quoteCmd($cmd) {\n\n\tif (CMS_GetOS() == \"Windows\") $cmd = \"\\\"$cmd\\\"\";\n\treturn $cmd;\n}",
"function getQuota() {\n $quota = array();\n $data['acct'] = $this->account;\n preg_match('/\"quota\" value=\"([^\"]*)/', $this->HTTP->getData('ftp/editquota.html', $data), $quota);\n return ($quota[1] == 0) ? 'Unlimited' : intval($quota[1]);\n }",
"function escape($arg) {\n\t\tif(!$this->_ec) {\n\t\t\t$this->_ec = ($this->minion->speck('system.kernel') == 'windows_nt') ? '\"' : '\\'';\n\t\t}\n\t\treturn $this->_ec . str_replace($this->_ec, '\\\\' . $this->_ec, $arg) . $this->_ec;\n\t}",
"public static function shellQuote(string $var): string {\n\t\treturn '\"' . str_replace('\"', '\\\"', $var) . '\"';\n\t}",
"function display_space_usage() {}",
"private function getQuotaUrl()\n {\n return array_get($this->options, 'quota_url');\n }",
"public function getSendingQuotaUsage(): string\n {\n $tracker = $this->getQuotaTracker();\n\n return $tracker->getUsage();\n }",
"function getQuotaByUser($_username, $_what='QMAX');",
"function get_quota_url()\r\n {\r\n return $this->get_url(array(\r\n self :: PARAM_ACTION => self :: ACTION_VIEW_QUOTA,\r\n self :: PARAM_CATEGORY_ID => null));\r\n }",
"function escapeshellarg($arg) {}",
"function manage_quota()\n\t{\n\t\t$this->output('/consent/ev_quota/v_manage_quota');\n\t}",
"public function get_free_space(): string\n\t{\n\t\t// TODO : FIX TO USE STORAGE FACADE => uploads may not be in public/uploads\n\t\t$dfs = disk_free_space(base_path(''));\n\n\t\treturn Helpers::getSymbolByQuantity($dfs);\n\t}",
"protected function _getEscapedName()\n {\n if(!($name = $this->_getStorage()->getName())) {\n return null;\n }\n \n return escapeshellarg($name);\n }",
"public function getQuota() {\n\t\t$quota = $this->account->getQuota();\n\t\tif ($quota === null) {\n\t\t\treturn 'default';\n\t\t}\n\t\treturn $quota;\n\t}",
"function escapeshellarg ($arg) {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Scale an SVG image | function image_scale_svg($svg_string, &$height = 0, &$width = 0)
{
if (!$height && !$width) {
return $svg_string;
}
$regex_width = '/(.*<svg[^>]* width=")([\d]+%?)(.*)/si';
$regex_height = '/(.*<svg[^>]* height=")([\d]+%?)(.*)/si';
preg_match($regex_width, $svg_string, $svg_width);
preg_match($regex_height, $svg_string, $svg_height);
$svg_width = (int) $svg_width[2];
$svg_height = (int) $svg_height[2];
if (!$svg_width || !$svg_height) {
return $svg_string;
}
// scale to make width and height big enough
if (!$width) {
$width = round($height * ($svg_width / $svg_height));
} elseif (!$height) {
$height = round($width * ($svg_height / $svg_width));
}
$svg_string = preg_replace($regex_width, "\${1}{$width}\${3}", $svg_string);
$svg_string = preg_replace($regex_height, "\${1}{$height}\${3}", $svg_string);
return $svg_string;
} | [
"function svg_size() { \n echo '<style> \n svg, img[src*=\".svg\"] { \n max-width: 150px !important; \n max-height: 150px !important; \n }\n </style>'; \n}",
"protected function extractSvgImageSizes() {}",
"public function scale($scale, $normalizeFlag){}",
"public function scale( $width, $height );",
"function image_scale($src_abspath, $dest_abspath, $aspect, $width, $strategy)\n{\n $im = new \\Imagick($src_abspath);\n $im = image_scale_im_obj($im, $aspect, $width, $strategy);\n return image_return_write($im, $dest_abspath);\n}",
"function scale($scale) {\r\n\t\t$width = $this->getWidth() * $scale/100;\r\n\t\t$height = $this->getheight() * $scale/100;\r\n\t\t$this->resize($width,$height);\r\n\t}",
"function scale($xScale, $yScale) {}",
"function scale( $width, $height, $direction = ezcImageGeometryFilters::SCALE_BOTH );",
"function scaleExact( $width, $height );",
"function scaleTo($x, $y){}",
"function scale($inFile, $outFile, $width, $height) {\n }",
"private function _pdfImagesScale()\n {\n $scale = PdfController::_ffValue( 'images', 'scale' );\n $this->_tcpdf->setImageScale( $scale );\n }",
"function kalium_fix_svg_size_for_images( $image, $attachment_id = null ) {\n\t\n\tif ( kalium()->helpers->isSVG( $image[0] ) && ! ( $image[1] && $image[2] ) ) {\n\t\t$svg_dimensions = kalium()->helpers->getSVGDimensions( $attachment_id );\n\t\t$image[1] = $svg_dimensions[0];\n\t\t$image[2] = $svg_dimensions[1];\n\t}\n\t\n\treturn $image;\n}",
"function scaleByFactor($size)\r\n {\r\n $new_x = round($size * $this->img_x, 0);\r\n $new_y = round($size * $this->img_y, 0);\r\n return $this->resize($new_x, $new_y);\r\n }",
"protected function executeResizeSvg()\n\t{\n\t\t$doc = new \\DOMDocument();\n\n\t\tif ($this->fileObj->extension == 'svgz')\n\t\t{\n\t\t\t$status = $doc->loadXML(gzdecode($this->fileObj->getContent()), LIBXML_NOERROR);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$status = $doc->loadXML($this->fileObj->getContent(), LIBXML_NOERROR);\n\t\t}\n\n\t\tif ($status !== true)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$svgElement = $doc->documentElement;\n\n\t\t// Set the viewBox attribute from the original dimensions\n\t\tif (!$svgElement->hasAttribute('viewBox'))\n\t\t{\n\t\t\t$origWidth = floatval($svgElement->getAttribute('width'));\n\t\t\t$origHeight = floatval($svgElement->getAttribute('height'));\n\n\t\t\tif ($origWidth && $origHeight)\n\t\t\t{\n\t\t\t\t$svgElement->setAttribute('viewBox', '0 0 ' . $origWidth . ' ' . $origHeight);\n\t\t\t}\n\t\t}\n\n\t\t$coordinates = $this->computeResize();\n\n\t\t$svgElement->setAttribute('x', $coordinates['target_x']);\n\t\t$svgElement->setAttribute('y', $coordinates['target_y']);\n\t\t$svgElement->setAttribute('width', $coordinates['target_width']);\n\t\t$svgElement->setAttribute('height', $coordinates['target_height']);\n\n\t\t$svgWrapElement = $doc->createElementNS('http://www.w3.org/2000/svg', 'svg');\n\t\t$svgWrapElement->setAttribute('version', '1.1');\n\t\t$svgWrapElement->setAttribute('width', $coordinates['width']);\n\t\t$svgWrapElement->setAttribute('height', $coordinates['height']);\n\t\t$svgWrapElement->appendChild($svgElement);\n\n\t\t$doc->appendChild($svgWrapElement);\n\n\t\tif ($this->fileObj->extension == 'svgz')\n\t\t{\n\t\t\t$xml = gzencode($doc->saveXML());\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$xml = $doc->saveXML();\n\t\t}\n\n\t\t$objCacheFile = new \\File($this->getCacheName(), true);\n\t\t$objCacheFile->write($xml);\n\t\t$objCacheFile->close();\n\t}",
"function website_core_fix_svg_size_attributes( $out, $id ) {\r\n\t$image_url = wp_get_attachment_url( $id );\r\n\t$file_ext = pathinfo( $image_url, PATHINFO_EXTENSION );\r\n\r\n\tif ( ! is_admin() || 'svg' !== $file_ext ) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\treturn array( $image_url, null, null, false );\r\n}",
"protected function svg_dimensions( $svg ) {\n\t\t\t$svg = @simplexml_load_file( $svg ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged\n\t\t\t$width = 0;\n\t\t\t$height = 0;\n\t\t\tif ( $svg ) {\n\t\t\t\t$attributes = $svg->attributes();\n\n\t\t\t\tif ( isset( $attributes->viewBox ) ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase\n\t\t\t\t\t$sizes = explode( ' ', $attributes->viewBox ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase\n\t\t\t\t\tif ( isset( $sizes[2], $sizes[3] ) ) {\n\t\t\t\t\t\t$viewbox_width = floatval( $sizes[2] );\n\t\t\t\t\t\t$viewbox_height = floatval( $sizes[3] );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( isset( $attributes->width, $attributes->height ) && is_numeric( (float) $attributes->width ) && is_numeric( (float) $attributes->height ) && ! $this->str_ends_with( (string) $attributes->width, '%' ) && ! $this->str_ends_with( (string) $attributes->height, '%' ) ) {\n\t\t\t\t\t$attr_width = floatval( $attributes->width );\n\t\t\t\t\t$attr_height = floatval( $attributes->height );\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Decide which attributes of the SVG we use first for image tag dimensions.\n\t\t\t\t *\n\t\t\t\t * We default to using the parameters in the viewbox attribute but\n\t\t\t\t * that can be overridden using this filter if you'd prefer to use\n\t\t\t\t * the width and height attributes.\n\t\t\t\t *\n\t\t\t\t * @hook safe_svg_use_width_height_attributes\n\t\t\t\t *\n\t\t\t\t * @param {bool} $false If the width & height attributes should be used first. Default false.\n\t\t\t\t * @param {string} $svg The file path to the SVG.\n\t\t\t\t *\n\t\t\t\t * @return {bool} If we should use the width & height attributes first or not.\n\t\t\t\t */\n\t\t\t\t$use_width_height = (bool) apply_filters( 'safe_svg_use_width_height_attributes', false, $svg );\n\n\t\t\t\tif ( $use_width_height ) {\n\t\t\t\t\tif ( isset( $attr_width, $attr_height ) ) {\n\t\t\t\t\t\t$width = $attr_width;\n\t\t\t\t\t\t$height = $attr_height;\n\t\t\t\t\t} elseif ( isset( $viewbox_width, $viewbox_height ) ) {\n\t\t\t\t\t\t$width = $viewbox_width;\n\t\t\t\t\t\t$height = $viewbox_height;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ( isset( $viewbox_width, $viewbox_height ) ) {\n\t\t\t\t\t\t$width = $viewbox_width;\n\t\t\t\t\t\t$height = $viewbox_height;\n\t\t\t\t\t} elseif ( isset( $attr_width, $attr_height ) ) {\n\t\t\t\t\t\t$width = $attr_width;\n\t\t\t\t\t\t$height = $attr_height;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( ! $width && ! $height ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn array(\n\t\t\t\t'width' => $width,\n\t\t\t\t'height' => $height,\n\t\t\t\t'orientation' => ( $width > $height ) ? 'landscape' : 'portrait',\n\t\t\t);\n\t\t}",
"public function scale($scale = 1) {\n\t\tif(stristr($scale, '%') !== false) {\n\t\t\t$scale = (float) preg_replace('/[^0-9\\.]/', '', $scale);\n\t\t\t$scale = $scale/100;\n\t\t}\n\t\t$scale = (float) $scale;\n\t\t$new_width = ceil($this->width * $scale);\n\t\t$new_height = ceil($this->height * $scale);\n\n\t\t$working_image = imagecreatetruecolor($new_width, $new_height);\n\n\t\tif(imagecopyresampled($working_image, $this->image, 0, 0, 0, 0, $new_width, $new_height, $this->width, $this->height)) {\n\t\t\t$this->image = $working_image;\n\t\t\t$this->width = $new_width;\n\t\t\t$this->height = $new_height;\n\t\t\treturn true;\n\t\t} else {\n\t\t\ttrigger_error('Resize failed.', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\t}",
"function SVGstar ($handle, $args)\n {\n global $SCALE_CONVERSION;\n\n checkHandle ($handle);\n\n $defaults = array (\n 'x' => 0,\n 'y' => 0,\n 'diameter' => 10, // outside\n 'innerDiameter' => 5, // inside (0 for none)\n 'points' => 6,\n 'units' => 'px',\n 'strokeColour' => 'black',\n 'strokeWidth' => 1,\n 'fillColour' => 'none',\n 'rotate' => 0, // rotation in degrees\n 'innerRotate' => 0, // rotation of inner part in degrees (in ADDITION to rotate amount)\n 'opacity' => 100,\n 'extra_attributes' => '',\n 'extra' => '',\n );\n\n $args = array_merge($defaults, array_intersect_key($args, $defaults));\n $opacity= $args ['opacity'] / 100;\n $extra_styles = $args ['extra'];\n $extra_attributes = $args ['extra_attributes'];\n\n $points = $args ['points'];\n\n // can't do less than three points\n if ($points < 3)\n return;\n\n $scale = $SCALE_CONVERSION [$args ['units']];\n if (!$scale)\n return; // can't do it without a scale factor\n\n // fwrite ($handle, \"<g transform=\\\"scale($scale)\\\">\\n\");\n fwrite ($handle, \"<path d=\\\"\");\n $x = $args ['x'];\n $y = $args ['y'];\n $diameter = $args ['diameter'];\n $innerdiameter = $args ['innerDiameter'];\n $action = 'M'; // move to\n $rotate = $args ['rotate'];\n $innerRotate = $args ['innerRotate'];\n $slice = 360 / $points; // how many degrees to progress each time\n $halfSlice = $slice / 2; // direction to inner point\n\n // do the points\n for ($i = 0; $i < $points; $i++)\n {\n $x_coord = cos (deg2rad($i * $slice + $rotate)) * $diameter + $x;\n $y_coord = sin (deg2rad($i * $slice + $rotate)) * $diameter + $y;\n fwrite ($handle, \" $action \" . number_format ($x_coord * $scale, 2, '.', '') . ' ' .\n number_format ($y_coord * $scale, 2, '.', ''));\n $action = 'L'; // line to\n if ($innerdiameter)\n {\n $x_coord = cos (deg2rad($i * $slice + $halfSlice + $rotate + $innerRotate)) * $innerdiameter + $x;\n $y_coord = sin (deg2rad($i * $slice + $halfSlice + $rotate + $innerRotate)) * $innerdiameter + $y;\n fwrite ($handle, \" $action \" . number_format ($x_coord * $scale, 2, '.', '') . ' ' .\n number_format ($y_coord * $scale, 2, '.', ''));\n }\n } // end of for loop\n\n fwrite ($handle, \"Z \\\" \" . // close path\n \"fill=\\\"\" . $args ['fillColour'] . \"\\\" \" .\n \"stroke-width=\\\"\" . $args ['strokeWidth'] * $scale . \"\\\" \" .\n \"stroke=\\\"\" . $args ['strokeColour'] . \"\\\" \" .\n \"opacity=\\\"$opacity\\\" \" .\n \"$extra_attributes \" . // arbitrary extra attributes\n \"style=\\\"$extra_styles\\\"\" . // arbitrary extra styles\n \"/>\\n\");\n// fwrite ($handle, \"</g>\\n\");\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds the Referral model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown. | protected function findModel($id)
{
if (($model = Referral::findOne($id)) !== null) {
return $model;
}
throw new NotFoundHttpException('The requested page does not exist.');
} | [
"protected function findOrFail($key)\n {\n return $this->model->where($this->model->getRouteKeyName(), $key)->firstOrFail();\n }",
"protected function findModel($id)\n {\n if (($model = Certificate::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n\t{\n\t\tif (($model = Budget::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}",
"private function checkForLocalExistence(string $modelKey, int $id): ?Model\n {\n if (! config('harvest.uses_database')) {\n return null;\n }\n\n $modelMethod = '\\\\Byte5\\\\LaravelHarvest\\\\Models\\\\' . Str::ucfirst(Str::camel($modelKey)) . '::whereExternalId';\n return $modelMethod($id)->first();\n }",
"protected function findModel($id) {\n if (($model = RefundPaylist::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n\t{\n\t\tif (($model = WiRequest::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}",
"protected function findModel($id)\n {\n if (($model = RefundApplication::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = RefundSheet::findOne($id)) !== null) { \n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n\t{\n if (($model = MemberDocuments::findOne($id)) !== null) {\n return $model;\n }\n\n\t\tthrow new \\yii\\web\\NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n\t}",
"protected function findModel($id)\n {\n \t$model = RefundSheet::find()->alias(\"refundSheet\")\n \t->joinWith(\"merchant merchant\")\n \t->joinWith(\"order order\")\n \t->joinWith(\"return return\")\n \t->joinWith(\"refundApply refundApply\")\n \t->joinWith(\"user user\")\n \t->joinWith(\"status0 stat\")\n \t->joinWith(\"vip vip\")\n \t->where(['refundSheet.id' => $id])->one();\n \t\n \tif($model){\n// \tif (($model = RefundSheet::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }\n }",
"protected function findModel()\n {\n $id = Yii::$app->request->get('id');\n $id = $id ? $id : Yii::$app->request->post('id');\n if (($model = ShipAddress::findOne($id)) !== null) {\n return $model;\n }\n\n throw new HttpException('The requested page does not exist.');\n }",
"protected function getModelRecordFromRoute()\n {\n //get primary key fields\n $primaryKey = $this->model->getConfig()->primaryKey;\n $where = [[$primaryKey, $this->routeParameters->$primaryKey]];\n $record = $this->model->first($where);\n if(!$record) {\n throw new \\Exception(\"Current route is supposed to retrieve a record but record is not found\", 1);\n }\n return $record;\n }",
"protected function findModel($id)\n {\n if (($model = Referout::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id_riwayat)\n {\n if (($model = Riwayat::findOne($id_riwayat)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n $modelClass = $this->getModel();\n if (($model = $modelClass->findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, Yii::t('app', 'The requested page does not exist.'));\n }\n }",
"protected function findModel($id)\n {\n if (($model = RefBookingSvc::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = Refund::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id) {\r\n\t\t$model = RefundSheetApply::find ()->alias ( \"refundApply\" )->joinWith ( \"vip vip\" )->joinWith ( \"order order\" )->joinWith ( \"status0 stat\" )->where ( [ \r\n\t\t\t\t'refundApply.id' => $id \r\n\t\t] )->one ();\r\n\t\t\r\n\t\tif ($model) {\r\n\t\t\t// if (($model = RefundSheetApply::findOne($id)) !== null) {\r\n\t\t\treturn $model;\r\n\t\t} else {\r\n\t\t\tthrow new NotFoundHttpException ( Yii::t ( 'app', 'The requested page does not exist.' ) );\r\n\t\t}\r\n\t}",
"protected function findModel($id)\n\t{\n if (($model = UserInvites::findOne($id)) !== null) {\n return $model;\n }\n\n\t\tthrow new \\yii\\web\\NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Email client delete folder request. | public static function clientFolderDeleteRequest()
{
return new ClientFolderDeleteRequestBuilder(new ClientFolderDeleteRequest());
} | [
"public function delete()\n\t{\n\t\t$this->folder = \"trash\";\n\t\t$this->save();\n\n\t\t//notify any listening bundles that an email has been moved to the\n\t\t//trash bin\n\t\t$event = new MailEvent($this);\n\t\t$dispatcher = MasterContainer::get(\"event_dispatcher\");\n\t\t$dispatcher->dispatch(MailEvents::onEmailMessageTrash, $event);\n\t}",
"private function _do_delete() {\n\t\tif (g($_POST, 'delete')) {\n\t\t\tif (g($this->conf, 'disable.delete')) die('Forbidden');\n\t\t\t\n $path = g($this->conf, 'path');\n if (g($_POST, 'path'))\n $path = \\Crypt::decrypt(g($_POST, 'path'));\n \n $this->_validPath($path);\n \n\t\t\t$parent = dirname($path);\n\t\t\t\n\t\t\tif ($path == g($this->conf, 'type')) {\n\t\t\t\t$this->_msg('Cannot delete root folder', 'error');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ($this->_delete($this->_path($path))) {\n\t\t\t\t$this->_msg('Success delete ['.$path.']');\n\t\t\t\theader('location:'.$this->_url(['path' => $parent]));\n\t\t\t\tdie();\n\t\t\t} else {\n\t\t\t\t$this->_msg('Failed delete ['.$path.'] : please call your administator', 'error');\n\t\t\t}\n\t\t}\n\t}",
"public function deleteFolder($path) {\n ///\n imap_deletemailbox($this->handler, $this->ref . $this->encode($path));\n ///\n }",
"function delete( $id )\n {\n $info = eZIMAPMailFolder::decodeFolderID( $id );\n $account = new eZMailAccount( $info[\"AccountID\"] ); \n eZIMAPMailFolder::deleteMailBox( $account, $info[\"FolderName\"] );\n }",
"public function delete($folder);",
"function deleteFolders($postData);",
"function Trigger_DeleteFolder(&$tNG) {\n $deleteObj = new tNG_DeleteFolder($tNG);\n $deleteObj->setBaseFolder(\"../../assets/gallery/\");\n $deleteObj->setFolder(\"{ID}\");\n return $deleteObj->Execute();\n}",
"function delete_folder($folder_id){\n\n global $xerte_toolkits_site;\n\n $database_id = database_connect(\"Delete folder database connect success\",\"Delete folder database connect failed\");\n\n $prefix = $xerte_toolkits_site->database_table_prefix;\n \n $query_to_delete_folder = \"delete from {$prefix}folderdetails where folder_id=?\";\n $params = array($folder_id); \n\n //echo $query_to_delete_folder;\n\n $ok = db_query($query_to_delete_folder, $params);\n if($ok !== false) {\n receive_message($_SESSION['toolkits_logon_username'], \"USER\", \"SUCCESS\", \"Folder \" . $folder_id . \" deleted for \" . $_SESSION['toolkits_logon_username'], \"Folder deletion succeeded for \" . $_SESSION['toolkits_logon_username']);\n }else{\n receive_message($_SESSION['toolkits_logon_username'], \"USER\", \"CRITICAL\", \"Folder \" . $folder_id . \" not deleted for \" . $_SESSION['toolkits_logon_username'], \"Folder deletion falied for \" . $_SESSION['toolkits_logon_username']);\n }\n\n}",
"public function deleteFolderConfirm()\n {\n if ( ! $this->checkAccess()) {\n return Cp::unauthorizedAccess();\n }\n\n Cp::$title = __('templates.folder_delete_confirm');\n Cp::$crumb = __('templates.folder_delete_confirm');\n\n if ( ! ($folder = $this->urlFolder(Request::input('folder')))) {\n return false;\n }\n\n // Cannot delete base folder\n if ($folder === '/') {\n return false;\n }\n\n $query = DB::table('templates')\n ->where('folder', $folder)\n ->select('folder')\n ->first();\n\n Cp::$body = Cp::deleteConfirmation(\n [\n 'url' => 'C=templates'.AMP.'M=deleteTemplateFolder',\n 'heading' => 'templates.delete_folder',\n 'message' => 'templates.delete_this_folder',\n 'item' => $query->folder,\n 'extra' => 'templates.all_templates_will_be_nuked',\n 'hidden' => ['folder' => $folder]\n ]\n );\n }",
"public function sent_delete() {\n if(!Auth::LoggedIn()) {\n $this->set('message', 'You must be logged in to access this feature!');\n $this->render('core_error');\n return;\n }\n $mailid = $_GET['mailid'];\n MailData::deletesentmailitem($mailid);\n $this->sent();\n }",
"function delete_folder($id_folder = NULL)\n\t{\n\t\t$this->Kalkun_model->delete_folder($id_folder);\n\t\tredirect('/', 'refresh');\n\t}",
"public function deleteFolderConfirm()\n {\n if ( ! $this->checkAccess()) {\n return Cp::unauthorizedAccess();\n }\n\n Cp::$title = __('kilvin::templates.folder_delete_confirm');\n Cp::$crumb = __('kilvin::templates.folder_delete_confirm');\n\n if ( ! ($folder = $this->urlFolder(Cp::pathVar('folder')))) {\n return false;\n }\n\n // Cannot delete base folder\n if ($folder === '/') {\n return false;\n }\n\n $query = DB::table('templates')\n ->where('folder', $folder)\n ->select('folder')\n ->first();\n\n Cp::$body = Cp::deleteConfirmation(\n [\n 'url' => 'templates/delete-template-folder',\n 'heading' => 'templates.delete_folder',\n 'message' => 'templates.delete_this_folder',\n 'item' => $query->folder,\n 'extra' => 'templates.all_templates_will_be_nuked',\n 'hidden' => ['folder' => $folder]\n ]\n );\n }",
"public static function deleteFolderRequest()\n {\n return new DeleteFolderRequestBuilder(new DeleteFolderRequest());\n }",
"public function getDeleteUrl()\n\t{\n\t\treturn 'index.php?module=Reports&action=Folder&mode=delete&folderid=' . $this->getId();\n\t}",
"public function deleteFolder() {\n\n\t\t$status = 0;\n\n\t\tif ($this['system']->checkToken($this['request']->get('token', 'string')) && $path = $this['path']->path('media:'.$this['request']->get('path', 'string'))) {\n\t\t\tif ($this['path']->path('media:') != $path) {\n\t\t\t\t$status = (int) $this->_deleteFolder($path);\n\t\t\t}\n\t\t}\n\n\t\techo json_encode(compact('status'));\n\t}",
"public function testDeleteFolderDocument()\n {\n $this->client = static::makeclientWithLogin();\n $route = $this->getUrl('api_apiv1_folder_deletefolderdocument');\n $this->client->request('DELETE', $route, [], [], $this->mandatoryHeaders, '{\"folId\":1,\"documentIds\":[2,4]}');\n $response = $this->client->getResponse();\n $this->assertEquals(204, $response->getStatusCode());\n }",
"protected function restNewslettersFoldersDeleteRequest()\n {\n\n $resourcePath = '/rest/newsletters/folders';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function deletedialogAction()\n {\n $this->disableLayout();\n $folderId = $this->getParam('folderId');\n\n if (!isset($folderId)) {\n throw new Zend_Exception('Must pass folderId parameter');\n }\n $folder = $this->Folder->load($folderId);\n if ($folder === false) {\n throw new Zend_Exception('Invalid folderId', 404);\n } elseif (!$this->Folder->policyCheck($folder, $this->userSession->Dao, MIDAS_POLICY_ADMIN)\n ) {\n throw new Zend_Exception('Admin permission required', 403);\n }\n $this->view->folder = $folder;\n $sizes = $this->Folder->getSizeFiltered(array($folder), $this->userSession->Dao);\n $this->view->sizeStr = UtilityComponent::formatSize($sizes[0]->size);\n }",
"public function testDeleteFolderUser()\n {\n $this->client = static::makeclientWithLogin();\n $route = $this->getUrl('api_apiv1_folder_deletefolderuser');\n $this->client->request(\n 'DELETE',\n $route,\n [],\n [],\n $this->mandatoryHeaders,\n '{\"folId\":1,\"userId\":\"MyUsrLogin02\"}'\n );\n $response = $this->client->getResponse();\n $this->assertEquals(204, $response->getStatusCode());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetches the meta information of a post. This method will get the meta information string from a post, matching $key. The meta information of a post is a special value that must be set apart from the regular post information. | function getPostMeta($key, $post) {
$this->cdb
->select('meta_value')
->where('meta_key', $key)
->where('post_id', $post);
$sql = $this->cdb->get('postmeta');
if ($sql->num_rows() > 0) {
$sql = $sql->row();
return $sql->meta_value;
} else {
return FALSE;
}
} | [
"function meta($key) {\n return get_post_meta($post->ID, $key, true);\n}",
"function get_post_meta($post_id, $key, $single = false) {\n\treturn get_metadata('post', $post_id, $key, $single);\n}",
"public function meta($key = null) {\n\t\tif (func_num_args() > 0) {\n\t\t\treturn isset($this->metaData[ $key ]) ? $this->metaData[ $key ] : null;\n\t\t} else {\n\t\t\treturn $this->metaData;\n\t\t}\n\t}",
"protected function get_meta($post_id)\n {\n }",
"function returnMetaValue($post_id, $meta_key){\r\n $conn = new mysqli($this->servername, $this->username, $this->password, $this->dbname);\r\n if ($conn->connect_error) {\r\n die(\"Connection failed: \" . $conn->connect_error);\r\n }\r\n\r\n // Searches for the nonce in the database\r\n $sql = \"SELECT meta_value FROM wp_postmeta WHERE post_id = \".$post_id.\" AND meta_key = '\".$meta_key.\"' LIMIT 1\";\r\n $query = mysqli_query($conn, $sql);\r\n $table = [];\r\n while ($row = $query->fetch_assoc()) {\r\n $table[] = $row;\r\n }\r\n $result = strval($table[0]['meta_value']);\r\n $conn->close();\r\n // Returns the field\r\n return $result;\r\n }",
"protected function build_post_data( $post ) {\n\t\t$meta_data = [];\n\n\t\tforeach ( $this->get_meta_keys() as $meta_key => $meta_info ) {\n\t\t\t$meta_data_for_key = $this->get_meta_value_wrapper( $meta_key, $post->ID );\n\t\t\t$post_type = $post->post_type;\n\n\t\t\t/*\n\t\t\t * If there is no meta_data for the current key, check for default settings\n\t\t\t *\n\t\t\t * For title we need to check if there is a modified SEO-title available and save it.\n\t\t\t * If the SEO title was not modified, we check if the user specified a default SEO title for this content type.\n\t\t\t * Otherwise we use the default title '%%title%% %%sep%% %%sitename%%'.\n\t\t\t *\n\t\t\t * If the meta description was not modified, we check if the user specified a default meta description for this content type.\n\t\t\t */\n\t\t\tif ( $meta_data_for_key === '' ) {\n\t\t\t\tswitch ( $meta_key ) {\n\t\t\t\t\tcase 'title':\n\t\t\t\t\t\t$meta_data_for_key = $this->apply_default_title( $post_type );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'metadesc':\n\t\t\t\t\t\t$meta_data_for_key = $this->get_options_wrapper( 'metadesc-' . $post_type, '' );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Get the name we use as a human readable meta_data label in the results.\n\t\t\t$meta_key_name = $meta_info['name'];\n\t\t\t// Apply json decoder to meta keys that are arrays (e.g., related keywords).\n\t\t\tif ( $meta_info['should_decode'] ) {\n\t\t\t\t$meta_data[ $meta_key_name ] = json_decode( $meta_data_for_key );\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$meta_data[ $meta_key_name ] = $meta_data_for_key;\n\t\t\t\tif ( $meta_info['should_replace_vars'] ) {\n\t\t\t\t\t$meta_data[ $meta_key_name ] = $this->process_replacevars( $meta_data_for_key, $post );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn [\n\t\t\t'ID' => $post->ID,\n\t\t\t'post_content' => $this->process_shortcodes( $post ),\n\t\t\t'meta' => $meta_data,\n\t\t];\n\t}",
"public function getMeta($key = '', $single = true) {\n return self::getCommentMeta($this->getId(), $key, $single);\n }",
"public function get_meta($key){\n $res = $this->user_metas()->select('value')->where('key',$key)->first();\n if($res) return $res->value;\n else return null;\n }",
"function avia_post_meta($post_id = '', $subkey = false)\n\t{\n\t\t$avia_post_id = $post_id;\n\n\t\t//if the user only passed a string and no id the string will be used as subkey\n\t\tif(!$subkey && $avia_post_id != \"\" && !is_numeric($avia_post_id) && !is_object($avia_post_id))\n\t\t{\n\t\t\t$subkey = $avia_post_id;\n\t\t\t$avia_post_id = \"\";\n\t\t}\n\n\t\tglobal $avia, $avia_config;\n\t\t$key = '_avia_elements_'.$avia->option_prefix;\n\t\tif(current_theme_supports( 'avia_post_meta_compat' ))\n\t\t{\n\t\t\t$key = '_avia_elements_theme_compatibility_mode'; //actiavates a compatibility mode for easier theme switching and keeping post options\n\t\t}\n\t\t$values = \"\";\n\n\t\t//if post id is on object the function was called via hook. If thats the case reset the meta array\n\t\tif(is_object($avia_post_id) && isset($avia_post_id->ID))\n\t\t{\n\t\t\t$avia_post_id = $avia_post_id->ID;\n\t\t}\n\n\n\t\tif(!$avia_post_id)\n\t\t{\n\t\t\t$avia_post_id = @get_the_ID();\n\t\t}\n\n\t\tif(!is_numeric($avia_post_id)) return;\n\n\n\t\t$avia_config['meta'] = avia_deep_decode(get_post_meta($avia_post_id, $key, true));\n\t\t$avia_config['meta'] = apply_filters('avia_post_meta_filter', $avia_config['meta'], $avia_post_id);\n\n\t\tif($subkey && isset($avia_config['meta'][$subkey]))\n\t\t{\n\t\t\t$meta = $avia_config['meta'][$subkey];\n\t\t}\n\t\telse if($subkey)\n\t\t{\n\t\t\t$meta = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$meta = $avia_config['meta'];\n\t\t}\n\n\t\treturn $meta;\n\t}",
"public function texturized_meta($post_id = null, $key) {\n\t\t$post_id = $this->post_id_for_sure($post_id);\n\t\t$text = trim(get_post_meta($post_id, $key, true));\n\t\treturn wptexturize($text);\n\t}",
"protected static function setup_meta($post)\n {\n self::$meta = get_post_custom($post->ID);\n }",
"public function getMetaInformation($key)\n\t{\n\t\tif (!is_array($this->meta))\n\t\t{\n\t\t\t$this->meta = array();\n\t\t\t$xml = simplexml_load_file($this->path.'language.xml');\n\t\t\tforeach ($xml->children() as $node)\n\t\t\t\t$this->meta[$node->getName()] = (string)$node;\n\t\t}\n\n\t\treturn isset($this->meta[$key]) ? $this->meta[$key] : null;\n\t}",
"public function getMetaInformation($key)\n {\n if (!is_array($this->meta)) {\n $this->meta = array();\n $xml = @simplexml_load_file($this->path.'language.xml');\n if ($xml) {\n foreach ($xml->children() as $node) {\n $this->meta[$node->getName()] = (string)$node;\n }\n }\n }\n\n return isset($this->meta[$key]) ? $this->meta[$key] : null;\n }",
"private function _getPostMeta( $PostGUID ) {\n if ( mb_strlen(NoNull($PostGUID)) != 36 ) { return false; }\n\n $ReplStr = array( '[ACCOUNT_ID]' => nullInt($this->settings['_account_id']),\n '[POST_GUID]' => sqlScrub($PostGUID),\n );\n $sqlStr = readResource(SQL_DIR . '/posts/getPostMeta.sql', $ReplStr);\n $rslt = doSQLQuery($sqlStr);\n if ( is_array($rslt) ) {\n $data = array();\n foreach ( $rslt as $Row ) {\n if ( YNBool($Row['is_visible']) ) {\n $block = explode('_', $Row['key']);\n if ( is_array($data[$block[0]]) === false ) {\n $data[$block[0]] = $this->_getPostMetaArray($block[0]);\n }\n $data[$block[0]][$block[1]] = (is_numeric($Row['value']) ? nullInt($Row['value']) : NoNull($Row['value']));\n }\n }\n\n // If there's a Geo Array, Check if a StaticMap can be Provided\n if ( array_key_exists('geo', $data) ) {\n if ( $data['geo']['longitude'] !== false && $data['geo']['latitude'] !== false ) {\n $data['geo']['staticmap'] = NoNull($this->settings['HomeURL']) . '/api/geocode/staticmap/' . round($data['geo']['latitude'], 5) . '/' . round($data['geo']['longitude'], 5);\n }\n }\n\n // If there's an Episode Array, Ensure the File value is prefixed with the CDN\n if ( array_key_exists('episode', $data) ) {\n $file = NoNull($data['episode']['file']);\n $ext = getFileExtension($file);\n $data['episode']['mime'] = getMimeFromExtension($ext);\n\n if ( $file != '' && strpos($file, '//') === false ) {\n $cdnUrl = getCdnUrl();\n $data['episode']['file'] = $cdnUrl . $file;\n }\n }\n\n // If we have data, return it.\n if ( count($data) > 0 ) { return $data; }\n }\n\n // If We're Here, There's No Meta\n return false;\n }",
"function setPostMeta($post) {\n $title = !empty($post['Post']['seo_title']) ? $post['Post']['seo_title'] : $post['Post']['name'];\n $title = htmlentities($title);\n \n $desc = !empty($post['Post']['seo_desc']) ? $post['Post']['seo_desc'] : $post['Post']['dek'];\n if (empty($desc))\n $desc = substr( trim(strip_tags($post['Post']['post'])), 0, 150);\n \n $desc = htmlentities($desc);\n \n $tags = Hash::extract( $post['PostTag'], '{n}.name');;\n \n $keywords = implode( ', ', (array)$tags );\n return ( array('title' => $title, 'desc' => $desc, 'keywords' => $keywords ));\n }",
"function jh_post_meta(){\n global $post;\n return jh_get_post_meta($post->ID);\n}",
"public function get_widget_post_meta( $post_id, $widget_id, $meta_key ) {\n\t\t$widget_post_meta = get_post_meta( $post_id, self::POST_META_KEY, true );\n\t\tif( empty( $widget_post_meta ) ) return '';\n\t\t$widget_post_meta_field = $widget_id . '_' . $meta_key;\n\t\tif( ! isset( $widget_post_meta[$widget_post_meta_field] ) ) return '';\n\t\treturn $widget_post_meta[$widget_post_meta_field];\n\t}",
"private function get_meta_value( $key ) {\n\t\t$meta = array();\n\t\t$meta_value = '';\n\t\t$requested_page = get_queried_object();\n\n\t\tif ( empty( $requested_page ) ) {\n\t\t\treturn $meta_value;\n\t\t}\n\n\t\t// TODO Use $meta_opts when get_current_options() is refactored - #2729.\n\t\tif ( property_exists( $requested_page, 'ID' ) ) {\n\t\t\t$meta = get_post_meta( $requested_page->ID );\n\t\t}\n\n\t\tif ( property_exists( $requested_page, 'term_id' ) ) {\n\t\t\t$meta = get_term_meta( $requested_page->term_id );\n\t\t}\n\n\t\tif ( $this->is_woocommerce_shop_page() ) {\n\t\t\t$meta = get_post_meta( wc_get_page_id( 'shop' ) );\n\t\t}\n\n\t\tif ( is_array( $meta ) && array_key_exists( '_aioseop_' . $key, $meta ) ) {\n\t\t\t$meta_value = $meta[ '_aioseop_' . $key ][0];\n\t\t}\n\n\t\treturn $meta_value;\n\t}",
"public function get_option_value($key){\n global $post;\n \n if(is_admin() && isset($_REQUEST['post']))\n { $post_id = $_REQUEST['post']; } \n else \n { $post_id = $post->ID;}\n \n return get_post_meta($post_id, $key, true);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.