query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Alternative function to power Blue LEDs on the strip. One parameter, power. Anything between 01. Default is 1. | public function setBlue($power = 1){
file_put_contents("/dev/pi-blaster", "{$this->GPIOBlue}=$power\n");
} | [
"public function setGreen($power = 1){\n file_put_contents(\"/dev/pi-blaster\", \"{$this->GPIOGreen}=$power\\n\");\n }",
"public function PowerOn()\n\t\t{\n\t\t\t$LW12 = $this->init();\n\t\t\t$LW12->PowerOn();\n\n\t\t\tSetValue($this->GetIDForIdent(\"power\"), $LW12->power);\n\t\t}",
"public function setColor($color,$power){\n\n try{\n if(is_float($power) || is_int($power)){\n // ok, good\n }\n else{\n throw new Exception(\"Amount of power was not int or float! Exiting.\", 1);\n return false;\n }\n }\n\n catch(Exception $e){\n echo \"Exception: \".$e->getMessage().\"\\n\";\n exit;\n }\n\n\n if($color == \"red\"){\n file_put_contents(\"/dev/pi-blaster\", \"{$this->GPIORed}=$power\\n\");\n }\n\n if($color == \"green\"){\n file_put_contents(\"/dev/pi-blaster\", \"{$this->GPIOGreen}=$power\\n\");\n }\n\n if($color == \"blue\"){\n file_put_contents(\"/dev/pi-blaster\", \"{$this->GPIOBlue}=$power\\n\");\n }\n }",
"public function setPower($power)\n {\n $this->power = $power;\n }",
"public function set_power()\n {\n $this->battery_power = 100;\n }",
"function eis_device_poweron() {\n\tglobal $eis_conf,$eis_dev_conf,$eis_dev_status,$eis_mysqli;\n\t// set the powers to their defaults\n\tif ($eis_dev_status[\"fullpower\"]) $powerlevel=1; else $powerlevel=0.5; \n\tfor ($p=1; $p<4;$p++)\n\t\tif ($p==$eis_dev_status[\"connected\"]) \n\t\t\t$eis_dev_status[\"cpower\".$p] = $eis_dev_conf[\"cpower\".$p]*$powerlevel;\n\treturn true;\n}",
"Public function SetPower($status){\n \n //prüfen ob Schaltsteckdose vorhanden\n// if($this->ReadPropertyInteger(\"PowerSwitch_ID\")!= 0) {\n if ($status == \"On\"){\n FS20_SwitchMode($this->ReadPropertyInteger(\"PowerSwitch_ID\"), true); //Gerät einschalten\n $this->SetTimerInterval(\"update\", $this->ReadPropertyInteger(\"updateInterval\"));\n }\n if ($status == \"Off\"){\n FS20_SwitchMode($this->ReadPropertyInteger(\"PowerSwitch_ID\"), false); //Gerät einschalten\n }\n// }\n return $status;\t\n }",
"function eis_device_poweroff() {\n\tglobal $eis_conf,$eis_dev_conf,$eis_dev_status,$eis_mysqli;\n\t// set the powers to zero\n\tfor ($p=1; $p<4;$p++) $eis_dev_status[\"cpower\".$p] = 0;\n\treturn true;\n}",
"function pvRebel_setPower($address,$fnPower) {\n\t\t$powerTo = 'F';\n\t\tif ($fnPower)\n\t\t\t$powerTo = 'O';\n\t\tpvRebel_SEND_CMD($address,'P'.$powerTo);\n\t}",
"function toggleBinaryGroup($group, $powerLevel=255)\n {\n\n for($i=0;$i<count($this->devices);$i++)\n {\n\n if($this->devices[$i]['group']==$group && $this->devices[$i]['type']=='Binary Power Switch')\n {\n $msg=\"DEVICE~\" . $this->devices[$i]['node'] . \"~\" . $powerLevel . \"~Binary Switch\";\n\n $this->sendReceiveMessage($msg);\n\n sleep(1);\n }\n\n }\n }",
"function get_powerbar_color($power, $img){\r\n\tif($power >= 60 && $power < 80){\r\n\t\t$c = imagecolorallocate($img, 0, 0, 249);\r\n\t}\r\n\telseif($power >= 40 && $power < 60){\r\n\t\t$c = imagecolorallocate($img, 255, 255, 0);\r\n\t}\r\n\telseif($power >= 20 && $power < 40){\r\n\t\t$c = imagecolorallocate($img, 255, 164, 0);\r\n\t}\r\n\telseif($power >= 0 && $power < 20){\r\n\t\t$c = imagecolorallocate($img, 252, 3, 0);\r\n\t}\r\n\telse{\r\n\t\t$c = imagecolorallocate($img, 1, 128, 1);\r\n\t}\r\n\t\r\n\treturn $c;\r\n}",
"private function setPower(float $power)\n {\n $this->power = $power;\n\n return $this;\n }",
"function eis_device_poweroff() {\n\tglobal $eis_conf,$eis_dev_conf,$eis_dev_status,$eis_mysqli;\n\t$eis_dev_status[\"glinestatus\"]=\"disconnected\"; \n\tfor ($p=1; $p<4;$p++) $eis_dev_status[\"gpower\".$p] = 0;\n\treturn true;\n}",
"Public function SetPower($state){\n\t\t$host = $this->ReadPropertyString('IPAddress');\n\t\t$url = \"http://$host:80/goform/formiPhoneAppPower.xml\";\n\t\tif ($state == true){\n $this->SendDebug('SetPower', 'Power: '.'einschalten', 0);\n\t\t\t$cmd = '1+PowerOn';\n\t\t\t$power=true;\n\t\t}\n\t\tif ($state == false){\n\t\t\t$cmd = '1+PowerStandby';\n\t\t\t$power=false;\n\t\t}\n\t\t$xml = $this->curl_get($url, $cmd);\n //$this->SendDebug('SetPower:XMLcreateArray_IN: ', $xml, 0);\n\t\t//$output = XML2Array::createArray($xml);\n $output = json_decode(json_encode((array)simplexml_load_string($xml)),true);\n //$this->SendDebug('SetPower:XMLcreateArray_IN: ', $output, 0);\n \t\t//$status = ($output['item']['Power']['value']);\n $status = ($output['Power']['value']);\n $this->SetValue(\"CeolPower\", $power);\n\t\treturn $status;\t\n\t}",
"public function ledsOff()\n {\n $payload = '';\n\n $this->sendRequest(self::FUNCTION_LEDS_OFF, $payload);\n }",
"function wc_hex_lighter($color, $factor = 30)\n {\n }",
"private function activateLED() {\n echo 'LED: on'.\"</br>\";\n }",
"private function setPower($on = true)\n\t{\n\t\t$xml = $this->baseXml('setup');\n\n\t\t$cmd = $xml->getElementsByTagName('CMD')->item(0);\n\n\t\t$power = $xml->createElement('Device.System.Power.State');\n\t\t$power->textContent = $on ? 'ON' : 'OFF';\n\t\t$cmd->appendChild($power);\n\n\t\t$xml = $this->send($xml);\n\t\t$this->checkSetupResponse($xml);\n\t}",
"public function getPower() {\r\n // TODO\r\n return 1;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get All orders IDs for a given product ID. | function get_order_item_ids_by_product_id( $product_id, $order_status = array( 'wc-completed', 'wc-processing', 'wc-on-hold' ) ){
global $wpdb;
$results = $wpdb->get_col("
SELECT order_items.order_item_id
FROM {$wpdb->prefix}woocommerce_order_items as order_items
LEFT JOIN {$wpdb->prefix}woocommerce_order_itemmeta as order_item_meta ON order_items.order_item_id = order_item_meta.order_item_id
LEFT JOIN {$wpdb->posts} AS posts ON order_items.order_id = posts.ID
WHERE posts.post_type = 'shop_order'
AND posts.post_status IN ( '" . implode( "','", $order_status ) . "' )
AND order_items.order_item_type = 'line_item'
AND order_item_meta.meta_key = '_product_id'
AND order_item_meta.meta_value = '$product_id'
");
return $results;
} | [
"protected function getOrderIds($productId) {\r\n //todo : do not use sql direct !!!\r\n $prefix = Mage::getConfig()->getTablePrefix();\r\n $sql = 'select distinct order_id from ' . $prefix . 'sales_flat_order_item where product_id = ' . $productId;\r\n $orderIds = mage::getResourceModel('catalog/product')->getReadConnection()->fetchCol($sql);\r\n return $orderIds;\r\n }",
"public function getOrderProductIds($order_id)\r\n {\r\n $select = $this->select()->from($this->info('name'), array('product_id'))->where('order_id =?', $order_id);\r\n return $select->query()->fetchAll();\r\n }",
"public function getOrderIds() {\n\t\tif (!Mage::registry('current_product')) {\n\t\t\treturn;\n\t\t}\n\t\t$product_id = Mage::registry('current_product')->getId();\n\t\t$orderItems = Mage::getResourceModel('sales/order_item_collection')\n\t\t\t\t\t->addFieldToFilter('product_id', $product_id)\n\t\t\t\t\t->toArray(array('order_id'))\n\t\t\t\t\t;\n\t\t$orderIds = array_unique(array_map(\n\t\t\tfunction($orderItem) {\n\t\t\t\treturn $orderItem['order_id'];\n\t\t\t},\n\t\t\t$orderItems['items']\n\t\t));\n\t\treturn $orderItems;\n\t}",
"public function getAllOrderIds()\n {\n $sql = \"SELECT DISTINCT order_id FROM isad251_stong.tearoom_table_order ORDER BY tearoom_table_order.order_id ASC;\";\n\n $result = $this->executeStatement($sql);\n $allOrders = [];\n\n if($result)\n {\n foreach ($result as $row)\n {\n $order = $row['order_id'];\n $allOrders[] = $order;\n }\n }\n\n return $allOrders;\n\n }",
"public function getProductIds()\n {\n $product_ids = array();\n $sql = \"\n SELECT id_product\n\t\t\tFROM \"._DB_PREFIX_.\"product\n WHERE active = 1 AND available_for_order = 1\n LIMIT \".$this->limit.\n \" OFFSET \".$this->offset ;\n\n $rows = Db::getInstance()->executeS($sql);\n foreach ($rows as $row) {\n $product_ids[] = (int)$row['id_product'];\n }\n return $product_ids;\n }",
"private function _getOrderProducts($order_id) {\n\t\t$sql = \"SELECT * FROM \" . DB_PREFIX . \"order_product\n\t\t\t\tWHERE order_id = \" . (int)$order_id;\n\n\t\t$res = $this->db->query($sql);\n\n\t\treturn $res->rows;\n\t}",
"protected function getProductIds()\n\t{\n\t\treturn [];\n\t}",
"private function get_product_ids() {\n\t\t\treturn \\WC_Facebookcommerce_Utils::get_all_product_ids_for_sync();\n\t\t}",
"private function getOrderIds()\n {\n $query = new \\DbQuery();\n\n $query->select('id_order');\n $query->from('revers_io_orders_url');\n\n return Db::getInstance()->executeS($query);\n }",
"public function ordered_products($order_id)\n {\n\n $order = $this->find($order_id);\n\n return $order->product;\n\n }",
"public function getOrderIDs()\n {\n return $this->orderIDs;\n }",
"public function getOrderProducts(): array\n {\n $order_products = [];\n\n foreach ($this->shopping_cart as $order_product) {\n $order_products[] = [\n \"product_id\" => $order_product['store_product']->product->id,\n \"supplier_id\" => $order_product['supplier_id'],\n \"quantity\" => $order_product['quantity'],\n ];\n }\n\n return $order_products;\n }",
"public function getCartProductIds()\n {\n $ids = $this->_coreRegistry->registry('_cart_product_ids');\n if ($ids === null) {\n $ids = [];\n foreach ($this->_checkoutSession->getQuote()->getAllItems() as $item) {\n $product = $item->getProduct();\n if ($product) {\n $ids[] = $product->getId();\n }\n }\n $this->_coreRegistry->register('_cart_product_ids', $ids);\n }\n return $ids;\n }",
"public static function getItemsbyProductID($product_id) {\r\n\t\t$data = array ();\r\n\t\t$upgrades = Doctrine_Query::create ()\r\n \t ->select ()\r\n \t ->from ( 'ProductsUpgrades pu' )\r\n ->leftJoin ( 'pu.Products p' )\r\n \t\t\t\t\t\t ->where ( 'pu.product_id = ?', $product_id )\r\n ->addWhere( \"p.isp_id = ?\", Isp::getCurrentId() )\r\n\t\t\t\t\t\t ->execute ( array (), Doctrine_Core::HYDRATE_ARRAY );\r\n\t\t\r\n\t\tif (! empty ( $upgrades )) {\r\n\t\t\tforeach ( $upgrades as $item ) {\r\n\t\t\t\t$data [] = $item ['upgrade_product_id'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $data;\r\n\t}",
"protected function getProductIds()\n\t{\t\n\t\t$arrIds = array();\n\t\t\t\t\n\t\tif (!strlen($this->Input->get('id')))\n\t\t{\n\t\t\t$arrIds = is_array($_SESSION['BE_DATA']['CURRENT']['IDS']) ? $_SESSION['BE_DATA']['CURRENT']['IDS'] : array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arrIds[] = $this->Input->get('id');\n\t\t}\n\t\t\n\t\treturn $arrIds;\n\t}",
"public function getProductIds()\n {\n $ids = array();\n foreach ($this->getMode() as $mode) {\n $method = 'get' . ucfirst($mode) . 'Ids';\n if (!method_exists($this, $method)) {\n continue;\n }\n // @TODO make mode much more flexibe (create logic rules):\n // current|compared|viewed,cart - use current|if none was found - use compared|and so on...\n // compared:cart|cart|viewed - items from cart that where compared recently|cart (if none was found)| viewed (if none was found)\n // compared,cart|viewed - items from cart and compared items|viewed if none was found\n\n // @TODO collect ids by groups and then slice each group proportionally\n $ids = array_merge($ids, $this->{$method}());\n }\n $ids = array_unique($ids);\n\n if (!count($ids)) {\n return null;\n }\n\n if (($limit = $this->getLimit()) && (count($ids) > $limit)) {\n $ids = array_slice($ids, -$limit);\n }\n return $ids;\n }",
"protected function getProductsOfId($id){\n\n $sql = \"SELECT * FROM products WHERE id IN (\" . implode(',', array_map('intval', $id)) . ')';\n $stmt = $this->connect()->prepare($sql); \n $stmt->execute($id);\n $results = $stmt->fetchAll();\n return $results;\n }",
"protected function _getCartProductIds()\n {\n $ids = $this->getData('_cart_product_ids');\n if ($ids === null) {\n $ids = [];\n foreach ($this->getQuote()->getAllItems() as $item) {\n $product = $item->getProduct();\n if ($product) {\n $ids[] = $product->getId();\n }\n }\n $this->setData('_cart_product_ids', $ids);\n }\n return $ids;\n }",
"public function getOrdersProducts()\n {\n return $this->hasMany(OrderProduct::class, ['order_id' => 'id']);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a hierarchy item | public function add_item($data, $table, $is_ordered)
{
// Make sure the parent_id is set
if ( ! array_key_exists('parent_id', $data) )
{
return FALSE;
}
// See if this parent item exists in the given table
$parent = $this->item_exists($data['parent_id']);
// If a non-NULL parent_id was set, make sure it refers to a valid item
if ( ! $parent AND $data['parent_id'] != NULL)
{
return FALSE;
}
$this->db->trans_start();
// If we want to set an order
if ($is_ordered)
{
$data['hierarchy_order'] = $this->highest_order($data['parent_id'], $table) + 1;
}
// Insert item into hierarchy table
$this->db->insert('hierarchy', array('parent_id' => $data['parent_id']));
// Get insert ID
$insert_id = $this->db->insert_id();
// Update extra data array
foreach ($this->config->item('hierarchy_' . $table) as $extra_row)
{
$extra_data[$extra_row] = $data[$extra_row];
}
// Add hierarchy ID to extra data array
$extra_data['hierarchy_id'] = $insert_id;
// Add extra data into linked table
$this->db->insert($table, $extra_data);
// If a parent ID was provided
if ($data['parent_id'])
{
$parent['lineage'][] = $insert_id;
$update_data = array(
'lineage' => implode('-', $parent['lineage']),
'deep' => $parent['deep'] + 1
);
$this->db
->where('hierarchy_id', $insert_id)
->update('hierarchy', $update_data);
}
// If no parent ID was provided
else
{
// We just need to update the lineage
$update_data = array(
'lineage' => $insert_id
);
$this->db
->where('hierarchy_id', $insert_id)
->update('hierarchy', $update_data);
}
$this->db->trans_complete();
return $this->db->trans_status();
} | [
"function add_child($item)\n {\n \tif($this->debug>0){error_log('New LP - In learnpathItem::add_child()',0);}\n \tif(!empty($item))\n \t{\n \t\t//do not check in DB as we expect the call to come from the learnpath class which should\n \t\t//be aware of any fake\n \t\t$this->children[] = $item;\n \t}\n }",
"public function addChild($item) {\n\t\t$this->children[] = $item;\n\t}",
"public function addItemChild($itemName,$childName);",
"public abstract function addItem();",
"public function addbranch($item) {\n\t\t$objitem = new ttree();\n\t\t$objitem->data = $item;\n\t\t$objitem->parent = &$this;\n\t\tarray_push($this->branchs,$objitem);\n\t}",
"public function addItem($item);",
"public function add_item($item);",
"public function add(ChainableItemInterface $item): void;",
"public function addItemAndParents ($item) {\n // If this is a record from the database, meaning it's already indexed,\n // we do the construction here\n if (is_array ($item)) {\n if (in_array($item['id'], self::$otherUsersMyCollections)) return;\n $itemId = $item['id'];\n // build new search result, linking it to this term\n if (!array_key_exists($itemId, $this->objects)) {\n $itemObject = $this->objects[$itemId] = HCSearchResult::factory($itemId);\n } else {\n $itemObject = &$this->objects[$itemId];\n }\n //$itemObject->addHit ($itemObject, $item['weight']);\n if ((HCCollection::isCollectionRoot($itemId))) return;\n // get parent from database\n $query = \"SELECT object_id FROM object_relations WHERE subject_id =\"\n\t\t .\" $itemId AND object_id NOT IN (\"\n\t\t .implode(', ', self::$otherUsersMyCollections).\")\";\n //print \"Getting parents of item $itemId\";\n $db = database::getInstance();\n $db->query($query);\n $result = $db->getRows();\n // add each parent as parent of the assigned object\n foreach ($result as $row) {\n // If it's not a root collection, add it as a parent.\n //if ((!HCCollection::isCollectionRoot($row['object_id'])) && (!in_array($row['object_id'], self::$otherUsersMyCollections))) {\n if ($row['object_id'] != 0) {\n $this->addItemAndParents($row['object_id']);\n $this->objects[$row['object_id']]->addChild($itemObject);\n }\n } // end foreach ($result as $row)\n } else { /* TODO: The following will probably never be used, so delete it. */\n if (in_array($item, self::$otherUsersMyCollections)) return;\n if (!array_key_exists($item, $this->objects)) {\n $newItem = HCSearchResult::factory($item);\n if ($newItem != NULL)\n $itemObject = $this->objects[$item] = $newItem;\n else return;\n //$itemObject = $this->objects[$item] = HCSearchResult::factory($item);\n } else {\n $itemObject = &$this->objects[$item];\n }\n // If it's a root collection, return\n //if ((HCCollection::isCollectionRoot($item)) || (in_array($item, self::$otherUsersMyCollections))) return;\n if ((HCCollection::isCollectionRoot($item))) return;\n // get parent from database\n $query = \"SELECT object_id FROM object_relations WHERE subject_id =\"\n\t\t .\" $item AND object_id NOT IN (\"\n\t\t .implode(', ', self::$otherUsersMyCollections).\")\";\n //print $query;\n $db = database::getInstance();\n $db->query($query);\n $result = $db->getRows();\n //$result = $db->getRows();\n // add each parent as parent of the assigned object\n //print_r ($result);\n foreach ($result as $row) {\n // If it's not a root collection, add it as a parent.\n //print \"Can we add collection $row[object_id] as parent of $item ? \\n\";\n //if ((!HCCollection::isCollectionRoot($row['object_id'])) && (!in_array($row['object_id'], self::$otherUsersMyCollections))) {\n if ($row['object_id'] != 0) {\n $this->addItemAndParents($row['object_id']);\n $this->objects[$row['object_id']]->addChild($itemObject);\n }\n } // end foreach ($result as $row)\n }\n }",
"function add_child(&$item) {\n // Check if we're trying to add table cell to current table directly, without any table-rows\n if (is_a($item, \"TableCellBoxPDF\")) {\n // Add cell to the last row\n $last_row =& $this->content[count($this->content)-1];\n $last_row->add_child($item);\n\n } elseif (is_a($item, \"TableRowBoxPDF\")) {\n // If previous row is empty, remove it (get rid of automatically generated table row in constructor)\n if (count($this->content[count($this->content)-1]->content) == 0) {\n array_pop($this->content);\n }\n\n // Just add passed row \n $this->content[] =& $item;\n\n } elseif (is_a($item, \"TableSectionBoxPDF\")) {\n // Add table section rows to current table, then drop section box\n for ($i=0; $i < count($item->content); $i++) {\n $this->add_child($item->content[$i]);\n }\n };\n }",
"function testAddToHierarchy2()\n {\n $plugin = new plugin_Base(array('name' => 'head'));\n $head_node = new plugin_Node($plugin);\n\n $plugin = new plugin_Base(array('name' => 'a', 'depends' => array('head')));\n $node_a = new plugin_Node($plugin);\n\n $plugin = new plugin_Base(array('name' => 'b', 'depends' => array('a')));\n $node_b = new plugin_Node($plugin);\n \n $head_node->addChild($node_a);\n $head_node->addChild($node_b);\n $this->assertEquals(1, $head_node->size());\n $this->assertEquals(1, $head_node->children[0]->size());\n $this->assertEquals('a', $head_node->children[0]->plugin->name);\n }",
"public function addItem($node) {\n\t\t$this->items[$node->getName()] = $node;\n }",
"private function addProductsToParent($item) {\n $subproducts = $this->productData->getSubproducts([$item->id], 0, 10, FALSE, TRUE);\n if (count($subproducts['items'])) {\n if (!isset($item->below)) {\n $item->below = $subproducts['items'];\n }\n else {\n $item->below = array_merge($item->below, $subproducts['items']);\n }\n }\n return $item;\n }",
"private function addProductsToParent($item) {\n $subproducts = $this->productData->getSubproducts([$item->id], 0, 10, FALSE, FALSE, TRUE);\n if (count($subproducts['rows'])) {\n if (!isset($item->below)) {\n $item->below = $subproducts['rows'];\n }\n else {\n $item->below = array_merge($item->below, $subproducts['rows']);\n }\n }\n return $item;\n }",
"protected function addRootItem()\n\t{\n\t\t$insert_data = array(\n\t\t\t'parent_id' => self::$DB_NULL\n\t\t);\n\t\t$this->db_insert($this->_table, $insert_data);\n\t}",
"public function addChild(MenuItem $item): void\n {\n if (!$this->hasChildren) {\n $this->addClass('menu-item-has-children');\n $this->hasChildren = true;\n }\n $this->children[] = $item;\n $item->level = $this->level + 1;\n if (count($this->children)) {\n $this->updateChildLevels();\n }\n }",
"public function addChildItem(BasketItem $item)\n {\n // add child item price\n $priceData = $this->getPrice()->toArray();\n $priceData['real_price'] += $item->getPrice()->getPrice();\n $this->price = new Price($priceData);\n\n $this->children[] = $item;\n }",
"public function add(mixed $item): void;",
"function treeAdditem($componentName, $rowIndex, $record, $doIndent) // Adds after the passed row index\n {\n $rows = &$this->data[$componentName]['rows'];\n\n $currentIndent = $rows[$rowIndex]['indent'];\n\n // Find last element at same level (if adding sub-item)\n while ($rowIndex < count($rows) && $rows[$rowIndex+1]['indent'] == $currentIndent+1)\n ++$rowIndex;\n\n array_splice($rows, $rowIndex+1, 0, array($record));\n\n for ($i=count($rows)-1; $i>$rowIndex+1; --$i)\n ++$rows[$i]['lineno'];\n\n $rows[$rowIndex+1]['lineno'] = $rowIndex+1;\n\n $rows[$rowIndex+1]['indent'] = $currentIndent + ($doIndent ? 1 : 0);\n\n $this->_treeCalculateFullTitles($rows, $this->_spec[$componentName]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Logout from the current session. Varbase Context varbase. Example: When I logout. | public function iLogout() {
// Logout if I am logged in.
if ($this->loggedIn()) {
$this->logout();
}
} | [
"public function doLogout()\n {\n $this->logsRepository->trackAction(\n $this->getCurrentUsername(),\n 'logout'\n );\n /*\n * se c'è logout nella superglobal $_GET cancello l'username dalla sessione\n */\n $_SESSION[\"username\"] = null;\n }",
"public function logout(){\n $this->auth = false;\n $this->cfg = [];\n $this->close_session();\n }",
"public function DoLogout()\n {\n// $this->DeleteRememberMeCookie();\n $this->sec_session_start();\n $this->SessionDestroy();\n }",
"function logout()\n\t{\n\t\t$logoutRequest = new LogoutRequest();\n\t\t$this->ns->logout($logoutRequest);\n\t}",
"public function logout()\n {\n $query = $this->request([\n 'action' => 'query',\n 'meta' => 'tokens',\n 'type' => 'csrf',\n ]);\n $this->request([\n 'action' => 'logout',\n 'token' => $query['query']['tokens']['csrftoken'],\n ]);\n $this->httpClient->clearCookies(); // Clear HTTP client cookies\n $this->session->cookies = null; // Clear session cookies\n $this->userInfo = null; // Reset MediaWiki user information\n $this->userInfo = $this->queryUserInfo();\n }",
"private function logout() {\n }",
"function dologout()\r\n {\r\n //get login object\r\n $userlogin = getUserLogin();\r\n //logout\r\n $userlogin->logout();\r\n $this->latesession->set('USERLOGIN', $userlogin);\r\n //redirect\r\n redirect('');\r\n\r\n }",
"public function logout()\n {\n global $session, $www;\n if ($session->user) {\n $session->logoutUser($session->user);\n $session->resetSession();\n $session->notice = 'You have been logged out.';\n }\n $this->view->activePage = 'logout';\n $this->view->setView('index', 'default');\n //echo header(\"Location: ${www['base']}\");\n //exit();\n }",
"public function Account_logout() {\n session_start();\n session_unset();\n session_destroy();\n }",
"public function logout(){\n\t\tglobal $con;\n\t\t\n\t\t// If the session was persisted through cookies,\n\t\t// get rid of that first.\n\t\tif(isset($_COOKIE['id'])){\n\t\t\t$prep = $con->prepare(\"\n\t\t\t\tDELETE FROM `tokens` \n\t\t\t\tWHERE token_user = $this->user_id\n\t\t\t\t\tAND token_val = ?\n\t\t\t\");\n\t\t\t\n\t\t\t$prep->bind_param(\"s\", $_COOKIE['id']);\n\t\t\t$prep->execute();\n\t\t\t// and clear the cookies...\n\t\t\tunset($_COOKIE['id']);\n\t\t\t/*bool setcookie ( string $name [, string $value [, \n\t\t\t\tint $expire = 0 [, string $path [, string $domain [, \n\t\t\t\tbool $secure = false [, bool $httponly = false ]]]]]] )*/\n\t\t\tsetcookie('id', '', time() - 3600);\n\t\t}\n\t\t\n\t\t// and now destroy the session variables...\n\t\tsession_unset();\n\t\tsession_destroy();\n\t\n\t\t\n\t}",
"function procLogout(){\n global $session;\n $retval = $session->logout();\n header(\"Location: ./\");\n }",
"private function logOut()\n {\n $this->codeBird->logout();\n }",
"public function logout(){\n\t\t\n\t\t//perform any custom authentication functions\n\t\t$this->strategy->logout_hook();\n\t\t\n\t\t//delete the php session cookie and autologin cookie\n\t\t$this->cookies->delete_cookie($this->session_zone->get_name());\n\t\t$this->cookies->delete_cookie('autologin');\n\t\t\n\t\t//this calls session_destroy() and session_unset()\n\t\t$this->session_zone->destroy();\n\t\t//clears the current user\n\t\t$this->user = null;\n\t\t\n\t\t//start a new session anonymous session\n\t\t$this->set_default_session();\n\t\n\t}",
"public function logout() {\n deleteSession();\n }",
"function actionLogout(){\r\n\r\n\t\t$user=helpers::get_Controller(USERS);\r\n\r\n\t\t$user->LogOut(); //destroy sessions and cookies\r\n\r\n\t\t$this->redirect(helpers::base_url());\r\n\t}",
"public function action_logout()\n\t{\n\t\t// Log out only if the token is ok\n\t\tif (Security::token() === $this->request->param('id'))\n\t\t{\n//\t\t\t$destroy = (bool) $this->request->query('destroy');\n//\t\t\t$all\t = (bool) $this->request->query('all');\t\t\t\n//\t\t\tAuth::instance()->logout($destroy, $all);\n//\t\t\tAuth::instance()->logout();\n\t\t\tAuth::instance()->logout(TRUE, TRUE);\n \t\tHTTP::redirect('user/auth/login');\n \t\texit;\n\t\t}\n\t\tAuth::instance()->logout();\n \tHTTP::redirect('user/auth/login');\n \texit;\n\t}",
"private function logout() {\n\t\tif($this->loginView->isLoggedIn())\n\t\t\t$this->message = \"Du har nu loggat ut\";\n\n\t\t$this->loginView->deleteSessionData();\n\t\t\n\t\t$this->is_logged_in = false;\n\t}",
"private function actionLogout()\n {\n $this->sessionManager->doLogout();\n $this->resetRequest();\n }",
"public function sso_after_logout(){\n\t\t//you can clear the session here (late clearing)\n\t\t//redirect to base_url();\n\t\tredirect();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Use the EsUsersRelatedByIdUserCreated relation EsUsers object | public function useEsUsersRelatedByIdUserCreatedQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinEsUsersRelatedByIdUserCreated($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'EsUsersRelatedByIdUserCreated', '\EsUsersQuery');
} | [
"public function users()\n {\n return $this->belongsToMany(config('vouchers.user_model'), config('vouchers.relation_table'))->withPivot('redeemed_at');\n }",
"public function getCreatedByUser()\n {\n return $this->getTable('User')->find($this->created_by_user_id);\n }",
"public function getUserAdded()\n {\n return $this->hasOne(User::className(), ['id' => 'user_added']);\n }",
"protected function createdUser_access()\n {\n\t\treturn $this->service->account->users->find('id', $this->attributes['created_by'])->first();\n\t}",
"public function users() \n {\n return $this->belongsToMany('App\\User', 'galleries_users', 'galleryId', 'userId')\n ->withTimestamps()\n ->withPivot('gallerySignup');\n }",
"protected function populateUsers(){\n $userIds = $this->getUsers();\n $users = BIM_Model_User::getMulti($userIds, true);\n\n // populate the creator\n $creator = $users[ $this->creator->id ];\n self::_updateUser($this->creator, $creator);\n\n // populate the challengers\n $challengers = $this->challengers;\n foreach ( $challengers as $challenger ){\n $target = $users[ $challenger->id ];\n self::_updateUser($challenger, $target);\n }\n }",
"public function requestingUsers()\n {\n return $this->belongsToMany(User::class, 'circle_members', 'circle_id')\n ->wherePivot('status', '0')\n ->withTimestamps();\n }",
"public static function getUsersCreated($userId = null)\n {\n $usersCreated = null;\n $userId = ($userId == null) ? sfContext::getInstance()->getUser()->getGuardUser()->getId() : $userId; \n \n $results = Doctrine::getTable('Profile')->findBy('created_by_user_id', $userId)->toArray();\n \n foreach ($results as $result) {\n $usersCreated[] = $result['id'];\n }\n \n return $usersCreated;\n }",
"public function initHbfEgresossRelatedByIdUserCreated($overrideExisting = true)\n {\n if (null !== $this->collHbfEgresossRelatedByIdUserCreated && !$overrideExisting) {\n return;\n }\n\n $collectionClassName = HbfEgresosTableMap::getTableMap()->getCollectionClassName();\n\n $this->collHbfEgresossRelatedByIdUserCreated = new $collectionClassName;\n $this->collHbfEgresossRelatedByIdUserCreated->setModel('\\HbfEgresos');\n }",
"public function initUsersRelatedByUser2Id()\n\t{\n\t\t$this->collUsersRelatedByUser2Id = new PropelObjectCollection();\n\t\t$this->collUsersRelatedByUser2Id->setModel('User');\n\t}",
"public function users(){\n\t\treturn $this->belongsToMany('\\\\bundles\\\\lincko\\\\api\\\\models\\\\data\\\\Users', 'users_x_workspaces', 'workspaces_id', 'users_id')->withPivot('access', 'super');\n\t}",
"public function users()\n {\n \t// hasMany(RelatedModel, foreignKeyOnRelatedModel = profesione_id, localKey = id)\n \treturn $this->hasMany(User::class,'id_profesion');//many pertenece a muchos, uno a muchos\n }",
"private function relateToUser()\n {\n if ($this->initRelationshipHelper() == false) {\n return;\n }\n global $current_user;\n\n $linkName = $this->rel->getRelationshipByModules($this->activity->module_name, $current_user->module_dir);\n\n if (!empty($linkName)) {\n $this->activity->load_relationship($linkName);\n $this->activity->$linkName->add($current_user, array($current_user->id));\n }\n }",
"public function getIdUsers1()\n {\n return $this->hasMany(User::className(), ['IdUser' => 'IdUser'])->viaTable('m_menyetujui', ['IdDoc' => 'IdDoc']);\n }",
"public function usersInvolved() {\n\t\treturn $this->belongsToMany('App\\User', 'incident_user_involved')->withTimestamps();\n\t}",
"public function addHbfIngresosRelatedByIdUserCreated(ChildHbfIngresos $l)\n {\n if ($this->collHbfIngresossRelatedByIdUserCreated === null) {\n $this->initHbfIngresossRelatedByIdUserCreated();\n $this->collHbfIngresossRelatedByIdUserCreatedPartial = true;\n }\n\n if (!$this->collHbfIngresossRelatedByIdUserCreated->contains($l)) {\n $this->doAddHbfIngresosRelatedByIdUserCreated($l);\n\n if ($this->hbfIngresossRelatedByIdUserCreatedScheduledForDeletion and $this->hbfIngresossRelatedByIdUserCreatedScheduledForDeletion->contains($l)) {\n $this->hbfIngresossRelatedByIdUserCreatedScheduledForDeletion->remove($this->hbfIngresossRelatedByIdUserCreatedScheduledForDeletion->search($l));\n }\n }\n\n return $this;\n }",
"public function users()\n {\n \treturn $this->belongsToMany('App\\User')->withPivot('answer')->withTimestamps();\n }",
"public function users()\n {\n return $this->belongsToMany(User::class, 'user_demographic')->withPivot('value')->withTimestamps();\n }",
"public function inviteUsers(){\n\n /**\n * No renderizamos vista\n * @var boolean\n */\n $this->autoRender = false;\n\n /**\n * Identificador del usuairo logueado\n * @var Int\n */\n $userId = $this->Auth->user('id');\n\n /**\n * Estado de éxito\n * @var boolean\n */\n $state = true;\n\n /**\n * Indentificadores de los los usuarios encontrados por email\n * @var Array\n */\n $emailsIds = $this->request->data['emailsIds'];\n\n /**\n * Variable que contiene la organizacion creada por un usuario\n * @var Array\n */\n $userOrganization = $this->userOwnOrganization($userId);\n\n /**\n * Identificador de la organización\n * @var Int\n */\n $organizationId = $userOrganization['Organization']['id'];\n\n /**\n * Recorremos los indentificadores de los usuarios obtenidos\n */\n foreach ($emailsIds as $id) {\n \n /**\n * Si el usuario no se encuentra en la organización\n */\n if (!$this->isUserInOrganization($id,$organizationId)) {\n \n /**\n * Creación de nueva relación de entidad con usuario\n */\n $this->OrganizationUser->create();\n\n /**\n * Si no se guardo correctamente\n */\n if(! $this->OrganizationUser->save(Array('user_id'=> $id, 'organization_id' => $organizationId))){\n \n $state = false;\n\n break;\n }\n\n /**\n * limpiamos el modelo\n */\n $this->OrganizationUser->Clear();\n \n }\n\n }\n\n /**\n * Mandamos el resultado de la acción\n */\n echo json_encode(Array('success'=>$state));\n\n }",
"public function users(){\n\t\treturn $this->belongsToMany('App\\User')->as('member')->withPivot('estimation', 'created_at', 'updated_at')->withTimestamps();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test the format function with named parameters. | public function testFormatNamedParameters() {
$actual = StringUtils::format("I have two {what} in my {where}.", [
'what' => 'apples',
'where' => 'pocket'
]);
$expected = 'I have two apples in my pocket.';
$this->assertEquals($expected, $actual);
} | [
"public function testFormatNamedAndIndexedParameters() {\n\t\t$actual = StringUtils::format(\"I have two {what} in my {where}. {0}\", [\n\t\t\t'what' => 'apples',\n\t\t\t'where' => 'pocket'\n\t\t], 'OUCH!');\n\t\t$expected = 'I have two apples in my pocket. OUCH!';\n\n\t\t$this->assertEquals($expected, $actual);\n\t}",
"public function testFormatterSubstitutesNamedParameters()\n {\n $this->skipIfNotPhpVersion('>=', '5.5');\n\n $message = $this->formatter->format('en', 'Hello {name}!', array('name' => 'Matthias'));\n $this->assertEquals('Hello Matthias!', $message);\n }",
"public function formatParameters($formatParameters);",
"#[@test]\n function formatWithTwoArguments() {\n $this->invoke('format', array('Hello %s', 'World'));\n }",
"#[@test]\n function formatWithLotsArguments() {\n $this->invoke('format', array('%s: %s %d %s', 'Hello', 'Timm', 42, 'is the answer'));\n }",
"public function format($param);",
"public function testDecoratorConvertsNamedToPositionalParameters()\n {\n $this->assertFormatterReceives('Hello {0} from {1}!', $this->anything());\n\n $params = array('name' => 'Matthias', 'location' => 'Bonn');\n $this->decorator->format('de', 'Hello {name} from {location}!', $params);\n }",
"function assertStringMatchesFormat($format, $string, $message = '')\n{\n return call_user_func_array(\n 'PHPUnit_Framework_Assert::assertStringMatchesFormat',\n func_get_args()\n );\n}",
"function msgfmt_format($fmt, $args){}",
"public function formats();",
"abstract public function format();",
"public function testFormat() {\n\t\t$actual = StringUtils::format(\"I have two {0} in my {1}.\", 'apples', 'pocket');\n\t\t$expected = \"I have two apples in my pocket.\";\n\n\t\t$this->assertEquals($expected, $actual);\n\t}",
"public function format($format);",
"function sprintfn ($format, array $args = array()) {\n // map of argument names to their corresponding sprintf numeric argument value\n $arg_nums = array_slice(array_flip(array_keys(array(0 => 0) + $args)), 1);\n\t\n // find the next named argument. each search starts at the end of the previous replacement.\n for ($pos = 0; preg_match('/(?<=%)([a-zA-Z_]\\w*)(?=\\$)/', $format, $match, PREG_OFFSET_CAPTURE, $pos);) {\n $arg_pos = $match[0][1];\n $arg_len = strlen($match[0][0]);\n $arg_key = $match[1][0];\n\t\t\n // programmer did not supply a value for the named argument found in the format string\n if (! array_key_exists($arg_key, $arg_nums)) {\n user_error(\"sprintfn(): Missing argument '${arg_key}'\", E_USER_WARNING);\n return false;\n }\n\t\t\n // replace the named argument with the corresponding numeric one\n $format = substr_replace($format, $replace = $arg_nums[$arg_key], $arg_pos, $arg_len);\n $pos = $arg_pos + strlen($replace); // skip to end of replacement for next iteration\n }\n\t\n return vsprintf($format, array_values($args));\n}",
"function sprintfn($format, array $args = array())\n{\n // map of argument names to their corresponding sprintf numeric argument value\n $arg_nums = array_slice(array_flip(array_keys(array(0 => 0) + $args)), 1);\n\n // find the next named argument. each search starts at the end of the previous replacement.\n for ($pos = 0; preg_match('/(?<=%)([a-zA-Z_]\\w*)(?=\\$)/', $format, $match, PREG_OFFSET_CAPTURE, $pos);)\n {\n $arg_pos = $match[0][1];\n $arg_len = strlen($match[0][0]);\n $arg_key = $match[1][0];\n\n // programmer did not supply a value for the named argument found in the format string\n if (!array_key_exists($arg_key, $arg_nums))\n {\n user_error(\"sprintfn(): Missing argument '${arg_key}'\", E_USER_WARNING);\n return false;\n }\n\n // replace the named argument with the corresponding numeric one\n $format = substr_replace($format, $replace = $arg_nums[$arg_key], $arg_pos, $arg_len);\n $pos = $arg_pos + strlen($replace); // skip to end of replacement for next iteration\n }\n return vsprintf($format, array_values($args));\n}",
"public static function format()\n\t{\n\t}",
"public static function assertStringMatchesFormat($format, $string, $message = '') {}",
"public static function assertStringMatchesFormat(string $format, string $string, string $message = ''): void\n {\n Assert::assertStringMatchesFormat(...\\func_get_args());\n }",
"public function support(string $format): bool ;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enables or disables Network Policy for a cluster. (clusters.setNetworkPolicy) | public function setNetworkPolicy($projectId, $zone, $clusterId, SetNetworkPolicyRequest $postBody, $optParams = [])
{
$params = ['projectId' => $projectId, 'zone' => $zone, 'clusterId' => $clusterId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('setNetworkPolicy', [$params], Operation::class);
} | [
"public function SetNetworkPolicy(\\Google\\Cloud\\Container\\V1beta1\\SetNetworkPolicyRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.container.v1beta1.ClusterManager/SetNetworkPolicy',\n $argument,\n ['\\Google\\Cloud\\Container\\V1beta1\\Operation', 'decode'],\n $metadata, $options);\n }",
"public function setNetworkPolicy($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\VmwareEngine\\V1\\NetworkPolicy::class);\n $this->network_policy = $var;\n\n return $this;\n }",
"public function setNetworkPolicyConfig($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Container\\V1beta1\\NetworkPolicyConfig::class);\n $this->network_policy_config = $var;\n\n return $this;\n }",
"public static function setDefaultPolicy($policy)\n {\n if (is_string($policy))\n {\n $policy = trim(strtoupper($policy));\n if ($policy === \"ALLOW\")\n $policy = Rule::ALLOW;\n elseif ($policy === \"DENY\")\n $policy = Rule::DENY;\n }\n\n if (!($policy === Rule::ALLOW || $policy === Rule::DENY))\n throw new Exception(\"Default policy should be either Rule::ALOW or Rule::DENY\"); \n\n self::$default_policy = $policy;\n }",
"public function setNetwork($val)\n {\n $this->_propDict[\"network\"] = $val;\n return $this;\n }",
"public function setUserRightsAllowAccessFromNetwork($val)\n {\n $this->_propDict[\"userRightsAllowAccessFromNetwork\"] = $val;\n return $this;\n }",
"public function testUpdateNetworkSwitchDhcpServerPolicy()\n {\n }",
"public function setAsNetworkPlugin( $value = true ) {\n\t\t$this->is_network_plugin = $value;\n\t}",
"public function testReplaceClusterPolicy()\n {\n\n }",
"public function setPolicyNumber($policyNumber);",
"public function setNetworkMode($mode)\n {\n $this->networkMode = $mode;\n\n return $this;\n }",
"public function setAssignmentPolicy($val)\n {\n $this->_propDict[\"assignmentPolicy\"] = $val;\n return $this;\n }",
"public function testCreateNetworkGroupPolicy()\n {\n }",
"public function update_network_settings() {\n\n\t\t/**\n\t\t * Update the network summary setting if the Network Settings\n\t\t * page is updated with the setting.\n\t\t */\n\t\tif ( isset( $_POST['ds_enable_network_summary'] ) ) {\n\n\t\t\t// Update the option.\n\t\t\tupdate_network_option(\n\n\t\t\t\t// Update for the current network.\n\t\t\t\tget_current_network_id(),\n\n\t\t\t\t// Option name to update.\n\t\t\t\t'ds_enable_network_summary',\n\n\t\t\t\t// Validate the integer setting.\n\t\t\t\tfilter_var( $_POST['ds_enable_network_summary'], FILTER_VALIDATE_INT )\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Update the network right now setting if the Network Settings\n\t\t * page is updated with the setting.\n\t\t */\n\t\tif ( isset( $_POST['ds_enable_network_right_now'] ) ) {\n\n\t\t\t// Update the option.\n\t\t\tupdate_network_option(\n\n\t\t\t\t// Update for the current network.\n\t\t\t\tget_current_network_id(),\n\n\t\t\t\t// Option name to update.\n\t\t\t\t'ds_enable_network_right_now',\n\n\t\t\t\t// Validate the integer setting.\n\t\t\t\tfilter_var( $_POST['ds_enable_network_right_now'], FILTER_VALIDATE_INT )\n\t\t\t);\n\t\t}\n\t}",
"function toggleMultiplenptNATrules($post, $json = false) {\n\tglobal $config;\n\n\tinit_config_arr(array('nat', 'npt'));\n\t$a_npt = &$config['nat']['npt'];\n\n\tforeach ($post['rule'] as $rulei) {\n\t\tif (isset($a_npt[$rulei]['disabled'])) {\n\t\t\tunset($a_npt[$rulei]['disabled']);\n\t\t} else {\n\t\t\t$a_npt[$rulei]['disabled'] = true;\n\t\t}\n\t}\n\n\tif (write_config(gettext(\"Firewall: NAT: NPt - toggle enable/disable for selected NPt mappings.\")) && !$json) {\n\t\tmark_subsystem_dirty('natconf');\n\t}\n\n\tif (!$json) {\n\t\theader(\"Location: firewall_nat_npt.php\");\n\t\texit;\n\t}\n}",
"public function allowNewConnections($allow = true){\n $this->allow = $allow;\n }",
"public function test_enableNetwork()\n {\n $saved = VisibilityViolator::getHiddenProperty(\n 'JClaveau\\SocialVideo\\SocialVideo',\n 'enabledSocialNetworks'\n );\n\n // not implemented\n VisibilityViolator::setHiddenProperty(\n 'JClaveau\\SocialVideo\\SocialVideo',\n 'enabledSocialNetworks',\n [\n SocialVideo::DAILYMOTION => null,\n ]\n );\n\n try {\n SocialVideo::enableNetwork( SocialVideo::DAILYMOTION );\n }\n catch (\\JClaveau\\SocialVideo\\NotImplementedException $e) {\n $this->assertEquals(\n $e->getMessage(),\n \"The support of the social network you try to enable is \"\n .\"not implement: \".SocialVideo::DAILYMOTION\n );\n }\n\n // disabled\n VisibilityViolator::setHiddenProperty(\n 'JClaveau\\SocialVideo\\SocialVideo',\n 'enabledSocialNetworks',\n [\n SocialVideo::DAILYMOTION => false,\n ]\n );\n\n SocialVideo::enableNetwork( SocialVideo::DAILYMOTION );\n\n $enabledSocialNetworks = VisibilityViolator::getHiddenProperty(\n 'JClaveau\\SocialVideo\\SocialVideo',\n 'enabledSocialNetworks'\n );\n\n $this->assertEquals( $enabledSocialNetworks, [\n SocialVideo::DAILYMOTION => true,\n ]);\n\n // restore\n VisibilityViolator::setHiddenProperty(\n 'JClaveau\\SocialVideo\\SocialVideo',\n 'enabledSocialNetworks',\n $saved\n );\n }",
"public function canSetControllablePolicy();",
"public function setAuthorizedNetwork($var)\n {\n GPBUtil::checkString($var, True);\n $this->authorized_network = $var;\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the severity column. | protected function formatSeverityColumn(
DevlogEntry $entry
) {
$severityId = $entry->getSeverity();
$severityName = SeverityUtility::getName($severityId);
$icon = $this->getSeverityIconClass($severityId);
if (!empty($icon)) {
$icon = \Sys25\RnBase\Backend\Utility\Icons::getSpriteIcon($icon);
}
return sprintf(
'<button '.
'type="submit" '.
'class="button button-severity severity severity-%2$s" '.
'name="SET[mklogDevlogEntrySeverity]" '.
'value="%1$s" '.
'title="Filter %3$s (%1$s)"'.
'>%4$s<span>%3$s</span></button>',
$severityId,
strtolower($severityName),
ucfirst(strtolower($severityName)),
$icon
);
} | [
"function print_column_severity( BugData $p_bug, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {\n\techo '<td class=\"column-severity\">';\n\tprint_formatted_severity_string( $p_bug );\n\techo '</td>';\n}",
"private static function formattedSeverity()\n {\n if(self::$phpErrNo){\n return sprintf('[%s => %s]', self::phpErr2Str(self::$phpErrNo), self::severity2Str(self::$errSeverity));\n }else{\n return sprintf('[%s]', self::severity2Str(self::$errSeverity));\n }\n }",
"function print_column_title_severity( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {\n\techo '<th class=\"column-severity\">';\n\tprint_view_bug_sort_link( lang_get( 'severity' ), 'severity', $p_sort, $p_dir, $p_columns_target );\n\tprint_sort_icon( $p_dir, $p_sort, 'severity' );\n\techo '</th>';\n}",
"public function decorateStatus($value, $row, $column, $isExport)\n {\n if ($row->getStatus()) {\n $cell = '<span class=\"grid-severity-notice\"><span>' . $value . '</span></span>';\n } else {\n $cell = '<span class=\"grid-severity-critical\"><span>' . $value . '</span></span>';\n }\n return $cell;\n }",
"public function getSeverity () : int {\n return $this->severity;\n }",
"public function getSeverity()\n\t{\n\t\treturn $this->getObject('severity');\n\t}",
"function getSeverity();",
"function print_formatted_severity_string( $p_status, $p_severity ) {\n\t\t$t_sev_str = get_enum_element( 'severity', $p_severity );\n\n\t\tif ( ( MAJOR <= $p_severity ) &&\n\t\t\t ( CLOSED != $p_status ) ) {\n\t\t\techo \"<span class=\\\"bold\\\">$t_sev_str</span>\";\n\t\t} else {\n\t\t\techo $t_sev_str;\n\t\t}\n\t}",
"public function get_event_severity()\n\t{\n\t\treturn self::severity_name( $this->severity_id );\n\t}",
"public function getSeverityText()\n {\n // Get the score that best matches this Vulnerability's severity score\n $scoreDefault = $this->getSeverityTextToScoreMap()->first(function ($score) {\n return $this->getSeverity() <= $score;\n }, self::SEVERITY_INFORMATION);\n\n // Return the key (Text representation) related to the score retrieved above\n return $this->getSeverityTextToScoreMap()->search($scoreDefault, true);\n }",
"public function getSeverityName(): string;",
"Public Function getSeverityColor() {\n\t\tSwitch($this->severity) {\n\t\t\tCase self::SEVERITY_FATAL: Return 'ffd0d0';\n\t\t\tCase self::SEVERITY_WARNING: Return 'ffffa0';\n\t\t\tCase self::SEVERITY_SUCCESS: Return 'd0ffd0';\n\t\t\tCase self::SEVERITY_NOTICE: Return 'ffffff';\n\t\t}\n\t}",
"public function decorateStatus($value, $row, $column, $isExport)\n {\n $class = '';\n switch ($row->getStatus()) {\n case Mage_Cron_Model_Schedule::STATUS_PENDING:\n $class = 'grid-severity-minor';\n break;\n case Mage_Cron_Model_Schedule::STATUS_RUNNING:\n $class = 'grid-severity-major';\n break;\n case Mage_Cron_Model_Schedule::STATUS_ERROR:\n case Mage_Cron_Model_Schedule::STATUS_MISSED:\n $class = 'grid-severity-critical';\n break;\n case Mage_Cron_Model_Schedule::STATUS_SUCCESS:\n $class = 'grid-severity-notice';\n break;\n }\n return '<span class=\"'.$class.'\"><span>'.$value.'</span></span>';\n }",
"public function getSeverityName()\n {\n return Logger::getLevelName($this->severity);\n }",
"public function getSeverityClass()\n\t{\n\t\tswitch ($this->severity)\n\t\t{\n\t\t\tcase LoggerSeverity::NOTICE:\n\t\t\t\treturn 'alert alert-info';\n\t\t\tcase LoggerSeverity::SUCCESS:\n\t\t\t\treturn 'alert alert-success';\n\t\t\tcase LoggerSeverity::WARNING:\n\t\t\t\treturn 'alert';\n\t\t\tcase LoggerSeverity::ERROR:\n\t\t\t\treturn 'alert alert-error';\n\t\t\tdefault:\n\t\t\t\treturn '';\n\t\t}\n\t}",
"public function setSeverity($val)\n {\n $this->_propDict[\"severity\"] = $val;\n return $this;\n }",
"public function renderColumns () {\n $cols = '';\n\n foreach (self::getColumnsArray() as $key => $num) {\n if ($key == 0) $cols .= \" \";\n\n $cols .= \" $num \";\n }\n\n return $cols;\n }",
"public function format($row, $column = null)\n {\n switch ($row['feeStatus']['id']) {\n case RefData::FEE_STATUS_PAID:\n $statusClass = 'green';\n break;\n case RefData::FEE_STATUS_OUTSTANDING:\n $statusClass = 'orange';\n break;\n case RefData::FEE_STATUS_CANCELLED:\n $statusClass = 'red';\n break;\n default:\n $statusClass = 'grey';\n break;\n }\n return vsprintf(\n '<strong class=\"govuk-tag govuk-tag--%s\">%s</strong>',\n [$statusClass, $row['feeStatus']['description']]\n );\n }",
"protected function RenderStatus_HTML_cells() {\n\t$qInStock = $this->QtyInStock();\n\t$out = \"<td>\"\n\t .$this->RenderPriceRange()\n\t .'</td><td>'\n\t .$this->CatalogOptionsList()\n\t .'</td>'\n\t ;\n\tif ($qInStock > 0) {\n\t $out .= \"<td>$qInStock in stock</td>\";\n\t}\n\treturn $out;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Notifies open question answer author if new feedback is posted. | function open_question_new_feedback_notify($feedback) {
if (!module_exists('newsfeed')) {
watchdog('open_question', 'Enable newsfeed module to notify users of new content.', array(), WATCHDOG_WARNING);
return;
}
$feedback_wrapper = entity_metadata_wrapper('node', $feedback);
$fields = array(
'field_message_feedback' => $feedback->nid,
'field_message_open_question' => $feedback_wrapper->field_open_question_answer->field_open_question->value()->nid,
);
$uids = array(
$feedback_wrapper->field_open_question_answer->value()->uid => array(
'notifiers' => array(
'internal' => 'internal'
)
)
);
newsfeed_create_message('answer_feedback_notification', $feedback->uid, $feedback, $fields, $uids);
} | [
"function handle_feedback() {\n check_ajax_referer('muiteerdocs-ajax');\n $previous = isset( $_COOKIE['muiteerdocs_response'] ) ? explode( ',', $_COOKIE['muiteerdocs_response'] ) : array();\n $post_id = intval( $_POST['post_id'] );\n $type = in_array( $_POST['type'], array('positive', 'negative') ) ? $_POST['type'] : false;\n\n // check previous response\n if ( in_array($post_id, $previous) ) {\n $message = __('Sorry, you\\'ve already recorded your feedback.', 'muiteer');\n wp_send_json_error($message);\n }\n\n // seems new\n if ($type) {\n $count = (int) get_post_meta($post_id, $type, true);\n update_post_meta($post_id, $type, $count + 1);\n array_push($previous, $post_id);\n $cookie_val = implode(',', $previous);\n $val = setcookie('muiteerdocs_response', $cookie_val, time() + WEEK_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN);\n }\n\n $message = __('Thanks for your feedback.', 'muiteer');\n wp_send_json_success($message);\n }",
"public function set_feedback()\n {\n $this->create_tracker();\n }",
"public function storeReply(Feedback $feedback)\n {\n // check if the auth user is allowed to submit a reply\n $this->validate(request(), [\n 'reply' => 'required|min:3',\n ]);\n\n $feedback_reply = Feedback::update([\n 'reply' => request()->reply,\n 'replied_at' => Carbon::now(),\n ]);\n\n redirect()->route('contractor-completed-projects.show', $project->id);\n }",
"public function addfeedbackAction(){\n \n // get the session variables\n $namespace = new Container('user');\n $userID = $namespace->userID;\n \n // Call method to update feedback\n // This receives a status of 0 for submit, 1 for draft, 2 for delete draft, 3 for delete report\n\n // ReportTable object handles the difference\n $this->getServiceLocator()->get('ReportTable')\n ->updateFeedback($this->params()->fromPost('id'),\n $userID,\n $this->params()->fromPost('feedbackText'),\n $this->params()->fromPost('feedbackFlag'));\n \n\n // Redirect user to index if successful\n $this->redirect()->toRoute('index');\n }",
"public function notifyNewFeedback(Feedback $feedback)\n {\n $application = $this->get_application();\n \n if ($application instanceof FeedbackNotificationSupport)\n {\n $this->getNotificationService()->notify($feedback, $application->retrieve_notifications()->as_array());\n }\n }",
"public function sendFeedback()\n {\n }",
"public function actionFeedback()\n\t{\n\t\t$model = new FeedbackForm;\n\t\tif(isset($_POST['FeedbackForm']))\n\t\t{\n\t\t\tif($model->sendFeedback($_POST['FeedbackForm'])) {\n\t\t\t\tYii::app()->user->setFlash('success', \"Thank you for your Feedback!\");\n\t\t\t\t$this->redirect(Yii::app()->homeUrl);\n\t\t\t}\n\t\t}\n\n\t\t$this->pageTitle = 'Feedback';\n\t\t$this->render('feedback', array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function addAction()\n {\n /* Checking if user is signed in to be allowed to add new answer */\n $this->requireSignin();\n\n /* Getting Question by id */\n $question = Question::getById(intval($_POST['question_id']));\n\n if ($question) {\n\n /* Checking if question is not closed */\n if ($question->is_closed == 0 && $question->active == 1) {\n\n /* Creating new Answer's object */\n $answer = new Answer($_POST);\n\n /* Checking if answer is not empty */\n if (strlen($answer->answer) < 2) {\n\n /* Show error message and redirect to question's page */\n Flash::addMessage('You can not add emty answer', Flash::INFO);\n }\n\n /* Getting user's id and set it as question's user_id */\n $user = Auth::getUser();\n $answer->user_id = $user->id;\n\n $answerId = $answer->add();\n\n if ($answerId) {\n\n /* Send notification to question's author */\n Notification::add([\n 'to_user' => $question->user_id,\n 'question_id' => $question->id,\n 'answer_id' => $answerId,\n 'type' => 'na',\n 'from_user' => $answer->user_id,\n ]);\n\n /* Send notifications to users who are following question */\n $followers = FollowedQuestion::getFollowers($question->id);\n foreach ($followers as $follower) {\n\n Notification::add([\n 'to_user' => $follower['user_id'],\n 'question_id' => $question->id,\n 'answer_id' => $answerId,\n 'type' => 'na',\n 'from_user' => $answer->user_id,\n ]);\n }\n\n /* Send notifications to mentioned users */\n $mention_number = 0;\n preg_match_all('/(<span class=\"mention\" [^>]*value=\"([^\"]*)\"[^>]*)>(.*?)<\\/span><\\/span>/i', $answer->answer, $mentions);\n\n foreach($mentions[2] as $mention) {\n\n /* Allow max 10 mentions */\n if ($mention_number < 10) {\n\n /* Check if user exists */\n $this_user = User::getByUsername($mention);\n\n if ($this_user) {\n\n Notification::add([\n 'to_user' => $this_user->id,\n 'question_id' => $question->id,\n 'answer_id' => $answerId,\n 'type' => 'nm',\n 'from_user' => $answer->user_id,\n ]);\n }\n }\n }\n\n /* Redirect to question's page and show success message */\n Flash::addMessage('Answer added!', Flash::INFO);\n $this->redirect('/question/'.$question->url.'#answer_'.$answerId);\n\n } else {\n \n /* Redirect to question's page and show error messages */\n Flash::addMessage(\"Error: \".implode(\", \", $answer->errors), Flash::INFO);\n }\n\n } else {\n \n /* Redirect to question's page and show error message */\n Flash::addMessage('This question is closed for new answers.', Flash::INFO);\n }\n\n $this->redirect('/question/'.$question->url);\n\n } else {\n\n /* Redirect to stream page and show error messages */\n Flash::addMessage('This question is unavailable.', Flash::INFO);\n $this->redirect('/');\n }\n }",
"public function postFeedback()\n {\n $handler = $this->post_handler;\n \n if (!empty($_POST)) {\n \n $required_fields = [\n 'name',\n 'body',\n 'email',\n ];\n \n $fields_processing = [\n 'name' => [\n ['trim_', []],\n ['htmlspecialchars_', []],\n ['validateLen', ['min' => 2, 'max' => 50]],\n ],\n 'body' => [\n ['trim_', []],\n ['htmlspecialchars_', []],\n ],\n 'email' => [\n ['trim_', []],\n ['htmlspecialchars_', []],\n ['validateEmail', []],\n ['validateLen', ['min' => 5, 'max' => 50]],\n ],\n ];\n \n $handler->handleInput($required_fields, $fields_processing);\n $handler->validateCaptcha();\n \n if (empty($handler->validation_errors)) {\n $this->model->saveFeedback();\n }\n }\n\n $context = ['handler' => $handler];\n \n if ($_SESSION['user_group'] == 'autorized') {\n $feedbacks = $this->model->getFeedbacks();\n $context['feedbacks'] = $feedbacks;\n }\n \n $this->view->render('default', 'Feedback page!', $context);\n }",
"public function acceptFeedbackAction()\n\t{\n\t\t$feedback_id = Extended\\feedback_requests::updateAcceptedStatus( Auth_UserAdapter::getIdentity ()->getId (), $this->getRequest()->getparam('feedback_req_id'), \\Extended\\feedback_requests::IS_ACCEPTED_YES, \\Extended\\feedback_requests::VISIBILITY_CRITERIA_DISPLAYED );\n\t\t\n\t\tif($feedback_id):\n\t\t\techo Zend_Json::encode( 1 );\n\t\telse:\n\t\t\techo Zend_Json::encode( 0 );\n\t\tendif;\n\t\tdie;\n\t}",
"function feedbackAction(){\n\t\t$d = $_SESSION['questionnary'];\n\t\n\t\treturn xView::load('vignette/feedback', $d)->render();\n\t}",
"function thaim_question_sent() {\n\tif ( empty( $_GET['message'] ) ) {\n\t\treturn false;\n\t}\n\n\t$thaim = thaim();\n\n\t$id = (int) $_GET['message'];\n\t$question = get_comment( $id );\n\n\tif ( ! empty( $question->comment_author_email ) && isset( $_COOKIE['comment_author_email_' . COOKIEHASH] ) && $question->comment_author_email === $_COOKIE['comment_author_email_' . COOKIEHASH] ) {\n\t\t$thaim->message_raw = array(\n\t\t\t'message-feedback' => sprintf( '<p class=\"message-info success\">%1$s</p>',\n\t\t\t\t__( 'Thanks a lot for your feedback. Your message was sent successfully. We will reply to it asap.', 'thaim' )\n\t\t\t),\n\t\t\t'message-content' => $question->comment_content,\n\t\t\t'message-email' => $question->comment_author_email,\n\t\t);\n\t} else {\n\t\t$thaim->message_raw = array(\n\t\t\t'message-feedback' => sprintf( '<p class=\"message-info error\">%s</p>',\n\t\t\t\t__( 'Ouch. There was a problem sending the message. Please try again.', 'thaim' )\n\t\t\t),\n\t\t\t'message-content' => '',\n\t\t\t'message-email' => '',\n\t\t);\n\t}\n\n\treturn true;\n}",
"function addFeedback($local_post_id, $teacher_id, $accept_key, $feedback, $grade) {\n\t\tglobal $LePress;\n\t\t$this->setGrade($local_post_id, $grade);\n\t\t$teacher = $this->getTeacherByID($teacher_id, $accept_key);\n\t\t$comment = $LePress->fetchComment($local_post_id, $teacher->email, 'LePressTeacher');\n\t\t$time = current_time('mysql');\n\t\t$data = array(\n\t\t 'comment_post_ID' => $local_post_id,\n\t\t 'comment_author' => $teacher->lastname.' '.$teacher->firstname,\n\t\t 'comment_author_email' => $teacher->email,\n\t\t 'comment_author_url' => $teacher->course_url,\n\t\t 'comment_content' => $feedback,\n\t\t 'comment_agent' => 'LePressTeacher',\n\t\t 'comment_type' => '',\n\t\t 'comment_date' => $time,\n\t\t 'comment_parent' => 0,\n\t\t 'user_id' => 0,\n\t\t 'comment_approved' => 1);\n\t\tif(!$comment) {\n\t\t\t$comment_id = wp_insert_comment($data);\n\t\t\tupdate_comment_meta($comment_id, 'lepress-read', '1');\n\t\t} else {\n\t\t\t$deleted = wp_delete_comment($comment->comment_ID, true);\n\t\t\tif($deleted) {\n\t\t\t\t$comment_id = wp_insert_comment($data);\n\t\t\t\tupdate_comment_meta($comment_id, 'lepress-read', '1');\n\t\t\t}\n\t\t}\n\t}",
"public function replyFeedback($userid, $message){\n $this->_db->insert('notifications', array(\n 'user_id' => $userid,\n 'type' => 'user',\n 'message' => $message\n ));\n return true;\n }",
"public function postFeedbackAction()\n {\n\t\t$userSession\t= new Container('fo_user');\n\t\t$request\t\t= $this->getRequest();\n\t\t\n\t\tif($request->isPost()) {\n\t\t\t$formData\t\t\t\t\t= $request->getPost();\n\t\t\t$formData['feedback_email']\t= (isset($userSession->userSession['user_email']) && trim($userSession->userSession['user_email']) != '') ? $userSession->userSession['user_email'] : $formData['feedback_email'];\n\t\t\t\n\t\t\tif(isset($formData['feedback_email']) && trim($formData['feedback_email']) != '' && isset($formData['feedback_category']) && trim($formData['feedback_category']) != '' && isset($formData['feedback_message']) && trim($formData['feedback_message']) != '') {\n\t\t\t\t$result\t= $this->postFeedback($formData);\n\t\t\t\techo \"1\";\t//\tSuccess\n\t\t\t\t//\tFeedback Mail has to be sent\n\t\t\t\t/*$emailaddress\t= 'deepan@sdi.la';\n\t\t\t\t$subject\t= 'Snapstate - Feedback';\n\t\t\t\t$message\t= '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n\t\t\t\t\t\t\t\t<html xmlns=\"http://www.w3.org/1999/xhtml\">\n\t\t\t\t\t\t\t\t<head>\n\t\t\t\t\t\t\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n\t\t\t\t\t\t\t\t<title>Feedback</title>\n\t\t\t\t\t\t\t\t</head>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<body>\n\t\t\t\t\t\t\t\t\t<table width=\"650\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"margin:40px auto; background:#fff;\">\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"border:1px solid #DEDEDE;\">\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td style=\"padding:10px;\"><img src=\"'.DOMAINPATH.'/Front/img/mail/logo.png\" width=\"136\" height=\"36\" /></td>\n\t\t\t\t\t\t\t\t\t <td align=\"right\" style=\"padding-right:10px;\" class=\"txt1\"><a href=\"#\">'.ADMIN_EMAIL.'</a></td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td colspan=\"2\" style=\"background:#DEDEDE;font-size:12px; height:25px;\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td style=\"padding-left:10px; color:#535353\">'.date('F, Y').'</td> \n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t </table></td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td style=\"padding:10px;\"><img src=\"'.DOMAINPATH.'/Front/img/mail/banner.png\" width=\"634\" height=\"215\" /></td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td></td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"padding:0px 20px;\">\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td style=\"text-align: justify; line-height:18px;color:#1868AE;\">Welcome '.ucwords($formData['first_name']).' '.ucwords($formData['last_name']).', </td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td style=\"text-align: center; line-height:28px; padding-bottom:10px; padding-top: 10px; font-size:20px; color:#1868AE\"><span class=\"quotes\">“</span> Congratulations! Thank you very much for registering with Snapstate.com. <span class=\"quotes\">”</span></td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td style=\"color: #147EC2;font-size: 14px;font-weight: normal;padding: 10px 0;\">Please click the link below to activate your account:</td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td style=\"text-align: justify; line-height:18px; padding-bottom:10px\"><a href=\"'.$link.'\" title=\"Click here to activate your account\">'.$link.'</a></td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td style=\"color: #147EC2;text-align: justify; line-height:18px;padding-bottom:10px\">Please find the login information below:</td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td style=\"color: #147EC2;text-align: justify; line-height:18px; padding-bottom:10px\">Email Address: ' . $formData['email_address'] . '</td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td style=\"color: #147EC2;text-align: justify; line-height:18px; padding-bottom:10px\">Passsword: '.$formData['registration_password'].'</td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t </table></td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td class=\"txt2\" style=\"padding:10px 0;border:1px solid #DEDEDE; text-align:center;font-size: 11px; background:url('.DOMAINPATH.'/Front/img/mail/footer-bg.png) no-repeat; color:#fff;\">© Copyright '.date('Y').' SnapState.com. All rights reserved. </td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t</body>\n\t\t\t\t\t\t\t\t\t</html>';\n\t\t\t\t$headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n\t\t\t\t$headers .= 'Content-type: text/html; charset=utf-8' . \"\\r\\n\";\n\t\t\t\t$headers .= 'From: '.$formData['feedback_email'].' <'.$formData['feedback_email'].'>' . \"\\r\\n\";\n\t\t\t\t$to\t\t= 'To: ' . $emailaddress . \"\\r\\n\";\n\t\t\t\t$headersMessage\t= $headers . $to;\n\t\t\t\t\n\t\t\t\tif(MAILER) {\n\t\t\t\t\tmail('', $subject, $message, $headersMessage);\t\n\t\t\t\t}*/\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\techo \"0\";\t//\timproper request\n\t\t\t}\n\t\t} else {\n\t\t\techo \"0\";\t//\timproper request\n\t\t}\n\t\treturn $this->getResponse();\n }",
"public function setFeedback( $v ){ if( $this->feedback != $v ){ $this->dirty = true; } $this->feedback = $v; }",
"public function notify(Feedback $feedback, array $notifications = array());",
"public function checkHelpSubmitted(){\r\n \t\r\n \t$config = Mage::getModel('faq/config')->load(0);\r\n \t \r\n \t$status = (int) $config->getRating();\r\n \t\r\n \t$id = $this->getRequest()->getParam('id');\r\n \t\r\n \t$cookie = Mage::getSingleton('core/cookie');\r\n \t$helpful = $cookie->get('helpful'.$id);\r\n \t\r\n \tif(is_string($helpful) || $status == '2'){\r\n \t\treturn true;\r\n \t}else{\r\n \t\treturn false;\r\n \t}\r\n }",
"public function notifyQuestionnaireReportersAction()\n {\n $questionnaireId = $this->getRequest()->getParam('id');\n $questionnaire = $this->getEntityManager()->getRepository('Application\\Model\\Questionnaire')->findOneById($questionnaireId);\n\n $users = $this->getUsersByRole($questionnaire, 'editor');\n\n $subject = 'GIMS - Questionnaire opened : ' . $questionnaire->getName();\n $mailParams = array(\n 'questionnaire' => $questionnaire,\n );\n $this->sendMail($users, $subject, new ViewModel($mailParams));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the value of cantAsientos | public function setCantAsientos($cantAsientos)
{
$this->cantAsientos = $cantAsientos;
return $this;
} | [
"function SetCantidad($cantidad)\t{\t$this->cantidad = $cantidad;\t}",
"public function setCantidad($Cantidad){\n \t$this->Cantidad = $Cantidad;\n\t}",
"public function setMotdepasse($motdepasse)\n{\n if (!is_integer($motdepasse) || empty($motdepasse))\n {\n $this->erreurs[] = self::MOTDEPASSE_INVALIDE;\n }\n$this->motdepasse = $motdepasse;\n\n}",
"function settugas($nilai){\n\t\tif (($nilai<=100)&&($nilai>=0)) {\n\t\t\t$this->tugas = $nilai;\n\t\t}\n\t}",
"function setuas($nilai){\n\t\tif (($nilai<=100)&&($nilai>=0)) {\n\t\t\t$this->uas = $nilai;\n\t\t}\n\t}",
"public function setCantidad_1($cantidad_1){\n $this->cantidad_1 = $cantidad_1;\n }",
"public function setVisCantidad($valor, $tipo = \"\")\n\t{\n\t\t$this -> vis_cantidad = $valor;\n\t\t\n\t\tif(!empty($tipo))\n\t\t{\n\t\t\t$this -> vis_cantidad_tipo = $tipo;\n\t\t}\n\t}",
"public function setCantidad($cantidad)\n {\n $this->cantidad = $cantidad;\n }",
"public function vaciarCafetera(){\n $this->setCantidadActual(0);\n }",
"public function testSetSeuilConting() {\n\n $obj = new ConstantesEntreprise();\n\n $obj->setSeuilConting(10.092018);\n $this->assertEquals(10.092018, $obj->getSeuilConting());\n }",
"public function actualizarNota(){\n $periodos=NotaPeriodo::select('nota_periodo')->where(\"fk_materia_boletin\",$this->pk_materia_boletin)->get();\n $this->nota_materia=0;\n foreach ($periodos as $p) {\n $this->nota_materia+=$p->nota_periodo;\n }\n $this->nota_materia=$this->nota_materia/4; //Siempre son 4 periodos\n $this->nota_materia=round($this->nota_materia, 1,PHP_ROUND_HALF_UP); //Redondeo\n $this->save();\n }",
"function setDeducao($nValorDeducao);",
"public function DA_CantidadPrefacturaAvales();",
"public function setDisciplina($valor){\n\t\t\t$this->disciplina = $valor;\n\t\t}",
"public function DA_CantidadPrefacturaUfeg();",
"public function testSetMontant() {\n\n $obj = new LignesIjss();\n\n $obj->setMontant(10.092018);\n $this->assertEquals(10.092018, $obj->getMontant());\n }",
"public function testSetTauxPensionMilitaire() {\n\n $obj = new Employes();\n\n $obj->setTauxPensionMilitaire(10.092018);\n $this->assertEquals(10.092018, $obj->getTauxPensionMilitaire());\n }",
"public function asignarNivelDeficiencia()\n\t{\n\t\tif($this->evaluacion_riesgo_nivel_deficiencia==1)\n\t\t{\n\t\t\t$this->evaluacion_riesgo_nivel_deficiencia=2;\n\t\t}\n\t\telseif($this->evaluacion_riesgo_nivel_deficiencia==2)\n\t\t{\n\t\t\t$this->evaluacion_riesgo_nivel_deficiencia=6;\n\t\t}\n\t\tif($this->evaluacion_riesgo_nivel_deficiencia==3)\n\t\t{\n\t\t\t$this->evaluacion_riesgo_nivel_deficiencia=10;\n\t\t}\n\t}",
"public function setCantidad_3($cantidad_3){\n $this->cantidad_3 = $cantidad_3;\n }",
"public function testSetSeuil() {\n\n $obj = new ConstantesEntreprise();\n\n $obj->setSeuil(10.092018);\n $this->assertEquals(10.092018, $obj->getSeuil());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
// __construct // __construct() Construct a new Search Constraint Construct a new Search Constraint | function __construct ($strConstraintName, $strConstraintType, $strConstraintObject, $strConstraintValue)
{
$this->_oblstrConstraintName = $this->Push (new dataString ('Name', $strConstraintName));
$this->_oblstrConstraintType = $this->Push (new dataString ('Operator', $strConstraintType));
$this->_oblobjConstraintValue = $this->Push (new $strConstraintObject ('Value', $strConstraintValue));
parent::__construct ('Constraint');
} | [
"public function createConstraint();",
"public function __construct($searchObject)\n { // @codingStandardsIgnoreEnd\n // Most values will transfer without changes\n $this->id = $searchObject->getSearchId();\n $this->i = $searchObject->getStartTime();\n $this->s = $searchObject->getQuerySpeed();\n $this->r = $searchObject->getResultTotal();\n $this->ty = $searchObject->getSearchType();\n\n // Search terms, we'll shorten keys\n $tempTerms = $searchObject->getSearchTerms();\n foreach ($tempTerms as $term) {\n $newTerm = array();\n foreach ($term as $k => $v) {\n switch ($k) {\n case 'join':\n $newTerm['j'] = $v;\n break;\n case 'index':\n $newTerm['i'] = $v;\n break;\n case 'lookfor':\n $newTerm['l'] = $v;\n break;\n case 'group':\n $newTerm['g'] = array();\n foreach ($v as $line) {\n $search = array();\n foreach ($line as $k2 => $v2) {\n switch ($k2) {\n case 'bool':\n $search['b'] = $v2;\n break;\n case 'field':\n $search['f'] = $v2;\n break;\n case 'lookfor':\n $search['l'] = $v2;\n break;\n }\n }\n $newTerm['g'][] = $search;\n }\n break;\n }\n }\n $this->t[] = $newTerm;\n }\n\n // It would be nice to shorten filter fields too, but\n // it would be a nightmare to maintain.\n $this->f = $searchObject->getFilters();\n }",
"public function __construct(array $searchParameter = array())\n {\n $this\n ->setSearchParameter($searchParameter);\n }",
"public function constraint(){\n try {\n // Sparql10.g:242:3: (v= brackettedExpression | v= builtInCall | v= functionCall ) \n $alt34=3;\n $LA34 = $this->input->LA(1);\n if($this->getToken('OPEN_BRACE')== $LA34)\n {\n $alt34=1;\n }\n else if($this->getToken('STR')== $LA34||$this->getToken('LANG')== $LA34||$this->getToken('LANGMATCHES')== $LA34||$this->getToken('DATATYPE')== $LA34||$this->getToken('BOUND')== $LA34||$this->getToken('SAMETERM')== $LA34||$this->getToken('ISIRI')== $LA34||$this->getToken('ISURI')== $LA34||$this->getToken('ISBLANK')== $LA34||$this->getToken('ISLITERAL')== $LA34||$this->getToken('REGEX')== $LA34)\n {\n $alt34=2;\n }\n else if($this->getToken('IRI_REF')== $LA34||$this->getToken('PNAME_NS')== $LA34||$this->getToken('PNAME_LN')== $LA34)\n {\n $alt34=3;\n }\n else{\n $nvae =\n new NoViableAltException(\"\", 34, 0, $this->input);\n\n throw $nvae;\n }\n\n switch ($alt34) {\n case 1 :\n // Sparql10.g:243:3: v= brackettedExpression \n {\n $this->pushFollow(self::$FOLLOW_brackettedExpression_in_constraint897);\n $this->brackettedExpression();\n\n $this->state->_fsp--;\n\n\n }\n break;\n case 2 :\n // Sparql10.g:244:5: v= builtInCall \n {\n $this->pushFollow(self::$FOLLOW_builtInCall_in_constraint905);\n $this->builtInCall();\n\n $this->state->_fsp--;\n\n\n }\n break;\n case 3 :\n // Sparql10.g:245:5: v= functionCall \n {\n $this->pushFollow(self::$FOLLOW_functionCall_in_constraint913);\n $this->functionCall();\n\n $this->state->_fsp--;\n\n\n }\n break;\n\n }\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }",
"function __construct($name = '', $constraint = '', $version = '') {\n parent::__construct($name, $version);\n $this->constraint = $constraint;\n $this->debug('New dependency object: ' . $this->name . '' . $this->constraint . ' ' . $this->version);\n }",
"final function __construct() {}",
"public function __construct()\r\n\t{\r\n\t\t$this->rules = new ValidationRules();\t\r\n\t}",
"protected function _getSearchAndStateConstraints()\n\t{\n\t\t// print \"Hello from JoomoobaseModelJoomoobase::_getSearchAndStateConstraints()<br />\\n\";\n\t\t$app = JFactory::getApplication();\n\t\t$option = JRequest::getCmd('option');\n\n\t\t$whereConstraint = array();\n\t\t$filter_search = $app->getUserStateFromRequest( $option.'filter_search', 'filter_search' );\n\t\t$filter_search = trim( $filter_search );\n\n\t\tif ( $filter_search )\n\t\t{\n\t\t\t$whereConstraint['search'] = ' LOWER(title) LIKE \"%' . $filter_search . '%\" OR' .\n\t\t\t ' LOWER(description) LIKE \"%' . $filter_search . '%\"';\n\t\t}\n\n\t\t$filter_state = $app->getUserStateFromRequest( $option.'filter_state', 'filter_state' );\n\n\t\tif ( $filter_state == 'P' )\n\t\t{\n\t\t\t$whereConstraint['state'] = ' published = 1';\n\t\t}\n\t\telseif ( $filter_state == 'U' )\n\t\t{\n\t\t\t$whereConstraint['state'] = ' published = 0';\n\t\t}\n\n\t\treturn $whereConstraint;\n\t}",
"public function searchIndex()\n {\n $ft = $this->_sqlite ? \"\" : \" FULLTEXT\";\n $key = Sanitize::toKey( $this->_name .\"_search\" );\n $this->_keys[ $key ] = \"CREATE\".$ft.\" INDEX `\".$key.\"` ON `\".$this->_name.\"` (`\".implode( \"`,`\", func_get_args() ).\"`)\";\n return $this;\n }",
"public static function create()\n {\n return new SearchCriteria();\n }",
"public function __construct($search, $replace)\n {\n $this->_search = $search;\n $this->_replace = $replace;\n }",
"private function __construct()\n {\n\n $this->jobSearchScv = new JobSearchDataAccessService();\n\n }",
"public function __construct($conjunction = 'AND');",
"public function __construct()\n {\n foreach ($this->defaultRestrictionTypes as $restrictionType) {\n $this->add($this->createRestriction($restrictionType));\n }\n }",
"public function __construct()\n {\n $class = get_class($this);\n if (static::$constCollectionPrefix) {\n $class::SetupConstRef('Simnang\\LoanPro\\Constants\\\\' . static::$constCollectionPrefix, $class::$validConstsByVal, $class::$constSetup, $class::$fields, __CLASS__);\n } else {\n throw new \\ReflectionException(\"Invalid state for \\$constCollectionPrefix in '$class'. Please set the protected static variable it to a valid value\");\n }\n if (func_num_args()) {\n $argCnt = func_num_args();\n $args = func_get_args();\n $reqCnt = count(static::$required);\n if ($argCnt != $reqCnt)\n throw new \\InvalidArgumentException(\"Incorrect number of arguments, can't make $class\");\n for ($i = 0; $i < $argCnt; ++$i) {\n if (!$this->IsValidField(static::$required[ $i ], $args[ $i ]) || is_null($args[ $i ]))\n throw new \\InvalidArgumentException(\"Invalid value '\" . $args[ $i ] . \"' for property \" . static::$required[ $i ]);\n $this->properties[ static::$required[ $i ] ] = $this->GetValidField(static::$required[ $i ], $args[ $i ]);\n }\n }\n }",
"public function test__constructThrowsExceptionForGivenPhrase():void\n {\n new Term('a search phrase');\n }",
"public function __construct()\n {\n $this->exprParameters = new AssociativeArray();\n // End of user code\n }",
"public function setConstraint($constraint);",
"public function __construct()\n\t{\n\t\tparent::__construct(new FastestBalancingAlgorithm());\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO: Implement apresentar() method. | public function apresentar()
{
} | [
"public function respostacontato()\n {\n //\n }",
"public function publicar()\n {\n }",
"function testeAtributos(){\n $oConsulta = new lConsulta();\n\n print_r(\"Antes:\\n\");\n print_r($oConsulta);\n\n $oConsulta->codAtendente = \"A0000\";\n $oConsulta->codPaciente = \"P0000\";\n $oConsulta->codMedico = \"M0000\";\n $oConsulta->data = \"2018-07-07\";\n $oConsulta->hora = \"11:30:00\";\n $oConsulta->observacao = \"O paciente apresentou o sintoma de dor de cabeça.\";\n $oConsulta->receita = \"Uma xícara de café ao menos uma vez ao dia.\";\n\n \n print_r(\"\\nDepois:\\n\");\n print_r($oConsulta);\n}",
"public function getApresentacoes()\n {\n return $this->apresentacoes;\n }",
"public function selectByIdContato()\r\n {\r\n \r\n }",
"public function obtener()\n {\n }",
"public function apagar()\n {\n }",
"abstract protected function getNombreArtista();",
"public function getCreacion()\r\n{\r\nreturn $this->creacion;\r\n}",
"function getAsignada($iddocente, $idhora)\n {\n leerClase('Horario_docente');\n if (!$iddocente)\n return false;\n $horario = new Horario_docente();\n $activo = Objectbase::STATUS_AC;\n $ottal = $horario->contar(\" docente_id='$iddocente' and hora_id= '$idhora' and estado = '$activo' \");\n if ($ottal)\n return true;\n return false;\n }",
"function getDocumento(){ return $this->documento; }",
"public function partido(){\n\t\treturn $this->belongsto(Partido::class);\n\t}",
"public function objPergunta(){\n if (! isset($this->_objPergunta)) { \n $obj = new objEpergunta($this->Conexao, false); \n $obj->loadByCod($this->pergunta); \n $this->_objPergunta = $obj; \n } \n \n return $this->_objPergunta; \n }",
"public function getVPatente()\n{\nreturn $this->vPatente;\n}",
"public function get_author_permastruct() {}",
"public function DA_ConsultarOpcionAplicacion();",
"public function obtener_colectivo();",
"public function setVencido();",
"public function getPresentaciones()\r\n {\r\n return $this->presentaciones;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets as characteristics BBIE Transport Equipment. Characteristics. Text Characteristics of this piece of transport equipment. 0..1 Transport Equipment Characteristics Text Text. Type | public function getCharacteristics()
{
return $this->characteristics;
} | [
"public function getCharacteristics(){\n\t\t\treturn $this->characteristics;\n\t\t}",
"public function get_equipment_type();",
"function getCharacteristicsData()\n\t{\n\t\tinclude_once(ADMIN_MODULES.\"classcore/data/CharacteristicsData.php\");\n\t\t$page = new $this->pageclass(new CharacteristicsData());\n\t\t$charact_data = $page->getData();\n\t\treturn $charact_data;\n\t}",
"public function getCharacteristics()\n {\n return $this->hasOne(Characteristics::className(), ['id' => 'characteristics_id']);\n }",
"public function getTechnical()\n {\n return $this->technical;\n }",
"public function getTechnicalTextDetails()\n {\n return $this->technicalTextDetails;\n }",
"public function getCharacteristicsOptions()\n {\n return $this->hasMany(CharacteristicsOptions::className(), ['characteristics_id' => 'id']);\n }",
"public function getSeatCharacteristics()\n {\n return $this->seatCharacteristics;\n }",
"public function getCharacteristicsProducts()\n {\n return $this->hasMany(CharacteristicsProducts::className(), ['characteristics_options_id' => 'id']);\n }",
"public function getTechnologyVector() {\r\n return $this->technologyVector;\r\n }",
"public function getTechnicalInformation()\n {\n if (! isset($this->source->technical_informations)) {\n $this->technicalInformation = new ArrayCollection();\n }\n\n return $this->technicalInformation ?: new ArrayCollection(Technical::fromList(\n $this->source->technical_informations\n ));\n }",
"public function getCharacteristics()\n {\n $characteristics = $this->getProductCharacteristics($this->product);\n if ($this->parentProduct) {\n $parentCharacteristics = $this->getProductCharacteristics($this->parentProduct);\n foreach ($parentCharacteristics as $key => $parentChar) {\n $exists = false;\n foreach ($characteristics as $char) {\n if ($parentChar['id'] === $char['id']) {\n $exists = true;\n break;\n }\n }\n\n if ($exists) {\n unset($parentCharacteristics[$key]);\n }\n\n }\n $characteristics = array_merge($parentCharacteristics, $characteristics);\n }\n\n return $characteristics;\n }",
"public function getCharacteristic(): ?string\n {\n return $this->Characteristic;\n }",
"public function getTechnology() {\n\t\treturn self::DEFAULT_TECHNOLOGY;\n\t}",
"private function getTechnology()\n\t\t{\n\t\t\t$cfg = new Config();\n\t\t\treturn $cfg->getTechnology();\n\t\t}",
"public function getPhoneTechType()\n {\n return $this->phoneTechType;\n }",
"public function getTechnicalCapability()\n {\n return $this->technicalCapability;\n }",
"public function getVehicleEquipment()\n {\n return isset($this->VehicleEquipment) ? $this->VehicleEquipment : null;\n }",
"function getEquipment()\n {\n return $this->equipment;\n }",
"public function getTec()\n {\n return $this->tec;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display the sidebar in archive. | function ForBlogs_archive_sidebar() {
if ( ForBlogs_is_sidebar() ) {
?>
<aside id="aside-container" class="col-lg-4 col-md-4 col-sm-12" role="complementary">
<div id="sidebar-home" class="sidebar">
<?php dynamic_sidebar( 'sidebar-7' ); ?>
</div>
</aside>
<?php
}
} | [
"public function output_sidebar() {}",
"public function printSidebar()\n {\n echo $this->getSidebar();\n }",
"public function admin_sidebar()\n {\n }",
"public function hookAdminCollectionsShowSidebar()\n {\n $collectionRec = get_current_record('collection');\n $collectionID = $collectionRec->id;\n echo \"<div class=\\\"panel\\\"><h4>Export METS XML</h4><p><a class='button blue' style='width:100%;' href='\" . url('mets-export/export/mets?search=&advanced%5B0%5D%5Bjoiner%5D=and&range=&collection=' . $collectionID . '&type=&user=&tags=&public=&featured=&submit_search=Search+for+items&hits=0') . \"'><input style='background-color:transparent;color:white;border:none;' type='button' value='Export Set as METS XML' /></a></p></div>\";\n }",
"protected function detail_sidebar(){\n\t\t\n\t\t/* Get data */\n\t\t$itemsModel = $this->getModel('items');\n\t\t$latestEssentials = $itemsModel->getLatest($this->_itemtype, 0, 5);\n\t\t\n\t\t/* Display sidebar */\n\t\t$this->sidebar(array(\n\t\t\tarray(\n\t\t\t\t'latest',\n\t\t\t\t$this->itemtype_plural,\n\t\t\t\t$latestEssentials\n\t\t\t), 'slideshow_featured', 'marketplace'\n\t\t));\n\t\t\n\t}",
"protected function detail_sidebar(){\n\t\t$this->sidebar(array(\n'slideshow_featured', 'marketplace', 'catch_your_breath'\n\t\t));\n\t}",
"public function Sidebar() {\n\n $sidebar = array(\n 'Author' => $this->get_author(),\n //'Twitter' => $this->get_twitter(),\n 'Newest' => $this->get_newest(),\n 'Archive' => $this->get_archive(),\n );\n\n return $sidebar;\n }",
"function cleanyeti_archivesopen() { ?>\n\t\t\n\t\t<div id=\"archives-page\" class=\"row\">\n<?php }",
"public function sidebar()\n {\n $remainingBalance = app('remaining-balance')->calculate();\n\n return $this->respondShow($remainingBalance, new SidebarTotalTransformer);\n }",
"function evo_archivesopen() { ?>\r\n\t\t\t\t<ul id=\"archives-page\" class=\"xoxo\">\r\n\t\t<?php }",
"public function sidebarAction()\n {\n $this->_helper->viewRenderer->setResponseSegment('sidebar');\n // TODO: complete auto sidebar feature.\n \n /* Render index side bar with recent stuff. */\n if ($this->_request->getParam('action') == 'index' &&\n $this->_request->getParam('controller') == 'index' &&\n $this->_request->getParam('module') == 'default'\n ) {\n $this->_forward('sidebar-front');\n return true;\n }\n\n /* Render request specific sidebar. */\n $page = strtolower($this->_request->getParam('controller'));\n $path = $this->view->getScriptPaths();\n $path = $path[0];\n $fileName = \"index/sidebar-{$page}.phtml\";\n $file = $path.$fileName;\n if (file_exists($file)) $this->_forward(\"sidebar-{$page}\");\n }",
"public function sidebar()\n {\n return Item::create(__('Announcements'))\n ->icon('fas fa-bullhorn')\n ->route('announcements.index')\n ->permissions('announcements.manage')\n ->active('announcements*');\n }",
"public function addSidebar()\n\t{\n\t\tJHtmlSidebar::addEntry(\n\t\t\tJText::_('COM_MONITOR_MENU_PROJECTS'),\n\t\t\t'?option=com_monitor&view=projects',\n\t\t\t$this->name == 'project'\n\t\t);\n\t\tJHtmlSidebar::addEntry(\n\t\t\tJText::_('COM_MONITOR_MENU_ISSUES'),\n\t\t\t'?option=com_monitor&view=issues',\n\t\t\t$this->name == 'issue'\n\t\t);\n\t\tJHtmlSidebar::addEntry(\n\t\t\tJText::_('COM_MONITOR_MENU_COMMENTS'),\n\t\t\t'?option=com_monitor&view=comments',\n\t\t\t$this->name == 'comment'\n\t\t);\n\t\tJHtmlSidebar::addEntry(\n\t\t\tJText::_('COM_MONITOR_MENU_STATUS'),\n\t\t\t'?option=com_monitor&view=status',\n\t\t\t$this->name == 'status'\n\t\t);\n\t\tJHtmlSidebar::addEntry(\n\t\t\tJText::_('COM_MONITOR_MENU_CLASSIFICATIONS'),\n\t\t\t'?option=com_monitor&view=classifications',\n\t\t\t$this->name == 'classification'\n\t\t);\n\t}",
"private function displaySidebars()\n {\n $this->displayCurrentUsers();\n $this->displayRecentUsers();\n\n }",
"public function SidebarView()\n\t{\n\t\t$menu_array\t= array(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\"page_url\"\t\t=> LINK_MAIN.\"quotes/all\",\n\t\t\t\t\t\t\t\t\t\"page_title\"\t=> \"Alle Zitate\",\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\"page_url\"\t\t=> LINK_MAIN.\"quotes/insert\",\n\t\t\t\t\t\t\t\t\t\"page_title\"\t=> \"Zitat hinzufügen\",\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\"page_url\"\t\t=> LINK_MAIN.\"quotes/random\",\n\t\t\t\t\t\t\t\t\t\"page_title\"\t=> \"Zufallszitate\",\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t);\n\t\t$menu_items\t= \"\";\n\t\tforeach($menu_array\tas $menu_item)\n\t\t{\n\t\t\t$this->tpl->vars(\"page_url\",\t\t$menu_item['page_url']);\n\t\t\t$this->tpl->vars(\"page_title\",\t\t$menu_item['page_title']);\n\t\t\t$menu_items\t\t.= $this->tpl->load(\"_nav_li\");\n\t\t}\n\t\t\n\t\t$this->tpl->vars(\"submenu_items\",\t\t$menu_items);\n\t\treturn $this->tpl->load(\"submenu\", PATH_PAGES_TPL.\"sidebar/\");\n\t}",
"function adc_do_community_sidebar() {\n\tdynamic_sidebar( 'community-sidebar' );\n}",
"public function sidebar() {\n\t\t\n\t\techo '<div id=\"side-info-column\" class=\"inner-sidebar\" style=\"width: 25%;\">';\n\t\t\n\t\t/* Instructions\n\t\t========================================================*/\n\t\techo '<div class=\"postbox\">\n\t\t\t\t<h3 class=\"hndle\">' . __( 'How to Use', BNM_LOCALE ) . '</h3>\n\t\t\t\t<div class=\"inside\">';\n\t\t\n\t\techo '<h4>' . __( 'Shortcode', BNM_LOCALE ) . '</h4>\n\t\t<p>' . __( 'To insert a mashup into any post or page, use this shortcode in the content area:', BNM_LOCALE ) . '</p>\n\t\t<pre class=\"smm-pre\">[social-media-mashup count=\"5\"]</pre>\n\t\t<p>' . sprintf( __( 'Change %s to customize the number of items displayed.', BNM_LOCALE ), '<code>count</code>' ) . '</p>\n\t\t<h4>' . __( 'Template Tag', BNM_LOCALE ) . '</h4>\n\t\t<p>' . __( 'Insert this code into your theme to display a mashup:', BNM_LOCALE ) . '</p>' . \n\t\t\"<pre class='smm-pre'><?php\\nif (function_exists('social_media_mashup'))\\n\\tsocial_media_mashup(5);\\n?></pre>\" . \n\t\t'<p>' . sprintf( __( 'Change %s to customize the number of items displayed.', BNM_LOCALE ), '<code>5</code>' ) . '</p>';\n\t\t\n\t\techo '</div>\n\t\t\t</div>';\n\t\t\n\t\t/* About BNM\n\t\t========================================================*/\n\t\techo '<div class=\"postbox\">\n\t\t\t\t<h3 class=\"hndle\">' . sprintf( __( 'About %s', BNM_LOCALE ), 'Brave New Media' ) . '</h3>\n\t\t\t\t<div class=\"inside\">';\n\t\t\n\t\techo '<p>' . sprintf( __( 'Based in Minneapolis, %s is a content development and management company founded in 1998. Rooted in design and video and around since the inception of the internet, %s works with local, national and international companies in creating compelling stories that support their brands in all digital media.', BNM_LOCALE ), 'Brave New Media', 'Brave New Media' ) . '</p>\n\t\t<p><a href=\"http://bravenewmedia.net/\" target=\"_blank\" class=\"button\">' . __( 'Visit Our Website', BNM_LOCALE ) . '</a>\n\t\t<a href=\"http://bnm.zendesk.com/\" target=\"_blank\" class=\"button\">' . __( 'Get Support', BNM_LOCALE ) . '</a></p>';\n\t\t\n\t\techo '</div>\n\t\t\t</div>';\n\t\t\n\t\t/* BNM Blog\n\t\t========================================================*/\n\t\techo '<div class=\"postbox\">\n\t\t\t\t<h3 class=\"hndle\">' . sprintf( __( 'The %s Blog', BNM_LOCALE ), 'Brave New Media' ) . '</h3>\n\t\t\t\t<div class=\"inside\">';\n\t\t\n\t\tif ( ! class_exists( 'SimplePie' ) )\n\t\t\trequire_once( SMM_DIR . '/simplepie.inc' );\n\t\t\n\t\t$feed = new SimplePie();\n\t\t$feed->set_feed_url( 'http://blog.bravenewmedia.net/feed/' );\n\t\tdate_default_timezone_set( get_option( 'America/Chicago' ) );\n\t\t$feed->encode_instead_of_strip( false );\n\t\t$feed->enable_cache( false );\n\t\t$feed->set_cache_location( SMM_DIR . '/cache' );\n\t\t$feed->init();\n\t\t$feed->handle_content_type();\n\t\t\n\t\techo '<div class=\"rss-widget\"><ul>';\n\t\t\n\t\tforeach ( $feed->get_items( 0, 3 ) as $item )\n\t\t\techo '<li><a class=\"rsswidget\" href=\"' . $item->get_permalink() . '\" target=\"_blank\">' . $item->get_title() . '</a> <span class=\"rss-date\">' . $item->get_date( 'F j, Y' ) . '</span></li>';\n\t\t\n\t\techo '</ul></div>';\n\t\t\n\t\techo '</div>\n\t\t\t</div>';\n\t\t\n\t\t/* Credits\n\t\t========================================================*/\n\t\techo '<div class=\"postbox credits\">\n\t\t\t\t<h3 class=\"hndle\">' . __( 'Credits', BNM_LOCALE ) . '</h3>\n\t\t\t\t<div class=\"inside\">';\n\t\t\n\t\techo '<ul>\n\t\t\t<li>' . __( 'Author:', BNM_LOCALE ) . ' <a href=\"http://profiles.wordpress.org/users/bravenewmedia/\" target=\"_blank\">bravenewmedia</a></li>\n\t\t\t<li>' . __( 'Contributor:', BNM_LOCALE ) . ' <a href=\"http://profiles.wordpress.org/users/aliso/\" target=\"_blank\">aliso</a></li>\n\t\t</ul>\n\t\t\n\t\t<h4>' . __( 'Special Thanks', BNM_LOCALE ) . '</h4>\n\t\t<ul>\n\t\t\t<li>' . sprintf( __( 'Icons by %s', BNM_LOCALE ), '<a href=\"http://picons.me/\" target=\"_blank\">Picons.me</a>' ) . '</li>\n\t\t\t<li>' . sprintf( __( 'Icons by %s', BNM_LOCALE ), '<a href=\"http://www.fasticon.com/\" target=\"_blank\">FastIcon.com</a>' ) . '</li>\n\t\t\t<li>' . sprintf( __( 'Icons by %s', BNM_LOCALE ), '<a href=\"http://www.komodomedia.com/blog/2008/12/social-media-mini-iconpack/\">Komodo Media</a>' ) . '</li>\n\t\t\t<li>' . sprintf( __( 'Settings API class by %s', BNM_LOCALE ), '<a href=\"http://alisothegeek.com/2011/01/wordpress-settings-api-tutorial-1/\" target=\"_blank\">Aliso the Geek</a>' ) . '</li>\n\t\t\t<li>' . sprintf( __( 'RSS feed mashing by %s', BNM_LOCALE ), '<a href=\"http://simplepie.org/\" target=\"_blank\">SimplePie</a>' ) . '</li>\n\t\t</ul>';\n\t\t\n\t\techo '</div>\n\t\t\t</div>';\n\t\t\t\n\t\t/* That's it!\n\t\t========================================================*/\n\t\t\n\t\techo '</div>';\n\t\t\n\t}",
"public function sidebar() {\n $args = func_get_args();\n $sidebar = $args[0];\n\n if (!is_array($sidebar)) {\n $sidebar = array('label' => $sidebar);\n }\n\n if (isset($args[1]) && is_string($args[1])) {\n $sidebar['action'] = $args[1];\n }\n\n $sidebar = array_merge(array(\n 'tab' => $this->tab(),\n 'action' => null,\n 'flag' => true,\n 'id' => $this->id(),\n ), $sidebar);\n\n $this->hook($sidebar['tab'] . '-sidebar', 'createSideMenu', array(\n $sidebar['id'],\n $sidebar['label'],\n $sidebar['action'],\n $sidebar['flag'])\n );\n }",
"protected function render_sidebar() {\n $settings = $this->get_settings_for_display();\n $sidebar = $settings['sidebar'];\n\n if (empty($sidebar)) {\n return;\n }\n\n dynamic_sidebar($sidebar);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get some individual details from a player's page. | public function retrieveDetailsFromPlayerPage(AhglPlayer $player)
{
$webpage = self::LEAGUE_BASE_URL . $player->getAhglProfileUrl();
$this->_crawler->addHtmlContent(file_get_contents($webpage), 'UTF-8');
$playerDataNode = $this->_crawler->filter('.content-section-1')->getNode(0);
$player->setAhglRecord($playerDataNode->childNodes->item(9)->nodeValue);
sleep(0.3);
return $player;
} | [
"public function getDetails(int $player);",
"public function details(int $player);",
"function getPlayers($page){\n\t$curl = curl_init();\n\t$url = \"https://www.balldontlie.io/api/v1/players?per_page=10&page=\".$page;\n\n\tcurl_setopt($curl, CURLOPT_URL, $url);\n\tcurl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\t$result = curl_exec($curl);\n\n\t// Decode object ()\n\t$result = json_decode($result);\n\n\tcurl_close($curl);\n\treturn $result->data;\n}",
"public function getPlaylyfePlayerProfile($playerID);",
"public function getPageDetails()\n {\n global $mysqli,$_GET;\n\n $offer_query = $mysqli->query(\"SELECT OFR.title, OFR.type, OFR.school_id, SHL.title AS schoolname FROM offers OFR INNER JOIN schools SHL ON SHL.id=OFR.school_id WHERE OFR.id=\".$_GET[\"ofrid\"]);\n $result = $offer_query->fetch_object();\n\n $type = ($result->type!='')? ' <small>(Typ: '.$result->type.')</small>':'';\n $title = $result->title. $type . ' <small>in '.$result->schoolname.'</small>';\n\n //inputs to add modal on page load\n $statuses = $this->getDateStatusOptions();\n\n return [\"title\"=>$title,\"sid\"=>$result->school_id,\"status_opt\"=>$statuses];\n }",
"public function retrievePlayerInfo(){\n\t\t\tif($json = @file_get_contents($this->url_player . KEY . \"&steamids=\" . $this->steam_id)){\n\t\t\t\t$this->error = null;\n\t\t\t} else {\n\t\t\t\t$this->error = USER_NOT_FOUND;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$this->player = json_decode($json, true);\n\t\t\treturn true;\n\t\t}",
"private function getProfilePage() {\n $temp_page = $this->_curler->fetchPage(self::IMDB_URL_BASE . self::IMDB_SEARCH_PAGE . urlencode($this->_name));\n if (!stripos($temp_page, '<title>' . $this->_name)) {\n $search = new Search($temp_page, $this->_xml_parser);\n $temp_page = $this->_curler->fetchPage(self::IMDB_URL_BASE . $search->getActorLink());\n }\n $this->_profile_page = new Profile($temp_page, $this->_xml_parser);\n }",
"public function getPlayerInformation($player_id) {\n $url = IfpaApi::BASE_URL . \"player/\" . $player_id . \"?api_key=\" . $this->api_key;\n return $this->makeRequest($url);\n }",
"public function getPlayerProfile()\n {\n $userID = Auth::user()->uid;\n $playerProfile = $this->playlyfe->getPlayerProfile($userID);\n $pl_score = $this->playlyfe->getUserLevel(Auth::user()->uid);\n return view(\"playlyfe.player_profile\")\n ->with(\"playerProfile\", $playerProfile)\n ->with(\"pl_score\", $pl_score);\n }",
"public function details()\n\t{\n\t\tif ($this->_ret = $this->_html->find(\"div.info\", 0)) {\n\t\t\tforeach ($this->_ret->find(\"div.row\") as $row) {\n\t\t\t\tif ($this->_ret = $row->find(\"h5\", 0)) {\n\t\t\t\t\tswitch (trim($this->_ret->plaintext)) {\n\t\t\t\t\t\tcase \"Genre\" :\n\t\t\t\t\t\tcase \"Platform\" :\n\t\t\t\t\t\tcase \"Platforms\" :\n\t\t\t\t\t\tcase \"Developer\" :\n\t\t\t\t\t\tcase \"Publisher\" :\n\t\t\t\t\t\t\t$this->_res['gamedetails'][$this->_ret->plaintext] = trim($this->_ret->next_sibling()->plaintext);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $this->_res;\n\t}",
"public function getplayerdata()\n\t{ \n\t\t$this->load->model('getplayerdata'); //Load the class \n\t\t$this->getplayerdata->getplayerdatabyplayer($_GET['player']); //JSON response\n\t\t \t\n\t}",
"public function getPlayInfo()\n {\n return $this->callGet('getPlayInfo');\n }",
"public function get_profile($player_name)\n {\n return $this->get_json($this->base_runemetrics_url.'profile/profile?user='.$this->norm($player_name).'&activities=20');\n }",
"public function get_name(){\n return $this->get_info('player_name');\n }",
"function playerAction()\n {\n $pageTitle = 'Player Listings';\n $playerLinkStyle = 'current_page';\n $isLoggedIn = $this->isLoggedInFromSession();\n $username = $this->usernameFromSession();\n\n $players = Player::getAll();\n\n require_once __DIR__ . '/../templates/players.php';\n\n }",
"public function getProfile()\n {\n $played = $portrait = $rank = [];\n\n foreach (['us', 'eu', 'kr'] as $region) {\n $dom = new Dom();\n $dom->load('https://playoverwatch.com/en-us/career/pc/'.$region.'/'.str_replace('#', '-', $this->tag));\n\n try {\n $portrait[$region] = $dom->find('.player-portrait')->getAttribute('src');\n } catch (Exception $e) {\n break;\n }\n\n $rank_wrapper = $dom->find('.competitive-rank', 0);\n\n if (!is_null($rank_wrapper)) {\n $rank[$region] = $rank_wrapper->find('.h6', 0)->text;\n } else {\n $rank[$region] = 0;\n }\n\n foreach ($dom->find('td') as $line) {\n if ($line->text == 'Games Played') {\n $played[$region] = $line->nextSibling()->text;\n break; // Getting first one\n }\n }\n }\n\n if (empty($played)) {\n die('Looks like no overwatch profiles were found for this battle.net account. If you believe that\\'s an error, please report this.');\n }\n\n $newest_region = array_search(max($played), $played);\n\n $this->avatar_url = $portrait[$newest_region];\n $this->rank = $rank[$newest_region];\n $this->prefered_region = $newest_region;\n\n $this->save();\n }",
"function info_playerInfo($pID) {\n\t\tif (!$pList = $this->info_playerList()) return false;\n\t\tforeach ($pList as $player)\n\t\t\tif ($player[1] == $pID)\n\t\t\t\treturn $player;\n\t\treturn false;\n\t}",
"function printPlayerInfo() {\n $pinfo_string = $this->first_name . \" \"\n \t\t . $this->last_name . \" (\"\n \t\t . $this->gender . \", \"\n \t\t . $this->email . \", \"\n \t\t . $this->phone_number . \")\";\n return $pinfo_string;\n }",
"private static function GetPlayerInfo(string $id) {\n\t\t$response = self::GetRequest(self::Profile . $id . '?xml=1');\n\t\tif($xml = simplexml_load_string($response))\n\t\t\tif(!$xml->error) {\n\t\t\t\t$realName = html_entity_decode((string)$xml->steamID);\n\t\t\t\tif(isset($xml->customURL) && (string)$xml->customURL) {\n\t\t\t\t\t$username = (string)$xml->customURL;\n\t\t\t\t\t$profile = 'https://steamcommunity.com/id/' . $username;\n\t\t\t\t} else {\n\t\t\t\t\t$username = $realName;\n\t\t\t\t\t$profile = self::Profile . $id;\n\t\t\t\t}\n\t\t\t\t$avatar = (string)$xml->avatarMedium; // 64px\n\t\t\t\treturn new PlayerInfo($username, $realName, $profile, $avatar);\n\t\t\t}\n\t\treturn new PlayerInfo('', '', self::Profile . $id, '');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a field to User Fields Parameter (uf) | public function addUserField($field)
{
} | [
"public function AddField();",
"function addToField(\\Foundation\\Form\\Field $field);",
"function et_register_user_field( $name, $args ){\n\tglobal $et_global;\n\t$user_fields = $et_global['user_fields'];\n\t$args = wp_parse_args($args, array(\n\t\t'title' \t\t=> '',\n\t\t'description' \t=> '',\n\t\t'type' \t\t\t=> 'int',\n\t\t'role' \t\t\t=> 'all',\n\t\t'display_profile' => true\n\t\t));\n\t$user_fields->register($name, $args);\n}",
"function add_field($user) {\n?>\n\t\t<table class=\"form-table\">\n\t\t\t<tr>\n\t\t\t\t<th><label for=\"jdwavatar\">Avatar</label></th>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"url\" name=\"jdwavatar\" id=\"jdwavatar\" value=\"<?php echo esc_attr(get_the_author_meta('jdwavatar', $user->ID)); ?>\" placeholder=\"http://\" class=\"regular-text\" /><br />\n\t\t\t\t\t<span class=\"description\">Saisissez l'URL d'une image.</span>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n<?php\n\t}",
"public function addUserFields( $user )\n { \n $user = new \\Squeeze\\Core\\User($user->data->ID);\n\n $fieldName = $user->get_meta('fieldName');\n\n echo $this->view->load('AdminUserFields', array(\n 'fieldName' => $fieldName,\n ));\n }",
"public function & AddFields (/* ...$fields */);",
"function ExtraUserInfo_add($user) {\n\n $field_val = get_user_meta($user->ID, $this->field_name);\n\n if(is_array($field_val)) :\n\n if(empty($field_val)) :\n $field_val[0] = \"\";\n endif;\n \n $field_val = $field_val[0];\n endif;\n\n ?>\n <table class=\"form-table\">\n <tr>\n <th>\n <label for=\"<?php echo $this->field_name; ?>\">\n <?php echo $this->field_title; ?>\n </label>\n </th>\n <td>\n <input \n type=\"text\" \n id=\"<?php echo $this->field_name; ?>\"\n name=\"<?php echo $this->field_name; ?>\"\n value=\"<?php echo $field_val; ?>\"/>\n <br/>\n <span class=\"description\">\n <?php echo $this->field_description; ?>\n </span>\n </td>\n </tr>\n </table>\n\n <?php\n\n }",
"function add_field($field_name){\n $this->fields[] = $field_name;\n }",
"public function setUserFields($fields){}",
"function add_field($field, $value)\r\n\t\t{\r\n\t\t// adds a key=>value pair to the fields array, which is what will be\r\n\t\t// sent to paypal as POST variables. If the value is already in the\r\n\t\t// array, it will be overwritten.\r\n\t\t$this->fields[\"$field\"] = $value;\r\n\t\t}",
"public function addUserExtensionField()\n\t{\n\t\t$module = vtlib\\Module::getInstance('Users');\n\t\tif ($module) {\n\t\t\t$module->initTables();\n\t\t\t$blockInstance = vtlib\\Block::getInstance('LBL_MORE_INFORMATION', $module->id);\n\t\t\tif ($blockInstance) {\n\t\t\t\t$fieldInstance = new vtlib\\Field();\n\t\t\t\t$fieldInstance->name = 'phone_crm_extension';\n\t\t\t\t$fieldInstance->label = 'CRM Phone Extension';\n\t\t\t\t$fieldInstance->uitype = 11;\n\t\t\t\t$fieldInstance->typeofdata = 'V~O';\n\t\t\t\t$blockInstance->addField($fieldInstance);\n\t\t\t}\n\t\t}\n\t\t\\App\\Log::info('User Extension Field added');\n\t}",
"public function addFields() {}",
"public function setUserFields($fields)\n {\n }",
"function fc_profile_fields($user) { ?>\n\t\t<h3>Additional profile information</h3>\n\t\t<table class=\"form-table\">\n\t\t\t<tr>\n\t\t\t\t<th><label for=\"fc_org_affiliation\">Affiliation</label></th>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" name=\"fc_org_affiliation\" id=\"fc_org_affiliation\" value=\"<?php echo esc_attr( get_user_meta($user->ID, 'affiliation', true) ); ?>\" class=\"regular-text\" /><br />\n\t\t\t\t\t<span class=\"description\">If you are affiliated with a particular foraging group (e.g. Forage Oakland), you can note that here.</span>\n\t\t\t\t</td>\n\t\t\t</tr>\n\n\t\t</table>\n<?php\n}",
"public function register_field() {}",
"function set_custom_field($member,$field,$amount)\n\t{\n\t\t$id=$this->connection->query_value_null_ok('profilefields','profilefieldid',array('title'=>'ocp_'.$field));\n\t\tif (is_null($id)) return;\n\t\t$this->connection->query_update('userfields',array('field'.strval($id)=>$amount),array('userid'=>$member),'',1);\n\t}",
"function bcbg_rcp_add_user_fields() {\n\t\n\t$business_phone = get_user_meta( get_current_user_id(), 'rcp_business_phone', true );\n\t$business_name = get_user_meta( get_current_user_id(), 'rcp_business_name', true );\n\t?>\n\t<p>\n\t\t<label for=\"rcp_business_phone\"><?php _e( 'Your Business Phone', 'rcp' ); ?></label>\n\t\t<input name=\"rcp_business_phone\" id=\"rcp_business_phone\" type=\"text\" value=\"<?php echo esc_attr( $business_phone ); ?>\"/>\n\t</p>\n\t<p>\n\t\t<label for=\"rcp_business_name\"><?php _e( 'Your Business Name', 'rcp' ); ?></label>\n\t\t<input name=\"rcp_business_name\" id=\"rcp_business_name\" type=\"text\" value=\"<?php echo esc_attr( $business_name ); ?>\"/>\n\t</p>\n\t<?php\n}",
"public function AddFields ($fields);",
"function brady_extra_user_profile_fields( $user ) {\n?>\n<h3>Facility Name</h3>\n<table class=\"form-table\">\n <tr>\n <th><label for=\"facility_name\">Facility Name</label></th>\n <td>\n <input type=\"text\" id=\"facility_name\" name=\"facility_name\" size=\"20\" value=\"<?php echo esc_attr( get_the_author_meta( 'facility_name', $user->ID )); ?>\">\n <span class=\"description\">Please enter Facility Name</span>\n </td>\n </tr>\n</table>\n<?php\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets any ValidationFailed objects that resulted from last call to validate(). | public function getValidationFailures()
{
return $this->validationFailures;
} | [
"public function getFailedValidationData()\n {\n $this->_objData = FormUtil::getFailedValidationObjects($this->_objPath);\n return $this->_objData;\n }",
"public function getValidationErrors() {\n\t\treturn $this->validationErrors;\n\t}",
"protected function getValidationErrors()\n {\n return $this->validation->errors();\n }",
"public function errors(){\n $errors = array();\n foreach($this->validators as $validator){\n $errors = array_merge($errors, $this->{$validator}());\n }\n return $errors;\n }",
"public function lastErrors()\n\t{\n\t\treturn $this->lastErrors;\n\t}",
"public function getValidationErrors() : array\n {\n $errors = [];\n\n if ($this->validationHasFailed()) {\n foreach ($this->getMessages() as $message) {\n if (isset($errors[$message->getField()])) {\n $errors[$message->getField()] .= ' ' . $message->getmessage();\n } else {\n $errors[$message->getField()] = $message->getmessage();\n }\n }\n }\n\n return $errors;\n }",
"public function get_validation_errors()\n\t{\n\t\treturn $this->_validation_errors;\n\t}",
"public function getFailedFields()\n {\n return $this->validator->failed();\n }",
"public function getValidationErrors() {\n $errors = $this->getFormState()->getData('validation_errors');\n return !empty($errors[$this->form_item->getName()]) ? $errors[$this->form_item->getName()] : NULL;\n }",
"public function getValidationResults()\n {\n $validatorResults = $this->validators->map(\n function($validator){\n /** @var Validator $validator */\n return $validator->validate();\n }\n );\n\n return $validatorResults;\n }",
"public function getValidationRelatedErrors()\r\n {\r\n return $this->validationRelatedErrors;\r\n }",
"public static function getFailedRules()\n {\n return static::$rulesErrors;\n }",
"public function validationResults() {\n return $this->Validation->results();\n }",
"public function getErrors()\n {\n $errors = [];\n\n foreach ($this->getRulesExecutionResult() as $ruleExecutionResult) {\n if (null !== $ruleExecutionResult->getError()) {\n $ruleExecutionResult->getError()->setPropertyName($this->getName());\n $errors[] = $ruleExecutionResult->getError();\n }\n }\n\n return $errors;\n }",
"public function getValidationErrorCount() {\n\t\treturn $this->_validationErrorCount;\n\t}",
"public function getLastErrors() {\n\t\treturn $this->mysql->getLastErrors();\n\t}",
"public function failList() {\n\t\treturn array_reduce($this->errors, 'array_merge', array());\n\t}",
"public function getFailedMessages()\n\t{\n\t\t$messages = array();\n\t\tforeach ($this->selectInput() AS $k => $input)\n\t\t{\n\t\t\tif ($input->hasRules() AND $input->hasFailMessage())\n\t\t\t{\n\t\t\t\t$messages[$k] = $input->getFailMessage();\n\t\t\t}\n\t\t}\n\n\t\treturn $messages;\n\t}",
"public function getValidationErrorMessages()\n {\n return $this->validationErrorMessages;\n }",
"public function getFailedRules()\n\t{\n\t\treturn $this->failedRules;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an array of TestFailure objects for the failures. | public function failures(): array
{
return $this->failures;
} | [
"public function getFailedTestCaseResults(): array\n {\n return $this->failedTestCaseResults;\n }",
"public function getFailures(): array\n {\n $errors = [];\n\n foreach ($this->getActionExceptions() as $actionException) {\n $errors[] = $actionException->getMessage();\n }\n\n return $errors;\n }",
"public function getFailures()\n {\n $errors = array();\n foreach ($this->getResponseSet()->getBulkResponses() as $bulkResponse) {\n if ($bulkResponse->hasError()) {\n $error = array(\n 'action' => $bulkResponse->getOpType(),\n ) + $bulkResponse->getData();\n $errors[] = $error;\n }\n }\n\n return $errors;\n }",
"public function failList() {\n\t\treturn array_reduce($this->errors, 'array_merge', array());\n\t}",
"public function failures()\n {\n return $this->getMailer()->failures();\n }",
"public function getFailedSpecs()\n {\n return $this->failed;\n }",
"function getTestsResults(): array\n{\n global $failures, $testsCount;\n\n $success = $testsCount - $failures;\n\n return [\n 'tests' => $testsCount,\n 'failures' => $failures,\n 'success' => $success\n ];\n}",
"public function getArrayValidationFailuresMessage() {\n $r = [];\n if (!empty($this->_validationFailures)) {\n for ($i = 0, $size = sizeof($this->_validationFailures); $i < $size; ++$i) {\n $r[] = $this->_validationFailures[$i]->getMessage();\n }\n }\n return $r;\n }",
"public function generateReturnFailOutput() {\n $date = format_date(time(), $type = 'medium', $format = '', $timezone = NULL, $langcode = NULL);\n $file_url = l($this->filename, $this->relative_path, $options = array('attributes' => array('target' => '_blank', 'id' => 'test-file')));\n $file_message = array(\n 'file' => $this->filename,\n 'error' => 0,\n 'message' => \"$date <br> File $file_url tested.\"\n );\n $message = t('@date: <br> Error running test @name ', array('@date' => $date, '@name' => $this->filename));\n watchdog('behat_editor', \"%date Error Running Test %name\", $variables = array('%date' => $date, '%name' => $this->filename), $severity = WATCHDOG_ERROR, $link = $this->absolute_file_path);\n $output = array('message' => $message, 'file' => $this->filename, 'error' => TRUE);\n $results = array('file' => $file_message, 'test' => $output, 'error' => 1, 'message' => $message);\n return $results;\n }",
"public function getTestsResults()\n {\n return array_map(\n function ($test) {\n return $this->getTestResult($test);\n },\n $this->config->getTests()\n );\n }",
"public function getErredTestResults() {\n\t\t\t$erredTests = array();\n\t\t\tforeach ($this->getAllTestResults() as $testResult) {\n\t\t\t\tif ($testResult instanceof ErredTestResult) {\n\t\t\t\t\t$erredTests[] = $testResult;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $erredTests;\n\t\t}",
"public function getSlowTests(): array\n {\n return $this->slowTests;\n }",
"public function getValidationTestData()\r\n {\r\n $testData = array(\r\n array(array(), 1),\r\n array(array('message' => 'Foo', 'url' => 'http://www.example.com'), 0),\r\n array(array('message' => 'Foo', 'url' => 'no valid URL'), 1)\r\n );\r\n \r\n return $testData;\r\n }",
"public function getFailures($a_section)\n\t{\n\t\treturn (array) $this->failures_by_section[$a_section];\n\t}",
"public function getStatus() {\n\t\t$a = array();\n\t\tforeach($this->results as $test_case) {\n\t\t\t$m = array();\n\t\t\t$total = 0;\n\t\t\t$passed = 0;\n\t\t\tforeach ($test_case['methods'] as $method) {\n\t\t\t\t$total++;\n\t\t\t\tif ($this->isPassed($method)) {\n\t\t\t\t\t++$passed;\n\t\t\t\t} else {\n\t\t\t\t\t$m = array_merge($method['fails'], $method['exceptions'], $method['errors']);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$a[$test_case['name']] = array(\n\t\t\t\t'methods'=> array_keys($test_case['methods']),\n\t\t\t\t'messages' => $m,\n\t\t\t\t'passed' => $passed,\n\t\t\t\t'failed' => ($total - $passed)\n\t\t\t);\n\t\t}\n\t\treturn $a;\n\t}",
"public function provideTestFailBuildIndex()\n {\n $cases = array();\n\n $definition = \"<?php class XXXTest\".uniqid().\" {} ?>\";\n\n $testHelper = new AutoloaderTestHelper($this);\n $testHelper->makeClass('Test', 'testFailBuildIndexA/');\n $testHelper->makeClass('Test', 'testFailBuildIndexA/', $definition);\n $testHelper->makeClass('Test', 'testFailBuildIndexA/', $definition);\n $cases[] = array(new Autoloader(\n $testHelper->getClassDirectory('testFailBuildIndexA')));\n\n $testHelper = new AutoloaderTestHelper($this);\n $testHelper->makeClass('Test', 'testFailBuildIndexB/A', $definition);\n $testHelper->makeClass('Test', 'testFailBuildIndexB/A');\n $testHelper->makeClass('Test', 'testFailBuildIndexB/B', $definition);\n $testHelper->makeClass('Test', 'testFailBuildIndexB/B');\n $cases[] = array(new Autoloader(\n $testHelper->getClassDirectory('testFailBuildIndexB')));\n\n return $cases;\n }",
"public function getFails()\n {\n return $this->getResultsFiltered(false);\n }",
"public function generateFailureMessages(PHP_CodeSniffer_File $file)\n {\n $testFile = $file->getFilename();\n $foundErrors = $file->getErrors();\n $foundWarnings = $file->getWarnings();\n $expectedErrors = $this->getErrorList(basename($testFile));\n $expectedWarnings = $this->getWarningList(basename($testFile));\n\n if (!is_array($expectedErrors)) {\n throw new PHP_CodeSniffer_Exception('getErrorList() must return an array');\n }\n\n if (!is_array($expectedWarnings)) {\n throw new PHP_CodeSniffer_Exception('getWarningList() must return an array');\n }\n\n /*\n We merge errors and warnings together to make it easier\n to iterate over them and produce the errors string. In this way,\n we can report on errors and warnings in the same line even though\n it's not really structured to allow that.\n */\n $allProblems = [];\n $failureMessages = [];\n foreach ($foundErrors as $line => $lineErrors) {\n if (!array_key_exists($line, $allProblems)) {\n $allProblems[$line] = ['expected_errors' => 0, 'expected_warnings' => 0, 'found_errors' => [], 'found_warnings' => []];\n }\n\n foreach ($lineErrors as $column => $errors) {\n $errorsTemp = [];\n foreach ($errors as $foundError) {\n $errorsTemp[] = $foundError['message'];\n }\n\n $allProblems[$line]['found_errors'] = array_merge($allProblems[$line]['found_errors'], $errorsTemp);\n }\n\n $allProblems[$line]['expected_errors'] = array_key_exists($line, $expectedErrors) ? $expectedErrors[$line] : 0;\n unset($expectedErrors[$line]);\n }\n\n foreach ($expectedErrors as $line => $numErrors) {\n if (!array_key_exists($line, $allProblems)) {\n $allProblems[$line] = ['expected_errors' => 0, 'expected_warnings' => 0, 'found_errors' => [], 'found_warnings' => []];\n }\n\n $allProblems[$line]['expected_errors'] = $numErrors;\n }\n\n foreach ($foundWarnings as $line => $lineWarnings) {\n if (!array_key_exists($line, $allProblems)) {\n $allProblems[$line] = ['expected_errors' => 0, 'expected_warnings' => 0, 'found_errors' => [], 'found_warnings' => []];\n }\n\n foreach ($lineWarnings as $column => $warnings) {\n $warningsTemp = [];\n foreach ($warnings as $warning) {\n $warningsTemp[] = $warning['message'];\n }\n\n $allProblems[$line]['found_warnings'] = array_merge($allProblems[$line]['found_warnings'], $warningsTemp);\n }\n\n $allProblems[$line]['expected_warnings'] = array_key_exists($line, $expectedWarnings) ? $expectedWarnings[$line] : 0;\n unset($expectedWarnings[$line]);\n }\n\n foreach ($expectedWarnings as $line => $numWarnings) {\n if (!array_key_exists($line, $allProblems)) {\n $allProblems[$line] = ['expected_errors' => 0, 'expected_warnings' => 0, 'found_errors' => [], 'found_warnings' => []];\n }\n\n $allProblems[$line]['expected_warnings'] = $numWarnings;\n }\n\n ksort($allProblems);\n foreach ($allProblems as $line => $problems) {\n $numErrors = count($problems['found_errors']);\n $numWarnings = count($problems['found_warnings']);\n $expectedErrors = $problems['expected_errors'];\n $expectedWarnings = $problems['expected_warnings'];\n $errors = '';\n $foundString = '';\n\n if ($expectedErrors !== $numErrors || $expectedWarnings !== $numWarnings) {\n $lineMessage = \"[LINE {$line}]\";\n $expectedMessage = 'Expected ';\n $foundMessage = 'in ' . basename($testFile) . ' but found ';\n\n if ($expectedErrors !== $numErrors) {\n $expectedMessage .= \"{$expectedErrors} error(s)\";\n $foundMessage .= \"{$numErrors} error(s)\";\n if ($numErrors !== 0) {\n $foundString .= 'error(s)';\n $errors .= implode(\"\\n -> \", $problems['found_errors']);\n }\n\n if ($expectedWarnings !== $numWarnings) {\n $expectedMessage .= ' and ';\n $foundMessage .= ' and ';\n\n if ($numWarnings !== 0 && $foundString !== '') {\n $foundString .= ' and ';\n }\n }\n }\n\n if ($expectedWarnings !== $numWarnings) {\n $expectedMessage .= \"{$expectedWarnings} warning(s)\";\n $foundMessage .= \"{$numWarnings} warning(s)\";\n if ($numWarnings !== 0) {\n $foundString .= 'warning(s)';\n if ($errors !== '') {\n $errors .= \"\\n -> \";\n }\n\n $errors .= implode(\"\\n -> \", $problems['found_warnings']);\n }\n }\n\n $fullMessage = \"{$lineMessage} {$expectedMessage} {$foundMessage}.\";\n if ($errors !== '') {\n $fullMessage .= \" The {$foundString} found were:\\n -> {$errors}\";\n }\n\n $failureMessages[] = $fullMessage;\n }\n }\n\n return $failureMessages;\n }",
"public function testFailure() {\n\t\t$test = new Failure( 'runTest' );\n\t\t$test->run( $this->result );\n\n\t\t$this->assertSame( 1, $this->listener->startTestCount, 'test start count failed' );\n\t\t$this->assertSame( 1, $this->listener->failureCount, 'failure count failed' );\n\t\t$this->assertSame( 1, $this->listener->endTestCount, 'test end count failed' );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Registers the onboarding steps. The argument is an array of the onboarding steps definition. | public function registerSteps(array $definitions)
{
$defaultDefinitions = [
'code' => null,
'label' => null,
'description' => null,
'icon' => null,
'url' => null,
'priority' => null,
'complete' => null,
];
foreach ($definitions as $code => $definition) {
$definition['code'] = $code;
$item = (object)array_merge($defaultDefinitions, $definition);
$item->completed = function () use ($item) {
$callable = $item->complete ?? null;
return $this->stepIsCompleted($callable);
};
$this->steps[$code] = $item;
}
} | [
"function setSteps($steps = []);",
"public function add_setup_step( $steps ) {\n\t\t$completed = get_option( $this->option, false ) && $this->api->can_make_request_with_token() ? true : false;\n\n\t\t$step = array(\n\t\t\t'title' => 'Automatic Updates',\n\t\t\t'completed' => $completed,\n\t\t\t'documentation' => array()\n\t\t);\n\n\t\t$steps = array( 'updates' => $step ) + $steps;\n\n\t\treturn $steps;\n\t}",
"public function insertSteps(array $steps)\r\n {\r\n foreach($steps as $step)\r\n {\r\n $this->insertStep($step);\r\n }\r\n }",
"public function setActionSteps(?array $value): void {\n $this->getBackingStore()->set('actionSteps', $value);\n }",
"protected function define_my_steps() {\n //$this->add_step(new backup_choice_activity_structure_step('choice_structure', 'choice.xml'));\n \n $this->add_step(new backup_ereflect_activity_structure_step('ereflect_structure', 'ereflect.xml'));\n \n \n }",
"public function setSteps($steps) {\n\t\t$this->steps = $steps;\n\t}",
"public function steps(): array;",
"protected function loadSteps()\r\n {\r\n $t = $this->getAnnotations();\r\n\r\n if(isset($t['class']['stepClass'])) {\r\n \t$stepClasses = $t['class']['stepClass'];\r\n }\r\n\r\n if (!empty($stepClasses)) {\r\n $this->_stepRunner = $this->register(new StepRunner());\r\n foreach ($stepClasses as $class) {\r\n $runner = $this->register(new $class(), true);\r\n $this->_stepRunner->addStepModule($runner);\r\n }\r\n } else {\r\n $this->_stepRunner = null;\r\n }\r\n }",
"protected function define_my_steps() {\n $this->add_step(new backup_term_activity_structure_step('term_structure', 'term.xml'));\n }",
"protected function define_my_steps() {\n $this->add_step(new backup_xfgon_activity_structure_step('xfgon structure', 'xfgon.xml'));\n }",
"public function getWizardSteps();",
"protected function define_my_steps() {\n $this->add_step(new backup_tadc_activity_structure_step('tadc_structure', 'tadc.xml'));\n }",
"protected function define_my_steps () {\n $this->add_step(new backup_iassign_activity_structure_step('iassign_structure', 'iassign.xml'));\n }",
"public function setSteps(?array $value): void {\n $this->getBackingStore()->set('steps', $value);\n }",
"private function _setSteps()\n {\n $this->_fields['step']\n ->addStep('start')\n ->addStep('step2')\n ->setAttribute('value', 'start')\n ;\n }",
"protected function define_my_steps() {\n $this->add_step(new backup_fhrorganizaciones_activity_structure_step('fhrorganizaciones_structure', 'fhrorganizaciones.xml'));\n }",
"public function addStep(callable $step);",
"protected function define_my_steps() {\n // Choice only has one structure step\n $this->add_step(new restore_activitystatus_activity_structure_step('activitystatus_structure', 'activitystatus.xml'));\n }",
"public function setSteps($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Eolymp\\Executor\\Report\\Step::class);\n $this->steps = $arr;\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Iterator interface Get current ImageSize | public function current(): ImageSize
{
return $this->sizes[$this->key()];
} | [
"public function getImageSize() \n {\n return $this->_imageSize; \n }",
"public function getImageSize()\n {\n return $this->imageSize;\n }",
"protected function _getImageSize()\n {\n return getimagesize($this->getFileName());\n }",
"public function get_image_size(){\n\t\treturn (int) $this->v_image_size;\n\t}",
"function size () {\n\t\t$ret = NULL;\n\t\tif (function_exists('getimagesize')) :\n\t\t\t$ret = getimagesize($this->streamify(__CLASS__.\".\".__METHOD__));\n\t\tendif;\n\t\treturn $ret;\n\t}",
"public function getSize() {\n\t\treturn $this->size;\n\t}",
"public function getImageWidth() {\r\n\t\t$current = $this->getCurrentImage();\r\n\t\treturn $current['width'];\r\n\t}",
"public function getImageSizeList()\r\n\t{\r\n\t\treturn System::getImageSizes()['image_sizes'];\r\n\r\n\t}",
"public function get_image_size(){\n return $this->get_info('player_image_size');\n }",
"function GetBitmapSize(){}",
"public function __getSize(){\n return $this->$size\n }",
"public function getImageFileSize()\n\t{\n\t\treturn filesize($this->file);\n\t}",
"public function getSize()\n {\n return $this->file['size'] / 1024;\n }",
"public function getSize()\n\t{\n\t\treturn (int) $this->xml->children('gphoto', true)->size;\n\t}",
"public function getImageSize()\n {\n return $this->scopeConfig->getValue(\n 'magepow_ajaxcart/success_popup/product_image_size',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"public function get_image_sizes() {\n\n $instance = Blox_Common::get_instance();\n return $instance->get_image_sizes();\n }",
"abstract protected function _getImageSizeConfiguration();",
"public function isImageSize() {\n\t\treturn $this->getImageSize();\n\t}",
"public function getImage_width()\n\t {\n\t return $this->image_width;\n\t }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Gets the 'assetic.filter_manager' service. This service is shared. This method always returns the same instance of the service. | protected function getAssetic_FilterManagerService()
{
return $this->services['assetic.filter_manager'] = new \Symfony\Bundle\AsseticBundle\FilterManager($this, array());
} | [
"protected function getAssetic_FilterManagerService()\n {\n return $this->services['assetic.filter_manager'] = new \\Symfony\\Bundle\\AsseticBundle\\FilterManager($this, array('cssrewrite' => 'assetic.filter.cssrewrite'));\n }",
"protected function _getFilterManager()\n {\n if (!isset($this->_filterManager)) {\n $this->_filterManager = new FilterManager();\n }\n\n return $this->_filterManager;\n }",
"public abstract function getFilterManager();",
"protected function getPlugin_Manager_FilterService()\n {\n return $this->services['plugin.manager.filter'] = new \\Drupal\\filter\\FilterPluginManager($this->get('container.namespaces'), $this->get('cache.discovery'), $this->get('module_handler'));\n }",
"protected function getFilterManager()\n {\n $container = new FilterContainer();\n\n $filter = new MatchSearch();\n $filter->setDocumentField('title');\n $filter->setRequestField('q');\n $container->set('title_match', $filter);\n\n $filter = new MatchSearch();\n $filter->setDocumentField('description');\n $filter->setRequestField('d');\n $container->set('description_match', $filter);\n\n return new FilterManager(\n $container,\n $this->getIndex(Product::class),\n new EventDispatcher(),\n $this->createMock('JMS\\Serializer\\Serializer')\n );\n }",
"public function getFilerManger()\n {\n $container = new FiltersContainer();\n\n $variant = new VariantFilter();\n $variant->setField('parent_id');\n\n $container->set('variant', $variant);\n\n return new FiltersManager($container, $this->getManager()->getRepository('AcmeTestBundle:Product'));\n }",
"protected function getFilterManager()\n {\n $container = new FilterContainer();\n\n $filter = new MatchSearch();\n $filter->setDocumentField('title');\n $filter->setRequestField('q');\n $filter->setResetRelation(new ExcludeRelation(['description_match']));\n $filter->setSearchRelation(new ExcludeRelation(['description_match']));\n $container->set('title_match', $filter);\n\n $filter = new MatchSearch();\n $filter->setDocumentField('description');\n $filter->setRequestField('d');\n $container->set('description_match', $filter);\n\n return new FilterManager(\n $container,\n $this->getIndex(Product::class),\n new EventDispatcher(),\n $this->createMock('JMS\\Serializer\\Serializer')\n );\n }",
"public function getFilterContainer()\n {\n return $this->filterContainer;\n }",
"public function setAssetsFilterManager(\\AssetsBundle\\Service\\AssetsFilterManager $oAssetsFilterManager){\n\t\t$this->assetsFilterManager = $oAssetsFilterManager;\n\t\treturn $this;\n\t}",
"protected function getLiipImagine_Filter_ManagerService()\n {\n $this->services['liip_imagine.filter.manager'] = $instance = new \\Liip\\ImagineBundle\\Imagine\\Filter\\FilterManager($this->get('liip_imagine.filter.configuration'), $this->get('liip_imagine'), $this->get('liip_imagine.binary.mime_type_guesser'));\n\n $instance->addLoader('relative_resize', $this->get('liip_imagine.filter.loader.relative_resize'));\n $instance->addLoader('resize', $this->get('liip_imagine.filter.loader.resize'));\n $instance->addLoader('thumbnail', $this->get('liip_imagine.filter.loader.thumbnail'));\n $instance->addLoader('crop', $this->get('liip_imagine.filter.loader.crop'));\n $instance->addLoader('grayscale', $this->get('liip_imagine.filter.loader.grayscale'));\n $instance->addLoader('paste', $this->get('liip_imagine.filter.loader.paste'));\n $instance->addLoader('watermark', $this->get('liip_imagine.filter.loader.watermark'));\n $instance->addLoader('background', $this->get('liip_imagine.filter.loader.background'));\n $instance->addLoader('strip', $this->get('liip_imagine.filter.loader.strip'));\n $instance->addLoader('scale', $this->get('liip_imagine.filter.loader.scale'));\n $instance->addLoader('upscale', $this->get('liip_imagine.filter.loader.upscale'));\n $instance->addLoader('downscale', $this->get('liip_imagine.filter.loader.downscale'));\n $instance->addLoader('auto_rotate', $this->get('liip_imagine.filter.loader.auto_rotate'));\n $instance->addLoader('rotate', $this->get('liip_imagine.filter.loader.rotate'));\n $instance->addLoader('interlace', $this->get('liip_imagine.filter.loader.interlace'));\n $instance->addPostProcessor('jpegoptim', $this->get('liip_imagine.filter.post_processor.jpegoptim'));\n $instance->addPostProcessor('optipng', $this->get('liip_imagine.filter.post_processor.optipng'));\n $instance->addPostProcessor('pngquant', $this->get('liip_imagine.filter.post_processor.pngquant'));\n $instance->addPostProcessor('mozjpeg', $this->get('liip_imagine.filter.post_processor.mozjpeg'));\n\n return $instance;\n }",
"public function getFilterService(): FilterServiceInterface;",
"public function setFilterManager(FilterManagerInterface $fm);",
"protected function _getAssetManager()\n {\n if (!isset($this->_assetManager)) {\n $this->_assetManager = new AssetManager();\n }\n\n return $this->_assetManager;\n }",
"public function getAssetManager()\n {\n if (!$this->assetManager) {\n $this->assetManager = new AssetManager($this);\n }\n return $this->assetManager;\n }",
"public function getFilter() {\r\n return $this->_provider->get('PM\\Profiler\\Repository\\Filter');\r\n }",
"public function getFilterRepository()\n {\n if (!$this->filterRepository) {\n $this->filterRepository = $this->getEntityManager()->getRepository('Application\\Model\\Filter');\n }\n\n return $this->filterRepository;\n }",
"protected function getOroFilter_EntityFilterService()\n {\n return $this->services['oro_filter.entity_filter'] = new \\Oro\\Bundle\\FilterBundle\\Filter\\EntityFilter($this->get('form.factory'), $this->get('oro_filter.filter_utility'));\n }",
"protected function getApiPlatform_Serializer_ContextBuilder_FilterService()\n {\n $a = ($this->privates['api_platform.metadata.resource.metadata_factory.cached'] ?? $this->getApiPlatform_Metadata_Resource_MetadataFactory_CachedService());\n\n return $this->privates['api_platform.serializer.context_builder.filter'] = new \\ApiPlatform\\Core\\Serializer\\SerializerFilterContextBuilder($a, ($this->privates['api_platform.filter_locator'] ?? $this->privates['api_platform.filter_locator'] = new \\Symfony\\Component\\DependencyInjection\\ServiceLocator(array())), new \\ApiPlatform\\Core\\Serializer\\SerializerContextBuilder($a));\n }",
"public function getFilerManger()\n {\n $container = new FilterContainer();\n\n $match = new MatchSearch();\n $match->setRequestField('q');\n $match->setDocumentField('title^0.5,description^2');\n\n $container->set('match', $match);\n\n return new FilterManager(\n $container,\n $this->getIndex(Product::class),\n new EventDispatcher(),\n $this->createMock('JMS\\Serializer\\Serializer')\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets whether the payload's content gets passed through mb_convert_encoding() Returns PEAR_ERROR object if mb_convert_encoding() isn't available. | function setConvertPayloadEncoding($in)
{
if ($in && !function_exists('mb_convert_encoding')) {
return $this->raiseError('mb_convert_encoding() is not available',
XML_RPC_ERROR_PROGRAMMING);
}
$this->convert_payload_encoding = $in;
} | [
"protected function canUseMbString()\n {\n return $this->globalFunctionsHelper->function_exists('mb_convert_encoding');\n }",
"protected function detectCharset()\n {\n // set the default\n $encode = new Encode;\n $encode->from($this->defaultCharset);\n $encode->to($this->defaultCharset);\n\n if ( ! is_null($this->options->enforceEncoding)) {\n // they want to enforce the given encoding\n $encode->from($this->options->enforceEncoding);\n $encode->to($this->options->enforceEncoding);\n\n return false;\n }\n\n $meta = $this->root->find('meta[http-equiv=Content-Type]', 0);\n if (is_null($meta)) {\n // could not find meta tag\n $this->root->propagateEncoding($encode);\n\n return false;\n }\n $content = $meta->content;\n if (empty($content)) {\n // could not find content\n $this->root->propagateEncoding($encode);\n\n return false;\n }\n $matches = [];\n if (preg_match('/charset=(.+)/', $content, $matches)) {\n $encode->from(trim($matches[1]));\n $this->root->propagateEncoding($encode);\n\n return true;\n }\n\n // no charset found\n $this->root->propagateEncoding($encode);\n\n return false;\n }",
"public static function getIsMbstringEnabled()\n\t{\n\t\tif (isset(self::$_isMbstringEnabled)) {\n\t\t\treturn self::$_isMbstringEnabled;\n\t\t}\n\n\t\tself::$_isMbstringEnabled = function_exists('mb_convert_encoding') ?\n\t\t\ttrue : false;\n\n\t\treturn self::$_isMbstringEnabled;\n\t}",
"protected function mbstring(): bool\n {\n return extension_loaded('mbstring');\n }",
"function reset_mbstring_encoding() {\n mbstring_binary_safe_encoding( true );\n}",
"public function testSetEncodingWithInvalidValue()\n {\n $connection = new Phergie_Connection;\n try {\n $connection->setEncoding('blah');\n $this->fail('Expected exception was not thrown');\n } catch (Phergie_Connection_Exception $e) {\n return;\n } catch (Exception $e) {\n $this->fail('Unexpected exception was thrown');\n }\n\n if (extension_loaded('mbstring')) {\n return;\n }\n\n try {\n $connection->setEncoding('UTF-8');\n } catch (Phergie_Connection_Exception $e) {\n return;\n } catch (Exception $e) {\n $this->fail('Unexpected exception was thrown');\n }\n }",
"public function testSetEncoding(): void\n {\n $test = FL\\StringHelper::getInstance(\"even more test strings\", \"UTF-8\");\n $this->assertEquals($test->getEncoding(), \"UTF-8\");\n\n $test->setEncoding(\"\");\n $this->assertEquals($test->getEncoding(), \\mb_internal_encoding());\n }",
"public static function mbstring_loaded()\n {\n $return = extension_loaded('mbstring');\n\n if ($return === true) {\n mb_internal_encoding('UTF-8');\n }\n\n return $return;\n }",
"public function setContent($content) {\n if(is_string($content)){\n if((strlen(utf8_decode($content))) > 1){\n $this->_content = $content;\n }\n }\n }",
"public function checkContentCharsetRequestHeader() : bool;",
"public function convCharset($inCharset=\"UTF-8\", $outCharset=\"CP1252//IGNORE\") {\r\n $retval = iconv($inCharset, $outCharset, $this->contents);\r\n if ($retval !== FALSE) {\r\n $this->contents = $retval;\r\n return true;\r\n }\r\n return false;\r\n }",
"public function checkContentEncodingRequestHeader() : bool;",
"public static function setUseMultiByte($use_mbstring)\n {\n if ($use_mbstring) {\n if (!extension_loaded(self::$__mbstring_extension_name)) {\n self::toss(\n \"RuntimeException\",\n \"The '{0}' extension must be enabled.\",\n self::$__mbstring_extension_name\n );\n }\n self::$use_mbstring = true;\n if (!self::$char_set) {\n self::$char_set = self::getDefaultCharacterSet();\n }\n } else {\n self::$use_mbstring = false;\n }\n }",
"public function checkAcceptCharsetRequestHeader() : bool;",
"function mbstring_binary_safe_encoding( $reset = false ) {\n static $encodings = array();\n static $overloaded = null;\n \n if ( is_null( $overloaded ) )\n {\n $overloaded = function_exists( 'mb_internal_encoding' ) && ( ini_get( 'mbstring.func_overload' ) & 2 );\n }\n \n if ( false === $overloaded )\n {\n return;\n }\n \n if ( ! $reset ) {\n $encoding = mb_internal_encoding();\n array_push( $encodings, $encoding );\n mb_internal_encoding( 'ISO-8859-1' );\n }\n \n if ( $reset && $encodings ) {\n $encoding = array_pop( $encodings );\n mb_internal_encoding( $encoding );\n }\n }",
"function mb_convert_encoding($str, $to_encoding, $from_encoding = null) {}",
"function usesFallbackEncoding(): bool\n {\n return $this->getEncodingInfo()['is_fallback'];\n }",
"public function checkContentEncodingRequestHeader() : bool\n {\n // by default in php we can decompress gzip and deflate request body\n if (in_array($this->request->getContentEncoding(), array_map('strtolower', ['', 'gzip', 'deflate']))) {\n return true;\n }\n return false;\n }",
"public static function hasMultiByteSupport()\n {\n if (self::$s_hasMultiByteSupport === null) {\n if (function_exists('mb_strlen') && Config::getGlobal('use_mbstring', true)) {\n mb_internal_encoding(self::atkGetCharset());\n self::$s_hasMultiByteSupport = true;\n } else {\n self::$s_hasMultiByteSupport = false;\n }\n }\n\n return self::$s_hasMultiByteSupport;\n }",
"public function testServerEncodingHasDefaultSetting(): void\n {\n // Default character encoding should be set\n $mailbox = new Mailbox($this->imapPath, $this->login, $this->password, $this->attachmentsDir);\n $this->assertSame('UTF-8', $mailbox->getServerEncoding());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds the Team 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 = Team::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
} | [
"protected function findModelTeam($id)\n {\n \tif (($model = Team::findOne($id)) !== null) {\n \t\treturn $model;\n \t} else {\n \t\tthrow new yii\\web\\NotFoundHttpException('The requested page does not exist.');\n \t}\n }",
"protected function findModel($id)\n\t{\n\t\tif (($model = Team::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t\t}\n\t}",
"protected function findModelTeamservice($id)\n {\n \tif (($model = Teamservice::findOne($id)) !== null) {\n \t\treturn $model;\n \t} else {\n \t\tthrow new yii\\web\\NotFoundHttpException('The requested page does not exist.');\n \t}\n }",
"protected function findModel($id)\n {\n if(($model=Team::findOne($id)) !== null)\n {\n return $model;\n }\n throw new NotFoundHttpException(\\Yii::t('app','The requested page does not exist.'));\n }",
"protected function findModel ($id)\n {\n if (($model = UserTeam::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"protected function findModel($id)\n {\n if (($model = MasterMitra::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }",
"protected function findModel($team_id, $u_id)\n {\n if (($model = DemandTaskAuditor::findOne(['team_id' => $team_id, 'u_id' => $u_id])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException(\\Yii::t('rcoa', 'The requested page does not exist.'));\n }\n }",
"protected function findModel($id)\n\t{\n\t\tif (($model = DataRepair::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 findTPModel($id)\n {\n if(($model=TeamPlayer::findOne($id)) !== null)\n {\n return $model;\n }\n throw new NotFoundHttpException(\\Yii::t('app','The requested page does not exist.'));\n }",
"protected function findModel($id)\n {\n if (($model = OttEventTeam::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"protected function findModel($id)\n {\n if (($model = Skenario1::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 {\n if (($model = Teams::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'Запрошенная страница не существует'));\n }",
"public function find($identifier): ?Model;",
"protected function findModel($id)\n\t{\n\t\tif (($model = Trailer::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\t{\n\t\tif (($model = Role::find($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 = PerusahaanSatu::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 {\n if (($model = HotelsInfo::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }",
"protected function findModelByPk(\\CActiveRecord $finder, $pk, $throwExceptionIfNotFound = true)\n\t{\n\t\t// Find the model\n\t\t$model = $finder->findByPk($pk);\n\n\t\t// Make sure it's found\n\t\tif (empty($model) && $throwExceptionIfNotFound) {\n\t\t\tthrow new \\CHttpException(404, get_class($finder).' with id \"'.$pk.'\" not found');\n\t\t}\n\n\t\treturn $model;\n\t}",
"protected function findModel($id) {\n\t\tif (($model = Drug::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 = Tblgames::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Rules action: displays a "Thank you for voting" message. | function election_vote_vote_message($post) {
drupal_set_message(
t('Thank you for voting for the @post <a href="!post_url">%post_title</a>.', array(
'@post' => election_get_post_name($post->election->type),
'!post_url' => url(election_post_uri_path($post)),
'%post_title' => $post->title,
))
);
} | [
"public function actionThank()\n {\n return $this->render('thank');\n }",
"public function bus_booking_action_template_notices() {\n\t\techo 'Thank you. Your booking has been confirmed.';\n\t}",
"public function voteDecision()\r\n {\r\n $app = Factory::getApplication();\r\n $model = $this->getModel('VoterForm', 'GavotingModel');\r\n\r\n // Attempt to update the data\r\n try\r\n {\r\n $return = $model->voteDecision();\r\n\r\n // Redirect to the list screen\r\n $this->setMessage(Text::_('COM_GAVOTING_ELECTION_SUCCESSFULLY'), 'success');\r\n $this->setRedirect(Route::_('index.php?option=com_gavoting&view=nominations', false));\r\n }\r\n catch (Exception $e)\r\n {\r\n $errorType = ($e->getCode() == '404') ? Text::_('ERROR') : 'warning';\r\n $this->setMessage($e->getMessage(), $errorType);\r\n $this->setRedirect('index.php?option=com_gavoting&view=nominations');\r\n }\r\n }",
"public function sentForm(){\n\t\t\techo \"Thank you for submitting\";\n\t\t}",
"public function thankyou() {\n \n }",
"public function opengiftconfirmAction()\n {\n $gid = $this->getParam(\"CF_gid\");\n\n $gift = Mbll_Tower_ItemTpl::getItemDescription($gid);\n\n $this->view->gift = $gift;\n\n $this->render();\n }",
"public function actionConfirm()\n\t{\n\t\t$this->render('confirm');\n\t}",
"public static function modal_notice() {\n\t\tif ( current_user_can( 'manage_options' ) && '' === get_user_meta( get_current_user_id(), 'wprm_feedback', true ) ) {\n\t\t\t$count = wp_count_posts( WPRM_POST_TYPE )->publish;\n\n\t\t\tif ( 23 <= intval( $count ) ) {\n\t\t\t\techo '<div class=\"wprm-feedback-notice\">';\n\t\t\t\techo '<strong>Wow, you\\'ve published ' . esc_html( $count ) . ' recipes!</strong><br/>Are you enjoying our plugin so far?<br/>';\n\t\t\t\techo '<button id=\"wprm-feedback-stop\" class=\"button button-small\">Stop asking me</button> <button id=\"wprm-feedback-no\" class=\"button button-primary button-small\">No...</button> <button id=\"wprm-feedback-yes\" class=\"button button-primary button-small\">Yes!</button>';\n\t\t\t\techo '</div>';\n\t\t\t}\n\t\t}\n\t}",
"public function thankyou()\n\t{\t\n\t\t$this->_data->page = 'thankyou_check_eligibility';\n\t\t$this->_data->page_title = 'Thank you for your order';\n\t\t$this->_data->show_breadcrumbs = false;\n\t\t\n\t\t$this->_data->eligible_numbers = 0;\n\t\t$this->_data->eligible_numbers = $this->accounts_model->get_eligible_numbers($this->_data->account_id); \n\t\t\n\t\t$this->load->view($this->_data->tpl_view, $this->_data);\n\t}",
"public function confirm()\n {\n $pageTitle = 'Commentaire en attente de validation';\n $this->render('confirmation', ['pageTitle' => $pageTitle], 'frontend');\n }",
"public function actionLegalNotice()\n\t{\n\n\t}",
"public function submitAction()\n\t{\n\t\t$hash = $this->getSession()->get('hash');\n\n\t\t$candidateId = $this->getSession()->get('candidateId');\n\t\t$stateListId = $this->getSession()->get('stateListId');\n\n\t\tif ($candidateId && $stateListId) {\n\t\t\t$success = $this->getVoterProvider()->vote($hash, $candidateId, $stateListId);\n\t\t\tif ($success) {\n\t\t\t\t$this->getSession()->remove('hash');\n\t\t\t\t$this->flashMessage('success', 'Ihre Stimme wurde erfolgreich abgegeben.');\n\t\t\t}\n\t\t}\n\n\t\treturn $this->redirect($this->generateUrl('btw_app_vote'));\n\t}",
"function oa_loudvoice_admin_message()\n{\n if (!oa_louddvoice_is_setup())\n {\n echo '<div class=\"updated\"><p><strong>' . __('Thank you for using the LoudVoice comments platform!', 'oa_loudvoice') . '</strong> ' . sprintf(__('Please <strong><a href=\"%s\">complete the setup</a></strong> to enable the plugin.', 'oa_loudvoice'), 'admin.php?page=oa_loudvoice_settings') . '</p></div>';\n }\n}",
"public static function notice_template_pricing() {\n\t\t?>\n\t\t<div class=\"notice notice-warning inline\">\n\t\t\t<p><?php _e( 'You are currently editing the page that has automatically generated content.', 'jobify' ); ?></p>\n\t\t</div><!-- .notice -->\n\t\t<?php\n\t}",
"function emp_book_confirm(){\n $this->_f3->set('confirm_message', 'Your employee handbook has been submitted.');\n $this->loadDefaultView('public/confirmation_page.html', 'Thank You');\n }",
"public function thank_you()\n\t{\n\t\t$title = t('Thank You');\n\t\treturn view('frontend.thankyou', compact('title'));\n\t}",
"public function confirmwinnerAction()\n {\n \t/*\n \t * Need to look up the bid & item info so the user can see what item they are workign on\n \t * Need to look up the phone number to see if it's in the system. If it is, load the person data into the form\n \t * If the user doesn't exits, show the credit card fields for entry.\n \t * If the user exists, display last 4 digital of card. Allow user to edit if it's wrong. Keep in mind only one card can be used for a person.\n \t * User confirms/fills out the user info and submits.\n \t */\n \t\n try {\n \t$this->authenticateAction('view');\n \t\n \tif ($this->_getParam('winningBid') == 'NA') {\n \t\t// delete the bids and assign the item to block 0 and item 0\n \t\t\n \t\trequire_once 'models/Bid.php';\n \t\t$table_bid = new models_Bid();\n \t\t$where = $table_bid->getAdapter()->quoteInto('itemId = ?', $this->_getParam('itemId'));\n \t\t$table_bid->delete($where);\n \t\t\n \t\trequire_once 'models/Block.php';\n \t\t$table_block = new models_Block();\n \t\t$select = $table_block->select();\n \t\t$select->where('auctionId = ?', $this->getCurrentAuctionId())\n \t\t\t\t->where('number = ?', 0);\n \t\t$block = $table_block->fetchRow($select);\n \t\t\n \t\trequire_once 'models/Item.php';\n \t\t$table_item = new models_Item();\n \t\t$item = $table_item->find($this->_getParam('itemId'))->current();\n \t\t$item->itemNumber = 0;\n \t\t$item->blockId = $block->blockId;\n \t\t$item->save();\n \t\t\n \t\t$this->_redirector->gotoUrl('/callbacks/index/viewblock/id/' . $this->_getParam('blockId'));\n \t\treturn;\n \t}\n \t\n\t \t$this->view->validPhone = true;\n\n \t/* DON'T NEED THIS CHECK, BID ACCEPTANCE TAKES CAR OF THIS\n\t \tif (strlen($this->_getParam('winnerPhone')) < 5) {\n\t \t\t$this->view->validPhone = false;\n\t \t\treturn;\n\t \t}\n \t*/\n\t \n\t require_once('models/Person.php');\n\t $table = new models_Person();\n\t $select = $table->select();\n\t\t\t$select->from($table)\n\t\t\t ->where('phone = ?', $this->_getParam('winnerPhone'));\n\t\t\t$rows_person = $table->fetchAll($select);\n\t\t\t\n\t\t\t$person = false;\n\t\t\t$card = false;\n\t\t\t$cardNum = false;\n \n\t\t\tif (count($rows_person) > 0) {\n\t\t\t\t$person = $rows_person->current();\n\t \n\t\t require_once('models/Card.php');\n\t\t $table = new models_Card();\n\t\t $select = $table->select();\n\t\t\t\t$select->from($table)\n\t\t\t\t ->where('personId = ?', $person->personId);\n\t\t\t\t$rows_card = $table->fetchAll($select);\n\t\t\t\t\n\t\t\t\tif (count($rows_card) > 0) {\n\t\t\t\t\t$card = $rows_card->current();\n\t\t\t\t\t\n\t\t\t \t$crypt = new Auction_Crypt();\n\t\t\t \t\n\t\t\t \t$key = $crypt->pbkdf2($this->resources['appconfig']['pass'], $this->resources['appconfig']['salt'], 20000, 32);\n\t\t\t \t$cardNum = '************' . substr($crypt->decrypt($card->number, $key), -4);\n\t\t\t \t// Don't need the expiry & cvv decryted since we're not going to display.\n\t\t\t \t//$expiry = $crypt->decrypt($card->expiry, $key);\n\t\t\t \t//$ccv = $crypt->decrypt($card->cvv, $key);\n\t\t\t\t}\n\t\t\t}\n\t \t\n\t require_once('models/Item.php');\n\t $table = new models_Item();\n\t $item = $table->find($this->_getParam('itemId'))->current();\n\t \t\n\t require_once('models/Block.php');\n\t $table = new models_Block();\n\t $block = $table->find($this->_getParam('blockId'))->current();\n\t \t\n\t require_once('models/Bid.php');\n\t $table = new models_Bid();\n\t $bid = $table->find($this->_getParam('winningBid'))->current();\n \n // Get the other items the customer has won\n $table = new models_vItemWinner();\n $select = $table->select();\n $select->from($table)\n ->where('auctionId = ?', $this->getCurrentAuctionId())\n ->where('phone = ?', $this->_getParam('winnerPhone'))\n ->order('itemNumber');\n $itemsWon = $table->fetchAll($select);\n\t \t\n\t $this->view->creditcard = $cardNum;\n\t $this->view->person = $person;\n\t $this->view->block = $block;\n\t $this->view->item = $item;\n\t $this->view->bid = $bid;\n\t $this->view->phone = $this->_getParam('winnerPhone');\n $this->view->itemsWon = $itemsWon;\n\t \t\n } catch (Metis_Auth_Exception $e) {\n \t$e->failed();\n \treturn;\n } catch (Zend_Db_Exception $e) {\n \t\n }\n }",
"function submitCommentMessageAction()\n {\n $pageTitle = 'submitCommentMessage';\n $submitCommentMessageLinkStyle = 'current_page';\n $isLoggedIn = $this->isLoggedInFromSession();\n $username = $this->usernameFromSession();\n\n\n $name = filter_input(INPUT_POST, 'name', FILTER_SANITIZE_STRING);\n $phone = filter_input(INPUT_POST, 'phone', FILTER_SANITIZE_STRING);\n $comment = filter_input(INPUT_POST, 'comment', FILTER_SANITIZE_STRING);\n\n $message1 = 'Thank You ' . $name;\n $message4 = 'Your phone number is : ' . $phone;\n $message5 = 'We will get back to you on your comment : ' . $comment;\n // $message6='' .$password;\n\n\n require_once __DIR__ . '/../templates/submitMessage.php';\n\n //do this when submit button is clicked.\n }",
"public function display_success_message () {\n\t \t\t\n\t \t\t// TO DO\n\t \t\t\n\t \t\t//$content = __( 'Your reservation has been booked successfully. You\\'ll receive an email confirming this with a link should you wish to cancel your booking.', 'woothemes' );\n\t \t\t\n\t \t\tif ( $_REQUEST['is_updated'] == 'yes' ) {\n\t \t\t\n\t \t\t\t$content = '<p class=\"woo-sc-box note\">'.__( 'Your appointment has been entered into our system, but not yet scheduled. To confirm it, please check your email from us and follow the link provided. If you allowed cookies when you submitted your request, you may confirm your appointment <a href=\"../manage-your-appointments/\">here</a>.', 'woothemes' ).'</p>';\n\t \t\t\t\n\t \t\t} else {\n\t \t\t\n\t \t\t\t$content = '<p class=\"woo-sc-box note\">'.__( 'Your appointment has been entered into our system, but not yet scheduled. To confirm it, please check your email from us and follow the link provided. If you allowed cookies when you submitted your request, you may confirm your appointment <a href=\"../manage-your-appointments/\">here</a>.', 'woothemes' ).'</p>';\n\t \t\t\n\t \t\t} // End IF Statement\n\t \t\t\n\t \t\t$content = apply_filters( 'wootable_success_message', $content );\n\t \t\t\n\t \t\treturn $content;\n\t \t\t\n\t \t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load rule settings iinto static variables | public static function load_rule() {
global $post;
if (!isset($post) || $post->post_type != self::$post_type || !isset($_GET['post'])) {
return;
}
self::$rule = get_post_meta($post->ID, 'inbound_rule', true);
self::$rule_trigger = (isset(self::$rule['trigger'])) ? self::$rule['trigger'] : '';
self::$rule_trigger_evaluate = (isset(self::$rule['trigger_filters_evaluate'])) ? self::$rule['trigger_filters_evaluate'] : '';
self::$rule_trigger_filters = (isset(self::$rule['trigger_filters'])) ? self::$rule['trigger_filters'] : array();
self::$rule_action_blocks = (isset(self::$rule['action_blocks'])) ? self::$rule['action_blocks'] : array();
} | [
"abstract protected function loadRules();",
"static function init()\n\t{\n\t\t$vals = Kohana::$config->load('webgrind');\n\t\t// iterate values\n\t\tforeach ($vals as $name => $val)\n\t\t\tself::$$name = $val;\n\t}",
"public function loadSettings();",
"function importRules()\n\t{\n\t\t$this->coreRules = ['rules' => [], 'controllers' => []];\n\t\t$this->routerRules = [];\n\t\t$router = $this;\n\t\tif (file_exists(INCLUDE_PATH . 'app' . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'Router' . DIRECTORY_SEPARATOR . 'rules.php'))\n\t\t\trequire(INCLUDE_PATH . 'app' . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'Router' . DIRECTORY_SEPARATOR . 'rules.php');\n\t}",
"public function loadSetting();",
"protected function loadRules()\n\t{\n\t\tif (!isset($this->rules)) {\n\t\t\t\n\t\t\t// Search for the configured rules file\n\t\t\tif (($conf = MHTTPD::getConfig('Rewrite')) \n\t\t\t\t&& (\n\t\t\t\t\t($file = realpath($conf['rules_file']))\n\t\t\t\t\t||\n\t\t\t\t\t($file = realpath(MHTTPD::getInipath().$conf['rules_file']))\n\t\t\t\t)\n\t\t\t\t&& is_file($file)\n\t\t\t\t) {\n\n\t\t\t\t// Fetch rules from the configured file\n\t\t\t\t$this->rules = parse_ini_file($file, true);\n\t\t\t\tif (MHTTPD::$debug) {cecho(\"Loaded rules from: $file\\n\");}\t\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t// Use the default values\n\t\t\t\tif (MHTTPD::$debug) {cecho(\"Rules file not found, using default rules\\n\");}\t\n\t\t\t\t$this->rules = $this->rules_default;\n\t\t\t}\n\t\t}\n\t}",
"function loadRules(){\n\t\t$json = JSONConfig::load(dirname(__FILE__).'/../config/',\n\t\t\t\t\t$this->config['rulefile']);\n\n\t\treturn $json;\n }",
"public static function loadRules() {\n\t\t\n\t\t// default var\n\t\t$configDir = Config::getOption(\"configDir\");\n\t\t\n\t\t// make sure the pattern engine data exists\n\t\tif (file_exists($configDir.\"/patternengines.json\")) {\n\t\t\t\n\t\t\t// get pattern engine list data\n\t\t\t$patternEngineList = json_decode(file_get_contents($configDir.\"/patternengines.json\"), true);\n\t\t\t\n\t\t\t// get the pattern engine info\n\t\t\tforeach ($patternEngineList[\"patternengines\"] as $patternEngineName) {\n\t\t\t\t\n\t\t\t\tself::$rules[] = new $patternEngineName();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\tConsole::writeError(\"The pattern engines list isn't available in <path>\".$configDir.\"</path>...\");\n\t\t}\n\t\t\n\t}",
"private function __construct()\n\t{\n\t\t$templateRulePath = \"settings/accesses/\".$GLOBALS['SETTINGS']['currentAccess'].\"/templateRules.ini\";\n\t\t$Rules = array();\n\n\t\t$this->Rules = parse_ini_file($templateRulePath,true);\n\t}",
"private function __initDefaultRules(){\r\n $this->rules = new PTBRRules();\r\n }",
"function load_settings()\r\n{\r\n\t$settings = load_json_data($GLOBALS['root_path'] . 'settings.json');\r\n\t\r\n\t$GLOBALS['podcast_file_path'] = $settings['podcast_file_path'];\r\n\t$GLOBALS['podcast_data_path'] = $settings['podcast_data_path'];\r\n\t$GLOBALS['podcasts_head_file'] = $settings['podcasts_head_file'];\r\n\t$GLOBALS['episode_limit'] = $settings['episode_limit'];\r\n}",
"function ti_common_default_rules_configuration() {\n\t$dir = drupal_get_path('module', 'ti_common') . \"/rules\";\n\t$rules_files = file_scan_directory($dir, '/.*\\.rule$/');\n\t$rules = array();\n\tforeach($rules_files as $path => $rule_info) {\n\t\t$name = $rule_info->name;\n\t\t$import_data = file_get_contents($path);\n\t\t$rules[$name] = entity_import('rules_config', $import_data);\n\t}\n\treturn $rules;\n}",
"public function load() {\n // Load settings\n\t $this->lookup_title = $this->getProjectSetting('lookup-title');\n\t $this->lookup_header = $this->getProjectSetting('lookup-header');\n\t $this->lookup_field = $this->getProjectSetting('lookup-field');\n\t $this->lookup_event_id = $this->getProjectSetting('lookup-event-id');\n\t $this->validate_mrn = $this->getProjectSetting('validate-mrn');\n\t $this->found_action = $this->getProjectSetting('found-action');\n\t $this->repeating_event_id = $this->getProjectSetting('repeating-event-id');\n\t $this->repeating_form_name = $this->getProjectSetting('repeating-form-name');\n\t $this->is_loaded = true;\n }",
"public function load_settings() {\n\t\tglobal $monsterinsights_settings;\n\t\trequire_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/options.php';\n\t\trequire_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/helpers.php';\n\t\trequire_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/deprecated.php';\n\t\t$monsterinsights_settings = monsterinsights_get_options();\n\t}",
"protected abstract function getCacheMatchVariables($rule);",
"protected abstract function init_settings();",
"public function __construct() {\n\t\t$spam_rule_files = list_files(SENDSTUDIO_RESOURCES_DIRECTORY . '/spam_rules');\n\n\t\tforeach ($spam_rule_files as $spam_rule) {\n\t\t\t$filename_parts = pathinfo($spam_rule);\n\t\t\tif (isset($filename_parts['extension']) && $filename_parts['extension'] == 'php') {\n\t\t\t\trequire(SENDSTUDIO_RESOURCES_DIRECTORY . '/spam_rules/' . $spam_rule);\n\t\t\t}\n\t\t}\n\n\t\t$this->rules = &$GLOBALS['Spam_Rules'];\n\t}",
"public function initRules() {\n $config = Context::$appConfig;\n if (isset($config->interceptRules['pre'])) {\n $this->preRules = $config->interceptRules['pre'];\n }\n if (isset($config->interceptRules['post'])) {\n $this->postRules = $config->interceptRules['post'];\n }\n }",
"public function loadRewriteRules() : void {\n // get user rewrite rules, use regular and escaped versions of them\n $this->rewrite_rules =\n RewriteRules::generate(\n $this->site_url,\n $this->destination_url\n );\n\n if ( ! $this->rewrite_rules ) {\n $err = 'No URL rewrite rules defined';\n WsLog::l( $err );\n throw new WP2StaticException( $err );\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
string system ( string $command [, int &$return_var ] ) | public static function _system($cmd)
{
# returns last line or False on error
# outputs directly
ob_start();
system($cmd, $return_var);
$back = ob_get_contents();
ob_end_clean();
return array($return_var, $back);
} | [
"private static function system(string $command, int &$return_var = null): string {\n\t\tob_start();\n\t\tsystem($command, $return_var);\n\t\treturn ob_get_clean();\n\t}",
"function buffered_system($command, &$buffer) {\n if (!($p=popen(\"($command)2>&1\",\"r\"))) return 126;\n while (!feof($p)) {\n $buffer = $buffer . fgets($p,1000);\n }\n return pclose($p);\n}",
"function execCommand($command) {\n\techo \"EXEC: $command\\n\";\n\tpassthru($command);\n\techo \"\\n\";\n}",
"function terminal($command)\n{\n //system\n if (function_exists('system')) {\n ob_start();\n system($command, $return_var);\n $output = ob_get_contents();\n ob_end_clean();\n } //passthru\n else if (function_exists('passthru')) {\n ob_start();\n passthru($command, $return_var);\n $output = ob_get_contents();\n ob_end_clean();\n }\n\n //exec\n// else if(function_exists('exec'))\n// {\n// exec($command , $output , $return_var);\n// $output = implode("n" , $output);\n//\t}\n\n //shell_exec\n else if (function_exists('shell_exec')) {\n $output = shell_exec($command);\n } else {\n $output = 'Command execution not possible on this system';\n $return_var = 1;\n }\n\n return ['output' => $output, 'status' => $return_var];\n}",
"protected function exec($command)\n\t{\n\t\t$function = $this->shell;\n\t\treturn trim($function($command));\n\t}",
"function run(string $cmd): string\n{\n \\exec($cmd, $output, $result_code);\n if ($result_code !== 0) {\n log(\"The command returned an error code ($result_code): $cmd\");\n return '';\n }\n return \\implode(\"\\n\", $output);\n}",
"function execCmd($command) {\n $descriptorspec = array(\n 0 => array(\"pipe\", \"r\"), // stdin\n 1 => array(\"pipe\", \"w\"), // stdout\n 2 => array(\"pipe\", \"w\"), // stderr\n );\n $proc = proc_open($command, $descriptorspec, $pipes, $this->repo['path']);\n $proc_in = $pipes[0];\n $proc_out = $pipes[1];\n $proc_err = $pipes[2];\n fclose($proc_in);\n $stdout_result = stream_get_contents($proc_out);\n $stderr_result = stream_get_contents($proc_err);\n fclose($proc_out);\n fclose($proc_err);\n $retval = proc_close($proc);\n return array($sdtout_result, $stderr_result, $retval);\n }",
"function returnCommand($command) {\n\tglobal $verbose;\n\t\n\tif($verbose) echo $command . \"\\n\";\n\treturn `$command`;\n}",
"function c ($command, $log_name = false)\n\t{\n\t\tprint \"Running command '$command'\\n\";\n\t\t// We limit PHP to 256M, but that only includes PHP allocated data. (Later versions of the tests add this check themselves\n\t\tlist ($out, $err, $exit) = complete_exec (\"ulimit -v 307200; $command\", NULL, 60*60*12, true); // allow no more than 12 hours for the process\n\n\t\tif ($log_name)\n\t\t{\n\t\t\tsave (\"Exit: $exit\\n\\nError:\\n$err\\n\\nOutput:\\n$out\", $log_name);\n\t\t}\n\n\t\tif ($out === \"Timeout\")\n\t\t{\n\t\t\t$out = $err; $err = $exit;\n\t\t\tprint \"Timeout\\nOutput:$out\\nError:$err\\n\";\n\t\t\tthrow new Exception;\n\t\t}\n\n\t\t// print before the program ends \n\t\tprint \"Returning result '$out'\\n\";\n\t\tprint \"Returning error '$err'\\n\";\n\t\tprint \"Returning exit '$exit'\\n\";\n\n\t\tif ($exit !== 0)\n\t\t{\n\t\t\tprint \"Exit code is not zero: $exit\\n\";\n\t\t\tthrow new Exception ();\n\t\t}\n\n\t\treturn $out;\n\t}",
"function phore_exec($cmd, array $args=[], $returnArray=false)\n{\n $cmd = phore_escape($cmd, $args, function(string $input) { return escapeshellarg($input); });\n exec($cmd . \" 2>&1\", $output, $return);\n if ($return !== 0)\n throw new \\Phore\\System\\PhoreExecException(\"Command '$cmd' returned with code $return. \" . implode(\"\\n\", $output), $return);\n if ($returnArray)\n return $output;\n return implode(\"\\n\", $output);\n}",
"protected function executeCommand(string $command): int\n {\n system($command, $error);\n return $error;\n }",
"public function exec($command);",
"function excute_shell($command)\n{\n if ((strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')) {\n popen($command, 'r');\n\n return;\n }\n\n shell_exec($command);\n\n}",
"private function executeUptimeCommand()\n {\n $error = exec($this->target->command, $system_string, $output);\n\n if ($output !== 0) {\n throw new DomainException((string) $error);\n }\n\n return (! is_array($system_string) || empty($system_string))\n ? ''\n : $system_string[0];\n }",
"public function Exec ( $command )\n\t {\n\t\t$process\t= $this -> ShellInstance -> Exec ( $command ) ;\n\t\t\n\t\treturn ( $process ) ;\n\t }",
"function zfs_zpool_cmd($command, $param, $verbose = false, $stderr = true, $out = false, &$output = array()) {\n\t$result = 1;\n\t$cmd = \"zpool {$command} {$param}\";\n\twrite_log($cmd);\n\n\tif (true === $verbose) {\n\t\tif (true === $stderr)\n\t\t\t$cmd .= \" 2>&1\"; // Redirect error message to stdout\n\t\tsystem($cmd, $result);\n\t}\telse {\n\t\tif (true === $out) {\n\t\t\tmwexec2($cmd, $output, $result);\n\t\t} else {\n\t\t\t$result = mwexec($cmd, true);\n\t\t}\n\t}\n\n\treturn $result;\n}",
"function cmd_exec($cmd, &$stdout, &$stderr)\n{\n $outfile = tempnam(\"/tmp\", \"cmd\");\n $errfile = tempnam(\"/tmp\", \"cmd\");\n $descriptorspec = array(\n 0 => array(\"pipe\", \"r\"),\n 1 => array(\"file\", $outfile, \"w\"),\n 2 => array(\"file\", $errfile, \"w\")\n );\n $proc = proc_open($cmd, $descriptorspec, $pipes);\n \n if (!is_resource($proc)) return 255;\n\n fclose($pipes[0]); //Don't really want to give any input\n\n $exit = proc_close($proc);\n $stdout = file($outfile);\n $stderr = file($errfile);\n\n unlink($outfile);\n unlink($errfile);\n return $exit;\n}",
"function conan_exec($command, $args, $remote = true)\n{\n\tif ($remote == true)\n\t{\n\t\t$remote = (CONAN_REMOTE == \"\" ? \"\" : \" -r \".CONAN_REMOTE);\n\t}\n\telse\n\t{\n\t\t$remote = \"\";\n\t}\n\n\t$command = CONAN_PATH.\"conan \".$command.$remote.\" \".$args;\n\n\t$bad = array(\"`\", \"~\", \"!\", \"#\", \"$\", \"%\", \"^\", \"&\", \"(\", \")\", \"=\", \"+\", \";\", \":\", \"'\", \"\\\"\", \"[\", \"]\", \"{\", \"}\", \"|\", \"<\", \">\");\n\tforeach ($bad as $word)\n\t{\n\t\tif (strpos($command, $word) != false)\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t}\n\n\tif (CACHE_PATH != \"\" && CACHE_DURATION != 0)\n\t{\n\t\t$result = cache_get($command);\n\t\tif ($result == null)\n\t\t{\n\t\t\t$result = shell_exec($command);\n\t\t\tcache_put($command, $result);\n\t\t}\n\n\t\treturn $result;\n\t}\n\telse\n\t{\n\t\treturn shell_exec($command);\n\t}\t\n}",
"function exec($cmd, &$stdout=null, &$stderr=null) {\n\t $proc = proc_open($cmd,[\n\t\t1 => ['pipe','w'],\n\t\t2 => ['pipe','w'],\n\t ],$pipes);\n\t $stdout = stream_get_contents($pipes[1]);\n\t fclose($pipes[1]);\n\t $stderr = stream_get_contents($pipes[2]);\n\t fclose($pipes[2]);\n\t return proc_close($proc);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation getHistoricDecisionInstancesCountAsyncWithHttpInfo Get Historic Decision Instance Count | public function getHistoricDecisionInstancesCountAsyncWithHttpInfo($decision_instance_id = null, $decision_instance_id_in = null, $decision_definition_id = null, $decision_definition_id_in = null, $decision_definition_key = null, $decision_definition_key_in = null, $decision_definition_name = null, $decision_definition_name_like = null, $process_definition_id = null, $process_definition_key = null, $process_instance_id = null, $case_definition_id = null, $case_definition_key = null, $case_instance_id = null, $activity_id_in = null, $activity_instance_id_in = null, $tenant_id_in = null, $without_tenant_id = null, $evaluated_before = null, $evaluated_after = null, $user_id = null, $root_decision_instance_id = null, $root_decision_instances_only = null, $decision_requirements_definition_id = null, $decision_requirements_definition_key = null)
{
$returnType = '\OpenAPI\Client\Model\CountResultDto';
$request = $this->getHistoricDecisionInstancesCountRequest($decision_instance_id, $decision_instance_id_in, $decision_definition_id, $decision_definition_id_in, $decision_definition_key, $decision_definition_key_in, $decision_definition_name, $decision_definition_name_like, $process_definition_id, $process_definition_key, $process_instance_id, $case_definition_id, $case_definition_key, $case_instance_id, $activity_id_in, $activity_instance_id_in, $tenant_id_in, $without_tenant_id, $evaluated_before, $evaluated_after, $user_id, $root_decision_instance_id, $root_decision_instances_only, $decision_requirements_definition_id, $decision_requirements_definition_key);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
if ($returnType === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
} else {
$content = (string) $response->getBody();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}
);
} | [
"public function getHistoricDecisionInstancesCount($decision_instance_id = null, $decision_instance_id_in = null, $decision_definition_id = null, $decision_definition_id_in = null, $decision_definition_key = null, $decision_definition_key_in = null, $decision_definition_name = null, $decision_definition_name_like = null, $process_definition_id = null, $process_definition_key = null, $process_instance_id = null, $case_definition_id = null, $case_definition_key = null, $case_instance_id = null, $activity_id_in = null, $activity_instance_id_in = null, $tenant_id_in = null, $without_tenant_id = null, $evaluated_before = null, $evaluated_after = null, $user_id = null, $root_decision_instance_id = null, $root_decision_instances_only = null, $decision_requirements_definition_id = null, $decision_requirements_definition_key = null)\n {\n list($response) = $this->getHistoricDecisionInstancesCountWithHttpInfo($decision_instance_id, $decision_instance_id_in, $decision_definition_id, $decision_definition_id_in, $decision_definition_key, $decision_definition_key_in, $decision_definition_name, $decision_definition_name_like, $process_definition_id, $process_definition_key, $process_instance_id, $case_definition_id, $case_definition_key, $case_instance_id, $activity_id_in, $activity_instance_id_in, $tenant_id_in, $without_tenant_id, $evaluated_before, $evaluated_after, $user_id, $root_decision_instance_id, $root_decision_instances_only, $decision_requirements_definition_id, $decision_requirements_definition_key);\n return $response;\n }",
"public function getHistoricProcessInstancesCountWithHttpInfo($process_instance_id = null, $process_instance_ids = null, $process_definition_id = null, $process_definition_key = null, $process_definition_key_in = null, $process_definition_name = null, $process_definition_name_like = null, $process_definition_key_not_in = null, $process_instance_business_key = null, $process_instance_business_key_like = null, $root_process_instances = null, $finished = null, $unfinished = null, $with_incidents = null, $with_root_incidents = null, $incident_type = null, $incident_status = null, $incident_message = null, $incident_message_like = null, $started_before = null, $started_after = null, $finished_before = null, $finished_after = null, $executed_activity_after = null, $executed_activity_before = null, $executed_job_after = null, $executed_job_before = null, $started_by = null, $super_process_instance_id = null, $sub_process_instance_id = null, $super_case_instance_id = null, $sub_case_instance_id = null, $case_instance_id = null, $tenant_id_in = null, $without_tenant_id = null, $executed_activity_id_in = null, $active_activity_id_in = null, $active = null, $suspended = null, $completed = null, $externally_terminated = null, $internally_terminated = null, $variables = null, $variable_names_ignore_case = null, $variable_values_ignore_case = null)\n {\n $request = $this->getHistoricProcessInstancesCountRequest($process_instance_id, $process_instance_ids, $process_definition_id, $process_definition_key, $process_definition_key_in, $process_definition_name, $process_definition_name_like, $process_definition_key_not_in, $process_instance_business_key, $process_instance_business_key_like, $root_process_instances, $finished, $unfinished, $with_incidents, $with_root_incidents, $incident_type, $incident_status, $incident_message, $incident_message_like, $started_before, $started_after, $finished_before, $finished_after, $executed_activity_after, $executed_activity_before, $executed_job_after, $executed_job_before, $started_by, $super_process_instance_id, $sub_process_instance_id, $super_case_instance_id, $sub_case_instance_id, $case_instance_id, $tenant_id_in, $without_tenant_id, $executed_activity_id_in, $active_activity_id_in, $active, $suspended, $completed, $externally_terminated, $internally_terminated, $variables, $variable_names_ignore_case, $variable_values_ignore_case);\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 }\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 ('\\OpenAPI\\Client\\Model\\CountResultDto' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\CountResultDto', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 400:\n if ('\\OpenAPI\\Client\\Model\\ExceptionDto' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\ExceptionDto', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\CountResultDto';\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 '\\OpenAPI\\Client\\Model\\CountResultDto',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\ExceptionDto',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getHistoricVariableInstancesCountWithHttpInfo($variable_name = null, $variable_name_like = null, $variable_value = null, $variable_names_ignore_case = null, $variable_values_ignore_case = null, $variable_type_in = null, $include_deleted = null, $process_instance_id = null, $process_instance_id_in = null, $process_definition_id = null, $process_definition_key = null, $execution_id_in = null, $case_instance_id = null, $case_execution_id_in = null, $case_activity_id_in = null, $task_id_in = null, $activity_instance_id_in = null, $tenant_id_in = null, $without_tenant_id = null)\n {\n $request = $this->getHistoricVariableInstancesCountRequest($variable_name, $variable_name_like, $variable_value, $variable_names_ignore_case, $variable_values_ignore_case, $variable_type_in, $include_deleted, $process_instance_id, $process_instance_id_in, $process_definition_id, $process_definition_key, $execution_id_in, $case_instance_id, $case_execution_id_in, $case_activity_id_in, $task_id_in, $activity_instance_id_in, $tenant_id_in, $without_tenant_id);\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 }\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 ('\\OpenAPI\\Client\\Model\\CountResultDto' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\CountResultDto', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 400:\n if ('\\OpenAPI\\Client\\Model\\ExceptionDto' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\ExceptionDto', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\CountResultDto';\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 '\\OpenAPI\\Client\\Model\\CountResultDto',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\ExceptionDto',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function queryHistoricActivityInstancesCountWithHttpInfo($historic_activity_instance_query_dto = null)\n {\n $request = $this->queryHistoricActivityInstancesCountRequest($historic_activity_instance_query_dto);\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 }\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 ('\\OpenAPI\\Client\\Model\\CountResultDto' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\CountResultDto', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 400:\n if ('\\OpenAPI\\Client\\Model\\ExceptionDto' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\ExceptionDto', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\CountResultDto';\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 '\\OpenAPI\\Client\\Model\\CountResultDto',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\ExceptionDto',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getHistoricProcessInstancesCountAsync($process_instance_id = null, $process_instance_ids = null, $process_definition_id = null, $process_definition_key = null, $process_definition_key_in = null, $process_definition_name = null, $process_definition_name_like = null, $process_definition_key_not_in = null, $process_instance_business_key = null, $process_instance_business_key_like = null, $root_process_instances = null, $finished = null, $unfinished = null, $with_incidents = null, $with_root_incidents = null, $incident_type = null, $incident_status = null, $incident_message = null, $incident_message_like = null, $started_before = null, $started_after = null, $finished_before = null, $finished_after = null, $executed_activity_after = null, $executed_activity_before = null, $executed_job_after = null, $executed_job_before = null, $started_by = null, $super_process_instance_id = null, $sub_process_instance_id = null, $super_case_instance_id = null, $sub_case_instance_id = null, $case_instance_id = null, $tenant_id_in = null, $without_tenant_id = null, $executed_activity_id_in = null, $active_activity_id_in = null, $active = null, $suspended = null, $completed = null, $externally_terminated = null, $internally_terminated = null, $variables = null, $variable_names_ignore_case = null, $variable_values_ignore_case = null)\n {\n return $this->getHistoricProcessInstancesCountAsyncWithHttpInfo($process_instance_id, $process_instance_ids, $process_definition_id, $process_definition_key, $process_definition_key_in, $process_definition_name, $process_definition_name_like, $process_definition_key_not_in, $process_instance_business_key, $process_instance_business_key_like, $root_process_instances, $finished, $unfinished, $with_incidents, $with_root_incidents, $incident_type, $incident_status, $incident_message, $incident_message_like, $started_before, $started_after, $finished_before, $finished_after, $executed_activity_after, $executed_activity_before, $executed_job_after, $executed_job_before, $started_by, $super_process_instance_id, $sub_process_instance_id, $super_case_instance_id, $sub_case_instance_id, $case_instance_id, $tenant_id_in, $without_tenant_id, $executed_activity_id_in, $active_activity_id_in, $active, $suspended, $completed, $externally_terminated, $internally_terminated, $variables, $variable_names_ignore_case, $variable_values_ignore_case)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function queryHistoricProcessInstancesCountWithHttpInfo($historic_process_instance_query_dto = null)\n {\n $request = $this->queryHistoricProcessInstancesCountRequest($historic_process_instance_query_dto);\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 }\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 ('\\OpenAPI\\Client\\Model\\CountResultDto' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\CountResultDto', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 400:\n if ('\\OpenAPI\\Client\\Model\\ExceptionDto' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\ExceptionDto', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\CountResultDto';\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 '\\OpenAPI\\Client\\Model\\CountResultDto',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\ExceptionDto',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getHistoricDecisionInstancesWithHttpInfo($decision_instance_id = null, $decision_instance_id_in = null, $decision_definition_id = null, $decision_definition_id_in = null, $decision_definition_key = null, $decision_definition_key_in = null, $decision_definition_name = null, $decision_definition_name_like = null, $process_definition_id = null, $process_definition_key = null, $process_instance_id = null, $case_definition_id = null, $case_definition_key = null, $case_instance_id = null, $activity_id_in = null, $activity_instance_id_in = null, $tenant_id_in = null, $without_tenant_id = null, $evaluated_before = null, $evaluated_after = null, $user_id = null, $root_decision_instance_id = null, $root_decision_instances_only = null, $decision_requirements_definition_id = null, $decision_requirements_definition_key = null, $include_inputs = null, $include_outputs = null, $disable_binary_fetching = null, $disable_custom_object_deserialization = null, $sort_by = null, $sort_order = null, $first_result = null, $max_results = null)\n {\n $request = $this->getHistoricDecisionInstancesRequest($decision_instance_id, $decision_instance_id_in, $decision_definition_id, $decision_definition_id_in, $decision_definition_key, $decision_definition_key_in, $decision_definition_name, $decision_definition_name_like, $process_definition_id, $process_definition_key, $process_instance_id, $case_definition_id, $case_definition_key, $case_instance_id, $activity_id_in, $activity_instance_id_in, $tenant_id_in, $without_tenant_id, $evaluated_before, $evaluated_after, $user_id, $root_decision_instance_id, $root_decision_instances_only, $decision_requirements_definition_id, $decision_requirements_definition_key, $include_inputs, $include_outputs, $disable_binary_fetching, $disable_custom_object_deserialization, $sort_by, $sort_order, $first_result, $max_results);\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 }\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 ('\\OpenAPI\\Client\\Model\\HistoricDecisionInstanceDto[]' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\HistoricDecisionInstanceDto[]', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 400:\n if ('\\OpenAPI\\Client\\Model\\ExceptionDto' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\ExceptionDto', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\HistoricDecisionInstanceDto[]';\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 '\\OpenAPI\\Client\\Model\\HistoricDecisionInstanceDto[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\ExceptionDto',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getHistoricProcessInstancesCountRequest($process_instance_id = null, $process_instance_ids = null, $process_definition_id = null, $process_definition_key = null, $process_definition_key_in = null, $process_definition_name = null, $process_definition_name_like = null, $process_definition_key_not_in = null, $process_instance_business_key = null, $process_instance_business_key_like = null, $root_process_instances = null, $finished = null, $unfinished = null, $with_incidents = null, $with_root_incidents = null, $incident_type = null, $incident_status = null, $incident_message = null, $incident_message_like = null, $started_before = null, $started_after = null, $finished_before = null, $finished_after = null, $executed_activity_after = null, $executed_activity_before = null, $executed_job_after = null, $executed_job_before = null, $started_by = null, $super_process_instance_id = null, $sub_process_instance_id = null, $super_case_instance_id = null, $sub_case_instance_id = null, $case_instance_id = null, $tenant_id_in = null, $without_tenant_id = null, $executed_activity_id_in = null, $active_activity_id_in = null, $active = null, $suspended = null, $completed = null, $externally_terminated = null, $internally_terminated = null, $variables = null, $variable_names_ignore_case = null, $variable_values_ignore_case = null)\n {\n\n $resourcePath = '/history/process-instance/count';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($process_instance_id !== null) {\n if('form' === 'form' && is_array($process_instance_id)) {\n foreach($process_instance_id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['processInstanceId'] = $process_instance_id;\n }\n }\n // query params\n if ($process_instance_ids !== null) {\n if('form' === 'form' && is_array($process_instance_ids)) {\n foreach($process_instance_ids as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['processInstanceIds'] = $process_instance_ids;\n }\n }\n // query params\n if ($process_definition_id !== null) {\n if('form' === 'form' && is_array($process_definition_id)) {\n foreach($process_definition_id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['processDefinitionId'] = $process_definition_id;\n }\n }\n // query params\n if ($process_definition_key !== null) {\n if('form' === 'form' && is_array($process_definition_key)) {\n foreach($process_definition_key as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['processDefinitionKey'] = $process_definition_key;\n }\n }\n // query params\n if ($process_definition_key_in !== null) {\n if('form' === 'form' && is_array($process_definition_key_in)) {\n foreach($process_definition_key_in as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['processDefinitionKeyIn'] = $process_definition_key_in;\n }\n }\n // query params\n if ($process_definition_name !== null) {\n if('form' === 'form' && is_array($process_definition_name)) {\n foreach($process_definition_name as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['processDefinitionName'] = $process_definition_name;\n }\n }\n // query params\n if ($process_definition_name_like !== null) {\n if('form' === 'form' && is_array($process_definition_name_like)) {\n foreach($process_definition_name_like as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['processDefinitionNameLike'] = $process_definition_name_like;\n }\n }\n // query params\n if ($process_definition_key_not_in !== null) {\n if('form' === 'form' && is_array($process_definition_key_not_in)) {\n foreach($process_definition_key_not_in as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['processDefinitionKeyNotIn'] = $process_definition_key_not_in;\n }\n }\n // query params\n if ($process_instance_business_key !== null) {\n if('form' === 'form' && is_array($process_instance_business_key)) {\n foreach($process_instance_business_key as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['processInstanceBusinessKey'] = $process_instance_business_key;\n }\n }\n // query params\n if ($process_instance_business_key_like !== null) {\n if('form' === 'form' && is_array($process_instance_business_key_like)) {\n foreach($process_instance_business_key_like as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['processInstanceBusinessKeyLike'] = $process_instance_business_key_like;\n }\n }\n // query params\n if ($root_process_instances !== null) {\n if('form' === 'form' && is_array($root_process_instances)) {\n foreach($root_process_instances as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['rootProcessInstances'] = $root_process_instances;\n }\n }\n // query params\n if ($finished !== null) {\n if('form' === 'form' && is_array($finished)) {\n foreach($finished as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['finished'] = $finished;\n }\n }\n // query params\n if ($unfinished !== null) {\n if('form' === 'form' && is_array($unfinished)) {\n foreach($unfinished as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['unfinished'] = $unfinished;\n }\n }\n // query params\n if ($with_incidents !== null) {\n if('form' === 'form' && is_array($with_incidents)) {\n foreach($with_incidents as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['withIncidents'] = $with_incidents;\n }\n }\n // query params\n if ($with_root_incidents !== null) {\n if('form' === 'form' && is_array($with_root_incidents)) {\n foreach($with_root_incidents as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['withRootIncidents'] = $with_root_incidents;\n }\n }\n // query params\n if ($incident_type !== null) {\n if('form' === 'form' && is_array($incident_type)) {\n foreach($incident_type as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['incidentType'] = $incident_type;\n }\n }\n // query params\n if ($incident_status !== null) {\n if('form' === 'form' && is_array($incident_status)) {\n foreach($incident_status as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['incidentStatus'] = $incident_status;\n }\n }\n // query params\n if ($incident_message !== null) {\n if('form' === 'form' && is_array($incident_message)) {\n foreach($incident_message as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['incidentMessage'] = $incident_message;\n }\n }\n // query params\n if ($incident_message_like !== null) {\n if('form' === 'form' && is_array($incident_message_like)) {\n foreach($incident_message_like as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['incidentMessageLike'] = $incident_message_like;\n }\n }\n // query params\n if ($started_before !== null) {\n if('form' === 'form' && is_array($started_before)) {\n foreach($started_before as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['startedBefore'] = $started_before;\n }\n }\n // query params\n if ($started_after !== null) {\n if('form' === 'form' && is_array($started_after)) {\n foreach($started_after as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['startedAfter'] = $started_after;\n }\n }\n // query params\n if ($finished_before !== null) {\n if('form' === 'form' && is_array($finished_before)) {\n foreach($finished_before as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['finishedBefore'] = $finished_before;\n }\n }\n // query params\n if ($finished_after !== null) {\n if('form' === 'form' && is_array($finished_after)) {\n foreach($finished_after as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['finishedAfter'] = $finished_after;\n }\n }\n // query params\n if ($executed_activity_after !== null) {\n if('form' === 'form' && is_array($executed_activity_after)) {\n foreach($executed_activity_after as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['executedActivityAfter'] = $executed_activity_after;\n }\n }\n // query params\n if ($executed_activity_before !== null) {\n if('form' === 'form' && is_array($executed_activity_before)) {\n foreach($executed_activity_before as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['executedActivityBefore'] = $executed_activity_before;\n }\n }\n // query params\n if ($executed_job_after !== null) {\n if('form' === 'form' && is_array($executed_job_after)) {\n foreach($executed_job_after as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['executedJobAfter'] = $executed_job_after;\n }\n }\n // query params\n if ($executed_job_before !== null) {\n if('form' === 'form' && is_array($executed_job_before)) {\n foreach($executed_job_before as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['executedJobBefore'] = $executed_job_before;\n }\n }\n // query params\n if ($started_by !== null) {\n if('form' === 'form' && is_array($started_by)) {\n foreach($started_by as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['startedBy'] = $started_by;\n }\n }\n // query params\n if ($super_process_instance_id !== null) {\n if('form' === 'form' && is_array($super_process_instance_id)) {\n foreach($super_process_instance_id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['superProcessInstanceId'] = $super_process_instance_id;\n }\n }\n // query params\n if ($sub_process_instance_id !== null) {\n if('form' === 'form' && is_array($sub_process_instance_id)) {\n foreach($sub_process_instance_id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['subProcessInstanceId'] = $sub_process_instance_id;\n }\n }\n // query params\n if ($super_case_instance_id !== null) {\n if('form' === 'form' && is_array($super_case_instance_id)) {\n foreach($super_case_instance_id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['superCaseInstanceId'] = $super_case_instance_id;\n }\n }\n // query params\n if ($sub_case_instance_id !== null) {\n if('form' === 'form' && is_array($sub_case_instance_id)) {\n foreach($sub_case_instance_id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['subCaseInstanceId'] = $sub_case_instance_id;\n }\n }\n // query params\n if ($case_instance_id !== null) {\n if('form' === 'form' && is_array($case_instance_id)) {\n foreach($case_instance_id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['caseInstanceId'] = $case_instance_id;\n }\n }\n // query params\n if ($tenant_id_in !== null) {\n if('form' === 'form' && is_array($tenant_id_in)) {\n foreach($tenant_id_in as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['tenantIdIn'] = $tenant_id_in;\n }\n }\n // query params\n if ($without_tenant_id !== null) {\n if('form' === 'form' && is_array($without_tenant_id)) {\n foreach($without_tenant_id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['withoutTenantId'] = $without_tenant_id;\n }\n }\n // query params\n if ($executed_activity_id_in !== null) {\n if('form' === 'form' && is_array($executed_activity_id_in)) {\n foreach($executed_activity_id_in as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['executedActivityIdIn'] = $executed_activity_id_in;\n }\n }\n // query params\n if ($active_activity_id_in !== null) {\n if('form' === 'form' && is_array($active_activity_id_in)) {\n foreach($active_activity_id_in as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['activeActivityIdIn'] = $active_activity_id_in;\n }\n }\n // query params\n if ($active !== null) {\n if('form' === 'form' && is_array($active)) {\n foreach($active as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['active'] = $active;\n }\n }\n // query params\n if ($suspended !== null) {\n if('form' === 'form' && is_array($suspended)) {\n foreach($suspended as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['suspended'] = $suspended;\n }\n }\n // query params\n if ($completed !== null) {\n if('form' === 'form' && is_array($completed)) {\n foreach($completed as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['completed'] = $completed;\n }\n }\n // query params\n if ($externally_terminated !== null) {\n if('form' === 'form' && is_array($externally_terminated)) {\n foreach($externally_terminated as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['externallyTerminated'] = $externally_terminated;\n }\n }\n // query params\n if ($internally_terminated !== null) {\n if('form' === 'form' && is_array($internally_terminated)) {\n foreach($internally_terminated as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['internallyTerminated'] = $internally_terminated;\n }\n }\n // query params\n if ($variables !== null) {\n if('form' === 'form' && is_array($variables)) {\n foreach($variables as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['variables'] = $variables;\n }\n }\n // query params\n if ($variable_names_ignore_case !== null) {\n if('form' === 'form' && is_array($variable_names_ignore_case)) {\n foreach($variable_names_ignore_case as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['variableNamesIgnoreCase'] = $variable_names_ignore_case;\n }\n }\n // query params\n if ($variable_values_ignore_case !== null) {\n if('form' === 'form' && is_array($variable_values_ignore_case)) {\n foreach($variable_values_ignore_case as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['variableValuesIgnoreCase'] = $variable_values_ignore_case;\n }\n }\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\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 historyListCount($query = null)\n {\n return $this->getApi()\n ->execute('history/process-instance/count', $query);\n }",
"public function getCleanableHistoricDecisionInstanceReportCountWithHttpInfo($decision_definition_id_in = null, $decision_definition_key_in = null, $tenant_id_in = null, $without_tenant_id = null, $compact = null)\n {\n $request = $this->getCleanableHistoricDecisionInstanceReportCountRequest($decision_definition_id_in, $decision_definition_key_in, $tenant_id_in, $without_tenant_id, $compact);\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 }\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 ('\\OpenAPI\\Client\\Model\\CountResultDto' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\CountResultDto', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 500:\n if ('\\OpenAPI\\Client\\Model\\ExceptionDto' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\ExceptionDto', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\CountResultDto';\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 '\\OpenAPI\\Client\\Model\\CountResultDto',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\ExceptionDto',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getCleanableHistoricDecisionInstanceReportCount($decision_definition_id_in = null, $decision_definition_key_in = null, $tenant_id_in = null, $without_tenant_id = null, $compact = null)\n {\n list($response) = $this->getCleanableHistoricDecisionInstanceReportCountWithHttpInfo($decision_definition_id_in, $decision_definition_key_in, $tenant_id_in, $without_tenant_id, $compact);\n return $response;\n }",
"public static function getCount() {\n return VicidialDnc::count();\n }",
"public function queryHistoricVariableInstancesCount($historic_variable_instance_query_dto = null)\n {\n list($response) = $this->queryHistoricVariableInstancesCountWithHttpInfo($historic_variable_instance_query_dto);\n return $response;\n }",
"public function count()\n {\n $request = $this->createRequestInstance(self::CAT_COUNT, null, null);\n\n return $this->client->send($request);\n }",
"public function getDecisionRequirementsDefinitionsCountWithHttpInfo($decision_requirements_definition_id = null, $decision_requirements_definition_id_in = null, $name = null, $name_like = null, $deployment_id = null, $key = null, $key_like = null, $category = null, $category_like = null, $version = null, $latest_version = null, $resource_name = null, $resource_name_like = null, $tenant_id_in = null, $without_tenant_id = null, $include_decision_requirements_definitions_without_tenant_id = null)\n {\n $request = $this->getDecisionRequirementsDefinitionsCountRequest($decision_requirements_definition_id, $decision_requirements_definition_id_in, $name, $name_like, $deployment_id, $key, $key_like, $category, $category_like, $version, $latest_version, $resource_name, $resource_name_like, $tenant_id_in, $without_tenant_id, $include_decision_requirements_definitions_without_tenant_id);\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 }\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 ('\\OpenAPI\\Client\\Model\\CountResultDto' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\CountResultDto', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 400:\n if ('\\OpenAPI\\Client\\Model\\ExceptionDto' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\ExceptionDto', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\CountResultDto';\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 '\\OpenAPI\\Client\\Model\\CountResultDto',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\ExceptionDto',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getListCount($query = null)\n {\n $result = $this->getApi()\n ->execute('process-instance/count', $query);\n return ArrayHelper::getValue($result, 'count');\n }",
"public function count(): int\n {\n return count($this->instances);\n }",
"public function testQueryHistoricProcessInstancesCount()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"function getHistoryCount() {\n\t\t$ret = NULL;\n\t\tif( $this->isValid() ) {\n\t\t\t$query = \"SELECT COUNT(*) AS `count`\n\t\t\t\t\tFROM `\".BIT_DB_PREFIX.\"tiki_history`\n\t\t\t\t\tWHERE `page_id` = ?\";\n\t\t\t$rs = $this->mDb->query($query, array($this->mPageId));\n\t\t\t$ret = $rs->fields['count'];\n\t\t}\n\t\treturn $ret;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'getGetExpense' | protected function getGetExpenseRequest($id)
{
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $id when calling getGetExpense'
);
}
$resourcePath = '/api/expenses/{id}';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($id !== null) {
$resourcePath = str_replace(
'{' . 'id' . '}',
ObjectSerializer::toPathValue($id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// 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\Query::build($formParams);
}
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('X-AUTH-TOKEN');
if ($apiKey !== null) {
$headers['X-AUTH-TOKEN'] = $apiKey;
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('X-AUTH-USER');
if ($apiKey !== null) {
$headers['X-AUTH-USER'] = $apiKey;
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | [
"protected function getGetExpenseCategoriesRequest()\n {\n\n $resourcePath = '/api/expenses/categories';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\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\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-AUTH-TOKEN');\n if ($apiKey !== null) {\n $headers['X-AUTH-TOKEN'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-AUTH-USER');\n if ($apiKey !== null) {\n $headers['X-AUTH-USER'] = $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\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function expenseGet($expense_id){\r\n\t\t$method='expense.get';\r\n\t\t$tags=array(\r\n\t\t\t'expense_id'=>$expense_id\r\n\t\t);\r\n\t\t$response=$this->prepare_xml($method,$tags);\r\n\t\t$obj=$this->xml_obj($response,'full');\r\n\t\treturn $obj;\r\n\t}",
"public function expences(GetExpencesRequest $request)\n {\n $params = $request->all();\n $user = Auth::id();\n $expences = new Expence;\n\n if(!isset($request->expence)){\n $expences = $expences->userExpenceDate($user, $params);\n }else{\n $expences = $expences->expence($request->expence);\n }\n\n if(!empty($expences)){\n return response()->json([\n 'expences' => $expences,\n 'message' => trans('expence.expences'),\n ], 201);\n }else{\n return response()->json([\n 'expences' => $expences,\n 'message' => trans('app.something_went_wrong'),\n ], 500);\n }\n }",
"public function getExpenseTypesAction(){\n require_once MODULES . '/business/controllers/generic.php';\n $businessController = new Viven_Business_Generic;\n return $businessController -> getExpenseTypesAction();\n }",
"function expenseList() {\r\n\tglobal $clsExpense;\r\n\t$response = array();\r\n\r\n\ttry {\r\n\t\t$responseData = $clsExpense->getExpenseList();\r\n\t\tLogger::log('Expense List complete');\r\n\t\t$response['success'] = 1;\r\n\t\t$response['data'] = $responseData;\r\n\t} catch (DBException $e) {\r\n\t\t$response['error'] = 1;\r\n\t\t$response['message'] = $e->getMessage();\r\n\t}\r\n\treturn $response;\r\n}",
"public function createExpenseAction()\n {\n $transaction = new Transaction($_POST);\n\t\t\n $transaction->addExpense();\n\t\t\n\t\tView::renderTemplate('Finances/newExpense.html');\n\t}",
"public function employeeRecurringExpenseGetRequest($id, $business_id, $employee_id, string $contentType = self::contentTypes['employeeRecurringExpenseGet'][0])\n {\n\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling employeeRecurringExpenseGet'\n );\n }\n\n // verify the required parameter 'business_id' is set\n if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $business_id when calling employeeRecurringExpenseGet'\n );\n }\n\n // verify the required parameter 'employee_id' is set\n if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $employee_id when calling employeeRecurringExpenseGet'\n );\n }\n\n\n $resourcePath = '/api/v2/business/{businessId}/employee/{employeeId}/expense/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($business_id !== null) {\n $resourcePath = str_replace(\n '{' . 'businessId' . '}',\n ObjectSerializer::toPathValue($business_id),\n $resourcePath\n );\n }\n // path params\n if ($employee_id !== null) {\n $resourcePath = str_replace(\n '{' . 'employeeId' . '}',\n ObjectSerializer::toPathValue($employee_id),\n $resourcePath\n );\n }\n\n\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml', ],\n $contentType,\n $multipart\n );\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('apiKey');\n if ($apiKey !== null) {\n $headers['apiKey'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHost = $this->config->getHost();\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'GET',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getGetExpensesWithHttpInfo($order_by = null, $order = null, $begin = null, $end = null, $refundable = null, $exported = null, $term = null, $page = null, $size = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\ExpenseEntity[]';\n $request = $this->getGetExpensesRequest($order_by, $order, $begin, $end, $refundable, $exported, $term, $page, $size);\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 '\\Swagger\\Client\\Model\\ExpenseEntity[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function expenseRequestGetExpenseRequestsRequest($business_id, $employee_id, $query = null, $filter = null, $orderby = null, $top = null, $skip = null, string $contentType = self::contentTypes['expenseRequestGetExpenseRequests'][0])\n {\n\n // verify the required parameter 'business_id' is set\n if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $business_id when calling expenseRequestGetExpenseRequests'\n );\n }\n\n // verify the required parameter 'employee_id' is set\n if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $employee_id when calling expenseRequestGetExpenseRequests'\n );\n }\n\n\n\n\n\n\n\n $resourcePath = '/api/v2/business/{businessId}/employee/{employeeId}/expenserequest';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $filter,\n '$filter', // param base name\n 'string', // openApiType\n '', // style\n false, // explode\n false // required\n ) ?? []);\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $orderby,\n '$orderby', // param base name\n 'string', // openApiType\n '', // style\n false, // explode\n false // required\n ) ?? []);\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $top,\n '$top', // param base name\n 'integer', // openApiType\n '', // style\n false, // explode\n false // required\n ) ?? []);\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $skip,\n '$skip', // param base name\n 'integer', // openApiType\n '', // style\n false, // explode\n false // required\n ) ?? []);\n\n // header params\n if ($query !== null) {\n $headerParams['query'] = ObjectSerializer::toHeaderValue($query);\n }\n\n // path params\n if ($business_id !== null) {\n $resourcePath = str_replace(\n '{' . 'businessId' . '}',\n ObjectSerializer::toPathValue($business_id),\n $resourcePath\n );\n }\n // path params\n if ($employee_id !== null) {\n $resourcePath = str_replace(\n '{' . 'employeeId' . '}',\n ObjectSerializer::toPathValue($employee_id),\n $resourcePath\n );\n }\n\n\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml', ],\n $contentType,\n $multipart\n );\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('apiKey');\n if ($apiKey !== null) {\n $headers['apiKey'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHost = $this->config->getHost();\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'GET',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"static public function createExpense()\n {\n return new self();\n }",
"public function get($expense_id){\n\t\t/* ensure expense_id is an integer */\n\t\tif(!is_numeric($expense_id)) throw new Exception(\"expense_id of invoice must be an integer\");\n\n\t\t$result=mysql_query(\"SELECT * FROM expense WHERE expense_id=$expense_id\");\n\t\tif($result){/*ensure query success*/\n\t\t\tif($row = mysql_fetch_array($result)){/*ensure record*/\n\t\t\t\t$vo = new expense($row['uid'],$row['expense_type'],$row['expense_date'],$row['category'],$row['truck_id'],$row['description'],$row['amount']);\n\t\t\t\t$vo->expense_id = $expense_id;\n\t\t\t\treturn $vo;\n\t\t\t}\n\t\t}\n\n\t\treturn NULL;\n\t}",
"protected function deleteDeleteExpenseRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling deleteDeleteExpense'\n );\n }\n\n $resourcePath = '/api/expenses/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-AUTH-TOKEN');\n if ($apiKey !== null) {\n $headers['X-AUTH-TOKEN'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-AUTH-USER');\n if ($apiKey !== null) {\n $headers['X-AUTH-USER'] = $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\\Query::build($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function expenses()\n {\n return $this->hasMany(Operation::class, 'from_envelope_id');\n }",
"public static function getEstimatedExpense(){\n $model = new PrPurchaseOrder;\n $query = $model->newQuery();\n $query->join('pr_supplier','pr_supplier.id', '=', 'pr_purchase_order.fk_supplier_id');\n $query->join('payment_terms','payment_terms.id', '=', 'pr_supplier.fk_term_id');\n $query->where('pr_purchase_order.accounting_approval',Config::get('constants.accounting_purchase_order_approved'));\n $query->where('pr_purchase_order.status',Config::get('constants.success'));\n $query->where(DB::raw(\"MONTH(CURDATE())\"),DB::raw(\"MONTH(DATE_ADD(pr_purchase_order.accounting_approval_at, INTERVAL payment_terms.payment_days DAY))\"));\n $data = $query->select(\n DB::raw(\"DATE_ADD(pr_purchase_order.accounting_approval_at, INTERVAL payment_terms.payment_days DAY) AS maturity_date\"),\n DB::raw(\"SUM(pr_purchase_order.cost) as amount\"),'pr_purchase_order.id')->first();\n if($data->amount>0){\n return $data->amount;\n }else{\n return 0;\n }\n }",
"public static function expense()\n {\n return new Transaction([\n 'scenario' => self::SCENARIO_EXPANSE,\n ]);\n }",
"public function transactions(GetExpenceTransactionsRequest $request)\n {\n $params = $request->all();\n $expence_t = new ExpenceTransaction;\n\n $message = trans('app.something_went_wrong');\n $code = 500;\n\n // return all expence transactions\n if(isset($request->expence)){\n $trans = $expence_t->transactions($request->expence);\n $message = trans('expencetrans.expence-prices');\n $code = 200;\n }\n\n // return trasaction using id\n if(isset($request->trans) && Helper::getStringType($request->trans) == \"integer\"){\n $trans = $expence_t->transaction($request->trans, null);\n $message = trans('expencetrans.expence-price');\n $code = 200;\n }\n\n // return transaction using reference\n if(isset($request->trans) && Helper::getStringType($request->trans) == \"string\"){\n $trans = $expence_t->transaction(null, $request->trans);\n $message = trans('expencetrans.expence-price');\n $code = 200;\n }\n\n if(!empty($trans)){\n return response()->json([\n 'transactions' => $trans,\n 'message' => $message\n ], $code);\n }else{\n return response()->json([\n 'transactions' => $trans,\n 'message' => $message\n ], $code);\n }\n }",
"public function variableexpenseGetListV1Request($eOrderBy = null, $iRowMax = 10000, $iRowOffset = 0, $acceptLanguage = null, $sFilter = null, string $contentType = self::contentTypes['variableexpenseGetListV1'][0])\n {\n\n\n if ($iRowMax !== null && $iRowMax > 10000) {\n throw new \\InvalidArgumentException('invalid value for \"$iRowMax\" when calling ObjectVariableexpenseApi.variableexpenseGetListV1, must be smaller than or equal to 10000.');\n }\n if ($iRowMax !== null && $iRowMax < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$iRowMax\" when calling ObjectVariableexpenseApi.variableexpenseGetListV1, must be bigger than or equal to 1.');\n }\n \n if ($iRowOffset !== null && $iRowOffset < 0) {\n throw new \\InvalidArgumentException('invalid value for \"$iRowOffset\" when calling ObjectVariableexpenseApi.variableexpenseGetListV1, must be bigger than or equal to 0.');\n }\n \n\n\n\n $resourcePath = '/1/object/variableexpense/getList';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $eOrderBy,\n 'eOrderBy', // param base name\n 'string', // openApiType\n 'form', // style\n true, // explode\n false // required\n ) ?? []);\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $iRowMax,\n 'iRowMax', // param base name\n 'integer', // openApiType\n 'form', // style\n true, // explode\n false // required\n ) ?? []);\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $iRowOffset,\n 'iRowOffset', // param base name\n 'integer', // openApiType\n 'form', // style\n true, // explode\n false // required\n ) ?? []);\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $sFilter,\n 'sFilter', // param base name\n 'string', // openApiType\n 'form', // style\n true, // explode\n false // required\n ) ?? []);\n\n // header params\n if ($acceptLanguage !== null) {\n $headerParams['Accept-Language'] = ObjectSerializer::toHeaderValue($acceptLanguage);\n }\n\n\n\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', ],\n $contentType,\n $multipart\n );\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHost = $this->config->getHost();\n $query = ObjectSerializer::buildQuery($queryParams);\n\n if ($apiKey !== null) {\n $secret = $this->config->getSecret();\n if ($secret !== '') {\n //Let's sign the request\n $headers = array_merge($headers, RequestSignature::getHeadersV1($apiKey, $secret, 'GET', $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''), $httpBody));\n }\t\t\n }\n\n return new Request(\n 'GET',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function employeeRecurringExpenseListRequest($business_id, $employee_id, string $contentType = self::contentTypes['employeeRecurringExpenseList'][0])\n {\n\n // verify the required parameter 'business_id' is set\n if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $business_id when calling employeeRecurringExpenseList'\n );\n }\n\n // verify the required parameter 'employee_id' is set\n if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $employee_id when calling employeeRecurringExpenseList'\n );\n }\n\n\n $resourcePath = '/api/v2/business/{businessId}/employee/{employeeId}/expense';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($business_id !== null) {\n $resourcePath = str_replace(\n '{' . 'businessId' . '}',\n ObjectSerializer::toPathValue($business_id),\n $resourcePath\n );\n }\n // path params\n if ($employee_id !== null) {\n $resourcePath = str_replace(\n '{' . 'employeeId' . '}',\n ObjectSerializer::toPathValue($employee_id),\n $resourcePath\n );\n }\n\n\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml', ],\n $contentType,\n $multipart\n );\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('apiKey');\n if ($apiKey !== null) {\n $headers['apiKey'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHost = $this->config->getHost();\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'GET',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getExpensespopup(Request $request) {\n\n\t\t$getBankDtls = array();\n\t\t$expensesData = array();\n\t\t$expData = array();\n\t\t$i = 1;\n\t\t\n\t\t$getBankDtls = Accounting::fetchExpensesBank($request);\n\t\t\n\t\tif ($request->expensesDate != \"\" && $request->bankIdAccNo != \"\") {\n\t\t\t$expensesData = Accounting::fetchExpensesData($request);\n\t\t\tforeach ($expensesData as $expkey => $expvalue) {\n\t\t\t\t$empName = Accounting::fnGetEmpName($expvalue->empId);\n\t\t\t\tif (isset($empName[0]->FirstName) && isset($empName[0]->LastName)) {\n\t\t\t\t\t$expData[$i]['empName'] = $empName[0]->FirstName.' '.$empName[0]->LastName;\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\n\t\treturn view('Accounting.expensesDatepopup',['request' => $request,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'getBankDtls' => $getBankDtls,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'expensesData' => $expensesData,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'expData' => $expData\n\t\t\t\t\t\t\t\t\t\t\t\t]);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setIpRange() Sets the value of the [domain_user_lock] column. Nonboolean arguments are converted using the following rules: 1, '1', 'true', 'on', and 'yes' are converted to boolean true 0, '0', 'false', 'off', and 'no' are converted to boolean false Check on string values is case insensitive (so 'FaLsE' is seen as 'false'). | public function setDomainUserLock($v)
{
if ($v !== null) {
if (is_string($v)) {
$v = in_array(strtolower($v), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
} else {
$v = (boolean) $v;
}
}
if ($this->domain_user_lock !== $v) {
$this->domain_user_lock = $v;
$this->modifiedColumns[] = LicenseVersionPeer::DOMAIN_USER_LOCK;
}
return $this;
} | [
"function setIPRanges($ipRanges) {\n\t\treturn $this->setData(implode(SUBSCRIPTION_IP_RANGE_SEPERATOR, $ipRanges));\n\t}",
"public function setsiteip($ip, $user = null, $domain = null)\n {\n if (!isset($ip))\n {\n error_log(\"setsiteip requires that ip is passed to it\");\n\n return false;\n }\n\n if ($user == null && $domain == null)\n {\n error_log(\"setsiteip requires that either domain or user is passed to it\");\n\n return false;\n }\n\n if ($user == null)\n {\n return $this->xmlapi_query(\"setsiteip\", array(\"ip\" => $ip, \"domain\" => $domain));\n }\n else\n {\n return $this->xmlapi_query(\"setsiteip\", array(\"ip\" => $ip, \"user\" => $user));\n }\n }",
"public function setDomainUserLock($v)\n {\n if ($v !== null) {\n if (is_string($v)) {\n $v = in_array(strtolower($v), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;\n } else {\n $v = (boolean) $v;\n }\n }\n\n if ($this->domain_user_lock !== $v) {\n $this->domain_user_lock = $v;\n $this->modifiedColumns[] = LicensePeer::DOMAIN_USER_LOCK;\n }\n\n\n return $this;\n }",
"public function setLocktodomain($v)\n\t{\n\r\n\t\t// Since the native PHP type for this column is string,\r\n\t\t// we will cast the input to a string (if it is not).\r\n\t\tif ($v !== null && !is_string($v)) {\r\n\t\t\t$v = (string) $v; \r\n\t\t}\r\n\n\t\tif ($this->locktodomain !== $v) {\n\t\t\t$this->locktodomain = $v;\n\t\t\t$this->modifiedColumns[] = FeUsersPeer::LOCKTODOMAIN;\n\t\t}\n\n\t}",
"public function setSSHAllowedRange($range)\n {\n $this->allow_ssh_from = $range.'/32';\n }",
"public function setRange($range) {\n $this->range = $range;\n }",
"public function setRange(Range $range)\n\t{\n\t\t$this->range = $range;\n\t}",
"public function setEnforceIP($bool);",
"public function set_user_ip_address($value)\n {\n }",
"function wb_set_range($control, $vmin, $vmax) {}",
"public function setIp($ip);",
"public function set_user_ip_address( $value ) {\n\t\t$this->set_prop( 'user_ip_address', $value );\n\t}",
"public function setRange($ip, $end = null)\n {\n if (strpos($ip, '-') !== false) {\n list($ip, $end) = array_map('trim', explode('-', $ip, 2));\n }\n\n if (false === filter_var($ip, FILTER_VALIDATE_IP) ||\n false === filter_var($end, FILTER_VALIDATE_IP)) {\n throw new \\InvalidArgumentException(\"Invalid IP range \\\"$ip-$end\\\"\");\n }\n\n // determine version (4 or 6)\n $this->version = (false === filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) ? 6 : 4;\n\n $this->istart = IP::inet_ptod($ip);\n $this->iend = IP::inet_ptod($end);\n\n // fix order\n if (bccomp($this->istart, $this->iend) == 1) {\n list($this->istart, $this->iend) = array($this->iend, $this->istart);\n list($ip, $end) = array($end, $ip);\n }\n\n $this->start = $ip;\n $this->end = $end;\n\n // calculate real prefix\n $len = $this->version == 4 ? 32 : 128;\n $this->prefix = $len - strlen(BC::bcdecbin(BC::bcxor($this->istart, $this->iend)));\n }",
"public function setIsRange($isRange)\n {\n $this->isRange = $isRange;\n }",
"function wb_set_range($control, $vmin, $vmax) { }",
"public function setLastIp($value);",
"static public function checkIP($ip_ranges)\n\t{\n\t\t// Check to see if a named IP range was specified\n\t\tif (is_string($ip_ranges) && isset(self::$named_ip_ranges[$ip_ranges])) {\n\t\t\t$ip_ranges = self::$named_ip_ranges[$ip_ranges];\n\t\t}\n\n\t\tif (!isset($_SERVER['REMOTE_ADDR'])) {\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Get the remote IP and remove any IPv6 to IPv4 mapping\n\t\t$user_ip = str_replace('::ffff:', '', $_SERVER['REMOTE_ADDR']);\n\t\t$user_ip_long = ip2long($user_ip);\n\n\t\tsettype($ip_ranges, 'array');\n\n\t\tforeach ($ip_ranges as $ip_range) {\n\n\t\t\tif (strpos($ip_range, '/') === FALSE) {\n\t\t\t\t$ip_range .= '/32';\n\t\t\t}\n\n\t\t\tlist($range_ip, $range_mask) = explode('/', $ip_range);\n\n\t\t\tif (strlen($range_mask) < 3) {\n\t\t\t\t$mask_long = pow(2, 32) - pow(2, 32 - $range_mask);\n\t\t\t} else {\n\t\t\t\t$mask_long = ip2long($range_mask);\n\t\t\t}\n\n\t\t\t$range_ip_long = ip2long($range_ip);\n\n\t\t\tif (($range_ip_long & $mask_long) != $range_ip_long) {\n\t\t\t\t$proper_range_ip = long2ip($range_ip_long & $mask_long);\n\t\t\t\tthrow new fProgrammerException(\n\t\t\t\t\t'The range base IP address specified, %1$s, is invalid for the CIDR range or subnet mask provided (%2$s). The proper IP is %3$s.',\n\t\t\t\t\t$range_ip,\n\t\t\t\t\t'/' . $range_mask,\n\t\t\t\t\t$proper_range_ip\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (($user_ip_long & $mask_long) == $range_ip_long) {\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\t}",
"public function setIp($ind, $ip) {\n\t\tif ($ind < 0 || $ind >= count($this->users)) {\n\t\t\tthrow DTException('setIp failed. invalid index: ' . $ind);\n\t\t}\n\t\t$this->ips[$ind] = $ip;\n\t}",
"function SetRange($min, $max){}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a collection of breeds | public function getBreeds() {
return $this->_fetch("breeds", $params, "get");
} | [
"public function breeds()\n {\n return Breed::query()->orderBy('name')->get();\n }",
"public function breeds()\n\t{\n\t\tif (! $breeds = cache('breeds'))\n\t\t{\n\t\t\t$result = $this->curl->get('https://api.thecatapi.com/v1/breeds');\n\t\t\t$rawBreeds = json_decode($result->getBody());\n\n\t\t\t$breeds = [];\n\t\t\tforeach ($rawBreeds as $row) {\n\t\t\t\t$breeds[] = [\n\t\t\t\t\t'id' => $row->id,\n\t\t\t\t\t'name' => $row->name,\n\t\t\t\t];\n\t\t\t}\n\n\t\t\tcache()->save('breeds', $breeds);\n\t\t}\n\n\t\treturn $breeds;\n\t}",
"public function getBeds()\n {\n $getBeds = new Database();\n return $getBeds->setTable(\"gardenBeds\")->where(\"gardenId\", \"=\", $this->gardenId)->results();\n }",
"public function breeds()\n {\n return $this->hasMany(Breed::class);\n }",
"public function getListOfBeds() {\n return [\n 1 => '1',\n 2 => '2',\n 3 => '3',\n 4 => '4',\n 5 => '5+',\n ];\n }",
"function get_all_breeds() {\n\n $this->db->from('breeds');\n $this->db->order_by(\"breed_name\", \"asc\");\n $query = $this->db->get(); \n return $query->result_array();\n }",
"abstract protected function getBreaches();",
"public function getBulls()\n {\n return $this->bulls;\n }",
"public function getAll()\n {\n return $this->bees;\n }",
"public function sub_breeds()\n {\n return $this->hasMany(SubBreed::class);\n }",
"public static function getBands()\n {\n $bands = DB::table('bands as b')\n ->select(\n 'b.id as bandId',\n 'b.name as bandName',\n 'g.id as genreId',\n 'g.name as genreName'\n )\n ->join('genres as g', 'g.id', 'b.genre_id')\n ->orderBy('bandId', 'desc')\n ->paginate(10);\n\n return $bands;\n }",
"private function getBreedLinks() {\n $breeds = $this->catApiClient->get('breeds');\n $links = [];\n foreach ($breeds as $breed) {\n $links[] = Link::createFromRoute($breed['name'], 'cat_api.browse_cats_page', ['breed_id' => $breed['id']]);\n }\n return [\n '#theme' => 'item_list',\n '#items' => $links,\n ];\n }",
"public function originatedBreeds()\n {\n return $this->hasMany('Breed', 'originator_id', 'id');\n }",
"public function brands()\n {\n return Cache::remember('app.filter_brands', 86400, function () {\n return new BrandCollection(Brand::where('top', 1)->limit(20)->get());\n });\n }",
"public function getAllSubBreeds($subBreed){\n\t\treturn $this->getBreedsFromGET(\"https://dog.ceo/api/breed/\".$subBreed.\"/list\");\n\t}",
"public function getBags()\n {\n return $this->bags;\n }",
"function getBuddies() {\n $qb = ServerBrowser\\EM::getInstance()->createQueryBuilder();\n $qb->select('b, u, p');\n $qb->from('Entities\\Buddy', 'b');\n $qb->join('b.user', 'u');\n $qb->join('b.player', 'p');\n $qb->where('b.user = :user');\n $qb->setParameter('user', g('UserManager')->getUser());\n $q = $qb->getQuery();\n $buddies = $q->getResult();\n return $buddies;\n}",
"public function getBlastingList() {\n return Blasting::where( 'status', 'waiting' )->where( 'blastAt', '<=', Carbon::now() )->get();\n }",
"function getRaffles() {\n\n $ret = array();\n\n $query = \"SELECT Id FROM Raffles\";\n $results = $this->db->query($query);\n while ($row = $results->fetchArray()) {\n $ret[count($ret)] = new Raffle($row['Id'], $this);\n }\n\n return $ret;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load the product list from POS to web store, which is created after the date specified If the date is not provided, all products will be loaded. | public function load_products_to_web_store($date_filter = FALSE){
$tb_product = 'erp.dbo.tbl_pos_item_mstr';
$tb_price = 'erp.dbo.tbl_pos_item_price';
$tb_cost = 'erp.dbo.tbl_pos_item_cost';
$config_key = "pos_last_load_time";
$current_time = date('Y-m-d H:i:s', time());
if( $date_filter == FALSE ){
$result = $this->db->query("SELECT * FROM config WHERE item = ?", $config_key);
$result = $result->row_array();
$date_filter = $result['value'];
}
//echo "Current time is $current_time, start loading products from POS from $date_filter";
$this->lna_pos = $this->load->database('lna_pos', TRUE); // Load the db, and assign to the member var.
$query = "SELECT items.item_code, style_no, color_code, size_code, short_desc, items.created_date, price.selling_price, c.cost ";
$query .= "FROM $tb_product items, $tb_price price, $tb_cost c";
$query .= "WHERE items.item_code = price.item_code AND c.item_code = items.item_code AND DATEDIFF(DAY, CONVERT(DATETIME, ?, 103), items.created_date) >= 0 ";
$query .= "ORDER BY items.item_code ";
$query = $this->lna_pos->query( $query, array($date_filter) );
if ($query->num_rows() > 0) {
$pos_products = $query->result_array();
$this->load->database();
$query1 = "INSERT INTO products (id, name_zh, front_img, price, discount, cost, status) VALUES ( ?, ?, ?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE id=id";
$query2 = "INSERT INTO product_color_size (pro_id, color, size) VALUES ( ?, ?, ?) ON DUPLICATE KEY UPDATE size=size";
//$i = 0;
foreach( $pos_products as $product ){
$this->db->query($query1, array($product['style_no'], $product['short_desc'], $product['style_no'] . $product['color_code'] . '-F_s.jpg', $product['selling_price'], $product['selling_price'], 'N'));
$this->db->query($query2, array($product['style_no'], $product['color_code'], $product['size_code']));
//$i++;
}
//echo "<p>$i record(s) loaded</p>";
$this->db->query("UPDATE config SET value = ? WHERE item = ?", array( $current_time, $config_key ) );
return $query->result_array();
}
return FALSE;
} | [
"private function loadProducts(): void {\n\t\t$this->products = ProductProvider::getProducts();\n\t}",
"function import_product_list()\r\n\t{\r\n\t\t//parse xml product list\r\n\t\t\r\n\t\t//import all products checking for duplicates\r\n\t\t\r\n\t\t$this->flash['notice'] = 'xxx Products imported successfully.';\r\n\t}",
"function loadAllProducts(){\r\n if($result = DB::doQuery(\"SELECT * FROM product;\")) {\r\n while ($prd = $result->fetch_object()) {\r\n $formats = explode(',',$prd->formats);\r\n $formats = str_replace(' ', '', $formats);\r\n $tags = explode(',',$prd->tags);\r\n $tags = str_replace(' ', '', $tags);\r\n\r\n $this->createProduct($prd->pid, $prd->name, $prd->category, $formats, $prd->img_link, $tags);\r\n }\r\n }\r\n }",
"private function load() {\n\n $db = Database::getInstance(); \n\t $con = $db->getConnection();\n \n $query = \"SELECT * FROM Products ORDER by ID DESC\";\n \n if ($result = $con->query($query)) {\n \t/* fetch object array */\n \t while ($prod = $result->fetch_object(\"Product\")) {\n\t\t\t \tarray_push($this->products, $prod);\n \t}\n \t/* free result set */\n \t$result->close();\n }\n\t}",
"function loadProductList(){\t\t\n $link = $this->context->link;\n $langId = $this->context->language->id;\n $shopId = $this->context->shop->id; \n $pageSize = 10;\n $page = Tools::getValue('page', 0);// intval($_POST['page']); \n $categoryId = Tools::getValue('categoryId', Configuration::get('PS_HOME_CATEGORY')); // Db::getInstance()->getValue(\"Select category_id From \"._DB_PREFIX_.\"simplecategory_module Where id = \".$moduleId);\n $keyword = Tools::getValue('keyword', '');\n\t\t$productIds = Tools::getValue('productIds', array());\t\t\n $arrSubCategory = $this->_getAllCategoryIds($categoryId);\n $arrSubCategory[] = $categoryId;\n $offset=($page - 1) * $pageSize;\n $total = $this->getManualProducts($langId, $arrSubCategory, $keyword, true);\n\t\t\n\t\t$response = new stdClass();\n $response->pagination = '';\n $response->list = '';\n if($total >0){ \n $response->pagination = $this->paginationAjax($total, $pageSize, $page, 6, 'loadProductList');\n $items = $this->getManualProducts($langId, $arrSubCategory, $keyword, false, $offset, $pageSize);\n if($items){\n if($items){\n \tif($productIds){\n \t\tforeach($items as $item){\n\t $imagePath = $link->getImageLink($item['link_rewrite'], $item['id_image'], 'cart_default');\n\t\t\t\t\t\t\tif(in_array($item['id_product'], $productIds)){\n\t\t\t\t\t\t\t\t$response->list .= '<tr id=\"pListTr_'.$item['id_product'].'\">\n\t <td>'.$item['id_product'].'</td>\n <td class=\"center\"><img src=\"'.$imagePath.'\" height=\"32\" /></td>\n\t <td>'.$item['name'].'</td>\t \n\t <td class=\"center\"><div><a href=\"javascript:void(0)\" id=\"manual-product-'.$item['id_product'].'\" data-id=\"'.$item['id_product'].'\" data-name=\"'.$item['name'].'\" class=\"link-add-manual-product-off\"><i class=\"icon-check-square-o\"></i></a></div></td>\n\t </tr>';\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$response->list .= '<tr id=\"pListTr_'.$item['id_product'].'\">\n <td>'.$item['id_product'].'</td>\t\t \n\t\t <td class=\"center\"><img src=\"'.$imagePath.'\" height=\"32\" /></td>\n\t\t <td>'.$item['name'].'</td> \n\t\t <td class=\"center\"><div><a href=\"javascript:void(0)\" id=\"manual-product-'.$item['id_product'].'\" data-id=\"'.$item['id_product'].'\" data-name=\"'.$item['name'].'\" class=\"link-add-manual-product\"><i class=\"icon-plus\"></i></a></div></td>\n\t\t </tr>';\t\n\t\t\t\t\t\t\t}\n\t \n\t }\n \t}else{\n\t \tforeach($items as $item){\n\t $imagePath = $link->getImageLink($item['link_rewrite'], $item['id_image'], 'cart_default');\t\t\t\t\t\t\t\n\t $response->list .= '<tr id=\"pListTr_'.$item['id_product'].'\">\n\t <td>'.$item['id_product'].'</td>\n\t <td class=\"center\"><img src=\"'.$imagePath.'\" height=\"32\" /></td>\n\t <td>'.$item['name'].'</td>\t \n\t <td class=\"center\"><div><a href=\"javascript:void(0)\" id=\"manual-product-'.$item['id_product'].'\" data-id=\"'.$item['id_product'].'\" data-name=\"'.$item['name'].'\" class=\"link-add-manual-product\"><i class=\"icon-plus\"></i></a></div></td>\n\t </tr>';\n\t }\t\n \t}\n \n }\n } \n }\n die(Tools::jsonEncode($response));\n }",
"public function getNewProducts() {\r\n\r\n $todayStartOfDayDate = $this->_localeDate->date()->setTime(0, 0, 0)->format('Y-m-d H:i:s');\r\n $todayEndOfDayDate = $this->_localeDate->date()->setTime(23, 59, 59)->format('Y-m-d H:i:s');\r\n\r\n /** @var $collection \\Magento\\Catalog\\Model\\ResourceModel\\Product\\Collection */\r\n $collection = $this->_productCollectionFactory->create();\r\n\r\n $collection = $this->_addProductAttributesAndPrices(\r\n $collection\r\n )->addStoreFilter()->addAttributeToFilter(\r\n 'news_from_date',\r\n [\r\n 'or' => [\r\n 0 => ['date' => true, 'to' => $todayEndOfDayDate],\r\n 1 => ['is' => new \\Zend_Db_Expr('null')],\r\n ]\r\n ],\r\n 'left'\r\n )->addAttributeToFilter(\r\n 'news_to_date',\r\n [\r\n 'or' => [\r\n 0 => ['date' => true, 'from' => $todayStartOfDayDate],\r\n 1 => ['is' => new \\Zend_Db_Expr('null')],\r\n ]\r\n ],\r\n 'left'\r\n )->addAttributeToFilter(\r\n [\r\n ['attribute' => 'news_from_date', 'is' => new \\Zend_Db_Expr('not null')],\r\n ['attribute' => 'news_to_date', 'is' => new \\Zend_Db_Expr('not null')],\r\n ]\r\n )->addAttributeToSort('news_from_date', 'desc')\r\n ->setPageSize($this->_limit)->setCurPage(1);\r\n $collection = $this->findProductByCatgoryIds($collection);\r\n $collection->getSelect()->group('e.entity_id');\r\n return $collection;\r\n }",
"public function setProductImportDate($date)\n {\n $this -> productImportDate = $date;\n }",
"public static function importProducts()\n {\n $importer = Mage::getModel('importer/importer');\n $importer->importProducts();\n }",
"public function getShopProducts(){\r\n $this->products = array();\r\n try {\r\n include_once __DIR__.'\\..\\cruds\\productCrud.php';\r\n $productCrud = new ProductCrud($this->crud);\r\n $dbProducts = $productCrud->readAllProducts();\r\n $this->products = $dbProducts;\r\n }\r\n catch (PDOException $e){\r\n $this->exception = DATABASE_ERROR;\r\n $this->debugLog('Getting all the products failed with the following error: '. $e->getMessage());\r\n $this->debugLog = 'Getting all the products failed with the following error: '. $e->getMessage();\r\n }\r\n }",
"function getProductList() ;",
"public function getUpdatedProducts($date)\n {\n return $this->sendRequest('product/updated_since/' . $date . '?&stock=1&stock=2&stock=3&stock=4&stock=5&stock=6&stock=7&stock=8&stock=9&stock=10');\n }",
"private function loadProductsFromJson(): void\n {\n $curl = curl_init();\n curl_setopt_array($curl, [\n CURLOPT_URL => $this->target_url,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_SSL_VERIFYPEER => false\n ]);\n $source = json_decode(\n curl_exec($curl)\n );\n curl_close($curl);\n if (is_object($source) && isset($source->products)) {\n $this->products = $source->products;\n }\n }",
"public function fetchProductList()\n {\n if (! array_key_exists('IdList.Id.1', $this->options)) {\n $this->log('Product IDs must be set in order to fetch them!', 'Warning');\n\n return false;\n }\n if (! array_key_exists('IdType', $this->options)) {\n $this->log('ID Type must be set in order to use the given IDs!', 'Warning');\n\n return false;\n }\n\n $url = $this->urlbase.$this->urlbranch;\n\n $query = $this->genQuery();\n\n if ($this->mockMode) {\n $xml = $this->fetchMockFile();\n } else {\n $response = $this->sendRequest($url, ['Post' => $query]);\n\n if (! $this->checkResponse($response)) {\n return false;\n }\n\n $xml = simplexml_load_string($response['body']);\n }\n\n $this->parseXML($xml);\n }",
"static public function LoadProducts( $reload = FALSE ) {\n\t\t$dbr = wfGetDB( DB_SLAVE );\n\n\t\t/**\n\t\t * If we have content in our list, just return that unless $reload is true.\n\t\t */\n\t\tif ( sizeof( self::$sProductList ) && !$reload ) {\n\t\t\treturn self::$sProductList;\n\t\t}\n\n\t\tself::$sProductList = array();\n\n\t\t// Use 0 as the last parameter to enforce getting latest revision of this article.\n\t\t$article = new Article( Title::newFromText( PONYDOCS_DOCUMENTATION_PRODUCTS_TITLE ), 0 );\n\t\t$content = $article->getContent();\n\n\t\tif ( !$article->exists() ) {\n\t\t\t // There is no products file found -- just return.\n\t\t\treturn array();\n\t\t}\n\n\t\t/**\n\t\t * The content of this topic should be of this form:\n\t\t * {{#product:shortName|Long Product Name|description|parent}}{{#product:anotherProduct|...\n\t\t * \n\t\t * There is a user defined parser hook which converts this into useful output when viewing as well.\n\t\t * \n\t\t * Then query categorylinks to only add the product if it has a tagged TOC file with the selected version.\n\t\t * Otherwise, skip it!\n\t\t * \n\t\t * NOTE product is the top entity, we need to verify better it has at least one version defined\n\t\t */\n\n\t\t// explode on the closing tag to get an array of products\n\t\t$tags = explode( '}}', $content );\n\t\tforeach ( $tags as $tag ) {\n\t\t\t$tag = trim( $tag );\n\t\t\tif ( strpos( $tag, '{{#product:' ) === 0 ) { \n\t\t\t\t\n\t\t\t\t// Remove the opening tag and prefix\n\t\t\t\t$product = str_replace( '{{#product:', '', $tag ); \n\t\t\t\t$parameters = explode( '|', $product );\n\t\t\t\t$parameters = array_map( 'trim', $parameters );\n\n\t\t\t\t// Set static flag if defined as static\n\t\t\t\t$static = FALSE;\n\t\t\t\tif ( strpos( $parameters[0], PONYDOCS_PRODUCT_STATIC_PREFIX ) === 0 ) {\n\t\t\t\t\t$parameters[0] = substr( $parameters[0], strlen(PONYDOCS_PRODUCT_STATIC_PREFIX ) );\n\t\t\t\t\t$static = TRUE;\n\t\t\t\t}\n\n\t\t\t\t// Allow admins to omit optional parameters\n\t\t\t\tforeach ( array( 1, 2, 3 ) as $index ) {\n\t\t\t\t\tif ( !array_key_exists( $index, $parameters ) ) {\n\t\t\t\t\t\t$parameters[$index] = '';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Avoid wedging the product page with a fatal error if shortName is omitted by some crazy nihilist\n\t\t\t\tif ( isset( $parameters[0] ) && $parameters[0] != '' ) {\n\t\t\t\t\t$pProduct = new PonyDocsProduct( $parameters[0], $parameters[1], $parameters[2], $parameters[3] );\n\t\t\t\t\t$pProduct->setStatic( $static );\n\t\t\t\t\tself::$sDefinedProductList[$pProduct->getShortName()] = $pProduct;\n\t\t\t\t\tself::$sProductList[$parameters[0]] = $pProduct;\n\t\t\t\t\tif (isset( $parameters[3]) && $parameters[3] != '' ) {\n\t\t\t\t\t\t// key is parent, value is array of children\n\t\t\t\t\t\tself::$sParentChildMap[$parameters[3]][] = $parameters[0];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn self::$sProductList;\n\t}",
"public function getProductList();",
"public function fetch_sales_product_list(){\n\t\t$data['products']=$this->cashier_model->fetch_sales_product_list(date('Y-m-d'));\n\t\t$this->load->view('cashier/products/salesproducts', $data);\n\t}",
"public function recently_viewed_products() {\n\n $products = ManagerHolder::get('PageVisit')->getViewedProducts($this->authEntity['id']);\n\n// $products = ManagerHolder::get('UserProduct')->getAllWhere(array('user_id' => $this->authEntity['id']));\n// if (!empty($products)) {\n// foreach ($products as &$product) {\n// ManagerHolder::get('Sale')->addAvailableSaleToProducts($this->authEntity['pregnancyweek_current_id'], $product['product']);\n// }\n// }\n\n $page = ManagerHolder::get('Page')->getOneWhere(array('page_url' => surround_with_slashes(uri_string())));\n $this->setHeaders($page);\n\n $this->layout->set('products', $products);\n $this->layout->view('viewed_products');\n }",
"public function getLessSoldProduct($date) {\n return response()->json(Order::getLessSoldProduct($date));\n }",
"function fetch_sales_product_list($date){\n \t\t$this->db->select('products.PRODUCT, products_to_sell.QUANTITY, products_to_sell.ID, products_to_sell.DATE_ADDED');\n \t\t$this->db->from('products_to_sell');\n \t\t$this->db->join('products', 'products_to_sell.PRODUCT_ID=products.PRODUCT_ID', 'left');\n \t\t$this->db->where('products_to_sell.DATE_ADDED', $date);\n \t\t$query=$this->db->get();\n \t\tif($query->num_rows()>0){\n \t\t\treturn $query->result();\n \t\t}\n \t\telse{\n \t\t\treturn false;\n \t\t}\n \t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests Config_Dir() : save > adding only an array | public function testDir_SaveUseArray()
{
$config = Config::with('mock:'.sys_get_temp_dir().'/def');
$config['xyz'] = array('a'=>'b');
$config->save();
$this->assertType('Q\Config_Dir', $config);
$this->assertEquals(sys_get_temp_dir()."/def", (string)$config->getPath());
$this->assertTrue(is_dir((string)$config->getPath()));
$this->assertType('Q\Config_File', $config['xyz']);
$this->assertEquals(sys_get_temp_dir()."/def/xyz.mock", (string)$config['xyz']->getPath());
$this->assertTrue(is_file((string)$config['xyz']->getPath()));
$this->assertEquals('a:1:{s:1:"a";s:1:"b";}', file_get_contents((string)$config['xyz']->getPath()));
} | [
"private static function saveConfig()\n {\n file_put_contents(self::$configPath, json_encode(self::$config, JSON_PRETTY_PRINT));\n }",
"function saveconfig_ini($config)\n{\n$file = fopen(\"config/config.ini\", \"w\");\nforeach($config as $param => $data)\n{\n$file_data .= $param.' = \"'.str_replace('\"', '', $data).'\"\n';\n}\nrewind($file);\nfwrite($file, $file_data);\nfclose($file);\n}",
"function saveconfig_ini($config)\r\n{\r\n\t$file = fopen(\"config/config.ini\", \"w\");\r\n\tforeach($config as $param => $data)\r\n\t{\r\n$file_data .= $param.' = \"'.str_replace('\"', '', $data).'\"\r\n';\r\n\t}\r\n\trewind($file);\r\n\tfwrite($file, $file_data);\r\n\tfclose($file);\r\n}",
"protected function addToConfig()\n {\n $path = $this->getConfigPath();\n $config = require($path);\n if (isset($config[$this->moduleId])) {\n if (\\Yii::$app->controller->confirm('Rewrite exist config?')) {\n $config[$this->moduleId] = $this->getConfigArray();\n echo 'Module config was rewrote' . PHP_EOL;\n }\n } else {\n $config[$this->moduleId] = $this->getConfigArray();\n }\n\n\n $this->writeArrayToFile($this->getConfigPath(), $config);\n }",
"public function testSaveDataProvider()\n {\n $configEmpty = __DIR__ . self::TEST_ASSETS_PATH . 'config/empty/';\n $configMono = __DIR__ . self::TEST_ASSETS_PATH . 'config/mono-server/';\n $configTwoServers = __DIR__ . self::TEST_ASSETS_PATH . 'config/2-servers/';\n return array(\n array($configEmpty, 'add test1 http://redmine.test1.com api-key-test1 Redmine server 1', 'Configuration added', $configMono),\n array($configMono, 'add test2 http://redmine.test2.com api-key-test2 Redmine server 2', 'Configuration added', $configTwoServers),\n array($configMono, 'remove test1', 'Configuration removed', $configEmpty),\n array($configTwoServers, 'remove test2', 'Configuration removed', $configMono),\n );\n }",
"private function writeConfig()\n\t{\n\t\tif ($this->option('write-config'))\n\t\t{\n\t\t\t$configFile = base_path() . '/config/larasearch.php';\n $configDir = base_path() . '/config';\n\n\t\t\tif (!File::exists($configFile))\n\t\t\t{\n\t\t\t\tif ($this->confirm('It appears that you have not yet published the larasearch config. Would you like to do this now?', false))\n\t\t\t\t{\n\t\t\t\t\t$this->call('vendor:publish', ['package' => 'iverberk/larasearch']);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tFile::put(\"${configDir}/paths.json\", json_encode(['paths' => $this->paths, 'reversedPaths' => $this->reversedPaths], JSON_PRETTY_PRINT));\n\n\t\t\t$this->info('Paths file written to local package configuration');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->info(json_encode(['paths' => $this->paths, 'reversedPaths' => $this->reversedPaths], JSON_PRETTY_PRINT));\n\t\t}\n\t}",
"protected function saveConfig()\n {\n $res = array();\n foreach($this->config as $category => $settings) {\n $res[] = '[' . $category . ']';\n\n foreach ($settings as $key => $value) {\n $res[] = $key . ' = ' . $value;\n }\n\n $res[] = '';\n }\n\n $fileContent = implode(\"\\n\", $res);\n file_put_contents(self::$pathConfiguration . '/WLANThermo.conf', $fileContent);\n }",
"function fillConfigArray()\n {\n $this->config['MOD_DIR'] = CONFIGURATION_DIR . 'detector/';\n $this->config['MOD_NAME'] = 'detector/';\n $this->config['DETECTOR_API_DIR'] = LIBRARIES_DIR . 'detector/';\n\n require CONFIGURATION_DIR . \"/configuration.php\";\n $this->fallback = $fallback_view;\n }",
"private function writeConfig()\n {\n $dumpedData = $this->dumper->dump($this->optionsYAML, 2);\n foreach ($this->finder as $configFile) {\n /** @var SplFileInfo $configFile */\n $this->filesystem->dumpFile($configFile->getRealPath(), $dumpedData);\n }\n }",
"static public function write_config() {\n\t\tfile_put_contents(PIPES_DIR . 'config.json', json_encode(self::$config));\n\t}",
"public function test_Save() \n {\n $config = new Config_File($this->file);\n $config['a'] = 20;\n $config->save();\n \n $this->assertArrayHasKey(0, Config_Mock_Unserialize::$created);\n $mock = Config_Mock_Unserialize::$created[0]; \n $this->assertType('Q\\Fs_File', $mock->in);\n $this->assertEquals($this->file, (string)$mock->in);\n\n $this->assertType('Q\\Config_File', $config);\n $this->assertEquals($mock->reverse->out, serialize((array)$config));\n \n $this->assertEquals(1, count(Config_Mock_Unserialize::$created)); \n }",
"private function __writeConfig() {\n\t\t$File = new File($this->__configPath . 'config.json', true);\n\t\treturn $File->write(json_encode($this->__info));\n\t}",
"public function save() {\n $ini = '';\n #\n # Create section\n #\n foreach (self::$config as $id => $section) {\n $ini .= '['.$id.']'.LF;\n #\n # Create parameter = \"value\" in the section\n #\n foreach ($section as $key => $value) {\n if (!is_array($value)) {\n $ini .= $key.' = \"'. str_replace('\"', '"', $value).'\"'.LF;\n } else {\n #\n # Create array of parameter = \"value\" in the section\n #\n foreach ($value as $i => $item) {\n if (!is_array($item)) {\n $ini .= $key.'['.$i.'] = \"'. str_replace('\"', '"', $item).'\"'.LF;\n } else {\n foreach ($item as $j => $point) {\n if (!empty($point)) {\n $ini .= $key.'['.$j.'] = \"'. str_replace('\"', '"', $point).'\"'.LF;\n }\n }\n }\n }\n }\n }\n }\n return file_put_contents(self::$ini, $ini, LOCK_EX);\n }",
"function save() {\n\t\t$this->serialize_config($this->config);\n\t}",
"function writecfg(){\n $key = $this->key;\n\n $rev = Configure::read($key);\n\n $value=serialize($rev);\n\n //if the configs haven't changed, no need to save them\n if ($value==$this->checksum) return;\n\n //otherwise the configs have changed, so\n\n $this->data = array('key'=>$key,'value'=>$value);\n\n if ($setting = $this->findByKey($key)) {\n $this->data['id'] = $setting['Setting']['id'];\n }\n\n $this->save($this->data);\n }",
"private static function insertConfig()\n {\n exec('cp -rn ' . App::root('vendor/juneszh/alight-admin/example/config/*') . ' ' . App::root('config/'));\n\n $configData = Config::get();\n $configFile = App::root(Config::FILE);\n $routeAdmin = 'config/route/admin.php';\n if ($configData['route']) {\n $configRoute = is_string($configData['route']) ? [$configData['route']] : $configData['route'];\n $associative = false;\n $insert = false;\n foreach ($configRoute as $value) {\n if (is_string($value)) {\n if (strpos($value, $routeAdmin) !== false) {\n $insert = true;\n break;\n }\n } elseif (is_array($value)) {\n foreach ($value as $value2) {\n if (strpos($value2, $routeAdmin) !== false) {\n $insert = true;\n break;\n break;\n }\n }\n }\n }\n if (!$insert) {\n foreach ($configRoute as $key => $value) {\n if (is_string($key)) {\n $associative = true;\n if ($key === '*') {\n if (is_string($value)) {\n $configRoute[$key] = [$value];\n }\n }\n }\n }\n if ($associative) {\n if (isset($configRoute['*'])) {\n $configRoute['*'][] = $routeAdmin;\n } else {\n $configRoute['*'] = $routeAdmin;\n }\n } else {\n $configRoute[] = $routeAdmin;\n }\n }\n } else {\n $configRoute = [$routeAdmin];\n }\n $configData['route'] = $configRoute;\n\n if (!isset($configData['admin']) || !$configData['admin']) {\n $configData['admin'] = array_intersect_key(AdminConfig::$config, ['title' => 1, 'path' => 1, 'locale' => 1]);\n }\n\n if (!isset($configData['admin']['menu']) || !$configData['admin']['menu']) {\n $configData['admin']['menu'] = 'config/admin/menu.php';\n }\n\n if (!isset($configData['admin']['console']) || !$configData['admin']['console']) {\n $configData['admin']['console'] = 'config/admin/console.php';\n }\n\n if ($configData) {\n file_put_contents($configFile, '<?php' . PHP_EOL . 'return ' . VarExporter::export($configData) . ';', LOCK_EX);\n }\n }",
"abstract protected function writeConfig($storages);",
"function save_conf() {\r\r\n\t\t$f = $this->s_DataDir.\"config\".$this->s_calendar_index.\".php\";\r\r\n\t\t$fb = $this->s_DataDir.\"config\".$this->s_calendar_index.\"_bak.php\";\r\r\n\t\t$this->copy_data($fb, $f);\r\r\n\t\t$this->drop_data($fb);\r\r\n\t}",
"public function testConfigDirectory()\n {\n $this->assertEquals($this->path->config().' created successfully', $this->generator->config());\n }",
"private function saveConfig()\n {\n try {\n if(!file_exists($this->configFile))\n file_put_contents(__DIR__.'/'.$this->configFile, json_encode([\n 'token' => 'TOKEN',\n ]));\n\n $data = json_encode($this->config);\n file_put_contents($this->configFile, $data);\n }catch (\\Exception $ex){\n $this->debug($ex->getMessage());\n return 0;\n }\n return 1;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create an instance of Auth. | public static function factory($config = array())
{
return new Auth($config);
} | [
"public static function auth()\n {\n return new Auth;\n }",
"function auth() {\n return new Auth;\n }",
"public static function factory($config = array()) {\n\t\treturn new Auth($config);\n\t}",
"public function __construct()\n\t{\n\t\t$this->protect = new Auth();\n\t}",
"public static function instance()\n {\n static $instance;\n\n // Load the Auth instance\n empty($instance) and $instance = new Auth();\n\n return $instance;\n }",
"public static function getInstance()\n {\n if (is_null(self::$instance)) {\n self::$instance = new Auth();\n }\n return self::$instance;\n }",
"public static function instance()\n\t{\n\t\t// Create instance if not already set\n\t\tif ( ! self::$_instance)\n\t\t{\n\t\t\tself::$_instance = new Auth;\n\t\t}\n\n\t\t// Return instance\n\t\treturn self::$_instance;\n\t}",
"function auth()\n {\n return (new AuthManager())->get();\n }",
"public static function instance($config = 'simple_auth')\n\t{\n\t\tstatic $instance;\n\n\t\t// Load the Auth instance\n\t\tempty($instance) and $instance = new Simple_Auth($config);\n\n\t\treturn $instance;\n\t}",
"public static function factory($config = array())\n\t{\n\t\treturn new Multi_Auth($config);\n\t}",
"public function createAuth(Request $request): Auth {\n $moduleBaseName = 'Auth';\n if (! $this->isTestMode()) {\n $moduleName = $moduleBaseName . 'Common';\n } else {\n $moduleName = $moduleBaseName . 'Test';\n }\n $object = $this->createModule($moduleName, $moduleBaseName);\n $object->setRequest($request);\n return $object;\n }",
"protected function getAuth() {\n return new DbAuth (App::getInstance()->getDb());\n }",
"private function authInstance()\n\t{\n\t\t# Your new class *should* inherits dcAuth.\n\t\tif (!defined('DC_AUTH_CLASS')) {\n\t\t\t$c = 'dcAuth';\n\t\t} else {\n\t\t\t$c = DC_AUTH_CLASS;\n\t\t}\n\t\t\n\t\tif (!class_exists($c)) {\n\t\t\tthrow new Exception('Authentication class '.$c.' does not exist.');\n\t\t}\n\t\t\n\t\tif ($c != 'dcAuth' && !is_subclass_of($c,'dcAuth')) {\n\t\t\tthrow new Exception('Authentication class '.$c.' does not inherit dcAuth.');\n\t\t}\n\t\t\n\t\treturn new $c($this);\n\t}",
"protected function getAuth() {\n\t\t\treturn new DbAuth (App::getInstance()->getDb());\n\t}",
"static public function instance(array $config = array()) {\n\t\treturn op5objstore::instance()->obj_instance_callback(\n\t\t\t__CLASS__,\n\t\t\tfunction () use($config) {\n\t\t\t\treturn new op5auth($config);\n\t\t\t}\n\t\t);\n\t}",
"function factory($driver, $params = null)\n {\n if (is_array($driver)) {\n $app = $driver[0];\n $driver = $driver[1];\n }\n\n $driver = basename($driver);\n if (empty($driver) || ($driver == 'none')) {\n return new Auth();\n }\n\n if (is_null($params)) {\n $params = Horde::getDriverConfig('auth', $driver);\n }\n\n $class = 'Auth_' . $driver;\n $include_error = '';\n if (!class_exists($class)) {\n $oldTrackErrors = ini_set('track_errors', 1);\n if (!empty($app)) {\n include $GLOBALS['registry']->get('fileroot', $app) . '/lib/Auth/' . $driver . '.php';\n } else {\n include 'Horde/Auth/' . $driver . '.php';\n }\n if (isset($php_errormsg)) {\n $include_error = $php_errormsg;\n }\n ini_set('track_errors', $oldTrackErrors);\n }\n\n if (class_exists($class)) {\n $auth = new $class($params);\n } else {\n $auth = PEAR::raiseError('Auth Driver (' . $class . ') not found' . ($include_error ? ': ' . $include_error : '') . '.');\n }\n\n return $auth;\n }",
"private function setupAuth()\n {\n Auth::extend( 'doctrine2l5', function() {\n return new \\Illuminate\\Auth\\Guard(\n new \\Doctrine2l5\\Auth\\Doctrine2UserProvider(\n \\D2EM::getRepository( Config::get( 'd2doctrine.auth.entity' ) ),\n new \\Illuminate\\Hashing\\BcryptHasher\n ),\n \\App::make('session.store')\n );\n });\n }",
"public function __construct(){\r\n\t\t$this->_auth = Zend_Auth::getInstance();\r\n\t}",
"public function auth()\n {\n return OAuthManager::getInstance();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ FINANCIAL METHODS Retrieve a financial table for owners and agents that includes maintenance costs, credit card charges, manual payments and owner payouts for a specified property | function getTotalTable($property_id, $startdate, $enddate){
global $db;
global $user_id;
// Get the daily rent amount
try{
$query = "SELECT amount as other, '' as cc_charge, '' as maintenance, '' as payout, request_datetime AS datetime, NULL as cc_charge_id, comment FROM other_payment
JOIN tenancy as t on t.tenancy_id = other_payment.tenancy_id WHERE t.property_id = ? AND request_datetime BETWEEN date(?) and date(?)
UNION ALL
SELECT '', amount, '', '', datetime, cc_charge_id, 'Automatic rent payment' FROM cc_charges
JOIN tenancy as t on t.tenancy_id = cc_charges.tenancy_id WHERE t.property_id = ? AND datetime BETWEEN date(?) and date(?)
UNION ALL
SELECT '', '', amount, '', request_datetime AS datetime, NULL, comment FROM maintenance_costs
JOIN tenancy as t on t.tenancy_id = maintenance_costs.tenancy_id WHERE t.property_id = ? AND request_datetime BETWEEN date(?) and date(?)
UNION ALL
SELECT '', '', '', amount, datetime, NULL, comment FROM owner_payments as o_p LEFT JOIN ownership as o on o_p.ownership_id = o.ownership_id WHERE property_id = ? AND datetime BETWEEN date(?) and date(?)
ORDER BY datetime DESC";
$stmt = $db->prepare($query);
$stmt->execute(array($property_id, $startdate, $enddate, $property_id, $startdate, $enddate, $property_id, $startdate, $enddate, $property_id, $startdate, $enddate));
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
return $result;
} catch (PDOException $e) {
// Something went wrong
var_dump($e);
return 0;
}
} | [
"function getPayouts($property_id, $startdate, $enddate) {\n\t\tglobal $db;\n\t\t\n\t\t$owner = getOwner($property_id);\n\t\t//change for multiple tenants - cycle through all tenancys that are in that property\n\t\t$ownershipID = $owner[0][\"ownership_id\"];\n\t\t//shows tenant name, only use though is if the property goes \n\t\t//through multiple tenants and want to see separate tenants but retain old ones\n\t\t$query = \"\n\t\t\tSELECT concat(u.first_name, ' ', u.last_name) AS name, \n\t\t\t\tp.amount as 'payout', p.datetime, p.comment, ' ' as rent, ' ' as main\n\t\t\tFROM owner_payments AS p\n\t\t\tLEFT JOIN ownership AS o ON p.ownership_id=o.ownership_id\n\t\t\tLEFT JOIN users AS u ON u.user_id =o.owner_id\n\t\t\tWHERE p.ownership_id = ? AND p.datetime >= ? AND p.datetime <= ?\n\t\t\tGROUP BY p.datetime\";\n\t\t\n\t\t$stmt = $db->prepare($query);\n\t\t$stmt->execute(array($ownershipID, $startdate, $enddate));\n\t\t$results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\treturn $results;\n\t}",
"function getOwner($property_id) {\n\t\tglobal $db;\n\t\t$query = \"SELECT * \n\t\t\t\tFROM ownership WHERE property_id = ?\";\n\t\t\n\t\t$stmt = $db->prepare($query);\n\t\t$stmt->execute(array($property_id));\n\t\t$results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\treturn $results;\n\t}",
"public function getOudtshoornWestSimilarPropertyOnShow(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = 102\n\t\t\t\t\t\t AND properties.property_status = 'On Show'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}",
"function getMaintenance($propId, $startdate, $enddate) {\n\t\tglobal $db;\n\t\t\n\t\t$tenant = getTenant($propId);\n\t\t//change for multiple tenants - cycle through all tenancys that are in that property\n\t\t$tenancyID = $tenant[0][\"tenancy_id\"];\n\t\t\n\t\t//shows tenant name, only use though is if the property goes \n\t\t//through multiple tenants and want to see separate tenants but retain old ones\n\t\t$query = \"\n\t\t\tSELECT concat(u.first_name, ' ', u.last_name) AS name, \n\t\t\t\tc.amount/100 as amount, c.approved_datetime, i.issue_category, c.comment, ' ' as rent, ' ' as payout\n\t\t\tFROM maintenance_costs AS c\n\t\t\tLEFT JOIN tenancy AS t ON c.tenancy_id=t.tenancy_id\n\t\t\tLEFT JOIN issue_items AS i ON c.item_id=i.item_id\n\t\t\tLEFT JOIN users AS u ON u.user_id =t.tenant_id\n\t\t\tWHERE c.tenancy_id = ? AND c.request_datetime >= ? AND c.request_datetime <= ?\n\t\t\tGROUP BY c.approved_datetime\";\n\t\t\n\t\t$stmt = $db->prepare($query);\n\t\t$stmt->execute(array($tenancyID, $startdate, $enddate));\n\t\t$results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\treturn $results;\n\t}",
"function actionGetFinancialDetails() {\r\n //if there is no session\r\n if (!isset(Yii::app()->getSession()->get('wsuser')->id)) {\r\n $this->sendResponse(200, CJSON::encode(array(\"status\" => \"ERROR\", \"message\" => \"Session Expired\")));\r\n }\r\n\r\n $wsUserObject = Yii::app()->getSession()->get('wsuser');\r\n $user_id = Yii::app()->getSession()->get('wsuser')->id;\r\n\r\n $singleORMAssetObj = Assets::model()->findAll(\"user_id=:user_id and status!=1\", array(\"user_id\" => $user_id));\r\n $debtsORMObj = Debts::model()->findAll(\"user_id=:user_id and status!=1\", array(\"user_id\" => $user_id));\r\n $insuranceORMObj = Insurance::model()->findAll(\"user_id=:user_id and status!=1\", array(\"user_id\" => $user_id));\r\n\r\n $netWorth = 0;\r\n $assetTotal = 0;\r\n $assets = array();\r\n foreach ($singleORMAssetObj as $acc) {\r\n $tok = strtok($acc->address, '+');\r\n $propadd = '';\r\n $propadd2 = '';\r\n $propcity = '';\r\n $propstate = '';\r\n if ($tok != false) {\r\n $propadd = $tok;\r\n $propadd2 = strtok('+');\r\n $propcity = strtok('+');\r\n $propstate = strtok('+');\r\n }\r\n $lsEachAcc = array(\r\n 'id' => $acc->id,\r\n 'user_id' => $acc->user_id,\r\n 'context' => $acc->context,\r\n 'type' => $acc->type,\r\n 'subtype' => $acc->subtype,\r\n 'name' => $acc->name,\r\n 'amount' => $acc->balance,\r\n 'actid' => $acc->actid,\r\n 'accttype' => $acc->type,\r\n 'refId' => $acc->refid,\r\n 'beneficiary' => $acc->beneficiary,\r\n 'assettype' => $acc->assettype,\r\n 'contribution' => $acc->contribution,\r\n 'growthrate' => $acc->growthrate,\r\n 'empcontribution' => $acc->empcontribution,\r\n 'withdrawal' => $acc->withdrawal,\r\n 'netincome' => $acc->netincome,\r\n 'loan' => $acc->loan,\r\n 'propadd' => $propadd,\r\n 'propadd2' => $propadd2,\r\n 'propcity' => $propcity,\r\n 'propstate' => $propstate,\r\n 'livehere' => $acc->livehere,\r\n 'zipcode' => $acc->zipcode,\r\n 'agepayout' => $acc->agepayout,\r\n 'status' => $acc->status,\r\n 'ticker' => $acc->ticker,\r\n 'invpos' => json_decode($acc->invpos),\r\n 'lstype' => $acc->lstype\r\n );\r\n $assets[] = $lsEachAcc;\r\n if ($acc->status == 0 && $acc->type != 'PENS' && $acc->type != 'SS') {\r\n $assetTotal = $assetTotal + $acc->balance;\r\n }\r\n }\r\n $netWorth = $netWorth + $assetTotal;\r\n\r\n $debtTotal = 0;\r\n $lsAccDEBT = array();\r\n foreach ($debtsORMObj as $acc) {\r\n $lsEachAcc = array(\r\n 'id' => $acc->id,\r\n 'user_id' => $acc->user_id,\r\n 'context' => $acc->context,\r\n 'name' => $acc->name,\r\n 'amount' => $acc->balowed,\r\n 'actid' => $acc->actid,\r\n 'amtpermonth' => $acc->amtpermonth,\r\n 'apr' => $acc->apr,\r\n 'yearsremaining' => $acc->yearsremaining,\r\n 'intdeductible' => $acc->intdeductible,\r\n 'mortgagetype' => $acc->mortgagetype,\r\n 'livehere' => $acc->livehere,\r\n 'accttype' => $acc->type,\r\n 'subtype' => $acc->subtype,\r\n 'refId' => $acc->refid,\r\n 'status' => $acc->status,\r\n 'monthly_payoff_balances' => $acc->monthly_payoff_balances,\r\n 'lstype' => \"DEBT\"\r\n );\r\n $lsAccDEBT[] = $lsEachAcc;\r\n if ($acc->status == 0 && $acc->monthly_payoff_balances == 0) {\r\n $debtTotal = $debtTotal + $acc->balowed;\r\n }\r\n }\r\n $netWorth = $netWorth - $debtTotal;\r\n\r\n $insuranceTotal = 0;\r\n $lsAccINSURANCE = array();\r\n foreach ($insuranceORMObj as $acc) {\r\n $lsEachAcc = array(\r\n 'id' => $acc->id,\r\n 'name' => $acc->name,\r\n 'insurancefor' => $acc->insurancefor,\r\n 'user_id' => $acc->user_id,\r\n 'context' => $acc->context,\r\n 'amount' => $acc->cashvalue,\r\n 'annualpremium' => $acc->annualpremium,\r\n 'reviewyear' => $acc->reviewyear,\r\n 'actid' => $acc->actid,\r\n 'dailybenfitamt' => $acc->dailybenfitamt,\r\n 'policyendyear' => $acc->policyendyear,\r\n 'coverageamt' => $acc->coverageamt,\r\n 'lifeinstype' => $acc->lifeinstype,\r\n 'amtupondeath' => $acc->amtupondeath,\r\n 'deductible' => $acc->deductible,\r\n 'grouppolicy' => $acc->grouppolicy,\r\n 'beneficiary' => $acc->beneficiary,\r\n 'dailyamtindexed' => $acc->dailyamtindexed,\r\n 'accttype' => $acc->type,\r\n 'subtype' => $acc->subtype,\r\n 'refId' => $acc->refid,\r\n 'status' => $acc->status,\r\n 'lstype' => \"INSURANCE\"\r\n );\r\n $lsAccINSURANCE[] = $lsEachAcc;\r\n if ($acc->status == 0 && $acc->type == 'LIFE') {\r\n $insuranceTotal = $insuranceTotal + $acc->cashvalue;\r\n }\r\n }\r\n $netWorth = $netWorth + $insuranceTotal;\r\n\r\n $wsEachUserItemBankAccount = array(\r\n 'assets' => $assets,\r\n 'assetTotal' => $assetTotal,\r\n 'debts' => $lsAccDEBT,\r\n 'debtTotal' => $debtTotal,\r\n 'insurance' => $lsAccINSURANCE,\r\n 'insuranceTotal' => $insuranceTotal,\r\n 'networth' => $netWorth,\r\n );\r\n $this->sendResponse(200, CJSON::encode(array(\"status\" => \"OK\", \"accounts\" => $wsEachUserItemBankAccount)));\r\n }",
"public function getPropertiesTopStats()\n {\n try {\n $propertyTopStats = Property::select(\n \\DB::raw('SUM(CASE WHEN sold_at IS NOT NULL THEN 1 ELSE 0 END) AS sold'),\n \\DB::raw('SUM(COALESCE(is_exclusive, 0)) AS exclusive')\n );\n\n $todayDate = (new \\DateTime('now', new \\DateTimeZone('UTC')))->format('Y-m-d');\n $thisMonthsFirstDate\n = (new \\DateTime('first day of this month', new \\DateTimeZone('UTC')))->format('Y-m-d');\n\n $totalTransactions = Property::select(\n \\DB::raw('SUM(COALESCE(NULLIF(price, 0), price_lower_range, price_upper_range, 0)) AS transactions')\n )\n ->whereNotNull('sold_at');\n\n $monthsViews = View::select(\n \\DB::raw('COUNT(views.id) AS views')\n )\n // ->whereRaw('MONTH(views.created_at) = ?', [date('n')])\n // ->whereRaw('YEAR(views.created_at) = ?', [date('Y')]);\n ->whereBetween('views.created_at', [$thisMonthsFirstDate, $todayDate]);\n\n $daysTransactions = Property::select(\n \\DB::raw('SUM(COALESCE(NULLIF(price, 0), price_lower_range, price_upper_range, 0)) AS transaction')\n )\n //->whereNotNull('sold_at')\n // ->whereRaw('DAY(created_at) = ?', [date('j')])\n // ->whereRaw('MONTH(created_at) = ?', [date('n')])\n // ->whereRaw('YEAR(created_at) = ?', [date('Y')]);\n ->whereBetween('sold_at', [$todayDate . ' 00:00:00', $todayDate . ' 23:59:59']);\n\n $user = Auth::guard('users')->user();\n\n if ($user->perms !== 0) {\n $agentId = $user->id;\n\n $propertyTopStats\n ->where('user_id', $agentId);\n\n $totalTransactions\n ->where('user_id', $agentId);\n\n $monthsViews\n ->join(\n 'properties',\n function ($join) use ($agentId) {\n $join->on('views.property_code', '=', 'properties.code')\n ->where('properties.user_id', $agentId);\n }\n );\n\n $daysTransactions\n ->where('user_id', $agentId);\n }\n\n $propertyTopStats = $propertyTopStats->first();\n $totalTransactions = $totalTransactions->first();\n $monthsViews = $monthsViews->first();\n $daysTransactions = $daysTransactions->first();\n\n return response()->json(['sold' => +$propertyTopStats->sold, 'exclusive' => +$propertyTopStats->exclusive, 'transactions' => +$totalTransactions->transactions, 'months_views' => $monthsViews->views, 'days_transactions' => +$daysTransactions->transaction], 200);\n } catch (\\Exception $e) {\n return response()->json(['message' => 'Problem getting stats'], 500);\n }\n }",
"public function actionIndex()\n {\n $user = Yii::$app->user->identity;\n $searchModel = new PropertyEnquierySearch();\n if(AuthHelper::is('agency')){\n $agencyId = $user->agency_id;\n $agents = \\yii\\helpers\\ArrayHelper::getColumn(\\common\\models\\User::find()->where(['agency_id' => $agencyId])->all(), 'id');\n $searchModel->ownerId = $agents;\n }else{\n $searchModel->ownerId = $user->id;\n }\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function getMetsimaholoSimilarPropertyToRent(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = 53\n\t\t\t\t\t\t AND properties.property_status = 'To Rent'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}",
"function Owner_Property_List() {\n global $app;\n $req = $app->request(); // Getting parameter with names \n $user_id = $req->params('owner_id');\n $type = $req->params('type'); //type=>flat,type=>villa,type=>independent\n $token = $req->params('auth_token');\n $timestamp = date('Y-m-d H:i:s');\n\n if (!empty($user_id)) { // check driver id\n if (checkAuthenticationOwner($token) == 1) {\n\n try {\n if ($type == 'flat') { //for flat\n $sql_query = \"select * FROM tbl_property WHERE owner_id='$user_id' AND property_type_id='1' AND is_active='1'\";\n } elseif ($type == 'villa') { //for villa\n $sql_query = \"select * FROM tbl_property WHERE owner_id='$user_id' AND property_type_id='2' AND is_active='1'\";\n } else { //For independent\n $sql_query = \"select * FROM tbl_property WHERE owner_id='$user_id' AND property_type_id='3' AND is_active='1'\";\n }\n $dbCon = getDB();\n $stmt = $dbCon->query($sql_query);\n $result = $stmt->rowCount();\n // Check num rows \n $propertylist = $stmt->fetchAll(PDO::FETCH_OBJ);\n $PropertyArray = array();\n foreach ($propertylist as $propertylistVal) {\n $ImageQuery = \"select property_image FROM tbl_property_image WHERE property_id='$propertylistVal->id' \";\n $stmt_images = $dbCon->query($ImageQuery);\n $Images = $stmt_images->fetchAll(PDO::FETCH_OBJ);\n /* For create a propert name */\n if ($type == 'flat') { //for flat\n $name = $propertylistVal->bhk . ' flat ';\n if (isset($propertylistVal->floor) && !empty($propertylistVal->floor)) {\n $name .= $propertylistVal->floor . ' floor';\n }\n } elseif ($type == 'villa') { //for villa\n $name = \"Villa\";\n } elseif ($type == 'independent') { //For independent\n $name = \"Independent\";\n }\n $PropertyArray[] = array(\n 'id' => $propertylistVal->id,\n 'property_type_id' => $propertylistVal->property_type_id,\n 'owner_id' => $propertylistVal->owner_id,\n // 'name' => $propertylistVal->name,\n 'name' => $name,\n 'floor' => $propertylistVal->floor,\n 'bhk' => $propertylistVal->bhk,\n 'no_of_room' => $propertylistVal->no_of_room,\n 'property_area' => $propertylistVal->property_area,\n 'location' => $propertylistVal->location,\n 'latitude' => $propertylistVal->latitude,\n 'longitude' => $propertylistVal->longitude,\n 'property_rent' => $propertylistVal->property_rent,\n 'house_no' => $propertylistVal->house_no,\n 'landmark' => $propertylistVal->landmark,\n 'additional_comment' => $propertylistVal->additional_comment,\n 'images' => $Images,\n 'is_property' => $propertylistVal->is_property\n );\n }\n\n $dbCon = null;\n $driver_array = array('success' => '1', 'property_list' => $PropertyArray, 'ImageUrl' => IMAGE_UPLOAD_URL . '/property_image/');\n echo $senddata = json_encode($driver_array);\n } catch (PDOException $e) {\n $error_array = array('success' => '0', 'text' => $e->getMessage());\n echo $senddata = json_encode($error_array);\n }\n } else {\n $error_array = array('success' => '0', 'text' => 'Token not valid !');\n echo $senddata = json_encode($error_array);\n }\n } else {\n $error_array = array('success' => '0', 'text' => 'All fields Required !');\n echo $senddata = json_encode($error_array);\n }\n savelogs($senddata, 'Owner_Property_List');\n}",
"public function getRandWestSimilarPropertyForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_status, property_type, property_desc, price, num_bathrooms, \n\t\t\t\t\t\t street_no, street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = 9\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}",
"public function getInvestorFunded()\n {\n return \\Md\\Fund::where('investor_id', '=', \\Auth::user()->id)\n ->with('innovation','innovation.user', 'innovation.category')\n ->groupBy('innovation_id')\n ->latest()\n ->paginate(3,['*'], 'investor');\n }",
"function getCurrentContractors()\r\n {\r\n include '../includes/db.php';\r\n include '../actions/controller.php';\r\n $controller = new Controller();\r\n try {\r\n $sql = \"SELECT * FROM contractors LEFT JOIN propertycontractors ON contractors.contractorID =\r\n propertycontractors.contractorID WHERE customerID = :custID\";\r\n $result = $pdo->prepare($sql);\r\n $result->bindParam(\":custID\", $_SESSION['customerID']);\r\n $result->execute();\r\n $controller->printContractorTable($result);\r\n } Catch (PDOException $e){\r\n echo \"ERROR!: \" . $e;\r\n exit();\r\n }\r\n }",
"public function getCapeAgulhasSimilarPropertyOnShow(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = 112\n\t\t\t\t\t\t AND properties.property_status = 'On Show'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}",
"function propertyPriceDetails($propertyId)\n{\n $query = \"select * from add_property_price_dtls where ap_id={$propertyId}\";\n\n return getQueryResults($query)[0];\n}",
"public function get_forsaleindex(){\n\t\t$allproperties = DB::table('properties')->where('property_isDeleted', '!=', '1')\n\t\t\t\t\t\t\t\t\t\t\t\t->where('property_statusId', '1')\n\t\t\t\t\t\t\t\t\t\t\t\t->orderBy('created_at','desc')->paginate(10);\n\n\t\t$allpropertytypes = DB::table('property_types')->orderBy('property_type_name')->get();\n\t\t$allpropertystatuses = DB::table('property_statuses')->orderBy('property_status_name')->get();\n\t\t$allpropertyvendors = DB::table('customers')->where('customer_type', 'Vendor')->orderBy('customer_firstName')->get();\n\n\t\t$this->layout->content = View::make('properties.index')\n\t\t\t->with('title', 'List of Properties')\n\t\t\t->with('properties', $allproperties)\n\t\t\t->with('propertytypes', $allpropertytypes)\n\t\t\t->with('propertyvendors', $allpropertyvendors)\n\t\t\t->with('propertystatuses', $allpropertystatuses);\n\t}",
"private function get_properties():array\n {\n $db = sparql_connect(\"https://landregistry.data.gov.uk/landregistry/query\");\n if (!$db) {\n print sparql_errno() . \": \" . sparql_error(). \"\\n\";\n exit;\n }\n sparql_ns(\"rdf\", \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\");\n sparql_ns(\"rdfs\", \"http://www.w3.org/2000/01/rdf-schema#\");\n sparql_ns(\"owl\", \"http://www.w3.org/2002/07/owl#\");\n sparql_ns(\"xsd\", \"http://www.w3.org/2001/XMLSchema#\");\n sparql_ns(\"sr\", \"http://data.ordnancesurvey.co.uk/ontology/spatialrelations/\");\n sparql_ns(\"ukhpi\", \"http://landregistry.data.gov.uk/def/ukhpi/\");\n sparql_ns(\"lrppi\", \"http://landregistry.data.gov.uk/def/ppi/\");\n sparql_ns(\"skos\", \"http://www.w3.org/2004/02/skos/core#\");\n sparql_ns(\"lrcommon\", \"http://landregistry.data.gov.uk/def/common/\");\n sparql_ns(\"ppd\", \"http://landregistry.data.gov.uk/def/ppi/\");\n \n $sparql = \"SELECT ?paon ?saon ?street ?town ?county ?postcode ?amount ?date ?property_type\n WHERE\n {\n FILTER( ?town = \\\"$this->town\\\"^^xsd:string )\n FILTER( strstarts( str(?postcode), \\\"$this->postcode\\\"^^xsd:string) )\n FILTER( ?date > \\\"$this->date_sold\\\"^^xsd:date )\n FILTER( ?amount > $this->min && ?amount < $this->max)\n \n ?addr lrcommon:postcode ?postcode ;\n lrcommon:town ?town .\n\n ?transx ppd:propertyAddress ?addr ;\n ppd:pricePaid ?amount ;\n ppd:transactionDate ?date ;\n ppd:transactionCategory <http://landregistry.data.gov.uk/def/ppi/standardPricePaidTransaction> ;\n ppd:propertyType ?property_type .\n \n OPTIONAL {?addr lrcommon:county ?county}\n OPTIONAL {?addr lrcommon:paon ?paon}\n OPTIONAL {?addr lrcommon:saon ?saon}\n OPTIONAL {?addr lrcommon:street ?street}\n }\n \";\n $result = sparql_query($sparql);\n if (!$result) {\n return ['error'=>'landregistry error', 'error_no'=> sparql_errno() . ': ' . sparql_error()];\n }\n $result= (array)$result;\n return $result['rows'];\n }",
"public function getCapeTownPropertyListImagesForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = '96'\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}",
"public function getPropertyAgentOnShow($property_id){\n\t\t\t$query = \"SELECT a.*, c.agency_id, c.logo, c.agency_name, property_id, price, property_desc\n\t\t\t\t\t FROM agents a\n\t\t\t\t\t LEFT JOIN properties p\n\t\t\t\t\t ON a.agent_id = p.agent_id\n\t\t\t\t\t LEFT JOIN agencies c\n\t\t\t\t\t ON a.agency_id = c.agency_id\n\t\t\t\t\t WHERE property_id = '$property_id'\n\t\t\t\t\t AND property_status = 'On Show'\";\n\t\t\t$result = $this->conn->query($query);\n\t\t\t$row = $result->fetch(PDO::FETCH_ASSOC);\n\t\t\t\n\t\t\t$agency = new Agency();\n\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\n\t\t\t$agent = new Agent();\n\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t$agent->setPhone($row['phone']);\n\t\t\t$agent->setImage($row['image']);\n\t\t\t$agent->setAgency($agency);\n\t\t\t\n\t\t\treturn $agent;\n\t\t}",
"public function getEmfuleniPropertyListImagesToRent(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = '4'\n\t\t\t\t\t\t AND properties.property_status = 'To Rent'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Limita las etiquetas html que se muestran en un texto | function LimitarEtiquetas(&$texto)
{
return strip_tags($texto,'<p><font><br><strong><b><em><i><strike><u><ol><ul><li><alt><sub><sup><blockquote><table><tr><td><th><tbody><thead><tfoot><caption><span><pre><address><h1><h2><h3><h4><h5><h6><hr><dd><dl><dt><cite><abbr><acronym><del><ins><div><img><a>');
} | [
"function str_limit_html($value, $limit = 200){\n \n if (mb_strwidth($value, 'UTF-8') <= $limit) {\n return $value;\n }\n \n // Strip text with HTML tags, sum html len tags too.\n // Is there another way to do it?\n do {\n $len = mb_strwidth( $value, 'UTF-8' );\n $len_stripped = mb_strwidth( strip_tags($value), 'UTF-8' );\n $len_tags = $len - $len_stripped;\n \n $value = mb_strimwidth($value, 0, $limit+$len_tags, '', 'UTF-8');\n } while( $len_stripped > $limit);\n \n // Load as HTML ignoring errors\n $dom = new DOMDocument();\n @$dom->loadHTML('<?xml encoding=\"utf-8\" ?>' . $value, LIBXML_HTML_NODEFDTD); \n\n // Fix the html errors\n $value = $dom->saveHtml($dom->getElementsByTagName('body')->item(0));\n \n // Remove body tag\n $value = mb_strimwidth($value, 6, mb_strwidth($value, 'UTF-8') - 13, '', 'UTF-8'); // <body> and </body>\n // Remove empty tags\n return preg_replace('/<(\\w+)\\b(?:\\s+[\\w\\-.:]+(?:\\s*=\\s*(?:\"[^\"]*\"|\"[^\"]*\"|[\\w\\-.:]+))?)*\\s*\\/?>\\s*<\\/\\1\\s*>/', '', $value);\n }",
"function limpia_contenido($texto){\r\n\r\n $retorno = strip_tags($texto);\r\n $retorno = strip_shortcodes($retorno);\r\n\r\n return $retorno;\r\n}",
"protected static function _htmltotext($html){\n\t\t\t$replace = array( // key=search value=replace\n\t\t\t\t\"/\\r/\"=>'', // Non-legal carriage return\n\t\t\t\t\"/[\\n\\t]+/\"=>' ', // Newlines and tabs\n\t\t\t\t'/[ ]{2,}/'=>' ', // Runs of spaces, pre-handling\n\t\t\t\t'/<script[^>]*>.*?<\\/script>/i'=>'', // <script>s -- which strip_tags supposedly has problems with\n\t\t\t\t'/<style[^>]*>.*?<\\/style>/i'=>'', // <style>s -- which strip_tags supposedly has problems with\n\t\t\t\t'/<h[123][^>]*>(.*?)<\\/h[123]>/ie'=>\"strtoupper(\\\"\\n\\n\\\\1\\n\\n\\\")\", // H1 - H3\n\t\t\t\t'/<h[456][^>]*>(.*?)<\\/h[456]>/ie'=>\"ucwords(\\\"\\n\\n\\\\1\\n\\n\\\")\", // H4 - H6\n\t\t\t\t'/<p[^>]*>/i'=>\"\\n\\n\\t\", // <P>\n\t\t\t\t'/<br[^>]*>/i'=>\"\\n\", // <br>\n\t\t\t\t'/<b[^>]*>(.*?)<\\/b>/ie'=>'strtoupper(\"\\\\1\")', // <b>\n\t\t\t\t'/<strong[^>]*>(.*?)<\\/strong>/ie'=>'strtoupper(\"\\\\1\")', // <strong>\n\t\t\t\t'/<i[^>]*>(.*?)<\\/i>/i'=>'_\\\\1_', // <i>\n\t\t\t\t'/<em[^>]*>(.*?)<\\/em>/i'=>'_\\\\1_', // <em>\n\t\t\t\t'/(<ul[^>]*>|<\\/ul>)/i'=>\"\\n\\n\", // <ul> and </ul>\n\t\t\t\t'/(<ol[^>]*>|<\\/ol>)/i'=>\"\\n\\n\", // <ol> and </ol>\n\t\t\t\t'/<li[^>]*>(.*?)<\\/li>/i'=>\"\\t* \\\\1\\n\", // <li> and </li>\n\t\t\t\t'/<li[^>]*>/i'=>\"\\n\\t* \", // <li>\n\t\t\t\t'/<a [^>]*href=\"([^\"]+)\"[^>]*>(.*?)<\\/a>/ie'=>'self::_build_link_list(\"\\\\1\", \"\\\\2\")',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// <a href=\"\">\n\t\t\t\t'/<hr[^>]*>/i'=>\"\\n-------------------------\\n\", // <hr>\n\t\t\t\t'/(<table[^>]*>|<\\/table>)/i'=>\"\\n\\n\", // <table> and </table>\n\t\t\t\t'/(<tr[^>]*>|<\\/tr>)/i'=>\"\\n\", // <tr> and </tr>\n\t\t\t\t'/<td[^>]*>(.*?)<\\/td>/i'=>\"\\t\\t\\\\1\\n\", // <td> and </td>\n\t\t\t\t'/<th[^>]*>(.*?)<\\/th>/ie'=>\"strtoupper(\\\"\\t\\t\\\\1\\n\\\")\", // <th> and </th>\n\t\t\t\t'/&(nbsp|#160);/i'=>' ', // Non-breaking space\n\t\t\t\t'/&(quot|rdquo|ldquo|#8220|#8221|#147|#148);/i'=>'\"', // Double quotes\n\t\t\t\t'/&(apos|rsquo|lsquo|#8216|#8217);/i'=>\"'\", // Single quotes\n\t\t\t\t'/>/i'=>'>', // Greater-than\n\t\t\t\t'/</i'=>'<', // Less-than\n\t\t\t\t'/&(amp|#38);/i'=>'&', // Ampersand\n\t\t\t\t'/&(copy|#169);/i'=>'(c)', // Copyright\n\t\t\t\t'/&(trade|#8482|#153);/i'=>'(tm)', // Trademark\n\t\t\t\t'/&(reg|#174);/i'=>'(R)', // Registered\n\t\t\t\t'/&(mdash|#151|#8212);/i'=>'--', // mdash\n\t\t\t\t'/&(ndash|minus|#8211|#8722);/i'=>'-', // ndash\n\t\t\t\t'/&(bull|#149|#8226);/i'=>'*', // Bullet\n\t\t\t\t'/&(pound|#163);/i'=>'£', // Pound sign\n\t\t\t\t'/&(euro|#8364);/i'=>'EUR', // Euro sign\n\t\t\t\t'/&[^&;]+;/i'=>'', // Unknown/unhandled entities\n\t\t\t\t'/[ ]{2,}/'=>' ' // Runs of spaces, post-handling\n\t\t\t);\n\t\t\tself::$_link_list = array();\n\t\t\t$html = preg_replace(array_keys($replace),array_values($replace),$html);\n\t\t\t$html = strip_tags($html);\n\t\t\tif(count(self::$_link_list))\n\t\t\t\t$html.=CRLF.CRLF.'Links:'.CRLF.'------'.CRLF.implode(CRLF,self::$_link_list);\n\t\t\treturn $html;\n\t\t}",
"public function stdWrap_stripHtml() {}",
"function _prepareArticleTextForFb($html){\n\t\t$text = strip_tags($html);\n\t\t\n\t\tif(strlen($text) > 300){\n\t\t\t$text = substr($text,0,300).'...';\t\n\t\t}\n\t\t\n\t\treturn $text;\n\t}",
"function truncate_html($text, $length = 300, $ending = '...', $exact = false, $considerHtml = true) {\n if ($considerHtml) {\n // if the plain text is shorter than the maximum length, return the whole text\n if (strlen(preg_replace('/<.*?>/', '', $text)) <= $length) {\n return $text;\n }\n // splits all html-tags to scanable lines\n preg_match_all('/(<.+?>)?([^<>]*)/s', $text, $lines, PREG_SET_ORDER);\n $total_length = strlen($ending);\n $open_tags = array();\n $truncate = '';\n foreach ($lines as $line_matchings) {\n // if there is any html-tag in this line, handle it and add it (uncounted) to the output\n if (!empty($line_matchings[1])) {\n // if it's an \"empty element\" with or without xhtml-conform closing slash\n if (preg_match('/^<(\\s*.+?\\/\\s*|\\s*(img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param)(\\s.+?)?)>$/is', $line_matchings[1])) {\n // do nothing\n // if tag is a closing tag\n } else if (preg_match('/^<\\s*\\/([^\\s]+?)\\s*>$/s', $line_matchings[1], $tag_matchings)) {\n // delete tag from $open_tags list\n $pos = array_search($tag_matchings[1], $open_tags);\n if ($pos !== false) {\n unset($open_tags[$pos]);\n }\n // if tag is an opening tag\n } else if (preg_match('/^<\\s*([^\\s>!]+).*?>$/s', $line_matchings[1], $tag_matchings)) {\n // add tag to the beginning of $open_tags list\n array_unshift($open_tags, strtolower($tag_matchings[1]));\n }\n // add html-tag to $truncate'd text\n $truncate .= $line_matchings[1];\n }\n // calculate the length of the plain text part of the line; handle entities as one character\n $content_length = strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|[0-9a-f]{1,6};/i', ' ', $line_matchings[2]));\n if ($total_length + $content_length > $length) {\n // the number of characters which are left\n $left = $length - $total_length;\n $entities_length = 0;\n // search for html entities\n if (preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|[0-9a-f]{1,6};/i', $line_matchings[2], $entities, PREG_OFFSET_CAPTURE)) {\n // calculate the real length of all entities in the legal range\n foreach ($entities[0] as $entity) {\n if ($entity[1] + 1 - $entities_length <= $left) {\n $left--;\n $entities_length += strlen($entity[0]);\n } else {\n // no more characters left\n break;\n }\n }\n }\n $truncate .= substr($line_matchings[2], 0, $left + $entities_length);\n // maximum lenght is reached, so get off the loop\n break;\n } else {\n $truncate .= $line_matchings[2];\n $total_length += $content_length;\n }\n // if the maximum length is reached, get off the loop\n if ($total_length >= $length) {\n break;\n }\n }\n } else {\n if (strlen($text) <= $length) {\n return $text;\n } else {\n $truncate = substr($text, 0, $length - strlen($ending));\n }\n }\n // if the words shouldn't be cut in the middle...\n if (!$exact) {\n // ...search the last occurance of a space...\n $spacepos = strrpos($truncate, ' ');\n if (isset($spacepos)) {\n // ...and cut the text in this position\n $truncate = substr($truncate, 0, $spacepos);\n }\n }\n // add the defined ending to the text\n $truncate .= $ending;\n if ($considerHtml) {\n // close all unclosed html-tags\n foreach ($open_tags as $tag) {\n $truncate .= '</' . $tag . '>';\n }\n }\n return $truncate;\n}",
"function util_eliminar_solo_tags($textoHTML, $etiquetas)\n{\n $textoHTML = preg_replace('#</?('. implode('|', $etiquetas) .')[^>]*>#is', '', $textoHTML);\n return trim($textoHTML);\n}",
"function postfilterHtml($html, $autolink = FALSE, $format = \"NONE\") {\n\t$cleanHtml = $html;\n\t\n\t// Display appropriately\n\tswitch ($format) {\n\t\t\n\t\tcase \"NONE\" :\n\t\t\t// Don't reformat.\n\t\t\tbreak;\n\t\t\n\t\tcase \"HTML\" :\n\t\t\t// Embedded HTML. Make it safe.\n\t\t\t$cleanHtml = safeHTML ( $cleanHtml );\n\t\t\tbreak;\n\t\t\n\t\tcase \"TEXT\" :\n\t\t\t// Make it safe.\n\t\t\t$cleanHtml = safeHTML ( $cleanHtml );\n\t\t\t\n\t\t\t// No embedded HTML, so add linebreaks\n\t\t\t$cleanHtml = nl2br ( $cleanHtml );\n\t\t\tbreak;\n\t\t\n\t\tcase \"PRE\" :\n\t\t\t// Make it safe\n\t\t\t$cleanHtml = safeHTML ( $cleanHtml );\n\t\t\t\n\t\t\t// Preformatted text, so add PRE tags\n\t\t\t$cleanHtml = '<PRE>' . $cleanHtml . '</PRE>';\n\t\t\tbreak;\n\t\t\n\t\tdefault : // AUTO\n\t\t // Make it safe\n\t\t\t$cleanHtml = safeHTML ( $cleanHtml );\n\t\t\t\n\t\t\t// Add linebreaks if no formatting is detected.\n\t\t\tif (! eregi ( \"<(P|BR).*>\", $cleanHtml )) {\n\t\t\t\t$cleanHtml = nl2br ( $cleanHtml );\n\t\t\t}\n\t}\n\t\n\tif ($autolink) {\n\t\t// Convert mailtos and https to hyperlinks.\n\t\t$cleanHtml = auto_link ( $cleanHtml );\n\t}\n\t\n\treturn $cleanHtml;\n}",
"function get_all_texts(){\n\t\t$pool = DatabasePool::instance();\n\t\t$list = $pool->query('GET_ALL_TEXTS');\n\t\tfor($line=0; $line<count($list); $line++){\n\t\t\t$text = $list[$line]['abstract'];\n\t\t\t$text = html_entity_decode($text); //dangerous - but will be corected with following lines of code\n\t\t\t$text = preg_replace('/<script\\b[^>]*>(.*?)<\\/script>/is','<b>scripts not allowed</b><br>',$text);\n\t\t\t$text = preg_replace('/<iframe\\b[^>]*>(.*?)<\\/iframe>/is','<b>iframes not allowed</b><br>',$text);\n\t\t\t$text = preg_replace('/(on.*?)=\".*?\"/','',$text);\n\t\t\t$list[$line]['abstract'] = $text;\n\t\t}\n\t\tDatabasePool::kill();\n\t\treturn $list;\n\t}",
"public function maakTekstHTML(): string\n {\n $exc = \\IDWNuts\\maak_excerpt($this->post, $this->exc_lim);\n\n // als geen afbeelding, dan lees-meer achter tekst zodat klikbaarheid duidelijker is.\n $this->tekstHTML =\n \"<p class='{$this->pakElementClass('tekst')}'>$exc\" .\n ($this->pakGeenAfbeelding()\n ? \"<span class='{$this->pakElementClass('lees-meer')}'>Meer\n </span>\"\n : '') .\n \"</p>\";\n return $this->tekstHTML;\n }",
"function _wpcom_vip_allow_more_html_in_comments() {\n\tremove_filter( 'pre_comment_content', 'wp_filter_kses' ); \n\tadd_filter( 'pre_comment_content', 'wp_filter_post_kses' );\n}",
"public function allow_html() {\n\n\t\treturn false;\n\t}",
"public function opt_in_dialog_text_allowed_html() { // phpcs:ignore Generic.CodeAnalysis.UselessOverridingMethod\n\t\treturn parent::opt_in_dialog_text_allowed_html();\n\t}",
"protected function filterMarkup($markup) {\n // Set inline html5 elements that are safe in a Juicebox gallery. Ref:\n // http://www.w3.org/html/wg/drafts/html/master/single-page.html#phrasing-content\n $valid_elements = \"<a><abbr><area><audio><b><bdi><bdo><br><button><canvas><cite><code><data><del><dfn><em><embed><i><iframe><img><input><ins><kbd><keygen><label><link><map><mark><math><meta><meter><noscript><object><output><progress><q><ruby><s><samp><script><select><small><span><strong><sub><sup><svg><template><textarea><time><u><var><video><wbr>\";\n // Add some html4 additions for legacy support.\n // Ref: http://www.htmlhelp.com/reference/html40/inline.html\n $valid_elements .= \"<acronym><basefont><big><font><rp><rt><strike><tt>\";\n $markup = strip_tags($markup, $valid_elements);\n // Also remove newlines to keep the output concise.\n $markup = str_replace(array(\"\\r\", \"\\n\"), '', $markup);\n return $markup;\n }",
"protected function shouldCleanHtml()\n {\n return false;\n }",
"function universal_autohtml(&$text) {\n global $serendipity;\n \n if (empty($text)) return $text;\n $text = trim($text);\n if (!serendipity_db_bool($serendipity['xmlrpc_htmlconvert'])) return $text;\n // if no p or br formatting is found, add it.\n if (!preg_match('@<p(.*)>@Usi', $text) && !preg_match('@</p>@Usi', $text) && !preg_match('@<br/?>@Usi', $text)) {\n $text = nl2p($text);\n $text = str_replace(\"\\n\", \"\", $text); // strip nl's in order not to have the nl2br plugin responding.\n }\n return $text;\n}",
"function LimpaTagsHTML($String) {\r\n\r\n $String = filter_var($String, FILTER_SANITIZE_STRING); //Limpa tags html da string\r\n\r\n return $String;\r\n}",
"function sanitize_specific_html_input($value)\n{\n $allwedTags=\"<p><br><a><b><u><i>\";\n\n if(!empty($value))\n {\n $value=strip_tags($value,$allwedTags);\n }\n return $value;\n}",
"private static function _filterHtml($data)\n {\n //catch the error log with html\n if (preg_match('/<body[\\s\\S]*?>([\\s\\S]*?)<\\/body>/i', $data, $match)) {\n self::$openLog = true;\n return strip_tags($match[0]);\n }\n return strip_tags($data);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the date dec. | public function setDateDec(?DateTime $dateDec): DecTva3514 {
$this->dateDec = $dateDec;
return $this;
} | [
"public function testSetDateDec() {\n\n $obj = new DecTvaGroupe();\n\n $obj->setDateDec(\"dateDec\");\n $this->assertEquals(\"dateDec\", $obj->getDateDec());\n }",
"function SetDate()\n { \n if ($this->month > 12)\n {\n $this->month=1;\n $this->year++;\n }\n\n if ($this->month < 1) \n {\n $this->month=12;\n $this->year--;\n }\n\n if ($this->year > 2037) $this->year = 2037;\n if ($this->year < 1971) $this->year = 1971;\n }",
"private function SetDate()\n\t{\t\t\n\t\tif ($this->month > 12) \n\t\t{\n\t\t\t$this->month=1;\n\t\t\t$this->year++;\n\t\t}\n\n\t\tif ($this->month < 1) \n\t\t{\n\t\t\t$this->month=12;\n\t\t\t$this->year--;\n\t\t}\n\n\t\tif ($this->year > 2037) $this->year = 2037;\n\t\tif ($this->year < 1971) $this->year = 1971;\n\t}",
"public function getDateDec() {\n return $this->dateDec;\n }",
"public function Dec ( )\n {\n $this->m_timestamp -= 60*60*24;\n $this->ts2mdy( );\n\n }",
"protected function _setPaymentDate()\n {\n \t$endOfMonth = date(\n 'd', mktime(0, 0, 0, $this->_month+1, 1, $this->_year) - 1\n );\n \tswitch ($this->_config['paydate']) {\n \t\tcase 'start':\n \t\t\t$this->_date = 1;\n \t\t\treturn;\n \t\tcase 'end':\n \t\t\t$this->_date = date(\n \t\t\t 'd', mktime(0, 0, 0, $this->_month+1, 1, $this->_year) - 1\n \t\t\t);\n \t\t\treturn;\n \t\tdefault:\n \t\t\t$this->_date = $this->_config['paydate'];\n \t\t\tif ($this->_config['paydate'] > $endOfMonth) {\n \t\t\t\t$this->_date = $endOfMonth;\n \t\t\t}\n \t\t\treturn;\n \t}\n }",
"public function set_dateDebut($_dateDebut)\n {\n $this->_dateDebut = $_dateDebut;\n\n return $this;\n }",
"public static function setDateFormatDay()\n {\n self::$settings[0] = 'Y-m-d';\n }",
"public function setDate($identifier, \\blaze\\util\\Date $value);",
"public function setDate( $date );",
"public function setDelRiskDate ($v)\n {\n if ( $v !== null && !is_int ($v) )\n {\n $ts = strtotime ($v);\n //Date/time accepts null values\n if ( $v == '' )\n {\n $ts = null;\n }\n if ( $ts === -1 || $ts === false )\n {\n throw new PropelException (\"Unable to parse date/time value for [del_risk_date] from input: \" .\n var_export ($v, true));\n }\n }\n else\n {\n $ts = $v;\n }\n if ( $this->del_risk_date !== $ts )\n {\n $this->del_risk_date = date (\"Y-m-d H:i:s\", $ts);\n }\n }",
"public function setFechaDesactivadoHoy()\n {\n $today = date('Y-m-d');\n $this->dFechaDesactivado = $today;\n }",
"function setDay($d)\n {\n if ($d > 31 || $d < 1) {\n $this->day = 1;\n } else {\n $this->day = $d;\n }\n }",
"public function getDateDec(): ?DateTime {\n return $this->dateDec;\n }",
"public function testSetDateDebut() {\n\n // Set a Date/time mock.\n $dateDebut = new DateTime(\"2018-09-10\");\n\n $obj = new LignesBulletinCompl();\n\n $obj->setDateDebut($dateDebut);\n $this->assertSame($dateDebut, $obj->getDateDebut());\n }",
"public function change_date()\n\t{\n\t\t$this->current_day =\t\tintval(Http::request('day'));\n\t\t$this->current_month =\tintval(Http::request('month'));\n\t\t$this->current_year =\tintval(Http::request('year'));\n\t\t$this->current = mktime(0, 0, 0, $this->current_month, ($this->current_day) ? $this->current_day : 1, $this->current_year);\n\t}",
"public function setDate($date);",
"function setEnrollment_date()\n {\n $this->enrollment_date = $enrollment_date;\n\n }",
"public function testSetDateDevis() {\n\n // Set a Date/time mock.\n $dateDevis = new DateTime(\"2018-09-10\");\n\n $obj = new DevisEntetes();\n\n $obj->setDateDevis($dateDevis);\n $this->assertSame($dateDevis, $obj->getDateDevis());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate a JavaScript representation of the root context | protected function getRootContext()
{
return $this->encode($this->config['rootContext']);
} | [
"function get_context_js() {\n session_start(); // For accessign auth info\n return \"\nvar x = x || {};\nx.context = x.context || {};\nx.context.baseuri = '\".xContext::$baseuri.\"';\nx.context.profile = '\".xContext::$profile.\"';\nx.context.config = x.context.config || {};\nx.context.config.error = x.context.config.error || {};\nx.context.config.error.reporting = '\".xContext::$config->error->reporting.\"';\nx.context.config.log = x.context.config.log || {};\nx.context.config.log.level = '\".xContext::$config->log->level.\"';\nx.context.auth = x.context.auth || {};\nx.context.auth.username = '\".xContext::$auth->username().\"';\n\";\n }",
"public function dump() {\n\n\t\t// reserve some attributes that wo don't want as js vars\n\t\t$reserved = array(\n\t\t\t'namespace'\n\t\t);\n\n\t\t// define \"magic\" keys which hold internal values\n\t\t$specials = array(\n\t\t\t'theme_path' => $this->template->get_theme_path(),\n\t\t\t'theme_url' => site_url($this->template->get_theme_path()),\n\t\t);\n\n\t\t// define our formats\n\t\t$html = array(\n\t\t\t'wrap' => \"<script>%s</script>\",\n\t\t\t'keyValuePair' => 'var %s = \\'%s\\';',\n\t\t\t'namespacedkeyValuePair' => '%s: \\'%s\\'',\n\t\t\t'namespace' => 'var %s = {%s}',\n\t\t);\n\n\t\t$attributes = $this->attributes();\n\n\t\tforeach (Events::trigger('jvars_dump', $attributes, 'array') as $event_data) {\n\t\t\t$attributes = array_merge($attributes, $event_data );\n\t\t}\n\n\t\t$vars = array();\n\n\t\tforeach (array_merge($attributes, $specials) as $name => $value) {\n\t\t\t// skip the reserved vars\n\t\t\tif(in_array($name, $reserved)) continue;\n\n\t\t\t$name = $this->_snakeToCamel($name);\n\n\t\t\tif($this->attribute('namespace')) {\n\t\t\t\t// if we want to namespace, use the namespaced format\n\t\t\t\t$vars[] = sprintf($html['namespacedkeyValuePair'], $name, $value);\n\t\t\t} else {\n\t\t\t\t// otherwise, just generate plain old key value pair vars\n\t\t\t\t$vars[] = sprintf($html['keyValuePair'], $name, $value);\n\t\t\t}\n\n\t\t}\n\n\t\tif(count($vars) === 0) return;\n\n\t\tif($this->attribute('namespace')) {\n\t\t\t// return the namespaced object\n\t\t\treturn sprintf(\n\t\t\t\t\t\t$html['wrap'],\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t$html['namespace'],\n\t\t\t\t\t\t\t$this->attribute('namespace'),\n\t\t\t\t\t\t\timplode(\",\\n\", $vars)\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t} else {\n\t\t\t// or just return concatenated vars\n\t\t\treturn sprintf(\n\t\t\t\t\t\t$html['wrap'],\n\t\t\t\t\t\timplode('', $vars)\n\t\t\t\t\t);\n\t\t}\n\n\t}",
"protected function getProductViewContext() : string\n {\n $context = [\n 'id' => Request::getInstance()->product_id\n ];\n\n return json_encode($context);\n }",
"public function javascript()\n {\n $varname = config('nitro.options.javascript_varname', 'options');\n $options = [];\n foreach($this->public() as $key => $option)\n {\n $options[$key] = $option['value'];\n }\n unset($key);\n $json = \\json_encode($options);\n return \"<script type=\\\"text/javascript\\\">var {$varname} = {$json}</script>\";\n }",
"public function context(int $options = JSON_PRETTY_PRINT): string\n {\n return json_encode($this->context, $options);\n }",
"public function toJson()\n {\n return $this->context->getRootStep()->toJson();\n }",
"public function generateJsonTree()\n\t{\n\t\t$this->_jsontree = array();\n\t\t$this->_jsontree[\"requestFirstIndex\"] = 0;\n\t\t$this->_jsontree[\"firstIndex\"] = 0;\n\t\t$this->_jsontree[\"count\"] = $this->_elementCount;\n\t\t$this->_jsontree[\"totalCount\"] = $this->_elementCount;\n\t\t$this->_jsontree[\"columns\"] = $this->_columns;\n\t\t$this->_jsontree[\"items\"] = $this->generateJsonTreeGetChildren();\n\t\treturn json_encode($this->_jsontree);\n\t}",
"private function serializeWithRoot()\n {\n return json_encode([$this->root() => $this->buildAttributesArray()]);\n }",
"public function generateJSON()\n {\n $result = $this->getNodesArray();\n\n $result = array('root'=>array('expanded'=>true, 'children'=>$result));\n\n return json_encode($result);\n }",
"protected function render(){\n $this->preprocesses();\n print $this->load_template($this->query, $this->tpl_vars);\n print $this->js_context();\n }",
"public function root();",
"public function get_template_root() {}",
"public function localRoot();",
"function template_dynamic_js() {\n $vars = array();\n $vars['HOST'] = HOST;\n $vars['SITE_ROOT'] = SITE_ROOT;\n $vars['PATH_TO_MODULES'] = PATH_TO_MODULES;\n $vars['BASE_PATH'] = '//' . HOST . '' . SITE_ROOT;\n\n $js_vars = json_encode($vars);\n\n //$user = new User();\n\n $return = 'var SYSTEM' . \"\\n\";\n $return .= 'SYSTEM = eval(' . $js_vars . ')' . \"\\n\";\n return $return;\n}",
"public final function renderJs()\n {\n // render a javascript header\n $js = $this->getJsHeader();\n\n // render the data table\n $js .= $this->getJsDataTable();\n\n // Instantiate our object.\n $js .= $this->getJsObjectInstantiation($this->getId());\n\n // draw the treemap\n $js .= $this->objectVariableName.\".draw(\" . $this->dataTableName . \",\\n\";\n\n $js .= \"\\t\" . json_encode($this->getMergedOptions()) . \"\\n\";\n\n $js .= \");\\n\";\n\n // render a javascript footer\n $js .= $this->getJsFooter();\n\n echo $js;\n }",
"private function getNamespacesScript(): string\n {\n $sCode = '';\n $aJsClasses = [];\n $aNamespaces = $this->xRepository->getNamespaces();\n foreach($aNamespaces as $sNamespace)\n {\n $offset = 0;\n $sJsNamespace = str_replace('\\\\', '.', $sNamespace);\n $sJsNamespace .= '.Null'; // This is a sentinel. The last token is not processed in the while loop.\n while(($dotPosition = strpos($sJsNamespace, '.', $offset)) !== false)\n {\n $sJsClass = substr($sJsNamespace, 0, $dotPosition);\n // Generate code for this object\n if(!isset($aJsClasses[$sJsClass]))\n {\n $sCode .= $this->sPrefix . \"$sJsClass = {};\\n\";\n $aJsClasses[$sJsClass] = $sJsClass;\n }\n $offset = $dotPosition + 1;\n }\n }\n return $sCode;\n }",
"public function render() {\n\t\t\n\t\tif(!$this->line_number)\n\t\t\t$this->parse();\n\t\t\n\t\t$result = $this->root->render();\n\t\t\n\t\tob_start();\n\t\t\n\t\tStringStream::add_string('result', $result);\n\t\textract($this->variables);\n\t\t$__options = $this->options;\n\t\t$__render_attributes = function($attributes) use ($__options) {\n\t\t nodes\\Tag::render_attributes_html($__options['format'], $__options['attr_wrapper'], $attributes);\n\t\t};\n\t\tinclude 'StringStream://result';\n\t\tStringStream::clear('result');\n\t\t\n\t\treturn rtrim(ob_get_clean());\n\t\t\n\t}",
"static function dump() {\n return print_r(get_class_vars(\"xContext\"), true);\n }",
"abstract protected function buildRoot();",
"public function generateSite()\n {\n\n $template = new TemplateImpl($this->backendContainer);\n $pageStrategy = $this->backendContainer->getCurrentPageStrategyInstance();\n\n\n $cacheControl = $this->backendContainer->getCacheControlInstance();\n if ($this->config->isDebugMode()) {\n $cacheControl->disableCache();\n $template->setTwigDebug(true);\n }\n\n\n $currentPage = $pageStrategy->getCurrentPage();\n $template->setTemplateFromConfig($currentPage->getTemplate(), \"_main\");\n\n $ajaxServer = $this->backendContainer->getAJAXServerInstance();\n $id = null;\n if (($id = $this->GETValueOfIndexIfSetElseDefault('ajax')) !== null) {\n $template->onlyInitialize();\n $ajaxServer->registerHandlersFromConfig();\n }\n\n //Decide output mode\n if ($id !== null) {\n echo json_encode($ajaxServer->handleFromFunctionString($id, $this->GETValueOfIndexIfSetElseDefault('token')), $this->config->isDebugMode()?JSON_PRETTY_PRINT:0);\n\n } else if (!$cacheControl->setUpCache()) {\n echo $template->render();\n }\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the ID of the opening balance | public function id() : OpeningBalanceId
{
return $this->id;
} | [
"public function getOpeningBalance();",
"public function getWithdrawalId();",
"public function get_open_state_id(){\n $OPEN_STATE_NAME = \"open\";\n $this->db->select(\"bidScheduleStateID\");\n $this->db->from(\"bid_schedule_state\");\n $this->db->where(\"name\",$OPEN_STATE_NAME);\n $query = $this->db->get();\n \n $id = $query->result()[0]->bidScheduleStateID;\n \n return $id;\n }",
"protected function getOpeningBalanceAccount()\n {\n return Equity::firstOrCreate([\n 'user_id' => $this->attributes['user_id'],\n 'name' => 'Opening Balances',\n ]);\n }",
"public function getOpenId() {\n return $this->_openId;\n }",
"function getOpenID() {\r\n return $this->query['open_id'];\r\n }",
"public function getIdbalanceHidrico(){\n return $this->idbalanceHidrico;\n }",
"public function getId()\n {\n return $this->getChargebackId();\n }",
"private function getMainId() {\n $lq = new ListQuery('Contract');\n $lq->addSimpleFilter('account_id', $this->account_id);\n $result = $lq->runQuery(0, 1);\n $id = null;\n\n if ($result->getResultCount()) {\n $idx = $result->getRowIndexes();\n $row = $result->getRowResult($idx[0]);\n $id = $row->getField('id');\n } else {\n $main = $this->createMain();\n $id = $main->getPrimaryKeyValue();\n }\n\n return $id;\n }",
"public function withdraw_interest()\n {\n $withdraw = Interest::where('user_id', auth()->id())->where('project_id', $this->id)->first();\n\n return $withdraw->id;\n\n }",
"public function getPledge_id()\n {\n if( !is_null($this->nPledge_id) )\n {\n if( $this->nPledge_id==='' )\n {\n return NULL;\n }\n else\n {\n return $this->nPledge_id;\n }\n }\n else\n {\n $this->hydrateFromBDD(array('pledge_id'));\n $this->callHydrateFromBDDOnGet++;\n if($this->callHydrateFromBDDOnGet>10)\n {\n echo \"<br />WARNING : trop d'appel en base depuis l'accesseur \". __CLASS__ .\"::\". __FUNCTION__ .\"\";\n }\n return $this->nPledge_id;\n }\n }",
"public function getOpenLibraryID(){\n\t\tReturn $this->ol[\"ISBN:\".$this->isbn][\"identifiers\"][\"openlibrary\"][0];\n\t}",
"public function getIncomeAccId()\n {\n\n return $this->income_acc_id;\n }",
"public function getFundId()\n {\n return $this->plg_fundid;\n }",
"public function getUniqueOpen()\n\t\t{\n\t\t\treturn $this->unique_open;\n\t\t}",
"public function opening_coa_balance($coa_id, $coa_name)\n {\n $query = DB::table('transactions as t')\n ->selectRaw('sum(t.debit) as predebit, sum(t.credit) as precredit')\n ->where([['approve',1],['is_opening',1],['chart_of_account_id',$coa_id]]);\n\n $query = $query->first();\n $ass_bal = $query->predebit - $query->precredit;\n $balance = $ass_bal;\n if ($coa_name == 'Customer Receivable') {\n $balance = $this->customer_rec_opening();\n }\n if ($coa_name == 'Loan Receivable') {\n $balance = $this->loan_rec_opening();\n }\n if ($coa_name == 'Account Receivable') {\n $root_balance = $this->account_rec_opening();\n $customer_balance = $this->customer_rec_opening();\n $loan_balance = $this->loan_rec_opening();\n $balance = $root_balance + $customer_balance + $loan_balance;\n }\n if ($coa_name == 'Cash At Bank') {\n $balance = $this->bank_opening();\n }\n if ($coa_name == 'Cash At Mobile Bank') {\n $balance = $this->mobile_bank_opening();\n }\n if ($coa_name == 'Cash & Cash Equivalent') {\n $balance = $this->cash_equivalent_opening();\n }\n if ($coa_name == 'Current Asset') {\n $cash_equivalent_balance = $this->cash_equivalent_opening();\n $root_balance = $this->account_rec_opening();\n $customer_balance = $this->customer_rec_opening();\n $loan_balance = $this->loan_rec_opening();\n $balance = $root_balance + $customer_balance + $loan_balance + $cash_equivalent_balance;\n }\n\n if ($coa_name == 'Non Current Assets') {\n $balance = $this->non_current_ass_opening();\n }\n if ($coa_name == 'Assets') {\n $non_curopen = $this->non_current_ass_opening();\n $cash_equivalent_balance = $this->cash_equivalent_opening();\n $root_balance = $this->account_rec_opening();\n $customer_balance = $this->customer_rec_opening();\n $loan_balance = $this->loan_rec_opening();\n $balance = $root_balance + $customer_balance + $loan_balance + $cash_equivalent_balance + $non_curopen;\n }\n\n if ($coa_name == 'Equity') {\n $balance = $this->equity_opening();\n }\n\n if ($coa_name == 'Expense') {\n $balance = $this->expense_opening();\n }\n\n if ($coa_name == 'Income') {\n $balance = $this->income_opening();\n }\n if ($coa_name == 'Account Payable') {\n $balance = $this->acc_payable_opening();\n }\n\n if ($coa_name == 'Employee Ledger') {\n $balance = $this->acc_employeeledger_opening();\n }\n\n if ($coa_name == 'Current Liabilities') {\n $cur_balance = $this->acc_curliabilities_opening();\n $paya_balance = $this->acc_payable_opening();\n $employe_balance = $this->acc_employeeledger_opening();\n $balance = $cur_balance + $paya_balance + $employe_balance;\n }\n\n if ($coa_name == 'Non Current Liabilities') {\n $balance = $this->acc_non_curliabilities_opening();\n }\n\n if ($coa_name == 'Liabilities') {\n $non_balance = $this->acc_non_curliabilities_opening();\n $cur_balance = $this->acc_curliabilities_opening();\n $paya_balance = $this->acc_payable_opening();\n $employe_balance = $this->acc_employeeledger_opening();\n $balance = $cur_balance + $paya_balance + $employe_balance + $non_balance;\n }\n\n return (!empty($balance) ? number_format($balance, 2) : number_format(0, 2));\n }",
"public function getOpenInterest()\n {\n return (int) $this->info[11];\n }",
"public function getContractId() {\n $result = \"HDCD\";\n if (strlen((string)$this->id) < 5)\n for ($i = 0; $i < 5 - strlen((string)$this->id); $i++)\n $result .= '0';\n return $result .= $this->id;\n }",
"public function getId() {\r\n\t\treturn($this->_currency_id);\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Common Function strip string | function stripString($string) {
return stripslashes($string);
} | [
"function stripper($str)\n{\n\t$CI =& get_instance();\n\n\t$filename = end($CI->uri->segments);\n\t\n\t// If we're dealing with a text file we'll strip out\n\t// all the pseudo-tags and what not\n\tif (FALSE !== (strpos($filename, '.txt')))\n\t{\n\t\t// Remove dashes\n\t\t$CI->output->final_output = preg_replace('#^[-]{4,}$#m', '', $CI->output->final_output);\n\n\t\t// Remove horline markers\n\t\t$CI->output->final_output = preg_replace('#^[_]{4,}$#m', '', $CI->output->final_output);\n\t\t\n\t\t// Remove the divs\n\t\t$CI->output->final_output = preg_replace('#^(div:[0-9a-z]+)$#m', '', $CI->output->final_output);\n\n\t\t// Reduce line breaks. If there are more than two consecutive linebreaks\n\t\t// we'll compress them down to a maximum of two since there's no benefit to more.\n\t\t$CI->output->final_output = preg_replace(\"/\\n\\n+/\", \"\\n\\n\", $CI->output->final_output);\n\t\t\n\t\t$CI->output->final_output = trim($CI->output->final_output);\n\t}\n\n}",
"function strip ( $haystack, $needle ) {\r\n\t\t$haystack = lstrip($haystack, $needle);\r\n\t\t$haystack = rstrip($haystack, $needle);\r\n\t\treturn $haystack;\r\n\t}",
"function sanitiseStrip($str, $connection)\n{\n\t$str = preg_replace(\"/[^a-zA-Z0-9!?#@.,\\s]/\", \"\", $str);\n\t$str = sanitise($str, $connection);\n\t// return the cleaned string:\n\treturn $str;\n}",
"function tidy_repair_string () {}",
"function str_strip(string $string, string $needle): array|string|null\n{\n if (!str__contains($string, $needle)) return $string;\n return preg_replace('/' . $needle .'+/', \"\", $string);\n}",
"function remove2($s){\n\twhile(substr($s, -1) == '!'){\n\t\t$s = substr_replace($s, '', -1);\n\t}\n\treturn $s;\n}",
"function remove1(string $s): string{\n\tif(substr($s, -1) == '!'){\n\t\t$s = substr_replace($s, '', -1);\n\t\treturn $s;\n\t\t}\n\treturn $s;\n\t}",
"function trimAnyWhere($string) {\r\n\t$string = str_replace ( array (\" \", \"\\t\", \"\\n\", \"\\r\", \"\\0\", \"\\x0B\" ), \"\", $string );\r\n\treturn $string;\r\n}",
"function cleanStr($str) {\n\t\t$str = str_replace($this->deviceUAFilterList, '', strtolower($str));\n\t\t$str = preg_replace('/[^(\\x20-\\x7F)]*/','', $str);\n\t\treturn trim($str);\n\t}",
"function stringStripTags ($string) {\n $string = preg_replace(\"/<del[^>]*>.+<\\/del[^>]*>/isU\", '', $string);\n $string = preg_replace(\"/<script[^>]*>.+<\\/script[^>]*>/isU\", '', $string);\n $string = preg_replace(\"/<style[^>]*>.+<\\/style[^>]*>/isU\", '', $string);\n $string = str_replace('>', '> ', $string);\n $string = str_replace('<', ' <', $string);\n $string = strip_tags($string);\n $string = preg_replace(\"/\\s+/\", \" \", $string);\n $string = trim($string);\n return $string;\n}",
"function str_remove($remove, $haystack) { \n \treturn str_replace($remove, \"\", $haystack); \n\t}",
"function _stripPartFromString(&$evalString) {\r\n\t\t$pos = strpos($evalString, \"\\t\");\r\n\t\tif(is_integer($pos)) {\r\n\t\t\t$result = substr($evalString, 0, $pos);\r\n\t\t\t$evalString = substr($evalString, $pos + 1);\r\n\t\t} else {\r\n\t\t\t$result = $evalString;\r\n\t\t\t$evalString = \"\";\r\n\t\t}\r\n\t\treturn $result;\r\n\t}",
"function remove($s){\r\n $s = explode(\" \", $s);\r\n for ($i=0; $i<count($s); $i++){\r\n while ($s[$i][strlen($s[$i])-1] == \"!\"){\r\n $s[$i] = substr($s[$i],0,-1);\r\n }\r\n }\r\n return implode(\" \", $s);\r\n }",
"function remove_slash ($str)\n {\n $res = ltrim($str, '/'); \n return $res;\n }",
"public function afterStrip($content);",
"function intrim($string)\n {\n return eregi_replace(' ', '', $string);\n }",
"protected function strip($str)\n {\n // Strip parentheses\n if (substr($str, 0, 1) == '(') {\n $str = substr($str, 1);\n }\n if (substr($str, -1) == ')') {\n $str = substr($str, 0, -1);\n }\n // Strip curly brackets\n if (substr($str, 0, 1) == '{') {\n $str = substr($str, 1);\n }\n if (substr($str, -1) == '}') {\n $str = substr($str, 0, -1);\n }\n // Strip leading slash\n if (substr($str, 0, 1) == '/') {\n $str = substr($str, 1);\n }\n\n return $str;\n }",
"function str_remove($needle, $haystack) {\n return str_replace($needle, '', $haystack);\n}",
"function trimAndSanitize($str){\n\t\t$str = trim($str);\n\t\t$str = str_replace(\"'\", \"\", $str );\n\t\t$str = str_replace(\";\", \"\", $str);\n\t\t$str = str_replace(\"|\", \"\", $str);\n\t\treturn $str;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds the AwpbActivityLine 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 = AwpbActivityLine::findOne($id)) !== null) {
return $model;
}
throw new NotFoundHttpException('The requested page does not exist.');
} | [
"protected function findModel($id)\n {\n if (($model = LineHistory::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('La página solicitada no existe.');\n }",
"protected function findModel($id)\n {\n if (($model = BlogLines::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"protected function findModel($id)\r\n {\r\n if (($model = Timeline::findOne($id)) !== null) {\r\n return $model;\r\n } else {\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }\r\n }",
"protected function findModel($id)\n {\n if (($model = SalesActivity::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 \tif (($model = ActivitySide::findOne($id)) !== null) {\n \t\treturn $model;\n \t}\n\n \tthrow new NotFoundHttpException('The requested page does not exist.');\n }",
"public function get($lineId);",
"protected function findModel($id) {\n if (($model = Cronograma::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function loadModel($pk) {\n\t\t$model = parent::loadModel($pk);\n\t\t$activeContexts = $this->getActiveContexts();\n\t\tforeach ($activeContexts as $activeContext) {\n\t\t\t$foreignKeyName = $activeContext['foreignKeyName'];\n\t\t\tif ($model->$foreignKeyName != $activeContext['model']->getPrimaryKey()) {\n\t\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t\t}\n\t\t}\n\n\t\treturn $model;\n\t}",
"protected function findModel($id)\n {\n if (($model = ReportSubscriberActivity::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 = ActivityLog::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function actionGetLineDetail() {\n $id = $this->getParam('id', 0);\n if ($id == 0) {\n $this->_data['error_code'] = self::STATUS_PARAMS_ERROR;\n } else {\n $service = new LineService();\n $line = $service->getDataByPk($id);\n if ($line) {\n $this->_data['data'] = $line;\n } else {\n $this->_data['error_code'] = self::STATUS_RES_EMPTY;\n }\n }\n\n $this->echoJson();\n }",
"protected function findModel($id)\n\t{\n\t\t\tif (($model = SpamLaunches::findOne($id)) !== null) {\n\t\t\t\t\treturn $model;\n\t\t\t} else {\n\t\t\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t\t\t}\n\t}",
"public function loadModel()\n\t{\n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']) && isset($_GET['code']))\n\t\t\t\t$this->_model=TblRequest::model()->findbyPk(array('code'=>$_GET['code'],'service'=>$_GET['id']));\n\t\t\tif($this->_model===null)\n\t\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\t\treturn $this->_model;\n\t}",
"protected function findModel($id)\n {\n if (($model = LineCategory::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 if (($model = Activity::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 = Trailer::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{\nif (($model = IcsrVersionResponse::findOne($id)) !== null) {\nreturn $model;\n} else {\nthrow new HttpException(404, 'The requested page does not exist.');\n}\n}",
"protected function findModel($id)\n {\n if (($model = OfflineActivity::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 = GoodsActivity::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 = Activitylist::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find the static assets directory for the Template via namespace. | public static function findStaticAssetsFor($namespace)
{
$rclass = new ReflectionClass($namespace);
return dirname($rclass->getFileName()) . '/static';
} | [
"protected function get_template_directories() {\n\t\treturn array('static/');\n\t}",
"function themosis_theme_assets()\n {\n if (is_multisite() && SUBDOMAIN_INSTALL)\n {\n $segments = explode('themes', get_template_directory_uri());\n $theme = (strpos($segments[1], DS) !== false) ? substr($segments[1], 1) : $segments[1];\n return get_site_url().'/'.CONTENT_DIR.'/themes/'.$theme.'/resources/assets';\n }\n\n return get_template_directory_uri().'/resources/assets';\n }",
"public static function get_asset_dir() {\n\n\t\tglobal $_llms_tests_bootstrap;\n\t\treturn $_llms_tests_bootstrap->assets_dir;\n\n\t}",
"function assets_dir() {\n $dir = (defined('THEME_ASSETS') ? THEME_ASSETS : 'assets');\n return '/'. $dir;\n}",
"private function getModuleAssetsDir()\n {\n $path = $this->controller->getConfig(\"views.moduleAssetsDir\");\n switch (true) {\n // Assets in current Module\n case preg_match(\"/^(_[\\w]+)/\", $path):\n $moduleNamespace = $this->controller->getModuleNamespace();\n $path = \"{$moduleNamespace}/Views/{$path}\";\n break;\n // Assets anywhere with current page. ie: /ModuleName/Views/_assets\n case preg_match(\"/^\\/\\/?/\", $path):\n $path = preg_replace(\"/^\\/\\/?/\", \"\", $path);\n break;\n // Usually if a URL is provided, and the content will delivered from a different place\n default:\n return $path;\n break;\n }\n $url = preg_replace(\"/\\/$/\",\"\",$this->controller->getSiteUrl());\n $path = str_replace([\"\\\\\"],[\"/\"], $path);\n return \"{$url}/{$path}\";\n }",
"function get_assets_path() {\n\treturn PATH . 'assets/';\n}",
"public function getAssetsPath() {\n return dirname(__FILE__) . '/assets';\n }",
"public function getAssetsPath()\r\n {\r\n return dirname(__FILE__) . '/assets';\r\n }",
"public static function getTwigPaths()\n {\n /** @var UniformResourceLocator $locator */\n $locator = static::gantry()['locator'];\n\n return $locator->mergeResources(['gantry-theme://templates', 'gantry-engine://templates']);\n }",
"public static function getAssetDirectory(): string\n {\n return PathUtils::combineAllPaths(self::getSourceDirectory(), \"assets\");\n }",
"protected function GetWebPath_forStaticFiles() {\n\treturn $this->GetWebPath_forAppBase().'static/';\n }",
"public static function findTemplatesFor($namespace)\n\t{\n\t\t$rclass = new ReflectionClass($namespace);\n\n\t\treturn dirname($rclass->getFileName()) . '/template';\n\t}",
"function themosis_theme_assets()\n {\n if (is_multisite() && SUBDOMAIN_INSTALL) {\n $segments = explode('themes', get_template_directory_uri());\n $theme = (strpos($segments[1], DS) !== false) ? substr($segments[1], 1) : $segments[1];\n\n return get_home_url().'/'.CONTENT_DIR.'/themes/'.$theme;\n }\n\n return get_template_directory_uri();\n }",
"public function getAssetsFolder(): void\n {\n self::assertEquals(\n 'EXT:t3v_core/Resources/Public/Assets',\n ExtensionUtility::getAssetsFolder('t3v_core')\n );\n\n self::assertEquals(\n 'FILE:EXT:t3v_core/Resources/Public/Assets',\n ExtensionUtility::getAssetsFolder('t3v_core', 'FILE:EXT:')\n );\n }",
"static function assets(){\n return '/resources?file=';\n }",
"function ib3_admin_get_staticpath($addprefix = FALSE, $theme_key = 'ib3_admin') {\n $ret = '';\n if ($addprefix) {\n $ret = '/';\n }\n $ret .= drupal_get_path('theme', $theme_key) . '/static/';\n return $ret;\n}",
"protected static function getStaticTemplatesInBaseConfigurationPath() {\n\t\t$relativeConfigurationPath = self::getBaseConfigurationPath();\n\t\treturn self::getStaticTemplatesInPath(self::PATH_TYPE_BASE, $relativeConfigurationPath);\n\t}",
"protected function resolveAssetPath()\n {\n $basename = md5(serialize(array_map(function ($path) {\n return [$path, filemtime($path)];\n }, $this->paths)));\n\n return Configure::read(ASSETS . '.target') . DS . $basename . '.' . $this->type;\n }",
"function getTemplateDirs();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Terminate a chunked transfer. | public function end()
{
$headers = $this->headers();
if ($headers['Transfer-Encoding']->value() !== 'chunked') {
return;
}
echo "0\r\n\r\n";
} | [
"public function end() {\n if (!$this->flushed) {\n if (!isset($this->headers['Content-Length']) && !isset($this->headers['Transfer-Encoding'])) {\n $this->headers['Content-Length']= [0];\n }\n\n $this->begin($this->output);\n }\n $this->output->close();\n }",
"public function close()\n {\n\t\theader(isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0', ' ' . $this->_httpStatus . ' ' . $this->_status_codes[$this->_httpStatus], true);\n\n\t\tif ( $this->_encoding == 'gzip' ) {\n\t\t\t$this->_body = gzdecode($this->_body);\n\t\t}\n\t\tif ($this->_chunked) {\n\t\t\tif ( $this->_filterResponseBodyCallback !== null ) {\n\t\t\t\techo call_user_func( $this->_filterResponseBodyCallback, $this->_translatedUri, $this->_body );\n\t\t\t} else {\n\t\t\t\techo $this->_body;\n\t\t\t}\n\t\t}else{\n\t\t\techo $this->_body;\n\t\t}\n\n curl_close($this->_curlHandle);\n }",
"public function _stop() {\r\n $this->response->send();\r\n $output = ob_get_clean();\r\n exit($output);\r\n }",
"public function close()\n {\n curl_reset($this->handle);\n }",
"public function finish() {\n\t\t\n\t\tcurl_close($this->curl);\n\t\t\n\t\tif($this->extraDestinationsGiven){\n\t\t\t$this->longDestination->finish();\n\t\t\t$this->shortDestination->finish();\n\t\t}\n\t}",
"public function end()\n {\n if ( ! $this->get('etag') )\n $this->set('etag', md5($this->output)); \n \n if ( ! $this->headers_sent )\n {\n foreach ( $this->headers as $k => &$v )\n header(sprintf('%s: %s', $k, $v), true);\n header('X-HTTP-HORUS-STATUS: ' . $this->status, false, $this->status());\n $this->headers_sent = true;\n }\n\n if ( strtolower($_SERVER['REQUEST_METHOD']) !== 'head' ) \n echo $this->sys->hooks->apply('horus.res.output', $this->output, $this->output);\n\n ob_end_flush();\n\n exit;\n }",
"public function shutdown()\n {\n if( ! empty( $this->ch ) )\n {\n curl_close( $this->ch );\n }\n }",
"public function onFinish()\n {\n if ($this->eofTerminated) {\n $this->requestFinished();\n $this->onResponse->executeAll($this, false);\n parent::onFinish();\n return;\n }\n if ($this->protocolError) {\n $this->onResponse->executeAll($this, false);\n } else {\n if (($this->state !== self::STATE_ROOT) && !$this->onResponse->isEmpty()) {\n $this->requestFinished();\n }\n }\n parent::onFinish();\n }",
"public function shutdown(): void\n {\n if (! empty($this->ch)) {\n curl_close($this->ch);\n $this->ch = false;\n }\n }",
"public function sendAndClose()\n {\n // Make sure nothing has been output yet\n if (headers_sent()) {\n return;\n }\n\n // Get the active user before headers are sent\n Craft::$app->getUser()->getIdentity();\n\n // Prevent the script from ending when the browser closes the connection\n ignore_user_abort(true);\n\n // Prepend any current OB content\n while (ob_get_length() !== false) {\n // If ob_start() didn't have the PHP_OUTPUT_HANDLER_CLEANABLE flag, ob_get_clean() will cause a PHP notice\n // and return false.\n $obContent = @ob_get_clean();\n\n if ($obContent !== false) {\n $this->content = $obContent . $this->content;\n } else {\n break;\n }\n }\n\n // Tell the browser to close the connection\n $length = $this->content !== null ? strlen($this->content) : 0;\n $this->getHeaders()\n ->set('Connection', 'close')\n ->set('Content-Length', $length);\n\n $this->send();\n\n // Close the session.\n Craft::$app->getSession()->close();\n\n // In case we're running on php-fpm (https://secure.php.net/manual/en/book.fpm.php)\n if (function_exists('fastcgi_finish_request')) {\n fastcgi_finish_request();\n }\n }",
"public static function _stop() {\n self::response()\n ->write(ob_get_clean())\n ->send();\n }",
"public function terminateAsync(): void;",
"function close(){\r\n\t \t$this->disconnect();\r\n\t\tstream_socket_shutdown($this->socket, STREAM_SHUT_WR);\r\n\t}",
"public function close()\n {\n curl_reset(self::$ch);\n }",
"public function end()\n {\n $this->stream->seek($this->stream->count() - 1);\n }",
"function close(){\n\t \t$this->disconnect();\n\t\tstream_socket_shutdown($this->socket, STREAM_SHUT_WR);\n\t}",
"public function close(): void\n {\n $this->remoteStream->close();\n $this->stream->close();\n }",
"function close() {\n \n $response = \"\";\n $cmd = \"QUIT\";\n if (! $this->_logging ( $cmd ))\n return FALSE;\n if (! $this->_putline ( $cmd ))\n return FALSE;\n \n if ($this->state == \"AUTHORIZATION\") {\n $this->state = \"DISCONNECTED\";\n } elseif ($this->state == \"TRANSACTION\") {\n $this->state = \"UPDATE\";\n }\n \n $response = $this->_getnextstring ();\n \n if (! $this->_logging ( $response ))\n return FALSE;\n if (substr ( $response, 0, 1 ) != \"+\") {\n $this->error = \"POP3 close() - Error: \" . $response;\n return FALSE;\n }\n $this->socket = FALSE;\n \n $this->_cleanup ();\n \n return TRUE;\n }",
"public function sendAbort()\n {\n\n return $this->netConf()->sendRPC('<abort/>');\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the event's additional details Will favor the 'more' field and fall back to `post_content` if unavailable | public function get_more() {
$more_field = $this->get_fm_field( 'event_details', 'more' );
if ( $more_field ) {
return $more_field;
}
return $this->get_content();
} | [
"public function get_what() {\n $what_field = $this->get_fm_field( 'event_details', 'what' );\n if ( $what_field ) {\n return Utils::reverse_wpautop( $what_field );\n }\n return $this->get_excerpt();\n }",
"function display_additional_meta_data(){\n\t\tglobal $post, $post_type;\n\t\t\n\t\t//if we are on our custom post type\n\t\tif($post_type == $this->content_type_name){\n\t\t\t\n\t\t\t//collect information\n\t\t\t$event_subtitle = get_post_meta($post->ID,'event_subtitle', true);\n\t\t\t$event_start_date = get_post_meta($post->ID,'event_start_date', true);\n\t\t\t$event_end_date = get_post_meta($post->ID,'event_end_date', true);\n\t\t\t$event_start_time = get_post_meta($post->ID,'event_start_time', true);\n\t\t\t$event_end_time = get_post_meta($post->ID,'event_end_time', true);\n\t\t\t$event_location = get_post_meta($post->ID,'event_location', true);\n\t\t\t$event_price = get_post_meta($post->ID,'event_price', true);\n\t\t\t\n\t\t\t$html = '';\n\t\t\t$html .= '<h3><i>' . $event_subtitle . '</i></h3>';\n\t\t\t$html .= '<section class=\"additional-meta\">';\n\t\t\t$html .= '<div class=\"meta\"><strong>Start: </strong><span>' . $event_start_date . ' - ' . $event_start_time . '</span></div>';\n\t\t\t$html .= '<div class=\"meta\"><strong>End: </strong><span>' . $event_end_date . ' - ' . $event_end_time . '</span></div>';\n\t\t\t$html .= '<div class=\"meta\"><strong>Location: </strong><span>' . $event_location . '</span></div>';\n\t\t\t$html .= '<div class=\"meta\"><strong>Price: </strong><span>' . $event_price . '</span></div>';\n\t\t\t\n\t\t\t$html .= '</section>';\n\t\t\t\n\t\t\techo $html;\n\t\t}\n\t\t\n\t}",
"public function getEventDetails() {\n\t\treturn $this->eventDetails;\n\t}",
"public function getDesc()\n {\n return $this->event_desc;\n }",
"function _getEventDetails() {\n if (!is_null($this->_eventDetails)) {\n return $this->_eventDetails;\n }\n $this->_eventDetails = $this->calendarObj->loadEvent($this->eventId);\n return $this->_eventDetails;\n }",
"function get_event_details($event_title)\n\t{\n\t\t$query = 'SELECT EVENT_DESCRIPTION, MEETUP_INSTRUCTIONS, TICKETS FROM EVENT_DETAILS WHERE EVENT_TITLE = \"'.$event_title.'\"';\n\t\treturn run_query($query);\t\n\t}",
"private function fetch_extended_info() {\n\t\tif( $this->description == '' ) {\n\t\t\t$t_text = bug_text_cache_row( $this->id );\n\n\t\t\t$this->description = $t_text['description'];\n\t\t\t$this->steps_to_reproduce = $t_text['steps_to_reproduce'];\n\t\t\t$this->additional_information = $t_text['additional_information'];\n\t\t}\n\t}",
"function bn_add_event_data_to_content( $content ) {\n\tif ( is_admin() ) return $content;\n\tif ( get_post_type() != 'event' ) return $content;\n\t\n\t$post_id = get_the_ID();\n\t\n\t$fields = array(\n\t\t'full_address' => bn_get_location_address( $post_id ), // Used for map\n\t\t'latlng' => bn_get_location_latlng( $post_id ), // Used for map\n\t\t'start_date' => get_field( 'start_date', $post_id ),\n\t\t'end_date' => get_field( 'end_date', $post_id ),\n\t\t'description' => get_field( 'description', $post_id ),\n\t\t'website' => get_field( 'website', $post_id ),\n\t\t'tickets_url' => get_field( 'tickets_url', $post_id ),\n\t\t'featured_image' => get_field( 'featured_image', $post_id, false ),\n\t\t'photo_gallery' => get_field( 'photo_gallery', $post_id ),\n\t);\n\t\n\tob_start();\n\t?>\n\t\n\t<h1><?php the_title(); ?></h1>\n\t\n\t<?php\n\t// ---------------\n\t// Featured Image\n\tif ( $fields['featured_image'] && get_post_type( $fields['featured_image'] ) == 'attachment' ) {\n\t\t$full_size = wp_get_attachment_image_src( $fields['featured_image'], 'full' );\n\t\t\n\t\techo '<p>';\n\t\techo '<a href=\"'. esc_attr($full_size[0]) . '\" target=\"_blank\" title=\"View full image\">';\n\t\techo wp_get_attachment_image( $fields['featured_image'], 'medium' );\n\t\techo '</a>';\n\t\techo '</p>';\n\t\t\n\t\t$fields['photo_gallery'] = array_filter( $fields['photo_gallery'] );\n\t\t\n\t\tif ( count($fields['photo_gallery']) > 1 ) {\n\t\t\techo '<p><em>More pictures available at the bottom of the page.</em></p>';\n\t\t}\n\t}\n\t?>\n\t\n\t<?php\n\t// --------------\n\t// Event Dates\n\techo '<p>';\n\tif ( $fields['start_date'][0]['date'] && $fields['start_date'][0]['time'] ) echo '<strong>Event Starts:</strong> ', esc_html($fields['start_date'][0]['date'] . ' at ' . $fields['start_date'][0]['time']) . '<br>';\n\tif ( $fields['end_date'][0]['date'] && $fields['end_date'][0]['time'] ) echo '<strong>Event Ends:</strong> ', esc_html($fields['end_date'][0]['date'] . ' at ' . $fields['end_date'][0]['time']) . '<br>';\n\techo '<strong>Posted on:</strong> ', date( 'M jS, Y \\a\\t g:ia', get_the_date('U') );\n\techo '</p>';\n\t?>\n\t\n\t<?php\n\t// ---------------\n\t// Description\n\tif ( $fields['description'] ) {\n\t\techo wpautop($fields['description']);\n\t}\n\t?>\n\t\n\t<?php\n\t// --------------\n\t// Website and Ticket URL\n\tif ( $fields['website'] ) echo '<p><strong>Website:</strong> <a href=\"'.esc_attr($fields['website']).'\" target=\"_blank\">Visit Website »</a></p>';\n\tif ( $fields['tickets_url'] ) echo '<p><strong>Tickets:</strong> <a href=\"'.esc_attr($fields['tickets_url']).'\" target=\"_blank\">Buy Tickets »</a></p>';\n\t?>\n\t\n\t<?php\n\t// ---------------\n\t// Google Map Location\n\tif ( $fields['full_address'] && $fields['latlng'] ) {\n\t\techo bn_generate_map( $fields['full_address'], $fields['latlng'][0], $fields['latlng'][1] );\n\t}\n\t?>\n\t\n\t<?php\n\t// ---------------\n\t// Photo gallery\n\tif ( count($fields['photo_gallery']) > 1 ) {\n\t\techo '<p>';\n\t\t\n\t\tforeach( $fields['photo_gallery'] as $i ) {\n\t\t\t$image_id = !empty($i['image']) ? $i['image'] : false;\n\t\t\tif ( !$image_id ) continue;\n\t\t\tif ( get_post_type($image_id) != 'attachment' ) continue;\n\t\t\t\n\t\t\t$full_size = wp_get_attachment_image_src( $image_id, 'full' );\n\t\t\tif ( !$full_size ) continue;\n\t\t\t\n\t\t\techo '<a href=\"'. esc_attr($full_size[0]) . '\" target=\"_blank\" title=\"View full image\">';\n\t\t\techo wp_get_attachment_image( $image_id, 'medium' );\n\t\t\techo '</a>';\n\t\t}\n\t\t\n\t\techo '</p>';\n\t}\n\t?>\n\t\n\t<?php\n\t$content = ob_get_clean();\n\t\n\treturn $content;\n}",
"public function getAnnounceMoreInformation(): string {\r\n return $this->announce_more_information;\r\n }",
"function get_eventDescription() {\n return $this->eventDescription;\n }",
"public function getMoreInfo();",
"public function eventDetails()\n {\n return [\n 'name' => 'Event',\n 'description' => 'Event description',\n 'group' => 'groupcode'\n ];\n }",
"public function getEventDescription() {\n return($this->eventDescription);\n }",
"public function get_extra_facebook_meta( $fb_id, $p ) {\r\n\r\n\t\t\t$event_array = $this->event_array;\r\n\t\t\t$fields = \"phone,cover,description,website\";\r\n\r\n\t\t\t$extra_meta = $this->cliff_fpe_helpers->get_facebook_json( $fb_id,\"fields=\" . $fields, $this->data );\r\n\t\t\tif( property_exists($extra_meta, \"description\")) $event_array[$p[0]][\"post_content\"] = $extra_meta->description;\r\n\t\t\tif( property_exists($extra_meta, \"website\")) $event_array[$p[0]][\"post_meta\"][\"_\" . $p[1] . \"Website\"] = $extra_meta->website;\r\n\t\t\tif( property_exists($extra_meta, \"cover\")) $event_array[$p[0]][\"post_meta\"][\"_\" . $p[1] . \"Cover\"] = $extra_meta->cover->source;\r\n\t\t\tif( property_exists($extra_meta, \"phone\")) $event_array[$p[0]][\"post_meta\"][\"_\" . $p[1] . \"Phone\"] = $extra_meta->phone;\r\n\r\n\t\t\treturn $event_array;\r\n\r\n\t\t}",
"public function getEventDescription()\n {\n return $this->eventDescription;\n }",
"public function actionEventDetails($event) {\n $baner_image = \\common\\models\\BanerImages::findOne(1);\n $event_details = \\common\\models\\NewsEvents::find()->where(['canonical_name' => $event])->one();\n $events = \\common\\models\\NewsEvents::find()->where(['status' => 1])->andWhere(['!=', 'id', $event_details->id])->limit(10)->all();\n \\Yii::$app->view->registerMetaTag(['name' => 'keywords', 'content' => $event_details->meta_keyword]);\n \\Yii::$app->view->registerMetaTag(['name' => 'description', 'content' => $event_details->meta_description]);\n return $this->render('news_detail', [\n 'event_details' => $event_details,\n 'baner_image' => $baner_image,\n 'events' => $events,\n ]);\n }",
"function tribe_get_the_event_meta() {\n\t_deprecated_function( __FUNCTION__, '4.3' );\n\n\t$html = '';\n\tforeach ( Tribe__Events__Meta_Factory::get_order() as $meta_groups ) {\n\t\tforeach ( $meta_groups as $meta_group_id ) {\n\t\t\t$html .= tribe_get_meta_group( $meta_group_id, true );\n\t\t}\n\t}\n\n\treturn apply_filters( 'tribe_get_the_event_meta', $html );\n}",
"public function getDescriptionMoreInfoHtml() { return $this->descriptionMoreInfoHtml; }",
"function get_site_extra_fields ( $eventid ) {\n $rows = dbi_get_cached_rows ( 'SELECT cal_name, cal_type, cal_date, cal_remind,\n cal_data FROM webcal_site_extras WHERE cal_id = ?', array ( $eventid ) );\n $extras = array ();\n if ( $rows ) {\n for ( $i = 0, $cnt = count ( $rows ); $i < $cnt; $i++ ) {\n $row = $rows[$i];\n // Save by cal_name (e.g. \"URL\").\n $extras[$row[0]] = array (\n 'cal_name' => $row[0],\n 'cal_type' => $row[1],\n 'cal_date' => $row[2],\n 'cal_remind' => $row[3],\n 'cal_data' => $row[4]\n );\n }\n }\n return $extras;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Requests the Zabbix API and returns the response of the method "screenitem.tablename". The $params Array can be used, to pass parameters to the Zabbix API. For more information about these parameters, check the Zabbix API documentation at The $arrayKeyProperty can be used to get an associative instead of an indexed array as response. A valid value for the $arrayKeyProperty is is any property of the returned JSON objects (e.g. "name", "host", "hostid", "graphid", "screenitemid"). | public function screenitemTableName($params = [], $arrayKeyProperty = null, $assoc = true)
{
return $this->request('screenitem.tablename', $this->getRequestParamsArray($params), $arrayKeyProperty, $assoc, true);
} | [
"public function templatescreenitemTableName($params = array(), $arrayKeyProperty = '')\n {\n return $this->request('templatescreenitem.tableName', $this->getRequestParamsArray($params), $arrayKeyProperty, true);\n }",
"public function templatescreenitemTableName($params = [], $arrayKeyProperty = null, $assoc = true)\n {\n return $this->request('templatescreenitem.tablename', $this->getRequestParamsArray($params), $arrayKeyProperty, $assoc, true);\n }",
"public function itemTableName($params = [], $arrayKeyProperty = null, $assoc = true)\n {\n return $this->request('item.tablename', $this->getRequestParamsArray($params), $arrayKeyProperty, $assoc, true);\n }",
"public function templatescreenTableName($params = [], $arrayKeyProperty = null, $assoc = true)\n {\n return $this->request('templatescreen.tablename', $this->getRequestParamsArray($params), $arrayKeyProperty, $assoc, true);\n }",
"public function itemTableName($params = array(), $arrayKeyProperty = '')\n {\n return $this->request('item.tableName', $this->getRequestParamsArray($params), $arrayKeyProperty, true);\n }",
"public function apiinfoTableName($params = array(), $arrayKeyProperty = '')\n {\n return $this->request('apiinfo.tableName', $this->getRequestParamsArray($params), $arrayKeyProperty, true);\n }",
"public function httptestTableName($params = array(), $arrayKeyProperty = '')\n {\n return $this->request('httptest.tableName', $this->getRequestParamsArray($params), $arrayKeyProperty, true);\n }",
"public function dashboardTableName($params = array(), $arrayKeyProperty = '')\n {\n return $this->request('dashboard.tableName', $this->getRequestParamsArray($params), $arrayKeyProperty, true);\n }",
"public function graphitemTableName($params = [], $arrayKeyProperty = null, $assoc = true)\n {\n return $this->request('graphitem.tablename', $this->getRequestParamsArray($params), $arrayKeyProperty, $assoc, true);\n }",
"public function httptestTableName($params = [], $arrayKeyProperty = null, $assoc = true)\n {\n return $this->request('httptest.tablename', $this->getRequestParamsArray($params), $arrayKeyProperty, $assoc, true);\n }",
"public function hostTableName($params = [], $arrayKeyProperty = null, $assoc = true)\n {\n return $this->request('host.tablename', $this->getRequestParamsArray($params), $arrayKeyProperty, $assoc, true);\n }",
"public function itemprototypeTableName($params = array(), $arrayKeyProperty = '')\n {\n return $this->request('itemprototype.tableName', $this->getRequestParamsArray($params), $arrayKeyProperty, true);\n }",
"public function historyTableName($params = [], $arrayKeyProperty = null, $assoc = true)\n {\n return $this->request('history.tablename', $this->getRequestParamsArray($params), $arrayKeyProperty, $assoc, true);\n }",
"public function apiTableName($params = [], $arrayKeyProperty = null, $assoc = true)\n {\n return $this->request('api.tablename', $this->getRequestParamsArray($params), $arrayKeyProperty, $assoc, true);\n }",
"public function graphitemTableName($params = array(), $arrayKeyProperty = '')\n {\n return $this->request('graphitem.tableName', $this->getRequestParamsArray($params), $arrayKeyProperty, true);\n }",
"public function hostinterfaceTableName($params = [], $arrayKeyProperty = null, $assoc = true)\n {\n return $this->request('hostinterface.tablename', $this->getRequestParamsArray($params), $arrayKeyProperty, $assoc, true);\n }",
"public function trendTableName($params = [], $arrayKeyProperty = null, $assoc = true)\n {\n return $this->request('trend.tablename', $this->getRequestParamsArray($params), $arrayKeyProperty, $assoc, true);\n }",
"public function applicationTableName($params = array(), $arrayKeyProperty = '')\n {\n return $this->request('application.tableName', $this->getRequestParamsArray($params), $arrayKeyProperty, true);\n }",
"public function proxyTableName($params = array(), $arrayKeyProperty = '')\n {\n return $this->request('proxy.tableName', $this->getRequestParamsArray($params), $arrayKeyProperty, true);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a binder metadata collection | public function createBinderMetadataCollection(array $binders): BinderMetadataCollection
{
/** @var list<BinderMetadata> $binderMetadatas */
$binderMetadatas = [];
$failedInterfacesToBinders = [];
foreach ($binders as $binder) {
try {
$binderMetadatas[] = $this->binderMetadataCollector->collect($binder);
} catch (FailedBinderMetadataCollectionException $ex) {
self::addFailedResolutionToMap($failedInterfacesToBinders, $ex);
}
$binderMetadatas = [
...$binderMetadatas,
...$this->retryFailedBinders($failedInterfacesToBinders)
];
}
if (\count($failedInterfacesToBinders) > 0) {
throw new ImpossibleBindingException($failedInterfacesToBinders);
}
return new BinderMetadataCollection($binderMetadatas);
} | [
"public function get(): ?BinderMetadataCollection;",
"protected function initModelsMetaData()\n {\n $config = $this->di->get('config');\n\n $this->di->set('modelsMetadata', function () use ($config) {\n if (isset($config->app->metadata)) {\n if ($config->app->metadata->adapter === 'Files') {\n return new PhMetaDataFiles([\n 'metaDataDir' => $config->app->metadata->path\n ]);\n }\n }\n\n return new PhMetaDataMemory();\n });\n }",
"public function getMetadataMap(): array\n {\n return [\n [\n '__class__' => RouteBasedCollectionMetadata::class,\n 'collection_class' => Collection\\UserCollection::class,\n 'collection_relation' => 'users',\n 'route' => 'api.v1.users.list'\n ],\n [\n '__class__' => RouteBasedResourceMetadata::class,\n 'resource_class' => User::class,\n 'route' => 'api.v1.users.get',\n 'extractor' => UserHydrator::class,\n 'resource_identifier' => 'user_id',\n 'identifiers_to_placeholders_mapping' => [\n 'user_id' => 'id',\n ],\n ],\n [\n '__class__' => RouteBasedResourceMetadata::class,\n 'resource_class' => Permission::class,\n 'route' => 'api.v1.users.permissions.get',\n 'extractor' => UserPermissionHydrator::class,\n 'resource_identifier' => 'user_id',\n 'identifiers_to_placeholders_mapping' => [\n 'user_id' => 'id',\n ],\n ]\n ];\n }",
"public function MetaDataBinder() {\n\t\t\t// Remember! We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below\n\t\t\tif ($this->Paginator) {\n\t\t\t\t$this->TotalItemCount = FichasBackup::CountAll();\n\t\t\t}\n\n\t\t\t// Setup the $objClauses Array\n\t\t\t$objClauses = array();\n\n\t\t\t// If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add\n\t\t\t// the OrderByClause to the $objClauses array\n\t\t\tif ($objClause = $this->OrderByClause)\n\t\t\t\tarray_push($objClauses, $objClause);\n\n\t\t\t// Add the LimitClause information, as well\n\t\t\tif ($objClause = $this->LimitClause)\n\t\t\t\tarray_push($objClauses, $objClause);\n\n\t\t\t// Set the DataSource to be a Query result from FichasBackup, given the clauses above\n\t\t\t$this->DataSource = FichasBackup::LoadAll($objClauses);\n\t\t}",
"protected function setupMetaData()\n {\n $this->app->singleton(MetaDataManager::class);\n }",
"public function createCollections()\n {\n foreach ($this->metadataFactory->getAllMetadata() as $class) {\n if ($class->isMappedSuperclass || $class->isEmbeddedDocument) {\n continue;\n }\n $this->createDocumentCollection($class->name);\n }\n }",
"public function populateMetadata()\n {\n $attributes = [];\n\n foreach ($this->getArrayableRelations() as $key => $value) {\n if ($key == 'meta' || $key == 'restrictedMeta') {\n if (!isset($attributes['metadata'])) {\n $attributes['metadata'] = [];\n }\n\n $value->each(function ($metadata) use (&$attributes) {\n if (!array_key_exists(str_replace('-', '_', $metadata->key), $attributes['metadata'])) {\n $attributes['metadata'][str_replace('-', '_', $metadata->key)] = $metadata->value;\n }\n });\n }\n }\n\n if (isset($attributes['metadata'])) {\n foreach ($this->getMetadataAttributes() as $key) {\n $attributes['metadata'][$key] = $this->populateMetadataAttribute(\n $key,\n array_key_exists(\n $key,\n $attributes['metadata']\n ) ? $attributes['metadata'][$key] : null\n );\n }\n }\n\n if (empty($attributes) && !empty($this->metadataAttributes)) {\n foreach ($this->metadataAttributes as $key => $value) {\n $attributes['metadata'][$key] = $value;\n }\n }\n\n unset($this->relations['meta']);\n unset($this->relations['restrictedMeta']);\n\n return $attributes;\n }",
"public function getMetadataMap() : array\n {\n return [\n [\n '__class__' => RouteBasedCollectionMetadata::class,\n 'collection_class' => Collection\\UserLogCollection::class,\n 'collection_relation' => 'logs',\n 'route' => 'api.v1.users.logs.list'\n ],\n [\n '__class__' => RouteBasedCollectionMetadata::class,\n 'collection_class' => Collection\\PasswordLogCollection::class,\n 'collection_relation' => 'logs',\n 'route' => 'api.v1.passwords.logs.list'\n ],\n [\n '__class__' => RouteBasedResourceMetadata::class,\n 'resource_class' => Log::class,\n 'route' => 'api.v1.logs.get',\n 'extractor' => LogHalHydrator::class,\n 'resource_identifier' => 'log_id',\n 'identifiers_to_placeholders_mapping' => [\n 'log_id' => 'id',\n ],\n ]\n ];\n }",
"public static function createMetadataFromConfig(array $config) {\n $collection = new ClassMetadataCollection();\n foreach ($config as $class => $metadataConfig) {\n $metadata = new ClassMetadata();\n foreach($metadataConfig as $propertyName => $propertyConfig) {\n $metadata->configureAttribute($propertyName, $propertyConfig);\n }\n\n $collection->add($class, $metadata);\n }\n return $collection;\n }",
"function getMetadataFactory()\n {\n\n }",
"public function getMetaData(): Collection\n {\n return $this->meta_data;\n }",
"private function addMetadataGenerators(): void\n {\n if ($this->isAddedMetadataGenerators) {\n return;\n }\n $classLocator = $this->getEntityClassLocator();\n\n $reader = $this->getMetadataReader();\n\n // register embeddable entities\n $this->conveyor[Conveyor::STAGE_INDEX][] = new Embeddings($classLocator, $reader);\n // register annotated entities\n $this->conveyor[Conveyor::STAGE_INDEX][] = new Entities($classLocator, $reader, $this->tableNaming);\n // register STI/JTI\n $this->conveyor[Conveyor::STAGE_INDEX][] = new TableInheritance($reader);\n // add @Table(columns) declarations\n $this->conveyor[Conveyor::STAGE_INDEX][] = new MergeColumns($reader);\n // add @Table(indexes) declarations\n $this->conveyor[Conveyor::STAGE_RENDER][] = new MergeIndexes($reader);\n\n $this->isAddedMetadataGenerators = true;\n }",
"public function getMappingBagCollection() : MappingBagCollection\n {\n return MappingBagCollection::create(\n ['fake' => 'Fake'],\n '@FakeBundle',\n 'Mmoreram\\ControllerExtraBundle\\Tests\\FakeBundle\\Entity'\n );\n }",
"public function meta() : MetadataBag\n {\n return $this->storage->getMetadataBag();\n }",
"protected function _getFormAttributeCollection()\n {\n return $this->_collectionFactory->create();\n }",
"protected function _getBinder()\n {\n return $this->_binder;\n }",
"public function defineBindings(): array;",
"protected function _create_collection($bind_info)\n {\n // Create an OCI-Collection object\n if(is_array($bind_info['type'])){\n $schema_and_type = $bind_info['type'];\n $collection = oci_new_collection($this->ci->conn,$schema_and_type[1], $schema_and_type[0]);\n }\n else{\n $collection = oci_new_collection($this->ci->conn,$bind_info['type']);\n }\n foreach ($bind_info['value'] as $array_item){ //add the items to the collection\n $collection->append($array_item);\n }\n return $collection;\n }",
"public function getMetadataHelper();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Dump out the session. | public static function dump()
{
var_dump($_SESSION);
} | [
"public function dumpSession() {\n\t\techo \"<pre>\\n\";\n\t\tprint_r($_SESSION);\n\t\techo \"</pre>\\n\";\n\t}",
"public function dump() {\r\n\t\t\techo $this->outputKV();\r\n\t\t}",
"public function dump();",
"public function dump() {\r\n\t\t\techo '<pre>';\r\n\t\t\tvar_dump($this->cart);\r\n\t\t\techo '</pre>';\r\n\t\t}",
"public function dump(): void\n {\n print_r($this->debug());\n }",
"function dump(){}",
"public function dump()\n {\n $this->logLatestContent();\n\n die(var_dump($this->response()));\n }",
"public function dump()\n {\n foreach ($this->tapes as $tape) {\n if ($tape->hasResponses()) {\n $fileName = 'record_'.$tape->getName().'.json';\n $content = $this->formatter->encodeResponsesCollection($tape->getResponses());\n $this->writer->write($fileName, $content);\n }\n }\n }",
"public function dump ()\n {\n while ( $this->reader->hasToken() ) {\n $this->reader->popToken()->dump();\n }\n }",
"function see_session()\n {\n\n \t echo '<pre>'.print_r($this->authentication->see_data(), true) .'</pre>';\n\n }",
"public static function debug() {\n\n\t\t\t$user = print_r(self::user(), TRUE);\n\t\t\t$data = print_r($_SESSION, TRUE);\n\t\t\t$sid = session_id();\n\n\t\t\techo <<<DEBUG\n<pre style=\"width:70%; border:1px solid black; background:#eee; padding:50px; margin:50px auto; clear:both; position:relative; z-index:100000;\">\n<b>Session debugging:</b>\nSID=$sid\n\nUser=$user\n\nData=$data\n</pre>\nDEBUG;\n\n\t\t}",
"public function writeToSession(): void\n {\n $_SESSION['current_user']=serialize($this);\n }",
"function serialize() {\r\n return session_encode();\r\n }",
"public function dumpLog() {\n\t\t$log = Swift_LogContainer::getLog ();\n\t\t$log->dump ();\n\t}",
"public function saveSession() {\n\t}",
"public function dump() {\n print_r($this->data);\n }",
"public function dumpTo($log)\n\t{\n\t\tif (!$this->sessionLog)\n\t\t\treturn;\n\n\t\t$log->write(new LogRecord(null, \"=== Detailed session log dump begin ==================\", null));\n\t\tforeach($this->sessionLog as $r) {\n\t\t\t$log->write($r); // historical log dumped with actual event times\n\t\t}\n\t\t$log->write(new LogRecord(null, \"=== Detailed session log dump end ====================\", null));\n\t}",
"function getDump() {\n\t\t$data = \"\";\n\t\tforeach($_SERVER AS $option => $value) {\n\t\t\t$data .= \"{$option} : {$value} \\n\";\n\t\t}\n\t\t$data.= \"\\n\\n\".str_repeat(\"=\", 20).\"\\nPOST DUMP: \\n\\n\".print_r($_POST,true);\n\t\t$data.= \"\\n\\n\".str_repeat(\"=\", 20).\"\\nCOOKIE DUMP: \\n\\n\".print_r($_COOKIE,true);\n\t\tif(!empty($_FILES)) {\n\t\t\t$data.= \"\\n\\n\".str_repeat(\"=\", 20).\"\\nFILES DUMP: \\n\\n\".print_r($_FILES,true);\n\t\t}\n\t\tif(isset($_SESSION)) {\n\t\t\t$data.= \"\\n\\n\".str_repeat(\"=\", 20).\"\\nSESSION DUMP: \\n\\n\".print_r($_SESSION,true);\n\t\t}\n\t\treturn $data;\n\t}",
"function saveSession()\n{\n\tif (!$this->sessName) return;\n\t$s = array(\n\t\t'sql' => $this->sql,\n\t\t'hash' => $this->hash,\n\t\t'length' => $this->length,\n\t\t'filter' => $this->filter,\n\t\t'page' => $this->pager->getValue('active'),\n\t\t'sortarray' => $this->sortArray,\n\t);\n\n\t$this->app->setSession($this->sessName, $s);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Verifies a user inputted key against the current timestamp. Checks $window keys either side of the timestamp. | public function verify(
#[\SensitiveParameter]
$key,
#[\SensitiveParameter]
$secret,
$window = null,
$timestamp = null,
$oldTimestamp = null
) {
return $this->verifyKey(
$secret,
$key,
$window,
$timestamp,
$oldTimestamp
);
} | [
"public function verifyKey(\n #[\\SensitiveParameter]\n $secret,\n #[\\SensitiveParameter]\n $key,\n $window = null,\n $timestamp = null,\n $oldTimestamp = null\n ) {\n $timestamp = $this->makeTimestamp($timestamp);\n\n return $this->findValidOTP(\n $secret,\n $key,\n $window,\n $this->makeStartingTimestamp($window, $timestamp, $oldTimestamp),\n $timestamp,\n $oldTimestamp\n );\n }",
"public function verifyKey($b32seed, $key, $window = 4, $useTimeStamp = true)\n\t{\n\t\t$timeStamp = $this->getTimestamp();\n\n\t\tif ($useTimeStamp !== true)\n\t\t{\n\t\t\t$timeStamp = (int)$useTimeStamp;\n\t\t}\n\n\t\t$binarySeed = $this->base32Decode($b32seed);\n\n\t\tfor ($ts = $timeStamp - $window; $ts <= $timeStamp + $window; $ts++)\n\t\t{\n\t\t\tif (Str::equals($this->oathHotp($binarySeed, $ts), $key))\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"function verifyKey() \n\t{\n\t\t// make sure a key is set\n\t\tif (!isset($_GET['key'])) { return false; }\n\t\t$key = $_GET['key'];\n\t\t// Decode the hex\n\t\t$key = preg_replace(\"/(.{2})/\",\"%$1\",$key);\n\t\t$key = rawurldecode($key);\n\t\t// Reverse the key\n\t\t$key = strrev($key);\n\t\t// Strip the random characters\n\t\t$key = preg_replace(\"/([a-z])/i\",'',$key);\n\t\t\n\t\t// If this key is from the past 10 seconds we consider it valid\n\t\t// might need to increase depending on bandwidth conditions...\n\t\treturn ((time()-$key) < 10)?true:false;\n\t}",
"protected function verifyTimestamp()\n\t{\n\t\t$time = Carbon::createFromTimestamp(\n\t\t\t$this->request->get('timestamp')\n\t\t);\n\n\t\t$expire = Carbon::now()->subHours($this->cacheDays * 24 / 2);\n\n\t\treturn $expire->lt($time);\n\t}",
"private function verifyKey($key) {\r\n\t\t$key = preg_replace(\"/(.{2})/\",\"%$1\",$key);\r\n\t\t$key = rawurldecode($key);\r\n\t\t$key = strrev($key);\r\n\t\t$key = preg_replace(\"/([a-z])/i\",'',$key);\r\n\t\treturn ((time() - $key) < 25) ? true : false;\r\n\t}",
"function yubikey_verify_timestamp($timestamp)\n{\n\t$tolerance = intval(getConfig('yubikey_api_ts_tolerance', 150));\n\t\n\t$now = time();\n\t$timestamp_seconds = yk_strtotime($timestamp);\n\n\tif ( !$timestamp || !$now || !$timestamp_seconds )\n\t{\n\t\treturn false;\n\t}\n\n\tif ( ( $timestamp_seconds + $tolerance ) > $now && ( $timestamp_seconds - $tolerance ) < $now )\n\t{\n\t\treturn true;\n\t}\n\n\treturn false;\n}",
"function IsKeyUp(int $key): bool { return false; }",
"public function waitForKeyPress();",
"public static function hasOldInput($key = null){\n\t\treturn \\Illuminate\\Session\\Store::hasOldInput($key);\n\t}",
"public function testHotpResyncWindow($key, $counter, $counterwindow)\n\t{\n\t\t$secret = $this->secret;\n\n\t\t// test with provided counter window\n\t\t$this->assertSame(($counter + $counterwindow), $this->Otp->checkHotpResync($secret, $counter, $key, $counterwindow));\n\t}",
"function hasOldInput ($key = null);",
"function ncurses_has_key($keycode)\n{\n}",
"public static function valid_timestamp($timestamp)\n\t{\n\t\t$timestamp_cutoff = \\Config::get('engine.timestamp_cutoff', 15);\n\t\t\n\t\t// Is the timestamp from 60 seconds ago up to the current time?\n\t\tif ((int)$timestamp >= (static::$gm_time - (int)$timestamp_cutoff) && (int)$timestamp <= static::$gm_time) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// Timestamp out of scope\n\t\treturn false;\n\t}",
"private static function validateTimestamp(){\n\t\tif(self::serverTimestamp() == self::$clientTimestamp){ return true; } else { return false; };\n\t}",
"public function isKeyValid()\n\t\t{\n\t\t\t$key = strtoupper( md5(\n\t\t\t\t$this->_secretWord . $this->_accountId .\n\t\t\t\t$this->getRequest()->getParam( 'order_number' ) .\n\t\t\t\t$this->getRequest()->getParam( 'total' )\n\t\t\t) );\n\t\t\treturn ( $key == $this->getRequest()->getParam( 'key' ) );\n\t\t}",
"function IsKeyDown(int $key): bool { return false; }",
"public function checkTimestamp() {\n $timestamp = \\Drupal::state()->get(\"everylane_last_timestamp\", 0);\n $cutoff = \\Drupal::state()->get('minimum_time_between_tweets',\n \\Drupal::config('everylane.settings')->get('minimum_time_between_tweets'));\n if (time() > strtotime($cutoff, $timestamp)) {\n return TRUE;\n }\n }",
"function checkResetKey($username, $key) {\n $attcount = $this->getAttempt($_SERVER['REMOTE_ADDR']);\n if ($attcount[0]->count >= MAX_ATTEMPTS) {\n $this->errormsg[] = $this->lang['resetpass_lockedout'];\n $this->errormsg[] = sprintf($this->lang['resetpass_wait'], WAIT_TIME);\n return false;\n } else {\n if (strlen($username) == 0) {\n return false;\n } elseif (strlen($username) > MAX_USERNAME_LENGTH) {\n return false;\n } elseif (strlen($username) < MIN_USERNAME_LENGTH) {\n return false;\n } elseif (strlen($key) == 0) {\n return false;\n } elseif (strlen($key) < RANDOM_KEY_LENGTH) {\n return false;\n } elseif (strlen($key) > RANDOM_KEY_LENGTH) {\n return false;\n } else {\n $query = $this->authorize->getAccountInfo($username);\n $count = count($query);\n if ($count == 0) {\n $this->logActivity(\"UNKNOWN\", \"AUTH_CHECKRESETKEY_FAIL\", \"Username doesn't exist ({$username})\");\n $this->addAttempt($_SERVER['REMOTE_ADDR']);\n $this->errormsg[] = $this->lang['checkresetkey_username_incorrect'];\n $attcount[0]->count = $attcount[0]->count + 1;\n $remaincount = (int) MAX_ATTEMPTS - $attcount[0]->count;\n $this->errormsg[] = sprintf($this->lang['checkresetkey_attempts_remaining'], $remaincount);\n return false;\n } else {\n $db_key = $query[0]->resetkey;\n if ($key == $db_key) {\n return true;\n } else {\n $this->logActivity($username, \"AUTH_CHECKRESETKEY_FAIL\", \"Key provided is different to DB key ( DB : {$db_key} / Given : {$key} )\");\n $this->addAttempt($_SERVER['REMOTE_ADDR']);\n $this->errormsg[] = $this->lang['checkresetkey_key_incorrect'];\n $attcount[0]->count = $attcount[0]->count + 1;\n $remaincount = (int) MAX_ATTEMPTS - $attcount[0]->count;\n $this->errormsg[] = sprintf($this->lang['checkresetkey_attempts_remaining'], $remaincount);\n return false;\n }\n }\n }\n }\n }",
"public function check_win()\n {\n\n $answerSheet = array(\"1\",\"2\",\"3\",\"8\",\" \",\"4\",\"7\",\"6\",\"5\");\n $currentTable = array( $_COOKIE['cellOne'], $_COOKIE['cellTwo'],$_COOKIE['cellThree'],$_COOKIE['cellEight'],\n $_COOKIE['cellBlank'],$_COOKIE['cellFour'],$_COOKIE['cellSeven'],$_COOKIE['cellSix'],\n $_COOKIE['cellFive']);\n $z = 0;\n if ($currentTable[$z] !== $answerSheet[$z]) // If cell does not match that in the answer sheet return false\n {\n echo (\"Hello Out there puzzle logic line 146\");\n return false;\n }\n $z++;\n echo \"Congratulations You Won!!!\";\n // window.alert(\"Congratulations You Solved The Puzzle!!!\");\n return true;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the default scopes used by this provider. | protected function getDefaultScopes()
{
return $this->scopes;
} | [
"public function getDefaultScopes()\n {\n return $this->defaultScopes;\n }",
"protected function getDefaultScopes()\n {\n return ['basic', 'titles', 'events', 'maps', 'email'];\n }",
"public function getDefaultScopes();",
"protected function getDefaultScopes()\n {\n return ['openid', 'profile', 'email', 'all'];\n }",
"protected function getDefaultScopes() {\n\t\treturn ['auth'];\n\t}",
"protected function getDefaultScopes()\n {\n return ['profile', 'openid', 'email'];\n }",
"public function defaultScope(): ScopeInterface\n {\n return new Scope(\"_default\", $this->name, $this->core);\n }",
"public function getAllScopes();",
"public function getScopes(): array\n {\n return $this->configManager->getScopes();\n }",
"public function getScope()\n {\n $loginProvidersConfig = Craft::app()->config->get($this->getHandle().'LoginProvider', 'social');\n\n if(isset($loginProvidersConfig['scope']))\n {\n return $loginProvidersConfig['scope'];\n }\n else\n {\n return $this->getDefaultScope();\n }\n }",
"public function scopes()\n {\n return $this->scopes;\n }",
"protected function getSupportedScopes()\n {\n static $scope = null;\n if (!\\is_object($scope)) {\n $scope = new Scope();\n }\n\n return $scope;\n }",
"public function getSupportedScopes()\n {\n return $this->supportedScopes;\n }",
"public function getScopes()\n {\n return $this->scopes;\n }",
"public function getDefaultScope($client_id = null);",
"public function scopes()\n {\n return [\n 'category' => new CategoryScope(),\n ];\n }",
"function scopes()\n {\n return [\n 'published'=>[\n 'condition'=>''\n ],\n 'recently'=>[\n 'order'=>'id desc'\n ]\n ];\n }",
"public function getScopes()\n {\n return $this->scopes->getValues();\n }",
"public function getGlobalScopes();",
"public function get_scopes() {\n\t\treturn array(\n\t\t\t'https://www.googleapis.com/auth/siteverification',\n\t\t);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load the email settings form | public function load_email_form() {
// Validate nonce
forminator_validate_ajax( "forminator_load_popup_email_settings" );
$html = forminator_template( 'settings/popup/edit-email-content' );
wp_send_json_success( $html );
} | [
"private function initMailOptionsForm()\n\t{\n\t\tglobal $ilCtrl, $ilSetting, $lng, $ilUser;\t\n\t\t\n\t\tinclude_once 'Services/Form/classes/class.ilPropertyFormGUI.php';\n\t\t$this->form = new ilPropertyFormGUI();\n\t\t\n\t\t$this->form->setFormAction($ilCtrl->getFormAction($this, 'saveMailOptions'));\n\t\t$this->form->setTitle($lng->txt('mail_settings'));\n\t\t\t\n\t\t// BEGIN INCOMING\n\t\tinclude_once 'Services/Mail/classes/class.ilMailOptions.php';\n\t\tif($ilSetting->get('usr_settings_hide_mail_incoming_mail') != '1')\n\t\t{\n\t\t\t$options = array(\n\t\t\t\tIL_MAIL_LOCAL => $this->lng->txt('mail_incoming_local'), \n\t\t\t\tIL_MAIL_EMAIL => $this->lng->txt('mail_incoming_smtp'),\n\t\t\t\tIL_MAIL_BOTH => $this->lng->txt('mail_incoming_both')\n\t\t\t);\n\t\t\t$si = new ilSelectInputGUI($lng->txt('mail_incoming'), 'incoming_type');\n\t\t\t$si->setOptions($options);\n\t\t\tif(!strlen(ilObjUser::_lookupEmail($ilUser->getId())) ||\n\t\t\t $ilSetting->get('usr_settings_disable_mail_incoming_mail') == '1')\n\t\t\t{\n\t\t\t\t$si->setDisabled(true);\t\n\t\t\t}\n\t\t\t$this->form->addItem($si);\n\t\t}\n\t\t\n\t\t// BEGIN LINEBREAK_OPTIONS\n\t\t$options = array();\n\t\tfor($i = 50; $i <= 80; $i++)\n\t\t{\n\t\t\t$options[$i] = $i; \n\t\t}\t\n\t\t$si = new ilSelectInputGUI($lng->txt('linebreak'), 'linebreak');\n\t\t$si->setOptions($options);\t\t\t\n\t\t$this->form->addItem($si);\n\t\t\n\t\t// BEGIN SIGNATURE\n\t\t$ta = new ilTextAreaInputGUI($lng->txt('signature'), 'signature');\n\t\t$ta->setRows(10);\n\t\t$ta->setCols(60);\t\t\t\n\t\t$this->form->addItem($ta);\n\t\t\n\t\t// BEGIN CRONJOB NOTIFICATION\n\t\tif($ilSetting->get('mail_notification'))\n\t\t{\n\t\t\t$cb = new ilCheckboxInputGUI($lng->txt('cron_mail_notification'), 'cronjob_notification');\t\t\t\n\t\t\t$cb->setInfo($lng->txt('mail_cronjob_notification_info'));\n\t\t\t$cb->setValue(1);\n\t\t\t$this->form->addItem($cb);\n\t\t}\t\t\n\t\t\n\t\t$this->form->addCommandButton('saveMailOptions', $lng->txt('save'));\n\t}",
"public function action_mailSettings_display()\n\t{\n\t\tglobal $txt, $context, $txtBirthdayEmails;\n\n\t\t// Some important context stuff\n\t\t$context['page_title'] = $txt['mail_settings'];\n\t\t$context['sub_template'] = 'show_settings';\n\n\t\t// Initialize the form\n\t\t$settingsForm = new SettingsForm(SettingsForm::DB_ADAPTER);\n\n\t\t// Initialize it with our settings\n\t\t$config_vars = $this->_settings();\n\t\t$settingsForm->setConfigVars($config_vars);\n\n\t\t// Piece of redundant code, for the javascript\n\t\t$processedBirthdayEmails = array();\n\t\tforeach ($txtBirthdayEmails as $key => $value)\n\t\t{\n\t\t\t$index = substr($key, 0, strrpos($key, '_'));\n\t\t\t$element = substr($key, strrpos($key, '_') + 1);\n\t\t\t$processedBirthdayEmails[$index][$element] = $value;\n\t\t}\n\n\t\t// Saving?\n\t\tif (isset($this->_req->query->save))\n\t\t{\n\t\t\t// Make the SMTP password a little harder to see in a backup etc.\n\t\t\tif (!empty($this->_req->post->smtp_password[1]))\n\t\t\t{\n\t\t\t\t$this->_req->post->smtp_password[0] = base64_encode($this->_req->post->smtp_password[0]);\n\t\t\t\t$this->_req->post->smtp_password[1] = base64_encode($this->_req->post->smtp_password[1]);\n\t\t\t}\n\t\t\tcheckSession();\n\n\t\t\t// We don't want to save the subject and body previews.\n\t\t\tunset($config_vars['birthday_subject'], $config_vars['birthday_body']);\n\t\t\t$settingsForm->setConfigVars($config_vars);\n\t\t\tcall_integration_hook('integrate_save_mail_settings');\n\n\t\t\t// You can not send more per page load than you can per minute\n\t\t\tif (!empty($this->_req->post->mail_batch_size))\n\t\t\t{\n\t\t\t\t$this->_req->post->mail_batch_size = min((int) $this->_req->post->mail_batch_size, (int) $this->_req->post->mail_period_limit);\n\t\t\t}\n\n\t\t\t// If not supplied, attempt to set a FQDN value for the SMTP client\n\t\t\tif (empty($this->_req->post->smtp_client) && $this->_req->post->mail_type === '1')\n\t\t\t{\n\t\t\t\t$this->_req->post->smtp_client = detectServer()->getFQDN();\n\t\t\t}\n\t\t\t$settingsForm->setConfigValues((array) $this->_req->post);\n\t\t\t$settingsForm->save();\n\t\t\tredirectexit('action=admin;area=mailqueue;sa=settings');\n\t\t}\n\n\t\t$context['post_url'] = getUrl('admin', ['action' => 'admin', 'area' => 'mailqueue', 'sa' => 'settings', 'save']);\n\t\t$context['settings_title'] = $txt['mailqueue_settings'];\n\n\t\t// Prepare the config form\n\t\t$settingsForm->prepare();\n\n\t\t// Build a little JS so the birthday mail can be seen\n\t\t$javascript = '\n\t\t\tvar bDay = {';\n\n\t\t$i = 0;\n\t\tforeach ($processedBirthdayEmails as $index => $email)\n\t\t{\n\t\t\t$is_last = ++$i === count($processedBirthdayEmails);\n\t\t\t$javascript .= '\n\t\t\t\t' . $index . ': {\n\t\t\t\tsubject: ' . JavaScriptEscape($email['subject']) . ',\n\t\t\t\tbody: ' . JavaScriptEscape(nl2br($email['body'])) . '\n\t\t\t}' . (!$is_last ? ',' : '');\n\t\t}\n\n\t\ttheme()->addInlineJavascript($javascript . '\n\t\t};\n\t\t\n\t\tfunction fetch_birthday_preview()\n\t\t{\n\t\t\tvar index = document.getElementById(\\'birthday_email\\').value;\n\n\t\t\tdocument.getElementById(\\'birthday_subject\\').innerHTML = bDay[index].subject;\n\t\t\tdocument.getElementById(\\'birthday_body\\').innerHTML = bDay[index].body;\n\t\t}', true);\n\t}",
"public function hbl_setting_mail()\n {\n $this->options = get_option('hbl_option_name_mail');\n ?>\n <div class=\"wrap\">\n <form method=\"post\" action=\"options.php\">\n <?php\n // This prints out all hidden setting fields\n settings_fields('hbl_option_group_mail');\n do_settings_sections('hbl-setting-mail');\n submit_button();\n ?>\n </form>\n </div>\n <?php\n }",
"private function emailSettings()\r\n {\r\n if ($this->_realAccessLevel < ACCESS_LEVEL_DEMO)\r\n {\r\n CommonErrors::fatal(COMMONERROR_PERMISSION, $this);\r\n return;\r\n //$this->fatal(ERROR_NO_PERMISSION);\r\n }\r\n\r\n $mailerSettings = new MailerSettings($this->_siteID);\r\n $mailerSettingsRS = $mailerSettings->getAll();\r\n\r\n $candidateJoborderStatusSendsMessage = unserialize($mailerSettingsRS['candidateJoborderStatusSendsMessage']);\r\n\r\n $emailTemplates = new EmailTemplates($this->_siteID);\r\n $emailTemplatesRS = $emailTemplates->getAll();\r\n\r\n $this->_template->assign('emailTemplatesRS', $emailTemplatesRS);\r\n $this->_template->assign('candidateJoborderStatusSendsMessage', $candidateJoborderStatusSendsMessage);\r\n $this->_template->assign('active', $this);\r\n $this->_template->assign('subActive', 'Administration');\r\n $this->_template->assign('mailerSettingsRS', $mailerSettingsRS);\r\n $this->_template->assign('sessionCookie', $_SESSION['CATS']->getCookie());\r\n $this->_template->display('./modules/settings/EmailSettings.tpl');\r\n }",
"private function loadForm()\n {\n $this->frm = new BackendForm('settings');\n\n $this->frm->addCheckbox(\n 'show_type_choice',\n $this->get('fork.settings')->get('Members', 'show_type_choice', 0)\n );\n\n $this->frm->addCheckbox(\n 'show_type_choice_as_page',\n $this->get('fork.settings')->get('Members', 'show_type_choice_as_page', 0)\n );\n\n $this->frm->addDropdown(\n 'default_type',\n BackendMembersModel::getMemberTypesForDropdown(),\n $this->get('fork.settings')->get('Members', 'default_type')\n )->setDefaultElement('-');\n\n $this->frm->addCheckbox(\n 'enable_index_page',\n $this->get('fork.settings')->get('Members', 'enable_index_page', 0)\n );\n\n $this->frm->addCheckbox(\n 'enable_email_registration',\n $this->get('fork.settings')->get('Members', 'enable_email_registration', 0)\n );\n\n $this->frm->addCheckbox(\n 'enable_auto_approve_requisites',\n $this->get('fork.settings')->get('Members', 'enable_auto_approve_requisites', 0)\n );\n\n $this->frm->addEditor(\n 'pending_text',\n $this->get('fork.settings')->get('Members', BL::getWorkingLanguage().'_pending_text', null)\n );\n $this->frm->addEditor(\n 'welcome_text',\n $this->get('fork.settings')->get('Members', BL::getWorkingLanguage().'_welcome_text', null)\n );\n\n $this->frm->addText(\n 'sources',\n $this->get('fork.settings')->get('Members', BL::getWorkingLanguage().'_sources', null)\n );\n\n $this->frm->addText(\n 'url_terms',\n $this->get('fork.settings')->get('Members', BL::getWorkingLanguage().'_url_terms', null)\n );\n\n $this->frm->addEditor(\n 'terms_requisites',\n $this->get('fork.settings')->get('Members', BL::getWorkingLanguage().'_terms_requisites', null)\n );\n\n foreach ($this->types as $type) {\n $this->frm->addDropdown(\n 'default_group_'.$type,\n array('-1' => '-') + $this->groups,\n $this->get('fork.settings')->get('Members', 'default_group_'.$type, -1)\n );\n }\n }",
"private function loadForm()\n\t{\n\t\t// init settings form\n\t\t$this->frm = new BackendForm('settings');\n\n\t\t// add fields for meta navigation\n\t\t$this->frm->addCheckbox('meta_navigation', BackendModel::getModuleSetting('pages', 'meta_navigation', false));\n\t}",
"private function loadForm()\n {\n $this->isGod = BackendAuthentication::getUser()->isGod();\n\n $this->frm = new BackendForm('settings');\n\n $this->frm->addText('feather_api_key', $this->get('fork.settings')->get($this->URL->getModule(), 'feather_api_key'), null, 'inputText input-wide', 'inputTextError input-wide');\n\n }",
"private function loadForm()\n {\n $this->frm = new BackendForm('settings');\n\n $this->frm->addCheckbox('enabled', BackendModel::getModuleSetting($this->URL->getModule(), 'enabled', false));\n $this->frm->addCheckbox('log', BackendModel::getModuleSetting($this->URL->getModule(), 'log', true));\n $this->frm->addCheckbox('add_data', BackendModel::getModuleSetting($this->URL->getModule(), 'add_data', true));\n }",
"function mail_options_html() { ?> \n <div class=\"wrap\"> \n <div id=\"icon-tools\" class=\"icon32\"></div> \n <h2>Mail Options</h2> \n <?php settings_errors(); ?> \n <form method=\"post\" action=\"options.php\"> \n <?php \n settings_fields( 'mail_options' ); \n do_settings_sections( 'mail_options' ); \n submit_button(); \n ?> \n </form> \n </div>\n <?php }",
"protected function initFormSettings()\r\n\t{\r\n\t global $lng;\r\n\t\t\r\n\t\tinclude_once('Services/Form/classes/class.ilPropertyFormGUI.php');\r\n\t\t$form = new ilPropertyFormGUI();\r\n\t\t$form->setFormAction($this->ctrl->getFormAction($this));\r\n\t\t$form->setTitle($this->lng->txt('exc_admin_settings'));\r\n\t\t$form->addCommandButton('saveSettings',$this->lng->txt('save'));\r\n\t\t$form->addCommandButton('cancel',$this->lng->txt('cancel'));\r\n\r\n\t\t$exc_set = new ilSetting(\"excs\");\r\n\t\t\r\n\t\t$pd = new ilCheckboxInputGUI($lng->txt(\"to_desktop\"), \"pd\");\r\n\t\t$pd->setInfo($lng->txt(\"exc_to_desktop_info\"));\r\n\t\t$pd->setChecked($exc_set->get(\"add_to_pd\", true));\r\n\t\t$form->addItem($pd);\r\n\r\n\t\treturn $form;\r\n\t}",
"public function init_form_fields()\n {\n $this->form_fields = include 'includes/settings-omnipay.php';\n }",
"public function render_email_settings_field() {\n\t\t\t\t\t\t$settings_field_name = $this->get_settings_field_name();\n\t\t\t\t\t\t$options = get_option( $settings_field_name );\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<input type='text' name='<?php echo $settings_field_name; ?>[email]'\n\t\t\t\t\t\t\t value='<?php echo $options['email']; ?>' class='regular-text'>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t}",
"public function settings_form() {\n //NOTE: store the form definition in separate file, not directly in lib.php!!\n return null;\n }",
"public function showMailOptions()\n\t{\n\t\t/**\n\t\t * @var $ilTabs ilTabsGUI\n\t\t * @var $lng ilLanguage\n\t\t * @var $rbacsystem ilRbacSystem\n\t\t */\n\t\tglobal $ilTabs, $lng, $rbacsystem;\n\n\t\tinclude_once 'Services/Mail/classes/class.ilMailGlobalServices.php';\n\t\tif(!$rbacsystem->checkAccess('internal_mail', ilMailGlobalServices::getMailObjectRefId()))\n\t\t{\n\t\t\t$this->ilias->raiseError($lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);\n\t\t}\n\t\t\n\t\t$lng->loadLanguageModule('mail');\n\t\t\n\t\t$this->__initSubTabs('showMailOptions');\n\t\t$ilTabs->activateTab('mail_settings');\n\n\t\t$this->setHeader();\n\n\t\t$this->initMailOptionsForm();\n\t\t$this->setMailOptionsValuesByDB();\n\n\t\t$this->tpl->setContent($this->form->getHTML());\n\t\t$this->tpl->show();\n\t}",
"function _form_section_mailbox_settings (&$form, &$form_state) {\n \n $form['erpal_crm_mailaction']['mailbox_settings'] = array (\n '#type' => 'fieldset',\n '#title' => t('Mailbox settings'),\n '#tree' => TRUE,\n '#collapsible' => TRUE,\n '#collapsed' => TRUE\n );\n \n $form['erpal_crm_mailaction']['mailbox_settings']['host'] = array (\n '#required' => TRUE,\n '#type' => 'textfield',\n '#title' => t('Host'),\n '#default_value' => Settings::get ('mailbox_settings', 'host', 'localhost'),\n '#size' => 20\n );\n \n $form['erpal_crm_mailaction']['mailbox_settings']['port'] = array (\n '#type' => 'textfield',\n '#required' => TRUE,\n '#title' => t('Port'),\n '#default_value' => Settings::get ('mailbox_settings', 'port', '143'),\n '#size' => 5\n );\n \n $form['erpal_crm_mailaction']['mailbox_settings']['inbox'] = array (\n '#type' => 'textfield',\n '#title' => t('Inbox folder name'),\n '#default_value' => Settings::get ('mailbox_settings', 'name', 'INBOX'),\n '#size' => 20\n );\n \n $form['erpal_crm_mailaction']['mailbox_settings']['tls'] = array (\n '#type' => 'radios',\n '#title' => t('Transport Layer Security'),\n '#options' => array(\n '/tls' => t('TLS'),\n '/notls' => t('No TLS'),\n ),\n '#default_value' => Settings::get ('mailbox_settings', 'tls', '/notls'),\n );\n \n $form['erpal_crm_mailaction']['mailbox_settings']['protocol'] = array (\n '#type' => 'radios',\n '#title' => t('Protocol'),\n '#options' => array(\n '/imap' => t('IMAP'),\n '/pop3' => t('POP3'),\n ),\n '#default_value' => Settings::get ('mailbox_settings', 'protocol', '/imap'),\n );\n \n $form['erpal_crm_mailaction']['mailbox_settings']['ssl'] = array (\n '#type' => 'radios',\n '#title' => t('Secure Sockets Layer'),\n '#options' => array(\n '' => t('No SSL'),\n '/ssl' => t('SSL'),\n ),\n '#default_value' => Settings::get ('mailbox_settings', 'ssl', ''),\n );\n \n $form['erpal_crm_mailaction']['mailbox_settings']['certificate'] = array (\n '#type' => 'radios',\n '#title' => t('Certificate'),\n '#options' => array(\n '/novalidate-cert' => t('Don\\'t validate certificate'),\n '/validate-cert' => t('Validate certificate'),\n ),\n '#default_value' => Settings::get ('mailbox_settings', 'certificate', '/novalidate-cert'),\n );\n \n $form['erpal_crm_mailaction']['mailbox_settings']['username'] = array (\n '#required' => TRUE,\n '#type' => 'textfield',\n '#title' => t('Username'),\n '#default_value' => Settings::get ('mailbox_settings', 'username', ''),\n '#size' => 20\n );\n\n $form['erpal_crm_mailaction']['mailbox_settings']['password'] = array (\n '#type' => 'password_confirm',\n '#size' => 20,\n '#description' => t('Leave blank if you want to use the old passwort setting.'),\n );\n \n return;\n}",
"function Mailer_settings()\n {\n $data = Array();\n //get all mailer settings vars to $data array\n $data = $this->config_model->Mailer_get($data);\n //get additional language constants for view\n $data = $this->config_model->add_panel_vars_ex($data,\"mailer_settings\");\n //load the view and pass there $data\n $res = $this->load->view(\"/admin/config/mailer_settings\", $data, true);\n make_response(\"output\", $res, 1);\n }",
"private function display_form(){\n\t\t$global_settings = $this->settings;\n\t\tinclude( FrmRegAppHelper::path() . '/views/global_settings.php' );\n\t}",
"public function load() {\n\t\t$this -> template = TemplateManager::load(\"EmailPreference\");\n\t\t$this -> template -> insert(\"email\", $this -> user -> getEmail());\n\t\t$this -> display();\n\t}",
"private function _initGeneralSettingsForm()\n\t{\n\t\tglobal $txt, $context;\n\n\t\t// Instantiate the form\n\t\t$this->_generalSettingsForm = new Settings_Form(Settings_Form::DB_ADAPTER);\n\n\t\t$config_vars = array(\n\t\t\tarray('select', 'sp_portal_mode', explode('|', $txt['sp_portal_mode_options'])),\n\t\t\tarray('check', 'sp_maintenance'),\n\t\t\tarray('text', 'sp_standalone_url'),\n\t\t\t'',\n\t\t\tarray('select', 'portaltheme', $context['SPortal']['themes']),\n\t\t\tarray('check', 'sp_disableColor'),\n\t\t\tarray('check', 'sp_disableForumRedirect'),\n\t\t\tarray('check', 'sp_disable_random_bullets'),\n\t\t\tarray('check', 'sp_disable_php_validation', 'subtext' => $txt['sp_disable_php_validation_desc']),\n\t\t\tarray('check', 'sp_disable_side_collapse'),\n\t\t\tarray('check', 'sp_resize_images'),\n\t\t\tarray('check', 'sp_disableMobile'),\n\t\t);\n\n\t\t$this->_generalSettingsForm->setConfigVars($config_vars);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Allows filterng of the current property maifest and then returns a new PropertyCollection with the filtered properties. It does not update the current manifest. | public function filter(string $property, ?string $value, bool $strict = false): PropertyCollection {
$filtered = [];
foreach ($this->_manifest as $item) {
if (
($strict === true && $item->{$property}->value === $value)
|| ($strict === false && strpos($item->{$property}->value, $value) !== false)
) {
$filtered[] = $item;
}
}
return new PropertyCollection($filtered);
} | [
"protected function propertiesFilter()\n {\n return ReflectionProperty::IS_PUBLIC | ReflectionProperty::IS_PROTECTED | ReflectionProperty::IS_PRIVATE;\n }",
"protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel('bs_tc/family_attribute_collection')\n ->addVisibleFilter();\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }",
"public function getFilterableAttributes()\n {\n $collection = parent::getFilterableAttributes();\n\n if ($collection instanceof Mage_Catalog_Model_Resource_Product_Attribute_Collection) {\n // Prealoads all needed attributes at once\n $attrUrlKeyModel = Mage::getResourceModel('md_seo/attribute_urlkey');\n $attrUrlKeyModel->preloadAttributesOptions($collection);\n }\n\n return $collection;\n }",
"public function filterPropertyBags(string ...$properties) {\n // $properties not validated here as they are validated through the\n // $package->filterPropertyBags functions.\n\n foreach ($this->_manifest as $package) {\n call_user_func_array([$package, 'filterPropertyBag'], $properties);\n }\n\n return $this;\n }",
"public function getFilterPropertyList()\n {\n return $this->arFilterPropertyList;\n }",
"protected function _prepareCollection()\r\n {\r\n $collection = Mage::getResourceModel('mageplaza_betterblog/post_attribute_collection')\r\n ->addVisibleFilter();\r\n $this->setCollection($collection);\r\n return parent::_prepareCollection();\r\n }",
"public function getFilters($property)\n\t{\n\t\t$filters = new Zend_Filter();\n\t\t\n\t\t// Return if no requirements are set for this property\n\t\tif (!array_key_exists($property, $this->_requirements)) return $filters;\n\t\t\n\t\tforeach ($this->_requirements[$property] as $requirement => $options) {\n\t\t\t// continue if requirement does not exist or is not a filter requirement\n\t\t\t$filter = Shanty_Mongo::getRequirement($requirement, $options);\n\t\t\tif (!$filter || !($filter instanceof Zend_Filter_Interface)) continue;\n\t\t\t\n\t\t\t$filters->addFilter($filter);\n\t\t}\n\t\t\n\t\treturn $filters;\n\t}",
"protected function _prepareCollection()\r\n {\r\n $collection = Mage::getResourceModel('catalog/category_attribute_collection')\r\n ->addFieldToFilter('is_user_defined',1)\r\n ;\r\n $this->setCollection($collection);\r\n\r\n return parent::_prepareCollection();\r\n }",
"protected function _getFilteredFormAttributeCollection()\n {\n $this->_allowedAttributes = $this->_systemAttributes = [];\n\n $collection = $this->_getFormAttributeCollection()\n ->addAttributeGrouping()\n ->setSortOrder();\n\n if ($this->_ignoreInvisible) {\n if ($this->_store) {\n $collection->addStoreFilter($this->_store->getId());\n }\n\n if ($this->getCustomerGroupId() !== null) {\n $collection->addCustomerGroupFilter($this->getCustomerGroupId());\n }\n\n if ($this->getShippingMethod() !== null) {\n $collection->addShippingMethodsFilter($this->getShippingMethod());\n }\n }\n\n return $collection;\n }",
"protected function _prepareCollection()\n\t{\n\t\t\n\t\t$vendor_id=Mage::getSingleton('customer/session')->getVendorId();\n\t\t$table = \"ced_vendor_product_attributes\";\n \t\t$tableName = Mage::getSingleton(\"core/resource\")->getTableName($table);\n \t\t$collection = Mage::getResourceModel('catalog/product_attribute_collection')\n \t\t\t\t\t ->addVisibleFilter();\n \t\t$collection->getSelect()\n \t\t\t\t\t->join($tableName,'main_table.attribute_id = '.$tableName.'.attribute_id', array('*'=> '*'));\n\t\t$collection->addFieldToFilter('vendor_id',$vendor_id);\n\t\t\n\t\t$this->setCollection($collection);\n\t\treturn parent::_prepareCollection();\n\t}",
"public function getAppliedProperties(){\n \t\t\treturn $this->properties()->with('photos')\n ->where('type',\n Property::TYPE_APPLICATION)->where('espera', 0)\n \t\t\t\t->orderBy('id', 'ASC')->join('postulates', \"users_has_properties.id\", \"=\", \"postulates.id\")->get();\n }",
"public function getFilterableList()\n {\n return new aiiPersistentObjectFilterablePropertyList( $this->poDef, ezcDbSchema::createFromDb( ezcDbInstance::get( ) ) );\n }",
"public function getFilterableProperties() {\n if (!isset($this->filterableProperties)) {\n return [];\n }\n\n return $this->filterableProperties;\n }",
"public function getProperties(): PropertiesCollection;",
"public function getpropertycollection() {\n /**\n * get Collection for the 'catalog/product' with add attribute filer as 'type_id'\n * And add the select feild Values such as,\n * 'image'\n * 'userid'\n * 'bedtype'\n * 'name'\n * 'Price'\n * 'description'\n * 'short_description'\n * 'propertytype'\n * 'amenity'\n * 'totalrooms'\n * 'propertyadd'\n * 'privacy'\n * 'status'\n * 'city'\n * 'statee'\n * 'country'\n * 'cancelpolicy'\n * 'pets'\n * 'maplocation'\n * 'accomodates'\n * 'propertyapproved'\n */\n return Mage::getModel ( 'catalog/product' )->getCollection ()->setDisableFlat ( true )->addAttributeToFilter ( 'type_id', array (\n 'eq' => 'property' \n ) )->addAttributeToSelect ( 'image' )->addAttributeToSelect ( 'userid' )->addAttributeToSelect ( 'bedtype' )->addAttributeToSelect ( 'name' )->addAttributeToSelect ( 'price' )->addAttributeToSelect ( 'description' )->addAttributeToSelect ( 'short_description' )->addAttributeToSelect ( 'propertytype' )->addAttributeToSelect ( 'amenity' )->addAttributeToSelect ( 'totalrooms' )->addAttributeToSelect ( 'propertyadd' )->addAttributeToSelect ( 'privacy' )->addAttributeToSelect ( 'status' )->addAttributeToSelect ( 'city' )->addAttributeToSelect ( 'state' )->addAttributeToSelect ( 'country' )->addAttributeToSelect ( 'cancelpolicy' )->addAttributeToSelect ( 'pets' )->addAttributeToSelect ( 'maplocation' )->addAttributeToSelect ( 'accomodates' )->addAttributeToSelect ( 'propertyapproved' );\n }",
"protected function getProductAttributesCollection() {\n $collection = Mage::getResourceModel( 'catalog/product_attribute_collection' );\n $collection->addFilter( 'is_visible', 1 );\n return $collection;\n }",
"public function getPropertiesWithoutManager()\n {\n\n $user = auth()->user();\n\n $userPropertiesWithOutManager = Property::with('information')->whereHas('information', function ($query) use ($user) {\n $query->where('user_id', $user->id)->where('manager_id', null);\n })->latest()->get();\n\n return new MinimalPropertyCollection($userPropertiesWithOutManager);\n }",
"public function filter()\n\t{\n\t\t$filters = $this->getFilterCollection()->getAll();\n\t\t$value = $this->getValue();\n\n\t\tforeach ($filters as $f => $obj)\n\t\t{\n\t\t\t$value = $obj->filter($value);\n\t\t}\n\n\t\t$this->setValue($value);\n\t\treturn $value;\n\t}",
"public function getProductPropertyList($arPropertySetList, $obProductList = null) : FilterPropertyCollection\n {\n //Get property set list\n $obPropertySetList = PropertySetCollection::make()->sort()->code($arPropertySetList);\n\n return $obPropertySetList->getProductPropertyCollection($obProductList);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Provides an appropriate stride to use This method provides a stride value that will respect all alignment requirements of the accelerated imagerendering code within cairo. | public static function strideForWidth(int $format, int $width): int {} | [
"public function getStride(){}",
"public static function strideForWidth($format, $width){}",
"public function GetDrawWidth()\n {\n $volumeCount = $this->VolumeCount();\n\n return\n LEFT_MARGIN +\n INSTANCE_WIDTH +\n ($volumeCount * (VOLUME_GAP + VOLUME_WIDTH)) +\n RIGHT_MARGIN;\n }",
"public function getSizeFactor(){\n\t\treturn $this->rx / $this->xBound + $this->ry / $this->yBound;\n\t}",
"function GetNextLargerSize(wxOrientation $direction, wxOrientation $direction, wxSize $relative_to){}",
"function GetNextSmallerSize(wxOrientation $direction, wxOrientation $direction, wxSize $relative_to){}",
"public function stdWrap_wrapAlignDataProvider() {}",
"function LogicalToDeviceYRel($y){}",
"public function calculateWithIndexData()\n {\n $this->checkThatKernelExists();\n\n $this->IndexData[-1] = 0;\n $maxDiff = $this->Kernel->width()/2;\n\n for ($i = 0; $i < $this->Length; ++$i) {\n $upper = 0;\n $lower = 0;\n\n foreach ($this->deltasToRespect($i, $maxDiff) as $deltaIndex => $delta) {\n $kernelFactor = $this->Kernel->at($delta);\n $indexDelta = $this->IndexData[$i + $deltaIndex] - $this->IndexData[$i + $deltaIndex - 1];\n $upper += $kernelFactor * $indexDelta * $this->Data[$i + $deltaIndex];\n $lower += $kernelFactor * $indexDelta;\n }\n\n if ($lower == 0) {\n $this->MovingAverage[] = $this->Data[$i];\n } else {\n $this->MovingAverage[] = $upper / $lower;\n }\n }\n }",
"protected function encodePixelAspectRatio(): string\n {\n return pack('C', $this->source->getPixelAspectRatio());\n }",
"protected function setDensities()\n\t{\n\t\t$size = $this->imagine->open($this->imagePath)->getSize();\n $width = $size->getWidth();\t\t\n $height = $size->getHeight();\t\t\n $ratio = $width/$height;\n \n\t if ($this->referenceWidth == self::REFERENCE_WIDTH_UNDEFINED && self::REFERENCE_HEIGHT_UNDEFINED == $this->referenceHeight) {\n\t\t\t$this->referenceWidth = $width;\t\t\t\n\t\t\t$this->referenceHeight = $height;\n\t\t} elseif (self::REFERENCE_WIDTH_UNDEFINED == $this->referenceWidth) {\n\t\t $this->referenceWidth = $this->referenceHeight*$ratio;\n\t\t} elseif (self::REFERENCE_HEIGHT_UNDEFINED == $this->referenceHeight) {\n\t\t $this->referenceHeight = $this->referenceWidth/$ratio;\n }\t\t\n\t\t\n\t\tif (self::BITMAP_TYPE_REGULAR == $this->bitmapType) {\t\t\n\t\t $this->densities[self::DENSITY_MDPI] = array($this->referenceWidth/3, $this->referenceHeight/3);\n\t\t $this->densities[self::DENSITY_HDPI] = array($this->referenceWidth/2, $this->referenceHeight/2);\n\t\t $this->densities[self::DENSITY_XHDPI] = array($this->referenceWidth*2/3, $this->referenceHeight*2/3);\n\t\t $this->densities[self::DENSITY_XXHDPI] = array($this->referenceWidth, $this->referenceHeight);\n\t\t} else {\n\t\t $this->densities[self::DENSITY_MDPI] = array($this->referenceWidth/4, $this->referenceHeight/4);\n\t\t $this->densities[self::DENSITY_HDPI] = array($this->referenceWidth*3/8, $this->referenceHeight*3/8);\n\t\t $this->densities[self::DENSITY_XHDPI] = array($this->referenceWidth/2, $this->referenceHeight/2);\n\t\t $this->densities[self::DENSITY_XXHDPI] = array($this->referenceWidth*3/4, $this->referenceHeight*3/4);\n\t\t $this->densities[self::DENSITY_XXXHDPI] = array($this->referenceWidth, $this->referenceHeight);\n\t\t}\n\t}",
"abstract protected function getWidthOptions();",
"private function layout_4c()\n {\n $ret = array();\n \n $h0 = ($this->width - 2*$this->padding - 2*$this->border_width -\n ($this->padding + 2*$this->border_width) *\n (1 - (2/(1/$this->ratios[3] + 1/$this->ratios[2] + 1/$this->ratios[1])))) / \n ($this->ratios[0] + (1/(1/$this->ratios[3] + 1/$this->ratios[2] + 1/$this->ratios[1])));\n $h1 = ($h0 - 2*$this->padding - 4*$this->border_width) /\n ($this->ratios[1]*(1/$this->ratios[3] + 1/$this->ratios[2]) + 1);\n $h3 = $h1 * $this->ratios[1] / $this->ratios[3];\n $h2 = $h0 - $h1 - $h3 - 2*$this->padding - 4*$this->border_width;\n \n $ret[1] = array(\n 'w' => round( $this->ratios[1] * $h1 ),\n 'h' => round( $h1 ),\n 'x' => $this->padding + $this->border_width,\n 'y' => $this->padding + $this->border_width\n );\n \n $ret[3] = array(\n 'w' => $ret[1]['w'],\n 'h' => round( $h3 ),\n 'x' => $ret[1]['x'],\n 'y' => $ret[1]['y'] + $ret[1]['h'] + $this->padding + 2*$this->border_width,\n );\n \n $ret[2] = array(\n 'w' => $ret[1]['w'],\n 'h' => round( $h2 ),\n 'x' => $ret[1]['x'],\n 'y' => $ret[3]['y'] + $ret[3]['h'] + $this->padding + 2*$this->border_width,\n );\n \n $ret[0] = array(\n 'w' => $this->width - $ret[1]['w'] - 3*$this->padding - 4*$this->border_width,\n 'h' => $ret[1]['h'] + $ret[3]['h'] + $ret[2]['h'] + 2*$this->padding + 4*$this->border_width,\n 'x' => $ret[1]['x'] + $ret[1]['w'] + $this->padding + 2*$this->border_width,\n 'y' => $ret[1]['y']\n );\n \n return $ret;\n }",
"protected function canvasSpacingY()\n {\n $this->canvas['spacing']['y'] = 0;\n\n if ($this->intermediate['height'] < $this->canvas['height']) {\n\n $difference = $this->canvas['height'] - $this->intermediate['height'];\n\n if ($difference % 2 === 0) {\n $this->canvas['spacing']['y'] = $difference / 2;\n } else {\n if ($difference > 1) {\n $this->canvas['spacing']['y'] = ($difference - 1) / 2 + 1;\n } else {\n $this->canvas['spacing']['y'] = 1;\n }\n }\n }\n }",
"function _calcDelta()\n {\n if ($this->_axisValueSpan == 0) {\n $this->_delta = false;\n } elseif ($this->_type == IMAGE_GRAPH_AXIS_X) {\n $this->_delta = (($this->_transpose ? $this->height() : $this->width()) - ($this->_axisPadding['low'] + $this->_axisPadding['high'])) / ($this->_axisValueSpan + ($this->_pushValues ? 1 : 0));\n } else {\n $this->_delta = (($this->_transpose ? $this->width() : $this->height()) - ($this->_axisPadding['low'] + $this->_axisPadding['high'])) / ($this->_axisValueSpan + ($this->_pushValues ? 1 : 0));\n }\n }",
"public function derivatives($min_width, $max_width = 2500, $step = 200);",
"public function im2col2d(\n bool $reverse,\n Buffer $images,\n int $images_offset,\n int $images_size,\n int $batches,\n int $im_h,\n int $im_w,\n int $channels,\n int $kernel_h,\n int $kernel_w,\n int $stride_h,\n int $stride_w,\n bool $padding,\n bool $channels_first,\n int $dilation_h,\n int $dilation_w,\n bool $cols_channels_first,\n Buffer $cols,\n int $cols_offset,\n int $cols_size,\n EventList $events=null, EventList $waitEvents=null\n )\n {\n $dtype = $images->dtype();\n if($dtype!=$cols->dtype()) {\n throw new InvalidArgumentException(\"Unmatch data type images and cols:\".\n $this->dtypeToString($dtype).\",\".$this->dtypeToString($cols->dtype()));\n }\n if($dtype==NDArray::float64) {\n $this->assertFP64();\n }\n\n $output_h = intval(floor(($im_h-($kernel_h-1)*$dilation_h-1)/$stride_h)+1);\n $output_w = intval(floor(($im_w-($kernel_w-1)*$dilation_w-1)/$stride_w)+1);\n if($padding) {\n $pad_h = (int)floor((($im_h-1)*$stride_h-$im_h+($kernel_h-1)*$dilation_h+1)/2);\n $pad_w = (int)floor((($im_w-1)*$stride_w-$im_w+($kernel_w-1)*$dilation_w+1)/2);\n $output_h = $im_h;\n $output_w = $im_w;\n } else {\n $pad_h = $pad_w = 0;\n }\n if($channels_first) {\n $channel_mode = 'cf';\n } else {\n $channel_mode = 'cl';\n }\n if($cols_channels_first) {\n $cols_mode = 'cf';\n } else {\n $cols_mode = 'cl';\n }\n if($reverse) {\n $tmode = 'R';\n } else {\n $tmode = 'F';\n }\n $type = $this->dtypeToOpenCLType[$dtype];\n $kernel_name = \"im2col2d_{$tmode}_{$type}_{$channel_mode}_{$cols_mode}\";\n if(!isset($this->sources[$kernel_name])) {\n if($channels_first) {\n $input_id = '(((batch_id*channels+channel_id)*im_h+input_y)*im_w+input_x)';\n } else {\n $input_id = '(((batch_id*im_h+input_y)*im_w+input_x)*channels+channel_id)';\n }\n if($cols_channels_first) {\n $cols_id = '(((((batch_id*output_h+im_y)*output_w+im_x)'.\n '*channels+channel_id)*kernel_h+kernel_y)*kernel_w+kernel_x)';\n } else {\n $cols_id = '(((((batch_id*output_h+im_y)*output_w+im_x)'.\n '*kernel_h+kernel_y)*kernel_w+kernel_x)*channels+channel_id)';\n }\n $input_y = '(im_y*stride_h+kernel_y*dilation_h-pad_h)';\n $input_x = '(im_x*stride_w+kernel_x*dilation_w-pad_w)';\n if($reverse) {\n $col_arg_type = 'const global';\n $im_arg_type = '__global';\n $this->sources[$kernel_name] =\n \"__kernel void {$kernel_name}(\\n\".\n \" $im_arg_type {$type} * images,\\n\".\n \" const uint offset_images,\\n\".\n \" $col_arg_type {$type} * cols,\\n\".\n \" const uint offset_cols,\\n\".\n \" const uint batches,\\n\".\n \" const uint im_h,\\n\".\n \" const uint im_w,\\n\".\n \" const uint channels,\\n\".\n \" const uint kernel_h,\\n\".\n \" const uint kernel_w,\\n\".\n \" const uint stride_h,\\n\".\n \" const uint stride_w,\\n\".\n \" const uint pad_h,\\n\".\n \" const uint pad_w,\\n\".\n \" const uint dilation_h,\\n\".\n \" const uint dilation_w,\\n\".\n \" const uint output_h,\\n\".\n \" const uint output_w\\n\".\n \" )\\n\".\n \"{\\n\".\n \" const uint gid0 = get_global_id(0);\\n\".\n \" const uint gid1 = get_global_id(1);\\n\".\n $this->splitPointer('channel_id','input_x','gid0','channels').\n $this->splitPointer('input_y','batch_id','gid1','im_h').\n //\" const uint kernel_idx = {$kernel_idx};\\n\".\n //\" const uint kernel_y = kernel_idx/kernel_w;\\n\".\n //\" const uint kernel_x = kernel_idx%kernel_w;\\n\".\n \" if(input_x<im_w && batch_id<batches){\\n\".\n \" {$type} value=0;\\n\".\n \" for(int kernel_y=0;kernel_y<kernel_h;kernel_y++) {\".\n \" for(int kernel_x=0;kernel_x<kernel_w;kernel_x++) {\".\n \" const int tmp_y = input_y-kernel_y*dilation_h+pad_h;\\n\".\n \" const int tmp_x = input_x-kernel_x*dilation_w+pad_w;\\n\".\n \" const int im_y = tmp_y/stride_h;\\n\". // div5bug\n \" const int im_x = tmp_x/stride_w;\\n\". // div5bug\n \" if(tmp_y%stride_h==0 && tmp_x%stride_w==0 &&\\n\". // div5bug\n \" im_y>=0 && im_y<output_h && im_x>=0 && im_x<output_w) {\\n\".\n \" value += cols[{$cols_id}];\\n\".\n \" }\\n\".\n \" }\\n\".\n \" }\\n\".\n \" images[{$input_id}] += value;\\n\".\n \" }\\n\".\n \"}\\n\";\n } else {\n $im_arg_type = 'const global';\n $col_arg_type = '__global';\n $this->sources[$kernel_name] =\n \"__kernel void {$kernel_name}(\\n\".\n \" $im_arg_type {$type} * images,\\n\".\n \" const uint offset_images,\\n\".\n \" $col_arg_type {$type} * cols,\\n\".\n \" const uint offset_cols,\\n\".\n \" const uint batches,\\n\".\n \" const uint im_h,\\n\".\n \" const uint im_w,\\n\".\n \" const uint channels,\\n\".\n \" const uint kernel_h,\\n\".\n \" const uint kernel_w,\\n\".\n \" const uint stride_h,\\n\".\n \" const uint stride_w,\\n\".\n \" const uint pad_h,\\n\".\n \" const uint pad_w,\\n\".\n \" const uint dilation_h,\\n\".\n \" const uint dilation_w,\\n\".\n \" const uint output_h,\\n\".\n \" const uint output_w\\n\".\n \" )\\n\".\n \"{\\n\".\n \" const uint gid0 = get_global_id(0);\\n\".\n \" const uint gid1 = get_global_id(1);\\n\".\n $this->splitPointer('channel_id','im_x','gid0','channels').\n $this->splitPointer('im_y','batch_id','gid1','output_h').\n \" if(im_x<output_w && batch_id<batches){\\n\".\n \" for(uint kernel_y=0;kernel_y<kernel_h;kernel_y++) {\\n\".\n \" for(uint kernel_x=0;kernel_x<kernel_w;kernel_x++) {\\n\".\n \" int input_y = {$input_y};\\n\".\n \" int input_x = {$input_x};\\n\".\n \" {$type} value;\\n\".\n \" if(input_y>=0 && input_y<im_h && input_x>=0 && input_x<im_w) {\\n\".\n \" uint input_id = {$input_id};\\n\".\n \" value = images[input_id];\\n\".\n \" } else {\\n\".\n \" value = 0;\\n\".\n \" }\\n\".\n \" uint cols_id = {$cols_id};\\n\".\n \" cols[cols_id] = value;\\n\".\n \" }\\n\".\n \" }\\n\".\n \" }\\n\".\n \"}\\n\";\n }\n }\n $kernel = $this->createKernel($kernel_name);\n $kernel->setArg(0,$images);\n $kernel->setArg(1,$images_offset,NDArray::uint32);\n $kernel->setArg(2,$cols);\n $kernel->setArg(3,$cols_offset,NDArray::uint32);\n $kernel->setArg(4,$batches,NDArray::uint32);\n $kernel->setArg(5,$im_h,NDArray::uint32);\n $kernel->setArg(6,$im_w,NDArray::uint32);\n $kernel->setArg(7,$channels,NDArray::uint32);\n $kernel->setArg(8,$kernel_h,NDArray::uint32);\n $kernel->setArg(9,$kernel_w,NDArray::uint32);\n $kernel->setArg(10,$stride_h,NDArray::uint32);\n $kernel->setArg(11,$stride_w,NDArray::uint32);\n $kernel->setArg(12,$pad_h,NDArray::uint32);\n $kernel->setArg(13,$pad_w,NDArray::uint32);\n $kernel->setArg(14,$dilation_h,NDArray::uint32);\n $kernel->setArg(15,$dilation_w,NDArray::uint32);\n $kernel->setArg(16,$output_h,NDArray::uint32);\n $kernel->setArg(17,$output_w,NDArray::uint32);\n if($reverse) {\n $global_work_size = [$this->ceil($im_w*$channels,4),$this->ceil($batches*$im_h,8)];\n $local_work_size = [4,8];\n } else {\n $global_work_size = [$this->ceil($output_w*$channels,4),$this->ceil($batches*$output_h,8)];\n $local_work_size=[4,8];\n //$global_work_size = [$output_w*$channels,$batches*$output_h];\n //$local_work_size=null;\n }\n $kernel->enqueueNDRange($this->queue,$global_work_size,$local_work_size,null,\n $events,$waitEvents);\n }",
"protected function intermediateSizeLandscape()\n {\n // Set width and then calculate height\n $this->intermediate['width'] = $this->canvas['width'];\n $this->intermediate['height'] = intval(round(\n $this->intermediate['width'] / $this->source['aspect_ratio'], 0));\n\n // If height larger than requested, set and calculate new width\n if ($this->intermediate['height'] > $this->canvas['height']) {\n $this->intermediate['height'] = $this->canvas['height'];\n $this->intermediate['width'] = intval(round(\n $this->intermediate['height'] * $this->source['aspect_ratio'], 0));\n }\n }",
"public function getMaxPairWidth(){\n\t\treturn $this->intMaxPairWidth + 20;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load cache data matching the meta | protected function loadCacheData($meta = [])
{
$data = null;
if ($this->cache()) {
$cacheKey = $this->createKey($meta);
$data = Pi::service('cache')->getItem($cacheKey, $this->namespace);
if (null !== $data) {
$data = json_decode($data, true);
}
}
return $data;
} | [
"abstract protected function loadCacheData();",
"private function loadCacheMetaData()\n {\n if (isset($this->metaData)) {\n return;\n }\n\n $metaFile = $this->cacheDirectory . '/cache.meta';\n $this->metaData = array();\n\n if (file_exists($metaFile)) {\n $this->metaData = unserialize(file_get_contents($metaFile));\n }\n }",
"protected function loadMeta()\n\t{\n\t\t$cache = $this->getCache('meta');\n\t\t$meta = $cache->getData();\n\t\tif($cache->isStale())\n\t\t{\n\t\t\t$meta = self::getMetaInfo($this->getPath());\n\t\t\t$cache->storeData($meta);\n\t\t}\n\n\t\tif(isset($meta['php']))\n\t\t{\n\t\t\t$this->phpRequirements = $meta['php'];\n\t\t\tunset($meta['php']);\n\t\t}else{\n\t\t\t$this->phpRequirements = array();\n\t\t}\n\n\t\t$version = new Version();\n\t\tif($version->fromString(isset($meta['version']) ? $meta['version'] : '0 Alpha'))\n\t\t\t$this->packageVersion = $version;\n\n\t\t$this->meta = $meta;\n\t}",
"private function loadMeta()\n {\n $dir = dirname($this->path);\n $fileName = basename($this->path);\n\n $metaFile = $dir . '/' . $fileName . '.meta';\n\n if (file_exists($metaFile) === true) {\n if (@$metaData = file_get_contents($metaFile)) {\n $meta = @unserialize($metaData);\n\n // Do no throw when encountering cache files from a previous version that may be invalid now.\n if (isset($meta['modified']) === false || isset($meta['dataType']) === false) {\n return;\n }\n\n $this->dataType = $meta['dataType'];\n $this->dateTime = new \\DateTime($meta['modified']);\n }\n }\n }",
"private function _get_cache_data()\n {\n $key = $this->_cache_key();\n $data = self::$_cache->get($key);\n if ($data) {\n // hit\n $this->_data = $data;\n } else {\n // not hit\n $this->_fetch_db_data();\n // self::$_cache->set($key, ??);\n }\n }",
"protected function load()\n {\n // See if we can get the item from cache\n $this->data = wp_cache_get($this->cacheKey, $this->cacheGroup);\n // If there's nothing, load the data from DB and cache it\n if ($this->data === false) {\n $this->loadFromDatabase();\n wp_cache_set($this->cacheKey, $this->data, $this->cacheGroup, $this->cacheTime);\n }\n\n // Run possible user conversion\n $this->afterLoadingCache();\n }",
"private function cacheFetch() {\n //$data = cache_get($this->id, 'cache');;\n $data = NULL;\n if ($data) {\n foreach ($this->properties as $prop) {\n if (isset($data->data[$prop]) && !empty($data->data[$prop])) {\n $this->$prop = $data->data[$prop];\n }\n }\n }\n }",
"public function loadCacheData() {\n $entityRepository = $this->getEntityRepository();\n $locations = $entityRepository->getLocationsForEveryApplication();\n\n $locationsToCache = array();\n if($locations) {\n foreach ($locations as $location) {\n $locationToCache = new LocationTaxonomyCache();\n $locationToCache->setLocationTaxonomyId($location->getLocationTaxonomyId());\n if($location->getParent())\n $locationToCache->setParentId($location->getParent()->getLocationTaxonomyId());\n $locationToCache->setSlug($location->getSlug());\n $locationToCache->setApplication($location->getApplication());\n\n $locationsToCache[] = $locationToCache;\n }\n }\n\n $this->getCacheAdapter()->setItem(self::LOCATIONS_CACHE_KEY, $locationsToCache);\n }",
"private function\n\tfetchDataFromCache (): void\n\t{\n\t\t$this -> body = file_get_contents ($this -> filename);\n\t\t$this -> source = 'cache';\n\t}",
"protected function __load_cache() {\n\t\tif (!$this->cache_loaded && class_exists('Cache')) {\n\t\t\tif (Kohana::$profiling === TRUE) $benchmark = Profiler::start(str_replace('_', '/', strtolower(get_called_class())), __FUNCTION__);\n\t\t\t// register shutdown function to save back cache data\n\t\t\tregister_shutdown_function(array(\n\t\t\t\t\t$this,\n\t\t\t\t\t'__unload_cache'\n\t\t\t));\n\t\t\t$c = null;\n\t\t\tif ( Kohana::$environment != Kohana::DEVELOPMENT ) {\n\t\t\t\t$c = Cache::instance()->get($this->name(), null);\n\t\t\t}\n\t\t\t\t\n\t\t\tif ($c === null) {\n\t\t\t\t$c = array();\n\t\t\t\t$this->changed(true);\n\t\t\t}\n\t\t\t\t\n\t\t\t// store data\n\t\t\t$this->cache($c);\n\t\t\t$this->cache_loaded = true;\n\t\t\tif (isset($benchmark)) Profiler::stop($benchmark);\n\t\t}\n\t}",
"protected function _getCache() {\n $values = array();\n $query = \"SELECT expiration, data FROM data_cache WHERE \";\n foreach($this->key as $col => $val) {\n $values[] = $col;\n $values[] = $val;\n $query .= \"%s = '%s' AND \";\n }\n $query = substr($query, 0, -4);\n $query .= 'LIMIT 1';\n\n $cachedData = db_fetch_object(db_query($query, $values));\n if($cachedData) {\n $this->expiration = $cachedData->expiration;\n $this->data = gzuncompress($cachedData->data);\n }\n }",
"protected function loadCache()\n\t{\n\t\trequire $this->cacheFilePathInfo['dirname'] . '/' . $this->cacheFilePathInfo['basename'];\n\t}",
"public function loadCache() {\n\t\tif ($this->tags !== null) return;\n\n\t\t// get cache\n\t\tWCF::getCache()->addResource($this->cacheName, WCF_DIR.'cache/cache.tagCloud-'.PACKAGE_ID.'-'.StringUtil::getHash(implode(',', $this->languageIDArray)).'.php', WCF_DIR.'lib/system/cache/CacheBuilderTagCloud.class.php', 0, 86400);\n\t\t$this->tags = WCF::getCache()->get($this->cacheName);\n\t}",
"private function _loadCache()\r\n\t{\r\n\t\t$filePath = $this->_getCacheFilePath();\r\n\t\tif(!file_exists($filePath))\r\n\t\t\tfile_put_contents($filePath, serialize(array()));\r\n\t\t\r\n\t\t$this->_cache = unserialize(file_get_contents($filePath));\r\n\t}",
"private function loadFromCache()\n {\n return Nette\\Environment::getCache(self::CACHE_NAMESPACE)->load($this->getCacheKey());\n }",
"private function loadCache()\n {\n if (file_exists($this->cacheLocation)) {\n $this->classCache = unserialize(file_get_contents($this->cacheLocation));\n }\n }",
"function readCache() {\n $this->cache_data = ($this->cache->get('Core7_Scripts2020_cache',-1,'',$this->cache_secret_key,$this->cache_secret_iv))?:[];\n }",
"private function _loadCache() {\n \n if(file_exists($this->filePath)){//cache file exists, load its contents\n \n //read the contents in the file\n $fileContents = file_get_contents($this->filePath);\n \n //recreate the cache object\n $cacheObject = unserialize($fileContents);\n \n }else{//no cache file\n\n //cache the live data\n $cacheObject = $this->_cache();\n \n }\n \n //load the cache object\n $this->cache = $cacheObject;\n \n }",
"private function load()\n {\n if (!$this->is_on()) {\n return;\n }\n\n $data = persistent_cache_get(array('SELF_LEARNING_CACHE', $this->bucket_name));\n if ($data !== null) {\n $this->data = $data;\n } elseif (is_file($this->path)) {\n $_data = cms_file_get_contents_safe($this->path);\n if ($_data !== false) {\n $this->data = @unserialize($_data);\n if ($this->data === false) {\n $this->invalidate(); // Corrupt\n }\n } else {\n $dir = get_custom_file_base() . '/caches/self_learning';\n if (!is_dir($dir)) {\n require_code('files2');\n make_missing_directory($dir);\n }\n\n $this->data = null;\n }\n }\n\n $this->empty = empty($this->data);\n\n if ($this->data !== null) {\n $this->keys_initial = array_flip(array_keys($this->data));\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Declaration for the base controller creator. Each creator should be described in specific Controller | abstract function createController(); | [
"public function createController(){\n\t\t$this->controller = new CunddController('initOnly');\n\t}",
"abstract protected function getController();",
"protected function createController()\n\t{\n\t\t$this->createParentControllerIfNotExists();\n\n\t\t$this->create('Controller', $this->data->get('controller.path'), [\n\t\t\t'name' => $this->data->get('controller.name'),\n\t\t\t'namespace' => $this->data->get('controller.namespace'),\n\t\t\t'parent' => $this->data->get('base_controller.name'),\n\t\t\t'parent_namespaced' => $this->data->get('base_controller.namespaced'),\n\t\t]);\n\t}",
"protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $this->call('make:controller', array_filter([\n 'module' => $this->getModule()['key'],\n 'name' => \"{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $this->argument('name') : null,\n '--api' => $this->option('api'),\n '--querybuilder' => $this->option('querybuilder')\n ]));\n }",
"protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call('crud:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => $this->option('api'),\n '--requests' => $this->option('requests') || $this->option('all'),\n '--path' => $this->option('viewPath') ? $this->getPathForControlller() : $this->getView(),\n ]));\n }",
"private function makeController()\n {\n new MakeController($this, $this->files);\n }",
"protected function _controllers()\n {\n $this['WatchController'] = function ($container) {\n return new Controller\\WatchController($container['app'], $container['watchFunctions']);\n };\n\n $this['RunController'] = function ($container) {\n return new Controller\\RunController($container['app'], $container['profiles'], $container['watchFunctions']);\n };\n\n $this['CustomController'] = function ($container) {\n return new Controller\\CustomController($container['app'], $container['profiles']);\n };\n\n $this['waterfallController'] = function ($container) {\n return new Xhgui_Controller_Waterfall($container['app'], $container['profiles']);\n };\n\n $this['importController'] = function ($container) {\n return new Xhgui_Controller_Import($container['app'], $container['saverMongo']);\n };\n }",
"public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }",
"protected function createController()\n {\n $controller = studly_case(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call('gen:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $this->option('resource') ? $modelName : null,\n '--overwrite' => $this->option('overwrite')\n ]);\n }",
"protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $this->call('module:controller', [\n 'name' => $controller,\n '--force' => $this->option('force')\n ]);\n }",
"protected function createController()\n {\n\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $args = [\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n ];\n\n $viewsDir = $this->option('views-dir');\n if ($viewsDir) {\n $args['--views-dir'] = $viewsDir;\n }\n\n $controllerDir = $this->option('controller-dir');\n if ($controllerDir) {\n $args['--controller-dir'] = $controllerDir;\n }\n\n $this->call('mbt:controller', $args);\n }",
"protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }",
"function create_controller () {\n\t\t$file_content = file_get_contents('generator/GeneratedObjectController.php');\n\n\t\t// replace names\n\t\t$file_content = $this->replace_names($file_content);\n\n\t\t// replace datatable display & search columns\n\t\t$content = [];\n\t\tforeach ($this->columns as $name => $type) {\n\t\t\t$content[] = \"'$name'\";\n\t\t}\n\t\t$file_content = str_replace('// generator display columns', '$this->datatable->display_columns = ['.implode(', ', $content).'];', $file_content);\n\t\t$file_content = str_replace('// generator search columns', '$this->datatable->search_columns = ['.implode(', ', $content).'];', $file_content);\n\n\t\t// replace validator rules\n\t\t$content = '';\n\t\tforeach ($this->columns as $name => $type) {\n\t\t\tif ($type != 'ai') {\n\t\t\t\t$content .= '\t\t$validator->rules[] = [\\''.ucfirst(str_replace('_', ' ', $name)).'\\', \\''.$name.'\\', \\'required\\'];'.PHP_EOL;\n\t\t\t}\n\t\t}\n\t\t$file_content = str_replace('\t\t// generator rules', rtrim($content, PHP_EOL), $file_content);\n\n\t\t// create new class file with content\n\t\tfile_put_contents('app/controllers/'.$this->name['class'].'Controller.php', $file_content);\n\t}",
"function get_controller() {}",
"protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }",
"public function controller()\n {\n $this->setClassname($this->getArgument(0));\n\n $this->generateClass('Http/Controllers', 'controller.stub', [\n 'classname' => $this->getClassname(),\n ]);\n }",
"function Controller()\n {\n \n }",
"abstract protected function getOwnerController();",
"private function createController(): string\n {\n $controllerName = $this->params['controller'] . $this->controllerSuffix;\n $controllerName = Stringify::studlyCaps($controllerName);\n return $this->getNamespace() . $controllerName;\n }",
"protected function createController()\n {\n $name = $this->argument('name');\n $this->callSilent('make:bundle:controller', [\n 'name' => $this->getBundleName($name),\n '--namespace' => $this->relativeNamespace,\n ]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
output URL as link and br | function do_html_URL($url, $name) {
?>
<a href="<?php echo htmlspecialchars($url); ?>"><?php echo htmlspecialchars($name); ?></a><br />
<?php
} | [
"function OC_HTML_doHtmlUrl($url, $name)\n { // output URL as link and br\n ?>\n <br><a href=\"<?PHP echo $url?>\"><?PHP echo$name?></a><br>\n <?PHP\n }",
"function wikitext_url($line) {\n \t?>\n \t<html>\n \t<a href=\"<?php $GLOBALS[\"endString\"] .= $line; ?>\"><?php $GLOBALS[\"endString\"] .= $line; ?></a>\n \t</html>\n \t<?php\n }",
"function wmf_shiro_echo_wrap_with_link( $text, $possible_url = '' ) {\n\tif ( empty( $possible_url ) ) :\n\t\techo esc_html( $text );\n\telse :\n\t?>\n\t<a href=\"<?php echo esc_url( $possible_url ); ?>\" target=\"_blank\" rel=\"noopener noreferrer\">\n\t\t<?php echo esc_html( $text ); ?>\n\t</a>\n\t<?php\n\tendif;\n}",
"function do_html_URL($url, $name)\r\n{\r\n?>\r\n <br><a href=\"<?=$url?>\"><?=$name?></a><br>\r\n<?\r\n}",
"public function as_html_link ()\n {\n $url = $this->as_url();\n\n return $this->_make_html_tag (\"<a href=\\\"$url\\\"\", '</a>');\n }",
"static public function formatOutput($txt)\n\t{\n\t\t$txt = htmlentities($txt);\n\t\t$txt = preg_replace('#(https?://[^\\s]+)#', '<a href=\"\\1\">\\1</a>', $txt);\n\t\t\n\t\treturn $txt;\n\t}",
"function create_hyperlink($url, $text) {\n\t\techo sprintf('<a href=\"%s\">%s</a>', $url, $text);\n\t}",
"public function htmlLink(): string\n {\n return '<a target=\"_blank\" href=\"' . e($this->getUrl()) . '\">' . e($this->name) . '</a>';\n }",
"function formatLink($url, $text)\n {\n return '<a href=\"'.$url.'\">'.$text.'</a>';\n }",
"public function outputLink()\n {\n return $this->outputUrl;\n }",
"function setUrlLink(){\n if( $this->id == 0 ) return;\n $url = $this->aFields[\"url\"]->toString();\n if( $url == \"\" ) return;\n $url = strip_tags( preg_replace( \"/[\\\"']/\", \"\", $url ) );\n if( !$this->aFields[\"url\"]->editable ) $this->aFields[\"url\"]->display = false;\n $this->aFields[\"url_link\"]->display = true;\n $this->aFields[\"url_link\"]->value = \"<a href=\\\"\".$url.\"\\\">\".$url.\"</a>\";\n }",
"function hyperlink($url, $linktxt){\n $linkcopy = $linktxt;\n if($linktxt == ''){\n $linkcopy = $url;\n }\n return \"<a href='\".\"$url\".\"'>\".\"$linkcopy\".\"</a>\";\n}",
"function print_link($url, $linktext = false, $target = false, $extras = false) {\n\tprint make_link ( $url, $linktext, $target, $extras );\n}",
"function print_link($url, $linktext=false, $target=false, $extras=false) {\n echo make_link($url, $linktext, $target, $extras);\n}",
"function makeAnchorLink( $url, $title, $content )\r\n{\r\n printf('<a href=\"%s\" title=\"%s\">%s</a>', $url, $title, $content);\r\n}",
"function formatLink($url, $text)\n {\n return $text.' ('.$url.')';\n }",
"public function display() {\r\n\t\techo '<a href=\"' . $this->_link .\r\n\t\t\t\t'\" title=\"' . $this->_text .\r\n\t\t\t\t'\">' . $this->_text . '</a><br/>';\r\n\t}",
"public abstract function displayUrl();",
"function buildLink($url, $link_text){\n\tfor ($i=0; $i < count($url); $i++) { \n\t\techo '<p><a href=\"'.$url[$i].'\">'.$link_text[$i].'</a></p>';\n\t\techo \"\\n\";\n\t}\n\t\n}",
"private function linkRenderer(array $link)\n {\n extract($link, EXTR_SKIP);\n \n if (!isset($url)) {\n throw new exception(\"Url not specified for link.\");\n }\n \n //output html for link\n $output = \"<a href=\";\n \n //add the url\n $output .= \"\\\"$url\\\">\\n\";\n \n //add the link text\n $output .= \" \".((isset($text) && is_string($text)) ?\n $text : \"Click Here\").\"\\n\";\n \n //close the <a> tag\n $output .= \"</a>\\n\";\n \n return $output;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
BP Course Mail function to be extended in future | function bp_course_process_mail($to,$subject,$message,$args=''){
$template = html_entity_decode(get_option('wplms_email_template'));
if(!isset($template) || !$template || strlen($template) < 5)
return $message;
$site_title = get_option('blogname');
$site_description = get_option('blogdescription');
$logo_url = vibe_get_option('logo');
$logo = '<a href="'.get_option('home_url').'"><img src="'.$logo_url.'" alt="'.$site_title.'" style="max-width:50%;"/></a>';
$sub_title = $subject;
if(isset($args['user_id'])){
if(is_numeric($args['user_id'])){
$name = bp_core_get_userlink($args['user_id']);
}else if(is_array($args['user_id'])){
$userid = $args['user_id'][0];
if(is_numeric($userid)){
$name = bp_core_get_userlink($userid);
}
}
}else
$name = $to;
$datetime = date_i18n( get_option( 'date_format' ), time());
if(isset($args['item_id'])){
$instructor_id = get_post_field('post_author', $args['item_id']);
$sender = bp_core_get_user_displayname($instructor_id);
$instructing_courses=apply_filters('wplms_instructing_courses_endpoint','instructing-courses');
$sender_links = '<a href="'.bp_core_get_user_domain( $instructor_id ).'">'.__('Profile','vibe-customtypes').'</a> | <a href="'.get_author_posts_url($instructor_id).$instructing_courses.'/">'.__('Courses','vibe-customtypes').'</a>';
$item = get_the_title($args['item_id']);
$item_links = '<a href="'.get_permalink( $args['item_id'] ).'">'.__('Link','vibe-customtypes').'</a> | <a href="'.bp_core_get_user_domain($instructor_id).'/">'.__('Instructor','vibe-customtypes').'</a>';
$unsubscribe_link = bp_core_get_user_domain($args['user_id']).'/settings/notifications';
}else{
$sender ='';
$sender_links ='';
$item ='';
$item_links ='';
$unsubscribe_link = '#';
$template = str_replace('cellpadding="28"','cellpadding="0"',$template);
}
$copyright = vibe_get_option('copyright');
$link_id = vibe_get_option('email_page');
if(is_numeric($link_id)){
$array = array(
'to' => $to,
'subject'=>$subject,
'message'=>$message,
'args'=>$args
);
$link = get_permalink($link_id).'?vars='.urlencode(json_encode($array));
}else{
$link = '#';
}
$template = str_replace('{{logo}}',$logo,$template);
$template = str_replace('{{subject}}',$subject,$template);
$template = str_replace('{{sub-title}}',$sub_title,$template);
$template = str_replace('{{name}}',$name,$template);
$template = str_replace('{{datetime}}',$datetime,$template);
$template = str_replace('{{message}}',$message,$template);
$template = str_replace('{{sender}}',$sender,$template);
$template = str_replace('{{sender_links}}',$sender_links,$template);
$template = str_replace('{{item}}',$item,$template);
$template = str_replace('{{item_links}}',$item_links,$template);
$template = str_replace('{{site_title}}',$site_title,$template);
$template = str_replace('{{site_description}}',$site_description,$template);
$template = str_replace('{{copyright}}',$copyright,$template);
$template = str_replace('{{unsubscribe_link}}',$unsubscribe_link,$template);
$template = str_replace('{{link}}',$link,$template);
$template = bp_course_minify_output($template);
return $template;
} | [
"function emailforsurveyCourse($guid,$id,$email,$name,$form,$mentor){\n \n global $wpdb;\n \n $slug = PAGE_SLUG; \n $btn_url = site_url().\"/$slug?survey=\".$id.\"&guid=\".$guid; \n \n $date = date(\"Y-m-d H:i:s\");\n $site_name = TR_SITE_NAME; \n $admin_email = get_option( 'admin_email' );\n $headers = 'From: ' . $admin_email . \"\\r\\n\" .\n 'Reply-To: ' . $admin_email . \"\\r\\n\" .\n 'MIME-Version: 1.0' . \"\\r\\n\" .\n 'Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\" .\n 'X-Mailer: PHP/' . phpversion(); \n \n $template = tt_get_template(\"survey_send_course\"); \n $subj = $template->subject; \n $subj = str_replace(\"{{course_name}}\", $mentor, $subj);\n\n $msg = $template->content; \n $msg = str_replace(array('{{username}}','{{course_name}}','{{url}}','{{site_name}}'),\n array($name,$mentor,$btn_url,$site_name), $msg);\n \n custom_mail($email,$subj,$msg,EMAIL_TYPE,\"\"); \n \n}",
"abstract protected function _sendMail ( );",
"protected function _sendMail()\n {}",
"function createMail () {\n\t\n\t}",
"public function cek_email () {\n\t\t\t\n\t\t}",
"function prepareEmailTextAndSubject()\n {\n global $application;\n $this->customerEmail = null;\n $this->product_obj = null;\n $pushedCurrency = false;\n\n switch($this->actionId)\n {\n case '1':\n case '2':\n case '3':\n case '4':\n case '5':\n case '16':\n $pushedCurrency = true;\n $currencyId = modApiFunc(\"Localization\", \"whichCurrencyToDisplayOrderIn\", $this->orderId);\n $orderInfo = modApiFunc(\"Checkout\", \"getOrderInfo\", $this->orderId, $currencyId);\n modApiFunc(\"Localization\", \"pushDisplayCurrency\", $currencyId, $currencyId);\n\n $customer_id = $orderInfo['PersonId'];\n $account_name = modApiFunc('Customer_Account','getCustomerAccountNameByCustomerID',$customer_id);\n $this->customer_obj = &$application->getInstance('CCustomerInfo',$account_name);\n// $this->customerEmail = $this->customer_obj->getPersonInfo('Email','Customer');\n $taxExemptEnabled = modApiFunc('Settings','getParamValue','TAXES_PARAMS','ALLOW_FULL_TAX_EXEMPTS');\n $taxExemptInfo = modApiFunc(\"TaxExempts\", \"getOrderFullTaxExempts\", $this->orderId, false);\n break;\n\n case '6':\n// if(array_key_exists('Email',$this->customerRegData['info']))\n// $this->customerEmail = $this->customerRegData['info']['Email'];\n $this->customer_obj = &$application->getInstance('CCustomerInfo',$this->customerRegData['account']);\n break;\n\n case '7':\n case '8':\n case '9':\n case '10':\n case '11':\n case '12':\n case '13':\n $this->customer_obj = &$application->getInstance('CCustomerInfo',$this->customerAccount);\n// $this->customerEmail = $this->customer_obj->getPersonInfo('Email','Customer');\n break;\n\n case '14':\n $this->product_obj = &$application->getInstance('CProductInfo',$this->inventory_info['entity_id']);\n break;\n\n case '15':\n $this -> product_obj = &$application -> getInstance('CProductInfo', $this -> review_data['product_id']);\n break;\n case '18':\n $this->customer_obj = &$application->getInstance('CCustomerInfo',$this->customerAccount);\n $this -> product_obj = &$application -> getInstance('CProductInfo', $this -> review_data['product_id']);\n break;\n };\n\n // reloading the notification info since it may be different for each language\n $this -> getNotificationInfo($this -> notificationId);\n\n $tagsList = modApiFunc(\"Notifications\", \"getAvailableTagsList\", array('0' => array('Id' => $this->actionId)));\n\n //initialize infotags\n $infotags = array();\n foreach ($tagsList[$this->actionId]['InfoTags'] as $infotag)\n {\n if (_ml_strpos($infotag, \"Order\") == 1)\n {\n $tag = _ml_substr($infotag, 6, _ml_strlen($infotag)-7);\n switch ($tag)\n {\n case 'Date':\n $infotags[$infotag] = modApiFunc(\"Localization\", \"date_format\", $orderInfo[$tag]);\n break;\n case 'GlobalDiscount':\n $infotags[$infotag] = modApiFunc(\"Localization\", \"currency_format\", $orderInfo['Price']['SubtotalGlobalDiscount']);\n break;\n case 'PromoCodeDiscount':\n $infotags[$infotag] = modApiFunc(\"Localization\", \"currency_format\", $orderInfo['Price']['SubtotalPromoCodeDiscount']);\n break;\n case 'QuantityDiscount':\n $infotags[$infotag] = modApiFunc(\"Localization\", \"currency_format\", $orderInfo['Price']['QuantityDiscount']);\n break;\n case 'DiscountedSubtotal':\n $infotags[$infotag] = modApiFunc(\"Localization\", \"currency_format\", $orderInfo['Price']['DiscountedSubtotal']);\n break;\n case 'TotalShippingAndHandlingCost':\n $ShippingCost = ($orderInfo['Price']['TotalShippingAndHandlingCost'] == PRICE_N_A) ? 0.0 : $orderInfo['Price']['TotalShippingAndHandlingCost'];\n $infotags[$infotag] = modApiFunc(\"Localization\", \"currency_format\", ($ShippingCost));\n break;\n case 'Tax':\n $infotags[$infotag] = \"\";\n $taxes = array();\n foreach ($orderInfo['Price'] as $key => $value)\n {\n $tax_name_patern = \"/^Taxes\\['(.+)'\\]$/\";\n $matches = array();\n if(preg_match($tax_name_patern, $key, $matches))\n {\n $taxes[$matches[1]] = $value;\n }\n }\n\n foreach ($taxes as $name => $value)\n {\n $infotags[$infotag].= $name.\" \".modApiFunc(\"Localization\", \"currency_format\", $value).\"\\n\";\n }\n break;\n case 'OldStatus':\n if ($this->actionId == '2')\n {\n $infotags[$infotag] = $this->OrderOldStatus;\n }\n break;\n case 'OldPaymentStatus':\n if ($this->actionId == '3')\n {\n $infotags[$infotag] = $this->OrderOldPaymentStatus;\n }\n break;\n case 'Total':\n case 'Subtotal':\n $infotags[$infotag] = modApiFunc(\"Localization\", \"currency_format\", $orderInfo[$tag]);\n break;\n case 'PaymentMethodText':\n {\n $pm_uid = $orderInfo['PaymentModuleId'];\n $infotags[$infotag] = modApiFunc(\"Checkout\", \"getPaymentMethodText\", $pm_uid);\n break;\n }\n\n case \"PromoCode\":\n $couponInfo = modApiFunc(\"PromoCodes\", \"getOrderCoupons\", $this->orderId);\n if (isset($couponInfo[0][\"coupon_promo_code\"])) {\n $infotags[$infotag] = $couponInfo[0][\"coupon_promo_code\"];\n }\n else {\n $infotags[$infotag] = \"\";\n }\n break;\n\n case \"TaxExptMark\":\n if ($taxExemptEnabled == \"true\"\n && isset($taxExemptInfo[0][\"exempt_status\"])\n && $taxExemptInfo[0][\"exempt_status\"] == \"true\")\n {\n $infotags[$infotag] = getMsg(\"SYS\",\"FULL_TAX_EXEMPT_YES_MSG\");\n }\n else\n {\n $infotags[$infotag] = getMsg(\"SYS\",\"FULL_TAX_EXEMPT_NO_MSG\");\n }\n break;\n\n case \"TaxExptAmount\":\n if ($taxExemptEnabled == \"true\"\n && isset($taxExemptInfo[0][\"exempt_status\"])\n && $taxExemptInfo[0][\"exempt_status\"] == \"true\")\n {\n $infotags[$infotag] = modApiFunc(\"Localization\", \"currency_format\", $orderInfo[\"Price\"][\"OrderTaxTotal\"]);\n }\n else\n {\n $infotags[$infotag] = modApiFunc(\"Localization\", \"currency_format\", \"0.0000\");\n }\n break;\n\n case \"TaxExptInput\":\n if ($taxExemptEnabled == \"true\"\n && isset($taxExemptInfo[0][\"exempt_status\"])\n && $taxExemptInfo[0][\"exempt_status\"] == \"true\")\n {\n $infotags[$infotag] = $taxExemptInfo[0][\"exempt_reason_customer_input\"];\n }\n else\n {\n $infotags[$infotag] = '';\n }\n break;\n case 'OrderTotalToPay':\n $infotags[$infotag] = modApiFunc(\"Localization\", \"currency_format\", $orderInfo['Price']['OrderTotalToPay']);\n break;\n case 'OrderTotalPrepaidByGC':\n $infotags[$infotag] = modApiFunc(\"Localization\", \"currency_format\", $orderInfo['Price']['OrderTotalPrepaidByGC']);\n break;\n\n default:\n $infotags[$infotag] = $orderInfo[$tag];\n break;\n }\n }\n elseif (_ml_strpos($infotag, 'CustomerReview') == 1)\n {\n $tag = _ml_substr($infotag, 15, _ml_strlen($infotag) - 16);\n\n $tag_value = '';\n if ($this -> review_data)\n switch($tag)\n {\n case 'Date':\n $tag_value = $this -> review_data['date'];\n break;\n\n case 'Time':\n $tag_value = $this -> review_data['time'];\n break;\n\n case 'Author':\n $tag_value = _ml_substr($this -> review_data['author'], 0, 56) .\n ((_ml_strlen($this -> review_data['author']) > 56)\n ? '...' : '');\n break;\n\n case 'IP':\n $tag_value = $this -> review_data['ip_address'];\n break;\n\n case 'Status':\n if ($this -> review_data['status'] == 'A')\n $tag_value = getMsg('CR', 'CR_STATUS_APPROVED');\n elseif ($this -> review_data['status'] == 'P')\n $tag_value = getMsg('CR', 'CR_STATUS_PENDING');\n else\n $tag_value = getMsg('CR', 'CR_STATUS_NOTAPPROVED');\n break;\n\n case 'Text':\n $tag_value = $this -> review_data['review'];\n break;\n\n case 'OverallRating':\n $tag_value = getMsg('CR', 'CR_RECORD_NO_RATE');\n if (is_array($this -> review_data['rating'])\n && !empty($this -> review_data['rating']))\n {\n $sum = 0;\n foreach($this -> review_data['rating'] as $v)\n $sum += $v['rate'];\n\n $tag_value = sprintf(\"%.2f\",\n $sum / count($this -> review_data['rating']));\n }\n break;\n }\n\n $infotags[$infotag] = $tag_value;\n }\n elseif (_ml_strpos($infotag, \"Customer\") == 1)\n {\n $tag = _ml_substr($infotag, 9, _ml_strlen($infotag)-10);\n $infotags[$infotag] = $this->customer_obj->getPersonInfo($tag,'Customer');\n\n switch(_ml_strtolower($tag))\n {\n case 'country':\n $infotags[$infotag] = modApiFunc('Location','getCountry',$infotags[$infotag]);\n break;\n case 'state':\n if(modApiFunc('Location','getStateCode',$infotags[$infotag]) != '')\n $infotags[$infotag] = modApiFunc('Location','getState',$infotags[$infotag]);\n else\n $infotags[$infotag] = $infotags[$infotag];\n break;\n };\n }\n elseif (_ml_strpos($infotag, \"Shipping\") == 1)\n {\n $tag = _ml_substr($infotag, 9, _ml_strlen($infotag)-10);\n $infotags[$infotag] = isset($orderInfo['Shipping']['attr'][$tag]['value'])? $orderInfo['Shipping']['attr'][$tag]['value']:(isset($orderInfo['Shipping']['attr'][$tag.\"NULL\"]['value'])? $orderInfo['Shipping']['attr'][$tag.\"NULL\"]['value']:\"\");\n }\n elseif (_ml_strpos($infotag, \"Billing\") == 1)\n {\n $tag = _ml_substr($infotag, 8, _ml_strlen($infotag)-9);\n $infotags[$infotag] = isset($orderInfo['Billing']['attr'][$tag]['value'])? $orderInfo['Billing']['attr'][$tag]['value']:\"\";\n }\n elseif (_ml_strpos($infotag, \"StoreOwner\") == 1)\n {\n $tag = _ml_substr($infotag, 11, _ml_strlen($infotag)-12);\n switch ($tag)\n {\n case \"StreetLine1\":\n $infotags[$infotag] = modApiFunc(\"Configuration\", \"getValue\", \"store_owner_street_line_1\");\n break;\n case \"StreetLine2\":\n $infotags[$infotag] = modApiFunc(\"Configuration\", \"getValue\", \"store_owner_street_line_2\");\n break;\n case \"SiteAdministratorEmail\":\n $infotags[$infotag] = modApiFunc(\"Configuration\", \"getValue\", \"store_owner_site_administrator_email\");\n break;\n case \"OrdersDepartmentEmail\":\n $infotags[$infotag] = modApiFunc(\"Configuration\", \"getValue\", \"store_owner_orders_department_email\");\n break;\n case \"Country\":\n $infotags[$infotag] = modApiFunc(\"Location\", \"getCountry\", modApiFunc(\"Configuration\", \"getValue\", \"store_owner_country\"));\n break;\n case \"State\":\n $state = modApiFunc(\"Configuration\", \"getValue\", \"store_owner_state\");\n $states_in_country = modApiFunc(\"Location\", \"getStates\", modApiFunc(\"Configuration\", \"getValue\", \"store_owner_country\"));\n if (array_key_exists($state, $states_in_country))\n {\n $infotags[$infotag] = modApiFunc(\"Location\", \"getState\", $state);\n }\n else\n {\n $infotags[$infotag] = $state;\n }\n break;\n default:\n $infotags[$infotag] = modApiFunc(\"Configuration\", \"getValue\", \"store_owner_\"._ml_strtolower($tag));\n break;\n }\n }\n elseif (_ml_strpos($infotag, \"TrackingNumber\") == 1)\n {\n $infotags[$infotag] = $orderInfo[\"TrackId\"];\n }\n elseif(_ml_strpos($infotag, 'AccountActivationLink') == 1)\n {\n $r = new Request();\n $r->setView('AccountActivation');\n $r->setAction('activate_account');\n $r->setKey('key',modApiFunc('Customer_Account','getActivationKey',$this->customerAccount));\n $infotags[$infotag] = $r->getURL();\n }\n elseif(_ml_strpos($infotag, 'AccountName') == 1)\n {\n $infotags[$infotag] = $this->customerAccount;\n }\n elseif(_ml_strpos($infotag, 'AccountNewPasswordLink') == 1)\n {\n $cz_layouts = LayoutConfigurationManager::static_get_cz_layouts_list();\n LayoutConfigurationManager::static_activate_cz_layout(array_shift(array_keys($cz_layouts)));\n $r = new CZRequest();\n $r->setView('CustomerNewPassword');\n $r->setKey('key',modApiFunc('Customer_Account','getActivationKey',$this->customerAccount));\n $infotags[$infotag] = $r->getURL();\n }\n elseif(preg_match('/^\\{combination(.+)\\}$/i',$infotag,$matches))\n {\n $tag_value = '';\n\n switch(_ml_strtolower($matches[1]))\n {\n case 'sku':\n $tag_value = $this->inventory_info['sku'];\n break;\n case 'quantityinstock':\n $tag_value = $this->inventory_info['quantity'];\n break;\n case 'description':\n $tag_value = modApiFunc('Product_Options','convertCombinationToString',modApiFunc('Product_Options','_unserialize_combination',$this->inventory_info['combination']),'; ');\n break;\n default:\n $tag_value = '';\n break;\n };\n\n $infotags[$infotag] = $tag_value;\n }\n elseif(preg_match('/^\\{product(.+)\\}$/i',$infotag,$matches) and $this->product_obj != null)\n {\n $infotags[$infotag] = $this->product_obj->getProductTagValue($matches[1],PRODUCTINFO_LOCALIZED_DATA);\n }\n elseif(_ml_strpos($infotag, 'GiftCertificateRecipient') == 1)\n {\n if ($this->gift_cert != null)\n {\n $infotags[$infotag] = $this->gift_cert->to;\n }\n }\n }\n\n //initialize blocktags\n foreach ($tagsList[$this->actionId]['BlockTags'] as $blocktagId => $blocktagInfo)\n {\n $infotags[$blocktagInfo['BlockTag']] = \"\";\n switch ($blocktagInfo['BlockTag'])\n {\n case '{OrderContentBlock}':\n foreach ($orderInfo['Products'] as $productInfo)\n {\n # settings default values for all infotags\n foreach ($blocktagInfo['BlockInfoTags'] as $t)\n {\n $t = strtr($t, array('{'=>'\\{','}'=>'\\}'));\n $init_productInfoTags[$t] = \"\";\n }\n\n $productInfoTags = array(\n \"{ProductID}\" => $productInfo['storeProductID'],\n \"{ProductName}\" => $productInfo['name'],\n \"{ProductQuantity}\" => $productInfo['qty'],\n \"{ProductPrice}\" => modApiFunc(\"Localization\", \"currency_format\", $productInfo['SalePrice']),\n \"{ProductAmount}\" => modApiFunc(\"Localization\", \"currency_format\", ($productInfo['qty']*$productInfo['SalePrice'])),\n \"{ProductOptions}\" => modApiFunc(\"Product_Options\",\"prepareTextForNotificaton\",$productInfo['options'])\n );\n\n $productInfoTags = array_merge($init_productInfoTags, $productInfoTags);\n\n foreach ($productInfo['attr'] as $attr => $attr_value)\n {\n if (\n $attr == \"SalePrice\" ||\n $attr == \"ListPrice\" ||\n $attr == \"PerItemShippingCost\" ||\n $attr == \"PerItemHandlingCost\"\n )\n {\n $productInfoTags[\"{Product\".$attr.\"}\"] = modApiFunc(\"Localization\", \"currency_format\", $attr_value[\"value\"]);\n }\n elseif (\n $attr == \"FreeShipping\" ||\n $attr == \"NeedShipping\"\n )\n {\n $productInfoTags[\"{Product\".$attr.\"}\"] = ($attr_value[\"value\"] == PRODUCT_FREESHIPPING_YES)? $this->MessageResources->getMessage(\"NTFCTN_INFO_YES_LABEL\"):$this->MessageResources->getMessage(\"NTFCTN_INFO_NO_LABEL\");\n }\n else\n {\n $productInfoTags[\"{Product\".$attr.\"}\"] = $attr_value[\"value\"];\n }\n }\n foreach ($productInfo['custom_attributes'] as $custom_attr_info)\n {\n $productInfoTags[\"{Product\".$custom_attr_info[\"tag\"].\"Custom}\"] = $custom_attr_info[\"value\"];\n }\n\n $blocktag_body = $this->getNotificationBlockBody($blocktagId);\n foreach ($productInfoTags as $tag => $val)\n {\n $blocktag_body = str_ireplace($tag, $val, $blocktag_body);\n }\n $infotags[$blocktagInfo['BlockTag']].= $blocktag_body.\"\\n\";\n }\n break;\n case '{LowLevelProductsBlock}':\n foreach ($orderInfo['Products'] as $productInfo)\n {\n if (!in_array($productInfo['storeProductID'], $this->_LowLevelProducts))\n {\n continue;\n }\n\n $_productInfo = new CProductInfo($productInfo['storeProductID']);\n\n if ($_productInfo->whichStockControlMethod() == PRODUCT_OPTIONS_INVENTORY_TRACKING)\n {\n $productQuantityInStock = modApiFunc('Product_Options','getQuantityInStockByInventoryTable','product', $productInfo['storeProductID']);\n }\n else // PRODUCT_QUANTITY_IN_STOCK_ATTRIBUTE\n {\n $productQuantityInStock = $_productInfo->getProductTagValue('QuantityInStock', PRODUCTINFO_NOT_LOCALIZED_DATA);\n }\n $productLowLevelInStock = $_productInfo->getProductTagValue('LowStockLevel', PRODUCTINFO_NOT_LOCALIZED_DATA);\n\n $productInfoTags = array(\n \"{ProductID}\" => $productInfo['storeProductID'],\n \"{ProductName}\" => $productInfo['name'],\n// \"{ProductQuantity}\" => $productInfo['qty'],\n \"{ProductPrice}\" => modApiFunc(\"Localization\", \"currency_format\", $productInfo['SalePrice']),\n// \"{ProductAmount}\" => modApiFunc(\"Localization\", \"currency_format\", ($productInfo['qty']*$productInfo['SalePrice'])),\n \"{ProductQuantityInStock}\" => (string)$productQuantityInStock\n );\n\n foreach ($productInfo['attr'] as $attr => $attr_value)\n {\n if (\n $attr == \"SalePrice\" ||\n $attr == \"ListPrice\" ||\n $attr == \"PerItemShippingCost\" ||\n $attr == \"PerItemHandlingCost\"\n )\n {\n $productInfoTags[\"{Product\".$attr.\"}\"] = modApiFunc(\"Localization\", \"currency_format\", $attr_value[\"value\"]);\n }\n elseif (\n $attr == \"FreeShipping\" ||\n $attr == \"NeedShipping\"\n )\n {\n $productInfoTags[\"{Product\".$attr.\"}\"] = ($attr_value[\"value\"] == PRODUCT_FREESHIPPING_YES)? $this->MessageResources->getMessage(\"NTFCTN_INFO_YES_LABEL\"):$this->MessageResources->getMessage(\"NTFCTN_INFO_NO_LABEL\");\n }\n else if ($attr != \"QuantityInStock\")\n {\n $productInfoTags[\"{Product\".$attr.\"}\"] = $attr_value[\"value\"];\n }\n }\n foreach ($productInfo['custom_attributes'] as $custom_attr_info)\n {\n $productInfoTags[\"{Product\".$custom_attr_info[\"tag\"].\"Custom}\"] = $custom_attr_info[\"value\"];\n }\n\n $blocktag_body = $this->getNotificationBlockBody($blocktagId);\n foreach ($productInfoTags as $tag => $val)\n {\n $blocktag_body = str_ireplace($tag, $val, $blocktag_body);\n }\n $infotags[$blocktagInfo['BlockTag']].= $blocktag_body.\"\\n\";\n }\n break;\n\n case '{OrderDiscountsBlock}':\n $promoInfo = modApiFunc(\"PromoCodes\", \"getOrderCoupons\", $this->orderId);\n $promoCode = (isset($promoInfo[0][\"coupon_promo_code\"])) ? $promoInfo[0][\"coupon_promo_code\"] : \"\";\n\n $discountsInfoTags = array(\n \"{OrderGlobalDiscount}\" => modApiFunc(\"Localization\", \"currency_format\", $orderInfo['Price']['SubtotalGlobalDiscount']),\n \"{OrderPromoCode}\" => $promoCode,\n \"{OrderPromoCodeDiscount}\" => modApiFunc(\"Localization\", \"currency_format\", $orderInfo['Price']['SubtotalPromoCodeDiscount']),\n \"{OrderQuantityDiscount}\" => modApiFunc(\"Localization\", \"currency_format\", $orderInfo['Price']['QuantityDiscount']),\n \"{OrderDiscountedSubtotal}\" => modApiFunc(\"Localization\", \"currency_format\", $orderInfo['Price']['DiscountedSubtotal']),\n \"{OrderSubtotal}\" => modApiFunc(\"Localization\", \"currency_format\", $orderInfo['Price']['OrderSubtotal']),\n \"{OrderTotalToPay}\" => modApiFunc(\"Localization\", \"currency_format\", $orderInfo['Price']['OrderTotalToPay']),\n \"{OrderTotalPrepaidByGC}\" => modApiFunc(\"Localization\", \"currency_format\", $orderInfo['Price']['OrderTotalPrepaidByGC'])\n );\n $blocktag_body = $this->getNotificationBlockBody($blocktagId);\n\n foreach ($discountsInfoTags as $tag => $val)\n {\n $blocktag_body = str_ireplace($tag, $val, $blocktag_body);\n }\n $infotags[$blocktagInfo['BlockTag']].= $blocktag_body;\n break;\n\n case '{OrderDownloadLinksBlock}':\n $hotlinks = modApiFunc('Product_Files','getHotlinksListForOrder',$this->orderId);\n foreach($hotlinks as $k => $hotlink_info)\n {\n $file_info = modApiFunc('Product_Files','getPFileInfo',$hotlink_info['file_id']);\n $HotlinkInfoTags = array(\n \"{DownloadLink}\" => $hotlink_info['hotlink_value']\n ,\"{DownloadLinkExpiryDate}\" => date(\"d M Y, H:i\", $hotlink_info['expire_date'])\n ,\"{DownloadLinkAttempts}\" => $hotlink_info['max_try']\n ,\"{DownloadFilename}\" => $file_info['file_name']\n ,\"{DownloadFileDescription}\" => $file_info['file_descr']\n );\n $blocktag_body = $this->getNotificationBlockBody($blocktagId);\n foreach ($HotlinkInfoTags as $tag => $val)\n {\n $blocktag_body = str_ireplace($tag, $val, $blocktag_body);\n }\n $infotags[$blocktagInfo['BlockTag']].= $blocktag_body;\n }\n break;\n\n case '{OrderedGiftCertificateBlock}':\n $gcs = array();\n if ($this->gift_cert)\n {\n $gcs = array(modApiFunc(\"GiftCertificateApi\", \"getGiftCertificate\", $this->gift_cert->code));\n }\n else if ($this->orderId)\n {\n $gcs = modApiFunc(\"GiftCertificateApi\",\"getGiftCertificatesForOrderId\",$this->orderId);\n }\n if (sizeof($gcs) > 0)\n {\n foreach($gcs as $gc)\n {\n $GCInfoTags = array(\n \"{PurchasedGiftCertificateCode}\" => $gc[\"gc_code\"]\n ,\"{PurchasedGiftCertificateMessage}\" => $gc[\"gc_message\"]\n ,\"{PurchasedGiftCertificateAmount}\" => modApiFunc(\"Localization\", \"currency_format\", $gc[\"gc_amount\"])\n ,\"{PurchasedGiftCertificateFrom}\" => $gc[\"gc_from\"]\n ,\"{PurchasedGiftCertificateTo}\" => $gc[\"gc_to\"]\n ,\"{PurchasedGiftCertificateType}\" => $gc[\"gc_sendtype\"]\n );\n $blocktag_body = $this->getNotificationBlockBody($blocktagId);\n foreach ($GCInfoTags as $tag => $val)\n {\n $blocktag_body = str_replace($tag, $val, $blocktag_body);\n }\n $infotags[$blocktagInfo['BlockTag']].= $blocktag_body;\n }\n }\n break;\n\n case '{AppliedGiftCertificateBlock}':\n $gcs = modApiFunc(\"GiftCertificateApi\",\"getOrderGCs\",$this->orderId);\n if (!empty($gcs) && is_array($gcs))\n {\n foreach($gcs as $i => $gc_data)\n {\n $gc = new GiftCertificate($gc_data['gc_code']);\n\n $GCInfoTags = array(\n \"{AppliedGiftCertificateCode}\" => $gc->code\n ,\"{AppliedGiftCertificateMessage}\" => $gc->message\n ,\"{AppliedGiftCertificateAmount}\" => modApiFunc(\"Localization\", \"currency_format\", $gc->amount)//$this->gift_cert->amount\n ,\"{AppliedGiftCertificateFrom}\" => $gc->from\n ,\"{AppliedGiftCertificateTo}\" => $gc->to\n ,\"{AppliedGiftCertificateType}\" => $gc->sendtype\n );\n $blocktag_body = $this->getNotificationBlockBody($blocktagId);\n foreach ($GCInfoTags as $tag => $val)\n {\n $blocktag_body = str_replace($tag, $val, $blocktag_body);\n }\n $infotags[$blocktagInfo['BlockTag']].= $blocktag_body;\n }\n }\n break;\n\n\n }\n };\n\n $this->EmailText = $this->getNotificationBody();\n $this->EmailSubject = $this->subject;\n\n foreach ($infotags as $tag => $val)\n {\n $this->EmailText = str_ireplace($tag, $val, $this->EmailText);\n $this->EmailSubject = str_ireplace($tag, $val, $this->EmailSubject);\n };\n\n $this->EmailText = $this->html_replace($this->EmailText);\n $this->EmailSubject = $this->html_replace($this->EmailSubject);\n\n if ($pushedCurrency)\n modApiFunc(\"Localization\", \"popDisplayCurrency\");\n }",
"function sendConfirmartionEmail($yourName, $email, $pluginName, $pluginDescription) {\r\n\t\t\r\n\tinclude 'cytostaff_emails.inc';\r\n\r\n\t$from = $cytostaff_emails[0];\r\n\t$to = $email;// Author e-mail contact\r\n\t$bcc = $cytostaff_emails[0];\r\n\t//for ($i=0; $i<count($cytostaff_emails); $i++){\r\n // \t$bcc = $bcc . $cytostaff_emails[$i] . \" \";\r\n\t//}\r\n\t$subject = \"Your plugin -- \" . $pluginName;\r\n\t$body = $yourName.\",\\n\\nThank you for submitting \" . $pluginName . \" to Cytoscape. \" .\r\n\t\t\"\\n\\nDescription:\\n\\n\".$pluginDescription.\"\\n\\n\".\r\n \t\"Cytoscape staff will review your plugin and publish it on the Cytoscape website.\" .\r\n \t\"\\n\\n\\nCytoscape team\";\r\n\r\n\t$headers = \"From: \" . $from . \"\\r\\n\"; \r\n\tif ($bcc != \"\") {\r\n\t\t$headers = $headers . \"BCC: \" . $bcc;\r\n\t}\r\n\r\n\tif (trim($to) == \"\") {\r\n\t\t// in case user did not provide an e-mail address, notify the cytostaff\r\n \t$to = $cytostaff_emails[0];\r\n \t$body = $body . \"\\n\\nNote: User did not provide an e-mail address!\";\r\n\t}\r\n\r\n\tif (mail($to, $subject, $body, $headers)) {\r\n \t\t//echo(\"<p>Confirmation e-mail was sent!</p>\");\r\n \t} else {\r\n \t\techo(\"<p>Failed to send a confirmation e-mail...</p>\");\r\n \t}\r\n\t\r\n\t//Send notification e-mail to staff\r\n\r\n\t$to =$cytostaff_emails[0];\r\n\t$bcc = $cytostaff_emails[0].' ';\r\n\tfor ($i=0; $i<count($cytostaff_emails); $i++){\r\n \t$bcc = $bcc . $cytostaff_emails[$i] . \" \";\r\n\t}\r\n\r\n\t$headers = \"From: \" . $from . \"\\r\\n\"; \r\n\tif ($bcc != \"\") {\r\n\t\t$headers = $headers . \"BCC: \" . $bcc;\r\n\t}\r\n\r\n\r\n\t$body = $body. \"\\n\\nAdmin URL: http://chianti.ucsd.edu/cyto_web/plugins3/pluginadmin.php\\n\\n\";\r\n\r\n\tif (mail($to, $subject, $body, $headers)) {\r\n \t\t//echo(\"<p>notification e-mail was sent to staff!</p>\");\r\n \t} else {\r\n \t\techo(\"<p>Failed to send a notification e-mail...</p>\");\r\n \t}\r\n}",
"function emailTopic ($pk_topic, $s_topic, $s_name, $s_email, $s_friendName, $s_friendEmail, $s_message, $b_newsletter, $b_cc) {\n\t$con = __openDB();\n\t__addAuthor ($con, $s_name, $s_email, $b_newsletter);\n\t__closeDB($con);\n\n\t$mail = new PHPMailer();\n \n\t$s_stockMessage = \"Dear \".getFirstName(htmlClean($s_friendName)).\",<br><br>\";\n\t$s_stockMessage .= \"Too Polite To Ask is a website dedicated to understanding others and your friend, \".htmlClean($s_name).\", has asked if you will share your experience on what it feels like to \".htmlClean($s_topic).\".<br><br>\";\n\t$s_stockMessage .= \"<i>(from \".htmlClean($s_name).\")</i><br>\";\n\t$s_stockMessage .= emailClean(htmlClean($s_message)).\"<br><br>\";\n\t$s_stockMessage .= \"<a href=\\\"\".getUrl(\"give-your-answer/$pk_topic/\").\"\\\">Click here to submit your answer</a><br><br>\";\n\t$s_stockMessage .= \"This message was sent to you by Too Polite To Ask. \";\n\t$s_stockMessage .= \"To be notified of upcoming Too Polite To Ask products and news, <a href=\\\"\".getUrl(\"get-newsletter/\").\"\\\">subscribe</a> to our mailings\";\n\n $mail->ClearAddresses(); \n $mail->ClearAttachments();\n $mail->IsHTML(true);\n\t\n\t$mail->From = \"info@toopolite.com\";\n\t$mail->FromName = \"Too Polite To Ask\";\n\t$mail->Host = \"smtp.sendgrid.net\";\n\t$mail->Port = 587;\n\t$mail->Username = $_ENV[\"SENDGRID_USERNAME\"];\n\t$mail->Password = $_ENV[\"SENDGRID_PASSWORD\"];\n\n\t$mail->AddAddress($s_friendEmail, $s_friendName);\n\tif ($b_cc) { $mail->AddCC($s_email, $s_name); }\n\n\t$mail->Subject = htmlClean($s_name).\" asks if you will share your story\";\n\t$mail->Body = $s_stockMessage;\n\t$mail->WordWrap = 50;\n\n\tif(!$mail->Send()){\n\t\techo \"Message could not be sent. <p>\";\n\t\techo \"Mailer Error: \" . $mail->ErrorInfo;\n\t\texit;\n\t}\n}",
"function mailitem($vars = false){\n\t\t\n\t\t//$message = file_get_contents(ROOT . '/app/emails/' . $template . '.html');\n\t\t$message = '\n<html>\n<head>\n<title>Atlas</title>\n</head>\n<body style=\"background-color: #ffffff; font: arial, sans-serif;padding:0;margin:0;\">\n<center>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"640\" align=\"center\">\n<tr style=\"background-color: #5d94d6; color: #fff;\">\n<td width=\"0px\" height=\"0px\"></td>\n<td colspan=\"1\" style=\"padding-left:25px;padding-top:5px;font: 18px \\'Helvetica Neue\\',\\'Arial\\',\\'sans-serif\\';\">*|datetime_created|*</td>\n</tr>\n<tr>\n<td width=\"0px\" height=\"0px\"></td>\n<td rowspan=\"2\" width=\"640px\" height=\"130\" align=\"center\" valign=\"bottom\" style=\"padding-bottom: 12px; padding-right: 5px; border-right:1px solid black;\"><img src=\"*|user_picture|*\" width=\"130\" height=\"130\" /></td>\n</tr>\n<tr>\n<td height=\"293\" colspan=\"2\" width=\"640px\"><img src=\"http://*|env|*.getatlas.com/img/email/top-blue-bg5.png\" /></td>\n</tr>\n<tr>\n<td colspan=\"2\" align=\"center\" style=\"font: bold 26px \\'Helvetica Neue\\',\\'Arial\\',\\'sans-serif\\';color:#3066af;\">Welcome to Atlas, *|user_firstname|*</td>\n</tr>\n<tr>\n<td height=\"15\" colspan=\"2\"> </td>\n</tr>\n<tr>\n<td height=\"34\" colspan=\"2\" align=\"center\"><img src=\"http://*|env|*.getatlas.com/img/email/atlas-icon.png\" /></td>\n</tr>\n<tr>\n<td colspan=\"2\" height=\"25\"> </td>\n</tr>\n<tr>\n<td colspan=\"2\" height=\"13\"><img src=\"http://*|env|*.getatlas.com/img/email/divider.png\" /></td>\n</tr>\n<tr>\n<td colspan=\"2\" height=\"25\"> </td>\n</tr>\n<tr>\n<td colspan=\"2\" align=\"center\" style=\"font: 30px \\'Helvetica Neue\\',\\'Arial\\',\\'sans-serif\\';color:#1b1b1b;line-height: 1.4em;\">\nYour feedback is very important to us.<br />\nWe want to make scheduling meetings<br />\nand phone calls as easy as possible.\n<br /><br />\nWith your help, we can.\n</td>\n</tr>\n<tr>\n<td colspan=\"2\" height=\"15\"> </td>\n</tr>\n<tr>\n<td height=\"45\" colspan=\"2\" align=\"center\" style=\"font: bold 30px \\'Helvetica Neue\\',\\'Arial\\',\\'sans-serif\\';color:#3066af;\">Team Atlas</td>\n</tr>\n<tr>\n<td height=\"34\" colspan=\"2\" align=\"center\"><img src=\"http://*|env|*.getatlas.com/img/email/atlas-icon.png\" /></td>\n</tr>\n<tr>\n<td colspan=\"2\" height=\"25\"> </td>\n</tr>\n<tr>\n<td colspan=\"2\" align=\"center\" style=\"font: 25px \\'Helvetica Neue\\',\\'Arial\\',\\'sans-serif\\';color:#1b1b1b;\">\nCheck out our YouTube channel for great Atlas tutorials.\n</td>\n</tr>\n<tr>\n<td height=\"100\" colspan=\"2\" align=\"center\"><a href=\"http://youtube.com/getatlas\" title=\"Tutorials on YouTube\"><img src=\"http://*|env|*.getatlas.com/img/email/tutorials.png\" width=\"261\" height=\"63\" alt=\"Tutorials on Youtube\" /></a></td>\n</tr>\n<tr>\n<td colspan=\"2\" height=\"75\"> </td>\n</tr>\n<tr>\n<td colspan=\"2\" align=\"center\" width=\"605\" height=\"31\"><img src=\"http://*|env|*.getatlas.com/img/email/tagline.png\" width=\"605\" height=\"31\" /></td>\n</tr>\n<tr>\n<td colspan=\"2\" height=\"25\"> </td>\n</tr>\n<tr>\n<td colspan=\"2\" height=\"15\">\n<table width=\"640\">\n<tr align=\"center\">\n<td width=\"206\" height=\"99\"><a href=\"http://*|env|*.getatlas.com/\"><img width=\"206\" height=\"60\" src=\"http://*|env|*.getatlas.com/img/email/app-store.png\" /></a></td>\n<td width=\"99\" height=\"99\"><a href=\"http://*|env|*.getatlas.com/\"><img width=\"99\" height=\"99\" src=\"http://*|env|*.getatlas.com/img/email/logo.png\" /></a></td>\n<td width=\"206\" height=\"99\"><a href=\"http://*|env|*.getatlas.com/\"><img width=\"206\" height=\"60\" src=\"http://*|env|*.getatlas.com/img/email/google-play.png\" /></a></td>\n</tr>\n</table>\n</td>\n</tr>\n<tr>\n<td colspan=\"2\" height=\"85\"> </td>\n</tr>\n</table>\n</center>\n</body>';\n\t\tif($vars){\n\t\t\tforeach($vars as $key=>$item){\n\t\t\t\t$message = str_replace('*|'.$key.'|*', $item, $message);\n\t\t\t}\n\t\t}\n\n\t\treturn $message;\n\t}",
"public function sendPartsEmail(){\n if($this->request->email && $this->request->guestEmail == '' ){\n $email = $this->request->email;\n $gdName = $this->request->gdName;\n $this->repository->acknowledgementMail($email);\n $this->repository->mailToRc($this->request->rcMailIds, $gdName);\n }\n else if($this->request->guestEmail){\n $this->repository->sendPdf();\n }\n }",
"function Submission_Handle_Certificate_Mail_Send()\n {\n $this->CertificatesObj()->Certificates_Generate_Mail_Send\n (\n $this->FriendsObj()->Sql_Select_Hash(array(\"ID\" => $this->ItemHash[ \"Friend\" ])),\n $this->Submission_Certificate_Where($this->ItemHash)\n );\n }",
"function eZMail()\n {\n\n }",
"function via_make_notice_mail_html($a, $muser) {\n global $CFG, $DB;\n\n if ($muser->mailformat != 1) {// Needs to be HTML.\n return '';\n }\n\n $posthtml = '<head></head>';\n $posthtml .= \"\\n<body>\\n\\n\";\n\n $posthtml .= '<div style=\"font-family: Calibri,sans-serif;\">';\n $posthtml .= '<a target=\"_blank\" href=\"'.$CFG->wwwroot.'/course/view.php?id='.$a->courseid.'\">'.$a->coursename.'</a>';\n $posthtml .= ' » <a target=\"_blank\"\n href=\"'.$CFG->wwwroot.'/mod/via/index.php?id='.$a->courseid.'\">'.$a->activitytitle.'</a> » ';\n $posthtml .= '<a target=\"_blank\" href=\"'.$CFG->wwwroot.'/mod/via/view.php?id='.$a->cmid.'\">'.$a->activitytitle.'</a>';\n $posthtml .= '</div>';\n $posthtml .= '<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" style=\"font-family: Calibri,sans-serif; color:#505050\">';\n $posthtml .= '<tr><td>'. get_string(\"noticeemailsubject\", \"via\") .'</td></tr>';\n $posthtml .= '<tr><td>'. get_string(\"noticeemailhtml\", \"via\", $a) .'</td></tr>';\n $posthtml .= '<tr><td><br/>'. get_string(\"noticeclicktoaccesshtml\", \"via\") .'</td></tr>';\n $posthtml .= '<tr><td>';\n $posthtml .= \"<a style='color:#fff; text-decoration:none; background:#6ab605; padding:8px;'\n href='\".$CFG->wwwroot.\"/mod/via/view.php?id=\".$a->cmid.\"' >\n <img style='vertical-align:middle'\n src='\" . $CFG->wwwroot .\"/mod/via/pix/access_small.png' hspace='5' height='14px' width='15px'>\".\n get_string(\"gotorecording\", \"via\").\"</a>\";\n $posthtml .= '</td></tr>';\n\n $posthtml .= '<tr><td>'.$CFG->wwwroot.\"/mod/via/view.php?id=\".$a->cmid .'</td></tr>';\n\n $posthtml .= '</table>'.\"\\n\\n\";\n\n $posthtml .= '</body>';\n\n return $posthtml;\n}",
"function sendMail($email,$authcode,$mailTexts,$markerArray=array()){\n\t\t\t\t\tif (is_array($markerArray['###PASSWORD'])){\n\t\t\t\t\t\tunset($markerArray['###PID###']);\n\t\t\t\t\t\tunset($markerArray['###PASSWORD###']);\n\t\t\t\t\t}\n\t\t\t\t\t//t3lib_div::devLog('sendMail markerArray', 'Einlade-Mod', 0, $markerArray);\n\t\t\t\t\t$link = t3lib_div::getIndpEnv('TYPO3_SITE_URL') . 'index.php?id=' . $this->pid . '&tx_kequestionnaire_pi1[auth_code]=' . $authcode;\n\t\t\t\t\t$html_link = '<a href=\"' . $link . '\">' . $link . '</a>';\n\n\t\t\t\t\t$markerArray[\"###AUTHCODE###\"] = $authcode;\n\t\t\t\t\t$markerArray[\"###LINK###\"] = '<' . $link . '>';\n\t\t\t\t\t$markerArray[\"###ID###\"] = $this->pid;\n\t\t\t\t\t$markerArray[\"###URL###\"] = $link;\n\t\t\t\t\t\n\t\t\t\t\t$body=$mailTexts[\"body\"];\n\t\t\t\t\t$html_body=nl2br($mailTexts[\"body\"]);\n\t\t\t\t\tforeach($markerArray as $key=>$val) $body=str_replace($key,$val,$body);\n\t\t\t\t\t$markerArray[\"###LINK###\"]=$html_link;\n\t\t\t\t\tforeach($markerArray as $key=>$val) $html_body=str_replace($key,$val,$html_body);\n\t\t\t\t\t\n\t\t\t\t\t$html_start=\"<html><head><title>\".$mailTexts[\"subject\"].\"</title></head><body>\";\n\t\t\t\t\t$html_end=\"</body></html>\";\n\t\t\t\t\t\n\t\t\t\t\tif($GLOBALS['TYPO3_CONF_VARS']['MAIL']['substituteOldMailAPI'] == 0 && $GLOBALS['TYPO3_CONF_VARS']['SYS']['compat_version'] < '4.6') {\t\n\t\t\t\t\t\t$this->htmlMail = t3lib_div::makeInstance('t3lib_htmlmail');\n\t\t\t\t\t\t$this->htmlMail->start();\n\t\t\t\t\t\t$this->htmlMail->recipient = $email;\n\t\t\t\t\t\t$this->htmlMail->subject = $mailTexts['subject'];\n\t\t\t\t\t\t$this->htmlMail->from_email = $mailTexts['fromEmail'];\n\t\t\t\t\t\t$this->htmlMail->from_name = $mailTexts['fromName'];\n\t\t\t\t\t\t$this->htmlMail->replyto_name = $mailTexts['fromName'];\n\t\t\t\t\t\t$this->htmlMail->organisation = $mailTexts['fromName'];\n\t\t\t\t\t\t$this->htmlMail->returnPath = $mailTexts['fromEmail'];\n\t\t\t\t\t\t//$this->htmlMail->addPlain($body);\n\t\t\t\t\t\t$this->htmlMail->setHTML($this->htmlMail->encodeMsg($html_start.$html_body.$html_end));\n\t\t\t\t\t\t$out=$this->htmlMail->send($email);\n\t\t\t\t\t} else {\t\t\t\t\t\t\n\t\t\t\t\t\t//use swiftmailer\n\t\t\t\t\t\t$swiftParams = array(\n\t\t\t\t\t\t\t'setFrom' => array( $mailTexts['fromEmail'] => $mailTexts['fromName']),\n\t\t\t\t\t\t\t'setReturnPath' => $mailTexts['fromEmail'],\n\t\t\t\t\t\t\t'setReplyTo' => $mailTexts['fromEmail'],\n\t\t\t\t\t\t\t'setContentType' => '',\n\t\t\t\t\t\t\t'setCharset' => 'uft-8',\n\t\t\t\t\t\t\t'setTo' => array($email),\n\t\t\t\t\t\t\t'setSubject' => $mailTexts['subject'],\n\t\t\t\t\t\t\t'setBody' => array($html_start.$html_body.$html_end, 'text/html'),\n\t\t\t\t\t\t\t//'addPart' => array($html_start.$html_body.$html_end, 'text/plain')\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$mail = t3lib_div::makeInstance('tx_kequestionnaire_swiftmailer');\n\t\t\t\t\t\t$out = $mail->send($swiftParams);\n\t\t\t\t\t\tunset($mail);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn $out;\n\n\t\t\t\t}",
"abstract protected function generateEmail();",
"function mailtoModule()\n{\n global $ACMSCfg;\n // FIXME: There should be an easy way to override templates with a theme.\n $parts = pathinfo(__FILE__);\n $this->templatePath = $parts[\"dirname\"] . \"/mailto_\";\n $this->recipient = \"\";\n $this->rcptName = \"\";\n $this->subject = \"\";\n $this->message = \"\";\n $this->sendername = \"\";\n $this->senderemail = \"\";\n\n $this->validRcpts = array();\n // Load the valid recipeints\n $tags = split(':', $ACMSCfg['mod_mailto']['tags']);\n foreach($tags as $tag) {\n $ctag = 'tag_' . $tag;\n if (!empty($ACMSCfg['mod_mailto'][$ctag])) {\n list($addr,$name) = split(':', $ACMSCfg['mod_mailto'][$ctag],2);\n $this->validRcpts[] = array('tag' => $tag, 'addr' => $addr, 'name' => $name);\n }\n }\n\n}",
"function contact_seller($data_array, $template_file) {\n \n /*Use the email template and replace the strings located within\n with the values from the data_array */ \n $email_message = file_get_contents($template_file);\n $email_message = str_replace(\"#USERNAME#\", $data_array['from_login'], $email_message);\n $email_message = str_replace(\"#SENDER_ID#\", $data_array['sender_id'], $email_message);\n $email_message = str_replace(\"#EMAIL#\", $data_array['from_email'], $email_message);\n $email_message = str_replace(\"#MESSAGE#\", $data_array['message'], $email_message);\n $email_message = str_replace(\"#PRODUCT_NAME#\", $data_array['product_name'], $email_message);\n $email_message = str_replace(\"#PRODUCT_ID#\", $data_array['product_id'], $email_message);\n \n //Construct the email headers\n $to = $data_array['to'];\n $from = \"no-reply@erikslist.com\";\n $email_subject = \"Post Inquiry From EriksList Member: \". $data_array['product_name'];\n\n $headers = \"From: \" . $from . \"\\r\\n\";\n $headers .= 'MIME-Version: 1.0' . \"\\n\"; \n $headers .= 'Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\"; \n \n //Send a confirmation email message to the user\n if (mail($to, $email_subject, $email_message, $headers) == true) {\n return true;\n }\n else {\n return false;\n }\n}",
"public function AdminPage_email() {\n\tglobal $wgRequest;\n\n\t$doCustCopy = $wgRequest->GetBool('send-to-cust');\n\t$txtSubj = $wgRequest->GetText('subject');\n\t$txtMsgPre = $wgRequest->GetText('email-msg-pre');\n\tif ($wgRequest->GetBool('btnSend')) {\n\t// Actually sending the email\n\t $txtDoCustCopy = $doCustCopy?'copy customer':'no customer copy';\n\n\t $txtEmailBody = $wgRequest->GetText('email-body');\n\t $txtEmailAddrSelf = $wgRequest->GetText('addr-self');\n\t $txtEmailAddrCust = $wgRequest->GetText('addr-cust');\n\t //$txtEmailSubject = $wgRequest->GetText('subject');\n\n\t // send the email\n\t $out = $this->EmailConfirm(TRUE, TRUE, $doCustCopy, $txtEmailAddrSelf, $txtEmailAddrCust, $txtSubj, $txtEmailBody);\n\t} else {\n\t $out = $this->AdminPage_email_preview($doCustCopy,$txtSubj,$txtMsgPre);\n\t}\n\n\treturn $out;\n }",
"function via_make_notification_mail_html($a, $muser) {\n global $CFG, $DB;\n\n if ($muser->mailformat != 1) {// Needs to be HTML.\n return '';\n }\n\n $posthtml = '<head></head>';\n $posthtml .= \"\\n<body>\\n\\n\";\n\n $posthtml .= '<div style=\"font-family: Calibri,sans-serif;\">';\n $posthtml .= '<a target=\"_blank\" href=\"'.$CFG->wwwroot.'/course/view.php?id='.$a->courseid.'\">'.$a->coursename.'</a>';\n $posthtml .= ' » <a target=\"_blank\"\n href=\"'.$CFG->wwwroot.'/mod/via/index.php?id='.$a->courseid.'\">'.$a->modulename.'</a> » ';\n $posthtml .= '<a target=\"_blank\" href=\"'.\n $CFG->wwwroot.'/mod/via/view.php?'.$a->viaurlparam.'='.$a->viaurlparamvalue.'\">'.$a->activitytitle.'</a>';\n $posthtml .= '</div>';\n $posthtml .= '<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" style=\"font-family: Calibri,sans-serif; color:#505050\">';\n $posthtml .= '<tr><td>'. get_string(\"notificationemailsubject\", \"via\") .'</td></tr>';\n $posthtml .= '<tr><td>'. get_string(\"notificationemailhtml\", \"via\", $a) .'</td></tr>';\n $posthtml .= '<tr><td><br/>'. get_string(\"noticeclicktoaccesshtml\", \"via\") .'</td></tr>';\n $posthtml .= '<tr><td>';\n $posthtml .= \"<a style='color:#fff; text-decoration:none; background:#6ab605; padding:8px;'\n href='\".$CFG->wwwroot.\"/mod/via/view.php?\".$a->viaurlparam.\"=\".$a->viaurlparamvalue.\"' >\n <img style='vertical-align:middle'\n src='\" . $CFG->wwwroot .\"/mod/via/pix/access_small.png' hspace='5' height='14px' width='15px'>\".\n get_string(\"gotorecording\", \"via\").\"</a>\";\n $posthtml .= '</td></tr>';\n\n $posthtml .= '<tr><td>'.$CFG->wwwroot.\"/mod/via/view.php?\".$a->viaurlparam.\"=\".$a->viaurlparamvalue.'</td></tr>';\n\n $posthtml .= '</table>'.\"\\n\\n\";\n\n $posthtml .= '</body>';\n\n return $posthtml;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add Assisting functions here / Ajax: clear debug file. | public function clear_debug_file() {
$this->load->language($this->route);
$json = array();
if (!$this->user->hasPermission('modify', $this->route)) {
$json['error'] = $this->language->get('error_permission');
} else {
$file = DIR_LOGS.$this->request->post['debug_file'];
$handle = fopen($file, 'w+');
fclose($handle);
$json['success'] = $this->language->get('success_clear_debug_file');
}
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
} | [
"function _debugReset () {\r\n $this->_debugIncludedfiles = array();\r\n $this->_debugTemplatevars = array();\r\n $this->_debugtags = array();\r\n $this->_debugwarnings = array();\r\n $this->_debugwarningmsgscontrol = array();\r\n $this->_debugwarningmsgs = array();\r\n }",
"function ClearTools(){}",
"public function clear_debug_list() {\n\n if ( isset( $_POST['sfcounter-debug-clear'] ) ) {\n\n update_option( 'sfcounter_debug_list' , array() );\n\n header( 'Location:' . admin_url() . 'admin.php?page=sfcounter-debug' );\n exit;\n }\n }",
"function acf_clear_log() {\n\tunlink( WP_CONTENT_DIR . '/debug.log' );\n}",
"function clear_files()\n\t{\n\t\t$this->files = array();\n\t\t$this->files_cache = array();\n\t\t$this->files_cache2 = array();\n\t\t$this->compiled_code = array();\n\t\t$this->uncompiled_code = array();\n\t}",
"public function clearJS() {\n\t\t$this->_jsFiles = array();\n\t}",
"public static function insertScreenCleanJs() {\n\t\tzbx_add_post_js('window.flickerfreeScreen.cleanAll();');\n\t}",
"function reset_debug()\n{\n\t$this->flag_debug = 0;\n}",
"public function clear_compile() {\n\t\t$this->js->_clear_compile ();\n\t}",
"public function clearFunctions() {\r\n\t\t// Remove all functions.\r\n\t\t$this->functions->clear();\r\n\r\n\t\t// Reload the system functions if necessary.\r\n\t\t$this->loadSystemFunctions();\r\n\t}",
"public static function clearCache() {\n $cached=sugar_cached('include/externalAPI.cache.php');\n if ( file_exists($cached) ) {\n unlink($cached);\n }\n $cached=sugar_cached('include/externalAPI.cache.js');\n if ( file_exists($cached) ) {\n unlink($cached);\n }\n }",
"private function clear()\n {\n $this->script = '';\n $this->output = array();\n $this->requestedUrls = array();\n $this->currentUrl = '';\n }",
"public static function flushMacros()\n {\n static::$macros = [];\n }",
"public static function flushMacros(): void\n {\n static::$macros = [];\n }",
"function debugger_api_clear_data() {\n db_query(\"TRUNCATE TABLE {debugger_traces}\");\n db_query(\"TRUNCATE TABLE {debugger_requests}\");\n db_query(\"TRUNCATE TABLE {debugger_functions}\");\n db_query(\"TRUNCATE TABLE {debugger_files}\");\n db_query(\"TRUNCATE TABLE {debugger_sql_queries}\");\n}",
"static function clearScripts(){\n\t\tforeach (self::$required_js as $key=>$hard){\n\t\t\tif ($hard)unset(self::$required_js[$key]);\n\t\t}\n\t\tforeach (self::$css as $key=>$script){\n\t\t\tif ($script[1])unset(self::$css[$key]);\n\t\t}\n\t\tforeach (self::$js as $key=>$script){\n\t\t\tif ($script[1])unset(self::$js[$key]);\n\t\t}\n\t}",
"public function finalPoint() {\r\n $this->addPoint('system.end');\r\n if (access('development')) {\r\n $cogear = getInstance();\r\n $template = new Template('Dev.results');\r\n $template->data = Dev_Gear::humanize($cogear->dev->measurePoint('system'));\r\n append('footer', $template->render());\r\n js($this->folder . '/js/inline/debug.js');\r\n }\r\n }",
"public static function clearDebugging()\n {\n self::$errorCount = 0;\n self::$exceptionCount = 0;\n self::$debugging = array();\n self::$profiling = array();\n }",
"function stopDebug()\r\n {\r\n oxSession::deleteVar( 'debugPHP');\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
initialize options and edan handler and set service | function __construct()
{
$this->options = new esw_options_handler();
$this->edan = new edan_handler();
$this->service = 'metadata/v1.1/metadata/search.htm';
} | [
"function __construct()\n {\n $this->edan = new edan_handler();\n $this->service = 'content/v1.1/content/getContent.htm';\n }",
"public function initializeService() {\n $this->phpThumb->config = array_merge($this->phpThumb->config,$this->options);\n $this->phpThumb->initialize();\n $this->phpThumb->setParameter('config_cache_directory',$this->config['cachePath']);\n $this->phpThumb->setParameter('config_allow_src_above_phpthumb',true);\n $this->phpThumb->setParameter('allow_local_http_src',true);\n $this->phpThumb->setParameter('config_document_root',$this->modx->context->getOption('base_path',MODX_BASE_PATH,$this->config));\n $this->phpThumb->setCacheDirectory();\n $this->phpThumb->set($this->input);\n }",
"private function setAuthManagerService() : void\n {\n $ini = $this->ini;\n $this->di->setShared(Service::AUTH_MANAGER, function () use ($ini) {\n $expirationTime = $ini->get('security')->expirationTime;\n $authManager = new AuthManager($expirationTime);\n $authManager->registerAccountType(\n UsernameAccountType::NAME,\n new UsernameAccountType()\n );\n\n return $authManager;\n });\n }",
"private function initOptions()\n {\n // Get the config options.\n $config_options = Config::get('adfly');\n\n // Push the config options to the options array.\n $this->setOptions($config_options);\n }",
"public function setService() {\n\t\n\t\t$settings = $this->getSettingsCarrier();\n\t\t\n\t\t$this->_service = array(\n\t\t\t'notemail'\t\t\t\t=> ($settings['notemail'] == 1 ? $this->_receiver['mail'] : null),\n\t\t\t'notesms'\t\t\t\t=> ($settings['notesms'] == 1 ? $this->_receiver['sms'] : null),\n\t\t\t'prenote'\t\t\t\t=> $settings['prenote'],\n\t\t\t'prenote_from'\t\t\t=> $settings['prenote_from'],\n\t\t\t'prenote_receiver'\t\t=> ($settings['prenote_receiver'] == '' ? $this->_receiver['mail'] : $settings['prenote_receiver']),\n\t\t\t'prenote_message'\t\t=> ($settings['prenote_message'] != '' ? $settings['prenote_message'] : null),\n\t\t\t'flex'\t\t\t\t\t=> ($this->getFlexDeliveryNote() ? true : null),\n\t\t\t'waybillid'\t\t\t\t=> $this->getWaybill($settings['waybillid'],$this->_receiver['country']),\n\t\t\t'smartdelivery'\t\t\t=> $this->isSmartDelivery(),\n\t\t\t'smartdelivery_start'\t=> $this->getSmartDeliveryTimeStart(),\n\t\t\t'smartdelivery_end'\t\t=> $this->getSmartDeliveryTimeEnd(),\n\t\t\t);\n\t\n\t}",
"public function __construct()\n {\n // ServiceList::addLocalService(\"payment_service\", \"localhost\", 8080, false);\n // ServiceList::addLocalService(\"fail_service\", \"localhost\", 8080, false);\n ServiceList::addLocalService(\"userService\", \"localhost\", 8080, false);\n \n }",
"private function initializeServices()\n {\n $this->em = $this->getService('doctrine.orm.entity_manager');\n $this->bookingService = $this->getService('front_end.services.booking');\n }",
"private function initializeServices()\n {\n $this->emailManager = $this->getService('mycp.service.email_manager');\n $this->em = $this->getService('doctrine.orm.entity_manager');\n $this->timeService = $this->getService('time');\n $this->translatorService = $this->getService('translator');\n $this->logger = $this->getService('mycp.logger');\n }",
"protected function initialize() {\n\n\t\t\t$sections = $this->ini->getSections();\n\n\t\t\tif ( !in_array( 'main', $sections ) ) {\n\t\t\t\tthrow new \\browserfs\\Exception('A [main] section is required in configuration file.');\n\t\t\t}\n\n\t\t\t$services = $this->ini->getSectionProperties( 'main' );\n\n\t\t\tif ( in_array( 'staging', $services ) ) {\n\t\t\t\t\n\t\t\t\t$this->staging = $this->ini->getProperty('main', 'staging', 'development' );\n\t\t\t\t\n\t\t\t\tif ( !in_array( $this->staging, [ 'development', 'staging', 'production' ] ) ) {\n\t\t\t\t\tthrow new \\browserfs\\Exception('Bad staging value inside of [main]: allowed \"development\", \"staging\", \"production\"' );\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\n\t\t\tforeach ( $services as $serviceName ) {\n\n\t\t\t\tif ( !in_array( $sectionName = ( $serviceName . '.' . $this->staging ), $sections ) ) {\n\t\t\t\t\t$sectionName = $serviceName;\n\t\t\t\t}\n\n\t\t\t\tif ( !in_array( $sectionName, $sections ) ) {\n\t\t\t\t\tthrow new \\browserfs\\Exception('Failed to load service \"' . $sectionName . '\": An appropriated section for it does not exist in config file!' );\n\t\t\t\t}\n\n\t\t\t\t$serviceProperties = [];\n\n\t\t\t\tforeach ( $this->ini->getSectionProperties( $sectionName ) as $sectionPropertyName ) {\n\t\t\t\t\t$serviceProperties[ $sectionPropertyName ] = $this->ini->getPropertyMulti( $sectionName, $sectionPropertyName );\n\t\t\t\t}\n\n\t\t\t\t$service = \\browserfs\\website\\Service::factory( \n\t\t\t\t\t$serviceName, \n\t\t\t\t\t$this->ini->getProperty( 'main', $serviceName, '' ), \n\t\t\t\t\t$this->namespace, \n\t\t\t\t\t$serviceProperties \n\t\t\t\t);\n\n\t\t\t\t$service->setDIInjector($this);\n\n\t\t\t\t$this->services[ $serviceName ] = $service;\n\t\t\t}\n\n\t\t}",
"private function initHttp()\n {\n $this->di->mapService('core.http', '\\Core\\Http\\Http', [\n 'core.http.cookie',\n 'core.http.header'\n ]);\n $this->di->mapService('core.http.cookie', '\\Core\\Http\\Cookie\\CookieHandler');\n $this->di->mapService('core.http.header', '\\Core\\Http\\Header\\HeaderHandler');\n\n $this->http = $this->di->get('core.http');\n }",
"public function setService(){\n if($this->getRecord()->getRecordType() === \"yt\"){\n $this->service = new YoutubeService();\n }\n if($this->getRecord()->getRecordType() === \"gm\"){\n $this->service = new GoogleMapService();\n }\n }",
"public static function run()\n {\n Config::init();\n self::initializeServices([\n Services\\AssetsService::class,\n Services\\Admin\\LinksService::class,\n Services\\CustomEndpointService::class,\n Services\\Admin\\MenuPageService::class,\n Services\\Admin\\SettingsService::class,\n ]);\n }",
"protected function init()\n {\n $config = $this->getConfig();\n $this->service = new \\Vimeo\\Vimeo(\n $config->vimeo->client_id, $config->vimeo->client_secret\n );\n\n $token = $this->service->clientCredentials();\n $this->service->setToken($token['body']['access_token']);\n }",
"private function initDi() {\n\t\t$this->_di = new FactoryDefault();\n\t}",
"public function setupWebservice() {\n $config = array();\n $credentials = Kohana::config('webserviceclient.basic_auth');\n if ($credentials) {\n $config['basic_auth'] = $credentials;\n }\n $this->service = new Web_Service($config);\n }",
"public function __construct()\n {\n $this->generatePDFSaleQuotationService = new GeneratePDFSaleQuotationService();\n }",
"public abstract function service();",
"private function iNetServicesConfigurationStartup()\n {\n /**\n * Request access to ServiceRequestContainer.\n */\n $this->setProperty('service', new ServiceRequestContainer($this));\n $this->registerAdusername($this->service);\n $this->set('domain_url', 'https://' . $this->service->get('Request')->server->get('SERVER_NAME'));\n $this->set('redirect_logout_shibboleth','/Shibboleth.sso/Logout?return=https://a4.ucsd.edu/tritON/logout?target='.$this->get('domain_url').'/sso/1/panel/');\n $this->service->get('Benchmark')->start();\n $this->service->get('Security')->requireSSL();\n // $this->service->get('Security')->checkReferer();\n $this->service->get('Session')->startSession();\n $this->service->get('Security')->runApplicationTurnKey();\n $this->service->get('dbh');\n $this->service->get('Session')->switchUserPassport($this->service->get('Persistence'));\n $this->service->get('ViewFactory');\n\n return $this;\n }",
"protected function _init()\n {\n foreach ($this->_options AS $name => $value) {\n switch ($name) {\n case 'server':\n $this->setServers($value);\n break;\n case 'blockedquerytype':\n $this->setBlockedQueryTypes($value);\n break;\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
HTML htmler for refreshes. | public function refreshes()
{
if ($this->refreshes === 'yes') {
return '<span class="label label-info">Yes</span>';
}
return '<span class="label label-warning">No</span>';
} | [
"public static function refresh()\n\t{\n\t\t?>\n\t\t<script type=\"text/javascript\">\n\t\t\tlocation.reload();\n\t\t</script>\n\t\t<?php\n\t}",
"public function render_refresh_ui() {\n\t $cats = get_option( 'pf_ab_categories' );\n\t $last_refreshed = isset( $cats['last_updated'] ) ? date( 'M j, Y H:i', $cats['last_updated'] ) : 'never';\n\t ?>\n\n\t <div id=\"refresh-ab-feeds\">\n\n\t\t<p>\n\t\t <?php\n\t\t $ab_refresh_when = sprintf(__('The list of feeds from academicblogs.org was last refreshed at <strong>%d</strong>. Click the Refresh button to do a refresh right now.', 'pf'), $last_refreshed);\n\t\t echo $ab_refresh_when;\n\t\t ?>\n\t\t</p>\n\n\t\t<a class=\"button\" id=\"calc_submit\"><?php _e('Refresh', 'pf') ?></a>\n\n\t\t<br />\n\t\t<div id=\"calc_progress\"></div>\n\t\t<br />\n\t </div>\n\n\t <?php\n\t}",
"function cellRefresh() {\n\t\t?>\n\t\t<td>\n\t\t\t<span style=\"cursor:pointer;\" class=\"ref\" id=\"ref-id-<?php echo $this->id(); ?>\">\n\t\t\t\t<span id=\"fa-ref-<?php echo $this->id(); ?>\" class=\"fa fa-2x fa-refresh\" />\n\t\t\t</span>\n\t\t</td>\n\t\t<?php\n\t}",
"public static function refresh() {\n\t\tself::redirect(helper_url::getURL());\n\t}",
"function tombolRefresh(){\n\t\t$title = Yii::t('app', 'Refresh');\n\t\t$url = Url::toRoute(['/sistem/user-profile']);\n\t\t$options = ['id'=>'store-id-refresh',\n\t\t\t\t 'data-pjax' => 0,\n\t\t\t\t 'class'=>\"btn btn-info btn-xs\",\n\t\t\t\t];\n\t\t$icon = '<span class=\"fa fa-history fa-lg\"></span>';\n\t\t$label = $icon . ' ' . $title;\n\n\t\treturn $content = Html::a($label,$url,$options);\n\t}",
"function refresher($msec) {\n\t\tif ( $msec )\n\t\t\treturn \"<html><head><script type='text/javascript'>window.onload=setTimeout('window.location.reload()', $msec);</script>\\n</head>\\n<body>\\n\";\n\t\telse\n\t\t\treturn \"<html><head><script type='text/javascript'>window.onload=window.location.reload();</script>\\n</head>\\n<body>\\n\";\n\t}",
"private function outputRefreshResponse()\n {\n if ($this->isAjaxRequest()) {\n http_response_code(503);\n exit(t('stache_building'));\n }\n\n $html = sprintf('<meta http-equiv=\"refresh\" content=\"1; URL=\\'%s\\'\" />', request()->getUri());\n\n exit($html);\n }",
"public function refresh() {\n\t\t// through ajax requests. But we don't want to do it if we're processing something from the url\n\t}",
"public function refresh() {\n\t\t$this->getPage()->reload();\n\t\tLog::instance()->write( 'Refreshed the current page', 1 );\n\t}",
"function create_refresh_button()\n{\necho \"<button type='submit' name='refresh' value='0'>Refresh/Update Page.</button>\";\n}",
"public function getRefreshUrl()\n {\n return $this->getUrl('*/*/refresh', array('_current' => true));\n }",
"public function refresh()\n {\n }",
"public static function refresh()\n {\n $app = Application::instance();\n $app->response->redirect(Url::current());\n }",
"function output_confirm_refresh($title,$message,$targetURL) {\n\tglobal $gSession;\n\t## prepare the template file\n\t$select_template = new Template();\n\t$select_template->set_templatefile(array(\"body\" => ENGINE.\"modules/interface/confirm_refresh.tpl\"));\n\t$select_template->set_var('title',$title);\n\t$select_template->set_var('message',$message);\n\n\tif($targetURL != '') {\n\t\t$targetURL = \"<meta http-equiv='refresh' content='2; url=\".$targetURL.\"'>\";\n\t\t$select_template->set_var('MAINREFRESH',$targetURL);\n\t}\t\t\n\t\n\t$select_template->pfill_block(\"body\");\n}",
"function reload($class,$msg,$uri,$timeout){\n\t if($timeout <= 0){ $timeout = 10000; } else { $timeout = $timeout * 1000; } // Default 10 sec\n\t if($class=='info'){ $c = 'class=\"alert alert-info\" role=\"alert\"'; }\n\t if($class=='warning'){ $c = 'class=\"alert alert-warning\" role=\"alert\"'; }\nreturn <<<E\n<tr>\n <td>\n <div {$c}><i class=\"fa fa-sync fa-spin\"></i> {$msg}</div>\n\t<script type=\"text/javascript\">\n\tvar count = {$timeout}/1000;\n\tvar counter = setInterval(timer, 1000);\n\tfunction timer() {\n\t count=count-1;\n\t if(count <= 0) {\n\t\tclearInterval(counter);\n\t\t//return;\n\t\twindow.location = \"{$uri}\";\n\t }\n\t document.getElementById(\"gcd\").innerHTML = count;\n\t}\n\t</script>\n </td>\n</tr>\nE;\n\t}",
"function give_reports_refresh_button() {\n\n\t$url = wp_nonce_url(\n\t\tadd_query_arg(\n\t\t\tarray(\n\t\t\t\t'give_action' => 'refresh_reports_transients',\n\t\t\t\t'give-messages[]' => 'refreshed-reports',\n\t\t\t)\n\t\t), 'give-refresh-reports'\n\t);\n\n\techo Give()->tooltips->render_link(\n\t\tarray(\n\t\t\t'label' => esc_attr__( 'Clicking this will clear the reports cache.', 'give' ),\n\t\t\t'tag_content' => '<span class=\"give-admin-button-icon give-admin-button-icon-update\"></span>' . esc_html__( 'Refresh Report Data', 'give' ),\n\t\t\t'link' => $url,\n\t\t\t'position' => 'left',\n\t\t\t'attributes' => array(\n\t\t\t\t'class' => 'button alignright give-admin-button',\n\t\t\t),\n\t\t)\n\t);\n}",
"function html() {\n\n\t\t}",
"Public function refresh (){\n $page = $_SERVER['PHP_SELF'];\n $sec = \"10\";\n header(\"Refresh: $sec; url=$page\"); \n }",
"function genMetaRefresh($jobId) {\n $this->printDebugMessage('genMetaRefresh', 'Begin', 2);\n $statusUrl = \"?jobId=$jobId\";\n $retVal = \"<meta http-equiv=\\\"refresh\\\" content=\\\"10;url=$statusUrl\\\">\";\n $this->printDebugMessage('genMetaRefresh', 'Begin', 2);\n return $retVal;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Runs the widget. This renders the article end tag. | public function run()
{
echo PHtml::closeTag('article');
} | [
"public function run()\n {\n $this->renderContainerEnd();\n echo CHtml::closeTag('div') . \"\\n\";\n }",
"public function widget_end( $args ) {\n\t\t\techo $args['after_widget'];\n\t\t}",
"public function widget_end( $args ) {\n\t\t\techo '' . $args['after_widget'];\n\t\t}",
"public function run() {\n $this->render('_slider',array('items'=>$this->items, 'options'=>$this->options)); // render view file which is in \"views/_slider.php\"\n return parent::run();\n }",
"public function post_widget() {\r\n\t\techo '<div id=\"beehive-post-statistics-app\"></div>';\r\n\r\n\t\t// Enqueue assets.\r\n\t\tAssets::instance()->enqueue_style( 'beehive-post-statistics' );\r\n\t\tAssets::instance()->enqueue_script( 'beehive-post-statistics' );\r\n\t}",
"public function renderContentEnd() {\r\n\t\t\r\n\t\techo CHtml::closeTag('div');\r\n\t}",
"protected function render()\r\n {\r\n $settings = $this->get_settings_for_display();\r\n include NVM_DIR_PATH . '/inc/elementor/widgets/' . static::class . '/render.php';\r\n }",
"public function run() {\n /*\n * Call set title function\n * Call draw calendar function\n * render calendar view\n */\n $this->registerScripts();\n $this->setTitle();\n $this->setControlMenu();\n $this->drawCalendar();\n $this->render(\"advanceCalendar\");\n }",
"public function endBody()\n {\n echo \"\\n\" . Html::endTag('div');\n }",
"public function run() {\n $buttons = $this->createPageButtons();\n if (empty($buttons))\n return;\n echo $this->header;\n $list = implode(\"\\n\", $buttons);\n echo CHtml::tag('div', $this->htmlOptions, $list);\n echo $this->footer;\n }",
"function afterRender() {\n\t\tif (!$this->enabled) {\n\t\t\treturn;\n\t\t}\n\t\techo $this->writeEvents(true);\n\t}",
"function renderEnd() {\r\n\t\t$c = ob_get_contents();\r\n\t\tob_end_clean();\r\n\t\t\r\n\t\t$visible = true;\r\n\t\t$test_content = trim($c);\r\n\t\tpreg_match(\"/^<div\\s+class=\\\\\\\"panel__content\\\\\\\">(.*)<\\/div>$/ims\", $test_content, $matches);\r\n\t\tif (isset($matches[1])) {\r\n\t\t\t$test_content = trim($matches[1]);\r\n\t\t}\r\n\t\tif ($test_content == \"\") {\r\n\t\t\t$visible = false;\r\n\t\t}\r\n\t\t// BEGIN\r\n\t\tif (!KT_is_ajax_request()) {\r\n\t\t\techo '<div id=\"__'.$this->id.'\" class=\"panel_class\" style=\"'.(!$visible ? 'display: none' : '').'\">';\r\n\t\t\tinclude($this->templates_path . $this->style. '/begin.html');\r\n\t\t} \r\n\t\t// CONTENT \r\n\t\techo $c;\r\n\t\t// END\r\n\t\tif (!KT_is_ajax_request()) {\r\n\t\t\tinclude($this->templates_path . $this->style. '/end.html');\r\n\t\t\techo \"</div>\";\r\n\t\t}\r\n\t\tif (count($this->lateHtml) > 0) {\r\n\t\t\techo join(\"\", $this->lateHtml);\r\n\t\t}\r\n\t}",
"public static function endRight()\n\t{\n\t\techo Html::endTag('div');\n\t}",
"protected function _render()\r\n\t{\r\n\t\treturn $this->_fetchView('widget');\r\n\t}",
"public function run() {\n $this->registerClientScript();\n $buttons = $this->createPageButtons();\n if (empty($buttons))\n return;\n echo $this->header;\n echo Html::tag('ul', $this->htmlOptions, implode(\"\\n\", $buttons));\n echo $this->footer;\n }",
"public function post_after_article() {\n\t\tglobal $post;\n\t\t$categories = get_the_category( $post->ID );\n\t\t?>\n\n\t\t<div class=\"section section-blog-info\">\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-md-6\">\n\t\t\t\t\t<div class=\"entry-categories\"><?php esc_html_e( 'Categories:', 'hestia' ); ?>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tforeach ( $categories as $category ) {\n\t\t\t\t\t\t\techo '<span class=\"label label-primary\"><a href=\"' . esc_url( get_category_link( $category->term_id ) ) . '\">' . esc_html( $category->name ) . '</a></span>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t</div>\n\t\t\t\t\t<?php the_tags( '<div class=\"entry-tags\">' . esc_html__( 'Tags: ', 'hestia' ) . '<span class=\"entry-tag\">', '</span><span class=\"entry-tag\">', '</span></div>' ); ?>\n\t\t\t\t</div>\n\t\t\t\t<?php do_action( 'hestia_blog_social_icons' ); ?>\n\t\t\t</div>\n\t\t\t<hr>\n\t\t\t<?php\n\t\t\t$this->maybe_render_author_box();\n\t\t\tif ( comments_open() || get_comments_number() ) :\n\t\t\t\tcomments_template();\n\t\t\tendif;\n\t\t\t?>\n\t\t</div>\n\t\t<?php\n\t}",
"public function run()\n\t{\n\t\t$widgetID=$this->getId();\n\t\t\n\t\tlist($name,$id)=$this->resolveNameID();\n\t\tif(isset($this->htmlOptions['id']))\n\t\t\t$id=$this->htmlOptions['id'];\n\t\telse\n\t\t\t$this->htmlOptions['id']=$id;\n\t\tif(isset($this->htmlOptions['name']))\n\t\t\t$name=$this->htmlOptions['name'];\n\n\t\t$this->registerClientScript($id);\n\t\t// $this->htmlOptions[\"class\"]=\"form-control\";\n\t\tif(isset($this->htmlOptions[\"class\"]))\n\t\t\t$this->htmlOptions[\"class\"].=\" sir-trevor-{$widgetID}\";\n\t\telse\n\t\t\t$this->htmlOptions[\"class\"]=\"sir-trevor-{$widgetID}\";\n\n\t\t#echo \"<small class=\\\"text-muted\\\"><em>Here a message for user</em></small>\";\n\t\techo CHtml::activeTextArea($this->model,$this->attribute,$this->htmlOptions);\n\t\t\n\t}",
"public function run() {\r\n $this->render(\"itemGroup\");\r\n }",
"protected function render() {\n\t\t?>\n\t\t<div class=\"elementor-divider\">\n\t\t\t<span class=\"elementor-divider-separator\"></span>\n\t\t</div>\n\t\t<?php\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Formats a date according to the format specified in the general settings page. It can take a string, a DateTime, or a Time instance. If $includeTimezone === true, will return the tz abbreviation at the end of the date (i.e. CST, PST, etc) | function app_date($date, bool $includeTime = false, bool $includeTimezone = false): string
{
$format = $includeTime
? [
service('settings')->get('App.dateFormat'),
service('settings')->get('App.timeFormat'),
$includeTimezone ? 'T' : '',
]
: [
setting('App.dateFormat'),
$includeTimezone ? 'T' : '',
];
$format = trim(implode(' ', $format));
if (is_string($date)) {
$date = Time::parse($date);
}
$date->setTimezone(service('settings')->get('App.appTimezone'));
return $date->format($format);
} | [
"public static function printDate($time, $format = '', $tzoutput = 'tzserver', $outputlangs = '', $encodetooutput = false) {\n global $conf, $langs;\n\n $to_gmt = false;\n $offsettz = $offsetdst = 0;\n if ($tzoutput) {\n $to_gmt = true; // For backward compatibility\n if (is_string($tzoutput)) {\n if ($tzoutput == 'tzserver') {\n $to_gmt = false;\n $offsettz = $offsetdst = 0;\n }\n if ($tzoutput == 'tzuser') {\n $to_gmt = true;\n $offsettz = (empty($_SESSION['siemp_tz']) ? 0 : $_SESSION['siemp_tz']) * 60 * 60;\n $offsetdst = (empty($_SESSION['siemp_dst']) ? 0 : $_SESSION['siemp_dst']) * 60 * 60;\n }\n if ($tzoutput == 'tzcompany') {\n $to_gmt = false;\n $offsettz = $offsetdst = 0; // TODO Define this and use it later\n }\n }\n }\n\n if (!is_object($outputlangs))\n $outputlangs = $langs;\n\n // Si format non defini, on prend $conf->format_date_text_short sinon %Y-%m-%d %H:%M:%S\n if (!$format)\n $format = (isset($conf->format_date_text_short) ? $conf->format_date_text_short : '%Y-%m-%d %H:%M:%S');\n\n // Change predefined format into computer format. If found translation in lang file we use it, otherwise we use default.\n if ($format == 'day')\n $format = (Translate::trans(\"FormatDateShort\") != \"FormatDateShort\" ? Translate::trans(\"FormatDateShort\") : $conf->format_date_short);\n if ($format == 'hour')\n $format = (Translate::trans(\"FormatHourShort\") != \"FormatHourShort\" ? Translate::trans(\"FormatHourShort\") : $conf->format_hour_short);\n if ($format == 'hourduration')\n $format = (Translate::trans(\"FormatHourShortDuration\") != \"FormatHourShortDuration\" ? Translate::trans(\"FormatHourShortDuration\") : $conf->format_hour_short_duration);\n if ($format == 'daytext')\n $format = (Translate::trans(\"FormatDateText\") != \"FormatDateText\" ? Translate::trans(\"FormatDateText\") : $conf->format_date_text);\n if ($format == 'daytextshort')\n $format = (Translate::trans(\"FormatDateTextShort\") != \"FormatDateTextShort\" ? Translate::trans(\"FormatDateTextShort\") : $conf->format_date_text_short);\n if ($format == 'dayhour')\n $format = (Translate::trans(\"FormatDateHourShort\") != \"FormatDateHourShort\" ? Translate::trans(\"FormatDateHourShort\") : $conf->format_date_hour_short);\n if ($format == 'dayhourtext')\n $format = (Translate::trans(\"FormatDateHourText\") != \"FormatDateHourText\" ? Translate::trans(\"FormatDateHourText\") : $conf->format_date_hour_text);\n if ($format == 'dayhourtextshort')\n $format = (Translate::trans(\"FormatDateHourTextShort\") != \"FormatDateHourTextShort\" ? Translate::trans(\"FormatDateHourTextShort\") : $conf->format_date_hour_text_short);\n\n // Format not sensitive to language\n if ($format == 'dayhourlog')\n $format = '%Y%m%d%H%M%S';\n if ($format == 'dayhourldap')\n $format = '%Y%m%d%H%M%SZ';\n if ($format == 'dayhourxcard')\n $format = '%Y%m%dT%H%M%SZ';\n if ($format == 'dayxcard')\n $format = '%Y%m%d';\n if ($format == 'dayrfc')\n $format = '%Y-%m-%d'; // DATE_RFC3339\n if ($format == 'dayhourrfc')\n $format = '%Y-%m-%dT%H:%M:%SZ'; // DATETIME RFC3339\n\n\n // If date undefined or \"\", we return \"\"\n if (String::strlen($time) == 0)\n return ''; // $time=0 allowed (it means 01/01/1970 00:00:00)\n\n\n //print 'x'.$time;\n\n if (preg_match('/%b/i', $format)) { // There is some text to translate\n // We inhibate translation to text made by strftime functions. We will use trans instead later.\n $format = str_replace('%b', '__b__', $format);\n $format = str_replace('%B', '__B__', $format);\n }\n if (preg_match('/%a/i', $format)) { // There is some text to translate\n // We inhibate translation to text made by strftime functions. We will use trans instead later.\n $format = str_replace('%a', '__a__', $format);\n $format = str_replace('%A', '__A__', $format);\n }\n\n // Analyze date (deprecated) Ex: 1970-01-01, 1970-01-01 01:00:00, 19700101010000\n if (preg_match('/^([0-9]+)\\-([0-9]+)\\-([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?/i', $time, $reg)\n || preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])$/i', $time, $reg)) {\n // This part of code should not be used.\n Syslog::log(\"Functions.lib::Date::printDate function call with deprecated value of time in page \" . $_SERVER[\"PHP_SELF\"], LOG_WARNING);\n // Date has format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' or 'YYYYMMDDHHMMSS'\n $syear = $reg[1];\n $smonth = $reg[2];\n $sday = $reg[3];\n $shour = $reg[4];\n $smin = $reg[5];\n $ssec = $reg[6];\n\n $time = self::mktime($shour, $smin, $ssec, $smonth, $sday, $syear, true);\n $ret = adodb_strftime($format, $time + $offsettz + $offsetdst, $to_gmt);\n } else {\n // Date is a timestamps\n if ($time < 100000000000) { // Protection against bad date values\n $ret = adodb_strftime($format, $time + $offsettz + $offsetdst, $to_gmt);\n }\n else\n $ret = 'Bad value ' . $time . ' for date';\n }\n\n if (preg_match('/__b__/i', $format)) {\n // Here ret is string in PHP setup language (strftime was used). Now we convert to $outputlangs.\n $month = adodb_strftime('%m', $time + $offsettz + $offsetdst);\n if ($encodetooutput) {\n $monthtext = Translate::transnoentities('Month' . $month);\n $monthtextshort = Translate::transnoentities('MonthShort' . $month);\n } else {\n $monthtext = Translate::transnoentitiesnoconv('Month' . $month);\n $monthtextshort = Translate::transnoentitiesnoconv('MonthShort' . $month);\n }\n //print 'monthtext='.$monthtext.' monthtextshort='.$monthtextshort;\n $ret = str_replace('__b__', $monthtextshort, $ret);\n $ret = str_replace('__B__', $monthtext, $ret);\n //print 'x'.Translate::$charset_output.'-'.$ret.'x';\n //return $ret;\n }\n if (preg_match('/__a__/i', $format)) {\n $w = adodb_strftime('%w', $time + $offsettz + $offsetdst);\n $dayweek = Translate::transnoentitiesnoconv('Day' . $w);\n $ret = str_replace('__A__', $dayweek, $ret);\n $ret = str_replace('__a__', String::substr($dayweek, 0, 3), $ret);\n }\n\n return $ret;\n }",
"private function get_date_format() {\n\t\tstatic $timezone_option;\n\n\t\tif ( $timezone_option === null ) {\n\t\t\t// When there isn't a timezone set\n\t\t\t$timezone_option = get_option( 'timezone_string' );\n\t\t}\n\n\t\t// Is there a timezone option and does it exists in the list of 'valid' timezone.\n\t\tif ( $timezone_option !== '' && in_array( $timezone_option, DateTimeZone::listIdentifiers() ) ) {\n\t\t\treturn DateTime::W3C;\n\t\t}\n\n\t\treturn 'Y-m-d';\n\t}",
"function getFormattedDate($timestamp, $timezone = FALSE, $dateIsUTC = TRUE)\r\n\t{\r\n\t\tif ($timezone === FALSE) {\r\n\t\t\t$timezone = Date_API::getPreferredTimezone();\r\n\t\t}\r\n\t\t$date = new Date($timestamp);\r\n\t\t// now convert to another timezone and return the date\r\n\t\tif ($dateIsUTC) {\r\n $date->convertTZById($timezone);\r\n } else {\r\n $date->setTZbyID($timezone);\r\n }\r\n\t\treturn $date->format('%a, %d %b %Y, %H:%M:%S ') . $date->tz->getShortName();\r\n\t}",
"function eventbrite_event_get_event_date( $date, $timezone, $date_format = '' ) {\n\tif ( ! $date_format )\n\t\t$date_format = get_option( 'date_format' );\n\n\t$tz = new DateTimeZone( $timezone );\n\t$dt = new DateTime( $date, $tz );\n\n\treturn $dt->format( $date_format );\n}",
"static function format_date($date,$format='')\n\t{\n\t\treturn egw_time::to($date,$format);\n\t}",
"public static function get_formatted_date_according_to_wp_settings($date){\n $date_format = get_option('date_format');\n if (empty($date_format)) {\n //WordPress's date form settings is not set. Lets set a default format.\n $date_format = 'Y-m-d';\n }\n\n $date_obj = new DateTime($date);\n $formatted_date = $date_obj->format($date_format);//Format the date value using date format settings\n return $formatted_date; \n }",
"function smarty_modifier_bit_date_format( $pString, $format = \"%b %e, %Y\", $pTraFormat = \"%b %e, %Y\" ) {\n\tglobal $gBitSystem, $gBitUser, $gBitLanguage;\n\n\tif( empty( $pString )) {\n\t\treturn '';\n\t}\n\n\t// we translate the entire date format string for total control\n\tif( $gBitSystem->getConfig( \"bitlanguage\", \"en\" ) != $gBitLanguage->mLanguage ) {\n\t\t$format = tra( $pTraFormat );\n\t}\n\n\tif( $gBitUser->getPreference( 'site_display_utc' ) == 'Fixed' && class_exists( 'DateTime' ) ) {\n\t\tdate_default_timezone_set( $gBitUser->getPreference( 'site_display_timezone', 'UTC' ) );\n\t\tif ( is_numeric( $pString )) {\n\t\t\t$dateTimeUser = new DateTime( '@'.$pString );\n\t\t} else {\n\t\t\t$dateTimeUser = new DateTime( $pString );\n\t\t}\n\t\t$disptime = strtotime($dateTimeUser->format(DATE_W3C));\n\t\treturn $gBitSystem->mServerTimestamp->strftime( $format, $disptime );\n\t} else {\n\t\t if( $gBitSystem->get_display_offset() ) {\n\t\t\t$format = preg_replace( \"/ ?%Z/\",'', $format );\n\t\t} else {\n\t\t\t$format = preg_replace( \"/%Z/\", \"UTC\", $format );\n\t\t}\n\t\t$disptime = $gBitSystem->mServerTimestamp->getDisplayDateFromUTC( $pString );\n\t}\n\treturn $gBitSystem->mServerTimestamp->strftime( $format, $disptime, TRUE );\n}",
"function formatDateExtra($datestr, $regionstr = null, $formatstr = null)\n {\n if($regionstr == null)\n {\n $region = $this->config['timezone']['frontend']['region'];\n }\n else\n {\n $region = $regionstr;\n }\n\n if($formatstr == null)\n {\n $format = $this->config['timezone']['frontend']['dateformat'];\n }\n else\n {\n $format = $formatstr;\n }\n\n $sql = \"SELECT CONVERT_TZ('\" . $datestr . \"', '{$this->config['timezone']['default']['region']}', '{$region}') as converteddate\";\n\n $resultarray = $this->fetch_array($this->execute_query($sql));\n\n return $this->formatDate($resultarray['converteddate'], $format);\n }",
"function ffd_date_format() {\r\n\treturn apply_filters( 'ffd_date_format', get_option( 'date_format' ) );\r\n}",
"public static function get_date_format()\n {\n return apply_filters('rp_wcec_date_format', get_option('date_format'));\n }",
"public function formatDate($date);",
"public function formatDate() {\n\t\treturn $this->dateTime->format('l j F Y'); \n\t}",
"function localizeDateTimes($inputStr, $formatOverride = null) {\n // Grab the format from the override if it exists, if not check\n // for the config option, otherwise default format\n $format = (($formatOverride != null) \n\t ? $formatOverride \n\t : ((WorkbenchConfig::get()->value(\"localeDateTimeFormat\") != null)\n\t ? WorkbenchConfig::get()->value(\"localeDateTimeFormat\")\n\t : 'Y-m-d\\\\TH:i:s.000P'));\n\t \n $timezone = WorkbenchConfig::get()->value(\"convertTimezone\");\n \n // Short-circuit if we aren't actually doing anything useful.\n if ($formatOverride == null && $timezone == \"\" && WorkbenchConfig::get()->value(\"localeDateTimeFormat\") == \"\") {\n return $inputStr;\n } \n\n date_default_timezone_set(\"UTC\");\n \n return preg_replace_callback('|\\d\\d\\d\\d\\-\\d\\d\\-\\d\\dT\\d\\d\\:\\d\\d:\\d\\d\\.\\d\\d\\dZ|', \n create_function(\n '$matches',\n \n '$utcDate = new DateTime($matches[0]);' .\n 'if (\\'' . $timezone . '\\'!= \\'\\') { ' . \n '$utcDate->setTimezone(new DateTimeZone(\\'' . $timezone . '\\'));'.\n '}' .\n 'return $utcDate->format(\\'' . $format . '\\');'\n ),\n $inputStr);\n}",
"function dja_date_format($value, $format = null, $use_l10n = null) {\n if ($format === null) {\n $format = 'DATE_FORMAT';\n }\n\n if ($use_l10n || ($use_l10n === null && Dja::getSetting('USE_L10N'))) {\n $lang = Dja::getSetting('LANGUAGE_CODE');\n \n $translateDateFormatToICUPattern = function($format) {\n $map = [\"'\"=>\"''\",'d'=>'dd','D'=>'eee','jS'=>'d','j'=>'d','l'=>'eeee','N'=>'c','S'=>'','w'=>'e','z'=>'D','W'=>'w','F'=>'MMMM','m'=>'MM','M'=>'MMM','n'=>'M','t'=>'','L'=>'','o'=>'Y','y'=>'yy','Y'=>'y','A'=>'a','B'=>'','g'=>'h','G'=>'H','h'=>'hh','H'=>'HH','i'=>'mm','s'=>'ss','u'=>'','e'=>'vv','I'=>'','O'=>'xx','P'=>'xxx','T'=>'z','Z'=>'','c'=>\"y-MM-dd'T'HH:mm:ssxxx\",'u'=>'','r'=>'eee,ddMMMyHH:mm:ssxx'];\n\n return strtr($format, $map);\n };\n \n $format = $translateDateFormatToICUPattern($format); \n \n if($value instanceof DateTime) {\n $tz = $value->getTimeZone()->getName();\n } else {\n $tz = null;\n }\n \n $ft = new IntlDateFormatter($lang, IntlDateFormatter::FULL, IntlDateFormatter::FULL, $tz, null, $format);\n \n return $ft->format($value); \n \n } elseif ($format=='DATE_FORMAT') {\n $format = Dja::getSetting('DATE_FORMAT');\n } elseif ($format=='SHORT_DATE_FORMAT') {\n $format = Dja::getSetting('SHORT_DATE_FORMAT');\n }\n\n // Mimic Django.\n $format = str_replace(array('N', 'e'), array('M.', 'O'), $format);\n\n if($value instanceof DateTime) {\n return $value->format($format);\n } else {\n return date($format, $value);\n }\n}",
"function parseDateTime($string, $timezone= null, $dformat = '', $tformat = '') {\n $timezone = new DateTimeZone($timezone ? $timezone : CalendarOptions::getActiveTimezone());\n \n $date = new DateTime(\n $string,\n $timezone\n );\n if ($timezone) {\n // If our timezone was ignored above, force it.\n $date->setTimezone($timezone);\n }\n \n if ($dformat) {\n return $date->format($dformat);\n }\n \n // if not format is given, return the ISO 8601 date format\n return $date->format('c');\n }",
"public function utcDate($scope, $date, $includeTime = false, $format = null);",
"function format_date(Carbon $date = null, $format = null)\n{\n if ($date === null) {\n return null;\n }\n\n /* Default to MySQL DateTime format */\n $format = $format ? $format : \"Y-m-d H:i:s\";\n\n return localize_date($date)->format($format);\n}",
"function format_date( $p_format, $p_date=NULL ) {\n\t\t//Impresion de fecha compatible con la clase PEAR/DATE\n\t\tif (!is_null($p_date)){\n\t\t\t$strdate=date( 'Y-m-d H:i:s T', $p_date );\n\t\t}else{\n\t\t\t$strdate=date( 'Y-m-d H:i:s T' );\n\t\t}\n\t\t$obj = new CDate($strdate);\n\t\treturn $obj ? $obj->format( $p_format ) : '-';\n\t\t\n\t\t//Impresion de fecha original\n\t\t//echo date( $p_format, $p_date );\n\t}",
"protected function _getFormattedDate()\n {\n $Time = new Time($this->created);\n\n return $Time->i18nFormat('MMMM d, Y', 'America/New_York');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add the command buttons of a question properties form | function addQuestionFormCommandButtons($form)
{
//if (!$this->object->getSelfAssessmentEditingMode() && !$_GET["calling_test"]) $form->addCommandButton("saveEdit", $this->lng->txt("save_edit"));
if(!$this->object->getSelfAssessmentEditingMode())
{
$form->addCommandButton("saveReturn", $this->lng->txt("save_return"));
}
$form->addCommandButton("save", $this->lng->txt("save"));
} | [
"public function editQuestion() \n\t{\n\t\tinclude_once(\"./Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$form = new ilPropertyFormGUI();\n\t\t$form->setFormAction($this->ctrl->getFormAction($this));\n\t\t$form->setTitle($this->lng->txt($this->getQuestionType()));\n\t\t$form->setMultipart(FALSE);\n\t\t$form->setTableWidth(\"100%\");\n\t\t$form->setId(\"essay\");\n\n\t\t// title\n\t\t$title = new ilTextInputGUI($this->lng->txt(\"title\"), \"title\");\n\t\t$title->setValue($this->object->getTitle());\n\t\t$title->setRequired(TRUE);\n\t\t$form->addItem($title);\n\t\t\n\t\t// label\n\t\t$label = new ilTextInputGUI($this->lng->txt(\"label\"), \"label\");\n\t\t$label->setValue($this->object->label);\n\t\t$label->setInfo($this->lng->txt(\"label_info\"));\n\t\t$label->setRequired(false);\n\t\t$form->addItem($label);\n\n\t\t// author\n\t\t$author = new ilTextInputGUI($this->lng->txt(\"author\"), \"author\");\n\t\t$author->setValue($this->object->getAuthor());\n\t\t$author->setRequired(TRUE);\n\t\t$form->addItem($author);\n\t\t\n\t\t// description\n\t\t$description = new ilTextInputGUI($this->lng->txt(\"description\"), \"description\");\n\t\t$description->setValue($this->object->getDescription());\n\t\t$description->setRequired(FALSE);\n\t\t$form->addItem($description);\n\t\t\n\t\t// questiontext\n\t\t$question = new ilTextAreaInputGUI($this->lng->txt(\"question\"), \"question\");\n\t\t$question->setValue($this->object->prepareTextareaOutput($this->object->getQuestiontext()));\n\t\t$question->setRequired(TRUE);\n\t\t$question->setRows(10);\n\t\t$question->setCols(80);\n\t\t$question->setUseRte(TRUE);\n\t\tinclude_once \"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php\";\n\t\t$question->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags(\"survey\"));\n\t\t$question->addPlugin(\"latex\");\n\t\t$question->addButton(\"latex\");\n\t\t$question->addButton(\"pastelatex\");\n\t\t$question->setRTESupport($this->object->getId(), \"spl\", \"survey\", null, false, \"3.4.7\");\n\t\t$form->addItem($question);\n\t\t\n\t\t// maximum number of characters\n\t\t$maxchars = new ilNumberInputGUI($this->lng->txt(\"maxchars\"), \"maxchars\");\n\t\t$maxchars->setRequired(false);\n\t\t$maxchars->setSize(5);\n\t\tif ($this->object->getMaxChars() > 0)\n\t\t{\n\t\t\t$maxchars->setValue($this->object->getMaxChars());\n\t\t}\n\t\t$maxchars->setDecimals(0);\n\t\t$form->addItem($maxchars);\n\t\t\n\t\t// textwidth\n\t\t$textwidth = new ilNumberInputGUI($this->lng->txt(\"width\"), \"textwidth\");\n\t\t$textwidth->setRequired(true);\n\t\t$textwidth->setSize(3);\n\t\t$textwidth->setValue($this->object->getTextWidth());\n\t\t$textwidth->setDecimals(0);\n\t\t$textwidth->setMinValue(10);\n\t\t$form->addItem($textwidth);\n\t\t\n\t\t// textheight\n\t\t$textheight = new ilNumberInputGUI($this->lng->txt(\"height\"), \"textheight\");\n\t\t$textheight->setRequired(true);\n\t\t$textheight->setSize(3);\n\t\t$textheight->setValue($this->object->getTextHeight());\n\t\t$textheight->setDecimals(0);\n\t\t$textheight->setMinValue(1);\n\t\t$form->addItem($textheight);\n\t\t\n\t\t// obligatory\n\t\t$shuffle = new ilCheckboxInputGUI($this->lng->txt(\"obligatory\"), \"obligatory\");\n\t\t$shuffle->setValue(1);\n\t\t$shuffle->setChecked($this->object->getObligatory());\n\t\t$shuffle->setRequired(FALSE);\n\t\t$form->addItem($shuffle);\n\n\t\t$this->addCommandButtons($form);\n\t\t\n\t\t$errors = false;\n\t\n\t\tif ($this->isSaveCommand())\n\t\t{\n\t\t\t$form->setValuesByPost();\n\t\t\t$errors = !$form->checkInput();\n\t\t\t$form->setValuesByPost(); // again, because checkInput now performs the whole stripSlashes handling and we need this if we don't want to have duplication of backslashes\n\t\t\tif ($errors) $checkonly = false;\n\t\t}\n\n\t\tif (!$checkonly) $this->tpl->setVariable(\"ADM_CONTENT\", $form->getHTML());\n\t\treturn $errors;\n\t}",
"public abstract function get_option_buttons();",
"function initializeQuestionEditForm() {\n if (!(isset($this->dialogQuestion) && is_object($this->dialogQuestion))) {\n include_once(PAPAYA_INCLUDE_PATH.'system/base_dialog.php');\n if (@$this->params['cmd'] != 'add_question') {\n $data = $this->question;\n $hidden = array(\n 'cmd' => 'edit_question',\n 'save' => 1,\n 'group_id' => $this->params['group_id'],\n 'question_id' => $this->params['question_id']\n );\n $btnCaption = 'Edit';\n } else {\n $data = array();\n $hidden = array(\n 'cmd' => 'create_question',\n 'save' => 1,\n 'group_id' => $this->params['group_id']\n );\n $btnCaption = 'Save';\n }\n $fields = array(\n 'question_title' => array('Title', 'isNoHTML', TRUE, 'input', 250),\n 'question_text' => array('Text', 'isSomeText', FALSE, 'simplerichtext', 12),\n 'question_link' => array('Link', 'isSomeText', FALSE, 'simplerichtext', 4)\n );\n $this->dialogQuestion = new base_dialog(\n $this, $this->paramName, $fields, $data, $hidden\n );\n $this->dialogQuestion->msgs = &$this->msgs;\n $this->dialogQuestion->loadParams();\n $this->dialogQuestion->baseLink = $this->baseLink;\n $this->dialogQuestion->dialogTitle =\n papaya_strings::escapeHtmlChars($this->_gt('Properties'));\n $this->dialogQuestion->buttonTitle = $btnCaption;\n $this->dialogQuestion->dialogDoubleButtons = FALSE;\n }\n }",
"public function setFormItems()\n {\n parent::setFormItems();\n $this->formitems['titleorquestion']['explanation'] = 'This will be the title of your Quiz.';\n $this->formitems['showresultsend']['default'] = true;\n\n $this->formitems['subtractwrong'] = array(\n 'type' => 'checkbox',\n 'name' => 'Marking',\n 'default' => 'on',\n 'checklabel' => 'Subtract wrong answers.',\n 'valid' => function($v,$i,$js)\n {\n if($js) return \"\";\n return true;\n },\n 'explanation' => ' If checked, each wrong answer will get minus point. The subtracted point is calculated based on the point of that question divided by the number of choices.',\n 'learn_more' => 'Details of Quiz Marking',\n );\n $this->formpages[0]['items'][] = 'subtractwrong';\n }",
"public function propertiesAction() {\n $translator = $this->getTranslator();\n\n $title = $this->properties->getLocalizedWidgetProperty($this->locale, self::PROPERTY_TITLE);\n $heading = $this->properties->getWidgetProperty(self::PROPERTY_HEADING);\n $anchor = $this->properties->getWidgetProperty(self::PROPERTY_ANCHOR);\n $type = $title === null ? 'page' : 'custom';\n\n $data = array(\n 'type' => $type,\n self::PROPERTY_TITLE => $title,\n self::PROPERTY_HEADING => $heading,\n self::PROPERTY_ANCHOR => $anchor,\n self::PROPERTY_TEMPLATE => $this->getTemplate(static::TEMPLATE_NAMESPACE . '/default'),\n );\n\n $form = $this->createFormBuilder($data);\n $form->addRow('type', 'option', array(\n 'label' => $translator->translate('label.title.type'),\n 'attributes' => array(\n 'data-toggle-dependant' => 'option-type',\n ),\n 'options' => array(\n 'page' => $translator->translate('label.title.page'),\n 'custom' => $translator->translate('label.title.custom'),\n ),\n ));\n $form->addRow(self::PROPERTY_TITLE, 'string', array(\n 'label' => $translator->translate('label.title'),\n 'description' => $translator->translate('label.title.description'),\n 'attributes' => array(\n 'class' => 'option-type option-type-custom',\n ),\n 'filters' => array(\n 'trim' => array(),\n 'stripTags' => array(),\n ),\n 'localized' => true,\n ));\n $form->addRow(self::PROPERTY_HEADING, 'option', array(\n 'label' => $translator->translate('label.heading'),\n 'description' => $translator->translate('label.title.heading.description'),\n 'attributes' => array(\n 'class' => 'option-type option-type-custom',\n ),\n 'options' => array(\n 2 => 2,\n 3 => 3,\n 4 => 4,\n 5 => 5,\n ),\n 'widget' => 'select'\n ));\n $form->addRow(self::PROPERTY_ANCHOR, 'option', array(\n 'label' => $translator->translate('label.title.anchor'),\n 'description' => $translator->translate('label.title.anchor.description'),\n 'attributes' => array(\n 'class' => 'option-type option-type-custom',\n ),\n ));\n $form->addRow(self::PROPERTY_TEMPLATE, 'select', array(\n 'label' => $translator->translate('label.template'),\n 'description' => $translator->translate('label.template.widget.description'),\n 'options' => $this->getAvailableTemplates(static::TEMPLATE_NAMESPACE),\n 'validators' => array(\n 'required' => array(),\n ),\n ));\n\n $form = $form->build();\n if ($form->isSubmitted()) {\n if ($this->request->getBodyParameter('cancel')) {\n return false;\n }\n\n try {\n $form->validate();\n\n $data = $form->getData();\n\n if ($data['type'] == 'page') {\n $data[self::PROPERTY_HEADING] = null;\n $data[self::PROPERTY_ANCHOR] = null;\n\n $this->properties->setLocalizedWidgetProperty($this->locale, self::PROPERTY_TITLE, null);\n $this->properties->setWidgetProperty(self::PROPERTY_TITLE, null);\n } else {\n $this->properties->setLocalizedWidgetProperty($this->locale, self::PROPERTY_TITLE, $data[self::PROPERTY_TITLE]);\n }\n\n $this->properties->setWidgetProperty(self::PROPERTY_HEADING, $data[self::PROPERTY_HEADING]);\n $this->properties->setWidgetProperty(self::PROPERTY_ANCHOR, $data[self::PROPERTY_ANCHOR] ? \"1\" : null);\n $this->setTemplate($data[self::PROPERTY_TEMPLATE]);\n\n return true;\n } catch (ValidationException $exception) {\n $this->setValidationException($exception, $form);\n }\n }\n\n $this->setTemplateView(static::TEMPLATE_NAMESPACE . '/properties', array(\n 'form' => $form->getView(),\n ));\n\n return false;\n }",
"function _addButtons()\r\n {\r\n $model\t\t=& $this->getModel();\r\n $params \t=& $model->getParams();\r\n $this->showEmail = $params->get( 'email', 0 );\r\n\r\n if (JRequest::getVar('tmpl') != 'component') {\r\n if ($this->showEmail) {\r\n $this->emailLink = '';\r\n }\r\n\r\n $this->showPrint = $params->get( 'print', 0 );\r\n if ($this->showPrint) {\r\n $this->printLink = '';\r\n }\r\n\r\n $this->showPDF = $params->get( 'pdf', 0 );\r\n if ($this->showPDF) {\r\n $this->pdfLink = '';\r\n }\r\n } else {\r\n $this->showPDF = $this->showPrint = false;\r\n }\r\n }",
"protected function define_answer_options_properties_section()\n {\n global $PAGE, $OUTPUT;\n $mform = $this->_form;\n\n // header\n $mform->addElement('header', 'answeroptionspropertiesheader',\n get_string(\"answer_options_properties\", 'qtype_omerocommon'));\n\n // selector to allow single or multi answers\n $menu = array(\n get_string('answersingleno', 'qtype_omerocommon'),\n get_string('answersingleyes', 'qtype_omerocommon'),\n );\n $mform->addElement('select', 'single',\n get_string('answerhowmany', 'qtype_omerocommon'), $menu);\n $mform->setDefault('single', 1);\n\n // how to number answer options\n $mform->addElement('select', 'answernumbering',\n get_string('answernumbering', 'qtype_multichoice'),\n qtype_multichoice::get_numbering_styles());\n $mform->setDefault('answernumbering', 'abc');\n\n // default mark\n $mform->addElement('text', 'defaultmark', get_string('defaultmark', 'question'),\n array('size' => 7));\n $mform->setType('defaultmark', PARAM_FLOAT);\n $mform->setDefault('defaultmark', 1);\n $mform->addRule('defaultmark', null, 'required', null, 'client');\n\n // flag to set the shuffling of answer options\n $mform->addElement('advcheckbox', 'shuffleanswers',\n get_string('shuffleanswers', 'qtype_multichoice'), null, null, array(0, 1));\n $mform->addHelpButton('shuffleanswers', 'shuffleanswers', 'qtype_multichoice');\n $mform->setDefault('shuffleanswers', 1);\n\n // set as expanded by default\n $mform->setExpanded('answeroptionspropertiesheader');\n }",
"public function populateAnswerSpecificFormPart(ilPropertyFormGUI $form );",
"public function setFormItems()\n {\n parent::setFormItems();\n $this->formitems['titleorquestion']['name'] = 'Title';\n $this->formitems['titleorquestion']['explanation'] = 'This will be the title of your Questionnaire.';\n $this->formitems['choices']['type'] = 'html';\n $this->formitems['choices']['code'] = '<script type=\"text/javascript\">//<![CDATA[\nwriteHTML()//]]></script>';\n $this->formitems['choices']['name'] = 'Questions';\n\n $this->formitems['choices']['valid'] = function($v,$i,$js)\n {\n if($js) return \"\";\n return true;\n };\n $this->formitems['choices']['textafter'] = '';\n $this->formitems['choices']['textbefore'] = '';\n }",
"function _addButtons()\r\n {\r\n $model\t\t=& $this->getModel();\r\n $params \t=& $model->getParams();\r\n $this->showEmail = $params->get( 'email', 0 );\r\n $this->emailLink = '';\r\n $this->printLink = '';\r\n $this->pdfLink = '';\r\n $this->showPrint = $params->get( 'print', 0 );\r\n\r\n if ($this->showPrint) {\r\n $text = JHTML::_('image.site', 'printButton.png', '/images/M_images/', NULL, NULL, JText::_( 'Print' ) );\r\n $this->printLink = '<a href=\"#\" onclick=\"window.print();return false;\">'.$text.'</a>';\r\n }\r\n\r\n if (JRequest::getVar('tmpl') != 'component') {\r\n if ($this->showEmail) {\r\n $this->emailLink = FabrikHelperHTML::emailIcon( $model, $params );\r\n }\r\n \t\r\n if ($this->showPrint) {\r\n $this->printLink = FabrikHelperHTML::printIcon( $model, $params, $model->_rowId );\r\n }\r\n\r\n $this->showPDF = $params->get( 'pdf', 0 );\r\n if ($this->showPDF) {\r\n $this->pdfLink = FabrikHelperHTML::pdfIcon( $model, $params, $model->_rowId );\r\n }\r\n } else {\r\n $this->showPDF = false;\r\n }\r\n }",
"public function get_form_editor_button() {\n\t\treturn array(\n\t\t\t'group' => 'advanced_fields',\n\t\t\t'text' => $this->get_form_editor_field_title(),\n\t\t\t'icon' => 'gform-icon--survey',\n\t\t);\n\t}",
"public function completeSpecificFormProperties(ilPropertyFormGUI $form)\n\t{\n\t\tif( !$this->questionOBJ->getSelfAssessmentEditingMode() )\n\t\t{\n\t\t\t$header = new ilFormSectionHeaderGUI();\n\t\t\t$header->setTitle($this->lng->txt('feedback_answers'));\n\t\t\t$form->addItem($header);\n\n\t\t\trequire_once './Services/Form/classes/class.ilRadioGroupInputGUI.php';\n\t\t\trequire_once './Services/Form/classes/class.ilRadioOption.php';\n\n\t\t\t$feedback = new ilRadioGroupInputGUI($this->lng->txt('feedback_setting'), 'feedback_setting');\n\t\t\t$feedback->addOption(\n\t\t\t\tnew ilRadioOption($this->lng->txt('feedback_all'), self::FEEDBACK_SETTING_ALL), true\n\t\t\t);\n\t\t\t$feedback->addOption(\n\t\t\t\tnew ilRadioOption($this->lng->txt('feedback_checked'), self::FEEDBACK_SETTING_CHECKED)\n\t\t\t);\n\t\t\t$feedback->addOption(\n\t\t\t\tnew ilRadioOption($this->lng->txt('feedback_correct'), self::FEEDBACK_SETTING_CORRECT)\n\t\t\t);\n\t\t\t$feedback->setRequired(true);\n\t\t\t$form->addItem($feedback);\n\n\t\t\tforeach( $this->getAnswerOptionsByAnswerIndex() as $index => $answer )\n\t\t\t{\n\t\t\t\t$propertyLabel = $this->questionOBJ->prepareTextareaOutput(\n\t\t\t\t\t$this->buildAnswerOptionLabel($index, $answer), true\n\t\t\t\t);\n\n\t\t\t\t$propertyPostVar = \"feedback_answer_$index\";\n\n\t\t\t\t$form->addItem($this->buildFeedbackContentFormProperty(\n\t\t\t\t\t$propertyLabel , $propertyPostVar, $this->questionOBJ->isAdditionalContentEditingModePageObject()\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t}",
"public function buttons()\n {\n View::parse('generic/textarea/buttons.phtml', ['ID' => $this->id]);\n }",
"public function setQuestionTabs()\n {\n global $DIC;\n $rbacsystem = $DIC->rbac()->system();\n $ilTabs = $DIC->tabs();\n\n $this->ctrl->setParameterByClass(\"ilpageobjectgui\", \"q_id\", $_GET[\"q_id\"]);\n include_once \"./Modules/TestQuestionPool/classes/class.assQuestion.php\";\n $q_type = $this->object->getQuestionType();\n\n if (strlen($q_type)) {\n $classname = $q_type . \"GUI\";\n $this->ctrl->setParameterByClass(strtolower($classname), \"sel_question_types\", $q_type);\n $this->ctrl->setParameterByClass(strtolower($classname), \"q_id\", $_GET[\"q_id\"]);\n }\n\n if ($_GET[\"q_id\"]) {\n if ($rbacsystem->checkAccess('write', $_GET[\"ref_id\"])) {\n // edit page\n $ilTabs->addTarget(\n \"edit_page\",\n $this->ctrl->getLinkTargetByClass(\"ilAssQuestionPageGUI\", \"edit\"),\n array(\"edit\", \"insert\", \"exec_pg\"),\n \"\",\n \"\",\n $force_active\n );\n }\n\n $this->addTab_QuestionPreview($ilTabs);\n }\n\n $force_active = false;\n if ($rbacsystem->checkAccess('write', $_GET[\"ref_id\"])) {\n $url = \"\";\n\n if ($classname) {\n $url = $this->ctrl->getLinkTargetByClass($classname, \"editQuestion\");\n }\n $commands = $_POST[\"cmd\"];\n\n // edit question properties\n $ilTabs->addTarget(\n \"edit_properties\",\n $url,\n array(\"editQuestion\", \"save\", \"cancel\", \"saveEdit\", \"originalSyncForm\"),\n $classname,\n \"\",\n $force_active\n );\n }\n\n // add tab for question feedback within common class assQuestionGUI\n $this->addTab_QuestionFeedback($ilTabs);\n\n // add tab for question hint within common class assQuestionGUI\n $this->addTab_QuestionHints($ilTabs);\n\n // add tab for question's suggested solution within common class assQuestionGUI\n $this->addTab_SuggestedSolution($ilTabs, $classname);\n\n\n // Assessment of questions sub menu entry\n if ($_GET[\"q_id\"]) {\n $ilTabs->addTarget(\n \"statistics\",\n $this->ctrl->getLinkTargetByClass($classname, \"assessment\"),\n array(\"assessment\"),\n $classname,\n \"\"\n );\n }\n\n $this->addBackTab($ilTabs);\n }",
"function question_ph_params_form($submiturl, $question) {\r\n\t\tfunction definition_inner(&$mform) {\r\n\t\t\tglobal $CFG, $QTYPES;\r\n\t\t\t$mform->addElement ( 'htmleditor', 'qtype' );\r\n\t\t}\r\n\r\n global $QTYPES, $CFG;\r\n \r\n $this->question = $question;\r\n $this->qtypeobj =& $QTYPES[$this->question->qtype];\r\n\r\n\t//get the dataset defintions for this question\r\n $this->datasetdefs = get_records_select('ph_params', 'question='.$question->id, 'decorder');\r\n\r\n parent::moodleform($submiturl);\r\n }",
"public function setQuestionTabs()\n\t{\n\t\tglobal $rbacsystem, $ilTabs;\n\n\t\t$ilTabs->clearTargets();\n\t\t\n\t\t$this->ctrl->setParameterByClass(\"ilAssQuestionPageGUI\", \"q_id\", $_GET[\"q_id\"]);\n\t\tinclude_once \"./Modules/TestQuestionPool/classes/class.assQuestion.php\";\n\t\t$q_type = $this->object->getQuestionType();\n\n\t\tif (strlen($q_type))\n\t\t{\n\t\t\t$classname = $q_type . \"GUI\";\n\t\t\t$this->ctrl->setParameterByClass(strtolower($classname), \"sel_question_types\", $q_type);\n\t\t\t$this->ctrl->setParameterByClass(strtolower($classname), \"q_id\", $_GET[\"q_id\"]);\n\t\t}\n\n\t\tif ($_GET[\"q_id\"])\n\t\t{\n\t\t\tif ($rbacsystem->checkAccess('write', $_GET[\"ref_id\"]))\n\t\t\t{\n\t\t\t\t// edit page\n\t\t\t\t$ilTabs->addTarget(\"edit_page\",\n\t\t\t\t\t$this->ctrl->getLinkTargetByClass(\"ilAssQuestionPageGUI\", \"edit\"),\n\t\t\t\t\tarray(\"edit\", \"insert\", \"exec_pg\"),\n\t\t\t\t\t\"\", \"\", $force_active);\n\t\t\t}\n\n\t\t\t$this->addTab_QuestionPreview($ilTabs);\n\t\t}\n\t\t$force_active = false;\n\t\tif ($rbacsystem->checkAccess('write', $_GET[\"ref_id\"]))\n\t\t{\n\t\t\t$url = \"\";\n\t\t\tif ($classname) $url = $this->ctrl->getLinkTargetByClass($classname, \"editQuestion\");\n\t\t\t$force_active = false;\n\t\t\t// edit question properties\n\t\t\t$ilTabs->addTarget(\"edit_question\",\n\t\t\t\t$url,\n\t\t\t\tarray(\"editQuestion\", \"save\", \"saveEdit\", \"addchoice\", \"removechoice\", \"removeimagechoice\", \"uploadchoice\", \"originalSyncForm\"),\n\t\t\t\t$classname, \"\", $force_active);\n\t\t}\n\n\t\t// add tab for question feedback within common class assQuestionGUI\n\t\t$this->addTab_QuestionFeedback($ilTabs);\n\n\t\t// add tab for question hint within common class assQuestionGUI\n\t\t$this->addTab_QuestionHints($ilTabs);\n\n\t\t// add tab for question's suggested solution within common class assQuestionGUI\n\t\t$this->addTab_SuggestedSolution($ilTabs, $classname);\n\n\t\t// Assessment of questions sub menu entry\n\t\tif ($_GET[\"q_id\"])\n\t\t{\n\t\t\t$ilTabs->addTarget(\"statistics\",\n\t\t\t\t$this->ctrl->getLinkTargetByClass($classname, \"assessment\"),\n\t\t\t\tarray(\"assessment\"),\n\t\t\t\t$classname, \"\");\n\t\t}\n\n\t\t$this->addBackTab($ilTabs);\n\t}",
"function setQuestionTabs()\n\t{\n\t\tglobal $rbacsystem, $ilTabs;\n\n\t\t$ilTabs->clearTargets();\n\t\t\n\t\t$this->ctrl->setParameterByClass(\"ilAssQuestionPageGUI\", \"q_id\", $_GET[\"q_id\"]);\n\t\tinclude_once \"./Modules/TestQuestionPool/classes/class.assQuestion.php\";\n\t\t$q_type = $this->object->getQuestionType();\n\n\t\tif (strlen($q_type))\n\t\t{\n\t\t\t$classname = $q_type . \"GUI\";\n\t\t\t$this->ctrl->setParameterByClass(strtolower($classname), \"sel_question_types\", $q_type);\n\t\t\t$this->ctrl->setParameterByClass(strtolower($classname), \"q_id\", $_GET[\"q_id\"]);\n\t\t}\n\n\t\tif ($_GET[\"q_id\"])\n\t\t{\n\t\t\tif ($rbacsystem->checkAccess('write', $_GET[\"ref_id\"]))\n\t\t\t{\n\t\t\t\t// edit page\n\t\t\t\t$ilTabs->addTarget(\"edit_page\",\n\t\t\t\t\t$this->ctrl->getLinkTargetByClass(\"ilAssQuestionPageGUI\", \"edit\"),\n\t\t\t\t\tarray(\"edit\", \"insert\", \"exec_pg\"),\n\t\t\t\t\t\"\", \"\", $force_active);\n\t\t\t}\n\n\t\t\t$this->addTab_QuestionPreview($ilTabs);\n\t\t}\n\n\t\t$force_active = false;\n\t\tif ($rbacsystem->checkAccess('write', $_GET[\"ref_id\"]))\n\t\t{\n\t\t\t$url = \"\";\n\t\t\tif ($classname) $url = $this->ctrl->getLinkTargetByClass($classname, \"editQuestion\");\n\t\t\t$commands = $_POST[\"cmd\"];\n\t\t\tif (is_array($commands))\n\t\t\t{\n\t\t\t\tforeach ($commands as $key => $value)\n\t\t\t\t{\n\t\t\t\t\tif (preg_match(\"/^delete_.*/\", $key, $matches))\n\t\t\t\t\t{\n\t\t\t\t\t\t$force_active = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// edit question properties\n\t\t\t$ilTabs->addTarget(\"edit_question\",\n\t\t\t\t$url,\n\t\t\t\tarray(\"orderNestedTerms\",\"orderNestedPictures\",\"editQuestion\", \"save\", \"saveEdit\", \"addanswers\", \"removeanswers\", \"changeToPictures\", \"uploadanswers\", \"changeToText\", \"upanswers\", \"downanswers\", \"originalSyncForm\"),\n\t\t\t\t$classname, \"\", $force_active);\n\t\t}\n\n\t\t// add tab for question feedback within common class assQuestionGUI\n\t\t$this->addTab_QuestionFeedback($ilTabs);\n\n\t\t// add tab for question hint within common class assQuestionGUI\n\t\t$this->addTab_QuestionHints($ilTabs);\n\n\t\t// add tab for question's suggested solution within common class assQuestionGUI\n\t\t$this->addTab_SuggestedSolution($ilTabs, $classname);\n\n\t\t// Assessment of questions sub menu entry\n\t\tif ($_GET[\"q_id\"])\n\t\t{\n\t\t\t$ilTabs->addTarget(\"statistics\",\n\t\t\t\t$this->ctrl->getLinkTargetByClass($classname, \"assessment\"),\n\t\t\t\tarray(\"assessment\"),\n\t\t\t\t$classname, \"\");\n\t\t}\n\n\t\t$this->addBackTab($ilTabs);\n\t}",
"public function completeSpecificFormProperties(ilPropertyFormGUI $form)\n\t{\n\t\tif( !$this->questionOBJ->getSelfAssessmentEditingMode() )\n\t\t{\n\t\t\t$header = new ilFormSectionHeaderGUI();\n\t\t\t$header->setTitle($this->lng->txt('feedback_answers'));\n\t\t\t$form->addItem($header);\n\t\t\n\t\t\tforeach( $this->getAnswerOptionsByAnswerIndex() as $index => $answer )\n\t\t\t{\n\t\t\t\t$propertyLabel = $this->questionOBJ->prepareTextareaOutput(\n\t\t\t\t\t\t$this->buildAnswerOptionLabel($index, $answer), true\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$propertyPostVar = \"feedback_answer_$index\";\n\t\t\t\t\n\t\t\t\t$form->addItem($this->buildFeedbackContentFormProperty(\n\t\t\t\t\t$propertyLabel , $propertyPostVar, $this->questionOBJ->isAdditionalContentEditingModePageObject()\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t}",
"function build_editing_form()\r\n {\r\n\r\n // $survey_template_user = $this->survey_template_user;\r\n // $property_names = $survey_template_user->get_additional_property_names();\r\n //\r\n // foreach ($property_names as $property_name)\r\n // {\r\n // $this->add_textfield($property_name, $property_name, true);\r\n // }\r\n // $this->addElement('hidden', SurveyTemplate :: PROPERTY_ID);\r\n // $this->build_footer('Update');\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set new original data | public function setOriginalData(array $data)
{
$this->originalData = $data;
} | [
"public function resetData() {\n\t\tif ($this->_dirty) {\n\t\t\t$this->data = $this->_originalData;\n\t\t\t$this->fixateData();\n\t\t}\n\t}",
"public function set_data( $data ){\n\t\t\t\n\t\t\t//dump( __LINE__, __METHOD__, $data );\n\t\t\t\n\t\t\t/* $data = array_merge( $data, $data[ 'data' ] );\n\t\t\t\n\t\t\tforeach( $data[ 'payee' ] as $pkey => $pval ){\n\t\t\t\t$payee_key = 'payee_'.$pkey;\n\t\t\t\t$data[ $payee_key ] = $pval;\n\t\t\t}\n\t\t\t\n\t\t\tunset( $data[ 'data' ] );\n\t\t\tunset( $data[ 'payee' ] ); */\n\t\t\t\n\t\t\t\n\t\t\tforeach ( get_object_vars( $this ) as $key => $value ){\n\t\t\t\tif( isset( $new_data[ $key ] ) && !empty( $data[ $key ] ) ){\n\t\t\t\t\t$this->$key = $data[ $key ];\n\t\t\t\t}\n\t\t\t}\t\n\t\t\t\n\t\t\t//\n\t\t}",
"final public function setOriginal($data)\n {\n $data = Helper::array($data);\n\n $this->original = $this->formatFieldData($data);\n\n $this->callCustomFormatter('original', new Fluent($data));\n }",
"protected function fixate()\n {\n $this->data = array_merge($this->data, $this->dirty);\n $this->dirty = [];\n }",
"public function resetData() {\n $this->data = array();\n }",
"protected function assignData($data){\n\t\tif ($data){\n\t\t//assign data to iterator\n \t\tforeach ($data as $index => $datum){\n \t\t\t$this[$index] = $datum;\n \t\t}\n \t}\n\t}",
"public function setContents($data)\r\n {\r\n $this->data = $data;\r\n \r\n if ($this->modified === null) {\r\n // if modified bit hasn't been set yet,\r\n // then it should now be set to FALSE, since\r\n // we just did inital population\r\n $this->modified = false;\r\n } elseif ($this->modified === false) {\r\n // if it was already FALSE, then it should\r\n // now be set to TRUE, since this is a subsequent\r\n // modfiication.\r\n $this->modified = true;\r\n }\r\n }",
"protected static function setData(){\n\n self::$data = \n array (\n 0 => \n array (\n 'id' => 2,\n 'nombre' => 'Nómina',\n 'estatus' => 'A',\n ),\n 1 => \n array (\n 'id' => 1,\n 'nombre' => 'Social',\n 'estatus' => 'A',\n ),\n)\t\t; \n\n \t}",
"public function setAll($data)\n {\n $this->data = $data;\n }",
"public function setUpdated(): void\n {\n $this->originalData = $this->itemReflection->dehydrate($this->item);\n }",
"abstract protected function updateDataset();",
"public function setData($data){\n $this->data = $data;\n $this->data_type = self::getType($data);\n }",
"function set($d){\n\t self::$data = array();\n\t self::$data = array_merge(self::$data,$d);//contenue de la variable passer du model a la vue\n }",
"protected function setData($data) {\n\t\t\t$this->_db->setData($this->data);\n\t\t}",
"public function setData(array $data)\n {\n $this->viewData = array_merge($this->viewData, $data);\n }",
"function set($d){\n\t $this->data = array();\n\t $this->data = array_merge($this->data,$d);//contenue de la variable passer du model a la vue\n\t}",
"public function setData($data)\n\t{\n\t\t$this->_model->data = $data;\n\t}",
"public function setData($data){\n $this->_headerRow = array_shift($data);\n $this->_data = $data;\n }",
"public function setData($data) {\n $this->data = json_encode($data);\n }",
"public function setData(array $data)\n {\n $this->paypal_data = array_merge($data,$this->paypal_data);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if post is editable by user | public function isEditable()
{
$activeUser = Session::getActiveUser();
// Check if user has posted the post
if ($activeUser->getId() === $this->getUserId()) {
return true;
}
// Check if active user is admin
if ($activeUser->getIsAdmin()) {
return true;
}
throw new \Exceptions\NoPermission("Sorry, you are not allowed to edit that post.");
} | [
"public function userCanEditPosts()\n {\n }",
"function isEditable($postData) {\n\t\t$wikiTypes = postsController::$wikiTypes;\n\t\t$userInfo = userCore::getUser();\n\t\treturn isset($wikiTypes[$postData['type']]) || ($postData['poster'] == 'user' && $postData['posterID'] == $userInfo['userID']);\n\t}",
"function can_edit_post(): bool {\n\tglobal $post;\n\treturn $post && is_user_logged_in() && current_user_can( 'edit_post', $post->ID );\n}",
"public function can_edit() {\n\t\tif ( ! function_exists( 'current_user_can' ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tif ( current_user_can( 'edit_post', $this->ID ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"static function any_editable() {\n $visitor = Visitor::current();\n $sql = SQL::current();\n\n # Can they edit posts?\n if ($visitor->group->can(\"edit_post\"))\n return true;\n\n # Can they edit drafts?\n if ($visitor->group->can(\"edit_draft\") and\n $sql->count(\"posts\", array(\"status\" => \"draft\")))\n return true;\n\n # Can they edit their own posts, and do they have any?\n if ($visitor->group->can(\"edit_own_post\") and\n $sql->count(\"posts\", array(\"user_id\" => $visitor->id)))\n return true;\n\n # Can they edit their own drafts, and do they have any?\n if ($visitor->group->can(\"edit_own_draft\") and\n $sql->count(\"posts\", array(\"status\" => \"draft\", \"user_id\" => $visitor->id)))\n return true;\n\n return false;\n }",
"public function canEditPost(){\n\t\t$result = false;\n\t\t$params = array(\n\t\t\t\"role_id\"=>$this->getRoleId(),\n\t\t\t\"user_id\"=>$this->getIdMember()\n\t\t);\n\t\t$role = $this->getRole();\n\t\t$result = Roles::checkPermission(\"edit\",\"post\",$role,$params);\n\t\t\n\t\treturn $result;\n\t}",
"public function canEditPost(Post $Post)\n {\n return (!$this->isNew() && ($this->type == 'A' || $this->type == 'M' || $this->id == $Post->users_id));\n }",
"public function isEditableFor( User_Model_User $user ){\n\t\tif( false == $this->getOwnerId() ){\n\t\t\treturn Zend_Registry::get( 'acl' )->isAllowed( $user->getRole(), 'forum_post', 'create' );\t\t\n\t\t} elseif( $this->getOwnerId() == $user->getId() ){\n\t\t\treturn Zend_Registry::get( 'acl' )->isAllowed( $user->getRole(), 'forum_post', 'edit' );\n\t\t} else {\n\t\t\treturn Zend_Registry::get( 'acl' )->isAllowed( $user->getRole(), 'forum_post_foreign', 'edit' );\n\t\t}\n\t}",
"public function can_edit_meta()\n {\n return current_user_can('edit_posts');\n }",
"public function userCanEditAndDelete() {\n\t\tglobal $profile_isAdmin;\n\n\t\tif (!is_object(icms::$user)) return false;\n\t\tif ($profile_isAdmin) return true;\n\t\treturn $this->getVar('poster_uid', 'e') == icms::$user->getVar('uid');\n\t}",
"function canEdit() {\r\n\t\tif($this->owner->ID == Member::currentUserID())\r\n\t\t\treturn true;\r\n\r\n\t\t$member = Member::currentUser();\r\n\t\tif($member)\r\n\t\t\treturn $member->isAdmin();\r\n\r\n\t\treturn false;\r\n\t}",
"function userCanEdit() {\n\treturn userIsLoggedIn() && ( Auth::user()->level == 'admin' || Auth::user()->level == 'update' );\n}",
"function vibrant_life_is_editing_blog() {\n \n if ( is_admin() && \n isset( $_REQUEST['post'] ) && \n $_REQUEST['post'] == get_option( 'page_for_posts' ) ) {\n return true;\n }\n \n return false;\n \n}",
"function user_can_edit_post_date($user_id, $post_id, $blog_id = 1) {\n\t$author_data = get_userdata($user_id);\n\treturn (($author_data->user_level > 4) && user_can_edit_post($user_id, $post_id, $blog_id));\n}",
"protected function check_edit_permission( $post ) {\n\t\t$post_type = get_post_type_object( $post['post_type'] );\n\n\t\tif ( ! current_user_can( $post_type->cap->edit_post, $post['ID'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"public function is_allowed_to_edit_content_object();",
"function user_allowed_editing() {\n return isadmin();\n }",
"protected function canEdit()\n {\n return true;\n }",
"public function isEditable()\n {\n return !($this->name == 'programmer' || $this->name == 'administrator');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Custom Taxonomies for Blog Posts | function rp3_blog_taxonomies() {
$industry_args = array(
'labels' => array(
'name' => 'Industries',
'singular_name' => 'Industry'
),
'public' => true,
'hierarchical' => true
);
register_taxonomy( 'rp3_tax_industries', 'post', $industry_args );
$service_args = array(
'labels' => array(
'name' => 'Services',
'singular_name' => 'Service'
),
'public' => true,
'hierarchical' => true
);
register_taxonomy( 'rp3_tax_services', 'post', $service_args );
// remove default "category" taxonomy from posts
register_taxonomy( 'category', array() );
} | [
"public function addTaxonomies() {\n foreach (self::getPostTypes() as $post_type) {\n register_rest_field($post_type, 'taxonomies', [\n 'get_callback' => function ($post) use ($post_type) {\n return self::getTermSchema($post_type, $post);\n },\n ]);\n }\n }",
"function edit_posts_to_include_blog_type() {\r\n register_taxonomy('blog_type', 'post', array(\r\n 'hierarchical' => true, \r\n 'labels' => array('name' => 'Blog Type')\r\n ));\r\n}",
"public function registerTaxonomies() {\n\t}",
"function twentysixteen_entry_taxonomies() {}",
"public function registerTaxonomies()\n {\n }",
"function add_custom_taxonomies() {\n // Add new \"Locations\" taxonomy to Posts\n register_taxonomy('company', 'bp_doc', array(\n // Hierarchical taxonomy (like categories)\n 'hierarchical' => true,\n // This array of options controls the labels displayed in the WordPress Admin UI\n 'labels' => array(\n 'name' => _x( 'Company', 'taxonomy general name' ),\n 'singular_name' => _x( 'Company', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Company' ),\n 'all_items' => __( 'All Company' ),\n 'parent_item' => __( 'Parent Company' ),\n 'parent_item_colon' => __( 'Parent Company:' ),\n 'edit_item' => __( 'Edit Company' ),\n 'update_item' => __( 'Update Company' ),\n 'add_new_item' => __( 'Add New Company' ),\n 'new_item_name' => __( 'New Company Name' ),\n 'menu_name' => __( 'Company' ),\n ),\n // Control the slugs used for this taxonomy\n 'rewrite' => array(\n 'slug' => 'company', // This controls the base slug that will display before each term\n 'with_front' => false, // Don't display the category base before \"/locations/\"\n 'hierarchical' => true // This will allow URL's like \"/locations/boston/cambridge/\"\n ),\n ));\n}",
"public function registerTaxonomies() {\r\n\t\tforeach ( $this->taxonomies as $taxonomy ) {\r\n\t\t\t$this->registerTaxonomyForObjectType( $taxonomy, $this->name );\r\n\t\t}\r\n }",
"function clb_add_taxonomies() {\r\n// clb_create_taxonomies('Genre', 'Genres', 'genre', true, array( 'movie', 'post' ));\r\n\r\n\r\n}",
"public function registerTaxonomies()\n {\n // Get the post types from the config.\n $taxonomies = config('taxonomies');\n\n $translater = new Translater($taxonomies, 'taxonomies');\n $taxonomies = $translater->translate([\n '*.labels.*',\n '*.names.singular',\n '*.names.plural',\n ]);\n\n // Iterate over each post type.\n collect($taxonomies)->each(function ($args, $key) {\n\n // Check if names are set, if not keep it as an empty array\n $links = $args['links'] ?? [];\n\n // Unset names from item\n unset($args['links']);\n\n // Check if names are set, if not keep it as an empty array\n $names = $args['names'] ?? [];\n\n // Unset names from item\n unset($args['names']);\n\n // Register the extended post type.\n register_extended_taxonomy($key, $links, $args, $names);\n });\n }",
"function register_taxonomies() {\r\n }",
"public function supplementTaxonomies();",
"function addTaxonomiesToPages()\n {\n register_taxonomy_for_object_type('post_tag', 'page');\n register_taxonomy_for_object_type('category', 'page');\n }",
"function register_taxonomies(){\n }",
"function getTaxonomies();",
"public function register_taxonomy() {\n\t\t$args = array(\n\t\t\t'public' => true,\n\t\t\t// We create our own custom UI\n\t\t\t'show_ui' => false,\n\t\t\t'labels' => array(\n\t\t\t\t'name' => __('Mini-Blogs', 'cf_mini_blog'),\n\t\t\t\t'singular_name' => __('Mini-Blog', 'cf_mini_blog'),\n\t\t\t),\n\t\t\t'hierarchical' => true,\n\t\t\t'rewrite' => array(\n\t\t\t\t'slug' => $this->taxonomy_slug\n\t\t\t)\n\t\t);\n\t\t$types = apply_filters('cfmb_register_taxonomy_types', array('post'));\n\t\t$args = apply_filters('cfmb_register_taxonomy_args', $args);\n\t\tregister_taxonomy($this->taxonomy, $types, $args);\n\t}",
"public function add_taxonomies() {\n\n\t\t$taxonomies = $this->settings['add_taxonomies'];\n\n\t\tif ( is_array( $taxonomies ) && count( $taxonomies ) > 0 ) {\n\n\t\t\tforeach ( $taxonomies as $taxonomy_slug => $taxonomy_args ) {\n\n\t\t\t\t$custom_args = '';\n\t\t\t\tif ( isset( $taxonomy_args['args'] ) && ! empty( $taxonomy_args['args'] ) ) {\n\t\t\t\t\t$custom_args = $taxonomy_args['args'];\n\t\t\t\t}\n\n\t\t\t\t$custom_labels = '';\n\t\t\t\tif ( isset( $taxonomy_args['labels'] ) && ! empty( $taxonomy_args['labels'] ) ) {\n\t\t\t\t\t$custom_labels = $taxonomy_args['labels'];\n\t\t\t\t}\n\n\t\t\t\t$this->register_taxonomy( $taxonomy_slug, $taxonomy_args['objects'], $custom_args, $custom_labels );\n\t\t\t}\n\t\t}\n\t}",
"public function register_taxonomies() {\n\t\tregister_taxonomy( 'bp_docs_doc_in_folder', bp_docs_get_post_type_name(), array(\n\t\t\t'public' => false,\n\t\t) );\n\n\t\tregister_taxonomy( 'bp_docs_folder_in_user', 'bp_docs_folder', array(\n\t\t\t'public' => true,\n\t\t) );\n\n\t\tif ( bp_is_active( 'groups' ) ) {\n\t\t\tregister_taxonomy( 'bp_docs_folder_in_group', 'bp_docs_folder', array(\n\t\t\t\t'public' => true,\n\t\t\t) );\n\t\t}\n\t}",
"function create_taxonomies() {\n\t\t\n\t\t\n\t}",
"public function registerTaxonomies()\n {\n foreach ($this->newTaxonomies as $taxonomy_name => $tax) {\n // register the taxonomy with Wordpress\n register_taxonomy($taxonomy_name, $this->postTypeName, $tax->options);\n }\n }",
"function setTaxonomies()\n\t\t{\n\t\t\t$this->taxonomies = ['genre', 'country', 'year', 'actors'];\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add MFA values to the account after answering the security question wrongly: | public function addMFAToAccountsLater($FILoginAcctId, $userName, $userPassword) {
try {
$cashedgeServiceToCall = "AccountMgmt/initiateAddAccounts";
$wsAddItemRequestXml = <<<END
<HarvestAddRqHeader xmlns="http://www.cashedge.com/wm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
partnerID="{$this->partnerId}" version="1.4.6">
<RqUID>initiateAddAccounts After wrong attempt OR Re adding deleted accounts</RqUID>
<SignonRq>
<UserInfo>
<UserID>{$userName}</UserID>
<HomeID>{$this->homeId}</HomeID>
<UserPassword>
<CryptType>None</CryptType>
<CryptVal>{$userPassword}</CryptVal>
</UserPassword>
<Role>User</Role>
</UserInfo>
</SignonRq>
<HarvestAddRq>
<AddMoreAccts>
<FILoginAcctId>{$FILoginAcctId}</FILoginAcctId>
</AddMoreAccts>
</HarvestAddRq>
</HarvestAddRqHeader>
END;
Yii::trace("Add MFA To Accounts Later Answer", "cashedgedata");
$xml = self::callCashEdgeApi($cashedgeServiceToCall, $wsAddItemRequestXml);
Yii::trace(":Data:" . CVarDumper::dumpAsString($xml), "cashedgedata");
if ($xml) {
$newRunID = $xml->getElementsByTagName("RunId");
if ($newRunID->length > 0) {
$runId = $newRunID->item(0)->nodeValue;
}
$newHarID = $xml->getElementsByTagName("HarvestAddID");
if ($newHarID->length > 0) {
$harId = $newHarID->item(0)->nodeValue;
}
return array("status" => "OK", "harvestId" => $runId, "harvestAddId" => $harId);
} else {
return Messages::getERRORMapping("FLEXSCORE", "1002", '');
}
} catch (Exception $E) {
return Messages::getERRORMapping("FLEXSCORE", "1002", '');
}
} | [
"function setMFA($user, $factors){\n\tglobal $authdb;\n\t$stmt = $authdb->prepare(\"UPDATE users SET minfactors = ? WHERE username = ?\");\n\tif($stmt == false){\n\t\tdie(\"Could not prepare update minfactors statement: \".$authdb->error);\n\t}\n\t$stmt->bind_param(\"is\", $factors, $user);\n\tif(!$stmt->execute()){\n\t\tdie(\"Could not update number of factors: \".$authdb->error);\n\t}\n}",
"function addMFAVote($user, $certid, $factors, $oldfactors){\n\tglobal $authdb;\n\t//First remove any votes with this certid. You only get to vote for one at a time\n\t$stmt = $authdb->prepare(\"DELETE FROM mfavotes WHERE certid = ?\");\n\tif($stmt == false){\n\t\tdie(\"Could not prepare statement: \".$authdb->error);\n\t}\n\t$stmt->bind_param(\"s\", $certid);\n\tif(!$stmt->execute()){\n\t\tdie(\"Could not remove MFA votes: \".$authdb->error);\n\t}\n\t//A request to keep the status quo does not need a vote table addition, just previous vote deletion\n\tif($oldfactors === $factors){\n\t\treturn;\n\t}\n\t//Then add new vote\n\t$stmt = $authdb->prepare(\"INSERT INTO mfavotes (username, certid, newnumfactors) VALUES(?, ?, ?)\");\n\tif($stmt == false){\n\t\tdie(\"Could not prepare statement: \".$authdb->error);\n\t}\n\t$stmt->bind_param(\"ssi\", $user, $certid, $factors);\n\tif(!$stmt->execute()){\n\t\tdie(\"Could not insert MFA vote: \".$authdb->error);\n\t}\n}",
"public function setForceChangePasswordNextSignInWithMfa(?bool $value): void {\n $this->getBackingStore()->set('forceChangePasswordNextSignInWithMfa', $value);\n }",
"function tfa_basic_setup_form(&$form_state, $account, $method = 'app_setup') {\n global $user;\n\n $form['account'] = array(\n '#type' => 'value',\n '#value' => $account,\n );\n $tfa_data = tfa_basic_get_tfa_data($account);\n\n // Do not continue if this isn't app setup and the app isn't already set.\n if (empty($tfa_data['status']) && $method != 'app_setup') {\n drupal_set_message(t('Set up TFA application before continuing with additional configurations.'), 'warning');\n drupal_goto('user/' . $account->uid . '/security/tfa');\n // @todo The whole form build process should not be started if this\n // condition is met.\n // In the hook_menu() the 'page callback' should be something different than\n // the 'drupal_get_form'.\n }\n\n $form['#cache'] = TRUE;\n if (empty($form_state['storage'])) {\n // Allow administrators to change TFA settings for another account.\n if ($account->uid != $user->uid) {\n $current_pass_description = t('Enter your current password to alter TFA settings for account %name.', array('%name' => $account->name));\n }\n else {\n $current_pass_description = t('Enter your current password to continue.');\n }\n\n $form['current_pass'] = array(\n '#type' => 'password',\n '#title' => t('Current password'),\n '#size' => 25,\n '#description' => $current_pass_description,\n '#attributes' => array('autocomplete' => 'off'),\n );\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Confirm'),\n );\n\n $form['cancel'] = array(\n '#type' => 'submit',\n '#value' => t('Cancel'),\n );\n }\n else {\n // Support multi-step TFA plugins triggered in tfa_basic_setup_form_submit.\n if (isset($form_state['storage']['method'])) {\n $method = $form_state['storage']['method'];\n }\n\n $context = array('uid' => $account->uid);\n switch ($method) {\n case 'app_setup':\n drupal_set_title(t('TFA setup - Application'));\n\n $form_state['storage']['methods'][$method] = $method;\n\n $setup_plugin = new TfaTotpSetup($context);\n $tfa_setup = new TfaSetup($setup_plugin, $context);\n\n if (!empty($tfa_data)) {\n $form['disclaimer'] = array(\n '#type' => 'markup',\n '#value' => '<p>' . t('Note: You should delete the old account in your mobile or desktop app before adding this new one.') . '</p>',\n );\n }\n $form = $tfa_setup->getForm($form, $form_state);\n $form_state['storage'][$method] = $tfa_setup;\n break;\n\n case 'trust_device':\n drupal_set_title(t('TFA setup - Trusted browsers'));\n\n $form_state['storage']['methods'][$method] = $method;\n\n $setup_plugin = new TfaTrustedDeviceSetup($context);\n $tfa_setup = new TfaSetup($setup_plugin, $context);\n $form = $tfa_setup->getForm($form, $form_state);\n $form_state['storage'][$method] = $tfa_setup;\n break;\n\n case 'recovery_codes':\n drupal_set_title(t('TFA setup - Recovery codes'));\n\n $form_state['storage']['methods'][$method] = $method;\n\n $setup_plugin = new TfaBasicRecoveryCodeSetup($context);\n $tfa_setup = new TfaSetup($setup_plugin, $context);\n $form = $tfa_setup->getForm($form, $form_state);\n $form_state['storage'][$method] = $tfa_setup;\n break;\n\n case 'recovery_codes_list':\n $recovery = new TfaBasicRecoveryCodeSetup(array('uid' => $account->uid));\n $codes = $recovery->getCodes();\n\n $output = theme('item_list', $codes);\n $output .= l(t('Return to account TFA overview'), 'user/' . $account->uid . '/security/tfa');\n $form['output'] = array(\n '#type' => 'markup',\n '#value' => $output,\n );\n\n // Return early.\n return $form;\n\n case 'sms_setup':\n drupal_set_title(t('TFA setup - SMS'));\n // First step is number entry.\n if (empty($form_state['storage'][$method])) {\n $form_state['storage']['methods'][$method] = $method;\n\n $default_number = tfa_basic_get_mobile_number($account);\n $form['sms_number'] = array(\n '#type' => 'textfield',\n '#title' => t('Mobile phone number'),\n '#description' => t('Enter your mobile phone number that can receive SMS codes. A code will be sent to this number for validation.'),\n '#default_value' => $default_number ?: '',\n );\n\n $form['send'] = array(\n '#type' => 'submit',\n '#value' => t('Send SMS'),\n );\n\n if (!empty($tfa_data['data']['sms'])) {\n // Provide disable SMS option.\n $form['actions']['sms_disable'] = array(\n '#type' => 'submit',\n '#value' => t('Disable SMS delivery'),\n );\n }\n }\n // Then validate by sending an SMS.\n else {\n $number = tfa_basic_format_number($form_state['storage']['sms_number']);\n drupal_set_message(t('A code was sent to @number. It may take up to a minute for its arrival.', array('@number' => $number)));\n $tfa_setup = $form_state['storage'][$method];\n $form = $tfa_setup->getForm($form, $form_state);\n if (in_array('app_setup', $form_state['storage']['methods'])) {\n drupal_set_message(t('If the code does not arrive or you entered the wrong number skip this step to continue without SMS delivery. You can enable it after completing the rest of TFA setup.'));\n }\n else {\n $form['code']['#description'] .= ' ' . l(t('If the code does not arrive or you entered the wrong number click here to start over.'), 'user/' . $account->uid . '/security/tfa/sms-setup');\n }\n\n $form_state['storage'][$method] = $tfa_setup;\n }\n break;\n\n default:\n break;\n\n }\n\n // Provide skip button for optional TFA plugins.\n if (isset($form_state['storage']['methods']) && count($form_state['storage']['methods']) > 1) {\n $form['actions']['skip'] = array(\n '#type' => 'submit',\n '#value' => t('Skip'),\n );\n }\n // Provide cancel button on first step or single steps.\n else {\n $form['actions']['cancel'] = array(\n '#type' => 'submit',\n '#value' => t('Cancel'),\n );\n }\n\n $form_state['storage']['method'] = $method;\n }\n\n return $form;\n\n}",
"public function claimFbAction() {\n\t\t$session = Mage::getSingleton('customer/session');\n\t\t$session->setData('fbc_refer', Mage::getUrl('fbc/account/claimFbComplete'));\n\t\t$this->_redirect('fbc/index/login');\n\t}",
"public function setForceChangePasswordNextSignInWithMfa($val)\n {\n $this->_propDict[\"forceChangePasswordNextSignInWithMfa\"] = $val;\n return $this;\n }",
"function cfea_login_form_addition() {\n\t\techo '<input type=\"hidden\" name=\"cfea_auth\" value=\"'.esc_html($_REQUEST['cfea_auth']).'\" />';\n\t}",
"function sms_user_settings_add_form(&$form_state, $account) {\n // refresh the numbers, no form if number and not multiple\n $numbers = sms_user_numbers($account, 'numbers', TRUE);\n if (count($numbers) && ! variable_get('sms_user_multiple_numbers', FALSE)) {\n return;\n }\n\n $form = array();\n $form['uid'] = array('#type' => 'value', '#value' => $account->uid);\n $form['add'] = sms_send_form();\n $form['add']['add_submit'] = array(\n '#type' => 'submit',\n '#value' => t('Add number'),\n );\n\n // place in a fieldset if there is more than one number \n if (count($numbers)) {\n $form['add']['#type'] = 'fieldset';\n $form['add']['#title'] = t('Add another number');\n $form['add']['#collapsible'] = TRUE;\n $form['add']['#collapsed'] = TRUE;\n }\n return $form;\n}",
"function updateUserQuestion() {\n $curentPassword = $_POST['currentPassword'];\n $question = $_POST['question'];\n $answer = $_POST['answer'];\n }",
"function upme_two_factor_email_login(){\n \n $verify_code = isset($_GET['upme_email_two_factor_verify']) ? $_GET['upme_email_two_factor_verify'] : '';\n $user_login = isset($_GET['upme_email_two_factor_login']) ? $_GET['upme_email_two_factor_login'] : '';\n \n if('' != $verify_code){\n $user = get_user_by( 'login', $user_login );\n if($user){\n $user_id = $user->ID;\n if($verify_code == get_user_meta($user_id,'upme_email_two_factor_code',true)){\n delete_user_meta($user_id,'upme_email_two_factor_code');\n // Set automatic login based on the setting value in admin\n wp_set_auth_cookie($user_id, false, is_ssl());\n $link = get_permalink($this->upme_settings['login_page_id']);\n wp_redirect($link);exit;\n }else{\n $this->errors[] = __('Invalid verification code in link.','upme');\n }\n }else{\n $this->errors[] = __('Invalid verification link.','upme');\n }\n }\n \n \n }",
"public function new_acc_form_callback(){\n\t\t\n\t\t//check nonce\n\t\tif ( !wp_verify_nonce( $_REQUEST['wp_nonce'], 'autoflow_get_email' ) )\n\t\t\tdie( 'invalid nonce' );\n\t\t//check email\n\t\tif ( $_REQUEST['email'] != $_REQUEST['email2'] )\n\t\t\tdie( 'Emails don\\'t match' );\n\t\t\n\t\t//create account and die\n\t\t$this->create_account(\n\t\t\tarray(\n\t\t\t\t'firstname' => $_REQUEST['firstname'],\n\t\t\t\t'surname' => $_REQUEST['surname'],\n\t\t\t\t'email' => $_REQUEST['email'],\n\t\t\t\t'nickname' => $_REQUEST['nickname'],\n\t\t\t), \n\t\t\t$_REQUEST['slug'], $_REQUEST['uid']\n\t\t);\n\t\tdie();\n\t}",
"public function rememberAuth() {\n if (!$this->entity_name) exit('Error remember auth : Not defined $entity_name');\n if (!$this->value) return;\n\n $pw_auth = PwSession::get('pw_auth');\n if (!$pw_auth) $pw_auth = [];\n $pw_auth[$this->entity_name] = $this;\n PwSession::set('pw_auth', $pw_auth);\n }",
"public function claimFbCompleteAction() {\n\t\t$sess = Mage::getSingleton('customer/session');\n\t\t$tmpUser = $sess->getCustomer();\n\t\t$newId = $tmpUser->getId();\n\t\t$newUser = clone $tmpUser;\n\n\n\t\t//user waa\n\t\t$store = Mage::app()->getStore();\n\t\t$storeId = $store->getStoreId();\n\t\t$fbObj = Mage::helper('fbconnect')->getFb();\n\n\t\tif (!$newId) {\n\t\t\t//user is not logged in\n\t\t\t$this->_redirect('fbc/account/');\n\t\t\treturn TRUE;\n\t\t}\n\t\tif (!$fbObj->user) {\n\t\t\t//someone's trying to fake a cookie\n\t\t\t$this->_redirect('fbc/account/');\n\t\t\treturn TRUE;\n\t\t}\n\t\t$fbuid = Mage::getModel('fbconnect/fbuid');\n\t\t$fbuid->loadByFbUid($fbObj->user);\n\n\t\tif ($fbuid->getData('claimed_user_id') > 0) {\n\t\t\t//this account has already been claimed\n\t\t\t$this->_redirect('fbc/account/');\n\t\t\treturn TRUE;\n\t\t}\n\t\t$oldUid = $fbuid->getData('user_id');\n\t\t$fbuid->setData('store_id', $storeId);\n\t\t$fbuid->setData('claimed_user_id', $newId);\n\t\t$fbuid->setData('updated_at', date('Y-m-d H:i:s'));\n\t\t$fbuid->setData('user_id', $newId);\n\t\t$fbuid->save();\n\n//\t\tMage::helper('fbconnect/account')->convertFbUidLink($oldUid, $fbObj->user, $storeId, $oldUser->getId());\n\t\tMage::helper('fbconnect/account')->convertAccountOrders($oldUid, $newId);\n\n\t\t$this->_redirect('fbc/account/');\n\t\treturn TRUE;\n\t}",
"function new_challenge()\n{\n\t\tglobal $seesionKey;\n\t\tif($_SESSION[$seesionKey][0]!=NULL){\n \t$_SESSION[$seesionKey][0]['user']['success_point'] = ($_SESSION[$seesionKey][0]['user']['success_point']-5);\n\t\t}\n}",
"function add_facebook_token($accid, $token, $fn, $ln) {\n $fbid = substr($accid,7, strlen($accid)-7);\n \n dbg(\"Adding auth token for facebook id $fbid\");\n \n if(preg_match(\"/[0-9]{1,16}/\",$fbid)===false) \n throw new Exception(\"Invalid fbid $fbid received. Refusing authentication token.\");\n \n // First add external share\n $r = $this->dbexec(\"insert into external_share (es_id,es_identity, es_identity_type, es_first_name, es_last_name) \n values (NULL, '$fbid', 'FaceBook',$fn,$ln)\", \"unable to insert external_share - \");\n if(!$r) \n throw new Exception(\"Error inserting external share for fbid $fbid: \".mysql_error());\n\n $esId = mysql_insert_id();\n \n error_log(\"received esId=$esId\");\n \n $this->dbexec(\"insert into authentication_token (at_id,at_token,at_account_id,at_es_id,at_create_date_time, at_secret, at_parent_at_id, at_priority) \n VALUES (NULL,'$token',NULL,\".$esId.\",CURRENT_TIMESTAMP, '$secret',$atId, 'I')\",\"Unable to insert token for account id $accid\");\n \n return true;\n }",
"function culturefeed_uitpas_profile_details_form_submit(array $form, array &$form_state) {\n\n $uitpas_user = $form_state['values']['uitpas_user'];\n /* @var CultureFeed_User $culturefeed_user */\n $culturefeed_user = $uitpas_user->user;\n /* @var CultureFeed_Uitpas_Passholder $passholder */\n $passholder = $uitpas_user->passholder;\n /* @var CultureFeed_Uitpas_Passholder_CardSystemSpecific $card_system */\n $card_system = $uitpas_user->card_system;\n\n $error = FALSE;\n\n if ($uitpas_user->user && $uitpas_user->passholder && $uitpas_user->card_system) {\n\n // Passholder.\n $passholder_update = new CultureFeed_Uitpas_Passholder();\n $passholder_update->uitpasNumber = $card_system->currentCard->uitpasNumber;\n $passholder_update->email = $form_state['values']['email'];\n if ($form_state['values']['tel']) {\n $passholder_update->telephone = $form_state['values']['tel'];\n }\n if ($form_state['values']['mobile']) {\n $passholder_update->gsm = $form_state['values']['mobile'];\n }\n\n try {\n $uitpas_user->cf->uitpas()->updatePassholder($passholder_update);\n }\n catch (Exception $e) {\n watchdog_exception('culturefeed_uitpas_profile_details_uitpas', $e);\n $error = TRUE;\n }\n\n // CultureFeed user.\n $culturefeed_user_update = new CultureFeed_User();\n $culturefeed_user_update->id = $culturefeed_user->id;\n $culturefeed_user_update->mbox = $form_state['values']['email'];\n\n try {\n DrupalCultureFeed::updateUser($culturefeed_user_update);\n }\n catch (Exception $e) {\n watchdog_exception('culturefeed_uitpas_profile_details_account', $e);\n $error = TRUE;\n }\n\n }\n\n else {\n $error = TRUE;\n }\n\n if ($error) {\n drupal_set_message(t('An error occurred.'), 'error');\n }\n else {\n drupal_set_message(t('Your changes have been saved.'));\n }\n\n}",
"public function add_to_register_form() {\n\t\t$this->recaptcha->show_recaptcha( array( 'action' => ITSEC_Recaptcha::A_REGISTER ) );\n\t}",
"function chpperm_account_form($form_state) {\n if ($form_state['storage']['detailed_view']) {\n return chpperm_account_view_form($form_state);\n }\n if ($form_state['storage']['detailed_notes']) {\n return chpperm_account_notes_form($form_state);\n }\n if ($form_state['storage']['detailed_edit']) {\n return chpperm_account_edit_form($form_state);\n }\n if ($form_state['storage']['detailed_money']) {\n return chpperm_account_money_form($form_state);\n }\n\n drupal_set_title(t('Permit accounts'));\n\n global $user;\n $form = array();\n ahah_helper_register($form, $form_state);\n\n $settings = array();\n $settings['tag'] = 'ajax';\n $settings['show_companies'] = TRUE;\n $settings['show_regions'] = TRUE; // !!\n $settings['show_clients'] = TRUE; // !!\n //$settings['display_single_company'] = TRUE; // !!\n //$settings['display_single_region'] = TRUE; // !!\n //$settings['display_single_client'] = TRUE; // !!\n $settings['option']['skippropertynotes'] = TRUE;\n $settings['buttons']['back']['title'] = t('Back');\n $settings['buttons']['back']['submit'] = 'chpperm_account_form_submit_back';\n if (user_access('anai chp add permit account')) {\n $settings['buttons']['add']['title'] = t('Add');\n $settings['buttons']['add']['submit'] = 'chpperm_account_form_submit_add';\n }\n if (chpprop_produce_header(&$form, &$form_state, $settings)) {\n return $form;\n }\n $company_id = $form_state['storage']['ajax']['CompanyId'];\n $region_id = $form_state['storage']['ajax']['RegionId'];\n $client_id = $form_state['storage']['ajax']['ClientId'];\n\n /*\n * Note 1: Region selector is mainly just there to narrow down client selector.\n * Note 2: Property options are built from groupprop_table instead of regular method.\n */\n\n $props = chpperm_retrieve_group_props($user->uid, $company_id, $client_id);\n //anai_dbg($props, '$props');\n\n $assigned_properties = array();\n if (!empty($props)) {\n foreach ($props as $property_id => $values) {\n $property = $form_state['storage']['ajax']['Properties'][$property_id]['data'];\n $assigned_properties[$property_id] =\n\tdecode_entities($property['Alias']).', '.\n\tdecode_entities($property['Street']).', '.\n\tdecode_entities($property['City']);\n }\n }\n\n if (!empty($assigned_properties)) {\n if (!isset($form_state['storage']['ajax']['PropertyId'])) {\n $form_state['storage']['ajax']['PropertyId'] = key($assigned_properties);\n }\n $form['ajax']['PropertyId'] =\n array('#type' => 'select',\n\t '#options' => $assigned_properties,\n\t '#title' => t('Property'),\n\t '#default_value' => $form_state['storage']['ajax']['PropertyId'],\n\t '#ahah' => array('event' => 'change',\n\t\t\t 'path' => ahah_helper_path(array('ajax')),\n\t\t\t 'wrapper' => 'ajax-wrapper'));\n $property_id = $form_state['storage']['ajax']['PropertyId'];\n }\n\n $assigned_lots = array();\n if (!empty($assigned_properties)) {\n foreach ($props[$property_id] as $lot_id => $values) {\n if ($lot_id === 'ANY') {\n\t$assigned_lots['ANY'] = t('Any lot');\n } else {\n\t$lot = $form_state['storage']['ajax']['Lots'][$property_id][$lot_id];\n\t$assigned_lots[$lot_id] = decode_entities($lot['data']['Alias']);\n }\n }\n if (!isset($form_state['storage']['ajax']['LotId'])) {\n $form_state['storage']['ajax']['LotId'] = key($assigned_lots);\n }\n $form['ajax']['LotId'] =\n array('#type' => 'select',\n\t '#options' => $assigned_lots,\n\t '#title' => t('Lot'),\n\t '#default_value' => $form_state['storage']['ajax']['LotId']);\n $lot_id = $form_state['storage']['ajax']['LotId'];\n }\n\n // Operational accounts\n $groups = array();\n if (!empty($assigned_properties)) {\n $groups = chpperm_retrieve_groups($user->uid, $company_id, $property_id);\n //anai_dbg($groups, '$groups');\n if (isset($groups[$client_id])) {\n $groups = $groups[$client_id];\n } else {\n $groups = array();\n }\n\n }\n $form['ajax']['filter'] =\n array('#type' => 'fieldset',\n\t '#title' => t('Active accounts'));\n if (empty($groups)) {\n $form['ajax']['filter']['empty'] = array('#value' => '<p>'.t('Empty.'));\n } else {\n $form['ajax']['filter']['list'] = chpperm_account_table_form($groups);\n }\n\n\n // List those not assigned to property\n $allgroups = chpperm_retrieve_groups($user->uid, $company_id);\n //anai_dbg($allgroups, '$allgroups');\n\n if (isset($allgroups[$client_id])) {\n $allgroups = $allgroups[$client_id];\n } else {\n $allgroups = array();\n }\n if (!empty($allgroups)) {\n $leftovers = array();\n foreach ($allgroups as $group_id => $group) {\n if (isset($groups[$group_id])) {\n\tcontinue;\n }\n $leftovers[$group_id] = $group;\n }\n }\n if (!empty($leftovers)) {\n $form['ajax']['all'] =\n array('#type' => 'fieldset',\n\t '#title' => t('Available accounts not assigned to property'));\n $form['ajax']['all']['list'] = chpperm_account_table_form($leftovers);\n }\n\n // Suspended table\n $groups = chpperm_retrieve_groups($user->uid, $company_id, 'ANY',\n\t\t\t\t TRUE, TRUE, // Active\n\t\t\t\t TRUE, TRUE); // Suspended\n if (isset($groups[$client_id])) {\n $groups = $groups[$client_id];\n } else {\n $groups = array();\n }\n if (!empty($groups)) {\n $form['ajax']['suspended'] =\n array('#type' => 'fieldset',\n\t '#title' => t('Suspended accounts'));\n $form['ajax']['suspended']['list'] = chpperm_account_table_form($groups);\n }\n\n // Retention table\n if (!isset($form_state['storage']['ajax']['Retention'])) {\n $form_state['storage']['ajax']['Retention'] = FALSE;\n }\n $form['ajax']['Retention'] =\n array('#type' => 'checkbox',\n\t '#title' => t('Show deleted accounts'),\n\t '#default_value' => $form_state['storage']['ajax']['Retention'],\n\t '#ahah' => array('event' => 'change',\n\t\t\t 'path' => ahah_helper_path(array('ajax')),\n\t\t\t 'wrapper' => 'ajax-wrapper'));\n if ($form_state['storage']['ajax']['Retention']) {\n $groups = chpperm_retrieve_groups($user->uid, $company_id, 'ANY',\n\t\t\t\t TRUE, FALSE, // Active\n\t\t\t\t FALSE, FALSE); // Suspended\n if (isset($groups[$client_id])) {\n $groups = $groups[$client_id];\n } else {\n $groups = array();\n }\n $form['ajax']['retention'] =\n array('#type' => 'fieldset',\n\t '#title' => t('Deleted accounts'));\n if (empty($groups)) {\n $form['ajax']['retention']['empty'] = array('#value' => '<p>'.t('Empty.'));\n } else {\n $form['ajax']['retention']['list'] = chpperm_account_table_form($groups);\n }\n }\n\n return $form;\n}",
"public function getForceChangePasswordNextSignInWithMfa()\n {\n if (array_key_exists(\"forceChangePasswordNextSignInWithMfa\", $this->_propDict)) {\n return $this->_propDict[\"forceChangePasswordNextSignInWithMfa\"];\n } else {\n return null;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the maximum count of letters around an found search term in the highlighted text. | function setMaxHighlightedTextChars($_count)
{
$this->maxHighlightedTextChars = intval($_count);
$this->hashMe .= $_count;
} | [
"public function getHighlightMaxAnalyzedChars () {}",
"public function getHighlightRegexMaxAnalyzedChars () {}",
"public function getHighlightRegexMaxAnalyzedChars() {}",
"public static function getUpperLimitSearchWord()\r\n {\r\n return 20;\r\n }",
"private function limit_words(): void {\n\t\t$s = get_search_query();\n\t\tif ( str_word_count( $s, 0 ) > $this->options->search_word_limit ) {\n\t\t\t$words = str_word_count( $s, 2 );\n\t\t\t$position = array_keys( $words );\n\t\t\t$new_s = rtrim( substr( $s, 0, $position[ $this->options->search_word_limit ] ), ' ' );\n\t\t\tset_query_var( 's', $new_s );\n\t\t}\n\t}",
"private function limit_characters(): void {\n\t\t$s = get_search_query();\n\t\tif ( strlen( $s ) > $this->options->search_character_limit ) {\n\t\t\t$new_s = substr( $s, 0, $this->options->search_character_limit );\n\t\t\tset_query_var( 's', $new_s );\n\t\t}\n\t}",
"public static function getUpperLimitSearchWord() {\n\t\treturn 20;\n\t}",
"public function setMaxKeywords(integer $max) {\r\n $this->_maxKeywords = $max;\r\n }",
"public static function getLowerLimitSearchWord()\r\n {\r\n return 3;\r\n }",
"public static function getLowerLimitSearchWord() {\n return 3;\n }",
"public static function getSearchDisplayedCharactersNumber() {\n return 200;\n }",
"function setMaxTeaserChars($_count)\n {\n $this->maxTeaserChars = intval($_count);\n $this->hashMe .= $_count;\n }",
"public static function getLowerLimitSearchWord() {\n\t\treturn 3;\n\t}",
"public static function getLowerLimitSearchWord() \n\t{\n\t\treturn 3;\n\t}",
"function getSubtext($searchterm, $dossier){\n global $link;\n $statements = [];\n $substringcount = [];\n foreach(explode(' ', $searchterm) as $word){\n $query = 'SELECT statement.id AS id, statement.subject_id AS subject, statement.text AS text FROM statement, dossier, subject, subject_to_dossier WHERE dossier.id=' . $dossier . ' AND subject.id=subject_to_dossier.subject_id AND dossier.id=subject_to_dossier.dossier_id\n AND statement.subject_id=subject.id AND text LIKE \\'%' . $word . '%\\';';\n if($result = pg_query($link, $query)){\n while($row = pg_fetch_assoc($result)){\n $statements[] = $row;\n $wordcount = 0;\n foreach(explode(' ', $searchterm) as $word){\n $wordcount += substr_count($row['text'], $word);\n }\n $substringcount[] = $wordcount;\n }\n }\n else{\n echo pg_errormessage($link);\n }\n }\n $maxkey = array_keys($substringcount, max($substringcount));\n $resultstring = '';\n //foreach($maxkey as $key){\n $resultstring .= highlightKeywords($searchterm, $statements[$maxkey[0]]) . '<br>' ;\n //}\n\n return $resultstring;\n}",
"function limit_text($text, $limit){\n if(str_word_count($text, 0)> $limit){\n $words = str_word_count($text,2);\n $pos = array_keys($words);\n $text = substr($text,0,$pos[$limit]). '...';\n }\n return $text;\n}",
"public function setAlternativeTermCount(int $count): self;",
"function AutoCompSetMaxWidth($characterCount){}",
"function vmw_fuzzy_word_length() {\n\t\treturn 3;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Alterar dados de Arquivoretificacao | public function alteraArquivoretificacao()
{
// recebe dados do formulario
$post = DadosFormulario::formularioCadastroArquivoretificacao(NULL, 2);
// valida dados do formulario
$oValidador = new ValidadorFormulario();
if (!$oValidador->validaFormularioCadastroArquivoretificacao($post, 2)) {
$this->msg = $oValidador->msg;
return false;
}
// cria variaveis para validacao com as chaves do array
foreach ($post as $i => $v) $$i = $v;
// cria objeto para grava-lo no BD
$oRetificacaoempresa = new Retificacaoempresa($idRetEmpresa);
$oArquivoretificacao = new Arquivoretificacao($idArqRet, $oRetificacaoempresa, $cnpj, $nomeArquivo, $novoNome, $link, $dataHoraAlteracao, $usuarioAlteracao);
$oArquivoretificacaoBD = new ArquivoretificacaoBD();
if (!$oArquivoretificacaoBD->alterar($oArquivoretificacao)) {
$this->msg = $oArquivoretificacaoBD->msg;
return false;
}
return true;
} | [
"private function importarArquivos()\n {\n\n if (empty($this->aArquivos)) {\n throw new \\ParameterException(\"Nenhum arquivo informado.\");\n }\n\n if (empty($this->aArquivos[0][\"Data\"])) {\n throw new \\ParameterException(\"Data do arquivo não informada.\");\n }\n\n $oDataArquivo = new \\DBDate($this->aArquivos[0][\"Data\"]);\n $sDataNomeSchema = $oDataArquivo->getDia() . $oDataArquivo->getMes() . $oDataArquivo->getAno();\n $sNomeSchema = \"importacao_\" . $sDataNomeSchema;\n\n $aDescricaoArquivoImportado = array();\n $oCivitas = new Civitas($sNomeSchema, false);\n $oProcessamento = new Processamento($sNomeSchema, false);\n\n $anousu = db_getsession(\"DB_anousu\");\n\n foreach ($this->aArquivos as $arquivo) {\n switch ($arquivo[\"TipoArquivo\"]) {\n case self::ARQUIVO_LOTES:\n $caminhoArquivo = $arquivo[\"Caminho\"] . $arquivo[\"Nome\"];\n $oCivitas->setArquivoLote($caminhoArquivo);\n $aDescricaoArquivoImportado[] = \"ARQUIVO DE LOTES\";\n break;\n\n case self::ARQUIVO_EDIFICACOES:\n $caminhoArquivo = $arquivo[\"Caminho\"] . $arquivo[\"Nome\"];\n $oCivitas->setArquivoConstrucao($caminhoArquivo);\n $aDescricaoArquivoImportado[] = \"ARQUIVO DE EDIFICAÇÕES\";\n break;\n }\n }\n\n $oProcessamento->setArquivosImportados($aDescricaoArquivoImportado);\n $oProcessamento->setDataArquivo($oDataArquivo);\n $oProcessamento->processar();\n $oCivitas->processar();\n $oProcessamento->calcularIptu($oCivitas->getMatriculasImportadas(), $anousu);\n $oProcessamento->incluirMatriculasImportadas();\n }",
"public function admin_migrarArquivos(){\r\n $model = 'NotasTecnica';\r\n\r\n $listPlArquivos = $this->Pl->find('all', array(\r\n 'fields' => array('Pl.id', 'Pl.arquivo'),\r\n 'conditions' => array(\r\n 'Pl.arquivo <>' => '',\r\n 'Pl.delete' => 0\r\n ),\r\n 'recursive' => -2\r\n ));\r\n\r\n foreach( $listPlArquivos as $arquivo){\r\n $pl_id = $arquivo['Pl']['id'];\r\n $explodeFileString = explode('/', $arquivo['Pl']['arquivo']);\r\n $nomeArquivo = $explodeFileString[2];\r\n $nomeArquivoExplode = explode('.', $nomeArquivo);\r\n $tituloArquivo = $nomeArquivoExplode[0];\r\n $dirArquivo = $explodeFileString[0].'/'.$explodeFileString[1];\r\n\r\n $a_newFile = array(\r\n 'pl_id' => $pl_id,\r\n 'nome' => $tituloArquivo,\r\n 'arquivo' => $nomeArquivo,\r\n 'dir' => $dirArquivo\r\n );\r\n // echo '<pre>';\r\n // print_r($a_newFile);\r\n // echo '</pre>';\r\n // die();\r\n\r\n\r\n $this->$model->create();\r\n $this->$model->save($a_newFile);\r\n }\r\n }",
"public function incluir() {\n\n $oDaoIssArquivoRetencao = new cl_issarquivoretencao;\n\n $oDaoIssArquivoRetencao->q90_instit = $this->iInstit;\n $oDaoIssArquivoRetencao->q90_data = $this->dData;\n $oDaoIssArquivoRetencao->q90_numeroremessa = $this->iNumeroRemessa;\n $oDaoIssArquivoRetencao->q90_versao = $this->iVersao;\n $oDaoIssArquivoRetencao->q90_quantidaderegistro = $this->iQuantidadeRegistro;\n $oDaoIssArquivoRetencao->q90_valortotal = db_formatar($this->iValorTotal, 'p', '', 2) / 100;\n $oDaoIssArquivoRetencao->q90_codigobanco = $this->iCodigoBanco;\n $oDaoIssArquivoRetencao->q90_oidarquivo = $this->iArquivo;\n $oDaoIssArquivoRetencao->q90_nomearquivo = $this->sNomeArquivo;\n\n $oDaoIssArquivoRetencao->incluir(null);\n\n if ($oDaoIssArquivoRetencao->erro_status == 0) {\n throw new Exception( _M (self::MENSAGENS . 'erro_arquivo_invalido') );\n }\n\n $this->setSequencial($oDaoIssArquivoRetencao->q90_sequencial);\n }",
"private function alterar() {\n\n $oDaoProtprocessodocumento = db_utils::getDao('protprocessodocumento');\n $oDaoProtprocessodocumento->p01_descricao = $this->sDescricao;\n $oDaoProtprocessodocumento->p01_sequencial = $this->iCodigo;\n $oDaoProtprocessodocumento->alterar($this->iCodigo);\n\n /**\n * Erro ao alterar documento\n */\n if ( $oDaoProtprocessodocumento->erro_status == \"0\" ) {\n throw new Exception(_M(URL_MENSAGEM_PROCESSO_DOCUMENTO . 'erro_alterar_documento'));\n }\n return _M(URL_MENSAGEM_PROCESSO_DOCUMENTO . 'documento_alterado');//true;\n }",
"private function persistirDados() {\n\n global $conn;\n if (!is_readable($this->getArquivo())) {\n throw new Exception(\"Arquivo do Documento não Encontrado.\");\n }\n\n /**\n * Abre um arquivo em formato binario somente leitura\n */\n $rDocumento = fopen($this->getArquivo(), \"rb\");\n $iTamanhoArquivo = filesize($this->getArquivo());\n $rDadosDocumento = fread($rDocumento, $iTamanhoArquivo);\n $oOidBanco = pg_lo_create();\n fclose($rDocumento);\n\n $oDaoAcordoDocumento = db_utils::getDao(\"acordodocumento\");\n\n $oDaoAcordoDocumento->ac40_sequencial = null;\n $oDaoAcordoDocumento->ac40_arquivo = $oOidBanco;\n $oDaoAcordoDocumento->ac40_descricao = $this->getDescricao();\n $oDaoAcordoDocumento->ac40_acordo = $this->getCodigoAcordo();\n $oDaoAcordoDocumento->ac40_nomearquivo = $this->getNomeArquivo();\n $oDaoAcordoDocumento->incluir(null);\n\n $this->iCodigo = $oDaoAcordoDocumento->ac40_sequencial;\n if ($oDaoAcordoDocumento->erro_status == '0') {\n throw new Exception($oDaoAcordoDocumento->erro_msg);\n }\n\n $oObjetoBanco = pg_lo_open($conn, $oOidBanco, \"w\");\n pg_lo_write($oObjetoBanco, $rDadosDocumento);\n pg_lo_close($oObjetoBanco);\n }",
"public function analisarArquivo() {\n }",
"private function cargarArchivosModificados()\n {\n //guardamos los archivos modificados pr un usuario\n $archivos = ArchivoCargadoEstado::listar(\"idusuario=\" . $this->getIdUsuario() . \" AND idestadotipos>1 \");\n $this->setArchivosModificados($archivos);\n }",
"public function setPathAttribute($path){ //modificaremos el atributo path, estamos recibiendo path de la BD\n\n if(! empty($path)){ //El campo path no debe estar vacio para que ejecute toda esa accion\n $name = Carbon::now()->second.$path->getClientOriginalName();//CON CARBON LE ESPECIFICAMOS LA FECHA DE HOY, TOMAMOS EL SEGUNDOEN QUE ES SUBIDO Y LO CONCATENAMOS AL NOMBRE ORIGINAL DEL ARCHIVO, creamos una variable que contatenara el nombre con los segundos\n $this->attributes['path'] = $name; //hacemos referencia a path y vamos a cambiarlo el nombre\n \\Storage::disk('local')->put($name, \\File::get($path)); //ACA SE HACE LA SUBIDA DEL ARCHIVO, especificamos el local y mediante el metodo put vamos a almacenar nuestro archivo, recibe el nombre y el archivo que vamos a subir que es el path\n }\n }",
"function file_update(){\n\n $sql ='';\n\n //\n $sql .= 'UPDATE `document` SET `promo`=\"';\n\n $sql .= $_POST['select'];\n\n $sql .= '\", `fichier`=\"';\n\n $sql .= $_POST['value'];\n\n $sql .= '\", `libelle`=\"\"';\n\n $sql .= ' WHERE `id`=\"' . $_POST['id'] .'\"';\n\n $sql .= ';';\n\n\n $namefile = \"SELECT `fichier` FROM `document` WHERE `id`='\". $_POST['id'] .\"'\";\n\n $ds = DIRECTORY_SEPARATOR;\n\n $storeFolder = '..'. $ds .'pdf';\n $namefile2 = \"SELECT `fichier` FROM `document` WHERE `id`='\". $_POST['id'] .\"'\";\n $namefile=DbOperation($namefile2);\n\n $name = str_replace(\"/\",$ds,$_POST['value']);\n rename(dirname( __FILE__ ) . $ds. $storeFolder. $ds . $namefile[0]['fichier'], dirname( __FILE__ ) . $ds. $storeFolder. $ds.$name);\n\n\n\n\n\n DbOperation($sql);\n\n return $sql;\n\n}",
"function asociarPedidoAArchivo($id_pedido, $nombreArchivo, $downloadPermitido = 1) {\n\tglobal $nombre_archivo_subido, $extension_archivo_subido;\n\tglobal $servicesFacade;\n\t\t\n\t$tipoArchivo = buscarArchivoFisico($nombreArchivo);\n\t\t\n\t$nombre_completo = $nombre_archivo_subido . \".\" . $extension_archivo_subido;\n\t\t\n\tif ($tipoArchivo != 0) {\n\t\t$archivos_pedido = $servicesFacade->getAllObjects(\"archivos_pedidos\", array(\"codigo_pedido\" => $id_pedido, \"nombre_archivo\" => $nombre_completo));\n\t\tif (count($archivos_pedido) != 0){\n\t\t\t//El pedido (sin importar si es actual o historial) ya estaba cargado para ese archivo. \n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\t$archivo_pedido_nuevo = array();\n\t\t$archivo_pedido_nuevo[\"Fecha_Upload\"]= date(\"Y-m-d H:i:s\");\n\t\t$archivo_pedido_nuevo[\"nombre_archivo\"]= $nombre_completo;\n\t\t$archivo_pedido_nuevo[\"codigo_pedido\"]= $id_pedido;\n\t\t$archivo_pedido_nuevo[\"Permitir_Download\"]= (int)$downloadPermitido;\n\t\t\n\t\t$codigo_archivo = $servicesFacade->agregarArchivoPedido($archivo_pedido_nuevo);\n\t\tif (is_a($codigo_archivo, \"Celsius_Exception\"))\n\t\t\treturn $codigo_archivo;\n\t\t\t\t\n\t\tif ($tipoArchivo == 1){ //solo los pdfs suman archivos\n\t\t\t$res = $servicesFacade->incrementarArchivosPedido($id_pedido);\n\t\t\tif (is_a($res, \"Celsius_Exception\"))\n\t\t\t\treturn $res;\n\t\t}\n\t\treturn $codigo_archivo;\n\t} else { //el archivo no fue encontrado\n\t\treturn new File_Exception(\"El archivo '$nombreArchivo' no fue encontrado\");\n\t}\n}",
"public function alterarDados (){\r\n \r\n $func = new Funcionario();\r\n $dao = new Dao ();\r\n \r\n //Post\r\n $id = $_POST['id'];\r\n $nome = $_POST['nome'];\r\n $email = $_POST['email'];\r\n $telefone = $_POST['telefone'];\r\n $url = $_FILES['url'];\r\n \r\n //Diretorio e nome\r\n $caminho = \"../view/repositorio/\"; //define o diretorio para onde enviaremos o arquivo\r\n $extensao = strtolower(substr($_FILES['url']['name'], -4)); //pega a extensao do arquivo\r\n $novo_nome = md5(time()) . $extensao; //define o nome do arquivo\r\n \r\n //Upload\r\n move_uploaded_file($_FILES['url']['tmp_name'], $caminho.$novo_nome); //efetua o upload\r\n \r\n $url_img = $caminho.$novo_nome;\r\n \r\n //Resize Imagem\r\n $resize = new resize($url_img);\r\n $resize->resizeImage(400,300, 'auto');\r\n $resize->saveImage($url_img,100);\r\n \r\n //Set Campos\r\n $func->setCampos($nome,$email,$telefone,$novo_nome,$id);\r\n //Update DB\r\n $dao->updateFoto($func);\r\n }",
"protected function atualizarAvaliacao() {\n \n db_app::import(\"social.cadastrounico.ImportacaoCadastroUnico\");\n $oImportacaoCadastroUnico = new ImportacaoCadastroUnico(null);\n $oImportacaoCadastroUnico->atualizarCidadao($this);\n }",
"public function alteraDetalhearquivo()\n {\n // recebe dados do formulario\n $post = DadosFormulario::formularioCadastroDetalhearquivo(NULL, 2);\n // valida dados do formulario\n $oValidador = new ValidadorFormulario();\n if (!$oValidador->validaFormularioCadastroDetalhearquivo($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 $oArquivo = new Arquivo($idArquivo);\n $oDetalhearquivo = new Detalhearquivo($idDetalheArquivo, $oArquivo, $descricao, $linha);\n $oDetalhearquivoBD = new DetalhearquivoBD();\n if (!$oDetalhearquivoBD->alterar($oDetalhearquivo)) {\n $this->msg = $oDetalhearquivoBD->msg;\n return false;\n }\n return true;\n }",
"function recuperarCursoArchivado($IDcurso) {\n\tglobal $db;\n\t\n\t$db->exec('UPDATE cursos SET archivar = 0, anoAcademico = \"\" WHERE ID = '.decrypt($IDcurso));\n}",
"private function geraArquivoEnvio() {\n\n $dtNomeArquivo = str_replace(\"-\", \"_\", $this->dtGeracaoArquivo);\n $this->sLocalizacaoArquivo = \"tmp/arquivo_{$this->iCodigoRemessa}_{$dtNomeArquivo}.txt\";\n\n $iInstituicao = $this->oInstituicao->getSequencial();\n $iAno = $this->iAno;\n $iRemessa = $this->iCodigoRemessa;\n $sSqlGeracaoArquivo = MovimentoArquivoTransmissao::getSqlDadosMovimentacao($iRemessa, $iInstituicao, $iAno);\n $rsBuscaDadosGeracaoArquivo = db_query($sSqlGeracaoArquivo);\n $iCodigoConvenio = db_utils::fieldsMemory($rsBuscaDadosGeracaoArquivo, 0)->convenio;\n $iTotalMovimentos = pg_num_rows($rsBuscaDadosGeracaoArquivo);\n $iContaPagadora = 0;\n\n $aCodigoSequenciais = array();\n\n $oLayoutTXT = new db_layouttxt(211, $this->sLocalizacaoArquivo);\n $oHeader = $this->constroiDadosHeader($iCodigoConvenio);\n\n $oLayoutTXT->setByLineOfDBUtils($oHeader, 1);\n $this->iContadorRegistros++;\n $aCodigoSequenciais[] = $this->iContadorRegistros;\n\n $oStdDadosBancoAnterior = new stdClass();\n $oStdDadosBancoAnterior->banco = 0;\n $oStdDadosBancoAnterior->agencia = 0;\n $oStdDadosBancoAnterior->digitoAgencia = 0;\n $oStdDadosBancoAnterior->conta = 0;\n $oStdDadosBancoAnterior->digitoConta = 0;\n\n /**\n * @TODO fazer uso do model ArquivoTransmissao, usando getMovimentos para buscar objetos\n * do tipo MovimentoArquivoTransmissao, para não precisar refazer o SQL \"MovimentoArquivoTransmissao::getSqlDadosMovimentacao\"\n */\n for ($iDadoMovimento = 0; $iDadoMovimento < $iTotalMovimentos; $iDadoMovimento++) {\n\n $this->iSequencialRegistro++;\n $oStdMovimento = db_utils::fieldsMemory($rsBuscaDadosGeracaoArquivo, $iDadoMovimento);\n $oDadosMovimento = MovimentoArquivoTransmissao::montaObjetoLinha($oStdMovimento);\n /* [Inicio plugin GeracaoArquivoOBN - Geracao Arquivo OBN - parte2] */\n $oLinha = $this->constroiLinhaTipoDois($oDadosMovimento);\n $oLayoutTXT->setByLineOfDBUtils($oLinha, 3, 2);\n /* [Fim plugin GeracaoArquivoOBN - Geracao Arquivo OBN - parte2] */\n\n $this->iContadorRegistros++;\n $aCodigoSequenciais[] = $this->iContadorRegistros;\n\n $this->nValorTotalDasMovimentacoes += $oDadosMovimento->getValor();\n\n /* [Inicio plugin GeracaoArquivoOBN - Geracao Arquivo OBN - parte3] */\n $iTipoLinha = ConfiguracaoArquivoObn::verificaTipoLinha($oDadosMovimento->getCodigoBarra());\n /* [Fim plugin GeracaoArquivoOBN - Geracao Arquivo OBN - parte3] */\n switch($iTipoLinha) {\n\n /* [Inicio plugin GeracaoArquivoOBN - Geracao Arquivo OBN - parte4] */\n /* [Fim plugin GeracaoArquivoOBN - Geracao Arquivo OBN - parte4] */\n case ConfiguracaoArquivoObn::LAYOUT4:\n\n /* [Inicio plugin GeracaoArquivoOBN - Geracao Arquivo OBN - parte5] */\n /* [Fim plugin GeracaoArquivoOBN - Geracao Arquivo OBN - parte5] */\n $this->iSequencialRegistro++;\n $oLinha = $this->constroiLinhaTipoQuatro($oDadosMovimento);\n $oLayoutTXT->setByLineOfDBUtils($oLinha, 3, 4);\n\n $this->iContadorRegistros++;\n $aCodigoSequenciais[] = $this->iContadorRegistros;\n break;\n\n /* [Inicio plugin GeracaoArquivoOBN - Geracao Arquivo OBN - parte6] */\n /* [Fim plugin GeracaoArquivoOBN - Geracao Arquivo OBN - parte6] */\n\n }\n\n }\n\n $this->iContadorRegistros = array_sum($aCodigoSequenciais);\n $oLinha = $this->constroiLinhaTrailer();\n $oLayoutTXT->setByLineOfDBUtils($oLinha, 5);\n }",
"function editar_asignacion ($datos){\n //--Obtenemos la asignacion para conservar los datos freezados del responsable de aula.\n $this->dep('datos')->tabla('asignacion')->cargar(array('id_asignacion'=>$this->s__id_asignacion));\n $asignacion=$this->dep('datos')->tabla('asignacion')->get();\n $datos['nombre']=$asignacion['nombre'];\n $datos['apellido']=$asignacion['apellido'];\n $datos['legajo']=$asignacion['legajo'];\n $datos['nro_doc']=$asignacion['nro_doc'];\n $datos['tipo_doc']=$asignacion['tipo_doc'];\n $datos['id_asignacion']=$this->s__id_asignacion;\n $this->dep('datos')->tabla('asignacion')->set($datos);\n $this->dep('datos')->tabla('asignacion')->sincronizar(); \n\n $asignacion_definitiva=array(\n 'nombre' => $datos['dia_semana'],\n 'id_asignacion' => $this->s__id_asignacion\n );\n\n //--Esta vez cargamos el datos_tabla con la asignacion_definitiva correspondiente.\n $this->dep('datos')->tabla('asignacion_definitiva')->cargar(array('id_asignacion'=>$this->s__id_asignacion));\n $this->dep('datos')->tabla('asignacion_definitiva')->set($asignacion_definitiva);\n $this->dep('datos')->tabla('asignacion_definitiva')->sincronizar();\n\n //--Guardamos el nuevo equipo de catedra, si no se realizo una edicion del mismo.\n $n=count($this->s__docentes_seleccionados);\n if($n>0){\n //--Contiene el equipo de catedra, si existe.\n if(count($this->s__equipo_catedra)>0){\n //--Internamente esta funcion modifica el contenido del atributo unico_registro.\n $this->dep('datos')->tabla('catedra')->set_tope_max_filas(count($this->s__equipo_catedra));\n $this->dep('datos')->tabla('catedra')->cargar(array('id_asignacion'=>$this->s__id_asignacion));\n\n $this->dep('datos')->tabla('catedra')->eliminar_todo();\n }\n //--Del cuadro docentes seleccionados nos falta el atributo id_asignacion necesario para\n //registrar el equipo de catedra.\n //print_r($this->s__id_asignacion);print_r(\"<br><br>\");\n\n foreach ($this->s__docentes_seleccionados as $key=>$docente){\n if(isset($docente)){\n $docente['id_asignacion']=$this->s__id_asignacion;\n $this->dep('datos')->tabla('catedra')->nueva_fila($docente);\n $this->dep('datos')->tabla('catedra')->sincronizar();\n $this->dep('datos')->tabla('catedra')->resetear();\n }\n }\n }\n }",
"public function archivos_documentos(){}",
"public function setArchivoNuevo(array $datos) {\r\n parent::connectDBPrueba()->query('SET FOREIGN_KEY_CHECKS = 0');\r\n $consulta = $this->insertar('t_archivos_minuta', $datos);\r\n parent::connectDBPrueba()->query('SET FOREIGN_KEY_CHECKS = 1');\r\n return $consulta;\r\n }",
"function sobreescribirArchivo($ruta, $archivo) {\r\n global $arrayLineas;\r\n $nuevaCadena = \"\";\r\n\r\n /* Introducimos todas las líneas ya modificadas en un string */\r\n for ($i = 1; $i <= sizeof($arrayLineas); $i++) {\r\n $nuevaCadena .= $arrayLineas[$i];\r\n }\r\n\r\n /* Si no está en UTF-8, lo convertimos */\r\n\r\n if (strpos(mb_detect_encoding($nuevaCadena), 'UTF-8') !== false) {\r\n $file = fopen($ruta . '/' . $archivo, \"w\");\r\n fwrite($file, $nuevaCadena);\r\n fclose($file);\r\n } else {\r\n $file = fopen($ruta . '/' . $archivo, \"w\");\r\n fwrite($file, \"\\xEF\\xBB\\xBF\" . $nuevaCadena);\r\n fclose($file);\r\n }\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the name of the model that is generated by the factory. | public function modelName(): string
{
$resolver = static::$modelNameResolver ?: static function (self $factory) {
$name = Str::replaceLast('Factory', '', Str::classBasename($factory));
return $name.'Model';
};
return $this->model ?: $resolver($this);
} | [
"public function modelName(): string\n {\n return class_basename($this->model);\n }",
"public function getModelName() {\n \treturn \n \t\tisset($this->modelName) ? \n \t\t$this->modelName :\n \t\tucwords(Str::snake((new \\ReflectionClass($this))->getShortName(), ' '));\n }",
"public function getModelName()\n\t{\n\t\t$relation = $this->getRelation();\n\t\tif ($relation)\n\t\t\t$model = $relation->foreignModelClass;\n\t\telse\n\t\t\t$model = $this->getAttribute('model');\n\n\t\treturn $model;\n\t}",
"protected function guessModel(): string\n {\n return config('travy.models.namespace').'\\\\'.class_basename(static::class);\n }",
"public function getModelName()\n {\n return class_basename($this->loggable_type);\n }",
"public function getPhoneModelName() {\n\t\treturn $this->getDependency('\\Phone\\Model', $this->model_id, 'name');\t\t\n\t}",
"public function fqnModel()\n {\n return rtrim($this->modelNamespace, '\\\\') . '\\\\' . $this->model;\n }",
"public function model(): string\n {\n $className = $this->getClassName(); // e.g. UserRepository\n $modelName = $this->getModelName($className); // e.g. User\n return $this->getModelNamespace($modelName);\n }",
"public static function getModelFriendlyName(): string\n {\n return self::$friendlyModelName ?? self::fromCamelCase(class_basename(get_called_class()));\n }",
"protected function tryInferName()\n\t{\n\t\treturn class_basename(get_class($this->model));\n\t}",
"public function getModelName()\n {\n }",
"public function getModel(): string {\n\t\treturn $this->model;\n\t}",
"protected function getModelName():string\n {\n return \\Yii::$app->user->identityClass;\n }",
"private function getTranslationModelName(): string\n {\n return $this->translationModel ?? '\\\\' . get_class($this) . 'Translation';\n }",
"public function getModelClassName()\n {\n return $this->objectInfo->getShortName();\n }",
"public function getName(): string\n {\n /** @noinspection ReturnFalseInspection */\n $class = substr(strrchr($this->getModelClass(), \"\\\\\"), 1);\n\n $snakeCasedName = '';\n\n $len = strlen($class);\n for ($i = 0; $i < $len; ++$i) {\n if ($i !== 0 && ctype_upper($class[$i])) {\n $snakeCasedName .= '_'.strtolower($class[$i]);\n } else {\n $snakeCasedName .= strtolower($class[$i]);\n }\n }\n\n return $snakeCasedName;\n }",
"public function getModel()\n {\n $model = $this->getXML()->getName();\n return $model;\n }",
"protected function _getEntityName() {\r\n return basename(str_replace('_Model', '', str_replace('\\\\', '/', get_class($this))));\r\n }",
"protected function getCrudName()\n {\n return Str::plural(class_basename($this->getModel()));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'createInboundShipmentPlan'. | protected function createInboundShipmentPlanRequest($body)
{
// verify the required parameter 'body' is set
if (null === $body || (is_array($body) && 0 === count($body))) {
throw new \InvalidArgumentException('Missing the required parameter $body when calling createInboundShipmentPlan');
}
$resourcePath = '/fba/inbound/v0/plans';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
return $this->generateRequest($multipart, $formParams, $queryParams, $resourcePath, $headerParams, 'POST', $httpBody);
} | [
"public function createInboundShipmentPlan($request)\n {\n require_once (dirname(__FILE__) . '/Model/CreateInboundShipmentPlanResponse.php');\n return FBAInboundServiceMWS_Model_CreateInboundShipmentPlanResponse::fromXML($this->_invoke('CreateInboundShipmentPlan'));\n }",
"public function createInboundShipmentPlan($request)\n {\n if (!$request instanceof FBAInboundServiceMWS_Model_CreateInboundShipmentPlanRequest) {\n require_once ('FBAInboundServiceMWS/Model/CreateInboundShipmentPlanRequest.php');\n $request = new FBAInboundServiceMWS_Model_CreateInboundShipmentPlanRequest($request);\n }\n require_once ('FBAInboundServiceMWS/Model/CreateInboundShipmentPlanResponse.php');\n return FBAInboundServiceMWS_Model_CreateInboundShipmentPlanResponse::fromXML($this->_invoke($this->_convertCreateInboundShipmentPlan($request)));\n }",
"public function createInboundShipment($request)\n {\n if (!$request instanceof FBAInboundServiceMWS_Model_CreateInboundShipmentRequest) {\n require_once ('FBAInboundServiceMWS/Model/CreateInboundShipmentRequest.php');\n $request = new FBAInboundServiceMWS_Model_CreateInboundShipmentRequest($request);\n }\n require_once ('FBAInboundServiceMWS/Model/CreateInboundShipmentResponse.php');\n return FBAInboundServiceMWS_Model_CreateInboundShipmentResponse::fromXML($this->_invoke($this->_convertCreateInboundShipment($request)));\n }",
"protected function createInboundShipmentRequest($body, $shipment_id)\n {\n // verify the required parameter 'body' is set\n if (null === $body || (is_array($body) && 0 === count($body))) {\n throw new \\InvalidArgumentException('Missing the required parameter $body when calling createInboundShipment');\n }\n // verify the required parameter 'shipment_id' is set\n if (null === $shipment_id || (is_array($shipment_id) && 0 === count($shipment_id))) {\n throw new \\InvalidArgumentException('Missing the required parameter $shipment_id when calling createInboundShipment');\n }\n\n $resourcePath = '/fba/inbound/v0/shipments/{shipmentId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = $body;\n $multipart = false;\n\n // path params\n if (null !== $shipment_id) {\n $resourcePath = str_replace(\n '{'.'shipmentId'.'}',\n ObjectSerializer::toPathValue($shipment_id),\n $resourcePath\n );\n }\n\n return $this->generateRequest($multipart, $formParams, $queryParams, $resourcePath, $headerParams, 'POST', $httpBody);\n }",
"protected function installmentPlanCreateRequest($request)\n {\n // verify the required parameter 'request' is set\n if ($request === null || (is_array($request) && count($request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $request when calling installmentPlanCreate'\n );\n }\n\n $resourcePath = '/api/InstallmentPlan/Create';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($request)) {\n $this->injectSessionRequestHeaders($request);\n $_tempBody = $request;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['text/plain', 'application/json', 'text/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['text/plain', 'application/json', 'text/json'],\n ['application/json-patch+json', 'application/json', 'text/json', 'application/_*+json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createInboundShipmentRequest($shipment_id, $body)\n {\n // verify the required parameter 'shipment_id' is set\n if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $shipment_id when calling createInboundShipment'\n );\n }\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling createInboundShipment'\n );\n }\n\n $resourcePath = '/fba/inbound/v0/shipments/{shipmentId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($shipment_id !== null) {\n $resourcePath = str_replace(\n '{' . 'shipmentId' . '}',\n ObjectSerializer::toPathValue($shipment_id),\n $resourcePath\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 ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($body)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($body));\n } else {\n $httpBody = $body;\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\\Query::build($formParams);\n }\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function installmentPlanRequestPaymentRequest($request)\n {\n // verify the required parameter 'request' is set\n if ($request === null || (is_array($request) && count($request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $request when calling installmentPlanRequestPayment'\n );\n }\n\n $resourcePath = '/api/InstallmentPlan/RequestPayment';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($request)) {\n $this->injectSessionRequestHeaders($request);\n $_tempBody = $request;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['text/plain', 'application/json', 'text/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['text/plain', 'application/json', 'text/json'],\n ['application/json-patch+json', 'application/json', 'text/json', 'application/_*+json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function callPlanCreateRequest($call_plan, $accountid)\n {\n // verify the required parameter 'call_plan' is set\n if ($call_plan === null || (is_array($call_plan) && count($call_plan) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $call_plan when calling callPlanCreate'\n );\n }\n // verify the required parameter 'accountid' is set\n if ($accountid === null || (is_array($accountid) && count($accountid) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $accountid when calling callPlanCreate'\n );\n }\n\n $resourcePath = '/{accountid}/callplan';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($accountid !== null) {\n $resourcePath = str_replace(\n '{' . 'accountid' . '}',\n ObjectSerializer::toPathValue($accountid),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($call_plan)) {\n $_tempBody = $call_plan;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function create_plan(Request $request){\n //$plan = Plan::get('P-34H46869E0829054WPFHLLOQ', $this->apiContext);\n //print_r($plan);die;\n $plan = new Plan();\n $plan->setName($request->name)\n ->setDescription($request->description)\n ->setType('infinite');\n\n // Set billing plan definitions\n $paymentDefinition = new PaymentDefinition();\n $paymentDefinition->setName('Regular Payments')\n ->setType('REGULAR')\n ->setFrequency('Month')\n ->setFrequencyInterval('1')\n ->setCycles('0')\n ->setAmount(new Currency(array('value' => floatval($request->amount), 'currency' => $request->currency)));\n\n // Set merchant preferences\n $merchantPreferences = new MerchantPreferences();\n $merchantPreferences->setReturnUrl($request->return_url)\n ->setCancelUrl($request->cancel_url)\n ->setAutoBillAmount('yes')\n ->setInitialFailAmountAction('CONTINUE')\n ->setMaxFailAttempts('0')\n ->setSetupFee(new Currency(array('value' => floatval($request->setup_fee), 'currency' => $request->setup_currency)));\n\n $plan->setPaymentDefinitions(array($paymentDefinition));\n $plan->setMerchantPreferences($merchantPreferences);\n\n //create the plan\n try {\n $createdPlan = $plan->create($this->apiContext);\n\n try {\n $patch = new Patch();\n $value = new PayPalModel('{\"state\":\"ACTIVE\"}');\n $patch->setOp('replace')\n ->setPath('/')\n ->setValue($value);\n $patchRequest = new PatchRequest();\n $patchRequest->addPatch($patch);\n $createdPlan->update($patchRequest, $this->apiContext);\n $plan = Plan::get($createdPlan->getId(), $this->apiContext);\n\n // Output plan id\n echo 'Plan ID:' . $plan->getId();\n } catch (PayPal\\Exception\\PayPalConnectionException $ex) {\n echo $ex->getCode();\n echo $ex->getData();\n die($ex);\n } catch (Exception $ex) {\n die($ex);\n }\n } catch (PayPal\\Exception\\PayPalConnectionException $ex) {\n echo $ex->getCode();\n echo $ex->getData();\n die($ex);\n } catch (Exception $ex) {\n die($ex);\n }\n }",
"private function _convertListInboundShipments($request) {\n \n $parameters = array();\n $parameters['Action'] = 'ListInboundShipments';\n if ($request->isSetSellerId()) {\n $parameters['SellerId'] = $request->getSellerId();\n }\n if ($request->isSetMarketplace()) {\n $parameters['Marketplace'] = $request->getMarketplace();\n }\n if ($request->isSetShipmentStatusList()) {\n $shipmentStatusListlistInboundShipmentsRequest = $request->getShipmentStatusList();\n foreach ($shipmentStatusListlistInboundShipmentsRequest->getmember() as $membershipmentStatusListIndex => $membershipmentStatusList) {\n $parameters['ShipmentStatusList' . '.' . 'member' . '.' . ($membershipmentStatusListIndex + 1)] = $membershipmentStatusList;\n }\n }\n if ($request->isSetShipmentIdList()) {\n $shipmentIdListlistInboundShipmentsRequest = $request->getShipmentIdList();\n foreach ($shipmentIdListlistInboundShipmentsRequest->getmember() as $membershipmentIdListIndex => $membershipmentIdList) {\n $parameters['ShipmentIdList' . '.' . 'member' . '.' . ($membershipmentIdListIndex + 1)] = $membershipmentIdList;\n }\n }\n if ($request->isSetLastUpdatedBefore()) {\n $parameters['LastUpdatedBefore'] = $request->getLastUpdatedBefore();\n }\n if ($request->isSetLastUpdatedAfter()) {\n $parameters['LastUpdatedAfter'] = $request->getLastUpdatedAfter();\n }\n\n return $parameters;\n }",
"protected function installmentPlanGetRequest($request)\n {\n // verify the required parameter 'request' is set\n if ($request === null || (is_array($request) && count($request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $request when calling installmentPlanGet'\n );\n }\n\n $resourcePath = '/api/InstallmentPlan/Get';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($request)) {\n $this->injectSessionRequestHeaders($request);\n $_tempBody = $request;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['text/plain', 'application/json', 'text/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['text/plain', 'application/json', 'text/json'],\n ['application/json-patch+json', 'application/json', 'text/json', 'application/_*+json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function inventoryPlansPostRequest($plan_type)\n {\n // verify the required parameter 'plan_type' is set\n if ($plan_type === null || (is_array($plan_type) && count($plan_type) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $plan_type when calling inventoryPlansPost'\n );\n }\n\n $resourcePath = '/inventory/plans';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // body params\n $_tempBody = null;\n if (isset($plan_type)) {\n $_tempBody = $plan_type;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue,\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n } elseif ($headers['Content-Type'] === 'application/json') {\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 API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n\n return new Request(\n 'POST',\n $this->config->getHost().$resourcePath.($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function create_new_plan($plan_name, $plan_description, $plan_type, $currency, $billing_interval, $client_plan_id = null, $plan_group = null, $plan_group_id = null, $usage_billing_interval = null, $active = null, $rollover_months = null, $rollover_plan_no = null, $rollover_client_plan_id = null, $initial_free_months = null, $acct_status_cd = null, $rollover_status_days = null, $rollover_status_cd = null, $dunning_plan_no = null, $dunning_client_plan_id = null, $template_no = null, $client_email_template_id = null, $apply_cancellation = null, $plan_cancel_min_month = null, $apply_minimum_fee = null, $how_to_apply_minimum_fee = null, $schedule = null, $service = null, $resource = null, $arc_service_no = null, $parent_plans = null, $parent_client_plan_ids = null, $exclusion_plans = null, $supplemental_obj_field = null, $template_ind = null, $child_plans = null, $notification_template_group_no = null, $credit_note_template_no = null, $surcharge_no = null, $client_surcharge_id = null, $proration_invoice_timing_cd = null)\n {\n return $this->__ws_call('create_new_plan', Array(\n 'plan_name' => $plan_name,\n 'plan_description' => $plan_description,\n 'plan_type' => $plan_type,\n 'currency' => $currency,\n 'billing_interval' => $billing_interval,\n 'client_plan_id' => $client_plan_id,\n 'plan_group' => $plan_group,\n 'plan_group_id' => $plan_group_id,\n 'usage_billing_interval' => $usage_billing_interval,\n 'active' => $active,\n 'rollover_months' => $rollover_months,\n 'rollover_plan_no' => $rollover_plan_no,\n 'rollover_client_plan_id' => $rollover_client_plan_id,\n 'initial_free_months' => $initial_free_months,\n 'acct_status_cd' => $acct_status_cd,\n 'rollover_status_days' => $rollover_status_days,\n 'rollover_status_cd' => $rollover_status_cd,\n 'dunning_plan_no' => $dunning_plan_no,\n 'dunning_client_plan_id' => $dunning_client_plan_id,\n 'template_no' => $template_no,\n 'client_email_template_id' => $client_email_template_id,\n 'apply_cancellation' => $apply_cancellation,\n 'plan_cancel_min_month' => $plan_cancel_min_month,\n 'apply_minimum_fee' => $apply_minimum_fee,\n 'how_to_apply_minimum_fee' => $how_to_apply_minimum_fee,\n 'schedule' => $schedule,\n 'service' => $service,\n 'resource' => $resource,\n 'arc_service_no' => $arc_service_no,\n 'parent_plans' => $parent_plans,\n 'parent_client_plan_ids' => $parent_client_plan_ids,\n 'exclusion_plans' => $exclusion_plans,\n 'supplemental_obj_field' => $supplemental_obj_field,\n 'template_ind' => $template_ind,\n 'child_plans' => $child_plans,\n 'notification_template_group_no' => $notification_template_group_no,\n 'credit_note_template_no' => $credit_note_template_no,\n 'surcharge_no' => $surcharge_no,\n 'client_surcharge_id' => $client_surcharge_id,\n 'proration_invoice_timing_cd' => $proration_invoice_timing_cd\n ));\n }",
"public function withInboundShipmentPlans($value)\n {\n $this->setInboundShipmentPlans($value);\n return $this;\n }",
"public function UpdateInboundShipment(Request\\UpdateInboundShipmentRequest $request);",
"protected function updateInboundShipmentRequest($shipmentId, $inboundShipmentRequest)\n {\n // verify the required parameter 'shipmentId' is set\n if ($shipmentId === null || (is_array($shipmentId) && count($shipmentId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $shipmentId when calling updateInboundShipment'\n );\n }\n // verify the required parameter 'inboundShipmentRequest' is set\n if ($inboundShipmentRequest === null || (is_array($inboundShipmentRequest) && count($inboundShipmentRequest) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $inboundShipmentRequest when calling updateInboundShipment'\n );\n }\n\n $resourcePath = '/fba/inbound/v0/shipments/{shipmentId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($shipmentId !== null) {\n $resourcePath = str_replace(\n '{' . 'shipmentId' . '}',\n ObjectSerializer::toPathValue($shipmentId),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($inboundShipmentRequest)) {\n $_tempBody = $inboundShipmentRequest;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\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 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function scheduledPlanRequest($scheduled_plan_id, $fields = null)\n {\n // verify the required parameter 'scheduled_plan_id' is set\n if ($scheduled_plan_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $scheduled_plan_id when calling scheduledPlan'\n );\n }\n\n $resourcePath = '/scheduled_plans/{scheduled_plan_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($fields !== null) {\n $queryParams['fields'] = ObjectSerializer::toQueryValue($fields);\n }\n\n // path params\n if ($scheduled_plan_id !== null) {\n $resourcePath = str_replace(\n '{' . 'scheduled_plan_id' . '}',\n ObjectSerializer::toPathValue($scheduled_plan_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 ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function listInboundShipments($request);",
"public function createRequestForCreateFlow(Flow $flow): RequestInterface\n {\n return $this->createRequest('POST', sprintf('/%1$s/flows', $this->getOptions()->getAccountId()), $flow, [], [], []);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create GET response metrics/messages/applications/6d917118 | public function getMetricsMessagesApplication6d917118()
{
return '';
} | [
"function getAllMessages($employerID, $employeeID, $count)\n{\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_URL, 'http://worqit.azurewebsites.net/api/Message/getLast?employerID='.$employerID.'&employeeID='.$employeeID.'&count='.$count.'');\n $content = curl_exec($curl);\n curl_close($curl);\n\n return json_decode($content);\n}",
"public function appStats(){\n\t\t$response = $this->sendRequest( 'POST' ,'readAppStats', $this->msgData);\n\t\tif(!isset($response[\"data\"]->{'Data'}))\n\t\t\treturn $response;\n\n\t\t$res = $response[\"data\"];\n\t\t$result = array();\n\t\t$i=0;\n\n\t\t$count = isset($res->{'AppStats'}) ? count($res->{'AppStats'}) : 0;\n\t\tif(isset($res->{'PushStats'}))\n\t\t{\n\t\t\tforeach ($res->{'PushStats'} as $pushStats)\n\t\t\t{\n\t\t\t\t$found = false;\n\t\t\t\tfor($j=0; $j<$count; $j++)\n\t\t\t\t{\n\t\t\t\t\tif((isset($res->{'AppStats'}[$j])) && ($pushStats->{'TimeIntervalInfo'} == $res->{'AppStats'}[$j]->{'TimeIntervalInfo'}))\n\t\t\t\t\t{\n\t\t\t\t\t\t$result[$i][\"TimeIntervalInfo\"] = $pushStats->{'TimeIntervalInfo'};\n\t\t\t\t\t\t$result[$i][\"AndroidPushSent\"] = $pushStats->{'AndroidPushSent'};\n\t\t\t\t\t\t$result[$i][\"IosPushSent\"] = $pushStats->{'IosPushSent'};\n\t\t\t\t\t\t$result[$i][\"AndroidPushOpen\"] = $pushStats->{'AndroidPushOpen'};\n\t\t\t\t\t\t$result[$i][\"IosPushOpen\"] = $pushStats->{'IosPushOpen'};\n\t\t\t\t\t\t$result[$i][\"AndroidAppOpenNotifDis\"] = $res->{'AppStats'}[$j]->{'AndroidAppOpenNotifDis'};\n\t\t\t\t\t\t$result[$i][\"AndroidAppOpenNotifEnb\"] = $res->{'AppStats'}[$j]->{'AndroidAppOpenNotifEnb'};\n\t\t\t\t\t\t$result[$i][\"IosAppOpenNotifDis\"] = $res->{'AppStats'}[$j]->{'IosAppOpenNotifDis'};\n\t\t\t\t\t\t$result[$i][\"IosAppOpenNotifEnb\"] = $res->{'AppStats'}[$j]->{'IosAppOpenNotifEnb'};\n\t\t\t\t\t\tunset($res->{'AppStats'}[$j]);\n\t\t\t\t\t\t$found = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!$found)\n\t\t\t\t{\n\t\t\t\t\t$result[$i][\"TimeIntervalInfo\"] = $pushStats->{'TimeIntervalInfo'};\n\t\t\t\t\t$result[$i][\"AndroidPushSent\"] = $pushStats->{'AndroidPushSent'};\n\t\t\t\t\t$result[$i][\"IosPushSent\"] = $pushStats->{'IosPushSent'};\n\t\t\t\t\t$result[$i][\"AndroidPushOpen\"] = $pushStats->{'AndroidPushOpen'};\n\t\t\t\t\t$result[$i][\"IosPushOpen\"] = $pushStats->{'IosPushOpen'};\n\t\t\t\t\t$result[$i][\"AndroidAppOpenNotifDis\"] = 0;\n\t\t\t\t\t$result[$i][\"AndroidAppOpenNotifEnb\"] = 0;\n\t\t\t\t\t$result[$i][\"IosAppOpenNotifDis\"] = 0;\n\t\t\t\t\t$result[$i][\"IosAppOpenNotifEnb\"] = 0;\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\tif($count)\n\t\t{\n\t\t\tforeach ($res->{'AppStats'} as $appStats)\n\t\t\t{\n\t\t\t\t$result[$i][\"TimeIntervalInfo\"] = $appStats->{'TimeIntervalInfo'};\n\t\t\t\t$result[$i][\"AndroidPushSent\"] = 0;\n\t\t\t\t$result[$i][\"IosPushSent\"] = 0;\n\t\t\t\t$result[$i][\"AndroidPushOpen\"] = 0;\n\t\t\t\t$result[$i][\"IosPushOpen\"] = 0;\n\t\t\t\t$result[$i][\"AndroidAppOpenNotifDis\"] = $appStats->{'AndroidAppOpenNotifDis'};\n\t\t\t\t$result[$i][\"AndroidAppOpenNotifEnb\"] = $appStats->{'AndroidAppOpenNotifEnb'};\n\t\t\t\t$result[$i][\"IosAppOpenNotifDis\"] = $appStats->{'IosAppOpenNotifDis'};\n\t\t\t\t$result[$i][\"IosAppOpenNotifEnb\"] = $appStats->{'IosAppOpenNotifEnb'};\n\t\t\t}\n\t\t}\n\t\tif(count($result))\n\t\t{\n\t\t\tusort($result, array(\"shipit\", \"cmpTimeInt\"));\n\t\t\t$file = \"appStats_\".gmdate(\"Y-m-d_H-i-s\").\".csv\";\n\t\t\t$output = fopen($file, 'w');\n\t\t\tfputcsv($output, array('TimeIntervalInfo', 'AndroidPushSent', 'IosPushSent', 'AndroidPushOpen', 'IosPushOpen', 'AndroidAppOpenNotifDis', 'AndroidAppOpenNotifEnb', 'IosAppOpenNotifDis', 'IosAppOpenNotifEnb'));\n\t\t\tforeach ($result as $res)\n\t\t\t{\n\t\t\t\tif(!$res['AndroidPushSent'])\n\t\t\t\t\t$res['AndroidPushSent'] = 0;\n\t\t\t\tif(!$res['IosPushSent'])\n\t\t\t\t\t$res['IosPushSent'] = 0;\n\t\t\t\tif(!$res['AndroidPushOpen'])\n\t\t\t\t\t$res['AndroidPushOpen'] = 0;\n\t\t\t\tif(!$res['IosPushOpen'])\n\t\t\t\t\t$res['IosPushOpen'] = 0;\n\t\t\t\tif(!$res['AndroidAppOpenNotifDis'])\n\t\t\t\t\t$res['AndroidAppOpenNotifDis'] = 0;\n\t\t\t\tif(!$res['AndroidAppOpenNotifEnb'])\n\t\t\t\t\t$res['AndroidAppOpenNotifEnb'] = 0;\n\t\t\t\tif(!$res['IosAppOpenNotifDis'])\n\t\t\t\t\t$res['IosAppOpenNotifDis'] = 0;\n\t\t\t\tif(!$res['IosAppOpenNotifEnb'])\n\t\t\t\t\t$res['IosAppOpenNotifEnb'] = 0;\n\t\t\t\tfputcsv($output, array($res['TimeIntervalInfo'], $res['AndroidPushSent'], $res['IosPushSent'], $res['AndroidPushOpen'], $res['IosPushOpen'],\n\t\t\t\t\t\t\t\t\t\t$res['AndroidAppOpenNotifDis'], $res['AndroidAppOpenNotifEnb'],$res['IosAppOpenNotifDis'], $res['IosAppOpenNotifEnb']));\n\t\t\t}\n\t\t\tfclose($output);\n\t\t}\n\t\tunset($response[\"data\"]);\n\t\treturn $response;\n\t}",
"private static function getApplicationLink() {\n\t\t$curl = curl_init();\n\t\tcurl_setopt_array($curl, array(\n\t\t\tCURLOPT_HEADER => false,\n\t\t\tCURLOPT_RETURNTRANSFER => true,\n\t\t\tCURLOPT_SSL_VERIFYPEER => false,\n\t\t\tCURLOPT_SSL_VERIFYHOST => false,\n\t\t\tCURLOPT_URL => self::$ucwa_baseserver . self::$ucwa_path_user,\n\t\t\tCURLOPT_REFERER => self::$ucwa_baseserver . self::$ucwa_path_xframe,\n\t\t\tCURLOPT_HTTPHEADER => array(\n\t\t\t\t\"Accept: application/json\",\n\t\t\t\t\"Authorization: Bearer \" . self::$ucwa_accesstoken,\n\t\t\t\t\"X-Ms-Origin: \" . self::$ucwa_fqdn,\n\t\t\t),\n\t\t\tCURLOPT_TIMEOUT => 15,\n\t\t));\n\t\t\n\t\t$response = curl_exec($curl);\n\t\t$status = curl_getinfo($curl);\n\t\tcurl_close($curl);\n\t\t\n\t\tif ($status[\"http_code\"] == 200) {\n\t\t\t$data = json_decode($response, true);\n\t\t\t$link = parse_url($data[\"_links\"][\"applications\"][\"href\"]);\n\t\t\t\n\t\t\tself::$ucwa_path_application = $link[\"path\"] . (isset($link[\"query\"]) ? '?' . $link[\"query\"] : '');\n\t\t\t\n\t\t\t// Check if Hostname is the same\n\t\t\tif ( self::$ucwa_baseserver != $link[\"scheme\"] . \"://\" . ( substr($link[\"host\"], -1) == \"/\" ? substr($link[\"host\"], 0, -1) : $link[\"host\"] ) ) {\n\t\t\t\t// Hostname different!\n\t\t\t\t// New access token\n\t\t\t\tself::$ucwa_baseserver = $link[\"scheme\"] . \"://\" . ( substr($link[\"host\"], -1) == \"/\" ? substr($link[\"host\"], 0, -1) : $link[\"host\"] );\n\t\t\t\t\n\t\t\t\tif ( self::getAccessToken(self::$ucwa_user, self::$ucwa_pass) ) {\n\t\t\t\t\treturn true;\t\n\t\t\t\t} else {\n\t\t\t\t\tself::_error(\"Hostname changed (application resource) => requested new access token => failed.\", array());\n\t\t\t\t\treturn false;\t\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {\n\t\t\tself::_error(\"Can't get applications link for Skype UCWA\", $status);\t\n\t\t\treturn false;\n\t\t}\n\t}",
"function messages_report ($params = array()) {\n // Account details\n $apiKey = urlencode('9FUGpx76Lv4-co6Tv7eY1O585eevwfyasTQu3ind1N');\n \n // Prepare data for POST request\n $data = array('apikey' => $apiKey, 'start' => $params['start'], 'limit' => $params['limit']);\n \n // Send the POST request with cURL\n $ch = curl_init('https://api.textlocal.in/get_history_api/');\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $response = curl_exec($ch);\n curl_close($ch);\n \n // Process your response here\n return $response;\n }",
"public function getApplicationInfo() {\n return $this->call('appInfo', 'getApplication', $startDate=null, $endDate=null, $eventName=null, $country=null, $versionName=null, $groupBy=null);\n }",
"function GetSpsWithUnreadMsgForApp($category_id, $app_user_id, $timestamp) \n {\t\n \t$return = array();\n\t$db = new DbHandler();\n\t$return = $db->getSpsWithUnreadMsgForApp($category_id, $app_user_id, $timestamp);\n\techo json_encode($return);\n }",
"public function action_getMetrics(){\n $name = Request::get('eventName','',AnalyticsModule::PARAMS_LOCATION);\n $metrics = AnalyticsAggregator::getMetricsByEventName($name);\n return array(\"Metrics\"=>DataObject::objectListToArrayList($metrics));\n }",
"function get_flashMessages() {\n \n $app = \\Slim\\Slim::getInstance();\n \n $flash = $app->view()->getData('flash');\n \n $messages = $flash->getMessages();\n \n $response = array();\n \n foreach($messages as $key => $val) {\n \n $response[] = array('type' => $key, 'message' => $val);\n \n }\n \n return json_encode($response);\n \n}",
"public function downloadDownloadedAppsAction() {\n\n\n $sessionId = $this->_getParam('token', 0);\n $userId = $this->__validateToken($sessionId);\n\n //Validate Heder params\n $headersParams = $this->validateHeaderParams();\n\n $userAgent = $headersParams['userAgent'];\n $chapId = $headersParams['chapId'];\n\n $appId = $this->_getParam('appId');\n $buildId = $this->_getParam('build_Id');\n $mobileNo = $this->_getParam('mdn');\n\n //Testing Mobile No\n //$mobileNo = '5155328687';\n //$userAgent = \"Mozilla/5.0 (Linux; U; Android 1.5; fr-fr; Galaxy Build/CUPCAKE) AppleWebKit/525.10+ (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2\";\n //$chapId = 8056;\n //Check if App Id has been provided\n if ($appId === null || empty($appId)) {\n\n\n $this->__echoError(\"1001\", \"App Id not found\", self::BAD_REQUEST_CODE);\n\n }\n //Check if Chap Id has been provided\n if ($buildId === null || empty($buildId)) {\n\n\n $this->__echoError(\"1002\", \"Build Id not found\", self::BAD_REQUEST_CODE);\n\n }\n //Check if Chap Id has been provided\n if ($mobileNo === null || empty($mobileNo)) {\n\n\n $this->__echoError(\"5000\", \"Mobile Number not found\", self::BAD_REQUEST_CODE);\n }\n\n\n //Check if the app belongs to the CHAP\n $chapProductModel = new Api_Model_ChapProducts();\n $appCount = $chapProductModel->getProductCountByChap($chapId, $appId);\n\n if ($appCount == 0) {\n\n\n $this->__echoError(\"1003\", \"App does not belong to this partner\", self::BAD_REQUEST_CODE);\n\n }\n\n /******************************************************************* */\n\n //Detect the device id from thd db according to the given user agent\n $deviceId = $this->deviceAction($userAgent);\n\n //Check if the device was detected or not, if not retrun a message as below\n if ($deviceId === null || empty($deviceId)) {\n\n $this->__echoError(\"2000\", \"Device not found\", self::BAD_REQUEST_CODE);\n } else {\n\n //get the app details\n $productModel = new Api_Model_Products();\n $appDetails = $productModel->getProductDetailsbyId($appId);\n\n //Check if app details available\n if (is_null($appDetails)) {\n $this->__echoError(\"3001\", \"This app has been removed or does not exist\", self::BAD_REQUEST_CODE);\n }\n\n $productDownloadCls = new Nexva_Api_ProductDownload();\n $buildUrl = $productDownloadCls->getBuildFileUrl($appId, $buildId);\n\n //check whether the app has been downloaded 2 times or less, if it downloaded 2 times it wont allowed download anymore\n $userDownloadModel = new Api_Model_UserDownloads();\n $capable = $userDownloadModel->checkDownloadCapability($appId,$chapId,$userId,$buildId);\n\n if($capable)\n {\n /************* Add Statistics - Download *************************/\n $source = \"API\";\n $ipAddress = $this->getRequest()->getServer('REMOTE_ADDR');\n\n\n $model_ProductBuild = new Model_ProductBuild();\n $buildInfo = $model_ProductBuild->getBuildDetails($buildId);\n\n\n $modelQueue = new Partner_Model_Queue();\n $modelQueue->removeDownlaodedItem($userId, $chapId);\n\n $modelDownloadStats = new Api_Model_StatisticsDownloads();\n $modelDownloadStats->addDownloadStat($appId, $chapId, $source, $ipAddress, $userId, $buildId, $buildInfo->platform_id, $buildInfo->language_id, $deviceId, $sessionId);\n\n /******************End Statistics ******************************* */\n\n $downloadLink = array();\n $downloadLink['download_app'] = $buildUrl;\n\n $this->getResponse()\n ->setHeader('Content-type', 'application/json');\n\n //Here str_replace has been used to prevent of adding '/' when ecnoded by JSON\n //thre is a solution but ,JSON_UNESCAPED_UNICODE is only works in PHP 5.4+, http://php.net/manual/en/function.json-encode.php\n $encodedDownloadLink = str_replace('\\/', '/', json_encode($downloadLink));\n $this->loggerInstance->log('Response :: Pay app response not logged' ,Zend_Log::INFO);\n echo $encodedDownloadLink;\n\n //since the download link has already sent adding a download record for UserDownload table\n $userDownloadModel->addDownloadRecord($appId,$chapId,$userId,$buildId);\n }\n else\n {\n $this->__echoError(\"1004\", \"Maximum Allowed Download Limit Reached\", self::BAD_REQUEST_CODE);\n }\n }\n }",
"public function get_api_log_message( $data ) {\n\n\t\t$messages = array();\n\n\t\t$messages[] = isset( $data['uri'] ) && $data['uri'] ? 'Request' : 'Response';\n\n\t\tforeach ( (array) $data as $key => $value ) {\n\t\t\t$messages[] = trim( sprintf( '%s: %s', $key, is_array( $value ) || ( is_object( $value ) && 'stdClass' == get_class( $value ) ) ? print_r( (array) $value, true ) : $value ) );\n\t\t}\n\n\t\treturn implode( \"\\n\", $messages ) . \"\\n\";\n\t}",
"public function summaryAction() \n {\n // Obtain app id from request object.\n $appId=$this->_request->id;\n \n $this->echoJson(\n array(\n \"app-name\"=>\"Test App\",\n \"app-link\"=>\"www.test.test\",\n \"app-cost\"=>\"Free\",\n \"app-category\"=>\"Test Category\",\n \"app-desciption\"=>\"Test App Description\",\n \"app-rating\"=>\"Test Rating\",\n \"app-size\"=>\"Test size\",\n )\n );\n }",
"public function viewApplications()\n {\n\n $url = $this->base.'applications';\n\n return self::makeAPICall('GET', $url);\n\n }",
"public function getChatRequests(){ \n $chat_list = Api::getChatRequests(); \n if(!empty($chat_list)){ \n return ResponseBuilder::result(200, 'success', $chat_list); \n } else {\n return ResponseBuilder::result(404, 'record_not_found'); \n }\n \n }",
"public function get_metric_details_for_application_id($equipment_application_metric_id, $equipment_application_id)\r\n\t{\r\n\t\t//this is reusable to get i.e. interface names for dhcp servers already running on the equipment\r\n\t\t\r\n\t\t$applications = $this->get_application_mappings();\r\n\t\t\r\n\t\tif ($applications != null) {\r\n\t\t\r\n\t\t\tforeach ($applications as $application) {\r\n\t\t\t\t\t\r\n\t\t\t\t//is this a\r\n\t\t\t\tif ($application->get_equipment_application_id() == $equipment_application_id) {\r\n\t\t\r\n\t\t\t\t\t$app_metrics = $application->get_metric_mappings();\r\n\t\t\r\n\t\t\t\t\tif ($app_metrics != null) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tforeach ($app_metrics as $app_metric) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ($app_metric->get_equipment_application_metric_id() == $equipment_application_metric_id) {\r\n\t\t\t\t\t\t\t\t$return[] = $app_metric;\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\t\r\n\t\tif (isset($return)) {\r\n\t\t\treturn $return;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t}",
"public function details($appId)\n {\n $this->validateNotEmptySessionOrFail();\n $username = $this->storage->getUsername();\n self::validateNotEmptyUsernameOrFail($username);\n $json = $this->signedFetch(\n 'GET',\n sprintf(\n 'application/%s',\n $appId\n )\n );\n return $json;\n }",
"public function viewApplications() {\n\t\t\n\t\t$url = $this->base . 'applications';\n\t\treturn self::makeAPICall('GET', $url);\n\t\t\n\t}",
"public function retrieveApplications()\n {\n return $this->start()->uri(\"/api/application\")\n ->get()\n ->go();\n }",
"function showMessages($ID){\n\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_URL, 'http://worqit.azurewebsites.net/api/Message/getOverviewEmployer/'.$ID);\n $content = curl_exec($curl);\n curl_close($curl);\n\n $allMessages = json_decode($content);\n $receivedMessages= array();\n if(!empty($allMessages->Messages)){\n foreach($allMessages->Messages as $allMessage){\n if($allMessage->sender== 'employee'){\n $receivedMessages[] = $allMessage;\n }\n }\n }\n return $receivedMessages;\n}",
"function listMetrics($cloudWatchClient)\r\n{\r\n try {\r\n $result = $cloudWatchClient->listMetrics();\r\n\r\n $message = ''; \r\n\r\n if (isset($result['@metadata']['effectiveUri']))\r\n {\r\n $message .= 'For the effective URI at ' . \r\n $result['@metadata']['effectiveUri'] . \":\\n\\n\";\r\n \r\n if ((isset($result['Metrics'])) and \r\n (count($result['Metrics']) > 0))\r\n {\r\n $message .= \"Metrics found:\\n\\n\";\r\n\r\n foreach($result['Metrics'] as $metric) \r\n {\r\n $message .= 'For metric ' . $metric['MetricName'] . \r\n ' in namespace ' . $metric['Namespace'] . \":\\n\";\r\n \r\n if ((isset($metric['Dimensions'])) and \r\n (count($metric['Dimensions']) > 0))\r\n {\r\n $message .= \"Dimensions:\\n\";\r\n\r\n foreach ($metric['Dimensions'] as $dimension)\r\n {\r\n $message .= 'Name: ' . $dimension['Name'] . \r\n ', Value: ' . $dimension['Value'] . \"\\n\";\r\n }\r\n\r\n $message .= \"\\n\";\r\n } else {\r\n $message .= \"No dimensions.\\n\\n\";\r\n }\r\n }\r\n } else {\r\n $message .= 'No metrics found.';\r\n }\r\n } else {\r\n $message .= 'No metrics found.';\r\n }\r\n\r\n return $message;\r\n } catch (AwsException $e) {\r\n return 'Error: ' . $e->getAwsErrorMessage();\r\n }\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create new asset delivery policy. | public function createAssetDeliveryPolicy(AssetDeliveryPolicy $assetDeliveryPolicy)
{
return AssetDeliveryPolicy::createFromOptions($this->_createEntity($assetDeliveryPolicy, 'AssetDeliveryPolicies'));
} | [
"public function create($project, Policy $postBody, $optParams = [])\n {\n $params = ['project' => $project, 'postBody' => $postBody];\n $params = array_merge($params, $optParams);\n return $this->call('create', [$params], Policy::class);\n }",
"protected function createPolicy()\n {\n $model = Str::studly(class_basename($this->argument('name')));\n $name = \"{$model}Policy\";\n $this->call('arche:policy', [\n 'name' => $name,\n '--model' => $model,\n ]);\n }",
"public function createDelivery();",
"public function actionCreate()\n\t{\n\t\t$post = Yii::$app->request->post();\n\t\t$model = new Policy;\n\t\t// $this->packFormData($post, $model);\n\t\t//if ($model->validate() && $model->insert()) {\n\t\tif ($model->load(Yii::$app->getRequest()->getBodyParams(), '') && $model->save()) {\n\t\t\t$data = ['id' => $model->primaryKey, 'msg' => '政策添加成功'];\n\t\t\treturn $data;\n\t\t} else {\n\t\t\t$validateError = $model->getFirstErrors();\n\t\t\t$validateError = is_array($validateError) ? join(',', $validateError) : 'So sorry. Something is wrong.';\n\t\t\tthrow new \\yii\\web\\HttpException(402, $validateError);\n\t\t}\n\t}",
"public function store(CreatePrivacyPolicyRequest $request)\n {\n $input = $request->all();\n\n $privacyPolicy = $this->privacyPolicyRepository->create($input);\n\n Flash::success('Privacy Policy saved successfully.');\n\n return redirect(route('privacy-policy.index'));\n }",
"public static function newPolicy()\n {\n $policy = null;\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\n $policy = new Policy($_POST);\n $policy = PoliciesDB::addPolicy($policy);\n }\n if (is_null($policy) || $policy->getErrorCount() != 0) {\n $_SESSION['policy'] = $policy;\n PolicyView::showNew();\n } else {\n HomeView::show();\n header('Location: /' . $_SESSION['base']);\n }\n }",
"public function create()\n {\n return view('privacy_policy.create');\n }",
"public function add_deliver_cost_post(Request $request, Area $area) {\n $post = $request->all();\n $post['area_id'] = $area->id;\n DeliveryArea::create($post);\n\n return redirect()->route('areas.deliverycosts');\n }",
"public function actionCreatePayment() {\n }",
"public function created(PaymentRequest $paymentRequest)\n {\n //\n }",
"public function createPolicy(Repository $repository, string $name): Policy;",
"public function createPurchaseContract();",
"public function create()\n {\n // solo se permite creacion de subastas a usuarios identificados\n if (!$this->isLoggedIn())\n $this->redirect(\"user\", \"login\");\n\n // se debe proporcionar el identificador del producto a poner en subasta\n if (!$this->request->product)\n $this->redirect(\"product\");\n\n // TODO: mover las comprobaciones sobre el modelo a los modelos.\n // el producto debe existir y estar en estado pendiente\n $this->product = new \\models\\Product($this->request->product);\n if (!$this->product->fill() || $this->product->state !== \"pendiente\") {\n $this->setFlash($this->lang[\"bidding\"][\"create_err\"]);\n $this->redirect(\"product\"); }\n\n // solo se permite la puesta en subasta al propietario o a un\n // administrador\n if ($this->session->username !== $this->product->getOwner() && !$this->isAdmin()) {\n $this->setFlash($this->lang[\"bidding\"][\"create_err\"]);\n $this->redirect(\"bidding\");\n }\n\n // si GET, redirige al formulario de creacion de subasta, con los datos\n // necesarios del producto\n if ($this->request->isGet()) {\n $this->view->assign(\"product\", $this->product);\n $this->view->render(\"bidding_create\");\n }\n\n // si POST, inserta la subasta y redirige\n if ($this->request->isPost()) {\n if ($this->createPost()) {\n $this->setFlash($this->lang[\"bidding\"][\"create_ok\"]);\n $this->redirect(\"bidding\");\n } else {\n $this->setFlash($this->lang[\"bidding\"][\"create_err\"]);\n $this->redirect(\"bidding\", \"create\");\n }\n }\n }",
"public function createPayment() {\r\n $payment = new AirpayPayment($this->merchant['id']);\r\n \r\n $uid = uniqid();\r\n while ($this->getPaymentRepository()->isInvoiceAvailable($uid) === false) {\r\n $uid = uniqid();\r\n }\r\n $payment->setInvoice($uid);\r\n \r\n $logEvent = new AirpayLogEvent('Payment created');\r\n $this->eventDispatcher->dispatch('beinarovic_airpay.log', $logEvent);\r\n \r\n return $payment;\r\n }",
"protected function createPolicy(): self\n {\n $path = app_path(\"Policies/{$this->singularClass}Policy.php\");\n $stub = $this->getStub('policy/policy');\n $this->files->put($path, $this->replacePlaceholders($stub));\n $this->info('Gate policy created');\n\n $path = app_path('Providers/AuthServiceProvider.php');\n $stub = $this->getStub('policy/mapping');\n $this->files->append($path, $this->replacePlaceholders($stub));\n $this->info('Gate policy mapping updated');\n\n $path = database_path('seeds/PermissionsSeeder.php');\n $stub = $this->getStub('model/permissionsSeeder');\n $this->files->append($path, $this->replacePlaceholders($stub));\n $this->info('Permissions seeder updated');\n\n return $this;\n }",
"public function create()\n\t{\n\t\t$this->auth->restrict('Purchase_Order.Orders.Create');\n\n\t\tif (isset($_POST['save']))\n\t\t{\n\t\t\tif ($insert_id = $this->save_purchase_order())\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\tlog_activity($this->current_user->id, lang('purchase_order_act_create_record') .': '. $insert_id .' : '. $this->input->ip_address(), 'purchase_order');\n\n\t\t\t\tTemplate::set_message(lang('purchase_order_create_success'), 'success');\n\t\t\t\tredirect(SITE_AREA .'/orders/purchase_order');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('purchase_order_create_failure') . $this->purchase_order_model->error, 'error');\n\t\t\t}\n\t\t}\n\t\tAssets::add_module_js('purchase_order', 'purchase_order.js');\n\n\t\tTemplate::set('toolbar_title', lang('purchase_order_create') . ' Purchase Order');\n\t\tTemplate::render();\n\t}",
"public function store(CreatePetpolicyRequest $request)\n\t{\n\t \n\t\tPetpolicy::create($request->all());\n\n\t\treturn redirect()->route(config('quickadmin.route').'.petpolicy.index');\n\t}",
"public function store(Request $request)\n {\n $this->authorize('create', Cost::class);\n }",
"public function createDeliveryMethod(Request $request)\n {\n $request->validate([\n 'name' => 'required|string|max:255',\n 'price' => 'required|numeric',\n 'description' => 'string|max:255'\n ], [], [\n 'name' => 'název',\n 'price' => 'cena',\n 'description' => 'popisek'\n ]);\n $delivery_method = new DeliveryMethod;\n $delivery_method->fill($request->all());\n $delivery_method->save();\n session()->flash('success_message', 'Nový způsob dopravy byl úspěšně přidán.');\n return redirect(route('admin.delivery_and_payment_methods'));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse urlpatterns This function configure and parse application urlpatterns array. | protected function urlparser(array $urlpatterns, string $request_path) : array {
//urlpatterns array
$urls=array();
//Parse urlpatterns array
foreach($urlpatterns as $url => $views) {
//Ignore trailing slashes
if($this->setting['ingore_slash']===true) {
$url=rtrim($url,'/');
}
//Convert wildcard patterns to RegEx
$regex=str_replace(array('{slug}'), array('([^/]+)'), $url);
//URLs route
$route=$regex;
//check urlpatterns have another urls array
if(!is_array($views)) {
//get views class name and method name
list($class,$view)=explode('.',$views);
//Match RegEx patterns
if(preg_match('#^'.$regex.'$#', $request_path, $matches)) {
//Matched URLs route
$route=$matches[0];
//Remove first data from array
array_shift($matches);
//Add pathVariables
$data=$matches;
} else {
//Null pathVariables
$data=array();
}
//Add URLs data
$urls[$route]['url']=$route;
$urls[$route]['views']=array('class'=>$class, 'method'=>$view);
$urls[$route]['data']=$data;
//if urlpatterns have another urls array
} else {
//Parse urlpatterns
foreach($views as $child_url => $child_view) {
//merge child urls with parent url
if(strlen($child_url)>0) {
//URLs route
$url=rtrim($route,'/').'/'.ltrim($child_url,'/');
} else {
//URLs route
$url=$child_url;
}
//Ignore trailing slashes
if($this->setting['ingore_slash']==true) {
$url=rtrim($url,'/');
}
//Convert wildcard patterns to RegEx
$regex=str_replace(array('{slug}'), array('([^/]+)'), $url);
//URLs route
$child_route=$regex;
//check view is array or not
if(!is_array($child_view)) {
//get views class name and method name
list($class,$view)=explode('.',$child_view);
//Match RegEx patterns
if(preg_match('#^'.$regex.'$#', $request_path, $matches)) {
//Matched URLs route
$child_route=$matches[0];
//Remove first data from array
array_shift($matches);
//Add pathVariables
$data=$matches;
} else {
//Null pathVaraiables
$data=array();
}
//Add URLs data
$urls[$child_route]['url']=$child_route;
$urls[$child_route]['views']=array('class'=>$class, 'method'=>$view);
$urls[$child_route]['data']=$data;
} else {
//Invalid urlpatterns
exit("invalid urlpatterns");
}
}
}
}
//return urlpatterns
return $urls;
} | [
"protected abstract function uriSchemePatterns();",
"public function addUrlPatterns(array $patterns) {\n\t\t\n\t\t// loop over the array of key value pairs, validating and adding to the url map\n\t\tforeach ($patterns as $pattern => $handler) {\n\t\t\t\n\t\t\t// valid pattern\n\t\t\tif (!is_string($pattern)) {\n\t\t\t\tthrow new Exception('The pattern provided is invalid, must be a valid regular expression');\n\t\t\t}\n\t\t\t\n\t\t\tif (is_array($handler)) {\n\t\t\t\t$parts = $handler;\n\t\t\t}\n\t\t\telse if(is_string($handler)) {\n\t\t\t\t$parts = explode('.', $handler);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new Exception('The handler provided is invalid.');\n\t\t\t}\n\t\t\t\n\t\t\t// valid handler\n\t\t\tif (count($parts) != 2) {\n\t\t\t\tthrow new Exception('The handler provided is invalid.');\n\t\t\t}\n\t\t\t$this->url_maps[$pattern] = array('class' => $parts[0], 'method' => $parts[1]);\n\t\t}\n\t}",
"protected function initUrlConfig()\n {\n if (!isset($this->urlConfig['prefix'])) {\n $this->urlConfig['prefix'] = self::URL_PREFIX;\n }\n if (!isset($this->urlConfig['routePrefix'])) {\n $this->urlConfig['routePrefix'] = self::URL_PREFIX;\n }\n if (!isset($this->urlConfig['rules'])) {\n $this->urlConfig['rules'] = [];\n }\n $this->urlConfig['rules'] = array_merge(\n $this->urlConfig['rules'],\n [\n 'captcha' => self::URL_ROUTE_CAPTCHA,\n 'clientAuth' => self::URL_ROUTE_CLIENT_AUTH,\n 'login' => self::URL_ROUTE_LOGIN,\n 'logout' => self::URL_ROUTE_LOGOUT,\n 'signup' => self::URL_ROUTE_SIGNUP,\n 'signupDone' => self::URL_ROUTE_SIGNUP_DONE,\n 'activate/<token:[a-zA-Z0-9_-]+>' => self::URL_ROUTE_ACTIVATE,\n 'connect' => self::URL_ROUTE_CONNECT,\n 'changePassword/<token:[a-zA-Z0-9_-]+>' => self::URL_ROUTE_CHANGE_PASSWORD,\n 'forgotPassword' => self::URL_ROUTE_FORGOT_PASSWORD,\n 'forgotPasswordDone' => self::URL_ROUTE_FORGOT_PASSWORD_DONE,\n 'resetPassword/<token:[a-zA-Z0-9_-]+>' => self::URL_ROUTE_RESET_PASSWORD,\n ]\n );\n }",
"protected static function parseUrl(){\n\t\tif(self::$urlSegments === null){\n\t\t\t$url = preg_replace('/^(.*)\\?.*$/', '\\1', $_SERVER['REQUEST_URI']);\n\t\t\t$url = trim($url, '/');\n\t\t\t$urlSegmentsRaw = explode('/', $url);\n\t\t\tself::$urlSegments = array();\n\t\t\tforeach($urlSegmentsRaw as $urlSegment){\n\t\t\t\tif($urlSegment !== '') array_push(self::$urlSegments, urldecode($urlSegment));\n\t\t\t}\n\t\t}\n\t}",
"public function parseRoutes()\n {\n $uri = $this->uri->getUriString(); // Warning !: don't use $this->uri->segments in here instead of use getUriString otherwise\n // we could not get url suffix \".html\".\n\n if ( ! isset($this->routes[$this->DOMAIN])) {\n $this->setRequest($this->uri->segments); \n return;\n }\n $parameters = array();\n foreach ($this->routes[$this->DOMAIN] as $val) { // Loop through the route array looking for wild-cards\n\n if (strpos($val['scheme'], '}') !== false) { // Do we have route Parameters like {id}/{name} ?\n $parametersIndex = preg_split('#{(.*?)}#', $val['scheme']); // Get parameter indexes\n foreach ($parametersIndex as $key => $values) { // Find parameters we will send it to closure($args)\n $values = null;\n $parameters[] = (isset($this->uri->segments[$key])) ? $this->uri->segments[$key] : null;\n }\n $val['scheme'] = preg_replace('#{(.*?)}#', '', $val['scheme']);\n }\n if (static::hasMatch($val['match'], $uri)) { // Does the route match ?\n $this->dispatchRouteMatches($uri, $val, $parameters);\n return;\n }\n }\n $this->setRequest($this->uri->segments); // If we got this far it means we didn't encounter a matching route so we'll set the site default route\n }",
"protected function _parse_routes()\n {\n $segments = ee()->uri->segment_array();\n array_shift($segments);\n // Turn the segment array into a URI string\n $uri = implode('/', $segments);\n\n // Get HTTP verb\n $http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri]))\n {\n // Check default routes format\n if (is_string($this->routes[$uri]))\n {\n $this->_set_request(explode('/', $this->routes[$uri]));\n return;\n }\n // Is there a matching http verb?\n elseif (is_array($this->routes[$uri]) && isset($this->routes[$uri][$http_verb]))\n {\n $this->_set_request(explode('/', $this->routes[$uri][$http_verb]));\n return;\n }\n }\n\n // Loop through the route array looking for wildcards\n foreach ($this->routes as $key => $val)\n {\n // Check if route format is using http verb\n if (is_array($val))\n {\n if (isset($val[$http_verb]))\n {\n $val = $val[$http_verb];\n }\n else\n {\n continue;\n }\n }\n\n // Convert wildcards to RegEx\n $key = str_replace(array(':any', ':num'), array('[^/]+', '[0-9]+'), $key);\n\n // Does the RegEx match?\n if (preg_match('#^'.$key.'$#', $uri, $matches))\n {\n\n // Are we using callbacks to process back-references?\n if ( ! is_string($val) && is_callable($val))\n {\n // Remove the original string from the matches array.\n array_shift($matches);\n\n // Execute the callback using the values in matches as its parameters.\n $val = call_user_func_array($val, $matches);\n }\n // Are we using the default routing method for back-references?\n elseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE)\n {\n $val = preg_replace('#^'.$key.'$#', $val, $uri);\n }\n\n $this->_set_request(explode('/', $val));\n return;\n }\n }\n\n throw new Exception(\"API NoFound\");\n }",
"protected function urlPathPattern()\n {\n return [];\n }",
"function _parse_routes()\n {\n $rest_routes = map_resources();\n\n // we do this for performence\n\t\tif (empty($rest_routes) && count($this->routes) == 1)\n\t\t{\n\t\t\t$this->_set_request($this->uri->segments);\n\t\t\treturn;\n\t\t}\n\n // also this...\n\t\t$uri = implode('/', $this->uri->segments);\n\t\tif (isset($this->routes[$uri]))\n\t\t{\n\t\t\t$this->_set_request(explode('/', $this->routes[$uri]));\n\t\t\treturn;\n\t\t}\n\n // RESTful url matching...\n $request_method = $_SERVER['REQUEST_METHOD'];\n $routes = (isset($rest_routes[$request_method]) && $rest_routes[$request_method]) ? $rest_routes[$request_method] : array();\n foreach($routes as $pattern => $replace)\n {\n $pattern = str_replace(':id', '[^/]+', $pattern); // use this to match non-numeric id field\n $pattern = str_replace(':any', '.+', $pattern);\n $pattern = str_replace(':num', '[0-9]+', $pattern);\n $pattern = str_replace(':uuid', '[a-zA-Z0-9]{8}(-[a-zA-Z0-9]{4}){3}-[a-zA-Z0-9]{12}', $pattern);\n\n // Does the RegEx match?\n\t\t\tif (preg_match(\"#^{$pattern}$#\", $uri))\n\t\t\t{\n\t\t\t\t// Do we have a back-reference?\n\t\t\t\tif (strpos($replace, '$') !== FALSE && strpos($pattern, '(') !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$replace = preg_replace(\"#^{$pattern}$#\", $replace, $uri);\n\t\t\t\t}\n\n // we are done\n\t\t\t\t$this->_set_request(explode('/', $replace));\n\t\t\t\treturn;\n\t\t\t}\n }\n\n // if non of the rules match, then go on...\n parent::_parse_routes();\n }",
"protected function loadUrlRules()\n {\n $urlManager = \\Yii::$app->urlManager;\n\n $defaultRoute = \\Yii::$app->defaultRoute;\n if (!$defaultRoute || $defaultRoute == 'site') {\n $defaultRoute = 'site/index';\n }\n\n // Add url rules for all other languages\n $languages = $this->getSupported(true);\n if (!$this->defaultLanguageCodeInUrl) {\n unset($languages[array_search($this->defaultLanguage, $languages)]);\n }\n if ($languages) {\n $implode = implode('|', $languages);\n $urlManager->addRules([\n [\n 'pattern' => '/<lang:('.$implode.')>/',\n 'route' => $defaultRoute,\n ],\n [\n 'pattern' => '/<lang:('.$implode.')>/<module:>/<controller:>',\n 'route' => '<module>/<controller>',\n ],\n [\n 'pattern' => '/<lang:('.$implode.')>/<module:>/<controller:>/<action:>',\n 'route' => '<module>/<controller>/<action>',\n ],\n [\n 'pattern' => '/<lang:('.$implode.')>/<controller:>',\n 'route' => '<controller>',\n ],\n [\n 'pattern' => '/<lang:('.$implode.')>/<controller:>/<action:>',\n 'route' => '<controller>/<action>',\n ],\n ]);\n }\n\n // Add url rules for default language\n if (!$this->defaultLanguageCodeInUrl) {\n $urlManager->addRules([\n [\n 'pattern' => '/',\n 'route' => $defaultRoute,\n 'defaults' => ['lang' => $this->defaultLanguage],\n ],\n [\n 'pattern' => '/<module:>/<controller:>',\n 'route' => '<module>/<controller>',\n 'defaults' => ['lang' => $this->defaultLanguage],\n ],\n [\n 'pattern' => '/<module:>/<controller:>/<action:>',\n 'route' => '<module>/<controller>/<action>',\n 'defaults' => ['lang' => $this->defaultLanguage],\n ],\n [\n 'pattern' => '/<controller:>',\n 'route' => '<controller>',\n 'defaults' => ['lang' => $this->defaultLanguage],\n ],\n [\n 'pattern' => '/<controller:>/<action:>',\n 'route' => '<controller>/<action>',\n 'defaults' => ['lang' => $this->defaultLanguage],\n ],\n ]);\n }\n }",
"public function setupSegments()\n {\n $this->url_segments = !empty($this->path_info) ? array_filter(explode('/',$this->path_info)) : null;\n }",
"function _parse_routes() {\r\n\r\n foreach (Modules::$locations as $key) {\r\n $dir = './' . $key;\r\n }\r\n\r\n // Turn the segment array into a URI string\r\n $uri = implode('/', $this->uri->segments);\r\n\r\n // Is there a literal match? If so we're done\r\n if (isset($this->routes[$uri])) {\r\n\r\n return $this->_set_request(explode('/', $this->routes[$uri]));\r\n }\r\n\r\n // Loop through the route array looking for wild-cards\r\n foreach ($this->routes as $key => $val) {\r\n // Convert wild-cards to RegEx\r\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\r\n\r\n // Does the RegEx match?\r\n if (preg_match('#^' . $key . '$#', $uri)) {\r\n // Do we have a back-reference?\r\n if (strpos($val, '$') !== FALSE AND strpos($key, '(') !== FALSE) {\r\n $val = preg_replace('#^' . $key . '$#', $val, $uri);\r\n }\r\n\r\n return $this->_set_request(explode('/', $val));\r\n }\r\n }\r\n\r\n // If we got this far it means we didn't encounter a\r\n // matching route so we'll set the site default route\r\n\r\n if (ENVIRONMENT === \"production\") {\r\n if ($this->locate($this->uri->segments)) {\r\n\r\n show_404();\r\n }\r\n } else {\r\n $this->_set_request($this->uri->segments);\r\n }\r\n }",
"protected function bindPatterns()\n {\n foreach ($this->patterns as $name => $pattern) {\n Route::pattern($name, $pattern);\n }\n }",
"protected function registerUrlHandlers()\n {\n\n }",
"private function getPatterns() {\n return [\n 'facebook.com\\/(.*)\\/videos\\/(.*)',\n 'facebook.com\\/(.*)\\/photos\\/(.*)',\n 'facebook.com\\/(.*)\\/posts\\/(.*)',\n 'flickr.com\\/photos\\/(.*)',\n 'flic.kr\\/p\\/(.*)',\n 'instagram.com\\/p\\/(.*)',\n 'open.spotify.com\\/track\\/(.*)',\n 'twitter.com\\/(.*)\\/status\\/(.*)',\n 'vimeo.com\\/\\d{7,9}',\n 'youtube.com\\/watch[?]v=(.*)',\n 'youtu.be\\/(.*)',\n 'ted.com\\/talks\\/(.*)',\n ];\n }",
"private function parseRoutes()\n {\n // Turn the segment array into a URI string\n $uri = implode('/', $this->uri->getSegments());\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri])) {\n return $this->setRequest(explode('/', $this->routes[$uri]));\n }\n\n // Loop through the route array looking for wild-cards\n foreach ($this->routes as $key => $val) {\n // Convert wild-cards to RegEx\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n // Does the RegEx match?\n if (preg_match('#^'.$key.'$#', $uri)) {\n // Do we have a back-reference?\n if (strpos($val, '$') !== false && strpos($key, '(') !== false) {\n $val = preg_replace('#^'.$key.'$#', $val, $uri);\n }\n\n return $this->setRequest(explode('/', $val));\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->setRequest($this->uri->getSegments());\n }",
"private function setup_urls()\n\t{\n\t\t$this->allowed_urls = ['login' => 'login_page', 'signup' => 'signup_page'];\n\t}",
"private function setUrlArray()\n {\n $this->urlArray = parse_url($this->url);\n if (isset($this->urlArray['query'])) {\n parse_str(html_entity_decode($this->urlArray['query']), $this->urlArray['query']);\n }\n $this->urlArray['method'] = $_SERVER['REQUEST_METHOD'];\n }",
"private function setupRoutes()\n {\n foreach ($this->routesRaw as $urlPattern => $innerPath) {\n $route = new Route($urlPattern, $innerPath);\n $this->routesCollection->addElement($route);\n }\n }",
"private function setup_routes()\n {\n // Setuip routing scheme\n if ( empty($this->routes) )\n {\n $this->routes = array('' => 'index', ':action' => ':action');\n }\n\n // Feed the dispatcher\n foreach ( $this->routes as $path => $scheme )\n {\n $this->add_route($path, $scheme);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generated from protobuf field optional string aggregate_value = 8; | public function getAggregateValue() {} | [
"public function getAggregateValue()\n {\n $value = $this->get(self::AGGREGATE_VALUE);\n return $value === null ? (string)$value : $value;\n }",
"function getAggregateValue();",
"public function setAggregateFields($var)\n {\n $arr = GPBUtil::checkMapField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Cloud\\Firestore\\V1\\Value::class);\n $this->aggregate_fields = $arr;\n\n return $this;\n }",
"public function aggregateType();",
"public function aggregateId(): string\n\t{\n\t\treturn $this->metadata['_aggregate_id'];\n\t}",
"public function getAggregationQuery()\n {\n return $this->readOneof(3);\n }",
"public function aggregateId(): string;",
"public function getAggregateType()\n {\n return $this->aggregateType;\n }",
"public function testAggregate()\n {\n $this->generate(\n $this->getSuiteDocument(),\n array(\n 'aggregate' => true,\n )\n );\n\n $output = $this->getOutput()->fetch();\n $this->assertStringCount(1, 'Foobar', $output);\n $this->assertStringCount(1, 'mySubject', $output);\n }",
"function addAggregateField($name, $format, $defaults = array()) {\n\t\t$defaults['type'] = 'aggregate';\n\t\t$defaults['format_string'] = $format;\n\t\t\n\t\treturn $this->addField($name, $defaults);\n\t}",
"public function getAggregateId()\n {\n return $this->aggregate_id;\n }",
"function testTypeSpecifiedAggregate() {\n\t\t// Template style access\n\t\t$this->assertEquals(DataObject::Aggregate('AggregateTest_Foo')->XML_val('Max', array('Foo')), 9);\n\t\t$this->assertEquals(DataObject::Aggregate('AggregateTest_Fab')->XML_val('Max', array('Fab')), 3);\n\n\t\t// PHP style access\n\t\t$this->assertEquals(DataObject::Aggregate('AggregateTest_Foo')->Max('Foo'), 9);\n\t\t$this->assertEquals(DataObject::Aggregate('AggregateTest_Fab')->Max('Fab'), 3);\n\t}",
"public function hasAggregateValue()\n {\n return $this->aggregate_value !== null;\n }",
"public function getAggregate()\n {\n return $this->aggregate;\n }",
"public function getBundleAggregationType()\n {\n return isset($this->bundle_aggregation_type) ? $this->bundle_aggregation_type : '';\n }",
"public function hasAggregateValue()\n {\n return $this->get(self::AGGREGATE_VALUE) !== null;\n }",
"public function getAggregateId()\n {\n return $this->aggregateId;\n }",
"public function getAggregateUsage()\n {\n return $this->getParameter('aggregate_usage');\n }",
"function addAggregateField($fieldname, $type=\"sum\")\r\n\t{\r\n\t\t$this->queryLoaded = false;\r\n\r\n\t\t$this->aggregateFields[$fieldname] = $type;\r\n\t}",
"public function getAggcode(){\n return $this->_aggcode;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check is validation passed. | public function isValidationPassed(); | [
"public function validationPassed()\n {\n return $this->getValue() === self::VALIDATION_PASSED;\n }",
"public function passes(){\n $result = $this->validate();\n return $result;\n }",
"protected function passedValidation()\n {\n //\n }",
"public function fails(){\n $result = $this->validate();\n return !$result;\n }",
"public function hasBeenValidated();",
"public function invalid() {\n return $this->errors->count() > 0; \n }",
"public function passes() {\n\n\t\t$valid = true;\n\n\t\tforeach ($this->fields as $field) {\n\n\t\t\tif($field->passes() === false) {\n\n\t\t\t\t$valid = false;\n\t\t\t\t$this->errors[] = $field->getError();\n\t\t\t}\n\t\t}\n\n\t\tif($this->validate() === false) {\n\t\t\t$valid = false;\n\t\t}\n\n\t\treturn $valid;\n\t}",
"public function whenFormPassesValidation();",
"abstract public function validation();",
"public function checkValid(){\n return $this->validUser != 0;\n }",
"private function checkValidity()\n {\n $valid = true;\n foreach( self::requiredProperties() as $requiredProperty )\n {\n if( is_null( $this->$requiredProperty ) )\n {\n $valid = false;\n break;\n }\n\n }\n $this->isValid = $valid;\n }",
"public function testValidResult(): void\n {\n $result = $this->validator->validate('foo', true);\n\n $this->assertTrue($result->isValid());\n }",
"public function isValid(): bool\n {\n return RutHelper::validate($this);\n }",
"protected function validate() {}",
"protected function _validate()\n\t{\n\t\t$curl = curl_init();\n\t\t\n\t\tcurl_setopt($curl, CURLOPT_URL, self::VERIFY_URL);\n\t\tcurl_setopt($curl, CURLOPT_POST, true);\n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($curl, CURLOPT_POSTFIELDS, $this->_getValidationParams());\n\t\t\n\t\t$curlData = curl_exec($curl);\n\t\t\n\t\tcurl_close($curl);\n\t\t\n\t\treturn !empty(Json::decode($curlData, true)['success']);\n\t}",
"public function isPassed(): bool\n {\n return count($this->violations) === 0;\n }",
"public function testValidateOne(): void\n {\n $this->assertTrue($this->validate(1, [1, 10]));\n }",
"public function isValid()\r\n\t{\r\n\t\t$valid = $this->validate($this->rule, $this->control->getValue(), $this->arg);\r\n\t\tif ($this->negative)\r\n\t\t\t$valid = !$valid;\r\n\r\n\t\tif ($valid)\r\n\t\t\treturn true;\r\n\r\n\t\t$this->control->setError($this->getMessage());\r\n\t\treturn false;\r\n\t}",
"public abstract function validate();",
"public function formIsValid() {\n\t\t\treturn empty($this->errors);\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PHP's mcrypt does not have built in PKCS5 Padding, so we use this | private function _add_PKCS5_padding($input)
{
$blocksize = 16;
$padding = "";
// Pad input to an even block size boundary
$padlength = $blocksize - (strlen($input) % $blocksize);
for($i = 1; $i <= $padlength; $i++) {
$padding .= chr($padlength);
}
return $input . $padding;
} | [
"function addPKCS5Padding($text) {\n\t$blocksize = 16;\n $pad = $blocksize - (strlen($text) % $blocksize);\n \treturn $text . str_repeat(chr($pad), $pad);\n}",
"public function setupMcrypt()\n {\n $this->key = str_pad(substr($this->key, 0, $this->keySize), $this->keySize, \"\\0\");\n parent::setupMcrypt();\n }",
"function mcrypt_data($input) {\r\n $key1 = \"ShareSpark\";\r\n $key2 = \"Org\";\r\n $key = $key1 . $key2;\r\n $encrypted = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $input, MCRYPT_MODE_CBC, md5(md5($key))));\r\n //var_dump($encrypted);\r\n return $encrypted;\r\n }",
"static protected function removePKCS5Padding($input)\n {\n $blockSize = 16;\n $padChar = ord($input[strlen($input) - 1]);\n\n /* Check for PadChar is less then Block size */\n if ($padChar > $blockSize)\n {\n throw new WPBC_SagepayApiException('Invalid encryption string');\n }\n /* Check by padding by character mask */\n if (strspn($input, chr($padChar), strlen($input) - $padChar) != $padChar)\n {\n throw new WPBC_SagepayApiException('Invalid encryption string');\n }\n\n $unpadded = substr($input, 0, (-1) * $padChar);\n /* Chech result for printable characters */\n if (preg_match('/[[:^print:]]/', $unpadded))\n {\n throw new WPBC_SagepayApiException('Invalid encryption string');\n }\n return $unpadded;\n }",
"private final static function en_pkcs5_pad($text, $blocksize) {\n $pad = $blocksize - (strlen($text) % $blocksize);\n return $text . str_repeat(chr($pad), $pad);\n }",
"function MCryptEncrypt($encrypt, $key)\r\n\t{\r\n\t\t$encrypt = serialize($encrypt);\r\n\t\t$iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC), MCRYPT_DEV_URANDOM); //windows ou php 5.3\r\n\t\t//$iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC), MCRYPT_RAND); //php 5.2 e linux\r\n\t\t$key = pack('H*', $key);\r\n\t\t$mac = hash_hmac('sha256', $encrypt, substr(bin2hex($key), -32));\r\n\t\t$passcrypt = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $encrypt.$mac, MCRYPT_MODE_CBC, $iv);\r\n\t\t$encoded = base64_encode($passcrypt).'|'.base64_encode($iv);\r\n\t\treturn $encoded;\r\n\t\t\r\n\t\t\r\n\t\t//PHP 7.\r\n\t\t////ref: http://php.net/manual/en/mcrypt.examples.php\r\n\t\t\r\n\t\t//$key = \"E4HD9h4DhS23DYfhHemkS3Nf\";// 24 bit Key\r\n\t\t////$key = $GLOBALS['$configCryptChave32byte'];// 24 bit Key\r\n\t\t//$iv = \"fYfhHeDm\";// 8 bit IV\r\n\t\t////$input = \"Text to encrypt\";// text to encrypt\r\n\t\t//$input = $encrypt;// text to encrypt\r\n\t\t//$bit_check=8;// bit amount for diff algor.\r\n\t\t\r\n\t\t////$str= encrypt($input,$key,$iv,$bit_check);\r\n\t\t////echo \"Start: $input - Excrypted: $str - Decrypted: \".decrypt($str,$key,$iv,$bit_check);\r\n\t\t\r\n\t\t////function encrypt($text,$key,$iv,$bit_check) {\r\n\t\t//$text_num =str_split($encrypt,$bit_check);\r\n\t\t//$text_num = $bit_check-strlen($text_num[count($text_num)-1]);\r\n\t\t//for ($i=0;$i<$text_num; $i++) {$encrypt = $encrypt . chr($text_num);}\r\n\t\t//$cipher = mcrypt_module_open(MCRYPT_TRIPLEDES,'','cbc','');\r\n\t\t//mcrypt_generic_init($cipher, $key, $iv);\r\n\t\t//$decrypted = mcrypt_generic($cipher,$encrypt);\r\n\t\t//mcrypt_generic_deinit($cipher);\r\n\t\t//return base64_encode($decrypted);\r\n\t\t\r\n\t\t////}\r\n\t}",
"public function testNullPadding()\n {\n $key = str_repeat('z', 16);\n $iv = str_repeat('z', 16);\n\n // a plaintext / ciphertext of length 1 is of an insufficient length for cbc mode\n $plaintext = $ciphertext = 'a';\n\n $mcrypt = bin2hex(mcrypt_encrypt('rijndael-128', $key, $plaintext, 'cbc', $iv));\n $compat = bin2hex(phpseclib_mcrypt_encrypt('rijndael-128', $key, $plaintext, 'cbc', $iv));\n $this->assertEquals($mcrypt, $compat);\n\n $mcrypt = bin2hex(mcrypt_decrypt('rijndael-128', $key, $ciphertext, 'cbc', $iv));\n $compat = bin2hex(phpseclib_mcrypt_decrypt('rijndael-128', $key, $ciphertext, 'cbc', $iv));\n $this->assertEquals($mcrypt, $compat);\n }",
"function mcrypt_decrypt () {}",
"protected function padAndMcrypt($value, $iv)\n\t{\n\t\t$value = $this->addPadding(serialize($value));\n\n\t\treturn mcrypt_encrypt($this->cipher, $this->key, $value, $this->mode, $iv);\n\t}",
"function encPad($data, $size) {\n $length = $size - strlen($data) % $size;\n return $data . str_repeat(chr($length), $length);\n}",
"function mcrypt_ofb($cipher, $key, $data, $mode, $iv)\n{\n}",
"public function cryptSetPadding(UnitTester $I)\n {\n $I->wantToTest('Crypt - setPadding()');\n\n $texts = [\n '',\n ];\n\n $key = '0123456789ABCDEF0123456789ABCDEF';\n\n $ciphers = [\n 'AES-256-CBC',\n 'AES-256-CFB',\n ];\n\n $pads = [\n Crypt::PADDING_ANSI_X_923,\n Crypt::PADDING_PKCS7,\n Crypt::PADDING_ISO_10126,\n Crypt::PADDING_ISO_IEC_7816_4,\n Crypt::PADDING_ZERO,\n Crypt::PADDING_SPACE,\n ];\n\n for ($i = 1; $i < 128; ++$i) {\n $texts[] = str_repeat('A', $i);\n }\n\n $crypt = new Crypt();\n\n $crypt->setKey(\n substr($key, 0, 32)\n );\n\n foreach ($pads as $padding) {\n $crypt->setPadding($padding);\n\n foreach ($ciphers as $cipher) {\n $crypt->setCipher($cipher);\n\n foreach ($texts as $expected) {\n $encrypted = $crypt->encrypt($expected);\n $actual = $crypt->decrypt($encrypted);\n\n $I->assertEquals($expected, $actual);\n }\n }\n }\n }",
"public abstract function addPadding($source, $blockSize);",
"public function getPadding();",
"function encrypt_pkcs7 ($str, $key)\n{\n $key = base64_decode($key);\n $block = mcrypt_get_block_size(\"tripledes\", \"ecb\");\n $pad = $block - (strlen($str) % $block);\n $str .= str_repeat(chr($pad), $pad);\n $ciphertext = mcrypt_encrypt(\"tripledes\", $key, $str, \"ecb\");\n\n return base64_encode($ciphertext);\n}",
"public function disablePadding()\n {\n $this->cipher->disablePadding();\n }",
"protected function _cryptPadText($text, $mode, $blockSize, $paddingType){ }",
"function md5_decrypt($enc_text, $password = PASSWORD, $iv_len = 16) {\n\t$enc_text = base64_decode ( $enc_text );\n\t$n = strlen ( $enc_text );\n\t$i = $iv_len;\n\t$plain_text = '';\n\t$iv = substr ( $password ^ substr ( $enc_text, 0, $iv_len ), 0, 512 );\n\twhile ( $i < $n ) {\n\t\t$block = substr ( $enc_text, $i, 16 );\n\t\t$plain_text .= $block ^ pack ( 'H*', md5 ( $iv ) );\n\t\t$iv = substr ( $block . $iv, 0, 512 ) ^ $password;\n\t\t$i += 16;\n\t}\n\treturn preg_replace ( '/\\\\x13\\\\x00*$/', '', $plain_text );\n}",
"protected function addPadding($data)\n {\n $module = $this->getCryptModule();\n $blockSize = mcrypt_enc_get_block_size($module);\n $pad = $blockSize - (StringHelper::byteLength($data) % $blockSize);\n\n return $data . str_repeat(chr($pad), $pad);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
disable other image sizes | function disableimage_sizes() {
remove_image_size('1536x1536'); // disable any other added image sizes
remove_image_size('2048x2048'); // disable images added via set_post_thumbnail_size()
} | [
"function shapeSpace_disable_other_image_sizes() {\n\t\n\tremove_image_size('post-thumbnail'); // disable images added via set_post_thumbnail_size() \n\tremove_image_size('another-size'); // disable any other added image sizes\n\t\n}",
"public function omitImageSize()\n\t{\n\t\t$this->forceImageSize = false;\n\t\t$this->resetTemplate();\n\t}",
"function remove_medium_image_size() {\n remove_image_size('medium');\n}",
"function medula_remove_plugin_image_sizes() {\n\tremove_image_size('image-name');\n}",
"function add_image_sizes() {\n add_image_size( 'small', 688, 0, FALSE); // force crop false\n}",
"function remove_plugin_image_sizes() {\n remove_image_size('small');\n remove_image_size('medium');\n remove_image_size('medium_large');\n remove_image_size('large');\n}",
"function dg_slider_image_size() {\n if ( function_exists( 'add_image_size' ) ) {\n add_image_size( 'main-slider-size', 1920, 1080, true );\n }\n }",
"public function options_scrset_image_sizes_exclude_todo(){\n\t \n\t $image_sizes_exclude = array(\n\t \n\t 'a'\t\t=> array(),\n\t );\n\t \n\t return $image_sizes_exclude;\n\t}",
"public function disable_max_srcset_image_width() {\n\t\tif ( apply_filters( 'dynamic_image_resizer_disable_response', true ) ) {\n\t\t\tadd_filter( 'max_srcset_image_width', '__return_true' );\n\t\t}\n\t}",
"function wpse238808_update_image_size_medium_large() {\n update_option( 'medium_large_size_w', 0 );\n update_option( 'medium_large_size_h', 0 );\n}",
"function remove_extra_image_sizes() {\n foreach ( get_intermediate_image_sizes() as $size ) {\n if ( !in_array( $size, array(\n // 'suprema_qodef_landscape',\n 'woocommerce_thumbnail',\n 'woocommerce_single'\n // 'woocommerce_gallery_thumbnail'\n\n ) ) ) {\n remove_image_size( $size );\n }\n }\n}",
"function modify_image_sizes() {\n // tiny\n add_image_size( 'tiny', 80, 120, false );\n\n // thumbnail\n update_option( 'thumbnail_size_w', 400 );\n update_option( 'thumbnail_size_h', 600 );\n update_option( 'thumbnail_crop', 0 );\n\n // medium\n update_option( 'medium_size_w', 800 );\n update_option( 'medium_size_h', 1200 );\n update_option( 'medium_crop', 0 );\n\n // large\n update_option( 'large_size_w', 1200 );\n update_option( 'large_size_h', 1800 );\n update_option( 'large_crop', 0 );\n\n // larger\n add_image_size( 'larger', 1800, 2700, false );\n}",
"function woocommerce_core_remove_image_size_options($sizes){\n unset($sizes['shop_catalog']);\n unset($sizes['shop_thumbnail']);\n unset($sizes['shop_single']);\n return $sizes;\n}",
"private function configureForSmallImage()\n {\n $this->imgHandle->file_name_body_add = '_small'; \n $this->imgHandle->image_resize = true;\n $this->imgHandle->image_x = MAXIMUM_UPLOADED_IMAGE_WIDTH;\n $this->imgHandle->image_ratio_y = true;\n $this->imgHandle->file_overwrite = true;\n }",
"public function image_sizes() {\n \n update_option( 'shop_catalog_image_size', array(\n 'width' => '9999',\n 'height' => '9999',\n 'crop' => 0\n ) );\n\n update_option( 'shop_single_image_size', array(\n 'width' => '9999',\n 'height' => '9999',\n 'crop' => 0\n ) );\n\n update_option( 'shop_thumbnail_image_size', array(\n 'width' => '9999',\n 'height' => '9999',\n 'crop' => 1\n ) );\n\n }",
"function remove_image_size( $name ) {\n\tglobal $_wp_additional_image_sizes;\n\n\tif ( isset( $_wp_additional_image_sizes[ $name ] ) ) {\n\t\tunset( $_wp_additional_image_sizes[ $name ] );\n\t\treturn true;\n\t}\n\n\treturn false;\n}",
"public function image_sizes() {\n //add_image_size(\"cpt-square\", 250, 250, true);\n //add_image_size(\"cpt-square-2x\", 500, 500, true);\n\t}",
"public static function set_image_size() {\n $size = get_option( 'yith_woocompare_image_size' );\n\n if( ! $size ) {\n return;\n }\n\n $size['crop'] = isset( $size['crop'] ) ? true : false;\n add_image_size( 'yith-woocompare-image', $size['width'], $size['height'], $size['crop'] );\n }",
"function forzarCropEnDimensiones() {\n add_image_size('medium', get_option('medium_size_w'), get_option('medium_size_h'), true);\n add_image_size('large', get_option('large_size_w'), get_option('large_size_h'), true);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Back Out a shiiresaki_bunrui3_kbn | public function _bakOut($shiiresaki_bunrui3_kbn, $dlt_flg = 0)
{
$bak_shiiresaki_bunrui3_kbn = new BakShiiresakiBunrui3Kbns();
foreach ($shiiresaki_bunrui3_kbn as $fld => $value) {
$bak_shiiresaki_bunrui3_kbn->$fld = $shiiresaki_bunrui3_kbn->$fld;
}
$bak_shiiresaki_bunrui3_kbn->id = NULL;
$bak_shiiresaki_bunrui3_kbn->id_moto = $shiiresaki_bunrui3_kbn->id;
$bak_shiiresaki_bunrui3_kbn->hikae_dltflg = $dlt_flg;
$bak_shiiresaki_bunrui3_kbn->hikae_user_id = (int)$this->getDI()->getSession()->get('auth')['id'];
$bak_shiiresaki_bunrui3_kbn->hikae_nichiji = date("Y-m-d H:i:s");
if (!$bak_shiiresaki_bunrui3_kbn->save()) {
foreach ($bak_shiiresaki_bunrui3_kbn->getMessages() as $message) {
$this->flash->error($message);
}
}
} | [
"public function _bakOut($shiiresaki_bunrui2_kbn, $dlt_flg = 0)\n {\n\n $bak_shiiresaki_bunrui2_kbn = new BakShiiresakiBunrui2Kbns();\n foreach ($shiiresaki_bunrui2_kbn as $fld => $value) {\n $bak_shiiresaki_bunrui2_kbn->$fld = $shiiresaki_bunrui2_kbn->$fld;\n }\n $bak_shiiresaki_bunrui2_kbn->id = NULL;\n $bak_shiiresaki_bunrui2_kbn->id_moto = $shiiresaki_bunrui2_kbn->id;\n $bak_shiiresaki_bunrui2_kbn->hikae_dltflg = $dlt_flg;\n $bak_shiiresaki_bunrui2_kbn->hikae_user_id = (int)$this->getDI()->getSession()->get('auth')['id'];\n $bak_shiiresaki_bunrui2_kbn->hikae_nichiji = date(\"Y-m-d H:i:s\");\n if (!$bak_shiiresaki_bunrui2_kbn->save()) {\n foreach ($bak_shiiresaki_bunrui2_kbn->getMessages() as $message) {\n $this->flash->error($message);\n }\n }\n }",
"public function _bakOut($shiiresaki_bunrui1_kbn, $dlt_flg = 0)\n {\n\n $bak_shiiresaki_bunrui1_kbn = new BakShiiresakiBunrui1Kbns();\n foreach ($shiiresaki_bunrui1_kbn as $fld => $value) {\n $bak_shiiresaki_bunrui1_kbn->$fld = $shiiresaki_bunrui1_kbn->$fld;\n }\n $bak_shiiresaki_bunrui1_kbn->id = NULL;\n $bak_shiiresaki_bunrui1_kbn->id_moto = $shiiresaki_bunrui1_kbn->id;\n $bak_shiiresaki_bunrui1_kbn->hikae_dltflg = $dlt_flg;\n $bak_shiiresaki_bunrui1_kbn->hikae_user_id = (int)$this->getDI()->getSession()->get('auth')['id'];\n $bak_shiiresaki_bunrui1_kbn->hikae_nichiji = date(\"Y-m-d H:i:s\");\n if (!$bak_shiiresaki_bunrui1_kbn->save()) {\n foreach ($bak_shiiresaki_bunrui1_kbn->getMessages() as $message) {\n $this->flash->error($message);\n }\n }\n }",
"protected function scnzb()\n\t{\n\t\t//[Complete][512754] Formula1.2014.Malaysian.Grand.Prix.Team.Principals.Press.Conference.720p.HDTV.x264-W4F NZB: http://scnzb.eu/1pgOmwj\n\t\tif (preg_match('/\\[Complete\\]\\[(?P<reqid>\\d+)\\]\\s*(?P<title>.+?)\\s+NZB:/i', $this->_channelData['message'], $matches)) {\n\t\t\t$this->CurPre['source'] = '#scnzb';\n\t\t\t$this->CurPre['groupid'] = $this->getGroupID('alt.binaries.boneless');\n\t\t\t$this->siftMatches($matches);\n\t\t}\n\t}",
"function blake2b($input, $key, $outlen = 64) {\n\t\t// preprocess inputs\n\t\t$input = $this->normalizeInput($input);\n\t\t// do the math\n\t\t$ctx = $this->blake2bInit($outlen, $key);\n\t\t$this->blake2bUpdate($ctx, $input);\n\t\treturn $this->blake2bFinal($ctx);\n\t}",
"public static function getHiraganaAndKata2byte(){\n $returnValue = array(\n 'あ' => 'ア', 'い' => 'イ', 'う' => 'ウ', 'え' => 'エ', 'お' => 'オ',\n 'か' => 'カ', 'き' => 'キ', 'く' => 'ク', 'け' => 'ケ', 'こ' => 'コ',\n 'さ' => 'サ', 'し' => 'シ', 'す' => 'ス', 'せ' => 'セ', 'そ' => 'ソ',\n 'た' => 'タ', 'ち' => 'チ', 'つ' => 'ツ', 'て' => 'テ', 'と' => 'ト',\n 'な' => 'ナ', 'に' => 'ニ', 'ぬ' => 'ヌ', 'ね' => 'ネ', 'の' => 'ノ',\n 'は' => 'ハ', 'ひ' => 'ヒ', 'ふ' => 'フ', 'へ' => 'ヘ', 'ほ' => 'ホ',\n 'ま' => 'マ', 'み' => 'ミ', 'む' => 'ム', 'め' => 'メ', 'も' => 'モ',\n 'や' => 'ヤ', 'ゆ' => 'ユ', 'よ' => 'ヨ', 'ら' => 'ラ', 'り' => 'リ',\n 'る' => 'ル', 'れ' => 'レ', 'ろ' => 'ロ', 'わ' => 'ワ', 'を' => 'ヲ',\n 'ん' => 'ン', 'が' => 'ガ', 'ぎ' => 'ギ', 'ぐ' => 'グ', 'げ' => 'ゲ', \n 'ご' => 'ゴ','ざ' => 'ザ', 'じ' => 'ジ', 'ず' => 'ズ', 'ぜ' => 'ゼ', \n 'ぞ' => 'ゾ','だ' => 'ダ', 'ぢ' => 'ヂ', 'づ' => 'ヅ', 'で' => 'デ', \n 'ど' => 'ド','ば' => 'バ', 'び' => 'ビ', 'ぶ' => 'ブ', 'べ' => 'ベ', \n 'ぼ' => 'ボ','ぱ' => 'パ', 'ぴ' => 'ピ', 'ぷ' => 'プ', 'ぺ' => 'ペ', \n 'ぽ' => 'ポ',\n // sound pair(am ghep)\n 'ぁ' => 'ァ', 'ぃ' => 'ィ', 'ぅ' => 'ゥ', 'ぇ' => 'ェ',\n 'ぉ' => 'ォ', 'ゃ' => 'ャ', 'ゅ' => 'ュ', 'ょ' => 'ョ', 'っ' => 'ッ',\n );\n return $returnValue;\n }",
"function downloadNZB($nzbid, $name = '') {\n\t\tglobal $config;\n\n\t\t$file = file_get_contents($config['downloader']['hellanzb']['config']);\n\t\t\n\t\t$server = getFromFile($file, 'Hellanzb.XMLRPC_SERVER');\n\t\t$port = getFromFile($file, 'Hellanzb.XMLRPC_PORT');\n\t\t$password = getFromFile($file, 'Hellanzb.XMLRPC_PASSWORD');\n\t\t\n\t\t$enqueue = array('method' => 'enqueuenewzbin', 'params' => array(array('int', $nzbid)));\n\t\t$output = getPage($server, $port, 'hellanzb', $password, 'status', $enqueue);\n\t\t$result = simplexml_load_string($output);\n\t\t\n\t\t// print_r($output);\n\t\t// print_r($result);\n\t\tif ($result->fault) {\n\t\t\treturn array('output' => $output, 'status' => false);\n\t\t} else {\n\t\t\treturn array('output' => $output, 'status' => true);\n\t\t}\n\t}",
"public function _bakOut($hasuushori_kbn, $dlt_flg = 0)\n {\n\n $bak_hasuushori_kbn = new BakHasuushoriKbns();\n foreach ($hasuushori_kbn as $fld => $value) {\n $bak_hasuushori_kbn->$fld = $hasuushori_kbn->$fld;\n }\n $bak_hasuushori_kbn->id = NULL;\n $bak_hasuushori_kbn->id_moto = $hasuushori_kbn->id;\n $bak_hasuushori_kbn->hikae_dltflg = $dlt_flg;\n $bak_hasuushori_kbn->hikae_user_id = (int)$this->getDI()->getSession()->get('auth')['id'];\n $bak_hasuushori_kbn->hikae_nichiji = date(\"Y-m-d H:i:s\");\n if (!$bak_hasuushori_kbn->save()) {\n foreach ($bak_hasuushori_kbn->getMessages() as $message) {\n $this->flash->error($message);\n }\n }\n }",
"function somaBytes_KB($valor,$valor2) //Calcula entre bytes e KB\n\t\t{\n\t\t\t//saida em Bytes(B)\n\t\t\t$this->byte = $this->valor; //valor em bytes\n\t\t\t$this->bit = $this->byte*8;\n\t\t\t$this->kb = $this->byte/1024;\n\t\t\t$this->mb = $this->kb/1024;\n\t\t\t$this->gb = $this->mb/1024;\n\t\t\t$this->tb = $this->gb/1024;\n\t\t\t//saída em Kbytes(KB)\n\t\t\t$this->kb2 = $this->valor2;\n\t\t\t$this->byte2 = $this->valor2*1024; //valor em bytes\n\t\t\t$this->bit2 = $this->byte2*8;\n\t\t\t$this->mb2 = $this->kb2/1024;\n\t\t\t$this->gb2 = $this->mb2/1024;\n\t\t\t$this->tb2 = $this->gb2/1024;\n\t\t\t//diferença entre BYtes de mesma unidade\n\t\t\t$this->difbytes = $this->byte + $this->byte2;\n\t\t\t$this->difbit = $this->bit + $this->bit2;\n\t\t\t$this->difkb = $this->kb + $this->kb2;\n\t\t\t$this->difmb = $this->mb + $this->mb2;\n\t\t\t$this->difgb = $this->gb + $this->gb2;\n\t\t\t$this->diftb = $this->tb + $this->tb2;\n\t\t\n\t\t\techo \"<h3 align='center'>Calcule $this->valor Bytes + $this->valor2 KB é: </h3>\n\t\t\t\t\t<table align='center'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t <td>Bits</td>\n\t\t\t\t\t <td>{$this->bit} bit<br></td>\t\t \n\t\t\t\t\t <td>{$this->bit2} bit<br></td>\t\t \n\t\t\t\t\t <td>{$this->difbit} bit<br></td>\t\t \n\t\t\t\t\t</tr>\n\t\t\t\t\t<br>\n\t\t\t\t<table>\";\n\n\t\t\techo \"<table align='center'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t <td>Bytes</td>\n\t\t\t\t\t <td bgcolor='#6666FF'>{$this->byte} Bytes<br></td>\t\t \n\t\t\t\t\t <td>{$this->byte2} Bytes<br></td>\t\t \n\t\t\t\t\t <td>{$this->difbytes} Bytes<br></td>\t\t \n\t\t\t\t\t</tr>\n\t\t\t\t\t<br>\n\t\t\t\t<table>\";\n\t\t\t\n\t\t\techo \"<table align='center'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t <td>KB</td>\n\t\t\t\t\t <td>{$this->kb} KB<br></td>\t\t \n\t\t\t\t\t <td bgcolor='#6666FF'>{$this->kb2} KB<br></td>\t\t \n\t\t\t\t\t <td>{$this->difkb} KB<br></td>\t\t \n\t\t\t\t\t</tr>\n\t\t\t\t\t<br>\n\t\t\t\t<table>\";\n\t\t\t\n\t\t\techo \"<table align='center'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t <td>MB</td>\n\t\t\t\t\t <td>{$this->mb} MB<br></td>\t\t \n\t\t\t\t\t <td>{$this->mb2} MB<br></td>\t\t \n\t\t\t\t\t <td>{$this->difmb} MB<br></td>\t\t \n\t\t\t\t\t</tr>\n\t\t\t\t\t<br>\n\t\t\t\t<table>\";\n\t\t\t\n\t\t\techo \"<table align='center'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t <td>GB</td>\n\t\t\t\t\t <td>{$this->gb} GB<br></td>\t\t \n\t\t\t\t\t <td>{$this->gb2} GB<br></td>\t\t \n\t\t\t\t\t <td>{$this->difgb} GB<br></td>\t\t \n\t\t\t\t\t</tr>\n\t\t\t\t\t<br>\n\t\t\t\t<table>\";\n\t\t\t\n\t\t\techo \"<table align='center'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t <td>TB</td>\n\t\t\t\t\t <td>{$this->tb} TB<br></td>\t\t \n\t\t\t\t\t <td>{$this->tb2} TB<br></td>\t\t \n\t\t\t\t\t <td>{$this->diftb} TB<br></td>\t\t \n\t\t\t\t\t</tr>\n\t\t\t\t\t<br>\n\t\t\t\t<table>\";\n\t\t}",
"static function GetHastaHekimBirimBilgisi(array $uss_data): object\n {\n try {\n return self::Authentication($uss_data)->get('https://ussservis.saglik.gov.tr/api/genel/GetHastaHekimBirimBilgisi', $uss_data);\n } catch (\\Exception $exception) {\n throw new \\Exception($exception->getMessage(), $exception->getCode());\n }\n }",
"public function getBanksWithUSSDShortCode()\n {\n $endpoint = \"{$this->baseUrl}{$this->v1}sdk/transactions/banks\";\n\n $response = json_decode(\n HttpRequest::get(\n $endpoint,\n [$this->getOauth2Header()]\n )\n );\n\n if ($response->requestSuccessful){\n return $response->responseBody;\n }\n\n }",
"function perskskhusus($mhsw, $khs, $bipot, $ada, $pmbmhswid=1) {\r\n // Jumlah SKS yg diambil mhsw. \r\n // Hrs diparsing krn dicek apkh mhsw jg mengambil jdwl dgn hrg yg berbeda?\r\n $s = \"select k.TahunID, k.MhswID,\r\n j.JadwalID, j.SKSAsli, j.HargaStandar, j.Harga\r\n from krs k\r\n left outer join jadwal j on k.JadwalID=j.JadwalID\r\n where k.MhswID='$mhsw[MhswID]' and k.TahunID='$khs[TahunID]'\r\n and j.HargaStandar='N' \";\r\n $r = _query($s);\r\n $totharga = 0; $totsks = 0; $mk = ''; $jml = 0;\r\n while ($w = _fetch_array($r)) {\r\n $jml++;\r\n //echo \"$w[MKKode]: $w[Nama] ($w[SKS] SKS), Harga Standar? $w[HargaStandar]:$w[Harga]<br />\";\r\n $totsks += $w['SKSAsli'];\r\n $totharga += $w['Harga'];\r\n $mk .= \"$w[MKKode] - $w[Nama]: $w[SKSAsli] SKS dgn Harga: $w[Harga] \\r\\n\";\r\n }\r\n if ($totharga <= 0){\r\n //$bpt = \r\n $totharga = GetaField(\"bipot2\", \"BipotNamaID = 16 and BIPOT2ID\", $bipot['BIPOT2ID'], \"Jumlah\");\r\n $jml = 1;\r\n }\r\n if (empty($ada) && ($totharga > 0)) {\r\n $s0 = \"insert into bipotmhsw(PMBID, MhswID, TahunID, BIPOT2ID, BIPOTNamaID,\r\n PMBMhswID, TrxID, Jumlah, Besar, Catatan,\r\n LoginBuat, TanggalBuat)\r\n values('$mhsw[PMBID]', '$mhsw[MhswID]', '$khs[TahunID]', '$bipot[BIPOT2ID]', '$bipot[BIPOTNamaID]',\r\n '$pmbmhswid', '$bipot[TrxID]', $jml, '$totharga', '$mk',\r\n '$_SESSION[_Login]', now())\";\r\n $r0 = _query($s0);\r\n }\r\n else {\r\n $s0 = \"update bipotmhsw set Besar='$totharga', Jumlah='$jml',\r\n PMBMhswID='$pmbmhswid',\r\n Catatan='Total SKS: $totsks',\r\n LoginEdit='$_SESSION[_Login]', TanggalEdit=now()\r\n where BIPOTMhswID='$ada[BIPOTMhswID]' \";\r\n $r0 = _query($s0);\r\n }\r\n}",
"function GetBin(){}",
"function ZerlegungGBKennz($gbkennz) {\n\t// Return: 9=Fehler, 0=Listen alle Bezirke 1=Such Bezirk-Name\n\t// 2=Such Bezirk-Nummer, 3=Such Blatt, 4=Such Buchung BVNR\n\tglobal $zgbbez, $zblatt, $zblattn, $zblattz, $zbvnr;\n\t$arr=explode(\"-\", $gbkennz, 3);\n\t$zgbbez=trim($arr[0]);\n\t$zblatt=trim($arr[1]);\n\t$zbvnr=trim($arr[2]);\n\tif ($zgbbez == \"\") { // keine Eingabe\n\t\treturn 0; // Amtsgerichte oder Bezirke listen\n\t} elseif ( ! is_ne_zahl($zgbbez)) { // Alphabetische Eingabe\n\t\treturn 1; // Such Bezirk-NAME\n\t} elseif ($zblatt == \"\") {\n\t\treturn 2; // Such Bezirk-NUMMER\n\t} else { // Format von BlattNr pruefen\n\t//'19' linksbündig\n\t//'000019 ' gefüllt 6 + blank\n\t//'000019A' .. mit Zusatzbuchstabe\n\t//'0300001' gefüllt 7, bei Blattart 5000 \"fiktives Blatt\"\n\t\t$len=strlen($zblatt);\n\t\tif ($len > 0 AND $len < 8) {\t\t\n\t\t\tif (trim($zblatt, \"0..9 \") == \"\") { // Normalfall: nur Zahlen (und Blank))\n\t\t\t\t$zblattn= rtrim(ltrim($zblatt, \"0\"), \" \");\n\t\t\t\t$zblattz=\"\";\n\t\t\t} else { // Sonderfall: Zusatz-Buchstabe am Ende\n\t\t\t\t$zblattn=substr($zblatt,0,$len-1);\n\t\t\t\t$zblattz=strtoupper(substr($zblatt,$len-1,1)); \n\t\t\t\tif ((trim($zblattn, \"0..9\") == \"\") and (trim($zblattz, \"A..Z\") == \"\")) {\n\t\t\t\t\t$zblattn= ltrim($zblattn, \"0\"); // ohne fuehrende Nullen\n\t\t\t\t} else {\n\t\t\t\t\techo \"<p class='err>Format 'Blatt': bis zu 6 Zahlen und ggf. ein Buchstabe</p>\";\t\n\t\t\t\t\treturn 9;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($zbvnr == \"\") {\n\t\t\t\treturn 3; // Such BLATT\n\t\t\t} elseif (is_ne_zahl($zbvnr)) {\t\t\n\t\t\t\t// $zbvnr=ltrim($zbvnr,\"0\"); // DB-Format ist integer\n\t\t\t\t// Vorsicht, Wert \"0\" ist moeglich und gueltig\n\t\t\t\treturn 4; // Such Grundstueck\n\t\t\t} else {\n\t\t\t\techo \"<p class='err>Die Buchungsstelle (BVNR) '\".$zbvnr.\"' ist nicht numerisch</p>\";\n\t\t\t\treturn 9;\n\t\t\t}\n\t\t} else {\n\t\t\techo \"<p class='err>Das Grundbuch-Blatt '\".$zblatt.\"' ist ungültig.</p>\";\n\t\t\treturn 9;\n\t\t}\n\t}\n}",
"public function getP2shByte();",
"public function getKtbPb()\n {\n\n return $this->ktb_pb;\n }",
"private function findBTRN(){\n\t\t$db = $this->db;\n\t\t$isbn = $this->isbn;\n\n\t\t$btrnQuery = \"SELECT bowker_title_record_number as btrn FROM newstech_book WHERE isbn10='$isbn' OR isbn13='$isbn' \";\n \t$queryResult = $db->query($btrnQuery);\n\n if ($queryResult->num_rows == 0){\n\t\t\tthrow new Exception(sprintf(\"BookHandler.class.php: %d => No BTRN found for isbn: %s\", __LINE__, $isbn));\n }\n\n\t\t$firstRow = $queryResult->fetch_assoc();\n $btrn = $firstRow['btrn'];\n\t\t\n\t\treturn $btrn;\n\t}",
"public function _bakOut($torihiki_kbn, $dlt_flg = 0)\n {\n\n $bak_torihiki_kbn = new BakTorihikiKbns();\n foreach ($torihiki_kbn as $fld => $value) {\n $bak_torihiki_kbn->$fld = $torihiki_kbn->$fld;\n }\n $bak_torihiki_kbn->id = NULL;\n $bak_torihiki_kbn->id_moto = $torihiki_kbn->id;\n $bak_torihiki_kbn->hikae_dltflg = $dlt_flg;\n $bak_torihiki_kbn->hikae_user_id = (int)$this->getDI()->getSession()->get('auth')['id'];\n $bak_torihiki_kbn->hikae_nichiji = date(\"Y-m-d H:i:s\");\n if (!$bak_torihiki_kbn->save()) {\n foreach ($bak_torihiki_kbn->getMessages() as $message) {\n $this->flash->error($message);\n }\n }\n }",
"static function to_b($in)\n\t{\n\n\t\tpreg_match(\"/^([.\\d]*)([kmgtp])(.*$)/i\", $in, $bits);\n\n\t\t$rm = array_flip(Units::$m);\n\t\t$suff = strtolower($bits[2]);\n\n\t\treturn (in_array($suff, array_keys($rm)))\n\t\t\t? $bits[1] * pow(1024, $rm[$suff])\n\t\t\t: false;\n\t}",
"function getCetakKeuanganMingguan1free1Hut($cabang, $week,$tahun,$result = 1)\n\t{\n\n\t\t$query = $this->db->query(\"select * from week where intid_week = \".$week.\" and inttahun = \".$tahun.\"\");\n\t\t$week = $query->result();\n\n\t\t$this->db->start_cache();\n\n\t\t$this->selectKeuangan();\n\t\t$this->CetakKeuangan($cabang,$tahun,$week[0]->dateweek_start,$week[0]->dateweek_end); \n\t\t\n\t\t$this->db->where(\"nota.intid_jpenjualan = 5\");\n\n\t\t$query \t= $this->db->get();\n\t\t$string = $this->db->last_query();\n\t\t\n\t\t$this->db->stop_cache();\n\n\t\t$this->db->flush_cache();\n\t\t\n\t\tif($result == 0) // 0 untuk hasil query, \n\t\t{\n\t\t\treturn $query;\n\t\t}\n\t\telse if($result == 1) // 1 untuk hasil query->result\n\t\t{\n\t\t\treturn $query->result();\n\t\t}\n\t\telse if($result == 2) // 2 untuk return string query\n\t\t{\n\t\t\treturn $string;\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter the query on the eva column Example usage: $query>filterByEva(1234); // WHERE eva = 1234 $query>filterByEva(array(12, 34)); // WHERE eva IN (12, 34) $query>filterByEva(array('min' => 12)); // WHERE eva > 12 | public function filterByEva($eva = null, $comparison = null)
{
if (is_array($eva)) {
$useMinMax = false;
if (isset($eva['min'])) {
$this->addUsingAlias(AbilityTableMap::COL_EVA, $eva['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($eva['max'])) {
$this->addUsingAlias(AbilityTableMap::COL_EVA, $eva['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AbilityTableMap::COL_EVA, $eva, $comparison);
} | [
"public function filterByEva($eva = null, $comparison = null)\n {\n if (is_array($eva)) {\n $useMinMax = false;\n if (isset($eva['min'])) {\n $this->addUsingAlias(ArmorTableMap::COL_EVA, $eva['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($eva['max'])) {\n $this->addUsingAlias(ArmorTableMap::COL_EVA, $eva['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ArmorTableMap::COL_EVA, $eva, $comparison);\n }",
"function filter($column, $operation = IDataSource::EQUAL, $value = NULL, $chainType = NULL);",
"public function filter($event, $value) {}",
"public function filterBy($name, $value, $type = null)\n {\n $type = is_null($type) ? $this->getColumnType($name) : $type;\n switch($type)\n {\n case sfModelFinderColumn::DATE:\n case sfModelFinderColumn::TIMESTAMP:\n if(!is_array($value))\n {\n $this->where($name, $value);\n }\n if (isset($value['from']) && $value['from'] !== '')\n {\n if ($type == sfModelFinderColumn::DATE)\n {\n $this->where($name, '>=', date('Y-m-d', $value['from']));\n }\n else\n {\n $this->where($name, '>=', $value['from']);\n }\n }\n if (isset($value['to']) && $value['to'] !== '')\n {\n if ($type == sfModelFinderColumn::DATE)\n {\n $this->where($name, '<=', date('Y-m-d', $value['to']));\n }\n else\n {\n $this->where($name, '<=', $value['to']);\n }\n }\n break;\n case sfModelFinderColumn::STRING:\n $value = (string) $value;\n if(preg_match('/[\\%\\*]/', $value))\n {\n $this->where($name, 'like', str_replace('*', '%', trim($value)));\n }\n else\n {\n $this->where($name, trim($value));\n }\n break;\n case sfModelFinderColumn::BOOLEAN:\n if(is_string($value))\n {\n $value = in_array(strtolower($value), array('false', 'off', '-', 'no', 'n')) ? false : true;\n }\n else\n {\n $value = (boolean) $value;\n }\n \n $this->where($name, $value);\n break;\n case sfModelFinderColumn::DECIMAL:\n case sfModelFinderColumn::REAL:\n case sfModelFinderColumn::FLOAT:\n case sfModelFinderColumn::DOUBLE:\n case sfModelFinderColumn::NUMERIC:\n $this->where($name, (float) $value);\n case sfModelFinderColumn::INTEGER:\n case sfModelFinderColumn::BIGINT:\n case sfModelFinderColumn::TINYINT:\n case sfModelFinderColumn::SMALLINT:\n $this->where($name, (integer) $value);\n break;\n default:\n $this->where($name, $value);\n }\n \n return $this;\n }",
"private function filter()\n {\n $this->builder->where(function ($builder) {\n collect($this->request->get('filter', []))->each(function ($value, $column) use ($builder) {\n $this->guardFilter($column);\n $this->filterColumn($builder, $column, $value);\n });\n });\n }",
"public function getFilteredValues($app);",
"private function fechaEntregaFilter($params, &$where, &$queryParams) {\n if($this->paramExists($params, 'fecha_entrega')) {\n list($fechaInicio,$fechaFin)= explode('-',$params['fecha_entrega']);\n $queryParams[':fecha_inicio'] = trim($fechaInicio);\n $queryParams[':fecha_fin'] = trim($fechaFin);\n $where = $this->addWhereSentence($where, \"Protocolo.fecha_entrega BETWEEN STR_TO_DATE(:fecha_inicio,'%d/%m/%Y') AND STR_TO_DATE(:fecha_fin,'%d/%m/%Y')\");\n }\n }",
"function filter_products3(){\n\n dd(DB::table('products')->where([ \n ['name', ['CocaCola', 'PesiLoca']], \n ['cost', 550, '>='],\n ['cost', [100, 200]]\n ], 'OR')->get()); \n }",
"function setAgeFilter($min_age) {\n $this->HAVING['diff >= '] = $min_age;\n }",
"protected function filterExhibit()\n {\n if (isset($this->params['exhibit_id'])) {\n\n $this->select->where(\n \"exhibit_id = ?\", $this->params['exhibit_id']\n );\n\n }\n }",
"protected function filterByArguments()\n {\n $options = $this->option(); \n if (!$options['all'] && !$options['done']) {\n $this->FilterItems('done',false);\n }\n if ($options['done']) {\n $this->FilterItems('done',true);\n }\n if ($options['today']) {\n $this->FilterItems('created_at',date('Y-m-d'));\n }\n }",
"function Filter(&$dbtv, $columnName) {\r\n\t\tparent::ControlElement($dbtv);\t\t\r\n\t\t$this->columnName = $columnName;\r\n\t\t\r\n\t\t//pregenerate and store query on construction so it's not affected by other filters\r\n\t\t$this->filterValuesQuery = $this->generateFilterValuesQuery($this->columnName);\r\n\t}",
"public function andFilterWhere()\n {\n }",
"public function scopeGetFilteredData($query, $request)\n {\n $filter = $request->filter;\n $Datefilter = $request->filterDate;\n $Datefilter1 = $request->filterDate1;\n $filterSelect = $request->filterSelect;\n\n /**\n * @param string $filter text type value\n * @param string $Datefilter date type value\n * @param string $filterSelect select value\n *\n * @return mixed\n */\n return $query->Where(function ($query) use ($filter, $Datefilter, $filterSelect,$Datefilter1) {\n if (count($filter) > 0) {\n foreach ($filter as $key => $value) {\n if ($value != \"\") {\n $query->where($key, 'LIKE', '%' . trim($value) . '%');\n }\n }\n }\n\n /* if (count($Datefilter) > 0) {\n foreach ($Datefilter as $dtkey => $dtvalue) {\n if ($dtvalue != \"\") {\n $query->where($dtkey, 'LIKE', '%' . date('Y-m-d', strtotime(trim($dtvalue))) . '%');\n }\n }\n }*/\n\n if (count($Datefilter) > 0) {\n foreach ($Datefilter as $dtkey => $dtvalue) {\n foreach ($Datefilter1 as $dtvalue1){\n if ($dtvalue != \"\" && $dtvalue1 !=\"\") {\n $start_date = date('Y-m-d 00:00:00', strtotime(trim($dtvalue)));\n $end_date = date('Y-m-d 23:59:59', strtotime(trim($dtvalue1)));\n $query->whereBetween($dtkey,[$start_date,$end_date]);\n }\n }\n }\n }\n\n if (count($filterSelect) > 0) {\n foreach ($filterSelect as $Sekey => $Sevalue) {\n if ($Sevalue != \"\") {\n $query->whereRaw('FIND_IN_SET(' . trim($Sevalue) . ',' . $Sekey . ')');\n }\n }\n }\n\n });\n\n }",
"public function getShowFilter()\n {\n $filter = $this->loader->getAgenda()->getFilter($this->_getIdParam());\n\n if ($filter && $filter->getSqlWhere()) {\n return array(\n \\MUtil_Model::SORT_DESC_PARAM => 'gap_admission_time',\n $filter->getSqlWhere(),\n 'limit' => 10,\n );\n } else {\n return array('1=0');\n }\n }",
"private function _getBooleanFilterConditions($field_name, $min_value, $table_name='Rental')\n\t{\n\n\t\t$conditions = array('OR' => array(\n\t\t\tarray($table_name . '.' . $field_name . ' >' => $min_value))\n\t\t);\n\n\t\treturn $conditions;\n\t}",
"public function filterHaving()\n {\n }",
"public function filterByEditable($value = null, $comparison = null)\n {\n return $this->useCalendareventQuery()->filterByEditable($value, $comparison)->endUse();\n }",
"function filterBy_S_A_F_E_C($SEDE, $AREA, $FACULTAD, $ESCUELA, $CARRERA,$TABLE_I)\n{\n global $mysqli;\n $TINS = $TABLE_I;\n $query = new Query($mysqli, \"SELECT red,nombre,apellido,CONCAT(provincia,'-',clave,'-',tomo,'-',folio)AS cedula,n_ins,sede,fac_ia,esc_ia,car_ia,fac_iia,esc_iia,car_iia,fac_iiia,esc_iiia,car_iiia\n FROM \" .$TINS. \" where sede = ? AND area_i = ? AND fac_ia = ? AND esc_ia = ? AND car_ia = ? \");\n $parametros = array(\"iiiii\", &$SEDE, &$AREA, &$FACULTAD, &$ESCUELA, &$CARRERA);\n $data = $query->getresults($parametros);\n\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finally, we remove empty class fields and any 'submenu' ones // | function orbital_strip_empty_classes($menu) {
$menu = preg_replace('/ class=""| class="sub-menu"/','',$menu);
return $menu;
} | [
"function minim_submenu_classes(&$menu) {\n if (!empty($menu)) {\n foreach ($menu as $key => $info) {\n if (is_numeric($key)) {\n $menu[$key]['#attributes']['class'][] = 'margin-s';\n $menu[$key]['#attributes']['class'][] = 'round-corners';\n $menu[$key]['#localized_options']['attributes']['class'][] = 'block-link';\n \n //d8 seems to be creating duplicate classes, so we strip them out here\n if (!empty($menu[$key]['#localized_options']['attributes']['class'])) {\n $menu[$key]['#localized_options']['attributes']['class'] = array_unique($menu[$key]['#localized_options']['attributes']['class']);\n }\n\n //tertiary nav menu items off of the main nav\n if (in_array('sub', $menu[$key]['#localized_options']['attributes']['class'])) {\n $menu[$key]['#attributes']['class'][] = 'text-xs';\n $menu[$key]['#attributes']['class'][] = 'inline';\n $menu[$key]['#attributes']['class'][] = 'red';\n $menu[$key]['#theme'] = 'menu_link__secondary';\n }\n //red background for tertiary nav link back\n elseif (in_array('active-trail', $menu[$key]['#localized_options']['attributes']['class'])) {\n $menu[$key]['#attributes']['class'][] = 'bg-red';\n }\n //tertiary nav link back and back \n if (!in_array('sub', $menu[$key]['#localized_options']['attributes']['class'])) {\n $menu[$key]['#localized_options']['attributes']['class'][] = 'padding-xs';\n }\n }\n }\n }\n}",
"function lwp_strip_empty_classes($menu) {\n $menu = preg_replace('/ class=\"\"| class=\"sub-menu\"/','',$menu);\n return $menu;\n}",
"function strip_empty_classes($menu) {\r\r\n $menu = preg_replace('/ class=\"\"| class=\"sub-menu\"/','',$menu);\r\r\n return $menu;\r\r\n}",
"function _hideSubmenu()\n\t{\n\t\t// WHY THE HELL DO THEY BREAK PUBLIC FUNCTIONS !!!\n\t\tJHTML::stylesheet('hidesubmenu.css', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/css/');\n\t}",
"function RemoverMenuEntradasWP() \n\t\t\t\t{\n\t\t\t\t// remove_menu_page('upload.php');//Remover Menu Medios.\n\t\t\t\t remove_menu_page('edit-comments.php');//Remover Menu Comentarios.\n \t \t// remove_menu_page('edit.php'); //Remover Menu Entradas.\n \t \t remove_menu_page('edit-tags.php'); //Remover Menu categorias.\n \t \t //Remover Categorias dentro de libros, revistas-cientificas, hemeroteca, videoteca.\n \t \t remove_submenu_page( 'edit.php?post_type=revistas-cientificas', 'edit-tags.php?taxonomy=category&post_type=revistas-cientificas' );\n \t \t remove_submenu_page( 'edit.php?post_type=libros', 'edit-tags.php?taxonomy=category&post_type=libros' );\n \t \t remove_submenu_page( 'edit.php?post_type=hemeroteca', 'edit-tags.php?taxonomy=category&post_type=hemeroteca' );\n \t \t remove_submenu_page( 'edit.php?post_type=papers', 'edit-tags.php?taxonomy=category&post_type=papers' );\n remove_submenu_page( 'edit.php?post_type=videoteca', 'edit-tags.php?taxonomy=category&post_type=videoteca' );\n \t \t}",
"public function cleanupMenu() {\r\n\t\t// Remove top level menu items\r\n\t\tremove_menu_page('upload.php');\r\n\t\tremove_menu_page('link-manager.php');\r\n\r\n\t\t// Remove sub menu items\r\n\t\tremove_submenu_page('themes.php', 'theme-editor.php');\r\n\t\tremove_submenu_page('plugins.php', 'plugin-editor.php');\r\n\t}",
"function frl_clear_menu_item_classes($items, $args){\t\t\n\tglobal $sections;\n\t\n\tif(empty($items))\n\t\treturn;\t\n\t\n\t$tops = array(); \n\tif($args->theme_location == 'primary' && empty($sections['labels'])){\n\t\tforeach($items as $index => $menu_item){\n\t\t\t//clear mess - remove everythind except any current mark\n\t\t\t\n\t\t\tif(!empty($menu_item->classes)){\n\t\t\t\t\n\t\t\t\tforeach($menu_item->classes as $i => $iclass){\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\t\t\n\t\t\n\t}\n\t\t\n\treturn $items;\n}",
"function clean_custom_menu( $theme_location ) {\n \tif ( ($theme_location) && ($locations = get_nav_menu_locations()) && isset($locations[$theme_location]) ) {\n \t$menu = get_term( $locations[$theme_location], 'nav_menu' );\n\t\t\t$menu_items = wp_get_nav_menu_items($menu->term_id);\n \n\t\t\t$menu_list = '<nav class=\"main-menu\">' .\"\\n\";\n\t\t\t$menu_list .= '<ul class=\"row between\">' .\"\\n\";\n \n\t\t\t$count = 0;\n\t\t\t$submenu = false;\n\t\t\t$counter = 0;\n \n\t\t\tforeach( $menu_items as $menu_item ) {\n \n \t$link = $menu_item->url;\n\t\t\t\t$title = $menu_item->title;\n \n\t\t\t\tif ( !$menu_item->menu_item_parent ) {\n\t \t$counter++;\n\t\t\t\t\t$parent_id = $menu_item->ID;\n \n\t\t\t\t\t$menu_list .= '<li class=\"main-menu__item\">' .\"\\n\";\n\t\t\t\t\t$menu_list .= '<a data-remodal-target=\"'.$counter.'\" href=\"'.$link.'\" class=\"title main-menu__link\">'.$title.'</a>' .\"\\n\";\n\n \t}\n\n \n\t\t\t\tif ( $parent_id == $menu_item->menu_item_parent ) {\n \n \tif ( !$submenu ) {\n \t$submenu = true;\n\t\t\t\t\t\t$menu_list .= '<ul class=\"main-menu__sub-menu animated fadeIn\">\n \t<div class=\"modal main-menu__modal-wrapper\" data-remodal-id=\"'.$counter.'\">\n \t\t<button class=\"button_close\" data-remodal-action=\"close\"></button>\n\t\t\t\t\t\t\t<div class=\"modal-wrapper\">\n <div class=\"modal__content\">\n <ul class=\"main-menu__sub-menu animated fadeIn\">' .\"\\n\";\n \t}\n \n\t\t\t\t\t$menu_list .= '<li class=\"main-menu__sub-menu__item\">' .\"\\n\";\n\t\t\t\t\t$menu_list .= '<a href=\"'.$link.'\" class=\"main-menu__sub-menu__link\">'.$title.'</a>' .\"\\n\";\n\t\t\t\t\t$menu_list .= '</li>' .\"\\n\";\n \n \n\t\t\t\t\tif ( $menu_items[ $count + 1 ]->menu_item_parent != $parent_id && $submenu ){\n \t $menu_list .= '</ul></div></div></div></ul>' .\"\\n\";\n \t $submenu = false;\n \t}\n \n \t}\n \n\t\t\t\tif ( $menu_items[ $count + 1 ]->menu_item_parent != $parent_id ) { \n \t$menu_list .= '</li>' .\"\\n\"; \n\t\t\t\t\t$submenu = false;\n \t}\n \n\t\t\t\t$count++;\n \t}\n \n\t\t\t$menu_list .= '</ul>' .\"\\n\";\n\t\t\t$menu_list .= '</nav>' .\"\\n\";\n \n \t} else {\n \t$menu_list = '<!-- no menu defined in location \"'.$theme_location.'\" -->';\n \t}\n\t\techo $menu_list;\n\t}",
"function zen_nav_submenu_classes( $classes, $item ) {\r\n\tif ($item->menu_item_parent){\r\n\t\t$classes[] = 'sub-menu-item';\r\n\t} else{\r\n\t\t$classes[] = 'main-menu-item';\r\n\t}\r\n\treturn $classes;\r\n}",
"function pxp_hide_add_menu()\n\t{\n\t\tglobal $submenu;\n\t\t\n\t\tunset($submenu['edit.php?post_type=pxp_credit_blocks'][10]);\n\t\tunset($submenu['edit.php?post_type=pxp_promo_codes'][10]);\n\t\tunset($submenu['edit.php?post_type=pxp_adjustments'][10]);\n\t}",
"function change_submenu_class($menu) {\n $menu = preg_replace('/ class=\"sub-menu\"/',' class=\"dropdown\"',$menu);\n return $menu;\n }",
"function integrity_preprocess_menu(&$variables) {\n $variables['attributes']['class'][] = 'clearfix';\n}",
"function pp_remove_add_new_submenus() {\n\tglobal $submenu; \n \tunset($submenu['edit.php?post_type=document_files'][10]); // Removes 'Add New'.\n}",
"function filter_bootstrap_nav_menu_submenu_css_class($classes, $args, $depth)\n{\n if (isset($args->bootstrap)) {\n $classes[] = 'dropdown-menu';\n }\n return $classes;\n}",
"function cf_remove_items() {\n $remove = array( 'wc-settings', 'wc-status', 'wc-addons', );\n foreach ( $remove as $submenu_slug ) {\n remove_submenu_page( 'woocommerce', $submenu_slug );\n }\n}",
"function scm_hook_admin_ui_menu_classes(){\n\n global $menu, $SCM_admin_menu;\n\n if( !isset( $menu ) || !$menu ) return;\n\n foreach( $menu as $key => $elem ){\n\n if( $elem[2] == 'upload.php' ) $menu[$key][0] = __( 'Libreria', SCM_THEME );\n\n foreach( $SCM_admin_menu as $pos => $cont ){\n\n foreach( $cont as $link ){\n \n $icon = '';\n if( is_array( $link ) ){\n $icon = $link[1];\n $link = $link[0];\n }\n //$class = getByValue( $cont, $elem[2] );\n $class = $link == $elem[2];\n\n if( $class ){\n if( startsWith( $pos, 'separator' ) )\n $menu[$key][4] .= ' scm-separator';\n else\n $menu[$key][4] .= ' scm-item';\n\n $menu[$key][4] .= ' scm-' . $pos;\n\n if( $icon )\n $menu[$key][4] .= ' fa ' . $icon;\n\n continue(2);\n }\n }\n }\n }\n}",
"public function remove_submenu_pages() {\n\t\tremove_submenu_page( 'edit.php', 'edit-tags.php?taxonomy=post_tag' );\n\t\tremove_submenu_page( 'edit.php', 'edit-tags.php?taxonomy=category' );\n\t}",
"public function freeSubMenuItems(){\n\t\tunset($this->wpSubMenuItems);\n\t}",
"function remove_surpless_menus() { \n\t\tglobal $menu;\n\t\t$restricted = array(__('Links'), __('Comments'), __('Profile'), __('Tools'));\n\t\tend($menu);\n\t\twhile (prev($menu)){\n\t\t\t$value = explode(' ',$menu[key($menu)][0]);\n\t\t\tif(in_array($value[0] != NULL?$value[0]:\"\" , $restricted)){unset($menu[key($menu)]);}\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the public 'config_cache_factory' shared service. | protected function getConfigCacheFactoryService()
{
return $this->services['config_cache_factory'] = new \Symfony\Component\Config\ResourceCheckerConfigCacheFactory(array(0 => new \Symfony\Component\Config\Resource\SelfCheckingResourceChecker(), 1 => new \Symfony\Component\Config\Resource\BCResourceInterfaceChecker()));
} | [
"protected function getConfigCacheFactoryService()\n {\n return $this->services['config_cache_factory'] = new \\Symfony\\Component\\Config\\ResourceCheckerConfigCacheFactory(new RewindableGenerator(function () {\n yield 0 => ${($_ = isset($this->services['dependency_injection.config.container_parameters_resource_checker']) ? $this->services['dependency_injection.config.container_parameters_resource_checker'] : ($this->services['dependency_injection.config.container_parameters_resource_checker'] = new \\Symfony\\Component\\DependencyInjection\\Config\\ContainerParametersResourceChecker($this))) && false ?: '_'};\n yield 1 => ${($_ = isset($this->services['config.resource.self_checking_resource_checker']) ? $this->services['config.resource.self_checking_resource_checker'] : ($this->services['config.resource.self_checking_resource_checker'] = new \\Symfony\\Component\\Config\\Resource\\SelfCheckingResourceChecker())) && false ?: '_'};\n }, 2));\n }",
"protected function getConfigCacheFactoryService()\n {\n return $this->privates['config_cache_factory'] = new \\Symfony\\Component\\Config\\ResourceCheckerConfigCacheFactory(new RewindableGenerator(function () {\n yield 0 => ($this->privates['dependency_injection.config.container_parameters_resource_checker'] ?? $this->privates['dependency_injection.config.container_parameters_resource_checker'] = new \\Symfony\\Component\\DependencyInjection\\Config\\ContainerParametersResourceChecker($this));\n yield 1 => ($this->privates['config.resource.self_checking_resource_checker'] ?? $this->privates['config.resource.self_checking_resource_checker'] = new \\Symfony\\Component\\Config\\Resource\\SelfCheckingResourceChecker());\n }, 2));\n }",
"protected function getConfigCacheFactoryService()\n {\n return $this->services['config_cache_factory'] = new \\Symfony\\Component\\Config\\ResourceCheckerConfigCacheFactory(new RewindableGenerator(function () {\n yield 0 => ${($_ = isset($this->services['1_445435e6562279fa39d002cc9e118a59f6d445721feb5152ee202f4c2d8ea04d']) ? $this->services['1_445435e6562279fa39d002cc9e118a59f6d445721feb5152ee202f4c2d8ea04d'] : $this->get1445435e6562279fa39d002cc9e118a59f6d445721feb5152ee202f4c2d8ea04dService()) && false ?: '_'};\n yield 1 => ${($_ = isset($this->services['2_445435e6562279fa39d002cc9e118a59f6d445721feb5152ee202f4c2d8ea04d']) ? $this->services['2_445435e6562279fa39d002cc9e118a59f6d445721feb5152ee202f4c2d8ea04d'] : $this->get2445435e6562279fa39d002cc9e118a59f6d445721feb5152ee202f4c2d8ea04dService()) && false ?: '_'};\n }, 2));\n }",
"protected function getConfigCacheFactory(): ConfigCacheFactoryInterface\n {\n if (!$this->configCacheFactory) {\n $this->configCacheFactory = new ConfigCacheFactory($this->options['debug']);\n }\n\n return $this->configCacheFactory;\n }",
"protected function getCacheFactoryService()\n {\n $this->services['cache_factory'] = $instance = new \\Drupal\\Core\\Cache\\CacheFactory($this->get('settings'));\n\n $instance->setContainer($this);\n\n return $instance;\n }",
"protected function configFactory() {\n return \\Drupal::service('config.factory');\n }",
"protected function _getConfigFactory()\n {\n return $this->configFactory;\n }",
"protected function getCacheService()\n {\n return $this->services['cache'] = new \\CacheCache\\Cache($this->get('cache.backend'));\n }",
"public function getCacheService(): CacheService\n {\n return $this->cacheService;\n }",
"protected function _getConfigService() {\n return $this->get('config');\n }",
"protected function getCache()\n {\n\n // Determine cache parameters\n $backend = self::config()->cacheBackend;\n\n // Create default backend if not overridden\n if ($backend === 'DynamicCache') {\n\n $cacheDir = str_replace(\n array(\n '%BASE_PATH%',\n '%ASSETS_PATH%'\n ),\n array(\n BASE_PATH,\n ASSETS_PATH\n ),\n self::config()->cacheDir\n );\n\n // Using own folder helps with separating page cache from other SS cached elements\n // TODO Use Filesystem::isAbsolute() once $_ENV['OS'] bug is fixed (should use getenv())\n if ($cacheDir[0] !== '/') {\n $cacheDir = TEMP_FOLDER . DIRECTORY_SEPARATOR . $cacheDir;\n }\n\n if (!is_dir($cacheDir)) {\n mkdir($cacheDir);\n }\n SS_Cache::add_backend('DynamicCacheStore', 'File', array('cache_dir' => $cacheDir));\n SS_Cache::pick_backend('DynamicCacheStore', $backend, 1000);\n }\n\n // Set lifetime, allowing for 0 (infinite) lifetime\n if (($lifetime = self::config()->cacheDuration) !== null) {\n SS_Cache::set_cache_lifetime($backend, $lifetime);\n }\n\n // Get factory from this cache\n return SS_Cache::factory($backend);\n }",
"protected function getCache_DiscoveryService()\n {\n return $this->services['cache.discovery'] = $this->get('cache_factory')->get('discovery');\n }",
"protected function getCacheService() {\n if ($this->_cacheService === NULL) {\n $this->setCacheService(\n PapayaCache::getService($this->papaya()->options)\n );\n }\n return $this->_cacheService;\n }",
"protected function getCache_AppService()\n {\n return $this->services['cache.app'] = new \\Symfony\\Component\\Cache\\Adapter\\FilesystemAdapter('PRjXijh7l5', 0, (__DIR__.'/pools'));\n }",
"protected function getCacheHashCalculatorService()\n {\n return $this->services['TYPO3\\\\CMS\\\\Frontend\\\\Page\\\\CacheHashCalculator'] = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Frontend\\Page\\CacheHashCalculator::class, \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Frontend\\Page\\CacheHashConfiguration::class));\n }",
"protected function _getCacheInstance()\n {\n return MyProject_Registry::getInstance()->registry('cache');\n }",
"public static function getCachingService()\n {\n if (!isset(static::$cache)) {\n $serviceClass = 'NullService';\n\n if (class_exists('Cache_Lite')) {\n $serviceClass = 'CacheLite';\n }\n\n $serviceClass = __NAMESPACE__ . '\\\\' . 'CachingService\\\\' . $serviceClass;\n static::setCachingService(new $serviceClass());\n }\n\n return static::$cache;\n }",
"private function loadConfigFromCache()\n {\n /** @var \\Core\\Services\\Contracts\\Config $config */\n $config = DI::getInstance()->get('config');\n\n /** @noinspection PhpIncludeInspection */\n $config->set(null, require $this->cachedFile);\n\n return $config;\n }",
"protected function getConfigLocatorService()\n {\n return $this->services['config_locator'] = new \\Symfony\\Component\\Config\\FileLocator('D:\\\\Git\\\\Gekosale3\\\\config');\n }",
"protected function createConfig()\n\t{\n\t\t$this->services->setSingleton('config', function ($sc) {\n\t\t\t$settings = $this->settings;\n\t\t\t$provider = new \\werx\\Config\\Providers\\ArrayProvider(self::combinePath($settings['app_dir'], $settings['config_dir']));\n\t\t\treturn new \\werx\\Config\\Container($provider, $settings['environment']);\n\t\t});\n\t\treturn $this->services->get('config');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the value of field snsgoods_sharenum | public function getSnsgoodsSharenum()
{
return $this->snsgoods_sharenum;
} | [
"public function getShareNum()\n {\n return $this->share_num;\n }",
"public function getShareGoodsid()\n {\n return $this->share_goodsid;\n }",
"public function getNfsShareId()\n {\n return $this->nfs_share_id;\n }",
"function bimber_mashsharer_get_share_count() {\n\t$url = mashsb_get_url();\n\t$number = getSharedcount( $url );\n\n\treturn $number;\n}",
"public function getShareId()\n {\n if (array_key_exists(\"shareId\", $this->_propDict)) {\n return $this->_propDict[\"shareId\"];\n } else {\n return null;\n }\n }",
"public function getShareId() {\n return $this->get(self::SHAREID);\n }",
"public function getToShare()\n {\n $value = $this->get(self::to_share);\n return $value === null ? (integer)$value : $value;\n }",
"public function getShareMemberid()\n {\n return $this->share_memberid;\n }",
"public function getShare() {\n\t\treturn $this->share;\n\t}",
"public function show_share($share){\n\t\treturn $share ? 'Shared' : 'Not Shared';\n\t}",
"public function getShareStoreid()\n {\n return $this->share_storeid;\n }",
"public function getShare()\n {\n return $this->share;\n }",
"public function getFbShareCount(){\n\t\t$temp = $this->getFb();\n\t\treturn $temp['share_count'];\n\t}",
"function bunchy_capture_entry_share_count() {\n\t$out_escaped = '';\n\n\tif ( bunchy_show_entry_share_count() ) {\n\t\t$share_count = bunchy_get_entry_share_count();\n\t\t$share_count_formatted = bunchy_format_number( $share_count );\n\n\t\t$out_escaped .= '<span class=\"entry-shares\">';\n\t\t$out_escaped .= sprintf( wp_kses_post( __( '<strong>%s</strong> Shares', 'bunchy' ) ), esc_html( $share_count_formatted ) );\n\t\t$out_escaped .= '</span>';\n\t}\n\n\treturn $out_escaped;\n}",
"public function setShareNum($share_num)\n {\n $this->share_num = $share_num;\n\n return $this;\n }",
"public function getShareName()\n {\n return $this->share_name;\n }",
"public function getArticleShareCount()\n {\n return $this->article_share_count;\n }",
"public function getParticipationShare() {\n\t\t$shares = 0;\n\t\t$wish = $this->getUid();\n\t\tif($this->getShares() > 0){\n\t\t\t$participation = Tx_Nboevents_Utility_Cookies::getCookieValue('Participation'.$wish);\n\t\t\tif ($participation) {\n\t\t\t\t$repo = t3lib_div::makeInstance('Tx_Nbowishlist_Domain_Repository_ParticipationRepository');\n\t\t\t\t$shares = $repo->sharesByParticipationAndWish($participation,$wish);\n\t\t\t}\n\t\t}\n\t\treturn $shares;\n\t}",
"public function getSsn()\n\t{\n\t\treturn $this->ssn;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a form to edit a Cimetiere entity. | private function createEditForm(Cimetiere $entity): FormInterface
{
return $this->createForm(
CimetiereType::class,
$entity,
[
'action' => $this->generateUrl('cimetiere_edit', [
'slug' => $entity->getSlug(),
]),
]
);
} | [
"private function createEditForm(Caractere $entity)\r\n {\r\n $form = $this->createForm(new CaractereType(), $entity, array(\r\n 'action' => $this->generateUrl('caractere_update', array('id' => $entity->getId())),\r\n 'method' => 'PUT',\r\n ));\r\n\r\n $form->add('submit', 'submit', array('label' => 'Update'));\r\n\r\n return $form;\r\n }",
"private function createEditForm(Croisiere $entity)\n {\n $form = $this->createForm(new CroisiereType(), $entity, array(\n 'action' => $this->generateUrl('croisiere_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"private function createEditForm(Carpinteria $entity)\n {\n $form = $this->createForm(new CarpinteriaType(), $entity, array(\n 'action' => $this->generateUrl('carpinteria_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Modificar', 'attr'=>array('onclick'=>'return confirmar()')));\n\t\t\n\t\t$form->add('button', 'submit', array('label' => 'Volver la lista','attr'=>array('onclick'=>'history.back()','formnovalidate'=>'formnovalidate','class'=>'btn btn-primary')));\n\t\t\n return $form;\n }",
"public function editAction()\n {\n $em = $this->getDoctrine()->getManager();\n $entity = $em->getRepository('CaiWebBundle:Contacto')->find(1);\n $editForm = $this->createEditForm($entity);\n return $this->render('CaiWebBundle:Contacto:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView()\n ));\n }",
"private function createEditForm(Tache $entity)\n {\n $form = $this->createForm(new TacheType(), $entity, array(\n 'action' => $this->generateUrl('tache_update', array('id' => $entity->getId())),\n 'method' => 'post',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Confirmer'));\n\n return $form;\n }",
"private function createEditForm(Ejercicios $entity)\n {\n $form = $this->createForm(new EjerciciosType(), $entity, array(\n 'action' => $this->generateUrl('admin_ejercicios_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n //$form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"private function createEditForm(Carrera $entity)\n {\n $form = $this->createForm(new CarreraType(), $entity, array(\n 'action' => $this->generateUrl('aulas_carrera_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Actualizar','attr'=>array('class'=>'btn btn-default botonTabla')));\n $form->add('button', 'submit', array('label' => 'Volver a la lista','attr'=>array('formaction'=>'../../carrera','formnovalidate'=>'formnovalidate','class'=>'btn btn-default botonTabla')));\n\n\n return $form;\n }",
"public function editformAction() {\r\n\t\tif (($messages = $this->_messages->getMessages ())) {\r\n\t\t\t$this->view->assign ( 'messages', $messages );\r\n\t\t}\r\n\t\t\r\n\t\t$info = $this->_tree->getNodeInfo ( $this->_request->getParam ( $this->_id_field ) );\r\n\t\t$form = new Bel_Forms_Builder ( $this->_formname, $this->_form_edit_action );\r\n\t\t$form->addElement ( 'hidden', $this->_id_field, array ('value' => $info->{$this->_id_field} ) );\r\n\t\t$form->populateForm ( $info );\r\n\t\t$this->view->assign ( 'form', $form );\r\n\t\t$this->view->display ( $this->_form_template );\r\n\t}",
"private function createEditForm(Tache $entity)\n {\n $form = $this->createForm(new TacheType(), $entity, array(\n 'action' => $this->generateUrl('admin_task_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"private function createEditForm(Consigne $entity)\n {\n $form = $this->createForm(new ConsigneType(), $entity, array(\n 'action' => $this->generateUrl('consigne_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"private function createEditForm(Cra $entity)\n {\n $form = $this->createForm(new CraType(), $entity, array(\n 'action' => $this->generateUrl('naf_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"private function createEditForm(Carroceria $entity)\n {\n $form = $this->createForm(new CarroceriaType(), $entity, array(\n 'action' => $this->generateUrl('carroceria_update', array('id' => $entity->getCodCarroceria())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"private function createEditForm(Coleta $entity)\n {\n $form = $this->createForm(new ColetaType(), $entity, array(\n 'action' => $this->generateUrl('coleta_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"private function createEditForm(Clientes $entity) {\n $form = $this->createForm(new ClientesActType(), $entity, array(\n 'action' => $this->generateUrl('clientes_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Actualizar', 'attr' => array('class' => 'btn btn-success')));\n\n\n\n return $form;\n }",
"private function createEditForm(Comercio $entity)\n {\n $form = $this->createForm(new ComercioType(), $entity, array(\n 'action' => $this->generateUrl('comercio_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n //$form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"private function createEditForm(Vitrine $entity)\n {\n $translated = $this->get('translator');\n $form = $this->createForm(new VitrineType(), $entity, array(\n 'action' => $this->generateUrl('vitrine_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => $translated->transChoice('txt.editar',0,array(),'messagesCommonBundle'), 'attr' => array('class' => 'btn btn-primary btn-lg')));\n\n return $form;\n }",
"private function createEditForm(Read $entity){\n $form = $this->createForm(ReadType::class, $entity, array(\n 'action' => $this->generateUrl('read_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n return $form;\n }",
"private function createEditForm(Couleur $entity)\n {\n $form = $this->createForm(new CouleurType(), $entity, array(\n 'action' => $this->generateUrl('couleur_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Modifier'));\n\n return $form;\n }",
"private function createEditForm(Acuerdo $entity)\n {\n $form = $this->createForm(new AcuerdoType(), $entity, array(\n 'action' => $this->generateUrl('acuerdo_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n// $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When true, only trigger a build if the revision regex does NOT match the git_ref regex. Generated from protobuf field bool invert_regex = 4; | public function getInvertRegex()
{
return $this->invert_regex;
} | [
"function _wpcc_trans_regex() {\n return _wpcc('You can write plain text or regular expressions. When writing regex, do not put slashes before and\n after the expression, and make sure the checkbox is checked. You can test your regex\n <a href=\"https://regex101.com/\" target=\"_blank\">here</a>.');\n}",
"public function setRegexForPlateValidation($regex);",
"abstract protected function buildRegex(): Matcher;",
"public function regex() {\r\n // split uri\r\n $arr = preg_split('@/@', $this->uri, NULL, PREG_SPLIT_NO_EMPTY);\r\n\r\n $regex = null;\r\n foreach ($arr as $ar) {\r\n // Replace dynamic with regex\r\n $regex = $regex.'\\/'.preg_replace('/\\{(.*?)\\}/', '[0-9A-Za-z]++', $ar);\r\n }\r\n\r\n $this->regex = '/^'.$regex.'$/';\r\n }",
"private function buildRegex(): string\n {\n $regex = '/^' . str_ireplace('/', '\\\\/', $this->pattern) . '$/';\n $parameters = $this->parseParameters($this->pattern);\n \n array_walk($parameters, function (ParameterDefinition $parameter) use (&$regex): void {\n if ($parameter->optional) {\n $match = '/\\\\\\\\\\\\/\\{\\?' . $parameter->name . '(:(\\(.+?\\)))?\\}/'; // Five backshashes to match a single backslash, really????? At least it works that way... right?\n $regex = preg_replace($match, '(\\/' . $parameter->pattern . ')?', $regex);\n } else {\n $regex = preg_replace('/\\{' . $parameter->name . '(:(\\(.+?\\)))?\\}/', $parameter->pattern, $regex);\n }\n });\n \n return $regex;\n }",
"public function getRegex()\n {\n //add an optional, internal _format variable to the url, used\n //for automatically checking the format at the end of the\n //url. This will only be matched if args_regex does not allow\n //for '.' .\n $url = $this->url . '(\\.:_format)';\n\n //replace all optional variable definitions with the regex equivalents\n $regex = str_replace('(', '(?:', $url);\n $regex = str_replace(')', ')?', $regex);\n\n //if using auto args for this route, replace :args with a\n //regex capture group for them. Throw an exception if :args\n //isn't in the url definition\n if ($this->auto_args) {\n if (!strpos($regex, ':args')) {\n throw new RouteFailedException(\"A route with auto args must contain ':args' in the url\");\n }\n $regex = preg_replace('`:args`', '(?P<args>.+)', $regex);\n }\n\n //regex of args in the url defintion\n $definition_args = '`:([a-zA-Z_][a-zA-Z0-9_]+)`';\n //replace with regex of args in the url to be tested\n $url_args = '(?P<\\1>' . $this->args_regex . ')';\n $regex = preg_replace($definition_args, $url_args, $regex);\n\n return '`^' . $regex . '$`';\n }",
"function mREGEX(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$REGEX;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:276:3: ( 'regex' ) \n // Tokenizer11.g:277:3: 'regex' \n {\n $this->matchString(\"regex\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"function igk_treat_get_ignore_regex($command){\n $h=null;\n if(isset($command->ignorePattern)){\n $h=$command->ignorePattern;\n }\n else{\n if(igk_getv($command, \"noGit\") == 1){\n $h[]=\".git\";\n }\n if(igk_getv($command, \"noVSCode\") == 1){\n $h[]=\".vscode\";\n }\n }\n if($h){\n if(is_array($h)){\n $h=implode(\"|\", $h);\n }\n $h=str_replace(\"/\", \"\\\\/\", $h);\n $h=str_replace(\".\", \"\\.\", $h);\n $h=\"/(\".$h.\")$/\";\n }\n return $h;\n}",
"public function getVersionRegexp(): string\n {\n return '~^##[ \\\\[]+[vV]?(\\\\d+\\\\.\\\\d+\\\\.\\\\d+).*$~m';\n }",
"function glob_to_regex($glob) {\n\n $glob = str_replace('.', '\\.', $glob);\n $glob = str_replace('+', '\\+', $glob);\n $glob = str_replace('*', '.+', $glob);\n $glob = str_replace('?', '.', $glob);\n\n return $glob ? \"^$glob$\" : $glob;\n }",
"public function testConditionEvaluationOperatorRegex() {\n // Test that when the operator is 'regex' and the regular expression in the\n // match string matches the path string('some/random/test/path'),\n // TRUE is returned.\n $this->condition\n ->setContextValue('operator', 'regex')\n ->setContextValue('match', 'randd?om.*patt?h');\n $this->assertTrue($this->condition->evaluate());\n\n // Test that when the operator is 'regex' and the regular expression in the\n // match string does not match the path string('some/random/test/path'),\n // FALSE is returned.\n $this->condition\n ->setContextValue('operator', 'regex')\n ->setContextValue('match', 'randd+om.*patt?h');\n $this->assertFalse($this->condition->evaluate());\n }",
"protected function build_regex() {\r\n\t\t$cmd = preg_quote($this->cmd, '@');\r\n\t\treturn \"@{{$cmd}:(.*?)}@i\";\r\n\t}",
"private function buildValidationRegex() {\n $numbers = array(\n 'min' => '[0-5]?\\d',\n 'hour' => '[01]?\\d|2[0-3]',\n 'day' => '0?[1-9]|[12]\\d|3[01]',\n 'month' => '[1-9]|1[012]',\n 'dow' => '[0-6]'\n );\n\n foreach ($numbers as $field => $number) {\n $range = \"(?:$number)(?:-(?:$number)(?:\\/\\d+)?)?\";\n $field_re[$field] = \"\\*(?:\\/\\d+)?|$range(?:,$range)*\";\n }\n\n $field_re['month'].='|jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec';\n $field_re['dow'].='|mon|tue|wed|thu|fri|sat|sun';\n\n $fields_re = '(' . join(')\\s+(', $field_re) . ')';\n\n $replacements = '@reboot|@yearly|@annually|@monthly|@weekly|@daily|@midnight|@hourly';\n\n return '/^\\s*(' .\n '$' .\n '|#' .\n '|\\w+\\s*=' .\n \"|$fields_re\\s+\" .\n \"|($replacements)\\s+\" .\n ')' .\n '([^\\\\s]+)\\\\s+' .\n '(.*)$/';\n }",
"public function matches($regex)\n {\n $regexes = array_map('strval', (array) $regex);\n\n $this->regexes = $this->merge($this->regexes, $regexes);\n }",
"public function setRegex($regex) {\n $this->regex = $regex;\n return true;\n }",
"public function setRegexurl($regex) {\n }",
"protected static function addAcceptableVersionRegex($versions)\n {\n $regex = array();\n foreach ($versions as $index => $version) {\n // Empty versions are not allowed for Dotb7\n if (empty($version)) {\n unset($versions[$index]);\n continue;\n }\n\n $version_parts = explode('.', $version);\n if (isset($version_parts[1])) {\n // Major and minor matching\n $regex[$index] = \"^{$version_parts[0]}\\.{$version_parts[1]}\\.([0-9]+)\";\n } elseif (isset($version_parts[0])) {\n // Major only\n $regex[$index] = \"^{$version_parts[0]}\\.([0-9]+)\\.([0-9]+)\";\n } else {\n // Full match\n $regex[$index] = $version;\n }\n }\n\n $versions['regex_matches'] = $regex;\n\n return $versions;\n }",
"public function regex_nonRegexPattern()\n {\n S::regex('abc', 'not valid regex');\n }",
"protected function buildRegexPattern()\n {\n return \"@^{$this->composition->pattern}\\/@\";\n }",
"public static function toRegEx(string $glob): string\n {\n $quoted = str_replace(['?', '*'], ['.', '.*'], $glob);\n $regExp = '~^' . $quoted . '$~';\n\n return $regExp;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the nb h jour3. | public function getNbHJour3(): ?float {
return $this->nbHJour3;
} | [
"public function getExoHNbHj3() {\n return $this->exoHNbHj3;\n }",
"public function getMetNumInyeccionEstandar3()\n\t{\n\t\treturn $this->met_num_inyeccion_estandar_3;\n\t}",
"public function getNbHJour2(): ?float {\n return $this->nbHJour2;\n }",
"public function getNbHJour6(): ?float {\n return $this->nbHJour6;\n }",
"public function getNbHJour4(): ?float {\n return $this->nbHJour4;\n }",
"public function getNbHn(): ?float {\n return $this->nbHn;\n }",
"public function get_prixNiv3()\n {\n return $this->_prixNiv3;\n }",
"public function getNbHs() {\n return $this->nbHs;\n }",
"public function getNbJhExo() {\n return $this->nbJhExo;\n }",
"function verteilung3($n) {\n return (powInt($n, 3)) / 3;\n}",
"public function get_game_three_heading () {\n\t\treturn get_field('field_5b4770942c38b', $this->get_id());\n\t}",
"public function getNb_meca_hs()\n {\n return $this->nb_meca_hs;\n }",
"public function getNbJourBase() {\n return $this->nbJourBase;\n }",
"public function getBalAgeeNbJoursInt3(): ?int {\n return $this->balAgeeNbJoursInt3;\n }",
"public function _getCoutHebergement(){\n $parametre = TableRegistry::get('ConfigParametres');\n $parametres = $parametre->find('all')->last();\n /*Coût unitaire d'une tente*/\n $coutTente = $parametres->cout_hebergement;\n\n return $coutTente * $this->nb_hebergement;\n }",
"public function getNbhChomPartiel() {\n return $this->nbhChomPartiel;\n }",
"public static function getNbPiece () {\n return self :: $nbPiece; \n }",
"public function getNbreHMaxiJeudi() {\n return $this->nbreHMaxiJeudi;\n }",
"public function getNbreHJeudi() {\n return $this->nbreHJeudi;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds and displays a ContentGroup entity. | public function showAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('CatMSAdminBundle:ContentGroup')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find ContentGroup entity.');
}
$deleteForm = $this->createDeleteForm($id);
return array(
'entity' => $entity,
'delete_form' => $deleteForm->createView(),
);
} | [
"public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('SinettMLABBuilderBundle:Group')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException($this->get('translator')->trans('groupController.createNotFoundException'));\n }\n\n \n\n return $this->render('SinettMLABBuilderBundle:Group:show.html.twig', array(\n 'entity' => $entity,\n ));\n }",
"private function getGroup()\n {\n try {\n $obj_group = $this->groups->getGroup($this->get['id']);\n } catch (\\Exception $e) {\n $this->logs->info('Call to unknown group ' . $this->get['id'] . '.',array('type'=>'securityLog'));\n exit();\n }\n \n $this->setHeader();\n $this->template->set('nameDefault', $obj_group->getName());\n $this->template->set('descriptionDefault', $obj_group->getDescription());\n if ($obj_group->isDefault())\n $this->template->set('defaultChecked', 'checked=\"checked\"');\n $this->template->set('id', $this->get['id']);\n \n $this->template->set('editTitle', t('system/admin/groups/headerEdit'));\n $this->template->set('buttonCancel', t('system/buttons/cancel'));\n $this->template->set('buttonSubmit', t('system/buttons/edit'));\n \n $this->template->set('buttonBack', t('system/buttons/back'));\n $this->template->set('delete', t('system/buttons/delete'));\n }",
"public function showAction($id)\r\n {\r\n $em = $this->getDoctrine()->getEntityManager();\r\n\r\n $entity = $em->getRepository('ArmdProjectBundle:ProjectGroup')->find($id);\r\n\r\n if (!$entity) {\r\n throw $this->createNotFoundException('Unable to find ProjectGroup entity.');\r\n }\r\n\r\n $deleteForm = $this->createDeleteForm($id);\r\n\r\n return $this->render('ArmdProjectBundle:ProjectGroup:show.html.twig', array(\r\n 'entity' => $entity,\r\n 'delete_form' => $deleteForm->createView(),\r\n ));\r\n }",
"public function getEntityGroup() {\n\t\t$query = Model\\Database::get()->prepare(\"\n\t\t\tSELECT `entity_group_id`, `group_title`\n\t\t\tFROM `entity_group`\n\t\t\tWHERE `book_id` = :book_id\n\t\t\t AND\n\t\t\t `entity_group_id` = :entity_group_id\n\t\t\t AND\n\t\t\t `group_removed` = 0\n\t\t\tLIMIT 1\n\t\t\");\n\n\t\t// And execute query\n\t\t$query->execute(array(\n\t\t\t':book_id' => $this->book_id,\n\t\t\t':entity_group_id' => $this->entity_group_id\n\t\t));\n\n\t\treturn $query->fetch();\n\t}",
"public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('EfreiDoorBundle:CardGroup')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find CardGroup entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('EfreiDoorBundle:CardGroup:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(), ));\n }",
"public function group() {\n return entity_load($this->group_type, $this->gid);\n }",
"public function getGroupContent(): ContentEntityInterface;",
"public function showContactGrouped($id,$groupName)\n {\n $this->contacts = Contact::where('group_contact_id',$id)->get();\n $this->titleNav = 'Groupes '.$groupName; \n }",
"public function GETEntityBy_groupid( $group_id) {\n $params = array();\n $params['group_id'] = $group_id;\n return CentralIndex::doCurl(\"GET\",\"/entity/by_groupid\",$params);\n }",
"public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BrainstrapBundlesFrontBundle:Tariff\\TariffGroup')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Tariff\\TariffGroup entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BrainstrapBundlesFrontBundle:Tariff/TariffGroup:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"function render_group_box($row, $zone = '_SEARCH', $give_context = true, $guid = '')\n{\n if (is_null($row)) { // Should never happen, but we need to be defensive\n return new Tempcode();\n }\n\n require_lang('cns');\n\n $url = build_url(array('page' => 'groups', 'type' => 'view', 'id' => $row['id']), get_module_zone('groups'));\n\n $_title = cns_get_group_name($row['id']);\n $title = $give_context ? do_lang('CONTENT_IS_OF_TYPE', do_lang('USERGROUP'), $_title) : $_title;\n\n $summary = get_translated_text($row['g_name'], $GLOBALS['FORUM_DB']);\n\n require_code('cns_groups2');\n $num_members = cns_get_group_members_raw_count($row['id']);\n $entry_details = do_lang_tempcode('GROUP_NUM_MEMBERS', escape_html(integer_format($num_members)));\n\n return do_template('SIMPLE_PREVIEW_BOX', array(\n '_GUID' => ($guid != '') ? $guid : 'efeac1c8465974edd27bb0d805c4fbe0',\n 'ID' => strval($row['id']),\n 'TITLE' => $title,\n 'TITLE_PLAIN' => $_title,\n 'SUMMARY' => $summary,\n 'ENTRY_DETAILS' => $entry_details,\n 'URL' => $url,\n 'FRACTIONAL_EDIT_FIELD_NAME' => $give_context ? null : 'name',\n 'FRACTIONAL_EDIT_FIELD_URL' => $give_context ? null : '_SEARCH:admin_cns_groups:__edit:' . strval($row['id']),\n 'RESOURCE_TYPE' => 'group',\n ));\n}",
"public function researchGroupsAction()\n {\n // Checks authorization of users\n if (!$this->isGranted('ROLE_DATA_REPOSITORY_MANAGER')) {\n return $this->render('template/AdminOnly.html.twig');\n }\n $GLOBALS['pelagos']['title'] = 'Research Groups';\n return $this->render('List/ResearchGroups.html.twig');\n }",
"public function getDisplayGroup($name);",
"protected function getGroup(GroupContentInterface $group_content) {\n // Since we have a group_content we can get the group.\n $group = $group_content->getGroup();\n\n // Prevent further execution if no group was found.\n if (empty($group)) {\n \\Drupal::logger('entity_activity_tracker')->error($this->t(\"Couldn't find Group!\"));\n return FALSE;\n }\n\n // Now we must find a tracker that matches the group\n // since a tracker is needed to create activity records.\n $properties = [\n 'entity_type' => $group->getEntityTypeId(),\n 'entity_bundle' => $group->bundle(),\n ];\n\n $group_tracker = $this->entityTypeManager->getStorage('entity_activity_tracker')->loadByProperties($properties);\n $group_tracker = reset($group_tracker);\n\n // Do something if there is a Tracker for group where content was created.\n if ($group_tracker) {\n // I NEED TO THINK HOW TO HANDLE MULTIPLE.\n // SINCE WE DONT ALLOW A NODE BE PART OF 2 DIFFERENT GROUPS ITS OK FOR NOW.\n return $group;\n }\n\n }",
"public function show(Group $group, Request $request){\n\n $user = $request->user(); // Gets user from request\n $group->load('articles'); // eager loads all articles associated with the group.\n\n if($this->isGroupMember($user,$group)){\n $responseArray = [\"user\" => $user, \"group\" => $group];\n return view('groups.show', $responseArray);\n } else{\n $responseArray = [\"user\" => $user, \"group\" => $group];\n return view('groups.showGuest', $responseArray);\n }\n\n }",
"public function pageGroups(){\n // Access-controlled page\n if (!$this->_app->user->checkAccess('uri_groups')){\n $this->_app->notFound();\n }\n\n $groups = Group::queryBuilder()->get();\n\n $this->_app->render('groups/groups.twig', [\n \"groups\" => $groups\n ]);\n }",
"function pmp_groups_page() {\n\tif (!current_user_can('manage_options'))\n\t\twp_die( __( 'You do not have sufficient permissions to access this page.' ) );\n\n\t$sdk = new SDKWrapper();\n\t$result = $sdk->queryDocs(array(\n\t\t'profile' => 'group',\n\t\t'writeable' => true,\n\t\t'limit' => 20\n\t));\n\n\t$context = array(\n\t\t'groups' => $result->items(),\n\t\t'creators' => pmp_get_creators(),\n\t\t'default_group' => get_option('pmp_default_group', false)\n\t);\n\tpmp_render_template('groups.php', $context);\n}",
"public function displayGroups() {\n $data = array();\n $data['groups'] = $this->group_model->get_groups();\n\n return load_view('admin/groups', $data);\n }",
"public abstract function get_group();",
"public function indexAction()\n {\n\n $em = $this->getDoctrine()->getManager();\n $entities = $em->getRepository('AppBundle:Group')->findAll();\n \n return array(\n 'entities' => $entities,\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse template contains xml_news_feed | function parse_news_feed() {
global $ft;
$query = sprintf("
SELECT
a.*, b.*, c.comments_id, count(DISTINCT c.id)
AS
comments
FROM
%1\$s a,
%2\$s b
LEFT JOIN
%3\$s c
ON
a.id = c.comments_id
LEFT JOIN
%4\$s d
ON
a.id = d.news_id
WHERE
published = '1'
GROUP BY
a.date
DESC
LIMIT
%5\$d",
TABLE_MAIN,
TABLE_CATEGORY,
TABLE_COMMENTS,
TABLE_ASSIGN2CAT,
10
);
$this->view->db->query($query);
$ft->define('xml_feed', 'xml_feed.tpl');
$ft->define_dynamic('xml_row', 'xml_feed');
$ft->define_dynamic("cat_row", "xml_feed");
$ft->assign(array(
'MAINSITE_LINK' =>'http://' . $this->http_root,
'NEWS_FEED' =>true
));
if($this->view->db->num_rows() > 0) {
while($this->view->db->next_record()) {
$date = $this->view->db->f("date");
$title = $this->view->db->f("title");
$text = $this->view->db->f("text");
$author = $this->view->db->f("author");
$id = $this->view->db->f("id");
$image = $this->view->db->f("image");
$comments_allow = $this->view->db->f("comments_allow");
$comments = $this->view->db->f("comments");
$date = $this->date_convert($date);
$text = str_replace($this->pattern, $this->replacement, $text);
list_assigned_categories($id);
if((bool)$this->rewrite) {
$comments_link = sprintf('%s1,%s,2,item.html', $this->http_root, $id);
$permanent_link = sprintf('%s1,%s,1,item.html', $this->http_root, $id);
} else {
$comments_link = sprintf('%sindex.php?p=2&id=%s', $this->http_root, $id);
$permanent_link = sprintf('%sindex.php?p=1&id=%s', $this->http_root, $id);
}
$ft->assign(array(
'DATE' =>$date,
'TITLE' =>$title,
'AUTHOR' =>$author,
'PERMALINK' =>$permanent_link,
'TEXT' =>$text,
'COMMENTS_LINK' =>$comments_link,
'DISPLAY_XML' =>true
));
$ft->parse('XML_ROW', ".xml_row");
}
} else {
$ft->assign('DISPLAY_XML', false);
$ft->parse('XML_ROW', ".xml_row");
}
$this->display();
} | [
"private function parseFeedToNews() {\n $news = array();\n $feed = simplexml_load_file($this->url);\n\n $urlImg = null;\n\n foreach($feed->channel->item as $item) {\n $urlImg = $this->getImageURL($item->link);\n\n $n = array (\n \"title\" => $item->title,\n \"url\" => $item->link,\n \"description\" => $item->description,\n \"published_date\" => date('Y-m-d H:i:s', strtotime(str_replace('-', '/', $item->pubDate))),\n\t\t \"url_img\" => $urlImg\n );\n array_push($news, $n);\n }\n\n return $news;\n }",
"public function parseContent();",
"public function actionNews()\n {\n libxml_use_internal_errors(true);\n $xml = simplexml_load_file($_SERVER['DOCUMENT_ROOT'] . '/../modules/rss_feeds/rocketLeague/rl_feed.xml');\n\n $data = [\n [\n 'title' => '',\n 'html' => '',\n ],\n [\n 'title' => '',\n 'html' => '',\n ],\n [\n 'title' => '',\n 'html' => '',\n ],\n ];\n\n $xmlError = libxml_get_errors();\n if (empty($xmlError)) {\n\n $key = 0;\n foreach ($xml->channel->item as $item) {\n\n if (3 === $key) {\n break;\n }\n\n $data[$key++] = [\n 'title' => $item->title->__toString(),\n 'html' => $item->description->__toString(),\n ];\n\n }\n }\n\n return $this->render('news',\n [\n 'data' => $data,\n ]);\n }",
"public function index_xpath_antara_news(Request $request){\n $url = \"https://www.antaranews.com/rss/terkini.xml\";\n\n $xml = simplexml_load_file($url);\n // dd($xml->channel->item);\n $data = count($xml->channel->item);\n // dd($data);\n for($i = 0; $i < 10; $i++){\n $document = new Document(strval($xml->channel->item[$i]->link), true);\n $summary = $document->find(\"//p[contains(@class, 'wp-caption-text')]\", Query::TYPE_XPATH);\n $content = $document->find(\"//div[contains(@class, 'post-content')]\", Query::TYPE_XPATH);\n for($j = 0; $j < count($summary); $j++){\n $articleCode[] = array(\n 'title' => strval($xml->channel->item[$i]->title),\n 'link' => strval($xml->channel->item[$i]->link),\n 'summary' => $summary[$j]->text(),\n 'content' => $content[$j]->text(),\n 'description' => strval($xml->channel->item[$i]->description),\n 'pubdate' => date(\"d/m/Y\", strtotime(strval($xml->channel->item[$i]->pubDate)))\n );\n }\n }\n dd($articleCode);\n }",
"function create_custom_feed() {\n load_template( TEMPLATEPATH . '/feed-rss2.php');\n}",
"private function createNewsFromRss($feed, $xml) {\n\t\t$imported = 0;\n $ns = $xml->getNamespaces(true);\n\n $elementCount = 0;\n foreach($xml->channel->item as $item) {\n $nsChilds = $item->children($ns['content']);\n if((string)$nsChilds->encoded != '') {\n $desc = trim((string)$nsChilds->encoded);\n \t }\n\n $itemtitle = (string)$item->title;\n $itemdate = DateTime::CreateFromFormat(DateTime::RSS, (string)$item->pubDate);\n\n $exists = Doctrine::instance()->getRepository('Model_Article_News')->findOneBy(array('title' => $itemtitle, 'date' => $itemdate, 'deleted' => 0));\n\n if(!$exists) {\n $news = new Model_Article_News();\n $news->title = $itemtitle;\n\n $news->date = $itemdate;\n\n // Extract the author of the item\n $author = $item->xpath(\"*[local-name()='creator']/text()\");\n\n if($author !== false && count($author) > 0 && !empty($author[0])) {\n // If an author/creator was found\n $news->author = $feed->author . \" | \" . (string)$author[0];\n } else {\n $news->author = $feed->author;\n }\n\n $news->ready_for_publish = true;\n $news->rssfeed = $feed;\n $news->text = (string)$desc;\n\n $link = (string) $item->link;\n $news->setExternal_links(array(array('url' => $link, 'show_link' => true)));\n\n if($feed->logo) {\n $news->logo = $feed->logo->id;\n }\n\n $news->active = true;\n\n Doctrine::instance()->persist($news);\n $imported++;\n }\n $elementCount++;\n }\n\t\treturn $imported;\n\t}",
"function do_feed_rss() {\n\tload_template( ABSPATH . WPINC . '/feed-rss.php' );\n}",
"function okf_custom_rss2_feed() {\n\tload_template( TEMPLATEPATH . '/oki-feed-rss2.php' );\n}",
"function zbozi_feed_rss() {\n $rss_template = dirname(__FILE__) . '/product-feed.php';\n load_template ( $rss_template );\n}",
"function Parse ($rss_url) {\r\n\t\t// Open and load RSS file\r\n\t\tif ($f = @fopen($rss_url, 'r')) {\r\n\t\t\t$rss_content = '';\r\n\t\t\twhile (!feof($f)) {\r\n\t\t\t\t$rss_content .= fgets($f, 4096);\r\n\t\t\t}\r\n\t\t\tfclose($f);\r\n\t\t\t// Parse document encoding\r\n\t\t\t$result['encoding'] = $this->my_preg_match(\"'encoding=[\\'\\\"](.*?)[\\'\\\"]'si\", $rss_content);\r\n\t\t\t// if document codepage is specified, use it\r\n\t\t\tif ($result['encoding'] != '')\r\n\t\t\t\t{ $this->rsscp = $result['encoding']; } // This is used in my_preg_match()\r\n\t\t\t// otherwise use the default codepage\r\n\t\t\telse\r\n\t\t\t\t{ $this->rsscp = $this->default_cp; } // This is used in my_preg_match()\r\n\t\t\t// Parse CHANNEL info\r\n\t\t\tpreg_match(\"'<channel.*?>(.*?)</channel>'si\", $rss_content, $out_channel);\r\n\t\t\tforeach($this->channeltags as $channeltag)\r\n\t\t\t{\r\n\t\t\t\t$temp = $this->my_preg_match(\"'<$channeltag.*?>(.*?)</$channeltag>'si\", $out_channel[1]);\r\n\t\t\t\tif ($temp != '') $result[$channeltag] = $temp; // Set only if not empty\r\n\t\t\t}\r\n\t\t\t// If date_format is specified and lastBuildDate is valid\r\n\t\t\tif ($this->date_format != '' && ($timestamp = strtotime($result['lastBuildDate'])) !==-1) {\r\n\t\t\t\t\t\t// convert lastBuildDate to specified date format\r\n\t\t\t\t\t\t$result['lastBuildDate'] = date($this->date_format, $timestamp);\r\n\t\t\t}\r\n\t\t\t// Parse TEXTINPUT info\r\n\t\t\tpreg_match(\"'<textinput(|[^>]*[^/])>(.*?)</textinput>'si\", $rss_content, $out_textinfo);\r\n\t\t\t\t// This a little strange regexp means:\r\n\t\t\t\t// Look for tag <textinput> with or without any attributes, but skip truncated version <textinput /> (it's not beggining tag)\r\n\t\t\tif (isset($out_textinfo[2])) {\r\n\t\t\t\tforeach($this->textinputtags as $textinputtag) {\r\n\t\t\t\t\t$temp = $this->my_preg_match(\"'<$textinputtag.*?>(.*?)</$textinputtag>'si\", $out_textinfo[2]);\r\n\t\t\t\t\tif ($temp != '') $result['textinput_'.$textinputtag] = $temp; // Set only if not empty\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Parse IMAGE info\r\n\t\t\tpreg_match(\"'<image.*?>(.*?)</image>'si\", $rss_content, $out_imageinfo);\r\n\t\t\tif (isset($out_imageinfo[1])) {\r\n\t\t\t\tforeach($this->imagetags as $imagetag) {\r\n\t\t\t\t\t$temp = $this->my_preg_match(\"'<$imagetag.*?>(.*?)</$imagetag>'si\", $out_imageinfo[1]);\r\n\t\t\t\t\tif ($temp != '') $result['image_'.$imagetag] = $temp; // Set only if not empty\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Parse ITEMS\r\n\t\t\tpreg_match_all(\"'<item(| .*?)>(.*?)</item>'si\", $rss_content, $items);\r\n\t\t\t$rss_items = $items[2];\r\n\t\t\t$i = 0;\r\n\t\t\t$result['items'] = array(); // create array even if there are no items\r\n\t\t\tforeach($rss_items as $rss_item) {\r\n\t\t\t\t// If number of items is lower then limit: Parse one item\r\n\t\t\t\tif ($i < $this->items_limit || $this->items_limit == 0) {\r\n\t\t\t\t\tforeach($this->itemtags as $itemtag) {\r\n\t\t\t\t\t\t$temp = $this->my_preg_match(\"'<$itemtag.*?>(.*?)</$itemtag>'si\", $rss_item);\r\n\t\t\t\t\t\tif ($temp != '') $result['items'][$i][$itemtag] = $temp; // Set only if not empty\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Strip HTML tags and other bullshit from DESCRIPTION\r\n\t\t\t\t\tif ($this->stripHTML && $result['items'][$i]['description'])\r\n\t\t\t\t\t\t$result['items'][$i]['description'] = strip_tags($this->unhtmlentities(strip_tags($result['items'][$i]['description'])));\r\n\t\t\t\t\t// Strip HTML tags and other bullshit from TITLE\r\n\t\t\t\t\tif ($this->stripHTML && $result['items'][$i]['title'])\r\n\t\t\t\t\t\t$result['items'][$i]['title'] = strip_tags($this->unhtmlentities(strip_tags($result['items'][$i]['title'])));\r\n\t\t\t\t\t// If date_format is specified and pubDate is valid\r\n\t\t\t\t\tif ($this->date_format != '' && ($timestamp = strtotime($result['items'][$i]['pubDate'])) !==-1) {\r\n\t\t\t\t\t\t// convert pubDate to specified date format\r\n\t\t\t\t\t\t$result['items'][$i]['pubDate'] = date($this->date_format, $timestamp);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Item counter\r\n\t\t\t\t\t$i++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$result['items_count'] = $i;\r\n\t\t\treturn $result;\r\n\t\t}\r\n\t\telse // Error in opening return False\r\n\t\t{\r\n\t\t\treturn False;\r\n\t\t}\r\n\t}",
"public static function fetch_wp_feed() {\n $feed_url = 'https://wordpress.org/news/feed/';\n $content = file_get_contents($feed_url);\n $x = new SimpleXMLElement($content);\n $i = 0;\n\n foreach($x->channel->item as $entry) {\n if($i == 3) break;\n echo \"<li><a href='$entry->link' title='$entry->title'>$title</a>\n $entry->description\n </li>\";\n $i++;\n\n }\n\n }",
"function _template_xml()\n\t{\n\t\tob_start();\n?><create>\n\t<weblog is_user_blog='n' blog_name='products' blog_title='Products' blog_url='' blog_description='' blog_lang='en' blog_encoding='utf-8' total_entries='0' total_comments='0' total_trackbacks='0' last_entry_date='0' last_comment_date='0' last_trackback_date='0' cat_group='' status_group='0' deft_status='open' search_excerpt='0' enable_trackbacks='n' trackback_use_url_title='n' trackback_max_hits='5' trackback_field='44' deft_category='' deft_comments='y' deft_trackbacks='y' weblog_require_membership='y' weblog_max_chars='0' weblog_html_formatting='all' weblog_allow_img_urls='y' weblog_auto_link_urls='n' weblog_notify='n' weblog_notify_emails='' comment_url='' comment_system_enabled='y' comment_require_membership='n' comment_use_captcha='n' comment_moderate='n' comment_max_chars='0' comment_timelock='0' comment_require_email='y' comment_text_formatting='xhtml' comment_html_formatting='safe' comment_allow_img_urls='n' comment_auto_link_urls='y' comment_notify='n' comment_notify_authors='n' comment_notify_emails='' comment_expiration='0' search_results_url='' tb_return_url='' ping_return_url='' show_url_title='y' trackback_system_enabled='n' show_trackback_field='y' trackback_use_captcha='n' show_ping_cluster='y' show_options_cluster='y' show_button_cluster='y' show_forum_cluster='n' show_pages_cluster='n' show_show_all_cluster='y' show_author_menu='y' show_status_menu='y' show_categories_menu='y' show_date_menu='y' rss_url='' enable_versioning='n' enable_qucksave_versioning='n' max_revisions='10' default_entry_title='' url_title_prefix='' live_look_template='0'>\n\t\t<field_group group_name='Products'>\n\t\t\t<field field_name='product_price' field_label='Price' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='0' field_related_orderby='date' field_related_sort='desc' field_related_max='0' field_ta_rows='8' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='2' />\n\t\t\t<field field_name='product_shipping' field_label='Shipping' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='0' field_related_orderby='date' field_related_sort='desc' field_related_max='0' field_ta_rows='8' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='3' />\n\t\t\t<field field_name='product_weight' field_label='Weight' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='0' field_related_orderby='date' field_related_sort='desc' field_related_max='0' field_ta_rows='8' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='4' />\n\t\t\t<field field_name='product_size' field_label='Size' field_instructions='' field_type='ct_price_mod' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='8' field_related_orderby='title' field_related_sort='desc' field_related_max='0' field_ta_rows='6' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='5' />\n\t\t\t<field field_name='product_download_url' field_label='Download URL' field_instructions='If the product has an associated download URL, add it here. ' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='8' field_related_orderby='title' field_related_sort='desc' field_related_max='0' field_ta_rows='6' field_maxl='300' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='34' />\n\t\t</field_group>\n\t</weblog>\n\t<weblog is_user_blog='n' blog_name='coupon_codes' blog_title='Coupon Codes' blog_url='' blog_description='' blog_lang='en' blog_encoding='utf-8' total_entries='0' total_comments='0' total_trackbacks='0' last_entry_date='0' last_comment_date='0' last_trackback_date='0' cat_group='' status_group='0' deft_status='open' search_excerpt='0' enable_trackbacks='n' trackback_use_url_title='n' trackback_max_hits='5' trackback_field='0' deft_category='' deft_comments='y' deft_trackbacks='y' weblog_require_membership='y' weblog_max_chars='0' weblog_html_formatting='all' weblog_allow_img_urls='y' weblog_auto_link_urls='y' weblog_notify='n' weblog_notify_emails='' comment_url='' comment_system_enabled='y' comment_require_membership='n' comment_use_captcha='n' comment_moderate='n' comment_max_chars='0' comment_timelock='0' comment_require_email='y' comment_text_formatting='xhtml' comment_html_formatting='safe' comment_allow_img_urls='n' comment_auto_link_urls='y' comment_notify='n' comment_notify_authors='n' comment_notify_emails='' comment_expiration='0' search_results_url='' tb_return_url='' ping_return_url='' show_url_title='y' trackback_system_enabled='n' show_trackback_field='y' trackback_use_captcha='n' show_ping_cluster='y' show_options_cluster='y' show_button_cluster='y' show_forum_cluster='n' show_pages_cluster='n' show_show_all_cluster='y' show_author_menu='y' show_status_menu='y' show_categories_menu='y' show_date_menu='y' rss_url='' enable_versioning='n' enable_qucksave_versioning='n' max_revisions='10' default_entry_title='' url_title_prefix='' live_look_template='0'>\n\t\t<field_group group_name='Coupon Codes'>\n\t\t\t<field field_name='coupon_code_type' field_label='Coupon Type' field_instructions='' field_type='ct_coupon' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='26' field_related_orderby='title' field_related_sort='desc' field_related_max='0' field_ta_rows='6' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='xhtml' field_show_fmt='y' field_order='3' />\n\t\t</field_group>\n\t</weblog>\n\t<weblog is_user_blog='n' blog_name='orders' blog_title='Orders' blog_url='' blog_description='' blog_lang='en' blog_encoding='utf-8' total_entries='0' total_comments='0' total_trackbacks='0' last_entry_date='0' last_comment_date='0' last_trackback_date='0' cat_group='' status_group='1' deft_status='open' search_excerpt='0' enable_trackbacks='n' trackback_use_url_title='n' trackback_max_hits='5' trackback_field='50' deft_category='' deft_comments='y' deft_trackbacks='y' weblog_require_membership='y' weblog_max_chars='0' weblog_html_formatting='all' weblog_allow_img_urls='y' weblog_auto_link_urls='n' weblog_notify='n' weblog_notify_emails='' comment_url='' comment_system_enabled='y' comment_require_membership='n' comment_use_captcha='n' comment_moderate='n' comment_max_chars='0' comment_timelock='0' comment_require_email='y' comment_text_formatting='xhtml' comment_html_formatting='safe' comment_allow_img_urls='n' comment_auto_link_urls='y' comment_notify='n' comment_notify_authors='n' comment_notify_emails='' comment_expiration='0' search_results_url='' tb_return_url='' ping_return_url='' show_url_title='y' trackback_system_enabled='n' show_trackback_field='y' trackback_use_captcha='n' show_ping_cluster='y' show_options_cluster='y' show_button_cluster='y' show_forum_cluster='n' show_pages_cluster='n' show_show_all_cluster='y' show_author_menu='y' show_status_menu='y' show_categories_menu='y' show_date_menu='y' rss_url='' enable_versioning='n' enable_qucksave_versioning='n' max_revisions='10' default_entry_title='' url_title_prefix='' live_look_template='0'>\n\t\t<field_group group_name='Orders'>\n\t\t\t<field field_name='order_shipping_address' field_label='Shipping Address' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='0' field_related_orderby='date' field_related_sort='desc' field_related_max='0' field_ta_rows='8' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='12' />\n\t\t\t<field field_name='order_shipping_address2' field_label='Shipping Address 2' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='0' field_related_orderby='date' field_related_sort='desc' field_related_max='0' field_ta_rows='8' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='13' />\n\t\t\t<field field_name='order_shipping_option' field_label='Shipping Method' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='8' field_related_orderby='date' field_related_sort='desc' field_related_max='0' field_ta_rows='8' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='30' />\n\t\t\t<field field_name='order_shipping_city' field_label='Shipping City' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='0' field_related_orderby='date' field_related_sort='desc' field_related_max='0' field_ta_rows='8' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='14' />\n\t\t\t<field field_name='order_billing_zip' field_label='Billing Zip' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='0' field_related_orderby='date' field_related_sort='desc' field_related_max='0' field_ta_rows='8' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='7' />\n\t\t\t<field field_name='order_shipping_first_name' field_label='Shipping First Name' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='0' field_related_orderby='date' field_related_sort='desc' field_related_max='0' field_ta_rows='8' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='10' />\n\t\t\t<field field_name='order_shipping_last_name' field_label='Shipping Last Name' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='0' field_related_orderby='date' field_related_sort='desc' field_related_max='0' field_ta_rows='8' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='11' />\n\t\t\t<field field_name='order_billing_state' field_label='Billing State' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='0' field_related_orderby='date' field_related_sort='desc' field_related_max='0' field_ta_rows='8' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='6' />\n\t\t\t<field field_name='order_billing_address' field_label='Billing Address' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='0' field_related_orderby='date' field_related_sort='desc' field_related_max='0' field_ta_rows='8' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='3' />\n\t\t\t<field field_name='order_billing_city' field_label='Billing City' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='0' field_related_orderby='date' field_related_sort='desc' field_related_max='0' field_ta_rows='8' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='5' />\n\t\t\t<field field_name='order_billing_address2' field_label='Billing Address 2' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='0' field_related_orderby='date' field_related_sort='desc' field_related_max='0' field_ta_rows='8' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='4' />\n\t\t\t<field field_name='order_billing_last_name' field_label='Billing Last Name' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='0' field_related_orderby='date' field_related_sort='desc' field_related_max='0' field_ta_rows='8' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='2' />\n\t\t\t<field field_name='order_billing_first_name' field_label='Billing First Name' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='0' field_related_orderby='date' field_related_sort='desc' field_related_max='0' field_ta_rows='8' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='1' />\n\t\t\t<field field_name='order_transaction_id' field_label='Transaction ID' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='0' field_related_orderby='date' field_related_sort='desc' field_related_max='0' field_ta_rows='8' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='31' />\n\t\t\t<field field_name='order_customer_email' field_label='Customer Email' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='0' field_related_orderby='date' field_related_sort='desc' field_related_max='0' field_ta_rows='8' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='18' />\n\t\t\t<field field_name='order_customer_phone' field_label='Customer Phone' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='0' field_related_orderby='date' field_related_sort='desc' field_related_max='0' field_ta_rows='8' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='19' />\n\t\t\t<field field_name='order_shipping_state' field_label='Shipping State' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='0' field_related_orderby='date' field_related_sort='desc' field_related_max='0' field_ta_rows='8' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='15' />\n\t\t\t<field field_name='order_shipping_zip' field_label='Shipping Zip' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='0' field_related_orderby='date' field_related_sort='desc' field_related_max='0' field_ta_rows='8' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='16' />\n\t\t\t<field field_name='order_subtotal' field_label='Subtotal' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='0' field_related_orderby='date' field_related_sort='desc' field_related_max='0' field_ta_rows='8' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='23' />\n\t\t\t<field field_name='order_tax' field_label='Tax' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='0' field_related_orderby='date' field_related_sort='desc' field_related_max='0' field_ta_rows='8' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='24' />\n\t\t\t<field field_name='order_shipping' field_label='Shipping Cost' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='8' field_related_orderby='date' field_related_sort='desc' field_related_max='0' field_ta_rows='8' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='25' />\n\t\t\t<field field_name='order_total' field_label='Total' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='0' field_related_orderby='date' field_related_sort='desc' field_related_max='0' field_ta_rows='8' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='26' />\n\t\t\t<field field_name='order_items' field_label='Items' field_instructions='' field_type='ct_items' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='26' field_related_orderby='date' field_related_sort='desc' field_related_max='0' field_ta_rows='8' field_maxl='0' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='27' />\n\t\t\t<field field_name='order_coupons' field_label='Coupons' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='8' field_related_orderby='title' field_related_sort='desc' field_related_max='0' field_ta_rows='6' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='34' />\n\t\t\t<field field_name='order_last_four' field_label='CC Last Four Digits' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='8' field_related_orderby='title' field_related_sort='desc' field_related_max='0' field_ta_rows='6' field_maxl='4' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='34' />\n\t\t\t<field field_name='order_error_message' field_label='Error Message' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='8' field_related_orderby='title' field_related_sort='desc' field_related_max='0' field_ta_rows='6' field_maxl='255' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='36' />\n\t\t</field_group>\n\t</weblog>\n\t<weblog is_user_blog='n' blog_name='purchased_items' blog_title='Purchased Items' blog_url='' blog_description='' blog_lang='en' blog_encoding='utf-8' total_entries='0' total_comments='0' total_trackbacks='0' last_entry_date='0' last_comment_date='0' last_trackback_date='0' cat_group='1' status_group='1' deft_status='open' search_excerpt='0' enable_trackbacks='n' trackback_use_url_title='n' trackback_max_hits='5' trackback_field='77' deft_category='' deft_comments='y' deft_trackbacks='y' weblog_require_membership='y' weblog_max_chars='0' weblog_html_formatting='all' weblog_allow_img_urls='y' weblog_auto_link_urls='n' weblog_notify='n' weblog_notify_emails='' comment_url='' comment_system_enabled='y' comment_require_membership='n' comment_use_captcha='n' comment_moderate='n' comment_max_chars='0' comment_timelock='0' comment_require_email='y' comment_text_formatting='xhtml' comment_html_formatting='safe' comment_allow_img_urls='n' comment_auto_link_urls='y' comment_notify='n' comment_notify_authors='n' comment_notify_emails='' comment_expiration='0' search_results_url='' tb_return_url='' ping_return_url='' show_url_title='y' trackback_system_enabled='n' show_trackback_field='y' trackback_use_captcha='n' show_ping_cluster='y' show_options_cluster='y' show_button_cluster='y' show_forum_cluster='n' show_pages_cluster='n' show_show_all_cluster='y' show_author_menu='y' show_status_menu='y' show_categories_menu='y' show_date_menu='y' rss_url='' enable_versioning='n' enable_qucksave_versioning='n' max_revisions='10' default_entry_title='' url_title_prefix='' live_look_template='0'>\n\t\t<field_group group_name='Purchased Items'>\n\t\t\t<field field_name='purchased_id' field_label='ID' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='26' field_related_orderby='title' field_related_sort='desc' field_related_max='0' field_ta_rows='6' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='1' />\n\t\t\t<field field_name='purchased_quantity' field_label='Quantity' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='8' field_related_orderby='title' field_related_sort='desc' field_related_max='0' field_ta_rows='6' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='2' />\n\t\t\t<field field_name='purchased_price' field_label='Price' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='' field_related_orderby='title' field_related_sort='desc' field_related_max='0' field_ta_rows='6' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='3' />\n\t\t\t<field field_name='purchased_order_id' field_label='Order Id' field_instructions='' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='8' field_related_orderby='title' field_related_sort='desc' field_related_max='0' field_ta_rows='6' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='35' />\n\t\t\t<field field_name='purchased_product_download_url' field_label='Product Download URL' field_instructions='This is the filename of the downloadable product. ' field_type='text' field_list_items='' field_pre_populate='n' field_pre_blog_id='0' field_pre_field_id='0' field_related_to='blog' field_related_id='8' field_related_orderby='title' field_related_sort='desc' field_related_max='0' field_ta_rows='6' field_maxl='128' field_required='n' field_text_direction='ltr' field_search='n' field_is_hidden='n' field_fmt='none' field_show_fmt='n' field_order='35' />\n\t\t</field_group>\n\t</weblog>\n\t<template_group group_name='reports' group_order='5' is_site_default='n' is_user_blog='n'>\n\t\t<template template_name='index' save_template_file='n' template_type='webpage' template_notes='' edit_date='' last_author_id='1' cache='n' refresh='0' no_auth_bounce='' enable_http_auth='n' allow_php='n' php_parse_location='o' hits=''>\n\t\t<![CDATA[\n{assign_variable:template=\"cart_single_page_checkout\"}\n{embed=includes/.header title=\"Reports\" }\n<style type=\"text/css\">\n\t.store_block table td{\n\t\tpadding: 6px;\n\t}\n</style>\n</head>\n<body>\n\t<h1>Reports</h1>\n\t<p>You can create reports in any way you'd like with CartThrob using standard EE templates.</p>\n\t<p>Note: CartThrob currently uses standard templates to output report information. Some business owners may want to see these reports within the context of their backend. Take a look at the following article: <a href=\"http://cartthrob.com/docs/tags_detail/order_items/\">Site Owner’s Completed Order Report</a></p>\n\n\n\t{!-- ORDERS REPORT --}\n <div class=\"store_block\">\n\t<h2>Sales Report</h2>\n\t{!-- outputting products stored in orders weblog. Like typical weblogs, \n\t\tthe name of the weblog may vary based on your system configuration --}\n\t\t{exp:weblog:entries weblog=\"orders\"}\n\t\t\t<h3>{title} Purchased: {entry_date format=\"%m/%d/%Y\"}</h3>\n\t\t\t{!-- The \"order_items\" is a custom field within the weblog. \n\t\t\t\tThe order_items is a very powerful field type. It can dynamically \n\t\t\t\t add and store configured product information. Each new configuration \n\t\t\t\toption will be stored in this field, regardless of the name or \n\t\t\t\tnumber of configuration options. This means that you can store \n\t\t\t\tsizes, colors, finishes, or other option data without pre-configuring \n\t\t\t\tthe field. See the article entry here on setting this up: \n\t\t\t\thttp://cartthrob.com/docs/sub_pages/orders_overview/\n\t\t\t\tand the article about outputting this data here: \n\t\t\t\thttp://cartthrob.com/docs/tags_detail/order_items/\n\t\t\t --}\n\t\t\t{!-- :table is a pseudo tag available for the order_items custom field. it\n\t\t\t\toutputs a table of the content stored in the order_items field. You can \n\t\t\t\talso use the {order_items}{/order_items} variable pair for more flexibility --}\n\t\t\t{order_items:table}<br />\n\t\t\n\t\t\t{!-- The variables below all reference standard EE weblog custom field variables --}\n<pre>\nSubtotal: \t\t\t{order_subtotal}\nTax: \t\t\t\t{order_tax}\nShipping:\t\t\t{order_shipping}\n-------------------------------------------------------------\nTotal:\t\t\t\t{order_total}\n</pre>\n\t\t\t<br />\n\t\t\tTransaction ID: {order_transaction_id}<br /><br />\n\n\t\t\tCustomer Info: <br />\n\t\t\t{order_billing_first_name} {order_billing_last_name}<br />\n\t\t\t{order_customer_email}<br />\n\n\t\t\t<hr>\n\t\t{/exp:weblog:entries}\n\t</div>\n\t\n\t{!-- PURCHASED ITEMS --}\n <div class=\"store_block\">\n\t<h2>PURCHASED ITEMS</h2>\n\t{!-- Purchased items is a standard EE weblog. There are no advanced custom fields associated\n\t\twith the Purchased items weblog --}\n\t\t{exp:weblog:entries weblog=\"purchased_items\" limit=\"20\"}\n\t\t\t<h3>{title}</h3>\n\t\t\tCustomer Info: {author}\n\t\t\tItem ID: {purchased_id}\n\t\t\tQuantity Purchased: {purchased_quantity}\n\t\t\tOrder ID: {purchased_order_id}\n\t\t\t<hr>\n\t\t{/exp:weblog:entries}\n\t</div>\n\t<div class=\"store_block\">\n\t\t<h2>Tags used in this template</h2>\n\t\t<ul>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/order_items/\">CartThrob Order Items Custom Field Type</a></li>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/order_items/#var_item:table\">CartThrob Order Items:Table</a></li>\n\n\t\t</ul>\n\t</div>\n\t<div class=\"store_block\">\n\t\t<h2>Concepts used in this template</h2>\n\t\t<ul>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/sub_pages/orders_overview/\">Orders Weblog</a></li>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/sub_pages/purchased_items_overview\">Purchased Items Weblog</a></li>\n\t\t</ul>\n\t</div>\n\t<div class=\"store_block\">\n\t\t{embed=includes/.footer}\n\t</div>\n</body>\n</html>\t\t]]>\n\t\t</template>\n\t</template_group>\n\t<template_group group_name='cart_single_page_checkout' group_order='1' is_site_default='y' is_user_blog='n'>\n\t\t<template template_name='index' save_template_file='n' template_type='webpage' template_notes='' edit_date='' last_author_id='1' cache='n' refresh='0' no_auth_bounce='' enable_http_auth='n' allow_php='n' php_parse_location='o' hits=''>\n\t\t<![CDATA[\n{assign_variable:template=\"cart_single_page_checkout\"}\n{embed=includes/.header title=\"Single Page Store\" }\n</head>\n<body>\n\t<h1>Single Page Store</h1>\n\t<p>This single page is an example of how you can use one page to add, update, and delete items, as well as checkout</p>\n\n\t{!-- ORDER COMPLETE MESSAGES --}\n\t{!-- The \"return\" paramater of the checkout form below is set back to this page with \"order_complete\" in the URL. \n\t\tThis saves creating a template specifically to handle order info. --}\n\t{if segment_2==\"order_complete\"}\n\t\t{!-- the submitted_order_info tag returns information from the last attempted order. --}\n\t\t{exp:cartthrob:submitted_order_info}\n\t\t <div class=\"store_block\">\n\t\t\t\t{if authorized}\n\t\t\t\t\tYour transaction is complete!<br />\n\t\t\t Transaction ID: {transaction_id}<br />\n\t\t\t Your total: {cart_total}<br />\n\t\t\t Your order ID: {order_id}\n\t\t\t {if:elseif declined}\n\t\t\t Your credit card was declined: {error_message}\n\t\t\t {if:elseif failed}\n\t\t\t Your payment failed: {error_message}\n\t\t\t {if:else}\n\t\t\t Your payment failed: {error_message}\n\t\t\t {/if}\n\t\t\t</div>\n\t\t{/exp:cartthrob:submitted_order_info}\n\t{/if}\n\n\t{!-- ADD A PRODUCT --}\n <div class=\"store_block\">\n\t<h2>Add Products</h2>\n\t{!-- outputting products stored in one of the \"products\" weblogs. These are exactly the same as normal \n\t\tproduct weblogs, so the weblog names may be different from what is listed below --}\n\t{exp:weblog:entries weblog=\"products\" limit=\"10\"}\n\t\t{!-- The add_to_cart_form adds 1 or more of a product to the cart --}\n\t\t{exp:cartthrob:add_to_cart_form \n\t\t\tentry_id=\"{entry_id}\" \n\t\t\treturn=\"{template}/index\"}\n\t\t\t\t<p>Product name: {title} <br />\n\t\t\t\tQuantity: <input type=\"text\" name=\"quantity\" size=\"5\" value=\"\" /> <input type=\"submit\" value=\"Add to Cart\">\n\t\t\t\t<br />\n\t\t\t\tPrice: ${product_price}<br />\n\t\t\t\t\n\t\t\t\t</p>\n\t\t{/exp:cartthrob:add_to_cart_form}\n\t{/exp:weblog:entries}\n\t</div>\n\n\t{!-- VIEW CART CONTENTS / UPDATE QUANTITIES --}\n\n\t<div class=\"store_block\">\n\t<h2>Cart Contents</h2>\n\t{!-- cart_items_info outputs information about your current cart, including products in the cart, weight, and prices. --}\n\t\t{exp:cartthrob:cart_items_info}\n\t\t{if no_results}\n\t\t <p>There is nothing in your cart</p>\n\t\t{/if}\n\t\t{!-- outputting data that's only applicable for the first item. --}\n\t\t{if first_row}\n\t\t\t{exp:cartthrob:update_cart_form \n\t\t\t\treturn=\"{template}/index\"}\n\t\t\n\t\t\t<h3>Customer Info</h3>\n\t\t\t\t{exp:cartthrob:customer_info}\n\t\t\t\t\tFirst Name: <input type=\"text\" name=\"first_name\" value=\"{customer_first_name}\" /><br />\n\t\t\t\t\tLast Name: <input type=\"text\" name=\"last_name\" value=\"{customer_last_name}\" /><br />\n\t\t\t\t\tEmail Address:\t<input type=\"text\" name=\"email_address\" value=\"{customer_email_address}\" /><br />\n\t\t\t\t\tState: <input type=\"text\" name=\"state\" value=\"{customer_state}\" /><br />\n\t\t\t\t\tZip: <input type=\"text\" name=\"zip\" value=\"{customer_zip}\" /><br />\n\t\t\t\t{/exp:cartthrob:customer_info}\n\n\t\t\t{!-- update_cart_form allows you to edit the information of one or more items in the cart at the same time\n\t\t\t\tas well as save customer information, and shipping options. --}\n\n\n\t\t\t\t\n\t\t\t <table>\n\t\t\t <thead>\n\t\t\t <tr>\n\t\t\t <td>Item</td>\n\t\t\t <td colspan=\"2\">Quantity</td>\n\t\t\t </tr>\n\t\t\t </thead>\n\t\t\t <tbody>\n\t\t{/if}\n\t\t\t <tr>\n\t\t <td>{title}</td>\n\t\t <td>\n\t\t\t\t\t\t\t\t{!-- you can reference products by entry_id and row_id. If you sell configurable \n\t\t\t\t\t\t\t\t\titems (like t-shirts with multiple sizes) you should use row_id to edit and \n\t\t\t\t\t\t\t\t\tdelete items, otherwise, all items with that entry id\n\t\t\t\t\t\t\t\t\tare affected, regardless of configuration --}\n\n\t \t<input type=\"text\" name=\"quantity[{row_id}]\" size=\"2\" value=\"{quantity}\" />\n\t\t </td>\n\t\t <td>\n\t\t\t\t\t\t\t{!-- This deletes one item (row_id) at a time--}\n\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"delete[{row_id}]\"> Delete this item\n\t\t </td>\n\t\t </tr>\n\t\t{if last_row}\n\t\t{!-- outputting data that's only applicable for the last item. --}\n\t\t\t <tr>\n\t\t\t <td>\n\t\t\t\t\t\t\t\t{!-- these are just some of the variables available within the cart_items_info tag --}\n\t\t\t <p>Subtotal: {cart_subtotal}<br />\n\t\t\t Shipping: {cart_shipping}<br />\n\t\t\t Tax: {cart_tax}<br /> \n\t\t\t\t\t\t\t\t{!--tax is updated based on user's location. To create a default tax price, set a default tax region in the backend --}\n\n\t\t\t\t\t\t\t\tShipping Option: {shipping_option}<br />\n\t\t\t\t\t\t\t\tTax Name: {cart_tax_name}<br />\n\t\t\t\t\t\t\t\tTax %: {cart_tax_rate}<br />\n\t\t\t\t\t\t\t\tDiscounted Subtotal: {exp:cartthrob:arithmetic operator=\"-\" num1=\"{cart_subtotal}\" num2=\"{cart_discount}\"}<br />\n\t\t\t\t\t\t\t\tDiscount: {cart_discount}<br />\n\t\t\t\n\t\t\t <strong>Total: {cart_total}</strong></p>\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{!-- total quantity of all items in cart --}\n\t\t\t\t\t\t\t\tTotal Items: {exp:cartthrob:total_items_count}<br />\n\t\t\t\t\t\t\t\t{!-- total items in cart --}\n\t\t\t\t\t\t\t\tTotal Unique Items: {exp:cartthrob:unique_items_count}</p>\n\n\t\t\t </td>\n\t\t\t <td colspan=\"2\"> </td>\n\t\t\t\n\t\t\t </tr>\n\t\t\t </tbody>\n\t\t\t </table>\n\t<input type=\"submit\" value=\"Update Cart\" />\n\n\t\t\t\t{/exp:cartthrob:update_cart_form}\n\t\t\t\n\t\t\t\n\t\t{/if}\n\t{/exp:cartthrob:cart_items_info}\n \n\t\n\t</div>\n\n\t{!-- ADD COUPON --}\n\t<div class=\"store_block\">\n\t<h2>Add Coupon</h2>\n\t{!-- add_coupon_form tag outputs an add_coupon form--}\n\t{exp:cartthrob:add_coupon_form \n\t\treturn=\"{template}/index\"}\n\t\t<input type=\"text\" name=\"coupon_code\" /> use code 5_off if you're demoing this on CartThrob.net<br />\n\t\t<input type=\"submit\" value=\"Add\" />\n\t{/exp:cartthrob:add_coupon_form}\n\t</div>\n\n\t{!-- SAVE CUSTOMER INFO --}\n\t<div class=\"store_block\">\n\t<h2>Save Customer Info</h2>\n\t\n\t{exp:cartthrob:save_customer_info_form \n\t\tid=\"myform_id\" \n\t\tname=\"myform_name\" \n\t\tclass=\"myform_class\" \n\t\treturn=\"{template}/index\" \n\t\t}\n\t\t\t{exp:cartthrob:customer_info}\n\t\t\n\t\t\t\tFirst Name: <input type=\"text\" name=\"first_name\" value=\"{customer_first_name}\" /><br />\n\t\t\t\tLast Name: <input type=\"text\" name=\"last_name\" value=\"{customer_last_name}\" /><br />\n\t\t\t\tEmail Address:\t<input type=\"text\" name=\"email_address\" value=\"{customer_email_address}\" /><br />\n\t\t\t\tState: <input type=\"text\" name=\"state\" value=\"{customer_state}\" /><br />\n\t\t\t\tZip: <input type=\"text\" name=\"zip\" value=\"{customer_zip}\" /><br />\n\t\t\t{/exp:cartthrob:customer_info}\n\t\t\n\t\t{exp:cartthrob:shipping_options}\n\t\t<br />\n\t\t<input type=\"submit\" value=\"Save\" />\n\t{/exp:cartthrob:save_customer_info_form}\n\t\n\t</div>\n\n\t\n\t{!-- CHECKOUT --}\n\t<div class=\"store_block\">\n\t<h2>Checkout</h2>\n\t{!-- checkout_form tag outputs a checkout form--}\n\t{!--- There are many parameters available for the checkout form. You may want to note: cart_empty_redirect \n\t\tthis parameter will redirect customer if there are no products in their cart. --}\n\t{exp:cartthrob:checkout_form \n\t\tgateway=\"dev_template\"\n\t\treturn=\"{template}/order_complete\"}\n\t\t{!-- The gateway_fields template variable to output fields required by your currently selected gateway \n\t\t\twhat you see on the front end changes based on the gateway's requirements.--}\n\t\t{gateway_fields}\n\t\t<br />\n\t\t{!-- you can add a coupon code using the \"add_coupon_form\" or you can add a code right here in the checkout_form --}\n\t\tAdd a coupon code: <input type=\"text\" name=\"coupon_code\" /> <br />\n\t\t<input type=\"submit\" value=\"Checkout\" />\n\t{/exp:cartthrob:checkout_form}\n\t</div>\n\t<div class=\"store_block\">\n\t\t<h2>Tags used in this template</h2>\n\t\t<ul>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/add_to_cart_form\">add_to_cart_form</a></li>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/add_coupon_form\">add_coupon_form</a></li>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/cart_items_info\">cart_items_info</a></li>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/checkout_form\">checkout_form</a></li>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/customer_info\">customer_info</a></li>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/save_customer_info_form\">save_customer_info_form</a></li>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/submitted_order_info\">submitted_order_info</a></li>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/update_cart_form\">update_cart_form</a></li>\n\t\t</ul>\n\t</div>\n\t<div class=\"store_block\">\n\t\t{embed=includes/.footer}\n\t</div>\n</body>\n</html>\t\t]]>\n\t\t</template>\n\t</template_group>\n\t<template_group group_name='cart_tshirt' group_order='2' is_site_default='n' is_user_blog='n'>\n\t\t<template template_name='index' save_template_file='n' template_type='webpage' template_notes='' edit_date='' last_author_id='1' cache='n' refresh='0' no_auth_bounce='' enable_http_auth='n' allow_php='n' php_parse_location='o' hits=''>\n\t\t<![CDATA[\n{assign_variable:template=\"cart_tshirt\"}\n{embed=includes/.header title=\"T-Shirt Store\" }\n</head>\n<body>\n\t<h1>T-Shirt Store</h1>\n\t<p>This example shows how you can add options that your customers can select, some options affect the price, and some do not.</p>\n\n\t{!-- ORDER COMPLETE MESSAGES --}\n\t{!-- The \"return\" paramater of the checkout form below is set back to this page with \"order_complete\" in the URL. \n\t\tThis saves creating a template specifically to handle order info. --}\n\t{if segment_2==\"order_complete\"}\n\t\t{!-- the submitted_order_info tag returns information from the last attempted order. --}\n\t\t{exp:cartthrob:submitted_order_info}\n\t\t <div class=\"store_block\">\n\t\t\t\t{if authorized}\n\t\t\t\t\tYour transaction is complete!<br />\n\t\t\t Transaction ID: {transaction_id}<br />\n\t\t\t Your total: {cart_total}<br />\n\t\t\t Your order ID: {order_id}\n\t\t\t {if:elseif declined}\n\t\t\t Your credit card was declined: {error_message}\n\t\t\t {if:elseif failed}\n\t\t\t Your payment failed: {error_message}\n\t\t\t {if:else}\n\t\t\t Your payment failed: {error_message}\n\t\t\t {/if}\n\t\t\t</div>\n\t\t{/exp:cartthrob:submitted_order_info}\n\t{/if}\n\n\t{!-- ADD A PRODUCT --}\n <div class=\"store_block\">\n\t\t<h2>Add T-Shirts</h2>\n\t\t{!-- outputting products stored in one of the \"products\" weblogs. These are exactly the same as normal \n\t\t\tproduct weblogs, so the weblog names may be different from what is listed below --}\n\t\t{exp:weblog:entries weblog=\"products\" limit=\"10\"}\n\t\t\t{!-- The add_to_cart_form adds 1 or more of a product to the cart --}\n\t\t\t{exp:cartthrob:add_to_cart_form \n\t\t\t\tentry_id=\"{entry_id}\" \n\t\t\t\treturn=\"{template}/index\"}\n\t\t\t\t\t<p>\n\t\t\t\t\t\tT-Shirt name: {title} Tee<br />\n\t\t\t\t\t\tQuantity: <input type=\"text\" name=\"quantity\" size=\"5\" value=\"\" /> \n\t\t\t\t\t\t<input type=\"submit\" value=\"Add to Cart\">\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\tPrice: ${product_price}<br />\n\t\t\t\t\t\t{!-- Some major magic happens here. This is the item_options variable.\n\t\t\t\t\t\t\tIt can be used in conjunction with a \"Cartthrob Price Modifiers\" field from your weblog, \n\t\t\t\t\t\t\tand can automatically create and populate input and select fields with the data from that custom field. \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tA. \n\t\t\t\t\t\t\tIt can be used singly like this: \n\t\t\t\t\t\t\t{item_options:select:YOUR_FIELD_NAME}\n\t\t\t\t\t\t\tand a select dropdown with your values will be output\n\n\t\t\t\t\t\t\tB. \n\t\t\t\t\t\t\tYou can use it as a variable pair like this: \n\t\t\t\t\t\t\t {item_options:select:YOUR_FIELD_NAME}\n\t\t\t\t\t\t\t\t<option value=\"{option}\">{option_name} $ {price}</option>\n\t\t\t\t\t\t\t{/item_options:select:YOUR_FIELD_NAME}\n\t\t\t\t\t\t\toption, option_name, and price are variables associated with the Cartthrob Price Modifiers custom field type.\n\t\t\t\t\t\t\tAssociated prices are automatically figured. \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tC.\n\t\t\t\t\t\t\tOR, you can add optoions on the fly like this: \n\t\t\t\t\t\t\t<select name=\"item_options[whatevs]\">\n\t\t\t\t\t\t\t\t<option value=\"S\">Small</option>\n\t\t\t\t\t\t\t\t<option value=\"M\">Medium</option>\n\t\t\t\t\t\t\t\t<option value=\"L\">Large</option>\n\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tD. \n\t\t\t\t\t\t\tOR This: \n\t\t\t\t\t\t\t{item_options:select:size class=\"size_box\" values=\"S:Small|M:Medium|L:Large\" attr:rel=\"external\"}\n\t\t\t\t\t\t\tIn both option C and D above, prices aren't modified dynamically. \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tThere are lots of ways to use the item_options variable. It's one of the most powerful features of CartThrob, \n\t\t\t\t\t\t\tbut possibly a bit complicated to grasp at first. Please feel free to post questions in the CartThrob forums\n\t\t\t\t\t\t\t--}\n\t\t\t\t\t\t{item_options:select:product_size}\n\t\t\t\t\t\t\t<option value=\"{option}\">{option_name} {price}</option>\n\t\t\t\t\t\t{/item_options:select:product_size}\n\t\t\t\t\t</p>\n\t\t\t{/exp:cartthrob:add_to_cart_form}\n\t\t{/exp:weblog:entries}\n\t</div>\n\n\t{!-- VIEW CART CONTENTS / UPDATE QUANTITIES --}\n\t<div class=\"store_block\">\n\t<h2>Cart Contents</h2>\n\t{!-- cart_items_info outputs information about your current cart, including products in the cart, weight, and prices. --}\n\t{exp:cartthrob:cart_items_info}\n\t\t{if no_results}\n\t\t <p>There is nothing in your cart</p>\n\t\t{/if}\n\t\t{!-- outputting data that's only applicable for the first item. --}\n\t\t{if first_row}\n\t\t\t{!-- update_cart_form allows you to edit the information of one or more items in the cart at the same time\n\t\t\t\tas well as save customer information, and shipping options. --}\n \t\t{exp:cartthrob:update_cart_form \n\t\t\t\treturn=\"{template}/index\"\n\t\t\t\t}\n\t\t\t <table>\n\t\t\t <thead>\n\t\t\t <tr>\n\t\t\t <td>Item</td>\n\t\t\t <td colspan=\"2\">Quantity</td>\n\t\t\t </tr>\n\t\t\t </thead>\n\t\t\t <tbody>\n\t\t{/if}\n\t\t\t <tr>\n\t\t\t\t\t\t{!-- The item_options field outputs information about a configured item option \n\t\t\t\t\t\t\tany option input with the add_to_cart_form can be output using the item_options variable\n\t\t\t\t\t\t\t{item_options:YOUR_FIELD_NAME} will output the option value. \n\t\t\t\t\t\t\t{item_options:YOUR_FIELD_NAME:option_name} will output the option text. \n\t\t\t\t\t\t\t--}\n\t\t <td><strong>{title}</strong>: {item_options:select:product_size row_id=\"yes\"}\n\t\t\t\t\t\t{!-- These variables are just some of the cart_items_info variables --}\n\t\t\t\t\t\t<br />Price with options: {item_price} x {quantity} = {item_subtotal}\n\t\t\t\t\t\t</td>\n\t\t <td>\n\t\t\t\t\t\t\t\t{!-- you can reference products by entry_id and row_id. If you sell configurable \n\t\t\t\t\t\t\t\t\titems (like t-shirts with multiple sizes) you should use row_id to edit and \n\t\t\t\t\t\t\t\t\tdelete items, otherwise, all items with that entry id\n\t\t\t\t\t\t\t\t\tare affected, regardless of configuration --}\n\t \t<input type=\"text\" name=\"quantity[{row_id}]\" size=\"2\" value=\"{quantity}\" />\n\t\t </td>\n\t\t <td>\n\t\t\t\t\t\t\t{!-- This deletes one item (row_id) at a time--}\n\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"delete[{row_id}]\"> Delete this item\n\t\t </td>\n\t\t </tr>\n\t\t{!-- outputting data that's only applicable for the last item. --}\n\t\t{if last_row}\n\t\t\t <tr>\n\t\t\t <td>\n\t\t\t\t\t\t\t\t{!-- these are just some of the variables available within the cart_items_info tag --}\n\t\t\t <p>Subtotal: {cart_subtotal}<br />\n\t\t\t Shipping: {cart_shipping}<br />\n\t\t\t Tax: {cart_tax}<br /> \n\t\t\t\t\t\t\t\t{!--tax is updated based on user's location. To create a default tax price, set a default tax region in the backend --}\n\t\t\t <strong>Total: {cart_total}</strong></p>\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{!-- total quantity of all items in cart --}\n\t\t\t\t\t\t\t\tTotal Items: {exp:cartthrob:total_items_count}<br />\n\t\t\t\t\t\t\t\t{!-- total items in cart --}\n\t\t\t\t\t\t\t\tTotal Unique Items: {exp:cartthrob:unique_items_count}</p>\n\t\t\t </td>\n\t\t\t <td colspan=\"2\"> </td>\n\t\t\t\n\t\t\t </tr>\n\t\t\t </tbody>\n\t\t\t </table>\n\t\t\t\t{!-- a clear_cart input can be used to remove all items in the cart --}\n\t\t\t <input type=\"submit\" name=\"clear_cart\" value=\"Empty Cart\" />\n\t\t\t\n\t\t\t <input type=\"submit\" value=\"Update Cart\" />\n\t\t\t\t{/exp:cartthrob:update_cart_form}\n\t\t\t\n\t\t{/if}\n\t{/exp:cartthrob:cart_items_info}\n\t</div>\n\n\t{!-- CHECKOUT --}\n\t<div class=\"store_block\">\n\t\t<h2>Checkout</h2>\n\t\t{!-- checkout_form tag outputs a checkout form--}\n\t\t{exp:cartthrob:checkout_form \n\t\t\tgateway=\"dev_template\"\n\t\t\treturn=\"{template}/order_complete\"}\n\t\t\t{!-- The gateway_fields template variable to output fields required by your currently selected gateway \n\t\t\t\twhat you see on the front end changes based on the gateway's requirements.--}\n\t\t\t{gateway_fields}\n\t\t\t<input type=\"submit\" value=\"Checkout\" />\n\t\t{/exp:cartthrob:checkout_form}\n\t</div>\n\t<div class=\"store_block\">\n\t\t<h2>Tags used in this template</h2>\n\t\t<ul>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/add_to_cart_form\">add_to_cart_form</a></li>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/add_to_cart_form/#var_item_options:select:your_option_name\">add_to_cart_form: item_options</a></li>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/cart_items_info\">cart_items_info</a></li>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/cart_items_info/#var_item_options:your_option\">cart_items_info: item_options</a></li>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/checkout_form\">checkout_form</a></li>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/submitted_order_info\">submitted_order_info</a></li>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/update_cart_form\">update_cart_form</a></li>\n\t\t</ul>\n\t\t<h2>Concepts used in this template</h2>\n\t\t<ul>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/sub_pages/price_modifiers/\">Price Modifiers</a></li>\n\t\t</ul>\n\t</div>\n\t<div class=\"store_block\">\n\t\t{embed=includes/.footer}\n\t</div>\n\n</body>\n</html>\t\t]]>\n\t\t</template>\n\t</template_group>\n\t<template_group group_name='cart_donations' group_order='3' is_site_default='n' is_user_blog='n'>\n\t\t<template template_name='index' save_template_file='n' template_type='webpage' template_notes='' edit_date='' last_author_id='4' cache='n' refresh='0' no_auth_bounce='' enable_http_auth='n' allow_php='n' php_parse_location='o' hits=''>\n\t\t<![CDATA[\n{assign_variable:template=\"cart_donations\"}\n{!-- DELETE A PRODUCT --}\n{if segment_2==\"delete\"}\n{!-- The delete_from_cart tag deletes items. \n\tIn this case it is only called if segment_2 is \"delete\"\n\tif used on a page with other tags, place it towards the top of the page. \n\t --}\n\t{exp:cartthrob:delete_from_cart delete_all=\"yes\" row_id=\"{segment_3}\"}\n{/if}\n{embed=includes/.header title=\"Taking Donations\" }\n\n</head>\n<body>\n\t\n\t<h1>Taking Donations</h1>\n\t<p>This page shows an example of how to take donations of any amount</p>\n\t{!-- ORDER COMPLETE MESSAGES --}\n\t{!-- The \"return\" paramater of the checkout form below is set back to this page with \"order_complete\" in the URL. \n\t\tThis saves creating a template specifically to handle order info. --}\n\t{if segment_2==\"order_complete\"}\n\t\t{!-- the submitted_order_info tag returns information from the last attempted order. --}\n\t\t{exp:cartthrob:submitted_order_info}\n\t\t <div class=\"store_block\">\n\t\t\t\t{if authorized}\n\t\t\t\t\tYour transaction is complete!<br />\n\t\t\t Transaction ID: {transaction_id}<br />\n\t\t\t Your total: {cart_total}<br />\n\t\t\t Your order ID: {order_id}\n\t\t\t {if:elseif declined}\n\t\t\t Your credit card was declined: {error_message}\n\t\t\t {if:elseif failed}\n\t\t\t Your payment failed: {error_message}\n\t\t\t {/if}\n\t\t\t</div>\n\t\t{/exp:cartthrob:submitted_order_info}\n\t{/if}\n\n\t{!-- ADD A PRODUCT --}\n\n <div class=\"store_block\">\n\t<h2>Make a Donation</h2>\n\t{exp:cartthrob:add_to_cart_form \n\t return=\"{template}/index\" \n\t\tallow_user_price=\"yes\"\n\t\ttitle=\"Donation\"\n\t\tno_shipping=\"yes\"\n\t\tno_tax=\"yes\"\n\t on_the_fly=\"true\" \n\t\t}\n\t\t<p>\n\t\t\t\n\t\t\tDonation Amount: $<input type=\"text\" maxlength=\"7\" size=\"5\" name=\"price\"> \n\t\t\t{!-- Adding a personal_message to the donation. No field called personal_message exists,\n\t\t\t\tbut if you are using the \"Cartthrob Order Items\" custom field type in your Orders Weblog... \n\t\t\t\tthis message will still be dynamically added to the order data. \n\t\t\t\tSee the add_to_cart_form for more details\n\t\t\t\t --}\n\t\t\tDonation Note: {item_options:input:personal_message value=\"\" }<br />\n\t\t</p>\n\t <input type=\"submit\" value=\"Submit\" />\n\t{/exp:cartthrob:add_to_cart_form}\n\t</div>\n\n\n\t{!-- VIEW CART CONTENTS / UPDATE QUANTITIES --}\n\t<div class=\"store_block\">\n\t\t<h2>Cart Contents</h2>\n\t\t\n\t{!-- cart_items_info outputs information about your current cart, including products in the cart, weight, and prices. --}\n\t{exp:cartthrob:cart_items_info}\n\t\t{if no_results}\n\t\t<p>Your cart is empty</p>\n\t\t{/if}\n\t\t{!-- outputting data that's only applicable for the first item. --}\n\t\t{if first_row}\n\t\t\t<h2>Thank You.</h2>\n\t\t\t<p>Thank you for your donation commitment, please pay for your donation now.</p>\n\t\t{/if}\n\t\t<p>Title: {title} <br />\n\n\t\t\tPersonal Message: {item_options:personal_message}<br />\n\t\t\t{!-- The delete URL links back to this page. \n\t\t\tThe segments activate the delete_from_cart tag at the top of this template.--}\n\t\t\t<a href=\"{path={template}/delete/{row_id}}\">Delete</a><br />\n\t\t\t</p>\n\t\t\n\t\t{if last_row}\n\t\t\t{!-- these are just some of the variables available within the cart_items_info tag --}\n\t\t\t<p><strong>Total: {cart_total}</strong></p>\n\t\t{/if}\n\t{/exp:cartthrob:cart_items_info}\n\t</div>\n\n\t{!-- CHECKOUT --}\n\t<div class=\"store_block\">\n\t<h2>Checkout</h2>\n\t{!-- the checkout_form outputs a checkout form--}\n\t{!-- overriding the chosen gateway with the the dev_template gateway here --}\n\t{exp:cartthrob:checkout_form gateway=\"dev_template\" return=\"{template}/order_complete\"}\n\t\t{!-- The gateway_fields template variable to output fields required by your currently selected gateway \n\t\t\twhat you see on the front end changes based on the gateway's requirements.--}\n\t\t{gateway_fields}\n\t\t<input type=\"submit\" value=\"Checkout\" />\n\t{/exp:cartthrob:checkout_form}\n\t</div>\n\t\n\t<div class=\"store_block\">\n\t\t<h2>Tags used in this template</h2>\n\t\t<ul>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/add_to_cart_form\">add_to_cart_form</a></li>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/cart_items_info\">cart_items_info</a></li>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/checkout_form\">checkout_form</a></li>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/delete_from_cart\">delete_from_cart</a></li>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/submitted_order_info\">submitted_order_info</a></li>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/update_cart_form\">update_cart_form</a></li>\n\t\t</ul>\n\t\t\n\t\t<h2>Concepts used in this template</h2>\n\t\t<ul>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/sub_pages/purchased_items_overview\">Purchased Items Weblog</a></li>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/sub_pages/orders_overview\">Orders Weblog</a></li>\n\t\t</ul>\n\t</div>\n\t<div class=\"store_block\">\n\t\t{embed=includes/.footer}\n\t</div>\n\n</body>\n</html>\t\t]]>\n\t\t</template>\n\t</template_group>\n\t<template_group group_name='cart_software' group_order='4' is_site_default='n' is_user_blog='n'>\n\t\t<template template_name='index' save_template_file='n' template_type='webpage' template_notes='' edit_date='' last_author_id='4' cache='n' refresh='0' no_auth_bounce='' enable_http_auth='n' allow_php='n' php_parse_location='o' hits=''>\n\t\t<![CDATA[\n{if segment_2==\"download_file\"}{exp:cartthrob:download_file encrypted=\"yes\" file=\"{segment_3}\" member_id=\"{segment_4}\" }{/if}\n{!-- it's usually a good idea to put a download_file link on its own page at the very top because nothing else is output when a download link is activated. \n\tfor this demo everything we need is placed on the same template to make it easier to see everything at once. \n\tThe view_download_link tag automatically encrypts content, so if you use that to generate your download links, you should always set encrypted to true/yes/1. \n--}{assign_variable:template=\"cart_software\"}\n{embed=includes/.header title=\"Software Store\" }\n\n</head>\n<body>\n\t{!-- DELETE A PRODUCT --}\n\t{if segment_2==\"delete\"}\n\t{!-- The delete_from_cart tag deletes a product. \n\t\tIn this case it is only called if segment_2 is \"delete\"\n\t\tif used on a page with other tags, place it towards the top of the page. \n\t\t --}\n\t\t{exp:cartthrob:delete_from_cart delete_all=\"yes\" row_id=\"{segment_3}\"}\n\t{/if}\n\t\n\t<h1>Software Store</h1>\n\t<p>This page shows an example of how you can sell & protect your downloadable products</p>\n\t{!-- ORDER COMPLETE MESSAGES --}\n\t{!-- The \"return\" paramater of the checkout form below is set back to this page with \"order_complete\" in the URL. \n\t\tThis saves creating a template specifically to handle order info. --}\n\t{if segment_2==\"order_complete\"}\n\t\t{!-- the submitted_order_info tag returns information from the last attempted order. --}\n\t\t{exp:cartthrob:submitted_order_info}\n\t\t <div class=\"store_block\">\n\t\t\t\t{if authorized}\n\t\t\t\t\tYour transaction is complete!<br />\n\t\t\t Transaction ID: {transaction_id}<br />\n\t\t\t Your total: {cart_total}<br />\n\t\t\t Your order ID: {order_id}\n\t\t\t {if:elseif declined}\n\t\t\t Your credit card was declined: {error_message}\n\t\t\t {if:elseif failed}\n\t\t\t Your payment failed: {error_message}\n\t\t\t {/if}\n\t\t\t</div>\n\t\t{/exp:cartthrob:submitted_order_info}\n\t{/if}\n\n\t<div class=\"store_block\">\n\t\t<h2>Your Previous Software Purchases</h2>\n\t\t{exp:weblog:entries weblog=\"purchased_items\" author=\"CURRENT_USER\" search:purchased_product_download_url=\"not IS_EMPTY\"}\n\t\t\t{if no_results}\n\t\t\t\t<h3>You have not purchased any software, but here's a link anyway</h3>\n\t\t\t\t{!-- this is where you would add a link to the file the customer just purchased \n\t\t\t\tto keep things simple, i've just added a link to a file that ships with CartThrob so you can test the download & encryption. \n\t\t\t\tYou can save information about individual items in a purchased_items weblog, or complete orders in an orders weblog.\n\t\t\t\t--}\n\t\t\t\t<a href=\"{exp:cartthrob:view_download_link \n\t\t\t\t\ttemplate='{path={template}/download_file}' \n\t\t\t\t\tfile ='{path=themes/cp_themes/default/cartthrob/images/cartthrob_logo_bg.jpg}' \n\t\t\t\t\tmember_id='{logged_in_member_id}'}\">Download</a>\n\t\t\t\t<br />\n\t\t\t{/if}\n\t\t\t\n\t\t\t<a href=\"{exp:cartthrob:view_download_link \n\t\t\t\ttemplate='{path={template}/download_file}' \n\t\t\t\tfile ='{path=images/uploads/{purchased_product_download_url}}' \n\t\t\t\tmember_id='{logged_in_member_id}'}\"><strong>Download</strong> <em>{title}</em> </a><br />\n\t\t{/exp:weblog:entries}\n\t</div>\t\n\t{!-- ADD A PRODUCT --}\n <div class=\"store_block\">\n\t<h2>Add Products</h2>\n\t{!-- outputting products stored in one of the \"products\" weblogs. These are exactly the same as normal \n\t\tproduct weblogs, so the weblog names may be different from what is listed below --}\n\t{exp:weblog:entries weblog=\"products\" limit=\"10\"}\n\t\t{!-- The add_to_cart_form adds 1 or more of a product to the cart --}\n\t\t{!-- checking to see if this product has any content in the product_download_url custom field --}\n\t\t{if product_download_url}\n\t\t\t{exp:cartthrob:add_to_cart_form \n\t\t\t\tentry_id=\"{entry_id}\" \n\t\t\t\treturn=\"{template}/index\"}\n\t\t\t\t\t<p>Product name: {title}<br />\n\t\t\t\t\tPrice: ${product_price}<br />\n\t\t\t\t\tQuantity: <input type=\"text\" name=\"quantity\" size=\"5\" value=\"\" /><br />\n\t\t\t\t\t<input type=\"hidden\" name=\"item_options[purchased_product_download_url]\" value=\"{product_download_url}\" />\n\t\t\t\t\t{!-- this field gathers information for the purchased items weblog's custom field call purchased_product_download_url \n\t\t\t\t\t\tIf you do something similar, you can name the field anything you want, \n\t\t\t\t\t\tas long as you add the field name as a key to the item options input field --}\n\t\t\t\t\n\t\t\t\t\t<input type=\"submit\" value=\"Add to Cart\">\n\t\t\t\t\t</p>\n\t\t\t{/exp:cartthrob:add_to_cart_form}\n\t\t{/if}\n\t{/exp:weblog:entries}\n\t</div>\n\n\t{!-- VIEW CART CONTENTS / UPDATE QUANTITIES --}\n\t<div class=\"store_block\">\n\t<h2>Cart Contents</h2>\n\t{!-- cart_items_info outputs information about your current cart, including products in the cart, weight, and prices. --}\n\t{exp:cartthrob:cart_items_info}\n\t\t{if no_results}\n\t\t <p>There is nothing in your cart</p>\n\t\t{/if}\n\t\t{!-- outputting data that's only applicable for the first item. --}\n\t\t{if first_row}\n\t\t\t <table>\n\t\t\t <thead>\n\t\t\t <tr>\n\t\t\t <td>Item</td>\n\t\t\t <td colspan=\"2\">Quantity</td>\n\t\t\t </tr>\n\t\t\t </thead>\n\t\t\t <tbody>\n\t\t{/if}\n\t\t\t <tr>\n\t\t <td>{title}</td>\n\t\t <td>\n\t\t </td>\n\t\t <td>\n\t\t\t\t\t\t\t{!-- This URL links back to this page. \n\t\t\t\t\t\t\t\tThe segments activate the delete_from_cart tag at the top of this template.--}\n\t\t\t\t\t\t\t<a href=\"{path={template}/delete/{row_id}}\">Delete</a>\n\t\t </td>\n\t\t </tr>\n\t\t{if last_row}\n\t\t{!-- outputting data that's only applicable for the last item. --}\n\t\t\t <tr>\n\t\t\t <td>\n\t\t\t\t\t\t\t\t{!-- these are just some of the variables available within the cart_items_info tag --}\n\t\t\t <p>Subtotal: {cart_subtotal}<br />\n\t\t\t Shipping: {cart_shipping}<br />\n\t\t\t Tax: {cart_tax}<br /> \n\t\t\t\t\t\t\t\t{!--tax is updated based on user's location. To create a default tax price, set a default tax region in the backend --}\n\t\t\t <strong>Total: {cart_total}</strong></p>\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{!-- total quantity of all items in cart --}\n\t\t\t\t\t\t\t\tTotal Items: {exp:cartthrob:total_items_count}<br />\n\t\t\t\t\t\t\t\t{!-- total items in cart --}\n\t\t\t\t\t\t\t\tTotal Unique Items: {exp:cartthrob:unique_items_count}</p>\n\t\t\t </td>\n\t\t\t <td colspan=\"2\"> </td>\n\t\t\t\n\t\t\t </tr>\n\t\t\t </tbody>\n\t\t\t </table>\n\t\t\t <input type=\"submit\" value=\"Update Cart\" />\n\t\t{/if}\n\t{/exp:cartthrob:cart_items_info}\n\t</div>\n\n\t{!-- CHECKOUT --}\n\t<div class=\"store_block\">\n\t<h2>Checkout</h2>\n\t{!-- the checkout_form outputs a checkout form--}\n\t{!-- overriding the chosen gateway with the the dev_template gateway here --}\n\t{exp:cartthrob:checkout_form gateway=\"dev_template\" return=\"{template}/order_complete\"}\n\t\t{!-- The gateway_fields template variable to output fields required by your currently selected gateway \n\t\t\twhat you see on the front end changes based on the gateway's requirements.--}\n\t\t{gateway_fields}\n\t\t<input type=\"submit\" value=\"Checkout\" />\n\t{/exp:cartthrob:checkout_form}\n\t</div>\n\t\n\t<div class=\"store_block\">\n\t\t<h2>Tags used in this template</h2>\n\t\t<ul>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/add_to_cart_form\">add_to_cart_form</a></li>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/cart_items_info\">cart_items_info</a></li>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/checkout_form\">checkout_form</a></li>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/delete_from_cart\">delete_from_cart</a></li>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/download_file\">download_file</a></li>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/submitted_order_info\">submitted_order_info</a></li>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/update_cart_form\">update_cart_form</a></li>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/tags_detail/view_download_link\">view_download_link</a></li>\n\t\t</ul>\n\t\t<h2>Concepts used in this template</h2>\n\t\t<ul>\n\t\t\t<li><a href=\"http://cartthrob.com/docs/sub_pages/purchased_items_overview\">Purchased Items Weblog</a></li>\n\t\t</ul>\n\t</div>\n\t<div class=\"store_block\">\n\t\t{embed=includes/.footer}\n\t</div>\n\n</body>\n</html>\t\t]]>\n\t\t</template>\n\t</template_group>\n\t<template_group group_name='includes' group_order='6' is_site_default='n' is_user_blog='n'>\n\t\t<template template_name='index' save_template_file='n' template_type='webpage' template_notes='' edit_date='' last_author_id='0' cache='n' refresh='0' no_auth_bounce='' enable_http_auth='n' allow_php='n' php_parse_location='o' hits='' />\n\t\t<template template_name='.header' save_template_file='n' template_type='webpage' template_notes='' edit_date='' last_author_id='1' cache='n' refresh='0' no_auth_bounce='' enable_http_auth='n' allow_php='n' php_parse_location='o' hits=''>\n\t\t<![CDATA[\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\n\"http://www.w3.org/TR/html4/strict.dtd\">\n<head>\n\t<title>{embed:title}</title>\n\t<style type=\"text/css\">\n\tbody{\n\t\t\tfont: 11px \"Lucida Grande\", Lucida, Verdana, sans-serif;\n\t\t}\n\t\th1{\n\t\t\tfont-size: 18px;\n\t\t\tfont-weight: bold;\n\t\t}\n\t\th2{\n\t\t\tfont-size: 16px;\n\t\t\tfont-weight: bold;\n\t\t}\n\t\th3{\n\t\t\tfont-size: 13px;\n\t\t\tfont-weight: bold;\n\t\t}\n\t\th4{\n\t\t\tfont-size: 12px;\n\t\t\tfont-weight: bold;\n\t\t}\n\t\t.store_block{\n\t\t\tpadding:12px;\n\t\t\tmargin-top: 12px;\n\t\t\tmargin-bottom:12px;\n\t\tbackground-color: #e1fefd;\n\t}\n\t</style>\t\t]]>\n\t\t</template>\n\t\t<template template_name='.footer' save_template_file='n' template_type='webpage' template_notes='' edit_date='' last_author_id='1' cache='n' refresh='0' no_auth_bounce='' enable_http_auth='n' allow_php='n' php_parse_location='o' hits=''>\n\t\t<![CDATA[\n<h2>Other Store Examples</h2>\n<ul>\n<li><a href=\"{path=cart_donations}\">Taking Donations</a></li>\n<li><a href=\"{path=cart_single_page_checkout}\">Single Page Checkout</a></li>\n<li><a href=\"{path=cart_software}\">Selling Software</a></li>\n<li><a href=\"{path=cart_tshirt}\">Selling Configurable Products (t-shirts)</a></li>\n</ul>\n<h2>Admin</h2>\n<ul>\n<li><a href=\"{path=reports}\">Admin Reports</a></li>\n</ul>\t\t]]>\n\t\t</template>\n\t\t<template template_name='payment_code_override' save_template_file='n' template_type='webpage' template_notes='' edit_date='' last_author_id='1' cache='n' refresh='0' no_auth_bounce='' enable_http_auth='n' allow_php='n' php_parse_location='o' hits=''>\n\t\t<![CDATA[\n<h1>Paypal Standard</h1>\n\t<fieldset class=\"billing\" >\n\t\t<label for=\"first_name\" class=\"required\">\n\t\t\tFirst Name\n\t\t</label><input type=\"text\" name=\"first_name\" />\n\t\t\n\t\t<label for=\"last_name\">\n\t\t\tLast Name\n\t\t</label><input type=\"text\" name=\"last_name\" />\n\t\t\n\t\t<label for=\"email_address\">\n\t\t\tEmail Address\n\t\t</label><input type=\"text\" name=\"email_address\" />\n\t\t\n\t\t<label for=\"address\">\n\t\t\tAddress\n\t\t</label><input type=\"text\" name=\"address\" />\n\t\t\n\t\t<label for=\"address2\">\n\t\t\tAddress 2\n\t\t</label><input type=\"text\" name=\"address2\" />\n\t\t\n\t\t<label for=\"city\">\n\t\t\tCity\n\t\t</label><input type=\"text\" name=\"city\" />\n\t\t\n\t\t<label for=\"state\">\n\t\t\tState\n\t\t</label><input type=\"text\" name=\"state\" />\n\t\t\n\t\t<label for=\"zip\">\n\t\t\tZip\n\t\t</label><input type=\"text\" name=\"zip\" />\n\t\t\n\t\t<label for=\"country_code\">\n\t\t\tCountry Code\n\t\t</label><input type=\"text\" name=\"country_code\" />\n\n<label><input type=\"checkbox\" value=\"1\" name=\"use_billing_info\" /> Use Billing Info?</label>\n\t\t\n\t\t<label for=\"description\">\n\t\t\tDescription\n\t\t</label><input type=\"text\" name=\"description\" />\n\t</fieldset>\n\t\t\t]]>\n\t\t</template>\n\t\t<template template_name='debug' save_template_file='n' template_type='webpage' template_notes='' edit_date='' last_author_id='1' cache='n' refresh='0' no_auth_bounce='61' enable_http_auth='n' allow_php='n' php_parse_location='o' hits=''>\n\t\t<![CDATA[\n{!-- uncomment to activate--}{!--{exp:cartthrob:debug_info}--}\t\t]]>\n\t\t</template>\n\t</template_group>\n</create>\n<?php\n\t\t$content = ob_get_contents();\n\t\t\n\t\tob_end_clean();\n\t\t\n\t\treturn $content;\n\t}",
"function parserFeed($feedURL) {\r\n\tglobal $feedItems;\r\n\tglobal $itemsByDate;\r\n\t\r\n\t$rss = simplexml_load_file($feedURL);\r\n\t$feedTitle = $rss->channel->title;\r\n\t$i = 0;\r\n\t\r\n\t\r\n\tforeach ($rss->channel->item as $feedItem) {\r\n\t\t$i++;\r\n\t\t$myDate = ($feedItem->pubDate);\r\n\t\t$dateForm = explode(\" \", $myDate);\r\n\t\t$myTimestamp = strtotime($feedItem->pubDate);\r\n\t\t$parentClassName;\r\n\t\t$imageTag;\r\n\t\t$socialTag = \"\";\r\n\t\t\r\n\t\t//Get the class name depending on if Tumblr or SelectB\r\n\t\tif($feedTitle == \"Bunmblr\"){ $parentClassName = \"tumblr\"; $socialTag = \"<span class='socialIcon'>T</span>\";}\r\n\t\telseif($feedTitle == \"Select B\") {$parentClassName = \"selectB\"; $socialTag = \"<span class='socialIcon'>w</span>\";}\r\n\t\t\r\n\t\t//Get the HTML content of post\r\n\t\t$itemContent = $feedItem->description;\r\n\t\t\r\n\t\t//Get Photo from content\r\n\t\t$html = str_get_html($itemContent);\r\n\t\t$imageTag = $html->find('img', 0);\r\n\t\t$imageURL = $imageTag->src;\r\n\t\t$videoTag = $html->find('object', 0);\r\n\t\t\r\n\r\n\t\t//Add HTML format to $itemFormat\r\n\t\t\r\n\t\t$itemFormat = \"\";\r\n\t\tif($imageTag){ //If content contains and image, set as background image\r\n\t\t\t$itemFormat .= \"<div style='background: url($imageURL); background-position: center;' class='rssItem photo $parentClassName' data-date='$myTimestamp' data-img='$imageURL'>\";\r\n\t\t}\r\n\t\telseif($videoTag){\r\n\t\t\t$itemFormat .= \"<div class='rssItem video $parentClassName' data-date='$myTimestamp' data-img='$imageURL'>\";\r\n\t\t}\r\n\t\telse{ //If there's no image\r\n\t\t\t$itemFormat .= \"<div class='rssItem $parentClassName' data-date='$myTimestamp'>\";\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t$itemFormat .= \"<div><a href='$feedItem->link' title='$feedItem->title'><h4 class='itemTitle'> $feedItem->title</h4><div class='itemContent'></div></a><h5 class='itemDate'>\".date(\"m/d/Y\",$myTimestamp).\"</h5>\r\n\t\t<h6 class='itemPosted'>Posted \".howLongAgo($myTimestamp).\"</h6>\r\n\t\t<h6 class='itemFeedTitle'>$feedTitle</h6></div>$socialTag</div>\";\r\n\t\t\r\n\t\t//Add to Array\r\n\t\tarray_push($feedItems, $itemFormat);\r\n\t\t$itemsByDate[$myTimestamp] = $itemFormat;\r\n\t\tif($i >= 3) break;\r\n\t}\r\n\t\r\n}",
"function mc_format_rss( $events ) {\n\tif ( is_array( $events ) && ! empty( $events ) ) {\n\t\t$template = PHP_EOL . \"<item>\n\t\t\t<title>{rss_title}</title>\n\t\t\t<link>{details_link}</link>\n\t\t\t<pubDate>{rssdate}</pubDate>\n\t\t\t<dc:creator>{author}</dc:creator>\n\t\t\t<description><![CDATA[{rss_description}]]></description>\n\t\t\t<ev:startdate>{dtstart}</ev:startdate>\n\t\t\t<ev:enddate>{dtend}</ev:enddate>\n\t\t\t<content:encoded><![CDATA[<div class='vevent'>\n\t\t\t<h1 class='summary'>{rss_title}</h1>\n\t\t\t<div class='description'>{rss_description}</div>\n\t\t\t<p class='dtstart' title='{ical_start}'>Begins: {time} on {date}</p>\n\t\t\t<p class='dtend' title='{ical_end}'>Ends: {endtime} on {enddate}</p>\n\t\t\t<p>Recurrance: {recurs}</p>\n\t\t\t<p>Repetition: {repeats} times</p>\n\t\t\t<div class='location'>{rss_hcard}</div>\n\t\t\t{rss_link_title}\n\t\t\t</div>]]></content:encoded>\n\t\t\t<dc:format xmlns:dc='http://purl.org/dc/elements/1.1/'>text/html</dc:format>\n\t\t\t<dc:source xmlns:dc='http://purl.org/dc/elements/1.1/'>\" . home_url() . '</dc:source>\n\t\t\t{guid}\n\t\t </item>' . PHP_EOL;\n\n\t\tif ( get_option( 'mc_use_rss_template' ) === '1' ) {\n\t\t\t$template = mc_get_template( 'rss' );\n\t\t}\n\n\t\t$charset = get_bloginfo( 'charset' );\n\t\t$output = '<?xml version=\"1.0\" encoding=\"' . $charset . '\"?>\n\t\t<rss version=\"2.0\"\n\t\t\txmlns:content=\"http://purl.org/rss/1.0/modules/content/\"\n\t\t\txmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n\t\t\txmlns:ev=\"http://purl.org/rss/1.0/modules/event/\"\n\t\t\txmlns:atom=\"http://www.w3.org/2005/Atom\"\n\t\t\txmlns:sy=\"http://purl.org/rss/1.0/modules/syndication/\"\n\t\t\txmlns:slash=\"http://purl.org/rss/1.0/modules/slash/\"\n\t\t\t>\n\t\t<channel>\n\t\t <title>' . get_bloginfo( 'name' ) . ' Calendar</title>\n\t\t <link>' . home_url() . '</link>\n\t\t <description>' . get_bloginfo( 'description' ) . ': My Calendar Events</description>\n\t\t <language>' . get_bloginfo( 'language' ) . '</language>\n\t\t <managingEditor>' . get_bloginfo( 'admin_email' ) . ' (' . get_bloginfo( 'name' ) . ' Admin)</managingEditor>\n\t\t <generator>My Calendar WordPress Plugin http://www.joedolson.com/my-calendar/</generator>\n\t\t <lastBuildDate>' . mysql2date( 'D, d M Y H:i:s +0000', current_time( 'timestamp' ) ) . '</lastBuildDate>\n\t\t <atom:link href=\"' . htmlentities( esc_url( add_query_arg( $_GET, get_feed_link( 'my-calendar-rss' ) ) ) ) . '\" rel=\"self\" type=\"application/rss+xml\" />' . PHP_EOL;\n\t\tforeach ( $events as $date ) {\n\t\t\tforeach ( array_keys( $date ) as $key ) {\n\t\t\t\t$event =& $date[ $key ];\n\t\t\t\t$array = mc_create_tags( $event );\n\t\t\t\t$output .= mc_draw_template( $array, $template, 'rss' );\n\t\t\t}\n\t\t}\n\t\t$output .= '</channel>\n\t\t</rss>';\n\n\t\treturn mc_strip_to_xml( $output );\n\t} else {\n\n\t\treturn false;\n\t}\n}",
"private function parseTemplate() {\r\n\t\t$template = $this->xmlConfig->xpath(self::CONFIG_TEMPLATE);\r\n\t\t$this->template = (count($template) > 0 && trim((string)$template[0]) != \"\") ? trim((string)$template[0]) : $this->getDefaultTemplate();\r\n\t}",
"function displayRSSFeed() {\n\t\t$rss_content = \"\";\n\n\t\t$rssTemplateFile = $this->conf['rssTemplateFile'];\n\t\tif (!$rssTemplateFile)\n\t\t\treturn $this->pi_getLL('no_rss_template_file',\"No RSS Template File configured.\");\n\n\t\t// current page where forum is\n\t\t$gotoPageID = $this->config['previewRSS_backPID'] ? $this->config['previewRSS_backPID'] : $this->id;\n\n\t\t// this is set for enabling relative URLs for images and links in the RSS feed.\n\t\t$sourceURL = $this->conf['xml.']['rss.']['source_url'] ? $this->conf['xml.']['rss.']['source_url'] : t3lib_div::getIndpEnv('TYPO3_SITE_URL');\n\n\t\t// load in template\n\t\t$rssTemplateCode = $this->cObj->fileResource($rssTemplateFile);\n\t\t$rssTemplate = $this->cObj->getSubpart($rssTemplateCode, '###TEMPLATE_RSS2###');\n\n\t\t// fill in template\n\t\t$dataArray = array('CHANNEL_TITLE','CHANNEL_LINK','CHANNEL_DESCRIPTION','LANGUAGE','NAMESPACE_ENTRIES','COPYRIGHT','DOCS','CHANNEL_CATEGORY','MANAGING_EDITOR','WEBMASTER','CHANNEL_IMAGE','TTL');\n\t\tfor ($i = 0; $i < count($dataArray); $i++) {\n\t\t\t$rssField = $dataArray[$i];\n\t\t\t$linkField = strtolower(str_replace('CHANNEL_','',$rssField));\n\t\t\tif ($val = $this->conf['xml.']['rss.'][strtolower($rssField)]) {\n\t\t\t\t$markerArray['###'.strtoupper($rssField).'###'] = '<'.$linkField.'>'.$val.'</'.$linkField.'>';\n\t\t\t}\n\t\t}\n\t\t$charset = ($GLOBALS['TSFE']->metaCharset?$GLOBALS['TSFE']->metaCharset:'iso-8859-1');\n\t\t$markerArray['###XML_CHARSET###'] = ' encoding=\"'.$charset.'\"';\n\n\t\t// fill in defaults...if not set\n\t\t$markerArray['###GENERATOR###'] = $this->conf['xml.']['rss.']['generator'] ? $this->conf['xml.']['rss.']['generator'] : 'TYPO3 v4 CMS';\n\t\t$markerArray['###XMLNS###'] = $this->conf['xml.']['rss.']['xmlns'];\n\t\t$markerArray['###XMLBASE###'] = 'xml:base=\"'.$sourceURL.'\"';\n\t\t$markerArray['###GEN_DATE###'] = date('D, d M Y h:i:s T');\n\t\tif (!$markerArray['###CHANNEL_TITLE###'])\n\t\t\t$markerArray['###CHANNEL_TITLE###'] = '<title>'. ($this->config['title'] ? $this->config['title'] : $this->conf['title']) .'</title>';\n\t\tif (!$markerArray['###CHANNEL_LINK###'])\n\t\t\t$markerArray['###CHANNEL_LINK###'] = '<link>'.$sourceURL.'</link>';\n\t\t$markerArray['###CHANNEL_GENERATOR###'] = '<generator>'.$markerArray['###GENERATOR###'].'</generator>';\n\n\t\t// grab item template\n\t\t$itemTemplate = $this->cObj->getSubpart($rssTemplateCode, '###ITEM###');\n\n\t\t// grab messages\n\t\t$pidList = t3lib_div::_GP('sp') ? t3lib_div::_GP('sp') : $this->pid_list;\n\t\t$order_by = 'post_datetime DESC';\n\t\t$where = 'toplevel_uid=0 ';\n\t\t$where .= ' AND pid IN(' . $GLOBALS['TYPO3_DB']->cleanIntList($pidList) . ')';\n\t\t$where .= ' AND moderationQueue=0';\n\t\t$where .= $this->cObj->enableFields($this->postTable);\n\t\t// handle languages\n\t\t$lang = ($l = $GLOBALS['TSFE']->sys_language_uid) ? $l : '0,-1';\n\t\t$where .= ' AND sys_language_uid IN ('.$lang.') ';\n\t\t$limit = $this->config['num_previewRSS_items'] ? $this->config['num_previewRSS_items'] : 5;\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', $this->postTable, $where, '', $order_by, $limit);\n\t\tif (mysql_error()) t3lib_div::debug(array(mysql_error(), \"SELECT \".$selFields.' FROM '.$this->postTable.' WHERE '.$where.' ORDER BY '.$order_by.' LIMIT '.$limit));\n\n\t\t// fill in item\n\t\t$item_content = \"\";\n\t\t$mostRecentMsgDate = 0;\n\t\t\n\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t\t\t$itemMarker['###ITEM_TITLE###'] = '<title>'.htmlspecialchars(stripslashes($row['subject'])).'</title>';\n\t\t\t$urlParams = array();\n\t\t\t$hashParams = '';\n\t\t\tif ($this->config['allow_single_view'] != 0)\n\t\t\t\t$urlParams['tx_wecdiscussion']['single'] = $row['uid'];\n\t\t\telse\n\t\t\t\t$urlParams['tx_wecdiscussion']['showreply'] = $row['uid'];\n\t\t\t$itemMarker['###ITEM_LINK###'] = '<link>' . htmlspecialchars($this->getAbsoluteURL($gotoPageID,$urlParams,TRUE)) . '</link>';\n\n\t\t\t$msgText = $row['message'];\n\t\t\tif (is_array($this->conf['general_stdWrap.'])) {\n\t\t\t\t$msgText = str_replace(' ',' ',$msgText);\n\t\t\t\t$msgText = $this->cObj->stdWrap($this->html_entity_decode($msgText,ENT_QUOTES), $this->conf['general_stdWrap.']);\n\t\t\t}\n\t\t\t// if absRefPrefix set, then do transform so adds (because bug in TYPO3 and USER_INT)\n\t\t\tif (($absRefPrefix = $GLOBALS['TSFE']->config['config']['absRefPrefix']) && ($RTEImageStorageDir = $GLOBALS['TYPO3_CONF_VARS']['BE']['RTE_imageStorageDir'])) {\n\t\t\t\t$msgText = str_replace('\"' .$RTEImageStorageDir, '\"' . $absRefPrefix . $RTEImageStorageDir, $msgText);\n\t\t\t}\n\t\t\t// fill in item markers\t\t\t\n\t\t\t$itemMarker['###ITEM_DESCRIPTION###'] = '<description>' . htmlspecialchars(stripslashes($msgText)) . '</description>';\n\t\t\tif ($row['email'])\n\t\t\t\t$itemMarker['###ITEM_AUTHOR###'] = '<author>' . htmlspecialchars(stripslashes($row['email'])) . ' ('.htmlspecialchars(stripslashes($row['name'])).')</author>';\n\t\t\tif (!empty($row['category']) && $this->categoryListByUID[$row['category']])\n\t\t\t\t$itemMarker['###ITEM_CATEGORY###'] = '<category>' . $this->categoryListByUID[$row['category']] . '</category>';\n\t\t\t$itemMarker['###ITEM_COMMENTS###'] = '';\n\t\t\t$itemMarker['###ITEM_ENCLOSURE###'] = '';\n\t\t\t$itemMarker['###ITEM_PUBDATE###'] = '<pubDate>' . date('D, d M Y H:i:s O',$row['post_datetime']) . '</pubDate>';\n\t\t\t$itemMarker['###ITEM_GUID###'] = '<guid isPermaLink=\"true\">' . $this->getAbsoluteURL($gotoPageID,$urlParams, TRUE) . '</guid>';\n\t\t\t$itemMarker['###ITEM_SOURCE###'] = '<source url=\"' . $sourceURL . '\">' . htmlspecialchars($row['subject']) . '</source>';\n\n\t\t\tif ($mostRecentMsgDate < $row['post_datetime'])\n\t\t\t\t$mostRecentMsgDate = $row['post_datetime'];\n\n\t\t\t// generate item info\n\t\t\t$item_content .= $this->cObj->substituteMarkerArrayCached($itemTemplate,$itemMarker,array(),array());\n\t\t}\n\t\t$subpartArray['###ITEM###'] = $item_content;\n\t\tif ($mostRecentMsgDate)\n\t\t\t$markerArray['###LAST_BUILD_DATE###'] = '<pubDate>' . date('D, d M Y H:i:s O', $mostRecentMsgDate) . '</pubDate>';\n\n\t\t// then substitute all the markers in the template into appropriate places\n\t\t$rss_content = $this->cObj->substituteMarkerArrayCached($rssTemplate,$markerArray,$subpartArray, array());\n\n\t\t// clear out any empty template fields (so if ###CONTENT1### is not substituted, will not display)\n\t\t$rss_content = preg_replace('/###.*?###/', '', $rss_content);\n\n\t\t// remove blank lines\n\t\t$rss_content = preg_replace(\"/(^[\\r\\n]*|[\\r\\n]+)[\\s\\t]*[\\r\\n]+/\", \"\\n\", $rss_content);\n\n\t\t// make certain tags XHTML compliant\n\t\t$rss_content = preg_replace(\"/<(img|hr|br|input)([^>]*)>/mi\", \"<$1$2 />\", $rss_content);\n\n\t\treturn $rss_content;\n\t}",
"function ct_podcast_feed_template() {\n\tload_template( locate_template( '/lib/scripts/podcast-feed.php' ) );\n}",
"private function rss_content() {\n\n // include the config\n $config = $this->config;\n\n // get the feed url\n if (isset($config['rss_feed'])) {\n $url = $config['rss_feed'];\n }\n\n // set date format to default\n $date_format = $config['date_format'];\n\n // build the array\n $rss = new DOMDocument();\n $rss->load($url);\n $feed = array();\n\n foreach ($rss->getElementsByTagName('item') as $node) {\n $item = array (\n 'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,\n 'description' => $node->getElementsByTagName('description')->item(0)->nodeValue,\n 'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,\n 'date' => date($date_format, strtotime($node->getElementsByTagName('pubDate')->item(0)->nodeValue)),\n );\n\n array_push($feed, $item);\n }\n\n return $feed;\n\n }",
"public function parse() {\n\t\t$sxml = $this->simple_xml;\n\t\t$namespaces = $this->namespaces;\n\t\t$posts = array();\n\t\t\n\t\tforeach ($sxml->channel->item as $item) {\n\t\t\t$post = array();\n\t\t\t// Get elements in namespaces\n\t\t\t$wp_ns = $item->children($namespaces['wp']);\n\t\t\t$content_ns = $item->children($namespaces['content']);\n\t\t\t$dc_ns = $item->children($namespaces['dc']);\n\t\t\tif (isset($namespaces['wfw']))\n\t\t\t\t$wfw_ns = $item->children($namespaces['wfw']);\n\n\t\t\t$post['Title'] = (string)$item->title;\n\t\t\t$post['Link'] = (string)$item->link;\n\t\t\t$post['Author'] = (string)$dc_ns->creator;\n\t\t\t\n\t\t\t// Uses this array to check if the category to be added already exists\n\t\t\t// in the post\n\t\t\t$categories = array();\n\t\t\t// Stores all categories and tags of the post in a string var\n\t\t\t$tags = '';\n\t\t\tforeach ($item->category as $cat) {\n\t\t\t\tif (!in_array($cat, $categories)) {\n\t\t\t\t\t$categories[] = (string)$cat;\n\t\t\t\t\t$tags .= $cat.', ';\n\t\t\t\t}\t\n\t\t\t}\n\t\t\t$tags = substr($tags, 0, strlen($tags)-2);\n\t\t\t$post['Tags'] = $tags;\n\t\t\t\n\t\t\t$post['Content'] = (string)$content_ns->encoded;\n\t\t\t$post['UrlTitle'] = (string) current($wp_ns->post_name);\n\t\t\t$post['Date'] = (string)$wp_ns->post_date;\n\t\t\t\n\t\t\t// Array of comments of a post \n\t\t\t$comments = array();\n\t\t\tforeach ($wp_ns->comment as $c) {\n\t\t\t\t// each comment\n\t\t\t\t$comment = array();\n\t\t\t\t// $c is not an array but SimpleXML object\n\t\t\t\t$comment['Name'] = (string)$c->comment_author;\n\t\t\t\t$comment['Comment'] = (string)$c->comment_content;\n\t\t\t\t$comment['Created'] = (string)$c->comment_date;\n\t\t\t\t$comments[] = $comment;\n\t\t\t}\n\t\t\t$post['Comments'] = $comments;\n\t\t\t$posts[] = $post;\n\t\t}\n\t\t// Also stores posts array in the class \n\t\t// before returning \n\t\t$this->posts = $posts;\n\t\treturn $this->posts;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set last group activity | function set_group_last_activity( $group_id = null ) {
update_post_meta( $group_id, 'um_groups_last_active', current_time( 'mysql' ) );
} | [
"public function setLastGroup(?string $group): void;",
"public function setLastActivity()\n {\n $this->lastActivity = time();\n }",
"public function updateLastActivity();",
"public function updateLastActivity() {\n\t\tif($this->_hasLastActivity) {\n\t\t\t// $this->getOwner()->disableBehavior('changelog');\n\t\t\t$this->getOwner()->lastActivity = time();\n\t\t\t$this->getOwner()->update(array('lastActivity'));\t// don't use save() so it doesn't trigger beforeValidate()\n\t\t\t// $this->getOwner()->enableBehavior('changelog');\n\t\t}\n\t}",
"function bp_widget_cache_invalidate_on_group_last_activity( $meta_id, $object_id, $meta_key ) {\n\tif ( 'last_activity' === $meta_key ) {\n\t\tremove_filter( 'query', 'bp_filter_metaid_column_name' );\n\t\tdelete_site_transient( bp_widget_get_transient_key( 'BP_Groups_Widget' ) );\n\t\tadd_filter( 'query', 'bp_filter_metaid_column_name' );\n\t}\n}",
"public function setLast_visit($value){\n $this->last_visit=$value;\n }",
"public function setLastActivityDate($date);",
"function get_group_last_activity( $group_id = null, $strtotime = false ) {\n\n\t\t$last_active = get_post_meta( $group_id, 'um_groups_last_active', true );\n\n\t\tif( empty( $last_active ) ){\n\t\t\t$post = get_post( $group_id );\n\n\t\t\t$last_active = $post->post_date;\n\t\t}\n\n\t\tif( $strtotime ){\n\t\t\treturn strtotime( $last_active );\n\t\t}\n\n\t\treturn $last_active;\n\t}",
"public function UpdateLastActivity()\n\t{\n\t\tif (isset($_SESSION['timestamp']) && $_SESSION['timestamp'] - time() > 60 * 10)\n\t\t{\n\t\t\t// If it's been enough time (say, 10 minutes), generate new session ID\n\t\t\t// to help prevent session hijacking\n\t\t\tsession_regenerate_id();\n\t\t\t$_SESSION['timestamp'] = time();\n\t\t}\n\n\t\t$this->LastActivity = now();\n\t\t$this->Save();\n\t}",
"private function updateLastActivity() {\n\n return Database::update(\"session\",\n array(\n 'last_activity' => time()\n ),\n array(\n 'session_id' => $_SESSION['session_id']\n )\n );\n }",
"function group_lastupdate() {\r\n\t global $database;\r\n\r\n\t $database->database_query(\"UPDATE se_groups SET group_dateupdated='\".time().\"' WHERE group_id='{$this->group_info['group_id']}' LIMIT 1\");\r\n\t \r\n\t}",
"public function group_end();",
"public static function lastActivity()\n {\n if (self::isLoggedIn()) {\n $_SESSION['LAST_ACTIVITY'] = time();\n }\n }",
"public static function switchToLast()\n {\n $last = Auth::user()->campaign;\n if ($last) {\n self::switchCampaign(Auth::user()->campaign);\n }\n }",
"function update_last_activity( $args ) {\n\t\tglobal $bp;\n\n\t\tif ( $this->id == $args['component'] ) {\n\t\t\tif ( array_key_exists( 'item_id', $args ) ) {\n\t\t\t\tupdate_post_meta( $args['item_id'], '_bpcp_last_activity', $args['recorded_time'] );\n\t\t\t\tdo_action( 'bpcp_update_last_activity', $this->id, $args );\n\t\t\t\tdo_action( 'bpcp_' . $this->id . '_update_last_activity', $args );\n\t\t\t}\n\t\t}\n\t}",
"public function save_activity() {\n\t\t$this->update_meta( 'activity', $this->activity() );\n\t}",
"protected function _logGroupEnd() {\n\t\t--$this->_logGroup;\n\t}",
"function SetLastActivity($forumid, $id = 0)\r\n{\r\n\tglobal $UNB;\r\n\r\n\t// Clean parameters\r\n\t$forumid = intval($forumid);\r\n\t$id = intval($id);\r\n\r\n\tif (!$id)\r\n\t{\r\n\t\t$id = $this->ID;\r\n\t\t$this->LastActivity = time();\r\n\t\t$this->LastForum = intval($forumid);\r\n\t}\r\n\r\n\t// generally we don't need to remove the cache in this case, except for who-is-where list\r\n\tif ($UNB['ThisPage'] == '@users') unset($UNB['UserCache'][$id]);\r\n\r\n\treturn $this->db->ChangeRecord(array('LastActivity' => time(), 'LastForum' => $forumid), 'ID=' . $id, 'Users');\r\n}",
"public function lastUpdated($id, $group = 'default');"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Render a human readable string from a file name The original file name is rebuilt striping the extension and a set of commonly used separator characters in file or directories names. | public static function getHumanReadableName($file_name)
{
$ext = self::getExtensionName($file_name);
if (!empty($ext)) {
$file_name = str_replace('.'.$ext, '', $file_name);
}
return ucfirst(str_replace(self::$REPLACEMENT_FILENAMES_CHARS, ' ', $file_name));
} | [
"public function renderFileName()\n {\n return Html::tag($this->fileNameTag, $this->fileName, $this->fileNameOptions);\n }",
"private function seo_file_name($file_name)\n\t{\t\n\t\t\n\t\t$path_info \t\t= pathinfo($file_name);\t\t\n\t\t$info_dir_name = preg_replace(\"/[\\s]/\", \"-\", strtolower($path_info['dirname']) ); \n\t\t\n\n\t\t$info_file_name = $path_info['filename'];\n\t\t$info_file_ext \t= $path_info['extension'];\t\t\n\n\t\t$string = $info_file_name ;\n\n\t $src = 'àáâãäçèéêëìíîïñòóôõöøùúûüýÿßÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝ';\n\t $rep = 'aaaaaceeeeiiiinoooooouuuuyysAAAAACEEEEIIIINOOOOOOUUUUY';\n\t // strip off accents (assuming utf8 PHP - note strtr() requires single-byte)\n\t $string = strtr(utf8_decode($string), utf8_decode($src), $rep);\n\t // convert to lower case\n\t $string = strtolower($string);\n\t // strip all but alphanumeric, whitespace, dot, underscore, hyphen\n\t $string = preg_replace(\"/[^a-z0-9\\s._-]/\", \"\", $string);\n\t // merge multiple consecutive whitespaces, dots, underscores, hyphens\n\t $string = preg_replace(\"/[\\s._-]+/\", \" \", $string);\n\t // convert whitespaces to hyphens\n\t $string = preg_replace(\"/[\\s]/\", \"-\", $string);\n\t\t\n\t\t\n\t\tif(substr($info_dir_name,1))\n\t\t{\n\t\t\t$file_path \t= $info_dir_name.\"/\".$string.'.'.$info_file_ext;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$file_path \t= \"/\". $string.'.'.$info_file_ext;\n\t\t}\n \n\t return $file_path;\n\t}",
"private function clean_file_name() {\n\t\treturn str_replace('%5', '-', str_replace('%25', '-', str_replace('%20', '-', $this->split_image['filename'])));\n\t}",
"function format_file_name($filepath)\n{\n\tlog_debug(\"misc\", \"Executing format_file_name($filepath)\");\n\n\treturn substr(strrchr($filepath,\"/\"),1);\n}",
"public function safeName() {\n return f::safeName($this->filename());\n }",
"static function filename($name){\r\n\t\treturn ucfirst($name);\r\n\t}",
"function escape_filename($unescaped_filename) {\n // Replace all weird characters with dashes\n $string = preg_replace('/[^\\w\\-' . ($unescaped_filename ? '~_\\.' : '') . ']+/u', '-', $unescaped_filename);\n\n // Only allow one dash separator at a time (and make string lowercase)\n $string = mb_strtolower(preg_replace('/--+/u', '-', $string), 'UTF-8');\n echo $string;\n return $string;\n}",
"private function filename()\n {\n $to = str_replace(['@', '.'], ['_at_', '_'], array_keys($this->message->getTo())[0]);\n\n return str_slug($this->message->getDate().'_'.$to.'_'.$this->message->getSubject(), '_').'.html';\n }",
"function get_name_from_file($filename)\n{\n return str_replace('_',' ',get_filename_wo_extension($filename));\n}",
"function get_file_label($file) {\n\t$result = $file;\n\n\t$info = pathinfo($file);\n\tif (!empty($info['filename'])) {\n\t\t$result = preg_replace('/_/', ' ', $info['filename']);\n\t}\n\n\treturn $result;\n}",
"private function makeFileName(SplFileInfo $file)\n\t{\n\t\t$name = str_replace($this->sassDirectory.DIRECTORY_SEPARATOR, '', $file->getRealPath());\n\n\t\treturn str_replace('\\\\', '/', $name);\n\t}",
"function format_file_name($uploadFile, $key = 0)\n{\n\t//Remove Special Characters\n\t$name = preg_replace(\"/[^A-Z0-9._-]/i\", \"_\", $uploadFile[\"name\"][$key]);\n\treturn $name;\n}",
"function sanitizeFilename($name) {\r\n $limit = 100;\r\n $special_chars = array (\"#\",\"$\",\"%\",\"^\",\"&\",\"*\",\"!\",\"~\",\"‘\",\"\\\"\",\"’\",\"'\",\"=\",\"?\",\"/\",\"[\",\"]\",\"(\",\")\",\"|\",\"<\",\">\",\";\",\"\\\\\",\",\",\".\");\r\n $name = preg_replace(\"/^[.]*/\",\"\",$name); // remove leading dots\r\n $name = preg_replace(\"/[.]*$/\",\"\",$name); // remove trailing dots\r\n \r\n $lastdotpos=strrpos($name, \".\"); // save last dot position\r\n \r\n $name = str_replace($special_chars, \"\", $name); // remove special characters\r\n \r\n $name = str_replace(' ','_',$name); // replace spaces with _\r\n \r\n $afterdot = \"\";\r\n if ($lastdotpos !== false) { // Split into name and extension, if any.\r\n if ($lastdotpos < (strlen($name) - 1))\r\n $afterdot = substr($name, $lastdotpos);\r\n \r\n $extensionlen = strlen($afterdot);\r\n \r\n if ($lastdotpos < ($limit - $extensionlen) )\r\n $beforedot = substr($name, 0, $lastdotpos);\r\n else\r\n $beforedot = substr($name, 0, ($limit - $extensionlen));\r\n }\r\n else // no extension\r\n $beforedot = substr($name,0,$limit);\r\n\r\n \r\n if ($afterdot)\r\n $name = $beforedot . \".\" . $afterdot;\r\n else\r\n $name = $beforedot;\r\n \r\n return $name;\r\n\r\n}",
"public function makeName( $fileName ){\n \n $extensions = array( '.jpg', '.png', '.gif', '.bmp' );\n\n $name = str_replace( $extensions, '', $fileName );\n $name = str_replace( '-', ' ', $name );\n $name = ucwords( $name );\n return $name;\n }",
"public function prettyFilename() {\n // build a nice, user-friendly filename\n $filename = strtolower($this->etd->mods->author->last) . \"_\";\n $nonfilechars = array(\"'\", \",\"); // what other characters are likely to occur in names?\n $replace = array(); // replace all with empty strings\n $filename = str_replace($nonfilechars, $replace, $filename);\n\n switch ($this->type) {\n case \"pdf\": $filename .= \"dissertation\"; break;\n case \"original\": $filename .= \"original\"; break;\n case \"supplement\": $filename .= \"supplement\"; break;\n }\n\n // if there is more than one of this type of file, add a number\n if (count($this->etd->{$this->type . \"s\"}) > 1) $filename .= $this->rels_ext->sequence;\n\n // determine file extension based on mimetype for common/expected files\n switch ($this->file->mimetype) {\n case \"application/pdf\":\n $ext = \"pdf\"; break;\n case \"application/msword\":\n $ext = \"doc\"; break;\n case \"application/zip\":\n case \"application/x-zip\":\n $ext = \"zip\"; break;\n case \"application/rar\":\n case \"application/x-rar\":\n $ext = \"rar\"; break;\n case \"application/gzip\":\n case \"application/x-gzip\":\n $ext = \"gz\"; break;\n case \"application/vnc.ms-excel\":\n $ext = \"xls\"; break;\n case \"application/vnd.ms-excel\":\n $ext = \"xls\"; break;\n case \"application/ms-excel\":\n\t$ext = \"xlsx\"; break;\n case \"application/vnd.ms-powerpoint\":\n $ext = \"ppt\"; break;\n case \"application/powerpoint\":\n $ext = \"pptx\"; break;\n\n default:\n if (isset($this->file->filename)) { // stored original filename\n $parts = explode(\".\", basename($this->file->filename));\n $ext = $parts[count($parts)-1]; // trust user's extension from original file\n }\n }\n if (isset($ext)) $filename .= \".\" . $ext;\n return $filename;\n }",
"public function file($name) {\n return $this->kirby->roots()->templates() . DS . str_replace('/', DS, $name) . '.php';\n }",
"private function get_title_from_filename( $filename ) {\n\t\t\t// Remove unwanted characters\n\t\t\treturn str_replace( array(\n\t\t\t\t'_',\n\t\t\t\t'-',\n\t\t\t\t'.'\n\t\t\t) , ' ', $filename );\n\t\t}",
"function _to_filename($name) {\n $name=preg_replace('@([A-Z])@','_$1',$name);\n $name=preg_replace('@[^a-z0-9_]@i', '_',$name);\n $name=preg_replace('@(_+)@','_',trim($name,\"_\"));\n $name=strtolower($name);\n return $name;\n}",
"function format_name_download($filename)\n{\n $filename = str_replace(array(' ', '/', '\\\\', '?', '!', '@', '#', '$', '%', '&', '*', '\\'', '\"', '<', '>', ':', ';'), array('_', '.', '.', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-'), $filename);\n return $filename;\n}",
"protected function getPageName(string $fileName): string\n {\n return str_replace('_', '', ucwords(\n str_replace(['-', ' ', ',', ':', '.'], '_', strtolower($fileName)), '_')\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clamps a given value to fit within the range. Modifies a value (passed by reference) so that it fits within the range. Like contains(), this function returns 1, 0, or +1. If the object was already within range, then a 0 is returned. If the object was below the range, then 1 is returned. If the object was beyond the range, then +1 is returned. | public function clamp(DateTime &$value)
{
$contained = $this->contains($value);
// Since the start and end of the range are stored as the asci codes,
// we use chr() in order to get back the corresponding character.
if ($contained < 0) {
$value = $this->start;
} elseif ($contained > 0) {
$value = $this->end;
}
return $contained;
} | [
"public function clamp(&$value)\n {\n $this->validateValue($value);\n $contained = $this->contains($value);\n\n // Since the start and end of the range are stored as the asci codes,\n // we use chr() in order to get back the corresponding character.\n if ($contained < 0) {\n $value = chr($this->start);\n } elseif ($contained > 0) {\n $value = chr($this->end);\n }\n\n return $contained;\n }",
"private static function setInRange_($value, $range)\n {\n $range = explode('..', $range);\n \n if((string)$range[0] == '')\n $range[0] = -INF;\n \n if((string)$range[1] == '')\n $range[1] = INF;\n \n return min(max($value, $range[0]), $range[1]); \n }",
"function clamp($value, $min, $max)\n {\n return max($min, min($max, $value));\n }",
"function clamp($value, $min, $max) {\n return max($min, min($max, $value));\n }",
"protected function keepWithin($value, $min, $max) {\n if ($value < $min) {\n return $min;\n }\n\n if ($value > $max) {\n return $max;\n }\n\n return $value;\n }",
"function clamp($val, $max, $min) {\n\t$val = (($val > $max)? $max : $val);\n\t$val = (($val < $min)? $min : $val);\n\treturn $val;\n}",
"function clamp($current, $min, $max) {\n return max($min, min($max, $current));\n }",
"function _forceRange($min = 0, $max = 255, &$property){\n if($property < $min){\n $property = $min;\n }\n if($property > $max){\n $property = $max;\n }\n }",
"public function clamp($min, $max) {\n if ($this->compare($min)==-1) return $min;\n if ($this->compare($max)==1) return $max;\n return $this;\n }",
"public function setUpperbound($value);",
"public static function clamp($val, $min=null, $max=null)\r\n\t{\r\n\t if ($min !== null && $val < $min)\r\n\t {\r\n\t return $min;\r\n\t }\r\n\t if ($max !== null && $val > $max)\r\n\t {\r\n\t return $max;\r\n\t }\r\n return $val;\r\n\t}",
"public static function clamp($val, $min=NULL, $max=NULL)\n\t{\n\t\tif ($min !== NULL && $val < $min)\n\t\t{\n\t\t\treturn $min;\n\t\t}\n\t\tif ($max !== NULL && $val > $max)\n\t\t{\n\t\t\treturn $max;\n\t\t}\n\t\treturn $val;\n\t}",
"protected function setUpperBoundInclusive($value)\n {\n $this->setUpperBound($value, true);\n }",
"public function checkRange(int $value)\n {\n if( ($value < $this->min) || ($value > $this->max)) {\n return $value;\n }\n }",
"public function clipLower(float $min);",
"public static function clip($value, $min, $max)\n {\n return max(min($value, $max), $min);\n }",
"protected function adjust($value) {\n $value = (int) $value;\n $value = min(100, $value);\n $value = max(0, $value);\n return $value;\n }",
"public function meetsThreshold($value);",
"function withinValue($value, $min, $max)\r\n {\r\n return (in_array($value, range($min, $max)));\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests rollback from failed entity save. | public function testEntityRollback() {
// Create a block.
try {
EntityTest::create(['name' => 'fail_insert'])->save();
$this->fail('Expected exception has not been thrown.');
}
catch (\Exception $e) {
// Expected exception; just continue testing.
}
// Check that the block does not exist in the database.
$ids = \Drupal::entityQuery('entity_test')
->accessCheck(FALSE)
->condition('name', 'fail_insert')
->execute();
$this->assertEmpty($ids);
} | [
"public function testRollbackTransaction(): void\n {\n $persistService = new PersistService(\n $this->entityName,\n $this->entityManager,\n $this->eventDispatcher,\n $this->logger\n );\n\n $this->entityManager->expects($this->once())->method('rollback');\n\n $persistService->rollbackTransaction();\n }",
"public function testRollbackTransactionError(): void\n {\n $persistService = new PersistService(\n $this->entityName,\n $this->entityManager,\n $this->eventDispatcher,\n $this->logger\n );\n\n $exceptionMessage = 'This is a test exception message for ' . __FUNCTION__;\n $exceptionCode = 123;\n $exception = new \\Exception($exceptionMessage, $exceptionCode);\n\n $this->entityManager->expects($this->once())\n ->method('rollback')\n ->willThrowException($exception);\n\n $this->expectException(PersistenceException::class);\n $this->expectExceptionMessage(sprintf('Failed to rollback transaction : %s', $exceptionMessage));\n $this->expectExceptionCode($exceptionCode);\n\n $persistService->rollbackTransaction();\n }",
"public function testSaveOrFail(): void\n {\n $this->expectException(PersistenceFailedException::class);\n $this->expectExceptionMessage('Entity save failure.');\n\n $entity = new Entity([\n 'foo' => 'bar',\n ]);\n $table = $this->getTableLocator()->get('users');\n\n $table->saveOrFail($entity);\n }",
"private function rollback()\n {\n $model = $this->setupModel(DefaultPrimaryKey::class);\n $oldModel = clone $model;\n $model = $this->updateModel($model, 3);\n $aRevision = ($model->allRevisions()->orderBy('id', 'asc')->get())[0];\n\n $model->rollback($aRevision->id, true);\n $hasDifferent = $this->compareTwoModel($oldModel, $model);\n $this->assertEquals(false, $hasDifferent, 'Fillable attribute values do not match');\n\n $aRevision = $model->allRevisions()->orderBy('id', 'asc')->first();\n $model->rollback($aRevision->id, false);\n $revisionCount = $model->allRevisions()->count();\n $this->assertEquals(0, $revisionCount, 'The revisions are not deleted');\n }",
"public function testRollBack()\n {\n $this->_object->beginTransaction();\n\n $this->assertTrue($this->_object->rollBack());\n $this->assertFalse($this->_object->isTransaction());\n }",
"public function testRollbackTransactionRevertsChanges()\n {\n $exampleOxId = 'XYZ';\n\n $this->truncateTestTable();\n $this->database->startTransaction();\n $this->database->execute(\"INSERT INTO \" . self::TABLE_NAME . \" (OXID) VALUES ('$exampleOxId');\", array());\n\n // assure, that the changes are made in this transaction\n $this->assertTestTableHasOnly($exampleOxId);\n\n $this->database->rollbackTransaction();\n\n // assure, that the changes are reverted\n $this->assureTestTableIsEmpty();\n }",
"public function transactionRollback();",
"public function testRollbackErrors()\n {\n $this->expectException(\\Exception::class);\n $this->migrations->markMigrated('all');\n $this->migrations->rollback();\n }",
"public function supportsRollback();",
"public function testTransactionRollback() {\n\n $this->pdo->beginTransaction();\n $this->pdo->exec(str_replace('id=1', 'id=2', self::$insert_sql));\n $this->pdo->rollBack();\n\n $res = $this->pdo->query(str_replace('id=1', 'id=2', self::$select_sql));\n $this->assertLessThan(2, $res, 'rollback did not work.');\n }",
"public function test_rollback_invalid_savepoint()\n\t{\n\t\t$db = Database::factory();\n\t\t$db->begin();\n\n\t\t$this->setExpectedException(\n\t\t\t'Database_Exception', 'does not exist', 1305\n\t\t);\n\n\t\t$db->rollback('kohana_savepoint');\n\t}",
"protected function rollback() {\n }",
"protected function _expectTransactionRollback()\n {\n $this->_adapter->expects($this->once())->method('rollback');\n }",
"public function testRollbackOnException()\n {\n $database = new Connection();\n $command = new Transaction(new Exceptional(), new Dispatcher($this->app), $database);\n\n try {\n $command->run();\n } catch (Exception $exception) {\n $this->assertSame(0, $database->transactionLevel(), 'The transaction should have been rolled back.');\n $this->assertSame(0, $database->commits, 'The transaction should not have been committed.');\n $this->assertSame(1, $database->rollbacks, 'The transaction should have been rolled back.');\n $this->assertSame('foo', $exception->getMessage(), 'The exception thrown in the command should be rethrown.');\n\n return;\n }\n\n $this->fail('An exception should have been rethrown by transaction wrapper.');\n }",
"public function testRollBackTransaction()\n {\n try {\n DAL::beginTransaction();\n DAL::rollback();\n $count = DAL::getTransactionCount();\n PHPUnit_Framework_Assert::assertEquals(0, $count);\n } catch (ChannelException $e) {\n PHPUnit_Framework_Assert::fail($e->getMessage());\n }\n\n }",
"public function rollbackTransaction() {\n\n\t\tif (count($this->savepointIds) == 0) {\n\t\t\tthrow new Exception('Transaction rollback was called, but no transaction was started');\n\t\t}\n\n\t\tif (count($this->savepointIds) == 1) {\n\t\t\tarray_pop($this->savepointIds);\n\t\t\t$this->setQuery('ROLLBACK');\n\t\t\t$this->query();\n\t\t}\n\t\telse {\n\t\t\t$lastSavePoint = array_pop($this->savepointIds);\n\t\t\t$this->setQuery('ROLLBACK TO SAVEPOINT ' . $lastSavePoint);\n\t\t\t$this->query();\n\t\t}\n\n\t}",
"function rollback()\n {\n $this->intransaction = false;\n }",
"public function transactionRollback() {\n $this->setQuery('ROLLBACK');\n $this->execute();\n }",
"public function testPersistWithValidationFailedException(): void\n {\n $this->expectException(EntityValidationFailedExceptionStub::class);\n\n $this->getEntityManager()->persist(new EntityWithValidationStub());\n $this->getEntityManager()->flush();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the human readable duration of the tracker | public function getHumanDurationAttribute()
{
$minutes = $this->duration % 60;
$hours = ($this->duration - $minutes) / 60;
return ($hours > 0 ? "$hours " . __('hours') . " " : "") . "$minutes " . __('minutes');
} | [
"public function duration()\n {\n if (! $this->hasStarted()) return '';\n\n return ($this->finished_at ?? Carbon::now())\n ->diffAsCarbonInterval($this->started_at)\n ->forHumans(['short' => true]);\n }",
"public function getDurationText()\n\t{\n\t\t$startTime = new DateTime($this->start_time);\n\t\t$endTime = new DateTime($this->end_time);\n\t\t$diff = $endTime->diff($startTime);\n\t\tif ($diff->y or $diff->m or $diff->d)\n\t\t\t$ret = $diff->format('%a days, %H:%I:%S');\n\t\telse\n\t\t\t$ret = $diff->format('%H:%I:%S');\n\t\treturn $ret;\n\t}",
"function getDurationString()\n\t{\n\t\treturn getHourString($this->duration);\n\t}",
"public function getDurationLabel()\n {\n return $this->format_duration($this->getWorkingDuration());\n }",
"public function get_duration_string()\n\t{\n\t\tif($this->get_fixed()) {\n\t\t\treturn \"\";\n\t\t}\n\t\t$duration = $this->get_duration();\n\t\t$data = $this->get_time_string($duration,true);\n\t\treturn sprintf(\"%dd %dh %dm\", $data['day'], $data['hours'], $data['minutes']);\n\t}",
"public function duration_string() {\n\t\t$duration = strtotime($this->t_end) - strtotime($this->t_start);\n\t\t$hour = floor($duration / 3600);\n\t\tif($hour > 800) return \"800:00:00\"; // max visable duration\n\n\t\t$minute = $duration / 60 % 60;\n\t\t$second = $duration % 60;\n\n\t\treturn \"$hour:$minute:$second\";\n\t}",
"public function getDuration() {\n $version = $this->getPriorityVersion();\n if ($version) {\n return $version->getDuration();\n }\n return '';\n }",
"public function getStatsDuration();",
"public function playDuration(): string\n {\n return $this->pluck('playDuration');\n }",
"public function getDuration() {\n\t\tpreg_match('/Duration: [0-9]{2}:[0-9]{2}:[0-9]{2}/', $this->fileinfo, $matches);\n\t\tpreg_match('/[0-9]{2}:[0-9]{2}:[0-9]{2}/', $matches[0], $matches);\n\t\treturn $matches[0];\n\t}",
"public final function get_duration_unit()\n {\n return $this->_duration_unit;\n }",
"public function get_formatted_duration() {\n\t\t$duration = $this->get_duration();\n\n\t\t$hour_in_seconds = 60 * 60;\n\n\t\tif ( $duration > $hour_in_seconds ) {\n\t\t\t$format = 'H:i:s';\n\t\t} else {\n\t\t\t$format = 'i:s';\n\t\t}\n\n\t\t$format = apply_filters( 'mace_video_duration_format', $format, $duration );\n\n\t\treturn date( $format, $duration );\n\t}",
"public function getDuration(): string|null;",
"function getDuration()\n {\n $duration = 0;\n foreach ($this->_tracks as $track) {\n $duration += $track->getDuration();\n }\n return (floor($duration / 1000));\n }",
"public function getDuration()\n {\n $duration = Duration::first();\n\n // mengembalikan nilai $duration\n return $duration;\n }",
"public function getFormattedDuration() {\n\t\t$duration = $this->getDuration();\n\t\tif ($duration) {\n\n\t\t\t$hours = $duration->days * 24 + $duration->h;\n\t\t\t$minutes = $duration->i;\n\n\t\t\treturn sprintf('%02sh %smin', $hours, $minutes);\n\t\t\treturn $duration->format('%hh %Imin');\n\t\t}\n\t\treturn '';\n\t}",
"public function duration()\n {\n $interval = $this->runEnd->diff($this->runStart);\n\n return $interval->format('%H:%I:%S');\n }",
"public function getDuration() {\n\t\t$cmd = shell_exec(\"$this->ffmpeg_path -i \\\"{$this->file_path}\\\" 2>&1\");\n\t\tpreg_match('/Duration: (.*?),/', $cmd, $matches);\n\t\tif (count($matches) > 0) {\n\t\t\treturn $matches[1];\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\t}",
"public function duration();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
save holder in the storage layer | public abstract function saveHolder(HolderInterface $holder); | [
"public abstract function saveHolder(HolderInterface $holder, bool $autocommit = true): HolderInterface;",
"public function save()\n\t{\n\t\tif($this->beforeSave())\n\t\t{\n\t\t\t$dest = $this->getStorageFile();\n\t\t\t\n\t\t\tif(file_exists($dest) and is_writable($dest)===false)\n\t\t\t{\n\t\t\t\t@chmod($dest,0777);\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($dest,$this->mode);\n\t\t\tfwrite($fp,$this->data);\n\t\t\tfclose($fp);\n\t\t\t$this->afterSave();\n\t\t}\n\t}",
"public function save() {\n\t\t$this->data['task_type'] = get_class($this);\n\t\t$this->data['iteration'] = 1;\n\t\t\n\t\tif($this->use_constants) {\n\t\t\t$this->data['EGS_USERNAME'] = EGS::getUsername();\n\t\t\t$this->data['EGS_COMPANY_ID'] = EGS::getCompanyId();\n\t\t\t$this->data['USER_SPACE'] = Omelette::getUserSpace();\n\t\t}\n\t\t$this->storage->write($this->data);\n\t}",
"private function save()\n\t{\n\t\tfile_put_contents($this->_file, json_encode($this->_container));\n\t}",
"public function saveToStorage(): void\n {\n $data = self::getCurrentData();\n\n $redis = new Redis();\n if (!$redis->connect('localhost')) {\n throw new Exception('Redis no connected: ' . $redis->getLastError());\n }\n\n $key = 'weather_' . $data['dt'];\n $redis->setex($key, 10800, serialize($data));\n\n //var_dump(unserialize($redis->get($key)));\n }",
"public function save()\n\t{\n\t\tglobal $cache;\n\t\t$cache->update($this->cache_key, $this->cache_data);\n\t}",
"public function save() {\n global $DB;\n if (empty($this->id)) {\n $r = (object)array(\n 'data' => base64_encode(serialize($this)),\n 'expirytime' => time() + (60*60*24),\n 'userid' => $this->user->id,\n );\n $this->id = $DB->insert_record('portfolio_tempdata', $r);\n $this->save(); // call again so that id gets added to the save data.\n } else {\n $DB->set_field('portfolio_tempdata', 'data', base64_encode(serialize($this)), array('id' => $this->id));\n }\n }",
"private function persistEngineState()\n\t{\n\t\t$session = Session::getInstance();\n\t\t$storage = new Storage();\n\t\t$sessionData = array_combine($session->getKnownKeys(), array_map(function ($key) use ($session) {\n\t\t\treturn $session->get($key);\n\t\t}, $session->getKnownKeys()));\n\n\t\t$storage->setValue('filescanner.memory', json_encode($sessionData));\n\t\t$storage->setValue('filescanner.timestamp', time());\n\t\t$storage->save();\n\t}",
"protected function _save() {\n\t\tif(!empty($this->_storage) && $this->_storage != $this->_cache) {\n\t\t\tif (extension_loaded('yaml')) {\n\t\t\t\t$yaml = yaml_emit($this->_storage);\n\t\t\t} else {\n\t\t\t\t$dumper = new \\sfYamlDumper();\n\t\t\t\t$yaml = $dumper->dump($this->_storage, 2);\n\t\t\t}\n\t\t\treturn file_put_contents($this->_dataStoreFile(), $yaml);\n\t\t}\n\t}",
"private function saveContainers() {\n Cache::forever('container', $this->container);\n }",
"public function store() {\n $this->storeCache( $this->cache );\n }",
"public function Persist()\n {\n if ($this->_localDataChanged)\n {\n file_put_contents($this->_filePath, serialize($this->_data));\n $this->_localDataChanged = false;\n }\n }",
"public function set_storage(&$storage);",
"public function save() {\n $this->_saved = TRUE;\n }",
"abstract public function save($storage_name,$mv_session_id);",
"abstract protected function realSaveData();",
"public function save()\n {\n $this->_data['timestamp'] = time();\n $this->_state->saveSyncCache(\n $this->_data,\n $this->_devid,\n $this->_user);\n }",
"abstract public function saveToBlockStorage(BlockStorable $storable): void;",
"public function saveWithPurging();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ acf_include This function will include a file | function acf_include( $file ) {
} | [
"function acf_include_once( $file = '' ) {\n}",
"protected function shortcodeInclude()\n {\n add_shortcode('include', function ($atts) {\n extract(\n shortcode_atts(['file' => 'NULL'], $atts)\n );\n\n // check for query string of variables after file path\n if (strpos($file, \"?\")) {\n global $query_string;\n $qs_position = strpos($file, \"?\");\n $qs_values = str_replace(\"amp;\", \"\", substr($file, $qs_position + 1));\n parse_str($qs_values, $query_string);\n\n // Remove query string from file\n $file = substr($file, 0, $qs_position);\n }\n\n $filepath = get_stylesheet_directory() .'/views/'. $file;\n\n // check if the file was specified and if the file exists\n if ($file != 'NULL' && file_exists($filepath)) {\n // turn on output buffering to capture script output\n ob_start();\n\n // include the specified file\n echo \\App\\template($filepath);\n\n // assign the file output to $content variable and clean buffer\n $content = ob_get_clean();\n\n return $content;\n }\n });\n }",
"function feather_include($filename) {\n include_once dirname(__FILE__) .'/includes/'. $filename;\n}",
"function xinclude() {}",
"function include_file($atts) {\n\t\t//if filepath was specified\n\t\textract(\n\t\t\tshortcode_atts(\n\t\t\t\tarray(\n\t\t\t\t\t'filepath' => 'NULL'\n\t\t\t\t), $atts\n\t\t\t)\n\t\t);\n\n\t\t//BEGIN modified portion of code to accept query strings\n\t\t//check for query string of variables after file path\n\t\tif(strpos($filepath,\"?\")) {\n\t\t\t$query_string_pos = strpos($filepath,\"?\");\n\t\t\t//create global variable for query string so we can access it in our included files if we need it\n\t\t\t//also parse it out from the clean file name which we will store in a new variable for including\n\t\t\tglobal $query_string;\n\t\t\t$query_string = substr($filepath,$query_string_pos + 1);\n\t\t\t$clean_file_path = substr($filepath,0,$query_string_pos); \n\t\t\t//if there isn't a query string\n\t\t} else {\n\t\t\t$clean_file_path = $filepath;\n\t\t}\n\t\t//END modified portion of code\n\n\t\t//check if the filepath was specified and if the file exists\n\t\tif ($filepath != 'NULL' && file_exists(get_stylesheet_directory_uri() . \"/\" . $clean_file_path)){\n\t\t\t//turn on output buffering to capture script output\n\t\t\tob_start();\n\t\t\t//include the specified file\n\t\t\tinclude(TEMPLATEPATH.$clean_file_path);\n\t\t\t//assign the file output to $content variable and clean buffer\n\t\t\t$content = ob_get_clean();\n\t\t\t//return the $content\n\t\t\t//return is important for the output to appear at the correct position\n\t\t\t//in the content\n\t\t\treturn $content;\n\t\t}\n\t}",
"function shortcode_include( $file, $args=NULL ) {\n ob_start();\n require(sprintf('%s/%s',dirname(__FILE__),$file)); \n $content = ob_get_contents();\n ob_end_clean(); return($content);\n }",
"public function xinclude ($options) {}",
"abstract function includeSpecificFiles();",
"private static function includeFile($file)\n {\n include_once $file;\n }",
"function include_file(string $filename, array $args = [])\n {\n return Includer::load($filename, $args);\n }",
"function bp_include() {\r\n\tdo_action( 'bp_include' );\r\n}",
"function el_installation_include($file = '', $params = array()) {\n $file = el_installation_paths()->root . $file;\n if (!empty($file) && is_file($file)) {\n ob_start();\n $params = $params;\n include($file);\n $contents = ob_get_clean();\n return $contents;\n }\n\n}",
"function sbp_include_once($file)\n{\n return Sbp\\Sbp::includeOnceFile($file);\n}",
"function zg_includes_add($include_file, $type) {\n $game = zg_get_game();\n $game_include_list = &drupal_static('zg_include_list', []);\n $game_include_missing = &drupal_static('zg_include_missing', []);\n $module_path = drupal_get_path('module', 'zg');\n $file_to_include = $module_path . '/includes/' . $type . '/' . $game . '_' .\n $include_file . '.inc';\n\n // Already in include list; return.\n if (in_array($type . '/' . $include_file, $game_include_list)) {\n return;\n }\n\n // Already in missing list; return.\n if (in_array($type . '/' . $include_file, $game_include_missing)) {\n return;\n }\n\n if (file_exists($file_to_include)) {\n $game_include_list[] = $type . '/' . $include_file;\n include_once $file_to_include;\n $function_name = $game . '_' . $include_file . '_init';\n if (function_exists($function_name)) {\n $function_name();\n }\n }\n else {\n // File does not exist; add to missing list.\n $game_include_missing[] = $type . '/' . $include_file;\n }\n}",
"public function inc($file)\n {\n include($file . '.php');\n }",
"function includeWithVars($filename, $vars) {\n extract($vars);\n include $filename;\n }",
"public static function include_files__front() {\n\n\t\t}",
"public function _include($file)\n\t{\n\t\tif ($this->theme\n && is_file($this->theme.\"/templates/{$this->outputFormat}/$file\")) {\n\t\t\tinclude $this->theme.\"/templates/{$this->outputFormat}/$file\";\n\t\t}\n\t\telse {\n\t\t\tinclude APPLICATION_HOME.\"/templates/{$this->outputFormat}/$file\";\n\t\t}\n\t}",
"function insertInclude($includeName, $obj = null){\n\t\textract($GLOBALS);\n\t\t$includeName = strtolower($includeName);\n\t\t$file = TEMPLATE_DIR . '/' . config()->theme . \"/includes/\".$includeName.\".tpl.php\";\n\t\tif(isDebug()){\n\t\t\tprint (\"<div class='debug-file-include'>\".$file.\"</div>\");\n\t\t}\n\t\tinclude($file);\t\n\t}",
"private function includes() {\n\t\trequire_once( CF_PLUGIN_DIR . 'classes/ajax.php' );\n\t\trequire_once( CF_PLUGIN_DIR . 'classes/shortcode.php' );\n\t\trequire_once( CF_PLUGIN_DIR . 'classes/widget.php' );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Can't browse any subdirectories | function testCantBrowseSubdirectories() {
$result = $this->get($this->baseUrl.'files/foo/bar/baz/'.$this->model->uploadedFile['id']);
$this->assertResponse(404);
$result = $this->get($this->baseUrl.'files/foo/bar/baz/');
$this->assertResponse(404);
$result = $this->get($this->baseUrl.'files/foo/bar/');
$this->assertResponse(404);
$result = $this->get($this->baseUrl.'files/foo/');
$this->assertResponse(404);
$result = $this->get($this->baseUrl.'files/');
$this->assertResponse(404);
} | [
"function getSubfolders() ;",
"function bob_scandir($root_path, $bad_path, $recursive) {\n $output = array();\n if (file_exists($root_path)){\n $paths = scandir($root_path);\n if ($paths === False)\n return False;\n foreach ($paths as $path) {\n $potential_path = \"${root_path}/${path}\";\n\n // Ignore any files in the bad (admin) path or files that begin with a period.\n if ($potential_path == $bad_path or $path[0] == '.')\n continue;\n\n $output[] = $potential_path;\n $bad_folder = ''; // not sure what this is for\n if ($recursive and is_dir($potential_path)) // Recursively descend and print out files.\n $output = array_merge($output, bob_scandir($potential_path, $bad_folder, $recursive));\n }\n }\n return $output;\n}",
"function read_directory_subfolders($dir = '.'){\n\t$folder=dir($dir); \n\t$arrFolderEntries = array();\n\twhile($folderEntry=$folder->read()){\n\t\tif($folderEntry != '.' && $folderEntry != '..' && is_dir($dir.$folderEntry) && strtolower($folderEntry) != 'admin') \n\t\t\t$arrFolderEntries[] = $folderEntry; \n\t} \n\t$folder->close(); \n\treturn $arrFolderEntries;\n}",
"function enumerateDirectories() : IEnumerable;",
"private function scanSubdirs()\n\t{\n\t\t$engine = AEFactory::getScanEngine();\n\n\t\tlist($root, $translated_root, $dir) = $this->getCleanDirectoryComponents();\n\n\t\t// Get a filters instance\n\t\t$filters = AEFactory::getFilters();\n\n\t\tif (is_null($this->getFolders_position))\n\t\t{\n\t\t\tAEUtilLogger::WriteLog(_AE_LOG_INFO, \"Scanning directories of \" . $this->current_directory);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tAEUtilLogger::WriteLog(_AE_LOG_INFO, \"Resuming scanning directories of \" . $this->current_directory);\n\t\t}\n\n\t\t// Get subdirectories\n\t\t$subdirectories = $engine->getFolders($this->current_directory, $this->getFolders_position);\n\n\t\t// Error propagation\n\t\t$this->propagateFromObject($engine);\n\n\t\t// If the list contains \"too many\" items, please break this step!\n\t\tif (AEFactory::getConfiguration()->get('volatile.breakflag', false))\n\t\t{\n\t\t\t// Log the step break decision, for debugging reasons\n\t\t\tAEUtilLogger::WriteLog(_AE_LOG_INFO, \"Large directory \" . $this->current_directory . \" while scanning for subdirectories; I will resume scanning in next step.\");\n\n\t\t\t// Return immediately, marking that we are not done yet!\n\t\t\treturn true;\n\t\t}\n\n\t\t// Error control\n\t\tif ($this->getError())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Start adding the subdirectories\n\t\tif (!empty($subdirectories) && is_array($subdirectories))\n\t\t{\n\t\t\t$dereferenceSymlinks = AEFactory::getConfiguration()->get('engine.archiver.common.dereference_symlinks');\n\n\t\t\t// If we have to treat symlinks as real directories just add everything\n\t\t\tif ($dereferenceSymlinks)\n\t\t\t{\n\t\t\t\t// Treat symlinks to directories as actual directories\n\t\t\t\tforeach ($subdirectories as $subdirectory)\n\t\t\t\t{\n\t\t\t\t\t$this->directory_list[] = $subdirectory;\n\t\t\t\t\t$this->progressAddFolder();\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If we are told not to dereference symlinks we'll need to check each subdirectory thoroughly\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Treat symlinks to directories as simple symlink files (ONLY WORKS WITH CERTAIN ARCHIVERS!)\n\t\t\t\tforeach ($subdirectories as $subdirectory)\n\t\t\t\t{\n\t\t\t\t\tif (is_link($subdirectory))\n\t\t\t\t\t{\n\t\t\t\t\t\t// Symlink detected; apply directory filters to it\n\t\t\t\t\t\tif (empty($dir))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$dirSlash = $dir;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$dirSlash = $dir . '/';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$check = $dirSlash . basename($subdirectory);\n\t\t\t\t\t\tAEUtilLogger::WriteLog(_AE_LOG_DEBUG, \"Directory symlink detected: $check\");\n\n\t\t\t\t\t\tif (_AKEEBA_IS_WINDOWS)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$check = AEUtilFilesystem::TranslateWinPath($check);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Do I need this? $dir contains a path relative to the root anyway...\n\t\t\t\t\t\t$check = ltrim(str_replace($translated_root, '', $check), '/');\n\n\t\t\t\t\t\t// Check for excluded symlinks (note that they are excluded as DIRECTORIES in the GUI)\n\t\t\t\t\t\tif ($filters->isFiltered($check, $root, 'dir', 'all'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tAEUtilLogger::WriteLog(_AE_LOG_INFO, \"Skipping directory symlink \" . $check);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tAEUtilLogger::WriteLog(_AE_LOG_DEBUG, 'Adding folder symlink: ' . $check);\n\t\t\t\t\t\t\t$this->file_list[] = $subdirectory;\n\t\t\t\t\t\t\t$this->progressAddFile();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->directory_list[] = $subdirectory;\n\t\t\t\t\t\t$this->progressAddFolder();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If the scanner nullified the next position to scan, we're done\n\t\t// scanning for subdirectories\n\t\tif (is_null($this->getFolders_position))\n\t\t{\n\t\t\t$this->done_subdir_scanning = true;\n\t\t}\n\n\t\treturn true;\n\t}",
"#[@test, @expect('lang.IllegalStateException')]\n public function fileViaGetDir() {\n $this->conn->connect();\n $this->conn->rootDir()->getDir('htdocs')->getDir('index.html');\n }",
"public function testReadDir() {\n // Get the files\n $files = f::read_dir( \".\" );\n\n // Only thing we can guarantee is . and ..\n $this->assertTrue( is_array( $files ) );\n }",
"public function testSubdirectoryCheck()\n {\n $cx = Cx::instanciate();\n $this->assertTrue(\n MediaSourceManager::isSubdirectory(\n $cx->getWebsitePath() . '/images', 'files/'\n )\n );\n $this->assertFalse(\n MediaSourceManager::isSubdirectory(\n $cx->getWebsitePath() . '/media', 'files/'\n )\n );\n $this->assertFalse(\n MediaSourceManager::isSubdirectory(\n $cx->getWebsitePath() . '/images', 'media5/'\n )\n );\n }",
"public static function scan () {\n self::tree(self::$config['base_dir'], 0);\n }",
"public function testBasicListNoNesting()\n {\n $path = dirname(__FILE__).'/TestDir/';\n $retval = FileSystem::listDirectory($path, array(), FALSE);\n PHPUnit_Framework_Assert::assertTrue(count($retval) === 5);\n\n }",
"public function dir_readdir()\n {}",
"function listar_directorios_ruta($ruta) {\n if (is_dir($ruta)) {\n if ($dh = opendir($ruta)) {\n while (($file = readdir($dh))) {\n if (is_dir($ruta . $file) && $file != \".\" && $file != \"..\" && $file != \"original\") {\n $rute = array_reverse(explode('/', $ruta . $file));\n $id = $rute[2] . $rute[1] . $rute[0];\n $sth = $this->db->prepare(\"SELECT * FROM photos where id=:id order by id\");\n $sth->execute(array(\n ':id' => intval($id)\n ));\n $data = $sth->fetch();\n $count = $sth->rowCount();\n if ($count == 0)\n echo intval($id) . \"NO existe<br>\";\n else\n echo intval($id) . \"SI existe<br>\";\n $this->listar_directorios_ruta($ruta . $file . \"/\");\n }\n }\n closedir($dh);\n }\n }\n }",
"public function getScanDirectories() : array;",
"function print_tree($dir = '.') {\n global $root_path;\n echo '<ul class=\"dirlist\">';\n $d = opendir($dir);\n while ($f = readdir($d)) {\n if (strpos($f, '.') === 0)\n continue;\n $ff = $dir . '/' . $f;\n if (is_dir($ff) && $_GET['mediatype'] != 'iframe') {\n echo '<li><a href=\"' . $root_path . $ff . '/\" onclick=\"load(\\'filechooser.php?viewdir=' . $ff . '&mediatype=' . $_GET['mediatype'] . '\\',\\'view-files\\'); return false;\">' . $f . '</a>';\n print_tree($ff);\n echo '</li>';\n }\n }\n echo '</ul>';\n}",
"public function index(){\n $dir = 'store';\n return $this->folders = array_diff(scandir($dir), array('..', '.'));\n }",
"function get_directory_list($rootdir, $excludefile='', $descend=true, $getdirs=false, $getfiles=true) {\n\n $dirs = array();\n\n if (!$getdirs and !$getfiles) { // Nothing to show\n return $dirs;\n }\n\n if (!is_dir($rootdir)) { // Must be a directory\n return $dirs;\n }\n\n if (!$dir = opendir($rootdir)) { // Can't open it for some reason\n return $dirs;\n }\n\n while (false !== ($file = readdir($dir))) {\n $firstchar = substr($file, 0, 1);\n if ($firstchar == '.' or $file == 'CVS' or $file == $excludefile) {\n continue;\n }\n $fullfile = $rootdir .'/'. $file;\n if (filetype($fullfile) == 'dir') {\n if ($getdirs) {\n $dirs[] = $file;\n }\n if ($descend) {\n $subdirs = get_directory_list($fullfile, $excludefile, $descend, $getdirs, $getfiles);\n foreach ($subdirs as $subdir) {\n $dirs[] = $file .'/'. $subdir;\n }\n }\n } else if ($getfiles) {\n $dirs[] = $file;\n }\n }\n closedir($dir);\n\n asort($dirs);\n\n return $dirs;\n}",
"function getDirectoryListing($path=''){\n if ($path =='') { \n $path = realpath(root);//.\"\\\\mcat\\\\uploads\";\n }\n $fnames = array();\n $cnt = 0;\nforeach (new DirectoryIterator($path) as $fileinfo){\n if ($fileinfo->isDot()) continue;\n $fnames[$cnt] = $fileinfo->getFileName();\n\t $cnt += 1;\n} // End foreach\t\t\n return $fnames;\n}",
"function get_allowed_use_subdirectories() {\n\treturn [ 'common' ];\n}",
"function setDirectoryList(){\n $this->dirs = scandir($this->path);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get table class object | public static function TableClass() { return self::getClassName().'_Table'; } | [
"public function getTableClass()\n\t{\n\t\treturn $this->class;\n\t}",
"public function getTableClass()\n {\n return $this->_tableClass;\n }",
"public function getTable()\n {\n $table = $this->_table;\n if (null === $table && !empty($this->_tableClass)) {\n $tableClass = $this->_tableClass;\n $table = Core::single($tableClass);\n $this->setTable($table);\n }\n return $table;\n }",
"public function getTblObj(){\r\n if(is_null(self::$tblObj)){\r\n self::$tblObj = new CatTable();\r\n }\r\n return self::$tblObj;\r\n }",
"public static function getTbl(){\r\n if(is_null(self::$tblObj)){\r\n self::$tblObj = new CatTable();\r\n }\r\n return self::$tblObj;\r\n }",
"public static function table() {\n return new ORMTableRef(static::schema());\n }",
"public function getTblObj(){\r\n if(is_null(self::$tblObj)){\r\n self::$tblObj = new ImageTable();\r\n }\r\n return self::$tblObj;\r\n }",
"protected function GetObjectTable() {\r\n\t\t\treturn $this->objectTable;\r\n\t\t}",
"public function getTblObj(){\r\n if(is_null(self::$tblObj)){\r\n self::$tblObj = new MemTable();\r\n }\r\n return self::$tblObj;\r\n }",
"public function get_table() {\n\t\treturn $this->table;\n\t}",
"abstract protected function _getDbTableClass();",
"function getDBTable() {\n // start with a general db_obj \n $db_obj = new db_class();\n \n $this->primary_key = $db_obj->getPrimaryKey($this->table_name);\n \n// if(! $this->filtered_query){ // TODO: figure out find and specific views.\n $sql = $this->get_sql();\n $db_table = $db_obj->getTableNoParams($sql);\n// } else {\n// $variables = gen_filtered_search();\n// $db_table = $db_obj->safeSelect($variables['sql'], $variables['typestr'], $variables['params'] );\n// }\n $db_obj->closeDB();\n \n return $db_table;\n }",
"protected function get_table_classes()\n {\n }",
"public static function getTbl(){\r\n if(is_null(self::$tblObj)){\r\n self::$tblObj = new MessageTable();\r\n }\r\n return self::$tblObj;\r\n }",
"public function getTabla(){\n\t\treturn $this->table;\n\t}",
"protected function _getDbTable()\n {\n if (null === $this->_dbTable) {\n $className = str_replace('Mapper', 'DbTable', get_class($this));\n $this->_dbTable = new $className;\n }\n return $this->_dbTable;\n }",
"function T($table)\n{\n\treturn Syx_Table::factory($table);\n}",
"public function getRowClass()\n {\n return $this->table()->getRowClass();\n }",
"public function getTableInfoObj() {\n \treturn $this->tableInfoObj;\n }",
"function get_table($tname) {\n //Return the table if it is set\n if (isset($this->tables[$tname])) {\n return $this->tables[$tname];\n }\n //\n //Otherwise create a new standard table from first principles\n else {\n $table = new TableStd($tname, $this);\n //\n //Update this database's table list\n $this->tables[$tname] = $table;\n //\n return $table;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If the post has a thumbnail? | public function hasThumbnail()
{
return ! empty($this->thumbnail);
} | [
"public function hasThumbnail() {\n return \\has_post_thumbnail($this->post->ID);\n }",
"function freshclicks_is_post_thumbnail_set()\n{\n\tglobal $post;\n\tif (get_the_post_thumbnail()) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}",
"public function hasThumbnail(){\n return !empty($this->getThumbnailObject());\n }",
"public function has_thumbnail()\n\t{\n\t\treturn (bool) $this->get('thumbnail');\n\t}",
"public function isThumbnail()\n {\n return $this->_is_thumbnail && (null !== $this->_is_thumbnail);\n }",
"public function isThumbnail() {\n\t\treturn (strcmp(strtolower($this->covertypeName), \"thumbnail\") == 0);\n\t}",
"function better_has_post_thumbnail( $post_id = NULL ) {\r\n\r\n\t\tif ( is_null( $post_id ) ) {\r\n\t\t\t$post = get_post();\r\n\t\t\t$post_id = $post->ID;\r\n\t\t}\r\n\r\n\t\tif ( has_post_thumbnail( $post_id ) ) {\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\r\n\t\treturn (bool) better_is_thumbnail_placeholder_active();\r\n\r\n\t}",
"public function hasThumbnail()\n {\n $filename = basename($this->getOriginal('filename'));\n\n return $this->manager->thumbnailExists($filename);\n }",
"public function hasThumbnailImage()\n\t{\n\t\treturn $this->thumbnail;\n\t}",
"public function has_featured_image()\n {\n\n return has_post_thumbnail($this->ID);\n\n }",
"function pinboard_post_thumbnail() {\n\tif( has_post_thumbnail() ) : ?>\n\t\t<figure class=\"entry-thumbnail\">\n\t\t\t<a href=\"<?php the_permalink() ?>\" rel=\"bookmark\" title=\"<?php the_title_attribute(); ?>\">\n\t\t\t\t<?php the_post_thumbnail( ( pinboard_is_teaser() ? 'teaser-thumb' : 'blog-thumb' ) ); ?>\n\t\t\t</a>\n\t\t</figure>\n\t<?php endif;\n}",
"protected function has_thumbnail_content() {\n\t\tif ( isset( $this->data['thumbnail_content'] ) && $this->data['thumbnail_content'] !== '' ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function hasThumbprint()\n {\n return $this->Thumbprint !== null;\n }",
"function can_show_post_thumbnail() {\n\treturn apply_filters( 'twentynineteen_can_show_post_thumbnail', ! post_password_required() && ! is_attachment() && has_post_thumbnail() );\n}",
"function has_content_or_thumbnail() {\r\n\r\n\treturn ( has_content() || has_post_thumbnail() );\r\n}",
"public function shouldCreateThumbnail() {\n return $this->thumb_width > 0 || $this->thumb_height > 0;\n }",
"function my_filter_image_thumbnail_meta($a, $object_id, $meta_key, $single)\n{\n if ('my_custom_post' === get_post_type($object_id) && $meta_key === '_thumbnail_id') {\n return true;\n }\n}",
"function has_the_featured_image($post_id = null) {\r\n $attach_id = get_post_thumbnail_id($post_id);\r\n\r\n return (bool) wp_get_attachment_image_src_ex($attach_id);\r\n}",
"function shell_thumbnail(){\r\n\r\n\t/* add it in archive/blog/search */\r\n\tif ( ( is_home() && !is_singular() ) || is_archive() || is_search() ){\r\n\r\n\t\t/* check get the image support */\r\n\t\tif ( current_theme_supports( 'get-the-image' ) )\r\n\t\t\tget_the_image( array( 'meta_key' => 'thumbnail', 'size' => 'thumbnail' ) );\r\n\t}\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a new empty sitemap document. | public static function newSitemapDocument()
{
return simplexml_load_string('<?xml version="1.0" encoding="UTF-8"?>' .
'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" />');
} | [
"public function createSiteMap()\n {\n $sitemap = Sitemap::create()->add(Url::create('/'))\n ->add(Url::create('/contactus'));\n\n Book::all()->each(function (Book $book) use ($sitemap) {\n $sitemap->add(Url::create(\"/books/{$book->slug}\"));\n });\n\n Category::all()->each(function (Category $category) use ($sitemap) {\n $sitemap->add(Url::create(\"/cats/{$category->slug}\"));\n });\n\n Author::all()->each(function (Author $author) use ($sitemap) {\n $sitemap->add(Url::create(\"/authors/{$author->slug}\"));\n });\n\n $sitemap->writeToFile(public_path('sitemap.xml'));\n }",
"protected function generateSiteMap()\n {\n $this->log(\"Generating sitemap.xml\\n\");\n \n $baseURL = $this->bookProps['book_website'];\n $siteMapGenerator = new SitemapGenerator($baseURL, $this->outDir);\n \n foreach ($this->siteUrls as $urlInfo) {\n $siteMapGenerator->addUrl($urlInfo[0], date('c'), 'monthly', $urlInfo[1]);\n }\n \n $siteMapGenerator->createSitemap();\n $siteMapGenerator->writeSitemap();\n }",
"public static function Sitemap() {\r\n $xml = fopen(\"sitemap.xml\", \"w+\");\r\n fwrite($xml, \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<?xml-stylesheet type=\\\"text/xsl\\\" href=\\\"sitemap.xsl\\\"?>\\n<urlset xmlns=\\\"http://www.sitemaps.org/schemas/sitemap/0.9\\\">\\n\\n\");\r\n\r\n $conteudo = ' <url>' . \"\\n\";\r\n $conteudo .= ' <loc>' . HOME . '</loc>' . \"\\n\";\r\n $conteudo .= ' <lastmod>' . date('Y-m-d') . '</lastmod>' . \"\\n\";\r\n $conteudo .= ' <changefreq>daily</changefreq>' . \"\\n\";\r\n $conteudo .= ' <priority>1.0</priority>' . \"\\n\";\r\n $conteudo .= ' </url>' . \"\\n\";\r\n\r\n fwrite($xml, $conteudo);\r\n\r\n $readSitemapGeral = new Read;\r\n $readSitemapGeral->ExeRead(\"ws_sitemaps\", \"WHERE mps_status = 1 ORDER BY mps_date DESC\");\r\n\r\n if (!$readSitemapGeral->getResult()): else:\r\n foreach ($readSitemapGeral->getResult() as $geral):\r\n $conteudo = ' <url>' . \"\\n\";\r\n $conteudo .= ' <loc>' . HOME . '/' . $geral['mps_link'] . '</loc>' . \"\\n\";\r\n $conteudo .= ' <lastmod>' . date('Y-m-d', strtotime($geral['mps_date'])) . '</lastmod>' . \"\\n\";\r\n $conteudo .= ' <changefreq>weekly</changefreq>' . \"\\n\";\r\n $conteudo .= ' <priority>' . $geral['mps_priority'] . '</priority>' . \"\\n\";\r\n $conteudo .= ' </url>' . \"\\n\";\r\n fwrite($xml, $conteudo);\r\n endforeach;\r\n endif;\r\n\r\n\r\n $readSitemap = new Read;\r\n $readSitemap->ExeRead(\"ws_posts\", \"WHERE post_status = 1 ORDER BY post_date DESC\");\r\n\r\n if (!$readSitemap->getResult()): else:\r\n foreach ($readSitemap->getResult() as $principal):\r\n $conteudo = ' <url>' . \"\\n\";\r\n $conteudo .= ' <loc>' . HOME . '/artigo/' . $principal['post_name'] . '</loc>' . \"\\n\";\r\n $conteudo .= ' <lastmod>' . date('Y-m-d', strtotime($principal['post_date'])) . '</lastmod>' . \"\\n\";\r\n $conteudo .= ' <changefreq>weekly</changefreq>' . \"\\n\";\r\n $conteudo .= ' <priority>0.8</priority>' . \"\\n\";\r\n $conteudo .= ' </url>' . \"\\n\";\r\n fwrite($xml, $conteudo);\r\n endforeach;\r\n endif;\r\n fwrite($xml, \"\\n</urlset>\");\r\n fclose($xml);\r\n\r\n $empty = filter_input(INPUT_GET, 'empty', FILTER_VALIDATE_BOOLEAN);\r\n if ($empty):\r\n SitemapXml();\r\n unlink(\"sitemap.xml.gz\");\r\n endif;\r\n }",
"protected function createSitemap() {\n\t\t$ret = '';\n\t\t$page = t3lib_div::_GP('page');\n\t\t\n\t\t$pageLimit\t\t= 10000;\n\t\t\n\t\t// Page limit on sitemap (DEPRECATED)\n\t\t$tmp = $this->getExtConf('sitemap_pageSitemapItemLimit', false);\n\t\tif( $tmp !== false ) {\n\t\t\t$pageLimit = (int)$tmp;\n\t\t}\n\t\t\n\t\tif( isset($this->tsSetup['pageLimit']) && $this->tsSetup['pageLimit'] != '' ) {\n\t\t\t$pageLimit = (int)$this->tsSetup['pageLimit'];\n\t\t}\n\n\t\t$pageItems\t\t= count($this->sitemapPages);\n\t\t$pageItemBegin\t= $pageLimit * ($page-1);\n\t\t$pageCount\t\t= ceil($pageItems/$pageLimit);\n\n\n\t\tif(empty($page) || $page == 'index') {\n\t\t\t$ret = $this->createSitemapIndex($pageCount);\n\t\t} elseif(is_numeric($page)) {\n\t\t\tif( $pageItemBegin <= $pageItems) {\n\t\t\t\t$this->sitemapPages = array_slice($this->sitemapPages, $pageItemBegin, $pageLimit);\n\t\t\t\t$ret = $this->createSitemapPage( $page );\n\t\t\t}\n\t\t}\n\n\t\treturn $ret;\n\t}",
"protected function createPagesSitemap(): Sitemap\n {\n return tap(new Sitemap, function (Sitemap $sitemap) {\n $baseUrl = 'http://example.com';\n $lastMod = '2017-01-01 00:00:00';\n\n $sitemap->setPath(\"{$baseUrl}/sitemap-pages.xml\");\n $sitemap->add(Url::make(\"{$baseUrl}/\")->setLastMod($lastMod));\n $sitemap->add(Url::make(\"{$baseUrl}/about-us\")->setLastMod($lastMod));\n $sitemap->add(Url::make(\"{$baseUrl}/contact\")->setLastMod($lastMod));\n });\n }",
"public function generate_sitemap_manually(){\n \n $sitemap = new SimpleXMLElement('<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"></urlset>');\n $i=0;\n $limit=min(($this->maps_number*$this->links_per_file)+$this->links_per_file,$this->links_total);\n $lastmod = date('Y-m-d\\\\TH:i:sP',time() - 20000000);\n for ($i=$this->maps_number*$this->links_per_file;$i<$limit;$i++)\n {\n if(empty($this->sitemap_urls[$i])) {\n die($this->maps_number);\n }\n $url = $this->sitemap_urls[$i];\n $url_tag = $sitemap->addChild(\"url\");\n $url_tag->addChild(\"loc\", htmlspecialchars($url));\n $url_tag->addChild(\"lastmod\",$this->lastmod[$i]);\n $url_tag->addChild(\"changefreq\",$this->changefreq[$i]);\n $url_tag->addChild(\"priority\",$this->priority[$i]);\n if($this->lastmod[$i] > $lastmod) $lastmod = $this->lastmod[$i];\n unset($this->sitemap_urls[$i]);\n unset($this->lastmod[$i]);\n unset($this->changefreq[$i]);\n unset($this->priority[$i]);\n }\n $this->links_mapped+=$limit-$this->maps_number*$this->links_per_file;\n $this->latest_lastmod[] = $lastmod;\n return $sitemap->asXML();\n }",
"public function createIndexSitemapFile()\n {\n if (sizeof($this->_filenamesForIndexSitemap) > 1) {\n $io = new Varien_Io_File();\n $io->setAllowCreateFolders(true);\n $io->open(array('path' => $this->getPath()));\n $fileToCreate = Mage::helper('ascurl')->insertStringToFilename($this->getSitemapFilename(), '_index');\n\n if ($io->fileExists($fileToCreate) && !$io->isWriteable($fileToCreate)) {\n Mage::throwException(\n Mage::helper('sitemap')->__(\n 'File \"%s\" cannot be saved. Please, make sure the directory \"%s\" is writeable by web server.',\n $fileToCreate,\n $this->getPath()\n )\n );\n }\n $io->streamOpen($fileToCreate);\n $io->streamWrite('<?xml version=\"1.0\" encoding=\"UTF-8\"?>' . \"\\n\");\n $io->streamWrite('<sitemapindex '.self::URLSET.'>');\n\n $storeId = $this->getStoreId();\n $baseUrl = Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);\n $date = Mage::getSingleton('core/date')->gmtDate('Y-m-d');\n $path = $this->getSitemapPath();\n $fullPath = preg_replace('/(?<=[^:])\\/{2,}/', '/', $baseUrl.$path);\n\n foreach ($this->_filenamesForIndexSitemap as $item) {\n $xml = sprintf(\n '<sitemap><loc>%s</loc><lastmod>%s</lastmod></sitemap>',\n htmlspecialchars($fullPath . $item),\n $date\n );\n $io->streamWrite($xml);\n }\n $io->streamWrite('</sitemapindex>');\n $io->streamClose();\n }\n return $this;\n }",
"protected function createIndex() {\n $sitemapIndex = SitemapIndex::create();\n\n $files = scandir($this->sitemapsDir);\n\n foreach($files as $sitemap) {\n if ($sitemap === '.' || $sitemap === '..') {\n continue;\n }\n $sitemapIndex->add('/sitemaps/'.basename($sitemap));\n }\n\n $sitemapIndex->writeToFile($this->dtDir . DIRECTORY_SEPARATOR .\n 'sitemap.xml');\n }",
"public function action_generate_sitemap()\n\t{\n\t\tif (!Auth::instance()->logged_in()) exit();\n\n\t\t$this->auto_render = FALSE;\n\n\t\t$main_file = 'sitemap.xml';\n\t\t$location = 'sitemaps/';\n\t\t$current = 1;\n\t\t$ext = '.xml';\n\t\t$host = URL::base();\n\t\t$sitemap_index = array();\n\n\t\t//empty sitemap dir\n\t\tarray_map('unlink', glob($location.\"*\"));\n\n\t\t$begin = '<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd\">';\n\t\t$end = \"\\n</urlset>\";\n\n\n\t\t//////////////////// CATEGORIES ///////////////////////\n\t\t# /catalog/category\n\t\t$file = 'sitemap-catalog';\n\t\t$strings = 0;\n\t\t$categories = Model::factory('Category')->find_all()->as_array(NULL, 'slug');\n\n\t\tfile_put_contents($location.$file.$current.$ext, $begin);\n\t\t$sitemap_index [] = $location . $file . $current . $ext;\n\t\tforeach ($categories AS $one => $category) {\n\t\t\t$xml = \"\\n<url><loc>\" . $host . \"katalog/\" . $category . \"</loc></url>\";\n\t\t\tfile_put_contents($location . $file . $current . $ext, $xml, FILE_APPEND);\n\t\t\t$strings++;\n\t\t\t//if 49999 string in file, create new\n\t\t\tif ($strings == 49999) {\n\t\t\t\t//write end\n\t\t\t\tfile_put_contents($location . $file . $current . $ext, $end, FILE_APPEND);\n\t\t\t\t//write to sitemap index\n\t\t\t\t$sitemap_index [] = $location . $file . $current . $ext;\n\t\t\t\t//get next file\n\t\t\t\t$current++;\n\t\t\t\t//write begin\n\t\t\t\tfile_put_contents($location . $file . $current . $ext, $begin, FILE_APPEND);\n\t\t\t\t//empty string\n\t\t\t\t$strings = 0;\n\t\t\t}\n\t\t}\n\n\t\t//write end\n\t\tif ($strings != 0) file_put_contents($location . $file . $current . $ext, $end, FILE_APPEND);\n\n\t\t//////////////////// MANUFACTURERS ///////////////////////\n\t\t# /catalog/manufacturer\n\t\t$file = 'sitemap-auto-brands';\n\t\t$strings = 0;\n\t\t$current = 1;\n\t\t$tecdoc = Model::factory('Tecdoc');\n\t\t$manufacturers = $tecdoc->get_manufacturers(false, false, false, true);\n\n\t\tfile_put_contents($location.$file.$current.$ext, $begin);\n\t\t$sitemap_index [] = $location . $file . $current . $ext;\n\t\tforeach ($manufacturers AS $one => $manufacturer) {\n\t\t\t$xml = \"\\n<url><loc>\" . $host . \"katalog/\" . $manufacturer['slug'] . \"</loc></url>\";\n\t\t\tfile_put_contents($location . $file . $current . $ext, $xml, FILE_APPEND);\n\t\t\t$strings++;\n\t\t\t//if 49999 string in file, create new\n\t\t\tif ($strings == 49999) {\n\t\t\t\t//write end\n\t\t\t\tfile_put_contents($location . $file . $current . $ext, $end, FILE_APPEND);\n\t\t\t\t//write to sitemap index\n\t\t\t\t$sitemap_index [] = $location . $file . $current . $ext;\n\t\t\t\t//get next file\n\t\t\t\t$current++;\n\t\t\t\t//write begin\n\t\t\t\tfile_put_contents($location . $file . $current . $ext, $begin, FILE_APPEND);\n\t\t\t\t//empty string\n\t\t\t\t$strings = 0;\n\t\t\t}\n\t\t}\n\n\t\t//write end\n\t\tif ($strings != 0) file_put_contents($location . $file . $current . $ext, $end, FILE_APPEND);\n\n\t\t//////////////////// MODELS ///////////////////////\n\t\t# //catalog/manufacturer/model\n\t\t$file = 'sitemap-auto-models';\n\t\t$strings = 0;\n\t\t$current = 1;\n\n\t\tfile_put_contents($location.$file.$current.$ext, $begin);\n\t\t$sitemap_index [] = $location . $file . $current . $ext;\n\t\tforeach ($manufacturers AS $key => $manufacturer) {\n\t\t\t$models = $tecdoc->get_cars(false, $manufacturer['id']);\n\t\t\tforeach ($models AS $k => $model) {\n\t\t\t\t$xml = \"\\n<url><loc>\" . $host . 'katalog/' . $manufacturer['slug'] . \"/\" . $model['slug'] . \"</loc></url>\";\n\t\t\t\tfile_put_contents($location.$file.$current.$ext, $xml, FILE_APPEND);\n\t\t\t\t$strings ++;\n\t\t\t\t//if 49999 string in file, create new\n\t\t\t\tif ($strings == 49999){\n\t\t\t\t\t//write end\n\t\t\t\t\tfile_put_contents($location.$file.$current.$ext, $end, FILE_APPEND);\n\t\t\t\t\t//write to sitemap index\n\t\t\t\t\t$sitemap_index [] = $location . $file . $current . $ext;\n\t\t\t\t\t//get next file\n\t\t\t\t\t$current++;\n\t\t\t\t\t//write begin\n\t\t\t\t\tfile_put_contents($location.$file.$current.$ext, $begin, FILE_APPEND);\n\t\t\t\t\t//empty string\n\t\t\t\t\t$strings = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//write end\n\t\tif ($strings != 0) file_put_contents($location . $file . $current . $ext, $end, FILE_APPEND);\n\n\t\t///////////////////// ARTICLES ///////////////////////\n\t\t$file = 'sitemap-products';\n\t\t$strings = 0;\n\t\t$current = 1;\n\n\t\t# /catalog/article/\n\t\tfile_put_contents($location.$file.$current.$ext, $begin);\n\t\t$sitemap_index [] = $location . $file . $current . $ext;\n\t\t$articles_count = Model::factory('Part')->count_all();\n\t\tfor ($i = 0; $i < $articles_count; $i += 5000) {\n\t\t\t$articles = Model::factory('Part')->limit(5000)->offset($i)->find_all()->as_array();\n\t \tforeach ($articles AS $value) {\n// foreach ($articles AS $key => $article) {\n\n if ($value->tecdoc_id){\n $tecdoc = ORM::factory('Tecdoc');\n $part_tecdoc = $tecdoc->get_part($value->tecdoc_id);\n $url = Htmlparser::transliterate($part_tecdoc['brand'] . \"-\" . $part_tecdoc['article_nr'] . \"-\" . substr($part_tecdoc['description'], 0, 50)) . \"-\" .$value->id;\n }\n else{\n $url = Htmlparser::transliterate($value->brand . \"-\" . $value->article_long . \"-\" . substr($value->name, 0, 50)) . \"-\" . $value->id;\n }\n\n $xml = \"\\n<url><loc>\" . $host . 'katalog/produkt/' . $url . \"</loc></url>\";\n// $xml = \"\\n<url><loc>\" . $host . 'catalog/product/' . $article . \"</loc></url>\";\n\n\t\t\t\tfile_put_contents($location . $file . $current . $ext, $xml, FILE_APPEND);\n\t\t\t\t$strings++;\n\t\t\t\t//if 49999 string in file, create new\n\t\t\t\tif ($strings == 49999) {\n\t\t\t\t\t//write end\n\t\t\t\t\tfile_put_contents($location . $file . $current . $ext, $end, FILE_APPEND);\n\t\t\t\t\t//write to sitemap index\n\t\t\t\t\t$sitemap_index [] = $location . $file . $current . $ext;\n\t\t\t\t\t//get next file\n\t\t\t\t\t$current++;\n\t\t\t\t\t//write begin\n\t\t\t\t\tfile_put_contents($location . $file . $current . $ext, $begin, FILE_APPEND);\n\t\t\t\t\t//empty string\n\t\t\t\t\t$strings = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//write end\n\t\tif ($strings != 0) file_put_contents($location . $file . $current . $ext, $end, FILE_APPEND);\n\n\n\t\t///////////////////// PAGES ///////////////////////\n\t\t$file = 'sitemap_info';\n\t\t$strings = 0;\n\t\t$current = 1;\n\n\t\t# /catalog/article/\n\t\t$pages = Model::factory('Page')->where('active', '=', 1)->find_all()->as_array(NULL, 'syn');\n\n\t\tfile_put_contents($location.$file.$current.$ext, $begin);\n\t\t$sitemap_index [] = $location . $file . $current . $ext;\n\t\tforeach ($pages AS $one => $page) {\n\t\t\t$xml = \"\\n<url><loc>\" . $host . \"\" . $page . \"</loc></url>\";\n\t\t\tfile_put_contents($location . $file . $current . $ext, $xml, FILE_APPEND);\n\t\t\t$strings++;\n\t\t\t//if 49999 string in file, create new\n\t\t\tif ($strings == 49999) {\n\t\t\t\t//write end\n\t\t\t\tfile_put_contents($location . $file . $current . $ext, $end, FILE_APPEND);\n\t\t\t\t//write to sitemap index\n\t\t\t\t$sitemap_index [] = $location . $file . $current . $ext;\n\t\t\t\t//get next file\n\t\t\t\t$current++;\n\t\t\t\t//write begin\n\t\t\t\tfile_put_contents($location . $file . $current . $ext, $begin, FILE_APPEND);\n\t\t\t\t//empty string\n\t\t\t\t$strings = 0;\n\t\t\t}\n\t\t}\n\n\t\t//write end\n\t\tif ($strings != 0) file_put_contents($location . $file . $current . $ext, $end, FILE_APPEND);\n\n\t\t$xml = '<sitemapindex xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd\">';\n\t\tfile_put_contents($main_file, $xml);\n\t\tforeach ($sitemap_index AS $index) {\n\t\t\t$xml = \"\\n<sitemap><loc>\" . $host . $index . \"</loc></sitemap>\";\n\t\t\tfile_put_contents($main_file, $xml, FILE_APPEND);\n\t\t}\n\t\t$xml = \"\\n</sitemapindex>\";\n\t\tfile_put_contents($main_file, $xml, FILE_APPEND);\n\t}",
"protected function _createIndexSitemap()\n {\n $sitemaps = Db::getInstance()->ExecuteS('SELECT `link` FROM `'._DB_PREFIX_.'sitemap_sitemap` WHERE id_shop = '.$this->context->shop->id);\n if (!$sitemaps) {\n return false;\n }\n\n $xml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?><sitemapindex xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"></sitemapindex>';\n try {\n $xmlFeed = new SimpleXMLElement($xml);\n\n foreach ($sitemaps as $link) {\n $sitemap = $xmlFeed->addChild('sitemap');\n $sitemap->addChild('loc', 'http' . (Configuration::get('PS_SSL_ENABLED') ? 's' : '') . '://' . Tools::getShopDomain(false, true) . __PS_BASE_URI__ . $link['link']);\n $sitemap->addChild('lastmod', date('c'));\n }\n file_put_contents($this->normalizeDirectory(_PS_ROOT_DIR_) . $this->context->shop->id . '_index_sitemap.xml', $xmlFeed->asXML());\n return true;\n } catch (Exception $e) {\n Logger::addLog(\"sitemap: Failed to create index sitemap: \" . $e);\n return false;\n }\n\n }",
"function genSitemapIndex()\n {\n $app = \\Slim\\Slim::getInstance();\n $sitemap = new \\SitemapPHP\\Sitemap($app->request->getUrl() . $app->request->getRootUri());\n $sitemap->setPath(realpath('cache/sitemap') . '/');\n $sitemap->addItem('/', '1.0', 'daily', 'Today');\n $pages = \\ORM::for_table('page')->order_by_desc('id')->find_array();\n foreach ($pages as $page) {\n $sitemap->addItem('/' . $page['alias'], '0.8', 'monthly', null);\n }\n $limit = 100;\n $offset = 0;\n do {\n $items = \\ORM::for_table('item')->limit($limit)->offset($offset)->order_by_desc('id')->find_array();\n foreach ($items as $item) {\n $sitemap->addItem('/item/' . $item['slug'] . '/' . $item['id'], '0.6', 'weekly', null);\n }\n $offset = $offset + $limit;\n } while (count($items) == $limit);\n $sitemap->createSitemapIndex($app->request->getUrl() . '/sitemap/', 'Today');\n }",
"function drush_simple_sitemap_generate() {\n \\Drupal::service('simple_sitemap.generator')->generateSitemap('drush');\n}",
"function wb_create_sitemap_table($con)\n{\n\t$query = 'CREATE TABLE IF NOT EXISTS sitemap\n\t(\n\t\tpage_id INT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE,\n\t\tPRIMARY KEY(page_id),\n\t\tparent_id INT UNSIGNED,\n\t\tactive BOOL NOT NULL DEFAULT 1,\n\t\ttitle VARCHAR(100)\n\t) ENGINE=InnoDB';\n\t\n\twb_query($query, $con);\n}",
"public function make_sitemap(): void {\n $results = SQL::current()->select(\n \"posts\",\n \"id\",\n array(\"status\" => \"public\"),\n array(\"id DESC\")\n )->fetchAll();\n\n $ids = array();\n\n foreach ($results as $result)\n $ids[] = $result[\"id\"];\n\n if (!empty($ids))\n $posts = Post::find(\n array(\"where\" => array(\"id\" => $ids))\n );\n else\n $posts = array();\n\n $pages = Page::find(\n array(\n \"where\" => array(\"public\" => true),\n \"order\" => \"list_order ASC\"\n )\n );\n\n $config = Config::current();\n $settings = $config->module_sitemap;\n\n $xml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'.\"\\n\";\n $xml.= '<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">'.\"\\n\";\n\n $xml.= '<url>'.\"\\n\".\n '<loc>'.\n fix($config->url).\n '/</loc>'.\"\\n\".\n '<lastmod>'.\n when(\"c\", time()).\n '</lastmod>'.\"\\n\".\n '<changefreq>'.\n $settings[\"blog_changefreq\"].\n '</changefreq>'.\"\\n\".\n '</url>'.\"\\n\";\n\n foreach ($posts as $post) {\n $lastmod = ($post->updated) ?\n $post->updated_at : $post->created_at ;\n\n $xml.= '<url>'.\"\\n\".\n '<loc>'.\n $post->url().\n '</loc>'.\"\\n\".\n '<lastmod>'.\n when(\"c\", $lastmod).\n '</lastmod>'.\"\\n\".\n '<changefreq>'.\n $settings[\"posts_changefreq\"].\n '</changefreq>'.\"\\n\".\n '<priority>'.\n (($post->pinned) ? \"1.0\" : \"0.5\").\n '</priority>'.\"\\n\".\n '</url>'.\"\\n\";\n }\n\n foreach ($pages as $page) {\n $lastmod = ($page->updated) ?\n $page->updated_at : $page->created_at ;\n\n $xml.= '<url>'.\"\\n\".\n '<loc>'.\n $page->url().\n '</loc>'.\"\\n\".\n '<lastmod>'.\n when(\"c\", $lastmod).\n '</lastmod>'.\"\\n\".\n '<changefreq>'.\n $settings[\"pages_changefreq\"].\n '</changefreq>'.\"\\n\".\n '<priority>'.\n (($page->show_in_list) ? \"1.0\" : \"0.5\").\n '</priority>'.\"\\n\".\n '</url>'.\"\\n\";\n }\n\n $xml.= '</urlset>'.\"\\n\";\n\n $filepath = $settings[\"sitemap_path\"].DIR.\"sitemap.xml\";\n $success = file_put_contents($filepath, $xml);\n\n if (DEBUG and $success !== false)\n error_log(\"SITEMAP updated \".$filepath);\n }",
"public function generate_sitemap() {\n\n\t\t$this->prepare_generation();\n\n\t\t$sitemap = $this->build_sitemap();\n\n\t\t$this->shutdown_generation();\n\n\t\treturn $sitemap;\n\t}",
"function generateSitemapXML(){\n\t\t\n\t\t$this->load->helper('custom_xml');\n\t\t\n\t\t$aData = $this->getLinks();\n\t\t\n\t\t$sXmlContent = '<?xml version=\"1.0\" encoding=\"UTF-8\"?><urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">';\n\t\t\n\t\t\n\t\t$aChangeFrequencies = array_flip($this->aChangeFrequencies);\n\t\t\n\t\t$fp = fopen(c('base_path').'sitemap.xml', 'w');\n\t\t$aDummy = array('url' => array());\n\t\t\n\t\tforeach($aData AS $oItem) {\n\n\t\t\t\n\t\t\t$aDummy['url']['loc'] \t\t\t= $oItem->url;\n\t\t\t$aDummy['url']['lastmod'] \t\t= date('Y-m-d', strtotime($oItem->last_modified_on));\n\t\t\t$aDummy['url']['changefreq'] \t= $aChangeFrequencies[$oItem->change_frequency];\n\t\t\t$aDummy['url']['priority'] \t\t= $oItem->priority;\n\t\t\t\n\t\t\t$sXmlContent .= array2XML($aDummy);\n\n\t\t}\n\t\t\n\t\t$sXmlContent .= '</urlset>';\n\t\t\n\t\tfwrite($fp, $sXmlContent);\n\t\tfclose($fp);\n\t}",
"public function build_local_sitemap() {\n\t\t\t$base = $GLOBALS['wp_rewrite']->using_index_permalinks() ? 'index.php/' : '';\n\n\t\t\t// Build entry for Geo Sitemap\n\t\t\t$output = '<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:geo=\"http://www.google.com/geo/schemas/sitemap/1.0\">\n\t\t\t\t<url>\n\t\t\t\t\t<loc>' . home_url( $base . 'locations.kml' ) . '</loc>\n\t\t\t\t\t<lastmod>' . date( 'c' ) . '</lastmod>\n\t\t\t\t\t<priority>1</priority>\n\t\t\t\t</url>\n\t\t\t</urlset>';\n\n\t\t\tif ( isset( $GLOBALS['wpseo_sitemaps'] ) ) {\n\t\t\t\t$GLOBALS['wpseo_sitemaps']->set_sitemap( $output );\n\t\t\t\t$GLOBALS['wpseo_sitemaps']->set_stylesheet( '<?xml-stylesheet type=\"text/xsl\" href=\"' . dirname( plugin_dir_url( __FILE__ ) ) . '/styles/geo-sitemap.xsl\"?>' );\n\t\t\t}\n\t\t}",
"public function action_sitemap()\n\t{\n\t\t// build query for everything that's not a link (external links all [should] have :// in them)\n\t\t$pages = Jelly::select('kohanut_page', NULL)->where('URL', 'NOT LIKE', '%://%')->execute();\n\t\n\t\t// set response variable with initial sitemap data.\n\t\t$response = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\n\t\t$response .= '<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">';\n\t\t\n\t\t// iterate through each page and add to sitemap\n\t\tforeach($pages as $page)\n\t\t{\n\t\t\t/**\n\t\t\t * @todo maybe have a sitemap flag in the database? could exclude error pages etc. then?\n\t\t\t * @todo check for HTTPS etc.. it's a tad hacked \n\t\t\t */\n\t\t\t$lastmod = date(DateTime::W3C, $page->edited);\n\t\t\t$response .= '<url>' . PHP_EOL;\n\t\t\t$response .= ' <loc>';\n\t\t\t$response .= 'http://' . $_SERVER['HTTP_HOST'] . '/' . $page->url;\n\t\t\t$response .= '</loc>' . PHP_EOL;\n\t\t\t$response .= ' <lastmod>' . $lastmod . '</lastmod>' . PHP_EOL;\n\t\t\t$response .= '</url>' . PHP_EOL;\n\t\t}\n\t\t$response .= \"</urlset>\";\n\t\t\n\t\t// set header content type as xml, or it will render as html.\n\t\t$this->request->headers = array(\"Content-Type\" => \"text/xml\");\n\t\t\n\t\t// echo it out\n\t\t$this->request->response = $response;\n\t}",
"public function getDomSitemap()\n {\n $dom = new DOMDocument('1.0', 'UTF-8');\n $dom->formatOutput = $this->getFormatOutput();\n\n $index = $dom->createElementNS(self::SITEMAP_NS, 'sitemapindex');\n $dom->appendChild($index);\n\n foreach ($this->urls as $data) {\n if (!$url = $this->url($data['url'])) {\n continue;\n }\n $sitemapNode = $dom->createElementNS(self::SITEMAP_NS, 'sitemap');\n $index->appendChild($sitemapNode);\n $sitemapNode->appendChild($dom->createElementNS(self::SITEMAP_NS, 'loc', $url));\n if (isset($data['lastmod'])) {\n // Currently lastmod is expected to be a valid date time string\n $sitemapNode->appendChild($dom->createElementNS(self::SITEMAP_NS, 'lastmod', $data['lastmod']));\n }\n }\n\n // Maybe validate schema just like in \\Zend\\View\\Helper\\Navigation\\Sitemap\n\n return $dom;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes the collUsoBateriasMontacargass collection. By default this just sets the collUsoBateriasMontacargass collection to an empty array (like clearcollUsoBateriasMontacargass()); however, you may wish to override this method in your stub class to provide setting appropriate to your application for example, setting the initial array to the values stored in database. | public function initUsoBateriasMontacargass($overrideExisting = true)
{
if (null !== $this->collUsoBateriasMontacargass && !$overrideExisting) {
return;
}
$this->collUsoBateriasMontacargass = new PropelObjectCollection();
$this->collUsoBateriasMontacargass->setModel('UsoBateriasMontacargas');
} | [
"public function getUsoBateriasMontacargass($criteria = null, PropelPDO $con = null)\n {\n $partial = $this->collUsoBateriasMontacargassPartial && !$this->isNew();\n if (null === $this->collUsoBateriasMontacargass || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collUsoBateriasMontacargass) {\n // return empty collection\n $this->initUsoBateriasMontacargass();\n } else {\n $collUsoBateriasMontacargass = UsoBateriasMontacargasQuery::create(null, $criteria)\n ->filterByBaterias($this)\n ->find($con);\n if (null !== $criteria) {\n if (false !== $this->collUsoBateriasMontacargassPartial && count($collUsoBateriasMontacargass)) {\n $this->initUsoBateriasMontacargass(false);\n\n foreach ($collUsoBateriasMontacargass as $obj) {\n if (false == $this->collUsoBateriasMontacargass->contains($obj)) {\n $this->collUsoBateriasMontacargass->append($obj);\n }\n }\n\n $this->collUsoBateriasMontacargassPartial = true;\n }\n\n $collUsoBateriasMontacargass->getInternalIterator()->rewind();\n\n return $collUsoBateriasMontacargass;\n }\n\n if ($partial && $this->collUsoBateriasMontacargass) {\n foreach ($this->collUsoBateriasMontacargass as $obj) {\n if ($obj->isNew()) {\n $collUsoBateriasMontacargass[] = $obj;\n }\n }\n }\n\n $this->collUsoBateriasMontacargass = $collUsoBateriasMontacargass;\n $this->collUsoBateriasMontacargassPartial = false;\n }\n }\n\n return $this->collUsoBateriasMontacargass;\n }",
"public function initCuentaCorrientes()\n\t{\n\t\t$this->collCuentaCorrientes = array();\n\t}",
"public function initNotaPedidoEstados()\n\t{\n\t\t$this->collNotaPedidoEstados = array();\n\t}",
"public function initTutors()\n\t{\n\t\t$this->collTutors = array();\n\t}",
"public function initTbofertacoordenadors()\n\t{\n\t\t$this->collTbofertacoordenadors = array();\n\t}",
"public function initCompraEstados()\n\t{\n\t\t$this->collCompraEstados = array();\n\t}",
"public function initmfFormularioUtilizadors()\n\t{\n\t\t$this->collmfFormularioUtilizadors = new PropelObjectCollection();\n\t\t$this->collmfFormularioUtilizadors->setModel('mfFormularioUtilizador');\n\t}",
"public function initTbofertahorarios()\n\t{\n\t\t$this->collTbofertahorarios = array();\n\t}",
"public function initUsuarios()\n\t{\n\t\t$this->collUsuarios = new PropelObjectCollection();\n\t\t$this->collUsuarios->setModel('Usuario');\n\t}",
"public function initNoticias()\n\t{\n\t\t$this->collNoticias = new PropelObjectCollection();\n\t\t$this->collNoticias->setModel('Noticia');\n\t}",
"public function initTbofertas()\n\t{\n\t\t$this->collTbofertas = array();\n\t}",
"public function initUserRidess()\n\t{\n\t\t$this->collUserRidess = array();\n\t}",
"private function _init() {\r\n\t\t\r\n\t\t// Cargas categorías y montos\r\n\t\t$categorias = $this->categoria_model->getAll();\r\n\t\t\r\n\t\t$montos = $this->monto_model->getAll();\r\n\t\t$palabras = array(\r\n\t\t\t\t\t\t\"5000\" =>\"cinco\",\r\n\t\t\t\t\t\t\"10000\" => \"diez\",\r\n\t\t\t\t\t\t\"20000\" => \"veinte\"\r\n\t\t\t\t\t);\r\n\t\tforeach($montos as $monto) {\r\n\t\t\t$monto->valor_format = \"$\".number_format($monto->valor,0,\",\",\".\");\r\n\t\t\t$monto->valor_str = $palabras[(string)$monto->valor];\r\n\t\t}\r\n\r\n\t\t$this->data[\"categorias\"] = $categorias;\r\n\t\t$this->data[\"montos\"] = $montos;\r\n\t}",
"public function setUsuarioMaterias(PropelCollection $usuarioMaterias, PropelPDO $con = null)\n {\n $this->usuarioMateriasScheduledForDeletion = $this->getUsuarioMaterias(new Criteria(), $con)->diff($usuarioMaterias);\n\n foreach ($this->usuarioMateriasScheduledForDeletion as $usuarioMateriaRemoved) {\n $usuarioMateriaRemoved->setUsuario(null);\n }\n\n $this->collUsuarioMaterias = null;\n foreach ($usuarioMaterias as $usuarioMateria) {\n $this->addUsuarioMateria($usuarioMateria);\n }\n\n $this->collUsuarioMaterias = $usuarioMaterias;\n $this->collUsuarioMateriasPartial = false;\n }",
"public function initMagasins()\n\t{\n\t\t$this->collMagasins = array();\n\t}",
"public function initUserEquipements()\n\t{\n\t\t$this->collUserEquipements = array();\n\t}",
"public function RegresaMontos(){\r\n\t\t$montos = array();\r\n $Conexion = conectar_bd();\r\n $Conexion->conectarse();\r\n\r\n $list_montos = $Conexion->ejecutar(\"SELECT sum(programabeneficiario.monto)as monto from dependencia\r\n\t\t\tleft JOIN programa on dependencia.id_dependencia = programa.dependencia_id_dependencia\r\n\t\t\tLEFT join programabeneficiario on programabeneficiario.id_programa = programa.id_programa\r\n\t\t\tgroup BY id_dependencia;\");\r\n \r\n while ($renglon = mysql_fetch_array($list_montos)){\r\n\t\t\t\r\n array_push($montos, ($renglon['monto']!=null)?intval($renglon['monto']):0);\r\n\t\t\t\r\n\t\t\t\r\n }\r\n\t\t\r\n $Conexion->desconectarse();\r\n return $montos;\r\n\t}",
"public function initMms()\n\t{\n\t\tif ($this->collMms === null) {\n\t\t\t$this->collMms = array();\n\t\t}\n\t}",
"public function otorgarPrestamo(){\n $fecha = date('d-m-y');\n $this->setFechaOtorgado($fecha);\n $cantidadCuotas = $this->getCantidadCuotas();\n $monto = $this->getMonto();\n $colObjCuota = array();\n for($i=0; $i<$cantidadCuotas; $i++){\n $montoCuota = $monto / $cantidadCuotas;\n $montoInteres = $this->calcularInteresPrestamo($i);\n $colObjCuota[$i] = new Cuota($i, $montoCuota, $montoInteres);\n }\n $this->setColObjCuota($colObjCuota);\n }",
"public function initPlateau() {\n\t\t\tfor ($i = 0; $i < $this->taille; $i++) { // parcours des y\n\t\t\t\tfor ($j=0; $j < $this->taille; $j++) { // parcours des x\n\t\t\t\t\tif(($i == 0) || (($i == 1) && (($j==0) || ($j==4)))) { //sur les 7 cases de départ du haut du plateau (joueur1)\n\t\t\t\t\t\t$this->matrice[$i][$j] = new Cellule($j,$i, new Pion($this->joueur1));\n\t\t\t\t\t} else if (($i == 4) || (($i == 3) && (($j==0) || ($j==4)))) { // sur les 7 cases de départ du bas du plateau (joueur2)\n\t\t\t\t\t\t$this->matrice[$i][$j] = new Cellule($j,$i, new Pion($this->joueur2));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->matrice[$i][$j] = new Cellule($j,$i,null);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create an array merging the config array with passed data. | private function mergeData(array $data)
{
return array_merge($this->adsConfig,$data);
} | [
"public function prepareConfigData(): array\n {\n $filePath = $this->config::CONFIG_FILE;\n $data = $this->readFile($filePath);\n $format = $this->config->getConfigWriteFormat();\n $name = $this->config::CONFIG_NAME;\n return $this->makeWriteDataArray($format, $data, $name);\n }",
"protected function _appendWithMerge(array $data) {\n unset($data['merge_config']);\n\n $config = app('config');\n $flatArray = $this->_doubleLeveledArray($data);\n\n foreach($flatArray as $k => $v) {\n $existingElement = $config->get($k);\n if(!$existingElement) {\n $config->set($k, $v);\n } else {\n if(!is_array($existingElement)) {\n $existingElement = [$existingElement];\n }\n\n if(!is_array($v)) {\n $existingElement[] = $v;\n } else {\n $existingElement = array_merge($existingElement, $v);\n }\n\n $config->set($k, $existingElement);\n }\n }\n }",
"public static function mergeConfig()\n {\n if (func_num_args() < 2) {\n trigger_error(__METHOD__ . ' needs two or more array arguments', E_USER_WARNING);\n return false;\n }\n\n $arrays = func_get_args();\n $merged = array();\n\n while ($arrays) {\n $array = array_shift($arrays);\n if (!is_array($array)) {\n trigger_error(__METHOD__ . ' encountered a non array argument', E_USER_WARNING);\n return false;\n }\n foreach ($array as $key => $value) {\n //if (is_string($key)) {\n if (is_array($value) && array_key_exists($key, $merged) && is_array($merged[$key])) {\n $merged[$key] = call_user_func(__METHOD__, $merged[$key], $value);\n } else {\n $merged[$key] = $value;\n }\n //} else {\n // $merged[] = $value;\n //}\n }\n }\n return $merged;\n }",
"public function build()\n {\n return array_merge($this->config, [\n 'fields' => $this->buildFields(),\n 'location' => $this->buildLocation(),\n 'key' => $this->namespaceGroupKey($this->config['key']),\n ]);\n }",
"protected function asConfigArray()\n {\n return [\n 'class' => static::class,\n 'queue' => null, // queue is not needed when invoked as a [[RefreshJob]]\n 'defaultContext' => $this->defaultContext->asConfigArray(),\n 'refreshAhead' => $this->refreshAhead instanceof ReferenceProvider ? $this->refreshAhead->asConfigArray() : $this->refreshAhead,\n 'generateValue' => $this->generateValue instanceof ReferenceProvider ? $this->generateValue->asConfigArray() : $this->generateValue,\n ];\n }",
"public function getConfigArray() {}",
"function merge_config() {\n $stack = func_get_args();\n $merged = [];\n while (($array = array_shift($stack))) {\n $merged = ArrayMerger::doMerge($merged, $array);\n }\n\n return $merged;\n}",
"public function prependConfigArray()\n {\n return [];\n }",
"function toArrayConfig()\n\t{\n\t\treturn new Ergo_Config_ArrayConfig($this->_data);\n\t}",
"public function merge(array $config)\n {\n $this->data = array_replace_recursive($this->get(), $config);\n }",
"public function mergeConfig()\n {\n $configs = func_get_args();\n $arrays = array_map(function (Config $cfg) {\n return $cfg->getAll();\n }, $configs);\n return new Config(call_user_func_array([$this, 'mergeArrays'], $arrays));\n }",
"protected function _createConfig($data = [])\n {\n return $this->_getConfigFactory()->make([\n ConfigFactoryInterface::K_DATA => $data,\n ]);\n }",
"public function asArray()\n {\n return $this->doConfig();\n }",
"function mergeData() {\n for ($x = 0; $x < sizeof($this->name); $x++) {\n array_push($this->data, array(\n \"name\" => $this->name[$x],\n \"lat\" => $this->lat[$x],\n \"long\" => $this->long[$x],\n \"address\" => $this->address[$x],\n ));\n }\n }",
"public function mergeDataProvider() {\n return [\n [\n // Data.\n ['a' => 1, 'b' => 2, 'c' => ['d' => 3]],\n // Data to merge.\n ['a' => 2, 'e' => 4, 'c' => ['f' => 5]],\n // Data merged.\n ['a' => 2, 'b' => 2, 'c' => ['d' => 3, 'f' => 5], 'e' => 4],\n ],\n ];\n }",
"public function create(array $data): Configuration;",
"public function getArray() {\n\n // Prepare some variables\n $lead_array = (!is_null($this->lead)) ? $this->lead->getArray() : [];\n $contact_array = (!is_null($this->contact)) ? $this->contact->getArray() : [];\n\n $result = [\n 'source' => $this->source,\n 'source_uid' => $this->source_uid,\n 'data' => [\n 'leads' => [$lead_array],\n 'contacts' => [$contact_array],\n 'companies' => [],\n ],\n 'source_data' => $this->getSourceData(),\n ];\n return $result;\n }",
"protected function initConfigData()\n\t{\n\t\treturn $this->config_data = $this->getConfig();\n\t}",
"public function setArraysToConfig()\n {\n foreach($this as $name => $value) {\n if (is_array($value) && $this->isArrayHasIndex($value)) {\n $this->$name = new Config();\n $this->$name->setStrictOnlyKeys(false); // allow arbitrary keys\n $this->$name->setData($value);\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the entity attributes. | public function getEntityAttributes()
{
return static::$entityAttributes;
} | [
"protected abstract function getEntityAttributes($entity);",
"function getAttributes() {}",
"public function getRestrictedEntityAttributes()\n {\n return $this->aEntityRestrictedAttributes;\n }",
"protected function _getAttributes()\n {\n if (is_null($this->_attributes)) {\n $eavConfig = Mage::getSingleton('eav/config');\n $attributes = $this->helper('fileattributes')->getFileAttributesCollection();\n \n foreach ($attributes as $attribute) {\n $type = $eavConfig->getEntityType($attribute->getEntityTypeId());\n $label = $this->__('%s (%s)', $attribute->getFrontendLabel(), $type->getEntityTypeCode());\n $this->_attributes[$attribute->getId()] = $label;\n }\n }\n return $this->_attributes;\n }",
"public function attributes()\n {\n return $this->hasManyThrough(Attribute::class, EntityAttribute::class, 'attribute_group_id', 'attribute_id');\n }",
"public function getAttributes()\n {\n return $this->item->getAttributes();\n }",
"public function getAttributes()\n {\n return $this->getValueJSONDecoded('nb_site_user_attributes');\n }",
"public function getDefaultAttributes() {\n return App::_()->IoC->EntityMeta->get_entity_type_properties($this->_entity_type);\n }",
"public function getUserAttributes();",
"public function getMetaAttributesAttribute()\n {\n return $this->getMetaAttributes();\n }",
"public function getEventAttributes()\n {\n return $this->event_attributes;\n }",
"public function getEntityAttributeAction();",
"public static function get_all_attributes() \n {\n return Attribute::select('id', 'name')->get();\n }",
"public function getAttributesProperty()\n {\n return Attribute::whereAttributeType(Customer::class)->get();\n }",
"public function getCustomEntityProductAttributes(): array\n {\n return $this->customEntityProductAttributes;\n }",
"public function attributes()\n {\n return $this->jsonSerialize();\n }",
"public function getAttributes() {\n return $this->getSamlAuth()->getAttributes();\n }",
"public function getParcelAttributes()\n {\n return $this->getData(self::PARCEL_ATTRIBUTES);\n }",
"protected function fetchAttributes()\n {\n return $this->getDatabaseConnection()->exec_SELECTquery(\n '*',\n 'tx_commerce_attributes',\n 'pid = ' . (int) $this->attributePid .\n ' AND hidden = 0 AND deleted = 0 and (sys_language_uid = 0 OR sys_language_uid = -1)',\n '',\n 'internal_title, title'\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |